[ Index ] |
PHP Cross Reference of WordPress |
[Summary view] [Print] [Text view]
1 this["wp"] = this["wp"] || {}; this["wp"]["editor"] = 2 /******/ (function(modules) { // webpackBootstrap 3 /******/ // The module cache 4 /******/ var installedModules = {}; 5 /******/ 6 /******/ // The require function 7 /******/ function __webpack_require__(moduleId) { 8 /******/ 9 /******/ // Check if module is in cache 10 /******/ if(installedModules[moduleId]) { 11 /******/ return installedModules[moduleId].exports; 12 /******/ } 13 /******/ // Create a new module (and put it into the cache) 14 /******/ var module = installedModules[moduleId] = { 15 /******/ i: moduleId, 16 /******/ l: false, 17 /******/ exports: {} 18 /******/ }; 19 /******/ 20 /******/ // Execute the module function 21 /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); 22 /******/ 23 /******/ // Flag the module as loaded 24 /******/ module.l = true; 25 /******/ 26 /******/ // Return the exports of the module 27 /******/ return module.exports; 28 /******/ } 29 /******/ 30 /******/ 31 /******/ // expose the modules object (__webpack_modules__) 32 /******/ __webpack_require__.m = modules; 33 /******/ 34 /******/ // expose the module cache 35 /******/ __webpack_require__.c = installedModules; 36 /******/ 37 /******/ // define getter function for harmony exports 38 /******/ __webpack_require__.d = function(exports, name, getter) { 39 /******/ if(!__webpack_require__.o(exports, name)) { 40 /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); 41 /******/ } 42 /******/ }; 43 /******/ 44 /******/ // define __esModule on exports 45 /******/ __webpack_require__.r = function(exports) { 46 /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { 47 /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); 48 /******/ } 49 /******/ Object.defineProperty(exports, '__esModule', { value: true }); 50 /******/ }; 51 /******/ 52 /******/ // create a fake namespace object 53 /******/ // mode & 1: value is a module id, require it 54 /******/ // mode & 2: merge all properties of value into the ns 55 /******/ // mode & 4: return value when already ns object 56 /******/ // mode & 8|1: behave like require 57 /******/ __webpack_require__.t = function(value, mode) { 58 /******/ if(mode & 1) value = __webpack_require__(value); 59 /******/ if(mode & 8) return value; 60 /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; 61 /******/ var ns = Object.create(null); 62 /******/ __webpack_require__.r(ns); 63 /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); 64 /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); 65 /******/ return ns; 66 /******/ }; 67 /******/ 68 /******/ // getDefaultExport function for compatibility with non-harmony modules 69 /******/ __webpack_require__.n = function(module) { 70 /******/ var getter = module && module.__esModule ? 71 /******/ function getDefault() { return module['default']; } : 72 /******/ function getModuleExports() { return module; }; 73 /******/ __webpack_require__.d(getter, 'a', getter); 74 /******/ return getter; 75 /******/ }; 76 /******/ 77 /******/ // Object.prototype.hasOwnProperty.call 78 /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; 79 /******/ 80 /******/ // __webpack_public_path__ 81 /******/ __webpack_require__.p = ""; 82 /******/ 83 /******/ 84 /******/ // Load entry module and return exports 85 /******/ return __webpack_require__(__webpack_require__.s = "./node_modules/@wordpress/editor/build-module/index.js"); 86 /******/ }) 87 /************************************************************************/ 88 /******/ ({ 89 90 /***/ "./node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js": 91 /*!*******************************************************************!*\ 92 !*** ./node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js ***! 93 \*******************************************************************/ 94 /*! exports provided: default */ 95 /***/ (function(module, __webpack_exports__, __webpack_require__) { 96 97 "use strict"; 98 __webpack_require__.r(__webpack_exports__); 99 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _arrayWithHoles; }); 100 function _arrayWithHoles(arr) { 101 if (Array.isArray(arr)) return arr; 102 } 103 104 /***/ }), 105 106 /***/ "./node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js": 107 /*!**********************************************************************!*\ 108 !*** ./node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js ***! 109 \**********************************************************************/ 110 /*! exports provided: default */ 111 /***/ (function(module, __webpack_exports__, __webpack_require__) { 112 113 "use strict"; 114 __webpack_require__.r(__webpack_exports__); 115 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _arrayWithoutHoles; }); 116 function _arrayWithoutHoles(arr) { 117 if (Array.isArray(arr)) { 118 for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { 119 arr2[i] = arr[i]; 120 } 121 122 return arr2; 123 } 124 } 125 126 /***/ }), 127 128 /***/ "./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js": 129 /*!**************************************************************************!*\ 130 !*** ./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js ***! 131 \**************************************************************************/ 132 /*! exports provided: default */ 133 /***/ (function(module, __webpack_exports__, __webpack_require__) { 134 135 "use strict"; 136 __webpack_require__.r(__webpack_exports__); 137 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _assertThisInitialized; }); 138 function _assertThisInitialized(self) { 139 if (self === void 0) { 140 throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); 141 } 142 143 return self; 144 } 145 146 /***/ }), 147 148 /***/ "./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js": 149 /*!*********************************************************************!*\ 150 !*** ./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js ***! 151 \*********************************************************************/ 152 /*! exports provided: default */ 153 /***/ (function(module, __webpack_exports__, __webpack_require__) { 154 155 "use strict"; 156 __webpack_require__.r(__webpack_exports__); 157 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _asyncToGenerator; }); 158 function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { 159 try { 160 var info = gen[key](arg); 161 var value = info.value; 162 } catch (error) { 163 reject(error); 164 return; 165 } 166 167 if (info.done) { 168 resolve(value); 169 } else { 170 Promise.resolve(value).then(_next, _throw); 171 } 172 } 173 174 function _asyncToGenerator(fn) { 175 return function () { 176 var self = this, 177 args = arguments; 178 return new Promise(function (resolve, reject) { 179 var gen = fn.apply(self, args); 180 181 function _next(value) { 182 asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); 183 } 184 185 function _throw(err) { 186 asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); 187 } 188 189 _next(undefined); 190 }); 191 }; 192 } 193 194 /***/ }), 195 196 /***/ "./node_modules/@babel/runtime/helpers/esm/classCallCheck.js": 197 /*!*******************************************************************!*\ 198 !*** ./node_modules/@babel/runtime/helpers/esm/classCallCheck.js ***! 199 \*******************************************************************/ 200 /*! exports provided: default */ 201 /***/ (function(module, __webpack_exports__, __webpack_require__) { 202 203 "use strict"; 204 __webpack_require__.r(__webpack_exports__); 205 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _classCallCheck; }); 206 function _classCallCheck(instance, Constructor) { 207 if (!(instance instanceof Constructor)) { 208 throw new TypeError("Cannot call a class as a function"); 209 } 210 } 211 212 /***/ }), 213 214 /***/ "./node_modules/@babel/runtime/helpers/esm/createClass.js": 215 /*!****************************************************************!*\ 216 !*** ./node_modules/@babel/runtime/helpers/esm/createClass.js ***! 217 \****************************************************************/ 218 /*! exports provided: default */ 219 /***/ (function(module, __webpack_exports__, __webpack_require__) { 220 221 "use strict"; 222 __webpack_require__.r(__webpack_exports__); 223 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _createClass; }); 224 function _defineProperties(target, props) { 225 for (var i = 0; i < props.length; i++) { 226 var descriptor = props[i]; 227 descriptor.enumerable = descriptor.enumerable || false; 228 descriptor.configurable = true; 229 if ("value" in descriptor) descriptor.writable = true; 230 Object.defineProperty(target, descriptor.key, descriptor); 231 } 232 } 233 234 function _createClass(Constructor, protoProps, staticProps) { 235 if (protoProps) _defineProperties(Constructor.prototype, protoProps); 236 if (staticProps) _defineProperties(Constructor, staticProps); 237 return Constructor; 238 } 239 240 /***/ }), 241 242 /***/ "./node_modules/@babel/runtime/helpers/esm/defineProperty.js": 243 /*!*******************************************************************!*\ 244 !*** ./node_modules/@babel/runtime/helpers/esm/defineProperty.js ***! 245 \*******************************************************************/ 246 /*! exports provided: default */ 247 /***/ (function(module, __webpack_exports__, __webpack_require__) { 248 249 "use strict"; 250 __webpack_require__.r(__webpack_exports__); 251 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _defineProperty; }); 252 function _defineProperty(obj, key, value) { 253 if (key in obj) { 254 Object.defineProperty(obj, key, { 255 value: value, 256 enumerable: true, 257 configurable: true, 258 writable: true 259 }); 260 } else { 261 obj[key] = value; 262 } 263 264 return obj; 265 } 266 267 /***/ }), 268 269 /***/ "./node_modules/@babel/runtime/helpers/esm/extends.js": 270 /*!************************************************************!*\ 271 !*** ./node_modules/@babel/runtime/helpers/esm/extends.js ***! 272 \************************************************************/ 273 /*! exports provided: default */ 274 /***/ (function(module, __webpack_exports__, __webpack_require__) { 275 276 "use strict"; 277 __webpack_require__.r(__webpack_exports__); 278 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _extends; }); 279 function _extends() { 280 _extends = Object.assign || function (target) { 281 for (var i = 1; i < arguments.length; i++) { 282 var source = arguments[i]; 283 284 for (var key in source) { 285 if (Object.prototype.hasOwnProperty.call(source, key)) { 286 target[key] = source[key]; 287 } 288 } 289 } 290 291 return target; 292 }; 293 294 return _extends.apply(this, arguments); 295 } 296 297 /***/ }), 298 299 /***/ "./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js": 300 /*!*******************************************************************!*\ 301 !*** ./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js ***! 302 \*******************************************************************/ 303 /*! exports provided: default */ 304 /***/ (function(module, __webpack_exports__, __webpack_require__) { 305 306 "use strict"; 307 __webpack_require__.r(__webpack_exports__); 308 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _getPrototypeOf; }); 309 function _getPrototypeOf(o) { 310 _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { 311 return o.__proto__ || Object.getPrototypeOf(o); 312 }; 313 return _getPrototypeOf(o); 314 } 315 316 /***/ }), 317 318 /***/ "./node_modules/@babel/runtime/helpers/esm/inherits.js": 319 /*!*************************************************************!*\ 320 !*** ./node_modules/@babel/runtime/helpers/esm/inherits.js ***! 321 \*************************************************************/ 322 /*! exports provided: default */ 323 /***/ (function(module, __webpack_exports__, __webpack_require__) { 324 325 "use strict"; 326 __webpack_require__.r(__webpack_exports__); 327 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _inherits; }); 328 /* harmony import */ var _setPrototypeOf__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./setPrototypeOf */ "./node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js"); 329 330 function _inherits(subClass, superClass) { 331 if (typeof superClass !== "function" && superClass !== null) { 332 throw new TypeError("Super expression must either be null or a function"); 333 } 334 335 subClass.prototype = Object.create(superClass && superClass.prototype, { 336 constructor: { 337 value: subClass, 338 writable: true, 339 configurable: true 340 } 341 }); 342 if (superClass) Object(_setPrototypeOf__WEBPACK_IMPORTED_MODULE_0__["default"])(subClass, superClass); 343 } 344 345 /***/ }), 346 347 /***/ "./node_modules/@babel/runtime/helpers/esm/iterableToArray.js": 348 /*!********************************************************************!*\ 349 !*** ./node_modules/@babel/runtime/helpers/esm/iterableToArray.js ***! 350 \********************************************************************/ 351 /*! exports provided: default */ 352 /***/ (function(module, __webpack_exports__, __webpack_require__) { 353 354 "use strict"; 355 __webpack_require__.r(__webpack_exports__); 356 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _iterableToArray; }); 357 function _iterableToArray(iter) { 358 if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); 359 } 360 361 /***/ }), 362 363 /***/ "./node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js": 364 /*!*************************************************************************!*\ 365 !*** ./node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js ***! 366 \*************************************************************************/ 367 /*! exports provided: default */ 368 /***/ (function(module, __webpack_exports__, __webpack_require__) { 369 370 "use strict"; 371 __webpack_require__.r(__webpack_exports__); 372 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _iterableToArrayLimit; }); 373 function _iterableToArrayLimit(arr, i) { 374 var _arr = []; 375 var _n = true; 376 var _d = false; 377 var _e = undefined; 378 379 try { 380 for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { 381 _arr.push(_s.value); 382 383 if (i && _arr.length === i) break; 384 } 385 } catch (err) { 386 _d = true; 387 _e = err; 388 } finally { 389 try { 390 if (!_n && _i["return"] != null) _i["return"](); 391 } finally { 392 if (_d) throw _e; 393 } 394 } 395 396 return _arr; 397 } 398 399 /***/ }), 400 401 /***/ "./node_modules/@babel/runtime/helpers/esm/nonIterableRest.js": 402 /*!********************************************************************!*\ 403 !*** ./node_modules/@babel/runtime/helpers/esm/nonIterableRest.js ***! 404 \********************************************************************/ 405 /*! exports provided: default */ 406 /***/ (function(module, __webpack_exports__, __webpack_require__) { 407 408 "use strict"; 409 __webpack_require__.r(__webpack_exports__); 410 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _nonIterableRest; }); 411 function _nonIterableRest() { 412 throw new TypeError("Invalid attempt to destructure non-iterable instance"); 413 } 414 415 /***/ }), 416 417 /***/ "./node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js": 418 /*!**********************************************************************!*\ 419 !*** ./node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js ***! 420 \**********************************************************************/ 421 /*! exports provided: default */ 422 /***/ (function(module, __webpack_exports__, __webpack_require__) { 423 424 "use strict"; 425 __webpack_require__.r(__webpack_exports__); 426 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _nonIterableSpread; }); 427 function _nonIterableSpread() { 428 throw new TypeError("Invalid attempt to spread non-iterable instance"); 429 } 430 431 /***/ }), 432 433 /***/ "./node_modules/@babel/runtime/helpers/esm/objectSpread.js": 434 /*!*****************************************************************!*\ 435 !*** ./node_modules/@babel/runtime/helpers/esm/objectSpread.js ***! 436 \*****************************************************************/ 437 /*! exports provided: default */ 438 /***/ (function(module, __webpack_exports__, __webpack_require__) { 439 440 "use strict"; 441 __webpack_require__.r(__webpack_exports__); 442 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _objectSpread; }); 443 /* harmony import */ var _defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./defineProperty */ "./node_modules/@babel/runtime/helpers/esm/defineProperty.js"); 444 445 function _objectSpread(target) { 446 for (var i = 1; i < arguments.length; i++) { 447 var source = arguments[i] != null ? arguments[i] : {}; 448 var ownKeys = Object.keys(source); 449 450 if (typeof Object.getOwnPropertySymbols === 'function') { 451 ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { 452 return Object.getOwnPropertyDescriptor(source, sym).enumerable; 453 })); 454 } 455 456 ownKeys.forEach(function (key) { 457 Object(_defineProperty__WEBPACK_IMPORTED_MODULE_0__["default"])(target, key, source[key]); 458 }); 459 } 460 461 return target; 462 } 463 464 /***/ }), 465 466 /***/ "./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js": 467 /*!****************************************************************************!*\ 468 !*** ./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js ***! 469 \****************************************************************************/ 470 /*! exports provided: default */ 471 /***/ (function(module, __webpack_exports__, __webpack_require__) { 472 473 "use strict"; 474 __webpack_require__.r(__webpack_exports__); 475 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _objectWithoutProperties; }); 476 /* harmony import */ var _objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./objectWithoutPropertiesLoose */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js"); 477 478 function _objectWithoutProperties(source, excluded) { 479 if (source == null) return {}; 480 var target = Object(_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_0__["default"])(source, excluded); 481 var key, i; 482 483 if (Object.getOwnPropertySymbols) { 484 var sourceSymbolKeys = Object.getOwnPropertySymbols(source); 485 486 for (i = 0; i < sourceSymbolKeys.length; i++) { 487 key = sourceSymbolKeys[i]; 488 if (excluded.indexOf(key) >= 0) continue; 489 if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; 490 target[key] = source[key]; 491 } 492 } 493 494 return target; 495 } 496 497 /***/ }), 498 499 /***/ "./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js": 500 /*!*********************************************************************************!*\ 501 !*** ./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js ***! 502 \*********************************************************************************/ 503 /*! exports provided: default */ 504 /***/ (function(module, __webpack_exports__, __webpack_require__) { 505 506 "use strict"; 507 __webpack_require__.r(__webpack_exports__); 508 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _objectWithoutPropertiesLoose; }); 509 function _objectWithoutPropertiesLoose(source, excluded) { 510 if (source == null) return {}; 511 var target = {}; 512 var sourceKeys = Object.keys(source); 513 var key, i; 514 515 for (i = 0; i < sourceKeys.length; i++) { 516 key = sourceKeys[i]; 517 if (excluded.indexOf(key) >= 0) continue; 518 target[key] = source[key]; 519 } 520 521 return target; 522 } 523 524 /***/ }), 525 526 /***/ "./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js": 527 /*!******************************************************************************!*\ 528 !*** ./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js ***! 529 \******************************************************************************/ 530 /*! exports provided: default */ 531 /***/ (function(module, __webpack_exports__, __webpack_require__) { 532 533 "use strict"; 534 __webpack_require__.r(__webpack_exports__); 535 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _possibleConstructorReturn; }); 536 /* harmony import */ var _helpers_esm_typeof__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../helpers/esm/typeof */ "./node_modules/@babel/runtime/helpers/esm/typeof.js"); 537 /* harmony import */ var _assertThisInitialized__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./assertThisInitialized */ "./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js"); 538 539 540 function _possibleConstructorReturn(self, call) { 541 if (call && (Object(_helpers_esm_typeof__WEBPACK_IMPORTED_MODULE_0__["default"])(call) === "object" || typeof call === "function")) { 542 return call; 543 } 544 545 return Object(_assertThisInitialized__WEBPACK_IMPORTED_MODULE_1__["default"])(self); 546 } 547 548 /***/ }), 549 550 /***/ "./node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js": 551 /*!*******************************************************************!*\ 552 !*** ./node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js ***! 553 \*******************************************************************/ 554 /*! exports provided: default */ 555 /***/ (function(module, __webpack_exports__, __webpack_require__) { 556 557 "use strict"; 558 __webpack_require__.r(__webpack_exports__); 559 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _setPrototypeOf; }); 560 function _setPrototypeOf(o, p) { 561 _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { 562 o.__proto__ = p; 563 return o; 564 }; 565 566 return _setPrototypeOf(o, p); 567 } 568 569 /***/ }), 570 571 /***/ "./node_modules/@babel/runtime/helpers/esm/slicedToArray.js": 572 /*!******************************************************************!*\ 573 !*** ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js ***! 574 \******************************************************************/ 575 /*! exports provided: default */ 576 /***/ (function(module, __webpack_exports__, __webpack_require__) { 577 578 "use strict"; 579 __webpack_require__.r(__webpack_exports__); 580 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _slicedToArray; }); 581 /* harmony import */ var _arrayWithHoles__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./arrayWithHoles */ "./node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js"); 582 /* harmony import */ var _iterableToArrayLimit__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./iterableToArrayLimit */ "./node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js"); 583 /* harmony import */ var _nonIterableRest__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./nonIterableRest */ "./node_modules/@babel/runtime/helpers/esm/nonIterableRest.js"); 584 585 586 587 function _slicedToArray(arr, i) { 588 return Object(_arrayWithHoles__WEBPACK_IMPORTED_MODULE_0__["default"])(arr) || Object(_iterableToArrayLimit__WEBPACK_IMPORTED_MODULE_1__["default"])(arr, i) || Object(_nonIterableRest__WEBPACK_IMPORTED_MODULE_2__["default"])(); 589 } 590 591 /***/ }), 592 593 /***/ "./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js": 594 /*!**********************************************************************!*\ 595 !*** ./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js ***! 596 \**********************************************************************/ 597 /*! exports provided: default */ 598 /***/ (function(module, __webpack_exports__, __webpack_require__) { 599 600 "use strict"; 601 __webpack_require__.r(__webpack_exports__); 602 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _toConsumableArray; }); 603 /* harmony import */ var _arrayWithoutHoles__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./arrayWithoutHoles */ "./node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js"); 604 /* harmony import */ var _iterableToArray__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./iterableToArray */ "./node_modules/@babel/runtime/helpers/esm/iterableToArray.js"); 605 /* harmony import */ var _nonIterableSpread__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./nonIterableSpread */ "./node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js"); 606 607 608 609 function _toConsumableArray(arr) { 610 return Object(_arrayWithoutHoles__WEBPACK_IMPORTED_MODULE_0__["default"])(arr) || Object(_iterableToArray__WEBPACK_IMPORTED_MODULE_1__["default"])(arr) || Object(_nonIterableSpread__WEBPACK_IMPORTED_MODULE_2__["default"])(); 611 } 612 613 /***/ }), 614 615 /***/ "./node_modules/@babel/runtime/helpers/esm/typeof.js": 616 /*!***********************************************************!*\ 617 !*** ./node_modules/@babel/runtime/helpers/esm/typeof.js ***! 618 \***********************************************************/ 619 /*! exports provided: default */ 620 /***/ (function(module, __webpack_exports__, __webpack_require__) { 621 622 "use strict"; 623 __webpack_require__.r(__webpack_exports__); 624 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _typeof; }); 625 function _typeof2(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof2 = function _typeof2(obj) { return typeof obj; }; } else { _typeof2 = function _typeof2(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof2(obj); } 626 627 function _typeof(obj) { 628 if (typeof Symbol === "function" && _typeof2(Symbol.iterator) === "symbol") { 629 _typeof = function _typeof(obj) { 630 return _typeof2(obj); 631 }; 632 } else { 633 _typeof = function _typeof(obj) { 634 return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : _typeof2(obj); 635 }; 636 } 637 638 return _typeof(obj); 639 } 640 641 /***/ }), 642 643 /***/ "./node_modules/@wordpress/editor/build-module/components/alignment-toolbar/index.js": 644 /*!*******************************************************************************************!*\ 645 !*** ./node_modules/@wordpress/editor/build-module/components/alignment-toolbar/index.js ***! 646 \*******************************************************************************************/ 647 /*! exports provided: AlignmentToolbar, default */ 648 /***/ (function(module, __webpack_exports__, __webpack_require__) { 649 650 "use strict"; 651 __webpack_require__.r(__webpack_exports__); 652 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AlignmentToolbar", function() { return AlignmentToolbar; }); 653 /* harmony import */ var _babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectSpread */ "./node_modules/@babel/runtime/helpers/esm/objectSpread.js"); 654 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); 655 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__); 656 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! lodash */ "lodash"); 657 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_2__); 658 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); 659 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__); 660 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); 661 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_4__); 662 /* harmony import */ var _wordpress_viewport__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/viewport */ "@wordpress/viewport"); 663 /* harmony import */ var _wordpress_viewport__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_viewport__WEBPACK_IMPORTED_MODULE_5__); 664 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); 665 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_6__); 666 /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose"); 667 /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_7__); 668 /* harmony import */ var _block_edit_context__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../block-edit/context */ "./node_modules/@wordpress/editor/build-module/components/block-edit/context.js"); 669 670 671 672 /** 673 * External dependencies 674 */ 675 676 /** 677 * WordPress dependencies 678 */ 679 680 681 682 683 684 685 /** 686 * Internal dependencies 687 */ 688 689 690 var ALIGNMENT_CONTROLS = [{ 691 icon: 'editor-alignleft', 692 title: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__["__"])('Align left'), 693 align: 'left' 694 }, { 695 icon: 'editor-aligncenter', 696 title: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__["__"])('Align center'), 697 align: 'center' 698 }, { 699 icon: 'editor-alignright', 700 title: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__["__"])('Align right'), 701 align: 'right' 702 }]; 703 function AlignmentToolbar(_ref) { 704 var isCollapsed = _ref.isCollapsed, 705 value = _ref.value, 706 onChange = _ref.onChange; 707 708 function applyOrUnset(align) { 709 return function () { 710 return onChange(value === align ? undefined : align); 711 }; 712 } 713 714 var activeAlignment = Object(lodash__WEBPACK_IMPORTED_MODULE_2__["find"])(ALIGNMENT_CONTROLS, function (control) { 715 return control.align === value; 716 }); 717 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_4__["Toolbar"], { 718 isCollapsed: isCollapsed, 719 icon: activeAlignment ? activeAlignment.icon : 'editor-alignleft', 720 label: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__["__"])('Change Text Alignment'), 721 controls: ALIGNMENT_CONTROLS.map(function (control) { 722 var align = control.align; 723 var isActive = value === align; 724 return Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_0__["default"])({}, control, { 725 isActive: isActive, 726 onClick: applyOrUnset(align) 727 }); 728 }) 729 }); 730 } 731 /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_7__["compose"])(Object(_block_edit_context__WEBPACK_IMPORTED_MODULE_8__["withBlockEditContext"])(function (_ref2) { 732 var clientId = _ref2.clientId; 733 return { 734 clientId: clientId 735 }; 736 }), Object(_wordpress_viewport__WEBPACK_IMPORTED_MODULE_5__["withViewportMatch"])({ 737 isLargeViewport: 'medium' 738 }), Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_6__["withSelect"])(function (select, _ref3) { 739 var clientId = _ref3.clientId, 740 isLargeViewport = _ref3.isLargeViewport, 741 isCollapsed = _ref3.isCollapsed; 742 743 var _select = select('core/editor'), 744 getBlockRootClientId = _select.getBlockRootClientId, 745 getEditorSettings = _select.getEditorSettings; 746 747 return { 748 isCollapsed: isCollapsed || !isLargeViewport || !getEditorSettings().hasFixedToolbar && getBlockRootClientId(clientId) 749 }; 750 }))(AlignmentToolbar)); 751 752 753 /***/ }), 754 755 /***/ "./node_modules/@wordpress/editor/build-module/components/autocomplete/index.js": 756 /*!**************************************************************************************!*\ 757 !*** ./node_modules/@wordpress/editor/build-module/components/autocomplete/index.js ***! 758 \**************************************************************************************/ 759 /*! exports provided: withFilteredAutocompleters, default */ 760 /***/ (function(module, __webpack_exports__, __webpack_require__) { 761 762 "use strict"; 763 __webpack_require__.r(__webpack_exports__); 764 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "withFilteredAutocompleters", function() { return withFilteredAutocompleters; }); 765 /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js"); 766 /* harmony import */ var _babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectSpread */ "./node_modules/@babel/runtime/helpers/esm/objectSpread.js"); 767 /* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/classCallCheck */ "./node_modules/@babel/runtime/helpers/esm/classCallCheck.js"); 768 /* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/esm/createClass */ "./node_modules/@babel/runtime/helpers/esm/createClass.js"); 769 /* harmony import */ var _babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/esm/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js"); 770 /* harmony import */ var _babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/helpers/esm/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js"); 771 /* harmony import */ var _babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inherits */ "./node_modules/@babel/runtime/helpers/esm/inherits.js"); 772 /* harmony import */ var _babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @babel/runtime/helpers/esm/assertThisInitialized */ "./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js"); 773 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); 774 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__); 775 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! lodash */ "lodash"); 776 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_9__); 777 /* harmony import */ var _wordpress_hooks__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @wordpress/hooks */ "@wordpress/hooks"); 778 /* harmony import */ var _wordpress_hooks__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_wordpress_hooks__WEBPACK_IMPORTED_MODULE_10__); 779 /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose"); 780 /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_11__); 781 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); 782 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_12__); 783 /* harmony import */ var _block_edit_context__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../block-edit/context */ "./node_modules/@wordpress/editor/build-module/components/block-edit/context.js"); 784 785 786 787 788 789 790 791 792 793 794 /** 795 * External dependencies 796 */ 797 798 /** 799 * WordPress dependencies 800 */ 801 802 803 804 805 806 /** 807 * Internal dependencies 808 */ 809 810 811 /* 812 * Use one array instance for fallback rather than inline array literals 813 * because the latter may cause rerender due to failed prop equality checks. 814 */ 815 816 var completersFallback = []; 817 /** 818 * Wrap the default Autocomplete component with one that 819 * supports a filter hook for customizing its list of autocompleters. 820 * 821 * Since there may be many Autocomplete instances at one time, this component 822 * applies the filter on demand, when the component is first focused after 823 * receiving a new list of completers. 824 * 825 * This function is exported for unit test. 826 * 827 * @param {Function} Autocomplete Original component. 828 * @return {Function} Wrapped component 829 */ 830 831 function withFilteredAutocompleters(Autocomplete) { 832 return ( 833 /*#__PURE__*/ 834 function (_Component) { 835 Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_6__["default"])(FilteredAutocomplete, _Component); 836 837 function FilteredAutocomplete() { 838 var _this; 839 840 Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_2__["default"])(this, FilteredAutocomplete); 841 842 _this = Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_4__["default"])(this, Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_5__["default"])(FilteredAutocomplete).call(this)); 843 _this.state = { 844 completers: completersFallback 845 }; 846 _this.saveParentRef = _this.saveParentRef.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(_this))); 847 _this.onFocus = _this.onFocus.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(_this))); 848 return _this; 849 } 850 851 Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_3__["default"])(FilteredAutocomplete, [{ 852 key: "componentDidUpdate", 853 value: function componentDidUpdate() { 854 var hasFocus = this.parentNode.contains(document.activeElement); 855 /* 856 * It's possible for props to be updated when the component has focus, 857 * so here, we ensure new completers are immediately applied while we 858 * have the focus. 859 * 860 * NOTE: This may trigger another render but only when the component has focus. 861 */ 862 863 if (hasFocus && this.hasStaleCompleters()) { 864 this.updateCompletersState(); 865 } 866 } 867 }, { 868 key: "onFocus", 869 value: function onFocus() { 870 if (this.hasStaleCompleters()) { 871 this.updateCompletersState(); 872 } 873 } 874 }, { 875 key: "hasStaleCompleters", 876 value: function hasStaleCompleters() { 877 return !('lastFilteredCompletersProp' in this.state) || this.state.lastFilteredCompletersProp !== this.props.completers; 878 } 879 }, { 880 key: "updateCompletersState", 881 value: function updateCompletersState() { 882 var _this$props = this.props, 883 blockName = _this$props.blockName, 884 completers = _this$props.completers; 885 var nextCompleters = completers; 886 var lastFilteredCompletersProp = nextCompleters; 887 888 if (Object(_wordpress_hooks__WEBPACK_IMPORTED_MODULE_10__["hasFilter"])('editor.Autocomplete.completers')) { 889 nextCompleters = Object(_wordpress_hooks__WEBPACK_IMPORTED_MODULE_10__["applyFilters"])('editor.Autocomplete.completers', // Provide copies so filters may directly modify them. 890 nextCompleters && nextCompleters.map(lodash__WEBPACK_IMPORTED_MODULE_9__["clone"]), blockName); 891 } 892 893 this.setState({ 894 lastFilteredCompletersProp: lastFilteredCompletersProp, 895 completers: nextCompleters || completersFallback 896 }); 897 } 898 }, { 899 key: "saveParentRef", 900 value: function saveParentRef(parentNode) { 901 this.parentNode = parentNode; 902 } 903 }, { 904 key: "render", 905 value: function render() { 906 var completers = this.state.completers; 907 908 var autocompleteProps = Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_1__["default"])({}, this.props, { 909 completers: completers 910 }); 911 912 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["createElement"])("div", { 913 onFocus: this.onFocus, 914 ref: this.saveParentRef 915 }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["createElement"])(Autocomplete, Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({ 916 onFocus: this.onFocus 917 }, autocompleteProps))); 918 } 919 }]); 920 921 return FilteredAutocomplete; 922 }(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["Component"]) 923 ); 924 } 925 /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_11__["compose"])([Object(_block_edit_context__WEBPACK_IMPORTED_MODULE_13__["withBlockEditContext"])(function (_ref) { 926 var name = _ref.name; 927 return { 928 blockName: name 929 }; 930 }), withFilteredAutocompleters])(_wordpress_components__WEBPACK_IMPORTED_MODULE_12__["Autocomplete"])); 931 932 933 /***/ }), 934 935 /***/ "./node_modules/@wordpress/editor/build-module/components/autocompleters/block.js": 936 /*!****************************************************************************************!*\ 937 !*** ./node_modules/@wordpress/editor/build-module/components/autocompleters/block.js ***! 938 \****************************************************************************************/ 939 /*! exports provided: createBlockCompleter, default */ 940 /***/ (function(module, __webpack_exports__, __webpack_require__) { 941 942 "use strict"; 943 __webpack_require__.r(__webpack_exports__); 944 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createBlockCompleter", function() { return createBlockCompleter; }); 945 /* harmony import */ var _babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/toConsumableArray */ "./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js"); 946 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); 947 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__); 948 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); 949 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_2__); 950 /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks"); 951 /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_3__); 952 /* harmony import */ var _block_icon__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../block-icon */ "./node_modules/@wordpress/editor/build-module/components/block-icon/index.js"); 953 954 955 956 /** 957 * WordPress dependencies 958 */ 959 960 961 /** 962 * Internal dependencies 963 */ 964 965 966 /** 967 * Returns the client ID of the parent where a newly inserted block would be 968 * placed. 969 * 970 * @return {string} Client ID of the parent where a newly inserted block would 971 * be placed. 972 */ 973 974 function defaultGetBlockInsertionParentClientId() { 975 return Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_2__["select"])('core/editor').getBlockInsertionPoint().rootClientId; 976 } 977 /** 978 * Returns the inserter items for the specified parent block. 979 * 980 * @param {string} parentClientId Client ID of the block for which to retrieve 981 * inserter items. 982 * 983 * @return {Array<Editor.InserterItem>} The inserter items for the specified 984 * parent. 985 */ 986 987 988 function defaultGetInserterItems(parentClientId) { 989 return Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_2__["select"])('core/editor').getInserterItems(parentClientId); 990 } 991 /** 992 * Returns the name of the currently selected block. 993 * 994 * @return {string?} The name of the currently selected block or `null` if no 995 * block is selected. 996 */ 997 998 999 function defaultGetSelectedBlockName() { 1000 var selectedBlock = Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_2__["select"])('core/editor').getSelectedBlock(); 1001 return selectedBlock ? selectedBlock.name : null; 1002 } 1003 /** 1004 * Creates a blocks repeater for replacing the current block with a selected block type. 1005 * 1006 * @return {Completer} A blocks completer. 1007 */ 1008 1009 1010 function createBlockCompleter() { 1011 var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}, 1012 _ref$getBlockInsertio = _ref.getBlockInsertionParentClientId, 1013 getBlockInsertionParentClientId = _ref$getBlockInsertio === void 0 ? defaultGetBlockInsertionParentClientId : _ref$getBlockInsertio, 1014 _ref$getInserterItems = _ref.getInserterItems, 1015 getInserterItems = _ref$getInserterItems === void 0 ? defaultGetInserterItems : _ref$getInserterItems, 1016 _ref$getSelectedBlock = _ref.getSelectedBlockName, 1017 getSelectedBlockName = _ref$getSelectedBlock === void 0 ? defaultGetSelectedBlockName : _ref$getSelectedBlock; 1018 1019 return { 1020 name: 'blocks', 1021 className: 'editor-autocompleters__block', 1022 triggerPrefix: '/', 1023 options: function options() { 1024 var selectedBlockName = getSelectedBlockName(); 1025 return getInserterItems(getBlockInsertionParentClientId()).filter( // Avoid offering to replace the current block with a block of the same type. 1026 function (inserterItem) { 1027 return selectedBlockName !== inserterItem.name; 1028 }); 1029 }, 1030 getOptionKeywords: function getOptionKeywords(inserterItem) { 1031 var title = inserterItem.title, 1032 _inserterItem$keyword = inserterItem.keywords, 1033 keywords = _inserterItem$keyword === void 0 ? [] : _inserterItem$keyword; 1034 return Object(_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_0__["default"])(keywords).concat([title]); 1035 }, 1036 getOptionLabel: function getOptionLabel(inserterItem) { 1037 var icon = inserterItem.icon, 1038 title = inserterItem.title; 1039 return [Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])(_block_icon__WEBPACK_IMPORTED_MODULE_4__["default"], { 1040 key: "icon", 1041 icon: icon && icon.src, 1042 showColors: true 1043 }), title]; 1044 }, 1045 allowContext: function allowContext(before, after) { 1046 return !(/\S/.test(before) || /\S/.test(after)); 1047 }, 1048 getOptionCompletion: function getOptionCompletion(inserterItem) { 1049 var name = inserterItem.name, 1050 initialAttributes = inserterItem.initialAttributes; 1051 return { 1052 action: 'replace', 1053 value: Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_3__["createBlock"])(name, initialAttributes) 1054 }; 1055 }, 1056 isOptionDisabled: function isOptionDisabled(inserterItem) { 1057 return inserterItem.isDisabled; 1058 } 1059 }; 1060 } 1061 /** 1062 * Creates a blocks repeater for replacing the current block with a selected block type. 1063 * 1064 * @return {Completer} A blocks completer. 1065 */ 1066 1067 /* harmony default export */ __webpack_exports__["default"] = (createBlockCompleter()); 1068 1069 1070 /***/ }), 1071 1072 /***/ "./node_modules/@wordpress/editor/build-module/components/autocompleters/index.js": 1073 /*!****************************************************************************************!*\ 1074 !*** ./node_modules/@wordpress/editor/build-module/components/autocompleters/index.js ***! 1075 \****************************************************************************************/ 1076 /*! exports provided: blockAutocompleter, userAutocompleter */ 1077 /***/ (function(module, __webpack_exports__, __webpack_require__) { 1078 1079 "use strict"; 1080 __webpack_require__.r(__webpack_exports__); 1081 /* harmony import */ var _block__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./block */ "./node_modules/@wordpress/editor/build-module/components/autocompleters/block.js"); 1082 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "blockAutocompleter", function() { return _block__WEBPACK_IMPORTED_MODULE_0__["default"]; }); 1083 1084 /* harmony import */ var _user__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./user */ "./node_modules/@wordpress/editor/build-module/components/autocompleters/user.js"); 1085 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "userAutocompleter", function() { return _user__WEBPACK_IMPORTED_MODULE_1__["default"]; }); 1086 1087 1088 1089 1090 1091 /***/ }), 1092 1093 /***/ "./node_modules/@wordpress/editor/build-module/components/autocompleters/user.js": 1094 /*!***************************************************************************************!*\ 1095 !*** ./node_modules/@wordpress/editor/build-module/components/autocompleters/user.js ***! 1096 \***************************************************************************************/ 1097 /*! exports provided: default */ 1098 /***/ (function(module, __webpack_exports__, __webpack_require__) { 1099 1100 "use strict"; 1101 __webpack_require__.r(__webpack_exports__); 1102 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); 1103 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); 1104 /* harmony import */ var _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/api-fetch */ "@wordpress/api-fetch"); 1105 /* harmony import */ var _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_1__); 1106 1107 1108 /** 1109 * WordPress dependencies 1110 */ 1111 1112 /** 1113 * A user mentions completer. 1114 * 1115 * @type {Completer} 1116 */ 1117 1118 /* harmony default export */ __webpack_exports__["default"] = ({ 1119 name: 'users', 1120 className: 'editor-autocompleters__user', 1121 triggerPrefix: '@', 1122 options: function options(search) { 1123 var payload = ''; 1124 1125 if (search) { 1126 payload = '?search=' + encodeURIComponent(search); 1127 } 1128 1129 return _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_1___default()({ 1130 path: '/wp/v2/users' + payload 1131 }); 1132 }, 1133 isDebounced: true, 1134 getOptionKeywords: function getOptionKeywords(user) { 1135 return [user.slug, user.name]; 1136 }, 1137 getOptionLabel: function getOptionLabel(user) { 1138 return [Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("img", { 1139 key: "avatar", 1140 className: "editor-autocompleters__user-avatar", 1141 alt: "", 1142 src: user.avatar_urls[24] 1143 }), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("span", { 1144 key: "name", 1145 className: "editor-autocompleters__user-name" 1146 }, user.name), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("span", { 1147 key: "slug", 1148 className: "editor-autocompleters__user-slug" 1149 }, user.slug)]; 1150 }, 1151 getOptionCompletion: function getOptionCompletion(user) { 1152 return "@".concat(user.slug); 1153 } 1154 }); 1155 1156 1157 /***/ }), 1158 1159 /***/ "./node_modules/@wordpress/editor/build-module/components/autosave-monitor/index.js": 1160 /*!******************************************************************************************!*\ 1161 !*** ./node_modules/@wordpress/editor/build-module/components/autosave-monitor/index.js ***! 1162 \******************************************************************************************/ 1163 /*! exports provided: AutosaveMonitor, default */ 1164 /***/ (function(module, __webpack_exports__, __webpack_require__) { 1165 1166 "use strict"; 1167 __webpack_require__.r(__webpack_exports__); 1168 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AutosaveMonitor", function() { return AutosaveMonitor; }); 1169 /* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/classCallCheck */ "./node_modules/@babel/runtime/helpers/esm/classCallCheck.js"); 1170 /* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/createClass */ "./node_modules/@babel/runtime/helpers/esm/createClass.js"); 1171 /* harmony import */ var _babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js"); 1172 /* harmony import */ var _babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/esm/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js"); 1173 /* harmony import */ var _babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inherits */ "./node_modules/@babel/runtime/helpers/esm/inherits.js"); 1174 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); 1175 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_5__); 1176 /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose"); 1177 /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_6__); 1178 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); 1179 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_7__); 1180 1181 1182 1183 1184 1185 1186 /** 1187 * WordPress dependencies 1188 */ 1189 1190 1191 1192 var AutosaveMonitor = 1193 /*#__PURE__*/ 1194 function (_Component) { 1195 Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__["default"])(AutosaveMonitor, _Component); 1196 1197 function AutosaveMonitor() { 1198 Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__["default"])(this, AutosaveMonitor); 1199 1200 return Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__["default"])(this, Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__["default"])(AutosaveMonitor).apply(this, arguments)); 1201 } 1202 1203 Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__["default"])(AutosaveMonitor, [{ 1204 key: "componentDidUpdate", 1205 value: function componentDidUpdate(prevProps) { 1206 var _this$props = this.props, 1207 isDirty = _this$props.isDirty, 1208 isAutosaveable = _this$props.isAutosaveable; 1209 1210 if (prevProps.isDirty !== isDirty || prevProps.isAutosaveable !== isAutosaveable) { 1211 this.toggleTimer(isDirty && isAutosaveable); 1212 } 1213 } 1214 }, { 1215 key: "componentWillUnmount", 1216 value: function componentWillUnmount() { 1217 this.toggleTimer(false); 1218 } 1219 }, { 1220 key: "toggleTimer", 1221 value: function toggleTimer(isPendingSave) { 1222 var _this = this; 1223 1224 clearTimeout(this.pendingSave); 1225 var autosaveInterval = this.props.autosaveInterval; 1226 1227 if (isPendingSave) { 1228 this.pendingSave = setTimeout(function () { 1229 return _this.props.autosave(); 1230 }, autosaveInterval * 1000); 1231 } 1232 } 1233 }, { 1234 key: "render", 1235 value: function render() { 1236 return null; 1237 } 1238 }]); 1239 1240 return AutosaveMonitor; 1241 }(_wordpress_element__WEBPACK_IMPORTED_MODULE_5__["Component"]); 1242 /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_6__["compose"])([Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_7__["withSelect"])(function (select) { 1243 var _select = select('core/editor'), 1244 isEditedPostDirty = _select.isEditedPostDirty, 1245 isEditedPostAutosaveable = _select.isEditedPostAutosaveable, 1246 getEditorSettings = _select.getEditorSettings; 1247 1248 var _getEditorSettings = getEditorSettings(), 1249 autosaveInterval = _getEditorSettings.autosaveInterval; 1250 1251 return { 1252 isDirty: isEditedPostDirty(), 1253 isAutosaveable: isEditedPostAutosaveable(), 1254 autosaveInterval: autosaveInterval 1255 }; 1256 }), Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_7__["withDispatch"])(function (dispatch) { 1257 return { 1258 autosave: dispatch('core/editor').autosave 1259 }; 1260 })])(AutosaveMonitor)); 1261 1262 1263 /***/ }), 1264 1265 /***/ "./node_modules/@wordpress/editor/build-module/components/block-actions/index.js": 1266 /*!***************************************************************************************!*\ 1267 !*** ./node_modules/@wordpress/editor/build-module/components/block-actions/index.js ***! 1268 \***************************************************************************************/ 1269 /*! exports provided: default */ 1270 /***/ (function(module, __webpack_exports__, __webpack_require__) { 1271 1272 "use strict"; 1273 __webpack_require__.r(__webpack_exports__); 1274 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash */ "lodash"); 1275 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_0__); 1276 /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose"); 1277 /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_1__); 1278 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); 1279 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_2__); 1280 /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks"); 1281 /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_3__); 1282 /** 1283 * External dependencies 1284 */ 1285 1286 /** 1287 * WordPress dependencies 1288 */ 1289 1290 1291 1292 1293 1294 function BlockActions(_ref) { 1295 var onDuplicate = _ref.onDuplicate, 1296 onRemove = _ref.onRemove, 1297 onInsertBefore = _ref.onInsertBefore, 1298 onInsertAfter = _ref.onInsertAfter, 1299 isLocked = _ref.isLocked, 1300 canDuplicate = _ref.canDuplicate, 1301 children = _ref.children; 1302 return children({ 1303 onDuplicate: onDuplicate, 1304 onRemove: onRemove, 1305 onInsertAfter: onInsertAfter, 1306 onInsertBefore: onInsertBefore, 1307 isLocked: isLocked, 1308 canDuplicate: canDuplicate 1309 }); 1310 } 1311 1312 /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_1__["compose"])([Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_2__["withSelect"])(function (select, props) { 1313 var _select = select('core/editor'), 1314 getBlocksByClientId = _select.getBlocksByClientId, 1315 getBlockIndex = _select.getBlockIndex, 1316 getTemplateLock = _select.getTemplateLock, 1317 getBlockRootClientId = _select.getBlockRootClientId; 1318 1319 var blocks = getBlocksByClientId(props.clientIds); 1320 var canDuplicate = Object(lodash__WEBPACK_IMPORTED_MODULE_0__["every"])(blocks, function (block) { 1321 return !!block && Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_3__["hasBlockSupport"])(block.name, 'multiple', true); 1322 }); 1323 var rootClientId = getBlockRootClientId(props.clientIds[0]); 1324 return { 1325 firstSelectedIndex: getBlockIndex(Object(lodash__WEBPACK_IMPORTED_MODULE_0__["first"])(Object(lodash__WEBPACK_IMPORTED_MODULE_0__["castArray"])(props.clientIds)), rootClientId), 1326 lastSelectedIndex: getBlockIndex(Object(lodash__WEBPACK_IMPORTED_MODULE_0__["last"])(Object(lodash__WEBPACK_IMPORTED_MODULE_0__["castArray"])(props.clientIds)), rootClientId), 1327 isLocked: !!getTemplateLock(rootClientId), 1328 blocks: blocks, 1329 canDuplicate: canDuplicate, 1330 rootClientId: rootClientId, 1331 extraProps: props 1332 }; 1333 }), Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_2__["withDispatch"])(function (dispatch, props) { 1334 var clientIds = props.clientIds, 1335 rootClientId = props.rootClientId, 1336 blocks = props.blocks, 1337 firstSelectedIndex = props.firstSelectedIndex, 1338 lastSelectedIndex = props.lastSelectedIndex, 1339 isLocked = props.isLocked, 1340 canDuplicate = props.canDuplicate; 1341 1342 var _dispatch = dispatch('core/editor'), 1343 insertBlocks = _dispatch.insertBlocks, 1344 multiSelect = _dispatch.multiSelect, 1345 removeBlocks = _dispatch.removeBlocks, 1346 insertDefaultBlock = _dispatch.insertDefaultBlock; 1347 1348 return { 1349 onDuplicate: function onDuplicate() { 1350 if (isLocked || !canDuplicate) { 1351 return; 1352 } 1353 1354 var clonedBlocks = blocks.map(function (block) { 1355 return Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_3__["cloneBlock"])(block); 1356 }); 1357 insertBlocks(clonedBlocks, lastSelectedIndex + 1, rootClientId); 1358 1359 if (clonedBlocks.length > 1) { 1360 multiSelect(Object(lodash__WEBPACK_IMPORTED_MODULE_0__["first"])(clonedBlocks).clientId, Object(lodash__WEBPACK_IMPORTED_MODULE_0__["last"])(clonedBlocks).clientId); 1361 } 1362 }, 1363 onRemove: function onRemove() { 1364 if (!isLocked) { 1365 removeBlocks(clientIds); 1366 } 1367 }, 1368 onInsertBefore: function onInsertBefore() { 1369 if (!isLocked) { 1370 insertDefaultBlock({}, rootClientId, firstSelectedIndex); 1371 } 1372 }, 1373 onInsertAfter: function onInsertAfter() { 1374 if (!isLocked) { 1375 insertDefaultBlock({}, rootClientId, lastSelectedIndex + 1); 1376 } 1377 } 1378 }; 1379 })])(BlockActions)); 1380 1381 1382 /***/ }), 1383 1384 /***/ "./node_modules/@wordpress/editor/build-module/components/block-alignment-toolbar/index.js": 1385 /*!*************************************************************************************************!*\ 1386 !*** ./node_modules/@wordpress/editor/build-module/components/block-alignment-toolbar/index.js ***! 1387 \*************************************************************************************************/ 1388 /*! exports provided: BlockAlignmentToolbar, default */ 1389 /***/ (function(module, __webpack_exports__, __webpack_require__) { 1390 1391 "use strict"; 1392 __webpack_require__.r(__webpack_exports__); 1393 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BlockAlignmentToolbar", function() { return BlockAlignmentToolbar; }); 1394 /* harmony import */ var _babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectSpread */ "./node_modules/@babel/runtime/helpers/esm/objectSpread.js"); 1395 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); 1396 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__); 1397 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); 1398 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__); 1399 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); 1400 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__); 1401 /* harmony import */ var _wordpress_viewport__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/viewport */ "@wordpress/viewport"); 1402 /* harmony import */ var _wordpress_viewport__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_viewport__WEBPACK_IMPORTED_MODULE_4__); 1403 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); 1404 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_5__); 1405 /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose"); 1406 /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_6__); 1407 /* harmony import */ var _block_edit_context__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../block-edit/context */ "./node_modules/@wordpress/editor/build-module/components/block-edit/context.js"); 1408 1409 1410 1411 /** 1412 * WordPress dependencies 1413 */ 1414 1415 1416 1417 1418 1419 /** 1420 * Internal dependencies 1421 */ 1422 1423 1424 var BLOCK_ALIGNMENTS_CONTROLS = { 1425 left: { 1426 icon: 'align-left', 1427 title: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__["__"])('Align left') 1428 }, 1429 center: { 1430 icon: 'align-center', 1431 title: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__["__"])('Align center') 1432 }, 1433 right: { 1434 icon: 'align-right', 1435 title: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__["__"])('Align right') 1436 }, 1437 wide: { 1438 icon: 'align-wide', 1439 title: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__["__"])('Wide width') 1440 }, 1441 full: { 1442 icon: 'align-full-width', 1443 title: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__["__"])('Full width') 1444 } 1445 }; 1446 var DEFAULT_CONTROLS = ['left', 'center', 'right', 'wide', 'full']; 1447 var WIDE_CONTROLS = ['wide', 'full']; 1448 function BlockAlignmentToolbar(_ref) { 1449 var isCollapsed = _ref.isCollapsed, 1450 value = _ref.value, 1451 onChange = _ref.onChange, 1452 _ref$controls = _ref.controls, 1453 controls = _ref$controls === void 0 ? DEFAULT_CONTROLS : _ref$controls, 1454 _ref$wideControlsEnab = _ref.wideControlsEnabled, 1455 wideControlsEnabled = _ref$wideControlsEnab === void 0 ? false : _ref$wideControlsEnab; 1456 1457 function applyOrUnset(align) { 1458 return function () { 1459 return onChange(value === align ? undefined : align); 1460 }; 1461 } 1462 1463 var enabledControls = wideControlsEnabled ? controls : controls.filter(function (control) { 1464 return WIDE_CONTROLS.indexOf(control) === -1; 1465 }); 1466 var activeAlignment = BLOCK_ALIGNMENTS_CONTROLS[value]; 1467 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__["Toolbar"], { 1468 isCollapsed: isCollapsed, 1469 icon: activeAlignment ? activeAlignment.icon : 'align-left', 1470 label: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__["__"])('Change Alignment'), 1471 controls: enabledControls.map(function (control) { 1472 return Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_0__["default"])({}, BLOCK_ALIGNMENTS_CONTROLS[control], { 1473 isActive: value === control, 1474 onClick: applyOrUnset(control) 1475 }); 1476 }) 1477 }); 1478 } 1479 /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_6__["compose"])(Object(_block_edit_context__WEBPACK_IMPORTED_MODULE_7__["withBlockEditContext"])(function (_ref2) { 1480 var clientId = _ref2.clientId; 1481 return { 1482 clientId: clientId 1483 }; 1484 }), Object(_wordpress_viewport__WEBPACK_IMPORTED_MODULE_4__["withViewportMatch"])({ 1485 isLargeViewport: 'medium' 1486 }), Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_5__["withSelect"])(function (select, _ref3) { 1487 var clientId = _ref3.clientId, 1488 isLargeViewport = _ref3.isLargeViewport, 1489 isCollapsed = _ref3.isCollapsed; 1490 1491 var _select = select('core/editor'), 1492 getBlockRootClientId = _select.getBlockRootClientId, 1493 getEditorSettings = _select.getEditorSettings; 1494 1495 return { 1496 wideControlsEnabled: select('core/editor').getEditorSettings().alignWide, 1497 isCollapsed: isCollapsed || !isLargeViewport || !getEditorSettings().hasFixedToolbar && getBlockRootClientId(clientId) 1498 }; 1499 }))(BlockAlignmentToolbar)); 1500 1501 1502 /***/ }), 1503 1504 /***/ "./node_modules/@wordpress/editor/build-module/components/block-compare/block-view.js": 1505 /*!********************************************************************************************!*\ 1506 !*** ./node_modules/@wordpress/editor/build-module/components/block-compare/block-view.js ***! 1507 \********************************************************************************************/ 1508 /*! exports provided: default */ 1509 /***/ (function(module, __webpack_exports__, __webpack_require__) { 1510 1511 "use strict"; 1512 __webpack_require__.r(__webpack_exports__); 1513 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); 1514 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); 1515 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); 1516 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__); 1517 1518 1519 /** 1520 * WordPress dependencies 1521 */ 1522 1523 1524 var BlockView = function BlockView(_ref) { 1525 var title = _ref.title, 1526 rawContent = _ref.rawContent, 1527 renderedContent = _ref.renderedContent, 1528 action = _ref.action, 1529 actionText = _ref.actionText, 1530 className = _ref.className; 1531 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("div", { 1532 className: className 1533 }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("div", { 1534 className: "editor-block-compare__content" 1535 }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("h1", { 1536 className: "editor-block-compare__heading" 1537 }, title), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("div", { 1538 className: "editor-block-compare__html" 1539 }, rawContent), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("div", { 1540 className: "editor-block-compare__preview edit-post-visual-editor" 1541 }, renderedContent)), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("div", { 1542 className: "editor-block-compare__action" 1543 }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__["Button"], { 1544 isLarge: true, 1545 tabIndex: "0", 1546 onClick: action 1547 }, actionText))); 1548 }; 1549 1550 /* harmony default export */ __webpack_exports__["default"] = (BlockView); 1551 1552 1553 /***/ }), 1554 1555 /***/ "./node_modules/@wordpress/editor/build-module/components/block-compare/index.js": 1556 /*!***************************************************************************************!*\ 1557 !*** ./node_modules/@wordpress/editor/build-module/components/block-compare/index.js ***! 1558 \***************************************************************************************/ 1559 /*! exports provided: default */ 1560 /***/ (function(module, __webpack_exports__, __webpack_require__) { 1561 1562 "use strict"; 1563 __webpack_require__.r(__webpack_exports__); 1564 /* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/classCallCheck */ "./node_modules/@babel/runtime/helpers/esm/classCallCheck.js"); 1565 /* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/createClass */ "./node_modules/@babel/runtime/helpers/esm/createClass.js"); 1566 /* harmony import */ var _babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js"); 1567 /* harmony import */ var _babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/esm/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js"); 1568 /* harmony import */ var _babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inherits */ "./node_modules/@babel/runtime/helpers/esm/inherits.js"); 1569 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); 1570 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_5__); 1571 /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); 1572 /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_6__); 1573 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! lodash */ "lodash"); 1574 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_7__); 1575 /* harmony import */ var diff__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! diff */ "./node_modules/diff/dist/diff.js"); 1576 /* harmony import */ var diff__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(diff__WEBPACK_IMPORTED_MODULE_8__); 1577 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); 1578 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_9__); 1579 /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks"); 1580 /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_10__); 1581 /* harmony import */ var _block_view__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./block-view */ "./node_modules/@wordpress/editor/build-module/components/block-compare/block-view.js"); 1582 1583 1584 1585 1586 1587 1588 1589 /** 1590 * External dependencies 1591 */ 1592 1593 1594 1595 /** 1596 * WordPress dependencies 1597 */ 1598 1599 1600 1601 1602 /** 1603 * Internal dependencies 1604 */ 1605 1606 1607 1608 var BlockCompare = 1609 /*#__PURE__*/ 1610 function (_Component) { 1611 Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__["default"])(BlockCompare, _Component); 1612 1613 function BlockCompare() { 1614 Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__["default"])(this, BlockCompare); 1615 1616 return Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__["default"])(this, Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__["default"])(BlockCompare).apply(this, arguments)); 1617 } 1618 1619 Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__["default"])(BlockCompare, [{ 1620 key: "getDifference", 1621 value: function getDifference(originalContent, newContent) { 1622 var difference = Object(diff__WEBPACK_IMPORTED_MODULE_8__["diffChars"])(originalContent, newContent); 1623 return difference.map(function (item, pos) { 1624 var classes = classnames__WEBPACK_IMPORTED_MODULE_6___default()({ 1625 'editor-block-compare__added': item.added, 1626 'editor-block-compare__removed': item.removed 1627 }); 1628 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_5__["createElement"])("span", { 1629 key: pos, 1630 className: classes 1631 }, item.value); 1632 }); 1633 } 1634 }, { 1635 key: "getOriginalContent", 1636 value: function getOriginalContent(block) { 1637 // Get current block details 1638 var blockType = Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_10__["getBlockType"])(block.name); 1639 return { 1640 rawContent: block.originalContent, 1641 renderedContent: Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_10__["getSaveElement"])(blockType, block.attributes) 1642 }; 1643 } 1644 }, { 1645 key: "getConvertedContent", 1646 value: function getConvertedContent(block) { 1647 // The convertor may return an array of items or a single item 1648 var newBlocks = Object(lodash__WEBPACK_IMPORTED_MODULE_7__["castArray"])(block); // Get converted block details 1649 1650 var newContent = newBlocks.map(function (item) { 1651 return Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_10__["getSaveContent"])(Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_10__["getBlockType"])(item.name), item.attributes, item.innerBlocks); 1652 }); 1653 var renderedContent = newBlocks.map(function (item) { 1654 return Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_10__["getSaveElement"])(Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_10__["getBlockType"])(item.name), item.attributes, item.innerBlocks); 1655 }); 1656 return { 1657 rawContent: newContent.join(''), 1658 renderedContent: renderedContent 1659 }; 1660 } 1661 }, { 1662 key: "render", 1663 value: function render() { 1664 var _this$props = this.props, 1665 block = _this$props.block, 1666 onKeep = _this$props.onKeep, 1667 onConvert = _this$props.onConvert, 1668 convertor = _this$props.convertor, 1669 convertButtonText = _this$props.convertButtonText; 1670 var original = this.getOriginalContent(block); 1671 var converted = this.getConvertedContent(convertor(block)); 1672 var difference = this.getDifference(original.rawContent, converted.rawContent); 1673 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_5__["createElement"])("div", { 1674 className: "editor-block-compare__wrapper" 1675 }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_5__["createElement"])(_block_view__WEBPACK_IMPORTED_MODULE_11__["default"], { 1676 title: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_9__["__"])('Current'), 1677 className: "editor-block-compare__current", 1678 action: onKeep, 1679 actionText: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_9__["__"])('Convert to HTML'), 1680 rawContent: original.rawContent, 1681 renderedContent: original.renderedContent 1682 }), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_5__["createElement"])(_block_view__WEBPACK_IMPORTED_MODULE_11__["default"], { 1683 title: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_9__["__"])('After Conversion'), 1684 className: "editor-block-compare__converted", 1685 action: onConvert, 1686 actionText: convertButtonText, 1687 rawContent: difference, 1688 renderedContent: converted.renderedContent 1689 })); 1690 } 1691 }]); 1692 1693 return BlockCompare; 1694 }(_wordpress_element__WEBPACK_IMPORTED_MODULE_5__["Component"]); 1695 1696 /* harmony default export */ __webpack_exports__["default"] = (BlockCompare); 1697 1698 1699 /***/ }), 1700 1701 /***/ "./node_modules/@wordpress/editor/build-module/components/block-controls/index.js": 1702 /*!****************************************************************************************!*\ 1703 !*** ./node_modules/@wordpress/editor/build-module/components/block-controls/index.js ***! 1704 \****************************************************************************************/ 1705 /*! exports provided: default */ 1706 /***/ (function(module, __webpack_exports__, __webpack_require__) { 1707 1708 "use strict"; 1709 __webpack_require__.r(__webpack_exports__); 1710 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); 1711 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); 1712 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); 1713 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__); 1714 /* harmony import */ var _block_edit_context__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../block-edit/context */ "./node_modules/@wordpress/editor/build-module/components/block-edit/context.js"); 1715 1716 1717 /** 1718 * WordPress dependencies 1719 */ 1720 1721 /** 1722 * Internal dependencies 1723 */ 1724 1725 1726 1727 var _createSlotFill = Object(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__["createSlotFill"])('BlockControls'), 1728 Fill = _createSlotFill.Fill, 1729 Slot = _createSlotFill.Slot; 1730 1731 var BlockControlsFill = function BlockControlsFill(_ref) { 1732 var controls = _ref.controls, 1733 children = _ref.children; 1734 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(Fill, null, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__["Toolbar"], { 1735 controls: controls 1736 }), children); 1737 }; 1738 1739 var BlockControls = Object(_block_edit_context__WEBPACK_IMPORTED_MODULE_2__["ifBlockEditSelected"])(BlockControlsFill); 1740 BlockControls.Slot = Slot; 1741 /* harmony default export */ __webpack_exports__["default"] = (BlockControls); 1742 1743 1744 /***/ }), 1745 1746 /***/ "./node_modules/@wordpress/editor/build-module/components/block-draggable/index.js": 1747 /*!*****************************************************************************************!*\ 1748 !*** ./node_modules/@wordpress/editor/build-module/components/block-draggable/index.js ***! 1749 \*****************************************************************************************/ 1750 /*! exports provided: default */ 1751 /***/ (function(module, __webpack_exports__, __webpack_require__) { 1752 1753 "use strict"; 1754 __webpack_require__.r(__webpack_exports__); 1755 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); 1756 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); 1757 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); 1758 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__); 1759 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); 1760 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_2__); 1761 1762 1763 /** 1764 * WordPress dependencies 1765 */ 1766 1767 1768 1769 var BlockDraggable = function BlockDraggable(_ref) { 1770 var children = _ref.children, 1771 clientId = _ref.clientId, 1772 rootClientId = _ref.rootClientId, 1773 blockElementId = _ref.blockElementId, 1774 index = _ref.index, 1775 onDragStart = _ref.onDragStart, 1776 onDragEnd = _ref.onDragEnd; 1777 var transferData = { 1778 type: 'block', 1779 srcIndex: index, 1780 srcRootClientId: rootClientId, 1781 srcClientId: clientId 1782 }; 1783 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__["Draggable"], { 1784 elementId: blockElementId, 1785 transferData: transferData, 1786 onDragStart: onDragStart, 1787 onDragEnd: onDragEnd 1788 }, function (_ref2) { 1789 var onDraggableStart = _ref2.onDraggableStart, 1790 onDraggableEnd = _ref2.onDraggableEnd; 1791 return children({ 1792 onDraggableStart: onDraggableStart, 1793 onDraggableEnd: onDraggableEnd 1794 }); 1795 }); 1796 }; 1797 1798 /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_2__["withSelect"])(function (select, _ref3) { 1799 var clientId = _ref3.clientId; 1800 1801 var _select = select('core/editor'), 1802 getBlockIndex = _select.getBlockIndex, 1803 getBlockRootClientId = _select.getBlockRootClientId; 1804 1805 return { 1806 index: getBlockIndex(clientId), 1807 rootClientId: getBlockRootClientId(clientId) 1808 }; 1809 })(BlockDraggable)); 1810 1811 1812 /***/ }), 1813 1814 /***/ "./node_modules/@wordpress/editor/build-module/components/block-drop-zone/index.js": 1815 /*!*****************************************************************************************!*\ 1816 !*** ./node_modules/@wordpress/editor/build-module/components/block-drop-zone/index.js ***! 1817 \*****************************************************************************************/ 1818 /*! exports provided: default */ 1819 /***/ (function(module, __webpack_exports__, __webpack_require__) { 1820 1821 "use strict"; 1822 __webpack_require__.r(__webpack_exports__); 1823 /* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/classCallCheck */ "./node_modules/@babel/runtime/helpers/esm/classCallCheck.js"); 1824 /* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/createClass */ "./node_modules/@babel/runtime/helpers/esm/createClass.js"); 1825 /* harmony import */ var _babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js"); 1826 /* harmony import */ var _babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/esm/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js"); 1827 /* harmony import */ var _babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inherits */ "./node_modules/@babel/runtime/helpers/esm/inherits.js"); 1828 /* harmony import */ var _babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/helpers/esm/assertThisInitialized */ "./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js"); 1829 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); 1830 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__); 1831 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! lodash */ "lodash"); 1832 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_7__); 1833 /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); 1834 /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_8__); 1835 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); 1836 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_9__); 1837 /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks"); 1838 /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_10__); 1839 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); 1840 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_11__); 1841 /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose"); 1842 /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_12__); 1843 1844 1845 1846 1847 1848 1849 1850 1851 /** 1852 * External Dependencies 1853 */ 1854 1855 1856 /** 1857 * WordPress dependencies 1858 */ 1859 1860 1861 1862 1863 1864 1865 1866 var parseDropEvent = function parseDropEvent(event) { 1867 var result = { 1868 srcRootClientId: null, 1869 srcClientId: null, 1870 srcIndex: null, 1871 type: null 1872 }; 1873 1874 if (!event.dataTransfer) { 1875 return result; 1876 } 1877 1878 try { 1879 result = Object.assign(result, JSON.parse(event.dataTransfer.getData('text'))); 1880 } catch (err) { 1881 return result; 1882 } 1883 1884 return result; 1885 }; 1886 1887 var BlockDropZone = 1888 /*#__PURE__*/ 1889 function (_Component) { 1890 Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__["default"])(BlockDropZone, _Component); 1891 1892 function BlockDropZone() { 1893 var _this; 1894 1895 Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__["default"])(this, BlockDropZone); 1896 1897 _this = Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__["default"])(this, Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__["default"])(BlockDropZone).apply(this, arguments)); 1898 _this.onFilesDrop = _this.onFilesDrop.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(_this))); 1899 _this.onHTMLDrop = _this.onHTMLDrop.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(_this))); 1900 _this.onDrop = _this.onDrop.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(_this))); 1901 return _this; 1902 } 1903 1904 Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__["default"])(BlockDropZone, [{ 1905 key: "getInsertIndex", 1906 value: function getInsertIndex(position) { 1907 var index = this.props.index; 1908 1909 if (index !== undefined) { 1910 return position.y === 'top' ? index : index + 1; 1911 } 1912 } 1913 }, { 1914 key: "onFilesDrop", 1915 value: function onFilesDrop(files, position) { 1916 var transformation = Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_10__["findTransform"])(Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_10__["getBlockTransforms"])('from'), function (transform) { 1917 return transform.type === 'files' && transform.isMatch(files); 1918 }); 1919 1920 if (transformation) { 1921 var insertIndex = this.getInsertIndex(position); 1922 var blocks = transformation.transform(files, this.props.updateBlockAttributes); 1923 this.props.insertBlocks(blocks, insertIndex); 1924 } 1925 } 1926 }, { 1927 key: "onHTMLDrop", 1928 value: function onHTMLDrop(HTML, position) { 1929 var blocks = Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_10__["rawHandler"])({ 1930 HTML: HTML, 1931 mode: 'BLOCKS' 1932 }); 1933 1934 if (blocks.length) { 1935 this.props.insertBlocks(blocks, this.getInsertIndex(position)); 1936 } 1937 } 1938 }, { 1939 key: "onDrop", 1940 value: function onDrop(event, position) { 1941 var _this$props = this.props, 1942 dstRootClientId = _this$props.rootClientId, 1943 dstClientId = _this$props.clientId, 1944 dstIndex = _this$props.index, 1945 getClientIdsOfDescendants = _this$props.getClientIdsOfDescendants; 1946 1947 var _parseDropEvent = parseDropEvent(event), 1948 srcRootClientId = _parseDropEvent.srcRootClientId, 1949 srcClientId = _parseDropEvent.srcClientId, 1950 srcIndex = _parseDropEvent.srcIndex, 1951 type = _parseDropEvent.type; 1952 1953 var isBlockDropType = function isBlockDropType(dropType) { 1954 return dropType === 'block'; 1955 }; 1956 1957 var isSameLevel = function isSameLevel(srcRoot, dstRoot) { 1958 // Note that rootClientId of top-level blocks will be undefined OR a void string, 1959 // so we also need to account for that case separately. 1960 return srcRoot === dstRoot || !srcRoot === true && !dstRoot === true; 1961 }; 1962 1963 var isSameBlock = function isSameBlock(src, dst) { 1964 return src === dst; 1965 }; 1966 1967 var isSrcBlockAnAncestorOfDstBlock = function isSrcBlockAnAncestorOfDstBlock(src, dst) { 1968 return getClientIdsOfDescendants([src]).some(function (id) { 1969 return id === dst; 1970 }); 1971 }; 1972 1973 if (!isBlockDropType(type) || isSameBlock(srcClientId, dstClientId) || isSrcBlockAnAncestorOfDstBlock(srcClientId, dstClientId)) { 1974 return; 1975 } 1976 1977 var positionIndex = this.getInsertIndex(position); // If the block is kept at the same level and moved downwards, 1978 // subtract to account for blocks shifting upward to occupy its old position. 1979 1980 var insertIndex = dstIndex && srcIndex < dstIndex && isSameLevel(srcRootClientId, dstRootClientId) ? positionIndex - 1 : positionIndex; 1981 this.props.moveBlockToPosition(srcClientId, srcRootClientId, insertIndex); 1982 } 1983 }, { 1984 key: "render", 1985 value: function render() { 1986 var _this$props2 = this.props, 1987 isLocked = _this$props2.isLocked, 1988 index = _this$props2.index; 1989 1990 if (isLocked) { 1991 return null; 1992 } 1993 1994 var isAppender = index === undefined; 1995 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_9__["DropZone"], { 1996 className: classnames__WEBPACK_IMPORTED_MODULE_8___default()('editor-block-drop-zone', { 1997 'is-appender': isAppender 1998 }), 1999 onFilesDrop: this.onFilesDrop, 2000 onHTMLDrop: this.onHTMLDrop, 2001 onDrop: this.onDrop 2002 }); 2003 } 2004 }]); 2005 2006 return BlockDropZone; 2007 }(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["Component"]); 2008 2009 /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_12__["compose"])(Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_11__["withDispatch"])(function (dispatch, ownProps) { 2010 var _dispatch = dispatch('core/editor'), 2011 _insertBlocks = _dispatch.insertBlocks, 2012 _updateBlockAttributes = _dispatch.updateBlockAttributes, 2013 _moveBlockToPosition = _dispatch.moveBlockToPosition; 2014 2015 return { 2016 insertBlocks: function insertBlocks(blocks, index) { 2017 var rootClientId = ownProps.rootClientId, 2018 layout = ownProps.layout; 2019 2020 if (layout) { 2021 // A block's transform function may return a single 2022 // transformed block or an array of blocks, so ensure 2023 // to first coerce to an array before mapping to inject 2024 // the layout attribute. 2025 blocks = Object(lodash__WEBPACK_IMPORTED_MODULE_7__["castArray"])(blocks).map(function (block) { 2026 return Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_10__["cloneBlock"])(block, { 2027 layout: layout 2028 }); 2029 }); 2030 } 2031 2032 _insertBlocks(blocks, index, rootClientId); 2033 }, 2034 updateBlockAttributes: function updateBlockAttributes() { 2035 _updateBlockAttributes.apply(void 0, arguments); 2036 }, 2037 moveBlockToPosition: function moveBlockToPosition(srcClientId, srcRootClientId, dstIndex) { 2038 var dstRootClientId = ownProps.rootClientId, 2039 layout = ownProps.layout; 2040 2041 _moveBlockToPosition(srcClientId, srcRootClientId, dstRootClientId, layout, dstIndex); 2042 } 2043 }; 2044 }), Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_11__["withSelect"])(function (select, _ref) { 2045 var rootClientId = _ref.rootClientId; 2046 2047 var _select = select('core/editor'), 2048 getClientIdsOfDescendants = _select.getClientIdsOfDescendants, 2049 getTemplateLock = _select.getTemplateLock; 2050 2051 return { 2052 isLocked: !!getTemplateLock(rootClientId), 2053 getClientIdsOfDescendants: getClientIdsOfDescendants 2054 }; 2055 }))(BlockDropZone)); 2056 2057 2058 /***/ }), 2059 2060 /***/ "./node_modules/@wordpress/editor/build-module/components/block-edit/context.js": 2061 /*!**************************************************************************************!*\ 2062 !*** ./node_modules/@wordpress/editor/build-module/components/block-edit/context.js ***! 2063 \**************************************************************************************/ 2064 /*! exports provided: BlockEditContextProvider, withBlockEditContext, ifBlockEditSelected */ 2065 /***/ (function(module, __webpack_exports__, __webpack_require__) { 2066 2067 "use strict"; 2068 __webpack_require__.r(__webpack_exports__); 2069 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BlockEditContextProvider", function() { return Provider; }); 2070 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "withBlockEditContext", function() { return withBlockEditContext; }); 2071 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ifBlockEditSelected", function() { return ifBlockEditSelected; }); 2072 /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js"); 2073 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); 2074 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__); 2075 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! lodash */ "lodash"); 2076 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_2__); 2077 /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose"); 2078 /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_3__); 2079 2080 2081 2082 /** 2083 * External dependencies 2084 */ 2085 2086 /** 2087 * WordPress dependencies 2088 */ 2089 2090 2091 2092 2093 var _createContext = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createContext"])({ 2094 name: '', 2095 isSelected: false, 2096 focusedElement: null, 2097 setFocusedElement: lodash__WEBPACK_IMPORTED_MODULE_2__["noop"], 2098 clientId: null 2099 }), 2100 Consumer = _createContext.Consumer, 2101 Provider = _createContext.Provider; 2102 2103 2104 /** 2105 * A Higher Order Component used to inject BlockEdit context to the 2106 * wrapped component. 2107 * 2108 * @param {Function} mapContextToProps Function called on every context change, 2109 * expected to return object of props to 2110 * merge with the component's own props. 2111 * 2112 * @return {Component} Enhanced component with injected context as props. 2113 */ 2114 2115 var withBlockEditContext = function withBlockEditContext(mapContextToProps) { 2116 return Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_3__["createHigherOrderComponent"])(function (OriginalComponent) { 2117 return function (props) { 2118 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])(Consumer, null, function (context) { 2119 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])(OriginalComponent, Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, props, mapContextToProps(context, props))); 2120 }); 2121 }; 2122 }, 'withBlockEditContext'); 2123 }; 2124 /** 2125 * A Higher Order Component used to render conditionally the wrapped 2126 * component only when the BlockEdit has selected state set. 2127 * 2128 * @param {Component} OriginalComponent Component to wrap. 2129 * 2130 * @return {Component} Component which renders only when the BlockEdit is selected. 2131 */ 2132 2133 var ifBlockEditSelected = Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_3__["createHigherOrderComponent"])(function (OriginalComponent) { 2134 return function (props) { 2135 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])(Consumer, null, function (_ref) { 2136 var isSelected = _ref.isSelected; 2137 return isSelected && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])(OriginalComponent, props); 2138 }); 2139 }; 2140 }, 'ifBlockEditSelected'); 2141 2142 2143 /***/ }), 2144 2145 /***/ "./node_modules/@wordpress/editor/build-module/components/block-edit/edit.js": 2146 /*!***********************************************************************************!*\ 2147 !*** ./node_modules/@wordpress/editor/build-module/components/block-edit/edit.js ***! 2148 \***********************************************************************************/ 2149 /*! exports provided: Edit, default */ 2150 /***/ (function(module, __webpack_exports__, __webpack_require__) { 2151 2152 "use strict"; 2153 __webpack_require__.r(__webpack_exports__); 2154 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Edit", function() { return Edit; }); 2155 /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js"); 2156 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); 2157 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__); 2158 /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); 2159 /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_2__); 2160 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); 2161 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__); 2162 /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks"); 2163 /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_4__); 2164 2165 2166 2167 /** 2168 * External dependencies 2169 */ 2170 2171 /** 2172 * WordPress dependencies 2173 */ 2174 2175 2176 2177 var Edit = function Edit(props) { 2178 var _props$attributes = props.attributes, 2179 attributes = _props$attributes === void 0 ? {} : _props$attributes, 2180 name = props.name; 2181 var blockType = Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_4__["getBlockType"])(name); 2182 2183 if (!blockType) { 2184 return null; 2185 } // Generate a class name for the block's editable form 2186 2187 2188 var generatedClassName = Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_4__["hasBlockSupport"])(blockType, 'className', true) ? Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_4__["getBlockDefaultClassName"])(name) : null; 2189 var className = classnames__WEBPACK_IMPORTED_MODULE_2___default()(generatedClassName, attributes.className); // `edit` and `save` are functions or components describing the markup 2190 // with which a block is displayed. If `blockType` is valid, assign 2191 // them preferentially as the render value for the block. 2192 2193 var Component = blockType.edit || blockType.save; 2194 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])(Component, Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, props, { 2195 className: className 2196 })); 2197 }; 2198 /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__["withFilters"])('editor.BlockEdit')(Edit)); 2199 2200 2201 /***/ }), 2202 2203 /***/ "./node_modules/@wordpress/editor/build-module/components/block-edit/index.js": 2204 /*!************************************************************************************!*\ 2205 !*** ./node_modules/@wordpress/editor/build-module/components/block-edit/index.js ***! 2206 \************************************************************************************/ 2207 /*! exports provided: default */ 2208 /***/ (function(module, __webpack_exports__, __webpack_require__) { 2209 2210 "use strict"; 2211 __webpack_require__.r(__webpack_exports__); 2212 /* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/classCallCheck */ "./node_modules/@babel/runtime/helpers/esm/classCallCheck.js"); 2213 /* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/createClass */ "./node_modules/@babel/runtime/helpers/esm/createClass.js"); 2214 /* harmony import */ var _babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js"); 2215 /* harmony import */ var _babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/esm/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js"); 2216 /* harmony import */ var _babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inherits */ "./node_modules/@babel/runtime/helpers/esm/inherits.js"); 2217 /* harmony import */ var _babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/helpers/esm/assertThisInitialized */ "./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js"); 2218 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); 2219 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__); 2220 /* harmony import */ var _edit__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./edit */ "./node_modules/@wordpress/editor/build-module/components/block-edit/edit.js"); 2221 /* harmony import */ var _context__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./context */ "./node_modules/@wordpress/editor/build-module/components/block-edit/context.js"); 2222 2223 2224 2225 2226 2227 2228 2229 2230 /** 2231 * WordPress dependencies 2232 */ 2233 2234 /** 2235 * Internal dependencies 2236 */ 2237 2238 2239 2240 2241 var BlockEdit = 2242 /*#__PURE__*/ 2243 function (_Component) { 2244 Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__["default"])(BlockEdit, _Component); 2245 2246 function BlockEdit(props) { 2247 var _this; 2248 2249 Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__["default"])(this, BlockEdit); 2250 2251 _this = Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__["default"])(this, Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__["default"])(BlockEdit).call(this, props)); 2252 _this.setFocusedElement = _this.setFocusedElement.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(_this))); 2253 _this.state = { 2254 focusedElement: null, 2255 setFocusedElement: _this.setFocusedElement 2256 }; 2257 return _this; 2258 } 2259 2260 Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__["default"])(BlockEdit, [{ 2261 key: "setFocusedElement", 2262 value: function setFocusedElement(focusedElement) { 2263 this.setState(function (prevState) { 2264 if (prevState.focusedElement === focusedElement) { 2265 return null; 2266 } 2267 2268 return { 2269 focusedElement: focusedElement 2270 }; 2271 }); 2272 } 2273 }, { 2274 key: "render", 2275 value: function render() { 2276 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(_context__WEBPACK_IMPORTED_MODULE_8__["BlockEditContextProvider"], { 2277 value: this.state 2278 }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(_edit__WEBPACK_IMPORTED_MODULE_7__["default"], this.props)); 2279 } 2280 }], [{ 2281 key: "getDerivedStateFromProps", 2282 value: function getDerivedStateFromProps(props) { 2283 var clientId = props.clientId, 2284 name = props.name, 2285 isSelected = props.isSelected; 2286 return { 2287 name: name, 2288 isSelected: isSelected, 2289 clientId: clientId 2290 }; 2291 } 2292 }]); 2293 2294 return BlockEdit; 2295 }(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["Component"]); 2296 2297 /* harmony default export */ __webpack_exports__["default"] = (BlockEdit); 2298 2299 2300 /***/ }), 2301 2302 /***/ "./node_modules/@wordpress/editor/build-module/components/block-format-controls/index.js": 2303 /*!***********************************************************************************************!*\ 2304 !*** ./node_modules/@wordpress/editor/build-module/components/block-format-controls/index.js ***! 2305 \***********************************************************************************************/ 2306 /*! exports provided: default */ 2307 /***/ (function(module, __webpack_exports__, __webpack_require__) { 2308 2309 "use strict"; 2310 __webpack_require__.r(__webpack_exports__); 2311 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); 2312 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__); 2313 /* harmony import */ var _block_edit_context__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../block-edit/context */ "./node_modules/@wordpress/editor/build-module/components/block-edit/context.js"); 2314 /** 2315 * WordPress dependencies 2316 */ 2317 2318 /** 2319 * Internal dependencies 2320 */ 2321 2322 2323 2324 var _createSlotFill = Object(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__["createSlotFill"])('BlockFormatControls'), 2325 Fill = _createSlotFill.Fill, 2326 Slot = _createSlotFill.Slot; 2327 2328 var BlockFormatControls = Object(_block_edit_context__WEBPACK_IMPORTED_MODULE_1__["ifBlockEditSelected"])(Fill); 2329 BlockFormatControls.Slot = Slot; 2330 /* harmony default export */ __webpack_exports__["default"] = (BlockFormatControls); 2331 2332 2333 /***/ }), 2334 2335 /***/ "./node_modules/@wordpress/editor/build-module/components/block-icon/index.js": 2336 /*!************************************************************************************!*\ 2337 !*** ./node_modules/@wordpress/editor/build-module/components/block-icon/index.js ***! 2338 \************************************************************************************/ 2339 /*! exports provided: default */ 2340 /***/ (function(module, __webpack_exports__, __webpack_require__) { 2341 2342 "use strict"; 2343 __webpack_require__.r(__webpack_exports__); 2344 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return BlockIcon; }); 2345 /* harmony import */ var _babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectSpread */ "./node_modules/@babel/runtime/helpers/esm/objectSpread.js"); 2346 /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); 2347 /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_1__); 2348 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); 2349 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__); 2350 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); 2351 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__); 2352 2353 2354 /** 2355 * External dependencies 2356 */ 2357 2358 /** 2359 * WordPress dependencies 2360 */ 2361 2362 2363 2364 2365 function renderIcon(icon) { 2366 if ('string' === typeof icon) { 2367 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__["Dashicon"], { 2368 icon: icon, 2369 size: 20 2370 }); 2371 } else if ('function' === typeof icon) { 2372 if (icon.prototype instanceof _wordpress_element__WEBPACK_IMPORTED_MODULE_3__["Component"]) { 2373 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__["createElement"])(icon); 2374 } 2375 2376 return icon(); 2377 } else if (icon && icon.type === 'svg') { 2378 var appliedProps = Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_0__["default"])({}, icon.props, { 2379 width: icon.props.width || 24, 2380 height: icon.props.height || 24 2381 }); 2382 2383 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__["SVG"], appliedProps); 2384 } 2385 2386 return icon || null; 2387 } 2388 2389 function BlockIcon(_ref) { 2390 var icon = _ref.icon, 2391 _ref$showColors = _ref.showColors, 2392 showColors = _ref$showColors === void 0 ? false : _ref$showColors, 2393 className = _ref.className; 2394 var renderedIcon = renderIcon(icon && icon.src ? icon.src : icon); 2395 var style = showColors ? { 2396 backgroundColor: icon && icon.background, 2397 color: icon && icon.foreground 2398 } : {}; 2399 2400 if (!renderedIcon) { 2401 return null; 2402 } 2403 2404 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__["createElement"])("div", { 2405 style: style, 2406 className: classnames__WEBPACK_IMPORTED_MODULE_1___default()('editor-block-icon', className, { 2407 'has-colors': showColors 2408 }) 2409 }, renderedIcon); 2410 } 2411 2412 2413 /***/ }), 2414 2415 /***/ "./node_modules/@wordpress/editor/build-module/components/block-inspector/index.js": 2416 /*!*****************************************************************************************!*\ 2417 !*** ./node_modules/@wordpress/editor/build-module/components/block-inspector/index.js ***! 2418 \*****************************************************************************************/ 2419 /*! exports provided: default */ 2420 /***/ (function(module, __webpack_exports__, __webpack_require__) { 2421 2422 "use strict"; 2423 __webpack_require__.r(__webpack_exports__); 2424 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); 2425 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); 2426 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lodash */ "lodash"); 2427 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_1__); 2428 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); 2429 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__); 2430 /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks"); 2431 /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_3__); 2432 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); 2433 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_4__); 2434 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); 2435 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_5__); 2436 /* harmony import */ var _skip_to_selected_block__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../skip-to-selected-block */ "./node_modules/@wordpress/editor/build-module/components/skip-to-selected-block/index.js"); 2437 /* harmony import */ var _block_icon__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../block-icon */ "./node_modules/@wordpress/editor/build-module/components/block-icon/index.js"); 2438 /* harmony import */ var _inspector_controls__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../inspector-controls */ "./node_modules/@wordpress/editor/build-module/components/inspector-controls/index.js"); 2439 /* harmony import */ var _inspector_advanced_controls__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../inspector-advanced-controls */ "./node_modules/@wordpress/editor/build-module/components/inspector-advanced-controls/index.js"); 2440 2441 2442 /** 2443 * External dependencies 2444 */ 2445 2446 /** 2447 * WordPress dependencies 2448 */ 2449 2450 2451 2452 2453 2454 /** 2455 * Internal Dependencies 2456 */ 2457 2458 2459 2460 2461 2462 2463 var BlockInspector = function BlockInspector(_ref) { 2464 var selectedBlock = _ref.selectedBlock, 2465 blockType = _ref.blockType, 2466 count = _ref.count; 2467 2468 if (count > 1) { 2469 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("span", { 2470 className: "editor-block-inspector__multi-blocks" 2471 }, Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__["__"])('Coming Soon')); 2472 } 2473 2474 if (!selectedBlock) { 2475 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("span", { 2476 className: "editor-block-inspector__no-blocks" 2477 }, Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__["__"])('No block selected.')); 2478 } 2479 2480 return [Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("div", { 2481 className: "editor-block-inspector__card", 2482 key: "card" 2483 }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_block_icon__WEBPACK_IMPORTED_MODULE_7__["default"], { 2484 icon: blockType.icon, 2485 showColors: true 2486 }), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("div", { 2487 className: "editor-block-inspector__card-content" 2488 }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("div", { 2489 className: "editor-block-inspector__card-title" 2490 }, blockType.title), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("div", { 2491 className: "editor-block-inspector__card-description" 2492 }, blockType.description))), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("div", { 2493 key: "inspector-controls" 2494 }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_inspector_controls__WEBPACK_IMPORTED_MODULE_8__["default"].Slot, null)), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("div", { 2495 key: "inspector-advanced-controls" 2496 }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_inspector_advanced_controls__WEBPACK_IMPORTED_MODULE_9__["default"].Slot, null, function (fills) { 2497 return !Object(lodash__WEBPACK_IMPORTED_MODULE_1__["isEmpty"])(fills) && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_4__["PanelBody"], { 2498 className: "editor-block-inspector__advanced", 2499 title: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__["__"])('Advanced'), 2500 initialOpen: false 2501 }, fills); 2502 })), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_skip_to_selected_block__WEBPACK_IMPORTED_MODULE_6__["default"], { 2503 key: "back" 2504 })]; 2505 }; 2506 2507 /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_5__["withSelect"])(function (select) { 2508 var _select = select('core/editor'), 2509 getSelectedBlock = _select.getSelectedBlock, 2510 getSelectedBlockCount = _select.getSelectedBlockCount; 2511 2512 var selectedBlock = getSelectedBlock(); 2513 var blockType = selectedBlock && Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_3__["getBlockType"])(selectedBlock.name); 2514 return { 2515 selectedBlock: selectedBlock, 2516 blockType: blockType, 2517 count: getSelectedBlockCount() 2518 }; 2519 })(BlockInspector)); 2520 2521 2522 /***/ }), 2523 2524 /***/ "./node_modules/@wordpress/editor/build-module/components/block-list-appender/index.js": 2525 /*!*********************************************************************************************!*\ 2526 !*** ./node_modules/@wordpress/editor/build-module/components/block-list-appender/index.js ***! 2527 \*********************************************************************************************/ 2528 /*! exports provided: default */ 2529 /***/ (function(module, __webpack_exports__, __webpack_require__) { 2530 2531 "use strict"; 2532 __webpack_require__.r(__webpack_exports__); 2533 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); 2534 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); 2535 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lodash */ "lodash"); 2536 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_1__); 2537 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); 2538 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_2__); 2539 /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks"); 2540 /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_3__); 2541 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); 2542 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__); 2543 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); 2544 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_5__); 2545 /* harmony import */ var _ignore_nested_events__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../ignore-nested-events */ "./node_modules/@wordpress/editor/build-module/components/ignore-nested-events/index.js"); 2546 /* harmony import */ var _default_block_appender__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../default-block-appender */ "./node_modules/@wordpress/editor/build-module/components/default-block-appender/index.js"); 2547 /* harmony import */ var _inserter__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../inserter */ "./node_modules/@wordpress/editor/build-module/components/inserter/index.js"); 2548 2549 2550 /** 2551 * External dependencies 2552 */ 2553 2554 /** 2555 * WordPress dependencies 2556 */ 2557 2558 2559 2560 2561 2562 /** 2563 * Internal dependencies 2564 */ 2565 2566 2567 2568 2569 2570 function BlockListAppender(_ref) { 2571 var blockClientIds = _ref.blockClientIds, 2572 layout = _ref.layout, 2573 isGroupedByLayout = _ref.isGroupedByLayout, 2574 rootClientId = _ref.rootClientId, 2575 canInsertDefaultBlock = _ref.canInsertDefaultBlock, 2576 isLocked = _ref.isLocked; 2577 2578 if (isLocked) { 2579 return null; 2580 } 2581 2582 var defaultLayout = isGroupedByLayout ? layout : undefined; 2583 2584 if (canInsertDefaultBlock) { 2585 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_ignore_nested_events__WEBPACK_IMPORTED_MODULE_6__["default"], { 2586 childHandledEvents: ['onFocus', 'onClick', 'onKeyDown'] 2587 }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_default_block_appender__WEBPACK_IMPORTED_MODULE_7__["default"], { 2588 rootClientId: rootClientId, 2589 lastBlockClientId: Object(lodash__WEBPACK_IMPORTED_MODULE_1__["last"])(blockClientIds), 2590 layout: defaultLayout 2591 })); 2592 } 2593 2594 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("div", { 2595 className: "block-list-appender" 2596 }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_inserter__WEBPACK_IMPORTED_MODULE_8__["default"], { 2597 rootClientId: rootClientId, 2598 layout: defaultLayout, 2599 renderToggle: function renderToggle(_ref2) { 2600 var onToggle = _ref2.onToggle, 2601 disabled = _ref2.disabled, 2602 isOpen = _ref2.isOpen; 2603 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_5__["Button"], { 2604 "aria-label": Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__["__"])('Add block'), 2605 onClick: onToggle, 2606 className: "block-list-appender__toggle", 2607 "aria-haspopup": "true", 2608 "aria-expanded": isOpen, 2609 disabled: disabled 2610 }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_5__["Dashicon"], { 2611 icon: "insert" 2612 })); 2613 } 2614 })); 2615 } 2616 2617 /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_2__["withSelect"])(function (select, _ref3) { 2618 var rootClientId = _ref3.rootClientId; 2619 2620 var _select = select('core/editor'), 2621 getBlockOrder = _select.getBlockOrder, 2622 canInsertBlockType = _select.canInsertBlockType, 2623 getTemplateLock = _select.getTemplateLock; 2624 2625 return { 2626 isLocked: !!getTemplateLock(rootClientId), 2627 blockClientIds: getBlockOrder(rootClientId), 2628 canInsertDefaultBlock: canInsertBlockType(Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_3__["getDefaultBlockName"])(), rootClientId) 2629 }; 2630 })(BlockListAppender)); 2631 2632 2633 /***/ }), 2634 2635 /***/ "./node_modules/@wordpress/editor/build-module/components/block-list/block-contextual-toolbar.js": 2636 /*!*******************************************************************************************************!*\ 2637 !*** ./node_modules/@wordpress/editor/build-module/components/block-list/block-contextual-toolbar.js ***! 2638 \*******************************************************************************************************/ 2639 /*! exports provided: default */ 2640 /***/ (function(module, __webpack_exports__, __webpack_require__) { 2641 2642 "use strict"; 2643 __webpack_require__.r(__webpack_exports__); 2644 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); 2645 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); 2646 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); 2647 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__); 2648 /* harmony import */ var _navigable_toolbar__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../navigable-toolbar */ "./node_modules/@wordpress/editor/build-module/components/navigable-toolbar/index.js"); 2649 /* harmony import */ var ___WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../ */ "./node_modules/@wordpress/editor/build-module/components/index.js"); 2650 2651 2652 /** 2653 * WordPress dependencies 2654 */ 2655 2656 /** 2657 * Internal dependencies 2658 */ 2659 2660 2661 2662 2663 function BlockContextualToolbar() { 2664 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_navigable_toolbar__WEBPACK_IMPORTED_MODULE_2__["default"], { 2665 className: "editor-block-contextual-toolbar", 2666 "aria-label": Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__["__"])('Block Toolbar') 2667 }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(___WEBPACK_IMPORTED_MODULE_3__["BlockToolbar"], null)); 2668 } 2669 2670 /* harmony default export */ __webpack_exports__["default"] = (BlockContextualToolbar); 2671 2672 2673 /***/ }), 2674 2675 /***/ "./node_modules/@wordpress/editor/build-module/components/block-list/block-crash-boundary.js": 2676 /*!***************************************************************************************************!*\ 2677 !*** ./node_modules/@wordpress/editor/build-module/components/block-list/block-crash-boundary.js ***! 2678 \***************************************************************************************************/ 2679 /*! exports provided: default */ 2680 /***/ (function(module, __webpack_exports__, __webpack_require__) { 2681 2682 "use strict"; 2683 __webpack_require__.r(__webpack_exports__); 2684 /* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/classCallCheck */ "./node_modules/@babel/runtime/helpers/esm/classCallCheck.js"); 2685 /* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/createClass */ "./node_modules/@babel/runtime/helpers/esm/createClass.js"); 2686 /* harmony import */ var _babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js"); 2687 /* harmony import */ var _babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/esm/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js"); 2688 /* harmony import */ var _babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inherits */ "./node_modules/@babel/runtime/helpers/esm/inherits.js"); 2689 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); 2690 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_5__); 2691 2692 2693 2694 2695 2696 2697 /** 2698 * WordPress dependencies 2699 */ 2700 2701 2702 var BlockCrashBoundary = 2703 /*#__PURE__*/ 2704 function (_Component) { 2705 Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__["default"])(BlockCrashBoundary, _Component); 2706 2707 function BlockCrashBoundary() { 2708 var _this; 2709 2710 Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__["default"])(this, BlockCrashBoundary); 2711 2712 _this = Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__["default"])(this, Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__["default"])(BlockCrashBoundary).apply(this, arguments)); 2713 _this.state = { 2714 hasError: false 2715 }; 2716 return _this; 2717 } 2718 2719 Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__["default"])(BlockCrashBoundary, [{ 2720 key: "componentDidCatch", 2721 value: function componentDidCatch(error) { 2722 this.props.onError(error); 2723 this.setState({ 2724 hasError: true 2725 }); 2726 } 2727 }, { 2728 key: "render", 2729 value: function render() { 2730 if (this.state.hasError) { 2731 return null; 2732 } 2733 2734 return this.props.children; 2735 } 2736 }]); 2737 2738 return BlockCrashBoundary; 2739 }(_wordpress_element__WEBPACK_IMPORTED_MODULE_5__["Component"]); 2740 2741 /* harmony default export */ __webpack_exports__["default"] = (BlockCrashBoundary); 2742 2743 2744 /***/ }), 2745 2746 /***/ "./node_modules/@wordpress/editor/build-module/components/block-list/block-crash-warning.js": 2747 /*!**************************************************************************************************!*\ 2748 !*** ./node_modules/@wordpress/editor/build-module/components/block-list/block-crash-warning.js ***! 2749 \**************************************************************************************************/ 2750 /*! exports provided: default */ 2751 /***/ (function(module, __webpack_exports__, __webpack_require__) { 2752 2753 "use strict"; 2754 __webpack_require__.r(__webpack_exports__); 2755 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); 2756 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); 2757 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); 2758 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__); 2759 /* harmony import */ var _warning__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../warning */ "./node_modules/@wordpress/editor/build-module/components/warning/index.js"); 2760 2761 2762 /** 2763 * WordPress dependencies 2764 */ 2765 2766 /** 2767 * Internal dependencies 2768 */ 2769 2770 2771 var warning = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_warning__WEBPACK_IMPORTED_MODULE_2__["default"], null, Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__["__"])('This block has encountered an error and cannot be previewed.')); 2772 /* harmony default export */ __webpack_exports__["default"] = (function () { 2773 return warning; 2774 }); 2775 2776 2777 /***/ }), 2778 2779 /***/ "./node_modules/@wordpress/editor/build-module/components/block-list/block-html.js": 2780 /*!*****************************************************************************************!*\ 2781 !*** ./node_modules/@wordpress/editor/build-module/components/block-list/block-html.js ***! 2782 \*****************************************************************************************/ 2783 /*! exports provided: BlockHTML, default */ 2784 /***/ (function(module, __webpack_exports__, __webpack_require__) { 2785 2786 "use strict"; 2787 __webpack_require__.r(__webpack_exports__); 2788 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BlockHTML", function() { return BlockHTML; }); 2789 /* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/classCallCheck */ "./node_modules/@babel/runtime/helpers/esm/classCallCheck.js"); 2790 /* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/createClass */ "./node_modules/@babel/runtime/helpers/esm/createClass.js"); 2791 /* harmony import */ var _babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js"); 2792 /* harmony import */ var _babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/esm/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js"); 2793 /* harmony import */ var _babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inherits */ "./node_modules/@babel/runtime/helpers/esm/inherits.js"); 2794 /* harmony import */ var _babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/helpers/esm/assertThisInitialized */ "./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js"); 2795 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); 2796 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__); 2797 /* harmony import */ var react_autosize_textarea__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! react-autosize-textarea */ "./node_modules/react-autosize-textarea/lib/index.js"); 2798 /* harmony import */ var react_autosize_textarea__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(react_autosize_textarea__WEBPACK_IMPORTED_MODULE_7__); 2799 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! lodash */ "lodash"); 2800 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_8__); 2801 /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose"); 2802 /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_9__); 2803 /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks"); 2804 /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_10__); 2805 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); 2806 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_11__); 2807 2808 2809 2810 2811 2812 2813 2814 2815 /** 2816 * External Dependencies 2817 */ 2818 2819 2820 /** 2821 * WordPress Dependencies 2822 */ 2823 2824 2825 2826 2827 2828 var BlockHTML = 2829 /*#__PURE__*/ 2830 function (_Component) { 2831 Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__["default"])(BlockHTML, _Component); 2832 2833 function BlockHTML(props) { 2834 var _this; 2835 2836 Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__["default"])(this, BlockHTML); 2837 2838 _this = Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__["default"])(this, Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__["default"])(BlockHTML).apply(this, arguments)); 2839 _this.onChange = _this.onChange.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(_this))); 2840 _this.onBlur = _this.onBlur.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(_this))); 2841 _this.state = { 2842 html: props.block.isValid ? Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_10__["getBlockContent"])(props.block) : props.block.originalContent 2843 }; 2844 return _this; 2845 } 2846 2847 Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__["default"])(BlockHTML, [{ 2848 key: "componentDidUpdate", 2849 value: function componentDidUpdate(prevProps) { 2850 if (!Object(lodash__WEBPACK_IMPORTED_MODULE_8__["isEqual"])(this.props.block.attributes, prevProps.block.attributes)) { 2851 this.setState({ 2852 html: Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_10__["getBlockContent"])(this.props.block) 2853 }); 2854 } 2855 } 2856 }, { 2857 key: "onBlur", 2858 value: function onBlur() { 2859 var html = this.state.html; 2860 var blockType = Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_10__["getBlockType"])(this.props.block.name); 2861 var attributes = Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_10__["getBlockAttributes"])(blockType, html, this.props.block.attributes); // If html is empty we reset the block to the default HTML and mark it as valid to avoid triggering an error 2862 2863 var content = html ? html : Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_10__["getSaveContent"])(blockType, attributes); 2864 var isValid = html ? Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_10__["isValidBlock"])(content, blockType, attributes) : true; 2865 this.props.onChange(this.props.clientId, attributes, content, isValid); // Ensure the state is updated if we reset so it displays the default content 2866 2867 if (!html) { 2868 this.setState({ 2869 html: content 2870 }); 2871 } 2872 } 2873 }, { 2874 key: "onChange", 2875 value: function onChange(event) { 2876 this.setState({ 2877 html: event.target.value 2878 }); 2879 } 2880 }, { 2881 key: "render", 2882 value: function render() { 2883 var html = this.state.html; 2884 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(react_autosize_textarea__WEBPACK_IMPORTED_MODULE_7___default.a, { 2885 className: "editor-block-list__block-html-textarea", 2886 value: html, 2887 onBlur: this.onBlur, 2888 onChange: this.onChange 2889 }); 2890 } 2891 }]); 2892 2893 return BlockHTML; 2894 }(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["Component"]); 2895 /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_9__["compose"])([Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_11__["withSelect"])(function (select, ownProps) { 2896 return { 2897 block: select('core/editor').getBlock(ownProps.clientId) 2898 }; 2899 }), Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_11__["withDispatch"])(function (dispatch) { 2900 return { 2901 onChange: function onChange(clientId, attributes, originalContent, isValid) { 2902 dispatch('core/editor').updateBlock(clientId, { 2903 attributes: attributes, 2904 originalContent: originalContent, 2905 isValid: isValid 2906 }); 2907 } 2908 }; 2909 })])(BlockHTML)); 2910 2911 2912 /***/ }), 2913 2914 /***/ "./node_modules/@wordpress/editor/build-module/components/block-list/block-invalid-warning.js": 2915 /*!****************************************************************************************************!*\ 2916 !*** ./node_modules/@wordpress/editor/build-module/components/block-list/block-invalid-warning.js ***! 2917 \****************************************************************************************************/ 2918 /*! exports provided: BlockInvalidWarning, default */ 2919 /***/ (function(module, __webpack_exports__, __webpack_require__) { 2920 2921 "use strict"; 2922 __webpack_require__.r(__webpack_exports__); 2923 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BlockInvalidWarning", function() { return BlockInvalidWarning; }); 2924 /* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/classCallCheck */ "./node_modules/@babel/runtime/helpers/esm/classCallCheck.js"); 2925 /* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/createClass */ "./node_modules/@babel/runtime/helpers/esm/createClass.js"); 2926 /* harmony import */ var _babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js"); 2927 /* harmony import */ var _babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/esm/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js"); 2928 /* harmony import */ var _babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inherits */ "./node_modules/@babel/runtime/helpers/esm/inherits.js"); 2929 /* harmony import */ var _babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/helpers/esm/assertThisInitialized */ "./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js"); 2930 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); 2931 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__); 2932 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); 2933 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_7__); 2934 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); 2935 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_8__); 2936 /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks"); 2937 /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_9__); 2938 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); 2939 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_10__); 2940 /* harmony import */ var _warning__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../warning */ "./node_modules/@wordpress/editor/build-module/components/warning/index.js"); 2941 /* harmony import */ var _block_compare__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../block-compare */ "./node_modules/@wordpress/editor/build-module/components/block-compare/index.js"); 2942 2943 2944 2945 2946 2947 2948 2949 2950 /** 2951 * WordPress dependencies 2952 */ 2953 2954 2955 2956 2957 2958 /** 2959 * Internal dependencies 2960 */ 2961 2962 2963 2964 var BlockInvalidWarning = 2965 /*#__PURE__*/ 2966 function (_Component) { 2967 Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__["default"])(BlockInvalidWarning, _Component); 2968 2969 function BlockInvalidWarning(props) { 2970 var _this; 2971 2972 Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__["default"])(this, BlockInvalidWarning); 2973 2974 _this = Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__["default"])(this, Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__["default"])(BlockInvalidWarning).call(this, props)); 2975 _this.state = { 2976 compare: false 2977 }; 2978 _this.onCompare = _this.onCompare.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(_this))); 2979 _this.onCompareClose = _this.onCompareClose.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(_this))); 2980 return _this; 2981 } 2982 2983 Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__["default"])(BlockInvalidWarning, [{ 2984 key: "onCompare", 2985 value: function onCompare() { 2986 this.setState({ 2987 compare: true 2988 }); 2989 } 2990 }, { 2991 key: "onCompareClose", 2992 value: function onCompareClose() { 2993 this.setState({ 2994 compare: false 2995 }); 2996 } 2997 }, { 2998 key: "render", 2999 value: function render() { 3000 var _this$props = this.props, 3001 convertToHTML = _this$props.convertToHTML, 3002 convertToBlocks = _this$props.convertToBlocks, 3003 convertToClassic = _this$props.convertToClassic, 3004 block = _this$props.block; 3005 var hasHTMLBlock = !!Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_9__["getBlockType"])('core/html'); 3006 var compare = this.state.compare; 3007 var hiddenActions = [{ 3008 title: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_7__["__"])('Convert to Classic Block'), 3009 onClick: convertToClassic 3010 }]; 3011 3012 if (compare) { 3013 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_8__["Modal"], { 3014 title: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_7__["__"])('Resolve Block'), 3015 onRequestClose: this.onCompareClose, 3016 className: "editor-block-compare" 3017 }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(_block_compare__WEBPACK_IMPORTED_MODULE_12__["default"], { 3018 block: block, 3019 onKeep: convertToHTML, 3020 onConvert: convertToBlocks, 3021 convertor: blockToBlocks, 3022 convertButtonText: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_7__["__"])('Convert to Blocks') 3023 })); 3024 } 3025 3026 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(_warning__WEBPACK_IMPORTED_MODULE_11__["default"], { 3027 actions: [Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_8__["Button"], { 3028 key: "convert", 3029 onClick: this.onCompare, 3030 isLarge: true, 3031 isPrimary: !hasHTMLBlock 3032 }, Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_7__["__"])('Resolve')), hasHTMLBlock && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_8__["Button"], { 3033 key: "edit", 3034 onClick: convertToHTML, 3035 isLarge: true, 3036 isPrimary: true 3037 }, Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_7__["__"])('Convert to HTML'))], 3038 secondaryActions: hiddenActions 3039 }, Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_7__["__"])('This block contains unexpected or invalid content.')); 3040 } 3041 }]); 3042 3043 return BlockInvalidWarning; 3044 }(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["Component"]); 3045 3046 var blockToClassic = function blockToClassic(block) { 3047 return Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_9__["createBlock"])('core/freeform', { 3048 content: block.originalContent 3049 }); 3050 }; 3051 3052 var blockToHTML = function blockToHTML(block) { 3053 return Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_9__["createBlock"])('core/html', { 3054 content: block.originalContent 3055 }); 3056 }; 3057 3058 var blockToBlocks = function blockToBlocks(block) { 3059 return Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_9__["rawHandler"])({ 3060 HTML: block.originalContent, 3061 mode: 'BLOCKS' 3062 }); 3063 }; 3064 3065 /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_10__["withDispatch"])(function (dispatch, _ref) { 3066 var block = _ref.block; 3067 3068 var _dispatch = dispatch('core/editor'), 3069 replaceBlock = _dispatch.replaceBlock; 3070 3071 return { 3072 convertToClassic: function convertToClassic() { 3073 replaceBlock(block.clientId, blockToClassic(block)); 3074 }, 3075 convertToHTML: function convertToHTML() { 3076 replaceBlock(block.clientId, blockToHTML(block)); 3077 }, 3078 convertToBlocks: function convertToBlocks() { 3079 replaceBlock(block.clientId, blockToBlocks(block)); 3080 } 3081 }; 3082 })(BlockInvalidWarning)); 3083 3084 3085 /***/ }), 3086 3087 /***/ "./node_modules/@wordpress/editor/build-module/components/block-list/block-mobile-toolbar.js": 3088 /*!***************************************************************************************************!*\ 3089 !*** ./node_modules/@wordpress/editor/build-module/components/block-list/block-mobile-toolbar.js ***! 3090 \***************************************************************************************************/ 3091 /*! exports provided: default */ 3092 /***/ (function(module, __webpack_exports__, __webpack_require__) { 3093 3094 "use strict"; 3095 __webpack_require__.r(__webpack_exports__); 3096 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); 3097 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); 3098 /* harmony import */ var _wordpress_viewport__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/viewport */ "@wordpress/viewport"); 3099 /* harmony import */ var _wordpress_viewport__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_viewport__WEBPACK_IMPORTED_MODULE_1__); 3100 /* harmony import */ var _block_mover__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../block-mover */ "./node_modules/@wordpress/editor/build-module/components/block-mover/index.js"); 3101 /* harmony import */ var _inserter__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../inserter */ "./node_modules/@wordpress/editor/build-module/components/inserter/index.js"); 3102 3103 3104 /** 3105 * WordPress dependencies 3106 */ 3107 3108 /** 3109 * Internal dependencies 3110 */ 3111 3112 3113 3114 3115 function BlockMobileToolbar(_ref) { 3116 var clientId = _ref.clientId; 3117 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("div", { 3118 className: "editor-block-list__block-mobile-toolbar" 3119 }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_inserter__WEBPACK_IMPORTED_MODULE_3__["default"], null), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_block_mover__WEBPACK_IMPORTED_MODULE_2__["default"], { 3120 clientIds: [clientId] 3121 })); 3122 } 3123 3124 /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_viewport__WEBPACK_IMPORTED_MODULE_1__["ifViewportMatches"])('< small')(BlockMobileToolbar)); 3125 3126 3127 /***/ }), 3128 3129 /***/ "./node_modules/@wordpress/editor/build-module/components/block-list/block.js": 3130 /*!************************************************************************************!*\ 3131 !*** ./node_modules/@wordpress/editor/build-module/components/block-list/block.js ***! 3132 \************************************************************************************/ 3133 /*! exports provided: BlockListBlock, default */ 3134 /***/ (function(module, __webpack_exports__, __webpack_require__) { 3135 3136 "use strict"; 3137 __webpack_require__.r(__webpack_exports__); 3138 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BlockListBlock", function() { return BlockListBlock; }); 3139 /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js"); 3140 /* harmony import */ var _babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectSpread */ "./node_modules/@babel/runtime/helpers/esm/objectSpread.js"); 3141 /* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/classCallCheck */ "./node_modules/@babel/runtime/helpers/esm/classCallCheck.js"); 3142 /* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/esm/createClass */ "./node_modules/@babel/runtime/helpers/esm/createClass.js"); 3143 /* harmony import */ var _babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/esm/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js"); 3144 /* harmony import */ var _babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/helpers/esm/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js"); 3145 /* harmony import */ var _babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inherits */ "./node_modules/@babel/runtime/helpers/esm/inherits.js"); 3146 /* harmony import */ var _babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @babel/runtime/helpers/esm/assertThisInitialized */ "./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js"); 3147 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); 3148 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__); 3149 /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); 3150 /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_9__); 3151 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! lodash */ "lodash"); 3152 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_10__); 3153 /* harmony import */ var _wordpress_dom__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @wordpress/dom */ "@wordpress/dom"); 3154 /* harmony import */ var _wordpress_dom__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(_wordpress_dom__WEBPACK_IMPORTED_MODULE_11__); 3155 /* harmony import */ var _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @wordpress/keycodes */ "@wordpress/keycodes"); 3156 /* harmony import */ var _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(_wordpress_keycodes__WEBPACK_IMPORTED_MODULE_12__); 3157 /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks"); 3158 /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_13__); 3159 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); 3160 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_14___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_14__); 3161 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); 3162 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_15___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_15__); 3163 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); 3164 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_16___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_16__); 3165 /* harmony import */ var _wordpress_viewport__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! @wordpress/viewport */ "@wordpress/viewport"); 3166 /* harmony import */ var _wordpress_viewport__WEBPACK_IMPORTED_MODULE_17___default = /*#__PURE__*/__webpack_require__.n(_wordpress_viewport__WEBPACK_IMPORTED_MODULE_17__); 3167 /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose"); 3168 /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_18___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_18__); 3169 /* harmony import */ var _block_edit__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ../block-edit */ "./node_modules/@wordpress/editor/build-module/components/block-edit/index.js"); 3170 /* harmony import */ var _block_mover__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ../block-mover */ "./node_modules/@wordpress/editor/build-module/components/block-mover/index.js"); 3171 /* harmony import */ var _block_drop_zone__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ../block-drop-zone */ "./node_modules/@wordpress/editor/build-module/components/block-drop-zone/index.js"); 3172 /* harmony import */ var _block_invalid_warning__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./block-invalid-warning */ "./node_modules/@wordpress/editor/build-module/components/block-list/block-invalid-warning.js"); 3173 /* harmony import */ var _block_crash_warning__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./block-crash-warning */ "./node_modules/@wordpress/editor/build-module/components/block-list/block-crash-warning.js"); 3174 /* harmony import */ var _block_crash_boundary__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./block-crash-boundary */ "./node_modules/@wordpress/editor/build-module/components/block-list/block-crash-boundary.js"); 3175 /* harmony import */ var _block_html__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./block-html */ "./node_modules/@wordpress/editor/build-module/components/block-list/block-html.js"); 3176 /* harmony import */ var _breadcrumb__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ./breadcrumb */ "./node_modules/@wordpress/editor/build-module/components/block-list/breadcrumb.js"); 3177 /* harmony import */ var _block_contextual_toolbar__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ./block-contextual-toolbar */ "./node_modules/@wordpress/editor/build-module/components/block-list/block-contextual-toolbar.js"); 3178 /* harmony import */ var _multi_controls__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ./multi-controls */ "./node_modules/@wordpress/editor/build-module/components/block-list/multi-controls.js"); 3179 /* harmony import */ var _block_mobile_toolbar__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ./block-mobile-toolbar */ "./node_modules/@wordpress/editor/build-module/components/block-list/block-mobile-toolbar.js"); 3180 /* harmony import */ var _insertion_point__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ./insertion-point */ "./node_modules/@wordpress/editor/build-module/components/block-list/insertion-point.js"); 3181 /* harmony import */ var _ignore_nested_events__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ../ignore-nested-events */ "./node_modules/@wordpress/editor/build-module/components/ignore-nested-events/index.js"); 3182 /* harmony import */ var _inserter_with_shortcuts__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! ../inserter-with-shortcuts */ "./node_modules/@wordpress/editor/build-module/components/inserter-with-shortcuts/index.js"); 3183 /* harmony import */ var _inserter__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! ../inserter */ "./node_modules/@wordpress/editor/build-module/components/inserter/index.js"); 3184 /* harmony import */ var _with_hover_areas__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(/*! ./with-hover-areas */ "./node_modules/@wordpress/editor/build-module/components/block-list/with-hover-areas.js"); 3185 3186 3187 3188 3189 3190 3191 3192 3193 3194 3195 /** 3196 * External dependencies 3197 */ 3198 3199 3200 /** 3201 * WordPress dependencies 3202 */ 3203 3204 3205 3206 3207 3208 3209 3210 3211 3212 3213 /** 3214 * Internal dependencies 3215 */ 3216 3217 3218 3219 3220 3221 3222 3223 3224 3225 3226 3227 3228 3229 3230 3231 3232 3233 var BlockListBlock = 3234 /*#__PURE__*/ 3235 function (_Component) { 3236 Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_6__["default"])(BlockListBlock, _Component); 3237 3238 function BlockListBlock() { 3239 var _this; 3240 3241 Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_2__["default"])(this, BlockListBlock); 3242 3243 _this = Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_4__["default"])(this, Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_5__["default"])(BlockListBlock).apply(this, arguments)); 3244 _this.setBlockListRef = _this.setBlockListRef.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(_this))); 3245 _this.bindBlockNode = _this.bindBlockNode.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(_this))); 3246 _this.setAttributes = _this.setAttributes.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(_this))); 3247 _this.maybeHover = _this.maybeHover.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(_this))); 3248 _this.hideHoverEffects = _this.hideHoverEffects.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(_this))); 3249 _this.mergeBlocks = _this.mergeBlocks.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(_this))); 3250 _this.insertBlocksAfter = _this.insertBlocksAfter.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(_this))); 3251 _this.onFocus = _this.onFocus.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(_this))); 3252 _this.preventDrag = _this.preventDrag.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(_this))); 3253 _this.onPointerDown = _this.onPointerDown.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(_this))); 3254 _this.deleteOrInsertAfterWrapper = _this.deleteOrInsertAfterWrapper.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(_this))); 3255 _this.onBlockError = _this.onBlockError.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(_this))); 3256 _this.onTouchStart = _this.onTouchStart.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(_this))); 3257 _this.onClick = _this.onClick.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(_this))); 3258 _this.onDragStart = _this.onDragStart.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(_this))); 3259 _this.onDragEnd = _this.onDragEnd.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(_this))); 3260 _this.selectOnOpen = _this.selectOnOpen.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(_this))); 3261 _this.hadTouchStart = false; 3262 _this.state = { 3263 error: null, 3264 dragging: false, 3265 isHovered: false 3266 }; 3267 return _this; 3268 } 3269 3270 Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_3__["default"])(BlockListBlock, [{ 3271 key: "componentDidMount", 3272 value: function componentDidMount() { 3273 if (this.props.isSelected) { 3274 this.focusTabbable(); 3275 } 3276 } 3277 }, { 3278 key: "componentDidUpdate", 3279 value: function componentDidUpdate(prevProps) { 3280 if (this.props.isTypingWithinBlock || this.props.isSelected) { 3281 this.hideHoverEffects(); 3282 } 3283 3284 if (this.props.isSelected && !prevProps.isSelected) { 3285 this.focusTabbable(); 3286 } 3287 } 3288 }, { 3289 key: "setBlockListRef", 3290 value: function setBlockListRef(node) { 3291 // Disable reason: The root return element uses a component to manage 3292 // event nesting, but the parent block list layout needs the raw DOM 3293 // node to track multi-selection. 3294 // 3295 // eslint-disable-next-line react/no-find-dom-node 3296 node = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["findDOMNode"])(node); 3297 this.wrapperNode = node; 3298 this.props.blockRef(node, this.props.clientId); 3299 } 3300 }, { 3301 key: "bindBlockNode", 3302 value: function bindBlockNode(node) { 3303 // Disable reason: The block element uses a component to manage event 3304 // nesting, but we rely on a raw DOM node for focusing. 3305 // 3306 // eslint-disable-next-line react/no-find-dom-node 3307 this.node = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["findDOMNode"])(node); 3308 } 3309 /** 3310 * When a block becomes selected, transition focus to an inner tabbable. 3311 */ 3312 3313 }, { 3314 key: "focusTabbable", 3315 value: function focusTabbable() { 3316 var initialPosition = this.props.initialPosition; // Focus is captured by the wrapper node, so while focus transition 3317 // should only consider tabbables within editable display, since it 3318 // may be the wrapper itself or a side control which triggered the 3319 // focus event, don't unnecessary transition to an inner tabbable. 3320 3321 if (this.wrapperNode.contains(document.activeElement)) { 3322 return; 3323 } // Find all tabbables within node. 3324 3325 3326 var textInputs = _wordpress_dom__WEBPACK_IMPORTED_MODULE_11__["focus"].tabbable.find(this.node).filter(_wordpress_dom__WEBPACK_IMPORTED_MODULE_11__["isTextField"]); // If reversed (e.g. merge via backspace), use the last in the set of 3327 // tabbables. 3328 3329 var isReverse = -1 === initialPosition; 3330 var target = (isReverse ? lodash__WEBPACK_IMPORTED_MODULE_10__["last"] : lodash__WEBPACK_IMPORTED_MODULE_10__["first"])(textInputs); 3331 3332 if (!target) { 3333 this.wrapperNode.focus(); 3334 return; 3335 } 3336 3337 target.focus(); // In reverse case, need to explicitly place caret position. 3338 3339 if (isReverse) { 3340 Object(_wordpress_dom__WEBPACK_IMPORTED_MODULE_11__["placeCaretAtHorizontalEdge"])(target, true); 3341 Object(_wordpress_dom__WEBPACK_IMPORTED_MODULE_11__["placeCaretAtVerticalEdge"])(target, true); 3342 } 3343 } 3344 }, { 3345 key: "setAttributes", 3346 value: function setAttributes(attributes) { 3347 var _this$props = this.props, 3348 block = _this$props.block, 3349 onChange = _this$props.onChange; 3350 var type = Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_13__["getBlockType"])(block.name); 3351 onChange(block.clientId, attributes); 3352 var metaAttributes = Object(lodash__WEBPACK_IMPORTED_MODULE_10__["reduce"])(attributes, function (result, value, key) { 3353 if (Object(lodash__WEBPACK_IMPORTED_MODULE_10__["get"])(type, ['attributes', key, 'source']) === 'meta') { 3354 result[type.attributes[key].meta] = value; 3355 } 3356 3357 return result; 3358 }, {}); 3359 3360 if (Object(lodash__WEBPACK_IMPORTED_MODULE_10__["size"])(metaAttributes)) { 3361 this.props.onMetaChange(Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_1__["default"])({}, this.props.meta, metaAttributes)); 3362 } 3363 } 3364 }, { 3365 key: "onTouchStart", 3366 value: function onTouchStart() { 3367 // Detect touchstart to disable hover on iOS 3368 this.hadTouchStart = true; 3369 } 3370 }, { 3371 key: "onClick", 3372 value: function onClick() { 3373 // Clear touchstart detection 3374 // Browser will try to emulate mouse events also see https://www.html5rocks.com/en/mobile/touchandmouse/ 3375 this.hadTouchStart = false; 3376 } 3377 /** 3378 * A mouseover event handler to apply hover effect when a pointer device is 3379 * placed within the bounds of the block. The mouseover event is preferred 3380 * over mouseenter because it may be the case that a previous mouseenter 3381 * event was blocked from being handled by a IgnoreNestedEvents component, 3382 * therefore transitioning out of a nested block to the bounds of the block 3383 * would otherwise not trigger a hover effect. 3384 * 3385 * @see https://developer.mozilla.org/en-US/docs/Web/Events/mouseenter 3386 */ 3387 3388 }, { 3389 key: "maybeHover", 3390 value: function maybeHover() { 3391 var _this$props2 = this.props, 3392 isPartOfMultiSelection = _this$props2.isPartOfMultiSelection, 3393 isSelected = _this$props2.isSelected; 3394 var isHovered = this.state.isHovered; 3395 3396 if (isHovered || isPartOfMultiSelection || isSelected || this.props.isMultiSelecting || this.hadTouchStart) { 3397 return; 3398 } 3399 3400 this.setState({ 3401 isHovered: true 3402 }); 3403 } 3404 /** 3405 * Sets the block state as unhovered if currently hovering. There are cases 3406 * where mouseleave may occur but the block is not hovered (multi-select), 3407 * so to avoid unnecesary renders, the state is only set if hovered. 3408 */ 3409 3410 }, { 3411 key: "hideHoverEffects", 3412 value: function hideHoverEffects() { 3413 if (this.state.isHovered) { 3414 this.setState({ 3415 isHovered: false 3416 }); 3417 } 3418 } 3419 }, { 3420 key: "mergeBlocks", 3421 value: function mergeBlocks() { 3422 var forward = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; 3423 var _this$props3 = this.props, 3424 block = _this$props3.block, 3425 previousBlockClientId = _this$props3.previousBlockClientId, 3426 nextBlockClientId = _this$props3.nextBlockClientId, 3427 onMerge = _this$props3.onMerge; // Do nothing when it's the first block. 3428 3429 if (!forward && !previousBlockClientId || forward && !nextBlockClientId) { 3430 return; 3431 } 3432 3433 if (forward) { 3434 onMerge(block.clientId, nextBlockClientId); 3435 } else { 3436 onMerge(previousBlockClientId, block.clientId); 3437 } 3438 } 3439 }, { 3440 key: "insertBlocksAfter", 3441 value: function insertBlocksAfter(blocks) { 3442 this.props.onInsertBlocks(blocks, this.props.order + 1); 3443 } 3444 /** 3445 * Marks the block as selected when focused and not already selected. This 3446 * specifically handles the case where block does not set focus on its own 3447 * (via `setFocus`), typically if there is no focusable input in the block. 3448 * 3449 * @return {void} 3450 */ 3451 3452 }, { 3453 key: "onFocus", 3454 value: function onFocus() { 3455 if (!this.props.isSelected && !this.props.isPartOfMultiSelection) { 3456 this.props.onSelect(); 3457 } 3458 } 3459 /** 3460 * Prevents default dragging behavior within a block to allow for multi- 3461 * selection to take effect unhampered. 3462 * 3463 * @param {DragEvent} event Drag event. 3464 * 3465 * @return {void} 3466 */ 3467 3468 }, { 3469 key: "preventDrag", 3470 value: function preventDrag(event) { 3471 event.preventDefault(); 3472 } 3473 /** 3474 * Begins tracking cursor multi-selection when clicking down within block. 3475 * 3476 * @param {MouseEvent} event A mousedown event. 3477 * 3478 * @return {void} 3479 */ 3480 3481 }, { 3482 key: "onPointerDown", 3483 value: function onPointerDown(event) { 3484 // Not the main button. 3485 // https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/button 3486 if (event.button !== 0) { 3487 return; 3488 } 3489 3490 if (event.shiftKey) { 3491 if (!this.props.isSelected) { 3492 this.props.onShiftSelection(this.props.clientId); 3493 event.preventDefault(); 3494 } 3495 } else { 3496 this.props.onSelectionStart(this.props.clientId); // Allow user to escape out of a multi-selection to a singular 3497 // selection of a block via click. This is handled here since 3498 // onFocus excludes blocks involved in a multiselection, as 3499 // focus can be incurred by starting a multiselection (focus 3500 // moved to first block's multi-controls). 3501 3502 if (this.props.isPartOfMultiSelection) { 3503 this.props.onSelect(); 3504 } 3505 } 3506 } 3507 /** 3508 * Interprets keydown event intent to remove or insert after block if key 3509 * event occurs on wrapper node. This can occur when the block has no text 3510 * fields of its own, particularly after initial insertion, to allow for 3511 * easy deletion and continuous writing flow to add additional content. 3512 * 3513 * @param {KeyboardEvent} event Keydown event. 3514 */ 3515 3516 }, { 3517 key: "deleteOrInsertAfterWrapper", 3518 value: function deleteOrInsertAfterWrapper(event) { 3519 var keyCode = event.keyCode, 3520 target = event.target; 3521 3522 if (target !== this.wrapperNode || this.props.isLocked) { 3523 return; 3524 } 3525 3526 switch (keyCode) { 3527 case _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_12__["ENTER"]: 3528 // Insert default block after current block if enter and event 3529 // not already handled by descendant. 3530 this.props.onInsertDefaultBlockAfter(); 3531 event.preventDefault(); 3532 break; 3533 3534 case _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_12__["BACKSPACE"]: 3535 case _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_12__["DELETE"]: 3536 // Remove block on backspace. 3537 var _this$props4 = this.props, 3538 clientId = _this$props4.clientId, 3539 onRemove = _this$props4.onRemove; 3540 onRemove(clientId); 3541 event.preventDefault(); 3542 break; 3543 } 3544 } 3545 }, { 3546 key: "onBlockError", 3547 value: function onBlockError(error) { 3548 this.setState({ 3549 error: error 3550 }); 3551 } 3552 }, { 3553 key: "onDragStart", 3554 value: function onDragStart() { 3555 this.setState({ 3556 dragging: true 3557 }); 3558 } 3559 }, { 3560 key: "onDragEnd", 3561 value: function onDragEnd() { 3562 this.setState({ 3563 dragging: false 3564 }); 3565 } 3566 }, { 3567 key: "selectOnOpen", 3568 value: function selectOnOpen(open) { 3569 if (open && !this.props.isSelected) { 3570 this.props.onSelect(); 3571 } 3572 } 3573 }, { 3574 key: "render", 3575 value: function render() { 3576 var _this$props5 = this.props, 3577 block = _this$props5.block, 3578 order = _this$props5.order, 3579 mode = _this$props5.mode, 3580 isFocusMode = _this$props5.isFocusMode, 3581 hasFixedToolbar = _this$props5.hasFixedToolbar, 3582 isLocked = _this$props5.isLocked, 3583 isFirst = _this$props5.isFirst, 3584 isLast = _this$props5.isLast, 3585 clientId = _this$props5.clientId, 3586 rootClientId = _this$props5.rootClientId, 3587 layout = _this$props5.layout, 3588 isSelected = _this$props5.isSelected, 3589 isPartOfMultiSelection = _this$props5.isPartOfMultiSelection, 3590 isFirstMultiSelected = _this$props5.isFirstMultiSelected, 3591 isTypingWithinBlock = _this$props5.isTypingWithinBlock, 3592 isMultiSelecting = _this$props5.isMultiSelecting, 3593 hoverArea = _this$props5.hoverArea, 3594 isEmptyDefaultBlock = _this$props5.isEmptyDefaultBlock, 3595 isMovable = _this$props5.isMovable, 3596 isPreviousBlockADefaultEmptyBlock = _this$props5.isPreviousBlockADefaultEmptyBlock, 3597 hasSelectedInnerBlock = _this$props5.hasSelectedInnerBlock, 3598 isParentOfSelectedBlock = _this$props5.isParentOfSelectedBlock, 3599 hasMultiSelection = _this$props5.hasMultiSelection, 3600 isDraggable = _this$props5.isDraggable; 3601 var isHovered = this.state.isHovered && !isMultiSelecting; 3602 var blockName = block.name, 3603 isValid = block.isValid; 3604 var blockType = Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_13__["getBlockType"])(blockName); // translators: %s: Type of block (i.e. Text, Image etc) 3605 3606 var blockLabel = Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_15__["sprintf"])(Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_15__["__"])('Block: %s'), blockType.title); // The block as rendered in the editor is composed of general block UI 3607 // (mover, toolbar, wrapper) and the display of the block content. 3608 // If the block is selected and we're typing the block should not appear. 3609 // Empty paragraph blocks should always show up as unselected. 3610 3611 var showEmptyBlockSideInserter = (isSelected || isHovered) && isEmptyDefaultBlock && isValid; 3612 var showSideInserter = (isSelected || isHovered) && isEmptyDefaultBlock; 3613 var shouldAppearSelected = !isFocusMode && !hasFixedToolbar && !showSideInserter && isSelected && !isTypingWithinBlock; 3614 var shouldAppearSelectedParent = !isFocusMode && !hasFixedToolbar && !showSideInserter && hasSelectedInnerBlock && !isTypingWithinBlock && !hasMultiSelection; 3615 var shouldAppearHovered = !isFocusMode && !hasFixedToolbar && isHovered && !isEmptyDefaultBlock; // We render block movers and block settings to keep them tabbale even if hidden 3616 3617 var shouldRenderMovers = !isFocusMode && (isSelected || hoverArea === 'left') && !showEmptyBlockSideInserter && !isMultiSelecting && !isPartOfMultiSelection && !isTypingWithinBlock; 3618 var shouldShowBreadcrumb = !isFocusMode && isHovered && !isEmptyDefaultBlock; 3619 var shouldShowContextualToolbar = !hasFixedToolbar && !showSideInserter && (isSelected && !isTypingWithinBlock || isFirstMultiSelected); 3620 var shouldShowMobileToolbar = shouldAppearSelected; 3621 var _this$state = this.state, 3622 error = _this$state.error, 3623 dragging = _this$state.dragging; // Insertion point can only be made visible when the side inserter is 3624 // not present, and either the block is at the extent of a selection or 3625 // is the first block in the top-level list rendering. 3626 3627 var shouldShowInsertionPoint = isPartOfMultiSelection && isFirst || !isPartOfMultiSelection; 3628 var canShowInBetweenInserter = !isEmptyDefaultBlock && !isPreviousBlockADefaultEmptyBlock; // Generate the wrapper class names handling the different states of the block. 3629 3630 var wrapperClassName = classnames__WEBPACK_IMPORTED_MODULE_9___default()('editor-block-list__block', { 3631 'has-warning': !isValid || !!error, 3632 'is-selected': shouldAppearSelected, 3633 'is-multi-selected': isPartOfMultiSelection, 3634 'is-selected-parent': shouldAppearSelectedParent, 3635 'is-hovered': shouldAppearHovered, 3636 'is-reusable': Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_13__["isReusableBlock"])(blockType), 3637 'is-dragging': dragging, 3638 'is-typing': isTypingWithinBlock, 3639 'is-focused': isFocusMode && (isSelected || isParentOfSelectedBlock), 3640 'is-focus-mode': isFocusMode 3641 }); 3642 var onReplace = this.props.onReplace; // Determine whether the block has props to apply to the wrapper. 3643 3644 var wrapperProps = this.props.wrapperProps; 3645 3646 if (blockType.getEditWrapperProps) { 3647 wrapperProps = Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_1__["default"])({}, wrapperProps, blockType.getEditWrapperProps(block.attributes)); 3648 } 3649 3650 var blockElementId = "block-".concat(clientId); // We wrap the BlockEdit component in a div that hides it when editing in 3651 // HTML mode. This allows us to render all of the ancillary pieces 3652 // (InspectorControls, etc.) which are inside `BlockEdit` but not 3653 // `BlockHTML`, even in HTML mode. 3654 3655 var blockEdit = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["createElement"])(_block_edit__WEBPACK_IMPORTED_MODULE_19__["default"], { 3656 name: blockName, 3657 isSelected: isSelected, 3658 attributes: block.attributes, 3659 setAttributes: this.setAttributes, 3660 insertBlocksAfter: isLocked ? undefined : this.insertBlocksAfter, 3661 onReplace: isLocked ? undefined : onReplace, 3662 mergeBlocks: isLocked ? undefined : this.mergeBlocks, 3663 clientId: clientId, 3664 isSelectionEnabled: this.props.isSelectionEnabled, 3665 toggleSelection: this.props.toggleSelection 3666 }); 3667 3668 if (mode !== 'visual') { 3669 blockEdit = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["createElement"])("div", { 3670 style: { 3671 display: 'none' 3672 } 3673 }, blockEdit); 3674 } // Disable reasons: 3675 // 3676 // jsx-a11y/mouse-events-have-key-events: 3677 // - onMouseOver is explicitly handling hover effects 3678 // 3679 // jsx-a11y/no-static-element-interactions: 3680 // - Each block can be selected by clicking on it 3681 3682 /* eslint-disable jsx-a11y/mouse-events-have-key-events, jsx-a11y/no-static-element-interactions, jsx-a11y/onclick-has-role, jsx-a11y/click-events-have-key-events */ 3683 3684 3685 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["createElement"])(_ignore_nested_events__WEBPACK_IMPORTED_MODULE_31__["default"], Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({ 3686 id: blockElementId, 3687 ref: this.setBlockListRef, 3688 onMouseOver: this.maybeHover, 3689 onMouseOverHandled: this.hideHoverEffects, 3690 onMouseLeave: this.hideHoverEffects, 3691 className: wrapperClassName, 3692 "data-type": block.name, 3693 onTouchStart: this.onTouchStart, 3694 onFocus: this.onFocus, 3695 onClick: this.onClick, 3696 onKeyDown: this.deleteOrInsertAfterWrapper, 3697 tabIndex: "0", 3698 "aria-label": blockLabel, 3699 childHandledEvents: ['onDragStart', 'onMouseDown'] 3700 }, wrapperProps), shouldShowInsertionPoint && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["createElement"])(_insertion_point__WEBPACK_IMPORTED_MODULE_30__["default"], { 3701 clientId: clientId, 3702 rootClientId: rootClientId, 3703 layout: layout, 3704 canShowInserter: canShowInBetweenInserter, 3705 onInsert: this.hideHoverEffects 3706 }), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["createElement"])(_block_drop_zone__WEBPACK_IMPORTED_MODULE_21__["default"], { 3707 index: order, 3708 clientId: clientId, 3709 rootClientId: rootClientId, 3710 layout: layout 3711 }), shouldRenderMovers && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["createElement"])(_block_mover__WEBPACK_IMPORTED_MODULE_20__["default"], { 3712 clientIds: clientId, 3713 blockElementId: blockElementId, 3714 isFirst: isFirst, 3715 isLast: isLast, 3716 isHidden: !(isHovered || isSelected) || hoverArea !== 'left', 3717 isDraggable: isDraggable !== false && !isPartOfMultiSelection && isMovable, 3718 onDragStart: this.onDragStart, 3719 onDragEnd: this.onDragEnd 3720 }), shouldShowBreadcrumb && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["createElement"])(_breadcrumb__WEBPACK_IMPORTED_MODULE_26__["default"], { 3721 clientId: clientId, 3722 isHidden: !(isHovered || isSelected) || hoverArea !== 'left' 3723 }), shouldShowContextualToolbar && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["createElement"])(_block_contextual_toolbar__WEBPACK_IMPORTED_MODULE_27__["default"], null), isFirstMultiSelected && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["createElement"])(_multi_controls__WEBPACK_IMPORTED_MODULE_28__["default"], { 3724 rootClientId: rootClientId 3725 }), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["createElement"])(_ignore_nested_events__WEBPACK_IMPORTED_MODULE_31__["default"], { 3726 ref: this.bindBlockNode, 3727 onDragStart: this.preventDrag, 3728 onMouseDown: this.onPointerDown, 3729 className: "editor-block-list__block-edit", 3730 "data-block": clientId 3731 }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["createElement"])(_block_crash_boundary__WEBPACK_IMPORTED_MODULE_24__["default"], { 3732 onError: this.onBlockError 3733 }, isValid && blockEdit, isValid && mode === 'html' && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["createElement"])(_block_html__WEBPACK_IMPORTED_MODULE_25__["default"], { 3734 clientId: clientId 3735 }), !isValid && [Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["createElement"])(_block_invalid_warning__WEBPACK_IMPORTED_MODULE_22__["default"], { 3736 key: "invalid-warning", 3737 block: block 3738 }), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["createElement"])("div", { 3739 key: "invalid-preview" 3740 }, Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_13__["getSaveElement"])(blockType, block.attributes))]), shouldShowMobileToolbar && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["createElement"])(_block_mobile_toolbar__WEBPACK_IMPORTED_MODULE_29__["default"], { 3741 clientId: clientId 3742 }), !!error && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["createElement"])(_block_crash_warning__WEBPACK_IMPORTED_MODULE_23__["default"], null)), showEmptyBlockSideInserter && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["createElement"])(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["Fragment"], null, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["createElement"])("div", { 3743 className: "editor-block-list__side-inserter" 3744 }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["createElement"])(_inserter_with_shortcuts__WEBPACK_IMPORTED_MODULE_32__["default"], { 3745 clientId: clientId, 3746 rootClientId: rootClientId, 3747 layout: layout, 3748 onToggle: this.selectOnOpen 3749 })), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["createElement"])("div", { 3750 className: "editor-block-list__empty-block-inserter" 3751 }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["createElement"])(_inserter__WEBPACK_IMPORTED_MODULE_33__["default"], { 3752 position: "top right", 3753 onToggle: this.selectOnOpen 3754 })))); 3755 /* eslint-enable jsx-a11y/no-static-element-interactions, jsx-a11y/onclick-has-role, jsx-a11y/click-events-have-key-events */ 3756 } 3757 }]); 3758 3759 return BlockListBlock; 3760 }(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["Component"]); 3761 var applyWithSelect = Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_16__["withSelect"])(function (select, _ref) { 3762 var clientId = _ref.clientId, 3763 rootClientId = _ref.rootClientId, 3764 isLargeViewport = _ref.isLargeViewport; 3765 3766 var _select = select('core/editor'), 3767 isBlockSelected = _select.isBlockSelected, 3768 getPreviousBlockClientId = _select.getPreviousBlockClientId, 3769 getNextBlockClientId = _select.getNextBlockClientId, 3770 getBlock = _select.getBlock, 3771 isAncestorMultiSelected = _select.isAncestorMultiSelected, 3772 isBlockMultiSelected = _select.isBlockMultiSelected, 3773 isFirstMultiSelectedBlock = _select.isFirstMultiSelectedBlock, 3774 isMultiSelecting = _select.isMultiSelecting, 3775 isTyping = _select.isTyping, 3776 getBlockIndex = _select.getBlockIndex, 3777 getEditedPostAttribute = _select.getEditedPostAttribute, 3778 getBlockMode = _select.getBlockMode, 3779 isSelectionEnabled = _select.isSelectionEnabled, 3780 getSelectedBlocksInitialCaretPosition = _select.getSelectedBlocksInitialCaretPosition, 3781 getEditorSettings = _select.getEditorSettings, 3782 hasSelectedInnerBlock = _select.hasSelectedInnerBlock, 3783 getTemplateLock = _select.getTemplateLock, 3784 hasMultiSelection = _select.hasMultiSelection; 3785 3786 var isSelected = isBlockSelected(clientId); 3787 3788 var _getEditorSettings = getEditorSettings(), 3789 hasFixedToolbar = _getEditorSettings.hasFixedToolbar, 3790 focusMode = _getEditorSettings.focusMode; 3791 3792 var block = getBlock(clientId); 3793 var previousBlockClientId = getPreviousBlockClientId(clientId); 3794 var previousBlock = getBlock(previousBlockClientId); 3795 var templateLock = getTemplateLock(rootClientId); 3796 var isParentOfSelectedBlock = hasSelectedInnerBlock(clientId, true); 3797 return { 3798 nextBlockClientId: getNextBlockClientId(clientId), 3799 isPartOfMultiSelection: isBlockMultiSelected(clientId) || isAncestorMultiSelected(clientId), 3800 isFirstMultiSelected: isFirstMultiSelectedBlock(clientId), 3801 isMultiSelecting: isMultiSelecting(), 3802 hasSelectedInnerBlock: hasSelectedInnerBlock(clientId, false), 3803 // We only care about this prop when the block is selected 3804 // Thus to avoid unnecessary rerenders we avoid updating the prop if the block is not selected. 3805 isTypingWithinBlock: (isSelected || isParentOfSelectedBlock) && isTyping(), 3806 order: getBlockIndex(clientId, rootClientId), 3807 meta: getEditedPostAttribute('meta'), 3808 mode: getBlockMode(clientId), 3809 isSelectionEnabled: isSelectionEnabled(), 3810 initialPosition: getSelectedBlocksInitialCaretPosition(), 3811 isEmptyDefaultBlock: block && Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_13__["isUnmodifiedDefaultBlock"])(block), 3812 isPreviousBlockADefaultEmptyBlock: previousBlock && Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_13__["isUnmodifiedDefaultBlock"])(previousBlock), 3813 isMovable: 'all' !== templateLock, 3814 isLocked: !!templateLock, 3815 isFocusMode: focusMode && isLargeViewport, 3816 hasFixedToolbar: hasFixedToolbar && isLargeViewport, 3817 previousBlockClientId: previousBlockClientId, 3818 block: block, 3819 isSelected: isSelected, 3820 isParentOfSelectedBlock: isParentOfSelectedBlock, 3821 hasMultiSelection: hasMultiSelection() 3822 }; 3823 }); 3824 var applyWithDispatch = Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_16__["withDispatch"])(function (dispatch, ownProps) { 3825 var _dispatch = dispatch('core/editor'), 3826 updateBlockAttributes = _dispatch.updateBlockAttributes, 3827 selectBlock = _dispatch.selectBlock, 3828 insertBlocks = _dispatch.insertBlocks, 3829 insertDefaultBlock = _dispatch.insertDefaultBlock, 3830 removeBlock = _dispatch.removeBlock, 3831 mergeBlocks = _dispatch.mergeBlocks, 3832 replaceBlocks = _dispatch.replaceBlocks, 3833 editPost = _dispatch.editPost, 3834 _toggleSelection = _dispatch.toggleSelection; 3835 3836 return { 3837 onChange: function onChange(clientId, attributes) { 3838 updateBlockAttributes(clientId, attributes); 3839 }, 3840 onSelect: function onSelect() { 3841 var clientId = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ownProps.clientId; 3842 var initialPosition = arguments.length > 1 ? arguments[1] : undefined; 3843 selectBlock(clientId, initialPosition); 3844 }, 3845 onInsertBlocks: function onInsertBlocks(blocks, index) { 3846 var rootClientId = ownProps.rootClientId, 3847 layout = ownProps.layout; 3848 blocks = blocks.map(function (block) { 3849 return Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_13__["cloneBlock"])(block, { 3850 layout: layout 3851 }); 3852 }); 3853 insertBlocks(blocks, index, rootClientId); 3854 }, 3855 onInsertDefaultBlockAfter: function onInsertDefaultBlockAfter() { 3856 var order = ownProps.order, 3857 rootClientId = ownProps.rootClientId; 3858 insertDefaultBlock({}, rootClientId, order + 1); 3859 }, 3860 onRemove: function onRemove(clientId) { 3861 removeBlock(clientId); 3862 }, 3863 onMerge: function onMerge() { 3864 mergeBlocks.apply(void 0, arguments); 3865 }, 3866 onReplace: function onReplace(blocks) { 3867 var layout = ownProps.layout; 3868 blocks = Object(lodash__WEBPACK_IMPORTED_MODULE_10__["castArray"])(blocks).map(function (block) { 3869 return Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_13__["cloneBlock"])(block, { 3870 layout: layout 3871 }); 3872 }); 3873 replaceBlocks([ownProps.clientId], blocks); 3874 }, 3875 onMetaChange: function onMetaChange(meta) { 3876 editPost({ 3877 meta: meta 3878 }); 3879 }, 3880 toggleSelection: function toggleSelection(selectionEnabled) { 3881 _toggleSelection(selectionEnabled); 3882 } 3883 }; 3884 }); 3885 /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_18__["compose"])(Object(_wordpress_viewport__WEBPACK_IMPORTED_MODULE_17__["withViewportMatch"])({ 3886 isLargeViewport: 'medium' 3887 }), applyWithSelect, applyWithDispatch, Object(_wordpress_components__WEBPACK_IMPORTED_MODULE_14__["withFilters"])('editor.BlockListBlock'), _with_hover_areas__WEBPACK_IMPORTED_MODULE_34__["default"])(BlockListBlock)); 3888 3889 3890 /***/ }), 3891 3892 /***/ "./node_modules/@wordpress/editor/build-module/components/block-list/breadcrumb.js": 3893 /*!*****************************************************************************************!*\ 3894 !*** ./node_modules/@wordpress/editor/build-module/components/block-list/breadcrumb.js ***! 3895 \*****************************************************************************************/ 3896 /*! exports provided: BlockBreadcrumb, default */ 3897 /***/ (function(module, __webpack_exports__, __webpack_require__) { 3898 3899 "use strict"; 3900 __webpack_require__.r(__webpack_exports__); 3901 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BlockBreadcrumb", function() { return BlockBreadcrumb; }); 3902 /* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/classCallCheck */ "./node_modules/@babel/runtime/helpers/esm/classCallCheck.js"); 3903 /* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/createClass */ "./node_modules/@babel/runtime/helpers/esm/createClass.js"); 3904 /* harmony import */ var _babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js"); 3905 /* harmony import */ var _babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/esm/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js"); 3906 /* harmony import */ var _babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inherits */ "./node_modules/@babel/runtime/helpers/esm/inherits.js"); 3907 /* harmony import */ var _babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/helpers/esm/assertThisInitialized */ "./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js"); 3908 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); 3909 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__); 3910 /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); 3911 /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_7__); 3912 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); 3913 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_8__); 3914 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); 3915 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_9__); 3916 /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose"); 3917 /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_10__); 3918 /* harmony import */ var _block_title__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../block-title */ "./node_modules/@wordpress/editor/build-module/components/block-title/index.js"); 3919 3920 3921 3922 3923 3924 3925 3926 3927 /** 3928 * External dependencies 3929 */ 3930 3931 /** 3932 * WordPress dependencies 3933 */ 3934 3935 3936 3937 3938 3939 /** 3940 * Internal dependencies 3941 */ 3942 3943 3944 /** 3945 * Block breadcrumb component, displaying the label of the block. If the block 3946 * descends from a root block, a button is displayed enabling the user to select 3947 * the root block. 3948 * 3949 * @param {string} props.clientId Client ID of block. 3950 * @param {string} props.rootClientId Client ID of block's root. 3951 * @param {Function} props.selectRootBlock Callback to select root block. 3952 */ 3953 3954 var BlockBreadcrumb = 3955 /*#__PURE__*/ 3956 function (_Component) { 3957 Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__["default"])(BlockBreadcrumb, _Component); 3958 3959 function BlockBreadcrumb() { 3960 var _this; 3961 3962 Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__["default"])(this, BlockBreadcrumb); 3963 3964 _this = Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__["default"])(this, Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__["default"])(BlockBreadcrumb).apply(this, arguments)); 3965 _this.state = { 3966 isFocused: false 3967 }; 3968 _this.onFocus = _this.onFocus.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(_this))); 3969 _this.onBlur = _this.onBlur.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(_this))); 3970 return _this; 3971 } 3972 3973 Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__["default"])(BlockBreadcrumb, [{ 3974 key: "onFocus", 3975 value: function onFocus(event) { 3976 this.setState({ 3977 isFocused: true 3978 }); // This is used for improved interoperability 3979 // with the block's `onFocus` handler which selects the block, thus conflicting 3980 // with the intention to select the root block. 3981 3982 event.stopPropagation(); 3983 } 3984 }, { 3985 key: "onBlur", 3986 value: function onBlur() { 3987 this.setState({ 3988 isFocused: false 3989 }); 3990 } 3991 }, { 3992 key: "render", 3993 value: function render() { 3994 var _this$props = this.props, 3995 clientId = _this$props.clientId, 3996 rootClientId = _this$props.rootClientId, 3997 isLight = _this$props.isLight; 3998 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("div", { 3999 className: classnames__WEBPACK_IMPORTED_MODULE_7___default()('editor-block-list__breadcrumb', { 4000 'is-light': isLight 4001 }) 4002 }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_8__["Toolbar"], null, rootClientId && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["Fragment"], null, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(_block_title__WEBPACK_IMPORTED_MODULE_11__["default"], { 4003 clientId: rootClientId 4004 }), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("span", { 4005 className: "editor-block-list__descendant-arrow" 4006 })), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(_block_title__WEBPACK_IMPORTED_MODULE_11__["default"], { 4007 clientId: clientId 4008 }))); 4009 } 4010 }]); 4011 4012 return BlockBreadcrumb; 4013 }(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["Component"]); 4014 /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_10__["compose"])([Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_9__["withSelect"])(function (select, ownProps) { 4015 var _select = select('core/editor'), 4016 getBlockRootClientId = _select.getBlockRootClientId, 4017 getEditorSettings = _select.getEditorSettings; 4018 4019 var clientId = ownProps.clientId; 4020 return { 4021 rootClientId: getBlockRootClientId(clientId), 4022 isLight: getEditorSettings().hasFixedToolbar 4023 }; 4024 })])(BlockBreadcrumb)); 4025 4026 4027 /***/ }), 4028 4029 /***/ "./node_modules/@wordpress/editor/build-module/components/block-list/index.js": 4030 /*!************************************************************************************!*\ 4031 !*** ./node_modules/@wordpress/editor/build-module/components/block-list/index.js ***! 4032 \************************************************************************************/ 4033 /*! exports provided: default */ 4034 /***/ (function(module, __webpack_exports__, __webpack_require__) { 4035 4036 "use strict"; 4037 __webpack_require__.r(__webpack_exports__); 4038 /* harmony import */ var _babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/defineProperty */ "./node_modules/@babel/runtime/helpers/esm/defineProperty.js"); 4039 /* harmony import */ var _babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectSpread */ "./node_modules/@babel/runtime/helpers/esm/objectSpread.js"); 4040 /* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/classCallCheck */ "./node_modules/@babel/runtime/helpers/esm/classCallCheck.js"); 4041 /* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/esm/createClass */ "./node_modules/@babel/runtime/helpers/esm/createClass.js"); 4042 /* harmony import */ var _babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/esm/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js"); 4043 /* harmony import */ var _babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/helpers/esm/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js"); 4044 /* harmony import */ var _babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inherits */ "./node_modules/@babel/runtime/helpers/esm/inherits.js"); 4045 /* harmony import */ var _babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @babel/runtime/helpers/esm/assertThisInitialized */ "./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js"); 4046 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); 4047 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__); 4048 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! lodash */ "lodash"); 4049 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_9__); 4050 /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); 4051 /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_10__); 4052 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); 4053 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_11__); 4054 /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose"); 4055 /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_12__); 4056 /* harmony import */ var _block__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./block */ "./node_modules/@wordpress/editor/build-module/components/block-list/block.js"); 4057 /* harmony import */ var _block_list_appender__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../block-list-appender */ "./node_modules/@wordpress/editor/build-module/components/block-list-appender/index.js"); 4058 4059 4060 4061 4062 4063 4064 4065 4066 4067 4068 /** 4069 * External dependencies 4070 */ 4071 4072 4073 /** 4074 * WordPress dependencies 4075 */ 4076 4077 4078 4079 4080 /** 4081 * Internal dependencies 4082 */ 4083 4084 4085 4086 4087 var BlockList = 4088 /*#__PURE__*/ 4089 function (_Component) { 4090 Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_6__["default"])(BlockList, _Component); 4091 4092 function BlockList(props) { 4093 var _this; 4094 4095 Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_2__["default"])(this, BlockList); 4096 4097 _this = Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_4__["default"])(this, Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_5__["default"])(BlockList).call(this, props)); 4098 _this.onSelectionStart = _this.onSelectionStart.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(_this))); 4099 _this.onSelectionEnd = _this.onSelectionEnd.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(_this))); 4100 _this.onShiftSelection = _this.onShiftSelection.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(_this))); 4101 _this.setBlockRef = _this.setBlockRef.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(_this))); 4102 _this.setLastClientY = _this.setLastClientY.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(_this))); 4103 _this.onPointerMove = Object(lodash__WEBPACK_IMPORTED_MODULE_9__["throttle"])(_this.onPointerMove.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(_this))), 100); // Browser does not fire `*move` event when the pointer position changes 4104 // relative to the document, so fire it with the last known position. 4105 4106 _this.onScroll = function () { 4107 return _this.onPointerMove({ 4108 clientY: _this.lastClientY 4109 }); 4110 }; 4111 4112 _this.lastClientY = 0; 4113 _this.nodes = {}; 4114 return _this; 4115 } 4116 4117 Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_3__["default"])(BlockList, [{ 4118 key: "componentDidMount", 4119 value: function componentDidMount() { 4120 window.addEventListener('mousemove', this.setLastClientY); 4121 } 4122 }, { 4123 key: "componentWillUnmount", 4124 value: function componentWillUnmount() { 4125 window.removeEventListener('mousemove', this.setLastClientY); 4126 } 4127 }, { 4128 key: "setLastClientY", 4129 value: function setLastClientY(_ref) { 4130 var clientY = _ref.clientY; 4131 this.lastClientY = clientY; 4132 } 4133 }, { 4134 key: "setBlockRef", 4135 value: function setBlockRef(node, clientId) { 4136 if (node === null) { 4137 delete this.nodes[clientId]; 4138 } else { 4139 this.nodes = Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_1__["default"])({}, this.nodes, Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__["default"])({}, clientId, node)); 4140 } 4141 } 4142 /** 4143 * Handles a pointer move event to update the extent of the current cursor 4144 * multi-selection. 4145 * 4146 * @param {MouseEvent} event A mousemove event object. 4147 * 4148 * @return {void} 4149 */ 4150 4151 }, { 4152 key: "onPointerMove", 4153 value: function onPointerMove(_ref2) { 4154 var clientY = _ref2.clientY; 4155 4156 // We don't start multi-selection until the mouse starts moving, so as 4157 // to avoid dispatching multi-selection actions on an in-place click. 4158 if (!this.props.isMultiSelecting) { 4159 this.props.onStartMultiSelect(); 4160 } 4161 4162 var boundaries = this.nodes[this.selectionAtStart].getBoundingClientRect(); 4163 var y = clientY - boundaries.top; 4164 var key = Object(lodash__WEBPACK_IMPORTED_MODULE_9__["findLast"])(this.coordMapKeys, function (coordY) { 4165 return coordY < y; 4166 }); 4167 this.onSelectionChange(this.coordMap[key]); 4168 } 4169 /** 4170 * Binds event handlers to the document for tracking a pending multi-select 4171 * in response to a mousedown event occurring in a rendered block. 4172 * 4173 * @param {string} clientId Client ID of block where mousedown occurred. 4174 * 4175 * @return {void} 4176 */ 4177 4178 }, { 4179 key: "onSelectionStart", 4180 value: function onSelectionStart(clientId) { 4181 if (!this.props.isSelectionEnabled) { 4182 return; 4183 } 4184 4185 var boundaries = this.nodes[clientId].getBoundingClientRect(); // Create a clientId to Y coördinate map. 4186 4187 var clientIdToCoordMap = Object(lodash__WEBPACK_IMPORTED_MODULE_9__["mapValues"])(this.nodes, function (node) { 4188 return node.getBoundingClientRect().top - boundaries.top; 4189 }); // Cache a Y coördinate to clientId map for use in `onPointerMove`. 4190 4191 this.coordMap = Object(lodash__WEBPACK_IMPORTED_MODULE_9__["invert"])(clientIdToCoordMap); // Cache an array of the Y coördinates for use in `onPointerMove`. 4192 // Sort the coördinates, as `this.nodes` will not necessarily reflect 4193 // the current block sequence. 4194 4195 this.coordMapKeys = Object(lodash__WEBPACK_IMPORTED_MODULE_9__["sortBy"])(Object.values(clientIdToCoordMap)); 4196 this.selectionAtStart = clientId; 4197 window.addEventListener('mousemove', this.onPointerMove); // Capture scroll on all elements. 4198 4199 window.addEventListener('scroll', this.onScroll, true); 4200 window.addEventListener('mouseup', this.onSelectionEnd); 4201 } 4202 /** 4203 * Handles multi-selection changes in response to pointer move. 4204 * 4205 * @param {string} clientId Client ID of block under cursor in multi-select 4206 * drag. 4207 */ 4208 4209 }, { 4210 key: "onSelectionChange", 4211 value: function onSelectionChange(clientId) { 4212 var _this$props = this.props, 4213 onMultiSelect = _this$props.onMultiSelect, 4214 selectionStart = _this$props.selectionStart, 4215 selectionEnd = _this$props.selectionEnd; 4216 var selectionAtStart = this.selectionAtStart; 4217 var isAtStart = selectionAtStart === clientId; 4218 4219 if (!selectionAtStart || !this.props.isSelectionEnabled) { 4220 return; 4221 } // If multi-selecting and cursor extent returns to the start of 4222 // selection, cancel multi-select. 4223 4224 4225 if (isAtStart && selectionStart) { 4226 onMultiSelect(null, null); 4227 } // Expand multi-selection to block under cursor. 4228 4229 4230 if (!isAtStart && selectionEnd !== clientId) { 4231 onMultiSelect(selectionAtStart, clientId); 4232 } 4233 } 4234 /** 4235 * Handles a mouseup event to end the current cursor multi-selection. 4236 * 4237 * @return {void} 4238 */ 4239 4240 }, { 4241 key: "onSelectionEnd", 4242 value: function onSelectionEnd() { 4243 // Cancel throttled calls. 4244 this.onPointerMove.cancel(); 4245 delete this.coordMap; 4246 delete this.coordMapKeys; 4247 delete this.selectionAtStart; 4248 window.removeEventListener('mousemove', this.onPointerMove); 4249 window.removeEventListener('scroll', this.onScroll, true); 4250 window.removeEventListener('mouseup', this.onSelectionEnd); // We may or may not be in a multi-selection when mouseup occurs (e.g. 4251 // an in-place mouse click), so only trigger stop if multi-selecting. 4252 4253 if (this.props.isMultiSelecting) { 4254 this.props.onStopMultiSelect(); 4255 } 4256 } 4257 }, { 4258 key: "onShiftSelection", 4259 value: function onShiftSelection(clientId) { 4260 if (!this.props.isSelectionEnabled) { 4261 return; 4262 } 4263 4264 var _this$props2 = this.props, 4265 selectionStartClientId = _this$props2.selectionStartClientId, 4266 onMultiSelect = _this$props2.onMultiSelect, 4267 onSelect = _this$props2.onSelect; 4268 4269 if (selectionStartClientId) { 4270 onMultiSelect(selectionStartClientId, clientId); 4271 } else { 4272 onSelect(clientId); 4273 } 4274 } 4275 }, { 4276 key: "render", 4277 value: function render() { 4278 var _this2 = this; 4279 4280 var _this$props3 = this.props, 4281 blockClientIds = _this$props3.blockClientIds, 4282 layout = _this$props3.layout, 4283 isGroupedByLayout = _this$props3.isGroupedByLayout, 4284 rootClientId = _this$props3.rootClientId, 4285 isDraggable = _this$props3.isDraggable; 4286 var defaultLayout; 4287 4288 if (isGroupedByLayout) { 4289 defaultLayout = layout; 4290 } 4291 4292 var classes = classnames__WEBPACK_IMPORTED_MODULE_10___default()('editor-block-list__layout', Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__["default"])({}, "layout-".concat(layout), layout)); 4293 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["createElement"])("div", { 4294 className: classes 4295 }, Object(lodash__WEBPACK_IMPORTED_MODULE_9__["map"])(blockClientIds, function (clientId, blockIndex) { 4296 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["createElement"])(_block__WEBPACK_IMPORTED_MODULE_13__["default"], { 4297 key: 'block-' + clientId, 4298 index: blockIndex, 4299 clientId: clientId, 4300 blockRef: _this2.setBlockRef, 4301 onSelectionStart: _this2.onSelectionStart, 4302 onShiftSelection: _this2.onShiftSelection, 4303 rootClientId: rootClientId, 4304 layout: defaultLayout, 4305 isFirst: blockIndex === 0, 4306 isLast: blockIndex === blockClientIds.length - 1, 4307 isDraggable: isDraggable 4308 }); 4309 }), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["createElement"])(_block_list_appender__WEBPACK_IMPORTED_MODULE_14__["default"], { 4310 rootClientId: rootClientId, 4311 layout: layout, 4312 isGroupedByLayout: isGroupedByLayout 4313 })); 4314 } 4315 }]); 4316 4317 return BlockList; 4318 }(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["Component"]); 4319 4320 /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_12__["compose"])([Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_11__["withSelect"])(function (select, ownProps) { 4321 var _select = select('core/editor'), 4322 getBlockOrder = _select.getBlockOrder, 4323 isSelectionEnabled = _select.isSelectionEnabled, 4324 isMultiSelecting = _select.isMultiSelecting, 4325 getMultiSelectedBlocksStartClientId = _select.getMultiSelectedBlocksStartClientId, 4326 getMultiSelectedBlocksEndClientId = _select.getMultiSelectedBlocksEndClientId, 4327 getBlockSelectionStart = _select.getBlockSelectionStart; 4328 4329 var rootClientId = ownProps.rootClientId; 4330 return { 4331 blockClientIds: getBlockOrder(rootClientId), 4332 selectionStart: getMultiSelectedBlocksStartClientId(), 4333 selectionEnd: getMultiSelectedBlocksEndClientId(), 4334 selectionStartClientId: getBlockSelectionStart(), 4335 isSelectionEnabled: isSelectionEnabled(), 4336 isMultiSelecting: isMultiSelecting() 4337 }; 4338 }), Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_11__["withDispatch"])(function (dispatch) { 4339 var _dispatch = dispatch('core/editor'), 4340 startMultiSelect = _dispatch.startMultiSelect, 4341 stopMultiSelect = _dispatch.stopMultiSelect, 4342 multiSelect = _dispatch.multiSelect, 4343 selectBlock = _dispatch.selectBlock; 4344 4345 return { 4346 onStartMultiSelect: startMultiSelect, 4347 onStopMultiSelect: stopMultiSelect, 4348 onMultiSelect: multiSelect, 4349 onSelect: selectBlock 4350 }; 4351 })])(BlockList)); 4352 4353 4354 /***/ }), 4355 4356 /***/ "./node_modules/@wordpress/editor/build-module/components/block-list/insertion-point.js": 4357 /*!**********************************************************************************************!*\ 4358 !*** ./node_modules/@wordpress/editor/build-module/components/block-list/insertion-point.js ***! 4359 \**********************************************************************************************/ 4360 /*! exports provided: default */ 4361 /***/ (function(module, __webpack_exports__, __webpack_require__) { 4362 4363 "use strict"; 4364 __webpack_require__.r(__webpack_exports__); 4365 /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutProperties */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js"); 4366 /* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/classCallCheck */ "./node_modules/@babel/runtime/helpers/esm/classCallCheck.js"); 4367 /* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/createClass */ "./node_modules/@babel/runtime/helpers/esm/createClass.js"); 4368 /* harmony import */ var _babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/esm/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js"); 4369 /* harmony import */ var _babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/esm/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js"); 4370 /* harmony import */ var _babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inherits */ "./node_modules/@babel/runtime/helpers/esm/inherits.js"); 4371 /* harmony import */ var _babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @babel/runtime/helpers/esm/assertThisInitialized */ "./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js"); 4372 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); 4373 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__); 4374 /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); 4375 /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_8__); 4376 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); 4377 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_9__); 4378 /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks"); 4379 /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_10__); 4380 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); 4381 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_11__); 4382 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); 4383 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_12__); 4384 /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose"); 4385 /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_13__); 4386 4387 4388 4389 4390 4391 4392 4393 4394 4395 /** 4396 * External dependencies 4397 */ 4398 4399 /** 4400 * WordPress dependencies 4401 */ 4402 4403 4404 4405 4406 4407 4408 4409 4410 var BlockInsertionPoint = 4411 /*#__PURE__*/ 4412 function (_Component) { 4413 Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_5__["default"])(BlockInsertionPoint, _Component); 4414 4415 function BlockInsertionPoint() { 4416 var _this; 4417 4418 Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_1__["default"])(this, BlockInsertionPoint); 4419 4420 _this = Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__["default"])(this, Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__["default"])(BlockInsertionPoint).apply(this, arguments)); 4421 _this.state = { 4422 isInserterFocused: false 4423 }; 4424 _this.onBlurInserter = _this.onBlurInserter.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["default"])(_this))); 4425 _this.onFocusInserter = _this.onFocusInserter.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["default"])(_this))); 4426 _this.onClick = _this.onClick.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["default"])(_this))); 4427 return _this; 4428 } 4429 4430 Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_2__["default"])(BlockInsertionPoint, [{ 4431 key: "onFocusInserter", 4432 value: function onFocusInserter(event) { 4433 // We stop propagation of the focus event to avoid selecting the current block 4434 // While we're trying to insert a new block 4435 event.stopPropagation(); 4436 this.setState({ 4437 isInserterFocused: true 4438 }); 4439 } 4440 }, { 4441 key: "onBlurInserter", 4442 value: function onBlurInserter() { 4443 this.setState({ 4444 isInserterFocused: false 4445 }); 4446 } 4447 }, { 4448 key: "onClick", 4449 value: function onClick() { 4450 var _this$props = this.props, 4451 layout = _this$props.layout, 4452 rootClientId = _this$props.rootClientId, 4453 index = _this$props.index, 4454 props = Object(_babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_0__["default"])(_this$props, ["layout", "rootClientId", "index"]); 4455 4456 props.insertDefaultBlock({ 4457 layout: layout 4458 }, rootClientId, index); 4459 props.startTyping(); 4460 this.onBlurInserter(); 4461 4462 if (props.onInsert) { 4463 this.props.onInsert(); 4464 } 4465 } 4466 }, { 4467 key: "render", 4468 value: function render() { 4469 var isInserterFocused = this.state.isInserterFocused; 4470 var _this$props2 = this.props, 4471 showInsertionPoint = _this$props2.showInsertionPoint, 4472 showInserter = _this$props2.showInserter; 4473 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["createElement"])("div", { 4474 className: "editor-block-list__insertion-point" 4475 }, showInsertionPoint && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["createElement"])("div", { 4476 className: "editor-block-list__insertion-point-indicator" 4477 }), showInserter && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["createElement"])("div", { 4478 className: classnames__WEBPACK_IMPORTED_MODULE_8___default()('editor-block-list__insertion-point-inserter', { 4479 'is-visible': isInserterFocused 4480 }) 4481 }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_11__["IconButton"], { 4482 icon: "insert", 4483 className: "editor-block-list__insertion-point-button", 4484 onClick: this.onClick, 4485 label: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_9__["__"])('Insert block'), 4486 onFocus: this.onFocusInserter, 4487 onBlur: this.onBlurInserter 4488 }))); 4489 } 4490 }]); 4491 4492 return BlockInsertionPoint; 4493 }(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["Component"]); 4494 4495 /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_13__["compose"])(Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_12__["withSelect"])(function (select, _ref) { 4496 var clientId = _ref.clientId, 4497 rootClientId = _ref.rootClientId, 4498 canShowInserter = _ref.canShowInserter; 4499 4500 var _select = select('core/editor'), 4501 canInsertBlockType = _select.canInsertBlockType, 4502 getBlockIndex = _select.getBlockIndex, 4503 getBlockInsertionPoint = _select.getBlockInsertionPoint, 4504 getBlock = _select.getBlock, 4505 isBlockInsertionPointVisible = _select.isBlockInsertionPointVisible, 4506 isTyping = _select.isTyping; 4507 4508 var _select2 = select('core/blocks'), 4509 getDefaultBlockName = _select2.getDefaultBlockName; 4510 4511 var blockIndex = clientId ? getBlockIndex(clientId, rootClientId) : -1; 4512 var insertIndex = blockIndex; 4513 var insertionPoint = getBlockInsertionPoint(); 4514 var block = clientId ? getBlock(clientId) : null; 4515 var showInsertionPoint = isBlockInsertionPointVisible() && insertionPoint.index === insertIndex && insertionPoint.rootClientId === rootClientId && (!block || !Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_10__["isUnmodifiedDefaultBlock"])(block)); 4516 var defaultBlockName = getDefaultBlockName(); 4517 return { 4518 canInsertDefaultBlock: canInsertBlockType(defaultBlockName, rootClientId), 4519 showInserter: !isTyping() && canShowInserter, 4520 index: insertIndex, 4521 showInsertionPoint: showInsertionPoint 4522 }; 4523 }), Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_13__["ifCondition"])(function (_ref2) { 4524 var canInsertDefaultBlock = _ref2.canInsertDefaultBlock; 4525 return canInsertDefaultBlock; 4526 }), Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_12__["withDispatch"])(function (dispatch) { 4527 var _dispatch = dispatch('core/editor'), 4528 insertDefaultBlock = _dispatch.insertDefaultBlock, 4529 startTyping = _dispatch.startTyping; 4530 4531 return { 4532 insertDefaultBlock: insertDefaultBlock, 4533 startTyping: startTyping 4534 }; 4535 }))(BlockInsertionPoint)); 4536 4537 4538 /***/ }), 4539 4540 /***/ "./node_modules/@wordpress/editor/build-module/components/block-list/multi-controls.js": 4541 /*!*********************************************************************************************!*\ 4542 !*** ./node_modules/@wordpress/editor/build-module/components/block-list/multi-controls.js ***! 4543 \*********************************************************************************************/ 4544 /*! exports provided: default */ 4545 /***/ (function(module, __webpack_exports__, __webpack_require__) { 4546 4547 "use strict"; 4548 __webpack_require__.r(__webpack_exports__); 4549 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); 4550 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); 4551 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lodash */ "lodash"); 4552 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_1__); 4553 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); 4554 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_2__); 4555 /* harmony import */ var _block_mover__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../block-mover */ "./node_modules/@wordpress/editor/build-module/components/block-mover/index.js"); 4556 4557 4558 /** 4559 * External dependencies 4560 */ 4561 4562 /** 4563 * WordPress dependencies 4564 */ 4565 4566 4567 /** 4568 * Internal dependencies 4569 */ 4570 4571 4572 4573 function BlockListMultiControls(_ref) { 4574 var multiSelectedBlockClientIds = _ref.multiSelectedBlockClientIds, 4575 clientId = _ref.clientId, 4576 isSelecting = _ref.isSelecting, 4577 isFirst = _ref.isFirst, 4578 isLast = _ref.isLast; 4579 4580 if (isSelecting) { 4581 return null; 4582 } 4583 4584 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_block_mover__WEBPACK_IMPORTED_MODULE_3__["default"], { 4585 key: "mover", 4586 clientId: clientId, 4587 clientIds: multiSelectedBlockClientIds, 4588 isFirst: isFirst, 4589 isLast: isLast 4590 }); 4591 } 4592 4593 /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_2__["withSelect"])(function (select, _ref2) { 4594 var clientId = _ref2.clientId; 4595 4596 var _select = select('core/editor'), 4597 getMultiSelectedBlockClientIds = _select.getMultiSelectedBlockClientIds, 4598 isMultiSelecting = _select.isMultiSelecting, 4599 getBlockIndex = _select.getBlockIndex, 4600 getBlockCount = _select.getBlockCount; 4601 4602 var clientIds = getMultiSelectedBlockClientIds(); 4603 var firstIndex = getBlockIndex(Object(lodash__WEBPACK_IMPORTED_MODULE_1__["first"])(clientIds), clientId); 4604 var lastIndex = getBlockIndex(Object(lodash__WEBPACK_IMPORTED_MODULE_1__["last"])(clientIds), clientId); 4605 return { 4606 multiSelectedBlockClientIds: clientIds, 4607 isSelecting: isMultiSelecting(), 4608 isFirst: firstIndex === 0, 4609 isLast: lastIndex + 1 === getBlockCount() 4610 }; 4611 })(BlockListMultiControls)); 4612 4613 4614 /***/ }), 4615 4616 /***/ "./node_modules/@wordpress/editor/build-module/components/block-list/with-hover-areas.js": 4617 /*!***********************************************************************************************!*\ 4618 !*** ./node_modules/@wordpress/editor/build-module/components/block-list/with-hover-areas.js ***! 4619 \***********************************************************************************************/ 4620 /*! exports provided: default */ 4621 /***/ (function(module, __webpack_exports__, __webpack_require__) { 4622 4623 "use strict"; 4624 __webpack_require__.r(__webpack_exports__); 4625 /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js"); 4626 /* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/classCallCheck */ "./node_modules/@babel/runtime/helpers/esm/classCallCheck.js"); 4627 /* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/createClass */ "./node_modules/@babel/runtime/helpers/esm/createClass.js"); 4628 /* harmony import */ var _babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/esm/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js"); 4629 /* harmony import */ var _babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/esm/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js"); 4630 /* harmony import */ var _babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inherits */ "./node_modules/@babel/runtime/helpers/esm/inherits.js"); 4631 /* harmony import */ var _babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @babel/runtime/helpers/esm/assertThisInitialized */ "./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js"); 4632 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); 4633 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__); 4634 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); 4635 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_8__); 4636 /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose"); 4637 /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_9__); 4638 4639 4640 4641 4642 4643 4644 4645 4646 4647 /** 4648 * WordPress dependencies 4649 */ 4650 4651 4652 4653 var withHoverAreas = Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_9__["createHigherOrderComponent"])(function (WrappedComponent) { 4654 var WithHoverAreasComponent = 4655 /*#__PURE__*/ 4656 function (_Component) { 4657 Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_5__["default"])(WithHoverAreasComponent, _Component); 4658 4659 function WithHoverAreasComponent() { 4660 var _this; 4661 4662 Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_1__["default"])(this, WithHoverAreasComponent); 4663 4664 _this = Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__["default"])(this, Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__["default"])(WithHoverAreasComponent).apply(this, arguments)); 4665 _this.state = { 4666 hoverArea: null 4667 }; 4668 _this.onMouseLeave = _this.onMouseLeave.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["default"])(_this))); 4669 _this.onMouseMove = _this.onMouseMove.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["default"])(_this))); 4670 return _this; 4671 } 4672 4673 Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_2__["default"])(WithHoverAreasComponent, [{ 4674 key: "componentDidMount", 4675 value: function componentDidMount() { 4676 // Disable reason: We use findDOMNode to avoid unnecessary extra dom Nodes 4677 // eslint-disable-next-line react/no-find-dom-node 4678 this.container = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["findDOMNode"])(this); 4679 this.container.addEventListener('mousemove', this.onMouseMove); 4680 this.container.addEventListener('mouseleave', this.onMouseLeave); 4681 } 4682 }, { 4683 key: "componentWillUnmount", 4684 value: function componentWillUnmount() { 4685 this.container.removeEventListener('mousemove', this.onMouseMove); 4686 this.container.removeEventListener('mouseleave', this.onMouseLeave); 4687 } 4688 }, { 4689 key: "onMouseLeave", 4690 value: function onMouseLeave() { 4691 if (this.state.hoverArea) { 4692 this.setState({ 4693 hoverArea: null 4694 }); 4695 } 4696 } 4697 }, { 4698 key: "onMouseMove", 4699 value: function onMouseMove(event) { 4700 var isRTL = this.props.isRTL; 4701 4702 var _this$container$getBo = this.container.getBoundingClientRect(), 4703 width = _this$container$getBo.width, 4704 left = _this$container$getBo.left, 4705 right = _this$container$getBo.right; 4706 4707 var hoverArea = null; 4708 4709 if (event.clientX - left < width / 3) { 4710 hoverArea = isRTL ? 'right' : 'left'; 4711 } else if (right - event.clientX < width / 3) { 4712 hoverArea = isRTL ? 'left' : 'right'; 4713 } 4714 4715 if (hoverArea !== this.state.hoverArea) { 4716 this.setState({ 4717 hoverArea: hoverArea 4718 }); 4719 } 4720 } 4721 }, { 4722 key: "render", 4723 value: function render() { 4724 var hoverArea = this.state.hoverArea; 4725 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["createElement"])(WrappedComponent, Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, this.props, { 4726 hoverArea: hoverArea 4727 })); 4728 } 4729 }]); 4730 4731 return WithHoverAreasComponent; 4732 }(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["Component"]); 4733 4734 return Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_8__["withSelect"])(function (select) { 4735 return { 4736 isRTL: select('core/editor').getEditorSettings().isRTL 4737 }; 4738 })(WithHoverAreasComponent); 4739 }); 4740 /* harmony default export */ __webpack_exports__["default"] = (withHoverAreas); 4741 4742 4743 /***/ }), 4744 4745 /***/ "./node_modules/@wordpress/editor/build-module/components/block-mover/drag-handle.js": 4746 /*!*******************************************************************************************!*\ 4747 !*** ./node_modules/@wordpress/editor/build-module/components/block-mover/drag-handle.js ***! 4748 \*******************************************************************************************/ 4749 /*! exports provided: IconDragHandle */ 4750 /***/ (function(module, __webpack_exports__, __webpack_require__) { 4751 4752 "use strict"; 4753 __webpack_require__.r(__webpack_exports__); 4754 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "IconDragHandle", function() { return IconDragHandle; }); 4755 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); 4756 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); 4757 /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); 4758 /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_1__); 4759 /* harmony import */ var _block_draggable__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../block-draggable */ "./node_modules/@wordpress/editor/build-module/components/block-draggable/index.js"); 4760 4761 4762 /** 4763 * External dependencies 4764 */ 4765 4766 /** 4767 * WordPress dependencies 4768 */ 4769 4770 4771 var IconDragHandle = function IconDragHandle(_ref) { 4772 var isVisible = _ref.isVisible, 4773 className = _ref.className, 4774 icon = _ref.icon, 4775 onDragStart = _ref.onDragStart, 4776 onDragEnd = _ref.onDragEnd, 4777 blockElementId = _ref.blockElementId, 4778 clientId = _ref.clientId; 4779 4780 if (!isVisible) { 4781 return null; 4782 } 4783 4784 var dragHandleClassNames = classnames__WEBPACK_IMPORTED_MODULE_1___default()('editor-block-mover__control-drag-handle', className); 4785 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_block_draggable__WEBPACK_IMPORTED_MODULE_2__["default"], { 4786 clientId: clientId, 4787 blockElementId: blockElementId, 4788 onDragStart: onDragStart, 4789 onDragEnd: onDragEnd 4790 }, function (_ref2) { 4791 var onDraggableStart = _ref2.onDraggableStart, 4792 onDraggableEnd = _ref2.onDraggableEnd; 4793 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("div", { 4794 className: dragHandleClassNames, 4795 "aria-hidden": "true", 4796 onDragStart: onDraggableStart, 4797 onDragEnd: onDraggableEnd, 4798 draggable: true 4799 }, icon); 4800 }); 4801 }; 4802 4803 4804 /***/ }), 4805 4806 /***/ "./node_modules/@wordpress/editor/build-module/components/block-mover/icons.js": 4807 /*!*************************************************************************************!*\ 4808 !*** ./node_modules/@wordpress/editor/build-module/components/block-mover/icons.js ***! 4809 \*************************************************************************************/ 4810 /*! exports provided: upArrow, downArrow, dragHandle */ 4811 /***/ (function(module, __webpack_exports__, __webpack_require__) { 4812 4813 "use strict"; 4814 __webpack_require__.r(__webpack_exports__); 4815 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "upArrow", function() { return upArrow; }); 4816 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "downArrow", function() { return downArrow; }); 4817 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "dragHandle", function() { return dragHandle; }); 4818 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); 4819 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); 4820 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); 4821 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__); 4822 4823 4824 /** 4825 * WordPress dependencies 4826 */ 4827 4828 var upArrow = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__["SVG"], { 4829 width: "18", 4830 height: "18", 4831 xmlns: "http://www.w3.org/2000/svg", 4832 viewBox: "0 0 18 18" 4833 }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__["Polygon"], { 4834 points: "9,4.5 3.3,10.1 4.8,11.5 9,7.3 13.2,11.5 14.7,10.1 " 4835 })); 4836 var downArrow = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__["SVG"], { 4837 width: "18", 4838 height: "18", 4839 xmlns: "http://www.w3.org/2000/svg", 4840 viewBox: "0 0 18 18" 4841 }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__["Polygon"], { 4842 points: "9,13.5 14.7,7.9 13.2,6.5 9,10.7 4.8,6.5 3.3,7.9 " 4843 })); 4844 var dragHandle = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__["SVG"], { 4845 width: "18", 4846 height: "18", 4847 xmlns: "http://www.w3.org/2000/svg", 4848 viewBox: "0 0 18 18" 4849 }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__["Path"], { 4850 d: "M13,8c0.6,0,1-0.4,1-1s-0.4-1-1-1s-1,0.4-1,1S12.4,8,13,8z M5,6C4.4,6,4,6.4,4,7s0.4,1,1,1s1-0.4,1-1S5.6,6,5,6z M5,10 c-0.6,0-1,0.4-1,1s0.4,1,1,1s1-0.4,1-1S5.6,10,5,10z M13,10c-0.6,0-1,0.4-1,1s0.4,1,1,1s1-0.4,1-1S13.6,10,13,10z M9,6 C8.4,6,8,6.4,8,7s0.4,1,1,1s1-0.4,1-1S9.6,6,9,6z M9,10c-0.6,0-1,0.4-1,1s0.4,1,1,1s1-0.4,1-1S9.6,10,9,10z" 4851 })); 4852 4853 4854 /***/ }), 4855 4856 /***/ "./node_modules/@wordpress/editor/build-module/components/block-mover/index.js": 4857 /*!*************************************************************************************!*\ 4858 !*** ./node_modules/@wordpress/editor/build-module/components/block-mover/index.js ***! 4859 \*************************************************************************************/ 4860 /*! exports provided: BlockMover, default */ 4861 /***/ (function(module, __webpack_exports__, __webpack_require__) { 4862 4863 "use strict"; 4864 __webpack_require__.r(__webpack_exports__); 4865 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BlockMover", function() { return BlockMover; }); 4866 /* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/classCallCheck */ "./node_modules/@babel/runtime/helpers/esm/classCallCheck.js"); 4867 /* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/createClass */ "./node_modules/@babel/runtime/helpers/esm/createClass.js"); 4868 /* harmony import */ var _babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js"); 4869 /* harmony import */ var _babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/esm/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js"); 4870 /* harmony import */ var _babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inherits */ "./node_modules/@babel/runtime/helpers/esm/inherits.js"); 4871 /* harmony import */ var _babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/helpers/esm/assertThisInitialized */ "./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js"); 4872 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); 4873 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__); 4874 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! lodash */ "lodash"); 4875 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_7__); 4876 /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); 4877 /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_8__); 4878 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); 4879 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_9__); 4880 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); 4881 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_10__); 4882 /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks"); 4883 /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_11__); 4884 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); 4885 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_12__); 4886 /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose"); 4887 /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_13__); 4888 /* harmony import */ var _mover_description__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./mover-description */ "./node_modules/@wordpress/editor/build-module/components/block-mover/mover-description.js"); 4889 /* harmony import */ var _icons__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./icons */ "./node_modules/@wordpress/editor/build-module/components/block-mover/icons.js"); 4890 /* harmony import */ var _drag_handle__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./drag-handle */ "./node_modules/@wordpress/editor/build-module/components/block-mover/drag-handle.js"); 4891 4892 4893 4894 4895 4896 4897 4898 4899 /** 4900 * External dependencies 4901 */ 4902 4903 4904 /** 4905 * WordPress dependencies 4906 */ 4907 4908 4909 4910 4911 4912 4913 4914 /** 4915 * Internal dependencies 4916 */ 4917 4918 4919 4920 4921 var BlockMover = 4922 /*#__PURE__*/ 4923 function (_Component) { 4924 Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__["default"])(BlockMover, _Component); 4925 4926 function BlockMover() { 4927 var _this; 4928 4929 Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__["default"])(this, BlockMover); 4930 4931 _this = Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__["default"])(this, Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__["default"])(BlockMover).apply(this, arguments)); 4932 _this.state = { 4933 isFocused: false 4934 }; 4935 _this.onFocus = _this.onFocus.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(_this))); 4936 _this.onBlur = _this.onBlur.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(_this))); 4937 return _this; 4938 } 4939 4940 Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__["default"])(BlockMover, [{ 4941 key: "onFocus", 4942 value: function onFocus() { 4943 this.setState({ 4944 isFocused: true 4945 }); 4946 } 4947 }, { 4948 key: "onBlur", 4949 value: function onBlur() { 4950 this.setState({ 4951 isFocused: false 4952 }); 4953 } 4954 }, { 4955 key: "render", 4956 value: function render() { 4957 var _this$props = this.props, 4958 onMoveUp = _this$props.onMoveUp, 4959 onMoveDown = _this$props.onMoveDown, 4960 isFirst = _this$props.isFirst, 4961 isLast = _this$props.isLast, 4962 isDraggable = _this$props.isDraggable, 4963 onDragStart = _this$props.onDragStart, 4964 onDragEnd = _this$props.onDragEnd, 4965 clientIds = _this$props.clientIds, 4966 blockElementId = _this$props.blockElementId, 4967 blockType = _this$props.blockType, 4968 firstIndex = _this$props.firstIndex, 4969 isLocked = _this$props.isLocked, 4970 instanceId = _this$props.instanceId, 4971 isHidden = _this$props.isHidden; 4972 var isFocused = this.state.isFocused; 4973 var blocksCount = Object(lodash__WEBPACK_IMPORTED_MODULE_7__["castArray"])(clientIds).length; 4974 4975 if (isLocked || isFirst && isLast) { 4976 return null; 4977 } // We emulate a disabled state because forcefully applying the `disabled` 4978 // attribute on the button while it has focus causes the screen to change 4979 // to an unfocused state (body as active element) without firing blur on, 4980 // the rendering parent, leaving it unable to react to focus out. 4981 4982 4983 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("div", { 4984 className: classnames__WEBPACK_IMPORTED_MODULE_8___default()('editor-block-mover', { 4985 'is-visible': isFocused || !isHidden 4986 }) 4987 }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_10__["IconButton"], { 4988 className: "editor-block-mover__control", 4989 onClick: isFirst ? null : onMoveUp, 4990 icon: _icons__WEBPACK_IMPORTED_MODULE_15__["upArrow"], 4991 label: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_9__["__"])('Move up'), 4992 "aria-describedby": "editor-block-mover__up-description-".concat(instanceId), 4993 "aria-disabled": isFirst, 4994 onFocus: this.onFocus, 4995 onBlur: this.onBlur 4996 }), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(_drag_handle__WEBPACK_IMPORTED_MODULE_16__["IconDragHandle"], { 4997 className: "editor-block-mover__control", 4998 icon: _icons__WEBPACK_IMPORTED_MODULE_15__["dragHandle"], 4999 clientId: clientIds, 5000 blockElementId: blockElementId, 5001 isVisible: isDraggable, 5002 onDragStart: onDragStart, 5003 onDragEnd: onDragEnd 5004 }), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_10__["IconButton"], { 5005 className: "editor-block-mover__control", 5006 onClick: isLast ? null : onMoveDown, 5007 icon: _icons__WEBPACK_IMPORTED_MODULE_15__["downArrow"], 5008 label: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_9__["__"])('Move down'), 5009 "aria-describedby": "editor-block-mover__down-description-".concat(instanceId), 5010 "aria-disabled": isLast, 5011 onFocus: this.onFocus, 5012 onBlur: this.onBlur 5013 }), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("span", { 5014 id: "editor-block-mover__up-description-".concat(instanceId), 5015 className: "editor-block-mover__description" 5016 }, Object(_mover_description__WEBPACK_IMPORTED_MODULE_14__["getBlockMoverDescription"])(blocksCount, blockType && blockType.title, firstIndex, isFirst, isLast, -1)), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("span", { 5017 id: "editor-block-mover__down-description-".concat(instanceId), 5018 className: "editor-block-mover__description" 5019 }, Object(_mover_description__WEBPACK_IMPORTED_MODULE_14__["getBlockMoverDescription"])(blocksCount, blockType && blockType.title, firstIndex, isFirst, isLast, 1))); 5020 } 5021 }]); 5022 5023 return BlockMover; 5024 }(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["Component"]); 5025 /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_13__["compose"])(Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_12__["withSelect"])(function (select, _ref) { 5026 var clientIds = _ref.clientIds; 5027 5028 var _select = select('core/editor'), 5029 getBlock = _select.getBlock, 5030 getBlockIndex = _select.getBlockIndex, 5031 getTemplateLock = _select.getTemplateLock, 5032 getBlockRootClientId = _select.getBlockRootClientId; 5033 5034 var firstClientId = Object(lodash__WEBPACK_IMPORTED_MODULE_7__["first"])(Object(lodash__WEBPACK_IMPORTED_MODULE_7__["castArray"])(clientIds)); 5035 var block = getBlock(firstClientId); 5036 var rootClientId = getBlockRootClientId(Object(lodash__WEBPACK_IMPORTED_MODULE_7__["first"])(Object(lodash__WEBPACK_IMPORTED_MODULE_7__["castArray"])(clientIds))); 5037 return { 5038 firstIndex: getBlockIndex(firstClientId, rootClientId), 5039 blockType: block ? Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_11__["getBlockType"])(block.name) : null, 5040 isLocked: getTemplateLock(rootClientId) === 'all', 5041 rootClientId: rootClientId 5042 }; 5043 }), Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_12__["withDispatch"])(function (dispatch, _ref2) { 5044 var clientIds = _ref2.clientIds, 5045 rootClientId = _ref2.rootClientId; 5046 5047 var _dispatch = dispatch('core/editor'), 5048 moveBlocksDown = _dispatch.moveBlocksDown, 5049 moveBlocksUp = _dispatch.moveBlocksUp; 5050 5051 return { 5052 onMoveDown: Object(lodash__WEBPACK_IMPORTED_MODULE_7__["partial"])(moveBlocksDown, clientIds, rootClientId), 5053 onMoveUp: Object(lodash__WEBPACK_IMPORTED_MODULE_7__["partial"])(moveBlocksUp, clientIds, rootClientId) 5054 }; 5055 }), _wordpress_compose__WEBPACK_IMPORTED_MODULE_13__["withInstanceId"])(BlockMover)); 5056 5057 5058 /***/ }), 5059 5060 /***/ "./node_modules/@wordpress/editor/build-module/components/block-mover/mover-description.js": 5061 /*!*************************************************************************************************!*\ 5062 !*** ./node_modules/@wordpress/editor/build-module/components/block-mover/mover-description.js ***! 5063 \*************************************************************************************************/ 5064 /*! exports provided: getBlockMoverDescription, getMultiBlockMoverDescription */ 5065 /***/ (function(module, __webpack_exports__, __webpack_require__) { 5066 5067 "use strict"; 5068 __webpack_require__.r(__webpack_exports__); 5069 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getBlockMoverDescription", function() { return getBlockMoverDescription; }); 5070 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getMultiBlockMoverDescription", function() { return getMultiBlockMoverDescription; }); 5071 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); 5072 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__); 5073 /** 5074 * WordPress dependencies 5075 */ 5076 5077 /** 5078 * Return a label for the block movement controls depending on block position. 5079 * 5080 * @param {number} selectedCount Number of blocks selected. 5081 * @param {string} type Block type - in the case of a single block, should 5082 * define its 'type'. I.e. 'Text', 'Heading', 'Image' etc. 5083 * @param {number} firstIndex The index (position - 1) of the first block selected. 5084 * @param {boolean} isFirst This is the first block. 5085 * @param {boolean} isLast This is the last block. 5086 * @param {number} dir Direction of movement (> 0 is considered to be going 5087 * down, < 0 is up). 5088 * 5089 * @return {string} Label for the block movement controls. 5090 */ 5091 5092 function getBlockMoverDescription(selectedCount, type, firstIndex, isFirst, isLast, dir) { 5093 var position = firstIndex + 1; 5094 5095 if (selectedCount > 1) { 5096 return getMultiBlockMoverDescription(selectedCount, firstIndex, isFirst, isLast, dir); 5097 } 5098 5099 if (isFirst && isLast) { 5100 // translators: %s: Type of block (i.e. Text, Image etc) 5101 return Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__["sprintf"])(Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__["__"])('Block %s is the only block, and cannot be moved'), type); 5102 } 5103 5104 if (dir > 0 && !isLast) { 5105 // moving down 5106 return Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__["sprintf"])( // translators: 1: Type of block (i.e. Text, Image etc), 2: Position of selected block, 3: New position 5107 Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__["__"])('Move %1$s block from position %2$d down to position %3$d'), type, position, position + 1); 5108 } 5109 5110 if (dir > 0 && isLast) { 5111 // moving down, and is the last item 5112 // translators: %s: Type of block (i.e. Text, Image etc) 5113 return Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__["sprintf"])(Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__["__"])('Block %s is at the end of the content and can’t be moved down'), type); 5114 } 5115 5116 if (dir < 0 && !isFirst) { 5117 // moving up 5118 return Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__["sprintf"])( // translators: 1: Type of block (i.e. Text, Image etc), 2: Position of selected block, 3: New position 5119 Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__["__"])('Move %1$s block from position %2$d up to position %3$d'), type, position, position - 1); 5120 } 5121 5122 if (dir < 0 && isFirst) { 5123 // moving up, and is the first item 5124 // translators: %s: Type of block (i.e. Text, Image etc) 5125 return Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__["sprintf"])(Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__["__"])('Block %s is at the beginning of the content and can’t be moved up'), type); 5126 } 5127 } 5128 /** 5129 * Return a label for the block movement controls depending on block position. 5130 * 5131 * @param {number} selectedCount Number of blocks selected. 5132 * @param {number} firstIndex The index (position - 1) of the first block selected. 5133 * @param {boolean} isFirst This is the first block. 5134 * @param {boolean} isLast This is the last block. 5135 * @param {number} dir Direction of movement (> 0 is considered to be going 5136 * down, < 0 is up). 5137 * 5138 * @return {string} Label for the block movement controls. 5139 */ 5140 5141 function getMultiBlockMoverDescription(selectedCount, firstIndex, isFirst, isLast, dir) { 5142 var position = firstIndex + 1; 5143 5144 if (dir < 0 && isFirst) { 5145 return Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__["__"])('Blocks cannot be moved up as they are already at the top'); 5146 } 5147 5148 if (dir > 0 && isLast) { 5149 return Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__["__"])('Blocks cannot be moved down as they are already at the bottom'); 5150 } 5151 5152 if (dir < 0 && !isFirst) { 5153 return Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__["sprintf"])( // translators: 1: Number of selected blocks, 2: Position of selected blocks 5154 Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__["_n"])('Move %1$d block from position %2$d up by one place', 'Move %1$d blocks from position %2$d up by one place', selectedCount), selectedCount, position); 5155 } 5156 5157 if (dir > 0 && !isLast) { 5158 return Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__["sprintf"])( // translators: 1: Number of selected blocks, 2: Position of selected blocks 5159 Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__["_n"])('Move %1$d block from position %2$d down by one place', 'Move %1$d blocks from position %2$d down by one place', selectedCount), selectedCount, position); 5160 } 5161 } 5162 5163 5164 /***/ }), 5165 5166 /***/ "./node_modules/@wordpress/editor/build-module/components/block-preview/index.js": 5167 /*!***************************************************************************************!*\ 5168 !*** ./node_modules/@wordpress/editor/build-module/components/block-preview/index.js ***! 5169 \***************************************************************************************/ 5170 /*! exports provided: BlockPreviewContent, default */ 5171 /***/ (function(module, __webpack_exports__, __webpack_require__) { 5172 5173 "use strict"; 5174 __webpack_require__.r(__webpack_exports__); 5175 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BlockPreviewContent", function() { return BlockPreviewContent; }); 5176 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); 5177 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); 5178 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lodash */ "lodash"); 5179 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_1__); 5180 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); 5181 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__); 5182 /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks"); 5183 /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_3__); 5184 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); 5185 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_4__); 5186 /* harmony import */ var _block_edit__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../block-edit */ "./node_modules/@wordpress/editor/build-module/components/block-edit/index.js"); 5187 5188 5189 /** 5190 * External dependencies 5191 */ 5192 5193 /** 5194 * WordPress dependencies 5195 */ 5196 5197 5198 5199 5200 /** 5201 * Internal dependencies 5202 */ 5203 5204 5205 /** 5206 * Block Preview Component: It renders a preview given a block name and attributes. 5207 * 5208 * @param {Object} props Component props. 5209 * 5210 * @return {WPElement} Rendered element. 5211 */ 5212 5213 function BlockPreview(props) { 5214 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("div", { 5215 className: "editor-block-preview" 5216 }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("div", { 5217 className: "editor-block-preview__title" 5218 }, Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__["__"])('Preview')), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(BlockPreviewContent, props)); 5219 } 5220 5221 function BlockPreviewContent(_ref) { 5222 var name = _ref.name, 5223 attributes = _ref.attributes; 5224 var block = Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_3__["createBlock"])(name, attributes); 5225 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_4__["Disabled"], { 5226 className: "editor-block-preview__content", 5227 "aria-hidden": true 5228 }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_block_edit__WEBPACK_IMPORTED_MODULE_5__["default"], { 5229 name: name, 5230 focus: false, 5231 attributes: block.attributes, 5232 setAttributes: lodash__WEBPACK_IMPORTED_MODULE_1__["noop"] 5233 })); 5234 } 5235 /* harmony default export */ __webpack_exports__["default"] = (BlockPreview); 5236 5237 5238 /***/ }), 5239 5240 /***/ "./node_modules/@wordpress/editor/build-module/components/block-selection-clearer/index.js": 5241 /*!*************************************************************************************************!*\ 5242 !*** ./node_modules/@wordpress/editor/build-module/components/block-selection-clearer/index.js ***! 5243 \*************************************************************************************************/ 5244 /*! exports provided: default */ 5245 /***/ (function(module, __webpack_exports__, __webpack_require__) { 5246 5247 "use strict"; 5248 __webpack_require__.r(__webpack_exports__); 5249 /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js"); 5250 /* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/classCallCheck */ "./node_modules/@babel/runtime/helpers/esm/classCallCheck.js"); 5251 /* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/createClass */ "./node_modules/@babel/runtime/helpers/esm/createClass.js"); 5252 /* harmony import */ var _babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/esm/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js"); 5253 /* harmony import */ var _babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/esm/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js"); 5254 /* harmony import */ var _babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inherits */ "./node_modules/@babel/runtime/helpers/esm/inherits.js"); 5255 /* harmony import */ var _babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @babel/runtime/helpers/esm/assertThisInitialized */ "./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js"); 5256 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); 5257 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__); 5258 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! lodash */ "lodash"); 5259 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_8__); 5260 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); 5261 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_9__); 5262 /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose"); 5263 /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_10__); 5264 5265 5266 5267 5268 5269 5270 5271 5272 5273 /** 5274 * External dependencies 5275 */ 5276 5277 /** 5278 * WordPress dependencies 5279 */ 5280 5281 5282 5283 5284 5285 var BlockSelectionClearer = 5286 /*#__PURE__*/ 5287 function (_Component) { 5288 Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_5__["default"])(BlockSelectionClearer, _Component); 5289 5290 function BlockSelectionClearer() { 5291 var _this; 5292 5293 Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_1__["default"])(this, BlockSelectionClearer); 5294 5295 _this = Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__["default"])(this, Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__["default"])(BlockSelectionClearer).apply(this, arguments)); 5296 _this.bindContainer = _this.bindContainer.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["default"])(_this))); 5297 _this.clearSelectionIfFocusTarget = _this.clearSelectionIfFocusTarget.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["default"])(_this))); 5298 return _this; 5299 } 5300 5301 Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_2__["default"])(BlockSelectionClearer, [{ 5302 key: "bindContainer", 5303 value: function bindContainer(ref) { 5304 this.container = ref; 5305 } 5306 /** 5307 * Clears the selected block on focus if the container is the target of the 5308 * focus. This assumes no other descendents have received focus until event 5309 * has bubbled to the container. 5310 * 5311 * @param {FocusEvent} event Focus event. 5312 */ 5313 5314 }, { 5315 key: "clearSelectionIfFocusTarget", 5316 value: function clearSelectionIfFocusTarget(event) { 5317 var _this$props = this.props, 5318 hasSelectedBlock = _this$props.hasSelectedBlock, 5319 hasMultiSelection = _this$props.hasMultiSelection, 5320 clearSelectedBlock = _this$props.clearSelectedBlock; 5321 var hasSelection = hasSelectedBlock || hasMultiSelection; 5322 5323 if (event.target === this.container && hasSelection) { 5324 clearSelectedBlock(); 5325 } 5326 } 5327 }, { 5328 key: "render", 5329 value: function render() { 5330 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["createElement"])("div", Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({ 5331 tabIndex: -1, 5332 onFocus: this.clearSelectionIfFocusTarget, 5333 ref: this.bindContainer 5334 }, Object(lodash__WEBPACK_IMPORTED_MODULE_8__["omit"])(this.props, ['clearSelectedBlock', 'hasSelectedBlock', 'hasMultiSelection']))); 5335 } 5336 }]); 5337 5338 return BlockSelectionClearer; 5339 }(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["Component"]); 5340 5341 /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_10__["compose"])([Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_9__["withSelect"])(function (select) { 5342 var _select = select('core/editor'), 5343 hasSelectedBlock = _select.hasSelectedBlock, 5344 hasMultiSelection = _select.hasMultiSelection; 5345 5346 return { 5347 hasSelectedBlock: hasSelectedBlock(), 5348 hasMultiSelection: hasMultiSelection() 5349 }; 5350 }), Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_9__["withDispatch"])(function (dispatch) { 5351 var _dispatch = dispatch('core/editor'), 5352 clearSelectedBlock = _dispatch.clearSelectedBlock; 5353 5354 return { 5355 clearSelectedBlock: clearSelectedBlock 5356 }; 5357 })])(BlockSelectionClearer)); 5358 5359 5360 /***/ }), 5361 5362 /***/ "./node_modules/@wordpress/editor/build-module/components/block-settings-menu/block-convert-button.js": 5363 /*!************************************************************************************************************!*\ 5364 !*** ./node_modules/@wordpress/editor/build-module/components/block-settings-menu/block-convert-button.js ***! 5365 \************************************************************************************************************/ 5366 /*! exports provided: default */ 5367 /***/ (function(module, __webpack_exports__, __webpack_require__) { 5368 5369 "use strict"; 5370 __webpack_require__.r(__webpack_exports__); 5371 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return BlockConvertButton; }); 5372 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); 5373 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); 5374 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); 5375 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__); 5376 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); 5377 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__); 5378 5379 5380 /** 5381 * WordPress dependencies 5382 */ 5383 5384 5385 function BlockConvertButton(_ref) { 5386 var shouldRender = _ref.shouldRender, 5387 onClick = _ref.onClick, 5388 small = _ref.small; 5389 5390 if (!shouldRender) { 5391 return null; 5392 } 5393 5394 var label = Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__["__"])('Convert to Blocks'); 5395 5396 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__["MenuItem"], { 5397 className: "editor-block-settings-menu__control", 5398 onClick: onClick, 5399 icon: "screenoptions", 5400 label: small ? label : undefined 5401 }, !small && label); 5402 } 5403 5404 5405 /***/ }), 5406 5407 /***/ "./node_modules/@wordpress/editor/build-module/components/block-settings-menu/block-html-convert-button.js": 5408 /*!*****************************************************************************************************************!*\ 5409 !*** ./node_modules/@wordpress/editor/build-module/components/block-settings-menu/block-html-convert-button.js ***! 5410 \*****************************************************************************************************************/ 5411 /*! exports provided: default */ 5412 /***/ (function(module, __webpack_exports__, __webpack_require__) { 5413 5414 "use strict"; 5415 __webpack_require__.r(__webpack_exports__); 5416 /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks"); 5417 /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__); 5418 /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose"); 5419 /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_1__); 5420 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); 5421 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_2__); 5422 /* harmony import */ var _block_convert_button__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./block-convert-button */ "./node_modules/@wordpress/editor/build-module/components/block-settings-menu/block-convert-button.js"); 5423 /** 5424 * WordPress dependencies 5425 */ 5426 5427 5428 5429 /** 5430 * Internal dependencies 5431 */ 5432 5433 5434 /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_1__["compose"])(Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_2__["withSelect"])(function (select, _ref) { 5435 var clientId = _ref.clientId; 5436 5437 var _select = select('core/editor'), 5438 getBlock = _select.getBlock, 5439 canUserUseUnfilteredHTML = _select.canUserUseUnfilteredHTML; 5440 5441 var block = getBlock(clientId); 5442 return { 5443 block: block, 5444 canUserUseUnfilteredHTML: canUserUseUnfilteredHTML(), 5445 shouldRender: block && block.name === 'core/html' 5446 }; 5447 }), Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_2__["withDispatch"])(function (dispatch, _ref2) { 5448 var block = _ref2.block, 5449 canUserUseUnfilteredHTML = _ref2.canUserUseUnfilteredHTML; 5450 return { 5451 onClick: function onClick() { 5452 return dispatch('core/editor').replaceBlocks(block.clientId, Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__["rawHandler"])({ 5453 HTML: Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__["getBlockContent"])(block), 5454 mode: 'BLOCKS', 5455 canUserUseUnfilteredHTML: canUserUseUnfilteredHTML 5456 })); 5457 } 5458 }; 5459 }))(_block_convert_button__WEBPACK_IMPORTED_MODULE_3__["default"])); 5460 5461 5462 /***/ }), 5463 5464 /***/ "./node_modules/@wordpress/editor/build-module/components/block-settings-menu/block-mode-toggle.js": 5465 /*!*********************************************************************************************************!*\ 5466 !*** ./node_modules/@wordpress/editor/build-module/components/block-settings-menu/block-mode-toggle.js ***! 5467 \*********************************************************************************************************/ 5468 /*! exports provided: BlockModeToggle, default */ 5469 /***/ (function(module, __webpack_exports__, __webpack_require__) { 5470 5471 "use strict"; 5472 __webpack_require__.r(__webpack_exports__); 5473 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BlockModeToggle", function() { return BlockModeToggle; }); 5474 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); 5475 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); 5476 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lodash */ "lodash"); 5477 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_1__); 5478 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); 5479 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__); 5480 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); 5481 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__); 5482 /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks"); 5483 /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_4__); 5484 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); 5485 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_5__); 5486 /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose"); 5487 /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_6__); 5488 5489 5490 /** 5491 * External dependencies 5492 */ 5493 5494 /** 5495 * WordPress dependencies 5496 */ 5497 5498 5499 5500 5501 5502 5503 function BlockModeToggle(_ref) { 5504 var blockType = _ref.blockType, 5505 mode = _ref.mode, 5506 onToggleMode = _ref.onToggleMode, 5507 _ref$small = _ref.small, 5508 small = _ref$small === void 0 ? false : _ref$small; 5509 5510 if (!Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_4__["hasBlockSupport"])(blockType, 'html', true)) { 5511 return null; 5512 } 5513 5514 var label = mode === 'visual' ? Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__["__"])('Edit as HTML') : Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__["__"])('Edit visually'); 5515 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__["MenuItem"], { 5516 className: "editor-block-settings-menu__control", 5517 onClick: onToggleMode, 5518 icon: "html", 5519 label: small ? label : undefined 5520 }, !small && label); 5521 } 5522 /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_6__["compose"])([Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_5__["withSelect"])(function (select, _ref2) { 5523 var clientId = _ref2.clientId; 5524 5525 var _select = select('core/editor'), 5526 getBlock = _select.getBlock, 5527 getBlockMode = _select.getBlockMode; 5528 5529 var block = getBlock(clientId); 5530 return { 5531 mode: getBlockMode(clientId), 5532 blockType: block ? Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_4__["getBlockType"])(block.name) : null 5533 }; 5534 }), Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_5__["withDispatch"])(function (dispatch, _ref3) { 5535 var _ref3$onToggle = _ref3.onToggle, 5536 onToggle = _ref3$onToggle === void 0 ? lodash__WEBPACK_IMPORTED_MODULE_1__["noop"] : _ref3$onToggle, 5537 clientId = _ref3.clientId; 5538 return { 5539 onToggleMode: function onToggleMode() { 5540 dispatch('core/editor').toggleBlockMode(clientId); 5541 onToggle(); 5542 } 5543 }; 5544 })])(BlockModeToggle)); 5545 5546 5547 /***/ }), 5548 5549 /***/ "./node_modules/@wordpress/editor/build-module/components/block-settings-menu/block-settings-menu-first-item.js": 5550 /*!**********************************************************************************************************************!*\ 5551 !*** ./node_modules/@wordpress/editor/build-module/components/block-settings-menu/block-settings-menu-first-item.js ***! 5552 \**********************************************************************************************************************/ 5553 /*! exports provided: default */ 5554 /***/ (function(module, __webpack_exports__, __webpack_require__) { 5555 5556 "use strict"; 5557 __webpack_require__.r(__webpack_exports__); 5558 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); 5559 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__); 5560 /** 5561 * WordPress dependencies 5562 */ 5563 5564 5565 var _createSlotFill = Object(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__["createSlotFill"])('_BlockSettingsMenuFirstItem'), 5566 _BlockSettingsMenuFirstItem = _createSlotFill.Fill, 5567 Slot = _createSlotFill.Slot; 5568 5569 _BlockSettingsMenuFirstItem.Slot = Slot; 5570 /* harmony default export */ __webpack_exports__["default"] = (_BlockSettingsMenuFirstItem); 5571 5572 5573 /***/ }), 5574 5575 /***/ "./node_modules/@wordpress/editor/build-module/components/block-settings-menu/block-settings-menu-plugins-extension.js": 5576 /*!*****************************************************************************************************************************!*\ 5577 !*** ./node_modules/@wordpress/editor/build-module/components/block-settings-menu/block-settings-menu-plugins-extension.js ***! 5578 \*****************************************************************************************************************************/ 5579 /*! exports provided: default */ 5580 /***/ (function(module, __webpack_exports__, __webpack_require__) { 5581 5582 "use strict"; 5583 __webpack_require__.r(__webpack_exports__); 5584 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); 5585 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__); 5586 /** 5587 * WordPress dependencies 5588 */ 5589 5590 5591 var _createSlotFill = Object(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__["createSlotFill"])('_BlockSettingsMenuPluginsExtension'), 5592 _BlockSettingsMenuPluginsExtension = _createSlotFill.Fill, 5593 Slot = _createSlotFill.Slot; 5594 5595 _BlockSettingsMenuPluginsExtension.Slot = Slot; 5596 /* harmony default export */ __webpack_exports__["default"] = (_BlockSettingsMenuPluginsExtension); 5597 5598 5599 /***/ }), 5600 5601 /***/ "./node_modules/@wordpress/editor/build-module/components/block-settings-menu/block-unknown-convert-button.js": 5602 /*!********************************************************************************************************************!*\ 5603 !*** ./node_modules/@wordpress/editor/build-module/components/block-settings-menu/block-unknown-convert-button.js ***! 5604 \********************************************************************************************************************/ 5605 /*! exports provided: default */ 5606 /***/ (function(module, __webpack_exports__, __webpack_require__) { 5607 5608 "use strict"; 5609 __webpack_require__.r(__webpack_exports__); 5610 /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks"); 5611 /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__); 5612 /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose"); 5613 /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_1__); 5614 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); 5615 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_2__); 5616 /* harmony import */ var _block_convert_button__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./block-convert-button */ "./node_modules/@wordpress/editor/build-module/components/block-settings-menu/block-convert-button.js"); 5617 /** 5618 * WordPress dependencies 5619 */ 5620 5621 5622 5623 /** 5624 * Internal dependencies 5625 */ 5626 5627 5628 /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_1__["compose"])(Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_2__["withSelect"])(function (select, _ref) { 5629 var clientId = _ref.clientId; 5630 5631 var _select = select('core/editor'), 5632 canUserUseUnfilteredHTML = _select.canUserUseUnfilteredHTML, 5633 getBlock = _select.getBlock; 5634 5635 var block = getBlock(clientId); 5636 return { 5637 block: block, 5638 canUserUseUnfilteredHTML: canUserUseUnfilteredHTML(), 5639 shouldRender: block && block.name === Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__["getUnknownTypeHandlerName"])() 5640 }; 5641 }), Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_2__["withDispatch"])(function (dispatch, _ref2) { 5642 var block = _ref2.block, 5643 canUserUseUnfilteredHTML = _ref2.canUserUseUnfilteredHTML; 5644 return { 5645 onClick: function onClick() { 5646 return dispatch('core/editor').replaceBlocks(block.clientId, Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__["rawHandler"])({ 5647 HTML: Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__["serialize"])(block), 5648 mode: 'BLOCKS', 5649 canUserUseUnfilteredHTML: canUserUseUnfilteredHTML 5650 })); 5651 } 5652 }; 5653 }))(_block_convert_button__WEBPACK_IMPORTED_MODULE_3__["default"])); 5654 5655 5656 /***/ }), 5657 5658 /***/ "./node_modules/@wordpress/editor/build-module/components/block-settings-menu/index.js": 5659 /*!*********************************************************************************************!*\ 5660 !*** ./node_modules/@wordpress/editor/build-module/components/block-settings-menu/index.js ***! 5661 \*********************************************************************************************/ 5662 /*! exports provided: BlockSettingsMenu, default */ 5663 /***/ (function(module, __webpack_exports__, __webpack_require__) { 5664 5665 "use strict"; 5666 __webpack_require__.r(__webpack_exports__); 5667 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BlockSettingsMenu", function() { return BlockSettingsMenu; }); 5668 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); 5669 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); 5670 /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); 5671 /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_1__); 5672 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! lodash */ "lodash"); 5673 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_2__); 5674 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); 5675 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__); 5676 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); 5677 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_4__); 5678 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); 5679 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_5__); 5680 /* harmony import */ var _editor_global_keyboard_shortcuts__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../editor-global-keyboard-shortcuts */ "./node_modules/@wordpress/editor/build-module/components/editor-global-keyboard-shortcuts/index.js"); 5681 /* harmony import */ var _block_actions__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../block-actions */ "./node_modules/@wordpress/editor/build-module/components/block-actions/index.js"); 5682 /* harmony import */ var _block_mode_toggle__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./block-mode-toggle */ "./node_modules/@wordpress/editor/build-module/components/block-settings-menu/block-mode-toggle.js"); 5683 /* harmony import */ var _reusable_block_convert_button__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./reusable-block-convert-button */ "./node_modules/@wordpress/editor/build-module/components/block-settings-menu/reusable-block-convert-button.js"); 5684 /* harmony import */ var _reusable_block_delete_button__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./reusable-block-delete-button */ "./node_modules/@wordpress/editor/build-module/components/block-settings-menu/reusable-block-delete-button.js"); 5685 /* harmony import */ var _block_html_convert_button__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./block-html-convert-button */ "./node_modules/@wordpress/editor/build-module/components/block-settings-menu/block-html-convert-button.js"); 5686 /* harmony import */ var _block_unknown_convert_button__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./block-unknown-convert-button */ "./node_modules/@wordpress/editor/build-module/components/block-settings-menu/block-unknown-convert-button.js"); 5687 /* harmony import */ var _block_settings_menu_first_item__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./block-settings-menu-first-item */ "./node_modules/@wordpress/editor/build-module/components/block-settings-menu/block-settings-menu-first-item.js"); 5688 /* harmony import */ var _block_settings_menu_plugins_extension__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./block-settings-menu-plugins-extension */ "./node_modules/@wordpress/editor/build-module/components/block-settings-menu/block-settings-menu-plugins-extension.js"); 5689 5690 5691 /** 5692 * External dependencies 5693 */ 5694 5695 5696 /** 5697 * WordPress dependencies 5698 */ 5699 5700 5701 5702 5703 5704 /** 5705 * Internal dependencies 5706 */ 5707 5708 5709 5710 5711 5712 5713 5714 5715 5716 5717 function BlockSettingsMenu(_ref) { 5718 var clientIds = _ref.clientIds, 5719 onSelect = _ref.onSelect; 5720 var blockClientIds = Object(lodash__WEBPACK_IMPORTED_MODULE_2__["castArray"])(clientIds); 5721 var count = blockClientIds.length; 5722 var firstBlockClientId = blockClientIds[0]; 5723 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_block_actions__WEBPACK_IMPORTED_MODULE_7__["default"], { 5724 clientIds: clientIds 5725 }, function (_ref2) { 5726 var onDuplicate = _ref2.onDuplicate, 5727 onRemove = _ref2.onRemove, 5728 onInsertAfter = _ref2.onInsertAfter, 5729 onInsertBefore = _ref2.onInsertBefore, 5730 canDuplicate = _ref2.canDuplicate, 5731 isLocked = _ref2.isLocked; 5732 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_4__["Dropdown"], { 5733 contentClassName: "editor-block-settings-menu__popover", 5734 position: "bottom right", 5735 renderToggle: function renderToggle(_ref3) { 5736 var onToggle = _ref3.onToggle, 5737 isOpen = _ref3.isOpen; 5738 var toggleClassname = classnames__WEBPACK_IMPORTED_MODULE_1___default()('editor-block-settings-menu__toggle', { 5739 'is-opened': isOpen 5740 }); 5741 var label = isOpen ? Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__["__"])('Hide options') : Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__["__"])('More options'); 5742 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_4__["Toolbar"], { 5743 controls: [{ 5744 icon: 'ellipsis', 5745 title: label, 5746 onClick: function onClick() { 5747 if (count === 1) { 5748 onSelect(firstBlockClientId); 5749 } 5750 5751 onToggle(); 5752 }, 5753 className: toggleClassname, 5754 extraProps: { 5755 'aria-expanded': isOpen 5756 } 5757 }] 5758 }); 5759 }, 5760 renderContent: function renderContent(_ref4) { 5761 var onClose = _ref4.onClose; 5762 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_4__["NavigableMenu"], { 5763 className: "editor-block-settings-menu__content" 5764 }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_block_settings_menu_first_item__WEBPACK_IMPORTED_MODULE_13__["default"].Slot, { 5765 fillProps: { 5766 onClose: onClose 5767 } 5768 }), count === 1 && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_block_unknown_convert_button__WEBPACK_IMPORTED_MODULE_12__["default"], { 5769 clientId: firstBlockClientId 5770 }), count === 1 && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_block_html_convert_button__WEBPACK_IMPORTED_MODULE_11__["default"], { 5771 clientId: firstBlockClientId 5772 }), !isLocked && canDuplicate && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_4__["MenuItem"], { 5773 className: "editor-block-settings-menu__control", 5774 onClick: onDuplicate, 5775 icon: "admin-page", 5776 shortcut: _editor_global_keyboard_shortcuts__WEBPACK_IMPORTED_MODULE_6__["shortcuts"].duplicate.display 5777 }, Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__["__"])('Duplicate')), !isLocked && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["Fragment"], null, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_4__["MenuItem"], { 5778 className: "editor-block-settings-menu__control", 5779 onClick: onInsertBefore, 5780 icon: "insert-before", 5781 shortcut: _editor_global_keyboard_shortcuts__WEBPACK_IMPORTED_MODULE_6__["shortcuts"].insertBefore.display 5782 }, Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__["__"])('Insert Before')), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_4__["MenuItem"], { 5783 className: "editor-block-settings-menu__control", 5784 onClick: onInsertAfter, 5785 icon: "insert-after", 5786 shortcut: _editor_global_keyboard_shortcuts__WEBPACK_IMPORTED_MODULE_6__["shortcuts"].insertAfter.display 5787 }, Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__["__"])('Insert After'))), count === 1 && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_block_mode_toggle__WEBPACK_IMPORTED_MODULE_8__["default"], { 5788 clientId: firstBlockClientId, 5789 onToggle: onClose 5790 }), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_reusable_block_convert_button__WEBPACK_IMPORTED_MODULE_9__["default"], { 5791 clientIds: clientIds, 5792 onToggle: onClose 5793 }), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_block_settings_menu_plugins_extension__WEBPACK_IMPORTED_MODULE_14__["default"].Slot, { 5794 fillProps: { 5795 clientIds: clientIds, 5796 onClose: onClose 5797 } 5798 }), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("div", { 5799 className: "editor-block-settings-menu__separator" 5800 }), count === 1 && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_reusable_block_delete_button__WEBPACK_IMPORTED_MODULE_10__["default"], { 5801 clientId: firstBlockClientId, 5802 onToggle: onClose 5803 }), !isLocked && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_4__["MenuItem"], { 5804 className: "editor-block-settings-menu__control", 5805 onClick: onRemove, 5806 icon: "trash", 5807 shortcut: _editor_global_keyboard_shortcuts__WEBPACK_IMPORTED_MODULE_6__["shortcuts"].removeBlock.display 5808 }, Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__["__"])('Remove Block'))); 5809 } 5810 }); 5811 }); 5812 } 5813 /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_5__["withDispatch"])(function (dispatch) { 5814 var _dispatch = dispatch('core/editor'), 5815 selectBlock = _dispatch.selectBlock; 5816 5817 return { 5818 onSelect: function onSelect(clientId) { 5819 selectBlock(clientId); 5820 } 5821 }; 5822 })(BlockSettingsMenu)); 5823 5824 5825 /***/ }), 5826 5827 /***/ "./node_modules/@wordpress/editor/build-module/components/block-settings-menu/reusable-block-convert-button.js": 5828 /*!*********************************************************************************************************************!*\ 5829 !*** ./node_modules/@wordpress/editor/build-module/components/block-settings-menu/reusable-block-convert-button.js ***! 5830 \*********************************************************************************************************************/ 5831 /*! exports provided: ReusableBlockConvertButton, default */ 5832 /***/ (function(module, __webpack_exports__, __webpack_require__) { 5833 5834 "use strict"; 5835 __webpack_require__.r(__webpack_exports__); 5836 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ReusableBlockConvertButton", function() { return ReusableBlockConvertButton; }); 5837 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); 5838 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); 5839 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lodash */ "lodash"); 5840 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_1__); 5841 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); 5842 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__); 5843 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); 5844 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__); 5845 /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks"); 5846 /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_4__); 5847 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); 5848 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_5__); 5849 /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose"); 5850 /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_6__); 5851 5852 5853 /** 5854 * External dependencies 5855 */ 5856 5857 /** 5858 * WordPress dependencies 5859 */ 5860 5861 5862 5863 5864 5865 5866 5867 function ReusableBlockConvertButton(_ref) { 5868 var isVisible = _ref.isVisible, 5869 isStaticBlock = _ref.isStaticBlock, 5870 onConvertToStatic = _ref.onConvertToStatic, 5871 onConvertToReusable = _ref.onConvertToReusable; 5872 5873 if (!isVisible) { 5874 return null; 5875 } 5876 5877 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["Fragment"], null, isStaticBlock && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__["MenuItem"], { 5878 className: "editor-block-settings-menu__control", 5879 icon: "controls-repeat", 5880 onClick: onConvertToReusable 5881 }, Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__["__"])('Add to Reusable Blocks')), !isStaticBlock && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__["MenuItem"], { 5882 className: "editor-block-settings-menu__control", 5883 icon: "controls-repeat", 5884 onClick: onConvertToStatic 5885 }, Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__["__"])('Convert to Regular Block'))); 5886 } 5887 /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_6__["compose"])([Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_5__["withSelect"])(function (select, _ref2) { 5888 var clientIds = _ref2.clientIds; 5889 5890 var _select = select('core/editor'), 5891 getBlock = _select.getBlock, 5892 getReusableBlock = _select.getReusableBlock; 5893 5894 var _select2 = select('core/blocks'), 5895 getFallbackBlockName = _select2.getFallbackBlockName; 5896 5897 var blocks = Object(lodash__WEBPACK_IMPORTED_MODULE_1__["map"])(clientIds, function (clientId) { 5898 return getBlock(clientId); 5899 }); // Hide 'Add to Reusable Blocks' on Classic blocks. Showing it causes a 5900 // confusing UX, because of its similarity to the 'Convert to Blocks' button. 5901 5902 var isVisible = Object(lodash__WEBPACK_IMPORTED_MODULE_1__["every"])(blocks, function (block) { 5903 return !!block; 5904 }) && (blocks.length !== 1 || blocks[0].name !== getFallbackBlockName()); 5905 return { 5906 isStaticBlock: isVisible && (blocks.length !== 1 || !Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_4__["isReusableBlock"])(blocks[0]) || !getReusableBlock(blocks[0].attributes.ref)), 5907 isVisible: isVisible 5908 }; 5909 }), Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_5__["withDispatch"])(function (dispatch, _ref3) { 5910 var clientIds = _ref3.clientIds, 5911 _ref3$onToggle = _ref3.onToggle, 5912 onToggle = _ref3$onToggle === void 0 ? lodash__WEBPACK_IMPORTED_MODULE_1__["noop"] : _ref3$onToggle; 5913 5914 var _dispatch = dispatch('core/editor'), 5915 convertBlockToReusable = _dispatch.convertBlockToReusable, 5916 convertBlockToStatic = _dispatch.convertBlockToStatic; 5917 5918 return { 5919 onConvertToStatic: function onConvertToStatic() { 5920 if (clientIds.length !== 1) { 5921 return; 5922 } 5923 5924 convertBlockToStatic(clientIds[0]); 5925 onToggle(); 5926 }, 5927 onConvertToReusable: function onConvertToReusable() { 5928 convertBlockToReusable(clientIds); 5929 onToggle(); 5930 } 5931 }; 5932 })])(ReusableBlockConvertButton)); 5933 5934 5935 /***/ }), 5936 5937 /***/ "./node_modules/@wordpress/editor/build-module/components/block-settings-menu/reusable-block-delete-button.js": 5938 /*!********************************************************************************************************************!*\ 5939 !*** ./node_modules/@wordpress/editor/build-module/components/block-settings-menu/reusable-block-delete-button.js ***! 5940 \********************************************************************************************************************/ 5941 /*! exports provided: ReusableBlockDeleteButton, default */ 5942 /***/ (function(module, __webpack_exports__, __webpack_require__) { 5943 5944 "use strict"; 5945 __webpack_require__.r(__webpack_exports__); 5946 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ReusableBlockDeleteButton", function() { return ReusableBlockDeleteButton; }); 5947 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); 5948 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); 5949 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lodash */ "lodash"); 5950 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_1__); 5951 /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose"); 5952 /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_2__); 5953 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); 5954 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__); 5955 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); 5956 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__); 5957 /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks"); 5958 /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_5__); 5959 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); 5960 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_6__); 5961 5962 5963 /** 5964 * External dependencies 5965 */ 5966 5967 /** 5968 * WordPress dependencies 5969 */ 5970 5971 5972 5973 5974 5975 5976 function ReusableBlockDeleteButton(_ref) { 5977 var reusableBlock = _ref.reusableBlock, 5978 onDelete = _ref.onDelete; 5979 5980 if (!reusableBlock) { 5981 return null; 5982 } 5983 5984 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__["MenuItem"], { 5985 className: "editor-block-settings-menu__control", 5986 icon: "no", 5987 disabled: reusableBlock.isTemporary, 5988 onClick: function onClick() { 5989 return onDelete(reusableBlock.id); 5990 } 5991 }, Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__["__"])('Remove from Reusable Blocks')); 5992 } 5993 /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_2__["compose"])([Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_6__["withSelect"])(function (select, _ref2) { 5994 var clientId = _ref2.clientId; 5995 5996 var _select = select('core/editor'), 5997 getBlock = _select.getBlock, 5998 getReusableBlock = _select.getReusableBlock; 5999 6000 var block = getBlock(clientId); 6001 return { 6002 reusableBlock: block && Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_5__["isReusableBlock"])(block) ? getReusableBlock(block.attributes.ref) : null 6003 }; 6004 }), Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_6__["withDispatch"])(function (dispatch, _ref3) { 6005 var _ref3$onToggle = _ref3.onToggle, 6006 onToggle = _ref3$onToggle === void 0 ? lodash__WEBPACK_IMPORTED_MODULE_1__["noop"] : _ref3$onToggle; 6007 6008 var _dispatch = dispatch('core/editor'), 6009 deleteReusableBlock = _dispatch.deleteReusableBlock; 6010 6011 return { 6012 onDelete: function onDelete(id) { 6013 // TODO: Make this a <Confirm /> component or similar 6014 // eslint-disable-next-line no-alert 6015 var hasConfirmed = window.confirm(Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__["__"])('Are you sure you want to delete this Reusable Block?\n\n' + 'It will be permanently removed from all posts and pages that use it.')); 6016 6017 if (hasConfirmed) { 6018 deleteReusableBlock(id); 6019 onToggle(); 6020 } 6021 } 6022 }; 6023 })])(ReusableBlockDeleteButton)); 6024 6025 6026 /***/ }), 6027 6028 /***/ "./node_modules/@wordpress/editor/build-module/components/block-styles/index.js": 6029 /*!**************************************************************************************!*\ 6030 !*** ./node_modules/@wordpress/editor/build-module/components/block-styles/index.js ***! 6031 \**************************************************************************************/ 6032 /*! exports provided: getActiveStyle, replaceActiveStyle, default */ 6033 /***/ (function(module, __webpack_exports__, __webpack_require__) { 6034 6035 "use strict"; 6036 __webpack_require__.r(__webpack_exports__); 6037 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getActiveStyle", function() { return getActiveStyle; }); 6038 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "replaceActiveStyle", function() { return replaceActiveStyle; }); 6039 /* harmony import */ var _babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectSpread */ "./node_modules/@babel/runtime/helpers/esm/objectSpread.js"); 6040 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); 6041 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__); 6042 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! lodash */ "lodash"); 6043 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_2__); 6044 /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); 6045 /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_3__); 6046 /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose"); 6047 /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_4__); 6048 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); 6049 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_5__); 6050 /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks"); 6051 /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_6__); 6052 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); 6053 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_7__); 6054 /* harmony import */ var _wordpress_token_list__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @wordpress/token-list */ "@wordpress/token-list"); 6055 /* harmony import */ var _wordpress_token_list__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_wordpress_token_list__WEBPACK_IMPORTED_MODULE_8__); 6056 /* harmony import */ var _block_preview__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../block-preview */ "./node_modules/@wordpress/editor/build-module/components/block-preview/index.js"); 6057 6058 6059 6060 /** 6061 * External dependencies 6062 */ 6063 6064 6065 /** 6066 * WordPress dependencies 6067 */ 6068 6069 6070 6071 6072 6073 6074 /** 6075 * Internal dependencies 6076 */ 6077 6078 6079 /** 6080 * Returns the active style from the given className. 6081 * 6082 * @param {Array} styles Block style variations. 6083 * @param {string} className Class name 6084 * 6085 * @return {Object?} The active style. 6086 */ 6087 6088 function getActiveStyle(styles, className) { 6089 var _iteratorNormalCompletion = true; 6090 var _didIteratorError = false; 6091 var _iteratorError = undefined; 6092 6093 try { 6094 for (var _iterator = new _wordpress_token_list__WEBPACK_IMPORTED_MODULE_8___default.a(className).values()[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { 6095 var style = _step.value; 6096 6097 if (style.indexOf('is-style-') === -1) { 6098 continue; 6099 } 6100 6101 var potentialStyleName = style.substring(9); 6102 var activeStyle = Object(lodash__WEBPACK_IMPORTED_MODULE_2__["find"])(styles, { 6103 name: potentialStyleName 6104 }); 6105 6106 if (activeStyle) { 6107 return activeStyle; 6108 } 6109 } 6110 } catch (err) { 6111 _didIteratorError = true; 6112 _iteratorError = err; 6113 } finally { 6114 try { 6115 if (!_iteratorNormalCompletion && _iterator.return != null) { 6116 _iterator.return(); 6117 } 6118 } finally { 6119 if (_didIteratorError) { 6120 throw _iteratorError; 6121 } 6122 } 6123 } 6124 6125 return Object(lodash__WEBPACK_IMPORTED_MODULE_2__["find"])(styles, 'isDefault'); 6126 } 6127 /** 6128 * Replaces the active style in the block's className. 6129 * 6130 * @param {string} className Class name. 6131 * @param {Object?} activeStyle The replaced style. 6132 * @param {Object} newStyle The replacing style. 6133 * 6134 * @return {string} The updated className. 6135 */ 6136 6137 function replaceActiveStyle(className, activeStyle, newStyle) { 6138 var list = new _wordpress_token_list__WEBPACK_IMPORTED_MODULE_8___default.a(className); 6139 6140 if (activeStyle) { 6141 list.remove('is-style-' + activeStyle.name); 6142 } 6143 6144 list.add('is-style-' + newStyle.name); 6145 return list.value; 6146 } 6147 6148 function BlockStyles(_ref) { 6149 var styles = _ref.styles, 6150 className = _ref.className, 6151 onChangeClassName = _ref.onChangeClassName, 6152 name = _ref.name, 6153 attributes = _ref.attributes, 6154 onSwitch = _ref.onSwitch, 6155 onHoverClassName = _ref.onHoverClassName; 6156 6157 if (!styles) { 6158 return null; 6159 } 6160 6161 var activeStyle = getActiveStyle(styles, className); 6162 6163 function updateClassName(style) { 6164 var updatedClassName = replaceActiveStyle(className, activeStyle, style); 6165 onChangeClassName(updatedClassName); 6166 onSwitch(); 6167 } 6168 6169 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])("div", { 6170 className: "editor-block-styles" 6171 }, styles.map(function (style) { 6172 var styleClassName = replaceActiveStyle(className, activeStyle, style); 6173 /* eslint-disable jsx-a11y/click-events-have-key-events */ 6174 6175 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])("div", { 6176 key: style.name, 6177 className: classnames__WEBPACK_IMPORTED_MODULE_3___default()('editor-block-styles__item', { 6178 'is-active': activeStyle === style 6179 }), 6180 onClick: function onClick() { 6181 return updateClassName(style); 6182 }, 6183 onMouseEnter: function onMouseEnter() { 6184 return onHoverClassName(styleClassName); 6185 }, 6186 onMouseLeave: function onMouseLeave() { 6187 return onHoverClassName(null); 6188 }, 6189 role: "button", 6190 tabIndex: "0", 6191 "aria-label": Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_7__["sprintf"])(Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_7__["__"])('Apply style variation "%s"'), style.label || style.name) 6192 }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])("div", { 6193 className: "editor-block-styles__item-preview" 6194 }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])(_block_preview__WEBPACK_IMPORTED_MODULE_9__["BlockPreviewContent"], { 6195 name: name, 6196 attributes: Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_0__["default"])({}, attributes, { 6197 className: styleClassName 6198 }) 6199 })), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])("div", { 6200 className: "editor-block-styles__item-label" 6201 }, style.label || style.name)); 6202 /* eslint-enable jsx-a11y/click-events-have-key-events */ 6203 })); 6204 } 6205 6206 /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_4__["compose"])([Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_5__["withSelect"])(function (select, _ref2) { 6207 var clientId = _ref2.clientId; 6208 var block = select('core/editor').getBlock(clientId); 6209 return { 6210 name: block.name, 6211 attributes: block.attributes, 6212 className: block.attributes.className || '', 6213 styles: Object(lodash__WEBPACK_IMPORTED_MODULE_2__["get"])(Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_6__["getBlockType"])(block.name), ['styles']) 6214 }; 6215 }), Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_5__["withDispatch"])(function (dispatch, _ref3) { 6216 var clientId = _ref3.clientId; 6217 return { 6218 onChangeClassName: function onChangeClassName(newClassName) { 6219 dispatch('core/editor').updateBlockAttributes(clientId, { 6220 className: newClassName 6221 }); 6222 } 6223 }; 6224 })])(BlockStyles)); 6225 6226 6227 /***/ }), 6228 6229 /***/ "./node_modules/@wordpress/editor/build-module/components/block-switcher/index.js": 6230 /*!****************************************************************************************!*\ 6231 !*** ./node_modules/@wordpress/editor/build-module/components/block-switcher/index.js ***! 6232 \****************************************************************************************/ 6233 /*! exports provided: BlockSwitcher, default */ 6234 /***/ (function(module, __webpack_exports__, __webpack_require__) { 6235 6236 "use strict"; 6237 __webpack_require__.r(__webpack_exports__); 6238 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BlockSwitcher", function() { return BlockSwitcher; }); 6239 /* harmony import */ var _babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectSpread */ "./node_modules/@babel/runtime/helpers/esm/objectSpread.js"); 6240 /* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/classCallCheck */ "./node_modules/@babel/runtime/helpers/esm/classCallCheck.js"); 6241 /* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/createClass */ "./node_modules/@babel/runtime/helpers/esm/createClass.js"); 6242 /* harmony import */ var _babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/esm/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js"); 6243 /* harmony import */ var _babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/esm/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js"); 6244 /* harmony import */ var _babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inherits */ "./node_modules/@babel/runtime/helpers/esm/inherits.js"); 6245 /* harmony import */ var _babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @babel/runtime/helpers/esm/assertThisInitialized */ "./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js"); 6246 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); 6247 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__); 6248 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! lodash */ "lodash"); 6249 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_8__); 6250 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); 6251 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_9__); 6252 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); 6253 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_10__); 6254 /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks"); 6255 /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_11__); 6256 /* harmony import */ var _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @wordpress/keycodes */ "@wordpress/keycodes"); 6257 /* harmony import */ var _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(_wordpress_keycodes__WEBPACK_IMPORTED_MODULE_12__); 6258 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); 6259 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_13__); 6260 /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose"); 6261 /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_14___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_14__); 6262 /* harmony import */ var _block_icon__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../block-icon */ "./node_modules/@wordpress/editor/build-module/components/block-icon/index.js"); 6263 /* harmony import */ var _block_styles__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ../block-styles */ "./node_modules/@wordpress/editor/build-module/components/block-styles/index.js"); 6264 /* harmony import */ var _block_preview__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ../block-preview */ "./node_modules/@wordpress/editor/build-module/components/block-preview/index.js"); 6265 /* harmony import */ var _block_types_list__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ../block-types-list */ "./node_modules/@wordpress/editor/build-module/components/block-types-list/index.js"); 6266 6267 6268 6269 6270 6271 6272 6273 6274 6275 /** 6276 * External dependencies 6277 */ 6278 6279 /** 6280 * WordPress dependencies 6281 */ 6282 6283 6284 6285 6286 6287 6288 6289 6290 /** 6291 * Internal dependencies 6292 */ 6293 6294 6295 6296 6297 6298 var BlockSwitcher = 6299 /*#__PURE__*/ 6300 function (_Component) { 6301 Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_5__["default"])(BlockSwitcher, _Component); 6302 6303 function BlockSwitcher() { 6304 var _this; 6305 6306 Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_1__["default"])(this, BlockSwitcher); 6307 6308 _this = Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__["default"])(this, Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__["default"])(BlockSwitcher).apply(this, arguments)); 6309 _this.state = { 6310 hoveredClassName: null 6311 }; 6312 _this.onHoverClassName = _this.onHoverClassName.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["default"])(_this))); 6313 return _this; 6314 } 6315 6316 Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_2__["default"])(BlockSwitcher, [{ 6317 key: "onHoverClassName", 6318 value: function onHoverClassName(className) { 6319 this.setState({ 6320 hoveredClassName: className 6321 }); 6322 } 6323 }, { 6324 key: "render", 6325 value: function render() { 6326 var _this2 = this; 6327 6328 var _this$props = this.props, 6329 blocks = _this$props.blocks, 6330 onTransform = _this$props.onTransform, 6331 inserterItems = _this$props.inserterItems; 6332 var hoveredClassName = this.state.hoveredClassName; 6333 6334 if (!blocks || !blocks.length) { 6335 return null; 6336 } 6337 6338 var itemsByName = Object(lodash__WEBPACK_IMPORTED_MODULE_8__["mapKeys"])(inserterItems, function (_ref) { 6339 var name = _ref.name; 6340 return name; 6341 }); 6342 var possibleBlockTransformations = Object(lodash__WEBPACK_IMPORTED_MODULE_8__["orderBy"])(Object(lodash__WEBPACK_IMPORTED_MODULE_8__["filter"])(Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_11__["getPossibleBlockTransformations"])(blocks), function (block) { 6343 return !!itemsByName[block.name]; 6344 }), function (block) { 6345 return itemsByName[block.name].frecency; 6346 }, 'desc'); 6347 var sourceBlockName = blocks[0].name; 6348 var blockType = Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_11__["getBlockType"])(sourceBlockName); 6349 var hasStyles = blocks.length === 1 && Object(lodash__WEBPACK_IMPORTED_MODULE_8__["get"])(blockType, ['styles'], []).length !== 0; 6350 6351 if (!hasStyles && !possibleBlockTransformations.length) { 6352 return null; 6353 } 6354 6355 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_10__["Dropdown"], { 6356 position: "bottom right", 6357 className: "editor-block-switcher", 6358 contentClassName: "editor-block-switcher__popover", 6359 renderToggle: function renderToggle(_ref2) { 6360 var onToggle = _ref2.onToggle, 6361 isOpen = _ref2.isOpen; 6362 6363 var openOnArrowDown = function openOnArrowDown(event) { 6364 if (!isOpen && event.keyCode === _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_12__["DOWN"]) { 6365 event.preventDefault(); 6366 event.stopPropagation(); 6367 onToggle(); 6368 } 6369 }; 6370 6371 var label = 1 === blocks.length ? Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_9__["__"])('Change block type') : Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_9__["sprintf"])(Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_9__["_n"])('Change type of %d block', 'Change type of %d blocks', blocks.length), blocks.length); 6372 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_10__["Toolbar"], null, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_10__["IconButton"], { 6373 className: "editor-block-switcher__toggle", 6374 onClick: onToggle, 6375 "aria-haspopup": "true", 6376 "aria-expanded": isOpen, 6377 label: label, 6378 tooltip: label, 6379 onKeyDown: openOnArrowDown 6380 }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["createElement"])(_block_icon__WEBPACK_IMPORTED_MODULE_15__["default"], { 6381 icon: blockType.icon && blockType.icon.src, 6382 showColors: true 6383 }), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_10__["SVG"], { 6384 className: "editor-block-switcher__transform", 6385 xmlns: "http://www.w3.org/2000/svg", 6386 viewBox: "0 0 24 24" 6387 }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_10__["Path"], { 6388 d: "M6.5 8.9c.6-.6 1.4-.9 2.2-.9h6.9l-1.3 1.3 1.4 1.4L19.4 7l-3.7-3.7-1.4 1.4L15.6 6H8.7c-1.4 0-2.6.5-3.6 1.5l-2.8 2.8 1.4 1.4 2.8-2.8zm13.8 2.4l-2.8 2.8c-.6.6-1.3.9-2.1.9h-7l1.3-1.3-1.4-1.4L4.6 16l3.7 3.7 1.4-1.4L8.4 17h6.9c1.3 0 2.6-.5 3.5-1.5l2.8-2.8-1.3-1.4z" 6389 })))); 6390 }, 6391 renderContent: function renderContent(_ref3) { 6392 var onClose = _ref3.onClose; 6393 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["createElement"])(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["Fragment"], null, hasStyles && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_10__["PanelBody"], { 6394 title: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_9__["__"])('Block Styles'), 6395 initialOpen: true 6396 }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["createElement"])(_block_styles__WEBPACK_IMPORTED_MODULE_16__["default"], { 6397 clientId: blocks[0].clientId, 6398 onSwitch: onClose, 6399 onHoverClassName: _this2.onHoverClassName 6400 })), possibleBlockTransformations.length !== 0 && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_10__["PanelBody"], { 6401 title: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_9__["__"])('Transform To:'), 6402 initialOpen: true 6403 }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["createElement"])(_block_types_list__WEBPACK_IMPORTED_MODULE_18__["default"], { 6404 items: possibleBlockTransformations.map(function (destinationBlockType) { 6405 return { 6406 id: destinationBlockType.name, 6407 icon: destinationBlockType.icon, 6408 title: destinationBlockType.title, 6409 hasChildBlocksWithInserterSupport: Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_11__["hasChildBlocksWithInserterSupport"])(destinationBlockType.name) 6410 }; 6411 }), 6412 onSelect: function onSelect(item) { 6413 onTransform(blocks, item.id); 6414 onClose(); 6415 } 6416 })), hoveredClassName !== null && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["createElement"])(_block_preview__WEBPACK_IMPORTED_MODULE_17__["default"], { 6417 name: blocks[0].name, 6418 attributes: Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_0__["default"])({}, blocks[0].attributes, { 6419 className: hoveredClassName 6420 }) 6421 })); 6422 } 6423 }); 6424 } 6425 }]); 6426 6427 return BlockSwitcher; 6428 }(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["Component"]); 6429 /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_14__["compose"])(Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_13__["withSelect"])(function (select, _ref4) { 6430 var clientIds = _ref4.clientIds; 6431 6432 var _select = select('core/editor'), 6433 getBlocksByClientId = _select.getBlocksByClientId, 6434 getBlockRootClientId = _select.getBlockRootClientId, 6435 getInserterItems = _select.getInserterItems; 6436 6437 var rootClientId = getBlockRootClientId(Object(lodash__WEBPACK_IMPORTED_MODULE_8__["first"])(Object(lodash__WEBPACK_IMPORTED_MODULE_8__["castArray"])(clientIds))); 6438 return { 6439 blocks: getBlocksByClientId(clientIds), 6440 inserterItems: getInserterItems(rootClientId) 6441 }; 6442 }), Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_13__["withDispatch"])(function (dispatch, ownProps) { 6443 return { 6444 onTransform: function onTransform(blocks, name) { 6445 dispatch('core/editor').replaceBlocks(ownProps.clientIds, Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_11__["switchToBlockType"])(blocks, name)); 6446 } 6447 }; 6448 }))(BlockSwitcher)); 6449 6450 6451 /***/ }), 6452 6453 /***/ "./node_modules/@wordpress/editor/build-module/components/block-switcher/multi-blocks-switcher.js": 6454 /*!********************************************************************************************************!*\ 6455 !*** ./node_modules/@wordpress/editor/build-module/components/block-switcher/multi-blocks-switcher.js ***! 6456 \********************************************************************************************************/ 6457 /*! exports provided: MultiBlocksSwitcher, default */ 6458 /***/ (function(module, __webpack_exports__, __webpack_require__) { 6459 6460 "use strict"; 6461 __webpack_require__.r(__webpack_exports__); 6462 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MultiBlocksSwitcher", function() { return MultiBlocksSwitcher; }); 6463 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); 6464 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); 6465 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); 6466 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_1__); 6467 /* harmony import */ var ___WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./ */ "./node_modules/@wordpress/editor/build-module/components/block-switcher/index.js"); 6468 6469 6470 /** 6471 * WordPress dependencies 6472 */ 6473 6474 /** 6475 * Internal dependencies 6476 */ 6477 6478 6479 function MultiBlocksSwitcher(_ref) { 6480 var isMultiBlockSelection = _ref.isMultiBlockSelection, 6481 selectedBlockClientIds = _ref.selectedBlockClientIds; 6482 6483 if (!isMultiBlockSelection) { 6484 return null; 6485 } 6486 6487 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(___WEBPACK_IMPORTED_MODULE_2__["default"], { 6488 key: "switcher", 6489 clientIds: selectedBlockClientIds 6490 }); 6491 } 6492 /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_1__["withSelect"])(function (select) { 6493 var selectedBlockClientIds = select('core/editor').getMultiSelectedBlockClientIds(); 6494 return { 6495 isMultiBlockSelection: selectedBlockClientIds.length > 1, 6496 selectedBlockClientIds: selectedBlockClientIds 6497 }; 6498 })(MultiBlocksSwitcher)); 6499 6500 6501 /***/ }), 6502 6503 /***/ "./node_modules/@wordpress/editor/build-module/components/block-title/index.js": 6504 /*!*************************************************************************************!*\ 6505 !*** ./node_modules/@wordpress/editor/build-module/components/block-title/index.js ***! 6506 \*************************************************************************************/ 6507 /*! exports provided: BlockTitle, default */ 6508 /***/ (function(module, __webpack_exports__, __webpack_require__) { 6509 6510 "use strict"; 6511 __webpack_require__.r(__webpack_exports__); 6512 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BlockTitle", function() { return BlockTitle; }); 6513 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); 6514 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_0__); 6515 /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks"); 6516 /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_1__); 6517 /** 6518 * WordPress dependencies 6519 */ 6520 6521 6522 /** 6523 * Renders the block's configured title as a string, or empty if the title 6524 * cannot be determined. 6525 * 6526 * @example 6527 * 6528 * ```jsx 6529 * <BlockTitle clientId="afd1cb17-2c08-4e7a-91be-007ba7ddc3a1" /> 6530 * ``` 6531 * 6532 * @param {?string} props.name Block name. 6533 * 6534 * @return {?string} Block title. 6535 */ 6536 6537 function BlockTitle(_ref) { 6538 var name = _ref.name; 6539 6540 if (!name) { 6541 return null; 6542 } 6543 6544 var blockType = Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_1__["getBlockType"])(name); 6545 6546 if (!blockType) { 6547 return null; 6548 } 6549 6550 return blockType.title; 6551 } 6552 /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_0__["withSelect"])(function (select, ownProps) { 6553 var _select = select('core/editor'), 6554 getBlockName = _select.getBlockName; 6555 6556 var clientId = ownProps.clientId; 6557 return { 6558 name: getBlockName(clientId) 6559 }; 6560 })(BlockTitle)); 6561 6562 6563 /***/ }), 6564 6565 /***/ "./node_modules/@wordpress/editor/build-module/components/block-toolbar/index.js": 6566 /*!***************************************************************************************!*\ 6567 !*** ./node_modules/@wordpress/editor/build-module/components/block-toolbar/index.js ***! 6568 \***************************************************************************************/ 6569 /*! exports provided: default */ 6570 /***/ (function(module, __webpack_exports__, __webpack_require__) { 6571 6572 "use strict"; 6573 __webpack_require__.r(__webpack_exports__); 6574 /* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/classCallCheck */ "./node_modules/@babel/runtime/helpers/esm/classCallCheck.js"); 6575 /* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/createClass */ "./node_modules/@babel/runtime/helpers/esm/createClass.js"); 6576 /* harmony import */ var _babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js"); 6577 /* harmony import */ var _babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/esm/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js"); 6578 /* harmony import */ var _babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inherits */ "./node_modules/@babel/runtime/helpers/esm/inherits.js"); 6579 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); 6580 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_5__); 6581 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); 6582 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_6__); 6583 /* harmony import */ var _wordpress_dom__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @wordpress/dom */ "@wordpress/dom"); 6584 /* harmony import */ var _wordpress_dom__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_wordpress_dom__WEBPACK_IMPORTED_MODULE_7__); 6585 /* harmony import */ var _block_switcher__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../block-switcher */ "./node_modules/@wordpress/editor/build-module/components/block-switcher/index.js"); 6586 /* harmony import */ var _block_switcher_multi_blocks_switcher__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../block-switcher/multi-blocks-switcher */ "./node_modules/@wordpress/editor/build-module/components/block-switcher/multi-blocks-switcher.js"); 6587 /* harmony import */ var _block_controls__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../block-controls */ "./node_modules/@wordpress/editor/build-module/components/block-controls/index.js"); 6588 /* harmony import */ var _block_format_controls__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../block-format-controls */ "./node_modules/@wordpress/editor/build-module/components/block-format-controls/index.js"); 6589 /* harmony import */ var _block_settings_menu__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../block-settings-menu */ "./node_modules/@wordpress/editor/build-module/components/block-settings-menu/index.js"); 6590 6591 6592 6593 6594 6595 6596 6597 /** 6598 * WordPress Dependencies 6599 */ 6600 6601 6602 6603 /** 6604 * Internal Dependencies 6605 */ 6606 6607 6608 6609 6610 6611 6612 6613 var BlockToolbar = 6614 /*#__PURE__*/ 6615 function (_Component) { 6616 Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__["default"])(BlockToolbar, _Component); 6617 6618 function BlockToolbar() { 6619 var _this; 6620 6621 Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__["default"])(this, BlockToolbar); 6622 6623 _this = Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__["default"])(this, Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__["default"])(BlockToolbar).apply(this, arguments)); 6624 _this.container = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_5__["createRef"])(); 6625 return _this; 6626 } 6627 6628 Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__["default"])(BlockToolbar, [{ 6629 key: "componentDidMount", 6630 value: function componentDidMount() { 6631 if (this.props.blockClientIds.length > 1) { 6632 this.focusContainer(); 6633 } 6634 } 6635 }, { 6636 key: "componentDidUpdate", 6637 value: function componentDidUpdate(prevProps) { 6638 if (prevProps.blockClientIds.length <= 1 && this.props.blockClientIds.length > 1) { 6639 this.focusContainer(); 6640 } 6641 } 6642 }, { 6643 key: "focusContainer", 6644 value: function focusContainer() { 6645 var tabbables = _wordpress_dom__WEBPACK_IMPORTED_MODULE_7__["focus"].tabbable.find(this.container.current); 6646 6647 if (tabbables.length) { 6648 tabbables[0].focus(); 6649 } 6650 } 6651 }, { 6652 key: "render", 6653 value: function render() { 6654 var _this$props = this.props, 6655 blockClientIds = _this$props.blockClientIds, 6656 isValid = _this$props.isValid, 6657 mode = _this$props.mode; 6658 6659 if (blockClientIds.length === 0) { 6660 return null; 6661 } 6662 6663 if (blockClientIds.length > 1) { 6664 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_5__["createElement"])("div", { 6665 className: "editor-block-toolbar", 6666 ref: this.container 6667 }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_5__["createElement"])(_block_switcher_multi_blocks_switcher__WEBPACK_IMPORTED_MODULE_9__["default"], null), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_5__["createElement"])(_block_settings_menu__WEBPACK_IMPORTED_MODULE_12__["default"], { 6668 clientIds: blockClientIds 6669 })); 6670 } 6671 6672 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_5__["createElement"])("div", { 6673 className: "editor-block-toolbar" 6674 }, mode === 'visual' && isValid && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_5__["createElement"])(_wordpress_element__WEBPACK_IMPORTED_MODULE_5__["Fragment"], null, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_5__["createElement"])(_block_switcher__WEBPACK_IMPORTED_MODULE_8__["default"], { 6675 clientIds: blockClientIds 6676 }), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_5__["createElement"])(_block_controls__WEBPACK_IMPORTED_MODULE_10__["default"].Slot, null), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_5__["createElement"])(_block_format_controls__WEBPACK_IMPORTED_MODULE_11__["default"].Slot, null)), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_5__["createElement"])(_block_settings_menu__WEBPACK_IMPORTED_MODULE_12__["default"], { 6677 clientIds: blockClientIds 6678 })); 6679 } 6680 }]); 6681 6682 return BlockToolbar; 6683 }(_wordpress_element__WEBPACK_IMPORTED_MODULE_5__["Component"]); 6684 6685 /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_6__["withSelect"])(function (select) { 6686 var _select = select('core/editor'), 6687 getSelectedBlock = _select.getSelectedBlock, 6688 getBlockMode = _select.getBlockMode, 6689 getMultiSelectedBlockClientIds = _select.getMultiSelectedBlockClientIds; 6690 6691 var block = getSelectedBlock(); 6692 var blockClientIds = block ? [block.clientId] : getMultiSelectedBlockClientIds(); 6693 return { 6694 blockClientIds: blockClientIds, 6695 isValid: block ? block.isValid : null, 6696 mode: block ? getBlockMode(block.clientId) : null 6697 }; 6698 })(BlockToolbar)); 6699 6700 6701 /***/ }), 6702 6703 /***/ "./node_modules/@wordpress/editor/build-module/components/block-types-list/index.js": 6704 /*!******************************************************************************************!*\ 6705 !*** ./node_modules/@wordpress/editor/build-module/components/block-types-list/index.js ***! 6706 \******************************************************************************************/ 6707 /*! exports provided: default */ 6708 /***/ (function(module, __webpack_exports__, __webpack_require__) { 6709 6710 "use strict"; 6711 __webpack_require__.r(__webpack_exports__); 6712 /* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/classCallCheck */ "./node_modules/@babel/runtime/helpers/esm/classCallCheck.js"); 6713 /* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/createClass */ "./node_modules/@babel/runtime/helpers/esm/createClass.js"); 6714 /* harmony import */ var _babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js"); 6715 /* harmony import */ var _babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/esm/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js"); 6716 /* harmony import */ var _babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inherits */ "./node_modules/@babel/runtime/helpers/esm/inherits.js"); 6717 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); 6718 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_5__); 6719 /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); 6720 /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_6__); 6721 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! lodash */ "lodash"); 6722 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_7__); 6723 /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks"); 6724 /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_8__); 6725 /* harmony import */ var _block_icon__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../block-icon */ "./node_modules/@wordpress/editor/build-module/components/block-icon/index.js"); 6726 6727 6728 6729 6730 6731 6732 6733 /** 6734 * External dependencies 6735 */ 6736 6737 6738 /** 6739 * WordPress dependencies 6740 */ 6741 6742 6743 6744 /** 6745 * Internal dependencies 6746 */ 6747 6748 6749 6750 var BlockTypesList = 6751 /*#__PURE__*/ 6752 function (_Component) { 6753 Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__["default"])(BlockTypesList, _Component); 6754 6755 function BlockTypesList() { 6756 Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__["default"])(this, BlockTypesList); 6757 6758 return Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__["default"])(this, Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__["default"])(BlockTypesList).apply(this, arguments)); 6759 } 6760 6761 Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__["default"])(BlockTypesList, [{ 6762 key: "render", 6763 value: function render() { 6764 var _this$props = this.props, 6765 items = _this$props.items, 6766 onSelect = _this$props.onSelect, 6767 _this$props$onHover = _this$props.onHover, 6768 onHover = _this$props$onHover === void 0 ? lodash__WEBPACK_IMPORTED_MODULE_7__["noop"] : _this$props$onHover; 6769 return ( 6770 /* 6771 * Disable reason: The `list` ARIA role is redundant but 6772 * Safari+VoiceOver won't announce the list otherwise. 6773 */ 6774 6775 /* eslint-disable jsx-a11y/no-redundant-roles */ 6776 Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_5__["createElement"])("ul", { 6777 role: "list", 6778 className: "editor-block-types-list" 6779 }, items.map(function (item) { 6780 var itemIconStyle = item.icon ? { 6781 backgroundColor: item.icon.background, 6782 color: item.icon.foreground 6783 } : {}; 6784 var itemIconStackStyle = item.icon && item.icon.shadowColor ? { 6785 backgroundColor: item.icon.shadowColor 6786 } : {}; 6787 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_5__["createElement"])("li", { 6788 className: "editor-block-types-list__list-item", 6789 key: item.id 6790 }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_5__["createElement"])("button", { 6791 className: classnames__WEBPACK_IMPORTED_MODULE_6___default()('editor-block-types-list__item', Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_8__["getBlockMenuDefaultClassName"])(item.id), { 6792 'editor-block-types-list__item-has-children': item.hasChildBlocksWithInserterSupport 6793 }), 6794 onClick: function onClick() { 6795 onSelect(item); 6796 onHover(null); 6797 }, 6798 disabled: item.isDisabled, 6799 onMouseEnter: function onMouseEnter() { 6800 return onHover(item); 6801 }, 6802 onMouseLeave: function onMouseLeave() { 6803 return onHover(null); 6804 }, 6805 onFocus: function onFocus() { 6806 return onHover(item); 6807 }, 6808 onBlur: function onBlur() { 6809 return onHover(null); 6810 }, 6811 "aria-label": item.title // Fix for IE11 and JAWS 2018. 6812 6813 }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_5__["createElement"])("span", { 6814 className: "editor-block-types-list__item-icon", 6815 style: itemIconStyle 6816 }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_5__["createElement"])(_block_icon__WEBPACK_IMPORTED_MODULE_9__["default"], { 6817 icon: item.icon && item.icon.src, 6818 showColors: true 6819 }), item.hasChildBlocksWithInserterSupport && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_5__["createElement"])("span", { 6820 className: "editor-block-types-list__item-icon-stack", 6821 style: itemIconStackStyle 6822 })), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_5__["createElement"])("span", { 6823 className: "editor-block-types-list__item-title" 6824 }, item.title))); 6825 })) 6826 /* eslint-enable jsx-a11y/no-redundant-roles */ 6827 6828 ); 6829 } 6830 }]); 6831 6832 return BlockTypesList; 6833 }(_wordpress_element__WEBPACK_IMPORTED_MODULE_5__["Component"]); 6834 6835 /* harmony default export */ __webpack_exports__["default"] = (BlockTypesList); 6836 6837 6838 /***/ }), 6839 6840 /***/ "./node_modules/@wordpress/editor/build-module/components/color-palette/control.js": 6841 /*!*****************************************************************************************!*\ 6842 !*** ./node_modules/@wordpress/editor/build-module/components/color-palette/control.js ***! 6843 \*****************************************************************************************/ 6844 /*! exports provided: ColorPaletteControl, default */ 6845 /***/ (function(module, __webpack_exports__, __webpack_require__) { 6846 6847 "use strict"; 6848 __webpack_require__.r(__webpack_exports__); 6849 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ColorPaletteControl", function() { return ColorPaletteControl; }); 6850 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); 6851 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); 6852 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); 6853 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__); 6854 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); 6855 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__); 6856 /* harmony import */ var ___WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./ */ "./node_modules/@wordpress/editor/build-module/components/color-palette/index.js"); 6857 /* harmony import */ var _with_color_context__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./with-color-context */ "./node_modules/@wordpress/editor/build-module/components/color-palette/with-color-context.js"); 6858 /* harmony import */ var _colors__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../colors */ "./node_modules/@wordpress/editor/build-module/components/colors/index.js"); 6859 6860 6861 /** 6862 * WordPress dependencies 6863 */ 6864 6865 6866 6867 /** 6868 * Internal dependencies 6869 */ 6870 6871 6872 6873 // translators: first %s: The type of color (e.g. background color), second %s: the color name or value (e.g. red or #ff0000) 6874 6875 var colorIndicatorAriaLabel = Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__["__"])('(current %s: %s)'); 6876 6877 function ColorPaletteControl(_ref) { 6878 var label = _ref.label, 6879 value = _ref.value, 6880 onChange = _ref.onChange, 6881 colors = _ref.colors; 6882 var colorObject = Object(_colors__WEBPACK_IMPORTED_MODULE_5__["getColorObjectByColorValue"])(colors, value); 6883 var colorName = colorObject && colorObject.name; 6884 var ariaLabel = Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__["sprintf"])(colorIndicatorAriaLabel, label.toLowerCase(), colorName || value); 6885 var labelElement = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["Fragment"], null, label, value && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__["ColorIndicator"], { 6886 colorValue: value, 6887 "aria-label": ariaLabel 6888 })); 6889 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__["BaseControl"], { 6890 className: "editor-color-palette-control", 6891 label: labelElement 6892 }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(___WEBPACK_IMPORTED_MODULE_3__["default"], { 6893 className: "editor-color-palette-control__color-palette", 6894 value: value, 6895 onChange: onChange 6896 })); 6897 } 6898 /* harmony default export */ __webpack_exports__["default"] = (Object(_with_color_context__WEBPACK_IMPORTED_MODULE_4__["default"])(ColorPaletteControl)); 6899 6900 6901 /***/ }), 6902 6903 /***/ "./node_modules/@wordpress/editor/build-module/components/color-palette/index.js": 6904 /*!***************************************************************************************!*\ 6905 !*** ./node_modules/@wordpress/editor/build-module/components/color-palette/index.js ***! 6906 \***************************************************************************************/ 6907 /*! exports provided: default */ 6908 /***/ (function(module, __webpack_exports__, __webpack_require__) { 6909 6910 "use strict"; 6911 __webpack_require__.r(__webpack_exports__); 6912 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); 6913 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__); 6914 /* harmony import */ var _with_color_context__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./with-color-context */ "./node_modules/@wordpress/editor/build-module/components/color-palette/with-color-context.js"); 6915 /** 6916 * WordPress dependencies 6917 */ 6918 6919 /** 6920 * Internal dependencies 6921 */ 6922 6923 6924 /* harmony default export */ __webpack_exports__["default"] = (Object(_with_color_context__WEBPACK_IMPORTED_MODULE_1__["default"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__["ColorPalette"])); 6925 6926 6927 /***/ }), 6928 6929 /***/ "./node_modules/@wordpress/editor/build-module/components/color-palette/with-color-context.js": 6930 /*!****************************************************************************************************!*\ 6931 !*** ./node_modules/@wordpress/editor/build-module/components/color-palette/with-color-context.js ***! 6932 \****************************************************************************************************/ 6933 /*! exports provided: default */ 6934 /***/ (function(module, __webpack_exports__, __webpack_require__) { 6935 6936 "use strict"; 6937 __webpack_require__.r(__webpack_exports__); 6938 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash */ "lodash"); 6939 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_0__); 6940 /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose"); 6941 /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_1__); 6942 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); 6943 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_2__); 6944 /** 6945 * External dependencies 6946 */ 6947 6948 /** 6949 * WordPress dependencies 6950 */ 6951 6952 6953 6954 /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_1__["createHigherOrderComponent"])(Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_2__["withSelect"])(function (select) { 6955 var settings = select('core/editor').getEditorSettings(); 6956 var colors = settings.colors; 6957 var disableCustomColors = settings.disableCustomColors; 6958 return { 6959 colors: colors, 6960 disableCustomColors: disableCustomColors, 6961 hasColorsToChoose: !Object(lodash__WEBPACK_IMPORTED_MODULE_0__["isEmpty"])(colors) || !disableCustomColors 6962 }; 6963 }), 'withColorContext')); 6964 6965 6966 /***/ }), 6967 6968 /***/ "./node_modules/@wordpress/editor/build-module/components/colors/index.js": 6969 /*!********************************************************************************!*\ 6970 !*** ./node_modules/@wordpress/editor/build-module/components/colors/index.js ***! 6971 \********************************************************************************/ 6972 /*! exports provided: getColorClassName, getColorObjectByAttributeValues, getColorObjectByColorValue, withColors */ 6973 /***/ (function(module, __webpack_exports__, __webpack_require__) { 6974 6975 "use strict"; 6976 __webpack_require__.r(__webpack_exports__); 6977 /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./utils */ "./node_modules/@wordpress/editor/build-module/components/colors/utils.js"); 6978 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getColorClassName", function() { return _utils__WEBPACK_IMPORTED_MODULE_0__["getColorClassName"]; }); 6979 6980 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getColorObjectByAttributeValues", function() { return _utils__WEBPACK_IMPORTED_MODULE_0__["getColorObjectByAttributeValues"]; }); 6981 6982 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getColorObjectByColorValue", function() { return _utils__WEBPACK_IMPORTED_MODULE_0__["getColorObjectByColorValue"]; }); 6983 6984 /* harmony import */ var _with_colors__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./with-colors */ "./node_modules/@wordpress/editor/build-module/components/colors/with-colors.js"); 6985 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "withColors", function() { return _with_colors__WEBPACK_IMPORTED_MODULE_1__["default"]; }); 6986 6987 6988 6989 6990 6991 /***/ }), 6992 6993 /***/ "./node_modules/@wordpress/editor/build-module/components/colors/utils.js": 6994 /*!********************************************************************************!*\ 6995 !*** ./node_modules/@wordpress/editor/build-module/components/colors/utils.js ***! 6996 \********************************************************************************/ 6997 /*! exports provided: getColorObjectByAttributeValues, getColorObjectByColorValue, getColorClassName, getMostReadableColor */ 6998 /***/ (function(module, __webpack_exports__, __webpack_require__) { 6999 7000 "use strict"; 7001 __webpack_require__.r(__webpack_exports__); 7002 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getColorObjectByAttributeValues", function() { return getColorObjectByAttributeValues; }); 7003 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getColorObjectByColorValue", function() { return getColorObjectByColorValue; }); 7004 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getColorClassName", function() { return getColorClassName; }); 7005 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getMostReadableColor", function() { return getMostReadableColor; }); 7006 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash */ "lodash"); 7007 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_0__); 7008 /* harmony import */ var tinycolor2__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! tinycolor2 */ "./node_modules/tinycolor2/tinycolor.js"); 7009 /* harmony import */ var tinycolor2__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(tinycolor2__WEBPACK_IMPORTED_MODULE_1__); 7010 /** 7011 * External dependencies 7012 */ 7013 7014 7015 /** 7016 * Provided an array of color objects as set by the theme or by the editor defaults, 7017 * and the values of the defined color or custom color returns a color object describing the color. 7018 * 7019 * @param {Array} colors Array of color objects as set by the theme or by the editor defaults. 7020 * @param {?string} definedColor A string containing the color slug. 7021 * @param {?string} customColor A string containing the customColor value. 7022 * 7023 * @return {?string} If definedColor is passed and the name is found in colors, 7024 * the color object exactly as set by the theme or editor defaults is returned. 7025 * Otherwise, an object that just sets the color is defined. 7026 */ 7027 7028 var getColorObjectByAttributeValues = function getColorObjectByAttributeValues(colors, definedColor, customColor) { 7029 if (definedColor) { 7030 var colorObj = Object(lodash__WEBPACK_IMPORTED_MODULE_0__["find"])(colors, { 7031 slug: definedColor 7032 }); 7033 7034 if (colorObj) { 7035 return colorObj; 7036 } 7037 } 7038 7039 return { 7040 color: customColor 7041 }; 7042 }; 7043 /** 7044 * Provided an array of color objects as set by the theme or by the editor defaults, and a color value returns the color object matching that value or undefined. 7045 * 7046 * @param {Array} colors Array of color objects as set by the theme or by the editor defaults. 7047 * @param {?string} colorValue A string containing the color value. 7048 * 7049 * @return {?string} Returns the color object included in the colors array whose color property equals colorValue. 7050 * Returns undefined if no color object matches this requirement. 7051 */ 7052 7053 var getColorObjectByColorValue = function getColorObjectByColorValue(colors, colorValue) { 7054 return Object(lodash__WEBPACK_IMPORTED_MODULE_0__["find"])(colors, { 7055 color: colorValue 7056 }); 7057 }; 7058 /** 7059 * Returns a class based on the context a color is being used and its slug. 7060 * 7061 * @param {string} colorContextName Context/place where color is being used e.g: background, text etc... 7062 * @param {string} colorSlug Slug of the color. 7063 * 7064 * @return {string} String with the class corresponding to the color in the provided context. 7065 */ 7066 7067 function getColorClassName(colorContextName, colorSlug) { 7068 if (!colorContextName || !colorSlug) { 7069 return; 7070 } 7071 7072 return "has-".concat(Object(lodash__WEBPACK_IMPORTED_MODULE_0__["kebabCase"])(colorSlug), "-").concat(colorContextName); 7073 } 7074 /** 7075 * Given an array of color objects and a color value returns the color value of the most readable color in the array. 7076 * 7077 * @param {Array} colors Array of color objects as set by the theme or by the editor defaults. 7078 * @param {?string} colorValue A string containing the color value. 7079 * 7080 * @return {string} String with the color value of the most readable color. 7081 */ 7082 7083 function getMostReadableColor(colors, colorValue) { 7084 return tinycolor2__WEBPACK_IMPORTED_MODULE_1___default.a.mostReadable(colorValue, Object(lodash__WEBPACK_IMPORTED_MODULE_0__["map"])(colors, 'color')).toHexString(); 7085 } 7086 7087 7088 /***/ }), 7089 7090 /***/ "./node_modules/@wordpress/editor/build-module/components/colors/with-colors.js": 7091 /*!**************************************************************************************!*\ 7092 !*** ./node_modules/@wordpress/editor/build-module/components/colors/with-colors.js ***! 7093 \**************************************************************************************/ 7094 /*! exports provided: default */ 7095 /***/ (function(module, __webpack_exports__, __webpack_require__) { 7096 7097 "use strict"; 7098 __webpack_require__.r(__webpack_exports__); 7099 /* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/classCallCheck */ "./node_modules/@babel/runtime/helpers/esm/classCallCheck.js"); 7100 /* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/createClass */ "./node_modules/@babel/runtime/helpers/esm/createClass.js"); 7101 /* harmony import */ var _babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js"); 7102 /* harmony import */ var _babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/esm/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js"); 7103 /* harmony import */ var _babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inherits */ "./node_modules/@babel/runtime/helpers/esm/inherits.js"); 7104 /* harmony import */ var _babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/helpers/esm/assertThisInitialized */ "./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js"); 7105 /* harmony import */ var _babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @babel/runtime/helpers/esm/defineProperty */ "./node_modules/@babel/runtime/helpers/esm/defineProperty.js"); 7106 /* harmony import */ var _babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectSpread */ "./node_modules/@babel/runtime/helpers/esm/objectSpread.js"); 7107 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); 7108 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__); 7109 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! lodash */ "lodash"); 7110 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_9__); 7111 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); 7112 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_10__); 7113 /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose"); 7114 /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_11__); 7115 /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./utils */ "./node_modules/@wordpress/editor/build-module/components/colors/utils.js"); 7116 7117 7118 7119 7120 7121 7122 7123 7124 7125 7126 /** 7127 * External dependencies 7128 */ 7129 7130 /** 7131 * WordPress dependencies 7132 */ 7133 7134 7135 7136 7137 /** 7138 * Internal dependencies 7139 */ 7140 7141 7142 var DEFAULT_COLORS = []; 7143 /** 7144 * Higher-order component, which handles color logic for class generation 7145 * color value, retrieval and color attribute setting. 7146 * 7147 * @param {...(object|string)} args The arguments can be strings or objects. If the argument is an object, 7148 * it should contain the color attribute name as key and the color context as value. 7149 * If the argument is a string the value should be the color attribute name, 7150 * the color context is computed by applying a kebab case transform to the value. 7151 * Color context represents the context/place where the color is going to be used. 7152 * The class name of the color is generated using 'has' followed by the color name 7153 * and ending with the color context all in kebab case e.g: has-green-background-color. 7154 * 7155 * 7156 * @return {Function} Higher-order component. 7157 */ 7158 7159 /* harmony default export */ __webpack_exports__["default"] = (function () { 7160 for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { 7161 args[_key] = arguments[_key]; 7162 } 7163 7164 var colorMap = Object(lodash__WEBPACK_IMPORTED_MODULE_9__["reduce"])(args, function (colorObject, arg) { 7165 return Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_7__["default"])({}, colorObject, Object(lodash__WEBPACK_IMPORTED_MODULE_9__["isString"])(arg) ? Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_6__["default"])({}, arg, Object(lodash__WEBPACK_IMPORTED_MODULE_9__["kebabCase"])(arg)) : arg); 7166 }, {}); 7167 return Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_11__["createHigherOrderComponent"])(Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_11__["compose"])([Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_10__["withSelect"])(function (select) { 7168 var settings = select('core/editor').getEditorSettings(); 7169 return { 7170 colors: Object(lodash__WEBPACK_IMPORTED_MODULE_9__["get"])(settings, ['colors'], DEFAULT_COLORS) 7171 }; 7172 }), function (WrappedComponent) { 7173 return ( 7174 /*#__PURE__*/ 7175 function (_Component) { 7176 Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__["default"])(_class, _Component); 7177 7178 function _class(props) { 7179 var _this; 7180 7181 Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__["default"])(this, _class); 7182 7183 _this = Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__["default"])(this, Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__["default"])(_class).call(this, props)); 7184 _this.setters = _this.createSetters(); 7185 _this.colorUtils = { 7186 getMostReadableColor: _this.getMostReadableColor.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(_this))) 7187 }; 7188 _this.state = {}; 7189 return _this; 7190 } 7191 7192 Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__["default"])(_class, [{ 7193 key: "getMostReadableColor", 7194 value: function getMostReadableColor(colorValue) { 7195 var colors = this.props.colors; 7196 return Object(_utils__WEBPACK_IMPORTED_MODULE_12__["getMostReadableColor"])(colors, colorValue); 7197 } 7198 }, { 7199 key: "createSetters", 7200 value: function createSetters() { 7201 var _this2 = this; 7202 7203 return Object(lodash__WEBPACK_IMPORTED_MODULE_9__["reduce"])(colorMap, function (settersAccumulator, colorContext, colorAttributeName) { 7204 var upperFirstColorAttributeName = Object(lodash__WEBPACK_IMPORTED_MODULE_9__["upperFirst"])(colorAttributeName); 7205 var customColorAttributeName = "custom".concat(upperFirstColorAttributeName); 7206 settersAccumulator["set".concat(upperFirstColorAttributeName)] = _this2.createSetColor(colorAttributeName, customColorAttributeName); 7207 return settersAccumulator; 7208 }, {}); 7209 } 7210 }, { 7211 key: "createSetColor", 7212 value: function createSetColor(colorAttributeName, customColorAttributeName) { 7213 var _this3 = this; 7214 7215 return function (colorValue) { 7216 var _this3$props$setAttri; 7217 7218 var colorObject = Object(_utils__WEBPACK_IMPORTED_MODULE_12__["getColorObjectByColorValue"])(_this3.props.colors, colorValue); 7219 7220 _this3.props.setAttributes((_this3$props$setAttri = {}, Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_6__["default"])(_this3$props$setAttri, colorAttributeName, colorObject && colorObject.slug ? colorObject.slug : undefined), Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_6__["default"])(_this3$props$setAttri, customColorAttributeName, colorObject && colorObject.slug ? undefined : colorValue), _this3$props$setAttri)); 7221 }; 7222 } 7223 }, { 7224 key: "render", 7225 value: function render() { 7226 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["createElement"])(WrappedComponent, Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_7__["default"])({}, this.props, { 7227 colors: undefined 7228 }, this.state, this.setters, { 7229 colorUtils: this.colorUtils 7230 })); 7231 } 7232 }], [{ 7233 key: "getDerivedStateFromProps", 7234 value: function getDerivedStateFromProps(_ref2, previousState) { 7235 var attributes = _ref2.attributes, 7236 colors = _ref2.colors; 7237 return Object(lodash__WEBPACK_IMPORTED_MODULE_9__["reduce"])(colorMap, function (newState, colorContext, colorAttributeName) { 7238 var colorObject = Object(_utils__WEBPACK_IMPORTED_MODULE_12__["getColorObjectByAttributeValues"])(colors, attributes[colorAttributeName], attributes["custom".concat(Object(lodash__WEBPACK_IMPORTED_MODULE_9__["upperFirst"])(colorAttributeName))]); 7239 var previousColorObject = previousState[colorAttributeName]; 7240 var previousColor = Object(lodash__WEBPACK_IMPORTED_MODULE_9__["get"])(previousColorObject, ['color']); 7241 /** 7242 * The "and previousColorObject" condition checks that a previous color object was already computed. 7243 * At the start previousColorObject and colorValue are both equal to undefined 7244 * bus as previousColorObject does not exist we should compute the object. 7245 */ 7246 7247 if (previousColor === colorObject.color && previousColorObject) { 7248 newState[colorAttributeName] = previousColorObject; 7249 } else { 7250 newState[colorAttributeName] = Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_7__["default"])({}, colorObject, { 7251 class: Object(_utils__WEBPACK_IMPORTED_MODULE_12__["getColorClassName"])(colorContext, colorObject.slug) 7252 }); 7253 } 7254 7255 return newState; 7256 }, {}); 7257 } 7258 }]); 7259 7260 return _class; 7261 }(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["Component"]) 7262 ); 7263 }]), 'withColors'); 7264 }); 7265 7266 7267 /***/ }), 7268 7269 /***/ "./node_modules/@wordpress/editor/build-module/components/contrast-checker/index.js": 7270 /*!******************************************************************************************!*\ 7271 !*** ./node_modules/@wordpress/editor/build-module/components/contrast-checker/index.js ***! 7272 \******************************************************************************************/ 7273 /*! exports provided: default */ 7274 /***/ (function(module, __webpack_exports__, __webpack_require__) { 7275 7276 "use strict"; 7277 __webpack_require__.r(__webpack_exports__); 7278 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); 7279 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); 7280 /* harmony import */ var tinycolor2__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! tinycolor2 */ "./node_modules/tinycolor2/tinycolor.js"); 7281 /* harmony import */ var tinycolor2__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(tinycolor2__WEBPACK_IMPORTED_MODULE_1__); 7282 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); 7283 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__); 7284 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); 7285 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__); 7286 7287 7288 /** 7289 * External dependencies 7290 */ 7291 7292 /** 7293 * WordPress dependencies 7294 */ 7295 7296 7297 7298 7299 function ContrastChecker(_ref) { 7300 var backgroundColor = _ref.backgroundColor, 7301 fallbackBackgroundColor = _ref.fallbackBackgroundColor, 7302 fallbackTextColor = _ref.fallbackTextColor, 7303 fontSize = _ref.fontSize, 7304 isLargeText = _ref.isLargeText, 7305 textColor = _ref.textColor; 7306 7307 if (!(backgroundColor || fallbackBackgroundColor) || !(textColor || fallbackTextColor)) { 7308 return null; 7309 } 7310 7311 var tinyBackgroundColor = tinycolor2__WEBPACK_IMPORTED_MODULE_1___default()(backgroundColor || fallbackBackgroundColor); 7312 var tinyTextColor = tinycolor2__WEBPACK_IMPORTED_MODULE_1___default()(textColor || fallbackTextColor); 7313 var hasTransparency = tinyBackgroundColor.getAlpha() !== 1 || tinyTextColor.getAlpha() !== 1; 7314 7315 if (hasTransparency || tinycolor2__WEBPACK_IMPORTED_MODULE_1___default.a.isReadable(tinyBackgroundColor, tinyTextColor, { 7316 level: 'AA', 7317 size: isLargeText || isLargeText !== false && fontSize >= 18 ? 'large' : 'small' 7318 })) { 7319 return null; 7320 } 7321 7322 var msg = tinyBackgroundColor.getBrightness() < tinyTextColor.getBrightness() ? Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__["__"])('This color combination may be hard for people to read. Try using a darker background color and/or a brighter text color.') : Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__["__"])('This color combination may be hard for people to read. Try using a brighter background color and/or a darker text color.'); 7323 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("div", { 7324 className: "editor-contrast-checker" 7325 }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__["Notice"], { 7326 status: "warning", 7327 isDismissible: false 7328 }, msg)); 7329 } 7330 7331 /* harmony default export */ __webpack_exports__["default"] = (ContrastChecker); 7332 7333 7334 /***/ }), 7335 7336 /***/ "./node_modules/@wordpress/editor/build-module/components/copy-handler/index.js": 7337 /*!**************************************************************************************!*\ 7338 !*** ./node_modules/@wordpress/editor/build-module/components/copy-handler/index.js ***! 7339 \**************************************************************************************/ 7340 /*! exports provided: default */ 7341 /***/ (function(module, __webpack_exports__, __webpack_require__) { 7342 7343 "use strict"; 7344 __webpack_require__.r(__webpack_exports__); 7345 /* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/classCallCheck */ "./node_modules/@babel/runtime/helpers/esm/classCallCheck.js"); 7346 /* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/createClass */ "./node_modules/@babel/runtime/helpers/esm/createClass.js"); 7347 /* harmony import */ var _babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js"); 7348 /* harmony import */ var _babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/esm/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js"); 7349 /* harmony import */ var _babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inherits */ "./node_modules/@babel/runtime/helpers/esm/inherits.js"); 7350 /* harmony import */ var _babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/helpers/esm/assertThisInitialized */ "./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js"); 7351 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); 7352 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__); 7353 /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks"); 7354 /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_7__); 7355 /* harmony import */ var _wordpress_dom__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @wordpress/dom */ "@wordpress/dom"); 7356 /* harmony import */ var _wordpress_dom__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_wordpress_dom__WEBPACK_IMPORTED_MODULE_8__); 7357 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); 7358 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_9__); 7359 /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose"); 7360 /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_10__); 7361 7362 7363 7364 7365 7366 7367 7368 /** 7369 * WordPress dependencies 7370 */ 7371 7372 7373 7374 7375 7376 7377 var CopyHandler = 7378 /*#__PURE__*/ 7379 function (_Component) { 7380 Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__["default"])(CopyHandler, _Component); 7381 7382 function CopyHandler() { 7383 var _this; 7384 7385 Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__["default"])(this, CopyHandler); 7386 7387 _this = Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__["default"])(this, Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__["default"])(CopyHandler).apply(this, arguments)); 7388 _this.onCopy = _this.onCopy.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(_this))); 7389 _this.onCut = _this.onCut.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(_this))); 7390 return _this; 7391 } 7392 7393 Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__["default"])(CopyHandler, [{ 7394 key: "componentDidMount", 7395 value: function componentDidMount() { 7396 document.addEventListener('copy', this.onCopy); 7397 document.addEventListener('cut', this.onCut); 7398 } 7399 }, { 7400 key: "componentWillUnmount", 7401 value: function componentWillUnmount() { 7402 document.removeEventListener('copy', this.onCopy); 7403 document.removeEventListener('cut', this.onCut); 7404 } 7405 }, { 7406 key: "onCopy", 7407 value: function onCopy(event) { 7408 var _this$props = this.props, 7409 multiSelectedBlocks = _this$props.multiSelectedBlocks, 7410 selectedBlock = _this$props.selectedBlock; 7411 7412 if (!multiSelectedBlocks.length && !selectedBlock) { 7413 return; 7414 } // Let native copy behaviour take over in input fields. 7415 7416 7417 if (selectedBlock && Object(_wordpress_dom__WEBPACK_IMPORTED_MODULE_8__["documentHasSelection"])()) { 7418 return; 7419 } 7420 7421 var serialized = Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_7__["serialize"])(selectedBlock || multiSelectedBlocks); 7422 event.clipboardData.setData('text/plain', serialized); 7423 event.clipboardData.setData('text/html', serialized); 7424 event.preventDefault(); 7425 } 7426 }, { 7427 key: "onCut", 7428 value: function onCut(event) { 7429 var multiSelectedBlockClientIds = this.props.multiSelectedBlockClientIds; 7430 this.onCopy(event); 7431 7432 if (multiSelectedBlockClientIds.length) { 7433 this.props.onRemove(multiSelectedBlockClientIds); 7434 } 7435 } 7436 }, { 7437 key: "render", 7438 value: function render() { 7439 return null; 7440 } 7441 }]); 7442 7443 return CopyHandler; 7444 }(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["Component"]); 7445 7446 /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_10__["compose"])([Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_9__["withSelect"])(function (select) { 7447 var _select = select('core/editor'), 7448 getMultiSelectedBlocks = _select.getMultiSelectedBlocks, 7449 getMultiSelectedBlockClientIds = _select.getMultiSelectedBlockClientIds, 7450 getSelectedBlock = _select.getSelectedBlock; 7451 7452 return { 7453 multiSelectedBlocks: getMultiSelectedBlocks(), 7454 multiSelectedBlockClientIds: getMultiSelectedBlockClientIds(), 7455 selectedBlock: getSelectedBlock() 7456 }; 7457 }), Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_9__["withDispatch"])(function (dispatch) { 7458 return { 7459 onRemove: dispatch('core/editor').removeBlocks 7460 }; 7461 })])(CopyHandler)); 7462 7463 7464 /***/ }), 7465 7466 /***/ "./node_modules/@wordpress/editor/build-module/components/default-block-appender/index.js": 7467 /*!************************************************************************************************!*\ 7468 !*** ./node_modules/@wordpress/editor/build-module/components/default-block-appender/index.js ***! 7469 \************************************************************************************************/ 7470 /*! exports provided: DefaultBlockAppender, default */ 7471 /***/ (function(module, __webpack_exports__, __webpack_require__) { 7472 7473 "use strict"; 7474 __webpack_require__.r(__webpack_exports__); 7475 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DefaultBlockAppender", function() { return DefaultBlockAppender; }); 7476 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); 7477 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); 7478 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lodash */ "lodash"); 7479 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_1__); 7480 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); 7481 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__); 7482 /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose"); 7483 /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_3__); 7484 /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks"); 7485 /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_4__); 7486 /* harmony import */ var _wordpress_html_entities__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/html-entities */ "@wordpress/html-entities"); 7487 /* harmony import */ var _wordpress_html_entities__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_html_entities__WEBPACK_IMPORTED_MODULE_5__); 7488 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); 7489 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_6__); 7490 /* harmony import */ var _block_drop_zone__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../block-drop-zone */ "./node_modules/@wordpress/editor/build-module/components/block-drop-zone/index.js"); 7491 /* harmony import */ var _inserter_with_shortcuts__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../inserter-with-shortcuts */ "./node_modules/@wordpress/editor/build-module/components/inserter-with-shortcuts/index.js"); 7492 /* harmony import */ var _inserter__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../inserter */ "./node_modules/@wordpress/editor/build-module/components/inserter/index.js"); 7493 7494 7495 /** 7496 * External dependencies 7497 */ 7498 7499 /** 7500 * WordPress dependencies 7501 */ 7502 7503 7504 7505 7506 7507 7508 /** 7509 * Internal dependencies 7510 */ 7511 7512 7513 7514 7515 function DefaultBlockAppender(_ref) { 7516 var isLocked = _ref.isLocked, 7517 isVisible = _ref.isVisible, 7518 onAppend = _ref.onAppend, 7519 showPrompt = _ref.showPrompt, 7520 placeholder = _ref.placeholder, 7521 layout = _ref.layout, 7522 rootClientId = _ref.rootClientId; 7523 7524 if (isLocked || !isVisible) { 7525 return null; 7526 } 7527 7528 var value = Object(_wordpress_html_entities__WEBPACK_IMPORTED_MODULE_5__["decodeEntities"])(placeholder) || Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__["__"])('Write your story'); // The appender "button" is in-fact a text field so as to support 7529 // transitions by WritingFlow occurring by arrow key press. WritingFlow 7530 // only supports tab transitions into text fields and to the block focus 7531 // boundary. 7532 // 7533 // See: https://github.com/WordPress/gutenberg/issues/4829#issuecomment-374213658 7534 // 7535 // If it were ever to be made to be a proper `button` element, it is 7536 // important to note that `onFocus` alone would not be sufficient to 7537 // capture click events, notably in Firefox. 7538 // 7539 // See: https://gist.github.com/cvrebert/68659d0333a578d75372 7540 7541 7542 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("div", { 7543 "data-root-client-id": rootClientId || '', 7544 className: "editor-default-block-appender" 7545 }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_block_drop_zone__WEBPACK_IMPORTED_MODULE_7__["default"], { 7546 rootClientId: rootClientId, 7547 layout: layout 7548 }), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("input", { 7549 role: "button", 7550 "aria-label": Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__["__"])('Add block'), 7551 className: "editor-default-block-appender__content", 7552 type: "text", 7553 readOnly: true, 7554 onFocus: onAppend, 7555 value: showPrompt ? value : '' 7556 }), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_inserter_with_shortcuts__WEBPACK_IMPORTED_MODULE_8__["default"], { 7557 rootClientId: rootClientId, 7558 layout: layout 7559 }), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_inserter__WEBPACK_IMPORTED_MODULE_9__["default"], { 7560 position: "top right" 7561 })); 7562 } 7563 /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_3__["compose"])(Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_6__["withSelect"])(function (select, ownProps) { 7564 var _select = select('core/editor'), 7565 getBlockCount = _select.getBlockCount, 7566 getBlock = _select.getBlock, 7567 getEditorSettings = _select.getEditorSettings, 7568 getTemplateLock = _select.getTemplateLock; 7569 7570 var isEmpty = !getBlockCount(ownProps.rootClientId); 7571 var lastBlock = getBlock(ownProps.lastBlockClientId); 7572 var isLastBlockDefault = Object(lodash__WEBPACK_IMPORTED_MODULE_1__["get"])(lastBlock, ['name']) === Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_4__["getDefaultBlockName"])(); 7573 var isLastBlockValid = Object(lodash__WEBPACK_IMPORTED_MODULE_1__["get"])(lastBlock, ['isValid']); 7574 7575 var _getEditorSettings = getEditorSettings(), 7576 bodyPlaceholder = _getEditorSettings.bodyPlaceholder; 7577 7578 return { 7579 isVisible: isEmpty || !isLastBlockDefault || !isLastBlockValid, 7580 showPrompt: isEmpty, 7581 isLocked: !!getTemplateLock(ownProps.rootClientId), 7582 placeholder: bodyPlaceholder 7583 }; 7584 }), Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_6__["withDispatch"])(function (dispatch, ownProps) { 7585 var _dispatch = dispatch('core/editor'), 7586 insertDefaultBlock = _dispatch.insertDefaultBlock, 7587 startTyping = _dispatch.startTyping; 7588 7589 return { 7590 onAppend: function onAppend() { 7591 var layout = ownProps.layout, 7592 rootClientId = ownProps.rootClientId; 7593 var attributes; 7594 7595 if (layout) { 7596 attributes = { 7597 layout: layout 7598 }; 7599 } 7600 7601 insertDefaultBlock(attributes, rootClientId); 7602 startTyping(); 7603 } 7604 }; 7605 }))(DefaultBlockAppender)); 7606 7607 7608 /***/ }), 7609 7610 /***/ "./node_modules/@wordpress/editor/build-module/components/document-outline/check.js": 7611 /*!******************************************************************************************!*\ 7612 !*** ./node_modules/@wordpress/editor/build-module/components/document-outline/check.js ***! 7613 \******************************************************************************************/ 7614 /*! exports provided: default */ 7615 /***/ (function(module, __webpack_exports__, __webpack_require__) { 7616 7617 "use strict"; 7618 __webpack_require__.r(__webpack_exports__); 7619 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash */ "lodash"); 7620 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_0__); 7621 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); 7622 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_1__); 7623 /** 7624 * External dependencies 7625 */ 7626 7627 /** 7628 * WordPress dependencies 7629 */ 7630 7631 7632 7633 function DocumentOutlineCheck(_ref) { 7634 var blocks = _ref.blocks, 7635 children = _ref.children; 7636 var headings = Object(lodash__WEBPACK_IMPORTED_MODULE_0__["filter"])(blocks, function (block) { 7637 return block.name === 'core/heading'; 7638 }); 7639 7640 if (headings.length < 1) { 7641 return null; 7642 } 7643 7644 return children; 7645 } 7646 7647 /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_1__["withSelect"])(function (select) { 7648 return { 7649 blocks: select('core/editor').getBlocks() 7650 }; 7651 })(DocumentOutlineCheck)); 7652 7653 7654 /***/ }), 7655 7656 /***/ "./node_modules/@wordpress/editor/build-module/components/document-outline/index.js": 7657 /*!******************************************************************************************!*\ 7658 !*** ./node_modules/@wordpress/editor/build-module/components/document-outline/index.js ***! 7659 \******************************************************************************************/ 7660 /*! exports provided: DocumentOutline, default */ 7661 /***/ (function(module, __webpack_exports__, __webpack_require__) { 7662 7663 "use strict"; 7664 __webpack_require__.r(__webpack_exports__); 7665 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DocumentOutline", function() { return DocumentOutline; }); 7666 /* harmony import */ var _babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/toConsumableArray */ "./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js"); 7667 /* harmony import */ var _babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectSpread */ "./node_modules/@babel/runtime/helpers/esm/objectSpread.js"); 7668 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); 7669 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__); 7670 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! lodash */ "lodash"); 7671 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_3__); 7672 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); 7673 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__); 7674 /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose"); 7675 /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_5__); 7676 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); 7677 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_6__); 7678 /* harmony import */ var _item__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./item */ "./node_modules/@wordpress/editor/build-module/components/document-outline/item.js"); 7679 /* harmony import */ var _rich_text__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./../rich-text */ "./node_modules/@wordpress/editor/build-module/components/rich-text/index.js"); 7680 7681 7682 7683 7684 /** 7685 * External dependencies 7686 */ 7687 7688 /** 7689 * WordPress dependencies 7690 */ 7691 7692 7693 7694 7695 /** 7696 * Internal dependencies 7697 */ 7698 7699 7700 7701 /** 7702 * Module constants 7703 */ 7704 7705 var emptyHeadingContent = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["createElement"])("em", null, Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__["__"])('(Empty heading)')); 7706 var incorrectLevelContent = [Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["createElement"])("br", { 7707 key: "incorrect-break" 7708 }), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["createElement"])("em", { 7709 key: "incorrect-message" 7710 }, Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__["__"])('(Incorrect heading level)'))]; 7711 var singleH1Headings = [Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["createElement"])("br", { 7712 key: "incorrect-break-h1" 7713 }), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["createElement"])("em", { 7714 key: "incorrect-message-h1" 7715 }, Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__["__"])('(Your theme may already use a H1 for the post title)'))]; 7716 var multipleH1Headings = [Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["createElement"])("br", { 7717 key: "incorrect-break-multiple-h1" 7718 }), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["createElement"])("em", { 7719 key: "incorrect-message-multiple-h1" 7720 }, Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__["__"])('(Multiple H1 headings are not recommended)'))]; 7721 /** 7722 * Returns an array of heading blocks enhanced with the following properties: 7723 * path - An array of blocks that are ancestors of the heading starting from a top-level node. 7724 * Can be an empty array if the heading is a top-level node (is not nested inside another block). 7725 * level - An integer with the heading level. 7726 * isEmpty - Flag indicating if the heading has no content. 7727 * 7728 * @param {?Array} blocks An array of blocks. 7729 * @param {?Array} path An array of blocks that are ancestors of the blocks passed as blocks. 7730 * 7731 * @return {Array} An array of heading blocks enhanced with the properties described above. 7732 */ 7733 7734 var computeOutlineHeadings = function computeOutlineHeadings() { 7735 var blocks = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; 7736 var path = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : []; 7737 return Object(lodash__WEBPACK_IMPORTED_MODULE_3__["flatMap"])(blocks, function () { 7738 var block = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; 7739 7740 if (block.name === 'core/heading') { 7741 return Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_1__["default"])({}, block, { 7742 path: path, 7743 level: block.attributes.level, 7744 isEmpty: isEmptyHeading(block) 7745 }); 7746 } 7747 7748 return computeOutlineHeadings(block.innerBlocks, Object(_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_0__["default"])(path).concat([block])); 7749 }); 7750 }; 7751 7752 var isEmptyHeading = function isEmptyHeading(heading) { 7753 return !heading.attributes.content || heading.attributes.content.length === 0; 7754 }; 7755 7756 var DocumentOutline = function DocumentOutline(_ref) { 7757 var _ref$blocks = _ref.blocks, 7758 blocks = _ref$blocks === void 0 ? [] : _ref$blocks, 7759 title = _ref.title, 7760 onSelect = _ref.onSelect, 7761 isTitleSupported = _ref.isTitleSupported; 7762 var headings = computeOutlineHeadings(blocks); 7763 7764 if (headings.length < 1) { 7765 return null; 7766 } 7767 7768 var prevHeadingLevel = 1; // Select the corresponding block in the main editor 7769 // when clicking on a heading item from the list. 7770 7771 var onSelectHeading = function onSelectHeading(clientId) { 7772 return onSelect(clientId); 7773 }; 7774 7775 var focusTitle = function focusTitle() { 7776 // Not great but it's the simplest way to focus the title right now. 7777 var titleNode = document.querySelector('.editor-post-title__input'); 7778 7779 if (titleNode) { 7780 titleNode.focus(); 7781 } 7782 }; 7783 7784 var hasTitle = isTitleSupported && title; 7785 var countByLevel = Object(lodash__WEBPACK_IMPORTED_MODULE_3__["countBy"])(headings, 'level'); 7786 var hasMultipleH1 = countByLevel[1] > 1; 7787 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["createElement"])("div", { 7788 className: "document-outline" 7789 }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["createElement"])("ul", null, hasTitle && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["createElement"])(_item__WEBPACK_IMPORTED_MODULE_7__["default"], { 7790 level: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__["__"])('Title'), 7791 isValid: true, 7792 onClick: focusTitle 7793 }, title), headings.map(function (item, index) { 7794 // Headings remain the same, go up by one, or down by any amount. 7795 // Otherwise there are missing levels. 7796 var isIncorrectLevel = item.level > prevHeadingLevel + 1; 7797 var isValid = !item.isEmpty && !isIncorrectLevel && !!item.level && (item.level !== 1 || !hasMultipleH1 && !hasTitle); 7798 prevHeadingLevel = item.level; 7799 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["createElement"])(_item__WEBPACK_IMPORTED_MODULE_7__["default"], { 7800 key: index, 7801 level: "H".concat(item.level), 7802 isValid: isValid, 7803 onClick: function onClick() { 7804 return onSelectHeading(item.clientId); 7805 }, 7806 path: item.path 7807 }, item.isEmpty ? emptyHeadingContent : Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["createElement"])(_rich_text__WEBPACK_IMPORTED_MODULE_8__["default"].Content, { 7808 tagName: "span", 7809 value: item.attributes.content 7810 }), isIncorrectLevel && incorrectLevelContent, item.level === 1 && hasMultipleH1 && multipleH1Headings, hasTitle && item.level === 1 && !hasMultipleH1 && singleH1Headings); 7811 }))); 7812 }; 7813 /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_5__["compose"])(Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_6__["withSelect"])(function (select) { 7814 var _select = select('core/editor'), 7815 getEditedPostAttribute = _select.getEditedPostAttribute, 7816 getBlocks = _select.getBlocks; 7817 7818 var _select2 = select('core'), 7819 getPostType = _select2.getPostType; 7820 7821 var postType = getPostType(getEditedPostAttribute('type')); 7822 return { 7823 title: getEditedPostAttribute('title'), 7824 blocks: getBlocks(), 7825 isTitleSupported: Object(lodash__WEBPACK_IMPORTED_MODULE_3__["get"])(postType, ['supports', 'title'], false) 7826 }; 7827 }), Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_6__["withDispatch"])(function (dispatch) { 7828 var _dispatch = dispatch('core/editor'), 7829 selectBlock = _dispatch.selectBlock; 7830 7831 return { 7832 onSelect: selectBlock 7833 }; 7834 }))(DocumentOutline)); 7835 7836 7837 /***/ }), 7838 7839 /***/ "./node_modules/@wordpress/editor/build-module/components/document-outline/item.js": 7840 /*!*****************************************************************************************!*\ 7841 !*** ./node_modules/@wordpress/editor/build-module/components/document-outline/item.js ***! 7842 \*****************************************************************************************/ 7843 /*! exports provided: default */ 7844 /***/ (function(module, __webpack_exports__, __webpack_require__) { 7845 7846 "use strict"; 7847 __webpack_require__.r(__webpack_exports__); 7848 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); 7849 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); 7850 /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); 7851 /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_1__); 7852 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); 7853 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__); 7854 /* harmony import */ var _block_title__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../block-title */ "./node_modules/@wordpress/editor/build-module/components/block-title/index.js"); 7855 7856 7857 /** 7858 * External dependencies 7859 */ 7860 7861 /** 7862 * WordPress dependencies 7863 */ 7864 7865 7866 /** 7867 * Internal dependencies 7868 */ 7869 7870 7871 7872 var TableOfContentsItem = function TableOfContentsItem(_ref) { 7873 var children = _ref.children, 7874 isValid = _ref.isValid, 7875 level = _ref.level, 7876 onClick = _ref.onClick, 7877 _ref$path = _ref.path, 7878 path = _ref$path === void 0 ? [] : _ref$path; 7879 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("li", { 7880 className: classnames__WEBPACK_IMPORTED_MODULE_1___default()('document-outline__item', "is-".concat(level.toLowerCase()), { 7881 'is-invalid': !isValid 7882 }) 7883 }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("button", { 7884 className: "document-outline__button", 7885 onClick: onClick 7886 }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("span", { 7887 className: "document-outline__emdash", 7888 "aria-hidden": "true" 7889 }), // path is an array of nodes that are ancestors of the heading starting in the top level node. 7890 // This mapping renders each ancestor to make it easier for the user to know where the headings are nested. 7891 path.map(function (_ref2, index) { 7892 var clientId = _ref2.clientId; 7893 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("strong", { 7894 key: index, 7895 className: "document-outline__level" 7896 }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_block_title__WEBPACK_IMPORTED_MODULE_3__["default"], { 7897 clientId: clientId 7898 })); 7899 }), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("strong", { 7900 className: "document-outline__level" 7901 }, level), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("span", { 7902 className: "document-outline__item-content" 7903 }, children), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("span", { 7904 className: "screen-reader-text" 7905 }, Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__["__"])('(Click to focus this heading)')))); 7906 }; 7907 7908 /* harmony default export */ __webpack_exports__["default"] = (TableOfContentsItem); 7909 7910 7911 /***/ }), 7912 7913 /***/ "./node_modules/@wordpress/editor/build-module/components/editor-global-keyboard-shortcuts/index.js": 7914 /*!**********************************************************************************************************!*\ 7915 !*** ./node_modules/@wordpress/editor/build-module/components/editor-global-keyboard-shortcuts/index.js ***! 7916 \**********************************************************************************************************/ 7917 /*! exports provided: shortcuts, default */ 7918 /***/ (function(module, __webpack_exports__, __webpack_require__) { 7919 7920 "use strict"; 7921 __webpack_require__.r(__webpack_exports__); 7922 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "shortcuts", function() { return shortcuts; }); 7923 /* harmony import */ var _babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/defineProperty */ "./node_modules/@babel/runtime/helpers/esm/defineProperty.js"); 7924 /* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/classCallCheck */ "./node_modules/@babel/runtime/helpers/esm/classCallCheck.js"); 7925 /* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/createClass */ "./node_modules/@babel/runtime/helpers/esm/createClass.js"); 7926 /* harmony import */ var _babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/esm/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js"); 7927 /* harmony import */ var _babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/esm/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js"); 7928 /* harmony import */ var _babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inherits */ "./node_modules/@babel/runtime/helpers/esm/inherits.js"); 7929 /* harmony import */ var _babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @babel/runtime/helpers/esm/assertThisInitialized */ "./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js"); 7930 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); 7931 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__); 7932 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! lodash */ "lodash"); 7933 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_8__); 7934 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); 7935 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_9__); 7936 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); 7937 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_10__); 7938 /* harmony import */ var _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @wordpress/keycodes */ "@wordpress/keycodes"); 7939 /* harmony import */ var _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(_wordpress_keycodes__WEBPACK_IMPORTED_MODULE_11__); 7940 /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose"); 7941 /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_12__); 7942 /* harmony import */ var _block_actions__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../block-actions */ "./node_modules/@wordpress/editor/build-module/components/block-actions/index.js"); 7943 7944 7945 7946 7947 7948 7949 7950 7951 7952 /** 7953 * External dependencies 7954 */ 7955 7956 /** 7957 * WordPress dependencies 7958 */ 7959 7960 7961 7962 7963 7964 7965 /** 7966 * Internal dependencies 7967 */ 7968 7969 7970 7971 var preventDefault = function preventDefault(event) { 7972 event.preventDefault(); 7973 return event; 7974 }; 7975 7976 var shortcuts = { 7977 duplicate: { 7978 raw: _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_11__["rawShortcut"].primaryShift('d'), 7979 display: _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_11__["displayShortcut"].primaryShift('d') 7980 }, 7981 removeBlock: { 7982 raw: _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_11__["rawShortcut"].access('z'), 7983 display: _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_11__["displayShortcut"].access('z') 7984 }, 7985 insertBefore: { 7986 raw: _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_11__["rawShortcut"].primaryAlt('t'), 7987 display: _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_11__["displayShortcut"].primaryAlt('t') 7988 }, 7989 insertAfter: { 7990 raw: _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_11__["rawShortcut"].primaryAlt('y'), 7991 display: _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_11__["displayShortcut"].primaryAlt('y') 7992 } 7993 }; 7994 7995 var EditorGlobalKeyboardShortcuts = 7996 /*#__PURE__*/ 7997 function (_Component) { 7998 Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_5__["default"])(EditorGlobalKeyboardShortcuts, _Component); 7999 8000 function EditorGlobalKeyboardShortcuts() { 8001 var _this; 8002 8003 Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_1__["default"])(this, EditorGlobalKeyboardShortcuts); 8004 8005 _this = Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__["default"])(this, Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__["default"])(EditorGlobalKeyboardShortcuts).apply(this, arguments)); 8006 _this.selectAll = _this.selectAll.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["default"])(_this))); 8007 _this.undoOrRedo = _this.undoOrRedo.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["default"])(_this))); 8008 _this.save = _this.save.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["default"])(_this))); 8009 _this.deleteSelectedBlocks = _this.deleteSelectedBlocks.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["default"])(_this))); 8010 _this.clearMultiSelection = _this.clearMultiSelection.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["default"])(_this))); 8011 return _this; 8012 } 8013 8014 Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_2__["default"])(EditorGlobalKeyboardShortcuts, [{ 8015 key: "selectAll", 8016 value: function selectAll(event) { 8017 var _this$props = this.props, 8018 rootBlocksClientIds = _this$props.rootBlocksClientIds, 8019 onMultiSelect = _this$props.onMultiSelect; 8020 event.preventDefault(); 8021 onMultiSelect(Object(lodash__WEBPACK_IMPORTED_MODULE_8__["first"])(rootBlocksClientIds), Object(lodash__WEBPACK_IMPORTED_MODULE_8__["last"])(rootBlocksClientIds)); 8022 } 8023 }, { 8024 key: "undoOrRedo", 8025 value: function undoOrRedo(event) { 8026 var _this$props2 = this.props, 8027 onRedo = _this$props2.onRedo, 8028 onUndo = _this$props2.onUndo; 8029 8030 if (event.shiftKey) { 8031 onRedo(); 8032 } else { 8033 onUndo(); 8034 } 8035 8036 event.preventDefault(); 8037 } 8038 }, { 8039 key: "save", 8040 value: function save(event) { 8041 event.preventDefault(); 8042 this.props.onSave(); 8043 } 8044 }, { 8045 key: "deleteSelectedBlocks", 8046 value: function deleteSelectedBlocks(event) { 8047 var _this$props3 = this.props, 8048 selectedBlockClientIds = _this$props3.selectedBlockClientIds, 8049 hasMultiSelection = _this$props3.hasMultiSelection, 8050 onRemove = _this$props3.onRemove, 8051 isLocked = _this$props3.isLocked; 8052 8053 if (hasMultiSelection) { 8054 event.preventDefault(); 8055 8056 if (!isLocked) { 8057 onRemove(selectedBlockClientIds); 8058 } 8059 } 8060 } 8061 /** 8062 * Clears current multi-selection, if one exists. 8063 */ 8064 8065 }, { 8066 key: "clearMultiSelection", 8067 value: function clearMultiSelection() { 8068 var _this$props4 = this.props, 8069 hasMultiSelection = _this$props4.hasMultiSelection, 8070 clearSelectedBlock = _this$props4.clearSelectedBlock; 8071 8072 if (hasMultiSelection) { 8073 clearSelectedBlock(); 8074 window.getSelection().removeAllRanges(); 8075 } 8076 } 8077 }, { 8078 key: "render", 8079 value: function render() { 8080 var _ref; 8081 8082 var selectedBlockClientIds = this.props.selectedBlockClientIds; 8083 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["createElement"])(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["Fragment"], null, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_9__["KeyboardShortcuts"], { 8084 shortcuts: (_ref = {}, Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__["default"])(_ref, _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_11__["rawShortcut"].primary('a'), this.selectAll), Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__["default"])(_ref, _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_11__["rawShortcut"].primary('z'), this.undoOrRedo), Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__["default"])(_ref, _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_11__["rawShortcut"].primaryShift('z'), this.undoOrRedo), Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__["default"])(_ref, "backspace", this.deleteSelectedBlocks), Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__["default"])(_ref, "del", this.deleteSelectedBlocks), Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__["default"])(_ref, "escape", this.clearMultiSelection), _ref) 8085 }), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_9__["KeyboardShortcuts"], { 8086 bindGlobal: true, 8087 shortcuts: Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__["default"])({}, _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_11__["rawShortcut"].primary('s'), this.save) 8088 }), selectedBlockClientIds.length > 0 && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["createElement"])(_block_actions__WEBPACK_IMPORTED_MODULE_13__["default"], { 8089 clientIds: selectedBlockClientIds 8090 }, function (_ref3) { 8091 var _ref4; 8092 8093 var onDuplicate = _ref3.onDuplicate, 8094 onRemove = _ref3.onRemove, 8095 onInsertAfter = _ref3.onInsertAfter, 8096 onInsertBefore = _ref3.onInsertBefore; 8097 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_9__["KeyboardShortcuts"], { 8098 bindGlobal: true, 8099 shortcuts: (_ref4 = {}, Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__["default"])(_ref4, shortcuts.duplicate.raw, Object(lodash__WEBPACK_IMPORTED_MODULE_8__["flow"])(preventDefault, onDuplicate)), Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__["default"])(_ref4, shortcuts.removeBlock.raw, Object(lodash__WEBPACK_IMPORTED_MODULE_8__["flow"])(preventDefault, onRemove)), Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__["default"])(_ref4, shortcuts.insertBefore.raw, Object(lodash__WEBPACK_IMPORTED_MODULE_8__["flow"])(preventDefault, onInsertBefore)), Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__["default"])(_ref4, shortcuts.insertAfter.raw, Object(lodash__WEBPACK_IMPORTED_MODULE_8__["flow"])(preventDefault, onInsertAfter)), _ref4) 8100 }); 8101 })); 8102 } 8103 }]); 8104 8105 return EditorGlobalKeyboardShortcuts; 8106 }(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["Component"]); 8107 8108 /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_12__["compose"])([Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_10__["withSelect"])(function (select) { 8109 var _select = select('core/editor'), 8110 getBlockOrder = _select.getBlockOrder, 8111 getMultiSelectedBlockClientIds = _select.getMultiSelectedBlockClientIds, 8112 hasMultiSelection = _select.hasMultiSelection, 8113 isEditedPostDirty = _select.isEditedPostDirty, 8114 getBlockRootClientId = _select.getBlockRootClientId, 8115 getTemplateLock = _select.getTemplateLock, 8116 getSelectedBlock = _select.getSelectedBlock; 8117 8118 var block = getSelectedBlock(); 8119 var selectedBlockClientIds = block ? [block.clientId] : getMultiSelectedBlockClientIds(); 8120 return { 8121 rootBlocksClientIds: getBlockOrder(), 8122 hasMultiSelection: hasMultiSelection(), 8123 isLocked: Object(lodash__WEBPACK_IMPORTED_MODULE_8__["some"])(selectedBlockClientIds, function (clientId) { 8124 return !!getTemplateLock(getBlockRootClientId(clientId)); 8125 }), 8126 isDirty: isEditedPostDirty(), 8127 selectedBlockClientIds: selectedBlockClientIds 8128 }; 8129 }), Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_10__["withDispatch"])(function (dispatch, ownProps) { 8130 var _dispatch = dispatch('core/editor'), 8131 clearSelectedBlock = _dispatch.clearSelectedBlock, 8132 multiSelect = _dispatch.multiSelect, 8133 redo = _dispatch.redo, 8134 undo = _dispatch.undo, 8135 removeBlocks = _dispatch.removeBlocks, 8136 savePost = _dispatch.savePost; 8137 8138 return { 8139 onSave: function onSave() { 8140 // TODO: This should be handled in the `savePost` effect in 8141 // considering `isSaveable`. See note on `isEditedPostSaveable` 8142 // selector about dirtiness and meta-boxes. When removing, also 8143 // remember to remove `isDirty` prop passing from `withSelect`. 8144 // 8145 // See: `isEditedPostSaveable` 8146 if (!ownProps.isDirty) { 8147 return; 8148 } 8149 8150 savePost(); 8151 }, 8152 clearSelectedBlock: clearSelectedBlock, 8153 onMultiSelect: multiSelect, 8154 onRedo: redo, 8155 onUndo: undo, 8156 onRemove: removeBlocks 8157 }; 8158 })])(EditorGlobalKeyboardShortcuts)); 8159 8160 8161 /***/ }), 8162 8163 /***/ "./node_modules/@wordpress/editor/build-module/components/editor-history/redo.js": 8164 /*!***************************************************************************************!*\ 8165 !*** ./node_modules/@wordpress/editor/build-module/components/editor-history/redo.js ***! 8166 \***************************************************************************************/ 8167 /*! exports provided: default */ 8168 /***/ (function(module, __webpack_exports__, __webpack_require__) { 8169 8170 "use strict"; 8171 __webpack_require__.r(__webpack_exports__); 8172 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); 8173 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); 8174 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); 8175 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__); 8176 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); 8177 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__); 8178 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); 8179 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_3__); 8180 /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose"); 8181 /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_4__); 8182 /* harmony import */ var _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/keycodes */ "@wordpress/keycodes"); 8183 /* harmony import */ var _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_keycodes__WEBPACK_IMPORTED_MODULE_5__); 8184 8185 8186 /** 8187 * WordPress dependencies 8188 */ 8189 8190 8191 8192 8193 8194 8195 function EditorHistoryRedo(_ref) { 8196 var hasRedo = _ref.hasRedo, 8197 redo = _ref.redo; 8198 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__["IconButton"], { 8199 icon: "redo", 8200 label: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__["__"])('Redo'), 8201 shortcut: _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_5__["displayShortcut"].primaryShift('z'), 8202 disabled: !hasRedo, 8203 onClick: redo, 8204 className: "editor-history__redo" 8205 }); 8206 } 8207 8208 /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_4__["compose"])([Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_3__["withSelect"])(function (select) { 8209 return { 8210 hasRedo: select('core/editor').hasEditorRedo() 8211 }; 8212 }), Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_3__["withDispatch"])(function (dispatch) { 8213 return { 8214 redo: function redo() { 8215 return dispatch('core/editor').redo(); 8216 } 8217 }; 8218 })])(EditorHistoryRedo)); 8219 8220 8221 /***/ }), 8222 8223 /***/ "./node_modules/@wordpress/editor/build-module/components/editor-history/undo.js": 8224 /*!***************************************************************************************!*\ 8225 !*** ./node_modules/@wordpress/editor/build-module/components/editor-history/undo.js ***! 8226 \***************************************************************************************/ 8227 /*! exports provided: default */ 8228 /***/ (function(module, __webpack_exports__, __webpack_require__) { 8229 8230 "use strict"; 8231 __webpack_require__.r(__webpack_exports__); 8232 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); 8233 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); 8234 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); 8235 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__); 8236 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); 8237 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__); 8238 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); 8239 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_3__); 8240 /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose"); 8241 /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_4__); 8242 /* harmony import */ var _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/keycodes */ "@wordpress/keycodes"); 8243 /* harmony import */ var _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_keycodes__WEBPACK_IMPORTED_MODULE_5__); 8244 8245 8246 /** 8247 * WordPress dependencies 8248 */ 8249 8250 8251 8252 8253 8254 8255 function EditorHistoryUndo(_ref) { 8256 var hasUndo = _ref.hasUndo, 8257 undo = _ref.undo; 8258 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__["IconButton"], { 8259 icon: "undo", 8260 label: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__["__"])('Undo'), 8261 shortcut: _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_5__["displayShortcut"].primary('z'), 8262 disabled: !hasUndo, 8263 onClick: undo, 8264 className: "editor-history__undo" 8265 }); 8266 } 8267 8268 /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_4__["compose"])([Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_3__["withSelect"])(function (select) { 8269 return { 8270 hasUndo: select('core/editor').hasEditorUndo() 8271 }; 8272 }), Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_3__["withDispatch"])(function (dispatch) { 8273 return { 8274 undo: function undo() { 8275 return dispatch('core/editor').undo(); 8276 } 8277 }; 8278 })])(EditorHistoryUndo)); 8279 8280 8281 /***/ }), 8282 8283 /***/ "./node_modules/@wordpress/editor/build-module/components/editor-notices/index.js": 8284 /*!****************************************************************************************!*\ 8285 !*** ./node_modules/@wordpress/editor/build-module/components/editor-notices/index.js ***! 8286 \****************************************************************************************/ 8287 /*! exports provided: default */ 8288 /***/ (function(module, __webpack_exports__, __webpack_require__) { 8289 8290 "use strict"; 8291 __webpack_require__.r(__webpack_exports__); 8292 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); 8293 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); 8294 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); 8295 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__); 8296 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); 8297 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_2__); 8298 /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose"); 8299 /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_3__); 8300 /* harmony import */ var _template_validation_notice__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../template-validation-notice */ "./node_modules/@wordpress/editor/build-module/components/template-validation-notice/index.js"); 8301 8302 8303 /** 8304 * WordPress dependencies 8305 */ 8306 8307 8308 8309 /** 8310 * Internal dependencies 8311 */ 8312 8313 8314 8315 function EditorNotices(props) { 8316 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__["NoticeList"], props, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_template_validation_notice__WEBPACK_IMPORTED_MODULE_4__["default"], null)); 8317 } 8318 8319 /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_3__["compose"])([Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_2__["withSelect"])(function (select) { 8320 return { 8321 notices: select('core/editor').getNotices() 8322 }; 8323 }), Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_2__["withDispatch"])(function (dispatch) { 8324 return { 8325 onRemove: dispatch('core/editor').removeNotice 8326 }; 8327 })])(EditorNotices)); 8328 8329 8330 /***/ }), 8331 8332 /***/ "./node_modules/@wordpress/editor/build-module/components/error-boundary/index.js": 8333 /*!****************************************************************************************!*\ 8334 !*** ./node_modules/@wordpress/editor/build-module/components/error-boundary/index.js ***! 8335 \****************************************************************************************/ 8336 /*! exports provided: default */ 8337 /***/ (function(module, __webpack_exports__, __webpack_require__) { 8338 8339 "use strict"; 8340 __webpack_require__.r(__webpack_exports__); 8341 /* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/classCallCheck */ "./node_modules/@babel/runtime/helpers/esm/classCallCheck.js"); 8342 /* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/createClass */ "./node_modules/@babel/runtime/helpers/esm/createClass.js"); 8343 /* harmony import */ var _babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js"); 8344 /* harmony import */ var _babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/esm/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js"); 8345 /* harmony import */ var _babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inherits */ "./node_modules/@babel/runtime/helpers/esm/inherits.js"); 8346 /* harmony import */ var _babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/helpers/esm/assertThisInitialized */ "./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js"); 8347 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); 8348 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__); 8349 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! lodash */ "lodash"); 8350 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_7__); 8351 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); 8352 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_8__); 8353 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); 8354 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_9__); 8355 /* harmony import */ var ___WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../ */ "./node_modules/@wordpress/editor/build-module/components/index.js"); 8356 /* harmony import */ var _store_selectors__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../store/selectors */ "./node_modules/@wordpress/editor/build-module/store/selectors.js"); 8357 8358 8359 8360 8361 8362 8363 8364 8365 /** 8366 * External dependencies 8367 */ 8368 8369 /** 8370 * WordPress dependencies 8371 */ 8372 8373 8374 8375 8376 /** 8377 * Internal dependencies 8378 */ 8379 8380 8381 8382 8383 var ErrorBoundary = 8384 /*#__PURE__*/ 8385 function (_Component) { 8386 Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__["default"])(ErrorBoundary, _Component); 8387 8388 function ErrorBoundary() { 8389 var _this; 8390 8391 Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__["default"])(this, ErrorBoundary); 8392 8393 _this = Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__["default"])(this, Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__["default"])(ErrorBoundary).apply(this, arguments)); 8394 _this.reboot = _this.reboot.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(_this))); 8395 _this.getContent = _this.getContent.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(_this))); 8396 _this.state = { 8397 error: null 8398 }; 8399 return _this; 8400 } 8401 8402 Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__["default"])(ErrorBoundary, [{ 8403 key: "componentDidCatch", 8404 value: function componentDidCatch(error) { 8405 this.setState({ 8406 error: error 8407 }); 8408 } 8409 }, { 8410 key: "reboot", 8411 value: function reboot() { 8412 this.props.onError(); 8413 } 8414 }, { 8415 key: "getContent", 8416 value: function getContent() { 8417 try { 8418 return Object(_store_selectors__WEBPACK_IMPORTED_MODULE_11__["getEditedPostContent"])(this.context.store.getState()); 8419 } catch (error) {} 8420 } 8421 }, { 8422 key: "render", 8423 value: function render() { 8424 var error = this.state.error; 8425 8426 if (!error) { 8427 return this.props.children; 8428 } 8429 8430 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(___WEBPACK_IMPORTED_MODULE_10__["Warning"], { 8431 className: "editor-error-boundary", 8432 actions: [Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_9__["Button"], { 8433 key: "recovery", 8434 onClick: this.reboot, 8435 isLarge: true 8436 }, Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_8__["__"])('Attempt Recovery')), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_9__["ClipboardButton"], { 8437 key: "copy-post", 8438 text: this.getContent, 8439 isLarge: true 8440 }, Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_8__["__"])('Copy Post Text')), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_9__["ClipboardButton"], { 8441 key: "copy-error", 8442 text: error.stack, 8443 isLarge: true 8444 }, Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_8__["__"])('Copy Error'))] 8445 }, Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_8__["__"])('The editor has encountered an unexpected error.')); 8446 } 8447 }]); 8448 8449 return ErrorBoundary; 8450 }(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["Component"]); 8451 8452 ErrorBoundary.contextTypes = { 8453 store: lodash__WEBPACK_IMPORTED_MODULE_7__["noop"] 8454 }; 8455 /* harmony default export */ __webpack_exports__["default"] = (ErrorBoundary); 8456 8457 8458 /***/ }), 8459 8460 /***/ "./node_modules/@wordpress/editor/build-module/components/font-sizes/font-size-picker.js": 8461 /*!***********************************************************************************************!*\ 8462 !*** ./node_modules/@wordpress/editor/build-module/components/font-sizes/font-size-picker.js ***! 8463 \***********************************************************************************************/ 8464 /*! exports provided: default */ 8465 /***/ (function(module, __webpack_exports__, __webpack_require__) { 8466 8467 "use strict"; 8468 __webpack_require__.r(__webpack_exports__); 8469 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); 8470 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__); 8471 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); 8472 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_1__); 8473 /** 8474 * WordPress dependencies 8475 */ 8476 8477 8478 /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_1__["withSelect"])(function (select) { 8479 var _select$getEditorSett = select('core/editor').getEditorSettings(), 8480 fontSizes = _select$getEditorSett.fontSizes; 8481 8482 return { 8483 fontSizes: fontSizes 8484 }; 8485 })(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__["FontSizePicker"])); 8486 8487 8488 /***/ }), 8489 8490 /***/ "./node_modules/@wordpress/editor/build-module/components/font-sizes/index.js": 8491 /*!************************************************************************************!*\ 8492 !*** ./node_modules/@wordpress/editor/build-module/components/font-sizes/index.js ***! 8493 \************************************************************************************/ 8494 /*! exports provided: getFontSize, getFontSizeClass, FontSizePicker, withFontSizes */ 8495 /***/ (function(module, __webpack_exports__, __webpack_require__) { 8496 8497 "use strict"; 8498 __webpack_require__.r(__webpack_exports__); 8499 /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./utils */ "./node_modules/@wordpress/editor/build-module/components/font-sizes/utils.js"); 8500 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getFontSize", function() { return _utils__WEBPACK_IMPORTED_MODULE_0__["getFontSize"]; }); 8501 8502 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getFontSizeClass", function() { return _utils__WEBPACK_IMPORTED_MODULE_0__["getFontSizeClass"]; }); 8503 8504 /* harmony import */ var _font_size_picker__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./font-size-picker */ "./node_modules/@wordpress/editor/build-module/components/font-sizes/font-size-picker.js"); 8505 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "FontSizePicker", function() { return _font_size_picker__WEBPACK_IMPORTED_MODULE_1__["default"]; }); 8506 8507 /* harmony import */ var _with_font_sizes__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./with-font-sizes */ "./node_modules/@wordpress/editor/build-module/components/font-sizes/with-font-sizes.js"); 8508 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "withFontSizes", function() { return _with_font_sizes__WEBPACK_IMPORTED_MODULE_2__["default"]; }); 8509 8510 8511 8512 8513 8514 8515 /***/ }), 8516 8517 /***/ "./node_modules/@wordpress/editor/build-module/components/font-sizes/utils.js": 8518 /*!************************************************************************************!*\ 8519 !*** ./node_modules/@wordpress/editor/build-module/components/font-sizes/utils.js ***! 8520 \************************************************************************************/ 8521 /*! exports provided: getFontSize, getFontSizeClass */ 8522 /***/ (function(module, __webpack_exports__, __webpack_require__) { 8523 8524 "use strict"; 8525 __webpack_require__.r(__webpack_exports__); 8526 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getFontSize", function() { return getFontSize; }); 8527 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getFontSizeClass", function() { return getFontSizeClass; }); 8528 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash */ "lodash"); 8529 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_0__); 8530 /** 8531 * External dependencies 8532 */ 8533 8534 /** 8535 * Returns the font size object based on an array of named font sizes and the namedFontSize and customFontSize values. 8536 * If namedFontSize is undefined or not found in fontSizes an object with just the size value based on customFontSize is returned. 8537 * 8538 * @param {Array} fontSizes Array of font size objects containing at least the "name" and "size" values as properties. 8539 * @param {?string} fontSizeAttribute Content of the font size attribute (slug). 8540 * @param {?number} customFontSizeAttribute Contents of the custom font size attribute (value). 8541 * 8542 * @return {?string} If fontSizeAttribute is set and an equal slug is found in fontSizes it returns the font size object for that slug. 8543 * Otherwise, an object with just the size value based on customFontSize is returned. 8544 */ 8545 8546 var getFontSize = function getFontSize(fontSizes, fontSizeAttribute, customFontSizeAttribute) { 8547 if (fontSizeAttribute) { 8548 var fontSizeObject = Object(lodash__WEBPACK_IMPORTED_MODULE_0__["find"])(fontSizes, { 8549 slug: fontSizeAttribute 8550 }); 8551 8552 if (fontSizeObject) { 8553 return fontSizeObject; 8554 } 8555 } 8556 8557 return { 8558 size: customFontSizeAttribute 8559 }; 8560 }; 8561 /** 8562 * Returns a class based on fontSizeName. 8563 * 8564 * @param {string} fontSizeSlug Slug of the fontSize. 8565 * 8566 * @return {string} String with the class corresponding to the fontSize passed. 8567 * The class is generated by appending 'has-' followed by fontSizeSlug in kebabCase and ending with '-font-size'. 8568 */ 8569 8570 function getFontSizeClass(fontSizeSlug) { 8571 if (!fontSizeSlug) { 8572 return; 8573 } 8574 8575 return "has-".concat(Object(lodash__WEBPACK_IMPORTED_MODULE_0__["kebabCase"])(fontSizeSlug), "-font-size"); 8576 } 8577 8578 8579 /***/ }), 8580 8581 /***/ "./node_modules/@wordpress/editor/build-module/components/font-sizes/with-font-sizes.js": 8582 /*!**********************************************************************************************!*\ 8583 !*** ./node_modules/@wordpress/editor/build-module/components/font-sizes/with-font-sizes.js ***! 8584 \**********************************************************************************************/ 8585 /*! exports provided: default */ 8586 /***/ (function(module, __webpack_exports__, __webpack_require__) { 8587 8588 "use strict"; 8589 __webpack_require__.r(__webpack_exports__); 8590 /* harmony import */ var _babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectSpread */ "./node_modules/@babel/runtime/helpers/esm/objectSpread.js"); 8591 /* harmony import */ var _babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/defineProperty */ "./node_modules/@babel/runtime/helpers/esm/defineProperty.js"); 8592 /* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/classCallCheck */ "./node_modules/@babel/runtime/helpers/esm/classCallCheck.js"); 8593 /* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/esm/createClass */ "./node_modules/@babel/runtime/helpers/esm/createClass.js"); 8594 /* harmony import */ var _babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/esm/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js"); 8595 /* harmony import */ var _babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/helpers/esm/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js"); 8596 /* harmony import */ var _babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inherits */ "./node_modules/@babel/runtime/helpers/esm/inherits.js"); 8597 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); 8598 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__); 8599 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! lodash */ "lodash"); 8600 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_8__); 8601 /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose"); 8602 /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_9__); 8603 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); 8604 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_10__); 8605 /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./utils */ "./node_modules/@wordpress/editor/build-module/components/font-sizes/utils.js"); 8606 8607 8608 8609 8610 8611 8612 8613 8614 8615 /** 8616 * External dependencies 8617 */ 8618 8619 /** 8620 * WordPress dependencies 8621 */ 8622 8623 8624 8625 8626 /** 8627 * Internal dependencies 8628 */ 8629 8630 8631 /** 8632 * Higher-order component, which handles font size logic for class generation, 8633 * font size value retrieval, and font size change handling. 8634 * 8635 * @param {...(object|string)} args The arguments should all be strings 8636 * Each string contains the font size attribute name e.g: 'fontSize'. 8637 * 8638 * @return {Function} Higher-order component. 8639 */ 8640 8641 /* harmony default export */ __webpack_exports__["default"] = (function () { 8642 for (var _len = arguments.length, fontSizeNames = new Array(_len), _key = 0; _key < _len; _key++) { 8643 fontSizeNames[_key] = arguments[_key]; 8644 } 8645 8646 /* 8647 * Computes an object whose key is the font size attribute name as passed in the array, 8648 * and the value is the custom font size attribute name. 8649 * Custom font size is automatically compted by appending custom followed by the font size attribute name in with the first letter capitalized. 8650 */ 8651 var fontSizeAttributeNames = Object(lodash__WEBPACK_IMPORTED_MODULE_8__["reduce"])(fontSizeNames, function (fontSizeAttributeNamesAccumulator, fontSizeAttributeName) { 8652 fontSizeAttributeNamesAccumulator[fontSizeAttributeName] = "custom".concat(Object(lodash__WEBPACK_IMPORTED_MODULE_8__["upperFirst"])(fontSizeAttributeName)); 8653 return fontSizeAttributeNamesAccumulator; 8654 }, {}); 8655 return Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_9__["createHigherOrderComponent"])(Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_9__["compose"])([Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_10__["withSelect"])(function (select) { 8656 var _select$getEditorSett = select('core/editor').getEditorSettings(), 8657 fontSizes = _select$getEditorSett.fontSizes; 8658 8659 return { 8660 fontSizes: fontSizes 8661 }; 8662 }), function (WrappedComponent) { 8663 return ( 8664 /*#__PURE__*/ 8665 function (_Component) { 8666 Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_6__["default"])(_class, _Component); 8667 8668 function _class(props) { 8669 var _this; 8670 8671 Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_2__["default"])(this, _class); 8672 8673 _this = Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_4__["default"])(this, Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_5__["default"])(_class).call(this, props)); 8674 _this.setters = _this.createSetters(); 8675 _this.state = {}; 8676 return _this; 8677 } 8678 8679 Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_3__["default"])(_class, [{ 8680 key: "createSetters", 8681 value: function createSetters() { 8682 var _this2 = this; 8683 8684 return Object(lodash__WEBPACK_IMPORTED_MODULE_8__["reduce"])(fontSizeAttributeNames, function (settersAccumulator, customFontSizeAttributeName, fontSizeAttributeName) { 8685 var upperFirstFontSizeAttributeName = Object(lodash__WEBPACK_IMPORTED_MODULE_8__["upperFirst"])(fontSizeAttributeName); 8686 settersAccumulator["set".concat(upperFirstFontSizeAttributeName)] = _this2.createSetFontSize(fontSizeAttributeName, customFontSizeAttributeName); 8687 return settersAccumulator; 8688 }, {}); 8689 } 8690 }, { 8691 key: "createSetFontSize", 8692 value: function createSetFontSize(fontSizeAttributeName, customFontSizeAttributeName) { 8693 var _this3 = this; 8694 8695 return function (fontSizeValue) { 8696 var _this3$props$setAttri; 8697 8698 var fontSizeObject = Object(lodash__WEBPACK_IMPORTED_MODULE_8__["find"])(_this3.props.fontSizes, { 8699 size: fontSizeValue 8700 }); 8701 8702 _this3.props.setAttributes((_this3$props$setAttri = {}, Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_1__["default"])(_this3$props$setAttri, fontSizeAttributeName, fontSizeObject && fontSizeObject.slug ? fontSizeObject.slug : undefined), Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_1__["default"])(_this3$props$setAttri, customFontSizeAttributeName, fontSizeObject && fontSizeObject.slug ? undefined : fontSizeValue), _this3$props$setAttri)); 8703 }; 8704 } 8705 }, { 8706 key: "render", 8707 value: function render() { 8708 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["createElement"])(WrappedComponent, Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_0__["default"])({}, this.props, { 8709 fontSizes: undefined 8710 }, this.state, this.setters)); 8711 } 8712 }], [{ 8713 key: "getDerivedStateFromProps", 8714 value: function getDerivedStateFromProps(_ref, previousState) { 8715 var attributes = _ref.attributes, 8716 fontSizes = _ref.fontSizes; 8717 8718 var didAttributesChange = function didAttributesChange(customFontSizeAttributeName, fontSizeAttributeName) { 8719 if (previousState[fontSizeAttributeName]) { 8720 // if new font size is name compare with the previous slug 8721 if (attributes[fontSizeAttributeName]) { 8722 return attributes[fontSizeAttributeName] !== previousState[fontSizeAttributeName].slug; 8723 } // if font size is not named, update when the font size value changes. 8724 8725 8726 return previousState[fontSizeAttributeName].size !== attributes[customFontSizeAttributeName]; 8727 } // in this case we need to build the font size object 8728 8729 8730 return true; 8731 }; 8732 8733 if (!Object(lodash__WEBPACK_IMPORTED_MODULE_8__["some"])(fontSizeAttributeNames, didAttributesChange)) { 8734 return null; 8735 } 8736 8737 var newState = Object(lodash__WEBPACK_IMPORTED_MODULE_8__["reduce"])(Object(lodash__WEBPACK_IMPORTED_MODULE_8__["pickBy"])(fontSizeAttributeNames, didAttributesChange), function (newStateAccumulator, customFontSizeAttributeName, fontSizeAttributeName) { 8738 var fontSizeAttributeValue = attributes[fontSizeAttributeName]; 8739 var fontSizeObject = Object(_utils__WEBPACK_IMPORTED_MODULE_11__["getFontSize"])(fontSizes, fontSizeAttributeValue, attributes[customFontSizeAttributeName]); 8740 newStateAccumulator[fontSizeAttributeName] = Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_0__["default"])({}, fontSizeObject, { 8741 class: Object(_utils__WEBPACK_IMPORTED_MODULE_11__["getFontSizeClass"])(fontSizeAttributeValue) 8742 }); 8743 return newStateAccumulator; 8744 }, {}); 8745 return Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_0__["default"])({}, previousState, newState); 8746 } 8747 }]); 8748 8749 return _class; 8750 }(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["Component"]) 8751 ); 8752 }]), 'withFontSizes'); 8753 }); 8754 8755 8756 /***/ }), 8757 8758 /***/ "./node_modules/@wordpress/editor/build-module/components/ignore-nested-events/index.js": 8759 /*!**********************************************************************************************!*\ 8760 !*** ./node_modules/@wordpress/editor/build-module/components/ignore-nested-events/index.js ***! 8761 \**********************************************************************************************/ 8762 /*! exports provided: default */ 8763 /***/ (function(module, __webpack_exports__, __webpack_require__) { 8764 8765 "use strict"; 8766 __webpack_require__.r(__webpack_exports__); 8767 /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js"); 8768 /* harmony import */ var _babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/toConsumableArray */ "./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js"); 8769 /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutProperties */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js"); 8770 /* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/esm/classCallCheck */ "./node_modules/@babel/runtime/helpers/esm/classCallCheck.js"); 8771 /* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/esm/createClass */ "./node_modules/@babel/runtime/helpers/esm/createClass.js"); 8772 /* harmony import */ var _babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/helpers/esm/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js"); 8773 /* harmony import */ var _babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @babel/runtime/helpers/esm/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js"); 8774 /* harmony import */ var _babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inherits */ "./node_modules/@babel/runtime/helpers/esm/inherits.js"); 8775 /* harmony import */ var _babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @babel/runtime/helpers/esm/assertThisInitialized */ "./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js"); 8776 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); 8777 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_9__); 8778 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! lodash */ "lodash"); 8779 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_10__); 8780 8781 8782 8783 8784 8785 8786 8787 8788 8789 8790 8791 /** 8792 * External dependencies 8793 */ 8794 8795 /** 8796 * WordPress dependencies 8797 */ 8798 8799 8800 /** 8801 * Component which renders a div with passed props applied except the optional 8802 * `childHandledEvents` prop. Event prop handlers are replaced with a proxying 8803 * event handler to capture and prevent events from being handled by ancestor 8804 * `IgnoreNestedEvents` elements by testing the presence of a private property 8805 * assigned on the event object. 8806 * 8807 * Optionally accepts an `childHandledEvents` prop array, which can be used in 8808 * instances where an inner `IgnoreNestedEvents` element exists and the outer 8809 * element should stop propagation but not invoke a callback handler, since it 8810 * would be assumed these are invoked by the child element. 8811 * 8812 * @type {Component} 8813 */ 8814 8815 var IgnoreNestedEvents = 8816 /*#__PURE__*/ 8817 function (_Component) { 8818 Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_7__["default"])(IgnoreNestedEvents, _Component); 8819 8820 function IgnoreNestedEvents() { 8821 var _this; 8822 8823 Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_3__["default"])(this, IgnoreNestedEvents); 8824 8825 _this = Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_5__["default"])(this, Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_6__["default"])(IgnoreNestedEvents).apply(this, arguments)); 8826 _this.proxyEvent = _this.proxyEvent.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_8__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_8__["default"])(_this))); // The event map is responsible for tracking an event type to a React 8827 // component prop name, since it is easy to determine event type from 8828 // a React prop name, but not the other way around. 8829 8830 _this.eventMap = {}; 8831 return _this; 8832 } 8833 /** 8834 * General event handler which only calls to its original props callback if 8835 * it has not already been handled by a descendant IgnoreNestedEvents. 8836 * 8837 * @param {Event} event Event object. 8838 * 8839 * @return {void} 8840 */ 8841 8842 8843 Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_4__["default"])(IgnoreNestedEvents, [{ 8844 key: "proxyEvent", 8845 value: function proxyEvent(event) { 8846 var isHandled = !!event.nativeEvent._blockHandled; // Assign into the native event, since React will reuse their synthetic 8847 // event objects and this property assignment could otherwise leak. 8848 // 8849 // See: https://reactjs.org/docs/events.html#event-pooling 8850 8851 event.nativeEvent._blockHandled = true; // Invoke original prop handler 8852 8853 var propKey = this.eventMap[event.type]; // If already handled (i.e. assume nested block), only invoke a 8854 // corresponding "Handled"-suffixed prop callback. 8855 8856 if (isHandled) { 8857 propKey += 'Handled'; 8858 } 8859 8860 if (this.props[propKey]) { 8861 this.props[propKey](event); 8862 } 8863 } 8864 }, { 8865 key: "render", 8866 value: function render() { 8867 var _this2 = this; 8868 8869 var _this$props = this.props, 8870 _this$props$childHand = _this$props.childHandledEvents, 8871 childHandledEvents = _this$props$childHand === void 0 ? [] : _this$props$childHand, 8872 props = Object(_babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_2__["default"])(_this$props, ["childHandledEvents"]); 8873 8874 var eventHandlers = Object(lodash__WEBPACK_IMPORTED_MODULE_10__["reduce"])(Object(_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_1__["default"])(childHandledEvents).concat(Object(_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_1__["default"])(Object.keys(props))), function (result, key) { 8875 // Try to match prop key as event handler 8876 var match = key.match(/^on([A-Z][a-zA-Z]+?)(Handled)?$/); 8877 8878 if (match) { 8879 var isHandledProp = !!match[2]; 8880 8881 if (isHandledProp) { 8882 // Avoid assigning through the invalid prop key. This 8883 // assumes mutation of shallow clone by above spread. 8884 delete props[key]; 8885 } // Re-map the prop to the local proxy handler to check whether 8886 // the event has already been handled. 8887 8888 8889 var proxiedPropName = 'on' + match[1]; 8890 result[proxiedPropName] = _this2.proxyEvent; // Assign event -> propName into an instance variable, so as to 8891 // avoid re-renders which could be incurred either by setState 8892 // or in mapping values to a newly created function. 8893 8894 _this2.eventMap[match[1].toLowerCase()] = proxiedPropName; 8895 } 8896 8897 return result; 8898 }, {}); 8899 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_9__["createElement"])("div", Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, props, eventHandlers)); 8900 } 8901 }]); 8902 8903 return IgnoreNestedEvents; 8904 }(_wordpress_element__WEBPACK_IMPORTED_MODULE_9__["Component"]); 8905 8906 /* harmony default export */ __webpack_exports__["default"] = (IgnoreNestedEvents); 8907 8908 8909 /***/ }), 8910 8911 /***/ "./node_modules/@wordpress/editor/build-module/components/index.js": 8912 /*!*************************************************************************!*\ 8913 !*** ./node_modules/@wordpress/editor/build-module/components/index.js ***! 8914 \*************************************************************************/ 8915 /*! exports provided: Autocomplete, AlignmentToolbar, BlockAlignmentToolbar, BlockControls, BlockEdit, BlockFormatControls, BlockIcon, ColorPalette, withColorContext, ContrastChecker, InnerBlocks, InspectorAdvancedControls, InspectorControls, PanelColor, PanelColorSettings, PlainText, RichText, ServerSideRender, MediaPlaceholder, MediaUpload, URLInput, URLInputButton, AutosaveMonitor, DocumentOutline, DocumentOutlineCheck, EditorGlobalKeyboardShortcuts, EditorHistoryRedo, EditorHistoryUndo, EditorNotices, PageAttributesCheck, PageAttributesOrder, PageAttributesParent, PageTemplate, PostAuthor, PostAuthorCheck, PostComments, PostExcerpt, PostExcerptCheck, PostFeaturedImage, PostFeaturedImageCheck, PostFormat, PostFormatCheck, PostLastRevision, PostLastRevisionCheck, PostLockedModal, PostPendingStatus, PostPendingStatusCheck, PostPingbacks, PostPreviewButton, PostPublishButton, PostPublishButtonLabel, PostPublishPanel, PostPublishPanelToggle, PostSavedState, PostSchedule, PostScheduleCheck, PostScheduleLabel, PostSticky, PostStickyCheck, PostSwitchToDraftButton, PostTaxonomies, PostTaxonomiesCheck, PostTextEditor, PostTitle, PostTrash, PostTrashCheck, PostTypeSupportCheck, PostVisibility, PostVisibilityLabel, PostVisibilityCheck, TableOfContents, UnsavedChangesWarning, WordCount, BlockInspector, BlockList, BlockMover, BlockSelectionClearer, BlockSettingsMenu, _BlockSettingsMenuFirstItem, _BlockSettingsMenuPluginsExtension, BlockTitle, BlockToolbar, CopyHandler, DefaultBlockAppender, ErrorBoundary, Inserter, MultiBlocksSwitcher, MultiSelectScrollIntoView, NavigableToolbar, ObserveTyping, PreserveScrollInReorder, SkipToSelectedBlock, Warning, WritingFlow, EditorProvider, blockAutocompleter, userAutocompleter, getColorClassName, getColorObjectByAttributeValues, getColorObjectByColorValue, withColors, getFontSize, getFontSizeClass, FontSizePicker, withFontSizes */ 8916 /***/ (function(module, __webpack_exports__, __webpack_require__) { 8917 8918 "use strict"; 8919 __webpack_require__.r(__webpack_exports__); 8920 /* harmony import */ var _autocomplete__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./autocomplete */ "./node_modules/@wordpress/editor/build-module/components/autocomplete/index.js"); 8921 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Autocomplete", function() { return _autocomplete__WEBPACK_IMPORTED_MODULE_0__["default"]; }); 8922 8923 /* harmony import */ var _autocompleters__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./autocompleters */ "./node_modules/@wordpress/editor/build-module/components/autocompleters/index.js"); 8924 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "blockAutocompleter", function() { return _autocompleters__WEBPACK_IMPORTED_MODULE_1__["blockAutocompleter"]; }); 8925 8926 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "userAutocompleter", function() { return _autocompleters__WEBPACK_IMPORTED_MODULE_1__["userAutocompleter"]; }); 8927 8928 /* harmony import */ var _alignment_toolbar__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./alignment-toolbar */ "./node_modules/@wordpress/editor/build-module/components/alignment-toolbar/index.js"); 8929 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "AlignmentToolbar", function() { return _alignment_toolbar__WEBPACK_IMPORTED_MODULE_2__["default"]; }); 8930 8931 /* harmony import */ var _block_alignment_toolbar__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./block-alignment-toolbar */ "./node_modules/@wordpress/editor/build-module/components/block-alignment-toolbar/index.js"); 8932 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "BlockAlignmentToolbar", function() { return _block_alignment_toolbar__WEBPACK_IMPORTED_MODULE_3__["default"]; }); 8933 8934 /* harmony import */ var _block_controls__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./block-controls */ "./node_modules/@wordpress/editor/build-module/components/block-controls/index.js"); 8935 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "BlockControls", function() { return _block_controls__WEBPACK_IMPORTED_MODULE_4__["default"]; }); 8936 8937 /* harmony import */ var _block_edit__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./block-edit */ "./node_modules/@wordpress/editor/build-module/components/block-edit/index.js"); 8938 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "BlockEdit", function() { return _block_edit__WEBPACK_IMPORTED_MODULE_5__["default"]; }); 8939 8940 /* harmony import */ var _block_format_controls__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./block-format-controls */ "./node_modules/@wordpress/editor/build-module/components/block-format-controls/index.js"); 8941 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "BlockFormatControls", function() { return _block_format_controls__WEBPACK_IMPORTED_MODULE_6__["default"]; }); 8942 8943 /* harmony import */ var _block_icon__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./block-icon */ "./node_modules/@wordpress/editor/build-module/components/block-icon/index.js"); 8944 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "BlockIcon", function() { return _block_icon__WEBPACK_IMPORTED_MODULE_7__["default"]; }); 8945 8946 /* harmony import */ var _color_palette__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./color-palette */ "./node_modules/@wordpress/editor/build-module/components/color-palette/index.js"); 8947 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ColorPalette", function() { return _color_palette__WEBPACK_IMPORTED_MODULE_8__["default"]; }); 8948 8949 /* harmony import */ var _color_palette_with_color_context__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./color-palette/with-color-context */ "./node_modules/@wordpress/editor/build-module/components/color-palette/with-color-context.js"); 8950 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "withColorContext", function() { return _color_palette_with_color_context__WEBPACK_IMPORTED_MODULE_9__["default"]; }); 8951 8952 /* harmony import */ var _colors__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./colors */ "./node_modules/@wordpress/editor/build-module/components/colors/index.js"); 8953 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getColorClassName", function() { return _colors__WEBPACK_IMPORTED_MODULE_10__["getColorClassName"]; }); 8954 8955 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getColorObjectByAttributeValues", function() { return _colors__WEBPACK_IMPORTED_MODULE_10__["getColorObjectByAttributeValues"]; }); 8956 8957 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getColorObjectByColorValue", function() { return _colors__WEBPACK_IMPORTED_MODULE_10__["getColorObjectByColorValue"]; }); 8958 8959 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "withColors", function() { return _colors__WEBPACK_IMPORTED_MODULE_10__["withColors"]; }); 8960 8961 /* harmony import */ var _contrast_checker__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./contrast-checker */ "./node_modules/@wordpress/editor/build-module/components/contrast-checker/index.js"); 8962 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ContrastChecker", function() { return _contrast_checker__WEBPACK_IMPORTED_MODULE_11__["default"]; }); 8963 8964 /* harmony import */ var _font_sizes__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./font-sizes */ "./node_modules/@wordpress/editor/build-module/components/font-sizes/index.js"); 8965 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getFontSize", function() { return _font_sizes__WEBPACK_IMPORTED_MODULE_12__["getFontSize"]; }); 8966 8967 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getFontSizeClass", function() { return _font_sizes__WEBPACK_IMPORTED_MODULE_12__["getFontSizeClass"]; }); 8968 8969 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "FontSizePicker", function() { return _font_sizes__WEBPACK_IMPORTED_MODULE_12__["FontSizePicker"]; }); 8970 8971 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "withFontSizes", function() { return _font_sizes__WEBPACK_IMPORTED_MODULE_12__["withFontSizes"]; }); 8972 8973 /* harmony import */ var _inner_blocks__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./inner-blocks */ "./node_modules/@wordpress/editor/build-module/components/inner-blocks/index.js"); 8974 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "InnerBlocks", function() { return _inner_blocks__WEBPACK_IMPORTED_MODULE_13__["default"]; }); 8975 8976 /* harmony import */ var _inspector_advanced_controls__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./inspector-advanced-controls */ "./node_modules/@wordpress/editor/build-module/components/inspector-advanced-controls/index.js"); 8977 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "InspectorAdvancedControls", function() { return _inspector_advanced_controls__WEBPACK_IMPORTED_MODULE_14__["default"]; }); 8978 8979 /* harmony import */ var _inspector_controls__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./inspector-controls */ "./node_modules/@wordpress/editor/build-module/components/inspector-controls/index.js"); 8980 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "InspectorControls", function() { return _inspector_controls__WEBPACK_IMPORTED_MODULE_15__["default"]; }); 8981 8982 /* harmony import */ var _panel_color__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./panel-color */ "./node_modules/@wordpress/editor/build-module/components/panel-color/index.js"); 8983 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PanelColor", function() { return _panel_color__WEBPACK_IMPORTED_MODULE_16__["default"]; }); 8984 8985 /* harmony import */ var _panel_color_settings__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./panel-color-settings */ "./node_modules/@wordpress/editor/build-module/components/panel-color-settings/index.js"); 8986 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PanelColorSettings", function() { return _panel_color_settings__WEBPACK_IMPORTED_MODULE_17__["default"]; }); 8987 8988 /* harmony import */ var _plain_text__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./plain-text */ "./node_modules/@wordpress/editor/build-module/components/plain-text/index.js"); 8989 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PlainText", function() { return _plain_text__WEBPACK_IMPORTED_MODULE_18__["default"]; }); 8990 8991 /* harmony import */ var _rich_text__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./rich-text */ "./node_modules/@wordpress/editor/build-module/components/rich-text/index.js"); 8992 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "RichText", function() { return _rich_text__WEBPACK_IMPORTED_MODULE_19__["default"]; }); 8993 8994 /* harmony import */ var _server_side_render__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./server-side-render */ "./node_modules/@wordpress/editor/build-module/components/server-side-render/index.js"); 8995 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ServerSideRender", function() { return _server_side_render__WEBPACK_IMPORTED_MODULE_20__["default"]; }); 8996 8997 /* harmony import */ var _media_placeholder__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./media-placeholder */ "./node_modules/@wordpress/editor/build-module/components/media-placeholder/index.js"); 8998 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MediaPlaceholder", function() { return _media_placeholder__WEBPACK_IMPORTED_MODULE_21__["default"]; }); 8999 9000 /* harmony import */ var _media_upload__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./media-upload */ "./node_modules/@wordpress/editor/build-module/components/media-upload/index.js"); 9001 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MediaUpload", function() { return _media_upload__WEBPACK_IMPORTED_MODULE_22__["default"]; }); 9002 9003 /* harmony import */ var _url_input__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./url-input */ "./node_modules/@wordpress/editor/build-module/components/url-input/index.js"); 9004 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "URLInput", function() { return _url_input__WEBPACK_IMPORTED_MODULE_23__["default"]; }); 9005 9006 /* harmony import */ var _url_input_button__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./url-input/button */ "./node_modules/@wordpress/editor/build-module/components/url-input/button.js"); 9007 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "URLInputButton", function() { return _url_input_button__WEBPACK_IMPORTED_MODULE_24__["default"]; }); 9008 9009 /* harmony import */ var _autosave_monitor__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./autosave-monitor */ "./node_modules/@wordpress/editor/build-module/components/autosave-monitor/index.js"); 9010 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "AutosaveMonitor", function() { return _autosave_monitor__WEBPACK_IMPORTED_MODULE_25__["default"]; }); 9011 9012 /* harmony import */ var _document_outline__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ./document-outline */ "./node_modules/@wordpress/editor/build-module/components/document-outline/index.js"); 9013 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "DocumentOutline", function() { return _document_outline__WEBPACK_IMPORTED_MODULE_26__["default"]; }); 9014 9015 /* harmony import */ var _document_outline_check__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ./document-outline/check */ "./node_modules/@wordpress/editor/build-module/components/document-outline/check.js"); 9016 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "DocumentOutlineCheck", function() { return _document_outline_check__WEBPACK_IMPORTED_MODULE_27__["default"]; }); 9017 9018 /* harmony import */ var _editor_global_keyboard_shortcuts__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ./editor-global-keyboard-shortcuts */ "./node_modules/@wordpress/editor/build-module/components/editor-global-keyboard-shortcuts/index.js"); 9019 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "EditorGlobalKeyboardShortcuts", function() { return _editor_global_keyboard_shortcuts__WEBPACK_IMPORTED_MODULE_28__["default"]; }); 9020 9021 /* harmony import */ var _editor_history_redo__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ./editor-history/redo */ "./node_modules/@wordpress/editor/build-module/components/editor-history/redo.js"); 9022 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "EditorHistoryRedo", function() { return _editor_history_redo__WEBPACK_IMPORTED_MODULE_29__["default"]; }); 9023 9024 /* harmony import */ var _editor_history_undo__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ./editor-history/undo */ "./node_modules/@wordpress/editor/build-module/components/editor-history/undo.js"); 9025 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "EditorHistoryUndo", function() { return _editor_history_undo__WEBPACK_IMPORTED_MODULE_30__["default"]; }); 9026 9027 /* harmony import */ var _editor_notices__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ./editor-notices */ "./node_modules/@wordpress/editor/build-module/components/editor-notices/index.js"); 9028 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "EditorNotices", function() { return _editor_notices__WEBPACK_IMPORTED_MODULE_31__["default"]; }); 9029 9030 /* harmony import */ var _page_attributes_check__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! ./page-attributes/check */ "./node_modules/@wordpress/editor/build-module/components/page-attributes/check.js"); 9031 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PageAttributesCheck", function() { return _page_attributes_check__WEBPACK_IMPORTED_MODULE_32__["default"]; }); 9032 9033 /* harmony import */ var _page_attributes_order__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! ./page-attributes/order */ "./node_modules/@wordpress/editor/build-module/components/page-attributes/order.js"); 9034 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PageAttributesOrder", function() { return _page_attributes_order__WEBPACK_IMPORTED_MODULE_33__["default"]; }); 9035 9036 /* harmony import */ var _page_attributes_parent__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(/*! ./page-attributes/parent */ "./node_modules/@wordpress/editor/build-module/components/page-attributes/parent.js"); 9037 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PageAttributesParent", function() { return _page_attributes_parent__WEBPACK_IMPORTED_MODULE_34__["default"]; }); 9038 9039 /* harmony import */ var _page_attributes_template__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(/*! ./page-attributes/template */ "./node_modules/@wordpress/editor/build-module/components/page-attributes/template.js"); 9040 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PageTemplate", function() { return _page_attributes_template__WEBPACK_IMPORTED_MODULE_35__["default"]; }); 9041 9042 /* harmony import */ var _post_author__WEBPACK_IMPORTED_MODULE_36__ = __webpack_require__(/*! ./post-author */ "./node_modules/@wordpress/editor/build-module/components/post-author/index.js"); 9043 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PostAuthor", function() { return _post_author__WEBPACK_IMPORTED_MODULE_36__["default"]; }); 9044 9045 /* harmony import */ var _post_author_check__WEBPACK_IMPORTED_MODULE_37__ = __webpack_require__(/*! ./post-author/check */ "./node_modules/@wordpress/editor/build-module/components/post-author/check.js"); 9046 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PostAuthorCheck", function() { return _post_author_check__WEBPACK_IMPORTED_MODULE_37__["default"]; }); 9047 9048 /* harmony import */ var _post_comments__WEBPACK_IMPORTED_MODULE_38__ = __webpack_require__(/*! ./post-comments */ "./node_modules/@wordpress/editor/build-module/components/post-comments/index.js"); 9049 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PostComments", function() { return _post_comments__WEBPACK_IMPORTED_MODULE_38__["default"]; }); 9050 9051 /* harmony import */ var _post_excerpt__WEBPACK_IMPORTED_MODULE_39__ = __webpack_require__(/*! ./post-excerpt */ "./node_modules/@wordpress/editor/build-module/components/post-excerpt/index.js"); 9052 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PostExcerpt", function() { return _post_excerpt__WEBPACK_IMPORTED_MODULE_39__["default"]; }); 9053 9054 /* harmony import */ var _post_excerpt_check__WEBPACK_IMPORTED_MODULE_40__ = __webpack_require__(/*! ./post-excerpt/check */ "./node_modules/@wordpress/editor/build-module/components/post-excerpt/check.js"); 9055 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PostExcerptCheck", function() { return _post_excerpt_check__WEBPACK_IMPORTED_MODULE_40__["default"]; }); 9056 9057 /* harmony import */ var _post_featured_image__WEBPACK_IMPORTED_MODULE_41__ = __webpack_require__(/*! ./post-featured-image */ "./node_modules/@wordpress/editor/build-module/components/post-featured-image/index.js"); 9058 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PostFeaturedImage", function() { return _post_featured_image__WEBPACK_IMPORTED_MODULE_41__["default"]; }); 9059 9060 /* harmony import */ var _post_featured_image_check__WEBPACK_IMPORTED_MODULE_42__ = __webpack_require__(/*! ./post-featured-image/check */ "./node_modules/@wordpress/editor/build-module/components/post-featured-image/check.js"); 9061 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PostFeaturedImageCheck", function() { return _post_featured_image_check__WEBPACK_IMPORTED_MODULE_42__["default"]; }); 9062 9063 /* harmony import */ var _post_format__WEBPACK_IMPORTED_MODULE_43__ = __webpack_require__(/*! ./post-format */ "./node_modules/@wordpress/editor/build-module/components/post-format/index.js"); 9064 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PostFormat", function() { return _post_format__WEBPACK_IMPORTED_MODULE_43__["default"]; }); 9065 9066 /* harmony import */ var _post_format_check__WEBPACK_IMPORTED_MODULE_44__ = __webpack_require__(/*! ./post-format/check */ "./node_modules/@wordpress/editor/build-module/components/post-format/check.js"); 9067 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PostFormatCheck", function() { return _post_format_check__WEBPACK_IMPORTED_MODULE_44__["default"]; }); 9068 9069 /* harmony import */ var _post_last_revision__WEBPACK_IMPORTED_MODULE_45__ = __webpack_require__(/*! ./post-last-revision */ "./node_modules/@wordpress/editor/build-module/components/post-last-revision/index.js"); 9070 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PostLastRevision", function() { return _post_last_revision__WEBPACK_IMPORTED_MODULE_45__["default"]; }); 9071 9072 /* harmony import */ var _post_last_revision_check__WEBPACK_IMPORTED_MODULE_46__ = __webpack_require__(/*! ./post-last-revision/check */ "./node_modules/@wordpress/editor/build-module/components/post-last-revision/check.js"); 9073 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PostLastRevisionCheck", function() { return _post_last_revision_check__WEBPACK_IMPORTED_MODULE_46__["default"]; }); 9074 9075 /* harmony import */ var _post_locked_modal__WEBPACK_IMPORTED_MODULE_47__ = __webpack_require__(/*! ./post-locked-modal */ "./node_modules/@wordpress/editor/build-module/components/post-locked-modal/index.js"); 9076 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PostLockedModal", function() { return _post_locked_modal__WEBPACK_IMPORTED_MODULE_47__["default"]; }); 9077 9078 /* harmony import */ var _post_pending_status__WEBPACK_IMPORTED_MODULE_48__ = __webpack_require__(/*! ./post-pending-status */ "./node_modules/@wordpress/editor/build-module/components/post-pending-status/index.js"); 9079 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PostPendingStatus", function() { return _post_pending_status__WEBPACK_IMPORTED_MODULE_48__["default"]; }); 9080 9081 /* harmony import */ var _post_pending_status_check__WEBPACK_IMPORTED_MODULE_49__ = __webpack_require__(/*! ./post-pending-status/check */ "./node_modules/@wordpress/editor/build-module/components/post-pending-status/check.js"); 9082 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PostPendingStatusCheck", function() { return _post_pending_status_check__WEBPACK_IMPORTED_MODULE_49__["default"]; }); 9083 9084 /* harmony import */ var _post_pingbacks__WEBPACK_IMPORTED_MODULE_50__ = __webpack_require__(/*! ./post-pingbacks */ "./node_modules/@wordpress/editor/build-module/components/post-pingbacks/index.js"); 9085 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PostPingbacks", function() { return _post_pingbacks__WEBPACK_IMPORTED_MODULE_50__["default"]; }); 9086 9087 /* harmony import */ var _post_preview_button__WEBPACK_IMPORTED_MODULE_51__ = __webpack_require__(/*! ./post-preview-button */ "./node_modules/@wordpress/editor/build-module/components/post-preview-button/index.js"); 9088 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PostPreviewButton", function() { return _post_preview_button__WEBPACK_IMPORTED_MODULE_51__["default"]; }); 9089 9090 /* harmony import */ var _post_publish_button__WEBPACK_IMPORTED_MODULE_52__ = __webpack_require__(/*! ./post-publish-button */ "./node_modules/@wordpress/editor/build-module/components/post-publish-button/index.js"); 9091 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PostPublishButton", function() { return _post_publish_button__WEBPACK_IMPORTED_MODULE_52__["default"]; }); 9092 9093 /* harmony import */ var _post_publish_button_label__WEBPACK_IMPORTED_MODULE_53__ = __webpack_require__(/*! ./post-publish-button/label */ "./node_modules/@wordpress/editor/build-module/components/post-publish-button/label.js"); 9094 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PostPublishButtonLabel", function() { return _post_publish_button_label__WEBPACK_IMPORTED_MODULE_53__["default"]; }); 9095 9096 /* harmony import */ var _post_publish_panel__WEBPACK_IMPORTED_MODULE_54__ = __webpack_require__(/*! ./post-publish-panel */ "./node_modules/@wordpress/editor/build-module/components/post-publish-panel/index.js"); 9097 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PostPublishPanel", function() { return _post_publish_panel__WEBPACK_IMPORTED_MODULE_54__["default"]; }); 9098 9099 /* harmony import */ var _post_publish_panel_toggle__WEBPACK_IMPORTED_MODULE_55__ = __webpack_require__(/*! ./post-publish-panel/toggle */ "./node_modules/@wordpress/editor/build-module/components/post-publish-panel/toggle.js"); 9100 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PostPublishPanelToggle", function() { return _post_publish_panel_toggle__WEBPACK_IMPORTED_MODULE_55__["default"]; }); 9101 9102 /* harmony import */ var _post_saved_state__WEBPACK_IMPORTED_MODULE_56__ = __webpack_require__(/*! ./post-saved-state */ "./node_modules/@wordpress/editor/build-module/components/post-saved-state/index.js"); 9103 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PostSavedState", function() { return _post_saved_state__WEBPACK_IMPORTED_MODULE_56__["default"]; }); 9104 9105 /* harmony import */ var _post_schedule__WEBPACK_IMPORTED_MODULE_57__ = __webpack_require__(/*! ./post-schedule */ "./node_modules/@wordpress/editor/build-module/components/post-schedule/index.js"); 9106 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PostSchedule", function() { return _post_schedule__WEBPACK_IMPORTED_MODULE_57__["default"]; }); 9107 9108 /* harmony import */ var _post_schedule_check__WEBPACK_IMPORTED_MODULE_58__ = __webpack_require__(/*! ./post-schedule/check */ "./node_modules/@wordpress/editor/build-module/components/post-schedule/check.js"); 9109 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PostScheduleCheck", function() { return _post_schedule_check__WEBPACK_IMPORTED_MODULE_58__["default"]; }); 9110 9111 /* harmony import */ var _post_schedule_label__WEBPACK_IMPORTED_MODULE_59__ = __webpack_require__(/*! ./post-schedule/label */ "./node_modules/@wordpress/editor/build-module/components/post-schedule/label.js"); 9112 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PostScheduleLabel", function() { return _post_schedule_label__WEBPACK_IMPORTED_MODULE_59__["default"]; }); 9113 9114 /* harmony import */ var _post_sticky__WEBPACK_IMPORTED_MODULE_60__ = __webpack_require__(/*! ./post-sticky */ "./node_modules/@wordpress/editor/build-module/components/post-sticky/index.js"); 9115 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PostSticky", function() { return _post_sticky__WEBPACK_IMPORTED_MODULE_60__["default"]; }); 9116 9117 /* harmony import */ var _post_sticky_check__WEBPACK_IMPORTED_MODULE_61__ = __webpack_require__(/*! ./post-sticky/check */ "./node_modules/@wordpress/editor/build-module/components/post-sticky/check.js"); 9118 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PostStickyCheck", function() { return _post_sticky_check__WEBPACK_IMPORTED_MODULE_61__["default"]; }); 9119 9120 /* harmony import */ var _post_switch_to_draft_button__WEBPACK_IMPORTED_MODULE_62__ = __webpack_require__(/*! ./post-switch-to-draft-button */ "./node_modules/@wordpress/editor/build-module/components/post-switch-to-draft-button/index.js"); 9121 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PostSwitchToDraftButton", function() { return _post_switch_to_draft_button__WEBPACK_IMPORTED_MODULE_62__["default"]; }); 9122 9123 /* harmony import */ var _post_taxonomies__WEBPACK_IMPORTED_MODULE_63__ = __webpack_require__(/*! ./post-taxonomies */ "./node_modules/@wordpress/editor/build-module/components/post-taxonomies/index.js"); 9124 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PostTaxonomies", function() { return _post_taxonomies__WEBPACK_IMPORTED_MODULE_63__["default"]; }); 9125 9126 /* harmony import */ var _post_taxonomies_check__WEBPACK_IMPORTED_MODULE_64__ = __webpack_require__(/*! ./post-taxonomies/check */ "./node_modules/@wordpress/editor/build-module/components/post-taxonomies/check.js"); 9127 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PostTaxonomiesCheck", function() { return _post_taxonomies_check__WEBPACK_IMPORTED_MODULE_64__["default"]; }); 9128 9129 /* harmony import */ var _post_text_editor__WEBPACK_IMPORTED_MODULE_65__ = __webpack_require__(/*! ./post-text-editor */ "./node_modules/@wordpress/editor/build-module/components/post-text-editor/index.js"); 9130 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PostTextEditor", function() { return _post_text_editor__WEBPACK_IMPORTED_MODULE_65__["default"]; }); 9131 9132 /* harmony import */ var _post_title__WEBPACK_IMPORTED_MODULE_66__ = __webpack_require__(/*! ./post-title */ "./node_modules/@wordpress/editor/build-module/components/post-title/index.js"); 9133 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PostTitle", function() { return _post_title__WEBPACK_IMPORTED_MODULE_66__["default"]; }); 9134 9135 /* harmony import */ var _post_trash__WEBPACK_IMPORTED_MODULE_67__ = __webpack_require__(/*! ./post-trash */ "./node_modules/@wordpress/editor/build-module/components/post-trash/index.js"); 9136 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PostTrash", function() { return _post_trash__WEBPACK_IMPORTED_MODULE_67__["default"]; }); 9137 9138 /* harmony import */ var _post_trash_check__WEBPACK_IMPORTED_MODULE_68__ = __webpack_require__(/*! ./post-trash/check */ "./node_modules/@wordpress/editor/build-module/components/post-trash/check.js"); 9139 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PostTrashCheck", function() { return _post_trash_check__WEBPACK_IMPORTED_MODULE_68__["default"]; }); 9140 9141 /* harmony import */ var _post_type_support_check__WEBPACK_IMPORTED_MODULE_69__ = __webpack_require__(/*! ./post-type-support-check */ "./node_modules/@wordpress/editor/build-module/components/post-type-support-check/index.js"); 9142 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PostTypeSupportCheck", function() { return _post_type_support_check__WEBPACK_IMPORTED_MODULE_69__["default"]; }); 9143 9144 /* harmony import */ var _post_visibility__WEBPACK_IMPORTED_MODULE_70__ = __webpack_require__(/*! ./post-visibility */ "./node_modules/@wordpress/editor/build-module/components/post-visibility/index.js"); 9145 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PostVisibility", function() { return _post_visibility__WEBPACK_IMPORTED_MODULE_70__["default"]; }); 9146 9147 /* harmony import */ var _post_visibility_label__WEBPACK_IMPORTED_MODULE_71__ = __webpack_require__(/*! ./post-visibility/label */ "./node_modules/@wordpress/editor/build-module/components/post-visibility/label.js"); 9148 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PostVisibilityLabel", function() { return _post_visibility_label__WEBPACK_IMPORTED_MODULE_71__["default"]; }); 9149 9150 /* harmony import */ var _post_visibility_check__WEBPACK_IMPORTED_MODULE_72__ = __webpack_require__(/*! ./post-visibility/check */ "./node_modules/@wordpress/editor/build-module/components/post-visibility/check.js"); 9151 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PostVisibilityCheck", function() { return _post_visibility_check__WEBPACK_IMPORTED_MODULE_72__["default"]; }); 9152 9153 /* harmony import */ var _table_of_contents__WEBPACK_IMPORTED_MODULE_73__ = __webpack_require__(/*! ./table-of-contents */ "./node_modules/@wordpress/editor/build-module/components/table-of-contents/index.js"); 9154 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TableOfContents", function() { return _table_of_contents__WEBPACK_IMPORTED_MODULE_73__["default"]; }); 9155 9156 /* harmony import */ var _unsaved_changes_warning__WEBPACK_IMPORTED_MODULE_74__ = __webpack_require__(/*! ./unsaved-changes-warning */ "./node_modules/@wordpress/editor/build-module/components/unsaved-changes-warning/index.js"); 9157 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "UnsavedChangesWarning", function() { return _unsaved_changes_warning__WEBPACK_IMPORTED_MODULE_74__["default"]; }); 9158 9159 /* harmony import */ var _word_count__WEBPACK_IMPORTED_MODULE_75__ = __webpack_require__(/*! ./word-count */ "./node_modules/@wordpress/editor/build-module/components/word-count/index.js"); 9160 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "WordCount", function() { return _word_count__WEBPACK_IMPORTED_MODULE_75__["default"]; }); 9161 9162 /* harmony import */ var _block_inspector__WEBPACK_IMPORTED_MODULE_76__ = __webpack_require__(/*! ./block-inspector */ "./node_modules/@wordpress/editor/build-module/components/block-inspector/index.js"); 9163 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "BlockInspector", function() { return _block_inspector__WEBPACK_IMPORTED_MODULE_76__["default"]; }); 9164 9165 /* harmony import */ var _block_list__WEBPACK_IMPORTED_MODULE_77__ = __webpack_require__(/*! ./block-list */ "./node_modules/@wordpress/editor/build-module/components/block-list/index.js"); 9166 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "BlockList", function() { return _block_list__WEBPACK_IMPORTED_MODULE_77__["default"]; }); 9167 9168 /* harmony import */ var _block_mover__WEBPACK_IMPORTED_MODULE_78__ = __webpack_require__(/*! ./block-mover */ "./node_modules/@wordpress/editor/build-module/components/block-mover/index.js"); 9169 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "BlockMover", function() { return _block_mover__WEBPACK_IMPORTED_MODULE_78__["default"]; }); 9170 9171 /* harmony import */ var _block_selection_clearer__WEBPACK_IMPORTED_MODULE_79__ = __webpack_require__(/*! ./block-selection-clearer */ "./node_modules/@wordpress/editor/build-module/components/block-selection-clearer/index.js"); 9172 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "BlockSelectionClearer", function() { return _block_selection_clearer__WEBPACK_IMPORTED_MODULE_79__["default"]; }); 9173 9174 /* harmony import */ var _block_settings_menu__WEBPACK_IMPORTED_MODULE_80__ = __webpack_require__(/*! ./block-settings-menu */ "./node_modules/@wordpress/editor/build-module/components/block-settings-menu/index.js"); 9175 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "BlockSettingsMenu", function() { return _block_settings_menu__WEBPACK_IMPORTED_MODULE_80__["default"]; }); 9176 9177 /* harmony import */ var _block_settings_menu_block_settings_menu_first_item__WEBPACK_IMPORTED_MODULE_81__ = __webpack_require__(/*! ./block-settings-menu/block-settings-menu-first-item */ "./node_modules/@wordpress/editor/build-module/components/block-settings-menu/block-settings-menu-first-item.js"); 9178 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "_BlockSettingsMenuFirstItem", function() { return _block_settings_menu_block_settings_menu_first_item__WEBPACK_IMPORTED_MODULE_81__["default"]; }); 9179 9180 /* harmony import */ var _block_settings_menu_block_settings_menu_plugins_extension__WEBPACK_IMPORTED_MODULE_82__ = __webpack_require__(/*! ./block-settings-menu/block-settings-menu-plugins-extension */ "./node_modules/@wordpress/editor/build-module/components/block-settings-menu/block-settings-menu-plugins-extension.js"); 9181 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "_BlockSettingsMenuPluginsExtension", function() { return _block_settings_menu_block_settings_menu_plugins_extension__WEBPACK_IMPORTED_MODULE_82__["default"]; }); 9182 9183 /* harmony import */ var _block_title__WEBPACK_IMPORTED_MODULE_83__ = __webpack_require__(/*! ./block-title */ "./node_modules/@wordpress/editor/build-module/components/block-title/index.js"); 9184 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "BlockTitle", function() { return _block_title__WEBPACK_IMPORTED_MODULE_83__["default"]; }); 9185 9186 /* harmony import */ var _block_toolbar__WEBPACK_IMPORTED_MODULE_84__ = __webpack_require__(/*! ./block-toolbar */ "./node_modules/@wordpress/editor/build-module/components/block-toolbar/index.js"); 9187 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "BlockToolbar", function() { return _block_toolbar__WEBPACK_IMPORTED_MODULE_84__["default"]; }); 9188 9189 /* harmony import */ var _copy_handler__WEBPACK_IMPORTED_MODULE_85__ = __webpack_require__(/*! ./copy-handler */ "./node_modules/@wordpress/editor/build-module/components/copy-handler/index.js"); 9190 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "CopyHandler", function() { return _copy_handler__WEBPACK_IMPORTED_MODULE_85__["default"]; }); 9191 9192 /* harmony import */ var _default_block_appender__WEBPACK_IMPORTED_MODULE_86__ = __webpack_require__(/*! ./default-block-appender */ "./node_modules/@wordpress/editor/build-module/components/default-block-appender/index.js"); 9193 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "DefaultBlockAppender", function() { return _default_block_appender__WEBPACK_IMPORTED_MODULE_86__["default"]; }); 9194 9195 /* harmony import */ var _error_boundary__WEBPACK_IMPORTED_MODULE_87__ = __webpack_require__(/*! ./error-boundary */ "./node_modules/@wordpress/editor/build-module/components/error-boundary/index.js"); 9196 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ErrorBoundary", function() { return _error_boundary__WEBPACK_IMPORTED_MODULE_87__["default"]; }); 9197 9198 /* harmony import */ var _inserter__WEBPACK_IMPORTED_MODULE_88__ = __webpack_require__(/*! ./inserter */ "./node_modules/@wordpress/editor/build-module/components/inserter/index.js"); 9199 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Inserter", function() { return _inserter__WEBPACK_IMPORTED_MODULE_88__["default"]; }); 9200 9201 /* harmony import */ var _block_switcher_multi_blocks_switcher__WEBPACK_IMPORTED_MODULE_89__ = __webpack_require__(/*! ./block-switcher/multi-blocks-switcher */ "./node_modules/@wordpress/editor/build-module/components/block-switcher/multi-blocks-switcher.js"); 9202 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MultiBlocksSwitcher", function() { return _block_switcher_multi_blocks_switcher__WEBPACK_IMPORTED_MODULE_89__["default"]; }); 9203 9204 /* harmony import */ var _multi_select_scroll_into_view__WEBPACK_IMPORTED_MODULE_90__ = __webpack_require__(/*! ./multi-select-scroll-into-view */ "./node_modules/@wordpress/editor/build-module/components/multi-select-scroll-into-view/index.js"); 9205 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MultiSelectScrollIntoView", function() { return _multi_select_scroll_into_view__WEBPACK_IMPORTED_MODULE_90__["default"]; }); 9206 9207 /* harmony import */ var _navigable_toolbar__WEBPACK_IMPORTED_MODULE_91__ = __webpack_require__(/*! ./navigable-toolbar */ "./node_modules/@wordpress/editor/build-module/components/navigable-toolbar/index.js"); 9208 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "NavigableToolbar", function() { return _navigable_toolbar__WEBPACK_IMPORTED_MODULE_91__["default"]; }); 9209 9210 /* harmony import */ var _observe_typing__WEBPACK_IMPORTED_MODULE_92__ = __webpack_require__(/*! ./observe-typing */ "./node_modules/@wordpress/editor/build-module/components/observe-typing/index.js"); 9211 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ObserveTyping", function() { return _observe_typing__WEBPACK_IMPORTED_MODULE_92__["default"]; }); 9212 9213 /* harmony import */ var _preserve_scroll_in_reorder__WEBPACK_IMPORTED_MODULE_93__ = __webpack_require__(/*! ./preserve-scroll-in-reorder */ "./node_modules/@wordpress/editor/build-module/components/preserve-scroll-in-reorder/index.js"); 9214 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PreserveScrollInReorder", function() { return _preserve_scroll_in_reorder__WEBPACK_IMPORTED_MODULE_93__["default"]; }); 9215 9216 /* harmony import */ var _skip_to_selected_block__WEBPACK_IMPORTED_MODULE_94__ = __webpack_require__(/*! ./skip-to-selected-block */ "./node_modules/@wordpress/editor/build-module/components/skip-to-selected-block/index.js"); 9217 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "SkipToSelectedBlock", function() { return _skip_to_selected_block__WEBPACK_IMPORTED_MODULE_94__["default"]; }); 9218 9219 /* harmony import */ var _warning__WEBPACK_IMPORTED_MODULE_95__ = __webpack_require__(/*! ./warning */ "./node_modules/@wordpress/editor/build-module/components/warning/index.js"); 9220 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Warning", function() { return _warning__WEBPACK_IMPORTED_MODULE_95__["default"]; }); 9221 9222 /* harmony import */ var _writing_flow__WEBPACK_IMPORTED_MODULE_96__ = __webpack_require__(/*! ./writing-flow */ "./node_modules/@wordpress/editor/build-module/components/writing-flow/index.js"); 9223 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "WritingFlow", function() { return _writing_flow__WEBPACK_IMPORTED_MODULE_96__["default"]; }); 9224 9225 /* harmony import */ var _provider__WEBPACK_IMPORTED_MODULE_97__ = __webpack_require__(/*! ./provider */ "./node_modules/@wordpress/editor/build-module/components/provider/index.js"); 9226 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "EditorProvider", function() { return _provider__WEBPACK_IMPORTED_MODULE_97__["default"]; }); 9227 9228 // Block Creation Components 9229 9230 9231 9232 9233 9234 9235 9236 9237 9238 9239 9240 9241 9242 9243 9244 9245 9246 9247 9248 9249 9250 9251 9252 9253 // Post Related Components 9254 9255 9256 9257 9258 9259 9260 9261 9262 9263 9264 9265 9266 9267 9268 9269 9270 9271 9272 9273 9274 9275 9276 9277 9278 9279 9280 9281 9282 9283 9284 9285 9286 9287 9288 9289 9290 9291 9292 9293 9294 9295 9296 9297 9298 9299 9300 9301 9302 9303 9304 9305 // Content Related Components 9306 9307 9308 9309 9310 9311 9312 9313 9314 9315 9316 9317 9318 9319 9320 9321 9322 9323 9324 9325 9326 9327 // State Related Components 9328 9329 9330 9331 9332 /***/ }), 9333 9334 /***/ "./node_modules/@wordpress/editor/build-module/components/inner-blocks/index.js": 9335 /*!**************************************************************************************!*\ 9336 !*** ./node_modules/@wordpress/editor/build-module/components/inner-blocks/index.js ***! 9337 \**************************************************************************************/ 9338 /*! exports provided: default */ 9339 /***/ (function(module, __webpack_exports__, __webpack_require__) { 9340 9341 "use strict"; 9342 __webpack_require__.r(__webpack_exports__); 9343 /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js"); 9344 /* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/classCallCheck */ "./node_modules/@babel/runtime/helpers/esm/classCallCheck.js"); 9345 /* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/createClass */ "./node_modules/@babel/runtime/helpers/esm/createClass.js"); 9346 /* harmony import */ var _babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/esm/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js"); 9347 /* harmony import */ var _babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/esm/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js"); 9348 /* harmony import */ var _babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inherits */ "./node_modules/@babel/runtime/helpers/esm/inherits.js"); 9349 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); 9350 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__); 9351 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! lodash */ "lodash"); 9352 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_7__); 9353 /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); 9354 /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_8__); 9355 /* harmony import */ var _wordpress_viewport__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @wordpress/viewport */ "@wordpress/viewport"); 9356 /* harmony import */ var _wordpress_viewport__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_wordpress_viewport__WEBPACK_IMPORTED_MODULE_9__); 9357 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); 9358 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_10__); 9359 /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks"); 9360 /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_11__); 9361 /* harmony import */ var _wordpress_is_shallow_equal__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @wordpress/is-shallow-equal */ "@wordpress/is-shallow-equal"); 9362 /* harmony import */ var _wordpress_is_shallow_equal__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(_wordpress_is_shallow_equal__WEBPACK_IMPORTED_MODULE_12__); 9363 /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose"); 9364 /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_13__); 9365 /* harmony import */ var _block_list__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../block-list */ "./node_modules/@wordpress/editor/build-module/components/block-list/index.js"); 9366 /* harmony import */ var _block_edit_context__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../block-edit/context */ "./node_modules/@wordpress/editor/build-module/components/block-edit/context.js"); 9367 9368 9369 9370 9371 9372 9373 9374 9375 /** 9376 * External dependencies 9377 */ 9378 9379 9380 /** 9381 * WordPress dependencies 9382 */ 9383 9384 9385 9386 9387 9388 9389 9390 /** 9391 * Internal dependencies 9392 */ 9393 9394 9395 9396 9397 var InnerBlocks = 9398 /*#__PURE__*/ 9399 function (_Component) { 9400 Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_5__["default"])(InnerBlocks, _Component); 9401 9402 function InnerBlocks() { 9403 var _this; 9404 9405 Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_1__["default"])(this, InnerBlocks); 9406 9407 _this = Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__["default"])(this, Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__["default"])(InnerBlocks).apply(this, arguments)); 9408 9409 _this.updateNestedSettings(); 9410 9411 return _this; 9412 } 9413 9414 Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_2__["default"])(InnerBlocks, [{ 9415 key: "getTemplateLock", 9416 value: function getTemplateLock() { 9417 var _this$props = this.props, 9418 templateLock = _this$props.templateLock, 9419 parentLock = _this$props.parentLock; 9420 return templateLock === undefined ? parentLock : templateLock; 9421 } 9422 }, { 9423 key: "componentDidMount", 9424 value: function componentDidMount() { 9425 var innerBlocks = this.props.block.innerBlocks; // only synchronize innerBlocks with template if innerBlocks are empty or a locking all exists 9426 9427 if (innerBlocks.length === 0 || this.getTemplateLock() === 'all') { 9428 return this.synchronizeBlocksWithTemplate(); 9429 } 9430 } 9431 }, { 9432 key: "componentDidUpdate", 9433 value: function componentDidUpdate(prevProps) { 9434 var _this$props2 = this.props, 9435 template = _this$props2.template, 9436 block = _this$props2.block; 9437 var innerBlocks = block.innerBlocks; 9438 this.updateNestedSettings(); // only synchronize innerBlocks with template if innerBlocks are empty or a locking all exists 9439 9440 if (innerBlocks.length === 0 || this.getTemplateLock() === 'all') { 9441 var hasTemplateChanged = !Object(lodash__WEBPACK_IMPORTED_MODULE_7__["isEqual"])(template, prevProps.template); 9442 9443 if (hasTemplateChanged) { 9444 this.synchronizeBlocksWithTemplate(); 9445 } 9446 } 9447 } 9448 /** 9449 * Called on mount or when a mismatch exists between the templates and 9450 * inner blocks, synchronizes inner blocks with the template, replacing 9451 * current blocks. 9452 */ 9453 9454 }, { 9455 key: "synchronizeBlocksWithTemplate", 9456 value: function synchronizeBlocksWithTemplate() { 9457 var _this$props3 = this.props, 9458 template = _this$props3.template, 9459 block = _this$props3.block, 9460 replaceInnerBlocks = _this$props3.replaceInnerBlocks; 9461 var innerBlocks = block.innerBlocks; // Synchronize with templates. If the next set differs, replace. 9462 9463 var nextBlocks = Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_11__["synchronizeBlocksWithTemplate"])(innerBlocks, template); 9464 9465 if (!Object(lodash__WEBPACK_IMPORTED_MODULE_7__["isEqual"])(nextBlocks, innerBlocks)) { 9466 replaceInnerBlocks(nextBlocks); 9467 } 9468 } 9469 }, { 9470 key: "updateNestedSettings", 9471 value: function updateNestedSettings() { 9472 var _this$props4 = this.props, 9473 blockListSettings = _this$props4.blockListSettings, 9474 allowedBlocks = _this$props4.allowedBlocks, 9475 updateNestedSettings = _this$props4.updateNestedSettings; 9476 var newSettings = { 9477 allowedBlocks: allowedBlocks, 9478 templateLock: this.getTemplateLock() 9479 }; 9480 9481 if (!_wordpress_is_shallow_equal__WEBPACK_IMPORTED_MODULE_12___default()(blockListSettings, newSettings)) { 9482 updateNestedSettings(newSettings); 9483 } 9484 } 9485 }, { 9486 key: "render", 9487 value: function render() { 9488 var _this$props5 = this.props, 9489 clientId = _this$props5.clientId, 9490 layouts = _this$props5.layouts, 9491 allowedBlocks = _this$props5.allowedBlocks, 9492 templateLock = _this$props5.templateLock, 9493 template = _this$props5.template, 9494 isSmallScreen = _this$props5.isSmallScreen, 9495 isSelectedBlockInRoot = _this$props5.isSelectedBlockInRoot; 9496 var classes = classnames__WEBPACK_IMPORTED_MODULE_8___default()('editor-inner-blocks', { 9497 'has-overlay': isSmallScreen && !isSelectedBlockInRoot 9498 }); 9499 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("div", { 9500 className: classes 9501 }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(_block_list__WEBPACK_IMPORTED_MODULE_14__["default"], Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({ 9502 rootClientId: clientId 9503 }, { 9504 layouts: layouts, 9505 allowedBlocks: allowedBlocks, 9506 templateLock: templateLock, 9507 template: template 9508 }))); 9509 } 9510 }]); 9511 9512 return InnerBlocks; 9513 }(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["Component"]); 9514 9515 InnerBlocks = Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_13__["compose"])([Object(_block_edit_context__WEBPACK_IMPORTED_MODULE_15__["withBlockEditContext"])(function (context) { 9516 return Object(lodash__WEBPACK_IMPORTED_MODULE_7__["pick"])(context, ['clientId']); 9517 }), Object(_wordpress_viewport__WEBPACK_IMPORTED_MODULE_9__["withViewportMatch"])({ 9518 isSmallScreen: '< medium' 9519 }), Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_10__["withSelect"])(function (select, ownProps) { 9520 var _select = select('core/editor'), 9521 isBlockSelected = _select.isBlockSelected, 9522 hasSelectedInnerBlock = _select.hasSelectedInnerBlock, 9523 getBlock = _select.getBlock, 9524 getBlockListSettings = _select.getBlockListSettings, 9525 getBlockRootClientId = _select.getBlockRootClientId, 9526 getTemplateLock = _select.getTemplateLock; 9527 9528 var clientId = ownProps.clientId; 9529 var parentClientId = getBlockRootClientId(clientId); 9530 return { 9531 isSelectedBlockInRoot: isBlockSelected(clientId) || hasSelectedInnerBlock(clientId), 9532 block: getBlock(clientId), 9533 blockListSettings: getBlockListSettings(clientId), 9534 parentLock: getTemplateLock(parentClientId) 9535 }; 9536 }), Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_10__["withDispatch"])(function (dispatch, ownProps) { 9537 var _dispatch = dispatch('core/editor'), 9538 replaceBlocks = _dispatch.replaceBlocks, 9539 insertBlocks = _dispatch.insertBlocks, 9540 updateBlockListSettings = _dispatch.updateBlockListSettings; 9541 9542 var block = ownProps.block, 9543 clientId = ownProps.clientId; 9544 return { 9545 replaceInnerBlocks: function replaceInnerBlocks(blocks) { 9546 var clientIds = Object(lodash__WEBPACK_IMPORTED_MODULE_7__["map"])(block.innerBlocks, 'clientId'); 9547 9548 if (clientIds.length) { 9549 replaceBlocks(clientIds, blocks); 9550 } else { 9551 insertBlocks(blocks, undefined, clientId); 9552 } 9553 }, 9554 updateNestedSettings: function updateNestedSettings(settings) { 9555 dispatch(updateBlockListSettings(clientId, settings)); 9556 } 9557 }; 9558 })])(InnerBlocks); 9559 InnerBlocks.Content = Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_11__["withBlockContentContext"])(function (_ref) { 9560 var BlockContent = _ref.BlockContent; 9561 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(BlockContent, null); 9562 }); 9563 /* harmony default export */ __webpack_exports__["default"] = (InnerBlocks); 9564 9565 9566 /***/ }), 9567 9568 /***/ "./node_modules/@wordpress/editor/build-module/components/inserter-with-shortcuts/index.js": 9569 /*!*************************************************************************************************!*\ 9570 !*** ./node_modules/@wordpress/editor/build-module/components/inserter-with-shortcuts/index.js ***! 9571 \*************************************************************************************************/ 9572 /*! exports provided: default */ 9573 /***/ (function(module, __webpack_exports__, __webpack_require__) { 9574 9575 "use strict"; 9576 __webpack_require__.r(__webpack_exports__); 9577 /* harmony import */ var _babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectSpread */ "./node_modules/@babel/runtime/helpers/esm/objectSpread.js"); 9578 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); 9579 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__); 9580 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! lodash */ "lodash"); 9581 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_2__); 9582 /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks"); 9583 /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_3__); 9584 /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose"); 9585 /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_4__); 9586 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); 9587 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_5__); 9588 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); 9589 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_6__); 9590 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); 9591 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_7__); 9592 /* harmony import */ var _block_icon__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../block-icon */ "./node_modules/@wordpress/editor/build-module/components/block-icon/index.js"); 9593 9594 9595 9596 /** 9597 * External dependencies 9598 */ 9599 9600 /** 9601 * WordPress dependencies 9602 */ 9603 9604 9605 9606 9607 9608 9609 /** 9610 * Internal dependencies 9611 */ 9612 9613 9614 9615 function InserterWithShortcuts(_ref) { 9616 var items = _ref.items, 9617 isLocked = _ref.isLocked, 9618 onInsert = _ref.onInsert; 9619 9620 if (isLocked) { 9621 return null; 9622 } 9623 9624 var itemsWithoutDefaultBlock = Object(lodash__WEBPACK_IMPORTED_MODULE_2__["filter"])(items, function (item) { 9625 return !item.isDisabled && (item.name !== Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_3__["getDefaultBlockName"])() || !Object(lodash__WEBPACK_IMPORTED_MODULE_2__["isEmpty"])(item.initialAttributes)); 9626 }).slice(0, 3); 9627 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])("div", { 9628 className: "editor-inserter-with-shortcuts" 9629 }, itemsWithoutDefaultBlock.map(function (item) { 9630 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_5__["IconButton"], { 9631 key: item.id, 9632 className: "editor-inserter-with-shortcuts__block", 9633 onClick: function onClick() { 9634 return onInsert(item); 9635 } // translators: %s: block title/name to be added 9636 , 9637 label: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_6__["sprintf"])(Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_6__["__"])('Add %s'), item.title), 9638 icon: Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])(_block_icon__WEBPACK_IMPORTED_MODULE_8__["default"], { 9639 icon: item.icon && item.icon.src 9640 }) 9641 }); 9642 })); 9643 } 9644 9645 /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_4__["compose"])(Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_7__["withSelect"])(function (select, _ref2) { 9646 var rootClientId = _ref2.rootClientId; 9647 9648 var _select = select('core/editor'), 9649 getInserterItems = _select.getInserterItems, 9650 getTemplateLock = _select.getTemplateLock; 9651 9652 return { 9653 items: getInserterItems(rootClientId), 9654 isLocked: !!getTemplateLock(rootClientId) 9655 }; 9656 }), Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_7__["withDispatch"])(function (dispatch, ownProps) { 9657 var clientId = ownProps.clientId, 9658 rootClientId = ownProps.rootClientId, 9659 layout = ownProps.layout; 9660 return { 9661 onInsert: function onInsert(_ref3) { 9662 var name = _ref3.name, 9663 initialAttributes = _ref3.initialAttributes; 9664 var block = Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_3__["createBlock"])(name, Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_0__["default"])({}, initialAttributes, { 9665 layout: layout 9666 })); 9667 9668 if (clientId) { 9669 dispatch('core/editor').replaceBlocks(clientId, block); 9670 } else { 9671 dispatch('core/editor').insertBlock(block, undefined, rootClientId); 9672 } 9673 } 9674 }; 9675 }))(InserterWithShortcuts)); 9676 9677 9678 /***/ }), 9679 9680 /***/ "./node_modules/@wordpress/editor/build-module/components/inserter/child-blocks.js": 9681 /*!*****************************************************************************************!*\ 9682 !*** ./node_modules/@wordpress/editor/build-module/components/inserter/child-blocks.js ***! 9683 \*****************************************************************************************/ 9684 /*! exports provided: default */ 9685 /***/ (function(module, __webpack_exports__, __webpack_require__) { 9686 9687 "use strict"; 9688 __webpack_require__.r(__webpack_exports__); 9689 /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js"); 9690 /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutProperties */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js"); 9691 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); 9692 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__); 9693 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); 9694 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_3__); 9695 /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose"); 9696 /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_4__); 9697 /* harmony import */ var _block_types_list__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../block-types-list */ "./node_modules/@wordpress/editor/build-module/components/block-types-list/index.js"); 9698 /* harmony import */ var _block_icon__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../block-icon */ "./node_modules/@wordpress/editor/build-module/components/block-icon/index.js"); 9699 9700 9701 9702 9703 /** 9704 * WordPress dependencies 9705 */ 9706 9707 9708 /** 9709 * Internal dependencies 9710 */ 9711 9712 9713 9714 9715 function ChildBlocks(_ref) { 9716 var rootBlockIcon = _ref.rootBlockIcon, 9717 rootBlockTitle = _ref.rootBlockTitle, 9718 items = _ref.items, 9719 props = Object(_babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__["default"])(_ref, ["rootBlockIcon", "rootBlockTitle", "items"]); 9720 9721 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["createElement"])("div", { 9722 className: "editor-inserter__child-blocks" 9723 }, (rootBlockIcon || rootBlockTitle) && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["createElement"])("div", { 9724 className: "editor-inserter__parent-block-header" 9725 }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["createElement"])(_block_icon__WEBPACK_IMPORTED_MODULE_6__["default"], { 9726 icon: rootBlockIcon, 9727 showColors: true 9728 }), rootBlockTitle && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["createElement"])("h2", null, rootBlockTitle)), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["createElement"])(_block_types_list__WEBPACK_IMPORTED_MODULE_5__["default"], Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({ 9729 items: items 9730 }, props))); 9731 } 9732 9733 /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_4__["compose"])(Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_4__["ifCondition"])(function (_ref2) { 9734 var items = _ref2.items; 9735 return items && items.length > 0; 9736 }), Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_3__["withSelect"])(function (select, _ref3) { 9737 var rootClientId = _ref3.rootClientId; 9738 9739 var _select = select('core/blocks'), 9740 getBlockType = _select.getBlockType; 9741 9742 var _select2 = select('core/editor'), 9743 getBlockName = _select2.getBlockName; 9744 9745 var rootBlockName = getBlockName(rootClientId); 9746 var rootBlockType = getBlockType(rootBlockName); 9747 return { 9748 rootBlockTitle: rootBlockType && rootBlockType.title, 9749 rootBlockIcon: rootBlockType && rootBlockType.icon 9750 }; 9751 }))(ChildBlocks)); 9752 9753 9754 /***/ }), 9755 9756 /***/ "./node_modules/@wordpress/editor/build-module/components/inserter/index.js": 9757 /*!**********************************************************************************!*\ 9758 !*** ./node_modules/@wordpress/editor/build-module/components/inserter/index.js ***! 9759 \**********************************************************************************/ 9760 /*! exports provided: InserterResultsPortal, default */ 9761 /***/ (function(module, __webpack_exports__, __webpack_require__) { 9762 9763 "use strict"; 9764 __webpack_require__.r(__webpack_exports__); 9765 /* harmony import */ var _babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectSpread */ "./node_modules/@babel/runtime/helpers/esm/objectSpread.js"); 9766 /* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/classCallCheck */ "./node_modules/@babel/runtime/helpers/esm/classCallCheck.js"); 9767 /* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/createClass */ "./node_modules/@babel/runtime/helpers/esm/createClass.js"); 9768 /* harmony import */ var _babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/esm/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js"); 9769 /* harmony import */ var _babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/esm/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js"); 9770 /* harmony import */ var _babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inherits */ "./node_modules/@babel/runtime/helpers/esm/inherits.js"); 9771 /* harmony import */ var _babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @babel/runtime/helpers/esm/assertThisInitialized */ "./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js"); 9772 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); 9773 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__); 9774 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); 9775 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_8__); 9776 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); 9777 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_9__); 9778 /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks"); 9779 /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_10__); 9780 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); 9781 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_11__); 9782 /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose"); 9783 /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_12__); 9784 /* harmony import */ var _menu__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./menu */ "./node_modules/@wordpress/editor/build-module/components/inserter/menu.js"); 9785 /* harmony import */ var _results_portal__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./results-portal */ "./node_modules/@wordpress/editor/build-module/components/inserter/results-portal.js"); 9786 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "InserterResultsPortal", function() { return _results_portal__WEBPACK_IMPORTED_MODULE_14__["default"]; }); 9787 9788 9789 9790 9791 9792 9793 9794 9795 9796 9797 /** 9798 * WordPress dependencies 9799 */ 9800 9801 9802 9803 9804 9805 9806 /** 9807 * Internal dependencies 9808 */ 9809 9810 9811 9812 9813 var defaultRenderToggle = function defaultRenderToggle(_ref) { 9814 var onToggle = _ref.onToggle, 9815 disabled = _ref.disabled, 9816 isOpen = _ref.isOpen; 9817 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_9__["IconButton"], { 9818 icon: "insert", 9819 label: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_8__["__"])('Add block'), 9820 onClick: onToggle, 9821 className: "editor-inserter__toggle", 9822 "aria-haspopup": "true", 9823 "aria-expanded": isOpen, 9824 disabled: disabled 9825 }); 9826 }; 9827 9828 var Inserter = 9829 /*#__PURE__*/ 9830 function (_Component) { 9831 Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_5__["default"])(Inserter, _Component); 9832 9833 function Inserter() { 9834 var _this; 9835 9836 Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_1__["default"])(this, Inserter); 9837 9838 _this = Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__["default"])(this, Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__["default"])(Inserter).apply(this, arguments)); 9839 _this.onToggle = _this.onToggle.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["default"])(_this))); 9840 return _this; 9841 } 9842 9843 Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_2__["default"])(Inserter, [{ 9844 key: "onToggle", 9845 value: function onToggle(isOpen) { 9846 var onToggle = this.props.onToggle; // Surface toggle callback to parent component 9847 9848 if (onToggle) { 9849 onToggle(isOpen); 9850 } 9851 } 9852 }, { 9853 key: "render", 9854 value: function render() { 9855 var _this$props = this.props, 9856 items = _this$props.items, 9857 position = _this$props.position, 9858 title = _this$props.title, 9859 onInsertBlock = _this$props.onInsertBlock, 9860 rootClientId = _this$props.rootClientId, 9861 disabled = _this$props.disabled, 9862 _this$props$renderTog = _this$props.renderToggle, 9863 _renderToggle = _this$props$renderTog === void 0 ? defaultRenderToggle : _this$props$renderTog; 9864 9865 if (items.length === 0) { 9866 return null; 9867 } 9868 9869 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_9__["Dropdown"], { 9870 className: "editor-inserter", 9871 contentClassName: "editor-inserter__popover", 9872 position: position, 9873 onToggle: this.onToggle, 9874 expandOnMobile: true, 9875 headerTitle: title, 9876 renderToggle: function renderToggle(_ref2) { 9877 var onToggle = _ref2.onToggle, 9878 isOpen = _ref2.isOpen; 9879 return _renderToggle({ 9880 onToggle: onToggle, 9881 isOpen: isOpen, 9882 disabled: disabled 9883 }); 9884 }, 9885 renderContent: function renderContent(_ref3) { 9886 var onClose = _ref3.onClose; 9887 9888 var onSelect = function onSelect(item) { 9889 onInsertBlock(item); 9890 onClose(); 9891 }; 9892 9893 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["createElement"])(_menu__WEBPACK_IMPORTED_MODULE_13__["default"], { 9894 items: items, 9895 onSelect: onSelect, 9896 rootClientId: rootClientId 9897 }); 9898 } 9899 }); 9900 } 9901 }]); 9902 9903 return Inserter; 9904 }(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["Component"]); 9905 9906 /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_12__["compose"])([Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_11__["withSelect"])(function (select, _ref4) { 9907 var rootClientId = _ref4.rootClientId, 9908 layout = _ref4.layout; 9909 9910 var _select = select('core/editor'), 9911 getEditedPostAttribute = _select.getEditedPostAttribute, 9912 getBlockInsertionPoint = _select.getBlockInsertionPoint, 9913 getSelectedBlock = _select.getSelectedBlock, 9914 getInserterItems = _select.getInserterItems, 9915 getBlockOrder = _select.getBlockOrder; 9916 9917 var insertionPoint = getBlockInsertionPoint(); 9918 var parentId = rootClientId || insertionPoint.rootClientId; 9919 return { 9920 title: getEditedPostAttribute('title'), 9921 insertionPoint: { 9922 rootClientId: parentId, 9923 layout: rootClientId ? layout : insertionPoint.layout, 9924 index: rootClientId ? getBlockOrder(rootClientId).length : insertionPoint.index 9925 }, 9926 selectedBlock: getSelectedBlock(), 9927 items: getInserterItems(parentId), 9928 rootClientId: parentId 9929 }; 9930 }), Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_11__["withDispatch"])(function (dispatch, ownProps) { 9931 return { 9932 onInsertBlock: function onInsertBlock(item) { 9933 var selectedBlock = ownProps.selectedBlock, 9934 insertionPoint = ownProps.insertionPoint; 9935 var index = insertionPoint.index, 9936 rootClientId = insertionPoint.rootClientId, 9937 layout = insertionPoint.layout; 9938 var name = item.name, 9939 initialAttributes = item.initialAttributes; 9940 var insertedBlock = Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_10__["createBlock"])(name, Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_0__["default"])({}, initialAttributes, { 9941 layout: layout 9942 })); 9943 9944 if (selectedBlock && Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_10__["isUnmodifiedDefaultBlock"])(selectedBlock)) { 9945 return dispatch('core/editor').replaceBlocks(selectedBlock.clientId, insertedBlock); 9946 } 9947 9948 return dispatch('core/editor').insertBlock(insertedBlock, index, rootClientId); 9949 } 9950 }; 9951 })])(Inserter)); 9952 9953 9954 /***/ }), 9955 9956 /***/ "./node_modules/@wordpress/editor/build-module/components/inserter/menu.js": 9957 /*!*********************************************************************************!*\ 9958 !*** ./node_modules/@wordpress/editor/build-module/components/inserter/menu.js ***! 9959 \*********************************************************************************/ 9960 /*! exports provided: searchItems, normalizeTerm, InserterMenu, default */ 9961 /***/ (function(module, __webpack_exports__, __webpack_require__) { 9962 9963 "use strict"; 9964 __webpack_require__.r(__webpack_exports__); 9965 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "searchItems", function() { return searchItems; }); 9966 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "normalizeTerm", function() { return normalizeTerm; }); 9967 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "InserterMenu", function() { return InserterMenu; }); 9968 /* harmony import */ var _babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/toConsumableArray */ "./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js"); 9969 /* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/classCallCheck */ "./node_modules/@babel/runtime/helpers/esm/classCallCheck.js"); 9970 /* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/createClass */ "./node_modules/@babel/runtime/helpers/esm/createClass.js"); 9971 /* harmony import */ var _babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/esm/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js"); 9972 /* harmony import */ var _babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/esm/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js"); 9973 /* harmony import */ var _babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inherits */ "./node_modules/@babel/runtime/helpers/esm/inherits.js"); 9974 /* harmony import */ var _babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @babel/runtime/helpers/esm/assertThisInitialized */ "./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js"); 9975 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); 9976 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__); 9977 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! lodash */ "lodash"); 9978 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_8__); 9979 /* harmony import */ var dom_scroll_into_view__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! dom-scroll-into-view */ "./node_modules/dom-scroll-into-view/lib/index.js"); 9980 /* harmony import */ var dom_scroll_into_view__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(dom_scroll_into_view__WEBPACK_IMPORTED_MODULE_9__); 9981 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); 9982 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_10__); 9983 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); 9984 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_11__); 9985 /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks"); 9986 /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_12__); 9987 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); 9988 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_13__); 9989 /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose"); 9990 /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_14___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_14__); 9991 /* harmony import */ var _block_preview__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../block-preview */ "./node_modules/@wordpress/editor/build-module/components/block-preview/index.js"); 9992 /* harmony import */ var _block_types_list__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ../block-types-list */ "./node_modules/@wordpress/editor/build-module/components/block-types-list/index.js"); 9993 /* harmony import */ var _child_blocks__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./child-blocks */ "./node_modules/@wordpress/editor/build-module/components/inserter/child-blocks.js"); 9994 /* harmony import */ var _results_portal__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./results-portal */ "./node_modules/@wordpress/editor/build-module/components/inserter/results-portal.js"); 9995 9996 9997 9998 9999 10000 10001 10002 10003 10004 /** 10005 * External dependencies 10006 */ 10007 10008 10009 /** 10010 * WordPress dependencies 10011 */ 10012 10013 10014 10015 10016 10017 10018 10019 /** 10020 * Internal dependencies 10021 */ 10022 10023 10024 10025 10026 10027 var MAX_SUGGESTED_ITEMS = 9; 10028 /** 10029 * Filters an item list given a search term. 10030 * 10031 * @param {Array} items Item list 10032 * @param {string} searchTerm Search term. 10033 * 10034 * @return {Array} Filtered item list. 10035 */ 10036 10037 var searchItems = function searchItems(items, searchTerm) { 10038 var normalizedSearchTerm = normalizeTerm(searchTerm); 10039 10040 var matchSearch = function matchSearch(string) { 10041 return normalizeTerm(string).indexOf(normalizedSearchTerm) !== -1; 10042 }; 10043 10044 return items.filter(function (item) { 10045 return matchSearch(item.title) || Object(lodash__WEBPACK_IMPORTED_MODULE_8__["some"])(item.keywords, matchSearch); 10046 }); 10047 }; 10048 /** 10049 * Converts the search term into a normalized term. 10050 * 10051 * @param {string} term The search term to normalize. 10052 * 10053 * @return {string} The normalized search term. 10054 */ 10055 10056 var normalizeTerm = function normalizeTerm(term) { 10057 // Disregard diacritics. 10058 // Input: "média" 10059 term = Object(lodash__WEBPACK_IMPORTED_MODULE_8__["deburr"])(term); // Accommodate leading slash, matching autocomplete expectations. 10060 // Input: "/media" 10061 10062 term = term.replace(/^\//, ''); // Lowercase. 10063 // Input: "MEDIA" 10064 10065 term = term.toLowerCase(); // Strip leading and trailing whitespace. 10066 // Input: " media " 10067 10068 term = term.trim(); 10069 return term; 10070 }; 10071 var InserterMenu = 10072 /*#__PURE__*/ 10073 function (_Component) { 10074 Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_5__["default"])(InserterMenu, _Component); 10075 10076 function InserterMenu() { 10077 var _this; 10078 10079 Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_1__["default"])(this, InserterMenu); 10080 10081 _this = Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__["default"])(this, Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__["default"])(InserterMenu).apply(this, arguments)); 10082 _this.state = { 10083 childItems: [], 10084 filterValue: '', 10085 hoveredItem: null, 10086 suggestedItems: [], 10087 reusableItems: [], 10088 itemsPerCategory: {}, 10089 openPanels: ['suggested'] 10090 }; 10091 _this.onChangeSearchInput = _this.onChangeSearchInput.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["default"])(_this))); 10092 _this.onHover = _this.onHover.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["default"])(_this))); 10093 _this.panels = {}; 10094 _this.inserterResults = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["createRef"])(); 10095 return _this; 10096 } 10097 10098 Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_2__["default"])(InserterMenu, [{ 10099 key: "componentDidMount", 10100 value: function componentDidMount() { 10101 // This could be replaced by a resolver. 10102 this.props.fetchReusableBlocks(); 10103 this.filter(); 10104 } 10105 }, { 10106 key: "componentDidUpdate", 10107 value: function componentDidUpdate(prevProps) { 10108 if (prevProps.items !== this.props.items) { 10109 this.filter(this.state.filterValue); 10110 } 10111 } 10112 }, { 10113 key: "onChangeSearchInput", 10114 value: function onChangeSearchInput(event) { 10115 this.filter(event.target.value); 10116 } 10117 }, { 10118 key: "onHover", 10119 value: function onHover(item) { 10120 this.setState({ 10121 hoveredItem: item 10122 }); 10123 10124 if (item) { 10125 this.props.showInsertionPoint(); 10126 } else { 10127 this.props.hideInsertionPoint(); 10128 } 10129 } 10130 }, { 10131 key: "bindPanel", 10132 value: function bindPanel(name) { 10133 var _this2 = this; 10134 10135 return function (ref) { 10136 _this2.panels[name] = ref; 10137 }; 10138 } 10139 }, { 10140 key: "onTogglePanel", 10141 value: function onTogglePanel(panel) { 10142 var _this3 = this; 10143 10144 return function () { 10145 var isOpened = _this3.state.openPanels.indexOf(panel) !== -1; 10146 10147 if (isOpened) { 10148 _this3.setState({ 10149 openPanels: Object(lodash__WEBPACK_IMPORTED_MODULE_8__["without"])(_this3.state.openPanels, panel) 10150 }); 10151 } else { 10152 _this3.setState({ 10153 openPanels: Object(_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_0__["default"])(_this3.state.openPanels).concat([panel]) 10154 }); 10155 10156 _this3.props.setTimeout(function () { 10157 // We need a generic way to access the panel's container 10158 // eslint-disable-next-line react/no-find-dom-node 10159 dom_scroll_into_view__WEBPACK_IMPORTED_MODULE_9___default()(Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["findDOMNode"])(_this3.panels[panel]), _this3.inserterResults.current, { 10160 alignWithTop: true 10161 }); 10162 }); 10163 } 10164 }; 10165 } 10166 }, { 10167 key: "filter", 10168 value: function filter() { 10169 var filterValue = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ''; 10170 var _this$props = this.props, 10171 items = _this$props.items, 10172 rootChildBlocks = _this$props.rootChildBlocks; 10173 var filteredItems = searchItems(items, filterValue); 10174 10175 var childItems = Object(lodash__WEBPACK_IMPORTED_MODULE_8__["filter"])(filteredItems, function (_ref) { 10176 var name = _ref.name; 10177 return Object(lodash__WEBPACK_IMPORTED_MODULE_8__["includes"])(rootChildBlocks, name); 10178 }); 10179 10180 var suggestedItems = []; 10181 10182 if (!filterValue) { 10183 var maxSuggestedItems = this.props.maxSuggestedItems || MAX_SUGGESTED_ITEMS; 10184 suggestedItems = Object(lodash__WEBPACK_IMPORTED_MODULE_8__["filter"])(items, function (item) { 10185 return item.utility > 0; 10186 }).slice(0, maxSuggestedItems); 10187 } 10188 10189 var reusableItems = Object(lodash__WEBPACK_IMPORTED_MODULE_8__["filter"])(filteredItems, { 10190 category: 'reusable' 10191 }); 10192 10193 var getCategoryIndex = function getCategoryIndex(item) { 10194 return Object(lodash__WEBPACK_IMPORTED_MODULE_8__["findIndex"])(Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_12__["getCategories"])(), function (category) { 10195 return category.slug === item.category; 10196 }); 10197 }; 10198 10199 var itemsPerCategory = Object(lodash__WEBPACK_IMPORTED_MODULE_8__["flow"])(function (itemList) { 10200 return Object(lodash__WEBPACK_IMPORTED_MODULE_8__["filter"])(itemList, function (item) { 10201 return item.category !== 'reusable'; 10202 }); 10203 }, function (itemList) { 10204 return Object(lodash__WEBPACK_IMPORTED_MODULE_8__["sortBy"])(itemList, getCategoryIndex); 10205 }, function (itemList) { 10206 return Object(lodash__WEBPACK_IMPORTED_MODULE_8__["groupBy"])(itemList, 'category'); 10207 })(filteredItems); 10208 var openPanels = this.state.openPanels; 10209 10210 if (filterValue !== this.state.filterValue) { 10211 if (!filterValue) { 10212 openPanels = ['suggested']; 10213 } else if (reusableItems.length) { 10214 openPanels = ['reusable']; 10215 } else if (filteredItems.length) { 10216 var firstCategory = Object(lodash__WEBPACK_IMPORTED_MODULE_8__["find"])(Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_12__["getCategories"])(), function (_ref2) { 10217 var slug = _ref2.slug; 10218 return itemsPerCategory[slug] && itemsPerCategory[slug].length; 10219 }); 10220 openPanels = [firstCategory.slug]; 10221 } 10222 } 10223 10224 this.setState({ 10225 hoveredItem: null, 10226 childItems: childItems, 10227 filterValue: filterValue, 10228 suggestedItems: suggestedItems, 10229 reusableItems: reusableItems, 10230 itemsPerCategory: itemsPerCategory, 10231 openPanels: openPanels 10232 }); 10233 } 10234 }, { 10235 key: "render", 10236 value: function render() { 10237 var _this4 = this; 10238 10239 var _this$props2 = this.props, 10240 instanceId = _this$props2.instanceId, 10241 onSelect = _this$props2.onSelect, 10242 rootClientId = _this$props2.rootClientId; 10243 var _this$state = this.state, 10244 childItems = _this$state.childItems, 10245 filterValue = _this$state.filterValue, 10246 hoveredItem = _this$state.hoveredItem, 10247 suggestedItems = _this$state.suggestedItems, 10248 reusableItems = _this$state.reusableItems, 10249 itemsPerCategory = _this$state.itemsPerCategory, 10250 openPanels = _this$state.openPanels; 10251 10252 var isPanelOpen = function isPanelOpen(panel) { 10253 return openPanels.indexOf(panel) !== -1; 10254 }; 10255 10256 var isSearching = !!filterValue; // Disable reason: The inserter menu is a modal display, not one which 10257 // is always visible, and one which already incurs this behavior of 10258 // autoFocus via Popover's focusOnMount. 10259 10260 /* eslint-disable jsx-a11y/no-autofocus */ 10261 10262 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["createElement"])("div", { 10263 className: "editor-inserter__menu" 10264 }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["createElement"])("label", { 10265 htmlFor: "editor-inserter__search-".concat(instanceId), 10266 className: "screen-reader-text" 10267 }, Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_10__["__"])('Search for a block')), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["createElement"])("input", { 10268 id: "editor-inserter__search-".concat(instanceId), 10269 type: "search", 10270 placeholder: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_10__["__"])('Search for a block'), 10271 className: "editor-inserter__search", 10272 autoFocus: true, 10273 onChange: this.onChangeSearchInput 10274 }), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["createElement"])("div", { 10275 className: "editor-inserter__results", 10276 ref: this.inserterResults, 10277 tabIndex: "0", 10278 role: "region", 10279 "aria-label": Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_10__["__"])('Available block types') 10280 }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["createElement"])(_child_blocks__WEBPACK_IMPORTED_MODULE_17__["default"], { 10281 rootClientId: rootClientId, 10282 items: childItems, 10283 onSelect: onSelect, 10284 onHover: this.onHover 10285 }), !!suggestedItems.length && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_11__["PanelBody"], { 10286 title: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_10__["__"])('Most Used'), 10287 opened: isPanelOpen('suggested'), 10288 onToggle: this.onTogglePanel('suggested'), 10289 ref: this.bindPanel('suggested') 10290 }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["createElement"])(_block_types_list__WEBPACK_IMPORTED_MODULE_16__["default"], { 10291 items: suggestedItems, 10292 onSelect: onSelect, 10293 onHover: this.onHover 10294 })), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["createElement"])(_results_portal__WEBPACK_IMPORTED_MODULE_18__["default"].Slot, { 10295 fillProps: { 10296 filterValue: filterValue 10297 } 10298 }), Object(lodash__WEBPACK_IMPORTED_MODULE_8__["map"])(Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_12__["getCategories"])(), function (category) { 10299 var categoryItems = itemsPerCategory[category.slug]; 10300 10301 if (!categoryItems || !categoryItems.length) { 10302 return null; 10303 } 10304 10305 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_11__["PanelBody"], { 10306 key: category.slug, 10307 title: category.title, 10308 opened: isSearching || isPanelOpen(category.slug), 10309 onToggle: _this4.onTogglePanel(category.slug), 10310 ref: _this4.bindPanel(category.slug) 10311 }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["createElement"])(_block_types_list__WEBPACK_IMPORTED_MODULE_16__["default"], { 10312 items: categoryItems, 10313 onSelect: onSelect, 10314 onHover: _this4.onHover 10315 })); 10316 }), !!reusableItems.length && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_11__["PanelBody"], { 10317 className: "editor-inserter__reusable-blocks-panel", 10318 title: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_10__["__"])('Reusable'), 10319 opened: isPanelOpen('reusable'), 10320 onToggle: this.onTogglePanel('reusable'), 10321 icon: "controls-repeat", 10322 ref: this.bindPanel('reusable') 10323 }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["createElement"])(_block_types_list__WEBPACK_IMPORTED_MODULE_16__["default"], { 10324 items: reusableItems, 10325 onSelect: onSelect, 10326 onHover: this.onHover 10327 }), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["createElement"])("a", { 10328 className: "editor-inserter__manage-reusable-blocks", 10329 href: "edit.php?post_type=wp_block" 10330 }, Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_10__["__"])('Manage All Reusable Blocks'))), Object(lodash__WEBPACK_IMPORTED_MODULE_8__["isEmpty"])(suggestedItems) && Object(lodash__WEBPACK_IMPORTED_MODULE_8__["isEmpty"])(reusableItems) && Object(lodash__WEBPACK_IMPORTED_MODULE_8__["isEmpty"])(itemsPerCategory) && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["createElement"])("p", { 10331 className: "editor-inserter__no-results" 10332 }, Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_10__["__"])('No blocks found.'))), hoveredItem && Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_12__["isReusableBlock"])(hoveredItem) && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["createElement"])(_block_preview__WEBPACK_IMPORTED_MODULE_15__["default"], { 10333 name: hoveredItem.name, 10334 attributes: hoveredItem.initialAttributes 10335 })); 10336 /* eslint-enable jsx-a11y/no-autofocus */ 10337 } 10338 }]); 10339 10340 return InserterMenu; 10341 }(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["Component"]); 10342 /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_14__["compose"])(Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_13__["withSelect"])(function (select, _ref3) { 10343 var rootClientId = _ref3.rootClientId; 10344 10345 var _select = select('core/blocks'), 10346 getChildBlockNames = _select.getChildBlockNames; 10347 10348 var _select2 = select('core/editor'), 10349 getBlockName = _select2.getBlockName; 10350 10351 var rootBlockName = getBlockName(rootClientId); 10352 return { 10353 rootChildBlocks: getChildBlockNames(rootBlockName) 10354 }; 10355 }), Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_13__["withDispatch"])(function (dispatch) { 10356 return { 10357 fetchReusableBlocks: dispatch('core/editor').fetchReusableBlocks, 10358 showInsertionPoint: dispatch('core/editor').showInsertionPoint, 10359 hideInsertionPoint: dispatch('core/editor').hideInsertionPoint 10360 }; 10361 }), _wordpress_components__WEBPACK_IMPORTED_MODULE_11__["withSpokenMessages"], _wordpress_compose__WEBPACK_IMPORTED_MODULE_14__["withInstanceId"], _wordpress_compose__WEBPACK_IMPORTED_MODULE_14__["withSafeTimeout"])(InserterMenu)); 10362 10363 10364 /***/ }), 10365 10366 /***/ "./node_modules/@wordpress/editor/build-module/components/inserter/results-portal.js": 10367 /*!*******************************************************************************************!*\ 10368 !*** ./node_modules/@wordpress/editor/build-module/components/inserter/results-portal.js ***! 10369 \*******************************************************************************************/ 10370 /*! exports provided: default */ 10371 /***/ (function(module, __webpack_exports__, __webpack_require__) { 10372 10373 "use strict"; 10374 __webpack_require__.r(__webpack_exports__); 10375 /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js"); 10376 /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutProperties */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js"); 10377 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); 10378 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__); 10379 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); 10380 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__); 10381 /* harmony import */ var _block_types_list__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../block-types-list */ "./node_modules/@wordpress/editor/build-module/components/block-types-list/index.js"); 10382 /* harmony import */ var _menu__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./menu */ "./node_modules/@wordpress/editor/build-module/components/inserter/menu.js"); 10383 10384 10385 10386 10387 /** 10388 * WordPress dependencies 10389 */ 10390 10391 /** 10392 * Internal dependencies 10393 */ 10394 10395 10396 10397 10398 var _createSlotFill = Object(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__["createSlotFill"])('InserterResultsPortal'), 10399 Fill = _createSlotFill.Fill, 10400 Slot = _createSlotFill.Slot; 10401 10402 var InserterResultsPortal = function InserterResultsPortal(_ref) { 10403 var items = _ref.items, 10404 title = _ref.title, 10405 onSelect = _ref.onSelect, 10406 onHover = _ref.onHover, 10407 props = Object(_babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__["default"])(_ref, ["items", "title", "onSelect", "onHover"]); 10408 10409 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["createElement"])(Fill, null, function (_ref2) { 10410 var filterValue = _ref2.filterValue; 10411 var filteredItems = Object(_menu__WEBPACK_IMPORTED_MODULE_5__["searchItems"])(items, filterValue); 10412 10413 if (!filteredItems.length) { 10414 return null; 10415 } 10416 10417 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__["PanelBody"], Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({ 10418 title: title 10419 }, props, { 10420 className: "editor-inserter__results-portal" 10421 }), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["createElement"])(_block_types_list__WEBPACK_IMPORTED_MODULE_4__["default"], { 10422 items: filteredItems, 10423 onSelect: onSelect, 10424 onHover: onHover 10425 })); 10426 }); 10427 }; 10428 10429 InserterResultsPortal.Slot = Slot; 10430 /* harmony default export */ __webpack_exports__["default"] = (InserterResultsPortal); 10431 10432 10433 /***/ }), 10434 10435 /***/ "./node_modules/@wordpress/editor/build-module/components/inspector-advanced-controls/index.js": 10436 /*!*****************************************************************************************************!*\ 10437 !*** ./node_modules/@wordpress/editor/build-module/components/inspector-advanced-controls/index.js ***! 10438 \*****************************************************************************************************/ 10439 /*! exports provided: default */ 10440 /***/ (function(module, __webpack_exports__, __webpack_require__) { 10441 10442 "use strict"; 10443 __webpack_require__.r(__webpack_exports__); 10444 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); 10445 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__); 10446 /* harmony import */ var _block_edit_context__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../block-edit/context */ "./node_modules/@wordpress/editor/build-module/components/block-edit/context.js"); 10447 /** 10448 * WordPress dependencies 10449 */ 10450 10451 /** 10452 * Internal dependencies 10453 */ 10454 10455 10456 10457 var _createSlotFill = Object(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__["createSlotFill"])('InspectorAdvancedControls'), 10458 Fill = _createSlotFill.Fill, 10459 Slot = _createSlotFill.Slot; 10460 10461 var InspectorAdvancedControls = Object(_block_edit_context__WEBPACK_IMPORTED_MODULE_1__["ifBlockEditSelected"])(Fill); 10462 InspectorAdvancedControls.Slot = Slot; 10463 /* harmony default export */ __webpack_exports__["default"] = (InspectorAdvancedControls); 10464 10465 10466 /***/ }), 10467 10468 /***/ "./node_modules/@wordpress/editor/build-module/components/inspector-controls/index.js": 10469 /*!********************************************************************************************!*\ 10470 !*** ./node_modules/@wordpress/editor/build-module/components/inspector-controls/index.js ***! 10471 \********************************************************************************************/ 10472 /*! exports provided: default */ 10473 /***/ (function(module, __webpack_exports__, __webpack_require__) { 10474 10475 "use strict"; 10476 __webpack_require__.r(__webpack_exports__); 10477 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); 10478 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__); 10479 /* harmony import */ var _block_edit_context__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../block-edit/context */ "./node_modules/@wordpress/editor/build-module/components/block-edit/context.js"); 10480 /** 10481 * WordPress dependencies 10482 */ 10483 10484 /** 10485 * Internal dependencies 10486 */ 10487 10488 10489 10490 var _createSlotFill = Object(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__["createSlotFill"])('InspectorControls'), 10491 Fill = _createSlotFill.Fill, 10492 Slot = _createSlotFill.Slot; 10493 10494 var InspectorControls = Object(_block_edit_context__WEBPACK_IMPORTED_MODULE_1__["ifBlockEditSelected"])(Fill); 10495 InspectorControls.Slot = Slot; 10496 /* harmony default export */ __webpack_exports__["default"] = (InspectorControls); 10497 10498 10499 /***/ }), 10500 10501 /***/ "./node_modules/@wordpress/editor/build-module/components/media-placeholder/index.js": 10502 /*!*******************************************************************************************!*\ 10503 !*** ./node_modules/@wordpress/editor/build-module/components/media-placeholder/index.js ***! 10504 \*******************************************************************************************/ 10505 /*! exports provided: default */ 10506 /***/ (function(module, __webpack_exports__, __webpack_require__) { 10507 10508 "use strict"; 10509 __webpack_require__.r(__webpack_exports__); 10510 /* harmony import */ var _babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/slicedToArray */ "./node_modules/@babel/runtime/helpers/esm/slicedToArray.js"); 10511 /* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/classCallCheck */ "./node_modules/@babel/runtime/helpers/esm/classCallCheck.js"); 10512 /* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/createClass */ "./node_modules/@babel/runtime/helpers/esm/createClass.js"); 10513 /* harmony import */ var _babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/esm/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js"); 10514 /* harmony import */ var _babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/esm/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js"); 10515 /* harmony import */ var _babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inherits */ "./node_modules/@babel/runtime/helpers/esm/inherits.js"); 10516 /* harmony import */ var _babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @babel/runtime/helpers/esm/assertThisInitialized */ "./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js"); 10517 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); 10518 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__); 10519 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! lodash */ "lodash"); 10520 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_8__); 10521 /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); 10522 /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_9__); 10523 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); 10524 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_10__); 10525 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); 10526 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_11__); 10527 /* harmony import */ var _wordpress_deprecated__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @wordpress/deprecated */ "@wordpress/deprecated"); 10528 /* harmony import */ var _wordpress_deprecated__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(_wordpress_deprecated__WEBPACK_IMPORTED_MODULE_12__); 10529 /* harmony import */ var _media_upload__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../media-upload */ "./node_modules/@wordpress/editor/build-module/components/media-upload/index.js"); 10530 /* harmony import */ var _utils___WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../../utils/ */ "./node_modules/@wordpress/editor/build-module/utils/index.js"); 10531 10532 10533 10534 10535 10536 10537 10538 10539 10540 /** 10541 * External dependencies 10542 */ 10543 10544 10545 /** 10546 * WordPress dependencies 10547 */ 10548 10549 10550 10551 10552 10553 /** 10554 * Internal dependencies 10555 */ 10556 10557 10558 10559 10560 var MediaPlaceholder = 10561 /*#__PURE__*/ 10562 function (_Component) { 10563 Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_5__["default"])(MediaPlaceholder, _Component); 10564 10565 function MediaPlaceholder() { 10566 var _this; 10567 10568 Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_1__["default"])(this, MediaPlaceholder); 10569 10570 _this = Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__["default"])(this, Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__["default"])(MediaPlaceholder).apply(this, arguments)); 10571 _this.state = { 10572 src: '' 10573 }; 10574 _this.onChangeSrc = _this.onChangeSrc.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["default"])(_this))); 10575 _this.onSubmitSrc = _this.onSubmitSrc.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["default"])(_this))); 10576 _this.onUpload = _this.onUpload.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["default"])(_this))); 10577 _this.onFilesUpload = _this.onFilesUpload.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["default"])(_this))); 10578 return _this; 10579 } 10580 10581 Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_2__["default"])(MediaPlaceholder, [{ 10582 key: "getAllowedTypes", 10583 value: function getAllowedTypes() { 10584 var _this$props = this.props, 10585 allowedTypes = _this$props.allowedTypes, 10586 deprecatedType = _this$props.type; 10587 var allowedTypesToUse = allowedTypes; 10588 10589 if (!allowedTypes && deprecatedType) { 10590 _wordpress_deprecated__WEBPACK_IMPORTED_MODULE_12___default()('type property of wp.editor.MediaPlaceholder', { 10591 version: '4.2', 10592 alternative: 'allowedTypes property containing an array with the allowedTypes or do not pass any property if all types are allowed' 10593 }); 10594 10595 if (deprecatedType === '*') { 10596 allowedTypesToUse = undefined; 10597 } else { 10598 allowedTypesToUse = [deprecatedType]; 10599 } 10600 } 10601 10602 return allowedTypesToUse; 10603 } 10604 }, { 10605 key: "onlyAllowsImages", 10606 value: function onlyAllowsImages() { 10607 var allowedTypes = this.getAllowedTypes(); 10608 10609 if (!allowedTypes) { 10610 return false; 10611 } 10612 10613 return Object(lodash__WEBPACK_IMPORTED_MODULE_8__["every"])(allowedTypes, function (allowedType) { 10614 return allowedType === 'image' || Object(lodash__WEBPACK_IMPORTED_MODULE_8__["startsWith"])(allowedType, 'image/'); 10615 }); 10616 } 10617 }, { 10618 key: "componentDidMount", 10619 value: function componentDidMount() { 10620 this.setState({ 10621 src: Object(lodash__WEBPACK_IMPORTED_MODULE_8__["get"])(this.props.value, ['src'], '') 10622 }); 10623 } 10624 }, { 10625 key: "componentDidUpdate", 10626 value: function componentDidUpdate(prevProps) { 10627 if (Object(lodash__WEBPACK_IMPORTED_MODULE_8__["get"])(prevProps.value, ['src'], '') !== Object(lodash__WEBPACK_IMPORTED_MODULE_8__["get"])(this.props.value, ['src'], '')) { 10628 this.setState({ 10629 src: Object(lodash__WEBPACK_IMPORTED_MODULE_8__["get"])(this.props.value, ['src'], '') 10630 }); 10631 } 10632 } 10633 }, { 10634 key: "onChangeSrc", 10635 value: function onChangeSrc(event) { 10636 this.setState({ 10637 src: event.target.value 10638 }); 10639 } 10640 }, { 10641 key: "onSubmitSrc", 10642 value: function onSubmitSrc(event) { 10643 event.preventDefault(); 10644 10645 if (this.state.src && this.props.onSelectURL) { 10646 this.props.onSelectURL(this.state.src); 10647 } 10648 } 10649 }, { 10650 key: "onUpload", 10651 value: function onUpload(event) { 10652 this.onFilesUpload(event.target.files); 10653 } 10654 }, { 10655 key: "onFilesUpload", 10656 value: function onFilesUpload(files) { 10657 var _this$props2 = this.props, 10658 onSelect = _this$props2.onSelect, 10659 multiple = _this$props2.multiple, 10660 onError = _this$props2.onError; 10661 var allowedTypes = this.getAllowedTypes(); 10662 var setMedia = multiple ? onSelect : function (_ref) { 10663 var _ref2 = Object(_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_0__["default"])(_ref, 1), 10664 media = _ref2[0]; 10665 10666 return onSelect(media); 10667 }; 10668 Object(_utils___WEBPACK_IMPORTED_MODULE_14__["mediaUpload"])({ 10669 allowedTypes: allowedTypes, 10670 filesList: files, 10671 onFileChange: setMedia, 10672 onError: onError 10673 }); 10674 } 10675 }, { 10676 key: "render", 10677 value: function render() { 10678 var _this$props3 = this.props, 10679 accept = _this$props3.accept, 10680 icon = _this$props3.icon, 10681 className = _this$props3.className, 10682 labels = _this$props3.labels, 10683 onSelect = _this$props3.onSelect, 10684 _this$props3$value = _this$props3.value, 10685 value = _this$props3$value === void 0 ? {} : _this$props3$value, 10686 onSelectURL = _this$props3.onSelectURL, 10687 _this$props3$onHTMLDr = _this$props3.onHTMLDrop, 10688 onHTMLDrop = _this$props3$onHTMLDr === void 0 ? lodash__WEBPACK_IMPORTED_MODULE_8__["noop"] : _this$props3$onHTMLDr, 10689 _this$props3$multiple = _this$props3.multiple, 10690 multiple = _this$props3$multiple === void 0 ? false : _this$props3$multiple, 10691 notices = _this$props3.notices; 10692 var allowedTypes = this.getAllowedTypes(); 10693 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_10__["Placeholder"], { 10694 icon: icon, 10695 label: labels.title // translators: %s: media name label e.g: "an audio","an image", "a video" 10696 , 10697 instructions: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_11__["sprintf"])(Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_11__["__"])('Drag %s, upload a new one or select a file from your library.'), labels.name), 10698 className: classnames__WEBPACK_IMPORTED_MODULE_9___default()('editor-media-placeholder', className), 10699 notices: notices 10700 }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_10__["DropZone"], { 10701 onFilesDrop: this.onFilesUpload, 10702 onHTMLDrop: onHTMLDrop 10703 }), onSelectURL && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["createElement"])("form", { 10704 onSubmit: this.onSubmitSrc 10705 }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["createElement"])("input", { 10706 type: "url", 10707 className: "components-placeholder__input", 10708 "aria-label": labels.title, 10709 placeholder: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_11__["__"])('Enter URL here…'), 10710 onChange: this.onChangeSrc, 10711 value: this.state.src 10712 }), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_10__["Button"], { 10713 isLarge: true, 10714 type: "submit" 10715 }, Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_11__["__"])('Use URL'))), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_10__["FormFileUpload"], { 10716 isLarge: true, 10717 className: "editor-media-placeholder__upload-button", 10718 onChange: this.onUpload, 10719 accept: accept, 10720 multiple: multiple 10721 }, Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_11__["__"])('Upload')), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["createElement"])(_media_upload__WEBPACK_IMPORTED_MODULE_13__["default"], { 10722 gallery: multiple && this.onlyAllowsImages(), 10723 multiple: multiple, 10724 onSelect: onSelect, 10725 allowedTypes: allowedTypes, 10726 value: value.id, 10727 render: function render(_ref3) { 10728 var open = _ref3.open; 10729 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_10__["Button"], { 10730 isLarge: true, 10731 onClick: open 10732 }, Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_11__["__"])('Media Library')); 10733 } 10734 })); 10735 } 10736 }]); 10737 10738 return MediaPlaceholder; 10739 }(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["Component"]); 10740 10741 /* harmony default export */ __webpack_exports__["default"] = (MediaPlaceholder); 10742 10743 10744 /***/ }), 10745 10746 /***/ "./node_modules/@wordpress/editor/build-module/components/media-upload/index.js": 10747 /*!**************************************************************************************!*\ 10748 !*** ./node_modules/@wordpress/editor/build-module/components/media-upload/index.js ***! 10749 \**************************************************************************************/ 10750 /*! exports provided: default */ 10751 /***/ (function(module, __webpack_exports__, __webpack_require__) { 10752 10753 "use strict"; 10754 __webpack_require__.r(__webpack_exports__); 10755 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); 10756 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__); 10757 /** 10758 * WordPress dependencies 10759 */ 10760 10761 /** 10762 * This is a placeholder for the media upload component necessary to make it possible to provide 10763 * an integration with the core blocks that handle media files. By default it renders nothing but 10764 * it provides a way to have it overridden with the `editor.MediaUpload` filter. 10765 * 10766 * @return {WPElement} Media upload element. 10767 */ 10768 10769 var MediaUpload = function MediaUpload() { 10770 return null; 10771 }; // Todo: rename the filter 10772 10773 10774 /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__["withFilters"])('editor.MediaUpload')(MediaUpload)); 10775 10776 10777 /***/ }), 10778 10779 /***/ "./node_modules/@wordpress/editor/build-module/components/multi-select-scroll-into-view/index.js": 10780 /*!*******************************************************************************************************!*\ 10781 !*** ./node_modules/@wordpress/editor/build-module/components/multi-select-scroll-into-view/index.js ***! 10782 \*******************************************************************************************************/ 10783 /*! exports provided: default */ 10784 /***/ (function(module, __webpack_exports__, __webpack_require__) { 10785 10786 "use strict"; 10787 __webpack_require__.r(__webpack_exports__); 10788 /* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/classCallCheck */ "./node_modules/@babel/runtime/helpers/esm/classCallCheck.js"); 10789 /* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/createClass */ "./node_modules/@babel/runtime/helpers/esm/createClass.js"); 10790 /* harmony import */ var _babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js"); 10791 /* harmony import */ var _babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/esm/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js"); 10792 /* harmony import */ var _babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inherits */ "./node_modules/@babel/runtime/helpers/esm/inherits.js"); 10793 /* harmony import */ var dom_scroll_into_view__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! dom-scroll-into-view */ "./node_modules/dom-scroll-into-view/lib/index.js"); 10794 /* harmony import */ var dom_scroll_into_view__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(dom_scroll_into_view__WEBPACK_IMPORTED_MODULE_5__); 10795 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); 10796 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__); 10797 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); 10798 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_7__); 10799 /* harmony import */ var _wordpress_dom__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @wordpress/dom */ "@wordpress/dom"); 10800 /* harmony import */ var _wordpress_dom__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_wordpress_dom__WEBPACK_IMPORTED_MODULE_8__); 10801 /* harmony import */ var _utils_dom__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../utils/dom */ "./node_modules/@wordpress/editor/build-module/utils/dom.js"); 10802 10803 10804 10805 10806 10807 10808 /** 10809 * External dependencies 10810 */ 10811 10812 /** 10813 * WordPress dependencies 10814 */ 10815 10816 10817 10818 10819 /** 10820 * Internal dependencies 10821 */ 10822 10823 10824 10825 var MultiSelectScrollIntoView = 10826 /*#__PURE__*/ 10827 function (_Component) { 10828 Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__["default"])(MultiSelectScrollIntoView, _Component); 10829 10830 function MultiSelectScrollIntoView() { 10831 Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__["default"])(this, MultiSelectScrollIntoView); 10832 10833 return Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__["default"])(this, Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__["default"])(MultiSelectScrollIntoView).apply(this, arguments)); 10834 } 10835 10836 Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__["default"])(MultiSelectScrollIntoView, [{ 10837 key: "componentDidUpdate", 10838 value: function componentDidUpdate() { 10839 // Relies on expectation that `componentDidUpdate` will only be called 10840 // if value of `extentClientId` changes. 10841 this.scrollIntoView(); 10842 } 10843 /** 10844 * Ensures that if a multi-selection exists, the extent of the selection is 10845 * visible within the nearest scrollable container. 10846 * 10847 * @return {void} 10848 */ 10849 10850 }, { 10851 key: "scrollIntoView", 10852 value: function scrollIntoView() { 10853 var extentClientId = this.props.extentClientId; 10854 10855 if (!extentClientId) { 10856 return; 10857 } 10858 10859 var extentNode = Object(_utils_dom__WEBPACK_IMPORTED_MODULE_9__["getBlockDOMNode"])(extentClientId); 10860 10861 if (!extentNode) { 10862 return; 10863 } 10864 10865 var scrollContainer = Object(_wordpress_dom__WEBPACK_IMPORTED_MODULE_8__["getScrollContainer"])(extentNode); // If there's no scroll container, it follows that there's no scrollbar 10866 // and thus there's no need to try to scroll into view. 10867 10868 if (!scrollContainer) { 10869 return; 10870 } 10871 10872 dom_scroll_into_view__WEBPACK_IMPORTED_MODULE_5___default()(extentNode, scrollContainer, { 10873 onlyScrollIfNeeded: true 10874 }); 10875 } 10876 }, { 10877 key: "render", 10878 value: function render() { 10879 return null; 10880 } 10881 }]); 10882 10883 return MultiSelectScrollIntoView; 10884 }(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["Component"]); 10885 10886 /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_7__["withSelect"])(function (select) { 10887 var _select = select('core/editor'), 10888 getLastMultiSelectedBlockClientId = _select.getLastMultiSelectedBlockClientId; 10889 10890 return { 10891 extentClientId: getLastMultiSelectedBlockClientId() 10892 }; 10893 })(MultiSelectScrollIntoView)); 10894 10895 10896 /***/ }), 10897 10898 /***/ "./node_modules/@wordpress/editor/build-module/components/navigable-toolbar/index.js": 10899 /*!*******************************************************************************************!*\ 10900 !*** ./node_modules/@wordpress/editor/build-module/components/navigable-toolbar/index.js ***! 10901 \*******************************************************************************************/ 10902 /*! exports provided: default */ 10903 /***/ (function(module, __webpack_exports__, __webpack_require__) { 10904 10905 "use strict"; 10906 __webpack_require__.r(__webpack_exports__); 10907 /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js"); 10908 /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutProperties */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js"); 10909 /* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/classCallCheck */ "./node_modules/@babel/runtime/helpers/esm/classCallCheck.js"); 10910 /* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/esm/createClass */ "./node_modules/@babel/runtime/helpers/esm/createClass.js"); 10911 /* harmony import */ var _babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/esm/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js"); 10912 /* harmony import */ var _babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/helpers/esm/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js"); 10913 /* harmony import */ var _babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inherits */ "./node_modules/@babel/runtime/helpers/esm/inherits.js"); 10914 /* harmony import */ var _babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @babel/runtime/helpers/esm/assertThisInitialized */ "./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js"); 10915 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); 10916 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__); 10917 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! lodash */ "lodash"); 10918 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_9__); 10919 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); 10920 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_10__); 10921 /* harmony import */ var _wordpress_dom__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @wordpress/dom */ "@wordpress/dom"); 10922 /* harmony import */ var _wordpress_dom__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(_wordpress_dom__WEBPACK_IMPORTED_MODULE_11__); 10923 /* harmony import */ var _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @wordpress/keycodes */ "@wordpress/keycodes"); 10924 /* harmony import */ var _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(_wordpress_keycodes__WEBPACK_IMPORTED_MODULE_12__); 10925 10926 10927 10928 10929 10930 10931 10932 10933 10934 10935 /** 10936 * External dependencies 10937 */ 10938 10939 /** 10940 * WordPress dependencies 10941 */ 10942 10943 10944 10945 10946 10947 /** 10948 * Browser dependencies 10949 */ 10950 10951 var _window = window, 10952 Node = _window.Node, 10953 getSelection = _window.getSelection; 10954 10955 var NavigableToolbar = 10956 /*#__PURE__*/ 10957 function (_Component) { 10958 Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_6__["default"])(NavigableToolbar, _Component); 10959 10960 function NavigableToolbar() { 10961 var _this; 10962 10963 Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_2__["default"])(this, NavigableToolbar); 10964 10965 _this = Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_4__["default"])(this, Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_5__["default"])(NavigableToolbar).apply(this, arguments)); 10966 _this.bindNode = _this.bindNode.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(_this))); 10967 _this.focusToolbar = _this.focusToolbar.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(_this))); 10968 _this.focusSelection = _this.focusSelection.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(_this))); 10969 _this.switchOnKeyDown = Object(lodash__WEBPACK_IMPORTED_MODULE_9__["cond"])([[Object(lodash__WEBPACK_IMPORTED_MODULE_9__["matchesProperty"])(['keyCode'], _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_12__["ESCAPE"]), _this.focusSelection]]); 10970 return _this; 10971 } 10972 10973 Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_3__["default"])(NavigableToolbar, [{ 10974 key: "bindNode", 10975 value: function bindNode(ref) { 10976 // Disable reason: Need DOM node for finding first focusable element 10977 // on keyboard interaction to shift to toolbar. 10978 // eslint-disable-next-line react/no-find-dom-node 10979 this.toolbar = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["findDOMNode"])(ref); 10980 } 10981 }, { 10982 key: "focusToolbar", 10983 value: function focusToolbar() { 10984 var tabbables = _wordpress_dom__WEBPACK_IMPORTED_MODULE_11__["focus"].tabbable.find(this.toolbar); 10985 10986 if (tabbables.length) { 10987 tabbables[0].focus(); 10988 } 10989 } 10990 /** 10991 * Programmatically shifts focus to the element where the current selection 10992 * exists, if there is a selection. 10993 */ 10994 10995 }, { 10996 key: "focusSelection", 10997 value: function focusSelection() { 10998 // Ensure that a selection exists. 10999 var selection = getSelection(); 11000 11001 if (!selection) { 11002 return; 11003 } // Focus node may be a text node, which cannot be focused directly. 11004 // Find its parent element instead. 11005 11006 11007 var focusNode = selection.focusNode; 11008 var focusElement = focusNode; 11009 11010 if (focusElement.nodeType !== Node.ELEMENT_NODE) { 11011 focusElement = focusElement.parentElement; 11012 } 11013 11014 if (focusElement) { 11015 focusElement.focus(); 11016 } 11017 } 11018 }, { 11019 key: "render", 11020 value: function render() { 11021 var _this$props = this.props, 11022 children = _this$props.children, 11023 props = Object(_babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__["default"])(_this$props, ["children"]); 11024 11025 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_10__["NavigableMenu"], Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({ 11026 orientation: "horizontal", 11027 role: "toolbar", 11028 ref: this.bindNode, 11029 onKeyDown: this.switchOnKeyDown 11030 }, props), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_10__["KeyboardShortcuts"], { 11031 bindGlobal: true // Use the same event that TinyMCE uses in the Classic block for its own `alt+f10` shortcut. 11032 , 11033 eventName: "keydown", 11034 shortcuts: { 11035 'alt+f10': this.focusToolbar 11036 } 11037 }), children); 11038 } 11039 }]); 11040 11041 return NavigableToolbar; 11042 }(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["Component"]); 11043 11044 /* harmony default export */ __webpack_exports__["default"] = (NavigableToolbar); 11045 11046 11047 /***/ }), 11048 11049 /***/ "./node_modules/@wordpress/editor/build-module/components/observe-typing/index.js": 11050 /*!****************************************************************************************!*\ 11051 !*** ./node_modules/@wordpress/editor/build-module/components/observe-typing/index.js ***! 11052 \****************************************************************************************/ 11053 /*! exports provided: default */ 11054 /***/ (function(module, __webpack_exports__, __webpack_require__) { 11055 11056 "use strict"; 11057 __webpack_require__.r(__webpack_exports__); 11058 /* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/classCallCheck */ "./node_modules/@babel/runtime/helpers/esm/classCallCheck.js"); 11059 /* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/createClass */ "./node_modules/@babel/runtime/helpers/esm/createClass.js"); 11060 /* harmony import */ var _babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js"); 11061 /* harmony import */ var _babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/esm/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js"); 11062 /* harmony import */ var _babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inherits */ "./node_modules/@babel/runtime/helpers/esm/inherits.js"); 11063 /* harmony import */ var _babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/helpers/esm/assertThisInitialized */ "./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js"); 11064 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); 11065 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__); 11066 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! lodash */ "lodash"); 11067 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_7__); 11068 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); 11069 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_8__); 11070 /* harmony import */ var _wordpress_dom__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @wordpress/dom */ "@wordpress/dom"); 11071 /* harmony import */ var _wordpress_dom__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_wordpress_dom__WEBPACK_IMPORTED_MODULE_9__); 11072 /* harmony import */ var _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @wordpress/keycodes */ "@wordpress/keycodes"); 11073 /* harmony import */ var _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_wordpress_keycodes__WEBPACK_IMPORTED_MODULE_10__); 11074 /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose"); 11075 /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_11__); 11076 11077 11078 11079 11080 11081 11082 11083 11084 /** 11085 * External dependencies 11086 */ 11087 11088 /** 11089 * WordPress dependencies 11090 */ 11091 11092 11093 11094 11095 11096 11097 /** 11098 * Set of key codes upon which typing is to be initiated on a keydown event. 11099 * 11100 * @type {number[]} 11101 */ 11102 11103 var KEY_DOWN_ELIGIBLE_KEY_CODES = [_wordpress_keycodes__WEBPACK_IMPORTED_MODULE_10__["UP"], _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_10__["RIGHT"], _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_10__["DOWN"], _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_10__["LEFT"], _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_10__["ENTER"], _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_10__["BACKSPACE"]]; 11104 /** 11105 * Returns true if a given keydown event can be inferred as intent to start 11106 * typing, or false otherwise. A keydown is considered eligible if it is a 11107 * text navigation without shift active. 11108 * 11109 * @param {KeyboardEvent} event Keydown event to test. 11110 * 11111 * @return {boolean} Whether event is eligible to start typing. 11112 */ 11113 11114 function isKeyDownEligibleForStartTyping(event) { 11115 var keyCode = event.keyCode, 11116 shiftKey = event.shiftKey; 11117 return !shiftKey && Object(lodash__WEBPACK_IMPORTED_MODULE_7__["includes"])(KEY_DOWN_ELIGIBLE_KEY_CODES, keyCode); 11118 } 11119 11120 var ObserveTyping = 11121 /*#__PURE__*/ 11122 function (_Component) { 11123 Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__["default"])(ObserveTyping, _Component); 11124 11125 function ObserveTyping() { 11126 var _this; 11127 11128 Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__["default"])(this, ObserveTyping); 11129 11130 _this = Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__["default"])(this, Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__["default"])(ObserveTyping).apply(this, arguments)); 11131 _this.stopTypingOnSelectionUncollapse = _this.stopTypingOnSelectionUncollapse.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(_this))); 11132 _this.stopTypingOnMouseMove = _this.stopTypingOnMouseMove.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(_this))); 11133 _this.startTypingInTextField = _this.startTypingInTextField.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(_this))); 11134 _this.stopTypingOnNonTextField = _this.stopTypingOnNonTextField.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(_this))); 11135 _this.lastMouseMove = null; 11136 return _this; 11137 } 11138 11139 Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__["default"])(ObserveTyping, [{ 11140 key: "componentDidMount", 11141 value: function componentDidMount() { 11142 this.toggleEventBindings(this.props.isTyping); 11143 } 11144 }, { 11145 key: "componentDidUpdate", 11146 value: function componentDidUpdate(prevProps) { 11147 if (this.props.isTyping !== prevProps.isTyping) { 11148 this.toggleEventBindings(this.props.isTyping); 11149 } 11150 } 11151 }, { 11152 key: "componentWillUnmount", 11153 value: function componentWillUnmount() { 11154 this.toggleEventBindings(false); 11155 } 11156 /** 11157 * Bind or unbind events to the document when typing has started or stopped 11158 * respectively, or when component has become unmounted. 11159 * 11160 * @param {boolean} isBound Whether event bindings should be applied. 11161 */ 11162 11163 }, { 11164 key: "toggleEventBindings", 11165 value: function toggleEventBindings(isBound) { 11166 var bindFn = isBound ? 'addEventListener' : 'removeEventListener'; 11167 document[bindFn]('selectionchange', this.stopTypingOnSelectionUncollapse); 11168 document[bindFn]('mousemove', this.stopTypingOnMouseMove); 11169 } 11170 /** 11171 * On mouse move, unset typing flag if user has moved cursor. 11172 * 11173 * @param {MouseEvent} event Mousemove event. 11174 */ 11175 11176 }, { 11177 key: "stopTypingOnMouseMove", 11178 value: function stopTypingOnMouseMove(event) { 11179 var clientX = event.clientX, 11180 clientY = event.clientY; // We need to check that the mouse really moved because Safari triggers 11181 // mousemove events when shift or ctrl are pressed. 11182 11183 if (this.lastMouseMove) { 11184 var _this$lastMouseMove = this.lastMouseMove, 11185 lastClientX = _this$lastMouseMove.clientX, 11186 lastClientY = _this$lastMouseMove.clientY; 11187 11188 if (lastClientX !== clientX || lastClientY !== clientY) { 11189 this.props.onStopTyping(); 11190 } 11191 } 11192 11193 this.lastMouseMove = { 11194 clientX: clientX, 11195 clientY: clientY 11196 }; 11197 } 11198 /** 11199 * On selection change, unset typing flag if user has made an uncollapsed 11200 * (shift) selection. 11201 */ 11202 11203 }, { 11204 key: "stopTypingOnSelectionUncollapse", 11205 value: function stopTypingOnSelectionUncollapse() { 11206 var selection = window.getSelection(); 11207 var isCollapsed = selection.rangeCount > 0 && selection.getRangeAt(0).collapsed; 11208 11209 if (!isCollapsed) { 11210 this.props.onStopTyping(); 11211 } 11212 } 11213 /** 11214 * Handles a keypress or keydown event to infer intention to start typing. 11215 * 11216 * @param {KeyboardEvent} event Keypress or keydown event to interpret. 11217 */ 11218 11219 }, { 11220 key: "startTypingInTextField", 11221 value: function startTypingInTextField(event) { 11222 var _this$props = this.props, 11223 isTyping = _this$props.isTyping, 11224 onStartTyping = _this$props.onStartTyping; 11225 var type = event.type, 11226 target = event.target; // Abort early if already typing, or key press is incurred outside a 11227 // text field (e.g. arrow-ing through toolbar buttons). 11228 // Ignore typing in a block toolbar 11229 11230 if (isTyping || !Object(_wordpress_dom__WEBPACK_IMPORTED_MODULE_9__["isTextField"])(target) || target.closest('.editor-block-toolbar')) { 11231 return; 11232 } // Special-case keydown because certain keys do not emit a keypress 11233 // event. Conversely avoid keydown as the canonical event since there 11234 // are many keydown which are explicitly not targeted for typing. 11235 11236 11237 if (type === 'keydown' && !isKeyDownEligibleForStartTyping(event)) { 11238 return; 11239 } 11240 11241 onStartTyping(); 11242 } 11243 /** 11244 * Stops typing when focus transitions to a non-text field element. 11245 * 11246 * @param {FocusEvent} event Focus event. 11247 */ 11248 11249 }, { 11250 key: "stopTypingOnNonTextField", 11251 value: function stopTypingOnNonTextField(event) { 11252 var _this2 = this; 11253 11254 event.persist(); // Since focus to a non-text field via arrow key will trigger before 11255 // the keydown event, wait until after current stack before evaluating 11256 // whether typing is to be stopped. Otherwise, typing will re-start. 11257 11258 this.props.setTimeout(function () { 11259 var _this2$props = _this2.props, 11260 isTyping = _this2$props.isTyping, 11261 onStopTyping = _this2$props.onStopTyping; 11262 var target = event.target; 11263 11264 if (isTyping && !Object(_wordpress_dom__WEBPACK_IMPORTED_MODULE_9__["isTextField"])(target)) { 11265 onStopTyping(); 11266 } 11267 }); 11268 } 11269 }, { 11270 key: "render", 11271 value: function render() { 11272 var children = this.props.children; // Disable reason: This component is responsible for capturing bubbled 11273 // keyboard events which are interpreted as typing intent. 11274 11275 /* eslint-disable jsx-a11y/no-static-element-interactions */ 11276 11277 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("div", { 11278 onFocus: this.stopTypingOnNonTextField, 11279 onKeyPress: this.startTypingInTextField, 11280 onKeyDown: this.startTypingInTextField 11281 }, children); 11282 /* eslint-enable jsx-a11y/no-static-element-interactions */ 11283 } 11284 }]); 11285 11286 return ObserveTyping; 11287 }(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["Component"]); 11288 11289 /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_11__["compose"])([Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_8__["withSelect"])(function (select) { 11290 var _select = select('core/editor'), 11291 isTyping = _select.isTyping; 11292 11293 return { 11294 isTyping: isTyping() 11295 }; 11296 }), Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_8__["withDispatch"])(function (dispatch) { 11297 var _dispatch = dispatch('core/editor'), 11298 startTyping = _dispatch.startTyping, 11299 stopTyping = _dispatch.stopTyping; 11300 11301 return { 11302 onStartTyping: startTyping, 11303 onStopTyping: stopTyping 11304 }; 11305 }), _wordpress_compose__WEBPACK_IMPORTED_MODULE_11__["withSafeTimeout"]])(ObserveTyping)); 11306 11307 11308 /***/ }), 11309 11310 /***/ "./node_modules/@wordpress/editor/build-module/components/page-attributes/check.js": 11311 /*!*****************************************************************************************!*\ 11312 !*** ./node_modules/@wordpress/editor/build-module/components/page-attributes/check.js ***! 11313 \*****************************************************************************************/ 11314 /*! exports provided: PageAttributesCheck, default */ 11315 /***/ (function(module, __webpack_exports__, __webpack_require__) { 11316 11317 "use strict"; 11318 __webpack_require__.r(__webpack_exports__); 11319 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PageAttributesCheck", function() { return PageAttributesCheck; }); 11320 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash */ "lodash"); 11321 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_0__); 11322 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); 11323 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_1__); 11324 /** 11325 * External dependencies 11326 */ 11327 11328 /** 11329 * WordPress dependencies 11330 */ 11331 11332 11333 function PageAttributesCheck(_ref) { 11334 var availableTemplates = _ref.availableTemplates, 11335 postType = _ref.postType, 11336 children = _ref.children; 11337 var supportsPageAttributes = Object(lodash__WEBPACK_IMPORTED_MODULE_0__["get"])(postType, ['supports', 'page-attributes'], false); // Only render fields if post type supports page attributes or available templates exist. 11338 11339 if (!supportsPageAttributes && Object(lodash__WEBPACK_IMPORTED_MODULE_0__["isEmpty"])(availableTemplates)) { 11340 return null; 11341 } 11342 11343 return children; 11344 } 11345 /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_1__["withSelect"])(function (select) { 11346 var _select = select('core/editor'), 11347 getEditedPostAttribute = _select.getEditedPostAttribute, 11348 getEditorSettings = _select.getEditorSettings; 11349 11350 var _select2 = select('core'), 11351 getPostType = _select2.getPostType; 11352 11353 var _getEditorSettings = getEditorSettings(), 11354 availableTemplates = _getEditorSettings.availableTemplates; 11355 11356 return { 11357 postType: getPostType(getEditedPostAttribute('type')), 11358 availableTemplates: availableTemplates 11359 }; 11360 })(PageAttributesCheck)); 11361 11362 11363 /***/ }), 11364 11365 /***/ "./node_modules/@wordpress/editor/build-module/components/page-attributes/order.js": 11366 /*!*****************************************************************************************!*\ 11367 !*** ./node_modules/@wordpress/editor/build-module/components/page-attributes/order.js ***! 11368 \*****************************************************************************************/ 11369 /*! exports provided: PageAttributesOrder, default */ 11370 /***/ (function(module, __webpack_exports__, __webpack_require__) { 11371 11372 "use strict"; 11373 __webpack_require__.r(__webpack_exports__); 11374 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PageAttributesOrder", function() { return PageAttributesOrder; }); 11375 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); 11376 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); 11377 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lodash */ "lodash"); 11378 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_1__); 11379 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); 11380 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__); 11381 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); 11382 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__); 11383 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); 11384 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_4__); 11385 /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose"); 11386 /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_5__); 11387 /* harmony import */ var _post_type_support_check__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../post-type-support-check */ "./node_modules/@wordpress/editor/build-module/components/post-type-support-check/index.js"); 11388 11389 11390 /** 11391 * External dependencies 11392 */ 11393 11394 /** 11395 * WordPress dependencies 11396 */ 11397 11398 11399 11400 11401 11402 /** 11403 * Internal dependencies 11404 */ 11405 11406 11407 var PageAttributesOrder = Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_5__["withState"])({ 11408 orderInput: null 11409 })(function (_ref) { 11410 var onUpdateOrder = _ref.onUpdateOrder, 11411 _ref$order = _ref.order, 11412 order = _ref$order === void 0 ? 0 : _ref$order, 11413 orderInput = _ref.orderInput, 11414 setState = _ref.setState; 11415 11416 var setUpdatedOrder = function setUpdatedOrder(value) { 11417 setState({ 11418 orderInput: value 11419 }); 11420 var newOrder = Number(value); 11421 11422 if (Number.isInteger(newOrder) && Object(lodash__WEBPACK_IMPORTED_MODULE_1__["invoke"])(value, ['trim']) !== '') { 11423 onUpdateOrder(Number(value)); 11424 } 11425 }; 11426 11427 var value = orderInput === null ? order : orderInput; 11428 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__["TextControl"], { 11429 className: "editor-page-attributes__order", 11430 type: "number", 11431 label: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__["__"])('Order'), 11432 value: value, 11433 onChange: setUpdatedOrder, 11434 size: 6, 11435 onBlur: function onBlur() { 11436 setState({ 11437 orderInput: null 11438 }); 11439 } 11440 }); 11441 }); 11442 11443 function PageAttributesOrderWithChecks(props) { 11444 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_post_type_support_check__WEBPACK_IMPORTED_MODULE_6__["default"], { 11445 supportKeys: "page-attributes" 11446 }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(PageAttributesOrder, props)); 11447 } 11448 11449 /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_5__["compose"])([Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_4__["withSelect"])(function (select) { 11450 return { 11451 order: select('core/editor').getEditedPostAttribute('menu_order') 11452 }; 11453 }), Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_4__["withDispatch"])(function (dispatch) { 11454 return { 11455 onUpdateOrder: function onUpdateOrder(order) { 11456 dispatch('core/editor').editPost({ 11457 menu_order: order 11458 }); 11459 } 11460 }; 11461 })])(PageAttributesOrderWithChecks)); 11462 11463 11464 /***/ }), 11465 11466 /***/ "./node_modules/@wordpress/editor/build-module/components/page-attributes/parent.js": 11467 /*!******************************************************************************************!*\ 11468 !*** ./node_modules/@wordpress/editor/build-module/components/page-attributes/parent.js ***! 11469 \******************************************************************************************/ 11470 /*! exports provided: PageAttributesParent, default */ 11471 /***/ (function(module, __webpack_exports__, __webpack_require__) { 11472 11473 "use strict"; 11474 __webpack_require__.r(__webpack_exports__); 11475 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PageAttributesParent", function() { return PageAttributesParent; }); 11476 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); 11477 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); 11478 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lodash */ "lodash"); 11479 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_1__); 11480 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); 11481 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__); 11482 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); 11483 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__); 11484 /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose"); 11485 /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_4__); 11486 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); 11487 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_5__); 11488 /* harmony import */ var _utils_terms__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../utils/terms */ "./node_modules/@wordpress/editor/build-module/utils/terms.js"); 11489 11490 11491 /** 11492 * External dependencies 11493 */ 11494 11495 /** 11496 * WordPress dependencies 11497 */ 11498 11499 11500 11501 11502 11503 /** 11504 * Internal dependencies 11505 */ 11506 11507 11508 function PageAttributesParent(_ref) { 11509 var parent = _ref.parent, 11510 postType = _ref.postType, 11511 items = _ref.items, 11512 onUpdateParent = _ref.onUpdateParent; 11513 var isHierarchical = Object(lodash__WEBPACK_IMPORTED_MODULE_1__["get"])(postType, ['hierarchical'], false); 11514 var parentPageLabel = Object(lodash__WEBPACK_IMPORTED_MODULE_1__["get"])(postType, ['labels', 'parent_item_colon']); 11515 var pageItems = items || []; 11516 11517 if (!isHierarchical || !parentPageLabel || !pageItems.length) { 11518 return null; 11519 } 11520 11521 var pagesTree = Object(_utils_terms__WEBPACK_IMPORTED_MODULE_6__["buildTermsTree"])(pageItems.map(function (item) { 11522 return { 11523 id: item.id, 11524 parent: item.parent, 11525 name: item.title.raw ? item.title.raw : "#".concat(item.id, " (").concat(Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__["__"])('no title'), ")") 11526 }; 11527 })); 11528 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__["TreeSelect"], { 11529 label: parentPageLabel, 11530 noOptionLabel: "(".concat(Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__["__"])('no parent'), ")"), 11531 tree: pagesTree, 11532 selectedId: parent, 11533 onChange: onUpdateParent 11534 }); 11535 } 11536 var applyWithSelect = Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_5__["withSelect"])(function (select) { 11537 var _select = select('core'), 11538 getPostType = _select.getPostType, 11539 getEntityRecords = _select.getEntityRecords; 11540 11541 var _select2 = select('core/editor'), 11542 getCurrentPostId = _select2.getCurrentPostId, 11543 getEditedPostAttribute = _select2.getEditedPostAttribute; 11544 11545 var postTypeSlug = getEditedPostAttribute('type'); 11546 var postType = getPostType(postTypeSlug); 11547 var postId = getCurrentPostId(); 11548 var isHierarchical = Object(lodash__WEBPACK_IMPORTED_MODULE_1__["get"])(postType, ['hierarchical'], false); 11549 var query = { 11550 per_page: -1, 11551 exclude: postId, 11552 parent_exclude: postId, 11553 orderby: 'menu_order', 11554 order: 'asc' 11555 }; 11556 return { 11557 parent: getEditedPostAttribute('parent'), 11558 items: isHierarchical ? getEntityRecords('postType', postTypeSlug, query) : [], 11559 postType: postType 11560 }; 11561 }); 11562 var applyWithDispatch = Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_5__["withDispatch"])(function (dispatch) { 11563 var _dispatch = dispatch('core/editor'), 11564 editPost = _dispatch.editPost; 11565 11566 return { 11567 onUpdateParent: function onUpdateParent(parent) { 11568 editPost({ 11569 parent: parent || 0 11570 }); 11571 } 11572 }; 11573 }); 11574 /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_4__["compose"])([applyWithSelect, applyWithDispatch])(PageAttributesParent)); 11575 11576 11577 /***/ }), 11578 11579 /***/ "./node_modules/@wordpress/editor/build-module/components/page-attributes/template.js": 11580 /*!********************************************************************************************!*\ 11581 !*** ./node_modules/@wordpress/editor/build-module/components/page-attributes/template.js ***! 11582 \********************************************************************************************/ 11583 /*! exports provided: PageTemplate, default */ 11584 /***/ (function(module, __webpack_exports__, __webpack_require__) { 11585 11586 "use strict"; 11587 __webpack_require__.r(__webpack_exports__); 11588 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PageTemplate", function() { return PageTemplate; }); 11589 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); 11590 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); 11591 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lodash */ "lodash"); 11592 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_1__); 11593 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); 11594 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__); 11595 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); 11596 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__); 11597 /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose"); 11598 /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_4__); 11599 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); 11600 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_5__); 11601 11602 11603 /** 11604 * External dependencies 11605 */ 11606 11607 /** 11608 * WordPress dependencies 11609 */ 11610 11611 11612 11613 11614 11615 function PageTemplate(_ref) { 11616 var availableTemplates = _ref.availableTemplates, 11617 selectedTemplate = _ref.selectedTemplate, 11618 onUpdate = _ref.onUpdate; 11619 11620 if (Object(lodash__WEBPACK_IMPORTED_MODULE_1__["isEmpty"])(availableTemplates)) { 11621 return null; 11622 } 11623 11624 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__["SelectControl"], { 11625 label: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__["__"])('Template:'), 11626 value: selectedTemplate, 11627 onChange: onUpdate, 11628 className: "editor-page-attributes__template", 11629 options: Object(lodash__WEBPACK_IMPORTED_MODULE_1__["map"])(availableTemplates, function (templateName, templateSlug) { 11630 return { 11631 value: templateSlug, 11632 label: templateName 11633 }; 11634 }) 11635 }); 11636 } 11637 /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_4__["compose"])(Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_5__["withSelect"])(function (select) { 11638 var _select = select('core/editor'), 11639 getEditedPostAttribute = _select.getEditedPostAttribute, 11640 getEditorSettings = _select.getEditorSettings; 11641 11642 var _getEditorSettings = getEditorSettings(), 11643 availableTemplates = _getEditorSettings.availableTemplates; 11644 11645 return { 11646 selectedTemplate: getEditedPostAttribute('template'), 11647 availableTemplates: availableTemplates 11648 }; 11649 }), Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_5__["withDispatch"])(function (dispatch) { 11650 return { 11651 onUpdate: function onUpdate(templateSlug) { 11652 dispatch('core/editor').editPost({ 11653 template: templateSlug || '' 11654 }); 11655 } 11656 }; 11657 }))(PageTemplate)); 11658 11659 11660 /***/ }), 11661 11662 /***/ "./node_modules/@wordpress/editor/build-module/components/panel-color-settings/index.js": 11663 /*!**********************************************************************************************!*\ 11664 !*** ./node_modules/@wordpress/editor/build-module/components/panel-color-settings/index.js ***! 11665 \**********************************************************************************************/ 11666 /*! exports provided: PanelColorSettings, default */ 11667 /***/ (function(module, __webpack_exports__, __webpack_require__) { 11668 11669 "use strict"; 11670 __webpack_require__.r(__webpack_exports__); 11671 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PanelColorSettings", function() { return PanelColorSettings; }); 11672 /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js"); 11673 /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutProperties */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js"); 11674 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); 11675 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__); 11676 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! lodash */ "lodash"); 11677 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_3__); 11678 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); 11679 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_4__); 11680 /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose"); 11681 /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_5__); 11682 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); 11683 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_6__); 11684 /* harmony import */ var _color_palette_control__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../color-palette/control */ "./node_modules/@wordpress/editor/build-module/components/color-palette/control.js"); 11685 /* harmony import */ var _color_palette_with_color_context__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../color-palette/with-color-context */ "./node_modules/@wordpress/editor/build-module/components/color-palette/with-color-context.js"); 11686 /* harmony import */ var _colors__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../colors */ "./node_modules/@wordpress/editor/build-module/components/colors/index.js"); 11687 11688 11689 11690 11691 /** 11692 * External dependencies 11693 */ 11694 11695 /** 11696 * WordPress dependencies 11697 */ 11698 11699 11700 11701 11702 /** 11703 * Internal dependencies 11704 */ 11705 11706 11707 11708 // translators: first %s: The type of color (e.g. background color), second %s: the color name or value (e.g. red or #ff0000) 11709 11710 var colorIndicatorAriaLabel = Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_6__["__"])('(%s: %s)'); 11711 11712 var renderColorIndicators = function renderColorIndicators(colorSettings, colors) { 11713 return colorSettings.map(function (_ref, index) { 11714 var value = _ref.value, 11715 label = _ref.label; 11716 11717 if (!value) { 11718 return null; 11719 } 11720 11721 var colorObject = Object(_colors__WEBPACK_IMPORTED_MODULE_9__["getColorObjectByColorValue"])(colors, value); 11722 var colorName = colorObject && colorObject.name; 11723 var ariaLabel = Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_6__["sprintf"])(colorIndicatorAriaLabel, label.toLowerCase(), colorName || value); 11724 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_4__["ColorIndicator"], { 11725 key: index, 11726 colorValue: value, 11727 "aria-label": ariaLabel 11728 }); 11729 }); 11730 }; // colorSettings is passed as an array of props so that it can be used for 11731 // mapping both ColorIndicator and ColorPaletteControl components. Passing 11732 // an array of components/nodes here wouldn't be feasible. 11733 11734 11735 function PanelColorSettings(_ref2) { 11736 var title = _ref2.title, 11737 colorSettings = _ref2.colorSettings, 11738 colors = _ref2.colors, 11739 children = _ref2.children, 11740 props = Object(_babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__["default"])(_ref2, ["title", "colorSettings", "colors", "children"]); 11741 11742 var className = 'editor-panel-color-settings'; 11743 var titleElement = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["createElement"])("span", { 11744 className: "".concat(className, "__panel-title") 11745 }, title, renderColorIndicators(colorSettings, colors)); 11746 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_4__["PanelBody"], Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({ 11747 className: className, 11748 title: titleElement 11749 }, Object(lodash__WEBPACK_IMPORTED_MODULE_3__["omit"])(props, 'colors')), colorSettings.map(function (settings, index) { 11750 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["createElement"])(_color_palette_control__WEBPACK_IMPORTED_MODULE_7__["default"], Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({ 11751 key: index 11752 }, settings)); 11753 }), children); 11754 } 11755 /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_5__["compose"])([_color_palette_with_color_context__WEBPACK_IMPORTED_MODULE_8__["default"], Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_5__["ifCondition"])(function (_ref3) { 11756 var hasColorsToChoose = _ref3.hasColorsToChoose; 11757 return hasColorsToChoose; 11758 })])(PanelColorSettings)); 11759 11760 11761 /***/ }), 11762 11763 /***/ "./node_modules/@wordpress/editor/build-module/components/panel-color/index.js": 11764 /*!*************************************************************************************!*\ 11765 !*** ./node_modules/@wordpress/editor/build-module/components/panel-color/index.js ***! 11766 \*************************************************************************************/ 11767 /*! exports provided: default */ 11768 /***/ (function(module, __webpack_exports__, __webpack_require__) { 11769 11770 "use strict"; 11771 __webpack_require__.r(__webpack_exports__); 11772 /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js"); 11773 /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutProperties */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js"); 11774 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); 11775 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__); 11776 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! lodash */ "lodash"); 11777 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_3__); 11778 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); 11779 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_4__); 11780 /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose"); 11781 /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_5__); 11782 /* harmony import */ var _color_palette__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../color-palette */ "./node_modules/@wordpress/editor/build-module/components/color-palette/index.js"); 11783 /* harmony import */ var _color_palette_with_color_context__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../color-palette/with-color-context */ "./node_modules/@wordpress/editor/build-module/components/color-palette/with-color-context.js"); 11784 /* harmony import */ var _colors__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../colors */ "./node_modules/@wordpress/editor/build-module/components/colors/index.js"); 11785 11786 11787 11788 11789 /** 11790 * External dependencies 11791 */ 11792 11793 /** 11794 * WordPress dependencies 11795 */ 11796 11797 11798 11799 /** 11800 * Internal dependencies 11801 */ 11802 11803 11804 11805 11806 11807 function PanelColor(_ref) { 11808 var colors = _ref.colors, 11809 title = _ref.title, 11810 colorValue = _ref.colorValue, 11811 initialOpen = _ref.initialOpen, 11812 props = Object(_babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__["default"])(_ref, ["colors", "title", "colorValue", "initialOpen"]); 11813 11814 var colorObject = Object(_colors__WEBPACK_IMPORTED_MODULE_8__["getColorObjectByColorValue"])(colors, colorValue); 11815 var colorName = colorObject && colorObject.name; 11816 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_4__["PanelColor"], { 11817 title: title, 11818 colorName: colorName, 11819 colorValue: colorValue, 11820 initialOpen: initialOpen 11821 }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["createElement"])(_color_palette__WEBPACK_IMPORTED_MODULE_6__["default"], Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({ 11822 value: colorValue 11823 }, Object(lodash__WEBPACK_IMPORTED_MODULE_3__["omit"])(props, ['disableCustomColors'])))); 11824 } 11825 11826 /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_5__["compose"])([_color_palette_with_color_context__WEBPACK_IMPORTED_MODULE_7__["default"], Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_5__["ifCondition"])(function (_ref2) { 11827 var hasColorsToChoose = _ref2.hasColorsToChoose; 11828 return hasColorsToChoose; 11829 })])(PanelColor)); 11830 11831 11832 /***/ }), 11833 11834 /***/ "./node_modules/@wordpress/editor/build-module/components/plain-text/index.js": 11835 /*!************************************************************************************!*\ 11836 !*** ./node_modules/@wordpress/editor/build-module/components/plain-text/index.js ***! 11837 \************************************************************************************/ 11838 /*! exports provided: default */ 11839 /***/ (function(module, __webpack_exports__, __webpack_require__) { 11840 11841 "use strict"; 11842 __webpack_require__.r(__webpack_exports__); 11843 /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js"); 11844 /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutProperties */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js"); 11845 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); 11846 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__); 11847 /* harmony import */ var react_autosize_textarea__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react-autosize-textarea */ "./node_modules/react-autosize-textarea/lib/index.js"); 11848 /* harmony import */ var react_autosize_textarea__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react_autosize_textarea__WEBPACK_IMPORTED_MODULE_3__); 11849 /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); 11850 /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_4__); 11851 11852 11853 11854 11855 /** 11856 * External dependencies 11857 */ 11858 11859 11860 11861 function PlainText(_ref) { 11862 var _onChange = _ref.onChange, 11863 className = _ref.className, 11864 props = Object(_babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__["default"])(_ref, ["onChange", "className"]); 11865 11866 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["createElement"])(react_autosize_textarea__WEBPACK_IMPORTED_MODULE_3___default.a, Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({ 11867 className: classnames__WEBPACK_IMPORTED_MODULE_4___default()('editor-plain-text', className), 11868 onChange: function onChange(event) { 11869 return _onChange(event.target.value); 11870 } 11871 }, props)); 11872 } 11873 11874 /* harmony default export */ __webpack_exports__["default"] = (PlainText); 11875 11876 11877 /***/ }), 11878 11879 /***/ "./node_modules/@wordpress/editor/build-module/components/post-author/check.js": 11880 /*!*************************************************************************************!*\ 11881 !*** ./node_modules/@wordpress/editor/build-module/components/post-author/check.js ***! 11882 \*************************************************************************************/ 11883 /*! exports provided: PostAuthorCheck, default */ 11884 /***/ (function(module, __webpack_exports__, __webpack_require__) { 11885 11886 "use strict"; 11887 __webpack_require__.r(__webpack_exports__); 11888 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PostAuthorCheck", function() { return PostAuthorCheck; }); 11889 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); 11890 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); 11891 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lodash */ "lodash"); 11892 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_1__); 11893 /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose"); 11894 /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_2__); 11895 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); 11896 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_3__); 11897 /* harmony import */ var _post_type_support_check__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../post-type-support-check */ "./node_modules/@wordpress/editor/build-module/components/post-type-support-check/index.js"); 11898 11899 11900 /** 11901 * External dependencies 11902 */ 11903 11904 /** 11905 * WordPress dependencies 11906 */ 11907 11908 11909 11910 /** 11911 * Internal dependencies 11912 */ 11913 11914 11915 function PostAuthorCheck(_ref) { 11916 var hasAssignAuthorAction = _ref.hasAssignAuthorAction, 11917 authors = _ref.authors, 11918 children = _ref.children; 11919 11920 if (!hasAssignAuthorAction || authors.length < 2) { 11921 return null; 11922 } 11923 11924 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_post_type_support_check__WEBPACK_IMPORTED_MODULE_4__["default"], { 11925 supportKeys: "author" 11926 }, children); 11927 } 11928 /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_2__["compose"])([Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_3__["withSelect"])(function (select) { 11929 var post = select('core/editor').getCurrentPost(); 11930 return { 11931 hasAssignAuthorAction: Object(lodash__WEBPACK_IMPORTED_MODULE_1__["get"])(post, ['_links', 'wp:action-assign-author'], false), 11932 postType: select('core/editor').getCurrentPostType(), 11933 authors: select('core').getAuthors() 11934 }; 11935 }), _wordpress_compose__WEBPACK_IMPORTED_MODULE_2__["withInstanceId"]])(PostAuthorCheck)); 11936 11937 11938 /***/ }), 11939 11940 /***/ "./node_modules/@wordpress/editor/build-module/components/post-author/index.js": 11941 /*!*************************************************************************************!*\ 11942 !*** ./node_modules/@wordpress/editor/build-module/components/post-author/index.js ***! 11943 \*************************************************************************************/ 11944 /*! exports provided: PostAuthor, default */ 11945 /***/ (function(module, __webpack_exports__, __webpack_require__) { 11946 11947 "use strict"; 11948 __webpack_require__.r(__webpack_exports__); 11949 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PostAuthor", function() { return PostAuthor; }); 11950 /* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/classCallCheck */ "./node_modules/@babel/runtime/helpers/esm/classCallCheck.js"); 11951 /* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/createClass */ "./node_modules/@babel/runtime/helpers/esm/createClass.js"); 11952 /* harmony import */ var _babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js"); 11953 /* harmony import */ var _babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/esm/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js"); 11954 /* harmony import */ var _babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inherits */ "./node_modules/@babel/runtime/helpers/esm/inherits.js"); 11955 /* harmony import */ var _babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/helpers/esm/assertThisInitialized */ "./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js"); 11956 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); 11957 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__); 11958 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); 11959 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_7__); 11960 /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose"); 11961 /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_8__); 11962 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); 11963 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_9__); 11964 /* harmony import */ var _check__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./check */ "./node_modules/@wordpress/editor/build-module/components/post-author/check.js"); 11965 11966 11967 11968 11969 11970 11971 11972 11973 /** 11974 * WordPress dependencies 11975 */ 11976 11977 11978 11979 11980 /** 11981 * Internal dependencies 11982 */ 11983 11984 11985 var PostAuthor = 11986 /*#__PURE__*/ 11987 function (_Component) { 11988 Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__["default"])(PostAuthor, _Component); 11989 11990 function PostAuthor() { 11991 var _this; 11992 11993 Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__["default"])(this, PostAuthor); 11994 11995 _this = Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__["default"])(this, Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__["default"])(PostAuthor).apply(this, arguments)); 11996 _this.setAuthorId = _this.setAuthorId.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(_this))); 11997 return _this; 11998 } 11999 12000 Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__["default"])(PostAuthor, [{ 12001 key: "setAuthorId", 12002 value: function setAuthorId(event) { 12003 var onUpdateAuthor = this.props.onUpdateAuthor; 12004 var value = event.target.value; 12005 onUpdateAuthor(Number(value)); 12006 } 12007 }, { 12008 key: "render", 12009 value: function render() { 12010 var _this$props = this.props, 12011 postAuthor = _this$props.postAuthor, 12012 instanceId = _this$props.instanceId, 12013 authors = _this$props.authors; 12014 var selectId = 'post-author-selector-' + instanceId; // Disable reason: A select with an onchange throws a warning 12015 12016 /* eslint-disable jsx-a11y/no-onchange */ 12017 12018 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(_check__WEBPACK_IMPORTED_MODULE_10__["default"], null, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("label", { 12019 htmlFor: selectId 12020 }, Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_7__["__"])('Author')), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("select", { 12021 id: selectId, 12022 value: postAuthor, 12023 onChange: this.setAuthorId, 12024 className: "editor-post-author__select" 12025 }, authors.map(function (author) { 12026 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("option", { 12027 key: author.id, 12028 value: author.id 12029 }, author.name); 12030 }))); 12031 /* eslint-enable jsx-a11y/no-onchange */ 12032 } 12033 }]); 12034 12035 return PostAuthor; 12036 }(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["Component"]); 12037 /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_8__["compose"])([Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_9__["withSelect"])(function (select) { 12038 return { 12039 postAuthor: select('core/editor').getEditedPostAttribute('author'), 12040 authors: select('core').getAuthors() 12041 }; 12042 }), Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_9__["withDispatch"])(function (dispatch) { 12043 return { 12044 onUpdateAuthor: function onUpdateAuthor(author) { 12045 dispatch('core/editor').editPost({ 12046 author: author 12047 }); 12048 } 12049 }; 12050 }), _wordpress_compose__WEBPACK_IMPORTED_MODULE_8__["withInstanceId"]])(PostAuthor)); 12051 12052 12053 /***/ }), 12054 12055 /***/ "./node_modules/@wordpress/editor/build-module/components/post-comments/index.js": 12056 /*!***************************************************************************************!*\ 12057 !*** ./node_modules/@wordpress/editor/build-module/components/post-comments/index.js ***! 12058 \***************************************************************************************/ 12059 /*! exports provided: default */ 12060 /***/ (function(module, __webpack_exports__, __webpack_require__) { 12061 12062 "use strict"; 12063 __webpack_require__.r(__webpack_exports__); 12064 /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutProperties */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js"); 12065 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); 12066 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__); 12067 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); 12068 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__); 12069 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); 12070 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__); 12071 /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose"); 12072 /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_4__); 12073 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); 12074 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_5__); 12075 12076 12077 12078 /** 12079 * WordPress dependencies 12080 */ 12081 12082 12083 12084 12085 12086 function PostComments(_ref) { 12087 var _ref$commentStatus = _ref.commentStatus, 12088 commentStatus = _ref$commentStatus === void 0 ? 'open' : _ref$commentStatus, 12089 props = Object(_babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_0__["default"])(_ref, ["commentStatus"]); 12090 12091 var onToggleComments = function onToggleComments() { 12092 return props.editPost({ 12093 comment_status: commentStatus === 'open' ? 'closed' : 'open' 12094 }); 12095 }; 12096 12097 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__["CheckboxControl"], { 12098 label: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__["__"])('Allow Comments'), 12099 checked: commentStatus === 'open', 12100 onChange: onToggleComments 12101 }); 12102 } 12103 12104 /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_4__["compose"])([Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_5__["withSelect"])(function (select) { 12105 return { 12106 commentStatus: select('core/editor').getEditedPostAttribute('comment_status') 12107 }; 12108 }), Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_5__["withDispatch"])(function (dispatch) { 12109 return { 12110 editPost: dispatch('core/editor').editPost 12111 }; 12112 })])(PostComments)); 12113 12114 12115 /***/ }), 12116 12117 /***/ "./node_modules/@wordpress/editor/build-module/components/post-excerpt/check.js": 12118 /*!**************************************************************************************!*\ 12119 !*** ./node_modules/@wordpress/editor/build-module/components/post-excerpt/check.js ***! 12120 \**************************************************************************************/ 12121 /*! exports provided: default */ 12122 /***/ (function(module, __webpack_exports__, __webpack_require__) { 12123 12124 "use strict"; 12125 __webpack_require__.r(__webpack_exports__); 12126 /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js"); 12127 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); 12128 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__); 12129 /* harmony import */ var _post_type_support_check__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../post-type-support-check */ "./node_modules/@wordpress/editor/build-module/components/post-type-support-check/index.js"); 12130 12131 12132 12133 /** 12134 * Internal dependencies 12135 */ 12136 12137 12138 function PostExcerptCheck(props) { 12139 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])(_post_type_support_check__WEBPACK_IMPORTED_MODULE_2__["default"], Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, props, { 12140 supportKeys: "excerpt" 12141 })); 12142 } 12143 12144 /* harmony default export */ __webpack_exports__["default"] = (PostExcerptCheck); 12145 12146 12147 /***/ }), 12148 12149 /***/ "./node_modules/@wordpress/editor/build-module/components/post-excerpt/index.js": 12150 /*!**************************************************************************************!*\ 12151 !*** ./node_modules/@wordpress/editor/build-module/components/post-excerpt/index.js ***! 12152 \**************************************************************************************/ 12153 /*! exports provided: default */ 12154 /***/ (function(module, __webpack_exports__, __webpack_require__) { 12155 12156 "use strict"; 12157 __webpack_require__.r(__webpack_exports__); 12158 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); 12159 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); 12160 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); 12161 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__); 12162 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); 12163 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__); 12164 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); 12165 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_3__); 12166 /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose"); 12167 /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_4__); 12168 12169 12170 /** 12171 * WordPress dependencies 12172 */ 12173 12174 12175 12176 12177 12178 function PostExcerpt(_ref) { 12179 var excerpt = _ref.excerpt, 12180 onUpdateExcerpt = _ref.onUpdateExcerpt; 12181 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("div", { 12182 className: "editor-post-excerpt" 12183 }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__["TextareaControl"], { 12184 label: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__["__"])('Write an excerpt (optional)'), 12185 className: "editor-post-excerpt__textarea", 12186 onChange: function onChange(value) { 12187 return onUpdateExcerpt(value); 12188 }, 12189 value: excerpt 12190 }), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__["ExternalLink"], { 12191 href: "https://codex.wordpress.org/Excerpt" 12192 }, Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__["__"])('Learn more about manual excerpts'))); 12193 } 12194 12195 /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_4__["compose"])([Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_3__["withSelect"])(function (select) { 12196 return { 12197 excerpt: select('core/editor').getEditedPostAttribute('excerpt') 12198 }; 12199 }), Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_3__["withDispatch"])(function (dispatch) { 12200 return { 12201 onUpdateExcerpt: function onUpdateExcerpt(excerpt) { 12202 dispatch('core/editor').editPost({ 12203 excerpt: excerpt 12204 }); 12205 } 12206 }; 12207 })])(PostExcerpt)); 12208 12209 12210 /***/ }), 12211 12212 /***/ "./node_modules/@wordpress/editor/build-module/components/post-featured-image/check.js": 12213 /*!*********************************************************************************************!*\ 12214 !*** ./node_modules/@wordpress/editor/build-module/components/post-featured-image/check.js ***! 12215 \*********************************************************************************************/ 12216 /*! exports provided: default */ 12217 /***/ (function(module, __webpack_exports__, __webpack_require__) { 12218 12219 "use strict"; 12220 __webpack_require__.r(__webpack_exports__); 12221 /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js"); 12222 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); 12223 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__); 12224 /* harmony import */ var _post_type_support_check__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../post-type-support-check */ "./node_modules/@wordpress/editor/build-module/components/post-type-support-check/index.js"); 12225 /* harmony import */ var _theme_support_check__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../theme-support-check */ "./node_modules/@wordpress/editor/build-module/components/theme-support-check/index.js"); 12226 12227 12228 12229 /** 12230 * Internal dependencies 12231 */ 12232 12233 12234 12235 function PostFeaturedImageCheck(props) { 12236 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])(_theme_support_check__WEBPACK_IMPORTED_MODULE_3__["default"], { 12237 supportKeys: "post-thumbnails" 12238 }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])(_post_type_support_check__WEBPACK_IMPORTED_MODULE_2__["default"], Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, props, { 12239 supportKeys: "thumbnail" 12240 }))); 12241 } 12242 12243 /* harmony default export */ __webpack_exports__["default"] = (PostFeaturedImageCheck); 12244 12245 12246 /***/ }), 12247 12248 /***/ "./node_modules/@wordpress/editor/build-module/components/post-featured-image/index.js": 12249 /*!*********************************************************************************************!*\ 12250 !*** ./node_modules/@wordpress/editor/build-module/components/post-featured-image/index.js ***! 12251 \*********************************************************************************************/ 12252 /*! exports provided: default */ 12253 /***/ (function(module, __webpack_exports__, __webpack_require__) { 12254 12255 "use strict"; 12256 __webpack_require__.r(__webpack_exports__); 12257 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); 12258 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); 12259 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lodash */ "lodash"); 12260 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_1__); 12261 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); 12262 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__); 12263 /* harmony import */ var _wordpress_hooks__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/hooks */ "@wordpress/hooks"); 12264 /* harmony import */ var _wordpress_hooks__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_hooks__WEBPACK_IMPORTED_MODULE_3__); 12265 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); 12266 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_4__); 12267 /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose"); 12268 /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_5__); 12269 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); 12270 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_6__); 12271 /* harmony import */ var _check__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./check */ "./node_modules/@wordpress/editor/build-module/components/post-featured-image/check.js"); 12272 /* harmony import */ var _media_upload__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../media-upload */ "./node_modules/@wordpress/editor/build-module/components/media-upload/index.js"); 12273 12274 12275 /** 12276 * External dependencies 12277 */ 12278 12279 /** 12280 * WordPress dependencies 12281 */ 12282 12283 12284 12285 12286 12287 12288 /** 12289 * Internal dependencies 12290 */ 12291 12292 12293 12294 var ALLOWED_MEDIA_TYPES = ['image']; // Used when labels from post type were not yet loaded or when they are not present. 12295 12296 var DEFAULT_SET_FEATURE_IMAGE_LABEL = Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__["__"])('Set featured image'); 12297 12298 var DEFAULT_REMOVE_FEATURE_IMAGE_LABEL = Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__["__"])('Remove image'); 12299 12300 function PostFeaturedImage(_ref) { 12301 var currentPostId = _ref.currentPostId, 12302 featuredImageId = _ref.featuredImageId, 12303 onUpdateImage = _ref.onUpdateImage, 12304 onRemoveImage = _ref.onRemoveImage, 12305 media = _ref.media, 12306 postType = _ref.postType; 12307 var postLabel = Object(lodash__WEBPACK_IMPORTED_MODULE_1__["get"])(postType, ['labels'], {}); 12308 var mediaWidth, mediaHeight, mediaSourceUrl; 12309 12310 if (media) { 12311 var mediaSize = Object(_wordpress_hooks__WEBPACK_IMPORTED_MODULE_3__["applyFilters"])('editor.PostFeaturedImage.imageSize', 'post-thumbnail', media.id, currentPostId); 12312 12313 if (Object(lodash__WEBPACK_IMPORTED_MODULE_1__["has"])(media, ['media_details', 'sizes', mediaSize])) { 12314 mediaWidth = media.media_details.sizes[mediaSize].width; 12315 mediaHeight = media.media_details.sizes[mediaSize].height; 12316 mediaSourceUrl = media.media_details.sizes[mediaSize].source_url; 12317 } else { 12318 mediaWidth = media.media_details.width; 12319 mediaHeight = media.media_details.height; 12320 mediaSourceUrl = media.source_url; 12321 } 12322 } 12323 12324 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_check__WEBPACK_IMPORTED_MODULE_7__["default"], null, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("div", { 12325 className: "editor-post-featured-image" 12326 }, !!featuredImageId && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_media_upload__WEBPACK_IMPORTED_MODULE_8__["default"], { 12327 title: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__["__"])('Set featured image'), 12328 onSelect: onUpdateImage, 12329 allowedTypes: ALLOWED_MEDIA_TYPES, 12330 modalClass: "editor-post-featured-image__media-modal", 12331 render: function render(_ref2) { 12332 var open = _ref2.open; 12333 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_4__["Button"], { 12334 className: "editor-post-featured-image__preview", 12335 onClick: open 12336 }, media && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_4__["ResponsiveWrapper"], { 12337 naturalWidth: mediaWidth, 12338 naturalHeight: mediaHeight 12339 }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("img", { 12340 src: mediaSourceUrl, 12341 alt: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__["__"])('Featured image') 12342 })), !media && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_4__["Spinner"], null)); 12343 }, 12344 value: featuredImageId 12345 }), !!featuredImageId && media && !media.isLoading && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_media_upload__WEBPACK_IMPORTED_MODULE_8__["default"], { 12346 title: postLabel.set_featured_image || DEFAULT_SET_FEATURE_IMAGE_LABEL, 12347 onSelect: onUpdateImage, 12348 allowedTypes: ALLOWED_MEDIA_TYPES, 12349 modalClass: "editor-post-featured-image__media-modal", 12350 render: function render(_ref3) { 12351 var open = _ref3.open; 12352 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_4__["Button"], { 12353 onClick: open, 12354 isDefault: true, 12355 isLarge: true 12356 }, Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__["__"])('Replace image')); 12357 } 12358 }), !featuredImageId && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("div", null, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_media_upload__WEBPACK_IMPORTED_MODULE_8__["default"], { 12359 title: postLabel.set_featured_image || DEFAULT_SET_FEATURE_IMAGE_LABEL, 12360 onSelect: onUpdateImage, 12361 allowedTypes: ALLOWED_MEDIA_TYPES, 12362 modalClass: "editor-post-featured-image__media-modal", 12363 render: function render(_ref4) { 12364 var open = _ref4.open; 12365 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_4__["Button"], { 12366 className: "editor-post-featured-image__toggle", 12367 onClick: open 12368 }, Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__["__"])('Set featured image')); 12369 } 12370 })), !!featuredImageId && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_4__["Button"], { 12371 onClick: onRemoveImage, 12372 isLink: true, 12373 isDestructive: true 12374 }, postLabel.remove_featured_image || DEFAULT_REMOVE_FEATURE_IMAGE_LABEL))); 12375 } 12376 12377 var applyWithSelect = Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_6__["withSelect"])(function (select) { 12378 var _select = select('core'), 12379 getMedia = _select.getMedia, 12380 getPostType = _select.getPostType; 12381 12382 var _select2 = select('core/editor'), 12383 getCurrentPostId = _select2.getCurrentPostId, 12384 getEditedPostAttribute = _select2.getEditedPostAttribute; 12385 12386 var featuredImageId = getEditedPostAttribute('featured_media'); 12387 return { 12388 media: featuredImageId ? getMedia(featuredImageId) : null, 12389 currentPostId: getCurrentPostId(), 12390 postType: getPostType(getEditedPostAttribute('type')), 12391 featuredImageId: featuredImageId 12392 }; 12393 }); 12394 var applyWithDispatch = Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_6__["withDispatch"])(function (dispatch) { 12395 var _dispatch = dispatch('core/editor'), 12396 editPost = _dispatch.editPost; 12397 12398 return { 12399 onUpdateImage: function onUpdateImage(image) { 12400 editPost({ 12401 featured_media: image.id 12402 }); 12403 }, 12404 onRemoveImage: function onRemoveImage() { 12405 editPost({ 12406 featured_media: 0 12407 }); 12408 } 12409 }; 12410 }); 12411 /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_5__["compose"])(applyWithSelect, applyWithDispatch, Object(_wordpress_components__WEBPACK_IMPORTED_MODULE_4__["withFilters"])('editor.PostFeaturedImage'))(PostFeaturedImage)); 12412 12413 12414 /***/ }), 12415 12416 /***/ "./node_modules/@wordpress/editor/build-module/components/post-format/check.js": 12417 /*!*************************************************************************************!*\ 12418 !*** ./node_modules/@wordpress/editor/build-module/components/post-format/check.js ***! 12419 \*************************************************************************************/ 12420 /*! exports provided: default */ 12421 /***/ (function(module, __webpack_exports__, __webpack_require__) { 12422 12423 "use strict"; 12424 __webpack_require__.r(__webpack_exports__); 12425 /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js"); 12426 /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutProperties */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js"); 12427 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); 12428 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__); 12429 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); 12430 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_3__); 12431 /* harmony import */ var _post_type_support_check__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../post-type-support-check */ "./node_modules/@wordpress/editor/build-module/components/post-type-support-check/index.js"); 12432 12433 12434 12435 12436 /** 12437 * WordPress dependencies 12438 */ 12439 12440 /** 12441 * Internal dependencies 12442 */ 12443 12444 12445 12446 function PostFormatCheck(_ref) { 12447 var disablePostFormats = _ref.disablePostFormats, 12448 props = Object(_babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__["default"])(_ref, ["disablePostFormats"]); 12449 12450 return !disablePostFormats && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["createElement"])(_post_type_support_check__WEBPACK_IMPORTED_MODULE_4__["default"], Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, props, { 12451 supportKeys: "post-formats" 12452 })); 12453 } 12454 12455 /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_3__["withSelect"])(function (select) { 12456 var editorSettings = select('core/editor').getEditorSettings(); 12457 return { 12458 disablePostFormats: editorSettings.disablePostFormats 12459 }; 12460 })(PostFormatCheck)); 12461 12462 12463 /***/ }), 12464 12465 /***/ "./node_modules/@wordpress/editor/build-module/components/post-format/index.js": 12466 /*!*************************************************************************************!*\ 12467 !*** ./node_modules/@wordpress/editor/build-module/components/post-format/index.js ***! 12468 \*************************************************************************************/ 12469 /*! exports provided: POST_FORMATS, default */ 12470 /***/ (function(module, __webpack_exports__, __webpack_require__) { 12471 12472 "use strict"; 12473 __webpack_require__.r(__webpack_exports__); 12474 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "POST_FORMATS", function() { return POST_FORMATS; }); 12475 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); 12476 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); 12477 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lodash */ "lodash"); 12478 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_1__); 12479 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); 12480 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__); 12481 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); 12482 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__); 12483 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); 12484 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_4__); 12485 /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose"); 12486 /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_5__); 12487 /* harmony import */ var _check__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./check */ "./node_modules/@wordpress/editor/build-module/components/post-format/check.js"); 12488 12489 12490 /** 12491 * External dependencies 12492 */ 12493 12494 /** 12495 * WordPress dependencies 12496 */ 12497 12498 12499 12500 12501 12502 /** 12503 * Internal dependencies 12504 */ 12505 12506 12507 var POST_FORMATS = [{ 12508 id: 'aside', 12509 caption: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__["__"])('Aside') 12510 }, { 12511 id: 'gallery', 12512 caption: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__["__"])('Gallery') 12513 }, { 12514 id: 'link', 12515 caption: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__["__"])('Link') 12516 }, { 12517 id: 'image', 12518 caption: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__["__"])('Image') 12519 }, { 12520 id: 'quote', 12521 caption: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__["__"])('Quote') 12522 }, { 12523 id: 'standard', 12524 caption: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__["__"])('Standard') 12525 }, { 12526 id: 'status', 12527 caption: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__["__"])('Status') 12528 }, { 12529 id: 'video', 12530 caption: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__["__"])('Video') 12531 }, { 12532 id: 'audio', 12533 caption: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__["__"])('Audio') 12534 }, { 12535 id: 'chat', 12536 caption: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__["__"])('Chat') 12537 }]; 12538 12539 function PostFormat(_ref) { 12540 var onUpdatePostFormat = _ref.onUpdatePostFormat, 12541 _ref$postFormat = _ref.postFormat, 12542 postFormat = _ref$postFormat === void 0 ? 'standard' : _ref$postFormat, 12543 supportedFormats = _ref.supportedFormats, 12544 suggestedFormat = _ref.suggestedFormat, 12545 instanceId = _ref.instanceId; 12546 var postFormatSelectorId = 'post-format-selector-' + instanceId; 12547 var formats = POST_FORMATS.filter(function (format) { 12548 return Object(lodash__WEBPACK_IMPORTED_MODULE_1__["includes"])(supportedFormats, format.id); 12549 }); 12550 var suggestion = Object(lodash__WEBPACK_IMPORTED_MODULE_1__["find"])(formats, function (format) { 12551 return format.id === suggestedFormat; 12552 }); // Disable reason: We need to change the value immiediately to show/hide the suggestion if needed 12553 12554 /* eslint-disable jsx-a11y/no-onchange */ 12555 12556 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_check__WEBPACK_IMPORTED_MODULE_6__["default"], null, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("div", { 12557 className: "editor-post-format" 12558 }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("div", { 12559 className: "editor-post-format__content" 12560 }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("label", { 12561 htmlFor: postFormatSelectorId 12562 }, Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__["__"])('Post Format')), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("select", { 12563 value: postFormat, 12564 onChange: function onChange(event) { 12565 return onUpdatePostFormat(event.target.value); 12566 }, 12567 id: postFormatSelectorId 12568 }, formats.map(function (format) { 12569 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("option", { 12570 key: format.id, 12571 value: format.id 12572 }, format.caption); 12573 }))), suggestion && suggestion.id !== postFormat && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("div", { 12574 className: "editor-post-format__suggestion" 12575 }, Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__["__"])('Suggestion:'), ' ', Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__["Button"], { 12576 isLink: true, 12577 onClick: function onClick() { 12578 return onUpdatePostFormat(suggestion.id); 12579 } 12580 }, suggestion.caption)))); 12581 /* eslint-enable jsx-a11y/no-onchange */ 12582 } 12583 12584 /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_5__["compose"])([Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_4__["withSelect"])(function (select) { 12585 var _select = select('core/editor'), 12586 getEditedPostAttribute = _select.getEditedPostAttribute, 12587 getSuggestedPostFormat = _select.getSuggestedPostFormat; 12588 12589 var postFormat = getEditedPostAttribute('format'); 12590 var themeSupports = select('core').getThemeSupports(); // Ensure current format is always in the set. 12591 // The current format may not be a format supported by the theme. 12592 12593 var supportedFormats = Object(lodash__WEBPACK_IMPORTED_MODULE_1__["union"])([postFormat], Object(lodash__WEBPACK_IMPORTED_MODULE_1__["get"])(themeSupports, ['formats'], [])); 12594 return { 12595 postFormat: postFormat, 12596 supportedFormats: supportedFormats, 12597 suggestedFormat: getSuggestedPostFormat() 12598 }; 12599 }), Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_4__["withDispatch"])(function (dispatch) { 12600 return { 12601 onUpdatePostFormat: function onUpdatePostFormat(postFormat) { 12602 dispatch('core/editor').editPost({ 12603 format: postFormat 12604 }); 12605 } 12606 }; 12607 }), _wordpress_compose__WEBPACK_IMPORTED_MODULE_5__["withInstanceId"]])(PostFormat)); 12608 12609 12610 /***/ }), 12611 12612 /***/ "./node_modules/@wordpress/editor/build-module/components/post-last-revision/check.js": 12613 /*!********************************************************************************************!*\ 12614 !*** ./node_modules/@wordpress/editor/build-module/components/post-last-revision/check.js ***! 12615 \********************************************************************************************/ 12616 /*! exports provided: PostLastRevisionCheck, default */ 12617 /***/ (function(module, __webpack_exports__, __webpack_require__) { 12618 12619 "use strict"; 12620 __webpack_require__.r(__webpack_exports__); 12621 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PostLastRevisionCheck", function() { return PostLastRevisionCheck; }); 12622 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); 12623 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); 12624 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); 12625 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_1__); 12626 /* harmony import */ var _post_type_support_check__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../post-type-support-check */ "./node_modules/@wordpress/editor/build-module/components/post-type-support-check/index.js"); 12627 12628 12629 /** 12630 * WordPress dependencies 12631 */ 12632 12633 /** 12634 * Internal dependencies 12635 */ 12636 12637 12638 function PostLastRevisionCheck(_ref) { 12639 var lastRevisionId = _ref.lastRevisionId, 12640 revisionsCount = _ref.revisionsCount, 12641 children = _ref.children; 12642 12643 if (!lastRevisionId || revisionsCount < 2) { 12644 return null; 12645 } 12646 12647 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_post_type_support_check__WEBPACK_IMPORTED_MODULE_2__["default"], { 12648 supportKeys: "revisions" 12649 }, children); 12650 } 12651 /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_1__["withSelect"])(function (select) { 12652 var _select = select('core/editor'), 12653 getCurrentPostLastRevisionId = _select.getCurrentPostLastRevisionId, 12654 getCurrentPostRevisionsCount = _select.getCurrentPostRevisionsCount; 12655 12656 return { 12657 lastRevisionId: getCurrentPostLastRevisionId(), 12658 revisionsCount: getCurrentPostRevisionsCount() 12659 }; 12660 })(PostLastRevisionCheck)); 12661 12662 12663 /***/ }), 12664 12665 /***/ "./node_modules/@wordpress/editor/build-module/components/post-last-revision/index.js": 12666 /*!********************************************************************************************!*\ 12667 !*** ./node_modules/@wordpress/editor/build-module/components/post-last-revision/index.js ***! 12668 \********************************************************************************************/ 12669 /*! exports provided: default */ 12670 /***/ (function(module, __webpack_exports__, __webpack_require__) { 12671 12672 "use strict"; 12673 __webpack_require__.r(__webpack_exports__); 12674 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); 12675 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); 12676 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); 12677 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__); 12678 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); 12679 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__); 12680 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); 12681 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_3__); 12682 /* harmony import */ var _check__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./check */ "./node_modules/@wordpress/editor/build-module/components/post-last-revision/check.js"); 12683 /* harmony import */ var _utils_url__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../utils/url */ "./node_modules/@wordpress/editor/build-module/utils/url.js"); 12684 12685 12686 /** 12687 * WordPress dependencies 12688 */ 12689 12690 12691 12692 /** 12693 * Internal dependencies 12694 */ 12695 12696 12697 12698 12699 function LastRevision(_ref) { 12700 var lastRevisionId = _ref.lastRevisionId, 12701 revisionsCount = _ref.revisionsCount; 12702 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_check__WEBPACK_IMPORTED_MODULE_4__["default"], null, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__["IconButton"], { 12703 href: Object(_utils_url__WEBPACK_IMPORTED_MODULE_5__["getWPAdminURL"])('revision.php', { 12704 revision: lastRevisionId, 12705 gutenberg: true 12706 }), 12707 className: "editor-post-last-revision__title", 12708 icon: "backup" 12709 }, Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__["sprintf"])(Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__["_n"])('%d Revision', '%d Revisions', revisionsCount), revisionsCount))); 12710 } 12711 12712 /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_3__["withSelect"])(function (select) { 12713 var _select = select('core/editor'), 12714 getCurrentPostLastRevisionId = _select.getCurrentPostLastRevisionId, 12715 getCurrentPostRevisionsCount = _select.getCurrentPostRevisionsCount; 12716 12717 return { 12718 lastRevisionId: getCurrentPostLastRevisionId(), 12719 revisionsCount: getCurrentPostRevisionsCount() 12720 }; 12721 })(LastRevision)); 12722 12723 12724 /***/ }), 12725 12726 /***/ "./node_modules/@wordpress/editor/build-module/components/post-locked-modal/index.js": 12727 /*!*******************************************************************************************!*\ 12728 !*** ./node_modules/@wordpress/editor/build-module/components/post-locked-modal/index.js ***! 12729 \*******************************************************************************************/ 12730 /*! exports provided: default */ 12731 /***/ (function(module, __webpack_exports__, __webpack_require__) { 12732 12733 "use strict"; 12734 __webpack_require__.r(__webpack_exports__); 12735 /* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/classCallCheck */ "./node_modules/@babel/runtime/helpers/esm/classCallCheck.js"); 12736 /* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/createClass */ "./node_modules/@babel/runtime/helpers/esm/createClass.js"); 12737 /* harmony import */ var _babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js"); 12738 /* harmony import */ var _babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/esm/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js"); 12739 /* harmony import */ var _babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inherits */ "./node_modules/@babel/runtime/helpers/esm/inherits.js"); 12740 /* harmony import */ var _babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/helpers/esm/assertThisInitialized */ "./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js"); 12741 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); 12742 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__); 12743 /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! jquery */ "jquery"); 12744 /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_7__); 12745 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); 12746 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_8__); 12747 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); 12748 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_9__); 12749 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); 12750 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_10__); 12751 /* harmony import */ var _wordpress_url__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @wordpress/url */ "@wordpress/url"); 12752 /* harmony import */ var _wordpress_url__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(_wordpress_url__WEBPACK_IMPORTED_MODULE_11__); 12753 /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose"); 12754 /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_12__); 12755 /* harmony import */ var _utils_url__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../../utils/url */ "./node_modules/@wordpress/editor/build-module/utils/url.js"); 12756 /* harmony import */ var _post_preview_button__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../post-preview-button */ "./node_modules/@wordpress/editor/build-module/components/post-preview-button/index.js"); 12757 12758 12759 12760 12761 12762 12763 12764 12765 /** 12766 * External dependencies 12767 */ 12768 12769 /** 12770 * WordPress dependencies 12771 */ 12772 12773 12774 12775 12776 12777 12778 12779 /** 12780 * Internal dependencies 12781 */ 12782 12783 12784 12785 12786 var PostLockedModal = 12787 /*#__PURE__*/ 12788 function (_Component) { 12789 Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__["default"])(PostLockedModal, _Component); 12790 12791 function PostLockedModal() { 12792 var _this; 12793 12794 Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__["default"])(this, PostLockedModal); 12795 12796 _this = Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__["default"])(this, Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__["default"])(PostLockedModal).apply(this, arguments)); 12797 _this.sendPostLock = _this.sendPostLock.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(_this))); 12798 _this.receivePostLock = _this.receivePostLock.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(_this))); 12799 _this.releasePostLock = _this.releasePostLock.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(_this))); 12800 return _this; 12801 } 12802 12803 Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__["default"])(PostLockedModal, [{ 12804 key: "componentDidMount", 12805 value: function componentDidMount() { 12806 // Details on these events on the Heartbeat API docs 12807 // https://developer.wordpress.org/plugins/javascript/heartbeat-api/ 12808 jquery__WEBPACK_IMPORTED_MODULE_7___default()(document).on('heartbeat-send.refresh-lock', this.sendPostLock).on('heartbeat-tick.refresh-lock', this.receivePostLock); 12809 } 12810 }, { 12811 key: "componentWillUnmount", 12812 value: function componentWillUnmount() { 12813 jquery__WEBPACK_IMPORTED_MODULE_7___default()(document).off('heartbeat-send.refresh-lock', this.sendPostLock).off('heartbeat-tick.refresh-lock', this.receivePostLock); 12814 } 12815 /** 12816 * Keep the lock refreshed. 12817 * 12818 * When the user does not send a heartbeat in a heartbeat-tick 12819 * the user is no longer editing and another user can start editing. 12820 * 12821 * @param {Object} event Event. 12822 * @param {Object} data Data to send in the heartbeat request. 12823 */ 12824 12825 }, { 12826 key: "sendPostLock", 12827 value: function sendPostLock(event, data) { 12828 var _this$props = this.props, 12829 isLocked = _this$props.isLocked, 12830 activePostLock = _this$props.activePostLock, 12831 postId = _this$props.postId; 12832 12833 if (isLocked) { 12834 return; 12835 } 12836 12837 data['wp-refresh-post-lock'] = { 12838 lock: activePostLock, 12839 post_id: postId 12840 }; 12841 } 12842 /** 12843 * Refresh post locks: update the lock string or show the dialog if somebody has taken over editing. 12844 * 12845 * @param {Object} event Event. 12846 * @param {Object} data Data received in the heartbeat request 12847 */ 12848 12849 }, { 12850 key: "receivePostLock", 12851 value: function receivePostLock(event, data) { 12852 if (!data['wp-refresh-post-lock']) { 12853 return; 12854 } 12855 12856 var _this$props2 = this.props, 12857 autosave = _this$props2.autosave, 12858 updatePostLock = _this$props2.updatePostLock; 12859 var received = data['wp-refresh-post-lock']; 12860 12861 if (received.lock_error) { 12862 // Auto save and display the takeover modal. 12863 autosave(); 12864 updatePostLock({ 12865 isLocked: true, 12866 isTakeover: true, 12867 user: { 12868 avatar: received.lock_error.avatar_src 12869 } 12870 }); 12871 } else if (received.new_lock) { 12872 updatePostLock({ 12873 isLocked: false, 12874 activePostLock: received.new_lock 12875 }); 12876 } 12877 } 12878 /** 12879 * Unlock the post before the window is exited. 12880 */ 12881 12882 }, { 12883 key: "releasePostLock", 12884 value: function releasePostLock() { 12885 var _this$props3 = this.props, 12886 isLocked = _this$props3.isLocked, 12887 activePostLock = _this$props3.activePostLock, 12888 postLockUtils = _this$props3.postLockUtils, 12889 postId = _this$props3.postId; 12890 12891 if (isLocked || !activePostLock) { 12892 return; 12893 } 12894 12895 var data = { 12896 action: 'wp-remove-post-lock', 12897 _wpnonce: postLockUtils.unlockNonce, 12898 post_ID: postId, 12899 active_post_lock: activePostLock 12900 }; 12901 jquery__WEBPACK_IMPORTED_MODULE_7___default.a.post({ 12902 async: false, 12903 url: postLockUtils.ajaxUrl, 12904 data: data 12905 }); 12906 } 12907 }, { 12908 key: "render", 12909 value: function render() { 12910 var _this$props4 = this.props, 12911 user = _this$props4.user, 12912 postId = _this$props4.postId, 12913 isLocked = _this$props4.isLocked, 12914 isTakeover = _this$props4.isTakeover, 12915 postLockUtils = _this$props4.postLockUtils; 12916 12917 if (!isLocked) { 12918 return null; 12919 } 12920 12921 var userDisplayName = user.name; 12922 var userAvatar = user.avatar; 12923 var unlockUrl = Object(_wordpress_url__WEBPACK_IMPORTED_MODULE_11__["addQueryArgs"])('post.php', { 12924 'get-post-lock': '1', 12925 lockKey: true, 12926 post: postId, 12927 action: 'edit', 12928 _wpnonce: postLockUtils.nonce 12929 }); 12930 var allPosts = Object(_utils_url__WEBPACK_IMPORTED_MODULE_13__["getWPAdminURL"])('edit.php'); 12931 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_9__["Modal"], { 12932 title: isTakeover ? Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_8__["__"])('Someone else has taken over this post.') : Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_8__["__"])('This post is already being edited.'), 12933 focusOnMount: true, 12934 shouldCloseOnClickOutside: false, 12935 shouldCloseOnEsc: false, 12936 isDismissable: false, 12937 className: "editor-post-locked-modal" 12938 }, !!userAvatar && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("img", { 12939 src: userAvatar, 12940 alt: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_8__["__"])('Avatar'), 12941 className: "editor-post-locked-modal__avatar" 12942 }), !!isTakeover && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("div", null, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("div", null, userDisplayName ? Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_8__["sprintf"])( 12943 /* translators: 'post' is generic and may be of any type (post, page, etc.). */ 12944 Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_8__["__"])('%s now has editing control of this post. Don\'t worry, your changes up to this moment have been saved'), userDisplayName) : 12945 /* translators: 'post' is generic and may be of any type (post, page, etc.). */ 12946 Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_8__["__"])('Another user now has editing control of this post. Don\'t worry, your changes up to this moment have been saved')), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("p", null, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("a", { 12947 href: allPosts 12948 }, Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_8__["__"])('View all posts')))), !isTakeover && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("div", null, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("div", null, userDisplayName ? Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_8__["sprintf"])( 12949 /* translators: 'post' is generic and may be of any type (post, page, etc.). */ 12950 Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_8__["__"])('%s is currently working on this post, which means you cannot make changes, unless you take over.'), userDisplayName) : 12951 /* translators: 'post' is generic and may be of any type (post, page, etc.). */ 12952 Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_8__["__"])('Another user is currently working on this post, which means you cannot make changes, unless you take over.')), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("div", { 12953 className: "editor-post-locked-modal__buttons" 12954 }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_9__["Button"], { 12955 isDefault: true, 12956 isLarge: true, 12957 href: allPosts 12958 }, Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_8__["__"])('All Posts')), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(_post_preview_button__WEBPACK_IMPORTED_MODULE_14__["default"], null), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_9__["Button"], { 12959 isPrimary: true, 12960 isLarge: true, 12961 href: unlockUrl 12962 }, Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_8__["__"])('Take Over'))))); 12963 } 12964 }]); 12965 12966 return PostLockedModal; 12967 }(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["Component"]); 12968 12969 /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_12__["compose"])(Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_10__["withSelect"])(function (select) { 12970 var _select = select('core/editor'), 12971 getEditorSettings = _select.getEditorSettings, 12972 isPostLocked = _select.isPostLocked, 12973 isPostLockTakeover = _select.isPostLockTakeover, 12974 getPostLockUser = _select.getPostLockUser, 12975 getCurrentPostId = _select.getCurrentPostId, 12976 getActivePostLock = _select.getActivePostLock; 12977 12978 return { 12979 isLocked: isPostLocked(), 12980 isTakeover: isPostLockTakeover(), 12981 user: getPostLockUser(), 12982 postId: getCurrentPostId(), 12983 postLockUtils: getEditorSettings().postLockUtils, 12984 activePostLock: getActivePostLock() 12985 }; 12986 }), Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_10__["withDispatch"])(function (dispatch) { 12987 var _dispatch = dispatch('core/editor'), 12988 autosave = _dispatch.autosave, 12989 updatePostLock = _dispatch.updatePostLock; 12990 12991 return { 12992 autosave: autosave, 12993 updatePostLock: updatePostLock 12994 }; 12995 }), Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_12__["withGlobalEvents"])({ 12996 beforeunload: 'releasePostLock' 12997 }))(PostLockedModal)); 12998 12999 13000 /***/ }), 13001 13002 /***/ "./node_modules/@wordpress/editor/build-module/components/post-pending-status/check.js": 13003 /*!*********************************************************************************************!*\ 13004 !*** ./node_modules/@wordpress/editor/build-module/components/post-pending-status/check.js ***! 13005 \*********************************************************************************************/ 13006 /*! exports provided: PostPendingStatusCheck, default */ 13007 /***/ (function(module, __webpack_exports__, __webpack_require__) { 13008 13009 "use strict"; 13010 __webpack_require__.r(__webpack_exports__); 13011 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PostPendingStatusCheck", function() { return PostPendingStatusCheck; }); 13012 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash */ "lodash"); 13013 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_0__); 13014 /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose"); 13015 /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_1__); 13016 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); 13017 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_2__); 13018 /** 13019 * External dependencies 13020 */ 13021 13022 /** 13023 * WordPress dependencies 13024 */ 13025 13026 13027 13028 function PostPendingStatusCheck(_ref) { 13029 var hasPublishAction = _ref.hasPublishAction, 13030 isPublished = _ref.isPublished, 13031 children = _ref.children; 13032 13033 if (isPublished || !hasPublishAction) { 13034 return null; 13035 } 13036 13037 return children; 13038 } 13039 /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_1__["compose"])(Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_2__["withSelect"])(function (select) { 13040 var _select = select('core/editor'), 13041 isCurrentPostPublished = _select.isCurrentPostPublished, 13042 getCurrentPostType = _select.getCurrentPostType, 13043 getCurrentPost = _select.getCurrentPost; 13044 13045 return { 13046 hasPublishAction: Object(lodash__WEBPACK_IMPORTED_MODULE_0__["get"])(getCurrentPost(), ['_links', 'wp:action-publish'], false), 13047 isPublished: isCurrentPostPublished(), 13048 postType: getCurrentPostType() 13049 }; 13050 }))(PostPendingStatusCheck)); 13051 13052 13053 /***/ }), 13054 13055 /***/ "./node_modules/@wordpress/editor/build-module/components/post-pending-status/index.js": 13056 /*!*********************************************************************************************!*\ 13057 !*** ./node_modules/@wordpress/editor/build-module/components/post-pending-status/index.js ***! 13058 \*********************************************************************************************/ 13059 /*! exports provided: PostPendingStatus, default */ 13060 /***/ (function(module, __webpack_exports__, __webpack_require__) { 13061 13062 "use strict"; 13063 __webpack_require__.r(__webpack_exports__); 13064 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PostPendingStatus", function() { return PostPendingStatus; }); 13065 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); 13066 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); 13067 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); 13068 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__); 13069 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); 13070 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__); 13071 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); 13072 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_3__); 13073 /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose"); 13074 /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_4__); 13075 /* harmony import */ var _check__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./check */ "./node_modules/@wordpress/editor/build-module/components/post-pending-status/check.js"); 13076 13077 13078 /** 13079 * WordPress dependencies 13080 */ 13081 13082 13083 13084 13085 /** 13086 * Internal dependencies 13087 */ 13088 13089 13090 function PostPendingStatus(_ref) { 13091 var status = _ref.status, 13092 onUpdateStatus = _ref.onUpdateStatus; 13093 13094 var togglePendingStatus = function togglePendingStatus() { 13095 var updatedStatus = status === 'pending' ? 'draft' : 'pending'; 13096 onUpdateStatus(updatedStatus); 13097 }; 13098 13099 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_check__WEBPACK_IMPORTED_MODULE_5__["default"], null, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__["CheckboxControl"], { 13100 label: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__["__"])('Pending Review'), 13101 checked: status === 'pending', 13102 onChange: togglePendingStatus 13103 })); 13104 } 13105 /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_4__["compose"])(Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_3__["withSelect"])(function (select) { 13106 return { 13107 status: select('core/editor').getEditedPostAttribute('status') 13108 }; 13109 }), Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_3__["withDispatch"])(function (dispatch) { 13110 return { 13111 onUpdateStatus: function onUpdateStatus(status) { 13112 dispatch('core/editor').editPost({ 13113 status: status 13114 }); 13115 } 13116 }; 13117 }))(PostPendingStatus)); 13118 13119 13120 /***/ }), 13121 13122 /***/ "./node_modules/@wordpress/editor/build-module/components/post-permalink/editor.js": 13123 /*!*****************************************************************************************!*\ 13124 !*** ./node_modules/@wordpress/editor/build-module/components/post-permalink/editor.js ***! 13125 \*****************************************************************************************/ 13126 /*! exports provided: default */ 13127 /***/ (function(module, __webpack_exports__, __webpack_require__) { 13128 13129 "use strict"; 13130 __webpack_require__.r(__webpack_exports__); 13131 /* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/classCallCheck */ "./node_modules/@babel/runtime/helpers/esm/classCallCheck.js"); 13132 /* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/createClass */ "./node_modules/@babel/runtime/helpers/esm/createClass.js"); 13133 /* harmony import */ var _babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js"); 13134 /* harmony import */ var _babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/esm/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js"); 13135 /* harmony import */ var _babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inherits */ "./node_modules/@babel/runtime/helpers/esm/inherits.js"); 13136 /* harmony import */ var _babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/helpers/esm/assertThisInitialized */ "./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js"); 13137 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); 13138 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__); 13139 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); 13140 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_7__); 13141 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); 13142 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_8__); 13143 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); 13144 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_9__); 13145 /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose"); 13146 /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_10__); 13147 13148 13149 13150 13151 13152 13153 13154 13155 /** 13156 * WordPress dependencies 13157 */ 13158 13159 13160 13161 13162 13163 13164 var PostPermalinkEditor = 13165 /*#__PURE__*/ 13166 function (_Component) { 13167 Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__["default"])(PostPermalinkEditor, _Component); 13168 13169 function PostPermalinkEditor(_ref) { 13170 var _this; 13171 13172 var permalinkParts = _ref.permalinkParts; 13173 13174 Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__["default"])(this, PostPermalinkEditor); 13175 13176 _this = Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__["default"])(this, Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__["default"])(PostPermalinkEditor).apply(this, arguments)); 13177 _this.state = { 13178 editedPostName: permalinkParts.postName 13179 }; 13180 _this.onSavePermalink = _this.onSavePermalink.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(_this))); 13181 return _this; 13182 } 13183 13184 Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__["default"])(PostPermalinkEditor, [{ 13185 key: "onSavePermalink", 13186 value: function onSavePermalink(event) { 13187 var postName = this.state.editedPostName.replace(/\s+/g, '-'); 13188 event.preventDefault(); 13189 this.props.onSave(); 13190 13191 if (postName === this.props.postName) { 13192 return; 13193 } 13194 13195 this.props.editPost({ 13196 slug: postName 13197 }); 13198 this.setState({ 13199 editedPostName: postName 13200 }); 13201 } 13202 }, { 13203 key: "render", 13204 value: function render() { 13205 var _this2 = this; 13206 13207 var _this$props$permalink = this.props.permalinkParts, 13208 prefix = _this$props$permalink.prefix, 13209 suffix = _this$props$permalink.suffix; 13210 var editedPostName = this.state.editedPostName; 13211 /* eslint-disable jsx-a11y/no-autofocus */ 13212 // Autofocus is allowed here, as this mini-UI is only loaded when the user clicks to open it. 13213 13214 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("form", { 13215 className: "editor-post-permalink-editor", 13216 onSubmit: this.onSavePermalink 13217 }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("span", { 13218 className: "editor-post-permalink__editor-container" 13219 }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("span", { 13220 className: "editor-post-permalink-editor__prefix" 13221 }, prefix), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("input", { 13222 className: "editor-post-permalink-editor__edit", 13223 "aria-label": Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_8__["__"])('Edit post permalink'), 13224 value: editedPostName, 13225 onChange: function onChange(event) { 13226 return _this2.setState({ 13227 editedPostName: event.target.value 13228 }); 13229 }, 13230 type: "text", 13231 autoFocus: true 13232 }), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("span", { 13233 className: "editor-post-permalink-editor__suffix" 13234 }, suffix), "\u200E"), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_9__["Button"], { 13235 className: "editor-post-permalink-editor__save", 13236 isLarge: true, 13237 onClick: this.onSavePermalink 13238 }, Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_8__["__"])('Save'))); 13239 /* eslint-enable jsx-a11y/no-autofocus */ 13240 } 13241 }]); 13242 13243 return PostPermalinkEditor; 13244 }(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["Component"]); 13245 13246 /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_10__["compose"])([Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_7__["withSelect"])(function (select) { 13247 var _select = select('core/editor'), 13248 getPermalinkParts = _select.getPermalinkParts; 13249 13250 return { 13251 permalinkParts: getPermalinkParts() 13252 }; 13253 }), Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_7__["withDispatch"])(function (dispatch) { 13254 var _dispatch = dispatch('core/editor'), 13255 editPost = _dispatch.editPost; 13256 13257 return { 13258 editPost: editPost 13259 }; 13260 })])(PostPermalinkEditor)); 13261 13262 13263 /***/ }), 13264 13265 /***/ "./node_modules/@wordpress/editor/build-module/components/post-permalink/index.js": 13266 /*!****************************************************************************************!*\ 13267 !*** ./node_modules/@wordpress/editor/build-module/components/post-permalink/index.js ***! 13268 \****************************************************************************************/ 13269 /*! exports provided: default */ 13270 /***/ (function(module, __webpack_exports__, __webpack_require__) { 13271 13272 "use strict"; 13273 __webpack_require__.r(__webpack_exports__); 13274 /* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/classCallCheck */ "./node_modules/@babel/runtime/helpers/esm/classCallCheck.js"); 13275 /* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/createClass */ "./node_modules/@babel/runtime/helpers/esm/createClass.js"); 13276 /* harmony import */ var _babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js"); 13277 /* harmony import */ var _babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/esm/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js"); 13278 /* harmony import */ var _babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inherits */ "./node_modules/@babel/runtime/helpers/esm/inherits.js"); 13279 /* harmony import */ var _babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/helpers/esm/assertThisInitialized */ "./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js"); 13280 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); 13281 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__); 13282 /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); 13283 /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_7__); 13284 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); 13285 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_8__); 13286 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); 13287 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_9__); 13288 /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose"); 13289 /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_10__); 13290 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); 13291 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_11__); 13292 /* harmony import */ var _editor_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./editor.js */ "./node_modules/@wordpress/editor/build-module/components/post-permalink/editor.js"); 13293 /* harmony import */ var _utils_url__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../../utils/url */ "./node_modules/@wordpress/editor/build-module/utils/url.js"); 13294 13295 13296 13297 13298 13299 13300 13301 13302 /** 13303 * External dependencies 13304 */ 13305 13306 /** 13307 * WordPress dependencies 13308 */ 13309 13310 13311 13312 13313 13314 13315 /** 13316 * Internal Dependencies 13317 */ 13318 13319 13320 13321 13322 var PostPermalink = 13323 /*#__PURE__*/ 13324 function (_Component) { 13325 Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__["default"])(PostPermalink, _Component); 13326 13327 function PostPermalink() { 13328 var _this; 13329 13330 Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__["default"])(this, PostPermalink); 13331 13332 _this = Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__["default"])(this, Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__["default"])(PostPermalink).apply(this, arguments)); 13333 _this.addVisibilityCheck = _this.addVisibilityCheck.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(_this))); 13334 _this.onVisibilityChange = _this.onVisibilityChange.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(_this))); 13335 _this.state = { 13336 isCopied: false, 13337 isEditingPermalink: false 13338 }; 13339 return _this; 13340 } 13341 13342 Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__["default"])(PostPermalink, [{ 13343 key: "addVisibilityCheck", 13344 value: function addVisibilityCheck() { 13345 window.addEventListener('visibilitychange', this.onVisibilityChange); 13346 } 13347 }, { 13348 key: "onVisibilityChange", 13349 value: function onVisibilityChange() { 13350 var _this$props = this.props, 13351 isEditable = _this$props.isEditable, 13352 refreshPost = _this$props.refreshPost; // If the user just returned after having clicked the "Change Permalinks" button, 13353 // fetch a new copy of the post from the server, just in case they enabled permalinks. 13354 13355 if (!isEditable && 'visible' === document.visibilityState) { 13356 refreshPost(); 13357 } 13358 } 13359 }, { 13360 key: "componentDidUpdate", 13361 value: function componentDidUpdate(prevProps, prevState) { 13362 // If we've just stopped editing the permalink, focus on the new permalink. 13363 if (prevState.isEditingPermalink && !this.state.isEditingPermalink) { 13364 this.linkElement.focus(); 13365 } 13366 } 13367 }, { 13368 key: "componentWillUnmount", 13369 value: function componentWillUnmount() { 13370 window.removeEventListener('visibilitychange', this.addVisibilityCheck); 13371 } 13372 }, { 13373 key: "render", 13374 value: function render() { 13375 var _this2 = this; 13376 13377 var _this$props2 = this.props, 13378 isNew = _this$props2.isNew, 13379 postLink = _this$props2.postLink, 13380 isEditable = _this$props2.isEditable, 13381 samplePermalink = _this$props2.samplePermalink, 13382 isPublished = _this$props2.isPublished; 13383 var _this$state = this.state, 13384 isCopied = _this$state.isCopied, 13385 isEditingPermalink = _this$state.isEditingPermalink; 13386 var ariaLabel = isCopied ? Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_9__["__"])('Permalink copied') : Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_9__["__"])('Copy the permalink'); 13387 13388 if (isNew || !postLink) { 13389 return null; 13390 } 13391 13392 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("div", { 13393 className: "editor-post-permalink" 13394 }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_11__["ClipboardButton"], { 13395 className: classnames__WEBPACK_IMPORTED_MODULE_7___default()('editor-post-permalink__copy', { 13396 'is-copied': isCopied 13397 }), 13398 text: samplePermalink, 13399 label: ariaLabel, 13400 onCopy: function onCopy() { 13401 return _this2.setState({ 13402 isCopied: true 13403 }); 13404 }, 13405 "aria-disabled": isCopied, 13406 icon: "admin-links" 13407 }), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("span", { 13408 className: "editor-post-permalink__label" 13409 }, Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_9__["__"])('Permalink:')), !isEditingPermalink && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_11__["ExternalLink"], { 13410 className: "editor-post-permalink__link", 13411 href: !isPublished ? postLink : samplePermalink, 13412 target: "_blank", 13413 ref: function ref(linkElement) { 13414 return _this2.linkElement = linkElement; 13415 } 13416 }, decodeURI(samplePermalink), "\u200E"), isEditingPermalink && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(_editor_js__WEBPACK_IMPORTED_MODULE_12__["default"], { 13417 onSave: function onSave() { 13418 return _this2.setState({ 13419 isEditingPermalink: false 13420 }); 13421 } 13422 }), isEditable && !isEditingPermalink && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_11__["Button"], { 13423 className: "editor-post-permalink__edit", 13424 isLarge: true, 13425 onClick: function onClick() { 13426 return _this2.setState({ 13427 isEditingPermalink: true 13428 }); 13429 } 13430 }, Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_9__["__"])('Edit')), !isEditable && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_11__["Button"], { 13431 className: "editor-post-permalink__change", 13432 isLarge: true, 13433 href: Object(_utils_url__WEBPACK_IMPORTED_MODULE_13__["getWPAdminURL"])('options-permalink.php'), 13434 onClick: this.addVisibilityCheck, 13435 target: "_blank" 13436 }, Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_9__["__"])('Change Permalinks'))); 13437 } 13438 }]); 13439 13440 return PostPermalink; 13441 }(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["Component"]); 13442 13443 /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_10__["compose"])([Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_8__["withSelect"])(function (select) { 13444 var _select = select('core/editor'), 13445 isEditedPostNew = _select.isEditedPostNew, 13446 isPermalinkEditable = _select.isPermalinkEditable, 13447 getCurrentPost = _select.getCurrentPost, 13448 getPermalink = _select.getPermalink, 13449 isCurrentPostPublished = _select.isCurrentPostPublished; 13450 13451 var _getCurrentPost = getCurrentPost(), 13452 link = _getCurrentPost.link; 13453 13454 return { 13455 isNew: isEditedPostNew(), 13456 postLink: link, 13457 isEditable: isPermalinkEditable(), 13458 samplePermalink: getPermalink(), 13459 isPublished: isCurrentPostPublished() 13460 }; 13461 }), Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_8__["withDispatch"])(function (dispatch) { 13462 var _dispatch = dispatch('core/editor'), 13463 refreshPost = _dispatch.refreshPost; 13464 13465 return { 13466 refreshPost: refreshPost 13467 }; 13468 })])(PostPermalink)); 13469 13470 13471 /***/ }), 13472 13473 /***/ "./node_modules/@wordpress/editor/build-module/components/post-pingbacks/index.js": 13474 /*!****************************************************************************************!*\ 13475 !*** ./node_modules/@wordpress/editor/build-module/components/post-pingbacks/index.js ***! 13476 \****************************************************************************************/ 13477 /*! exports provided: default */ 13478 /***/ (function(module, __webpack_exports__, __webpack_require__) { 13479 13480 "use strict"; 13481 __webpack_require__.r(__webpack_exports__); 13482 /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutProperties */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js"); 13483 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); 13484 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__); 13485 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); 13486 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__); 13487 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); 13488 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__); 13489 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); 13490 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_4__); 13491 /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose"); 13492 /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_5__); 13493 13494 13495 13496 /** 13497 * WordPress dependencies 13498 */ 13499 13500 13501 13502 13503 13504 function PostPingbacks(_ref) { 13505 var _ref$pingStatus = _ref.pingStatus, 13506 pingStatus = _ref$pingStatus === void 0 ? 'open' : _ref$pingStatus, 13507 props = Object(_babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_0__["default"])(_ref, ["pingStatus"]); 13508 13509 var onTogglePingback = function onTogglePingback() { 13510 return props.editPost({ 13511 ping_status: pingStatus === 'open' ? 'closed' : 'open' 13512 }); 13513 }; 13514 13515 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__["CheckboxControl"], { 13516 label: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__["__"])('Allow Pingbacks & Trackbacks'), 13517 checked: pingStatus === 'open', 13518 onChange: onTogglePingback 13519 }); 13520 } 13521 13522 /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_5__["compose"])([Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_4__["withSelect"])(function (select) { 13523 return { 13524 pingStatus: select('core/editor').getEditedPostAttribute('ping_status') 13525 }; 13526 }), Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_4__["withDispatch"])(function (dispatch) { 13527 return { 13528 editPost: dispatch('core/editor').editPost 13529 }; 13530 })])(PostPingbacks)); 13531 13532 13533 /***/ }), 13534 13535 /***/ "./node_modules/@wordpress/editor/build-module/components/post-preview-button/index.js": 13536 /*!*********************************************************************************************!*\ 13537 !*** ./node_modules/@wordpress/editor/build-module/components/post-preview-button/index.js ***! 13538 \*********************************************************************************************/ 13539 /*! exports provided: PostPreviewButton, default */ 13540 /***/ (function(module, __webpack_exports__, __webpack_require__) { 13541 13542 "use strict"; 13543 __webpack_require__.r(__webpack_exports__); 13544 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PostPreviewButton", function() { return PostPreviewButton; }); 13545 /* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/classCallCheck */ "./node_modules/@babel/runtime/helpers/esm/classCallCheck.js"); 13546 /* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/createClass */ "./node_modules/@babel/runtime/helpers/esm/createClass.js"); 13547 /* harmony import */ var _babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js"); 13548 /* harmony import */ var _babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/esm/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js"); 13549 /* harmony import */ var _babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inherits */ "./node_modules/@babel/runtime/helpers/esm/inherits.js"); 13550 /* harmony import */ var _babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/helpers/esm/assertThisInitialized */ "./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js"); 13551 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); 13552 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__); 13553 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! lodash */ "lodash"); 13554 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_7__); 13555 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); 13556 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_8__); 13557 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); 13558 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_9__); 13559 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); 13560 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_10__); 13561 /* harmony import */ var _wordpress_nux__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @wordpress/nux */ "@wordpress/nux"); 13562 /* harmony import */ var _wordpress_nux__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(_wordpress_nux__WEBPACK_IMPORTED_MODULE_11__); 13563 /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose"); 13564 /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_12__); 13565 13566 13567 13568 13569 13570 13571 13572 13573 /** 13574 * External dependencies 13575 */ 13576 13577 /** 13578 * WordPress dependencies 13579 */ 13580 13581 13582 13583 13584 13585 13586 13587 var PostPreviewButton = 13588 /*#__PURE__*/ 13589 function (_Component) { 13590 Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__["default"])(PostPreviewButton, _Component); 13591 13592 function PostPreviewButton() { 13593 var _this; 13594 13595 Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__["default"])(this, PostPreviewButton); 13596 13597 _this = Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__["default"])(this, Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__["default"])(PostPreviewButton).apply(this, arguments)); 13598 _this.openPreviewWindow = _this.openPreviewWindow.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(_this))); 13599 return _this; 13600 } 13601 13602 Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__["default"])(PostPreviewButton, [{ 13603 key: "componentDidUpdate", 13604 value: function componentDidUpdate(prevProps) { 13605 var previewLink = this.props.previewLink; // This relies on the window being responsible to unset itself when 13606 // navigation occurs or a new preview window is opened, to avoid 13607 // unintentional forceful redirects. 13608 13609 if (previewLink && !prevProps.previewLink) { 13610 this.setPreviewWindowLink(previewLink); // Once popup redirect is evaluated, even if already closed, delete 13611 // reference to avoid later assignment of location in post update. 13612 13613 delete this.previewWindow; 13614 } 13615 } 13616 /** 13617 * Sets the preview window's location to the given URL, if a preview window 13618 * exists and is not closed. 13619 * 13620 * @param {string} url URL to assign as preview window location. 13621 */ 13622 13623 }, { 13624 key: "setPreviewWindowLink", 13625 value: function setPreviewWindowLink(url) { 13626 var previewWindow = this.previewWindow; 13627 13628 if (previewWindow && !previewWindow.closed) { 13629 previewWindow.location = url; 13630 } 13631 } 13632 }, { 13633 key: "getWindowTarget", 13634 value: function getWindowTarget() { 13635 var postId = this.props.postId; 13636 return "wp-preview-".concat(postId); 13637 } 13638 /** 13639 * Opens a popup window, navigating user to a preview of the current post. 13640 * Triggers autosave if post is autosaveable. 13641 */ 13642 13643 }, { 13644 key: "openPreviewWindow", 13645 value: function openPreviewWindow() { 13646 var _this$props = this.props, 13647 isAutosaveable = _this$props.isAutosaveable, 13648 previewLink = _this$props.previewLink, 13649 currentPostLink = _this$props.currentPostLink; // Open a popup, BUT: Set it to a blank page until save completes. This 13650 // is necessary because popups can only be opened in response to user 13651 // interaction (click), but we must still wait for the post to save. 13652 13653 if (!this.previewWindow || this.previewWindow.closed) { 13654 this.previewWindow = window.open('', this.getWindowTarget()); 13655 } // Ask the browser to bring the preview tab to the front 13656 // This can work or not depending on the browser's user preferences 13657 // https://html.spec.whatwg.org/multipage/interaction.html#dom-window-focus 13658 13659 13660 this.previewWindow.focus(); // If there are no changes to autosave, we cannot perform the save, but 13661 // if there is an existing preview link (e.g. previous published post 13662 // autosave), it should be reused as the popup destination. 13663 13664 if (!isAutosaveable && !previewLink && currentPostLink) { 13665 this.setPreviewWindowLink(currentPostLink); 13666 return; 13667 } 13668 13669 if (!isAutosaveable) { 13670 this.setPreviewWindowLink(previewLink); 13671 return; 13672 } 13673 13674 this.props.autosave(); 13675 var markup = "\n\t\t\t<div class=\"editor-post-preview-button__interstitial-message\">\n\t\t\t\t<p>Please wait…</p>\n\t\t\t\t<p>Generating preview.</p>\n\t\t\t</div>\n\t\t\t<style>\n\t\t\t\tbody {\n\t\t\t\t\tmargin: 0;\n\t\t\t\t}\n\t\t\t\t.editor-post-preview-button__interstitial-message {\n\t\t\t\t\tdisplay: flex;\n\t\t\t\t\tflex-direction: column;\n\t\t\t\t\talign-items: center;\n\t\t\t\t\tjustify-content: center;\n\t\t\t\t\theight: 100vh;\n\t\t\t\t\twidth: 100vw;\n\t\t\t\t}\n\t\t\t\tp {\n\t\t\t\t\ttext-align: center;\n\t\t\t\t\tfont-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Oxygen-Sans, Ubuntu, Cantarell, \"Helvetica Neue\", sans-serif;\n\t\t\t\t}\n\t\t\t</style>"; 13676 this.previewWindow.document.write(markup); 13677 this.previewWindow.document.close(); 13678 } 13679 }, { 13680 key: "render", 13681 value: function render() { 13682 var isSaveable = this.props.isSaveable; 13683 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_8__["Button"], { 13684 className: "editor-post-preview", 13685 isLarge: true, 13686 onClick: this.openPreviewWindow, 13687 disabled: !isSaveable 13688 }, Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_9__["_x"])('Preview', 'imperative verb'), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(_wordpress_nux__WEBPACK_IMPORTED_MODULE_11__["DotTip"], { 13689 id: "core/editor.preview" 13690 }, Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_9__["__"])('Click “Preview” to load a preview of this page, so you can make sure you’re happy with your blocks.'))); 13691 } 13692 }]); 13693 13694 return PostPreviewButton; 13695 }(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["Component"]); 13696 /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_12__["compose"])([Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_10__["withSelect"])(function (select) { 13697 var _select = select('core/editor'), 13698 getCurrentPostId = _select.getCurrentPostId, 13699 getCurrentPostAttribute = _select.getCurrentPostAttribute, 13700 getAutosaveAttribute = _select.getAutosaveAttribute, 13701 getEditedPostAttribute = _select.getEditedPostAttribute, 13702 isEditedPostDirty = _select.isEditedPostDirty, 13703 isEditedPostNew = _select.isEditedPostNew, 13704 isEditedPostSaveable = _select.isEditedPostSaveable, 13705 isEditedPostAutosaveable = _select.isEditedPostAutosaveable; 13706 13707 var _select2 = select('core'), 13708 getPostType = _select2.getPostType; 13709 13710 var postType = getPostType(getEditedPostAttribute('type')); 13711 return { 13712 postId: getCurrentPostId(), 13713 currentPostLink: getCurrentPostAttribute('link'), 13714 previewLink: getAutosaveAttribute('preview_link'), 13715 isDirty: isEditedPostDirty(), 13716 isNew: isEditedPostNew(), 13717 isSaveable: isEditedPostSaveable(), 13718 isAutosaveable: isEditedPostAutosaveable(), 13719 isViewable: Object(lodash__WEBPACK_IMPORTED_MODULE_7__["get"])(postType, ['viewable'], false) 13720 }; 13721 }), Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_10__["withDispatch"])(function (dispatch) { 13722 return { 13723 autosave: dispatch('core/editor').autosave 13724 }; 13725 }), Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_12__["ifCondition"])(function (_ref) { 13726 var isViewable = _ref.isViewable; 13727 return isViewable; 13728 })])(PostPreviewButton)); 13729 13730 13731 /***/ }), 13732 13733 /***/ "./node_modules/@wordpress/editor/build-module/components/post-publish-button/index.js": 13734 /*!*********************************************************************************************!*\ 13735 !*** ./node_modules/@wordpress/editor/build-module/components/post-publish-button/index.js ***! 13736 \*********************************************************************************************/ 13737 /*! exports provided: PostPublishButton, default */ 13738 /***/ (function(module, __webpack_exports__, __webpack_require__) { 13739 13740 "use strict"; 13741 __webpack_require__.r(__webpack_exports__); 13742 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PostPublishButton", function() { return PostPublishButton; }); 13743 /* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/classCallCheck */ "./node_modules/@babel/runtime/helpers/esm/classCallCheck.js"); 13744 /* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/createClass */ "./node_modules/@babel/runtime/helpers/esm/createClass.js"); 13745 /* harmony import */ var _babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js"); 13746 /* harmony import */ var _babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/esm/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js"); 13747 /* harmony import */ var _babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inherits */ "./node_modules/@babel/runtime/helpers/esm/inherits.js"); 13748 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); 13749 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_5__); 13750 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! lodash */ "lodash"); 13751 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_6__); 13752 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); 13753 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_7__); 13754 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); 13755 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_8__); 13756 /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose"); 13757 /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_9__); 13758 /* harmony import */ var _label__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./label */ "./node_modules/@wordpress/editor/build-module/components/post-publish-button/label.js"); 13759 13760 13761 13762 13763 13764 13765 13766 /** 13767 * External dependencies 13768 */ 13769 13770 /** 13771 * WordPress dependencies 13772 */ 13773 13774 13775 13776 13777 13778 /** 13779 * Internal dependencies 13780 */ 13781 13782 13783 var PostPublishButton = 13784 /*#__PURE__*/ 13785 function (_Component) { 13786 Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__["default"])(PostPublishButton, _Component); 13787 13788 function PostPublishButton(props) { 13789 var _this; 13790 13791 Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__["default"])(this, PostPublishButton); 13792 13793 _this = Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__["default"])(this, Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__["default"])(PostPublishButton).call(this, props)); 13794 _this.buttonNode = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_5__["createRef"])(); 13795 return _this; 13796 } 13797 13798 Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__["default"])(PostPublishButton, [{ 13799 key: "componentDidMount", 13800 value: function componentDidMount() { 13801 if (this.props.focusOnMount) { 13802 this.buttonNode.current.focus(); 13803 } 13804 } 13805 }, { 13806 key: "render", 13807 value: function render() { 13808 var _this$props = this.props, 13809 isSaving = _this$props.isSaving, 13810 onStatusChange = _this$props.onStatusChange, 13811 onSave = _this$props.onSave, 13812 isBeingScheduled = _this$props.isBeingScheduled, 13813 visibility = _this$props.visibility, 13814 isPublishable = _this$props.isPublishable, 13815 isSaveable = _this$props.isSaveable, 13816 hasPublishAction = _this$props.hasPublishAction, 13817 _this$props$onSubmit = _this$props.onSubmit, 13818 onSubmit = _this$props$onSubmit === void 0 ? lodash__WEBPACK_IMPORTED_MODULE_6__["noop"] : _this$props$onSubmit, 13819 forceIsSaving = _this$props.forceIsSaving; 13820 var isButtonEnabled = isPublishable && isSaveable; 13821 var publishStatus; 13822 13823 if (!hasPublishAction) { 13824 publishStatus = 'pending'; 13825 } else if (isBeingScheduled) { 13826 publishStatus = 'future'; 13827 } else if (visibility === 'private') { 13828 publishStatus = 'private'; 13829 } else { 13830 publishStatus = 'publish'; 13831 } 13832 13833 var onClick = function onClick() { 13834 onSubmit(); 13835 onStatusChange(publishStatus); 13836 onSave(); 13837 }; 13838 13839 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_5__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_7__["Button"], { 13840 ref: this.buttonNode, 13841 className: "editor-post-publish-button", 13842 isPrimary: true, 13843 isLarge: true, 13844 onClick: onClick, 13845 disabled: !isButtonEnabled, 13846 isBusy: isSaving 13847 }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_5__["createElement"])(_label__WEBPACK_IMPORTED_MODULE_10__["default"], { 13848 forceIsSaving: forceIsSaving 13849 })); 13850 } 13851 }]); 13852 13853 return PostPublishButton; 13854 }(_wordpress_element__WEBPACK_IMPORTED_MODULE_5__["Component"]); 13855 /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_9__["compose"])([Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_8__["withSelect"])(function (select, _ref) { 13856 var forceIsSaving = _ref.forceIsSaving, 13857 forceIsDirty = _ref.forceIsDirty; 13858 13859 var _select = select('core/editor'), 13860 isSavingPost = _select.isSavingPost, 13861 isEditedPostBeingScheduled = _select.isEditedPostBeingScheduled, 13862 getEditedPostVisibility = _select.getEditedPostVisibility, 13863 isEditedPostSaveable = _select.isEditedPostSaveable, 13864 isEditedPostPublishable = _select.isEditedPostPublishable, 13865 getCurrentPost = _select.getCurrentPost, 13866 getCurrentPostType = _select.getCurrentPostType; 13867 13868 return { 13869 isSaving: forceIsSaving || isSavingPost(), 13870 isBeingScheduled: isEditedPostBeingScheduled(), 13871 visibility: getEditedPostVisibility(), 13872 isSaveable: isEditedPostSaveable(), 13873 isPublishable: forceIsDirty || isEditedPostPublishable(), 13874 hasPublishAction: Object(lodash__WEBPACK_IMPORTED_MODULE_6__["get"])(getCurrentPost(), ['_links', 'wp:action-publish'], false), 13875 postType: getCurrentPostType() 13876 }; 13877 }), Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_8__["withDispatch"])(function (dispatch) { 13878 var _dispatch = dispatch('core/editor'), 13879 editPost = _dispatch.editPost, 13880 savePost = _dispatch.savePost; 13881 13882 return { 13883 onStatusChange: function onStatusChange(status) { 13884 return editPost({ 13885 status: status 13886 }); 13887 }, 13888 onSave: savePost 13889 }; 13890 })])(PostPublishButton)); 13891 13892 13893 /***/ }), 13894 13895 /***/ "./node_modules/@wordpress/editor/build-module/components/post-publish-button/label.js": 13896 /*!*********************************************************************************************!*\ 13897 !*** ./node_modules/@wordpress/editor/build-module/components/post-publish-button/label.js ***! 13898 \*********************************************************************************************/ 13899 /*! exports provided: PublishButtonLabel, default */ 13900 /***/ (function(module, __webpack_exports__, __webpack_require__) { 13901 13902 "use strict"; 13903 __webpack_require__.r(__webpack_exports__); 13904 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PublishButtonLabel", function() { return PublishButtonLabel; }); 13905 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash */ "lodash"); 13906 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_0__); 13907 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); 13908 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__); 13909 /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose"); 13910 /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_2__); 13911 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); 13912 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_3__); 13913 /** 13914 * External dependencies 13915 */ 13916 13917 /** 13918 * WordPress dependencies 13919 */ 13920 13921 13922 13923 13924 function PublishButtonLabel(_ref) { 13925 var isPublished = _ref.isPublished, 13926 isBeingScheduled = _ref.isBeingScheduled, 13927 isSaving = _ref.isSaving, 13928 isPublishing = _ref.isPublishing, 13929 hasPublishAction = _ref.hasPublishAction, 13930 isAutosaving = _ref.isAutosaving; 13931 13932 if (isPublishing) { 13933 return Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__["__"])('Publishing…'); 13934 } else if (isPublished && isSaving && !isAutosaving) { 13935 return Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__["__"])('Updating…'); 13936 } else if (isBeingScheduled && isSaving && !isAutosaving) { 13937 return Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__["__"])('Scheduling…'); 13938 } 13939 13940 if (!hasPublishAction) { 13941 return Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__["__"])('Submit for Review'); 13942 } else if (isPublished) { 13943 return Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__["__"])('Update'); 13944 } else if (isBeingScheduled) { 13945 return Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__["__"])('Schedule'); 13946 } 13947 13948 return Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__["__"])('Publish'); 13949 } 13950 /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_2__["compose"])([Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_3__["withSelect"])(function (select, _ref2) { 13951 var forceIsSaving = _ref2.forceIsSaving; 13952 13953 var _select = select('core/editor'), 13954 isCurrentPostPublished = _select.isCurrentPostPublished, 13955 isEditedPostBeingScheduled = _select.isEditedPostBeingScheduled, 13956 isSavingPost = _select.isSavingPost, 13957 isPublishingPost = _select.isPublishingPost, 13958 getCurrentPost = _select.getCurrentPost, 13959 getCurrentPostType = _select.getCurrentPostType, 13960 isAutosavingPost = _select.isAutosavingPost; 13961 13962 return { 13963 isPublished: isCurrentPostPublished(), 13964 isBeingScheduled: isEditedPostBeingScheduled(), 13965 isSaving: forceIsSaving || isSavingPost(), 13966 isPublishing: isPublishingPost(), 13967 hasPublishAction: Object(lodash__WEBPACK_IMPORTED_MODULE_0__["get"])(getCurrentPost(), ['_links', 'wp:action-publish'], false), 13968 postType: getCurrentPostType(), 13969 isAutosaving: isAutosavingPost() 13970 }; 13971 })])(PublishButtonLabel)); 13972 13973 13974 /***/ }), 13975 13976 /***/ "./node_modules/@wordpress/editor/build-module/components/post-publish-panel/index.js": 13977 /*!********************************************************************************************!*\ 13978 !*** ./node_modules/@wordpress/editor/build-module/components/post-publish-panel/index.js ***! 13979 \********************************************************************************************/ 13980 /*! exports provided: default */ 13981 /***/ (function(module, __webpack_exports__, __webpack_require__) { 13982 13983 "use strict"; 13984 __webpack_require__.r(__webpack_exports__); 13985 /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js"); 13986 /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutProperties */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js"); 13987 /* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/classCallCheck */ "./node_modules/@babel/runtime/helpers/esm/classCallCheck.js"); 13988 /* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/esm/createClass */ "./node_modules/@babel/runtime/helpers/esm/createClass.js"); 13989 /* harmony import */ var _babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/esm/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js"); 13990 /* harmony import */ var _babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/helpers/esm/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js"); 13991 /* harmony import */ var _babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inherits */ "./node_modules/@babel/runtime/helpers/esm/inherits.js"); 13992 /* harmony import */ var _babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @babel/runtime/helpers/esm/assertThisInitialized */ "./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js"); 13993 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); 13994 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__); 13995 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! lodash */ "lodash"); 13996 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_9__); 13997 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); 13998 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_10__); 13999 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); 14000 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_11__); 14001 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); 14002 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_12__); 14003 /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose"); 14004 /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_13__); 14005 /* harmony import */ var _post_publish_button__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../post-publish-button */ "./node_modules/@wordpress/editor/build-module/components/post-publish-button/index.js"); 14006 /* harmony import */ var _prepublish__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./prepublish */ "./node_modules/@wordpress/editor/build-module/components/post-publish-panel/prepublish.js"); 14007 /* harmony import */ var _postpublish__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./postpublish */ "./node_modules/@wordpress/editor/build-module/components/post-publish-panel/postpublish.js"); 14008 14009 14010 14011 14012 14013 14014 14015 14016 14017 14018 /** 14019 * External dependencies 14020 */ 14021 14022 /** 14023 * WordPress dependencies 14024 */ 14025 14026 14027 14028 14029 14030 14031 /** 14032 * Internal Dependencies 14033 */ 14034 14035 14036 14037 14038 14039 var PostPublishPanel = 14040 /*#__PURE__*/ 14041 function (_Component) { 14042 Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_6__["default"])(PostPublishPanel, _Component); 14043 14044 function PostPublishPanel() { 14045 var _this; 14046 14047 Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_2__["default"])(this, PostPublishPanel); 14048 14049 _this = Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_4__["default"])(this, Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_5__["default"])(PostPublishPanel).apply(this, arguments)); 14050 _this.onSubmit = _this.onSubmit.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(_this))); 14051 _this.state = { 14052 loading: false, 14053 submitted: false 14054 }; 14055 return _this; 14056 } 14057 14058 Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_3__["default"])(PostPublishPanel, [{ 14059 key: "componentDidUpdate", 14060 value: function componentDidUpdate(prevProps) { 14061 // Automatically collapse the publish sidebar when a post 14062 // is published and the user makes an edit. 14063 if (prevProps.isPublished && !this.props.isSaving && this.props.isDirty) { 14064 this.props.onClose(); 14065 } 14066 } 14067 }, { 14068 key: "onSubmit", 14069 value: function onSubmit() { 14070 var _this$props = this.props, 14071 onClose = _this$props.onClose, 14072 hasPublishAction = _this$props.hasPublishAction; 14073 14074 if (!hasPublishAction) { 14075 onClose(); 14076 return; 14077 } 14078 14079 this.setState({ 14080 loading: true 14081 }); 14082 } 14083 }, { 14084 key: "render", 14085 value: function render() { 14086 var _this$props2 = this.props, 14087 isScheduled = _this$props2.isScheduled, 14088 isPublishSidebarEnabled = _this$props2.isPublishSidebarEnabled, 14089 onClose = _this$props2.onClose, 14090 onTogglePublishSidebar = _this$props2.onTogglePublishSidebar, 14091 forceIsDirty = _this$props2.forceIsDirty, 14092 forceIsSaving = _this$props2.forceIsSaving, 14093 PrePublishExtension = _this$props2.PrePublishExtension, 14094 PostPublishExtension = _this$props2.PostPublishExtension, 14095 additionalProps = Object(_babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__["default"])(_this$props2, ["isScheduled", "isPublishSidebarEnabled", "onClose", "onTogglePublishSidebar", "forceIsDirty", "forceIsSaving", "PrePublishExtension", "PostPublishExtension"]); 14096 14097 var _this$state = this.state, 14098 loading = _this$state.loading, 14099 submitted = _this$state.submitted; 14100 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["createElement"])("div", Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({ 14101 className: "editor-post-publish-panel" 14102 }, additionalProps), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["createElement"])("div", { 14103 className: "editor-post-publish-panel__header" 14104 }, !submitted && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["createElement"])("div", { 14105 className: "editor-post-publish-panel__header-publish-button" 14106 }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["createElement"])(_post_publish_button__WEBPACK_IMPORTED_MODULE_14__["default"], { 14107 focusOnMount: true, 14108 onSubmit: this.onSubmit, 14109 forceIsDirty: forceIsDirty, 14110 forceIsSaving: forceIsSaving 14111 }), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["createElement"])("span", { 14112 className: "editor-post-publish-panel__spacer" 14113 })), submitted && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["createElement"])("div", { 14114 className: "editor-post-publish-panel__header-published" 14115 }, isScheduled ? Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_10__["__"])('Scheduled') : Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_10__["__"])('Published')), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_11__["IconButton"], { 14116 "aria-expanded": true, 14117 onClick: onClose, 14118 icon: "no-alt", 14119 label: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_10__["__"])('Close panel') 14120 })), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["createElement"])("div", { 14121 className: "editor-post-publish-panel__content" 14122 }, !loading && !submitted && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["createElement"])(_prepublish__WEBPACK_IMPORTED_MODULE_15__["default"], null, PrePublishExtension && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["createElement"])(PrePublishExtension, null)), loading && !submitted && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_11__["Spinner"], null), submitted && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["createElement"])(_postpublish__WEBPACK_IMPORTED_MODULE_16__["default"], null, PostPublishExtension && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["createElement"])(PostPublishExtension, null))), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["createElement"])("div", { 14123 className: "editor-post-publish-panel__footer" 14124 }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_11__["CheckboxControl"], { 14125 label: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_10__["__"])('Always show pre-publish checks.'), 14126 checked: isPublishSidebarEnabled, 14127 onChange: onTogglePublishSidebar 14128 }))); 14129 } 14130 }], [{ 14131 key: "getDerivedStateFromProps", 14132 value: function getDerivedStateFromProps(props, state) { 14133 if (state.submitted || props.isSaving || !props.isPublished && !props.isScheduled) { 14134 return null; 14135 } 14136 14137 return { 14138 submitted: true, 14139 loading: false 14140 }; 14141 } 14142 }]); 14143 14144 return PostPublishPanel; 14145 }(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["Component"]); 14146 14147 /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_13__["compose"])([Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_12__["withSelect"])(function (select) { 14148 var _select = select('core/editor'), 14149 getCurrentPost = _select.getCurrentPost, 14150 getCurrentPostType = _select.getCurrentPostType, 14151 isCurrentPostPublished = _select.isCurrentPostPublished, 14152 isCurrentPostScheduled = _select.isCurrentPostScheduled, 14153 isSavingPost = _select.isSavingPost, 14154 isEditedPostDirty = _select.isEditedPostDirty; 14155 14156 var _select2 = select('core/editor'), 14157 isPublishSidebarEnabled = _select2.isPublishSidebarEnabled; 14158 14159 return { 14160 postType: getCurrentPostType(), 14161 hasPublishAction: Object(lodash__WEBPACK_IMPORTED_MODULE_9__["get"])(getCurrentPost(), ['_links', 'wp:action-publish'], false), 14162 isPublished: isCurrentPostPublished(), 14163 isScheduled: isCurrentPostScheduled(), 14164 isSaving: isSavingPost(), 14165 isDirty: isEditedPostDirty(), 14166 isPublishSidebarEnabled: isPublishSidebarEnabled() 14167 }; 14168 }), Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_12__["withDispatch"])(function (dispatch, _ref) { 14169 var isPublishSidebarEnabled = _ref.isPublishSidebarEnabled; 14170 14171 var _dispatch = dispatch('core/editor'), 14172 disablePublishSidebar = _dispatch.disablePublishSidebar, 14173 enablePublishSidebar = _dispatch.enablePublishSidebar; 14174 14175 return { 14176 onTogglePublishSidebar: function onTogglePublishSidebar() { 14177 if (isPublishSidebarEnabled) { 14178 disablePublishSidebar(); 14179 } else { 14180 enablePublishSidebar(); 14181 } 14182 } 14183 }; 14184 })])(PostPublishPanel)); 14185 14186 14187 /***/ }), 14188 14189 /***/ "./node_modules/@wordpress/editor/build-module/components/post-publish-panel/maybe-post-format-panel.js": 14190 /*!**************************************************************************************************************!*\ 14191 !*** ./node_modules/@wordpress/editor/build-module/components/post-publish-panel/maybe-post-format-panel.js ***! 14192 \**************************************************************************************************************/ 14193 /*! exports provided: default */ 14194 /***/ (function(module, __webpack_exports__, __webpack_require__) { 14195 14196 "use strict"; 14197 __webpack_require__.r(__webpack_exports__); 14198 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); 14199 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); 14200 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lodash */ "lodash"); 14201 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_1__); 14202 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); 14203 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__); 14204 /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose"); 14205 /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_3__); 14206 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); 14207 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_4__); 14208 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); 14209 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_5__); 14210 /* harmony import */ var _post_format__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../post-format */ "./node_modules/@wordpress/editor/build-module/components/post-format/index.js"); 14211 14212 14213 /** 14214 * External dependencies 14215 */ 14216 14217 /** 14218 * WordPress dependencies. 14219 */ 14220 14221 14222 14223 14224 14225 /** 14226 * Internal dependencies. 14227 */ 14228 14229 14230 14231 var PostFormatSuggestion = function PostFormatSuggestion(_ref) { 14232 var suggestedPostFormat = _ref.suggestedPostFormat, 14233 suggestionText = _ref.suggestionText, 14234 onUpdatePostFormat = _ref.onUpdatePostFormat; 14235 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_5__["Button"], { 14236 isLink: true, 14237 onClick: function onClick() { 14238 return onUpdatePostFormat(suggestedPostFormat); 14239 } 14240 }, suggestionText); 14241 }; 14242 14243 var PostFormatPanel = function PostFormatPanel(_ref2) { 14244 var suggestion = _ref2.suggestion, 14245 onUpdatePostFormat = _ref2.onUpdatePostFormat; 14246 var panelBodyTitle = [Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__["__"])('Suggestion:'), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("span", { 14247 className: "editor-post-publish-panel__link", 14248 key: "label" 14249 }, Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__["__"])('Use a post format'))]; 14250 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_5__["PanelBody"], { 14251 initialOpen: false, 14252 title: panelBodyTitle 14253 }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("p", null, Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__["__"])('Your theme uses post formats to highlight different kinds of content, like images or videos. Apply a post format to see this special styling.')), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("p", null, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(PostFormatSuggestion, { 14254 onUpdatePostFormat: onUpdatePostFormat, 14255 suggestedPostFormat: suggestion.id, 14256 suggestionText: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__["sprintf"])(Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__["__"])('Apply the "%1$s" format.'), suggestion.caption) 14257 }))); 14258 }; 14259 14260 var getSuggestion = function getSuggestion(supportedFormats, suggestedPostFormat) { 14261 var formats = _post_format__WEBPACK_IMPORTED_MODULE_6__["POST_FORMATS"].filter(function (format) { 14262 return Object(lodash__WEBPACK_IMPORTED_MODULE_1__["includes"])(supportedFormats, format.id); 14263 }); 14264 return Object(lodash__WEBPACK_IMPORTED_MODULE_1__["find"])(formats, function (format) { 14265 return format.id === suggestedPostFormat; 14266 }); 14267 }; 14268 14269 /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_3__["compose"])(Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_4__["withSelect"])(function (select) { 14270 var _select = select('core/editor'), 14271 getEditedPostAttribute = _select.getEditedPostAttribute, 14272 getSuggestedPostFormat = _select.getSuggestedPostFormat; 14273 14274 var supportedFormats = Object(lodash__WEBPACK_IMPORTED_MODULE_1__["get"])(select('core').getThemeSupports(), ['formats'], []); 14275 return { 14276 currentPostFormat: getEditedPostAttribute('format'), 14277 suggestion: getSuggestion(supportedFormats, getSuggestedPostFormat()) 14278 }; 14279 }), Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_4__["withDispatch"])(function (dispatch) { 14280 return { 14281 onUpdatePostFormat: function onUpdatePostFormat(postFormat) { 14282 dispatch('core/editor').editPost({ 14283 format: postFormat 14284 }); 14285 } 14286 }; 14287 }), Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_3__["ifCondition"])(function (_ref3) { 14288 var suggestion = _ref3.suggestion, 14289 currentPostFormat = _ref3.currentPostFormat; 14290 return suggestion && suggestion.id !== currentPostFormat; 14291 }))(PostFormatPanel)); 14292 14293 14294 /***/ }), 14295 14296 /***/ "./node_modules/@wordpress/editor/build-module/components/post-publish-panel/maybe-tags-panel.js": 14297 /*!*******************************************************************************************************!*\ 14298 !*** ./node_modules/@wordpress/editor/build-module/components/post-publish-panel/maybe-tags-panel.js ***! 14299 \*******************************************************************************************************/ 14300 /*! exports provided: default */ 14301 /***/ (function(module, __webpack_exports__, __webpack_require__) { 14302 14303 "use strict"; 14304 __webpack_require__.r(__webpack_exports__); 14305 /* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/classCallCheck */ "./node_modules/@babel/runtime/helpers/esm/classCallCheck.js"); 14306 /* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/createClass */ "./node_modules/@babel/runtime/helpers/esm/createClass.js"); 14307 /* harmony import */ var _babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js"); 14308 /* harmony import */ var _babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/esm/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js"); 14309 /* harmony import */ var _babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inherits */ "./node_modules/@babel/runtime/helpers/esm/inherits.js"); 14310 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); 14311 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_5__); 14312 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! lodash */ "lodash"); 14313 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_6__); 14314 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); 14315 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_7__); 14316 /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose"); 14317 /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_8__); 14318 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); 14319 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_9__); 14320 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); 14321 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_10__); 14322 /* harmony import */ var _post_taxonomies_flat_term_selector__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../post-taxonomies/flat-term-selector */ "./node_modules/@wordpress/editor/build-module/components/post-taxonomies/flat-term-selector.js"); 14323 14324 14325 14326 14327 14328 14329 14330 /** 14331 * External dependencies 14332 */ 14333 14334 /** 14335 * WordPress dependencies 14336 */ 14337 14338 14339 14340 14341 14342 14343 14344 14345 var TagsPanel = function TagsPanel() { 14346 var panelBodyTitle = [Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_7__["__"])('Suggestion:'), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_5__["createElement"])("span", { 14347 className: "editor-post-publish-panel__link", 14348 key: "label" 14349 }, Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_7__["__"])('Add tags'))]; 14350 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_5__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_10__["PanelBody"], { 14351 initialOpen: false, 14352 title: panelBodyTitle 14353 }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_5__["createElement"])("p", null, Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_7__["__"])('Tags help users and search engines navigate your site and find your content. Add a few keywords to describe your post.')), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_5__["createElement"])(_post_taxonomies_flat_term_selector__WEBPACK_IMPORTED_MODULE_11__["default"], { 14354 slug: 'post_tag' 14355 })); 14356 }; 14357 14358 var MaybeTagsPanel = 14359 /*#__PURE__*/ 14360 function (_Component) { 14361 Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__["default"])(MaybeTagsPanel, _Component); 14362 14363 function MaybeTagsPanel(props) { 14364 var _this; 14365 14366 Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__["default"])(this, MaybeTagsPanel); 14367 14368 _this = Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__["default"])(this, Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__["default"])(MaybeTagsPanel).call(this, props)); 14369 _this.state = { 14370 hadTagsWhenOpeningThePanel: props.hasTags 14371 }; 14372 return _this; 14373 } 14374 /* 14375 * We only want to show the tag panel if the post didn't have 14376 * any tags when the user hit the Publish button. 14377 * 14378 * We can't use the prop.hasTags because it'll change to true 14379 * if the user adds a new tag within the pre-publish panel. 14380 * This would force a re-render and a new prop.hasTags check, 14381 * hiding this panel and keeping the user from adding 14382 * more than one tag. 14383 */ 14384 14385 14386 Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__["default"])(MaybeTagsPanel, [{ 14387 key: "render", 14388 value: function render() { 14389 if (!this.state.hadTagsWhenOpeningThePanel) { 14390 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_5__["createElement"])(TagsPanel, null); 14391 } 14392 14393 return null; 14394 } 14395 }]); 14396 14397 return MaybeTagsPanel; 14398 }(_wordpress_element__WEBPACK_IMPORTED_MODULE_5__["Component"]); 14399 14400 /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_8__["compose"])(Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_9__["withSelect"])(function (select) { 14401 var postType = select('core/editor').getCurrentPostType(); 14402 var tagsTaxonomy = select('core').getTaxonomy('post_tag'); 14403 var tags = tagsTaxonomy && select('core/editor').getEditedPostAttribute(tagsTaxonomy.rest_base); 14404 return { 14405 areTagsFetched: tagsTaxonomy !== undefined, 14406 isPostTypeSupported: tagsTaxonomy && Object(lodash__WEBPACK_IMPORTED_MODULE_6__["some"])(tagsTaxonomy.types, function (type) { 14407 return type === postType; 14408 }), 14409 hasTags: tags && tags.length 14410 }; 14411 }), Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_8__["ifCondition"])(function (_ref) { 14412 var areTagsFetched = _ref.areTagsFetched, 14413 isPostTypeSupported = _ref.isPostTypeSupported; 14414 return isPostTypeSupported && areTagsFetched; 14415 }))(MaybeTagsPanel)); 14416 14417 14418 /***/ }), 14419 14420 /***/ "./node_modules/@wordpress/editor/build-module/components/post-publish-panel/postpublish.js": 14421 /*!**************************************************************************************************!*\ 14422 !*** ./node_modules/@wordpress/editor/build-module/components/post-publish-panel/postpublish.js ***! 14423 \**************************************************************************************************/ 14424 /*! exports provided: default */ 14425 /***/ (function(module, __webpack_exports__, __webpack_require__) { 14426 14427 "use strict"; 14428 __webpack_require__.r(__webpack_exports__); 14429 /* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/classCallCheck */ "./node_modules/@babel/runtime/helpers/esm/classCallCheck.js"); 14430 /* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/createClass */ "./node_modules/@babel/runtime/helpers/esm/createClass.js"); 14431 /* harmony import */ var _babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js"); 14432 /* harmony import */ var _babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/esm/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js"); 14433 /* harmony import */ var _babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inherits */ "./node_modules/@babel/runtime/helpers/esm/inherits.js"); 14434 /* harmony import */ var _babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/helpers/esm/assertThisInitialized */ "./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js"); 14435 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); 14436 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__); 14437 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! lodash */ "lodash"); 14438 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_7__); 14439 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); 14440 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_8__); 14441 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); 14442 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_9__); 14443 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); 14444 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_10__); 14445 /* harmony import */ var _post_schedule_label__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../post-schedule/label */ "./node_modules/@wordpress/editor/build-module/components/post-schedule/label.js"); 14446 14447 14448 14449 14450 14451 14452 14453 14454 /** 14455 * External Dependencies 14456 */ 14457 14458 /** 14459 * WordPress Dependencies 14460 */ 14461 14462 14463 14464 14465 14466 /** 14467 * Internal dependencies 14468 */ 14469 14470 14471 14472 var PostPublishPanelPostpublish = 14473 /*#__PURE__*/ 14474 function (_Component) { 14475 Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__["default"])(PostPublishPanelPostpublish, _Component); 14476 14477 function PostPublishPanelPostpublish() { 14478 var _this; 14479 14480 Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__["default"])(this, PostPublishPanelPostpublish); 14481 14482 _this = Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__["default"])(this, Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__["default"])(PostPublishPanelPostpublish).apply(this, arguments)); 14483 _this.state = { 14484 showCopyConfirmation: false 14485 }; 14486 _this.onCopy = _this.onCopy.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(_this))); 14487 _this.onSelectInput = _this.onSelectInput.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(_this))); 14488 return _this; 14489 } 14490 14491 Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__["default"])(PostPublishPanelPostpublish, [{ 14492 key: "componentWillUnmount", 14493 value: function componentWillUnmount() { 14494 clearTimeout(this.dismissCopyConfirmation); 14495 } 14496 }, { 14497 key: "onCopy", 14498 value: function onCopy() { 14499 var _this2 = this; 14500 14501 this.setState({ 14502 showCopyConfirmation: true 14503 }); 14504 clearTimeout(this.dismissCopyConfirmation); 14505 this.dismissCopyConfirmation = setTimeout(function () { 14506 _this2.setState({ 14507 showCopyConfirmation: false 14508 }); 14509 }, 4000); 14510 } 14511 }, { 14512 key: "onSelectInput", 14513 value: function onSelectInput(event) { 14514 event.target.select(); 14515 } 14516 }, { 14517 key: "render", 14518 value: function render() { 14519 var _this$props = this.props, 14520 children = _this$props.children, 14521 isScheduled = _this$props.isScheduled, 14522 post = _this$props.post, 14523 postType = _this$props.postType; 14524 var viewPostLabel = Object(lodash__WEBPACK_IMPORTED_MODULE_7__["get"])(postType, ['labels', 'view_item']); 14525 var postPublishNonLinkHeader = isScheduled ? Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["Fragment"], null, Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_9__["__"])('is now scheduled. It will go live on'), " ", Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(_post_schedule_label__WEBPACK_IMPORTED_MODULE_11__["default"], null), ".") : Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_9__["__"])('is now live.'); 14526 var postPublishBodyText = isScheduled ? Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_9__["__"])('The post address will be:') : Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_9__["__"])('What’s next?'); 14527 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("div", { 14528 className: "post-publish-panel__postpublish" 14529 }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_8__["PanelBody"], { 14530 className: "post-publish-panel__postpublish-header" 14531 }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("a", { 14532 href: post.link 14533 }, post.title || Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_9__["__"])('(no title)')), " ", postPublishNonLinkHeader), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_8__["PanelBody"], null, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("div", null, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("strong", null, postPublishBodyText)), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("input", { 14534 className: "post-publish-panel__postpublish-link-input", 14535 readOnly: true, 14536 value: post.link, 14537 onFocus: this.onSelectInput, 14538 type: "text" 14539 }), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("div", { 14540 className: "post-publish-panel__postpublish-buttons" 14541 }, !isScheduled && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_8__["Button"], { 14542 isDefault: true, 14543 href: post.link 14544 }, viewPostLabel), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_8__["ClipboardButton"], { 14545 isDefault: true, 14546 text: post.link, 14547 onCopy: this.onCopy 14548 }, this.state.showCopyConfirmation ? Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_9__["__"])('Copied!') : Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_9__["__"])('Copy Link')))), children); 14549 } 14550 }]); 14551 14552 return PostPublishPanelPostpublish; 14553 }(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["Component"]); 14554 14555 /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_10__["withSelect"])(function (select) { 14556 var _select = select('core/editor'), 14557 getEditedPostAttribute = _select.getEditedPostAttribute, 14558 getCurrentPost = _select.getCurrentPost, 14559 isCurrentPostScheduled = _select.isCurrentPostScheduled; 14560 14561 var _select2 = select('core'), 14562 getPostType = _select2.getPostType; 14563 14564 return { 14565 post: getCurrentPost(), 14566 postType: getPostType(getEditedPostAttribute('type')), 14567 isScheduled: isCurrentPostScheduled() 14568 }; 14569 })(PostPublishPanelPostpublish)); 14570 14571 14572 /***/ }), 14573 14574 /***/ "./node_modules/@wordpress/editor/build-module/components/post-publish-panel/prepublish.js": 14575 /*!*************************************************************************************************!*\ 14576 !*** ./node_modules/@wordpress/editor/build-module/components/post-publish-panel/prepublish.js ***! 14577 \*************************************************************************************************/ 14578 /*! exports provided: default */ 14579 /***/ (function(module, __webpack_exports__, __webpack_require__) { 14580 14581 "use strict"; 14582 __webpack_require__.r(__webpack_exports__); 14583 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); 14584 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); 14585 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lodash */ "lodash"); 14586 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_1__); 14587 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); 14588 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__); 14589 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); 14590 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__); 14591 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); 14592 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_4__); 14593 /* harmony import */ var _post_visibility__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../post-visibility */ "./node_modules/@wordpress/editor/build-module/components/post-visibility/index.js"); 14594 /* harmony import */ var _post_visibility_label__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../post-visibility/label */ "./node_modules/@wordpress/editor/build-module/components/post-visibility/label.js"); 14595 /* harmony import */ var _post_schedule__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../post-schedule */ "./node_modules/@wordpress/editor/build-module/components/post-schedule/index.js"); 14596 /* harmony import */ var _post_schedule_label__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../post-schedule/label */ "./node_modules/@wordpress/editor/build-module/components/post-schedule/label.js"); 14597 /* harmony import */ var _maybe_tags_panel__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./maybe-tags-panel */ "./node_modules/@wordpress/editor/build-module/components/post-publish-panel/maybe-tags-panel.js"); 14598 /* harmony import */ var _maybe_post_format_panel__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./maybe-post-format-panel */ "./node_modules/@wordpress/editor/build-module/components/post-publish-panel/maybe-post-format-panel.js"); 14599 14600 14601 /** 14602 * External dependencies 14603 */ 14604 14605 /** 14606 * WordPress dependencies 14607 */ 14608 14609 14610 14611 14612 14613 /** 14614 * Internal Dependencies 14615 */ 14616 14617 14618 14619 14620 14621 14622 14623 14624 function PostPublishPanelPrepublish(_ref) { 14625 var hasPublishAction = _ref.hasPublishAction, 14626 isBeingScheduled = _ref.isBeingScheduled, 14627 children = _ref.children; 14628 var prePublishTitle, prePublishBodyText; 14629 14630 if (!hasPublishAction) { 14631 prePublishTitle = Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__["__"])('Are you ready to submit for review?'); 14632 prePublishBodyText = Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__["__"])('When you’re ready, submit your work for review, and an Editor will be able to approve it for you.'); 14633 } else if (isBeingScheduled) { 14634 prePublishTitle = Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__["__"])('Are you ready to schedule?'); 14635 prePublishBodyText = Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__["__"])('Your post will be published at the specified date and time.'); 14636 } else { 14637 prePublishTitle = Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__["__"])('Are you ready to publish?'); 14638 prePublishBodyText = Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__["__"])('Double-check your settings, then use the button to publish your post.'); 14639 } 14640 14641 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("div", { 14642 className: "editor-post-publish-panel__prepublish" 14643 }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("div", null, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("strong", null, prePublishTitle)), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("p", null, prePublishBodyText), hasPublishAction && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["Fragment"], null, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__["PanelBody"], { 14644 initialOpen: false, 14645 title: [Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__["__"])('Visibility:'), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("span", { 14646 className: "editor-post-publish-panel__link", 14647 key: "label" 14648 }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_post_visibility_label__WEBPACK_IMPORTED_MODULE_6__["default"], null))] 14649 }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_post_visibility__WEBPACK_IMPORTED_MODULE_5__["default"], null)), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__["PanelBody"], { 14650 initialOpen: false, 14651 title: [Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__["__"])('Publish:'), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("span", { 14652 className: "editor-post-publish-panel__link", 14653 key: "label" 14654 }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_post_schedule_label__WEBPACK_IMPORTED_MODULE_8__["default"], null))] 14655 }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_post_schedule__WEBPACK_IMPORTED_MODULE_7__["default"], null)), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_maybe_post_format_panel__WEBPACK_IMPORTED_MODULE_10__["default"], null), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_maybe_tags_panel__WEBPACK_IMPORTED_MODULE_9__["default"], null), children)); 14656 } 14657 14658 /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_4__["withSelect"])(function (select) { 14659 var _select = select('core/editor'), 14660 getCurrentPost = _select.getCurrentPost, 14661 isEditedPostBeingScheduled = _select.isEditedPostBeingScheduled; 14662 14663 return { 14664 hasPublishAction: Object(lodash__WEBPACK_IMPORTED_MODULE_1__["get"])(getCurrentPost(), ['_links', 'wp:action-publish'], false), 14665 isBeingScheduled: isEditedPostBeingScheduled() 14666 }; 14667 })(PostPublishPanelPrepublish)); 14668 14669 14670 /***/ }), 14671 14672 /***/ "./node_modules/@wordpress/editor/build-module/components/post-publish-panel/toggle.js": 14673 /*!*********************************************************************************************!*\ 14674 !*** ./node_modules/@wordpress/editor/build-module/components/post-publish-panel/toggle.js ***! 14675 \*********************************************************************************************/ 14676 /*! exports provided: PostPublishPanelToggle, default */ 14677 /***/ (function(module, __webpack_exports__, __webpack_require__) { 14678 14679 "use strict"; 14680 __webpack_require__.r(__webpack_exports__); 14681 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PostPublishPanelToggle", function() { return PostPublishPanelToggle; }); 14682 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); 14683 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); 14684 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lodash */ "lodash"); 14685 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_1__); 14686 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); 14687 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__); 14688 /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose"); 14689 /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_3__); 14690 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); 14691 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__); 14692 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); 14693 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_5__); 14694 /* harmony import */ var _wordpress_nux__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @wordpress/nux */ "@wordpress/nux"); 14695 /* harmony import */ var _wordpress_nux__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_wordpress_nux__WEBPACK_IMPORTED_MODULE_6__); 14696 /* harmony import */ var _post_publish_button__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../post-publish-button */ "./node_modules/@wordpress/editor/build-module/components/post-publish-button/index.js"); 14697 14698 14699 /** 14700 * External Dependencies 14701 */ 14702 14703 /** 14704 * WordPress Dependencies 14705 */ 14706 14707 14708 14709 14710 14711 14712 /** 14713 * Internal Dependencies 14714 */ 14715 14716 14717 function PostPublishPanelToggle(_ref) { 14718 var hasPublishAction = _ref.hasPublishAction, 14719 isSaving = _ref.isSaving, 14720 isPublishable = _ref.isPublishable, 14721 isSaveable = _ref.isSaveable, 14722 isPublished = _ref.isPublished, 14723 isBeingScheduled = _ref.isBeingScheduled, 14724 isPending = _ref.isPending, 14725 isScheduled = _ref.isScheduled, 14726 onToggle = _ref.onToggle, 14727 isOpen = _ref.isOpen, 14728 forceIsDirty = _ref.forceIsDirty, 14729 forceIsSaving = _ref.forceIsSaving; 14730 var isButtonEnabled = !isSaving && !forceIsSaving && isPublishable && isSaveable || isPublished; 14731 var showToggle = !isPublished && !(isScheduled && isBeingScheduled) && !(isPending && !hasPublishAction); 14732 14733 if (!showToggle) { 14734 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_post_publish_button__WEBPACK_IMPORTED_MODULE_7__["default"], { 14735 forceIsDirty: forceIsDirty, 14736 forceIsSaving: forceIsSaving 14737 }); 14738 } 14739 14740 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__["Button"], { 14741 className: "editor-post-publish-panel__toggle", 14742 isPrimary: true, 14743 onClick: onToggle, 14744 "aria-expanded": isOpen, 14745 disabled: !isButtonEnabled, 14746 isBusy: isSaving && isPublished 14747 }, isBeingScheduled ? Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__["__"])('Schedule…') : Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__["__"])('Publish…'), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_nux__WEBPACK_IMPORTED_MODULE_6__["DotTip"], { 14748 id: "core/editor.publish" 14749 }, Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__["__"])('Finished writing? That’s great, let’s get this published right now. Just click “Publish” and you’re good to go.'))); 14750 } 14751 /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_3__["compose"])([Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_5__["withSelect"])(function (select) { 14752 var _select = select('core/editor'), 14753 isSavingPost = _select.isSavingPost, 14754 isEditedPostSaveable = _select.isEditedPostSaveable, 14755 isEditedPostPublishable = _select.isEditedPostPublishable, 14756 isCurrentPostPending = _select.isCurrentPostPending, 14757 isCurrentPostPublished = _select.isCurrentPostPublished, 14758 isEditedPostBeingScheduled = _select.isEditedPostBeingScheduled, 14759 isCurrentPostScheduled = _select.isCurrentPostScheduled, 14760 getCurrentPost = _select.getCurrentPost, 14761 getCurrentPostType = _select.getCurrentPostType; 14762 14763 return { 14764 hasPublishAction: Object(lodash__WEBPACK_IMPORTED_MODULE_1__["get"])(getCurrentPost(), ['_links', 'wp:action-publish'], false), 14765 isSaving: isSavingPost(), 14766 isSaveable: isEditedPostSaveable(), 14767 isPublishable: isEditedPostPublishable(), 14768 isPending: isCurrentPostPending(), 14769 isPublished: isCurrentPostPublished(), 14770 isScheduled: isCurrentPostScheduled(), 14771 isBeingScheduled: isEditedPostBeingScheduled(), 14772 postType: getCurrentPostType() 14773 }; 14774 })])(PostPublishPanelToggle)); 14775 14776 14777 /***/ }), 14778 14779 /***/ "./node_modules/@wordpress/editor/build-module/components/post-saved-state/index.js": 14780 /*!******************************************************************************************!*\ 14781 !*** ./node_modules/@wordpress/editor/build-module/components/post-saved-state/index.js ***! 14782 \******************************************************************************************/ 14783 /*! exports provided: PostSavedState, default */ 14784 /***/ (function(module, __webpack_exports__, __webpack_require__) { 14785 14786 "use strict"; 14787 __webpack_require__.r(__webpack_exports__); 14788 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PostSavedState", function() { return PostSavedState; }); 14789 /* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/classCallCheck */ "./node_modules/@babel/runtime/helpers/esm/classCallCheck.js"); 14790 /* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/createClass */ "./node_modules/@babel/runtime/helpers/esm/createClass.js"); 14791 /* harmony import */ var _babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js"); 14792 /* harmony import */ var _babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/esm/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js"); 14793 /* harmony import */ var _babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inherits */ "./node_modules/@babel/runtime/helpers/esm/inherits.js"); 14794 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); 14795 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_5__); 14796 /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); 14797 /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_6__); 14798 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); 14799 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_7__); 14800 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); 14801 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_8__); 14802 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); 14803 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_9__); 14804 /* harmony import */ var _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @wordpress/keycodes */ "@wordpress/keycodes"); 14805 /* harmony import */ var _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_wordpress_keycodes__WEBPACK_IMPORTED_MODULE_10__); 14806 /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose"); 14807 /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_11__); 14808 /* harmony import */ var _post_switch_to_draft_button__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../post-switch-to-draft-button */ "./node_modules/@wordpress/editor/build-module/components/post-switch-to-draft-button/index.js"); 14809 14810 14811 14812 14813 14814 14815 14816 /** 14817 * External dependencies 14818 */ 14819 14820 /** 14821 * WordPress dependencies 14822 */ 14823 14824 14825 14826 14827 14828 14829 14830 /** 14831 * Internal dependencies 14832 */ 14833 14834 14835 /** 14836 * Component showing whether the post is saved or not and displaying save links. 14837 * 14838 * @param {Object} Props Component Props. 14839 */ 14840 14841 var PostSavedState = 14842 /*#__PURE__*/ 14843 function (_Component) { 14844 Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__["default"])(PostSavedState, _Component); 14845 14846 function PostSavedState() { 14847 var _this; 14848 14849 Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__["default"])(this, PostSavedState); 14850 14851 _this = Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__["default"])(this, Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__["default"])(PostSavedState).apply(this, arguments)); 14852 _this.state = { 14853 forceSavedMessage: false 14854 }; 14855 return _this; 14856 } 14857 14858 Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__["default"])(PostSavedState, [{ 14859 key: "componentDidUpdate", 14860 value: function componentDidUpdate(prevProps) { 14861 var _this2 = this; 14862 14863 if (prevProps.isSaving && !this.props.isSaving) { 14864 this.setState({ 14865 forceSavedMessage: true 14866 }); 14867 this.props.setTimeout(function () { 14868 _this2.setState({ 14869 forceSavedMessage: false 14870 }); 14871 }, 1000); 14872 } 14873 } 14874 }, { 14875 key: "render", 14876 value: function render() { 14877 var _this$props = this.props, 14878 isNew = _this$props.isNew, 14879 isScheduled = _this$props.isScheduled, 14880 isPublished = _this$props.isPublished, 14881 isDirty = _this$props.isDirty, 14882 isSaving = _this$props.isSaving, 14883 isSaveable = _this$props.isSaveable, 14884 onSave = _this$props.onSave, 14885 isAutosaving = _this$props.isAutosaving; 14886 var forceSavedMessage = this.state.forceSavedMessage; 14887 14888 if (isSaving) { 14889 // TODO: Classes generation should be common across all return 14890 // paths of this function, including proper naming convention for 14891 // the "Save Draft" button. 14892 var classes = classnames__WEBPACK_IMPORTED_MODULE_6___default()('editor-post-saved-state', 'is-saving', { 14893 'is-autosaving': isAutosaving 14894 }); 14895 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_5__["createElement"])("span", { 14896 className: classes 14897 }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_5__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_8__["Dashicon"], { 14898 icon: "cloud" 14899 }), isAutosaving ? Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_7__["__"])('Autosaving') : Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_7__["__"])('Saving')); 14900 } 14901 14902 if (isPublished || isScheduled) { 14903 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_5__["createElement"])(_post_switch_to_draft_button__WEBPACK_IMPORTED_MODULE_12__["default"], null); 14904 } 14905 14906 if (!isSaveable) { 14907 return null; 14908 } 14909 14910 if (forceSavedMessage || !isNew && !isDirty) { 14911 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_5__["createElement"])("span", { 14912 className: "editor-post-saved-state is-saved" 14913 }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_5__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_8__["Dashicon"], { 14914 icon: "saved" 14915 }), Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_7__["__"])('Saved')); 14916 } 14917 14918 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_5__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_8__["IconButton"], { 14919 className: "editor-post-save-draft", 14920 onClick: onSave, 14921 icon: "cloud-upload", 14922 shortcut: _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_10__["displayShortcut"].primary('s') 14923 }, Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_7__["__"])('Save Draft')); 14924 } 14925 }]); 14926 14927 return PostSavedState; 14928 }(_wordpress_element__WEBPACK_IMPORTED_MODULE_5__["Component"]); 14929 /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_11__["compose"])([Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_9__["withSelect"])(function (select, _ref) { 14930 var forceIsDirty = _ref.forceIsDirty, 14931 forceIsSaving = _ref.forceIsSaving; 14932 14933 var _select = select('core/editor'), 14934 isEditedPostNew = _select.isEditedPostNew, 14935 isCurrentPostPublished = _select.isCurrentPostPublished, 14936 isCurrentPostScheduled = _select.isCurrentPostScheduled, 14937 isEditedPostDirty = _select.isEditedPostDirty, 14938 isSavingPost = _select.isSavingPost, 14939 isEditedPostSaveable = _select.isEditedPostSaveable, 14940 getCurrentPost = _select.getCurrentPost, 14941 isAutosavingPost = _select.isAutosavingPost; 14942 14943 return { 14944 post: getCurrentPost(), 14945 isNew: isEditedPostNew(), 14946 isPublished: isCurrentPostPublished(), 14947 isScheduled: isCurrentPostScheduled(), 14948 isDirty: forceIsDirty || isEditedPostDirty(), 14949 isSaving: forceIsSaving || isSavingPost(), 14950 isSaveable: isEditedPostSaveable(), 14951 isAutosaving: isAutosavingPost() 14952 }; 14953 }), Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_9__["withDispatch"])(function (dispatch) { 14954 return { 14955 onSave: dispatch('core/editor').savePost 14956 }; 14957 }), _wordpress_compose__WEBPACK_IMPORTED_MODULE_11__["withSafeTimeout"]])(PostSavedState)); 14958 14959 14960 /***/ }), 14961 14962 /***/ "./node_modules/@wordpress/editor/build-module/components/post-schedule/check.js": 14963 /*!***************************************************************************************!*\ 14964 !*** ./node_modules/@wordpress/editor/build-module/components/post-schedule/check.js ***! 14965 \***************************************************************************************/ 14966 /*! exports provided: PostScheduleCheck, default */ 14967 /***/ (function(module, __webpack_exports__, __webpack_require__) { 14968 14969 "use strict"; 14970 __webpack_require__.r(__webpack_exports__); 14971 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PostScheduleCheck", function() { return PostScheduleCheck; }); 14972 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash */ "lodash"); 14973 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_0__); 14974 /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose"); 14975 /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_1__); 14976 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); 14977 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_2__); 14978 /** 14979 * External dependencies 14980 */ 14981 14982 /** 14983 * WordPress dependencies 14984 */ 14985 14986 14987 14988 function PostScheduleCheck(_ref) { 14989 var hasPublishAction = _ref.hasPublishAction, 14990 children = _ref.children; 14991 14992 if (!hasPublishAction) { 14993 return null; 14994 } 14995 14996 return children; 14997 } 14998 /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_1__["compose"])([Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_2__["withSelect"])(function (select) { 14999 var _select = select('core/editor'), 15000 getCurrentPost = _select.getCurrentPost, 15001 getCurrentPostType = _select.getCurrentPostType; 15002 15003 return { 15004 hasPublishAction: Object(lodash__WEBPACK_IMPORTED_MODULE_0__["get"])(getCurrentPost(), ['_links', 'wp:action-publish'], false), 15005 postType: getCurrentPostType() 15006 }; 15007 })])(PostScheduleCheck)); 15008 15009 15010 /***/ }), 15011 15012 /***/ "./node_modules/@wordpress/editor/build-module/components/post-schedule/index.js": 15013 /*!***************************************************************************************!*\ 15014 !*** ./node_modules/@wordpress/editor/build-module/components/post-schedule/index.js ***! 15015 \***************************************************************************************/ 15016 /*! exports provided: PostSchedule, default */ 15017 /***/ (function(module, __webpack_exports__, __webpack_require__) { 15018 15019 "use strict"; 15020 __webpack_require__.r(__webpack_exports__); 15021 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PostSchedule", function() { return PostSchedule; }); 15022 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); 15023 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); 15024 /* harmony import */ var _wordpress_date__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/date */ "@wordpress/date"); 15025 /* harmony import */ var _wordpress_date__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_date__WEBPACK_IMPORTED_MODULE_1__); 15026 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); 15027 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_2__); 15028 /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose"); 15029 /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_3__); 15030 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); 15031 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_4__); 15032 15033 15034 /** 15035 * WordPress dependencies 15036 */ 15037 15038 15039 15040 15041 function PostSchedule(_ref) { 15042 var date = _ref.date, 15043 onUpdateDate = _ref.onUpdateDate; 15044 var settings = Object(_wordpress_date__WEBPACK_IMPORTED_MODULE_1__["getSettings"])(); // To know if the current timezone is a 12 hour time with look for "a" in the time format 15045 // We also make sure this a is not escaped by a "/" 15046 15047 var is12HourTime = /a(?!\\)/i.test(settings.formats.time.toLowerCase() // Test only the lower case a 15048 .replace(/\\\\/g, '') // Replace "//" with empty strings 15049 .split('').reverse().join('') // Reverse the string and test for "a" not followed by a slash 15050 ); 15051 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_4__["DateTimePicker"], { 15052 key: "date-time-picker", 15053 currentDate: date, 15054 onChange: onUpdateDate, 15055 locale: settings.l10n.locale, 15056 is12Hour: is12HourTime 15057 }); 15058 } 15059 /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_3__["compose"])([Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_2__["withSelect"])(function (select) { 15060 return { 15061 date: select('core/editor').getEditedPostAttribute('date') 15062 }; 15063 }), Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_2__["withDispatch"])(function (dispatch) { 15064 return { 15065 onUpdateDate: function onUpdateDate(date) { 15066 dispatch('core/editor').editPost({ 15067 date: date 15068 }); 15069 } 15070 }; 15071 })])(PostSchedule)); 15072 15073 15074 /***/ }), 15075 15076 /***/ "./node_modules/@wordpress/editor/build-module/components/post-schedule/label.js": 15077 /*!***************************************************************************************!*\ 15078 !*** ./node_modules/@wordpress/editor/build-module/components/post-schedule/label.js ***! 15079 \***************************************************************************************/ 15080 /*! exports provided: PostScheduleLabel, default */ 15081 /***/ (function(module, __webpack_exports__, __webpack_require__) { 15082 15083 "use strict"; 15084 __webpack_require__.r(__webpack_exports__); 15085 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PostScheduleLabel", function() { return PostScheduleLabel; }); 15086 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); 15087 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__); 15088 /* harmony import */ var _wordpress_date__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/date */ "@wordpress/date"); 15089 /* harmony import */ var _wordpress_date__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_date__WEBPACK_IMPORTED_MODULE_1__); 15090 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); 15091 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_2__); 15092 /** 15093 * WordPress dependencies 15094 */ 15095 15096 15097 15098 function PostScheduleLabel(_ref) { 15099 var date = _ref.date, 15100 isFloating = _ref.isFloating; 15101 var settings = Object(_wordpress_date__WEBPACK_IMPORTED_MODULE_1__["getSettings"])(); 15102 return date && !isFloating ? Object(_wordpress_date__WEBPACK_IMPORTED_MODULE_1__["dateI18n"])(settings.formats.datetime, date) : Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__["__"])('Immediately'); 15103 } 15104 /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_2__["withSelect"])(function (select) { 15105 return { 15106 date: select('core/editor').getEditedPostAttribute('date'), 15107 isFloating: select('core/editor').isEditedPostDateFloating() 15108 }; 15109 })(PostScheduleLabel)); 15110 15111 15112 /***/ }), 15113 15114 /***/ "./node_modules/@wordpress/editor/build-module/components/post-sticky/check.js": 15115 /*!*************************************************************************************!*\ 15116 !*** ./node_modules/@wordpress/editor/build-module/components/post-sticky/check.js ***! 15117 \*************************************************************************************/ 15118 /*! exports provided: PostStickyCheck, default */ 15119 /***/ (function(module, __webpack_exports__, __webpack_require__) { 15120 15121 "use strict"; 15122 __webpack_require__.r(__webpack_exports__); 15123 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PostStickyCheck", function() { return PostStickyCheck; }); 15124 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash */ "lodash"); 15125 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_0__); 15126 /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose"); 15127 /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_1__); 15128 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); 15129 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_2__); 15130 /** 15131 * External dependencies 15132 */ 15133 15134 /** 15135 * WordPress dependencies 15136 */ 15137 15138 15139 15140 function PostStickyCheck(_ref) { 15141 var hasStickyAction = _ref.hasStickyAction, 15142 postType = _ref.postType, 15143 children = _ref.children; 15144 15145 if (postType !== 'post' || !hasStickyAction) { 15146 return null; 15147 } 15148 15149 return children; 15150 } 15151 /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_1__["compose"])([Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_2__["withSelect"])(function (select) { 15152 var post = select('core/editor').getCurrentPost(); 15153 return { 15154 hasStickyAction: Object(lodash__WEBPACK_IMPORTED_MODULE_0__["get"])(post, ['_links', 'wp:action-sticky'], false), 15155 postType: select('core/editor').getCurrentPostType() 15156 }; 15157 })])(PostStickyCheck)); 15158 15159 15160 /***/ }), 15161 15162 /***/ "./node_modules/@wordpress/editor/build-module/components/post-sticky/index.js": 15163 /*!*************************************************************************************!*\ 15164 !*** ./node_modules/@wordpress/editor/build-module/components/post-sticky/index.js ***! 15165 \*************************************************************************************/ 15166 /*! exports provided: PostSticky, default */ 15167 /***/ (function(module, __webpack_exports__, __webpack_require__) { 15168 15169 "use strict"; 15170 __webpack_require__.r(__webpack_exports__); 15171 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PostSticky", function() { return PostSticky; }); 15172 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); 15173 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); 15174 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); 15175 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__); 15176 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); 15177 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__); 15178 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); 15179 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_3__); 15180 /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose"); 15181 /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_4__); 15182 /* harmony import */ var _check__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./check */ "./node_modules/@wordpress/editor/build-module/components/post-sticky/check.js"); 15183 15184 15185 /** 15186 * WordPress dependencies 15187 */ 15188 15189 15190 15191 15192 /** 15193 * Internal dependencies 15194 */ 15195 15196 15197 function PostSticky(_ref) { 15198 var onUpdateSticky = _ref.onUpdateSticky, 15199 _ref$postSticky = _ref.postSticky, 15200 postSticky = _ref$postSticky === void 0 ? false : _ref$postSticky; 15201 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_check__WEBPACK_IMPORTED_MODULE_5__["default"], null, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__["CheckboxControl"], { 15202 label: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__["__"])('Stick to the Front Page'), 15203 checked: postSticky, 15204 onChange: function onChange() { 15205 return onUpdateSticky(!postSticky); 15206 } 15207 })); 15208 } 15209 /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_4__["compose"])([Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_3__["withSelect"])(function (select) { 15210 return { 15211 postSticky: select('core/editor').getEditedPostAttribute('sticky') 15212 }; 15213 }), Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_3__["withDispatch"])(function (dispatch) { 15214 return { 15215 onUpdateSticky: function onUpdateSticky(postSticky) { 15216 dispatch('core/editor').editPost({ 15217 sticky: postSticky 15218 }); 15219 } 15220 }; 15221 })])(PostSticky)); 15222 15223 15224 /***/ }), 15225 15226 /***/ "./node_modules/@wordpress/editor/build-module/components/post-switch-to-draft-button/index.js": 15227 /*!*****************************************************************************************************!*\ 15228 !*** ./node_modules/@wordpress/editor/build-module/components/post-switch-to-draft-button/index.js ***! 15229 \*****************************************************************************************************/ 15230 /*! exports provided: default */ 15231 /***/ (function(module, __webpack_exports__, __webpack_require__) { 15232 15233 "use strict"; 15234 __webpack_require__.r(__webpack_exports__); 15235 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); 15236 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); 15237 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); 15238 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__); 15239 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); 15240 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__); 15241 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); 15242 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_3__); 15243 /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose"); 15244 /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_4__); 15245 15246 15247 /** 15248 * WordPress dependencies 15249 */ 15250 15251 15252 15253 15254 15255 function PostSwitchToDraftButton(_ref) { 15256 var isSaving = _ref.isSaving, 15257 isPublished = _ref.isPublished, 15258 isScheduled = _ref.isScheduled, 15259 onClick = _ref.onClick; 15260 15261 if (!isPublished && !isScheduled) { 15262 return null; 15263 } 15264 15265 var onSwitch = function onSwitch() { 15266 var alertMessage; 15267 15268 if (isPublished) { 15269 alertMessage = Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__["__"])('Are you sure you want to unpublish this post?'); 15270 } else if (isScheduled) { 15271 alertMessage = Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__["__"])('Are you sure you want to unschedule this post?'); 15272 } // eslint-disable-next-line no-alert 15273 15274 15275 if (window.confirm(alertMessage)) { 15276 onClick(); 15277 } 15278 }; 15279 15280 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__["Button"], { 15281 className: "editor-post-switch-to-draft", 15282 isLarge: true, 15283 onClick: onSwitch, 15284 disabled: isSaving 15285 }, Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__["__"])('Switch to Draft')); 15286 } 15287 15288 /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_4__["compose"])([Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_3__["withSelect"])(function (select) { 15289 var _select = select('core/editor'), 15290 isSavingPost = _select.isSavingPost, 15291 isCurrentPostPublished = _select.isCurrentPostPublished, 15292 isCurrentPostScheduled = _select.isCurrentPostScheduled; 15293 15294 return { 15295 isSaving: isSavingPost(), 15296 isPublished: isCurrentPostPublished(), 15297 isScheduled: isCurrentPostScheduled() 15298 }; 15299 }), Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_3__["withDispatch"])(function (dispatch) { 15300 var _dispatch = dispatch('core/editor'), 15301 editPost = _dispatch.editPost, 15302 savePost = _dispatch.savePost; 15303 15304 return { 15305 onClick: function onClick() { 15306 editPost({ 15307 status: 'draft' 15308 }); 15309 savePost(); 15310 } 15311 }; 15312 })])(PostSwitchToDraftButton)); 15313 15314 15315 /***/ }), 15316 15317 /***/ "./node_modules/@wordpress/editor/build-module/components/post-taxonomies/check.js": 15318 /*!*****************************************************************************************!*\ 15319 !*** ./node_modules/@wordpress/editor/build-module/components/post-taxonomies/check.js ***! 15320 \*****************************************************************************************/ 15321 /*! exports provided: PostTaxonomiesCheck, default */ 15322 /***/ (function(module, __webpack_exports__, __webpack_require__) { 15323 15324 "use strict"; 15325 __webpack_require__.r(__webpack_exports__); 15326 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PostTaxonomiesCheck", function() { return PostTaxonomiesCheck; }); 15327 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash */ "lodash"); 15328 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_0__); 15329 /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose"); 15330 /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_1__); 15331 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); 15332 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_2__); 15333 /** 15334 * External Dependencies 15335 */ 15336 15337 /** 15338 * WordPress dependencies 15339 */ 15340 15341 15342 15343 function PostTaxonomiesCheck(_ref) { 15344 var postType = _ref.postType, 15345 taxonomies = _ref.taxonomies, 15346 children = _ref.children; 15347 var hasTaxonomies = Object(lodash__WEBPACK_IMPORTED_MODULE_0__["some"])(taxonomies, function (taxonomy) { 15348 return Object(lodash__WEBPACK_IMPORTED_MODULE_0__["includes"])(taxonomy.types, postType); 15349 }); 15350 15351 if (!hasTaxonomies) { 15352 return null; 15353 } 15354 15355 return children; 15356 } 15357 /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_1__["compose"])([Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_2__["withSelect"])(function (select) { 15358 return { 15359 postType: select('core/editor').getCurrentPostType(), 15360 taxonomies: select('core').getTaxonomies() 15361 }; 15362 })])(PostTaxonomiesCheck)); 15363 15364 15365 /***/ }), 15366 15367 /***/ "./node_modules/@wordpress/editor/build-module/components/post-taxonomies/flat-term-selector.js": 15368 /*!******************************************************************************************************!*\ 15369 !*** ./node_modules/@wordpress/editor/build-module/components/post-taxonomies/flat-term-selector.js ***! 15370 \******************************************************************************************************/ 15371 /*! exports provided: default */ 15372 /***/ (function(module, __webpack_exports__, __webpack_require__) { 15373 15374 "use strict"; 15375 __webpack_require__.r(__webpack_exports__); 15376 /* harmony import */ var _babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/defineProperty */ "./node_modules/@babel/runtime/helpers/esm/defineProperty.js"); 15377 /* harmony import */ var _babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectSpread */ "./node_modules/@babel/runtime/helpers/esm/objectSpread.js"); 15378 /* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/classCallCheck */ "./node_modules/@babel/runtime/helpers/esm/classCallCheck.js"); 15379 /* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/esm/createClass */ "./node_modules/@babel/runtime/helpers/esm/createClass.js"); 15380 /* harmony import */ var _babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/esm/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js"); 15381 /* harmony import */ var _babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/helpers/esm/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js"); 15382 /* harmony import */ var _babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inherits */ "./node_modules/@babel/runtime/helpers/esm/inherits.js"); 15383 /* harmony import */ var _babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @babel/runtime/helpers/esm/assertThisInitialized */ "./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js"); 15384 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); 15385 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__); 15386 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! lodash */ "lodash"); 15387 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_9__); 15388 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); 15389 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_10__); 15390 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); 15391 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_11__); 15392 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); 15393 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_12__); 15394 /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose"); 15395 /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_13__); 15396 /* harmony import */ var _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! @wordpress/api-fetch */ "@wordpress/api-fetch"); 15397 /* harmony import */ var _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_14___default = /*#__PURE__*/__webpack_require__.n(_wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_14__); 15398 /* harmony import */ var _wordpress_url__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! @wordpress/url */ "@wordpress/url"); 15399 /* harmony import */ var _wordpress_url__WEBPACK_IMPORTED_MODULE_15___default = /*#__PURE__*/__webpack_require__.n(_wordpress_url__WEBPACK_IMPORTED_MODULE_15__); 15400 15401 15402 15403 15404 15405 15406 15407 15408 15409 15410 /** 15411 * External dependencies 15412 */ 15413 15414 /** 15415 * WordPress dependencies 15416 */ 15417 15418 15419 15420 15421 15422 15423 15424 15425 /** 15426 * Module constants 15427 */ 15428 15429 var DEFAULT_QUERY = { 15430 per_page: -1, 15431 orderby: 'count', 15432 order: 'desc', 15433 _fields: 'id,name' 15434 }; 15435 var MAX_TERMS_SUGGESTIONS = 20; 15436 15437 var isSameTermName = function isSameTermName(termA, termB) { 15438 return termA.toLowerCase() === termB.toLowerCase(); 15439 }; 15440 15441 var FlatTermSelector = 15442 /*#__PURE__*/ 15443 function (_Component) { 15444 Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_6__["default"])(FlatTermSelector, _Component); 15445 15446 function FlatTermSelector() { 15447 var _this; 15448 15449 Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_2__["default"])(this, FlatTermSelector); 15450 15451 _this = Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_4__["default"])(this, Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_5__["default"])(FlatTermSelector).apply(this, arguments)); 15452 _this.onChange = _this.onChange.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(_this))); 15453 _this.searchTerms = Object(lodash__WEBPACK_IMPORTED_MODULE_9__["throttle"])(_this.searchTerms.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(_this))), 500); 15454 _this.findOrCreateTerm = _this.findOrCreateTerm.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(_this))); 15455 _this.state = { 15456 loading: false, 15457 availableTerms: [], 15458 selectedTerms: [] 15459 }; 15460 return _this; 15461 } 15462 15463 Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_3__["default"])(FlatTermSelector, [{ 15464 key: "componentDidMount", 15465 value: function componentDidMount() { 15466 var _this2 = this; 15467 15468 if (!Object(lodash__WEBPACK_IMPORTED_MODULE_9__["isEmpty"])(this.props.terms)) { 15469 this.setState({ 15470 loading: false 15471 }); 15472 this.initRequest = this.fetchTerms({ 15473 include: this.props.terms.join(','), 15474 per_page: 100 15475 }); 15476 this.initRequest.then(function () { 15477 _this2.setState({ 15478 loading: false 15479 }); 15480 }, function (xhr) { 15481 if (xhr.statusText === 'abort') { 15482 return; 15483 } 15484 15485 _this2.setState({ 15486 loading: false 15487 }); 15488 }); 15489 } 15490 15491 this.searchTerms(); 15492 } 15493 }, { 15494 key: "componentWillUnmount", 15495 value: function componentWillUnmount() { 15496 Object(lodash__WEBPACK_IMPORTED_MODULE_9__["invoke"])(this.initRequest, ['abort']); 15497 Object(lodash__WEBPACK_IMPORTED_MODULE_9__["invoke"])(this.searchRequest, ['abort']); 15498 } 15499 }, { 15500 key: "componentDidUpdate", 15501 value: function componentDidUpdate(prevProps) { 15502 if (prevProps.terms !== this.props.terms) { 15503 this.updateSelectedTerms(this.props.terms); 15504 } 15505 } 15506 }, { 15507 key: "fetchTerms", 15508 value: function fetchTerms() { 15509 var _this3 = this; 15510 15511 var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; 15512 var taxonomy = this.props.taxonomy; 15513 15514 var query = Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_1__["default"])({}, DEFAULT_QUERY, params); 15515 15516 var request = _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_14___default()({ 15517 path: Object(_wordpress_url__WEBPACK_IMPORTED_MODULE_15__["addQueryArgs"])("/wp/v2/".concat(taxonomy.rest_base), query) 15518 }); 15519 request.then(function (terms) { 15520 _this3.setState(function (state) { 15521 return { 15522 availableTerms: state.availableTerms.concat(terms.filter(function (term) { 15523 return !Object(lodash__WEBPACK_IMPORTED_MODULE_9__["find"])(state.availableTerms, function (availableTerm) { 15524 return availableTerm.id === term.id; 15525 }); 15526 })) 15527 }; 15528 }); 15529 15530 _this3.updateSelectedTerms(_this3.props.terms); 15531 }); 15532 return request; 15533 } 15534 }, { 15535 key: "updateSelectedTerms", 15536 value: function updateSelectedTerms() { 15537 var _this4 = this; 15538 15539 var terms = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; 15540 var selectedTerms = terms.reduce(function (result, termId) { 15541 var termObject = Object(lodash__WEBPACK_IMPORTED_MODULE_9__["find"])(_this4.state.availableTerms, function (term) { 15542 return term.id === termId; 15543 }); 15544 15545 if (termObject) { 15546 result.push(termObject.name); 15547 } 15548 15549 return result; 15550 }, []); 15551 this.setState({ 15552 selectedTerms: selectedTerms 15553 }); 15554 } 15555 }, { 15556 key: "findOrCreateTerm", 15557 value: function findOrCreateTerm(termName) { 15558 var _this5 = this; 15559 15560 var taxonomy = this.props.taxonomy; // Tries to create a term or fetch it if it already exists. 15561 15562 return _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_14___default()({ 15563 path: "/wp/v2/".concat(taxonomy.rest_base), 15564 method: 'POST', 15565 data: { 15566 name: termName 15567 } 15568 }).catch(function (error) { 15569 var errorCode = error.code; 15570 15571 if (errorCode === 'term_exists') { 15572 // If the terms exist, fetch it instead of creating a new one. 15573 _this5.addRequest = _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_14___default()({ 15574 path: Object(_wordpress_url__WEBPACK_IMPORTED_MODULE_15__["addQueryArgs"])("/wp/v2/".concat(taxonomy.rest_base), Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_1__["default"])({}, DEFAULT_QUERY, { 15575 search: termName 15576 })) 15577 }); 15578 return _this5.addRequest.then(function (searchResult) { 15579 return Object(lodash__WEBPACK_IMPORTED_MODULE_9__["find"])(searchResult, function (result) { 15580 return isSameTermName(result.name, termName); 15581 }); 15582 }); 15583 } 15584 15585 return Promise.reject(error); 15586 }); 15587 } 15588 }, { 15589 key: "onChange", 15590 value: function onChange(termNames) { 15591 var _this6 = this; 15592 15593 var uniqueTerms = Object(lodash__WEBPACK_IMPORTED_MODULE_9__["uniqBy"])(termNames, function (term) { 15594 return term.toLowerCase(); 15595 }); 15596 this.setState({ 15597 selectedTerms: uniqueTerms 15598 }); 15599 var newTermNames = uniqueTerms.filter(function (termName) { 15600 return !Object(lodash__WEBPACK_IMPORTED_MODULE_9__["find"])(_this6.state.availableTerms, function (term) { 15601 return isSameTermName(term.name, termName); 15602 }); 15603 }); 15604 15605 var termNamesToIds = function termNamesToIds(names, availableTerms) { 15606 return names.map(function (termName) { 15607 return Object(lodash__WEBPACK_IMPORTED_MODULE_9__["find"])(availableTerms, function (term) { 15608 return isSameTermName(term.name, termName); 15609 }).id; 15610 }); 15611 }; 15612 15613 if (newTermNames.length === 0) { 15614 return this.props.onUpdateTerms(termNamesToIds(uniqueTerms, this.state.availableTerms), this.props.taxonomy.rest_base); 15615 } 15616 15617 Promise.all(newTermNames.map(this.findOrCreateTerm)).then(function (newTerms) { 15618 var newAvailableTerms = _this6.state.availableTerms.concat(newTerms); 15619 15620 _this6.setState({ 15621 availableTerms: newAvailableTerms 15622 }); 15623 15624 return _this6.props.onUpdateTerms(termNamesToIds(uniqueTerms, newAvailableTerms), _this6.props.taxonomy.rest_base); 15625 }); 15626 } 15627 }, { 15628 key: "searchTerms", 15629 value: function searchTerms() { 15630 var search = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ''; 15631 Object(lodash__WEBPACK_IMPORTED_MODULE_9__["invoke"])(this.searchRequest, ['abort']); 15632 this.searchRequest = this.fetchTerms({ 15633 search: search 15634 }); 15635 } 15636 }, { 15637 key: "render", 15638 value: function render() { 15639 var _this$props = this.props, 15640 slug = _this$props.slug, 15641 taxonomy = _this$props.taxonomy, 15642 hasAssignAction = _this$props.hasAssignAction; 15643 15644 if (!hasAssignAction) { 15645 return null; 15646 } 15647 15648 var _this$state = this.state, 15649 loading = _this$state.loading, 15650 availableTerms = _this$state.availableTerms, 15651 selectedTerms = _this$state.selectedTerms; 15652 var termNames = availableTerms.map(function (term) { 15653 return term.name; 15654 }); 15655 var newTermPlaceholderLabel = Object(lodash__WEBPACK_IMPORTED_MODULE_9__["get"])(taxonomy, ['data', 'labels', 'add_new_item'], slug === 'post_tag' ? Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_10__["__"])('Add New Tag') : Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_10__["__"])('Add New Term')); 15656 var singularName = Object(lodash__WEBPACK_IMPORTED_MODULE_9__["get"])(taxonomy, ['data', 'labels', 'singular_name'], slug === 'post_tag' ? Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_10__["__"])('Tag') : Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_10__["__"])('Term')); 15657 var termAddedLabel = Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_10__["sprintf"])(Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_10__["_x"])('%s added', 'term'), singularName); 15658 var termRemovedLabel = Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_10__["sprintf"])(Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_10__["_x"])('%s removed', 'term'), singularName); 15659 var removeTermLabel = Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_10__["sprintf"])(Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_10__["_x"])('Remove %s', 'term'), singularName); 15660 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_11__["FormTokenField"], { 15661 value: selectedTerms, 15662 displayTransform: lodash__WEBPACK_IMPORTED_MODULE_9__["unescape"], 15663 suggestions: termNames, 15664 onChange: this.onChange, 15665 onInputChange: this.searchTerms, 15666 maxSuggestions: MAX_TERMS_SUGGESTIONS, 15667 disabled: loading, 15668 placeholder: newTermPlaceholderLabel, 15669 messages: { 15670 added: termAddedLabel, 15671 removed: termRemovedLabel, 15672 remove: removeTermLabel 15673 } 15674 }); 15675 } 15676 }]); 15677 15678 return FlatTermSelector; 15679 }(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["Component"]); 15680 15681 /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_13__["compose"])(Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_12__["withSelect"])(function (select, _ref) { 15682 var slug = _ref.slug; 15683 15684 var _select = select('core/editor'), 15685 getCurrentPost = _select.getCurrentPost; 15686 15687 var _select2 = select('core'), 15688 getTaxonomy = _select2.getTaxonomy; 15689 15690 var taxonomy = getTaxonomy(slug); 15691 return { 15692 hasCreateAction: taxonomy ? Object(lodash__WEBPACK_IMPORTED_MODULE_9__["get"])(getCurrentPost(), ['_links', 'wp:action-create-' + taxonomy.rest_base], false) : false, 15693 hasAssignAction: taxonomy ? Object(lodash__WEBPACK_IMPORTED_MODULE_9__["get"])(getCurrentPost(), ['_links', 'wp:action-assign-' + taxonomy.rest_base], false) : false, 15694 terms: taxonomy ? select('core/editor').getEditedPostAttribute(taxonomy.rest_base) : [], 15695 taxonomy: taxonomy 15696 }; 15697 }), Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_12__["withDispatch"])(function (dispatch) { 15698 return { 15699 onUpdateTerms: function onUpdateTerms(terms, restBase) { 15700 dispatch('core/editor').editPost(Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__["default"])({}, restBase, terms)); 15701 } 15702 }; 15703 }), Object(_wordpress_components__WEBPACK_IMPORTED_MODULE_11__["withFilters"])('editor.PostTaxonomyType'))(FlatTermSelector)); 15704 15705 15706 /***/ }), 15707 15708 /***/ "./node_modules/@wordpress/editor/build-module/components/post-taxonomies/hierarchical-term-selector.js": 15709 /*!**************************************************************************************************************!*\ 15710 !*** ./node_modules/@wordpress/editor/build-module/components/post-taxonomies/hierarchical-term-selector.js ***! 15711 \**************************************************************************************************************/ 15712 /*! exports provided: default */ 15713 /***/ (function(module, __webpack_exports__, __webpack_require__) { 15714 15715 "use strict"; 15716 __webpack_require__.r(__webpack_exports__); 15717 /* harmony import */ var _babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/defineProperty */ "./node_modules/@babel/runtime/helpers/esm/defineProperty.js"); 15718 /* harmony import */ var _babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectSpread */ "./node_modules/@babel/runtime/helpers/esm/objectSpread.js"); 15719 /* harmony import */ var _babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/toConsumableArray */ "./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js"); 15720 /* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/esm/classCallCheck */ "./node_modules/@babel/runtime/helpers/esm/classCallCheck.js"); 15721 /* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/esm/createClass */ "./node_modules/@babel/runtime/helpers/esm/createClass.js"); 15722 /* harmony import */ var _babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/helpers/esm/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js"); 15723 /* harmony import */ var _babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @babel/runtime/helpers/esm/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js"); 15724 /* harmony import */ var _babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inherits */ "./node_modules/@babel/runtime/helpers/esm/inherits.js"); 15725 /* harmony import */ var _babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @babel/runtime/helpers/esm/assertThisInitialized */ "./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js"); 15726 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); 15727 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_9__); 15728 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! lodash */ "lodash"); 15729 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_10__); 15730 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); 15731 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_11__); 15732 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); 15733 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_12__); 15734 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); 15735 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_13__); 15736 /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose"); 15737 /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_14___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_14__); 15738 /* harmony import */ var _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! @wordpress/api-fetch */ "@wordpress/api-fetch"); 15739 /* harmony import */ var _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_15___default = /*#__PURE__*/__webpack_require__.n(_wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_15__); 15740 /* harmony import */ var _wordpress_url__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! @wordpress/url */ "@wordpress/url"); 15741 /* harmony import */ var _wordpress_url__WEBPACK_IMPORTED_MODULE_16___default = /*#__PURE__*/__webpack_require__.n(_wordpress_url__WEBPACK_IMPORTED_MODULE_16__); 15742 /* harmony import */ var _utils_terms__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ../../utils/terms */ "./node_modules/@wordpress/editor/build-module/utils/terms.js"); 15743 15744 15745 15746 15747 15748 15749 15750 15751 15752 15753 15754 /** 15755 * External dependencies 15756 */ 15757 15758 /** 15759 * WordPress dependencies 15760 */ 15761 15762 15763 15764 15765 15766 15767 15768 15769 /** 15770 * Internal dependencies 15771 */ 15772 15773 15774 /** 15775 * Module Constants 15776 */ 15777 15778 var DEFAULT_QUERY = { 15779 per_page: -1, 15780 orderby: 'name', 15781 order: 'asc', 15782 _fields: 'id,name,parent' 15783 }; 15784 var MIN_TERMS_COUNT_FOR_FILTER = 8; 15785 15786 var HierarchicalTermSelector = 15787 /*#__PURE__*/ 15788 function (_Component) { 15789 Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_7__["default"])(HierarchicalTermSelector, _Component); 15790 15791 function HierarchicalTermSelector() { 15792 var _this; 15793 15794 Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_3__["default"])(this, HierarchicalTermSelector); 15795 15796 _this = Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_5__["default"])(this, Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_6__["default"])(HierarchicalTermSelector).apply(this, arguments)); 15797 _this.findTerm = _this.findTerm.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_8__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_8__["default"])(_this))); 15798 _this.onChange = _this.onChange.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_8__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_8__["default"])(_this))); 15799 _this.onChangeFormName = _this.onChangeFormName.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_8__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_8__["default"])(_this))); 15800 _this.onChangeFormParent = _this.onChangeFormParent.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_8__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_8__["default"])(_this))); 15801 _this.onAddTerm = _this.onAddTerm.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_8__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_8__["default"])(_this))); 15802 _this.onToggleForm = _this.onToggleForm.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_8__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_8__["default"])(_this))); 15803 _this.setFilterValue = _this.setFilterValue.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_8__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_8__["default"])(_this))); 15804 _this.sortBySelected = _this.sortBySelected.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_8__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_8__["default"])(_this))); 15805 _this.state = { 15806 loading: true, 15807 availableTermsTree: [], 15808 availableTerms: [], 15809 adding: false, 15810 formName: '', 15811 formParent: '', 15812 showForm: false, 15813 filterValue: '', 15814 filteredTermsTree: [] 15815 }; 15816 return _this; 15817 } 15818 15819 Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_4__["default"])(HierarchicalTermSelector, [{ 15820 key: "onChange", 15821 value: function onChange(event) { 15822 var _this$props = this.props, 15823 onUpdateTerms = _this$props.onUpdateTerms, 15824 _this$props$terms = _this$props.terms, 15825 terms = _this$props$terms === void 0 ? [] : _this$props$terms, 15826 taxonomy = _this$props.taxonomy; 15827 var termId = parseInt(event.target.value, 10); 15828 var hasTerm = terms.indexOf(termId) !== -1; 15829 var newTerms = hasTerm ? Object(lodash__WEBPACK_IMPORTED_MODULE_10__["without"])(terms, termId) : Object(_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_2__["default"])(terms).concat([termId]); 15830 onUpdateTerms(newTerms, taxonomy.rest_base); 15831 } 15832 }, { 15833 key: "onChangeFormName", 15834 value: function onChangeFormName(event) { 15835 var newValue = event.target.value.trim() === '' ? '' : event.target.value; 15836 this.setState({ 15837 formName: newValue 15838 }); 15839 } 15840 }, { 15841 key: "onChangeFormParent", 15842 value: function onChangeFormParent(newParent) { 15843 this.setState({ 15844 formParent: newParent 15845 }); 15846 } 15847 }, { 15848 key: "onToggleForm", 15849 value: function onToggleForm() { 15850 this.setState(function (state) { 15851 return { 15852 showForm: !state.showForm 15853 }; 15854 }); 15855 } 15856 }, { 15857 key: "findTerm", 15858 value: function findTerm(terms, parent, name) { 15859 return Object(lodash__WEBPACK_IMPORTED_MODULE_10__["find"])(terms, function (term) { 15860 return (!term.parent && !parent || parseInt(term.parent) === parseInt(parent)) && term.name.toLowerCase() === name.toLowerCase(); 15861 }); 15862 } 15863 }, { 15864 key: "onAddTerm", 15865 value: function onAddTerm(event) { 15866 var _this2 = this; 15867 15868 event.preventDefault(); 15869 var _this$props2 = this.props, 15870 onUpdateTerms = _this$props2.onUpdateTerms, 15871 taxonomy = _this$props2.taxonomy, 15872 terms = _this$props2.terms, 15873 slug = _this$props2.slug; 15874 var _this$state = this.state, 15875 formName = _this$state.formName, 15876 formParent = _this$state.formParent, 15877 adding = _this$state.adding, 15878 availableTerms = _this$state.availableTerms; 15879 15880 if (formName === '' || adding) { 15881 return; 15882 } // check if the term we are adding already exists 15883 15884 15885 var existingTerm = this.findTerm(availableTerms, formParent, formName); 15886 15887 if (existingTerm) { 15888 // if the term we are adding exists but is not selected select it 15889 if (!Object(lodash__WEBPACK_IMPORTED_MODULE_10__["some"])(terms, function (term) { 15890 return term === existingTerm.id; 15891 })) { 15892 onUpdateTerms(Object(_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_2__["default"])(terms).concat([existingTerm.id]), taxonomy.rest_base); 15893 } 15894 15895 this.setState({ 15896 formName: '', 15897 formParent: '' 15898 }); 15899 return; 15900 } 15901 15902 this.setState({ 15903 adding: true 15904 }); 15905 this.addRequest = _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_15___default()({ 15906 path: "/wp/v2/".concat(taxonomy.rest_base), 15907 method: 'POST', 15908 data: { 15909 name: formName, 15910 parent: formParent ? formParent : undefined 15911 } 15912 }); // Tries to create a term or fetch it if it already exists 15913 15914 var findOrCreatePromise = this.addRequest.catch(function (error) { 15915 var errorCode = error.code; 15916 15917 if (errorCode === 'term_exists') { 15918 // search the new category created since last fetch 15919 _this2.addRequest = _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_15___default()({ 15920 path: Object(_wordpress_url__WEBPACK_IMPORTED_MODULE_16__["addQueryArgs"])("/wp/v2/".concat(taxonomy.rest_base), Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_1__["default"])({}, DEFAULT_QUERY, { 15921 parent: formParent || 0, 15922 search: formName 15923 })) 15924 }); 15925 return _this2.addRequest.then(function (searchResult) { 15926 return _this2.findTerm(searchResult, formParent, formName); 15927 }); 15928 } 15929 15930 return Promise.reject(error); 15931 }); 15932 findOrCreatePromise.then(function (term) { 15933 var hasTerm = !!Object(lodash__WEBPACK_IMPORTED_MODULE_10__["find"])(_this2.state.availableTerms, function (availableTerm) { 15934 return availableTerm.id === term.id; 15935 }); 15936 var newAvailableTerms = hasTerm ? _this2.state.availableTerms : [term].concat(Object(_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_2__["default"])(_this2.state.availableTerms)); 15937 var termAddedMessage = Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_11__["sprintf"])(Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_11__["_x"])('%s added', 'term'), Object(lodash__WEBPACK_IMPORTED_MODULE_10__["get"])(_this2.props.taxonomy, ['data', 'labels', 'singular_name'], slug === 'category' ? Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_11__["__"])('Category') : Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_11__["__"])('Term'))); 15938 15939 _this2.props.speak(termAddedMessage, 'assertive'); 15940 15941 _this2.addRequest = null; 15942 15943 _this2.setState({ 15944 adding: false, 15945 formName: '', 15946 formParent: '', 15947 availableTerms: newAvailableTerms, 15948 availableTermsTree: _this2.sortBySelected(Object(_utils_terms__WEBPACK_IMPORTED_MODULE_17__["buildTermsTree"])(newAvailableTerms)) 15949 }); 15950 15951 onUpdateTerms(Object(_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_2__["default"])(terms).concat([term.id]), taxonomy.rest_base); 15952 }, function (xhr) { 15953 if (xhr.statusText === 'abort') { 15954 return; 15955 } 15956 15957 _this2.addRequest = null; 15958 15959 _this2.setState({ 15960 adding: false 15961 }); 15962 }); 15963 } 15964 }, { 15965 key: "componentDidMount", 15966 value: function componentDidMount() { 15967 this.fetchTerms(); 15968 } 15969 }, { 15970 key: "componentWillUnmount", 15971 value: function componentWillUnmount() { 15972 Object(lodash__WEBPACK_IMPORTED_MODULE_10__["invoke"])(this.fetchRequest, ['abort']); 15973 Object(lodash__WEBPACK_IMPORTED_MODULE_10__["invoke"])(this.addRequest, ['abort']); 15974 } 15975 }, { 15976 key: "componentDidUpdate", 15977 value: function componentDidUpdate(prevProps) { 15978 if (this.props.taxonomy !== prevProps.taxonomy) { 15979 this.fetchTerms(); 15980 } 15981 } 15982 }, { 15983 key: "fetchTerms", 15984 value: function fetchTerms() { 15985 var _this3 = this; 15986 15987 var taxonomy = this.props.taxonomy; 15988 15989 if (!taxonomy) { 15990 return; 15991 } 15992 15993 this.fetchRequest = _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_15___default()({ 15994 path: Object(_wordpress_url__WEBPACK_IMPORTED_MODULE_16__["addQueryArgs"])("/wp/v2/".concat(taxonomy.rest_base), DEFAULT_QUERY) 15995 }); 15996 this.fetchRequest.then(function (terms) { 15997 // resolve 15998 var availableTermsTree = _this3.sortBySelected(Object(_utils_terms__WEBPACK_IMPORTED_MODULE_17__["buildTermsTree"])(terms)); 15999 16000 _this3.fetchRequest = null; 16001 16002 _this3.setState({ 16003 loading: false, 16004 availableTermsTree: availableTermsTree, 16005 availableTerms: terms 16006 }); 16007 }, function (xhr) { 16008 // reject 16009 if (xhr.statusText === 'abort') { 16010 return; 16011 } 16012 16013 _this3.fetchRequest = null; 16014 16015 _this3.setState({ 16016 loading: false 16017 }); 16018 }); 16019 } 16020 }, { 16021 key: "sortBySelected", 16022 value: function sortBySelected(termsTree) { 16023 var terms = this.props.terms; 16024 16025 var treeHasSelection = function treeHasSelection(termTree) { 16026 if (terms.indexOf(termTree.id) !== -1) { 16027 return true; 16028 } 16029 16030 if (undefined === termTree.children) { 16031 return false; 16032 } 16033 16034 var anyChildIsSelected = termTree.children.map(treeHasSelection).filter(function (child) { 16035 return child; 16036 }).length > 0; 16037 16038 if (anyChildIsSelected) { 16039 return true; 16040 } 16041 16042 return false; 16043 }; 16044 16045 var termOrChildIsSelected = function termOrChildIsSelected(termA, termB) { 16046 var termASelected = treeHasSelection(termA); 16047 var termBSelected = treeHasSelection(termB); 16048 16049 if (termASelected === termBSelected) { 16050 return 0; 16051 } 16052 16053 if (termASelected && !termBSelected) { 16054 return -1; 16055 } 16056 16057 if (!termASelected && termBSelected) { 16058 return 1; 16059 } 16060 16061 return 0; 16062 }; 16063 16064 termsTree.sort(termOrChildIsSelected); 16065 return termsTree; 16066 } 16067 }, { 16068 key: "setFilterValue", 16069 value: function setFilterValue(event) { 16070 var availableTermsTree = this.state.availableTermsTree; 16071 var filterValue = event.target.value; 16072 var filteredTermsTree = availableTermsTree.map(this.getFilterMatcher(filterValue)).filter(function (term) { 16073 return term; 16074 }); 16075 16076 var getResultCount = function getResultCount(terms) { 16077 var count = 0; 16078 16079 for (var i = 0; i < terms.length; i++) { 16080 count++; 16081 16082 if (undefined !== terms[i].children) { 16083 count += getResultCount(terms[i].children); 16084 } 16085 } 16086 16087 return count; 16088 }; 16089 16090 this.setState({ 16091 filterValue: filterValue, 16092 filteredTermsTree: filteredTermsTree 16093 }); 16094 var resultCount = getResultCount(filteredTermsTree); 16095 var resultsFoundMessage = Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_11__["sprintf"])(Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_11__["_n"])('%d result found.', '%d results found.', resultCount, 'term'), resultCount); 16096 this.props.debouncedSpeak(resultsFoundMessage, 'assertive'); 16097 } 16098 }, { 16099 key: "getFilterMatcher", 16100 value: function getFilterMatcher(filterValue) { 16101 var matchTermsForFilter = function matchTermsForFilter(originalTerm) { 16102 if ('' === filterValue) { 16103 return originalTerm; 16104 } // Shallow clone, because we'll be filtering the term's children and 16105 // don't want to modify the original term. 16106 16107 16108 var term = Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_1__["default"])({}, originalTerm); // Map and filter the children, recursive so we deal with grandchildren 16109 // and any deeper levels. 16110 16111 16112 if (term.children.length > 0) { 16113 term.children = term.children.map(matchTermsForFilter).filter(function (child) { 16114 return child; 16115 }); 16116 } // If the term's name contains the filterValue, or it has children 16117 // (i.e. some child matched at some point in the tree) then return it. 16118 16119 16120 if (-1 !== term.name.toLowerCase().indexOf(filterValue) || term.children.length > 0) { 16121 return term; 16122 } // Otherwise, return false. After mapping, the list of terms will need 16123 // to have false values filtered out. 16124 16125 16126 return false; 16127 }; 16128 16129 return matchTermsForFilter; 16130 } 16131 }, { 16132 key: "renderTerms", 16133 value: function renderTerms(renderedTerms) { 16134 var _this4 = this; 16135 16136 var _this$props$terms2 = this.props.terms, 16137 terms = _this$props$terms2 === void 0 ? [] : _this$props$terms2; 16138 return renderedTerms.map(function (term) { 16139 var id = "editor-post-taxonomies-hierarchical-term-".concat(term.id); 16140 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_9__["createElement"])("div", { 16141 key: term.id, 16142 className: "editor-post-taxonomies__hierarchical-terms-choice" 16143 }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_9__["createElement"])("input", { 16144 id: id, 16145 className: "editor-post-taxonomies__hierarchical-terms-input", 16146 type: "checkbox", 16147 checked: terms.indexOf(term.id) !== -1, 16148 value: term.id, 16149 onChange: _this4.onChange 16150 }), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_9__["createElement"])("label", { 16151 htmlFor: id 16152 }, Object(lodash__WEBPACK_IMPORTED_MODULE_10__["unescape"])(term.name)), !!term.children.length && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_9__["createElement"])("div", { 16153 className: "editor-post-taxonomies__hierarchical-terms-subchoices" 16154 }, _this4.renderTerms(term.children))); 16155 }); 16156 } 16157 }, { 16158 key: "render", 16159 value: function render() { 16160 var _this$props3 = this.props, 16161 slug = _this$props3.slug, 16162 taxonomy = _this$props3.taxonomy, 16163 instanceId = _this$props3.instanceId, 16164 hasCreateAction = _this$props3.hasCreateAction, 16165 hasAssignAction = _this$props3.hasAssignAction; 16166 16167 if (!hasAssignAction) { 16168 return null; 16169 } 16170 16171 var _this$state2 = this.state, 16172 availableTermsTree = _this$state2.availableTermsTree, 16173 availableTerms = _this$state2.availableTerms, 16174 filteredTermsTree = _this$state2.filteredTermsTree, 16175 formName = _this$state2.formName, 16176 formParent = _this$state2.formParent, 16177 loading = _this$state2.loading, 16178 showForm = _this$state2.showForm, 16179 filterValue = _this$state2.filterValue; 16180 16181 var labelWithFallback = function labelWithFallback(labelProperty, fallbackIsCategory, fallbackIsNotCategory) { 16182 return Object(lodash__WEBPACK_IMPORTED_MODULE_10__["get"])(taxonomy, ['data', 'labels', labelProperty], slug === 'category' ? fallbackIsCategory : fallbackIsNotCategory); 16183 }; 16184 16185 var newTermButtonLabel = labelWithFallback('add_new_item', Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_11__["__"])('Add new category'), Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_11__["__"])('Add new term')); 16186 var newTermLabel = labelWithFallback('new_item_name', Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_11__["__"])('Add new category'), Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_11__["__"])('Add new term')); 16187 var parentSelectLabel = labelWithFallback('parent_item', Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_11__["__"])('Parent Category'), Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_11__["__"])('Parent Term')); 16188 var noParentOption = "\u2014 ".concat(parentSelectLabel, " \u2014"); 16189 var newTermSubmitLabel = newTermButtonLabel; 16190 var inputId = "editor-post-taxonomies__hierarchical-terms-input-".concat(instanceId); 16191 var filterInputId = "editor-post-taxonomies__hierarchical-terms-filter-".concat(instanceId); 16192 var filterLabel = Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_11__["sprintf"])(Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_11__["_x"])('Search %s', 'term'), Object(lodash__WEBPACK_IMPORTED_MODULE_10__["get"])(this.props.taxonomy, ['name'], slug === 'category' ? Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_11__["__"])('Categories') : Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_11__["__"])('Terms'))); 16193 var groupLabel = Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_11__["sprintf"])(Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_11__["_x"])('Available %s', 'term'), Object(lodash__WEBPACK_IMPORTED_MODULE_10__["get"])(this.props.taxonomy, ['name'], slug === 'category' ? Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_11__["__"])('Categories') : Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_11__["__"])('Terms'))); 16194 var showFilter = availableTerms.length >= MIN_TERMS_COUNT_FOR_FILTER; 16195 return [showFilter && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_9__["createElement"])("label", { 16196 key: "filter-label", 16197 htmlFor: filterInputId 16198 }, filterLabel), showFilter && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_9__["createElement"])("input", { 16199 type: "search", 16200 id: filterInputId, 16201 value: filterValue, 16202 onChange: this.setFilterValue, 16203 className: "editor-post-taxonomies__hierarchical-terms-filter", 16204 key: "term-filter-input" 16205 }), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_9__["createElement"])("div", { 16206 className: "editor-post-taxonomies__hierarchical-terms-list", 16207 key: "term-list", 16208 tabIndex: "0", 16209 role: "group", 16210 "aria-label": groupLabel 16211 }, this.renderTerms('' !== filterValue ? filteredTermsTree : availableTermsTree)), !loading && hasCreateAction && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_9__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_12__["Button"], { 16212 key: "term-add-button", 16213 onClick: this.onToggleForm, 16214 className: "editor-post-taxonomies__hierarchical-terms-add", 16215 "aria-expanded": showForm, 16216 isLink: true 16217 }, newTermButtonLabel), showForm && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_9__["createElement"])("form", { 16218 onSubmit: this.onAddTerm, 16219 key: "hierarchical-terms-form" 16220 }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_9__["createElement"])("label", { 16221 htmlFor: inputId, 16222 className: "editor-post-taxonomies__hierarchical-terms-label" 16223 }, newTermLabel), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_9__["createElement"])("input", { 16224 type: "text", 16225 id: inputId, 16226 className: "editor-post-taxonomies__hierarchical-terms-input", 16227 value: formName, 16228 onChange: this.onChangeFormName, 16229 required: true 16230 }), !!availableTerms.length && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_9__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_12__["TreeSelect"], { 16231 label: parentSelectLabel, 16232 noOptionLabel: noParentOption, 16233 onChange: this.onChangeFormParent, 16234 selectedId: formParent, 16235 tree: availableTermsTree 16236 }), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_9__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_12__["Button"], { 16237 isDefault: true, 16238 type: "submit", 16239 className: "editor-post-taxonomies__hierarchical-terms-submit" 16240 }, newTermSubmitLabel))]; 16241 /* eslint-enable jsx-a11y/no-onchange */ 16242 } 16243 }]); 16244 16245 return HierarchicalTermSelector; 16246 }(_wordpress_element__WEBPACK_IMPORTED_MODULE_9__["Component"]); 16247 16248 /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_14__["compose"])([Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_13__["withSelect"])(function (select, _ref) { 16249 var slug = _ref.slug; 16250 16251 var _select = select('core/editor'), 16252 getCurrentPost = _select.getCurrentPost; 16253 16254 var _select2 = select('core'), 16255 getTaxonomy = _select2.getTaxonomy; 16256 16257 var taxonomy = getTaxonomy(slug); 16258 return { 16259 hasCreateAction: taxonomy ? Object(lodash__WEBPACK_IMPORTED_MODULE_10__["get"])(getCurrentPost(), ['_links', 'wp:action-create-' + taxonomy.rest_base], false) : false, 16260 hasAssignAction: taxonomy ? Object(lodash__WEBPACK_IMPORTED_MODULE_10__["get"])(getCurrentPost(), ['_links', 'wp:action-assign-' + taxonomy.rest_base], false) : false, 16261 terms: taxonomy ? select('core/editor').getEditedPostAttribute(taxonomy.rest_base) : [], 16262 taxonomy: taxonomy 16263 }; 16264 }), Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_13__["withDispatch"])(function (dispatch) { 16265 return { 16266 onUpdateTerms: function onUpdateTerms(terms, restBase) { 16267 dispatch('core/editor').editPost(Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__["default"])({}, restBase, terms)); 16268 } 16269 }; 16270 }), _wordpress_components__WEBPACK_IMPORTED_MODULE_12__["withSpokenMessages"], _wordpress_compose__WEBPACK_IMPORTED_MODULE_14__["withInstanceId"], Object(_wordpress_components__WEBPACK_IMPORTED_MODULE_12__["withFilters"])('editor.PostTaxonomyType')])(HierarchicalTermSelector)); 16271 16272 16273 /***/ }), 16274 16275 /***/ "./node_modules/@wordpress/editor/build-module/components/post-taxonomies/index.js": 16276 /*!*****************************************************************************************!*\ 16277 !*** ./node_modules/@wordpress/editor/build-module/components/post-taxonomies/index.js ***! 16278 \*****************************************************************************************/ 16279 /*! exports provided: PostTaxonomies, default */ 16280 /***/ (function(module, __webpack_exports__, __webpack_require__) { 16281 16282 "use strict"; 16283 __webpack_require__.r(__webpack_exports__); 16284 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PostTaxonomies", function() { return PostTaxonomies; }); 16285 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); 16286 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); 16287 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lodash */ "lodash"); 16288 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_1__); 16289 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); 16290 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_2__); 16291 /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose"); 16292 /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_3__); 16293 /* harmony import */ var _hierarchical_term_selector__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./hierarchical-term-selector */ "./node_modules/@wordpress/editor/build-module/components/post-taxonomies/hierarchical-term-selector.js"); 16294 /* harmony import */ var _flat_term_selector__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./flat-term-selector */ "./node_modules/@wordpress/editor/build-module/components/post-taxonomies/flat-term-selector.js"); 16295 16296 16297 /** 16298 * External Dependencies 16299 */ 16300 16301 /** 16302 * WordPress dependencies 16303 */ 16304 16305 16306 16307 16308 /** 16309 * Internal dependencies 16310 */ 16311 16312 16313 16314 function PostTaxonomies(_ref) { 16315 var postType = _ref.postType, 16316 taxonomies = _ref.taxonomies, 16317 _ref$taxonomyWrapper = _ref.taxonomyWrapper, 16318 taxonomyWrapper = _ref$taxonomyWrapper === void 0 ? lodash__WEBPACK_IMPORTED_MODULE_1__["identity"] : _ref$taxonomyWrapper; 16319 var availableTaxonomies = Object(lodash__WEBPACK_IMPORTED_MODULE_1__["filter"])(taxonomies, function (taxonomy) { 16320 return Object(lodash__WEBPACK_IMPORTED_MODULE_1__["includes"])(taxonomy.types, postType); 16321 }); 16322 var visibleTaxonomies = Object(lodash__WEBPACK_IMPORTED_MODULE_1__["filter"])(availableTaxonomies, function (taxonomy) { 16323 return taxonomy.visibility.show_ui; 16324 }); 16325 return visibleTaxonomies.map(function (taxonomy) { 16326 var TaxonomyComponent = taxonomy.hierarchical ? _hierarchical_term_selector__WEBPACK_IMPORTED_MODULE_4__["default"] : _flat_term_selector__WEBPACK_IMPORTED_MODULE_5__["default"]; 16327 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["Fragment"], { 16328 key: "taxonomy-".concat(taxonomy.slug) 16329 }, taxonomyWrapper(Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(TaxonomyComponent, { 16330 slug: taxonomy.slug 16331 }), taxonomy)); 16332 }); 16333 } 16334 /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_3__["compose"])([Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_2__["withSelect"])(function (select) { 16335 return { 16336 postType: select('core/editor').getCurrentPostType(), 16337 taxonomies: select('core').getTaxonomies({ 16338 per_page: -1 16339 }) 16340 }; 16341 })])(PostTaxonomies)); 16342 16343 16344 /***/ }), 16345 16346 /***/ "./node_modules/@wordpress/editor/build-module/components/post-text-editor/index.js": 16347 /*!******************************************************************************************!*\ 16348 !*** ./node_modules/@wordpress/editor/build-module/components/post-text-editor/index.js ***! 16349 \******************************************************************************************/ 16350 /*! exports provided: PostTextEditor, default */ 16351 /***/ (function(module, __webpack_exports__, __webpack_require__) { 16352 16353 "use strict"; 16354 __webpack_require__.r(__webpack_exports__); 16355 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PostTextEditor", function() { return PostTextEditor; }); 16356 /* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/classCallCheck */ "./node_modules/@babel/runtime/helpers/esm/classCallCheck.js"); 16357 /* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/createClass */ "./node_modules/@babel/runtime/helpers/esm/createClass.js"); 16358 /* harmony import */ var _babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js"); 16359 /* harmony import */ var _babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/esm/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js"); 16360 /* harmony import */ var _babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inherits */ "./node_modules/@babel/runtime/helpers/esm/inherits.js"); 16361 /* harmony import */ var _babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/helpers/esm/assertThisInitialized */ "./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js"); 16362 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); 16363 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__); 16364 /* harmony import */ var react_autosize_textarea__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! react-autosize-textarea */ "./node_modules/react-autosize-textarea/lib/index.js"); 16365 /* harmony import */ var react_autosize_textarea__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(react_autosize_textarea__WEBPACK_IMPORTED_MODULE_7__); 16366 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); 16367 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_8__); 16368 /* harmony import */ var _wordpress_html_entities__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @wordpress/html-entities */ "@wordpress/html-entities"); 16369 /* harmony import */ var _wordpress_html_entities__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_wordpress_html_entities__WEBPACK_IMPORTED_MODULE_9__); 16370 /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks"); 16371 /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_10__); 16372 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); 16373 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_11__); 16374 /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose"); 16375 /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_12__); 16376 16377 16378 16379 16380 16381 16382 16383 16384 /** 16385 * External dependencies 16386 */ 16387 16388 /** 16389 * WordPress dependencies 16390 */ 16391 16392 16393 16394 16395 16396 16397 16398 var PostTextEditor = 16399 /*#__PURE__*/ 16400 function (_Component) { 16401 Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__["default"])(PostTextEditor, _Component); 16402 16403 function PostTextEditor() { 16404 var _this; 16405 16406 Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__["default"])(this, PostTextEditor); 16407 16408 _this = Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__["default"])(this, Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__["default"])(PostTextEditor).apply(this, arguments)); 16409 _this.edit = _this.edit.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(_this))); 16410 _this.stopEditing = _this.stopEditing.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(_this))); 16411 _this.state = {}; 16412 return _this; 16413 } 16414 16415 Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__["default"])(PostTextEditor, [{ 16416 key: "edit", 16417 16418 /** 16419 * Handles a textarea change event to notify the onChange prop callback and 16420 * reflect the new value in the component's own state. This marks the start 16421 * of the user's edits, if not already changed, preventing future props 16422 * changes to value from replacing the rendered value. This is expected to 16423 * be followed by a reset to dirty state via `stopEditing`. 16424 * 16425 * @see stopEditing 16426 * 16427 * @param {Event} event Change event. 16428 */ 16429 value: function edit(event) { 16430 var value = event.target.value; 16431 this.props.onChange(value); 16432 this.setState({ 16433 value: value, 16434 isDirty: true 16435 }); 16436 } 16437 /** 16438 * Function called when the user has completed their edits, responsible for 16439 * ensuring that changes, if made, are surfaced to the onPersist prop 16440 * callback and resetting dirty state. 16441 */ 16442 16443 }, { 16444 key: "stopEditing", 16445 value: function stopEditing() { 16446 if (this.state.isDirty) { 16447 this.props.onPersist(this.state.value); 16448 this.setState({ 16449 isDirty: false 16450 }); 16451 } 16452 } 16453 }, { 16454 key: "render", 16455 value: function render() { 16456 var value = this.state.value; 16457 var _this$props = this.props, 16458 placeholder = _this$props.placeholder, 16459 instanceId = _this$props.instanceId; 16460 var decodedPlaceholder = Object(_wordpress_html_entities__WEBPACK_IMPORTED_MODULE_9__["decodeEntities"])(placeholder); 16461 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["Fragment"], null, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("label", { 16462 htmlFor: "post-content-".concat(instanceId), 16463 className: "screen-reader-text" 16464 }, decodedPlaceholder || Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_8__["__"])('Write your story')), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(react_autosize_textarea__WEBPACK_IMPORTED_MODULE_7___default.a, { 16465 autoComplete: "off", 16466 value: value, 16467 onChange: this.edit, 16468 onBlur: this.stopEditing, 16469 className: "editor-post-text-editor", 16470 id: "post-content-".concat(instanceId), 16471 placeholder: decodedPlaceholder || Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_8__["__"])('Write your story') 16472 })); 16473 } 16474 }], [{ 16475 key: "getDerivedStateFromProps", 16476 value: function getDerivedStateFromProps(props, state) { 16477 if (state.isDirty) { 16478 return null; 16479 } 16480 16481 return { 16482 value: props.value, 16483 isDirty: false 16484 }; 16485 } 16486 }]); 16487 16488 return PostTextEditor; 16489 }(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["Component"]); 16490 /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_12__["compose"])([Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_11__["withSelect"])(function (select) { 16491 var _select = select('core/editor'), 16492 getEditedPostContent = _select.getEditedPostContent, 16493 getEditorSettings = _select.getEditorSettings; 16494 16495 var _getEditorSettings = getEditorSettings(), 16496 bodyPlaceholder = _getEditorSettings.bodyPlaceholder; 16497 16498 return { 16499 value: getEditedPostContent(), 16500 placeholder: bodyPlaceholder 16501 }; 16502 }), Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_11__["withDispatch"])(function (dispatch) { 16503 var _dispatch = dispatch('core/editor'), 16504 editPost = _dispatch.editPost, 16505 resetBlocks = _dispatch.resetBlocks; 16506 16507 return { 16508 onChange: function onChange(content) { 16509 editPost({ 16510 content: content 16511 }); 16512 }, 16513 onPersist: function onPersist(content) { 16514 resetBlocks(Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_10__["parse"])(content)); 16515 } 16516 }; 16517 }), _wordpress_compose__WEBPACK_IMPORTED_MODULE_12__["withInstanceId"]])(PostTextEditor)); 16518 16519 16520 /***/ }), 16521 16522 /***/ "./node_modules/@wordpress/editor/build-module/components/post-title/index.js": 16523 /*!************************************************************************************!*\ 16524 !*** ./node_modules/@wordpress/editor/build-module/components/post-title/index.js ***! 16525 \************************************************************************************/ 16526 /*! exports provided: default */ 16527 /***/ (function(module, __webpack_exports__, __webpack_require__) { 16528 16529 "use strict"; 16530 __webpack_require__.r(__webpack_exports__); 16531 /* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/classCallCheck */ "./node_modules/@babel/runtime/helpers/esm/classCallCheck.js"); 16532 /* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/createClass */ "./node_modules/@babel/runtime/helpers/esm/createClass.js"); 16533 /* harmony import */ var _babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js"); 16534 /* harmony import */ var _babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/esm/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js"); 16535 /* harmony import */ var _babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inherits */ "./node_modules/@babel/runtime/helpers/esm/inherits.js"); 16536 /* harmony import */ var _babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/helpers/esm/assertThisInitialized */ "./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js"); 16537 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); 16538 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__); 16539 /* harmony import */ var react_autosize_textarea__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! react-autosize-textarea */ "./node_modules/react-autosize-textarea/lib/index.js"); 16540 /* harmony import */ var react_autosize_textarea__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(react_autosize_textarea__WEBPACK_IMPORTED_MODULE_7__); 16541 /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); 16542 /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_8__); 16543 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! lodash */ "lodash"); 16544 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_9__); 16545 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); 16546 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_10__); 16547 /* harmony import */ var _wordpress_html_entities__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @wordpress/html-entities */ "@wordpress/html-entities"); 16548 /* harmony import */ var _wordpress_html_entities__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(_wordpress_html_entities__WEBPACK_IMPORTED_MODULE_11__); 16549 /* harmony import */ var _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @wordpress/keycodes */ "@wordpress/keycodes"); 16550 /* harmony import */ var _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(_wordpress_keycodes__WEBPACK_IMPORTED_MODULE_12__); 16551 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); 16552 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_13__); 16553 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); 16554 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_14___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_14__); 16555 /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose"); 16556 /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_15___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_15__); 16557 /* harmony import */ var _post_permalink__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ../post-permalink */ "./node_modules/@wordpress/editor/build-module/components/post-permalink/index.js"); 16558 /* harmony import */ var _post_type_support_check__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ../post-type-support-check */ "./node_modules/@wordpress/editor/build-module/components/post-type-support-check/index.js"); 16559 16560 16561 16562 16563 16564 16565 16566 16567 /** 16568 * External dependencies 16569 */ 16570 16571 16572 16573 /** 16574 * WordPress dependencies 16575 */ 16576 16577 16578 16579 16580 16581 16582 16583 16584 /** 16585 * Internal dependencies 16586 */ 16587 16588 16589 16590 /** 16591 * Constants 16592 */ 16593 16594 var REGEXP_NEWLINES = /[\r\n]+/g; 16595 16596 var PostTitle = 16597 /*#__PURE__*/ 16598 function (_Component) { 16599 Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__["default"])(PostTitle, _Component); 16600 16601 function PostTitle() { 16602 var _this; 16603 16604 Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__["default"])(this, PostTitle); 16605 16606 _this = Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__["default"])(this, Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__["default"])(PostTitle).apply(this, arguments)); 16607 _this.onChange = _this.onChange.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(_this))); 16608 _this.onSelect = _this.onSelect.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(_this))); 16609 _this.onUnselect = _this.onUnselect.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(_this))); 16610 _this.onKeyDown = _this.onKeyDown.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(_this))); 16611 _this.redirectHistory = _this.redirectHistory.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(_this))); 16612 _this.state = { 16613 isSelected: false 16614 }; 16615 return _this; 16616 } 16617 16618 Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__["default"])(PostTitle, [{ 16619 key: "handleFocusOutside", 16620 value: function handleFocusOutside() { 16621 this.onUnselect(); 16622 } 16623 }, { 16624 key: "onSelect", 16625 value: function onSelect() { 16626 this.setState({ 16627 isSelected: true 16628 }); 16629 this.props.clearSelectedBlock(); 16630 } 16631 }, { 16632 key: "onUnselect", 16633 value: function onUnselect() { 16634 this.setState({ 16635 isSelected: false 16636 }); 16637 } 16638 }, { 16639 key: "onChange", 16640 value: function onChange(event) { 16641 var newTitle = event.target.value.replace(REGEXP_NEWLINES, ' '); 16642 this.props.onUpdate(newTitle); 16643 } 16644 }, { 16645 key: "onKeyDown", 16646 value: function onKeyDown(event) { 16647 if (event.keyCode === _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_12__["ENTER"]) { 16648 event.preventDefault(); 16649 this.props.onEnterPress(); 16650 } 16651 } 16652 /** 16653 * Emulates behavior of an undo or redo on its corresponding key press 16654 * combination. This is a workaround to React's treatment of undo in a 16655 * controlled textarea where characters are updated one at a time. 16656 * Instead, leverage the store's undo handling of title changes. 16657 * 16658 * @see https://github.com/facebook/react/issues/8514 16659 * 16660 * @param {KeyboardEvent} event Key event. 16661 */ 16662 16663 }, { 16664 key: "redirectHistory", 16665 value: function redirectHistory(event) { 16666 if (event.shiftKey) { 16667 this.props.onRedo(); 16668 } else { 16669 this.props.onUndo(); 16670 } 16671 16672 event.preventDefault(); 16673 } 16674 }, { 16675 key: "render", 16676 value: function render() { 16677 var _this$props = this.props, 16678 hasFixedToolbar = _this$props.hasFixedToolbar, 16679 isCleanNewPost = _this$props.isCleanNewPost, 16680 isFocusMode = _this$props.isFocusMode, 16681 isPostTypeViewable = _this$props.isPostTypeViewable, 16682 instanceId = _this$props.instanceId, 16683 placeholder = _this$props.placeholder, 16684 title = _this$props.title; 16685 var isSelected = this.state.isSelected; 16686 var className = classnames__WEBPACK_IMPORTED_MODULE_8___default()('editor-post-title__block', { 16687 'is-selected': isSelected, 16688 'is-focus-mode': isFocusMode, 16689 'has-fixed-toolbar': hasFixedToolbar 16690 }); 16691 var decodedPlaceholder = Object(_wordpress_html_entities__WEBPACK_IMPORTED_MODULE_11__["decodeEntities"])(placeholder); 16692 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(_post_type_support_check__WEBPACK_IMPORTED_MODULE_17__["default"], { 16693 supportKeys: "title" 16694 }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("div", { 16695 className: "editor-post-title" 16696 }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("div", { 16697 className: className 16698 }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_14__["KeyboardShortcuts"], { 16699 shortcuts: { 16700 'mod+z': this.redirectHistory, 16701 'mod+shift+z': this.redirectHistory 16702 } 16703 }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("label", { 16704 htmlFor: "post-title-".concat(instanceId), 16705 className: "screen-reader-text" 16706 }, decodedPlaceholder || Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_10__["__"])('Add title')), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(react_autosize_textarea__WEBPACK_IMPORTED_MODULE_7___default.a, { 16707 id: "post-title-".concat(instanceId), 16708 className: "editor-post-title__input", 16709 value: title, 16710 onChange: this.onChange, 16711 placeholder: decodedPlaceholder || Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_10__["__"])('Add title'), 16712 onFocus: this.onSelect, 16713 onKeyDown: this.onKeyDown, 16714 onKeyPress: this.onUnselect 16715 /* 16716 Only autofocus the title when the post is entirely empty. 16717 This should only happen for a new post, which means we 16718 focus the title on new post so the author can start typing 16719 right away, without needing to click anything. 16720 */ 16721 16722 /* eslint-disable jsx-a11y/no-autofocus */ 16723 , 16724 autoFocus: isCleanNewPost 16725 /* eslint-enable jsx-a11y/no-autofocus */ 16726 16727 })), isSelected && isPostTypeViewable && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(_post_permalink__WEBPACK_IMPORTED_MODULE_16__["default"], null)))); 16728 } 16729 }]); 16730 16731 return PostTitle; 16732 }(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["Component"]); 16733 16734 var applyWithSelect = Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_13__["withSelect"])(function (select) { 16735 var _select = select('core/editor'), 16736 getEditedPostAttribute = _select.getEditedPostAttribute, 16737 getEditorSettings = _select.getEditorSettings, 16738 isCleanNewPost = _select.isCleanNewPost; 16739 16740 var _select2 = select('core'), 16741 getPostType = _select2.getPostType; 16742 16743 var postType = getPostType(getEditedPostAttribute('type')); 16744 16745 var _getEditorSettings = getEditorSettings(), 16746 titlePlaceholder = _getEditorSettings.titlePlaceholder, 16747 focusMode = _getEditorSettings.focusMode, 16748 hasFixedToolbar = _getEditorSettings.hasFixedToolbar; 16749 16750 return { 16751 isCleanNewPost: isCleanNewPost(), 16752 title: getEditedPostAttribute('title'), 16753 isPostTypeViewable: Object(lodash__WEBPACK_IMPORTED_MODULE_9__["get"])(postType, ['viewable'], false), 16754 placeholder: titlePlaceholder, 16755 isFocusMode: focusMode, 16756 hasFixedToolbar: hasFixedToolbar 16757 }; 16758 }); 16759 var applyWithDispatch = Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_13__["withDispatch"])(function (dispatch) { 16760 var _dispatch = dispatch('core/editor'), 16761 insertDefaultBlock = _dispatch.insertDefaultBlock, 16762 editPost = _dispatch.editPost, 16763 clearSelectedBlock = _dispatch.clearSelectedBlock, 16764 undo = _dispatch.undo, 16765 redo = _dispatch.redo; 16766 16767 return { 16768 onEnterPress: function onEnterPress() { 16769 insertDefaultBlock(undefined, undefined, 0); 16770 }, 16771 onUpdate: function onUpdate(title) { 16772 editPost({ 16773 title: title 16774 }); 16775 }, 16776 onUndo: undo, 16777 onRedo: redo, 16778 clearSelectedBlock: clearSelectedBlock 16779 }; 16780 }); 16781 /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_15__["compose"])(applyWithSelect, applyWithDispatch, _wordpress_compose__WEBPACK_IMPORTED_MODULE_15__["withInstanceId"], _wordpress_components__WEBPACK_IMPORTED_MODULE_14__["withFocusOutside"])(PostTitle)); 16782 16783 16784 /***/ }), 16785 16786 /***/ "./node_modules/@wordpress/editor/build-module/components/post-trash/check.js": 16787 /*!************************************************************************************!*\ 16788 !*** ./node_modules/@wordpress/editor/build-module/components/post-trash/check.js ***! 16789 \************************************************************************************/ 16790 /*! exports provided: default */ 16791 /***/ (function(module, __webpack_exports__, __webpack_require__) { 16792 16793 "use strict"; 16794 __webpack_require__.r(__webpack_exports__); 16795 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); 16796 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_0__); 16797 /** 16798 * WordPress dependencies 16799 */ 16800 16801 16802 function PostTrashCheck(_ref) { 16803 var isNew = _ref.isNew, 16804 postId = _ref.postId, 16805 children = _ref.children; 16806 16807 if (isNew || !postId) { 16808 return null; 16809 } 16810 16811 return children; 16812 } 16813 16814 /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_0__["withSelect"])(function (select) { 16815 var _select = select('core/editor'), 16816 isEditedPostNew = _select.isEditedPostNew, 16817 getCurrentPostId = _select.getCurrentPostId; 16818 16819 return { 16820 isNew: isEditedPostNew(), 16821 postId: getCurrentPostId() 16822 }; 16823 })(PostTrashCheck)); 16824 16825 16826 /***/ }), 16827 16828 /***/ "./node_modules/@wordpress/editor/build-module/components/post-trash/index.js": 16829 /*!************************************************************************************!*\ 16830 !*** ./node_modules/@wordpress/editor/build-module/components/post-trash/index.js ***! 16831 \************************************************************************************/ 16832 /*! exports provided: default */ 16833 /***/ (function(module, __webpack_exports__, __webpack_require__) { 16834 16835 "use strict"; 16836 __webpack_require__.r(__webpack_exports__); 16837 /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutProperties */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js"); 16838 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); 16839 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__); 16840 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); 16841 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__); 16842 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); 16843 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__); 16844 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); 16845 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_4__); 16846 /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose"); 16847 /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_5__); 16848 16849 16850 16851 /** 16852 * WordPress dependencies 16853 */ 16854 16855 16856 16857 16858 16859 function PostTrash(_ref) { 16860 var isNew = _ref.isNew, 16861 postId = _ref.postId, 16862 postType = _ref.postType, 16863 props = Object(_babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_0__["default"])(_ref, ["isNew", "postId", "postType"]); 16864 16865 if (isNew || !postId) { 16866 return null; 16867 } 16868 16869 var onClick = function onClick() { 16870 return props.trashPost(postId, postType); 16871 }; 16872 16873 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__["Button"], { 16874 isLink: true, 16875 className: "editor-post-trash button-link-delete", 16876 onClick: onClick 16877 }, Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__["__"])('Move to trash'), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__["Dashicon"], { 16878 icon: "trash" 16879 })); 16880 } 16881 16882 /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_5__["compose"])([Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_4__["withSelect"])(function (select) { 16883 var _select = select('core/editor'), 16884 isEditedPostNew = _select.isEditedPostNew, 16885 getCurrentPostId = _select.getCurrentPostId, 16886 getCurrentPostType = _select.getCurrentPostType; 16887 16888 return { 16889 isNew: isEditedPostNew(), 16890 postId: getCurrentPostId(), 16891 postType: getCurrentPostType() 16892 }; 16893 }), Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_4__["withDispatch"])(function (dispatch) { 16894 return { 16895 trashPost: dispatch('core/editor').trashPost 16896 }; 16897 })])(PostTrash)); 16898 16899 16900 /***/ }), 16901 16902 /***/ "./node_modules/@wordpress/editor/build-module/components/post-type-support-check/index.js": 16903 /*!*************************************************************************************************!*\ 16904 !*** ./node_modules/@wordpress/editor/build-module/components/post-type-support-check/index.js ***! 16905 \*************************************************************************************************/ 16906 /*! exports provided: PostTypeSupportCheck, default */ 16907 /***/ (function(module, __webpack_exports__, __webpack_require__) { 16908 16909 "use strict"; 16910 __webpack_require__.r(__webpack_exports__); 16911 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PostTypeSupportCheck", function() { return PostTypeSupportCheck; }); 16912 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash */ "lodash"); 16913 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_0__); 16914 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); 16915 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_1__); 16916 /** 16917 * External dependencies 16918 */ 16919 16920 /** 16921 * WordPress dependencies 16922 */ 16923 16924 16925 /** 16926 * A component which renders its own children only if the current editor post 16927 * type supports one of the given `supportKeys` prop. 16928 * 16929 * @param {?Object} props.postType Current post type. 16930 * @param {WPElement} props.children Children to be rendered if post 16931 * type supports. 16932 * @param {(string|string[])} props.supportKeys String or string array of keys 16933 * to test. 16934 * 16935 * @return {WPElement} Rendered element. 16936 */ 16937 16938 function PostTypeSupportCheck(_ref) { 16939 var postType = _ref.postType, 16940 children = _ref.children, 16941 supportKeys = _ref.supportKeys; 16942 var isSupported = true; 16943 16944 if (postType) { 16945 isSupported = Object(lodash__WEBPACK_IMPORTED_MODULE_0__["some"])(Object(lodash__WEBPACK_IMPORTED_MODULE_0__["castArray"])(supportKeys), function (key) { 16946 return !!postType.supports[key]; 16947 }); 16948 } 16949 16950 if (!isSupported) { 16951 return null; 16952 } 16953 16954 return children; 16955 } 16956 /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_1__["withSelect"])(function (select) { 16957 var _select = select('core/editor'), 16958 getEditedPostAttribute = _select.getEditedPostAttribute; 16959 16960 var _select2 = select('core'), 16961 getPostType = _select2.getPostType; 16962 16963 return { 16964 postType: getPostType(getEditedPostAttribute('type')) 16965 }; 16966 })(PostTypeSupportCheck)); 16967 16968 16969 /***/ }), 16970 16971 /***/ "./node_modules/@wordpress/editor/build-module/components/post-visibility/check.js": 16972 /*!*****************************************************************************************!*\ 16973 !*** ./node_modules/@wordpress/editor/build-module/components/post-visibility/check.js ***! 16974 \*****************************************************************************************/ 16975 /*! exports provided: PostVisibilityCheck, default */ 16976 /***/ (function(module, __webpack_exports__, __webpack_require__) { 16977 16978 "use strict"; 16979 __webpack_require__.r(__webpack_exports__); 16980 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PostVisibilityCheck", function() { return PostVisibilityCheck; }); 16981 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash */ "lodash"); 16982 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_0__); 16983 /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose"); 16984 /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_1__); 16985 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); 16986 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_2__); 16987 /** 16988 * External dependencies 16989 */ 16990 16991 /** 16992 * WordPress dependencies 16993 */ 16994 16995 16996 16997 function PostVisibilityCheck(_ref) { 16998 var hasPublishAction = _ref.hasPublishAction, 16999 render = _ref.render; 17000 var canEdit = hasPublishAction; 17001 return render({ 17002 canEdit: canEdit 17003 }); 17004 } 17005 /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_1__["compose"])([Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_2__["withSelect"])(function (select) { 17006 var _select = select('core/editor'), 17007 getCurrentPost = _select.getCurrentPost, 17008 getCurrentPostType = _select.getCurrentPostType; 17009 17010 return { 17011 hasPublishAction: Object(lodash__WEBPACK_IMPORTED_MODULE_0__["get"])(getCurrentPost(), ['_links', 'wp:action-publish'], false), 17012 postType: getCurrentPostType() 17013 }; 17014 })])(PostVisibilityCheck)); 17015 17016 17017 /***/ }), 17018 17019 /***/ "./node_modules/@wordpress/editor/build-module/components/post-visibility/index.js": 17020 /*!*****************************************************************************************!*\ 17021 !*** ./node_modules/@wordpress/editor/build-module/components/post-visibility/index.js ***! 17022 \*****************************************************************************************/ 17023 /*! exports provided: PostVisibility, default */ 17024 /***/ (function(module, __webpack_exports__, __webpack_require__) { 17025 17026 "use strict"; 17027 __webpack_require__.r(__webpack_exports__); 17028 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PostVisibility", function() { return PostVisibility; }); 17029 /* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/classCallCheck */ "./node_modules/@babel/runtime/helpers/esm/classCallCheck.js"); 17030 /* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/createClass */ "./node_modules/@babel/runtime/helpers/esm/createClass.js"); 17031 /* harmony import */ var _babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js"); 17032 /* harmony import */ var _babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/esm/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js"); 17033 /* harmony import */ var _babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inherits */ "./node_modules/@babel/runtime/helpers/esm/inherits.js"); 17034 /* harmony import */ var _babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/helpers/esm/assertThisInitialized */ "./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js"); 17035 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); 17036 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__); 17037 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); 17038 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_7__); 17039 /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose"); 17040 /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_8__); 17041 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); 17042 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_9__); 17043 /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./utils */ "./node_modules/@wordpress/editor/build-module/components/post-visibility/utils.js"); 17044 17045 17046 17047 17048 17049 17050 17051 17052 /** 17053 * WordPress dependencies 17054 */ 17055 17056 17057 17058 17059 /** 17060 * Internal Dependencies 17061 */ 17062 17063 17064 var PostVisibility = 17065 /*#__PURE__*/ 17066 function (_Component) { 17067 Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__["default"])(PostVisibility, _Component); 17068 17069 function PostVisibility(props) { 17070 var _this; 17071 17072 Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__["default"])(this, PostVisibility); 17073 17074 _this = Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__["default"])(this, Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__["default"])(PostVisibility).apply(this, arguments)); 17075 _this.setPublic = _this.setPublic.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(_this))); 17076 _this.setPrivate = _this.setPrivate.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(_this))); 17077 _this.setPasswordProtected = _this.setPasswordProtected.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(_this))); 17078 _this.updatePassword = _this.updatePassword.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(_this))); 17079 _this.state = { 17080 hasPassword: !!props.password 17081 }; 17082 return _this; 17083 } 17084 17085 Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__["default"])(PostVisibility, [{ 17086 key: "setPublic", 17087 value: function setPublic() { 17088 var _this$props = this.props, 17089 visibility = _this$props.visibility, 17090 onUpdateVisibility = _this$props.onUpdateVisibility, 17091 status = _this$props.status; 17092 onUpdateVisibility(visibility === 'private' ? 'draft' : status); 17093 this.setState({ 17094 hasPassword: false 17095 }); 17096 } 17097 }, { 17098 key: "setPrivate", 17099 value: function setPrivate() { 17100 if (!window.confirm(Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_7__["__"])('Would you like to privately publish this post now?'))) { 17101 // eslint-disable-line no-alert 17102 return; 17103 } 17104 17105 var _this$props2 = this.props, 17106 onUpdateVisibility = _this$props2.onUpdateVisibility, 17107 onSave = _this$props2.onSave; 17108 onUpdateVisibility('private'); 17109 this.setState({ 17110 hasPassword: false 17111 }); 17112 onSave(); 17113 } 17114 }, { 17115 key: "setPasswordProtected", 17116 value: function setPasswordProtected() { 17117 var _this$props3 = this.props, 17118 visibility = _this$props3.visibility, 17119 onUpdateVisibility = _this$props3.onUpdateVisibility, 17120 status = _this$props3.status, 17121 password = _this$props3.password; 17122 onUpdateVisibility(visibility === 'private' ? 'draft' : status, password || ''); 17123 this.setState({ 17124 hasPassword: true 17125 }); 17126 } 17127 }, { 17128 key: "updatePassword", 17129 value: function updatePassword(event) { 17130 var _this$props4 = this.props, 17131 status = _this$props4.status, 17132 onUpdateVisibility = _this$props4.onUpdateVisibility; 17133 onUpdateVisibility(status, event.target.value); 17134 } 17135 }, { 17136 key: "render", 17137 value: function render() { 17138 var _this$props5 = this.props, 17139 visibility = _this$props5.visibility, 17140 password = _this$props5.password, 17141 instanceId = _this$props5.instanceId; 17142 var visibilityHandlers = { 17143 public: { 17144 onSelect: this.setPublic, 17145 checked: visibility === 'public' && !this.state.hasPassword 17146 }, 17147 private: { 17148 onSelect: this.setPrivate, 17149 checked: visibility === 'private' 17150 }, 17151 password: { 17152 onSelect: this.setPasswordProtected, 17153 checked: this.state.hasPassword 17154 } 17155 }; 17156 return [Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("fieldset", { 17157 key: "visibility-selector", 17158 className: "editor-post-visibility__dialog-fieldset" 17159 }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("legend", { 17160 className: "editor-post-visibility__dialog-legend" 17161 }, Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_7__["__"])('Post Visibility')), _utils__WEBPACK_IMPORTED_MODULE_10__["visibilityOptions"].map(function (_ref) { 17162 var value = _ref.value, 17163 label = _ref.label, 17164 info = _ref.info; 17165 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("div", { 17166 key: value, 17167 className: "editor-post-visibility__choice" 17168 }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("input", { 17169 type: "radio", 17170 name: "editor-post-visibility__setting-".concat(instanceId), 17171 value: value, 17172 onChange: visibilityHandlers[value].onSelect, 17173 checked: visibilityHandlers[value].checked, 17174 id: "editor-post-".concat(value, "-").concat(instanceId), 17175 "aria-describedby": "editor-post-".concat(value, "-").concat(instanceId, "-description"), 17176 className: "editor-post-visibility__dialog-radio" 17177 }), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("label", { 17178 htmlFor: "editor-post-".concat(value, "-").concat(instanceId), 17179 className: "editor-post-visibility__dialog-label" 17180 }, label), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("p", { 17181 id: "editor-post-".concat(value, "-").concat(instanceId, "-description"), 17182 className: "editor-post-visibility__dialog-info" 17183 }, info)); 17184 })), this.state.hasPassword && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("div", { 17185 className: "editor-post-visibility__dialog-password", 17186 key: "password-selector" 17187 }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("label", { 17188 htmlFor: "editor-post-visibility__dialog-password-input-".concat(instanceId), 17189 className: "screen-reader-text" 17190 }, Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_7__["__"])('Create password')), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("input", { 17191 className: "editor-post-visibility__dialog-password-input", 17192 id: "editor-post-visibility__dialog-password-input-".concat(instanceId), 17193 type: "text", 17194 onChange: this.updatePassword, 17195 value: password, 17196 placeholder: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_7__["__"])('Use a secure password') 17197 }))]; 17198 } 17199 }]); 17200 17201 return PostVisibility; 17202 }(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["Component"]); 17203 /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_8__["compose"])([Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_9__["withSelect"])(function (select) { 17204 var _select = select('core/editor'), 17205 getEditedPostAttribute = _select.getEditedPostAttribute, 17206 getEditedPostVisibility = _select.getEditedPostVisibility; 17207 17208 return { 17209 status: getEditedPostAttribute('status'), 17210 visibility: getEditedPostVisibility(), 17211 password: getEditedPostAttribute('password') 17212 }; 17213 }), Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_9__["withDispatch"])(function (dispatch) { 17214 var _dispatch = dispatch('core/editor'), 17215 savePost = _dispatch.savePost, 17216 editPost = _dispatch.editPost; 17217 17218 return { 17219 onSave: savePost, 17220 onUpdateVisibility: function onUpdateVisibility(status) { 17221 var password = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; 17222 editPost({ 17223 status: status, 17224 password: password 17225 }); 17226 } 17227 }; 17228 }), _wordpress_compose__WEBPACK_IMPORTED_MODULE_8__["withInstanceId"]])(PostVisibility)); 17229 17230 17231 /***/ }), 17232 17233 /***/ "./node_modules/@wordpress/editor/build-module/components/post-visibility/label.js": 17234 /*!*****************************************************************************************!*\ 17235 !*** ./node_modules/@wordpress/editor/build-module/components/post-visibility/label.js ***! 17236 \*****************************************************************************************/ 17237 /*! exports provided: default */ 17238 /***/ (function(module, __webpack_exports__, __webpack_require__) { 17239 17240 "use strict"; 17241 __webpack_require__.r(__webpack_exports__); 17242 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash */ "lodash"); 17243 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_0__); 17244 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); 17245 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_1__); 17246 /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./utils */ "./node_modules/@wordpress/editor/build-module/components/post-visibility/utils.js"); 17247 /** 17248 * External dependencies 17249 */ 17250 17251 /** 17252 * WordPress dependencies 17253 */ 17254 17255 17256 /** 17257 * Internal Dependencies 17258 */ 17259 17260 17261 17262 function PostVisibilityLabel(_ref) { 17263 var visibility = _ref.visibility; 17264 17265 var getVisibilityLabel = function getVisibilityLabel() { 17266 return Object(lodash__WEBPACK_IMPORTED_MODULE_0__["find"])(_utils__WEBPACK_IMPORTED_MODULE_2__["visibilityOptions"], { 17267 value: visibility 17268 }).label; 17269 }; 17270 17271 return getVisibilityLabel(visibility); 17272 } 17273 17274 /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_1__["withSelect"])(function (select) { 17275 return { 17276 visibility: select('core/editor').getEditedPostVisibility() 17277 }; 17278 })(PostVisibilityLabel)); 17279 17280 17281 /***/ }), 17282 17283 /***/ "./node_modules/@wordpress/editor/build-module/components/post-visibility/utils.js": 17284 /*!*****************************************************************************************!*\ 17285 !*** ./node_modules/@wordpress/editor/build-module/components/post-visibility/utils.js ***! 17286 \*****************************************************************************************/ 17287 /*! exports provided: visibilityOptions */ 17288 /***/ (function(module, __webpack_exports__, __webpack_require__) { 17289 17290 "use strict"; 17291 __webpack_require__.r(__webpack_exports__); 17292 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "visibilityOptions", function() { return visibilityOptions; }); 17293 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); 17294 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__); 17295 /** 17296 * WordPress Dependencies 17297 */ 17298 17299 var visibilityOptions = [{ 17300 value: 'public', 17301 label: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__["__"])('Public'), 17302 info: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__["__"])('Visible to everyone.') 17303 }, { 17304 value: 'private', 17305 label: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__["__"])('Private'), 17306 info: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__["__"])('Only visible to site admins and editors.') 17307 }, { 17308 value: 'password', 17309 label: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__["__"])('Password Protected'), 17310 info: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__["__"])('Protected with a password you choose. Only those with the password can view this post.') 17311 }]; 17312 17313 17314 /***/ }), 17315 17316 /***/ "./node_modules/@wordpress/editor/build-module/components/preserve-scroll-in-reorder/index.js": 17317 /*!****************************************************************************************************!*\ 17318 !*** ./node_modules/@wordpress/editor/build-module/components/preserve-scroll-in-reorder/index.js ***! 17319 \****************************************************************************************************/ 17320 /*! exports provided: default */ 17321 /***/ (function(module, __webpack_exports__, __webpack_require__) { 17322 17323 "use strict"; 17324 __webpack_require__.r(__webpack_exports__); 17325 /* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/classCallCheck */ "./node_modules/@babel/runtime/helpers/esm/classCallCheck.js"); 17326 /* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/createClass */ "./node_modules/@babel/runtime/helpers/esm/createClass.js"); 17327 /* harmony import */ var _babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js"); 17328 /* harmony import */ var _babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/esm/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js"); 17329 /* harmony import */ var _babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inherits */ "./node_modules/@babel/runtime/helpers/esm/inherits.js"); 17330 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); 17331 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_5__); 17332 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); 17333 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_6__); 17334 /* harmony import */ var _wordpress_dom__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @wordpress/dom */ "@wordpress/dom"); 17335 /* harmony import */ var _wordpress_dom__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_wordpress_dom__WEBPACK_IMPORTED_MODULE_7__); 17336 /* harmony import */ var _utils_dom__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../utils/dom */ "./node_modules/@wordpress/editor/build-module/utils/dom.js"); 17337 17338 17339 17340 17341 17342 17343 /** 17344 * WordPress dependencies 17345 */ 17346 17347 17348 17349 /** 17350 * Internal dependencies 17351 */ 17352 17353 17354 /** 17355 * Non-visual component which preserves offset of selected block within nearest 17356 * scrollable container while reordering. 17357 * 17358 * @example 17359 * 17360 * ```jsx 17361 * <PreserveScrollInReorder /> 17362 * ``` 17363 */ 17364 17365 var PreserveScrollInReorder = 17366 /*#__PURE__*/ 17367 function (_Component) { 17368 Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__["default"])(PreserveScrollInReorder, _Component); 17369 17370 function PreserveScrollInReorder() { 17371 Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__["default"])(this, PreserveScrollInReorder); 17372 17373 return Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__["default"])(this, Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__["default"])(PreserveScrollInReorder).apply(this, arguments)); 17374 } 17375 17376 Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__["default"])(PreserveScrollInReorder, [{ 17377 key: "getSnapshotBeforeUpdate", 17378 value: function getSnapshotBeforeUpdate(prevProps) { 17379 var _this$props = this.props, 17380 blockOrder = _this$props.blockOrder, 17381 selectionStart = _this$props.selectionStart; 17382 17383 if (blockOrder !== prevProps.blockOrder && selectionStart) { 17384 return this.getOffset(selectionStart); 17385 } 17386 17387 return null; 17388 } 17389 }, { 17390 key: "componentDidUpdate", 17391 value: function componentDidUpdate(prevProps, prevState, snapshot) { 17392 if (snapshot) { 17393 this.restorePreviousOffset(snapshot); 17394 } 17395 } 17396 /** 17397 * Given the block client ID of the start of the selection, saves the 17398 * block's top offset as an instance property before a reorder is to occur. 17399 * 17400 * @param {string} selectionStart Client ID of selected block. 17401 * 17402 * @return {number?} The scroll offset. 17403 */ 17404 17405 }, { 17406 key: "getOffset", 17407 value: function getOffset(selectionStart) { 17408 var blockNode = Object(_utils_dom__WEBPACK_IMPORTED_MODULE_8__["getBlockDOMNode"])(selectionStart); 17409 17410 if (!blockNode) { 17411 return null; 17412 } 17413 17414 return blockNode.getBoundingClientRect().top; 17415 } 17416 /** 17417 * After a block reordering, restores the previous viewport top offset. 17418 * 17419 * @param {number} offset The scroll offset. 17420 */ 17421 17422 }, { 17423 key: "restorePreviousOffset", 17424 value: function restorePreviousOffset(offset) { 17425 var selectionStart = this.props.selectionStart; 17426 var blockNode = Object(_utils_dom__WEBPACK_IMPORTED_MODULE_8__["getBlockDOMNode"])(selectionStart); 17427 17428 if (blockNode) { 17429 var scrollContainer = Object(_wordpress_dom__WEBPACK_IMPORTED_MODULE_7__["getScrollContainer"])(blockNode); 17430 17431 if (scrollContainer) { 17432 scrollContainer.scrollTop = scrollContainer.scrollTop + blockNode.getBoundingClientRect().top - offset; 17433 } 17434 } 17435 } 17436 }, { 17437 key: "render", 17438 value: function render() { 17439 return null; 17440 } 17441 }]); 17442 17443 return PreserveScrollInReorder; 17444 }(_wordpress_element__WEBPACK_IMPORTED_MODULE_5__["Component"]); 17445 17446 /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_6__["withSelect"])(function (select) { 17447 return { 17448 blockOrder: select('core/editor').getBlockOrder(), 17449 selectionStart: select('core/editor').getBlockSelectionStart() 17450 }; 17451 })(PreserveScrollInReorder)); 17452 17453 17454 /***/ }), 17455 17456 /***/ "./node_modules/@wordpress/editor/build-module/components/provider/index.js": 17457 /*!**********************************************************************************!*\ 17458 !*** ./node_modules/@wordpress/editor/build-module/components/provider/index.js ***! 17459 \**********************************************************************************/ 17460 /*! exports provided: default */ 17461 /***/ (function(module, __webpack_exports__, __webpack_require__) { 17462 17463 "use strict"; 17464 __webpack_require__.r(__webpack_exports__); 17465 /* harmony import */ var _babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/slicedToArray */ "./node_modules/@babel/runtime/helpers/esm/slicedToArray.js"); 17466 /* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/classCallCheck */ "./node_modules/@babel/runtime/helpers/esm/classCallCheck.js"); 17467 /* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/createClass */ "./node_modules/@babel/runtime/helpers/esm/createClass.js"); 17468 /* harmony import */ var _babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/esm/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js"); 17469 /* harmony import */ var _babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/esm/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js"); 17470 /* harmony import */ var _babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inherits */ "./node_modules/@babel/runtime/helpers/esm/inherits.js"); 17471 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! lodash */ "lodash"); 17472 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_6__); 17473 /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose"); 17474 /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_7__); 17475 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); 17476 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__); 17477 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); 17478 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_9__); 17479 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); 17480 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_10__); 17481 /* harmony import */ var _editor_styles__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../editor-styles */ "./node_modules/@wordpress/editor/build-module/editor-styles/index.js"); 17482 17483 17484 17485 17486 17487 17488 17489 /** 17490 * External dependencies 17491 */ 17492 17493 /** 17494 * WordPress Dependencies 17495 */ 17496 17497 17498 17499 17500 17501 /** 17502 * Internal dependencies 17503 */ 17504 17505 17506 17507 var EditorProvider = 17508 /*#__PURE__*/ 17509 function (_Component) { 17510 Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_5__["default"])(EditorProvider, _Component); 17511 17512 function EditorProvider(props) { 17513 var _this; 17514 17515 Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_1__["default"])(this, EditorProvider); 17516 17517 _this = Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__["default"])(this, Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__["default"])(EditorProvider).apply(this, arguments)); // Assume that we don't need to initialize in the case of an error recovery. 17518 17519 if (!props.recovery) { 17520 _this.props.updateEditorSettings(props.settings); 17521 17522 _this.props.updatePostLock(props.settings.postLock); 17523 17524 _this.props.setupEditor(props.post, props.settings.autosave); 17525 } 17526 17527 return _this; 17528 } 17529 17530 Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_2__["default"])(EditorProvider, [{ 17531 key: "componentDidMount", 17532 value: function componentDidMount() { 17533 if (!this.props.settings.styles) { 17534 return; 17535 } 17536 17537 Object(lodash__WEBPACK_IMPORTED_MODULE_6__["map"])(this.props.settings.styles, function (_ref) { 17538 var css = _ref.css, 17539 baseURL = _ref.baseURL; 17540 var transforms = [_editor_styles__WEBPACK_IMPORTED_MODULE_11__["editorWidth"], Object(_editor_styles__WEBPACK_IMPORTED_MODULE_11__["wrap"])('.editor-block-list__block', ['.wp-block'])]; 17541 17542 if (baseURL) { 17543 transforms.push(Object(_editor_styles__WEBPACK_IMPORTED_MODULE_11__["urlRewrite"])(baseURL)); 17544 } 17545 17546 var updatedCSS = Object(_editor_styles__WEBPACK_IMPORTED_MODULE_11__["traverse"])(css, Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_7__["compose"])(transforms)); 17547 17548 if (updatedCSS) { 17549 var node = document.createElement('style'); 17550 node.innerHTML = updatedCSS; 17551 document.body.appendChild(node); 17552 } 17553 }); 17554 } 17555 }, { 17556 key: "componentDidUpdate", 17557 value: function componentDidUpdate(prevProps) { 17558 if (this.props.settings !== prevProps.settings) { 17559 this.props.updateEditorSettings(this.props.settings); 17560 } 17561 } 17562 }, { 17563 key: "render", 17564 value: function render() { 17565 var children = this.props.children; 17566 var providers = [// Slot / Fill provider: 17567 // 17568 // - context.getSlot 17569 // - context.registerSlot 17570 // - context.unregisterSlot 17571 [_wordpress_components__WEBPACK_IMPORTED_MODULE_9__["SlotFillProvider"]], // DropZone provider: 17572 [_wordpress_components__WEBPACK_IMPORTED_MODULE_9__["DropZoneProvider"]]]; 17573 var createEditorElement = Object(lodash__WEBPACK_IMPORTED_MODULE_6__["flow"])(providers.map(function (_ref2) { 17574 var _ref3 = Object(_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_0__["default"])(_ref2, 2), 17575 Provider = _ref3[0], 17576 props = _ref3[1]; 17577 17578 return function (arg) { 17579 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["createElement"])(Provider, props, arg); 17580 }; 17581 })); 17582 return createEditorElement(children); 17583 } 17584 }]); 17585 17586 return EditorProvider; 17587 }(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["Component"]); 17588 17589 /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_10__["withDispatch"])(function (dispatch) { 17590 var _dispatch = dispatch('core/editor'), 17591 setupEditor = _dispatch.setupEditor, 17592 updateEditorSettings = _dispatch.updateEditorSettings, 17593 updatePostLock = _dispatch.updatePostLock; 17594 17595 return { 17596 setupEditor: setupEditor, 17597 updateEditorSettings: updateEditorSettings, 17598 updatePostLock: updatePostLock 17599 }; 17600 })(EditorProvider)); 17601 17602 17603 /***/ }), 17604 17605 /***/ "./node_modules/@wordpress/editor/build-module/components/rich-text/aria.js": 17606 /*!**********************************************************************************!*\ 17607 !*** ./node_modules/@wordpress/editor/build-module/components/rich-text/aria.js ***! 17608 \**********************************************************************************/ 17609 /*! exports provided: pickAriaProps, diffAriaProps */ 17610 /***/ (function(module, __webpack_exports__, __webpack_require__) { 17611 17612 "use strict"; 17613 __webpack_require__.r(__webpack_exports__); 17614 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "pickAriaProps", function() { return pickAriaProps; }); 17615 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "diffAriaProps", function() { return diffAriaProps; }); 17616 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash */ "lodash"); 17617 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_0__); 17618 /** 17619 * External dependencies 17620 */ 17621 17622 17623 var isAriaPropName = function isAriaPropName(name) { 17624 return Object(lodash__WEBPACK_IMPORTED_MODULE_0__["startsWith"])(name, 'aria-'); 17625 }; 17626 17627 var pickAriaProps = function pickAriaProps(props) { 17628 return Object(lodash__WEBPACK_IMPORTED_MODULE_0__["pickBy"])(props, function (value, key) { 17629 return isAriaPropName(key) && !Object(lodash__WEBPACK_IMPORTED_MODULE_0__["isNil"])(value); 17630 }); 17631 }; 17632 var diffAriaProps = function diffAriaProps(props, nextProps) { 17633 var prevAriaKeys = Object(lodash__WEBPACK_IMPORTED_MODULE_0__["keys"])(pickAriaProps(props)); 17634 var nextAriaKeys = Object(lodash__WEBPACK_IMPORTED_MODULE_0__["keys"])(pickAriaProps(nextProps)); 17635 var removedKeys = Object(lodash__WEBPACK_IMPORTED_MODULE_0__["difference"])(prevAriaKeys, nextAriaKeys); 17636 var updatedKeys = nextAriaKeys.filter(function (key) { 17637 return !Object(lodash__WEBPACK_IMPORTED_MODULE_0__["isEqual"])(props[key], nextProps[key]); 17638 }); 17639 return { 17640 removedKeys: removedKeys, 17641 updatedKeys: updatedKeys 17642 }; 17643 }; 17644 17645 17646 /***/ }), 17647 17648 /***/ "./node_modules/@wordpress/editor/build-module/components/rich-text/core-tokens/image/index.js": 17649 /*!*****************************************************************************************************!*\ 17650 !*** ./node_modules/@wordpress/editor/build-module/components/rich-text/core-tokens/image/index.js ***! 17651 \*****************************************************************************************************/ 17652 /*! exports provided: name, settings */ 17653 /***/ (function(module, __webpack_exports__, __webpack_require__) { 17654 17655 "use strict"; 17656 __webpack_require__.r(__webpack_exports__); 17657 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "name", function() { return name; }); 17658 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "settings", function() { return settings; }); 17659 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); 17660 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); 17661 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); 17662 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__); 17663 /* harmony import */ var _media_upload__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../media-upload */ "./node_modules/@wordpress/editor/build-module/components/media-upload/index.js"); 17664 17665 17666 /** 17667 * WordPress dependencies 17668 */ 17669 17670 /** 17671 * Internal dependencies 17672 */ 17673 17674 17675 var name = 'core/image'; 17676 var ALLOWED_MEDIA_TYPES = ['image']; 17677 var settings = { 17678 id: 'image', 17679 title: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__["__"])('Inline Image'), 17680 type: 'image', 17681 icon: Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("svg", { 17682 xmlns: "http://www.w3.org/2000/svg", 17683 viewBox: "0 0 24 24" 17684 }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("path", { 17685 d: "M4 16h10c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2H4c-1.1 0-2 .9-2 2v9c0 1.1.9 2 2 2zM4 5h10v9H4V5zm14 9v2h4v-2h-4zM2 20h20v-2H2v2zm6.4-8.8L7 9.4 5 12h8l-2.6-3.4-2 2.6z" 17686 })), 17687 edit: function edit(_ref) { 17688 var onSave = _ref.onSave; 17689 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_media_upload__WEBPACK_IMPORTED_MODULE_2__["default"], { 17690 allowedTypes: ALLOWED_MEDIA_TYPES, 17691 onSelect: function onSelect(media) { 17692 return onSave(media); 17693 }, 17694 onClose: function onClose() { 17695 return onSave(null); 17696 }, 17697 render: function render(_ref2) { 17698 var open = _ref2.open; 17699 open(); 17700 return null; 17701 } 17702 }); 17703 }, 17704 save: function save(_ref3) { 17705 var id = _ref3.id, 17706 url = _ref3.url, 17707 alt = _ref3.alt, 17708 width = _ref3.width; 17709 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("img", { 17710 className: "wp-image-".concat(id) // set width in style attribute to prevent Block CSS from overriding it 17711 , 17712 style: { 17713 width: "".concat(Math.min(width, 150), "px") 17714 }, 17715 src: url, 17716 alt: alt 17717 }); 17718 } 17719 }; 17720 17721 17722 /***/ }), 17723 17724 /***/ "./node_modules/@wordpress/editor/build-module/components/rich-text/core-tokens/index.js": 17725 /*!***********************************************************************************************!*\ 17726 !*** ./node_modules/@wordpress/editor/build-module/components/rich-text/core-tokens/index.js ***! 17727 \***********************************************************************************************/ 17728 /*! exports provided: image */ 17729 /***/ (function(module, __webpack_exports__, __webpack_require__) { 17730 17731 "use strict"; 17732 __webpack_require__.r(__webpack_exports__); 17733 /* harmony import */ var _image__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./image */ "./node_modules/@wordpress/editor/build-module/components/rich-text/core-tokens/image/index.js"); 17734 /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "image", function() { return _image__WEBPACK_IMPORTED_MODULE_0__; }); 17735 /** 17736 * Internal dependencies 17737 */ 17738 17739 17740 17741 17742 /***/ }), 17743 17744 /***/ "./node_modules/@wordpress/editor/build-module/components/rich-text/format-toolbar/index.js": 17745 /*!**************************************************************************************************!*\ 17746 !*** ./node_modules/@wordpress/editor/build-module/components/rich-text/format-toolbar/index.js ***! 17747 \**************************************************************************************************/ 17748 /*! exports provided: default */ 17749 /***/ (function(module, __webpack_exports__, __webpack_require__) { 17750 17751 "use strict"; 17752 __webpack_require__.r(__webpack_exports__); 17753 /* harmony import */ var _babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectSpread */ "./node_modules/@babel/runtime/helpers/esm/objectSpread.js"); 17754 /* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/classCallCheck */ "./node_modules/@babel/runtime/helpers/esm/classCallCheck.js"); 17755 /* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/createClass */ "./node_modules/@babel/runtime/helpers/esm/createClass.js"); 17756 /* harmony import */ var _babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/esm/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js"); 17757 /* harmony import */ var _babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/esm/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js"); 17758 /* harmony import */ var _babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inherits */ "./node_modules/@babel/runtime/helpers/esm/inherits.js"); 17759 /* harmony import */ var _babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @babel/runtime/helpers/esm/assertThisInitialized */ "./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js"); 17760 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); 17761 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__); 17762 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); 17763 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_8__); 17764 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); 17765 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_9__); 17766 /* harmony import */ var _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @wordpress/keycodes */ "@wordpress/keycodes"); 17767 /* harmony import */ var _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_wordpress_keycodes__WEBPACK_IMPORTED_MODULE_10__); 17768 /* harmony import */ var _wordpress_rich_text__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @wordpress/rich-text */ "@wordpress/rich-text"); 17769 /* harmony import */ var _wordpress_rich_text__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(_wordpress_rich_text__WEBPACK_IMPORTED_MODULE_11__); 17770 /* harmony import */ var _wordpress_url__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @wordpress/url */ "@wordpress/url"); 17771 /* harmony import */ var _wordpress_url__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(_wordpress_url__WEBPACK_IMPORTED_MODULE_12__); 17772 /* harmony import */ var _formatting_controls__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../formatting-controls */ "./node_modules/@wordpress/editor/build-module/components/rich-text/formatting-controls.js"); 17773 /* harmony import */ var _link_container__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./link-container */ "./node_modules/@wordpress/editor/build-module/components/rich-text/format-toolbar/link-container.js"); 17774 /* harmony import */ var _toolbar_container__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./toolbar-container */ "./node_modules/@wordpress/editor/build-module/components/rich-text/format-toolbar/toolbar-container.js"); 17775 17776 17777 17778 17779 17780 17781 17782 17783 17784 /** 17785 * WordPress dependencies 17786 */ 17787 17788 17789 17790 17791 17792 17793 /** 17794 * Internal dependencies 17795 */ 17796 17797 17798 17799 17800 17801 var FormatToolbar = 17802 /*#__PURE__*/ 17803 function (_Component) { 17804 Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_5__["default"])(FormatToolbar, _Component); 17805 17806 function FormatToolbar(_ref) { 17807 var _this; 17808 17809 var toggleFormat = _ref.toggleFormat, 17810 editor = _ref.editor; 17811 17812 Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_1__["default"])(this, FormatToolbar); 17813 17814 _this = Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__["default"])(this, Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__["default"])(FormatToolbar).apply(this, arguments)); 17815 _this.removeLink = _this.removeLink.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["default"])(_this))); 17816 _this.addLink = _this.addLink.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["default"])(_this))); 17817 _this.stopAddingLink = _this.stopAddingLink.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["default"])(_this))); 17818 _this.applyFormat = _this.applyFormat.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["default"])(_this))); 17819 _this.removeFormat = _this.removeFormat.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["default"])(_this))); 17820 _this.getActiveFormat = _this.getActiveFormat.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["default"])(_this))); 17821 _this.toggleFormat = _this.toggleFormat.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["default"])(_this))); 17822 _this.state = { 17823 addingLink: false 17824 }; 17825 17826 if (editor) { 17827 editor.shortcuts.add(_wordpress_keycodes__WEBPACK_IMPORTED_MODULE_10__["rawShortcut"].primary('k'), '', _this.addLink); 17828 editor.shortcuts.add(_wordpress_keycodes__WEBPACK_IMPORTED_MODULE_10__["rawShortcut"].access('a'), '', _this.addLink); 17829 editor.shortcuts.add(_wordpress_keycodes__WEBPACK_IMPORTED_MODULE_10__["rawShortcut"].access('s'), '', _this.removeLink); 17830 editor.shortcuts.add(_wordpress_keycodes__WEBPACK_IMPORTED_MODULE_10__["rawShortcut"].access('d'), '', function () { 17831 return toggleFormat({ 17832 type: 'del' 17833 }); 17834 }); 17835 editor.shortcuts.add(_wordpress_keycodes__WEBPACK_IMPORTED_MODULE_10__["rawShortcut"].access('x'), '', function () { 17836 return toggleFormat({ 17837 type: 'code' 17838 }); 17839 }); 17840 } 17841 17842 return _this; 17843 } 17844 17845 Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_2__["default"])(FormatToolbar, [{ 17846 key: "removeLink", 17847 value: function removeLink() { 17848 this.removeFormat('a'); 17849 } 17850 }, { 17851 key: "addLink", 17852 value: function addLink() { 17853 var text = Object(_wordpress_rich_text__WEBPACK_IMPORTED_MODULE_11__["getTextContent"])(Object(_wordpress_rich_text__WEBPACK_IMPORTED_MODULE_11__["slice"])(this.props.record)); 17854 17855 if (text && Object(_wordpress_url__WEBPACK_IMPORTED_MODULE_12__["isURL"])(text)) { 17856 this.applyFormat({ 17857 type: 'a', 17858 attributes: { 17859 href: text 17860 } 17861 }); 17862 } else { 17863 this.setState({ 17864 addingLink: true 17865 }); 17866 } 17867 } 17868 }, { 17869 key: "stopAddingLink", 17870 value: function stopAddingLink() { 17871 this.setState({ 17872 addingLink: false 17873 }); 17874 } 17875 /** 17876 * Apply a format with the current value and selection. 17877 * 17878 * @param {Object} format The format to apply. 17879 */ 17880 17881 }, { 17882 key: "applyFormat", 17883 value: function applyFormat(format) { 17884 this.props.onChange(Object(_wordpress_rich_text__WEBPACK_IMPORTED_MODULE_11__["applyFormat"])(this.props.record, format)); 17885 } 17886 /** 17887 * Remove a format from the current value with the current selection. 17888 * 17889 * @param {string} formatType The type of format to remove. 17890 */ 17891 17892 }, { 17893 key: "removeFormat", 17894 value: function removeFormat(formatType) { 17895 this.props.onChange(Object(_wordpress_rich_text__WEBPACK_IMPORTED_MODULE_11__["removeFormat"])(this.props.record, formatType)); 17896 } 17897 /** 17898 * Get the current format based on the selection 17899 * 17900 * @param {string} formatType The type of format to check. 17901 * 17902 * @return {boolean} Whether the format is active or not. 17903 */ 17904 17905 }, { 17906 key: "getActiveFormat", 17907 value: function getActiveFormat(formatType) { 17908 return Object(_wordpress_rich_text__WEBPACK_IMPORTED_MODULE_11__["getActiveFormat"])(this.props.record, formatType); 17909 } 17910 /** 17911 * Toggle a format based on the selection. 17912 * 17913 * @param {Object} format The format to toggle. 17914 */ 17915 17916 }, { 17917 key: "toggleFormat", 17918 value: function toggleFormat(format) { 17919 if (this.getActiveFormat(format.type)) { 17920 this.removeFormat(format.type); 17921 } else { 17922 this.applyFormat(format); 17923 } 17924 } 17925 }, { 17926 key: "render", 17927 value: function render() { 17928 var _this2 = this; 17929 17930 var link = this.getActiveFormat('a'); 17931 var toolbarControls = _formatting_controls__WEBPACK_IMPORTED_MODULE_13__["FORMATTING_CONTROLS"].filter(function (control) { 17932 return _this2.props.enabledControls.indexOf(control.format) !== -1; 17933 }).map(function (control) { 17934 if (control.format === 'link') { 17935 var linkIsActive = link !== undefined; 17936 return Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_0__["default"])({}, control, { 17937 shortcut: linkIsActive ? control.activeShortcut : control.shortcut, 17938 icon: linkIsActive ? 'editor-unlink' : 'admin-links', 17939 // TODO: Need proper unlink icon 17940 title: linkIsActive ? Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_8__["__"])('Unlink') : Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_8__["__"])('Link'), 17941 onClick: linkIsActive ? _this2.removeLink : _this2.addLink, 17942 isActive: !!linkIsActive 17943 }); 17944 } 17945 17946 return Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_0__["default"])({}, control, { 17947 onClick: function onClick() { 17948 return _this2.toggleFormat({ 17949 type: control.selector 17950 }); 17951 }, 17952 isActive: _this2.getActiveFormat(control.selector) !== undefined 17953 }); 17954 }); 17955 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["createElement"])(_toolbar_container__WEBPACK_IMPORTED_MODULE_15__["default"], null, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_9__["Toolbar"], { 17956 controls: toolbarControls 17957 }), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["createElement"])(_link_container__WEBPACK_IMPORTED_MODULE_14__["default"], { 17958 link: link, 17959 record: this.props.record, 17960 onChange: this.props.onChange, 17961 applyFormat: this.applyFormat, 17962 removeFormat: this.removeFormat, 17963 getActiveFormat: this.getActiveFormat, 17964 toggleFormat: this.toggleFormat, 17965 addingLink: this.state.addingLink, 17966 stopAddingLink: this.stopAddingLink 17967 })); 17968 } 17969 }]); 17970 17971 return FormatToolbar; 17972 }(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["Component"]); 17973 17974 /* harmony default export */ __webpack_exports__["default"] = (FormatToolbar); 17975 17976 17977 /***/ }), 17978 17979 /***/ "./node_modules/@wordpress/editor/build-module/components/rich-text/format-toolbar/link-container.js": 17980 /*!***********************************************************************************************************!*\ 17981 !*** ./node_modules/@wordpress/editor/build-module/components/rich-text/format-toolbar/link-container.js ***! 17982 \***********************************************************************************************************/ 17983 /*! exports provided: default */ 17984 /***/ (function(module, __webpack_exports__, __webpack_require__) { 17985 17986 "use strict"; 17987 __webpack_require__.r(__webpack_exports__); 17988 /* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/classCallCheck */ "./node_modules/@babel/runtime/helpers/esm/classCallCheck.js"); 17989 /* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/createClass */ "./node_modules/@babel/runtime/helpers/esm/createClass.js"); 17990 /* harmony import */ var _babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js"); 17991 /* harmony import */ var _babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/esm/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js"); 17992 /* harmony import */ var _babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inherits */ "./node_modules/@babel/runtime/helpers/esm/inherits.js"); 17993 /* harmony import */ var _babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/helpers/esm/assertThisInitialized */ "./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js"); 17994 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); 17995 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__); 17996 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); 17997 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_7__); 17998 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); 17999 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_8__); 18000 /* harmony import */ var _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @wordpress/keycodes */ "@wordpress/keycodes"); 18001 /* harmony import */ var _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_wordpress_keycodes__WEBPACK_IMPORTED_MODULE_9__); 18002 /* harmony import */ var _wordpress_url__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @wordpress/url */ "@wordpress/url"); 18003 /* harmony import */ var _wordpress_url__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_wordpress_url__WEBPACK_IMPORTED_MODULE_10__); 18004 /* harmony import */ var _wordpress_rich_text__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @wordpress/rich-text */ "@wordpress/rich-text"); 18005 /* harmony import */ var _wordpress_rich_text__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(_wordpress_rich_text__WEBPACK_IMPORTED_MODULE_11__); 18006 /* harmony import */ var _positioned_at_selection__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./positioned-at-selection */ "./node_modules/@wordpress/editor/build-module/components/rich-text/format-toolbar/positioned-at-selection.js"); 18007 /* harmony import */ var _url_input__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../../url-input */ "./node_modules/@wordpress/editor/build-module/components/url-input/index.js"); 18008 /* harmony import */ var _utils_url__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../../../utils/url */ "./node_modules/@wordpress/editor/build-module/utils/url.js"); 18009 18010 18011 18012 18013 18014 18015 18016 18017 /** 18018 * WordPress dependencies 18019 */ 18020 18021 18022 18023 18024 18025 18026 /** 18027 * Internal dependencies 18028 */ 18029 18030 18031 18032 18033 18034 var stopKeyPropagation = function stopKeyPropagation(event) { 18035 return event.stopPropagation(); 18036 }; 18037 18038 function getLinkAttributesFromFormat() { 18039 var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}, 18040 _ref$attributes = _ref.attributes; 18041 18042 _ref$attributes = _ref$attributes === void 0 ? {} : _ref$attributes; 18043 var _ref$attributes$href = _ref$attributes.href, 18044 href = _ref$attributes$href === void 0 ? '' : _ref$attributes$href, 18045 target = _ref$attributes.target; 18046 return { 18047 href: href, 18048 target: target 18049 }; 18050 } 18051 18052 function createLinkFormat(_ref2) { 18053 var href = _ref2.href, 18054 opensInNewWindow = _ref2.opensInNewWindow; 18055 var format = { 18056 type: 'a', 18057 attributes: { 18058 href: href 18059 } 18060 }; 18061 18062 if (opensInNewWindow) { 18063 format.attributes.target = '_blank'; 18064 format.attributes.rel = 'noreferrer noopener'; 18065 } 18066 18067 return format; 18068 } 18069 18070 function isShowingInput(props, state) { 18071 return props.addingLink || state.editLink; 18072 } 18073 18074 var LinkContainer = 18075 /*#__PURE__*/ 18076 function (_Component) { 18077 Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__["default"])(LinkContainer, _Component); 18078 18079 function LinkContainer() { 18080 var _this; 18081 18082 Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__["default"])(this, LinkContainer); 18083 18084 _this = Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__["default"])(this, Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__["default"])(LinkContainer).apply(this, arguments)); 18085 _this.editLink = _this.editLink.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(_this))); 18086 _this.submitLink = _this.submitLink.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(_this))); 18087 _this.onKeyDown = _this.onKeyDown.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(_this))); 18088 _this.onChangeInputValue = _this.onChangeInputValue.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(_this))); 18089 _this.toggleLinkSettingsVisibility = _this.toggleLinkSettingsVisibility.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(_this))); 18090 _this.setLinkTarget = _this.setLinkTarget.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(_this))); 18091 _this.resetState = _this.resetState.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(_this))); 18092 _this.state = {}; 18093 return _this; 18094 } 18095 18096 Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__["default"])(LinkContainer, [{ 18097 key: "onKeyDown", 18098 value: function onKeyDown(event) { 18099 if (event.keyCode === _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_9__["ESCAPE"]) { 18100 event.stopPropagation(); 18101 this.resetState(); 18102 } 18103 18104 if ([_wordpress_keycodes__WEBPACK_IMPORTED_MODULE_9__["LEFT"], _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_9__["DOWN"], _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_9__["RIGHT"], _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_9__["UP"], _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_9__["BACKSPACE"], _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_9__["ENTER"]].indexOf(event.keyCode) > -1) { 18105 // Stop the key event from propagating up to maybeStartTyping in BlockListBlock. 18106 event.stopPropagation(); 18107 } 18108 } 18109 }, { 18110 key: "onChangeInputValue", 18111 value: function onChangeInputValue(inputValue) { 18112 this.setState({ 18113 inputValue: inputValue 18114 }); 18115 } 18116 }, { 18117 key: "toggleLinkSettingsVisibility", 18118 value: function toggleLinkSettingsVisibility() { 18119 this.setState(function (state) { 18120 return { 18121 settingsVisible: !state.settingsVisible 18122 }; 18123 }); 18124 } 18125 }, { 18126 key: "setLinkTarget", 18127 value: function setLinkTarget(opensInNewWindow) { 18128 this.setState({ 18129 opensInNewWindow: opensInNewWindow 18130 }); // Apply now if URL is not being edited. 18131 18132 if (!isShowingInput(this.props, this.state)) { 18133 var _getLinkAttributesFro = getLinkAttributesFromFormat(this.props.link), 18134 href = _getLinkAttributesFro.href; 18135 18136 this.props.applyFormat(createLinkFormat({ 18137 href: href, 18138 opensInNewWindow: opensInNewWindow 18139 })); 18140 } 18141 } 18142 }, { 18143 key: "editLink", 18144 value: function editLink(event) { 18145 this.setState({ 18146 editLink: true 18147 }); 18148 event.preventDefault(); 18149 } 18150 }, { 18151 key: "submitLink", 18152 value: function submitLink(event) { 18153 var _this$props = this.props, 18154 link = _this$props.link, 18155 record = _this$props.record; 18156 var _this$state = this.state, 18157 inputValue = _this$state.inputValue, 18158 opensInNewWindow = _this$state.opensInNewWindow; 18159 var href = Object(_wordpress_url__WEBPACK_IMPORTED_MODULE_10__["prependHTTP"])(inputValue); 18160 var format = createLinkFormat({ 18161 href: href, 18162 opensInNewWindow: opensInNewWindow 18163 }); 18164 18165 if (Object(_wordpress_rich_text__WEBPACK_IMPORTED_MODULE_11__["isCollapsed"])(record) && link === undefined) { 18166 var toInsert = Object(_wordpress_rich_text__WEBPACK_IMPORTED_MODULE_11__["applyFormat"])(Object(_wordpress_rich_text__WEBPACK_IMPORTED_MODULE_11__["create"])({ 18167 text: href 18168 }), format, 0, href.length); 18169 this.props.onChange(Object(_wordpress_rich_text__WEBPACK_IMPORTED_MODULE_11__["insert"])(record, toInsert)); 18170 } else { 18171 this.props.applyFormat(format); 18172 } 18173 18174 this.resetState(); 18175 18176 if (!link) { 18177 this.props.speak(Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_7__["__"])('Link added.'), 'assertive'); 18178 } 18179 18180 event.preventDefault(); 18181 } 18182 }, { 18183 key: "resetState", 18184 value: function resetState() { 18185 this.props.stopAddingLink(); 18186 this.setState({ 18187 editLink: false 18188 }); 18189 } 18190 }, { 18191 key: "render", 18192 value: function render() { 18193 var _this$props2 = this.props, 18194 link = _this$props2.link, 18195 addingLink = _this$props2.addingLink, 18196 record = _this$props2.record; 18197 18198 if (!link && !addingLink) { 18199 return null; 18200 } 18201 18202 var _this$state2 = this.state, 18203 inputValue = _this$state2.inputValue, 18204 settingsVisible = _this$state2.settingsVisible, 18205 opensInNewWindow = _this$state2.opensInNewWindow; 18206 18207 var _getLinkAttributesFro2 = getLinkAttributesFromFormat(link), 18208 href = _getLinkAttributesFro2.href; 18209 18210 var showInput = isShowingInput(this.props, this.state); 18211 var linkSettings = settingsVisible && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("div", { 18212 className: "editor-format-toolbar__link-modal-line editor-format-toolbar__link-settings" 18213 }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_8__["ToggleControl"], { 18214 label: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_7__["__"])('Open in New Window'), 18215 checked: opensInNewWindow, 18216 onChange: this.setLinkTarget 18217 })); 18218 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_8__["Fill"], { 18219 name: "RichText.Siblings" 18220 }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(_positioned_at_selection__WEBPACK_IMPORTED_MODULE_12__["default"], { 18221 className: "editor-format-toolbar__link-container", 18222 key: "".concat(record.start).concat(record.end) 18223 /* Used to force rerender on selection change */ 18224 18225 }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_8__["Popover"], { 18226 position: "bottom center", 18227 focusOnMount: showInput ? 'firstElement' : false, 18228 onClickOutside: this.resetState 18229 }, showInput && // Disable reason: KeyPress must be suppressed so the block doesn't hide the toolbar 18230 18231 /* eslint-disable jsx-a11y/no-noninteractive-element-interactions */ 18232 Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("form", { 18233 className: "editor-format-toolbar__link-modal", 18234 onKeyPress: stopKeyPropagation, 18235 onKeyDown: this.onKeyDown, 18236 onSubmit: this.submitLink 18237 }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("div", { 18238 className: "editor-format-toolbar__link-modal-line" 18239 }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(_url_input__WEBPACK_IMPORTED_MODULE_13__["default"], { 18240 value: inputValue, 18241 onChange: this.onChangeInputValue 18242 }), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_8__["IconButton"], { 18243 icon: "editor-break", 18244 label: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_7__["__"])('Apply'), 18245 type: "submit" 18246 }), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_8__["IconButton"], { 18247 className: "editor-format-toolbar__link-settings-toggle", 18248 icon: "ellipsis", 18249 label: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_7__["__"])('Link Settings'), 18250 onClick: this.toggleLinkSettingsVisibility, 18251 "aria-expanded": settingsVisible 18252 })), linkSettings) 18253 /* eslint-enable jsx-a11y/no-noninteractive-element-interactions */ 18254 , !showInput && // Disable reason: KeyPress must be suppressed so the block doesn't hide the toolbar 18255 18256 /* eslint-disable jsx-a11y/no-static-element-interactions */ 18257 Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("div", { 18258 className: "editor-format-toolbar__link-modal", 18259 onKeyPress: stopKeyPropagation 18260 }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("div", { 18261 className: "editor-format-toolbar__link-modal-line" 18262 }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_8__["ExternalLink"], { 18263 className: "editor-format-toolbar__link-value", 18264 href: href 18265 }, Object(_utils_url__WEBPACK_IMPORTED_MODULE_14__["filterURLForDisplay"])(decodeURI(href))), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_8__["IconButton"], { 18266 icon: "edit", 18267 label: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_7__["__"])('Edit'), 18268 onClick: this.editLink 18269 }), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_8__["IconButton"], { 18270 className: "editor-format-toolbar__link-settings-toggle", 18271 icon: "ellipsis", 18272 label: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_7__["__"])('Link Settings'), 18273 onClick: this.toggleLinkSettingsVisibility, 18274 "aria-expanded": settingsVisible 18275 })), linkSettings) 18276 /* eslint-enable jsx-a11y/no-static-element-interactions */ 18277 ))); 18278 } 18279 }], [{ 18280 key: "getDerivedStateFromProps", 18281 value: function getDerivedStateFromProps(props, state) { 18282 var _getLinkAttributesFro3 = getLinkAttributesFromFormat(props.link), 18283 href = _getLinkAttributesFro3.href, 18284 target = _getLinkAttributesFro3.target; 18285 18286 var opensInNewWindow = target === '_blank'; 18287 18288 if (!isShowingInput(props, state)) { 18289 if (href !== state.inputValue) { 18290 return { 18291 inputValue: href 18292 }; 18293 } 18294 18295 if (opensInNewWindow !== state.opensInNewWindow) { 18296 return { 18297 opensInNewWindow: opensInNewWindow 18298 }; 18299 } 18300 } 18301 18302 return null; 18303 } 18304 }]); 18305 18306 return LinkContainer; 18307 }(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["Component"]); 18308 18309 /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_components__WEBPACK_IMPORTED_MODULE_8__["withSpokenMessages"])(LinkContainer)); 18310 18311 18312 /***/ }), 18313 18314 /***/ "./node_modules/@wordpress/editor/build-module/components/rich-text/format-toolbar/positioned-at-selection.js": 18315 /*!********************************************************************************************************************!*\ 18316 !*** ./node_modules/@wordpress/editor/build-module/components/rich-text/format-toolbar/positioned-at-selection.js ***! 18317 \********************************************************************************************************************/ 18318 /*! exports provided: default */ 18319 /***/ (function(module, __webpack_exports__, __webpack_require__) { 18320 18321 "use strict"; 18322 __webpack_require__.r(__webpack_exports__); 18323 /* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/classCallCheck */ "./node_modules/@babel/runtime/helpers/esm/classCallCheck.js"); 18324 /* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/createClass */ "./node_modules/@babel/runtime/helpers/esm/createClass.js"); 18325 /* harmony import */ var _babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js"); 18326 /* harmony import */ var _babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/esm/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js"); 18327 /* harmony import */ var _babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inherits */ "./node_modules/@babel/runtime/helpers/esm/inherits.js"); 18328 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); 18329 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_5__); 18330 /* harmony import */ var _wordpress_dom__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @wordpress/dom */ "@wordpress/dom"); 18331 /* harmony import */ var _wordpress_dom__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_wordpress_dom__WEBPACK_IMPORTED_MODULE_6__); 18332 18333 18334 18335 18336 18337 18338 18339 /** 18340 * WordPress dependencies 18341 */ 18342 18343 18344 /** 18345 * Returns a style object for applying as `position: absolute` for an element 18346 * relative to the bottom-center of the current selection. Includes `top` and 18347 * `left` style properties. 18348 * 18349 * @return {Object} Style object. 18350 */ 18351 18352 function getCurrentCaretPositionStyle() { 18353 var selection = window.getSelection(); // Unlikely, but in the case there is no selection, return empty styles so 18354 // as to avoid a thrown error by `Selection#getRangeAt` on invalid index. 18355 18356 if (selection.rangeCount === 0) { 18357 return {}; 18358 } // Get position relative viewport. 18359 18360 18361 var rect = Object(_wordpress_dom__WEBPACK_IMPORTED_MODULE_6__["getRectangleFromRange"])(selection.getRangeAt(0)); 18362 var top = rect.top + rect.height; 18363 var left = rect.left + rect.width / 2; // Offset by positioned parent, if one exists. 18364 18365 var offsetParent = Object(_wordpress_dom__WEBPACK_IMPORTED_MODULE_6__["getOffsetParent"])(selection.anchorNode); 18366 18367 if (offsetParent) { 18368 var parentRect = offsetParent.getBoundingClientRect(); 18369 top -= parentRect.top; 18370 left -= parentRect.left; 18371 } 18372 18373 return { 18374 top: top, 18375 left: left 18376 }; 18377 } 18378 /** 18379 * Component which renders itself positioned under the current caret selection. 18380 * The position is calculated at the time of the component being mounted, so it 18381 * should only be mounted after the desired selection has been made. 18382 * 18383 * @type {WPComponent} 18384 */ 18385 18386 18387 var PositionedAtSelection = 18388 /*#__PURE__*/ 18389 function (_Component) { 18390 Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__["default"])(PositionedAtSelection, _Component); 18391 18392 function PositionedAtSelection() { 18393 var _this; 18394 18395 Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__["default"])(this, PositionedAtSelection); 18396 18397 _this = Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__["default"])(this, Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__["default"])(PositionedAtSelection).apply(this, arguments)); 18398 _this.state = { 18399 style: getCurrentCaretPositionStyle() 18400 }; 18401 return _this; 18402 } 18403 18404 Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__["default"])(PositionedAtSelection, [{ 18405 key: "render", 18406 value: function render() { 18407 var _this$props = this.props, 18408 className = _this$props.className, 18409 children = _this$props.children; 18410 var style = this.state.style; 18411 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_5__["createElement"])("div", { 18412 className: className, 18413 style: style 18414 }, children); 18415 } 18416 }]); 18417 18418 return PositionedAtSelection; 18419 }(_wordpress_element__WEBPACK_IMPORTED_MODULE_5__["Component"]); 18420 18421 /* harmony default export */ __webpack_exports__["default"] = (PositionedAtSelection); 18422 18423 18424 /***/ }), 18425 18426 /***/ "./node_modules/@wordpress/editor/build-module/components/rich-text/format-toolbar/toolbar-container.js": 18427 /*!**************************************************************************************************************!*\ 18428 !*** ./node_modules/@wordpress/editor/build-module/components/rich-text/format-toolbar/toolbar-container.js ***! 18429 \**************************************************************************************************************/ 18430 /*! exports provided: default */ 18431 /***/ (function(module, __webpack_exports__, __webpack_require__) { 18432 18433 "use strict"; 18434 __webpack_require__.r(__webpack_exports__); 18435 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); 18436 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); 18437 18438 18439 var ToolbarContainer = function ToolbarContainer(props) { 18440 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("div", { 18441 className: "editor-format-toolbar" 18442 }, props.children); 18443 }; 18444 18445 /* harmony default export */ __webpack_exports__["default"] = (ToolbarContainer); 18446 18447 18448 /***/ }), 18449 18450 /***/ "./node_modules/@wordpress/editor/build-module/components/rich-text/formatting-controls.js": 18451 /*!*************************************************************************************************!*\ 18452 !*** ./node_modules/@wordpress/editor/build-module/components/rich-text/formatting-controls.js ***! 18453 \*************************************************************************************************/ 18454 /*! exports provided: FORMATTING_CONTROLS */ 18455 /***/ (function(module, __webpack_exports__, __webpack_require__) { 18456 18457 "use strict"; 18458 __webpack_require__.r(__webpack_exports__); 18459 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FORMATTING_CONTROLS", function() { return FORMATTING_CONTROLS; }); 18460 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); 18461 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__); 18462 /* harmony import */ var _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/keycodes */ "@wordpress/keycodes"); 18463 /* harmony import */ var _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_keycodes__WEBPACK_IMPORTED_MODULE_1__); 18464 /** 18465 * WordPress dependencies 18466 */ 18467 18468 18469 var FORMATTING_CONTROLS = [{ 18470 icon: 'editor-bold', 18471 title: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__["__"])('Bold'), 18472 shortcut: _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_1__["displayShortcut"].primary('b'), 18473 format: 'bold', 18474 selector: 'strong' 18475 }, { 18476 icon: 'editor-italic', 18477 title: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__["__"])('Italic'), 18478 shortcut: _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_1__["displayShortcut"].primary('i'), 18479 format: 'italic', 18480 selector: 'em' 18481 }, { 18482 icon: 'admin-links', 18483 title: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__["__"])('Link'), 18484 shortcut: _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_1__["displayShortcut"].primary('k'), 18485 activeShortcut: _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_1__["displayShortcut"].access('s'), 18486 format: 'link', 18487 selector: 'a' 18488 }, { 18489 icon: 'editor-strikethrough', 18490 title: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__["__"])('Strikethrough'), 18491 shortcut: _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_1__["displayShortcut"].access('d'), 18492 format: 'strikethrough', 18493 selector: 'del' 18494 }]; 18495 18496 18497 /***/ }), 18498 18499 /***/ "./node_modules/@wordpress/editor/build-module/components/rich-text/index.js": 18500 /*!***********************************************************************************!*\ 18501 !*** ./node_modules/@wordpress/editor/build-module/components/rich-text/index.js ***! 18502 \***********************************************************************************/ 18503 /*! exports provided: RichText, default */ 18504 /***/ (function(module, __webpack_exports__, __webpack_require__) { 18505 18506 "use strict"; 18507 __webpack_require__.r(__webpack_exports__); 18508 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RichText", function() { return RichText; }); 18509 /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutProperties */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js"); 18510 /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js"); 18511 /* harmony import */ var _babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/slicedToArray */ "./node_modules/@babel/runtime/helpers/esm/slicedToArray.js"); 18512 /* harmony import */ var _babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/esm/toConsumableArray */ "./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js"); 18513 /* harmony import */ var _babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectSpread */ "./node_modules/@babel/runtime/helpers/esm/objectSpread.js"); 18514 /* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/helpers/esm/classCallCheck */ "./node_modules/@babel/runtime/helpers/esm/classCallCheck.js"); 18515 /* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @babel/runtime/helpers/esm/createClass */ "./node_modules/@babel/runtime/helpers/esm/createClass.js"); 18516 /* harmony import */ var _babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @babel/runtime/helpers/esm/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js"); 18517 /* harmony import */ var _babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @babel/runtime/helpers/esm/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js"); 18518 /* harmony import */ var _babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inherits */ "./node_modules/@babel/runtime/helpers/esm/inherits.js"); 18519 /* harmony import */ var _babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @babel/runtime/helpers/esm/assertThisInitialized */ "./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js"); 18520 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); 18521 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_11__); 18522 /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); 18523 /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_12__); 18524 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! lodash */ "lodash"); 18525 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_13__); 18526 /* harmony import */ var memize__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! memize */ "./node_modules/memize/index.js"); 18527 /* harmony import */ var memize__WEBPACK_IMPORTED_MODULE_14___default = /*#__PURE__*/__webpack_require__.n(memize__WEBPACK_IMPORTED_MODULE_14__); 18528 /* harmony import */ var _wordpress_dom__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! @wordpress/dom */ "@wordpress/dom"); 18529 /* harmony import */ var _wordpress_dom__WEBPACK_IMPORTED_MODULE_15___default = /*#__PURE__*/__webpack_require__.n(_wordpress_dom__WEBPACK_IMPORTED_MODULE_15__); 18530 /* harmony import */ var _wordpress_blob__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! @wordpress/blob */ "@wordpress/blob"); 18531 /* harmony import */ var _wordpress_blob__WEBPACK_IMPORTED_MODULE_16___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blob__WEBPACK_IMPORTED_MODULE_16__); 18532 /* harmony import */ var _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! @wordpress/keycodes */ "@wordpress/keycodes"); 18533 /* harmony import */ var _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_17___default = /*#__PURE__*/__webpack_require__.n(_wordpress_keycodes__WEBPACK_IMPORTED_MODULE_17__); 18534 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); 18535 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_18___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_18__); 18536 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); 18537 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_19___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_19__); 18538 /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks"); 18539 /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_20___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_20__); 18540 /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose"); 18541 /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_21___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_21__); 18542 /* harmony import */ var _wordpress_url__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! @wordpress/url */ "@wordpress/url"); 18543 /* harmony import */ var _wordpress_url__WEBPACK_IMPORTED_MODULE_22___default = /*#__PURE__*/__webpack_require__.n(_wordpress_url__WEBPACK_IMPORTED_MODULE_22__); 18544 /* harmony import */ var _wordpress_rich_text__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! @wordpress/rich-text */ "@wordpress/rich-text"); 18545 /* harmony import */ var _wordpress_rich_text__WEBPACK_IMPORTED_MODULE_23___default = /*#__PURE__*/__webpack_require__.n(_wordpress_rich_text__WEBPACK_IMPORTED_MODULE_23__); 18546 /* harmony import */ var _wordpress_html_entities__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! @wordpress/html-entities */ "@wordpress/html-entities"); 18547 /* harmony import */ var _wordpress_html_entities__WEBPACK_IMPORTED_MODULE_24___default = /*#__PURE__*/__webpack_require__.n(_wordpress_html_entities__WEBPACK_IMPORTED_MODULE_24__); 18548 /* harmony import */ var _autocomplete__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ../autocomplete */ "./node_modules/@wordpress/editor/build-module/components/autocomplete/index.js"); 18549 /* harmony import */ var _block_format_controls__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ../block-format-controls */ "./node_modules/@wordpress/editor/build-module/components/block-format-controls/index.js"); 18550 /* harmony import */ var _formatting_controls__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ./formatting-controls */ "./node_modules/@wordpress/editor/build-module/components/rich-text/formatting-controls.js"); 18551 /* harmony import */ var _format_toolbar__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ./format-toolbar */ "./node_modules/@wordpress/editor/build-module/components/rich-text/format-toolbar/index.js"); 18552 /* harmony import */ var _tinymce__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ./tinymce */ "./node_modules/@wordpress/editor/build-module/components/rich-text/tinymce.js"); 18553 /* harmony import */ var _aria__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ./aria */ "./node_modules/@wordpress/editor/build-module/components/rich-text/aria.js"); 18554 /* harmony import */ var _patterns__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ./patterns */ "./node_modules/@wordpress/editor/build-module/components/rich-text/patterns.js"); 18555 /* harmony import */ var _block_edit_context__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! ../block-edit/context */ "./node_modules/@wordpress/editor/build-module/components/block-edit/context.js"); 18556 /* harmony import */ var _tokens_ui__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! ./tokens/ui */ "./node_modules/@wordpress/editor/build-module/components/rich-text/tokens/ui/index.js"); 18557 18558 18559 18560 18561 18562 18563 18564 18565 18566 18567 18568 18569 18570 /** 18571 * External dependencies 18572 */ 18573 18574 18575 18576 /** 18577 * WordPress dependencies 18578 */ 18579 18580 18581 18582 18583 18584 18585 18586 18587 18588 18589 18590 18591 /** 18592 * Internal dependencies 18593 */ 18594 18595 18596 18597 18598 18599 18600 18601 18602 18603 18604 /** 18605 * Browser dependencies 18606 */ 18607 18608 var _window = window, 18609 Node = _window.Node, 18610 getSelection = _window.getSelection; 18611 /** 18612 * Zero-width space character used by TinyMCE as a caret landing point for 18613 * inline boundary nodes. 18614 * 18615 * @see tinymce/src/core/main/ts/text/Zwsp.ts 18616 * 18617 * @type {string} 18618 */ 18619 18620 var TINYMCE_ZWSP = "\uFEFF"; 18621 var RichText = 18622 /*#__PURE__*/ 18623 function (_Component) { 18624 Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_9__["default"])(RichText, _Component); 18625 18626 function RichText(_ref) { 18627 var _this; 18628 18629 var value = _ref.value, 18630 onReplace = _ref.onReplace, 18631 multiline = _ref.multiline; 18632 18633 Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_5__["default"])(this, RichText); 18634 18635 _this = Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_7__["default"])(this, Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_8__["default"])(RichText).apply(this, arguments)); 18636 _this.onInit = _this.onInit.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_10__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_10__["default"])(_this))); 18637 _this.getSettings = _this.getSettings.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_10__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_10__["default"])(_this))); 18638 _this.onSetup = _this.onSetup.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_10__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_10__["default"])(_this))); 18639 _this.onFocus = _this.onFocus.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_10__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_10__["default"])(_this))); 18640 _this.onChange = _this.onChange.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_10__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_10__["default"])(_this))); 18641 _this.onNodeChange = _this.onNodeChange.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_10__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_10__["default"])(_this))); 18642 _this.onDeleteKeyDown = _this.onDeleteKeyDown.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_10__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_10__["default"])(_this))); 18643 _this.onHorizontalNavigationKeyDown = _this.onHorizontalNavigationKeyDown.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_10__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_10__["default"])(_this))); 18644 _this.onKeyDown = _this.onKeyDown.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_10__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_10__["default"])(_this))); 18645 _this.onKeyUp = _this.onKeyUp.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_10__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_10__["default"])(_this))); 18646 _this.onPropagateUndo = _this.onPropagateUndo.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_10__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_10__["default"])(_this))); 18647 _this.onPaste = _this.onPaste.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_10__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_10__["default"])(_this))); 18648 _this.onCreateUndoLevel = _this.onCreateUndoLevel.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_10__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_10__["default"])(_this))); 18649 _this.setFocusedElement = _this.setFocusedElement.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_10__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_10__["default"])(_this))); 18650 _this.onInput = _this.onInput.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_10__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_10__["default"])(_this))); 18651 _this.onSelectionChange = _this.onSelectionChange.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_10__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_10__["default"])(_this))); 18652 _this.getRecord = _this.getRecord.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_10__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_10__["default"])(_this))); 18653 _this.createRecord = _this.createRecord.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_10__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_10__["default"])(_this))); 18654 _this.applyRecord = _this.applyRecord.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_10__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_10__["default"])(_this))); 18655 _this.isEmpty = _this.isEmpty.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_10__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_10__["default"])(_this))); 18656 _this.valueToFormat = _this.valueToFormat.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_10__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_10__["default"])(_this))); 18657 _this.setRef = _this.setRef.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_10__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_10__["default"])(_this))); 18658 _this.isActive = _this.isActive.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_10__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_10__["default"])(_this))); 18659 _this.formatToValue = memize__WEBPACK_IMPORTED_MODULE_14___default()(_this.formatToValue.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_10__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_10__["default"])(_this))), { 18660 size: 1 18661 }); 18662 _this.savedContent = value; 18663 _this.containerRef = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_11__["createRef"])(); 18664 _this.patterns = Object(_patterns__WEBPACK_IMPORTED_MODULE_31__["getPatterns"])({ 18665 onReplace: onReplace, 18666 multiline: multiline 18667 }); 18668 _this.enterPatterns = Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_20__["getBlockTransforms"])('from').filter(function (_ref2) { 18669 var type = _ref2.type, 18670 trigger = _ref2.trigger; 18671 return type === 'pattern' && trigger === 'enter'; 18672 }); 18673 _this.state = {}; 18674 _this.usedDeprecatedChildrenSource = Array.isArray(value); 18675 return _this; 18676 } 18677 18678 Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_6__["default"])(RichText, [{ 18679 key: "componentDidMount", 18680 value: function componentDidMount() { 18681 document.addEventListener('selectionchange', this.onSelectionChange); 18682 } 18683 }, { 18684 key: "componentWillUnmount", 18685 value: function componentWillUnmount() { 18686 document.removeEventListener('selectionchange', this.onSelectionChange); 18687 } 18688 }, { 18689 key: "setRef", 18690 value: function setRef(node) { 18691 this.editableRef = node; 18692 } 18693 }, { 18694 key: "isActive", 18695 value: function isActive() { 18696 return this.editableRef === document.activeElement; 18697 } 18698 /** 18699 * Retrieves the settings for this block. 18700 * 18701 * Allows passing in settings which will be overwritten. 18702 * 18703 * @param {Object} settings The settings to overwrite. 18704 * @return {Object} The settings for this block. 18705 */ 18706 18707 }, { 18708 key: "getSettings", 18709 value: function getSettings(settings) { 18710 settings = Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_4__["default"])({}, settings, { 18711 forced_root_block: this.props.multiline || false, 18712 // Allow TinyMCE to keep one undo level for comparing changes. 18713 // Prevent it otherwise from accumulating any history. 18714 custom_undo_redo_levels: 1 18715 }); 18716 var unstableGetSettings = this.props.unstableGetSettings; 18717 18718 if (unstableGetSettings) { 18719 settings = unstableGetSettings(settings); 18720 } 18721 18722 return settings; 18723 } 18724 /** 18725 * Handles the onSetup event for the TinyMCE component. 18726 * 18727 * Will setup event handlers for the TinyMCE instance. 18728 * An `onSetup` function in the props will be called if it is present. 18729 * 18730 * @param {tinymce} editor The editor instance as passed by TinyMCE. 18731 */ 18732 18733 }, { 18734 key: "onSetup", 18735 value: function onSetup(editor) { 18736 this.editor = editor; 18737 editor.on('init', this.onInit); 18738 editor.on('nodechange', this.onNodeChange); 18739 editor.on('keydown', this.onKeyDown); 18740 editor.on('keyup', this.onKeyUp); 18741 editor.on('BeforeExecCommand', this.onPropagateUndo); 18742 editor.on('focus', this.onFocus); // The change event in TinyMCE fires every time an undo level is added. 18743 18744 editor.on('change', this.onCreateUndoLevel); 18745 var unstableOnSetup = this.props.unstableOnSetup; 18746 18747 if (unstableOnSetup) { 18748 unstableOnSetup(editor); 18749 } 18750 } 18751 }, { 18752 key: "setFocusedElement", 18753 value: function setFocusedElement() { 18754 if (this.props.setFocusedElement) { 18755 this.props.setFocusedElement(this.props.instanceId); 18756 } 18757 } 18758 }, { 18759 key: "onInit", 18760 value: function onInit() { 18761 this.editor.shortcuts.add(_wordpress_keycodes__WEBPACK_IMPORTED_MODULE_17__["rawShortcut"].primary('z'), '', 'Undo'); 18762 this.editor.shortcuts.add(_wordpress_keycodes__WEBPACK_IMPORTED_MODULE_17__["rawShortcut"].primaryShift('z'), '', 'Redo'); // Remove TinyMCE Core shortcut for consistency with global editor 18763 // shortcuts. Also clashes with Mac browsers. 18764 18765 this.editor.shortcuts.remove('meta+y', '', 'Redo'); 18766 } 18767 /** 18768 * Handles an undo event from TinyMCE. 18769 * 18770 * @param {UndoEvent} event The undo event as triggered by TinyMCE. 18771 */ 18772 18773 }, { 18774 key: "onPropagateUndo", 18775 value: function onPropagateUndo(event) { 18776 var _this$props = this.props, 18777 onUndo = _this$props.onUndo, 18778 onRedo = _this$props.onRedo; 18779 var command = event.command; 18780 18781 if (command === 'Undo' && onUndo) { 18782 Object(lodash__WEBPACK_IMPORTED_MODULE_13__["defer"])(onUndo); 18783 event.preventDefault(); 18784 } 18785 18786 if (command === 'Redo' && onRedo) { 18787 Object(lodash__WEBPACK_IMPORTED_MODULE_13__["defer"])(onRedo); 18788 event.preventDefault(); 18789 } 18790 } 18791 /** 18792 * Get the current record (value and selection) from props and state. 18793 * 18794 * @return {Object} The current record (value and selection). 18795 */ 18796 18797 }, { 18798 key: "getRecord", 18799 value: function getRecord() { 18800 var _this$formatToValue = this.formatToValue(this.props.value), 18801 formats = _this$formatToValue.formats, 18802 text = _this$formatToValue.text; 18803 18804 var _this$state = this.state, 18805 start = _this$state.start, 18806 end = _this$state.end; 18807 return { 18808 formats: formats, 18809 text: text, 18810 start: start, 18811 end: end 18812 }; 18813 } 18814 }, { 18815 key: "createRecord", 18816 value: function createRecord() { 18817 var multiline = this.props.multiline; 18818 var range = window.getSelection().getRangeAt(0); 18819 return Object(_wordpress_rich_text__WEBPACK_IMPORTED_MODULE_23__["create"])({ 18820 element: this.editableRef, 18821 range: range, 18822 multilineTag: multiline, 18823 removeNode: function removeNode(node) { 18824 return node.getAttribute('data-mce-bogus') === 'all'; 18825 }, 18826 unwrapNode: function unwrapNode(node) { 18827 return !!node.getAttribute('data-mce-bogus'); 18828 }, 18829 removeAttribute: function removeAttribute(attribute) { 18830 return attribute.indexOf('data-mce-') === 0; 18831 }, 18832 filterString: function filterString(string) { 18833 return string.replace(TINYMCE_ZWSP, ''); 18834 } 18835 }); 18836 } 18837 }, { 18838 key: "applyRecord", 18839 value: function applyRecord(record) { 18840 var multiline = this.props.multiline; 18841 Object(_wordpress_rich_text__WEBPACK_IMPORTED_MODULE_23__["apply"])(record, this.editableRef, multiline); 18842 } 18843 }, { 18844 key: "isEmpty", 18845 value: function isEmpty() { 18846 return Object(_wordpress_rich_text__WEBPACK_IMPORTED_MODULE_23__["isEmpty"])(this.formatToValue(this.props.value)); 18847 } 18848 /** 18849 * Handles a paste event from TinyMCE. 18850 * 18851 * Saves the pasted data as plain text in `pastedPlainText`. 18852 * 18853 * @param {PasteEvent} event The paste event as triggered by TinyMCE. 18854 */ 18855 18856 }, { 18857 key: "onPaste", 18858 value: function onPaste(event) { 18859 var _this2 = this; 18860 18861 var clipboardData = event.clipboardData; 18862 var items = clipboardData.items, 18863 files = clipboardData.files; // In Edge these properties can be null instead of undefined, so a more 18864 // rigorous test is required over using default values. 18865 18866 items = Object(lodash__WEBPACK_IMPORTED_MODULE_13__["isNil"])(items) ? [] : items; 18867 files = Object(lodash__WEBPACK_IMPORTED_MODULE_13__["isNil"])(files) ? [] : files; 18868 var item = Object(lodash__WEBPACK_IMPORTED_MODULE_13__["find"])(Object(_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_3__["default"])(items).concat(Object(_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_3__["default"])(files)), function (_ref3) { 18869 var type = _ref3.type; 18870 return /^image\/(?:jpe?g|png|gif)$/.test(type); 18871 }); 18872 var plainText = ''; 18873 var html = ''; // IE11 only supports `Text` as an argument for `getData` and will 18874 // otherwise throw an invalid argument error, so we try the standard 18875 // arguments first, then fallback to `Text` if they fail. 18876 18877 try { 18878 plainText = clipboardData.getData('text/plain'); 18879 html = clipboardData.getData('text/html'); 18880 } catch (error1) { 18881 try { 18882 html = clipboardData.getData('Text'); 18883 } catch (error2) { 18884 // Some browsers like UC Browser paste plain text by default and 18885 // don't support clipboardData at all, so allow default 18886 // behaviour. 18887 return; 18888 } 18889 } 18890 18891 event.preventDefault(); // Allows us to ask for this information when we get a report. 18892 18893 window.console.log('Received HTML:\n\n', html); 18894 window.console.log('Received plain text:\n\n', plainText); // Only process file if no HTML is present. 18895 // Note: a pasted file may have the URL as plain text. 18896 18897 if (item && !html) { 18898 var file = item.getAsFile ? item.getAsFile() : item; 18899 18900 var _content = Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_20__["rawHandler"])({ 18901 HTML: "<img src=\"".concat(Object(_wordpress_blob__WEBPACK_IMPORTED_MODULE_16__["createBlobURL"])(file), "\">"), 18902 mode: 'BLOCKS', 18903 tagName: this.props.tagName 18904 }); 18905 18906 var _shouldReplace = this.props.onReplace && this.isEmpty(); // Allows us to ask for this information when we get a report. 18907 18908 18909 window.console.log('Received item:\n\n', file); 18910 18911 if (_shouldReplace) { 18912 // Necessary to allow the paste bin to be removed without errors. 18913 this.props.setTimeout(function () { 18914 return _this2.props.onReplace(_content); 18915 }); 18916 } else if (this.props.onSplit) { 18917 // Necessary to get the right range. 18918 // Also done in the TinyMCE paste plugin. 18919 this.props.setTimeout(function () { 18920 return _this2.splitContent(_content); 18921 }); 18922 } 18923 18924 return; 18925 } // There is a selection, check if a URL is pasted. 18926 18927 18928 if (!this.editor.selection.isCollapsed()) { 18929 var pastedText = (html || plainText).replace(/<[^>]+>/g, '').trim(); // A URL was pasted, turn the selection into a link 18930 18931 if (Object(_wordpress_url__WEBPACK_IMPORTED_MODULE_22__["isURL"])(pastedText)) { 18932 this.onChange(Object(_wordpress_rich_text__WEBPACK_IMPORTED_MODULE_23__["applyFormat"])(this.getRecord(), { 18933 type: 'a', 18934 attributes: { 18935 href: Object(_wordpress_html_entities__WEBPACK_IMPORTED_MODULE_24__["decodeEntities"])(pastedText) 18936 } 18937 })); // Allows us to ask for this information when we get a report. 18938 18939 window.console.log('Created link:\n\n', pastedText); 18940 return; 18941 } 18942 } 18943 18944 var shouldReplace = this.props.onReplace && this.isEmpty(); 18945 var mode = 'INLINE'; 18946 18947 if (shouldReplace) { 18948 mode = 'BLOCKS'; 18949 } else if (this.props.onSplit) { 18950 mode = 'AUTO'; 18951 } 18952 18953 var content = Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_20__["rawHandler"])({ 18954 HTML: html, 18955 plainText: plainText, 18956 mode: mode, 18957 tagName: this.props.tagName, 18958 canUserUseUnfilteredHTML: this.props.canUserUseUnfilteredHTML 18959 }); 18960 18961 if (typeof content === 'string') { 18962 var recordToInsert = Object(_wordpress_rich_text__WEBPACK_IMPORTED_MODULE_23__["create"])({ 18963 html: content 18964 }); 18965 this.onChange(Object(_wordpress_rich_text__WEBPACK_IMPORTED_MODULE_23__["insert"])(this.getRecord(), recordToInsert)); 18966 } else if (this.props.onSplit) { 18967 if (!content.length) { 18968 return; 18969 } 18970 18971 if (shouldReplace) { 18972 this.props.onReplace(content); 18973 } else { 18974 this.splitContent(content, { 18975 paste: true 18976 }); 18977 } 18978 } 18979 } 18980 /** 18981 * Handles a focus event on the contenteditable field, calling the 18982 * `unstableOnFocus` prop callback if one is defined. The callback does not 18983 * receive any arguments. 18984 * 18985 * This is marked as a private API and the `unstableOnFocus` prop is not 18986 * documented, as the current requirements where it is used are subject to 18987 * future refactoring following `isSelected` handling. 18988 * 18989 * In contrast with `setFocusedElement`, this is only triggered in response 18990 * to focus within the contenteditable field, whereas `setFocusedElement` 18991 * is triggered on focus within any `RichText` descendent element. 18992 * 18993 * @see setFocusedElement 18994 * 18995 * @private 18996 */ 18997 18998 }, { 18999 key: "onFocus", 19000 value: function onFocus() { 19001 var unstableOnFocus = this.props.unstableOnFocus; 19002 19003 if (unstableOnFocus) { 19004 unstableOnFocus(); 19005 } 19006 } 19007 /** 19008 * Handle input on the next selection change event. 19009 */ 19010 19011 }, { 19012 key: "onInput", 19013 value: function onInput() { 19014 var record = this.createRecord(); 19015 var transformed = this.patterns.reduce(function (accumlator, transform) { 19016 return transform(accumlator); 19017 }, record); // Don't apply changes if there's no transform. Content will be up to 19018 // date. In the future we could always let it flow back in the live DOM 19019 // if there are no performance issues. 19020 19021 this.onChange(transformed, record === transformed); 19022 } 19023 /** 19024 * Handles the `selectionchange` event: sync the selection to local state. 19025 */ 19026 19027 }, { 19028 key: "onSelectionChange", 19029 value: function onSelectionChange() { 19030 // Ensure it's the active element. This is a global event. 19031 if (!this.isActive()) { 19032 return; 19033 } 19034 19035 var _this$createRecord = this.createRecord(), 19036 start = _this$createRecord.start, 19037 end = _this$createRecord.end; 19038 19039 if (start !== this.state.start || end !== this.state.end) { 19040 this.setState({ 19041 start: start, 19042 end: end 19043 }); 19044 } 19045 } 19046 /** 19047 * Sync the value to global state. The node tree and selection will also be 19048 * updated if differences are found. 19049 * 19050 * @param {Object} record The record to sync and apply. 19051 * @param {boolean} _withoutApply If true, the record won't be applied to 19052 * the live DOM. 19053 */ 19054 19055 }, { 19056 key: "onChange", 19057 value: function onChange(record, _withoutApply) { 19058 if (!_withoutApply) { 19059 this.applyRecord(record); 19060 } 19061 19062 var start = record.start, 19063 end = record.end; 19064 this.savedContent = this.valueToFormat(record); 19065 this.props.onChange(this.savedContent); 19066 this.setState({ 19067 start: start, 19068 end: end 19069 }); 19070 } 19071 }, { 19072 key: "onCreateUndoLevel", 19073 value: function onCreateUndoLevel(event) { 19074 // TinyMCE fires a `change` event when the first letter in an instance 19075 // is typed. This should not create a history record in Gutenberg. 19076 // https://github.com/tinymce/tinymce/blob/4.7.11/src/core/main/ts/api/UndoManager.ts#L116-L125 19077 // In other cases TinyMCE won't fire a `change` with at least a previous 19078 // record present, so this is a reliable check. 19079 // https://github.com/tinymce/tinymce/blob/4.7.11/src/core/main/ts/api/UndoManager.ts#L272-L275 19080 if (event && event.lastLevel === null) { 19081 return; 19082 } // Always ensure the content is up-to-date. This is needed because e.g. 19083 // making something bold will trigger a TinyMCE change event but no 19084 // input event. Avoid dispatching an action if the original event is 19085 // blur because the content will already be up-to-date. 19086 19087 19088 if (!event || !event.originalEvent || event.originalEvent.type !== 'blur') { 19089 this.onChange(this.createRecord(), true); 19090 } 19091 19092 this.props.onCreateUndoLevel(); 19093 } 19094 /** 19095 * Handles a delete keyDown event to handle merge or removal for collapsed 19096 * selection where caret is at directional edge: forward for a delete key, 19097 * reverse for a backspace key. 19098 * 19099 * @link https://en.wikipedia.org/wiki/Caret_navigation 19100 * 19101 * @param {tinymce.EditorEvent<KeyboardEvent>} event Keydown event. 19102 */ 19103 19104 }, { 19105 key: "onDeleteKeyDown", 19106 value: function onDeleteKeyDown(event) { 19107 var _this$props2 = this.props, 19108 onMerge = _this$props2.onMerge, 19109 onRemove = _this$props2.onRemove; 19110 19111 if (!onMerge && !onRemove) { 19112 return; 19113 } 19114 19115 var keyCode = event.keyCode; 19116 var isReverse = keyCode === _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_17__["BACKSPACE"]; 19117 19118 var _getSelection = getSelection(), 19119 isCollapsed = _getSelection.isCollapsed; // Only process delete if the key press occurs at uncollapsed edge. 19120 19121 19122 if (!isCollapsed) { 19123 return; 19124 } 19125 19126 var empty = this.isEmpty(); // It is important to consider emptiness because an empty container 19127 // will include a bogus TinyMCE BR node _after_ the caret, so in a 19128 // forward deletion the isHorizontalEdge function will incorrectly 19129 // interpret the presence of the bogus node as not being at the edge. 19130 19131 var isEdge = empty || Object(_wordpress_dom__WEBPACK_IMPORTED_MODULE_15__["isHorizontalEdge"])(this.editableRef, isReverse); 19132 19133 if (!isEdge) { 19134 return; 19135 } 19136 19137 if (onMerge) { 19138 onMerge(!isReverse); 19139 } // Only handle remove on Backspace. This serves dual-purpose of being 19140 // an intentional user interaction distinguishing between Backspace and 19141 // Delete to remove the empty field, but also to avoid merge & remove 19142 // causing destruction of two fields (merge, then removed merged). 19143 19144 19145 if (onRemove && empty && isReverse) { 19146 onRemove(!isReverse); 19147 } 19148 19149 event.preventDefault(); // Calling onMerge() or onRemove() will destroy the editor, so it's 19150 // important that we stop other handlers (e.g. ones registered by 19151 // TinyMCE) from also handling this event. 19152 19153 event.stopImmediatePropagation(); 19154 } 19155 /** 19156 * Handles a horizontal navigation key down event to handle the case where 19157 * TinyMCE attempts to preventDefault when on the outside edge of an inline 19158 * boundary when arrowing _away_ from the boundary, not within it. Replaces 19159 * the TinyMCE event `preventDefault` behavior with a noop, such that those 19160 * relying on `defaultPrevented` are not misinformed about the arrow event. 19161 * 19162 * If TinyMCE#4476 is resolved, this handling may be removed. 19163 * 19164 * @see https://github.com/tinymce/tinymce/issues/4476 19165 * 19166 * @param {tinymce.EditorEvent<KeyboardEvent>} event Keydown event. 19167 */ 19168 19169 }, { 19170 key: "onHorizontalNavigationKeyDown", 19171 value: function onHorizontalNavigationKeyDown(event) { 19172 var _getSelection2 = getSelection(), 19173 focusNode = _getSelection2.focusNode; 19174 19175 var nodeType = focusNode.nodeType, 19176 nodeValue = focusNode.nodeValue; 19177 19178 if (nodeType !== Node.TEXT_NODE) { 19179 return; 19180 } 19181 19182 if (nodeValue.length !== 1 || nodeValue[0] !== TINYMCE_ZWSP) { 19183 return; 19184 } 19185 19186 var keyCode = event.keyCode; // Consider to be moving away from inline boundary based on: 19187 // 19188 // 1. Within a text fragment consisting only of ZWSP. 19189 // 2. If in reverse, there is no previous sibling. If forward, there is 19190 // no next sibling (i.e. end of node). 19191 19192 var isReverse = keyCode === _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_17__["LEFT"]; 19193 var edgeSibling = isReverse ? 'previousSibling' : 'nextSibling'; 19194 19195 if (!focusNode[edgeSibling]) { 19196 // Note: This is not reassigning on the native event, rather the 19197 // "fixed" TinyMCE copy, which proxies its preventDefault to the 19198 // native event. By reassigning here, we're effectively preventing 19199 // the proxied call on the native event, but not otherwise mutating 19200 // the original event object. 19201 event.preventDefault = lodash__WEBPACK_IMPORTED_MODULE_13__["noop"]; 19202 } 19203 } 19204 /** 19205 * Handles a keydown event from TinyMCE. 19206 * 19207 * @param {KeydownEvent} event The keydown event as triggered by TinyMCE. 19208 */ 19209 19210 }, { 19211 key: "onKeyDown", 19212 value: function onKeyDown(event) { 19213 var keyCode = event.keyCode; 19214 var isDelete = keyCode === _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_17__["DELETE"] || keyCode === _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_17__["BACKSPACE"]; 19215 19216 if (isDelete) { 19217 this.onDeleteKeyDown(event); 19218 } 19219 19220 var isHorizontalNavigation = keyCode === _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_17__["LEFT"] || keyCode === _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_17__["RIGHT"]; 19221 19222 if (isHorizontalNavigation) { 19223 this.onHorizontalNavigationKeyDown(event); 19224 } // If we click shift+Enter on inline RichTexts, we avoid creating two contenteditables 19225 // We also split the content and call the onSplit prop if provided. 19226 19227 19228 if (keyCode === _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_17__["ENTER"]) { 19229 event.preventDefault(); 19230 19231 if (this.props.onReplace) { 19232 var text = Object(_wordpress_rich_text__WEBPACK_IMPORTED_MODULE_23__["getTextContent"])(this.getRecord()); 19233 var transformation = Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_20__["findTransform"])(this.enterPatterns, function (item) { 19234 return item.regExp.test(text); 19235 }); 19236 19237 if (transformation) { 19238 // Calling onReplace() will destroy the editor, so it's 19239 // important that we stop other handlers (e.g. ones 19240 // registered by TinyMCE) from also handling this event. 19241 event.stopImmediatePropagation(); 19242 this.props.onReplace([transformation.transform({ 19243 content: text 19244 })]); 19245 return; 19246 } 19247 } 19248 19249 if (this.props.multiline) { 19250 var record = this.getRecord(); 19251 19252 if (this.props.onSplit && Object(_wordpress_rich_text__WEBPACK_IMPORTED_MODULE_23__["isEmptyLine"])(record)) { 19253 var _this$props3; 19254 19255 (_this$props3 = this.props).onSplit.apply(_this$props3, Object(_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_3__["default"])(Object(_wordpress_rich_text__WEBPACK_IMPORTED_MODULE_23__["split"])(record).map(this.valueToFormat))); 19256 } else { 19257 // Character is used to separate lines in multiline values. 19258 this.onChange(Object(_wordpress_rich_text__WEBPACK_IMPORTED_MODULE_23__["insert"])(record, "\u2028")); 19259 } 19260 } else if (event.shiftKey || !this.props.onSplit) { 19261 var _record = this.getRecord(); 19262 19263 var _text = Object(_wordpress_rich_text__WEBPACK_IMPORTED_MODULE_23__["getTextContent"])(_record); 19264 19265 var length = _text.length; 19266 var toInsert = '\n'; // If the caret is at the end of the text, and there is no 19267 // trailing line break or no text at all, we have to insert two 19268 // line breaks in order to create a new line visually and place 19269 // the caret there. 19270 19271 if (_record.end === length && (_text.charAt(length - 1) !== '\n' || length === 0)) { 19272 toInsert = '\n\n'; 19273 } 19274 19275 this.onChange(Object(_wordpress_rich_text__WEBPACK_IMPORTED_MODULE_23__["insert"])(this.getRecord(), toInsert)); 19276 } else { 19277 this.splitContent(); 19278 } 19279 } 19280 } 19281 /** 19282 * Handles TinyMCE key up event. 19283 * 19284 * @param {number} keyCode The key code that has been pressed on the keyboard. 19285 */ 19286 19287 }, { 19288 key: "onKeyUp", 19289 value: function onKeyUp(_ref4) { 19290 var keyCode = _ref4.keyCode; 19291 19292 // The input event does not fire when the whole field is selected and 19293 // BACKSPACE is pressed. 19294 if (keyCode === _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_17__["BACKSPACE"]) { 19295 this.onChange(this.createRecord(), true); 19296 } // `scrollToRect` is called on `nodechange`, whereas calling it on 19297 // `keyup` *when* moving to a new RichText element results in incorrect 19298 // scrolling. Though the following allows false positives, it results 19299 // in much smoother scrolling. 19300 19301 19302 if (this.props.isViewportSmall && keyCode !== _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_17__["BACKSPACE"] && keyCode !== _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_17__["ENTER"]) { 19303 this.scrollToRect(Object(_wordpress_dom__WEBPACK_IMPORTED_MODULE_15__["getRectangleFromRange"])(this.editor.selection.getRng())); 19304 } 19305 } 19306 }, { 19307 key: "scrollToRect", 19308 value: function scrollToRect(rect) { 19309 var caretTop = rect.top; 19310 var container = Object(_wordpress_dom__WEBPACK_IMPORTED_MODULE_15__["getScrollContainer"])(this.editableRef); 19311 19312 if (!container) { 19313 return; 19314 } // When scrolling, avoid positioning the caret at the very top of 19315 // the viewport, providing some "air" and some textual context for 19316 // the user, and avoiding toolbars. 19317 19318 19319 var graceOffset = 100; // Avoid pointless scrolling by establishing a threshold under 19320 // which scrolling should be skipped; 19321 19322 var epsilon = 10; 19323 var delta = caretTop - graceOffset; 19324 19325 if (Math.abs(delta) > epsilon) { 19326 container.scrollTo(container.scrollLeft, container.scrollTop + delta); 19327 } 19328 } 19329 /** 19330 * Splits the content at the location of the selection. 19331 * 19332 * Replaces the content of the editor inside this element with the contents 19333 * before the selection. Sends the elements after the selection to the `onSplit` 19334 * handler. 19335 * 19336 * @param {Array} blocks The blocks to add after the split point. 19337 * @param {Object} context The context for splitting. 19338 */ 19339 19340 }, { 19341 key: "splitContent", 19342 value: function splitContent() { 19343 var blocks = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; 19344 var context = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; 19345 var onSplit = this.props.onSplit; 19346 var record = this.createRecord(); 19347 19348 if (!onSplit) { 19349 return; 19350 } 19351 19352 var _split = Object(_wordpress_rich_text__WEBPACK_IMPORTED_MODULE_23__["split"])(record), 19353 _split2 = Object(_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_2__["default"])(_split, 2), 19354 before = _split2[0], 19355 after = _split2[1]; // In case split occurs at the trailing or leading edge of the field, 19356 // assume that the before/after values respectively reflect the current 19357 // value. This also provides an opportunity for the parent component to 19358 // determine whether the before/after value has changed using a trivial 19359 // strict equality operation. 19360 19361 19362 if (Object(_wordpress_rich_text__WEBPACK_IMPORTED_MODULE_23__["isEmpty"])(after)) { 19363 before = record; 19364 } else if (Object(_wordpress_rich_text__WEBPACK_IMPORTED_MODULE_23__["isEmpty"])(before)) { 19365 after = record; 19366 } // If pasting and the split would result in no content other than the 19367 // pasted blocks, remove the before and after blocks. 19368 19369 19370 if (context.paste) { 19371 before = Object(_wordpress_rich_text__WEBPACK_IMPORTED_MODULE_23__["isEmpty"])(before) ? null : before; 19372 after = Object(_wordpress_rich_text__WEBPACK_IMPORTED_MODULE_23__["isEmpty"])(after) ? null : after; 19373 } 19374 19375 if (before) { 19376 before = this.valueToFormat(before); 19377 } 19378 19379 if (after) { 19380 after = this.valueToFormat(after); 19381 } 19382 19383 onSplit.apply(void 0, [before, after].concat(Object(_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_3__["default"])(blocks))); 19384 } 19385 }, { 19386 key: "onNodeChange", 19387 value: function onNodeChange(_ref5) { 19388 var parents = _ref5.parents; 19389 19390 if (!this.isActive()) { 19391 return; 19392 } 19393 19394 if (this.props.isViewportSmall) { 19395 var rect; 19396 var selectedAnchor = Object(lodash__WEBPACK_IMPORTED_MODULE_13__["find"])(parents, function (node) { 19397 return node.tagName === 'A'; 19398 }); 19399 19400 if (selectedAnchor) { 19401 // If we selected a link, position the Link UI below the link 19402 rect = selectedAnchor.getBoundingClientRect(); 19403 } else { 19404 // Otherwise, position the Link UI below the cursor or text selection 19405 rect = Object(_wordpress_dom__WEBPACK_IMPORTED_MODULE_15__["getRectangleFromRange"])(this.editor.selection.getRng()); 19406 } // Originally called on `focusin`, that hook turned out to be 19407 // premature. On `nodechange` we can work with the finalized TinyMCE 19408 // instance and scroll to proper position. 19409 19410 19411 this.scrollToRect(rect); 19412 } 19413 } 19414 }, { 19415 key: "componentDidUpdate", 19416 value: function componentDidUpdate(prevProps) { 19417 var _this$props4 = this.props, 19418 tagName = _this$props4.tagName, 19419 value = _this$props4.value; 19420 19421 if (tagName === prevProps.tagName && value !== prevProps.value && value !== this.savedContent) { 19422 // Handle deprecated `children` and `node` sources. 19423 // The old way of passing a value with the `node` matcher required 19424 // the value to be mapped first, creating a new array each time, so 19425 // a shallow check wouldn't work. We need to check deep equality. 19426 // This is only executed for a deprecated API and will eventually be 19427 // removed. 19428 if (Array.isArray(value) && Object(lodash__WEBPACK_IMPORTED_MODULE_13__["isEqual"])(value, this.savedContent)) { 19429 return; 19430 } 19431 19432 var record = this.formatToValue(value); 19433 19434 if (this.isActive()) { 19435 var prevRecord = this.formatToValue(prevProps.value); 19436 var length = Object(_wordpress_rich_text__WEBPACK_IMPORTED_MODULE_23__["getTextContent"])(prevRecord).length; 19437 record.start = length; 19438 record.end = length; 19439 } 19440 19441 this.applyRecord(record); 19442 this.savedContent = value; 19443 } 19444 } 19445 }, { 19446 key: "formatToValue", 19447 value: function formatToValue(value) { 19448 var _this$props5 = this.props, 19449 format = _this$props5.format, 19450 multiline = _this$props5.multiline; // Handle deprecated `children` and `node` sources. 19451 19452 if (Array.isArray(value)) { 19453 return Object(_wordpress_rich_text__WEBPACK_IMPORTED_MODULE_23__["create"])({ 19454 html: _wordpress_blocks__WEBPACK_IMPORTED_MODULE_20__["children"].toHTML(value), 19455 multilineTag: multiline 19456 }); 19457 } 19458 19459 if (format === 'string') { 19460 return Object(_wordpress_rich_text__WEBPACK_IMPORTED_MODULE_23__["create"])({ 19461 html: value, 19462 multilineTag: multiline 19463 }); 19464 } // Guard for blocks passing `null` in onSplit callbacks. May be removed 19465 // if onSplit is revised to not pass a `null` value. 19466 19467 19468 if (value === null) { 19469 return Object(_wordpress_rich_text__WEBPACK_IMPORTED_MODULE_23__["create"])(); 19470 } 19471 19472 return value; 19473 } 19474 }, { 19475 key: "valueToFormat", 19476 value: function valueToFormat(_ref6) { 19477 var formats = _ref6.formats, 19478 text = _ref6.text; 19479 var _this$props6 = this.props, 19480 format = _this$props6.format, 19481 multiline = _this$props6.multiline; // Handle deprecated `children` and `node` sources. 19482 19483 if (this.usedDeprecatedChildrenSource) { 19484 return _wordpress_blocks__WEBPACK_IMPORTED_MODULE_20__["children"].fromDOM(Object(_wordpress_rich_text__WEBPACK_IMPORTED_MODULE_23__["unstableToDom"])({ 19485 formats: formats, 19486 text: text 19487 }, multiline).body.childNodes); 19488 } 19489 19490 if (format === 'string') { 19491 return Object(_wordpress_rich_text__WEBPACK_IMPORTED_MODULE_23__["toHTMLString"])({ 19492 formats: formats, 19493 text: text 19494 }, multiline); 19495 } 19496 19497 return { 19498 formats: formats, 19499 text: text 19500 }; 19501 } 19502 }, { 19503 key: "render", 19504 value: function render() { 19505 var _this3 = this; 19506 19507 var _this$props7 = this.props, 19508 _this$props7$tagName = _this$props7.tagName, 19509 Tagname = _this$props7$tagName === void 0 ? 'div' : _this$props7$tagName, 19510 style = _this$props7.style, 19511 value = _this$props7.value, 19512 wrapperClassName = _this$props7.wrapperClassName, 19513 className = _this$props7.className, 19514 _this$props7$inlineTo = _this$props7.inlineToolbar, 19515 inlineToolbar = _this$props7$inlineTo === void 0 ? false : _this$props7$inlineTo, 19516 formattingControls = _this$props7.formattingControls, 19517 placeholder = _this$props7.placeholder, 19518 MultilineTag = _this$props7.multiline, 19519 _this$props7$keepPlac = _this$props7.keepPlaceholderOnFocus, 19520 keepPlaceholderOnFocus = _this$props7$keepPlac === void 0 ? false : _this$props7$keepPlac, 19521 isSelected = _this$props7.isSelected, 19522 autocompleters = _this$props7.autocompleters; 19523 var ariaProps = Object(_aria__WEBPACK_IMPORTED_MODULE_30__["pickAriaProps"])(this.props); // Generating a key that includes `tagName` ensures that if the tag 19524 // changes, we unmount and destroy the previous TinyMCE element, then 19525 // mount and initialize a new child element in its place. 19526 19527 var key = ['editor', Tagname].join(); 19528 var isPlaceholderVisible = placeholder && (!isSelected || keepPlaceholderOnFocus) && this.isEmpty(); 19529 var classes = classnames__WEBPACK_IMPORTED_MODULE_12___default()(wrapperClassName, 'editor-rich-text'); 19530 var record = this.getRecord(); 19531 var formatToolbar = this.editor && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_11__["createElement"])(_format_toolbar__WEBPACK_IMPORTED_MODULE_28__["default"], { 19532 record: record, 19533 onChange: this.onChange, 19534 enabledControls: formattingControls, 19535 editor: this.editor 19536 }); 19537 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_11__["createElement"])("div", { 19538 className: classes, 19539 ref: this.containerRef, 19540 onFocus: this.setFocusedElement 19541 }, isSelected && !inlineToolbar && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_11__["createElement"])(_block_format_controls__WEBPACK_IMPORTED_MODULE_26__["default"], null, formatToolbar), isSelected && inlineToolbar && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_11__["createElement"])("div", { 19542 className: "editor-rich-text__inline-toolbar" 19543 }, formatToolbar), isSelected && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_11__["createElement"])(_tokens_ui__WEBPACK_IMPORTED_MODULE_33__["default"], { 19544 editor: this.editor, 19545 containerRef: this.containerRef 19546 }), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_11__["createElement"])(_autocomplete__WEBPACK_IMPORTED_MODULE_25__["default"], { 19547 onReplace: this.props.onReplace, 19548 completers: autocompleters, 19549 record: record, 19550 onChange: this.onChange 19551 }, function (_ref7) { 19552 var isExpanded = _ref7.isExpanded, 19553 listBoxId = _ref7.listBoxId, 19554 activeId = _ref7.activeId; 19555 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_11__["createElement"])(_wordpress_element__WEBPACK_IMPORTED_MODULE_11__["Fragment"], null, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_11__["createElement"])(_tinymce__WEBPACK_IMPORTED_MODULE_29__["default"], Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_1__["default"])({ 19556 tagName: Tagname, 19557 getSettings: _this3.getSettings, 19558 onSetup: _this3.onSetup, 19559 style: style, 19560 defaultValue: value, 19561 isPlaceholderVisible: isPlaceholderVisible, 19562 "aria-label": placeholder, 19563 "aria-autocomplete": "list", 19564 "aria-expanded": isExpanded, 19565 "aria-owns": listBoxId, 19566 "aria-activedescendant": activeId 19567 }, ariaProps, { 19568 className: className, 19569 key: key, 19570 onPaste: _this3.onPaste, 19571 onInput: _this3.onInput, 19572 multilineTag: MultilineTag, 19573 setRef: _this3.setRef 19574 })), isPlaceholderVisible && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_11__["createElement"])(Tagname, { 19575 className: classnames__WEBPACK_IMPORTED_MODULE_12___default()('editor-rich-text__tinymce', className), 19576 style: style 19577 }, MultilineTag ? Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_11__["createElement"])(MultilineTag, null, placeholder) : placeholder), isSelected && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_11__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_18__["Slot"], { 19578 name: "RichText.Siblings" 19579 })); 19580 })); 19581 } 19582 }]); 19583 19584 return RichText; 19585 }(_wordpress_element__WEBPACK_IMPORTED_MODULE_11__["Component"]); 19586 RichText.defaultProps = { 19587 formattingControls: _formatting_controls__WEBPACK_IMPORTED_MODULE_27__["FORMATTING_CONTROLS"].map(function (_ref8) { 19588 var format = _ref8.format; 19589 return format; 19590 }), 19591 format: 'string', 19592 value: '' 19593 }; 19594 var RichTextContainer = Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_21__["compose"])([_wordpress_compose__WEBPACK_IMPORTED_MODULE_21__["withInstanceId"], Object(_block_edit_context__WEBPACK_IMPORTED_MODULE_32__["withBlockEditContext"])(function (context, ownProps) { 19595 // When explicitly set as not selected, do nothing. 19596 if (ownProps.isSelected === false) { 19597 return {}; 19598 } // When explicitly set as selected, use the value stored in the context instead. 19599 19600 19601 if (ownProps.isSelected === true) { 19602 return { 19603 isSelected: context.isSelected 19604 }; 19605 } // Ensures that only one RichText component can be focused. 19606 19607 19608 return { 19609 isSelected: context.isSelected && context.focusedElement === ownProps.instanceId, 19610 setFocusedElement: context.setFocusedElement 19611 }; 19612 }), Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_19__["withSelect"])(function (select) { 19613 var _ref9 = select('core/viewport') || {}, 19614 _ref9$isViewportMatch = _ref9.isViewportMatch, 19615 isViewportMatch = _ref9$isViewportMatch === void 0 ? lodash__WEBPACK_IMPORTED_MODULE_13__["identity"] : _ref9$isViewportMatch; 19616 19617 var _select = select('core/editor'), 19618 canUserUseUnfilteredHTML = _select.canUserUseUnfilteredHTML; 19619 19620 return { 19621 isViewportSmall: isViewportMatch('< small'), 19622 canUserUseUnfilteredHTML: canUserUseUnfilteredHTML() 19623 }; 19624 }), Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_19__["withDispatch"])(function (dispatch) { 19625 var _dispatch = dispatch('core/editor'), 19626 createUndoLevel = _dispatch.createUndoLevel, 19627 redo = _dispatch.redo, 19628 undo = _dispatch.undo; 19629 19630 return { 19631 onCreateUndoLevel: createUndoLevel, 19632 onRedo: redo, 19633 onUndo: undo 19634 }; 19635 }), _wordpress_compose__WEBPACK_IMPORTED_MODULE_21__["withSafeTimeout"]])(RichText); 19636 19637 RichTextContainer.Content = function (_ref10) { 19638 var value = _ref10.value, 19639 Tag = _ref10.tagName, 19640 MultilineTag = _ref10.multiline, 19641 props = Object(_babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_0__["default"])(_ref10, ["value", "tagName", "multiline"]); 19642 19643 var html = value; // Handle deprecated `children` and `node` sources. 19644 19645 if (Array.isArray(value)) { 19646 html = _wordpress_blocks__WEBPACK_IMPORTED_MODULE_20__["children"].toHTML(value); 19647 } 19648 19649 if (!html && MultilineTag) { 19650 html = "<".concat(MultilineTag, "></").concat(MultilineTag, ">"); 19651 } 19652 19653 var content = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_11__["createElement"])(_wordpress_element__WEBPACK_IMPORTED_MODULE_11__["RawHTML"], null, html); 19654 19655 if (Tag) { 19656 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_11__["createElement"])(Tag, Object(lodash__WEBPACK_IMPORTED_MODULE_13__["omit"])(props, ['format']), content); 19657 } 19658 19659 return content; 19660 }; 19661 19662 RichTextContainer.isEmpty = function () { 19663 var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ''; 19664 19665 // Handle deprecated `children` and `node` sources. 19666 if (Array.isArray(value)) { 19667 return !value || value.length === 0; 19668 } 19669 19670 return value.length === 0; 19671 }; 19672 19673 RichTextContainer.Content.defaultProps = { 19674 format: 'string', 19675 value: '' 19676 }; 19677 /* harmony default export */ __webpack_exports__["default"] = (RichTextContainer); 19678 19679 19680 /***/ }), 19681 19682 /***/ "./node_modules/@wordpress/editor/build-module/components/rich-text/patterns.js": 19683 /*!**************************************************************************************!*\ 19684 !*** ./node_modules/@wordpress/editor/build-module/components/rich-text/patterns.js ***! 19685 \**************************************************************************************/ 19686 /*! exports provided: getPatterns */ 19687 /***/ (function(module, __webpack_exports__, __webpack_require__) { 19688 19689 "use strict"; 19690 __webpack_require__.r(__webpack_exports__); 19691 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getPatterns", function() { return getPatterns; }); 19692 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash */ "lodash"); 19693 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_0__); 19694 /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks"); 19695 /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_1__); 19696 /* harmony import */ var _wordpress_rich_text__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/rich-text */ "@wordpress/rich-text"); 19697 /* harmony import */ var _wordpress_rich_text__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_rich_text__WEBPACK_IMPORTED_MODULE_2__); 19698 /** 19699 * External dependencies 19700 */ 19701 19702 /** 19703 * WordPress dependencies 19704 */ 19705 19706 19707 19708 function getPatterns(_ref) { 19709 var onReplace = _ref.onReplace, 19710 multiline = _ref.multiline; 19711 var patterns = Object(lodash__WEBPACK_IMPORTED_MODULE_0__["filter"])(Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_1__["getBlockTransforms"])('from'), function (_ref2) { 19712 var type = _ref2.type, 19713 trigger = _ref2.trigger; 19714 return type === 'pattern' && trigger === undefined; 19715 }); 19716 return [function (record) { 19717 if (!onReplace) { 19718 return record; 19719 } 19720 19721 var text = Object(_wordpress_rich_text__WEBPACK_IMPORTED_MODULE_2__["getTextContent"])(record); 19722 var transformation = Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_1__["findTransform"])(patterns, function (item) { 19723 return item.regExp.test(text); 19724 }); 19725 19726 if (!transformation) { 19727 return record; 19728 } 19729 19730 var result = text.match(transformation.regExp); 19731 var block = transformation.transform({ 19732 content: Object(_wordpress_rich_text__WEBPACK_IMPORTED_MODULE_2__["remove"])(record, 0, result[0].length), 19733 match: result 19734 }); 19735 onReplace([block]); 19736 return record; 19737 }, function (record) { 19738 if (multiline) { 19739 return record; 19740 } 19741 19742 var text = Object(_wordpress_rich_text__WEBPACK_IMPORTED_MODULE_2__["getTextContent"])(record); // Quick check the text for the necessary character. 19743 19744 if (text.indexOf('`') === -1) { 19745 return record; 19746 } 19747 19748 var match = text.match(/`([^`]+)`/); 19749 19750 if (!match) { 19751 return record; 19752 } 19753 19754 var start = match.index; 19755 var end = start + match[1].length; 19756 record = Object(_wordpress_rich_text__WEBPACK_IMPORTED_MODULE_2__["remove"])(record, start, start + 1); 19757 record = Object(_wordpress_rich_text__WEBPACK_IMPORTED_MODULE_2__["remove"])(record, end, end + 1); 19758 record = Object(_wordpress_rich_text__WEBPACK_IMPORTED_MODULE_2__["applyFormat"])(record, { 19759 type: 'code' 19760 }, start, end); 19761 return record; 19762 }]; 19763 } 19764 19765 19766 /***/ }), 19767 19768 /***/ "./node_modules/@wordpress/editor/build-module/components/rich-text/tinymce.js": 19769 /*!*************************************************************************************!*\ 19770 !*** ./node_modules/@wordpress/editor/build-module/components/rich-text/tinymce.js ***! 19771 \*************************************************************************************/ 19772 /*! exports provided: default */ 19773 /***/ (function(module, __webpack_exports__, __webpack_require__) { 19774 19775 "use strict"; 19776 __webpack_require__.r(__webpack_exports__); 19777 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return TinyMCE; }); 19778 /* harmony import */ var _babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/defineProperty */ "./node_modules/@babel/runtime/helpers/esm/defineProperty.js"); 19779 /* harmony import */ var _babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectSpread */ "./node_modules/@babel/runtime/helpers/esm/objectSpread.js"); 19780 /* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/classCallCheck */ "./node_modules/@babel/runtime/helpers/esm/classCallCheck.js"); 19781 /* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/esm/createClass */ "./node_modules/@babel/runtime/helpers/esm/createClass.js"); 19782 /* harmony import */ var _babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/esm/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js"); 19783 /* harmony import */ var _babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/helpers/esm/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js"); 19784 /* harmony import */ var _babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inherits */ "./node_modules/@babel/runtime/helpers/esm/inherits.js"); 19785 /* harmony import */ var _babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @babel/runtime/helpers/esm/assertThisInitialized */ "./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js"); 19786 /* harmony import */ var tinymce__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! tinymce */ "tinymce"); 19787 /* harmony import */ var tinymce__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(tinymce__WEBPACK_IMPORTED_MODULE_8__); 19788 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! lodash */ "lodash"); 19789 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_9__); 19790 /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); 19791 /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_10__); 19792 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); 19793 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_11__); 19794 /* harmony import */ var _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @wordpress/keycodes */ "@wordpress/keycodes"); 19795 /* harmony import */ var _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(_wordpress_keycodes__WEBPACK_IMPORTED_MODULE_12__); 19796 /* harmony import */ var _wordpress_rich_text__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @wordpress/rich-text */ "@wordpress/rich-text"); 19797 /* harmony import */ var _wordpress_rich_text__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(_wordpress_rich_text__WEBPACK_IMPORTED_MODULE_13__); 19798 /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks"); 19799 /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_14___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_14__); 19800 /* harmony import */ var _aria__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./aria */ "./node_modules/@wordpress/editor/build-module/components/rich-text/aria.js"); 19801 19802 19803 19804 19805 19806 19807 19808 19809 19810 /** 19811 * External dependencies 19812 */ 19813 19814 19815 19816 /** 19817 * WordPress dependencies 19818 */ 19819 19820 19821 19822 19823 19824 /** 19825 * Internal dependencies 19826 */ 19827 19828 19829 /** 19830 * Determines whether we need a fix to provide `input` events for contenteditable. 19831 * 19832 * @param {Element} editorNode The root editor node. 19833 * 19834 * @return {boolean} A boolean indicating whether the fix is needed. 19835 */ 19836 19837 function needsInternetExplorerInputFix(editorNode) { 19838 return (// Rely on userAgent in the absence of a reasonable feature test for contenteditable `input` events. 19839 /Trident/.test(window.navigator.userAgent) && // IE11 dispatches input events for `<input>` and `<textarea>`. 19840 !/input/i.test(editorNode.tagName) && !/textarea/i.test(editorNode.tagName) 19841 ); 19842 } 19843 /** 19844 * Applies a fix that provides `input` events for contenteditable in Internet Explorer. 19845 * 19846 * @param {Element} editorNode The root editor node. 19847 * 19848 * @return {Function} A function to remove the fix (for cleanup). 19849 */ 19850 19851 19852 function applyInternetExplorerInputFix(editorNode) { 19853 /** 19854 * Dispatches `input` events in response to `textinput` events. 19855 * 19856 * IE provides a `textinput` event that is similar to an `input` event, 19857 * and we use it to manually dispatch an `input` event. 19858 * `textinput` is dispatched for text entry but for not deletions. 19859 * 19860 * @param {Event} textInputEvent An Internet Explorer `textinput` event. 19861 */ 19862 function mapTextInputEvent(textInputEvent) { 19863 textInputEvent.stopImmediatePropagation(); 19864 var inputEvent = document.createEvent('Event'); 19865 inputEvent.initEvent('input', true, false); 19866 inputEvent.data = textInputEvent.data; 19867 textInputEvent.target.dispatchEvent(inputEvent); 19868 } 19869 /** 19870 * Dispatches `input` events in response to Delete and Backspace keyup. 19871 * 19872 * It would be better dispatch an `input` event after each deleting 19873 * `keydown` because the DOM is updated after each, but it is challenging 19874 * to determine the right time to dispatch `input` since propagation of 19875 * `keydown` can be stopped at any point. 19876 * 19877 * It's easier to listen for `keyup` in the capture phase and dispatch 19878 * `input` before `keyup` propagates further. It's not perfect, but should 19879 * be good enough. 19880 * 19881 * @param {KeyboardEvent} keyUp 19882 * @param {Node} keyUp.target The event target. 19883 * @param {number} keyUp.keyCode The key code. 19884 */ 19885 19886 19887 function mapDeletionKeyUpEvents(_ref) { 19888 var target = _ref.target, 19889 keyCode = _ref.keyCode; 19890 var isDeletion = _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_12__["BACKSPACE"] === keyCode || _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_12__["DELETE"] === keyCode; 19891 19892 if (isDeletion && editorNode.contains(target)) { 19893 var inputEvent = document.createEvent('Event'); 19894 inputEvent.initEvent('input', true, false); 19895 inputEvent.data = null; 19896 target.dispatchEvent(inputEvent); 19897 } 19898 } 19899 19900 editorNode.addEventListener('textinput', mapTextInputEvent); 19901 document.addEventListener('keyup', mapDeletionKeyUpEvents, true); 19902 return function removeInternetExplorerInputFix() { 19903 editorNode.removeEventListener('textinput', mapTextInputEvent); 19904 document.removeEventListener('keyup', mapDeletionKeyUpEvents, true); 19905 }; 19906 } 19907 19908 var IS_PLACEHOLDER_VISIBLE_ATTR_NAME = 'data-is-placeholder-visible'; 19909 19910 var TinyMCE = 19911 /*#__PURE__*/ 19912 function (_Component) { 19913 Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_6__["default"])(TinyMCE, _Component); 19914 19915 function TinyMCE() { 19916 var _this; 19917 19918 Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_2__["default"])(this, TinyMCE); 19919 19920 _this = Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_4__["default"])(this, Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_5__["default"])(TinyMCE).call(this)); 19921 _this.bindEditorNode = _this.bindEditorNode.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(_this))); 19922 return _this; 19923 } 19924 19925 Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_3__["default"])(TinyMCE, [{ 19926 key: "componentDidMount", 19927 value: function componentDidMount() { 19928 this.initialize(); 19929 } 19930 }, { 19931 key: "shouldComponentUpdate", 19932 value: function shouldComponentUpdate() { 19933 // We must prevent rerenders because TinyMCE will modify the DOM, thus 19934 // breaking React's ability to reconcile changes. 19935 // 19936 // See: https://github.com/facebook/react/issues/6802 19937 return false; 19938 } 19939 }, { 19940 key: "componentWillReceiveProps", 19941 value: function componentWillReceiveProps(nextProps) { 19942 var _this2 = this; 19943 19944 this.configureIsPlaceholderVisible(nextProps.isPlaceholderVisible); 19945 19946 if (!Object(lodash__WEBPACK_IMPORTED_MODULE_9__["isEqual"])(this.props.style, nextProps.style)) { 19947 this.editorNode.setAttribute('style', ''); 19948 Object.assign(this.editorNode.style, nextProps.style); 19949 } 19950 19951 if (!Object(lodash__WEBPACK_IMPORTED_MODULE_9__["isEqual"])(this.props.className, nextProps.className)) { 19952 this.editorNode.className = classnames__WEBPACK_IMPORTED_MODULE_10___default()(nextProps.className, 'editor-rich-text__tinymce'); 19953 } 19954 19955 var _diffAriaProps = Object(_aria__WEBPACK_IMPORTED_MODULE_15__["diffAriaProps"])(this.props, nextProps), 19956 removedKeys = _diffAriaProps.removedKeys, 19957 updatedKeys = _diffAriaProps.updatedKeys; 19958 19959 removedKeys.forEach(function (key) { 19960 return _this2.editorNode.removeAttribute(key); 19961 }); 19962 updatedKeys.forEach(function (key) { 19963 return _this2.editorNode.setAttribute(key, nextProps[key]); 19964 }); 19965 } 19966 }, { 19967 key: "componentWillUnmount", 19968 value: function componentWillUnmount() { 19969 if (!this.editor) { 19970 return; 19971 } 19972 19973 this.editor.destroy(); 19974 delete this.editor; 19975 } 19976 }, { 19977 key: "configureIsPlaceholderVisible", 19978 value: function configureIsPlaceholderVisible(isPlaceholderVisible) { 19979 var isPlaceholderVisibleString = String(!!isPlaceholderVisible); 19980 19981 if (this.editorNode.getAttribute(IS_PLACEHOLDER_VISIBLE_ATTR_NAME) !== isPlaceholderVisibleString) { 19982 this.editorNode.setAttribute(IS_PLACEHOLDER_VISIBLE_ATTR_NAME, isPlaceholderVisibleString); 19983 } 19984 } 19985 }, { 19986 key: "initialize", 19987 value: function initialize() { 19988 var _this3 = this; 19989 19990 var settings = this.props.getSettings({ 19991 theme: false, 19992 inline: true, 19993 toolbar: false, 19994 browser_spellcheck: true, 19995 entity_encoding: 'raw', 19996 convert_urls: false, 19997 inline_boundaries_selector: 'a[href],code,b,i,strong,em,del,ins,sup,sub', 19998 plugins: [] 19999 }); 20000 tinymce__WEBPACK_IMPORTED_MODULE_8___default.a.init(Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_1__["default"])({}, settings, { 20001 target: this.editorNode, 20002 setup: function setup(editor) { 20003 _this3.editor = editor; 20004 20005 _this3.props.onSetup(editor); 20006 } 20007 })); 20008 } 20009 }, { 20010 key: "bindEditorNode", 20011 value: function bindEditorNode(editorNode) { 20012 this.editorNode = editorNode; 20013 20014 if (this.props.setRef) { 20015 this.props.setRef(editorNode); 20016 } 20017 /** 20018 * A ref function can be used for cleanup because React calls it with 20019 * `null` when unmounting. 20020 */ 20021 20022 20023 if (this.removeInternetExplorerInputFix) { 20024 this.removeInternetExplorerInputFix(); 20025 this.removeInternetExplorerInputFix = null; 20026 } 20027 20028 if (editorNode && needsInternetExplorerInputFix(editorNode)) { 20029 this.removeInternetExplorerInputFix = applyInternetExplorerInputFix(editorNode); 20030 } 20031 } 20032 }, { 20033 key: "render", 20034 value: function render() { 20035 var _objectSpread2; 20036 20037 var ariaProps = Object(_aria__WEBPACK_IMPORTED_MODULE_15__["pickAriaProps"])(this.props); 20038 var _this$props = this.props, 20039 _this$props$tagName = _this$props.tagName, 20040 tagName = _this$props$tagName === void 0 ? 'div' : _this$props$tagName, 20041 style = _this$props.style, 20042 defaultValue = _this$props.defaultValue, 20043 className = _this$props.className, 20044 isPlaceholderVisible = _this$props.isPlaceholderVisible, 20045 onPaste = _this$props.onPaste, 20046 onInput = _this$props.onInput, 20047 multilineTag = _this$props.multilineTag; 20048 /* 20049 * The role=textbox and aria-multiline=true must always be used together 20050 * as TinyMCE always behaves like a sort of textarea where text wraps in 20051 * multiple lines. Only the table block editable element is excluded. 20052 */ 20053 20054 if (tagName !== 'table') { 20055 ariaProps.role = 'textbox'; 20056 ariaProps['aria-multiline'] = true; 20057 } // If a default value is provided, render it into the DOM even before 20058 // TinyMCE finishes initializing. This avoids a short delay by allowing 20059 // us to show and focus the content before it's truly ready to edit. 20060 20061 20062 var initialHTML = defaultValue; // Handle deprecated `children` and `node` sources. 20063 20064 if (Array.isArray(defaultValue)) { 20065 initialHTML = _wordpress_blocks__WEBPACK_IMPORTED_MODULE_14__["children"].toHTML(defaultValue); 20066 } else if (typeof defaultValue !== 'string') { 20067 initialHTML = Object(_wordpress_rich_text__WEBPACK_IMPORTED_MODULE_13__["toHTMLString"])(defaultValue, multilineTag); 20068 } 20069 20070 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_11__["createElement"])(tagName, Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_1__["default"])({}, ariaProps, (_objectSpread2 = { 20071 className: classnames__WEBPACK_IMPORTED_MODULE_10___default()(className, 'editor-rich-text__tinymce'), 20072 contentEditable: true 20073 }, Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__["default"])(_objectSpread2, IS_PLACEHOLDER_VISIBLE_ATTR_NAME, isPlaceholderVisible), Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__["default"])(_objectSpread2, "ref", this.bindEditorNode), Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__["default"])(_objectSpread2, "style", style), Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__["default"])(_objectSpread2, "suppressContentEditableWarning", true), Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__["default"])(_objectSpread2, "dangerouslySetInnerHTML", { 20074 __html: initialHTML 20075 }), Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__["default"])(_objectSpread2, "onPaste", onPaste), Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__["default"])(_objectSpread2, "onInput", onInput), _objectSpread2))); 20076 } 20077 }]); 20078 20079 return TinyMCE; 20080 }(_wordpress_element__WEBPACK_IMPORTED_MODULE_11__["Component"]); 20081 20082 20083 20084 20085 /***/ }), 20086 20087 /***/ "./node_modules/@wordpress/editor/build-module/components/rich-text/tokens/index.js": 20088 /*!******************************************************************************************!*\ 20089 !*** ./node_modules/@wordpress/editor/build-module/components/rich-text/tokens/index.js ***! 20090 \******************************************************************************************/ 20091 /*! exports provided: validateTokenSettings */ 20092 /***/ (function(module, __webpack_exports__, __webpack_require__) { 20093 20094 "use strict"; 20095 __webpack_require__.r(__webpack_exports__); 20096 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "validateTokenSettings", function() { return validateTokenSettings; }); 20097 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash */ "lodash"); 20098 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_0__); 20099 /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks"); 20100 /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_1__); 20101 /* harmony import */ var _wordpress_hooks__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/hooks */ "@wordpress/hooks"); 20102 /* harmony import */ var _wordpress_hooks__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_hooks__WEBPACK_IMPORTED_MODULE_2__); 20103 /** 20104 * External dependencies 20105 */ 20106 20107 /** 20108 * WordPress dependencies 20109 */ 20110 20111 20112 20113 /** 20114 * Browser dependencies 20115 */ 20116 20117 var error = window.console.error; 20118 /** 20119 * Validates the token settings object. 20120 * 20121 * @param {string} name Token name. 20122 * @param {Object} settings Token settings. 20123 * @param {Object} state core/editor state. 20124 * 20125 * @return {Object} Validated token settings. 20126 */ 20127 20128 function validateTokenSettings(name, settings, state) { 20129 if (typeof name !== 'string') { 20130 error('Token names must be strings.'); 20131 return; 20132 } 20133 20134 if (!/^[a-z][a-z0-9-]*\/[a-z][a-z0-9-]*$/.test(name)) { 20135 error('Token names must contain a namespace prefix, include only lowercase alphanumeric characters or dashes, and start with a letter. Example: my-plugin/my-custom-token'); 20136 return; 20137 } 20138 20139 if (Object(lodash__WEBPACK_IMPORTED_MODULE_0__["has"])(state, [name])) { 20140 error('Token "' + name + '" is already registered.'); 20141 return; 20142 } 20143 20144 settings = Object(_wordpress_hooks__WEBPACK_IMPORTED_MODULE_2__["applyFilters"])('editor.registerToken', settings, name); 20145 20146 if (!settings || !Object(lodash__WEBPACK_IMPORTED_MODULE_0__["isFunction"])(settings.save)) { 20147 error('The "save" property must be specified and must be a valid function.'); 20148 return; 20149 } 20150 20151 if (Object(lodash__WEBPACK_IMPORTED_MODULE_0__["has"])(settings, ['edit']) && !Object(lodash__WEBPACK_IMPORTED_MODULE_0__["isFunction"])(settings.edit)) { 20152 error('The "edit" property must be a valid function.'); 20153 return; 20154 } 20155 20156 if (Object(lodash__WEBPACK_IMPORTED_MODULE_0__["has"])(settings, ['keywords']) && settings.keywords.length > 3) { 20157 error('The token "' + name + '" can have a maximum of 3 keywords.'); 20158 return; 20159 } 20160 20161 if (!Object(lodash__WEBPACK_IMPORTED_MODULE_0__["has"])(settings, ['title']) || settings.title === '') { 20162 error('The token "' + name + '" must have a title.'); 20163 return; 20164 } 20165 20166 if (typeof settings.title !== 'string') { 20167 error('Token titles must be strings.'); 20168 return; 20169 } 20170 20171 settings.icon = Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_1__["normalizeIconObject"])(settings.icon); 20172 20173 if (!Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_1__["isValidIcon"])(settings.icon.src)) { 20174 error('The icon passed is invalid. ' + 'The icon should be a string, an element, a function, or an object following the specifications documented in https://wordpress.org/gutenberg/handbook/block-api/#icon-optional'); 20175 return; 20176 } 20177 20178 return settings; 20179 } 20180 20181 20182 /***/ }), 20183 20184 /***/ "./node_modules/@wordpress/editor/build-module/components/rich-text/tokens/ui/index.js": 20185 /*!*********************************************************************************************!*\ 20186 !*** ./node_modules/@wordpress/editor/build-module/components/rich-text/tokens/ui/index.js ***! 20187 \*********************************************************************************************/ 20188 /*! exports provided: default */ 20189 /***/ (function(module, __webpack_exports__, __webpack_require__) { 20190 20191 "use strict"; 20192 __webpack_require__.r(__webpack_exports__); 20193 /* harmony import */ var _babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectSpread */ "./node_modules/@babel/runtime/helpers/esm/objectSpread.js"); 20194 /* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/classCallCheck */ "./node_modules/@babel/runtime/helpers/esm/classCallCheck.js"); 20195 /* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/createClass */ "./node_modules/@babel/runtime/helpers/esm/createClass.js"); 20196 /* harmony import */ var _babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/esm/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js"); 20197 /* harmony import */ var _babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/esm/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js"); 20198 /* harmony import */ var _babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inherits */ "./node_modules/@babel/runtime/helpers/esm/inherits.js"); 20199 /* harmony import */ var _babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @babel/runtime/helpers/esm/assertThisInitialized */ "./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js"); 20200 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); 20201 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__); 20202 /* harmony import */ var _wordpress_dom__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @wordpress/dom */ "@wordpress/dom"); 20203 /* harmony import */ var _wordpress_dom__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_wordpress_dom__WEBPACK_IMPORTED_MODULE_8__); 20204 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); 20205 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_9__); 20206 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); 20207 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_10__); 20208 /* harmony import */ var _inserter__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../../inserter */ "./node_modules/@wordpress/editor/build-module/components/inserter/index.js"); 20209 20210 20211 20212 20213 20214 20215 20216 20217 20218 /** 20219 * WordPress dependencies 20220 */ 20221 20222 20223 20224 20225 /** 20226 * Internal dependencies 20227 */ 20228 20229 20230 20231 var TokenUI = 20232 /*#__PURE__*/ 20233 function (_Component) { 20234 Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_5__["default"])(TokenUI, _Component); 20235 20236 function TokenUI() { 20237 var _this; 20238 20239 Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_1__["default"])(this, TokenUI); 20240 20241 _this = Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__["default"])(this, Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__["default"])(TokenUI).apply(this, arguments)); 20242 _this.onHover = _this.onHover.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["default"])(_this))); 20243 _this.onSelect = _this.onSelect.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["default"])(_this))); 20244 _this.onSave = _this.onSave.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["default"])(_this))); 20245 _this.state = { 20246 selected: null, 20247 hovered: null 20248 }; 20249 return _this; 20250 } 20251 20252 Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_2__["default"])(TokenUI, [{ 20253 key: "getInsertPosition", 20254 value: function getInsertPosition() { 20255 var _this$props = this.props, 20256 containerRef = _this$props.containerRef, 20257 editor = _this$props.editor; // The container is relatively positioned. 20258 20259 var containerPosition = containerRef.current.getBoundingClientRect(); 20260 var rect = Object(_wordpress_dom__WEBPACK_IMPORTED_MODULE_8__["getRectangleFromRange"])(editor.selection.getRng()); 20261 return { 20262 top: rect.top - containerPosition.top, 20263 left: rect.right - containerPosition.left, 20264 height: rect.height 20265 }; 20266 } 20267 }, { 20268 key: "onSave", 20269 value: function onSave(_ref) { 20270 var _this2 = this; 20271 20272 var save = _ref.save; 20273 return function (attributes) { 20274 var editor = _this2.props.editor; 20275 20276 if (attributes) { 20277 editor.insertContent(Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["renderToString"])(save(attributes))); 20278 } 20279 20280 _this2.setState({ 20281 selected: null 20282 }); 20283 }; 20284 } 20285 }, { 20286 key: "onHover", 20287 value: function onHover(settings) { 20288 this.setState({ 20289 hovered: !!settings 20290 }); 20291 } 20292 }, { 20293 key: "onSelect", 20294 value: function onSelect(settings) { 20295 this.setState({ 20296 selected: settings 20297 }); 20298 } 20299 }, { 20300 key: "render", 20301 value: function render() { 20302 var _this$state = this.state, 20303 hovered = _this$state.hovered, 20304 selected = _this$state.selected; 20305 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["createElement"])(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["Fragment"], null, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["createElement"])(_inserter__WEBPACK_IMPORTED_MODULE_11__["InserterResultsPortal"], { 20306 title: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_9__["__"])('Inline Elements'), 20307 items: this.props.items, 20308 onSelect: this.onSelect, 20309 onHover: this.onHover, 20310 initialOpen: false 20311 }), hovered && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["createElement"])("div", { 20312 style: Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_0__["default"])({ 20313 position: 'absolute' 20314 }, this.getInsertPosition()), 20315 className: "blocks-inline-insertion-point" 20316 }), selected && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["createElement"])(selected.edit, { 20317 onSave: this.onSave(selected) 20318 })); 20319 } 20320 }]); 20321 20322 return TokenUI; 20323 }(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["Component"]); 20324 20325 /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_10__["withSelect"])(function (select) { 20326 var _select = select('core/editor'), 20327 getTokenSettings = _select.getTokenSettings; 20328 20329 return { 20330 items: Object.values(getTokenSettings()) 20331 }; 20332 })(TokenUI)); 20333 20334 20335 /***/ }), 20336 20337 /***/ "./node_modules/@wordpress/editor/build-module/components/server-side-render/index.js": 20338 /*!********************************************************************************************!*\ 20339 !*** ./node_modules/@wordpress/editor/build-module/components/server-side-render/index.js ***! 20340 \********************************************************************************************/ 20341 /*! exports provided: default */ 20342 /***/ (function(module, __webpack_exports__, __webpack_require__) { 20343 20344 "use strict"; 20345 __webpack_require__.r(__webpack_exports__); 20346 /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js"); 20347 /* harmony import */ var _babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectSpread */ "./node_modules/@babel/runtime/helpers/esm/objectSpread.js"); 20348 /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutProperties */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js"); 20349 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); 20350 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__); 20351 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); 20352 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_4__); 20353 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); 20354 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_5__); 20355 20356 20357 20358 20359 20360 /** 20361 * WordPress dependencies. 20362 */ 20363 20364 20365 /* harmony default export */ __webpack_exports__["default"] = (function (_ref) { 20366 var _ref$urlQueryArgs = _ref.urlQueryArgs, 20367 urlQueryArgs = _ref$urlQueryArgs === void 0 ? {} : _ref$urlQueryArgs, 20368 props = Object(_babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_2__["default"])(_ref, ["urlQueryArgs"]); 20369 20370 var _select = Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_5__["select"])('core/editor'), 20371 getCurrentPostId = _select.getCurrentPostId; 20372 20373 urlQueryArgs = Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_1__["default"])({ 20374 post_id: getCurrentPostId() 20375 }, urlQueryArgs); 20376 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_4__["ServerSideRender"], Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({ 20377 urlQueryArgs: urlQueryArgs 20378 }, props)); 20379 }); 20380 20381 20382 /***/ }), 20383 20384 /***/ "./node_modules/@wordpress/editor/build-module/components/skip-to-selected-block/index.js": 20385 /*!************************************************************************************************!*\ 20386 !*** ./node_modules/@wordpress/editor/build-module/components/skip-to-selected-block/index.js ***! 20387 \************************************************************************************************/ 20388 /*! exports provided: default */ 20389 /***/ (function(module, __webpack_exports__, __webpack_require__) { 20390 20391 "use strict"; 20392 __webpack_require__.r(__webpack_exports__); 20393 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); 20394 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); 20395 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); 20396 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_1__); 20397 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); 20398 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__); 20399 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); 20400 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__); 20401 /* harmony import */ var _utils_dom__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../utils/dom */ "./node_modules/@wordpress/editor/build-module/utils/dom.js"); 20402 20403 20404 /** 20405 * WordPress dependencies 20406 */ 20407 20408 20409 20410 /** 20411 * Internal Dependencies 20412 */ 20413 20414 20415 20416 var SkipToSelectedBlock = function SkipToSelectedBlock(_ref) { 20417 var selectedBlockClientId = _ref.selectedBlockClientId; 20418 20419 var onClick = function onClick() { 20420 var selectedBlockElement = Object(_utils_dom__WEBPACK_IMPORTED_MODULE_4__["getBlockFocusableWrapper"])(selectedBlockClientId); 20421 selectedBlockElement.focus(); 20422 }; 20423 20424 return selectedBlockClientId && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__["Button"], { 20425 isDefault: true, 20426 type: "button", 20427 className: "editor-skip-to-selected-block", 20428 onClick: onClick 20429 }, Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__["__"])('Skip to the selected block')); 20430 }; 20431 20432 /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_1__["withSelect"])(function (select) { 20433 return { 20434 selectedBlockClientId: select('core/editor').getBlockSelectionStart() 20435 }; 20436 })(SkipToSelectedBlock)); 20437 20438 20439 /***/ }), 20440 20441 /***/ "./node_modules/@wordpress/editor/build-module/components/table-of-contents/index.js": 20442 /*!*******************************************************************************************!*\ 20443 !*** ./node_modules/@wordpress/editor/build-module/components/table-of-contents/index.js ***! 20444 \*******************************************************************************************/ 20445 /*! exports provided: default */ 20446 /***/ (function(module, __webpack_exports__, __webpack_require__) { 20447 20448 "use strict"; 20449 __webpack_require__.r(__webpack_exports__); 20450 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); 20451 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); 20452 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); 20453 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__); 20454 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); 20455 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__); 20456 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); 20457 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_3__); 20458 /* harmony import */ var _panel__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./panel */ "./node_modules/@wordpress/editor/build-module/components/table-of-contents/panel.js"); 20459 20460 20461 /** 20462 * WordPress dependencies 20463 */ 20464 20465 20466 20467 /** 20468 * Internal dependencies 20469 */ 20470 20471 20472 20473 function TableOfContents(_ref) { 20474 var hasBlocks = _ref.hasBlocks; 20475 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__["Dropdown"], { 20476 position: "bottom", 20477 className: "table-of-contents", 20478 contentClassName: "table-of-contents__popover", 20479 renderToggle: function renderToggle(_ref2) { 20480 var isOpen = _ref2.isOpen, 20481 onToggle = _ref2.onToggle; 20482 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__["IconButton"], { 20483 onClick: onToggle, 20484 icon: "info-outline", 20485 "aria-expanded": isOpen, 20486 label: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__["__"])('Content structure'), 20487 disabled: !hasBlocks 20488 }); 20489 }, 20490 renderContent: function renderContent() { 20491 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_panel__WEBPACK_IMPORTED_MODULE_4__["default"], null); 20492 } 20493 }); 20494 } 20495 20496 /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_3__["withSelect"])(function (select) { 20497 return { 20498 hasBlocks: !!select('core/editor').getBlockCount() 20499 }; 20500 })(TableOfContents)); 20501 20502 20503 /***/ }), 20504 20505 /***/ "./node_modules/@wordpress/editor/build-module/components/table-of-contents/panel.js": 20506 /*!*******************************************************************************************!*\ 20507 !*** ./node_modules/@wordpress/editor/build-module/components/table-of-contents/panel.js ***! 20508 \*******************************************************************************************/ 20509 /*! exports provided: default */ 20510 /***/ (function(module, __webpack_exports__, __webpack_require__) { 20511 20512 "use strict"; 20513 __webpack_require__.r(__webpack_exports__); 20514 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); 20515 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); 20516 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); 20517 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__); 20518 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); 20519 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_2__); 20520 /* harmony import */ var _word_count__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../word-count */ "./node_modules/@wordpress/editor/build-module/components/word-count/index.js"); 20521 /* harmony import */ var _document_outline__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../document-outline */ "./node_modules/@wordpress/editor/build-module/components/document-outline/index.js"); 20522 20523 20524 /** 20525 * WordPress dependencies 20526 */ 20527 20528 20529 20530 /** 20531 * Internal dependencies 20532 */ 20533 20534 20535 20536 20537 function TableOfContentsPanel(_ref) { 20538 var headingCount = _ref.headingCount, 20539 paragraphCount = _ref.paragraphCount, 20540 numberOfBlocks = _ref.numberOfBlocks; 20541 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["Fragment"], null, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("div", { 20542 className: "table-of-contents__counts", 20543 role: "note", 20544 "aria-label": Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__["__"])('Document Statistics'), 20545 tabIndex: "0" 20546 }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("div", { 20547 className: "table-of-contents__count" 20548 }, Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__["__"])('Words'), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_word_count__WEBPACK_IMPORTED_MODULE_3__["default"], null)), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("div", { 20549 className: "table-of-contents__count" 20550 }, Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__["__"])('Headings'), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("span", { 20551 className: "table-of-contents__number" 20552 }, headingCount)), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("div", { 20553 className: "table-of-contents__count" 20554 }, Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__["__"])('Paragraphs'), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("span", { 20555 className: "table-of-contents__number" 20556 }, paragraphCount)), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("div", { 20557 className: "table-of-contents__count" 20558 }, Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__["__"])('Blocks'), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("span", { 20559 className: "table-of-contents__number" 20560 }, numberOfBlocks))), headingCount > 0 && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["Fragment"], null, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("hr", null), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("span", { 20561 className: "table-of-contents__title" 20562 }, Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__["__"])('Document Outline')), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_document_outline__WEBPACK_IMPORTED_MODULE_4__["default"], null))); 20563 } 20564 20565 /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_2__["withSelect"])(function (select) { 20566 var _select = select('core/editor'), 20567 getGlobalBlockCount = _select.getGlobalBlockCount; 20568 20569 return { 20570 headingCount: getGlobalBlockCount('core/heading'), 20571 paragraphCount: getGlobalBlockCount('core/paragraph'), 20572 numberOfBlocks: getGlobalBlockCount() 20573 }; 20574 })(TableOfContentsPanel)); 20575 20576 20577 /***/ }), 20578 20579 /***/ "./node_modules/@wordpress/editor/build-module/components/template-validation-notice/index.js": 20580 /*!****************************************************************************************************!*\ 20581 !*** ./node_modules/@wordpress/editor/build-module/components/template-validation-notice/index.js ***! 20582 \****************************************************************************************************/ 20583 /*! exports provided: default */ 20584 /***/ (function(module, __webpack_exports__, __webpack_require__) { 20585 20586 "use strict"; 20587 __webpack_require__.r(__webpack_exports__); 20588 /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutProperties */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js"); 20589 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); 20590 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__); 20591 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); 20592 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__); 20593 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); 20594 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__); 20595 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); 20596 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_4__); 20597 /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose"); 20598 /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_5__); 20599 20600 20601 20602 /** 20603 * WordPress dependencies 20604 */ 20605 20606 20607 20608 20609 20610 function TemplateValidationNotice(_ref) { 20611 var isValid = _ref.isValid, 20612 props = Object(_babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_0__["default"])(_ref, ["isValid"]); 20613 20614 if (isValid) { 20615 return null; 20616 } 20617 20618 var confirmSynchronization = function confirmSynchronization() { 20619 // eslint-disable-next-line no-alert 20620 if (window.confirm(Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__["__"])('Resetting the template may result in loss of content, do you want to continue?'))) { 20621 props.synchronizeTemplate(); 20622 } 20623 }; 20624 20625 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__["Notice"], { 20626 className: "editor-template-validation-notice", 20627 isDismissible: false, 20628 status: "warning" 20629 }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])("p", null, Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__["__"])('The content of your post doesn’t match the template assigned to your post type.')), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])("div", null, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__["Button"], { 20630 isDefault: true, 20631 onClick: props.resetTemplateValidity 20632 }, Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__["__"])('Keep it as is')), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__["Button"], { 20633 onClick: confirmSynchronization, 20634 isPrimary: true 20635 }, Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__["__"])('Reset the template')))); 20636 } 20637 20638 /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_5__["compose"])([Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_4__["withSelect"])(function (select) { 20639 return { 20640 isValid: select('core/editor').isValidTemplate() 20641 }; 20642 }), Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_4__["withDispatch"])(function (dispatch) { 20643 var _dispatch = dispatch('core/editor'), 20644 setTemplateValidity = _dispatch.setTemplateValidity, 20645 synchronizeTemplate = _dispatch.synchronizeTemplate; 20646 20647 return { 20648 resetTemplateValidity: function resetTemplateValidity() { 20649 return setTemplateValidity(true); 20650 }, 20651 synchronizeTemplate: synchronizeTemplate 20652 }; 20653 })])(TemplateValidationNotice)); 20654 20655 20656 /***/ }), 20657 20658 /***/ "./node_modules/@wordpress/editor/build-module/components/theme-support-check/index.js": 20659 /*!*********************************************************************************************!*\ 20660 !*** ./node_modules/@wordpress/editor/build-module/components/theme-support-check/index.js ***! 20661 \*********************************************************************************************/ 20662 /*! exports provided: ThemeSupportCheck, default */ 20663 /***/ (function(module, __webpack_exports__, __webpack_require__) { 20664 20665 "use strict"; 20666 __webpack_require__.r(__webpack_exports__); 20667 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ThemeSupportCheck", function() { return ThemeSupportCheck; }); 20668 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash */ "lodash"); 20669 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_0__); 20670 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); 20671 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_1__); 20672 /** 20673 * External dependencies 20674 */ 20675 20676 /** 20677 * WordPress dependencies 20678 */ 20679 20680 20681 function ThemeSupportCheck(_ref) { 20682 var themeSupports = _ref.themeSupports, 20683 children = _ref.children, 20684 postType = _ref.postType, 20685 supportKeys = _ref.supportKeys; 20686 var isSupported = Object(lodash__WEBPACK_IMPORTED_MODULE_0__["some"])(Object(lodash__WEBPACK_IMPORTED_MODULE_0__["castArray"])(supportKeys), function (key) { 20687 var supported = Object(lodash__WEBPACK_IMPORTED_MODULE_0__["get"])(themeSupports, [key], false); // 'post-thumbnails' can be boolean or an array of post types. 20688 // In the latter case, we need to verify `postType` exists 20689 // within `supported`. If `postType` isn't passed, then the check 20690 // should fail. 20691 20692 if ('post-thumbnails' === key && Object(lodash__WEBPACK_IMPORTED_MODULE_0__["isArray"])(supported)) { 20693 return Object(lodash__WEBPACK_IMPORTED_MODULE_0__["includes"])(supported, postType); 20694 } 20695 20696 return supported; 20697 }); 20698 20699 if (!isSupported) { 20700 return null; 20701 } 20702 20703 return children; 20704 } 20705 /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_1__["withSelect"])(function (select) { 20706 var _select = select('core'), 20707 getThemeSupports = _select.getThemeSupports; 20708 20709 var _select2 = select('core/editor'), 20710 getEditedPostAttribute = _select2.getEditedPostAttribute; 20711 20712 return { 20713 postType: getEditedPostAttribute('type'), 20714 themeSupports: getThemeSupports() 20715 }; 20716 })(ThemeSupportCheck)); 20717 20718 20719 /***/ }), 20720 20721 /***/ "./node_modules/@wordpress/editor/build-module/components/unsaved-changes-warning/index.js": 20722 /*!*************************************************************************************************!*\ 20723 !*** ./node_modules/@wordpress/editor/build-module/components/unsaved-changes-warning/index.js ***! 20724 \*************************************************************************************************/ 20725 /*! exports provided: default */ 20726 /***/ (function(module, __webpack_exports__, __webpack_require__) { 20727 20728 "use strict"; 20729 __webpack_require__.r(__webpack_exports__); 20730 /* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/classCallCheck */ "./node_modules/@babel/runtime/helpers/esm/classCallCheck.js"); 20731 /* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/createClass */ "./node_modules/@babel/runtime/helpers/esm/createClass.js"); 20732 /* harmony import */ var _babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js"); 20733 /* harmony import */ var _babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/esm/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js"); 20734 /* harmony import */ var _babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inherits */ "./node_modules/@babel/runtime/helpers/esm/inherits.js"); 20735 /* harmony import */ var _babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/helpers/esm/assertThisInitialized */ "./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js"); 20736 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! lodash */ "lodash"); 20737 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_6__); 20738 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); 20739 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_7__); 20740 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); 20741 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__); 20742 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); 20743 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_9__); 20744 /* harmony import */ var _wordpress_deprecated__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @wordpress/deprecated */ "@wordpress/deprecated"); 20745 /* harmony import */ var _wordpress_deprecated__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_wordpress_deprecated__WEBPACK_IMPORTED_MODULE_10__); 20746 20747 20748 20749 20750 20751 20752 20753 /** 20754 * External dependencies 20755 */ 20756 20757 /** 20758 * WordPress dependencies 20759 */ 20760 20761 20762 20763 20764 20765 20766 var UnsavedChangesWarning = 20767 /*#__PURE__*/ 20768 function (_Component) { 20769 Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__["default"])(UnsavedChangesWarning, _Component); 20770 20771 function UnsavedChangesWarning() { 20772 var _this; 20773 20774 Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__["default"])(this, UnsavedChangesWarning); 20775 20776 _this = Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__["default"])(this, Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__["default"])(UnsavedChangesWarning).apply(this, arguments)); 20777 _this.warnIfUnsavedChanges = _this.warnIfUnsavedChanges.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(_this))); 20778 return _this; 20779 } 20780 20781 Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__["default"])(UnsavedChangesWarning, [{ 20782 key: "componentDidMount", 20783 value: function componentDidMount() { 20784 window.addEventListener('beforeunload', this.warnIfUnsavedChanges); 20785 } 20786 }, { 20787 key: "componentWillUnmount", 20788 value: function componentWillUnmount() { 20789 window.removeEventListener('beforeunload', this.warnIfUnsavedChanges); 20790 } 20791 /** 20792 * Warns the user if there are unsaved changes before leaving the editor. 20793 * 20794 * @param {Event} event `beforeunload` event. 20795 * 20796 * @return {?string} Warning prompt message, if unsaved changes exist. 20797 */ 20798 20799 }, { 20800 key: "warnIfUnsavedChanges", 20801 value: function warnIfUnsavedChanges(event) { 20802 var _this$props = this.props, 20803 isDirty = _this$props.isDirty, 20804 _this$props$forceIsDi = _this$props.forceIsDirty, 20805 forceIsDirty = _this$props$forceIsDi === void 0 ? lodash__WEBPACK_IMPORTED_MODULE_6__["stubFalse"] : _this$props$forceIsDi; // For deprecation, infer explicitly provided if not assigned to 20806 // fallback value. 20807 20808 if (forceIsDirty !== lodash__WEBPACK_IMPORTED_MODULE_6__["stubFalse"]) { 20809 _wordpress_deprecated__WEBPACK_IMPORTED_MODULE_10___default()('UnsavedChangesWarning forceIsDirty prop', { 20810 plugin: 'Gutenberg', 20811 version: '4.2' 20812 }); 20813 } 20814 20815 if (isDirty || forceIsDirty()) { 20816 event.returnValue = Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_7__["__"])('You have unsaved changes. If you proceed, they will be lost.'); 20817 return event.returnValue; 20818 } 20819 } 20820 }, { 20821 key: "render", 20822 value: function render() { 20823 return null; 20824 } 20825 }]); 20826 20827 return UnsavedChangesWarning; 20828 }(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["Component"]); 20829 20830 /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_9__["withSelect"])(function (select) { 20831 return { 20832 isDirty: select('core/editor').isEditedPostDirty() 20833 }; 20834 })(UnsavedChangesWarning)); 20835 20836 20837 /***/ }), 20838 20839 /***/ "./node_modules/@wordpress/editor/build-module/components/url-input/button.js": 20840 /*!************************************************************************************!*\ 20841 !*** ./node_modules/@wordpress/editor/build-module/components/url-input/button.js ***! 20842 \************************************************************************************/ 20843 /*! exports provided: default */ 20844 /***/ (function(module, __webpack_exports__, __webpack_require__) { 20845 20846 "use strict"; 20847 __webpack_require__.r(__webpack_exports__); 20848 /* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/classCallCheck */ "./node_modules/@babel/runtime/helpers/esm/classCallCheck.js"); 20849 /* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/createClass */ "./node_modules/@babel/runtime/helpers/esm/createClass.js"); 20850 /* harmony import */ var _babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js"); 20851 /* harmony import */ var _babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/esm/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js"); 20852 /* harmony import */ var _babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inherits */ "./node_modules/@babel/runtime/helpers/esm/inherits.js"); 20853 /* harmony import */ var _babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/helpers/esm/assertThisInitialized */ "./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js"); 20854 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); 20855 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__); 20856 /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); 20857 /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_7__); 20858 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); 20859 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_8__); 20860 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); 20861 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_9__); 20862 /* harmony import */ var ___WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./ */ "./node_modules/@wordpress/editor/build-module/components/url-input/index.js"); 20863 20864 20865 20866 20867 20868 20869 20870 20871 /** 20872 * External dependencies 20873 */ 20874 20875 /** 20876 * WordPress dependencies 20877 */ 20878 20879 20880 20881 20882 /** 20883 * Internal dependencies 20884 */ 20885 20886 20887 20888 var URLInputButton = 20889 /*#__PURE__*/ 20890 function (_Component) { 20891 Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__["default"])(URLInputButton, _Component); 20892 20893 function URLInputButton() { 20894 var _this; 20895 20896 Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__["default"])(this, URLInputButton); 20897 20898 _this = Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__["default"])(this, Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__["default"])(URLInputButton).apply(this, arguments)); 20899 _this.toggle = _this.toggle.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(_this))); 20900 _this.submitLink = _this.submitLink.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(_this))); 20901 _this.state = { 20902 expanded: false 20903 }; 20904 return _this; 20905 } 20906 20907 Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__["default"])(URLInputButton, [{ 20908 key: "toggle", 20909 value: function toggle() { 20910 this.setState({ 20911 expanded: !this.state.expanded 20912 }); 20913 } 20914 }, { 20915 key: "submitLink", 20916 value: function submitLink(event) { 20917 event.preventDefault(); 20918 this.toggle(); 20919 } 20920 }, { 20921 key: "render", 20922 value: function render() { 20923 var _this$props = this.props, 20924 url = _this$props.url, 20925 onChange = _this$props.onChange; 20926 var expanded = this.state.expanded; 20927 var buttonLabel = url ? Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_8__["__"])('Edit Link') : Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_8__["__"])('Insert Link'); 20928 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("div", { 20929 className: "editor-url-input__button" 20930 }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_9__["IconButton"], { 20931 icon: "admin-links", 20932 label: buttonLabel, 20933 onClick: this.toggle, 20934 className: classnames__WEBPACK_IMPORTED_MODULE_7___default()('components-toolbar__control', { 20935 'is-active': url 20936 }) 20937 }), expanded && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("form", { 20938 className: "editor-url-input__button-modal", 20939 onSubmit: this.submitLink 20940 }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("div", { 20941 className: "editor-url-input__button-modal-line" 20942 }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_9__["IconButton"], { 20943 className: "editor-url-input__back", 20944 icon: "arrow-left-alt", 20945 label: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_8__["__"])('Close'), 20946 onClick: this.toggle 20947 }), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(___WEBPACK_IMPORTED_MODULE_10__["default"], { 20948 value: url || '', 20949 onChange: onChange 20950 }), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_9__["IconButton"], { 20951 icon: "editor-break", 20952 label: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_8__["__"])('Submit'), 20953 type: "submit" 20954 })))); 20955 } 20956 }]); 20957 20958 return URLInputButton; 20959 }(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["Component"]); 20960 20961 /* harmony default export */ __webpack_exports__["default"] = (URLInputButton); 20962 20963 20964 /***/ }), 20965 20966 /***/ "./node_modules/@wordpress/editor/build-module/components/url-input/index.js": 20967 /*!***********************************************************************************!*\ 20968 !*** ./node_modules/@wordpress/editor/build-module/components/url-input/index.js ***! 20969 \***********************************************************************************/ 20970 /*! exports provided: default */ 20971 /***/ (function(module, __webpack_exports__, __webpack_require__) { 20972 20973 "use strict"; 20974 __webpack_require__.r(__webpack_exports__); 20975 /* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/classCallCheck */ "./node_modules/@babel/runtime/helpers/esm/classCallCheck.js"); 20976 /* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/createClass */ "./node_modules/@babel/runtime/helpers/esm/createClass.js"); 20977 /* harmony import */ var _babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js"); 20978 /* harmony import */ var _babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/esm/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js"); 20979 /* harmony import */ var _babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inherits */ "./node_modules/@babel/runtime/helpers/esm/inherits.js"); 20980 /* harmony import */ var _babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/helpers/esm/assertThisInitialized */ "./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js"); 20981 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); 20982 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__); 20983 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! lodash */ "lodash"); 20984 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_7__); 20985 /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); 20986 /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_8__); 20987 /* harmony import */ var dom_scroll_into_view__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! dom-scroll-into-view */ "./node_modules/dom-scroll-into-view/lib/index.js"); 20988 /* harmony import */ var dom_scroll_into_view__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(dom_scroll_into_view__WEBPACK_IMPORTED_MODULE_9__); 20989 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); 20990 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_10__); 20991 /* harmony import */ var _wordpress_html_entities__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @wordpress/html-entities */ "@wordpress/html-entities"); 20992 /* harmony import */ var _wordpress_html_entities__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(_wordpress_html_entities__WEBPACK_IMPORTED_MODULE_11__); 20993 /* harmony import */ var _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @wordpress/keycodes */ "@wordpress/keycodes"); 20994 /* harmony import */ var _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(_wordpress_keycodes__WEBPACK_IMPORTED_MODULE_12__); 20995 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); 20996 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_13__); 20997 /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose"); 20998 /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_14___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_14__); 20999 /* harmony import */ var _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! @wordpress/api-fetch */ "@wordpress/api-fetch"); 21000 /* harmony import */ var _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_15___default = /*#__PURE__*/__webpack_require__.n(_wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_15__); 21001 /* harmony import */ var _wordpress_url__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! @wordpress/url */ "@wordpress/url"); 21002 /* harmony import */ var _wordpress_url__WEBPACK_IMPORTED_MODULE_16___default = /*#__PURE__*/__webpack_require__.n(_wordpress_url__WEBPACK_IMPORTED_MODULE_16__); 21003 21004 21005 21006 21007 21008 21009 21010 21011 /** 21012 * External dependencies 21013 */ 21014 21015 21016 21017 /** 21018 * WordPress dependencies 21019 */ 21020 21021 21022 21023 21024 21025 21026 21027 21028 // Since URLInput is rendered in the context of other inputs, but should be 21029 // considered a separate modal node, prevent keyboard events from propagating 21030 // as being considered from the input. 21031 21032 var stopEventPropagation = function stopEventPropagation(event) { 21033 return event.stopPropagation(); 21034 }; 21035 21036 var URLInput = 21037 /*#__PURE__*/ 21038 function (_Component) { 21039 Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__["default"])(URLInput, _Component); 21040 21041 function URLInput() { 21042 var _this; 21043 21044 Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__["default"])(this, URLInput); 21045 21046 _this = Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__["default"])(this, Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__["default"])(URLInput).apply(this, arguments)); 21047 _this.onChange = _this.onChange.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(_this))); 21048 _this.onKeyDown = _this.onKeyDown.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(_this))); 21049 _this.bindListNode = _this.bindListNode.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(_this))); 21050 _this.updateSuggestions = Object(lodash__WEBPACK_IMPORTED_MODULE_7__["throttle"])(_this.updateSuggestions.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(_this))), 200); 21051 _this.suggestionNodes = []; 21052 _this.state = { 21053 posts: [], 21054 showSuggestions: false, 21055 selectedSuggestion: null 21056 }; 21057 return _this; 21058 } 21059 21060 Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__["default"])(URLInput, [{ 21061 key: "componentDidUpdate", 21062 value: function componentDidUpdate() { 21063 var _this2 = this; 21064 21065 var _this$state = this.state, 21066 showSuggestions = _this$state.showSuggestions, 21067 selectedSuggestion = _this$state.selectedSuggestion; // only have to worry about scrolling selected suggestion into view 21068 // when already expanded 21069 21070 if (showSuggestions && selectedSuggestion !== null && !this.scrollingIntoView) { 21071 this.scrollingIntoView = true; 21072 dom_scroll_into_view__WEBPACK_IMPORTED_MODULE_9___default()(this.suggestionNodes[selectedSuggestion], this.listNode, { 21073 onlyScrollIfNeeded: true 21074 }); 21075 setTimeout(function () { 21076 _this2.scrollingIntoView = false; 21077 }, 100); 21078 } 21079 } 21080 }, { 21081 key: "componentWillUnmount", 21082 value: function componentWillUnmount() { 21083 delete this.suggestionsRequest; 21084 } 21085 }, { 21086 key: "bindListNode", 21087 value: function bindListNode(ref) { 21088 this.listNode = ref; 21089 } 21090 }, { 21091 key: "bindSuggestionNode", 21092 value: function bindSuggestionNode(index) { 21093 var _this3 = this; 21094 21095 return function (ref) { 21096 _this3.suggestionNodes[index] = ref; 21097 }; 21098 } 21099 }, { 21100 key: "updateSuggestions", 21101 value: function updateSuggestions(value) { 21102 var _this4 = this; 21103 21104 // Show the suggestions after typing at least 2 characters 21105 // and also for URLs 21106 if (value.length < 2 || /^https?:/.test(value)) { 21107 this.setState({ 21108 showSuggestions: false, 21109 selectedSuggestion: null, 21110 loading: false 21111 }); 21112 return; 21113 } 21114 21115 this.setState({ 21116 showSuggestions: true, 21117 selectedSuggestion: null, 21118 loading: true 21119 }); 21120 var request = _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_15___default()({ 21121 path: Object(_wordpress_url__WEBPACK_IMPORTED_MODULE_16__["addQueryArgs"])('/gutenberg/v1/search', { 21122 search: value, 21123 per_page: 20, 21124 type: 'post' 21125 }) 21126 }); 21127 request.then(function (posts) { 21128 // A fetch Promise doesn't have an abort option. It's mimicked by 21129 // comparing the request reference in on the instance, which is 21130 // reset or deleted on subsequent requests or unmounting. 21131 if (_this4.suggestionsRequest !== request) { 21132 return; 21133 } 21134 21135 _this4.setState({ 21136 posts: posts, 21137 loading: false 21138 }); 21139 21140 if (!!posts.length) { 21141 _this4.props.debouncedSpeak(Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_10__["sprintf"])(Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_10__["_n"])('%d result found, use up and down arrow keys to navigate.', '%d results found, use up and down arrow keys to navigate.', posts.length), posts.length), 'assertive'); 21142 } else { 21143 _this4.props.debouncedSpeak(Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_10__["__"])('No results.'), 'assertive'); 21144 } 21145 }).catch(function () { 21146 if (_this4.suggestionsRequest === request) { 21147 _this4.setState({ 21148 loading: false 21149 }); 21150 } 21151 }); 21152 this.suggestionsRequest = request; 21153 } 21154 }, { 21155 key: "onChange", 21156 value: function onChange(event) { 21157 var inputValue = event.target.value; 21158 this.props.onChange(inputValue); 21159 this.updateSuggestions(inputValue); 21160 } 21161 }, { 21162 key: "onKeyDown", 21163 value: function onKeyDown(event) { 21164 var _this$state2 = this.state, 21165 showSuggestions = _this$state2.showSuggestions, 21166 selectedSuggestion = _this$state2.selectedSuggestion, 21167 posts = _this$state2.posts, 21168 loading = _this$state2.loading; // If the suggestions are not shown or loading, we shouldn't handle the arrow keys 21169 // We shouldn't preventDefault to allow block arrow keys navigation 21170 21171 if (!showSuggestions || !posts.length || loading) { 21172 return; 21173 } 21174 21175 switch (event.keyCode) { 21176 case _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_12__["UP"]: 21177 { 21178 event.stopPropagation(); 21179 event.preventDefault(); 21180 var previousIndex = !selectedSuggestion ? posts.length - 1 : selectedSuggestion - 1; 21181 this.setState({ 21182 selectedSuggestion: previousIndex 21183 }); 21184 break; 21185 } 21186 21187 case _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_12__["DOWN"]: 21188 { 21189 event.stopPropagation(); 21190 event.preventDefault(); 21191 var nextIndex = selectedSuggestion === null || selectedSuggestion === posts.length - 1 ? 0 : selectedSuggestion + 1; 21192 this.setState({ 21193 selectedSuggestion: nextIndex 21194 }); 21195 break; 21196 } 21197 21198 case _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_12__["ENTER"]: 21199 { 21200 if (this.state.selectedSuggestion !== null) { 21201 event.stopPropagation(); 21202 var post = this.state.posts[this.state.selectedSuggestion]; 21203 this.selectLink(post); 21204 } 21205 } 21206 } 21207 } 21208 }, { 21209 key: "selectLink", 21210 value: function selectLink(post) { 21211 this.props.onChange(post.url, post); 21212 this.setState({ 21213 selectedSuggestion: null, 21214 showSuggestions: false 21215 }); 21216 } 21217 }, { 21218 key: "render", 21219 value: function render() { 21220 var _this5 = this; 21221 21222 var _this$props = this.props, 21223 _this$props$value = _this$props.value, 21224 value = _this$props$value === void 0 ? '' : _this$props$value, 21225 _this$props$autoFocus = _this$props.autoFocus, 21226 autoFocus = _this$props$autoFocus === void 0 ? true : _this$props$autoFocus, 21227 instanceId = _this$props.instanceId; 21228 var _this$state3 = this.state, 21229 showSuggestions = _this$state3.showSuggestions, 21230 posts = _this$state3.posts, 21231 selectedSuggestion = _this$state3.selectedSuggestion, 21232 loading = _this$state3.loading; 21233 /* eslint-disable jsx-a11y/no-autofocus */ 21234 21235 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["Fragment"], null, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("div", { 21236 className: "editor-url-input" 21237 }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("input", { 21238 autoFocus: autoFocus, 21239 type: "text", 21240 "aria-label": Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_10__["__"])('URL'), 21241 required: true, 21242 value: value, 21243 onChange: this.onChange, 21244 onInput: stopEventPropagation, 21245 placeholder: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_10__["__"])('Paste URL or type to search'), 21246 onKeyDown: this.onKeyDown, 21247 role: "combobox", 21248 "aria-expanded": showSuggestions, 21249 "aria-autocomplete": "list", 21250 "aria-owns": "editor-url-input-suggestions-".concat(instanceId), 21251 "aria-activedescendant": selectedSuggestion !== null ? "editor-url-input-suggestion-".concat(instanceId, "-").concat(selectedSuggestion) : undefined 21252 }), loading && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_13__["Spinner"], null)), showSuggestions && !!posts.length && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_13__["Popover"], { 21253 position: "bottom", 21254 noArrow: true, 21255 focusOnMount: false 21256 }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("div", { 21257 className: "editor-url-input__suggestions", 21258 id: "editor-url-input-suggestions-".concat(instanceId), 21259 ref: this.bindListNode, 21260 role: "listbox" 21261 }, posts.map(function (post, index) { 21262 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("button", { 21263 key: post.id, 21264 role: "option", 21265 tabIndex: "-1", 21266 id: "editor-url-input-suggestion-".concat(instanceId, "-").concat(index), 21267 ref: _this5.bindSuggestionNode(index), 21268 className: classnames__WEBPACK_IMPORTED_MODULE_8___default()('editor-url-input__suggestion', { 21269 'is-selected': index === selectedSuggestion 21270 }), 21271 onClick: function onClick() { 21272 return _this5.selectLink(post); 21273 }, 21274 "aria-selected": index === selectedSuggestion 21275 }, Object(_wordpress_html_entities__WEBPACK_IMPORTED_MODULE_11__["decodeEntities"])(post.title) || Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_10__["__"])('(no title)')); 21276 })))); 21277 /* eslint-enable jsx-a11y/no-autofocus */ 21278 } 21279 }]); 21280 21281 return URLInput; 21282 }(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["Component"]); 21283 21284 /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_components__WEBPACK_IMPORTED_MODULE_13__["withSpokenMessages"])(Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_14__["withInstanceId"])(URLInput))); 21285 21286 21287 /***/ }), 21288 21289 /***/ "./node_modules/@wordpress/editor/build-module/components/warning/index.js": 21290 /*!*********************************************************************************!*\ 21291 !*** ./node_modules/@wordpress/editor/build-module/components/warning/index.js ***! 21292 \*********************************************************************************/ 21293 /*! exports provided: default */ 21294 /***/ (function(module, __webpack_exports__, __webpack_require__) { 21295 21296 "use strict"; 21297 __webpack_require__.r(__webpack_exports__); 21298 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); 21299 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); 21300 /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); 21301 /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_1__); 21302 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); 21303 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__); 21304 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); 21305 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__); 21306 21307 21308 /** 21309 * External dependencies 21310 */ 21311 21312 /** 21313 * WordPress dependencies 21314 */ 21315 21316 21317 21318 21319 21320 function Warning(_ref) { 21321 var className = _ref.className, 21322 actions = _ref.actions, 21323 children = _ref.children, 21324 secondaryActions = _ref.secondaryActions; 21325 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("div", { 21326 className: classnames__WEBPACK_IMPORTED_MODULE_1___default()(className, 'editor-warning') 21327 }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("div", { 21328 className: "editor-warning__contents" 21329 }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("p", { 21330 className: "editor-warning__message" 21331 }, children), _wordpress_element__WEBPACK_IMPORTED_MODULE_0__["Children"].count(actions) > 0 && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("div", { 21332 className: "editor-warning__actions" 21333 }, _wordpress_element__WEBPACK_IMPORTED_MODULE_0__["Children"].map(actions, function (action, i) { 21334 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("span", { 21335 key: i, 21336 className: "editor-warning__action" 21337 }, action); 21338 }))), secondaryActions && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__["Dropdown"], { 21339 className: "editor-warning__secondary", 21340 position: "bottom left", 21341 renderToggle: function renderToggle(_ref2) { 21342 var isOpen = _ref2.isOpen, 21343 onToggle = _ref2.onToggle; 21344 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__["IconButton"], { 21345 icon: "ellipsis", 21346 label: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__["__"])('More options'), 21347 onClick: onToggle, 21348 "aria-expanded": isOpen 21349 }); 21350 }, 21351 renderContent: function renderContent() { 21352 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__["MenuGroup"], { 21353 label: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__["__"])('More options') 21354 }, secondaryActions.map(function (item, pos) { 21355 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__["MenuItem"], { 21356 onClick: item.onClick, 21357 key: pos 21358 }, item.title); 21359 })); 21360 } 21361 })); 21362 } 21363 21364 /* harmony default export */ __webpack_exports__["default"] = (Warning); 21365 21366 21367 /***/ }), 21368 21369 /***/ "./node_modules/@wordpress/editor/build-module/components/word-count/index.js": 21370 /*!************************************************************************************!*\ 21371 !*** ./node_modules/@wordpress/editor/build-module/components/word-count/index.js ***! 21372 \************************************************************************************/ 21373 /*! exports provided: default */ 21374 /***/ (function(module, __webpack_exports__, __webpack_require__) { 21375 21376 "use strict"; 21377 __webpack_require__.r(__webpack_exports__); 21378 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); 21379 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); 21380 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); 21381 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_1__); 21382 /* harmony import */ var _wordpress_wordcount__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/wordcount */ "@wordpress/wordcount"); 21383 /* harmony import */ var _wordpress_wordcount__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_wordcount__WEBPACK_IMPORTED_MODULE_2__); 21384 21385 21386 /** 21387 * WordPress dependencies 21388 */ 21389 21390 21391 21392 function WordCount(_ref) { 21393 var content = _ref.content; 21394 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("span", { 21395 className: "word-count" 21396 }, Object(_wordpress_wordcount__WEBPACK_IMPORTED_MODULE_2__["count"])(content, 'words')); 21397 } 21398 21399 /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_1__["withSelect"])(function (select) { 21400 return { 21401 content: select('core/editor').getEditedPostAttribute('content') 21402 }; 21403 })(WordCount)); 21404 21405 21406 /***/ }), 21407 21408 /***/ "./node_modules/@wordpress/editor/build-module/components/writing-flow/index.js": 21409 /*!**************************************************************************************!*\ 21410 !*** ./node_modules/@wordpress/editor/build-module/components/writing-flow/index.js ***! 21411 \**************************************************************************************/ 21412 /*! exports provided: default */ 21413 /***/ (function(module, __webpack_exports__, __webpack_require__) { 21414 21415 "use strict"; 21416 __webpack_require__.r(__webpack_exports__); 21417 /* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/classCallCheck */ "./node_modules/@babel/runtime/helpers/esm/classCallCheck.js"); 21418 /* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/createClass */ "./node_modules/@babel/runtime/helpers/esm/createClass.js"); 21419 /* harmony import */ var _babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js"); 21420 /* harmony import */ var _babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/esm/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js"); 21421 /* harmony import */ var _babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inherits */ "./node_modules/@babel/runtime/helpers/esm/inherits.js"); 21422 /* harmony import */ var _babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/helpers/esm/assertThisInitialized */ "./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js"); 21423 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); 21424 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__); 21425 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! lodash */ "lodash"); 21426 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_7__); 21427 /* harmony import */ var _wordpress_dom__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @wordpress/dom */ "@wordpress/dom"); 21428 /* harmony import */ var _wordpress_dom__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_wordpress_dom__WEBPACK_IMPORTED_MODULE_8__); 21429 /* harmony import */ var _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @wordpress/keycodes */ "@wordpress/keycodes"); 21430 /* harmony import */ var _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_wordpress_keycodes__WEBPACK_IMPORTED_MODULE_9__); 21431 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); 21432 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_10__); 21433 /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose"); 21434 /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_11__); 21435 /* harmony import */ var _utils_dom__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../../utils/dom */ "./node_modules/@wordpress/editor/build-module/utils/dom.js"); 21436 21437 21438 21439 21440 21441 21442 21443 21444 /** 21445 * External dependencies 21446 */ 21447 21448 /** 21449 * WordPress dependencies 21450 */ 21451 21452 21453 21454 21455 21456 21457 /** 21458 * Internal dependencies 21459 */ 21460 21461 21462 /** 21463 * Browser constants 21464 */ 21465 21466 var _window = window, 21467 getSelection = _window.getSelection; 21468 /** 21469 * Given an element, returns true if the element is a tabbable text field, or 21470 * false otherwise. 21471 * 21472 * @param {Element} element Element to test. 21473 * 21474 * @return {boolean} Whether element is a tabbable text field. 21475 */ 21476 21477 var isTabbableTextField = Object(lodash__WEBPACK_IMPORTED_MODULE_7__["overEvery"])([_wordpress_dom__WEBPACK_IMPORTED_MODULE_8__["isTextField"], _wordpress_dom__WEBPACK_IMPORTED_MODULE_8__["focus"].tabbable.isTabbableIndex]); 21478 21479 var WritingFlow = 21480 /*#__PURE__*/ 21481 function (_Component) { 21482 Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__["default"])(WritingFlow, _Component); 21483 21484 function WritingFlow() { 21485 var _this; 21486 21487 Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__["default"])(this, WritingFlow); 21488 21489 _this = Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__["default"])(this, Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__["default"])(WritingFlow).apply(this, arguments)); 21490 _this.onKeyDown = _this.onKeyDown.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(_this))); 21491 _this.bindContainer = _this.bindContainer.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(_this))); 21492 _this.clearVerticalRect = _this.clearVerticalRect.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(_this))); 21493 _this.focusLastTextField = _this.focusLastTextField.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(_this))); 21494 /** 21495 * Here a rectangle is stored while moving the caret vertically so 21496 * vertical position of the start position can be restored. 21497 * This is to recreate browser behaviour across blocks. 21498 * 21499 * @type {?DOMRect} 21500 */ 21501 21502 _this.verticalRect = null; 21503 return _this; 21504 } 21505 21506 Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__["default"])(WritingFlow, [{ 21507 key: "bindContainer", 21508 value: function bindContainer(ref) { 21509 this.container = ref; 21510 } 21511 }, { 21512 key: "clearVerticalRect", 21513 value: function clearVerticalRect() { 21514 this.verticalRect = null; 21515 } 21516 /** 21517 * Returns the optimal tab target from the given focused element in the 21518 * desired direction. A preference is made toward text fields, falling back 21519 * to the block focus stop if no other candidates exist for the block. 21520 * 21521 * @param {Element} target Currently focused text field. 21522 * @param {boolean} isReverse True if considering as the first field. 21523 * 21524 * @return {?Element} Optimal tab target, if one exists. 21525 */ 21526 21527 }, { 21528 key: "getClosestTabbable", 21529 value: function getClosestTabbable(target, isReverse) { 21530 // Since the current focus target is not guaranteed to be a text field, 21531 // find all focusables. Tabbability is considered later. 21532 var focusableNodes = _wordpress_dom__WEBPACK_IMPORTED_MODULE_8__["focus"].focusable.find(this.container); 21533 21534 if (isReverse) { 21535 focusableNodes = Object(lodash__WEBPACK_IMPORTED_MODULE_7__["reverse"])(focusableNodes); 21536 } // Consider as candidates those focusables after the current target. 21537 // It's assumed this can only be reached if the target is focusable 21538 // (on its keydown event), so no need to verify it exists in the set. 21539 21540 21541 focusableNodes = focusableNodes.slice(focusableNodes.indexOf(target) + 1); 21542 21543 function isTabCandidate(node, i, array) { 21544 // Not a candidate if the node is not tabbable. 21545 if (!_wordpress_dom__WEBPACK_IMPORTED_MODULE_8__["focus"].tabbable.isTabbableIndex(node)) { 21546 return false; 21547 } // Prefer text fields... 21548 21549 21550 if (Object(_wordpress_dom__WEBPACK_IMPORTED_MODULE_8__["isTextField"])(node)) { 21551 return true; 21552 } // ...but settle for block focus stop. 21553 21554 21555 if (!Object(_utils_dom__WEBPACK_IMPORTED_MODULE_12__["isBlockFocusStop"])(node)) { 21556 return false; 21557 } // If element contains inner blocks, stop immediately at its focus 21558 // wrapper. 21559 21560 21561 if (Object(_utils_dom__WEBPACK_IMPORTED_MODULE_12__["hasInnerBlocksContext"])(node)) { 21562 return true; 21563 } // If navigating out of a block (in reverse), don't consider its 21564 // block focus stop. 21565 21566 21567 if (node.contains(target)) { 21568 return false; 21569 } // In case of block focus stop, check to see if there's a better 21570 // text field candidate within. 21571 21572 21573 for (var offset = 1, nextNode; nextNode = array[i + offset]; offset++) { 21574 // Abort if no longer testing descendents of focus stop. 21575 if (!node.contains(nextNode)) { 21576 break; 21577 } // Apply same tests by recursion. This is important to consider 21578 // nestable blocks where we don't want to settle for the inner 21579 // block focus stop. 21580 21581 21582 if (isTabCandidate(nextNode, i + offset, array)) { 21583 return false; 21584 } 21585 } 21586 21587 return true; 21588 } 21589 21590 return Object(lodash__WEBPACK_IMPORTED_MODULE_7__["find"])(focusableNodes, isTabCandidate); 21591 } 21592 }, { 21593 key: "expandSelection", 21594 value: function expandSelection(isReverse) { 21595 var _this$props = this.props, 21596 selectedBlockClientId = _this$props.selectedBlockClientId, 21597 selectionStartClientId = _this$props.selectionStartClientId, 21598 selectionBeforeEndClientId = _this$props.selectionBeforeEndClientId, 21599 selectionAfterEndClientId = _this$props.selectionAfterEndClientId; 21600 var nextSelectionEndClientId = isReverse ? selectionBeforeEndClientId : selectionAfterEndClientId; 21601 21602 if (nextSelectionEndClientId) { 21603 this.props.onMultiSelect(selectionStartClientId || selectedBlockClientId, nextSelectionEndClientId); 21604 } 21605 } 21606 }, { 21607 key: "moveSelection", 21608 value: function moveSelection(isReverse) { 21609 var _this$props2 = this.props, 21610 selectedFirstClientId = _this$props2.selectedFirstClientId, 21611 selectedLastClientId = _this$props2.selectedLastClientId; 21612 var focusedBlockClientId = isReverse ? selectedFirstClientId : selectedLastClientId; 21613 21614 if (focusedBlockClientId) { 21615 this.props.onSelectBlock(focusedBlockClientId); 21616 } 21617 } 21618 /** 21619 * Returns true if the given target field is the last in its block which 21620 * can be considered for tab transition. For example, in a block with two 21621 * text fields, this would return true when reversing from the first of the 21622 * two fields, but false when reversing from the second. 21623 * 21624 * @param {Element} target Currently focused text field. 21625 * @param {boolean} isReverse True if considering as the first field. 21626 * 21627 * @return {boolean} Whether field is at edge for tab transition. 21628 */ 21629 21630 }, { 21631 key: "isTabbableEdge", 21632 value: function isTabbableEdge(target, isReverse) { 21633 var closestTabbable = this.getClosestTabbable(target, isReverse); 21634 return !closestTabbable || !Object(_utils_dom__WEBPACK_IMPORTED_MODULE_12__["isInSameBlock"])(target, closestTabbable); 21635 } 21636 }, { 21637 key: "onKeyDown", 21638 value: function onKeyDown(event) { 21639 var _this$props3 = this.props, 21640 hasMultiSelection = _this$props3.hasMultiSelection, 21641 onMultiSelect = _this$props3.onMultiSelect, 21642 blocks = _this$props3.blocks; 21643 var keyCode = event.keyCode, 21644 target = event.target; 21645 var isUp = keyCode === _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_9__["UP"]; 21646 var isDown = keyCode === _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_9__["DOWN"]; 21647 var isLeft = keyCode === _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_9__["LEFT"]; 21648 var isRight = keyCode === _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_9__["RIGHT"]; 21649 var isReverse = isUp || isLeft; 21650 var isHorizontal = isLeft || isRight; 21651 var isVertical = isUp || isDown; 21652 var isNav = isHorizontal || isVertical; 21653 var isShift = event.shiftKey; 21654 var isNavEdge = isVertical ? _wordpress_dom__WEBPACK_IMPORTED_MODULE_8__["isVerticalEdge"] : _wordpress_dom__WEBPACK_IMPORTED_MODULE_8__["isHorizontalEdge"]; // This logic inside this condition needs to be checked before 21655 // the check for event.nativeEvent.defaultPrevented. 21656 // The logic handles meta+a keypress and this event is default prevented by TinyMCE. 21657 21658 if (!isNav) { 21659 // Set immediately before the meta+a combination can be pressed. 21660 if (_wordpress_keycodes__WEBPACK_IMPORTED_MODULE_9__["isKeyboardEvent"].primary(event)) { 21661 this.isEntirelySelected = Object(_wordpress_dom__WEBPACK_IMPORTED_MODULE_8__["isEntirelySelected"])(target); 21662 } 21663 21664 if (_wordpress_keycodes__WEBPACK_IMPORTED_MODULE_9__["isKeyboardEvent"].primary(event, 'a')) { 21665 // When the target is contentEditable, selection will already 21666 // have been set by TinyMCE earlier in this call stack. We need 21667 // check the previous result, otherwise all blocks will be 21668 // selected right away. 21669 if (target.isContentEditable ? this.isEntirelySelected : Object(_wordpress_dom__WEBPACK_IMPORTED_MODULE_8__["isEntirelySelected"])(target)) { 21670 onMultiSelect(Object(lodash__WEBPACK_IMPORTED_MODULE_7__["first"])(blocks), Object(lodash__WEBPACK_IMPORTED_MODULE_7__["last"])(blocks)); 21671 event.preventDefault(); 21672 } // Set in case the meta key doesn't get released. 21673 21674 21675 this.isEntirelySelected = Object(_wordpress_dom__WEBPACK_IMPORTED_MODULE_8__["isEntirelySelected"])(target); 21676 } 21677 21678 return; 21679 } // Abort if navigation has already been handled (e.g. TinyMCE inline 21680 // boundaries). 21681 21682 21683 if (event.nativeEvent.defaultPrevented) { 21684 return; 21685 } 21686 21687 if (!isVertical) { 21688 this.verticalRect = null; 21689 } else if (!this.verticalRect) { 21690 this.verticalRect = Object(_wordpress_dom__WEBPACK_IMPORTED_MODULE_8__["computeCaretRect"])(target); 21691 } 21692 21693 if (isShift && (hasMultiSelection || this.isTabbableEdge(target, isReverse) && isNavEdge(target, isReverse))) { 21694 // Shift key is down, and there is multi selection or we're at the end of the current block. 21695 this.expandSelection(isReverse); 21696 event.preventDefault(); 21697 } else if (hasMultiSelection) { 21698 // Moving from block multi-selection to single block selection 21699 this.moveSelection(isReverse); 21700 event.preventDefault(); 21701 } else if (isVertical && Object(_wordpress_dom__WEBPACK_IMPORTED_MODULE_8__["isVerticalEdge"])(target, isReverse)) { 21702 var closestTabbable = this.getClosestTabbable(target, isReverse); 21703 21704 if (closestTabbable) { 21705 Object(_wordpress_dom__WEBPACK_IMPORTED_MODULE_8__["placeCaretAtVerticalEdge"])(closestTabbable, isReverse, this.verticalRect); 21706 event.preventDefault(); 21707 } 21708 } else if (isHorizontal && getSelection().isCollapsed && Object(_wordpress_dom__WEBPACK_IMPORTED_MODULE_8__["isHorizontalEdge"])(target, isReverse)) { 21709 var _closestTabbable = this.getClosestTabbable(target, isReverse); 21710 21711 Object(_wordpress_dom__WEBPACK_IMPORTED_MODULE_8__["placeCaretAtHorizontalEdge"])(_closestTabbable, isReverse); 21712 event.preventDefault(); 21713 } 21714 } 21715 /** 21716 * Sets focus to the end of the last tabbable text field, if one exists. 21717 */ 21718 21719 }, { 21720 key: "focusLastTextField", 21721 value: function focusLastTextField() { 21722 var focusableNodes = _wordpress_dom__WEBPACK_IMPORTED_MODULE_8__["focus"].focusable.find(this.container); 21723 var target = Object(lodash__WEBPACK_IMPORTED_MODULE_7__["findLast"])(focusableNodes, isTabbableTextField); 21724 21725 if (target) { 21726 Object(_wordpress_dom__WEBPACK_IMPORTED_MODULE_8__["placeCaretAtHorizontalEdge"])(target, true); 21727 } 21728 } 21729 }, { 21730 key: "render", 21731 value: function render() { 21732 var children = this.props.children; // Disable reason: Wrapper itself is non-interactive, but must capture 21733 // bubbling events from children to determine focus transition intents. 21734 21735 /* eslint-disable jsx-a11y/no-static-element-interactions */ 21736 21737 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("div", { 21738 className: "editor-writing-flow" 21739 }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("div", { 21740 ref: this.bindContainer, 21741 onKeyDown: this.onKeyDown, 21742 onMouseDown: this.clearVerticalRect 21743 }, children), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("div", { 21744 "aria-hidden": true, 21745 tabIndex: -1, 21746 onClick: this.focusLastTextField, 21747 className: "editor-writing-flow__click-redirect" 21748 })); 21749 /* eslint-disable jsx-a11y/no-static-element-interactions */ 21750 } 21751 }]); 21752 21753 return WritingFlow; 21754 }(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["Component"]); 21755 21756 /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_11__["compose"])([Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_10__["withSelect"])(function (select) { 21757 var _select = select('core/editor'), 21758 getSelectedBlockClientId = _select.getSelectedBlockClientId, 21759 getMultiSelectedBlocksStartClientId = _select.getMultiSelectedBlocksStartClientId, 21760 getMultiSelectedBlocksEndClientId = _select.getMultiSelectedBlocksEndClientId, 21761 getPreviousBlockClientId = _select.getPreviousBlockClientId, 21762 getNextBlockClientId = _select.getNextBlockClientId, 21763 getFirstMultiSelectedBlockClientId = _select.getFirstMultiSelectedBlockClientId, 21764 getLastMultiSelectedBlockClientId = _select.getLastMultiSelectedBlockClientId, 21765 hasMultiSelection = _select.hasMultiSelection, 21766 getBlockOrder = _select.getBlockOrder; 21767 21768 var selectedBlockClientId = getSelectedBlockClientId(); 21769 var selectionStartClientId = getMultiSelectedBlocksStartClientId(); 21770 var selectionEndClientId = getMultiSelectedBlocksEndClientId(); 21771 return { 21772 selectedBlockClientId: selectedBlockClientId, 21773 selectionStartClientId: selectionStartClientId, 21774 selectionBeforeEndClientId: getPreviousBlockClientId(selectionEndClientId || selectedBlockClientId), 21775 selectionAfterEndClientId: getNextBlockClientId(selectionEndClientId || selectedBlockClientId), 21776 selectedFirstClientId: getFirstMultiSelectedBlockClientId(), 21777 selectedLastClientId: getLastMultiSelectedBlockClientId(), 21778 hasMultiSelection: hasMultiSelection(), 21779 blocks: getBlockOrder() 21780 }; 21781 }), Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_10__["withDispatch"])(function (dispatch) { 21782 var _dispatch = dispatch('core/editor'), 21783 multiSelect = _dispatch.multiSelect, 21784 selectBlock = _dispatch.selectBlock; 21785 21786 return { 21787 onMultiSelect: multiSelect, 21788 onSelectBlock: selectBlock 21789 }; 21790 })])(WritingFlow)); 21791 21792 21793 /***/ }), 21794 21795 /***/ "./node_modules/@wordpress/editor/build-module/editor-styles/ast/index.js": 21796 /*!********************************************************************************!*\ 21797 !*** ./node_modules/@wordpress/editor/build-module/editor-styles/ast/index.js ***! 21798 \********************************************************************************/ 21799 /*! exports provided: parse, stringify */ 21800 /***/ (function(module, __webpack_exports__, __webpack_require__) { 21801 21802 "use strict"; 21803 __webpack_require__.r(__webpack_exports__); 21804 /* harmony import */ var _parse__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./parse */ "./node_modules/@wordpress/editor/build-module/editor-styles/ast/parse.js"); 21805 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "parse", function() { return _parse__WEBPACK_IMPORTED_MODULE_0__["default"]; }); 21806 21807 /* harmony import */ var _stringify__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./stringify */ "./node_modules/@wordpress/editor/build-module/editor-styles/ast/stringify/index.js"); 21808 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "stringify", function() { return _stringify__WEBPACK_IMPORTED_MODULE_1__["default"]; }); 21809 21810 // Adapted from https://github.com/reworkcss/css 21811 // because we needed to remove source map support. 21812 21813 21814 21815 21816 /***/ }), 21817 21818 /***/ "./node_modules/@wordpress/editor/build-module/editor-styles/ast/parse.js": 21819 /*!********************************************************************************!*\ 21820 !*** ./node_modules/@wordpress/editor/build-module/editor-styles/ast/parse.js ***! 21821 \********************************************************************************/ 21822 /*! exports provided: default */ 21823 /***/ (function(module, __webpack_exports__, __webpack_require__) { 21824 21825 "use strict"; 21826 __webpack_require__.r(__webpack_exports__); 21827 /* harmony import */ var _babel_runtime_helpers_esm_typeof__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/typeof */ "./node_modules/@babel/runtime/helpers/esm/typeof.js"); 21828 21829 // Adapted from https://github.com/reworkcss/css 21830 // because we needed to remove source map support. 21831 // http://www.w3.org/TR/CSS21/grammar.htm 21832 // https://github.com/visionmedia/css-parse/pull/49#issuecomment-30088027 21833 var commentre = /\/\*[^*]*\*+([^/*][^*]*\*+)*\//g; 21834 /* harmony default export */ __webpack_exports__["default"] = (function (css, options) { 21835 options = options || {}; 21836 /** 21837 * Positional. 21838 */ 21839 21840 var lineno = 1; 21841 var column = 1; 21842 /** 21843 * Update lineno and column based on `str`. 21844 */ 21845 21846 function updatePosition(str) { 21847 var lines = str.match(/\n/g); 21848 21849 if (lines) { 21850 lineno += lines.length; 21851 } 21852 21853 var i = str.lastIndexOf('\n'); // eslint-disable-next-line no-bitwise 21854 21855 column = ~i ? str.length - i : column + str.length; 21856 } 21857 /** 21858 * Mark position and patch `node.position`. 21859 */ 21860 21861 21862 function position() { 21863 var start = { 21864 line: lineno, 21865 column: column 21866 }; 21867 return function (node) { 21868 node.position = new Position(start); 21869 whitespace(); 21870 return node; 21871 }; 21872 } 21873 /** 21874 * Store position information for a node 21875 */ 21876 21877 21878 function Position(start) { 21879 this.start = start; 21880 this.end = { 21881 line: lineno, 21882 column: column 21883 }; 21884 this.source = options.source; 21885 } 21886 /** 21887 * Non-enumerable source string 21888 */ 21889 21890 21891 Position.prototype.content = css; 21892 /** 21893 * Error `msg`. 21894 */ 21895 21896 var errorsList = []; 21897 21898 function error(msg) { 21899 var err = new Error(options.source + ':' + lineno + ':' + column + ': ' + msg); 21900 err.reason = msg; 21901 err.filename = options.source; 21902 err.line = lineno; 21903 err.column = column; 21904 err.source = css; 21905 21906 if (options.silent) { 21907 errorsList.push(err); 21908 } else { 21909 throw err; 21910 } 21911 } 21912 /** 21913 * Parse stylesheet. 21914 */ 21915 21916 21917 function stylesheet() { 21918 var rulesList = rules(); 21919 return { 21920 type: 'stylesheet', 21921 stylesheet: { 21922 source: options.source, 21923 rules: rulesList, 21924 parsingErrors: errorsList 21925 } 21926 }; 21927 } 21928 /** 21929 * Opening brace. 21930 */ 21931 21932 21933 function open() { 21934 return match(/^{\s*/); 21935 } 21936 /** 21937 * Closing brace. 21938 */ 21939 21940 21941 function close() { 21942 return match(/^}/); 21943 } 21944 /** 21945 * Parse ruleset. 21946 */ 21947 21948 21949 function rules() { 21950 var node; 21951 var accumulator = []; 21952 whitespace(); 21953 comments(accumulator); 21954 21955 while (css.length && css.charAt(0) !== '}' && (node = atrule() || rule())) { 21956 if (node !== false) { 21957 accumulator.push(node); 21958 comments(accumulator); 21959 } 21960 } 21961 21962 return accumulator; 21963 } 21964 /** 21965 * Match `re` and return captures. 21966 */ 21967 21968 21969 function match(re) { 21970 var m = re.exec(css); 21971 21972 if (!m) { 21973 return; 21974 } 21975 21976 var str = m[0]; 21977 updatePosition(str); 21978 css = css.slice(str.length); 21979 return m; 21980 } 21981 /** 21982 * Parse whitespace. 21983 */ 21984 21985 21986 function whitespace() { 21987 match(/^\s*/); 21988 } 21989 /** 21990 * Parse comments; 21991 */ 21992 21993 21994 function comments(accumulator) { 21995 var c; 21996 accumulator = accumulator || []; // eslint-disable-next-line no-cond-assign 21997 21998 while (c = comment()) { 21999 if (c !== false) { 22000 accumulator.push(c); 22001 } 22002 } 22003 22004 return accumulator; 22005 } 22006 /** 22007 * Parse comment. 22008 */ 22009 22010 22011 function comment() { 22012 var pos = position(); 22013 22014 if ('/' !== css.charAt(0) || '*' !== css.charAt(1)) { 22015 return; 22016 } 22017 22018 var i = 2; 22019 22020 while ('' !== css.charAt(i) && ('*' !== css.charAt(i) || '/' !== css.charAt(i + 1))) { 22021 ++i; 22022 } 22023 22024 i += 2; 22025 22026 if ('' === css.charAt(i - 1)) { 22027 return error('End of comment missing'); 22028 } 22029 22030 var str = css.slice(2, i - 2); 22031 column += 2; 22032 updatePosition(str); 22033 css = css.slice(i); 22034 column += 2; 22035 return pos({ 22036 type: 'comment', 22037 comment: str 22038 }); 22039 } 22040 /** 22041 * Parse selector. 22042 */ 22043 22044 22045 function selector() { 22046 var m = match(/^([^{]+)/); 22047 22048 if (!m) { 22049 return; 22050 } 22051 /* @fix Remove all comments from selectors 22052 * http://ostermiller.org/findcomment.html */ 22053 22054 22055 return trim(m[0]).replace(/\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*\/+/g, '').replace(/"(?:\\"|[^"])*"|'(?:\\'|[^'])*'/g, function (matched) { 22056 return matched.replace(/,/g, "\u200C"); 22057 }).split(/\s*(?![^(]*\)),\s*/).map(function (s) { 22058 return s.replace(/\u200C/g, ','); 22059 }); 22060 } 22061 /** 22062 * Parse declaration. 22063 */ 22064 22065 22066 function declaration() { 22067 var pos = position(); // prop 22068 22069 var prop = match(/^(\*?[-#\/\*\\\w]+(\[[0-9a-z_-]+\])?)\s*/); 22070 22071 if (!prop) { 22072 return; 22073 } 22074 22075 prop = trim(prop[0]); // : 22076 22077 if (!match(/^:\s*/)) { 22078 return error("property missing ':'"); 22079 } // val 22080 22081 22082 var val = match(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^\)]*?\)|[^};])+)/); 22083 var ret = pos({ 22084 type: 'declaration', 22085 property: prop.replace(commentre, ''), 22086 value: val ? trim(val[0]).replace(commentre, '') : '' 22087 }); // ; 22088 22089 match(/^[;\s]*/); 22090 return ret; 22091 } 22092 /** 22093 * Parse declarations. 22094 */ 22095 22096 22097 function declarations() { 22098 var decls = []; 22099 22100 if (!open()) { 22101 return error("missing '{'"); 22102 } 22103 22104 comments(decls); // declarations 22105 22106 var decl; // eslint-disable-next-line no-cond-assign 22107 22108 while (decl = declaration()) { 22109 if (decl !== false) { 22110 decls.push(decl); 22111 comments(decls); 22112 } 22113 } 22114 22115 if (!close()) { 22116 return error("missing '}'"); 22117 } 22118 22119 return decls; 22120 } 22121 /** 22122 * Parse keyframe. 22123 */ 22124 22125 22126 function keyframe() { 22127 var m; 22128 var vals = []; 22129 var pos = position(); // eslint-disable-next-line no-cond-assign 22130 22131 while (m = match(/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/)) { 22132 vals.push(m[1]); 22133 match(/^,\s*/); 22134 } 22135 22136 if (!vals.length) { 22137 return; 22138 } 22139 22140 return pos({ 22141 type: 'keyframe', 22142 values: vals, 22143 declarations: declarations() 22144 }); 22145 } 22146 /** 22147 * Parse keyframes. 22148 */ 22149 22150 22151 function atkeyframes() { 22152 var pos = position(); 22153 var m = match(/^@([-\w]+)?keyframes\s*/); 22154 22155 if (!m) { 22156 return; 22157 } 22158 22159 var vendor = m[1]; // identifier 22160 22161 m = match(/^([-\w]+)\s*/); 22162 22163 if (!m) { 22164 return error('@keyframes missing name'); 22165 } 22166 22167 var name = m[1]; 22168 22169 if (!open()) { 22170 return error("@keyframes missing '{'"); 22171 } 22172 22173 var frame; 22174 var frames = comments(); // eslint-disable-next-line no-cond-assign 22175 22176 while (frame = keyframe()) { 22177 frames.push(frame); 22178 frames = frames.concat(comments()); 22179 } 22180 22181 if (!close()) { 22182 return error("@keyframes missing '}'"); 22183 } 22184 22185 return pos({ 22186 type: 'keyframes', 22187 name: name, 22188 vendor: vendor, 22189 keyframes: frames 22190 }); 22191 } 22192 /** 22193 * Parse supports. 22194 */ 22195 22196 22197 function atsupports() { 22198 var pos = position(); 22199 var m = match(/^@supports *([^{]+)/); 22200 22201 if (!m) { 22202 return; 22203 } 22204 22205 var supports = trim(m[1]); 22206 22207 if (!open()) { 22208 return error("@supports missing '{'"); 22209 } 22210 22211 var style = comments().concat(rules()); 22212 22213 if (!close()) { 22214 return error("@supports missing '}'"); 22215 } 22216 22217 return pos({ 22218 type: 'supports', 22219 supports: supports, 22220 rules: style 22221 }); 22222 } 22223 /** 22224 * Parse host. 22225 */ 22226 22227 22228 function athost() { 22229 var pos = position(); 22230 var m = match(/^@host\s*/); 22231 22232 if (!m) { 22233 return; 22234 } 22235 22236 if (!open()) { 22237 return error("@host missing '{'"); 22238 } 22239 22240 var style = comments().concat(rules()); 22241 22242 if (!close()) { 22243 return error("@host missing '}'"); 22244 } 22245 22246 return pos({ 22247 type: 'host', 22248 rules: style 22249 }); 22250 } 22251 /** 22252 * Parse media. 22253 */ 22254 22255 22256 function atmedia() { 22257 var pos = position(); 22258 var m = match(/^@media *([^{]+)/); 22259 22260 if (!m) { 22261 return; 22262 } 22263 22264 var media = trim(m[1]); 22265 22266 if (!open()) { 22267 return error("@media missing '{'"); 22268 } 22269 22270 var style = comments().concat(rules()); 22271 22272 if (!close()) { 22273 return error("@media missing '}'"); 22274 } 22275 22276 return pos({ 22277 type: 'media', 22278 media: media, 22279 rules: style 22280 }); 22281 } 22282 /** 22283 * Parse custom-media. 22284 */ 22285 22286 22287 function atcustommedia() { 22288 var pos = position(); 22289 var m = match(/^@custom-media\s+(--[^\s]+)\s*([^{;]+);/); 22290 22291 if (!m) { 22292 return; 22293 } 22294 22295 return pos({ 22296 type: 'custom-media', 22297 name: trim(m[1]), 22298 media: trim(m[2]) 22299 }); 22300 } 22301 /** 22302 * Parse paged media. 22303 */ 22304 22305 22306 function atpage() { 22307 var pos = position(); 22308 var m = match(/^@page */); 22309 22310 if (!m) { 22311 return; 22312 } 22313 22314 var sel = selector() || []; 22315 22316 if (!open()) { 22317 return error("@page missing '{'"); 22318 } 22319 22320 var decls = comments(); // declarations 22321 22322 var decl; // eslint-disable-next-line no-cond-assign 22323 22324 while (decl = declaration()) { 22325 decls.push(decl); 22326 decls = decls.concat(comments()); 22327 } 22328 22329 if (!close()) { 22330 return error("@page missing '}'"); 22331 } 22332 22333 return pos({ 22334 type: 'page', 22335 selectors: sel, 22336 declarations: decls 22337 }); 22338 } 22339 /** 22340 * Parse document. 22341 */ 22342 22343 22344 function atdocument() { 22345 var pos = position(); 22346 var m = match(/^@([-\w]+)?document *([^{]+)/); 22347 22348 if (!m) { 22349 return; 22350 } 22351 22352 var vendor = trim(m[1]); 22353 var doc = trim(m[2]); 22354 22355 if (!open()) { 22356 return error("@document missing '{'"); 22357 } 22358 22359 var style = comments().concat(rules()); 22360 22361 if (!close()) { 22362 return error("@document missing '}'"); 22363 } 22364 22365 return pos({ 22366 type: 'document', 22367 document: doc, 22368 vendor: vendor, 22369 rules: style 22370 }); 22371 } 22372 /** 22373 * Parse font-face. 22374 */ 22375 22376 22377 function atfontface() { 22378 var pos = position(); 22379 var m = match(/^@font-face\s*/); 22380 22381 if (!m) { 22382 return; 22383 } 22384 22385 if (!open()) { 22386 return error("@font-face missing '{'"); 22387 } 22388 22389 var decls = comments(); // declarations 22390 22391 var decl; // eslint-disable-next-line no-cond-assign 22392 22393 while (decl = declaration()) { 22394 decls.push(decl); 22395 decls = decls.concat(comments()); 22396 } 22397 22398 if (!close()) { 22399 return error("@font-face missing '}'"); 22400 } 22401 22402 return pos({ 22403 type: 'font-face', 22404 declarations: decls 22405 }); 22406 } 22407 /** 22408 * Parse import 22409 */ 22410 22411 22412 var atimport = _compileAtrule('import'); 22413 /** 22414 * Parse charset 22415 */ 22416 22417 22418 var atcharset = _compileAtrule('charset'); 22419 /** 22420 * Parse namespace 22421 */ 22422 22423 22424 var atnamespace = _compileAtrule('namespace'); 22425 /** 22426 * Parse non-block at-rules 22427 */ 22428 22429 22430 function _compileAtrule(name) { 22431 var re = new RegExp('^@' + name + '\\s*([^;]+);'); 22432 return function () { 22433 var pos = position(); 22434 var m = match(re); 22435 22436 if (!m) { 22437 return; 22438 } 22439 22440 var ret = { 22441 type: name 22442 }; 22443 ret[name] = m[1].trim(); 22444 return pos(ret); 22445 }; 22446 } 22447 /** 22448 * Parse at rule. 22449 */ 22450 22451 22452 function atrule() { 22453 if (css[0] !== '@') { 22454 return; 22455 } 22456 22457 return atkeyframes() || atmedia() || atcustommedia() || atsupports() || atimport() || atcharset() || atnamespace() || atdocument() || atpage() || athost() || atfontface(); 22458 } 22459 /** 22460 * Parse rule. 22461 */ 22462 22463 22464 function rule() { 22465 var pos = position(); 22466 var sel = selector(); 22467 22468 if (!sel) { 22469 return error('selector missing'); 22470 } 22471 22472 comments(); 22473 return pos({ 22474 type: 'rule', 22475 selectors: sel, 22476 declarations: declarations() 22477 }); 22478 } 22479 22480 return addParent(stylesheet()); 22481 }); 22482 /** 22483 * Trim `str`. 22484 */ 22485 22486 function trim(str) { 22487 return str ? str.replace(/^\s+|\s+$/g, '') : ''; 22488 } 22489 /** 22490 * Adds non-enumerable parent node reference to each node. 22491 */ 22492 22493 22494 function addParent(obj, parent) { 22495 var isNode = obj && typeof obj.type === 'string'; 22496 var childParent = isNode ? obj : parent; 22497 22498 for (var k in obj) { 22499 var value = obj[k]; 22500 22501 if (Array.isArray(value)) { 22502 value.forEach(function (v) { 22503 addParent(v, childParent); 22504 }); 22505 } else if (value && Object(_babel_runtime_helpers_esm_typeof__WEBPACK_IMPORTED_MODULE_0__["default"])(value) === 'object') { 22506 addParent(value, childParent); 22507 } 22508 } 22509 22510 if (isNode) { 22511 Object.defineProperty(obj, 'parent', { 22512 configurable: true, 22513 writable: true, 22514 enumerable: false, 22515 value: parent || null 22516 }); 22517 } 22518 22519 return obj; 22520 } 22521 22522 22523 /***/ }), 22524 22525 /***/ "./node_modules/@wordpress/editor/build-module/editor-styles/ast/stringify/compiler.js": 22526 /*!*********************************************************************************************!*\ 22527 !*** ./node_modules/@wordpress/editor/build-module/editor-styles/ast/stringify/compiler.js ***! 22528 \*********************************************************************************************/ 22529 /*! exports provided: default */ 22530 /***/ (function(module, __webpack_exports__, __webpack_require__) { 22531 22532 "use strict"; 22533 __webpack_require__.r(__webpack_exports__); 22534 // Adapted from https://github.com/reworkcss/css 22535 // because we needed to remove source map support. 22536 22537 /** 22538 * Expose `Compiler`. 22539 */ 22540 /* harmony default export */ __webpack_exports__["default"] = (Compiler); 22541 /** 22542 * Initialize a compiler. 22543 * 22544 * @param {Type} name 22545 * @return {Type} 22546 * @api public 22547 */ 22548 22549 function Compiler(opts) { 22550 this.options = opts || {}; 22551 } 22552 /** 22553 * Emit `str` 22554 */ 22555 22556 22557 Compiler.prototype.emit = function (str) { 22558 return str; 22559 }; 22560 /** 22561 * Visit `node`. 22562 */ 22563 22564 22565 Compiler.prototype.visit = function (node) { 22566 return this[node.type](node); 22567 }; 22568 /** 22569 * Map visit over array of `nodes`, optionally using a `delim` 22570 */ 22571 22572 22573 Compiler.prototype.mapVisit = function (nodes, delim) { 22574 var buf = ''; 22575 delim = delim || ''; 22576 22577 for (var i = 0, length = nodes.length; i < length; i++) { 22578 buf += this.visit(nodes[i]); 22579 22580 if (delim && i < length - 1) { 22581 buf += this.emit(delim); 22582 } 22583 } 22584 22585 return buf; 22586 }; 22587 22588 22589 /***/ }), 22590 22591 /***/ "./node_modules/@wordpress/editor/build-module/editor-styles/ast/stringify/compress.js": 22592 /*!*********************************************************************************************!*\ 22593 !*** ./node_modules/@wordpress/editor/build-module/editor-styles/ast/stringify/compress.js ***! 22594 \*********************************************************************************************/ 22595 /*! exports provided: default */ 22596 /***/ (function(module, __webpack_exports__, __webpack_require__) { 22597 22598 "use strict"; 22599 __webpack_require__.r(__webpack_exports__); 22600 /* harmony import */ var inherits__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! inherits */ "./node_modules/inherits/inherits_browser.js"); 22601 /* harmony import */ var inherits__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(inherits__WEBPACK_IMPORTED_MODULE_0__); 22602 /* harmony import */ var _compiler__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./compiler */ "./node_modules/@wordpress/editor/build-module/editor-styles/ast/stringify/compiler.js"); 22603 // Adapted from https://github.com/reworkcss/css 22604 // because we needed to remove source map support. 22605 22606 /** 22607 * External dependencies 22608 */ 22609 22610 /** 22611 * Internal dependencies 22612 */ 22613 22614 22615 /** 22616 * Expose compiler. 22617 */ 22618 22619 /* harmony default export */ __webpack_exports__["default"] = (Compiler); 22620 /** 22621 * Initialize a new `Compiler`. 22622 */ 22623 22624 function Compiler(options) { 22625 _compiler__WEBPACK_IMPORTED_MODULE_1__["default"].call(this, options); 22626 } 22627 /** 22628 * Inherit from `Base.prototype`. 22629 */ 22630 22631 22632 inherits__WEBPACK_IMPORTED_MODULE_0___default()(Compiler, _compiler__WEBPACK_IMPORTED_MODULE_1__["default"]); 22633 /** 22634 * Compile `node`. 22635 */ 22636 22637 Compiler.prototype.compile = function (node) { 22638 return node.stylesheet.rules.map(this.visit, this).join(''); 22639 }; 22640 /** 22641 * Visit comment node. 22642 */ 22643 22644 22645 Compiler.prototype.comment = function (node) { 22646 return this.emit('', node.position); 22647 }; 22648 /** 22649 * Visit import node. 22650 */ 22651 22652 22653 Compiler.prototype.import = function (node) { 22654 return this.emit('@import ' + node.import + ';', node.position); 22655 }; 22656 /** 22657 * Visit media node. 22658 */ 22659 22660 22661 Compiler.prototype.media = function (node) { 22662 return this.emit('@media ' + node.media, node.position) + this.emit('{') + this.mapVisit(node.rules) + this.emit('}'); 22663 }; 22664 /** 22665 * Visit document node. 22666 */ 22667 22668 22669 Compiler.prototype.document = function (node) { 22670 var doc = '@' + (node.vendor || '') + 'document ' + node.document; 22671 return this.emit(doc, node.position) + this.emit('{') + this.mapVisit(node.rules) + this.emit('}'); 22672 }; 22673 /** 22674 * Visit charset node. 22675 */ 22676 22677 22678 Compiler.prototype.charset = function (node) { 22679 return this.emit('@charset ' + node.charset + ';', node.position); 22680 }; 22681 /** 22682 * Visit namespace node. 22683 */ 22684 22685 22686 Compiler.prototype.namespace = function (node) { 22687 return this.emit('@namespace ' + node.namespace + ';', node.position); 22688 }; 22689 /** 22690 * Visit supports node. 22691 */ 22692 22693 22694 Compiler.prototype.supports = function (node) { 22695 return this.emit('@supports ' + node.supports, node.position) + this.emit('{') + this.mapVisit(node.rules) + this.emit('}'); 22696 }; 22697 /** 22698 * Visit keyframes node. 22699 */ 22700 22701 22702 Compiler.prototype.keyframes = function (node) { 22703 return this.emit('@' + (node.vendor || '') + 'keyframes ' + node.name, node.position) + this.emit('{') + this.mapVisit(node.keyframes) + this.emit('}'); 22704 }; 22705 /** 22706 * Visit keyframe node. 22707 */ 22708 22709 22710 Compiler.prototype.keyframe = function (node) { 22711 var decls = node.declarations; 22712 return this.emit(node.values.join(','), node.position) + this.emit('{') + this.mapVisit(decls) + this.emit('}'); 22713 }; 22714 /** 22715 * Visit page node. 22716 */ 22717 22718 22719 Compiler.prototype.page = function (node) { 22720 var sel = node.selectors.length ? node.selectors.join(', ') : ''; 22721 return this.emit('@page ' + sel, node.position) + this.emit('{') + this.mapVisit(node.declarations) + this.emit('}'); 22722 }; 22723 /** 22724 * Visit font-face node. 22725 */ 22726 22727 22728 Compiler.prototype['font-face'] = function (node) { 22729 return this.emit('@font-face', node.position) + this.emit('{') + this.mapVisit(node.declarations) + this.emit('}'); 22730 }; 22731 /** 22732 * Visit host node. 22733 */ 22734 22735 22736 Compiler.prototype.host = function (node) { 22737 return this.emit('@host', node.position) + this.emit('{') + this.mapVisit(node.rules) + this.emit('}'); 22738 }; 22739 /** 22740 * Visit custom-media node. 22741 */ 22742 22743 22744 Compiler.prototype['custom-media'] = function (node) { 22745 return this.emit('@custom-media ' + node.name + ' ' + node.media + ';', node.position); 22746 }; 22747 /** 22748 * Visit rule node. 22749 */ 22750 22751 22752 Compiler.prototype.rule = function (node) { 22753 var decls = node.declarations; 22754 22755 if (!decls.length) { 22756 return ''; 22757 } 22758 22759 return this.emit(node.selectors.join(','), node.position) + this.emit('{') + this.mapVisit(decls) + this.emit('}'); 22760 }; 22761 /** 22762 * Visit declaration node. 22763 */ 22764 22765 22766 Compiler.prototype.declaration = function (node) { 22767 return this.emit(node.property + ':' + node.value, node.position) + this.emit(';'); 22768 }; 22769 22770 22771 /***/ }), 22772 22773 /***/ "./node_modules/@wordpress/editor/build-module/editor-styles/ast/stringify/identity.js": 22774 /*!*********************************************************************************************!*\ 22775 !*** ./node_modules/@wordpress/editor/build-module/editor-styles/ast/stringify/identity.js ***! 22776 \*********************************************************************************************/ 22777 /*! exports provided: default */ 22778 /***/ (function(module, __webpack_exports__, __webpack_require__) { 22779 22780 "use strict"; 22781 __webpack_require__.r(__webpack_exports__); 22782 /* harmony import */ var inherits__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! inherits */ "./node_modules/inherits/inherits_browser.js"); 22783 /* harmony import */ var inherits__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(inherits__WEBPACK_IMPORTED_MODULE_0__); 22784 /* harmony import */ var _compiler__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./compiler */ "./node_modules/@wordpress/editor/build-module/editor-styles/ast/stringify/compiler.js"); 22785 // Adapted from https://github.com/reworkcss/css 22786 // because we needed to remove source map support. 22787 22788 /** 22789 * External dependencies 22790 */ 22791 22792 /** 22793 * Internal dependencies 22794 */ 22795 22796 22797 /** 22798 * Expose compiler. 22799 */ 22800 22801 /* harmony default export */ __webpack_exports__["default"] = (Compiler); 22802 /** 22803 * Initialize a new `Compiler`. 22804 */ 22805 22806 function Compiler(options) { 22807 options = options || {}; 22808 _compiler__WEBPACK_IMPORTED_MODULE_1__["default"].call(this, options); 22809 this.indentation = options.indent; 22810 } 22811 /** 22812 * Inherit from `Base.prototype`. 22813 */ 22814 22815 22816 inherits__WEBPACK_IMPORTED_MODULE_0___default()(Compiler, _compiler__WEBPACK_IMPORTED_MODULE_1__["default"]); 22817 /** 22818 * Compile `node`. 22819 */ 22820 22821 Compiler.prototype.compile = function (node) { 22822 return this.stylesheet(node); 22823 }; 22824 /** 22825 * Visit stylesheet node. 22826 */ 22827 22828 22829 Compiler.prototype.stylesheet = function (node) { 22830 return this.mapVisit(node.stylesheet.rules, '\n\n'); 22831 }; 22832 /** 22833 * Visit comment node. 22834 */ 22835 22836 22837 Compiler.prototype.comment = function (node) { 22838 return this.emit(this.indent() + '/*' + node.comment + '*/', node.position); 22839 }; 22840 /** 22841 * Visit import node. 22842 */ 22843 22844 22845 Compiler.prototype.import = function (node) { 22846 return this.emit('@import ' + node.import + ';', node.position); 22847 }; 22848 /** 22849 * Visit media node. 22850 */ 22851 22852 22853 Compiler.prototype.media = function (node) { 22854 return this.emit('@media ' + node.media, node.position) + this.emit(' {\n' + this.indent(1)) + this.mapVisit(node.rules, '\n\n') + this.emit(this.indent(-1) + '\n}'); 22855 }; 22856 /** 22857 * Visit document node. 22858 */ 22859 22860 22861 Compiler.prototype.document = function (node) { 22862 var doc = '@' + (node.vendor || '') + 'document ' + node.document; 22863 return this.emit(doc, node.position) + this.emit(' ' + ' {\n' + this.indent(1)) + this.mapVisit(node.rules, '\n\n') + this.emit(this.indent(-1) + '\n}'); 22864 }; 22865 /** 22866 * Visit charset node. 22867 */ 22868 22869 22870 Compiler.prototype.charset = function (node) { 22871 return this.emit('@charset ' + node.charset + ';', node.position); 22872 }; 22873 /** 22874 * Visit namespace node. 22875 */ 22876 22877 22878 Compiler.prototype.namespace = function (node) { 22879 return this.emit('@namespace ' + node.namespace + ';', node.position); 22880 }; 22881 /** 22882 * Visit supports node. 22883 */ 22884 22885 22886 Compiler.prototype.supports = function (node) { 22887 return this.emit('@supports ' + node.supports, node.position) + this.emit(' {\n' + this.indent(1)) + this.mapVisit(node.rules, '\n\n') + this.emit(this.indent(-1) + '\n}'); 22888 }; 22889 /** 22890 * Visit keyframes node. 22891 */ 22892 22893 22894 Compiler.prototype.keyframes = function (node) { 22895 return this.emit('@' + (node.vendor || '') + 'keyframes ' + node.name, node.position) + this.emit(' {\n' + this.indent(1)) + this.mapVisit(node.keyframes, '\n') + this.emit(this.indent(-1) + '}'); 22896 }; 22897 /** 22898 * Visit keyframe node. 22899 */ 22900 22901 22902 Compiler.prototype.keyframe = function (node) { 22903 var decls = node.declarations; 22904 return this.emit(this.indent()) + this.emit(node.values.join(', '), node.position) + this.emit(' {\n' + this.indent(1)) + this.mapVisit(decls, '\n') + this.emit(this.indent(-1) + '\n' + this.indent() + '}\n'); 22905 }; 22906 /** 22907 * Visit page node. 22908 */ 22909 22910 22911 Compiler.prototype.page = function (node) { 22912 var sel = node.selectors.length ? node.selectors.join(', ') + ' ' : ''; 22913 return this.emit('@page ' + sel, node.position) + this.emit('{\n') + this.emit(this.indent(1)) + this.mapVisit(node.declarations, '\n') + this.emit(this.indent(-1)) + this.emit('\n}'); 22914 }; 22915 /** 22916 * Visit font-face node. 22917 */ 22918 22919 22920 Compiler.prototype['font-face'] = function (node) { 22921 return this.emit('@font-face ', node.position) + this.emit('{\n') + this.emit(this.indent(1)) + this.mapVisit(node.declarations, '\n') + this.emit(this.indent(-1)) + this.emit('\n}'); 22922 }; 22923 /** 22924 * Visit host node. 22925 */ 22926 22927 22928 Compiler.prototype.host = function (node) { 22929 return this.emit('@host', node.position) + this.emit(' {\n' + this.indent(1)) + this.mapVisit(node.rules, '\n\n') + this.emit(this.indent(-1) + '\n}'); 22930 }; 22931 /** 22932 * Visit custom-media node. 22933 */ 22934 22935 22936 Compiler.prototype['custom-media'] = function (node) { 22937 return this.emit('@custom-media ' + node.name + ' ' + node.media + ';', node.position); 22938 }; 22939 /** 22940 * Visit rule node. 22941 */ 22942 22943 22944 Compiler.prototype.rule = function (node) { 22945 var indent = this.indent(); 22946 var decls = node.declarations; 22947 22948 if (!decls.length) { 22949 return ''; 22950 } 22951 22952 return this.emit(node.selectors.map(function (s) { 22953 return indent + s; 22954 }).join(',\n'), node.position) + this.emit(' {\n') + this.emit(this.indent(1)) + this.mapVisit(decls, '\n') + this.emit(this.indent(-1)) + this.emit('\n' + this.indent() + '}'); 22955 }; 22956 /** 22957 * Visit declaration node. 22958 */ 22959 22960 22961 Compiler.prototype.declaration = function (node) { 22962 return this.emit(this.indent()) + this.emit(node.property + ': ' + node.value, node.position) + this.emit(';'); 22963 }; 22964 /** 22965 * Increase, decrease or return current indentation. 22966 */ 22967 22968 22969 Compiler.prototype.indent = function (level) { 22970 this.level = this.level || 1; 22971 22972 if (null !== level) { 22973 this.level += level; 22974 return ''; 22975 } 22976 22977 return Array(this.level).join(this.indentation || ' '); 22978 }; 22979 22980 22981 /***/ }), 22982 22983 /***/ "./node_modules/@wordpress/editor/build-module/editor-styles/ast/stringify/index.js": 22984 /*!******************************************************************************************!*\ 22985 !*** ./node_modules/@wordpress/editor/build-module/editor-styles/ast/stringify/index.js ***! 22986 \******************************************************************************************/ 22987 /*! exports provided: default */ 22988 /***/ (function(module, __webpack_exports__, __webpack_require__) { 22989 22990 "use strict"; 22991 __webpack_require__.r(__webpack_exports__); 22992 /* harmony import */ var _compress__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./compress */ "./node_modules/@wordpress/editor/build-module/editor-styles/ast/stringify/compress.js"); 22993 /* harmony import */ var _identity__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./identity */ "./node_modules/@wordpress/editor/build-module/editor-styles/ast/stringify/identity.js"); 22994 // Adapted from https://github.com/reworkcss/css 22995 // because we needed to remove source map support. 22996 22997 /** 22998 * Internal dependencies. 22999 */ 23000 23001 23002 /** 23003 * Stringfy the given AST `node`. 23004 * 23005 * Options: 23006 * 23007 * - `compress` space-optimized output 23008 * - `sourcemap` return an object with `.code` and `.map` 23009 * 23010 * @param {Object} node 23011 * @param {Object} [options] 23012 * @return {String} 23013 * @api public 23014 */ 23015 23016 /* harmony default export */ __webpack_exports__["default"] = (function (node, options) { 23017 options = options || {}; 23018 var compiler = options.compress ? new _compress__WEBPACK_IMPORTED_MODULE_0__["default"](options) : new _identity__WEBPACK_IMPORTED_MODULE_1__["default"](options); 23019 var code = compiler.compile(node); 23020 return code; 23021 }); 23022 23023 23024 /***/ }), 23025 23026 /***/ "./node_modules/@wordpress/editor/build-module/editor-styles/index.js": 23027 /*!****************************************************************************!*\ 23028 !*** ./node_modules/@wordpress/editor/build-module/editor-styles/index.js ***! 23029 \****************************************************************************/ 23030 /*! exports provided: traverse, urlRewrite, wrap, editorWidth */ 23031 /***/ (function(module, __webpack_exports__, __webpack_require__) { 23032 23033 "use strict"; 23034 __webpack_require__.r(__webpack_exports__); 23035 /* harmony import */ var _traverse__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./traverse */ "./node_modules/@wordpress/editor/build-module/editor-styles/traverse.js"); 23036 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "traverse", function() { return _traverse__WEBPACK_IMPORTED_MODULE_0__["default"]; }); 23037 23038 /* harmony import */ var _transforms_url_rewrite__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./transforms/url-rewrite */ "./node_modules/@wordpress/editor/build-module/editor-styles/transforms/url-rewrite.js"); 23039 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "urlRewrite", function() { return _transforms_url_rewrite__WEBPACK_IMPORTED_MODULE_1__["default"]; }); 23040 23041 /* harmony import */ var _transforms_wrap__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./transforms/wrap */ "./node_modules/@wordpress/editor/build-module/editor-styles/transforms/wrap.js"); 23042 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "wrap", function() { return _transforms_wrap__WEBPACK_IMPORTED_MODULE_2__["default"]; }); 23043 23044 /* harmony import */ var _transforms_editor_width__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./transforms/editor-width */ "./node_modules/@wordpress/editor/build-module/editor-styles/transforms/editor-width.js"); 23045 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "editorWidth", function() { return _transforms_editor_width__WEBPACK_IMPORTED_MODULE_3__["default"]; }); 23046 23047 23048 23049 23050 23051 23052 23053 /***/ }), 23054 23055 /***/ "./node_modules/@wordpress/editor/build-module/editor-styles/transforms/editor-width.js": 23056 /*!**********************************************************************************************!*\ 23057 !*** ./node_modules/@wordpress/editor/build-module/editor-styles/transforms/editor-width.js ***! 23058 \**********************************************************************************************/ 23059 /*! exports provided: getEditorWidthRules, default */ 23060 /***/ (function(module, __webpack_exports__, __webpack_require__) { 23061 23062 "use strict"; 23063 __webpack_require__.r(__webpack_exports__); 23064 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getEditorWidthRules", function() { return getEditorWidthRules; }); 23065 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash */ "lodash"); 23066 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_0__); 23067 /** 23068 * External dependencies 23069 */ 23070 23071 var getEditorWidthRules = function getEditorWidthRules(width) { 23072 return { 23073 type: 'rule', 23074 selectors: ['body.gutenberg-editor-page .editor-post-title__block', 'body.gutenberg-editor-page .editor-default-block-appender', 'body.gutenberg-editor-page .editor-block-list__block'], 23075 declarations: [{ 23076 type: 'declaration', 23077 property: 'max-width', 23078 value: width 23079 }] 23080 }; 23081 }; 23082 23083 var editorWidth = function editorWidth(node) { 23084 if (node.type === 'rule' && Object(lodash__WEBPACK_IMPORTED_MODULE_0__["find"])(node.selectors, function (selector) { 23085 return selector.trim() === '.wp-block'; 23086 })) { 23087 var widthDeclaration = Object(lodash__WEBPACK_IMPORTED_MODULE_0__["find"])(node.declarations, function (declaration) { 23088 return declaration.property === 'width'; 23089 }); 23090 23091 if (widthDeclaration) { 23092 return getEditorWidthRules(widthDeclaration.value); 23093 } 23094 } 23095 23096 return node; 23097 }; 23098 23099 /* harmony default export */ __webpack_exports__["default"] = (editorWidth); 23100 23101 23102 /***/ }), 23103 23104 /***/ "./node_modules/@wordpress/editor/build-module/editor-styles/transforms/url-rewrite.js": 23105 /*!*********************************************************************************************!*\ 23106 !*** ./node_modules/@wordpress/editor/build-module/editor-styles/transforms/url-rewrite.js ***! 23107 \*********************************************************************************************/ 23108 /*! exports provided: default */ 23109 /***/ (function(module, __webpack_exports__, __webpack_require__) { 23110 23111 "use strict"; 23112 __webpack_require__.r(__webpack_exports__); 23113 /* harmony import */ var _babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectSpread */ "./node_modules/@babel/runtime/helpers/esm/objectSpread.js"); 23114 /* harmony import */ var url__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! url */ "./node_modules/url/url.js"); 23115 /* harmony import */ var url__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(url__WEBPACK_IMPORTED_MODULE_1__); 23116 23117 23118 /** 23119 * External dependencies 23120 */ 23121 23122 /** 23123 * Return `true` if the given path is http/https. 23124 * 23125 * @param {string} filePath path 23126 * 23127 * @return {boolean} is remote path. 23128 */ 23129 23130 function isRemotePath(filePath) { 23131 return /^(?:https?:)?\/\//.test(filePath); 23132 } 23133 /** 23134 * Return `true` if the given filePath is an absolute url. 23135 * 23136 * @param {string} filePath path 23137 * 23138 * @return {boolean} is absolute path. 23139 */ 23140 23141 23142 function isAbsolutePath(filePath) { 23143 return /^\/(?!\/)/.test(filePath); 23144 } 23145 /** 23146 * Whether or not the url should be inluded. 23147 * 23148 * @param {Object} meta url meta info 23149 * 23150 * @return {boolean} is valid. 23151 */ 23152 23153 23154 function isValidURL(meta) { 23155 // ignore hashes or data uris 23156 if (meta.value.indexOf('data:') === 0 || meta.value.indexOf('#') === 0) { 23157 return false; 23158 } 23159 23160 if (isAbsolutePath(meta.value)) { 23161 return false; 23162 } // do not handle the http/https urls if `includeRemote` is false 23163 23164 23165 if (isRemotePath(meta.value)) { 23166 return false; 23167 } 23168 23169 return true; 23170 } 23171 /** 23172 * Get the absolute path of the url, relative to the basePath 23173 * 23174 * @param {string} str the url 23175 * @param {string} baseURL base URL 23176 * @param {string} absolutePath the absolute path 23177 * 23178 * @return {string} the full path to the file 23179 */ 23180 23181 23182 function getResourcePath(str, baseURL) { 23183 var pathname = Object(url__WEBPACK_IMPORTED_MODULE_1__["parse"])(str).pathname; 23184 var filePath = Object(url__WEBPACK_IMPORTED_MODULE_1__["resolve"])(baseURL, pathname); 23185 return filePath; 23186 } 23187 /** 23188 * Process the single `url()` pattern 23189 * 23190 * @param {string} baseURL the base URL for relative URLs 23191 * @return {Promise} the Promise 23192 */ 23193 23194 23195 function processURL(baseURL) { 23196 return function (meta) { 23197 var URL = getResourcePath(meta.value, baseURL); 23198 return Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_0__["default"])({}, meta, { 23199 newUrl: 'url(' + meta.before + meta.quote + URL + meta.quote + meta.after + ')' 23200 }); 23201 }; 23202 } 23203 /** 23204 * Get all `url()`s, and return the meta info 23205 * 23206 * @param {string} value decl.value 23207 * 23208 * @return {Array} the urls 23209 */ 23210 23211 23212 function getURLs(value) { 23213 var reg = /url\((\s*)(['"]?)(.+?)\2(\s*)\)/g; 23214 var match; 23215 var URLs = []; 23216 23217 while ((match = reg.exec(value)) !== null) { 23218 var meta = { 23219 source: match[0], 23220 before: match[1], 23221 quote: match[2], 23222 value: match[3], 23223 after: match[4] 23224 }; 23225 23226 if (isValidURL(meta)) { 23227 URLs.push(meta); 23228 } 23229 } 23230 23231 return URLs; 23232 } 23233 /** 23234 * Replace the raw value's `url()` segment to the new value 23235 * 23236 * @param {string} raw the raw value 23237 * @param {Array} URLs the URLs to replace 23238 * 23239 * @return {string} the new value 23240 */ 23241 23242 23243 function replaceURLs(raw, URLs) { 23244 URLs.forEach(function (item) { 23245 raw = raw.replace(item.source, item.newUrl); 23246 }); 23247 return raw; 23248 } 23249 23250 var rewrite = function rewrite(rootURL) { 23251 return function (node) { 23252 if (node.type === 'declaration') { 23253 var updatedURLs = getURLs(node.value).map(processURL(rootURL)); 23254 return Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_0__["default"])({}, node, { 23255 value: replaceURLs(node.value, updatedURLs) 23256 }); 23257 } 23258 23259 return node; 23260 }; 23261 }; 23262 23263 /* harmony default export */ __webpack_exports__["default"] = (rewrite); 23264 23265 23266 /***/ }), 23267 23268 /***/ "./node_modules/@wordpress/editor/build-module/editor-styles/transforms/wrap.js": 23269 /*!**************************************************************************************!*\ 23270 !*** ./node_modules/@wordpress/editor/build-module/editor-styles/transforms/wrap.js ***! 23271 \**************************************************************************************/ 23272 /*! exports provided: default */ 23273 /***/ (function(module, __webpack_exports__, __webpack_require__) { 23274 23275 "use strict"; 23276 __webpack_require__.r(__webpack_exports__); 23277 /* harmony import */ var _babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectSpread */ "./node_modules/@babel/runtime/helpers/esm/objectSpread.js"); 23278 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lodash */ "lodash"); 23279 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_1__); 23280 23281 23282 /** 23283 * External dependencies 23284 */ 23285 23286 /** 23287 * @const string IS_ROOT_TAG Regex to check if the selector is a root tag selector. 23288 */ 23289 23290 var IS_ROOT_TAG = /^(body|html).*$/; 23291 23292 var wrap = function wrap(namespace) { 23293 var ignore = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : []; 23294 return function (node) { 23295 var updateSelector = function updateSelector(selector) { 23296 if (Object(lodash__WEBPACK_IMPORTED_MODULE_1__["includes"])(ignore, selector.trim())) { 23297 return selector; 23298 } // Anything other than a root tag is always prefixed. 23299 23300 23301 { 23302 if (!selector.match(IS_ROOT_TAG)) { 23303 return namespace + ' ' + selector; 23304 } 23305 } // HTML and Body elements cannot be contained within our container so lets extract their styles. 23306 23307 return selector.replace(/^(body|html)/, namespace); 23308 }; 23309 23310 if (node.type === 'rule') { 23311 return Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_0__["default"])({}, node, { 23312 selectors: node.selectors.map(updateSelector) 23313 }); 23314 } 23315 23316 return node; 23317 }; 23318 }; 23319 23320 /* harmony default export */ __webpack_exports__["default"] = (wrap); 23321 23322 23323 /***/ }), 23324 23325 /***/ "./node_modules/@wordpress/editor/build-module/editor-styles/traverse.js": 23326 /*!*******************************************************************************!*\ 23327 !*** ./node_modules/@wordpress/editor/build-module/editor-styles/traverse.js ***! 23328 \*******************************************************************************/ 23329 /*! exports provided: default */ 23330 /***/ (function(module, __webpack_exports__, __webpack_require__) { 23331 23332 "use strict"; 23333 __webpack_require__.r(__webpack_exports__); 23334 /* harmony import */ var _ast__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./ast */ "./node_modules/@wordpress/editor/build-module/editor-styles/ast/index.js"); 23335 /* harmony import */ var traverse__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! traverse */ "./node_modules/traverse/index.js"); 23336 /* harmony import */ var traverse__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(traverse__WEBPACK_IMPORTED_MODULE_1__); 23337 /** 23338 * External dependencies 23339 */ 23340 23341 23342 23343 function traverseCSS(css, callback) { 23344 try { 23345 var parsed = Object(_ast__WEBPACK_IMPORTED_MODULE_0__["parse"])(css); 23346 var updated = traverse__WEBPACK_IMPORTED_MODULE_1___default.a.map(parsed, function (node) { 23347 if (!node) { 23348 return node; 23349 } 23350 23351 var updatedNode = callback(node); 23352 return this.update(updatedNode); 23353 }); 23354 return Object(_ast__WEBPACK_IMPORTED_MODULE_0__["stringify"])(updated); 23355 } catch (err) { 23356 // eslint-disable-next-line no-console 23357 console.warn('Error while traversing the CSS: ' + err); 23358 return null; 23359 } 23360 } 23361 23362 /* harmony default export */ __webpack_exports__["default"] = (traverseCSS); 23363 23364 23365 /***/ }), 23366 23367 /***/ "./node_modules/@wordpress/editor/build-module/hooks/align.js": 23368 /*!********************************************************************!*\ 23369 !*** ./node_modules/@wordpress/editor/build-module/hooks/align.js ***! 23370 \********************************************************************/ 23371 /*! exports provided: addAttribute, getBlockValidAlignments, withToolbarControls, withDataAlign, addAssignedAlign */ 23372 /***/ (function(module, __webpack_exports__, __webpack_require__) { 23373 23374 "use strict"; 23375 __webpack_require__.r(__webpack_exports__); 23376 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addAttribute", function() { return addAttribute; }); 23377 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getBlockValidAlignments", function() { return getBlockValidAlignments; }); 23378 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "withToolbarControls", function() { return withToolbarControls; }); 23379 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "withDataAlign", function() { return withDataAlign; }); 23380 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addAssignedAlign", function() { return addAssignedAlign; }); 23381 /* harmony import */ var _babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectSpread */ "./node_modules/@babel/runtime/helpers/esm/objectSpread.js"); 23382 /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js"); 23383 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); 23384 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__); 23385 /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); 23386 /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_3__); 23387 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! lodash */ "lodash"); 23388 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_4__); 23389 /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose"); 23390 /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_5__); 23391 /* harmony import */ var _wordpress_hooks__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @wordpress/hooks */ "@wordpress/hooks"); 23392 /* harmony import */ var _wordpress_hooks__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_wordpress_hooks__WEBPACK_IMPORTED_MODULE_6__); 23393 /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks"); 23394 /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_7__); 23395 /* harmony import */ var _components__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../components */ "./node_modules/@wordpress/editor/build-module/components/index.js"); 23396 23397 23398 23399 23400 /** 23401 * External dependencies 23402 */ 23403 23404 23405 /** 23406 * WordPress dependencies 23407 */ 23408 23409 23410 23411 23412 /** 23413 * Internal dependencies 23414 */ 23415 23416 23417 /** 23418 * Filters registered block settings, extending attributes to include `align`. 23419 * 23420 * @param {Object} settings Original block settings 23421 * @return {Object} Filtered block settings 23422 */ 23423 23424 function addAttribute(settings) { 23425 // allow blocks to specify their own attribute definition with default values if needed. 23426 if (Object(lodash__WEBPACK_IMPORTED_MODULE_4__["has"])(settings.attributes, ['align', 'type'])) { 23427 return settings; 23428 } 23429 23430 if (Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_7__["hasBlockSupport"])(settings, 'align')) { 23431 // Use Lodash's assign to gracefully handle if attributes are undefined 23432 settings.attributes = Object(lodash__WEBPACK_IMPORTED_MODULE_4__["assign"])(settings.attributes, { 23433 align: { 23434 type: 'string' 23435 } 23436 }); 23437 } 23438 23439 return settings; 23440 } 23441 /** 23442 * Returns an array of valid alignments for a block type depending on its 23443 * defined supports. Returns an empty array if block does not support align. 23444 * 23445 * @param {string} blockName Block name to check 23446 * @return {string[]} Valid alignments for block 23447 */ 23448 23449 function getBlockValidAlignments(blockName) { 23450 // Explicitly defined array set of valid alignments 23451 var blockAlign = Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_7__["getBlockSupport"])(blockName, 'align'); 23452 23453 if (Array.isArray(blockAlign)) { 23454 return blockAlign; 23455 } 23456 23457 var validAlignments = []; 23458 23459 if (true === blockAlign) { 23460 // `true` includes all alignments... 23461 validAlignments.push('left', 'center', 'right'); 23462 23463 if (Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_7__["hasBlockSupport"])(blockName, 'alignWide', true)) { 23464 validAlignments.push('wide', 'full'); 23465 } 23466 } 23467 23468 return validAlignments; 23469 } 23470 /** 23471 * Override the default edit UI to include new toolbar controls for block 23472 * alignment, if block defines support. 23473 * 23474 * @param {Function} BlockEdit Original component 23475 * @return {Function} Wrapped component 23476 */ 23477 23478 var withToolbarControls = Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_5__["createHigherOrderComponent"])(function (BlockEdit) { 23479 return function (props) { 23480 var validAlignments = getBlockValidAlignments(props.name); 23481 23482 var updateAlignment = function updateAlignment(nextAlign) { 23483 if (!nextAlign) { 23484 var blockType = Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_7__["getBlockType"])(props.name); 23485 var blockDefaultAlign = Object(lodash__WEBPACK_IMPORTED_MODULE_4__["get"])(blockType, ['attributes', 'align', 'default']); 23486 23487 if (blockDefaultAlign) { 23488 nextAlign = ''; 23489 } 23490 } 23491 23492 props.setAttributes({ 23493 align: nextAlign 23494 }); 23495 }; 23496 23497 return [validAlignments.length > 0 && props.isSelected && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["createElement"])(_components__WEBPACK_IMPORTED_MODULE_8__["BlockControls"], { 23498 key: "align-controls" 23499 }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["createElement"])(_components__WEBPACK_IMPORTED_MODULE_8__["BlockAlignmentToolbar"], { 23500 value: props.attributes.align, 23501 onChange: updateAlignment, 23502 controls: validAlignments 23503 })), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["createElement"])(BlockEdit, Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_1__["default"])({ 23504 key: "edit" 23505 }, props))]; 23506 }; 23507 }, 'withToolbarControls'); 23508 /** 23509 * Override the default block element to add alignment wrapper props. 23510 * 23511 * @param {Function} BlockListBlock Original component 23512 * @return {Function} Wrapped component 23513 */ 23514 23515 var withDataAlign = Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_5__["createHigherOrderComponent"])(function (BlockListBlock) { 23516 return function (props) { 23517 var align = props.block.attributes.align; 23518 var validAlignments = getBlockValidAlignments(props.block.name); 23519 var wrapperProps = props.wrapperProps; 23520 23521 if (Object(lodash__WEBPACK_IMPORTED_MODULE_4__["includes"])(validAlignments, align)) { 23522 wrapperProps = Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_0__["default"])({}, wrapperProps, { 23523 'data-align': align 23524 }); 23525 } 23526 23527 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["createElement"])(BlockListBlock, Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_1__["default"])({}, props, { 23528 wrapperProps: wrapperProps 23529 })); 23530 }; 23531 }, 'withDataAlign'); 23532 /** 23533 * Override props assigned to save component to inject alignment class name if 23534 * block supports it. 23535 * 23536 * @param {Object} props Additional props applied to save element 23537 * @param {Object} blockType Block type 23538 * @param {Object} attributes Block attributes 23539 * @return {Object} Filtered props applied to save element 23540 */ 23541 23542 function addAssignedAlign(props, blockType, attributes) { 23543 var align = attributes.align; 23544 23545 if (Object(lodash__WEBPACK_IMPORTED_MODULE_4__["includes"])(getBlockValidAlignments(blockType), align)) { 23546 props.className = classnames__WEBPACK_IMPORTED_MODULE_3___default()("align".concat(align), props.className); 23547 } 23548 23549 return props; 23550 } 23551 Object(_wordpress_hooks__WEBPACK_IMPORTED_MODULE_6__["addFilter"])('blocks.registerBlockType', 'core/align/addAttribute', addAttribute); 23552 Object(_wordpress_hooks__WEBPACK_IMPORTED_MODULE_6__["addFilter"])('editor.BlockListBlock', 'core/editor/align/with-data-align', withDataAlign); 23553 Object(_wordpress_hooks__WEBPACK_IMPORTED_MODULE_6__["addFilter"])('editor.BlockEdit', 'core/editor/align/with-toolbar-controls', withToolbarControls); 23554 Object(_wordpress_hooks__WEBPACK_IMPORTED_MODULE_6__["addFilter"])('blocks.getSaveContent.extraProps', 'core/align/addAssignedAlign', addAssignedAlign); 23555 23556 23557 /***/ }), 23558 23559 /***/ "./node_modules/@wordpress/editor/build-module/hooks/anchor.js": 23560 /*!*********************************************************************!*\ 23561 !*** ./node_modules/@wordpress/editor/build-module/hooks/anchor.js ***! 23562 \*********************************************************************/ 23563 /*! exports provided: addAttribute, withInspectorControl, addSaveProps */ 23564 /***/ (function(module, __webpack_exports__, __webpack_require__) { 23565 23566 "use strict"; 23567 __webpack_require__.r(__webpack_exports__); 23568 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addAttribute", function() { return addAttribute; }); 23569 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "withInspectorControl", function() { return withInspectorControl; }); 23570 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addSaveProps", function() { return addSaveProps; }); 23571 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); 23572 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); 23573 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lodash */ "lodash"); 23574 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_1__); 23575 /* harmony import */ var _wordpress_hooks__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/hooks */ "@wordpress/hooks"); 23576 /* harmony import */ var _wordpress_hooks__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_hooks__WEBPACK_IMPORTED_MODULE_2__); 23577 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); 23578 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__); 23579 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); 23580 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__); 23581 /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks"); 23582 /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_5__); 23583 /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose"); 23584 /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_6__); 23585 /* harmony import */ var _components__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../components */ "./node_modules/@wordpress/editor/build-module/components/index.js"); 23586 23587 23588 /** 23589 * External dependencies 23590 */ 23591 23592 /** 23593 * WordPress dependencies 23594 */ 23595 23596 23597 23598 23599 23600 23601 23602 /** 23603 * Internal dependencies 23604 */ 23605 23606 23607 /** 23608 * Regular expression matching invalid anchor characters for replacement. 23609 * 23610 * @type {RegExp} 23611 */ 23612 23613 var ANCHOR_REGEX = /[\s#]/g; 23614 /** 23615 * Filters registered block settings, extending attributes with anchor using ID 23616 * of the first node. 23617 * 23618 * @param {Object} settings Original block settings. 23619 * 23620 * @return {Object} Filtered block settings. 23621 */ 23622 23623 function addAttribute(settings) { 23624 if (Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_5__["hasBlockSupport"])(settings, 'anchor')) { 23625 // Use Lodash's assign to gracefully handle if attributes are undefined 23626 settings.attributes = Object(lodash__WEBPACK_IMPORTED_MODULE_1__["assign"])(settings.attributes, { 23627 anchor: { 23628 type: 'string', 23629 source: 'attribute', 23630 attribute: 'id', 23631 selector: '*' 23632 } 23633 }); 23634 } 23635 23636 return settings; 23637 } 23638 /** 23639 * Override the default edit UI to include a new block inspector control for 23640 * assigning the anchor ID, if block supports anchor. 23641 * 23642 * @param {function|Component} BlockEdit Original component. 23643 * 23644 * @return {string} Wrapped component. 23645 */ 23646 23647 var withInspectorControl = Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_6__["createHigherOrderComponent"])(function (BlockEdit) { 23648 return function (props) { 23649 var hasAnchor = Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_5__["hasBlockSupport"])(props.name, 'anchor'); 23650 23651 if (hasAnchor && props.isSelected) { 23652 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["Fragment"], null, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(BlockEdit, props), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_components__WEBPACK_IMPORTED_MODULE_7__["InspectorAdvancedControls"], null, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__["TextControl"], { 23653 label: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__["__"])('HTML Anchor'), 23654 help: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__["__"])('Anchors lets you link directly to a section on a page.'), 23655 value: props.attributes.anchor || '', 23656 onChange: function onChange(nextValue) { 23657 nextValue = nextValue.replace(ANCHOR_REGEX, '-'); 23658 props.setAttributes({ 23659 anchor: nextValue 23660 }); 23661 } 23662 }))); 23663 } 23664 23665 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(BlockEdit, props); 23666 }; 23667 }, 'withInspectorControl'); 23668 /** 23669 * Override props assigned to save component to inject anchor ID, if block 23670 * supports anchor. This is only applied if the block's save result is an 23671 * element and not a markup string. 23672 * 23673 * @param {Object} extraProps Additional props applied to save element. 23674 * @param {Object} blockType Block type. 23675 * @param {Object} attributes Current block attributes. 23676 * 23677 * @return {Object} Filtered props applied to save element. 23678 */ 23679 23680 function addSaveProps(extraProps, blockType, attributes) { 23681 if (Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_5__["hasBlockSupport"])(blockType, 'anchor')) { 23682 extraProps.id = attributes.anchor; 23683 } 23684 23685 return extraProps; 23686 } 23687 Object(_wordpress_hooks__WEBPACK_IMPORTED_MODULE_2__["addFilter"])('blocks.registerBlockType', 'core/anchor/attribute', addAttribute); 23688 Object(_wordpress_hooks__WEBPACK_IMPORTED_MODULE_2__["addFilter"])('editor.BlockEdit', 'core/editor/anchor/with-inspector-control', withInspectorControl); 23689 Object(_wordpress_hooks__WEBPACK_IMPORTED_MODULE_2__["addFilter"])('blocks.getSaveContent.extraProps', 'core/anchor/save-props', addSaveProps); 23690 23691 23692 /***/ }), 23693 23694 /***/ "./node_modules/@wordpress/editor/build-module/hooks/custom-class-name.js": 23695 /*!********************************************************************************!*\ 23696 !*** ./node_modules/@wordpress/editor/build-module/hooks/custom-class-name.js ***! 23697 \********************************************************************************/ 23698 /*! exports provided: addAttribute, withInspectorControl, addSaveProps, getHTMLRootElementClasses, addParsedDifference */ 23699 /***/ (function(module, __webpack_exports__, __webpack_require__) { 23700 23701 "use strict"; 23702 __webpack_require__.r(__webpack_exports__); 23703 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addAttribute", function() { return addAttribute; }); 23704 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "withInspectorControl", function() { return withInspectorControl; }); 23705 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addSaveProps", function() { return addSaveProps; }); 23706 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getHTMLRootElementClasses", function() { return getHTMLRootElementClasses; }); 23707 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addParsedDifference", function() { return addParsedDifference; }); 23708 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); 23709 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); 23710 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lodash */ "lodash"); 23711 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_1__); 23712 /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); 23713 /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_2__); 23714 /* harmony import */ var _wordpress_hooks__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/hooks */ "@wordpress/hooks"); 23715 /* harmony import */ var _wordpress_hooks__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_hooks__WEBPACK_IMPORTED_MODULE_3__); 23716 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); 23717 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_4__); 23718 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); 23719 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_5__); 23720 /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks"); 23721 /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_6__); 23722 /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose"); 23723 /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_7__); 23724 /* harmony import */ var _components__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../components */ "./node_modules/@wordpress/editor/build-module/components/index.js"); 23725 23726 23727 /** 23728 * External dependencies 23729 */ 23730 23731 23732 /** 23733 * WordPress dependencies 23734 */ 23735 23736 23737 23738 23739 23740 23741 23742 /** 23743 * Internal dependencies 23744 */ 23745 23746 23747 /** 23748 * Filters registered block settings, extending attributes with anchor using ID 23749 * of the first node. 23750 * 23751 * @param {Object} settings Original block settings. 23752 * 23753 * @return {Object} Filtered block settings. 23754 */ 23755 23756 function addAttribute(settings) { 23757 if (Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_6__["hasBlockSupport"])(settings, 'customClassName', true)) { 23758 // Use Lodash's assign to gracefully handle if attributes are undefined 23759 settings.attributes = Object(lodash__WEBPACK_IMPORTED_MODULE_1__["assign"])(settings.attributes, { 23760 className: { 23761 type: 'string' 23762 } 23763 }); 23764 } 23765 23766 return settings; 23767 } 23768 /** 23769 * Override the default edit UI to include a new block inspector control for 23770 * assigning the custom class name, if block supports custom class name. 23771 * 23772 * @param {function|Component} BlockEdit Original component. 23773 * 23774 * @return {string} Wrapped component. 23775 */ 23776 23777 var withInspectorControl = Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_7__["createHigherOrderComponent"])(function (BlockEdit) { 23778 return function (props) { 23779 var hasCustomClassName = Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_6__["hasBlockSupport"])(props.name, 'customClassName', true); 23780 23781 if (hasCustomClassName && props.isSelected) { 23782 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["Fragment"], null, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(BlockEdit, props), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_components__WEBPACK_IMPORTED_MODULE_8__["InspectorAdvancedControls"], null, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_4__["TextControl"], { 23783 label: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_5__["__"])('Additional CSS Class'), 23784 value: props.attributes.className || '', 23785 onChange: function onChange(nextValue) { 23786 props.setAttributes({ 23787 className: nextValue 23788 }); 23789 } 23790 }))); 23791 } 23792 23793 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(BlockEdit, props); 23794 }; 23795 }, 'withInspectorControl'); 23796 /** 23797 * Override props assigned to save component to inject anchor ID, if block 23798 * supports anchor. This is only applied if the block's save result is an 23799 * element and not a markup string. 23800 * 23801 * @param {Object} extraProps Additional props applied to save element. 23802 * @param {Object} blockType Block type. 23803 * @param {Object} attributes Current block attributes. 23804 * 23805 * @return {Object} Filtered props applied to save element. 23806 */ 23807 23808 function addSaveProps(extraProps, blockType, attributes) { 23809 if (Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_6__["hasBlockSupport"])(blockType, 'customClassName', true) && attributes.className) { 23810 extraProps.className = classnames__WEBPACK_IMPORTED_MODULE_2___default()(extraProps.className, attributes.className); 23811 } 23812 23813 return extraProps; 23814 } 23815 /** 23816 * Given an HTML string, returns an array of class names assigned to the root 23817 * element in the markup. 23818 * 23819 * @param {string} innerHTML Markup string from which to extract classes. 23820 * 23821 * @return {string[]} Array of class names assigned to the root element. 23822 */ 23823 23824 function getHTMLRootElementClasses(innerHTML) { 23825 innerHTML = "<div data-custom-class-name>".concat(innerHTML, "</div>"); 23826 var parsed = Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_6__["parseWithAttributeSchema"])(innerHTML, { 23827 type: 'string', 23828 source: 'attribute', 23829 selector: '[data-custom-class-name] > *', 23830 attribute: 'class' 23831 }); 23832 return parsed ? parsed.trim().split(/\s+/) : []; 23833 } 23834 /** 23835 * Given a parsed set of block attributes, if the block supports custom class 23836 * names and an unknown class (per the block's serialization behavior) is 23837 * found, the unknown classes are treated as custom classes. This prevents the 23838 * block from being considered as invalid. 23839 * 23840 * @param {Object} blockAttributes Original block attributes. 23841 * @param {Object} blockType Block type settings. 23842 * @param {string} innerHTML Original block markup. 23843 * 23844 * @return {Object} Filtered block attributes. 23845 */ 23846 23847 function addParsedDifference(blockAttributes, blockType, innerHTML) { 23848 if (Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_6__["hasBlockSupport"])(blockType, 'customClassName', true)) { 23849 // To determine difference, serialize block given the known set of 23850 // attributes, with the exception of `className`. This will determine 23851 // the default set of classes. From there, any difference in innerHTML 23852 // can be considered as custom classes. 23853 var attributesSansClassName = Object(lodash__WEBPACK_IMPORTED_MODULE_1__["omit"])(blockAttributes, ['className']); 23854 var serialized = Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_6__["getSaveContent"])(blockType, attributesSansClassName); 23855 var defaultClasses = getHTMLRootElementClasses(serialized); 23856 var actualClasses = getHTMLRootElementClasses(innerHTML); 23857 var customClasses = Object(lodash__WEBPACK_IMPORTED_MODULE_1__["difference"])(actualClasses, defaultClasses); 23858 23859 if (customClasses.length) { 23860 blockAttributes.className = customClasses.join(' '); 23861 } else if (serialized) { 23862 delete blockAttributes.className; 23863 } 23864 } 23865 23866 return blockAttributes; 23867 } 23868 Object(_wordpress_hooks__WEBPACK_IMPORTED_MODULE_3__["addFilter"])('blocks.registerBlockType', 'core/custom-class-name/attribute', addAttribute); 23869 Object(_wordpress_hooks__WEBPACK_IMPORTED_MODULE_3__["addFilter"])('editor.BlockEdit', 'core/editor/custom-class-name/with-inspector-control', withInspectorControl); 23870 Object(_wordpress_hooks__WEBPACK_IMPORTED_MODULE_3__["addFilter"])('blocks.getSaveContent.extraProps', 'core/custom-class-name/save-props', addSaveProps); 23871 Object(_wordpress_hooks__WEBPACK_IMPORTED_MODULE_3__["addFilter"])('blocks.getBlockAttributes', 'core/custom-class-name/addParsedDifference', addParsedDifference); 23872 23873 23874 /***/ }), 23875 23876 /***/ "./node_modules/@wordpress/editor/build-module/hooks/default-autocompleters.js": 23877 /*!*************************************************************************************!*\ 23878 !*** ./node_modules/@wordpress/editor/build-module/hooks/default-autocompleters.js ***! 23879 \*************************************************************************************/ 23880 /*! no exports provided */ 23881 /***/ (function(module, __webpack_exports__, __webpack_require__) { 23882 23883 "use strict"; 23884 __webpack_require__.r(__webpack_exports__); 23885 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash */ "lodash"); 23886 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_0__); 23887 /* harmony import */ var _wordpress_hooks__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/hooks */ "@wordpress/hooks"); 23888 /* harmony import */ var _wordpress_hooks__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_hooks__WEBPACK_IMPORTED_MODULE_1__); 23889 /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks"); 23890 /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_2__); 23891 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); 23892 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_3__); 23893 /* harmony import */ var _components__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../components */ "./node_modules/@wordpress/editor/build-module/components/index.js"); 23894 /** 23895 * External dependencies 23896 */ 23897 23898 /** 23899 * WordPress dependencies 23900 */ 23901 23902 23903 23904 23905 /** 23906 * Internal dependencies 23907 */ 23908 23909 23910 var defaultAutocompleters = [_components__WEBPACK_IMPORTED_MODULE_4__["userAutocompleter"]]; 23911 var fetchReusableBlocks = Object(lodash__WEBPACK_IMPORTED_MODULE_0__["once"])(function () { 23912 return Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_3__["dispatch"])('core/editor').fetchReusableBlocks(); 23913 }); 23914 23915 function setDefaultCompleters(completers, blockName) { 23916 if (!completers) { 23917 // Provide copies so filters may directly modify them. 23918 completers = defaultAutocompleters.map(lodash__WEBPACK_IMPORTED_MODULE_0__["clone"]); // Add blocks autocompleter for Paragraph block 23919 23920 if (blockName === Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_2__["getDefaultBlockName"])()) { 23921 completers.push(Object(lodash__WEBPACK_IMPORTED_MODULE_0__["clone"])(_components__WEBPACK_IMPORTED_MODULE_4__["blockAutocompleter"])); 23922 /* 23923 * NOTE: This is a hack to help ensure reusable blocks are loaded 23924 * so they may be included in the block completer. It can be removed 23925 * once we have a way for completers to Promise options while 23926 * store-based data dependencies are being resolved. 23927 */ 23928 23929 fetchReusableBlocks(); 23930 } 23931 } 23932 23933 return completers; 23934 } 23935 23936 Object(_wordpress_hooks__WEBPACK_IMPORTED_MODULE_1__["addFilter"])('editor.Autocomplete.completers', 'editor/autocompleters/set-default-completers', setDefaultCompleters); 23937 23938 23939 /***/ }), 23940 23941 /***/ "./node_modules/@wordpress/editor/build-module/hooks/generated-class-name.js": 23942 /*!***********************************************************************************!*\ 23943 !*** ./node_modules/@wordpress/editor/build-module/hooks/generated-class-name.js ***! 23944 \***********************************************************************************/ 23945 /*! exports provided: addGeneratedClassName */ 23946 /***/ (function(module, __webpack_exports__, __webpack_require__) { 23947 23948 "use strict"; 23949 __webpack_require__.r(__webpack_exports__); 23950 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addGeneratedClassName", function() { return addGeneratedClassName; }); 23951 /* harmony import */ var _babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/toConsumableArray */ "./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js"); 23952 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lodash */ "lodash"); 23953 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_1__); 23954 /* harmony import */ var _wordpress_hooks__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/hooks */ "@wordpress/hooks"); 23955 /* harmony import */ var _wordpress_hooks__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_hooks__WEBPACK_IMPORTED_MODULE_2__); 23956 /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks"); 23957 /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_3__); 23958 23959 23960 /** 23961 * External dependencies 23962 */ 23963 23964 /** 23965 * WordPress dependencies 23966 */ 23967 23968 23969 23970 /** 23971 * Override props assigned to save component to inject generated className if 23972 * block supports it. This is only applied if the block's save result is an 23973 * element and not a markup string. 23974 * 23975 * @param {Object} extraProps Additional props applied to save element. 23976 * @param {Object} blockType Block type. 23977 * 23978 * @return {Object} Filtered props applied to save element. 23979 */ 23980 23981 function addGeneratedClassName(extraProps, blockType) { 23982 // Adding the generated className 23983 if (Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_3__["hasBlockSupport"])(blockType, 'className', true)) { 23984 if (typeof extraProps.className === 'string') { 23985 // We have some extra classes and want to add the default classname 23986 // We use uniq to prevent duplicate classnames 23987 extraProps.className = Object(lodash__WEBPACK_IMPORTED_MODULE_1__["uniq"])([Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_3__["getBlockDefaultClassName"])(blockType.name)].concat(Object(_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_0__["default"])(extraProps.className.split(' ')))).join(' ').trim(); 23988 } else { 23989 // There is no string in the className variable, 23990 // so we just dump the default name in there 23991 extraProps.className = Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_3__["getBlockDefaultClassName"])(blockType.name); 23992 } 23993 } 23994 23995 return extraProps; 23996 } 23997 Object(_wordpress_hooks__WEBPACK_IMPORTED_MODULE_2__["addFilter"])('blocks.getSaveContent.extraProps', 'core/generated-class-name/save-props', addGeneratedClassName); 23998 23999 24000 /***/ }), 24001 24002 /***/ "./node_modules/@wordpress/editor/build-module/hooks/index.js": 24003 /*!********************************************************************!*\ 24004 !*** ./node_modules/@wordpress/editor/build-module/hooks/index.js ***! 24005 \********************************************************************/ 24006 /*! no exports provided */ 24007 /***/ (function(module, __webpack_exports__, __webpack_require__) { 24008 24009 "use strict"; 24010 __webpack_require__.r(__webpack_exports__); 24011 /* harmony import */ var _align__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./align */ "./node_modules/@wordpress/editor/build-module/hooks/align.js"); 24012 /* harmony import */ var _anchor__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./anchor */ "./node_modules/@wordpress/editor/build-module/hooks/anchor.js"); 24013 /* harmony import */ var _custom_class_name__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./custom-class-name */ "./node_modules/@wordpress/editor/build-module/hooks/custom-class-name.js"); 24014 /* harmony import */ var _default_autocompleters__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./default-autocompleters */ "./node_modules/@wordpress/editor/build-module/hooks/default-autocompleters.js"); 24015 /* harmony import */ var _generated_class_name__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./generated-class-name */ "./node_modules/@wordpress/editor/build-module/hooks/generated-class-name.js"); 24016 /* harmony import */ var _layout__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./layout */ "./node_modules/@wordpress/editor/build-module/hooks/layout.js"); 24017 /** 24018 * Internal dependencies 24019 */ 24020 24021 24022 24023 24024 24025 24026 24027 24028 /***/ }), 24029 24030 /***/ "./node_modules/@wordpress/editor/build-module/hooks/layout.js": 24031 /*!*********************************************************************!*\ 24032 !*** ./node_modules/@wordpress/editor/build-module/hooks/layout.js ***! 24033 \*********************************************************************/ 24034 /*! exports provided: addAttribute, addSaveProps */ 24035 /***/ (function(module, __webpack_exports__, __webpack_require__) { 24036 24037 "use strict"; 24038 __webpack_require__.r(__webpack_exports__); 24039 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addAttribute", function() { return addAttribute; }); 24040 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addSaveProps", function() { return addSaveProps; }); 24041 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash */ "lodash"); 24042 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_0__); 24043 /* harmony import */ var _wordpress_hooks__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/hooks */ "@wordpress/hooks"); 24044 /* harmony import */ var _wordpress_hooks__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_hooks__WEBPACK_IMPORTED_MODULE_1__); 24045 /** 24046 * External dependencies 24047 */ 24048 24049 /** 24050 * WordPress dependencies 24051 */ 24052 24053 24054 /** 24055 * Filters registered block settings, extending attributes with layout. 24056 * 24057 * @param {Object} settings Original block settings. 24058 * 24059 * @return {Object} Filtered block settings. 24060 */ 24061 24062 function addAttribute(settings) { 24063 // Use Lodash's assign to gracefully handle if attributes are undefined 24064 settings.attributes = Object(lodash__WEBPACK_IMPORTED_MODULE_0__["assign"])(settings.attributes, { 24065 layout: { 24066 type: 'string' 24067 } 24068 }); 24069 return settings; 24070 } 24071 /** 24072 * Override props assigned to save component to inject layout class. This is 24073 * only applied if the block's save result is an element and not a markup 24074 * string. 24075 * 24076 * @param {Object} extraProps Additional props applied to save element. 24077 * @param {Object} blockType Block type. 24078 * @param {Object} attributes Current block attributes. 24079 * 24080 * @return {Object} Filtered props applied to save element. 24081 */ 24082 24083 function addSaveProps(extraProps, blockType, attributes) { 24084 var layout = attributes.layout; 24085 24086 if (layout) { 24087 extraProps.className = Object(lodash__WEBPACK_IMPORTED_MODULE_0__["compact"])([extraProps.className, 'layout-' + layout]).join(' '); 24088 } 24089 24090 return extraProps; 24091 } 24092 /** 24093 * Given a transformed block, assigns the layout from the original block. Since 24094 * layout is a "global" attribute implemented via hooks, the individual block 24095 * transforms are not expected to handle this themselves, and a transform would 24096 * otherwise lose assigned layout. 24097 * 24098 * @param {Object} transformedBlock Original transformed block. 24099 * @param {Object} blocks Blocks on which transform was applied. 24100 * 24101 * @return {Object} Modified transformed block, with layout preserved. 24102 */ 24103 24104 function preserveLayoutAttribute(transformedBlock, blocks) { 24105 // Since block transforms are many-to-many, use the layout attribute from 24106 // the first of the source blocks. 24107 var layout = Object(lodash__WEBPACK_IMPORTED_MODULE_0__["get"])(blocks, [0, 'attributes', 'layout']); 24108 transformedBlock.attributes.layout = layout; 24109 return transformedBlock; 24110 } 24111 /** 24112 * Excludes the layout from the list of attributes to check 24113 * when determining if a block is unmodified or not. 24114 * 24115 * @param {Object} attributeKeys Attribute keys to check 24116 * 24117 * @return {Object} Modified list of attribute keys 24118 */ 24119 24120 24121 function excludeLayoutFromUnmodifiedBlockCheck(attributeKeys) { 24122 return Object(lodash__WEBPACK_IMPORTED_MODULE_0__["without"])(attributeKeys, 'layout'); 24123 } 24124 24125 Object(_wordpress_hooks__WEBPACK_IMPORTED_MODULE_1__["addFilter"])('blocks.registerBlockType', 'core/layout/attribute', addAttribute); 24126 Object(_wordpress_hooks__WEBPACK_IMPORTED_MODULE_1__["addFilter"])('blocks.getSaveContent.extraProps', 'core/layout/save-props', addSaveProps); 24127 Object(_wordpress_hooks__WEBPACK_IMPORTED_MODULE_1__["addFilter"])('blocks.switchToBlockType.transformedBlock', 'core/layout/preserve-layout', preserveLayoutAttribute); 24128 Object(_wordpress_hooks__WEBPACK_IMPORTED_MODULE_1__["addFilter"])('blocks.isUnmodifiedDefaultBlock.attributes', 'core/layout/exclude-layout-attribute-check', excludeLayoutFromUnmodifiedBlockCheck); 24129 24130 24131 /***/ }), 24132 24133 /***/ "./node_modules/@wordpress/editor/build-module/index.js": 24134 /*!**************************************************************!*\ 24135 !*** ./node_modules/@wordpress/editor/build-module/index.js ***! 24136 \**************************************************************/ 24137 /*! exports provided: Autocomplete, AlignmentToolbar, BlockAlignmentToolbar, BlockControls, BlockEdit, BlockFormatControls, BlockIcon, ColorPalette, withColorContext, ContrastChecker, InnerBlocks, InspectorAdvancedControls, InspectorControls, PanelColor, PanelColorSettings, PlainText, RichText, ServerSideRender, MediaPlaceholder, MediaUpload, URLInput, URLInputButton, AutosaveMonitor, DocumentOutline, DocumentOutlineCheck, EditorGlobalKeyboardShortcuts, EditorHistoryRedo, EditorHistoryUndo, EditorNotices, PageAttributesCheck, PageAttributesOrder, PageAttributesParent, PageTemplate, PostAuthor, PostAuthorCheck, PostComments, PostExcerpt, PostExcerptCheck, PostFeaturedImage, PostFeaturedImageCheck, PostFormat, PostFormatCheck, PostLastRevision, PostLastRevisionCheck, PostLockedModal, PostPendingStatus, PostPendingStatusCheck, PostPingbacks, PostPreviewButton, PostPublishButton, PostPublishButtonLabel, PostPublishPanel, PostPublishPanelToggle, PostSavedState, PostSchedule, PostScheduleCheck, PostScheduleLabel, PostSticky, PostStickyCheck, PostSwitchToDraftButton, PostTaxonomies, PostTaxonomiesCheck, PostTextEditor, PostTitle, PostTrash, PostTrashCheck, PostTypeSupportCheck, PostVisibility, PostVisibilityLabel, PostVisibilityCheck, TableOfContents, UnsavedChangesWarning, WordCount, BlockInspector, BlockList, BlockMover, BlockSelectionClearer, BlockSettingsMenu, _BlockSettingsMenuFirstItem, _BlockSettingsMenuPluginsExtension, BlockTitle, BlockToolbar, CopyHandler, DefaultBlockAppender, ErrorBoundary, Inserter, MultiBlocksSwitcher, MultiSelectScrollIntoView, NavigableToolbar, ObserveTyping, PreserveScrollInReorder, SkipToSelectedBlock, Warning, WritingFlow, EditorProvider, mediaUpload, blockAutocompleter, userAutocompleter, getColorClassName, getColorObjectByAttributeValues, getColorObjectByColorValue, withColors, getFontSize, getFontSizeClass, FontSizePicker, withFontSizes */ 24138 /***/ (function(module, __webpack_exports__, __webpack_require__) { 24139 24140 "use strict"; 24141 __webpack_require__.r(__webpack_exports__); 24142 /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks"); 24143 /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__); 24144 /* harmony import */ var _wordpress_core_data__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/core-data */ "@wordpress/core-data"); 24145 /* harmony import */ var _wordpress_core_data__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_core_data__WEBPACK_IMPORTED_MODULE_1__); 24146 /* harmony import */ var _wordpress_nux__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/nux */ "@wordpress/nux"); 24147 /* harmony import */ var _wordpress_nux__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_nux__WEBPACK_IMPORTED_MODULE_2__); 24148 /* harmony import */ var _wordpress_viewport__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/viewport */ "@wordpress/viewport"); 24149 /* harmony import */ var _wordpress_viewport__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_viewport__WEBPACK_IMPORTED_MODULE_3__); 24150 /* harmony import */ var _store__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./store */ "./node_modules/@wordpress/editor/build-module/store/index.js"); 24151 /* harmony import */ var _hooks__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./hooks */ "./node_modules/@wordpress/editor/build-module/hooks/index.js"); 24152 /* harmony import */ var _components__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./components */ "./node_modules/@wordpress/editor/build-module/components/index.js"); 24153 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Autocomplete", function() { return _components__WEBPACK_IMPORTED_MODULE_6__["Autocomplete"]; }); 24154 24155 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "AlignmentToolbar", function() { return _components__WEBPACK_IMPORTED_MODULE_6__["AlignmentToolbar"]; }); 24156 24157 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "BlockAlignmentToolbar", function() { return _components__WEBPACK_IMPORTED_MODULE_6__["BlockAlignmentToolbar"]; }); 24158 24159 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "BlockControls", function() { return _components__WEBPACK_IMPORTED_MODULE_6__["BlockControls"]; }); 24160 24161 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "BlockEdit", function() { return _components__WEBPACK_IMPORTED_MODULE_6__["BlockEdit"]; }); 24162 24163 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "BlockFormatControls", function() { return _components__WEBPACK_IMPORTED_MODULE_6__["BlockFormatControls"]; }); 24164 24165 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "BlockIcon", function() { return _components__WEBPACK_IMPORTED_MODULE_6__["BlockIcon"]; }); 24166 24167 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ColorPalette", function() { return _components__WEBPACK_IMPORTED_MODULE_6__["ColorPalette"]; }); 24168 24169 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "withColorContext", function() { return _components__WEBPACK_IMPORTED_MODULE_6__["withColorContext"]; }); 24170 24171 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ContrastChecker", function() { return _components__WEBPACK_IMPORTED_MODULE_6__["ContrastChecker"]; }); 24172 24173 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "InnerBlocks", function() { return _components__WEBPACK_IMPORTED_MODULE_6__["InnerBlocks"]; }); 24174 24175 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "InspectorAdvancedControls", function() { return _components__WEBPACK_IMPORTED_MODULE_6__["InspectorAdvancedControls"]; }); 24176 24177 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "InspectorControls", function() { return _components__WEBPACK_IMPORTED_MODULE_6__["InspectorControls"]; }); 24178 24179 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PanelColor", function() { return _components__WEBPACK_IMPORTED_MODULE_6__["PanelColor"]; }); 24180 24181 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PanelColorSettings", function() { return _components__WEBPACK_IMPORTED_MODULE_6__["PanelColorSettings"]; }); 24182 24183 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PlainText", function() { return _components__WEBPACK_IMPORTED_MODULE_6__["PlainText"]; }); 24184 24185 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "RichText", function() { return _components__WEBPACK_IMPORTED_MODULE_6__["RichText"]; }); 24186 24187 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ServerSideRender", function() { return _components__WEBPACK_IMPORTED_MODULE_6__["ServerSideRender"]; }); 24188 24189 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MediaPlaceholder", function() { return _components__WEBPACK_IMPORTED_MODULE_6__["MediaPlaceholder"]; }); 24190 24191 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MediaUpload", function() { return _components__WEBPACK_IMPORTED_MODULE_6__["MediaUpload"]; }); 24192 24193 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "URLInput", function() { return _components__WEBPACK_IMPORTED_MODULE_6__["URLInput"]; }); 24194 24195 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "URLInputButton", function() { return _components__WEBPACK_IMPORTED_MODULE_6__["URLInputButton"]; }); 24196 24197 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "AutosaveMonitor", function() { return _components__WEBPACK_IMPORTED_MODULE_6__["AutosaveMonitor"]; }); 24198 24199 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "DocumentOutline", function() { return _components__WEBPACK_IMPORTED_MODULE_6__["DocumentOutline"]; }); 24200 24201 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "DocumentOutlineCheck", function() { return _components__WEBPACK_IMPORTED_MODULE_6__["DocumentOutlineCheck"]; }); 24202 24203 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "EditorGlobalKeyboardShortcuts", function() { return _components__WEBPACK_IMPORTED_MODULE_6__["EditorGlobalKeyboardShortcuts"]; }); 24204 24205 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "EditorHistoryRedo", function() { return _components__WEBPACK_IMPORTED_MODULE_6__["EditorHistoryRedo"]; }); 24206 24207 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "EditorHistoryUndo", function() { return _components__WEBPACK_IMPORTED_MODULE_6__["EditorHistoryUndo"]; }); 24208 24209 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "EditorNotices", function() { return _components__WEBPACK_IMPORTED_MODULE_6__["EditorNotices"]; }); 24210 24211 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PageAttributesCheck", function() { return _components__WEBPACK_IMPORTED_MODULE_6__["PageAttributesCheck"]; }); 24212 24213 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PageAttributesOrder", function() { return _components__WEBPACK_IMPORTED_MODULE_6__["PageAttributesOrder"]; }); 24214 24215 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PageAttributesParent", function() { return _components__WEBPACK_IMPORTED_MODULE_6__["PageAttributesParent"]; }); 24216 24217 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PageTemplate", function() { return _components__WEBPACK_IMPORTED_MODULE_6__["PageTemplate"]; }); 24218 24219 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PostAuthor", function() { return _components__WEBPACK_IMPORTED_MODULE_6__["PostAuthor"]; }); 24220 24221 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PostAuthorCheck", function() { return _components__WEBPACK_IMPORTED_MODULE_6__["PostAuthorCheck"]; }); 24222 24223 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PostComments", function() { return _components__WEBPACK_IMPORTED_MODULE_6__["PostComments"]; }); 24224 24225 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PostExcerpt", function() { return _components__WEBPACK_IMPORTED_MODULE_6__["PostExcerpt"]; }); 24226 24227 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PostExcerptCheck", function() { return _components__WEBPACK_IMPORTED_MODULE_6__["PostExcerptCheck"]; }); 24228 24229 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PostFeaturedImage", function() { return _components__WEBPACK_IMPORTED_MODULE_6__["PostFeaturedImage"]; }); 24230 24231 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PostFeaturedImageCheck", function() { return _components__WEBPACK_IMPORTED_MODULE_6__["PostFeaturedImageCheck"]; }); 24232 24233 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PostFormat", function() { return _components__WEBPACK_IMPORTED_MODULE_6__["PostFormat"]; }); 24234 24235 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PostFormatCheck", function() { return _components__WEBPACK_IMPORTED_MODULE_6__["PostFormatCheck"]; }); 24236 24237 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PostLastRevision", function() { return _components__WEBPACK_IMPORTED_MODULE_6__["PostLastRevision"]; }); 24238 24239 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PostLastRevisionCheck", function() { return _components__WEBPACK_IMPORTED_MODULE_6__["PostLastRevisionCheck"]; }); 24240 24241 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PostLockedModal", function() { return _components__WEBPACK_IMPORTED_MODULE_6__["PostLockedModal"]; }); 24242 24243 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PostPendingStatus", function() { return _components__WEBPACK_IMPORTED_MODULE_6__["PostPendingStatus"]; }); 24244 24245 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PostPendingStatusCheck", function() { return _components__WEBPACK_IMPORTED_MODULE_6__["PostPendingStatusCheck"]; }); 24246 24247 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PostPingbacks", function() { return _components__WEBPACK_IMPORTED_MODULE_6__["PostPingbacks"]; }); 24248 24249 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PostPreviewButton", function() { return _components__WEBPACK_IMPORTED_MODULE_6__["PostPreviewButton"]; }); 24250 24251 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PostPublishButton", function() { return _components__WEBPACK_IMPORTED_MODULE_6__["PostPublishButton"]; }); 24252 24253 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PostPublishButtonLabel", function() { return _components__WEBPACK_IMPORTED_MODULE_6__["PostPublishButtonLabel"]; }); 24254 24255 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PostPublishPanel", function() { return _components__WEBPACK_IMPORTED_MODULE_6__["PostPublishPanel"]; }); 24256 24257 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PostPublishPanelToggle", function() { return _components__WEBPACK_IMPORTED_MODULE_6__["PostPublishPanelToggle"]; }); 24258 24259 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PostSavedState", function() { return _components__WEBPACK_IMPORTED_MODULE_6__["PostSavedState"]; }); 24260 24261 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PostSchedule", function() { return _components__WEBPACK_IMPORTED_MODULE_6__["PostSchedule"]; }); 24262 24263 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PostScheduleCheck", function() { return _components__WEBPACK_IMPORTED_MODULE_6__["PostScheduleCheck"]; }); 24264 24265 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PostScheduleLabel", function() { return _components__WEBPACK_IMPORTED_MODULE_6__["PostScheduleLabel"]; }); 24266 24267 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PostSticky", function() { return _components__WEBPACK_IMPORTED_MODULE_6__["PostSticky"]; }); 24268 24269 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PostStickyCheck", function() { return _components__WEBPACK_IMPORTED_MODULE_6__["PostStickyCheck"]; }); 24270 24271 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PostSwitchToDraftButton", function() { return _components__WEBPACK_IMPORTED_MODULE_6__["PostSwitchToDraftButton"]; }); 24272 24273 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PostTaxonomies", function() { return _components__WEBPACK_IMPORTED_MODULE_6__["PostTaxonomies"]; }); 24274 24275 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PostTaxonomiesCheck", function() { return _components__WEBPACK_IMPORTED_MODULE_6__["PostTaxonomiesCheck"]; }); 24276 24277 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PostTextEditor", function() { return _components__WEBPACK_IMPORTED_MODULE_6__["PostTextEditor"]; }); 24278 24279 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PostTitle", function() { return _components__WEBPACK_IMPORTED_MODULE_6__["PostTitle"]; }); 24280 24281 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PostTrash", function() { return _components__WEBPACK_IMPORTED_MODULE_6__["PostTrash"]; }); 24282 24283 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PostTrashCheck", function() { return _components__WEBPACK_IMPORTED_MODULE_6__["PostTrashCheck"]; }); 24284 24285 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PostTypeSupportCheck", function() { return _components__WEBPACK_IMPORTED_MODULE_6__["PostTypeSupportCheck"]; }); 24286 24287 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PostVisibility", function() { return _components__WEBPACK_IMPORTED_MODULE_6__["PostVisibility"]; }); 24288 24289 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PostVisibilityLabel", function() { return _components__WEBPACK_IMPORTED_MODULE_6__["PostVisibilityLabel"]; }); 24290 24291 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PostVisibilityCheck", function() { return _components__WEBPACK_IMPORTED_MODULE_6__["PostVisibilityCheck"]; }); 24292 24293 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TableOfContents", function() { return _components__WEBPACK_IMPORTED_MODULE_6__["TableOfContents"]; }); 24294 24295 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "UnsavedChangesWarning", function() { return _components__WEBPACK_IMPORTED_MODULE_6__["UnsavedChangesWarning"]; }); 24296 24297 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "WordCount", function() { return _components__WEBPACK_IMPORTED_MODULE_6__["WordCount"]; }); 24298 24299 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "BlockInspector", function() { return _components__WEBPACK_IMPORTED_MODULE_6__["BlockInspector"]; }); 24300 24301 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "BlockList", function() { return _components__WEBPACK_IMPORTED_MODULE_6__["BlockList"]; }); 24302 24303 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "BlockMover", function() { return _components__WEBPACK_IMPORTED_MODULE_6__["BlockMover"]; }); 24304 24305 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "BlockSelectionClearer", function() { return _components__WEBPACK_IMPORTED_MODULE_6__["BlockSelectionClearer"]; }); 24306 24307 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "BlockSettingsMenu", function() { return _components__WEBPACK_IMPORTED_MODULE_6__["BlockSettingsMenu"]; }); 24308 24309 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "_BlockSettingsMenuFirstItem", function() { return _components__WEBPACK_IMPORTED_MODULE_6__["_BlockSettingsMenuFirstItem"]; }); 24310 24311 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "_BlockSettingsMenuPluginsExtension", function() { return _components__WEBPACK_IMPORTED_MODULE_6__["_BlockSettingsMenuPluginsExtension"]; }); 24312 24313 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "BlockTitle", function() { return _components__WEBPACK_IMPORTED_MODULE_6__["BlockTitle"]; }); 24314 24315 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "BlockToolbar", function() { return _components__WEBPACK_IMPORTED_MODULE_6__["BlockToolbar"]; }); 24316 24317 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "CopyHandler", function() { return _components__WEBPACK_IMPORTED_MODULE_6__["CopyHandler"]; }); 24318 24319 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "DefaultBlockAppender", function() { return _components__WEBPACK_IMPORTED_MODULE_6__["DefaultBlockAppender"]; }); 24320 24321 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ErrorBoundary", function() { return _components__WEBPACK_IMPORTED_MODULE_6__["ErrorBoundary"]; }); 24322 24323 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Inserter", function() { return _components__WEBPACK_IMPORTED_MODULE_6__["Inserter"]; }); 24324 24325 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MultiBlocksSwitcher", function() { return _components__WEBPACK_IMPORTED_MODULE_6__["MultiBlocksSwitcher"]; }); 24326 24327 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MultiSelectScrollIntoView", function() { return _components__WEBPACK_IMPORTED_MODULE_6__["MultiSelectScrollIntoView"]; }); 24328 24329 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "NavigableToolbar", function() { return _components__WEBPACK_IMPORTED_MODULE_6__["NavigableToolbar"]; }); 24330 24331 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ObserveTyping", function() { return _components__WEBPACK_IMPORTED_MODULE_6__["ObserveTyping"]; }); 24332 24333 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PreserveScrollInReorder", function() { return _components__WEBPACK_IMPORTED_MODULE_6__["PreserveScrollInReorder"]; }); 24334 24335 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "SkipToSelectedBlock", function() { return _components__WEBPACK_IMPORTED_MODULE_6__["SkipToSelectedBlock"]; }); 24336 24337 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Warning", function() { return _components__WEBPACK_IMPORTED_MODULE_6__["Warning"]; }); 24338 24339 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "WritingFlow", function() { return _components__WEBPACK_IMPORTED_MODULE_6__["WritingFlow"]; }); 24340 24341 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "EditorProvider", function() { return _components__WEBPACK_IMPORTED_MODULE_6__["EditorProvider"]; }); 24342 24343 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "blockAutocompleter", function() { return _components__WEBPACK_IMPORTED_MODULE_6__["blockAutocompleter"]; }); 24344 24345 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "userAutocompleter", function() { return _components__WEBPACK_IMPORTED_MODULE_6__["userAutocompleter"]; }); 24346 24347 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getColorClassName", function() { return _components__WEBPACK_IMPORTED_MODULE_6__["getColorClassName"]; }); 24348 24349 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getColorObjectByAttributeValues", function() { return _components__WEBPACK_IMPORTED_MODULE_6__["getColorObjectByAttributeValues"]; }); 24350 24351 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getColorObjectByColorValue", function() { return _components__WEBPACK_IMPORTED_MODULE_6__["getColorObjectByColorValue"]; }); 24352 24353 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "withColors", function() { return _components__WEBPACK_IMPORTED_MODULE_6__["withColors"]; }); 24354 24355 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getFontSize", function() { return _components__WEBPACK_IMPORTED_MODULE_6__["getFontSize"]; }); 24356 24357 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getFontSizeClass", function() { return _components__WEBPACK_IMPORTED_MODULE_6__["getFontSizeClass"]; }); 24358 24359 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "FontSizePicker", function() { return _components__WEBPACK_IMPORTED_MODULE_6__["FontSizePicker"]; }); 24360 24361 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "withFontSizes", function() { return _components__WEBPACK_IMPORTED_MODULE_6__["withFontSizes"]; }); 24362 24363 /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./utils */ "./node_modules/@wordpress/editor/build-module/utils/index.js"); 24364 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "mediaUpload", function() { return _utils__WEBPACK_IMPORTED_MODULE_7__["mediaUpload"]; }); 24365 24366 /** 24367 * WordPress dependencies 24368 */ 24369 24370 24371 24372 24373 /** 24374 * Internal dependencies 24375 */ 24376 24377 24378 24379 24380 24381 24382 24383 /***/ }), 24384 24385 /***/ "./node_modules/@wordpress/editor/build-module/store/actions.js": 24386 /*!**********************************************************************!*\ 24387 !*** ./node_modules/@wordpress/editor/build-module/store/actions.js ***! 24388 \**********************************************************************/ 24389 /*! exports provided: setupEditor, resetPost, resetAutosave, updatePost, setupEditorState, resetBlocks, receiveBlocks, updateBlockAttributes, updateBlock, selectBlock, startMultiSelect, stopMultiSelect, multiSelect, clearSelectedBlock, toggleSelection, replaceBlocks, replaceBlock, moveBlocksDown, moveBlocksUp, moveBlockToPosition, insertBlock, insertBlocks, showInsertionPoint, hideInsertionPoint, setTemplateValidity, checkTemplateValidity, synchronizeTemplate, editPost, savePost, refreshPost, trashPost, mergeBlocks, autosave, redo, undo, createUndoLevel, removeBlocks, removeBlock, toggleBlockMode, startTyping, stopTyping, createNotice, removeNotice, updatePostLock, createSuccessNotice, createInfoNotice, createErrorNotice, createWarningNotice, fetchReusableBlocks, receiveReusableBlocks, saveReusableBlock, deleteReusableBlock, updateReusableBlockTitle, convertBlockToStatic, convertBlockToReusable, insertDefaultBlock, updateBlockListSettings, updateEditorSettings, registerToken, unregisterToken, enablePublishSidebar, disablePublishSidebar */ 24390 /***/ (function(module, __webpack_exports__, __webpack_require__) { 24391 24392 "use strict"; 24393 __webpack_require__.r(__webpack_exports__); 24394 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setupEditor", function() { return setupEditor; }); 24395 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "resetPost", function() { return resetPost; }); 24396 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "resetAutosave", function() { return resetAutosave; }); 24397 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "updatePost", function() { return updatePost; }); 24398 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setupEditorState", function() { return setupEditorState; }); 24399 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "resetBlocks", function() { return resetBlocks; }); 24400 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "receiveBlocks", function() { return receiveBlocks; }); 24401 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "updateBlockAttributes", function() { return updateBlockAttributes; }); 24402 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "updateBlock", function() { return updateBlock; }); 24403 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "selectBlock", function() { return selectBlock; }); 24404 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "startMultiSelect", function() { return startMultiSelect; }); 24405 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "stopMultiSelect", function() { return stopMultiSelect; }); 24406 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "multiSelect", function() { return multiSelect; }); 24407 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "clearSelectedBlock", function() { return clearSelectedBlock; }); 24408 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "toggleSelection", function() { return toggleSelection; }); 24409 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "replaceBlocks", function() { return replaceBlocks; }); 24410 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "replaceBlock", function() { return replaceBlock; }); 24411 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "moveBlocksDown", function() { return moveBlocksDown; }); 24412 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "moveBlocksUp", function() { return moveBlocksUp; }); 24413 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "moveBlockToPosition", function() { return moveBlockToPosition; }); 24414 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "insertBlock", function() { return insertBlock; }); 24415 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "insertBlocks", function() { return insertBlocks; }); 24416 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "showInsertionPoint", function() { return showInsertionPoint; }); 24417 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "hideInsertionPoint", function() { return hideInsertionPoint; }); 24418 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setTemplateValidity", function() { return setTemplateValidity; }); 24419 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "checkTemplateValidity", function() { return checkTemplateValidity; }); 24420 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "synchronizeTemplate", function() { return synchronizeTemplate; }); 24421 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "editPost", function() { return editPost; }); 24422 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "savePost", function() { return savePost; }); 24423 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "refreshPost", function() { return refreshPost; }); 24424 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "trashPost", function() { return trashPost; }); 24425 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "mergeBlocks", function() { return mergeBlocks; }); 24426 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "autosave", function() { return autosave; }); 24427 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "redo", function() { return redo; }); 24428 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "undo", function() { return undo; }); 24429 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createUndoLevel", function() { return createUndoLevel; }); 24430 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "removeBlocks", function() { return removeBlocks; }); 24431 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "removeBlock", function() { return removeBlock; }); 24432 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "toggleBlockMode", function() { return toggleBlockMode; }); 24433 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "startTyping", function() { return startTyping; }); 24434 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "stopTyping", function() { return stopTyping; }); 24435 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createNotice", function() { return createNotice; }); 24436 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "removeNotice", function() { return removeNotice; }); 24437 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "updatePostLock", function() { return updatePostLock; }); 24438 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createSuccessNotice", function() { return createSuccessNotice; }); 24439 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createInfoNotice", function() { return createInfoNotice; }); 24440 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createErrorNotice", function() { return createErrorNotice; }); 24441 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createWarningNotice", function() { return createWarningNotice; }); 24442 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fetchReusableBlocks", function() { return fetchReusableBlocks; }); 24443 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "receiveReusableBlocks", function() { return receiveReusableBlocks; }); 24444 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "saveReusableBlock", function() { return saveReusableBlock; }); 24445 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "deleteReusableBlock", function() { return deleteReusableBlock; }); 24446 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "updateReusableBlockTitle", function() { return updateReusableBlockTitle; }); 24447 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "convertBlockToStatic", function() { return convertBlockToStatic; }); 24448 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "convertBlockToReusable", function() { return convertBlockToReusable; }); 24449 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "insertDefaultBlock", function() { return insertDefaultBlock; }); 24450 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "updateBlockListSettings", function() { return updateBlockListSettings; }); 24451 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "updateEditorSettings", function() { return updateEditorSettings; }); 24452 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "registerToken", function() { return registerToken; }); 24453 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "unregisterToken", function() { return unregisterToken; }); 24454 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "enablePublishSidebar", function() { return enablePublishSidebar; }); 24455 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "disablePublishSidebar", function() { return disablePublishSidebar; }); 24456 /* harmony import */ var uuid_v4__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! uuid/v4 */ "./node_modules/uuid/v4.js"); 24457 /* harmony import */ var uuid_v4__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(uuid_v4__WEBPACK_IMPORTED_MODULE_0__); 24458 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lodash */ "lodash"); 24459 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_1__); 24460 /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks"); 24461 /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_2__); 24462 /* harmony import */ var _wordpress_deprecated__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/deprecated */ "@wordpress/deprecated"); 24463 /* harmony import */ var _wordpress_deprecated__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_deprecated__WEBPACK_IMPORTED_MODULE_3__); 24464 /** 24465 * External Dependencies 24466 */ 24467 24468 24469 /** 24470 * WordPress dependencies 24471 */ 24472 24473 24474 24475 /** 24476 * Returns an action object used in signalling that editor has initialized with 24477 * the specified post object and editor settings. 24478 * 24479 * @param {Object} post Post object. 24480 * @param {Object} autosaveStatus The Post's autosave status. 24481 * 24482 * @return {Object} Action object. 24483 */ 24484 24485 function setupEditor(post, autosaveStatus) { 24486 return { 24487 type: 'SETUP_EDITOR', 24488 autosave: autosaveStatus, 24489 post: post 24490 }; 24491 } 24492 /** 24493 * Returns an action object used in signalling that the latest version of the 24494 * post has been received, either by initialization or save. 24495 * 24496 * @param {Object} post Post object. 24497 * 24498 * @return {Object} Action object. 24499 */ 24500 24501 function resetPost(post) { 24502 return { 24503 type: 'RESET_POST', 24504 post: post 24505 }; 24506 } 24507 /** 24508 * Returns an action object used in signalling that the latest autosave of the 24509 * post has been received, by initialization or autosave. 24510 * 24511 * @param {Object} post Autosave post object. 24512 * 24513 * @return {Object} Action object. 24514 */ 24515 24516 function resetAutosave(post) { 24517 return { 24518 type: 'RESET_AUTOSAVE', 24519 post: post 24520 }; 24521 } 24522 /** 24523 * Returns an action object used in signalling that a patch of updates for the 24524 * latest version of the post have been received. 24525 * 24526 * @param {Object} edits Updated post fields. 24527 * 24528 * @return {Object} Action object. 24529 */ 24530 24531 function updatePost(edits) { 24532 return { 24533 type: 'UPDATE_POST', 24534 edits: edits 24535 }; 24536 } 24537 /** 24538 * Returns an action object used to setup the editor state when first opening an editor. 24539 * 24540 * @param {Object} post Post object. 24541 * @param {Array} blocks Array of blocks. 24542 * @param {Object} edits Initial edited attributes object. 24543 * 24544 * @return {Object} Action object. 24545 */ 24546 24547 function setupEditorState(post, blocks, edits) { 24548 return { 24549 type: 'SETUP_EDITOR_STATE', 24550 post: post, 24551 blocks: blocks, 24552 edits: edits 24553 }; 24554 } 24555 /** 24556 * Returns an action object used in signalling that blocks state should be 24557 * reset to the specified array of blocks, taking precedence over any other 24558 * content reflected as an edit in state. 24559 * 24560 * @param {Array} blocks Array of blocks. 24561 * 24562 * @return {Object} Action object. 24563 */ 24564 24565 function resetBlocks(blocks) { 24566 return { 24567 type: 'RESET_BLOCKS', 24568 blocks: blocks 24569 }; 24570 } 24571 /** 24572 * Returns an action object used in signalling that blocks have been received. 24573 * Unlike resetBlocks, these should be appended to the existing known set, not 24574 * replacing. 24575 * 24576 * @param {Object[]} blocks Array of block objects. 24577 * 24578 * @return {Object} Action object. 24579 */ 24580 24581 function receiveBlocks(blocks) { 24582 return { 24583 type: 'RECEIVE_BLOCKS', 24584 blocks: blocks 24585 }; 24586 } 24587 /** 24588 * Returns an action object used in signalling that the block attributes with 24589 * the specified client ID has been updated. 24590 * 24591 * @param {string} clientId Block client ID. 24592 * @param {Object} attributes Block attributes to be merged. 24593 * 24594 * @return {Object} Action object. 24595 */ 24596 24597 function updateBlockAttributes(clientId, attributes) { 24598 return { 24599 type: 'UPDATE_BLOCK_ATTRIBUTES', 24600 clientId: clientId, 24601 attributes: attributes 24602 }; 24603 } 24604 /** 24605 * Returns an action object used in signalling that the block with the 24606 * specified client ID has been updated. 24607 * 24608 * @param {string} clientId Block client ID. 24609 * @param {Object} updates Block attributes to be merged. 24610 * 24611 * @return {Object} Action object. 24612 */ 24613 24614 function updateBlock(clientId, updates) { 24615 return { 24616 type: 'UPDATE_BLOCK', 24617 clientId: clientId, 24618 updates: updates 24619 }; 24620 } 24621 /** 24622 * Returns an action object used in signalling that the block with the 24623 * specified client ID has been selected, optionally accepting a position 24624 * value reflecting its selection directionality. An initialPosition of -1 24625 * reflects a reverse selection. 24626 * 24627 * @param {string} clientId Block client ID. 24628 * @param {?number} initialPosition Optional initial position. Pass as -1 to 24629 * reflect reverse selection. 24630 * 24631 * @return {Object} Action object. 24632 */ 24633 24634 function selectBlock(clientId) { 24635 var initialPosition = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; 24636 return { 24637 type: 'SELECT_BLOCK', 24638 initialPosition: initialPosition, 24639 clientId: clientId 24640 }; 24641 } 24642 function startMultiSelect() { 24643 return { 24644 type: 'START_MULTI_SELECT' 24645 }; 24646 } 24647 function stopMultiSelect() { 24648 return { 24649 type: 'STOP_MULTI_SELECT' 24650 }; 24651 } 24652 function multiSelect(start, end) { 24653 return { 24654 type: 'MULTI_SELECT', 24655 start: start, 24656 end: end 24657 }; 24658 } 24659 function clearSelectedBlock() { 24660 return { 24661 type: 'CLEAR_SELECTED_BLOCK' 24662 }; 24663 } 24664 /** 24665 * Returns an action object that enables or disables block selection. 24666 * 24667 * @param {boolean} [isSelectionEnabled=true] Whether block selection should 24668 * be enabled. 24669 24670 * @return {Object} Action object. 24671 */ 24672 24673 function toggleSelection() { 24674 var isSelectionEnabled = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true; 24675 return { 24676 type: 'TOGGLE_SELECTION', 24677 isSelectionEnabled: isSelectionEnabled 24678 }; 24679 } 24680 /** 24681 * Returns an action object signalling that a blocks should be replaced with 24682 * one or more replacement blocks. 24683 * 24684 * @param {(string|string[])} clientIds Block client ID(s) to replace. 24685 * @param {(Object|Object[])} blocks Replacement block(s). 24686 * 24687 * @return {Object} Action object. 24688 */ 24689 24690 function replaceBlocks(clientIds, blocks) { 24691 return { 24692 type: 'REPLACE_BLOCKS', 24693 clientIds: Object(lodash__WEBPACK_IMPORTED_MODULE_1__["castArray"])(clientIds), 24694 blocks: Object(lodash__WEBPACK_IMPORTED_MODULE_1__["castArray"])(blocks), 24695 time: Date.now() 24696 }; 24697 } 24698 /** 24699 * Returns an action object signalling that a single block should be replaced 24700 * with one or more replacement blocks. 24701 * 24702 * @param {(string|string[])} clientId Block client ID to replace. 24703 * @param {(Object|Object[])} block Replacement block(s). 24704 * 24705 * @return {Object} Action object. 24706 */ 24707 24708 function replaceBlock(clientId, block) { 24709 return replaceBlocks(clientId, block); 24710 } 24711 /** 24712 * Higher-order action creator which, given the action type to dispatch creates 24713 * an action creator for managing block movement. 24714 * 24715 * @param {string} type Action type to dispatch. 24716 * 24717 * @return {Function} Action creator. 24718 */ 24719 24720 function createOnMove(type) { 24721 return function (clientIds, rootClientId) { 24722 return { 24723 clientIds: Object(lodash__WEBPACK_IMPORTED_MODULE_1__["castArray"])(clientIds), 24724 type: type, 24725 rootClientId: rootClientId 24726 }; 24727 }; 24728 } 24729 24730 var moveBlocksDown = createOnMove('MOVE_BLOCKS_DOWN'); 24731 var moveBlocksUp = createOnMove('MOVE_BLOCKS_UP'); 24732 /** 24733 * Returns an action object signalling that an indexed block should be moved 24734 * to a new index. 24735 * 24736 * @param {?string} clientId The client ID of the block. 24737 * @param {?string} fromRootClientId Root client ID source. 24738 * @param {?string} toRootClientId Root client ID destination. 24739 * @param {?string} layout Layout to move the block into. 24740 * @param {number} index The index to move the block into. 24741 * 24742 * @return {Object} Action object. 24743 */ 24744 24745 function moveBlockToPosition(clientId, fromRootClientId, toRootClientId, layout, index) { 24746 return { 24747 type: 'MOVE_BLOCK_TO_POSITION', 24748 fromRootClientId: fromRootClientId, 24749 toRootClientId: toRootClientId, 24750 clientId: clientId, 24751 index: index, 24752 layout: layout 24753 }; 24754 } 24755 /** 24756 * Returns an action object used in signalling that a single block should be 24757 * inserted, optionally at a specific index respective a root block list. 24758 * 24759 * @param {Object} block Block object to insert. 24760 * @param {?number} index Index at which block should be inserted. 24761 * @param {?string} rootClientId Optional root client ID of block list on which 24762 * to insert. 24763 * 24764 * @return {Object} Action object. 24765 */ 24766 24767 function insertBlock(block, index, rootClientId) { 24768 return insertBlocks([block], index, rootClientId); 24769 } 24770 /** 24771 * Returns an action object used in signalling that an array of blocks should 24772 * be inserted, optionally at a specific index respective a root block list. 24773 * 24774 * @param {Object[]} blocks Block objects to insert. 24775 * @param {?number} index Index at which block should be inserted. 24776 * @param {?string} rootClientId Optional root cliente ID of block list on 24777 * which to insert. 24778 * 24779 * @return {Object} Action object. 24780 */ 24781 24782 function insertBlocks(blocks, index, rootClientId) { 24783 return { 24784 type: 'INSERT_BLOCKS', 24785 blocks: Object(lodash__WEBPACK_IMPORTED_MODULE_1__["castArray"])(blocks), 24786 index: index, 24787 rootClientId: rootClientId, 24788 time: Date.now() 24789 }; 24790 } 24791 /** 24792 * Returns an action object used in signalling that the insertion point should 24793 * be shown. 24794 * 24795 * @return {Object} Action object. 24796 */ 24797 24798 function showInsertionPoint() { 24799 return { 24800 type: 'SHOW_INSERTION_POINT' 24801 }; 24802 } 24803 /** 24804 * Returns an action object hiding the insertion point. 24805 * 24806 * @return {Object} Action object. 24807 */ 24808 24809 function hideInsertionPoint() { 24810 return { 24811 type: 'HIDE_INSERTION_POINT' 24812 }; 24813 } 24814 /** 24815 * Returns an action object resetting the template validity. 24816 * 24817 * @param {boolean} isValid template validity flag. 24818 * 24819 * @return {Object} Action object. 24820 */ 24821 24822 function setTemplateValidity(isValid) { 24823 return { 24824 type: 'SET_TEMPLATE_VALIDITY', 24825 isValid: isValid 24826 }; 24827 } 24828 /** 24829 * Returns an action object to check the template validity. 24830 * 24831 * @return {Object} Action object. 24832 */ 24833 24834 function checkTemplateValidity() { 24835 // TODO: Hello future deprecation remover. Please ensure also to remove all 24836 // references to CHECK_TEMPLATE_VALIDITY, notably its effect handler. 24837 _wordpress_deprecated__WEBPACK_IMPORTED_MODULE_3___default()('checkTemplateValidity action (`core/editor`)', { 24838 version: '4.1', 24839 plugin: 'Gutenberg', 24840 hint: 'Validity is verified automatically upon block reset.' 24841 }); 24842 return { 24843 type: 'CHECK_TEMPLATE_VALIDITY' 24844 }; 24845 } 24846 /** 24847 * Returns an action object synchronize the template with the list of blocks 24848 * 24849 * @return {Object} Action object. 24850 */ 24851 24852 function synchronizeTemplate() { 24853 return { 24854 type: 'SYNCHRONIZE_TEMPLATE' 24855 }; 24856 } 24857 function editPost(edits) { 24858 return { 24859 type: 'EDIT_POST', 24860 edits: edits 24861 }; 24862 } 24863 /** 24864 * Returns an action object to save the post. 24865 * 24866 * @param {Object} options Options for the save. 24867 * @param {boolean} options.autosave Perform an autosave if true. 24868 * 24869 * @return {Object} Action object. 24870 */ 24871 24872 function savePost() { 24873 var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; 24874 return { 24875 type: 'REQUEST_POST_UPDATE', 24876 options: options 24877 }; 24878 } 24879 function refreshPost() { 24880 return { 24881 type: 'REFRESH_POST' 24882 }; 24883 } 24884 function trashPost(postId, postType) { 24885 return { 24886 type: 'TRASH_POST', 24887 postId: postId, 24888 postType: postType 24889 }; 24890 } 24891 /** 24892 * Returns an action object used in signalling that two blocks should be merged 24893 * 24894 * @param {string} firstBlockClientId Client ID of the first block to merge. 24895 * @param {string} secondBlockClientId Client ID of the second block to merge. 24896 * 24897 * @return {Object} Action object. 24898 */ 24899 24900 function mergeBlocks(firstBlockClientId, secondBlockClientId) { 24901 return { 24902 type: 'MERGE_BLOCKS', 24903 blocks: [firstBlockClientId, secondBlockClientId] 24904 }; 24905 } 24906 /** 24907 * Returns an action object used in signalling that the post should autosave. 24908 * 24909 * @return {Object} Action object. 24910 */ 24911 24912 function autosave() { 24913 return savePost({ 24914 autosave: true 24915 }); 24916 } 24917 /** 24918 * Returns an action object used in signalling that undo history should 24919 * restore last popped state. 24920 * 24921 * @return {Object} Action object. 24922 */ 24923 24924 function redo() { 24925 return { 24926 type: 'REDO' 24927 }; 24928 } 24929 /** 24930 * Returns an action object used in signalling that undo history should pop. 24931 * 24932 * @return {Object} Action object. 24933 */ 24934 24935 function undo() { 24936 return { 24937 type: 'UNDO' 24938 }; 24939 } 24940 /** 24941 * Returns an action object used in signalling that undo history record should 24942 * be created. 24943 * 24944 * @return {Object} Action object. 24945 */ 24946 24947 function createUndoLevel() { 24948 return { 24949 type: 'CREATE_UNDO_LEVEL' 24950 }; 24951 } 24952 /** 24953 * Returns an action object used in signalling that the blocks corresponding to 24954 * the set of specified client IDs are to be removed. 24955 * 24956 * @param {string|string[]} clientIds Client IDs of blocks to remove. 24957 * @param {boolean} selectPrevious True if the previous block should be 24958 * selected when a block is removed. 24959 * 24960 * @return {Object} Action object. 24961 */ 24962 24963 function removeBlocks(clientIds) { 24964 var selectPrevious = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true; 24965 return { 24966 type: 'REMOVE_BLOCKS', 24967 clientIds: Object(lodash__WEBPACK_IMPORTED_MODULE_1__["castArray"])(clientIds), 24968 selectPrevious: selectPrevious 24969 }; 24970 } 24971 /** 24972 * Returns an action object used in signalling that the block with the 24973 * specified client ID is to be removed. 24974 * 24975 * @param {string} clientId Client ID of block to remove. 24976 * @param {boolean} selectPrevious True if the previous block should be 24977 * selected when a block is removed. 24978 * 24979 * @return {Object} Action object. 24980 */ 24981 24982 function removeBlock(clientId, selectPrevious) { 24983 return removeBlocks([clientId], selectPrevious); 24984 } 24985 /** 24986 * Returns an action object used to toggle the block editing mode between 24987 * visual and HTML modes. 24988 * 24989 * @param {string} clientId Block client ID. 24990 * 24991 * @return {Object} Action object. 24992 */ 24993 24994 function toggleBlockMode(clientId) { 24995 return { 24996 type: 'TOGGLE_BLOCK_MODE', 24997 clientId: clientId 24998 }; 24999 } 25000 /** 25001 * Returns an action object used in signalling that the user has begun to type. 25002 * 25003 * @return {Object} Action object. 25004 */ 25005 25006 function startTyping() { 25007 return { 25008 type: 'START_TYPING' 25009 }; 25010 } 25011 /** 25012 * Returns an action object used in signalling that the user has stopped typing. 25013 * 25014 * @return {Object} Action object. 25015 */ 25016 25017 function stopTyping() { 25018 return { 25019 type: 'STOP_TYPING' 25020 }; 25021 } 25022 /** 25023 * Returns an action object used to create a notice. 25024 * 25025 * @param {string} status The notice status. 25026 * @param {WPElement} content The notice content. 25027 * @param {?Object} options The notice options. Available options: 25028 * `id` (string; default auto-generated) 25029 * `isDismissible` (boolean; default `true`). 25030 * 25031 * @return {Object} Action object. 25032 */ 25033 25034 function createNotice(status, content) { 25035 var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; 25036 var _options$id = options.id, 25037 id = _options$id === void 0 ? uuid_v4__WEBPACK_IMPORTED_MODULE_0___default()() : _options$id, 25038 _options$isDismissibl = options.isDismissible, 25039 isDismissible = _options$isDismissibl === void 0 ? true : _options$isDismissibl, 25040 spokenMessage = options.spokenMessage; 25041 return { 25042 type: 'CREATE_NOTICE', 25043 notice: { 25044 id: id, 25045 status: status, 25046 content: content, 25047 isDismissible: isDismissible, 25048 spokenMessage: spokenMessage 25049 } 25050 }; 25051 } 25052 /** 25053 * Returns an action object used to remove a notice. 25054 * 25055 * @param {string} id The notice id. 25056 * 25057 * @return {Object} Action object. 25058 */ 25059 25060 function removeNotice(id) { 25061 return { 25062 type: 'REMOVE_NOTICE', 25063 noticeId: id 25064 }; 25065 } 25066 /** 25067 * Returns an action object used to lock the editor. 25068 * 25069 * @param {Object} lock Details about the post lock status, user, and nonce. 25070 * 25071 * @return {Object} Action object. 25072 */ 25073 25074 function updatePostLock(lock) { 25075 return { 25076 type: 'UPDATE_POST_LOCK', 25077 lock: lock 25078 }; 25079 } 25080 var createSuccessNotice = Object(lodash__WEBPACK_IMPORTED_MODULE_1__["partial"])(createNotice, 'success'); 25081 var createInfoNotice = Object(lodash__WEBPACK_IMPORTED_MODULE_1__["partial"])(createNotice, 'info'); 25082 var createErrorNotice = Object(lodash__WEBPACK_IMPORTED_MODULE_1__["partial"])(createNotice, 'error'); 25083 var createWarningNotice = Object(lodash__WEBPACK_IMPORTED_MODULE_1__["partial"])(createNotice, 'warning'); 25084 /** 25085 * Returns an action object used to fetch a single reusable block or all 25086 * reusable blocks from the REST API into the store. 25087 * 25088 * @param {?string} id If given, only a single reusable block with this ID will 25089 * be fetched. 25090 * 25091 * @return {Object} Action object. 25092 */ 25093 25094 function fetchReusableBlocks(id) { 25095 return { 25096 type: 'FETCH_REUSABLE_BLOCKS', 25097 id: id 25098 }; 25099 } 25100 /** 25101 * Returns an action object used in signalling that reusable blocks have been 25102 * received. `results` is an array of objects containing: 25103 * - `reusableBlock` - Details about how the reusable block is persisted. 25104 * - `parsedBlock` - The original block. 25105 * 25106 * @param {Object[]} results Reusable blocks received. 25107 * 25108 * @return {Object} Action object. 25109 */ 25110 25111 function receiveReusableBlocks(results) { 25112 return { 25113 type: 'RECEIVE_REUSABLE_BLOCKS', 25114 results: results 25115 }; 25116 } 25117 /** 25118 * Returns an action object used to save a reusable block that's in the store to 25119 * the REST API. 25120 * 25121 * @param {Object} id The ID of the reusable block to save. 25122 * 25123 * @return {Object} Action object. 25124 */ 25125 25126 function saveReusableBlock(id) { 25127 return { 25128 type: 'SAVE_REUSABLE_BLOCK', 25129 id: id 25130 }; 25131 } 25132 /** 25133 * Returns an action object used to delete a reusable block via the REST API. 25134 * 25135 * @param {number} id The ID of the reusable block to delete. 25136 * 25137 * @return {Object} Action object. 25138 */ 25139 25140 function deleteReusableBlock(id) { 25141 return { 25142 type: 'DELETE_REUSABLE_BLOCK', 25143 id: id 25144 }; 25145 } 25146 /** 25147 * Returns an action object used in signalling that a reusable block's title is 25148 * to be updated. 25149 * 25150 * @param {number} id The ID of the reusable block to update. 25151 * @param {string} title The new title. 25152 * 25153 * @return {Object} Action object. 25154 */ 25155 25156 function updateReusableBlockTitle(id, title) { 25157 return { 25158 type: 'UPDATE_REUSABLE_BLOCK_TITLE', 25159 id: id, 25160 title: title 25161 }; 25162 } 25163 /** 25164 * Returns an action object used to convert a reusable block into a static block. 25165 * 25166 * @param {string} clientId The client ID of the block to attach. 25167 * 25168 * @return {Object} Action object. 25169 */ 25170 25171 function convertBlockToStatic(clientId) { 25172 return { 25173 type: 'CONVERT_BLOCK_TO_STATIC', 25174 clientId: clientId 25175 }; 25176 } 25177 /** 25178 * Returns an action object used to convert a static block into a reusable block. 25179 * 25180 * @param {string} clientIds The client IDs of the block to detach. 25181 * 25182 * @return {Object} Action object. 25183 */ 25184 25185 function convertBlockToReusable(clientIds) { 25186 return { 25187 type: 'CONVERT_BLOCK_TO_REUSABLE', 25188 clientIds: Object(lodash__WEBPACK_IMPORTED_MODULE_1__["castArray"])(clientIds) 25189 }; 25190 } 25191 /** 25192 * Returns an action object used in signalling that a new block of the default 25193 * type should be added to the block list. 25194 * 25195 * @param {?Object} attributes Optional attributes of the block to assign. 25196 * @param {?string} rootClientId Optional root client ID of block list on which 25197 * to append. 25198 * @param {?number} index Optional index where to insert the default block 25199 * 25200 * @return {Object} Action object 25201 */ 25202 25203 function insertDefaultBlock(attributes, rootClientId, index) { 25204 var block = Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_2__["createBlock"])(Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_2__["getDefaultBlockName"])(), attributes); 25205 return insertBlock(block, index, rootClientId); 25206 } 25207 /** 25208 * Returns an action object that changes the nested settings of a given block. 25209 * 25210 * @param {string} clientId Client ID of the block whose nested setting are 25211 * being received. 25212 * @param {Object} settings Object with the new settings for the nested block. 25213 * 25214 * @return {Object} Action object 25215 */ 25216 25217 function updateBlockListSettings(clientId, settings) { 25218 return { 25219 type: 'UPDATE_BLOCK_LIST_SETTINGS', 25220 clientId: clientId, 25221 settings: settings 25222 }; 25223 } 25224 /* 25225 * Returns an action object used in signalling that the editor settings have been updated. 25226 * 25227 * @param {Object} settings Updated settings 25228 * 25229 * @return {Object} Action object 25230 */ 25231 25232 function updateEditorSettings(settings) { 25233 return { 25234 type: 'UPDATE_EDITOR_SETTINGS', 25235 settings: settings 25236 }; 25237 } 25238 function registerToken(name, settings) { 25239 return { 25240 type: 'REGISTER_TOKEN', 25241 name: name, 25242 settings: settings 25243 }; 25244 } 25245 function unregisterToken(name) { 25246 return { 25247 type: 'UNREGISTER_TOKEN', 25248 name: name 25249 }; 25250 } 25251 /** 25252 * Returns an action object used in signalling that the user has enabled the publish sidebar. 25253 * 25254 * @return {Object} Action object 25255 */ 25256 25257 function enablePublishSidebar() { 25258 return { 25259 type: 'ENABLE_PUBLISH_SIDEBAR' 25260 }; 25261 } 25262 /** 25263 * Returns an action object used in signalling that the user has disabled the publish sidebar. 25264 * 25265 * @return {Object} Action object 25266 */ 25267 25268 function disablePublishSidebar() { 25269 return { 25270 type: 'DISABLE_PUBLISH_SIDEBAR' 25271 }; 25272 } 25273 25274 25275 /***/ }), 25276 25277 /***/ "./node_modules/@wordpress/editor/build-module/store/array.js": 25278 /*!********************************************************************!*\ 25279 !*** ./node_modules/@wordpress/editor/build-module/store/array.js ***! 25280 \********************************************************************/ 25281 /*! exports provided: insertAt, moveTo */ 25282 /***/ (function(module, __webpack_exports__, __webpack_require__) { 25283 25284 "use strict"; 25285 __webpack_require__.r(__webpack_exports__); 25286 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "insertAt", function() { return insertAt; }); 25287 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "moveTo", function() { return moveTo; }); 25288 /* harmony import */ var _babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/toConsumableArray */ "./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js"); 25289 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lodash */ "lodash"); 25290 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_1__); 25291 25292 25293 /** 25294 * External dependencies 25295 */ 25296 25297 /** 25298 * Insert one or multiple elements into a given position of an array. 25299 * 25300 * @param {Array} array Source array. 25301 * @param {*} elements Elements to insert. 25302 * @param {number} index Insert Position. 25303 * 25304 * @return {Array} Result. 25305 */ 25306 25307 function insertAt(array, elements, index) { 25308 return Object(_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_0__["default"])(array.slice(0, index)).concat(Object(_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_0__["default"])(Object(lodash__WEBPACK_IMPORTED_MODULE_1__["castArray"])(elements)), Object(_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_0__["default"])(array.slice(index))); 25309 } 25310 /** 25311 * Moves an element in an array. 25312 * 25313 * @param {Array} array Source array. 25314 * @param {number} from Source index. 25315 * @param {number} to Destination index. 25316 * @param {number} count Number of elements to move. 25317 * 25318 * @return {Array} Result. 25319 */ 25320 25321 function moveTo(array, from, to) { 25322 var count = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 1; 25323 25324 var withoutMovedElements = Object(_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_0__["default"])(array); 25325 25326 withoutMovedElements.splice(from, count); 25327 return insertAt(withoutMovedElements, array.slice(from, from + count), to); 25328 } 25329 25330 25331 /***/ }), 25332 25333 /***/ "./node_modules/@wordpress/editor/build-module/store/defaults.js": 25334 /*!***********************************************************************!*\ 25335 !*** ./node_modules/@wordpress/editor/build-module/store/defaults.js ***! 25336 \***********************************************************************/ 25337 /*! exports provided: PREFERENCES_DEFAULTS, EDITOR_SETTINGS_DEFAULTS */ 25338 /***/ (function(module, __webpack_exports__, __webpack_require__) { 25339 25340 "use strict"; 25341 __webpack_require__.r(__webpack_exports__); 25342 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PREFERENCES_DEFAULTS", function() { return PREFERENCES_DEFAULTS; }); 25343 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EDITOR_SETTINGS_DEFAULTS", function() { return EDITOR_SETTINGS_DEFAULTS; }); 25344 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); 25345 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__); 25346 /** 25347 * WordPress dependencies 25348 */ 25349 25350 var PREFERENCES_DEFAULTS = { 25351 insertUsage: {}, 25352 isPublishSidebarEnabled: true 25353 }; 25354 /** 25355 * The default editor settings 25356 * 25357 * alignWide boolean Enable/Disable Wide/Full Alignments 25358 * colors Array Palette colors 25359 * fontSizes Array Available font sizes 25360 * maxWidth number Max width to constraint resizing 25361 * blockTypes boolean|Array Allowed block types 25362 * hasFixedToolbar boolean Whether or not the editor toolbar is fixed 25363 * focusMode boolean Whether the focus mode is enabled or not 25364 */ 25365 25366 var EDITOR_SETTINGS_DEFAULTS = { 25367 alignWide: false, 25368 colors: [{ 25369 name: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__["__"])('Pale pink'), 25370 slug: 'pale-pink', 25371 color: '#f78da7' 25372 }, { 25373 name: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__["__"])('Vivid red'), 25374 slug: 'vivid-red', 25375 color: '#cf2e2e' 25376 }, { 25377 name: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__["__"])('Luminous vivid orange'), 25378 slug: 'luminous-vivid-orange', 25379 color: '#ff6900' 25380 }, { 25381 name: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__["__"])('Luminous vivid amber'), 25382 slug: 'luminous-vivid-amber', 25383 color: '#fcb900' 25384 }, { 25385 name: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__["__"])('Light green cyan'), 25386 slug: 'light-green-cyan', 25387 color: '#7bdcb5' 25388 }, { 25389 name: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__["__"])('Vivid green cyan'), 25390 slug: 'vivid-green-cyan', 25391 color: '#00d084' 25392 }, { 25393 name: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__["__"])('Pale cyan blue'), 25394 slug: 'pale-cyan-blue', 25395 color: '#8ed1fc' 25396 }, { 25397 name: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__["__"])('Vivid cyan blue'), 25398 slug: 'vivid-cyan-blue', 25399 color: '#0693e3' 25400 }, { 25401 name: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__["__"])('Very light gray'), 25402 slug: 'very-light-gray', 25403 color: '#eeeeee' 25404 }, { 25405 name: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__["__"])('Cyan bluish gray'), 25406 slug: 'cyan-bluish-gray', 25407 color: '#abb8c3' 25408 }, { 25409 name: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__["__"])('Very dark gray'), 25410 slug: 'very-dark-gray', 25411 color: '#313131' 25412 }], 25413 fontSizes: [{ 25414 name: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__["__"])('Small'), 25415 size: 13, 25416 slug: 'small' 25417 }, { 25418 name: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__["__"])('Normal'), 25419 size: 16, 25420 slug: 'normal' 25421 }, { 25422 name: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__["__"])('Medium'), 25423 size: 20, 25424 slug: 'medium' 25425 }, { 25426 name: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__["__"])('Large'), 25427 size: 36, 25428 slug: 'large' 25429 }, { 25430 name: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__["__"])('Huge'), 25431 size: 48, 25432 slug: 'huge' 25433 }], 25434 // This is current max width of the block inner area 25435 // It's used to constraint image resizing and this value could be overridden later by themes 25436 maxWidth: 580, 25437 // Allowed block types for the editor, defaulting to true (all supported). 25438 allowedBlockTypes: true, 25439 // Maximum upload size in bytes allowed for the site. 25440 maxUploadFileSize: 0, 25441 // List of allowed mime types and file extensions. 25442 allowedMimeTypes: null 25443 }; 25444 25445 25446 /***/ }), 25447 25448 /***/ "./node_modules/@wordpress/editor/build-module/store/effects.js": 25449 /*!**********************************************************************!*\ 25450 !*** ./node_modules/@wordpress/editor/build-module/store/effects.js ***! 25451 \**********************************************************************/ 25452 /*! exports provided: validateBlocksToTemplate, selectPreviousBlock, ensureDefaultBlock, default */ 25453 /***/ (function(module, __webpack_exports__, __webpack_require__) { 25454 25455 "use strict"; 25456 __webpack_require__.r(__webpack_exports__); 25457 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "validateBlocksToTemplate", function() { return validateBlocksToTemplate; }); 25458 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "selectPreviousBlock", function() { return selectPreviousBlock; }); 25459 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ensureDefaultBlock", function() { return ensureDefaultBlock; }); 25460 /* harmony import */ var _babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/toConsumableArray */ "./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js"); 25461 /* harmony import */ var _babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/slicedToArray */ "./node_modules/@babel/runtime/helpers/esm/slicedToArray.js"); 25462 /* harmony import */ var _babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectSpread */ "./node_modules/@babel/runtime/helpers/esm/objectSpread.js"); 25463 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); 25464 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__); 25465 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! lodash */ "lodash"); 25466 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_4__); 25467 /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks"); 25468 /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_5__); 25469 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); 25470 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_6__); 25471 /* harmony import */ var _wordpress_a11y__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @wordpress/a11y */ "@wordpress/a11y"); 25472 /* harmony import */ var _wordpress_a11y__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_wordpress_a11y__WEBPACK_IMPORTED_MODULE_7__); 25473 /* harmony import */ var _actions__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./actions */ "./node_modules/@wordpress/editor/build-module/store/actions.js"); 25474 /* harmony import */ var _selectors__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./selectors */ "./node_modules/@wordpress/editor/build-module/store/selectors.js"); 25475 /* harmony import */ var _effects_reusable_blocks__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./effects/reusable-blocks */ "./node_modules/@wordpress/editor/build-module/store/effects/reusable-blocks.js"); 25476 /* harmony import */ var _effects_posts__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./effects/posts */ "./node_modules/@wordpress/editor/build-module/store/effects/posts.js"); 25477 25478 25479 25480 25481 25482 /** 25483 * External dependencies 25484 */ 25485 25486 /** 25487 * WordPress dependencies 25488 */ 25489 25490 25491 25492 25493 /** 25494 * Internal dependencies 25495 */ 25496 25497 25498 25499 25500 25501 /** 25502 * Block validity is a function of blocks state (at the point of a 25503 * reset) and the template setting. As a compromise to its placement 25504 * across distinct parts of state, it is implemented here as a side- 25505 * effect of the block reset action. 25506 * 25507 * @param {Object} action RESET_BLOCKS action. 25508 * @param {Object} store Store instance. 25509 * 25510 * @return {?Object} New validity set action if validity has changed. 25511 */ 25512 25513 function validateBlocksToTemplate(action, store) { 25514 var state = store.getState(); 25515 var template = Object(_selectors__WEBPACK_IMPORTED_MODULE_9__["getTemplate"])(state); 25516 var templateLock = Object(_selectors__WEBPACK_IMPORTED_MODULE_9__["getTemplateLock"])(state); // Unlocked templates are considered always valid because they act 25517 // as default values only. 25518 25519 var isBlocksValidToTemplate = !template || templateLock !== 'all' || Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_5__["doBlocksMatchTemplate"])(action.blocks, template); // Update if validity has changed. 25520 25521 if (isBlocksValidToTemplate !== Object(_selectors__WEBPACK_IMPORTED_MODULE_9__["isValidTemplate"])(state)) { 25522 return Object(_actions__WEBPACK_IMPORTED_MODULE_8__["setTemplateValidity"])(isBlocksValidToTemplate); 25523 } 25524 } 25525 /** 25526 * Effect handler which will return a block select action to select the block 25527 * occurring before the selected block in the previous state, unless it is the 25528 * same block or the action includes a falsey `selectPrevious` option flag. 25529 * 25530 * @param {Object} action Action which had initiated the effect handler. 25531 * @param {Object} store Store instance. 25532 * 25533 * @return {?Object} Block select action to select previous, if applicable. 25534 */ 25535 25536 function selectPreviousBlock(action, store) { 25537 // if the action says previous block should not be selected don't do anything. 25538 if (!action.selectPrevious) { 25539 return; 25540 } 25541 25542 var firstRemovedBlockClientId = action.clientIds[0]; 25543 var state = store.getState(); 25544 var currentSelectedBlock = Object(_selectors__WEBPACK_IMPORTED_MODULE_9__["getSelectedBlock"])(state); // recreate the state before the block was removed. 25545 25546 var previousState = Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_2__["default"])({}, state, { 25547 editor: { 25548 present: Object(lodash__WEBPACK_IMPORTED_MODULE_4__["last"])(state.editor.past) 25549 } 25550 }); // rootClientId of the removed block. 25551 25552 25553 var rootClientId = Object(_selectors__WEBPACK_IMPORTED_MODULE_9__["getBlockRootClientId"])(previousState, firstRemovedBlockClientId); // Client ID of the block that was before the removed block or the 25554 // rootClientId if the removed block was first amongst its siblings. 25555 25556 var blockClientIdToSelect = Object(_selectors__WEBPACK_IMPORTED_MODULE_9__["getPreviousBlockClientId"])(previousState, firstRemovedBlockClientId) || rootClientId; // Dispatch select block action if the currently selected block 25557 // is not already the block we want to be selected. 25558 25559 if (blockClientIdToSelect !== currentSelectedBlock) { 25560 return Object(_actions__WEBPACK_IMPORTED_MODULE_8__["selectBlock"])(blockClientIdToSelect, -1); 25561 } 25562 } 25563 /** 25564 * Effect handler which will return a default block insertion action if there 25565 * are no other blocks at the root of the editor. This is expected to be used 25566 * in actions which may result in no blocks remaining in the editor (removal, 25567 * replacement, etc). 25568 * 25569 * @param {Object} action Action which had initiated the effect handler. 25570 * @param {Object} store Store instance. 25571 * 25572 * @return {?Object} Default block insert action, if no other blocks exist. 25573 */ 25574 25575 function ensureDefaultBlock(action, store) { 25576 if (!Object(_selectors__WEBPACK_IMPORTED_MODULE_9__["getBlockCount"])(store.getState())) { 25577 return Object(_actions__WEBPACK_IMPORTED_MODULE_8__["insertDefaultBlock"])(); 25578 } 25579 } 25580 /* harmony default export */ __webpack_exports__["default"] = ({ 25581 REQUEST_POST_UPDATE: function REQUEST_POST_UPDATE(action, store) { 25582 Object(_effects_posts__WEBPACK_IMPORTED_MODULE_11__["requestPostUpdate"])(action, store); 25583 }, 25584 REQUEST_POST_UPDATE_SUCCESS: _effects_posts__WEBPACK_IMPORTED_MODULE_11__["requestPostUpdateSuccess"], 25585 REQUEST_POST_UPDATE_FAILURE: _effects_posts__WEBPACK_IMPORTED_MODULE_11__["requestPostUpdateFailure"], 25586 TRASH_POST: function TRASH_POST(action, store) { 25587 Object(_effects_posts__WEBPACK_IMPORTED_MODULE_11__["trashPost"])(action, store); 25588 }, 25589 TRASH_POST_FAILURE: _effects_posts__WEBPACK_IMPORTED_MODULE_11__["trashPostFailure"], 25590 REFRESH_POST: function REFRESH_POST(action, store) { 25591 Object(_effects_posts__WEBPACK_IMPORTED_MODULE_11__["refreshPost"])(action, store); 25592 }, 25593 MERGE_BLOCKS: function MERGE_BLOCKS(action, store) { 25594 var dispatch = store.dispatch; 25595 var state = store.getState(); 25596 25597 var _action$blocks = Object(_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_1__["default"])(action.blocks, 2), 25598 firstBlockClientId = _action$blocks[0], 25599 secondBlockClientId = _action$blocks[1]; 25600 25601 var blockA = Object(_selectors__WEBPACK_IMPORTED_MODULE_9__["getBlock"])(state, firstBlockClientId); 25602 var blockB = Object(_selectors__WEBPACK_IMPORTED_MODULE_9__["getBlock"])(state, secondBlockClientId); 25603 var blockType = Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_5__["getBlockType"])(blockA.name); // Only focus the previous block if it's not mergeable 25604 25605 if (!blockType.merge) { 25606 dispatch(Object(_actions__WEBPACK_IMPORTED_MODULE_8__["selectBlock"])(blockA.clientId)); 25607 return; 25608 } // We can only merge blocks with similar types 25609 // thus, we transform the block to merge first 25610 25611 25612 var blocksWithTheSameType = blockA.name === blockB.name ? [blockB] : Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_5__["switchToBlockType"])(blockB, blockA.name); // If the block types can not match, do nothing 25613 25614 if (!blocksWithTheSameType || !blocksWithTheSameType.length) { 25615 return; 25616 } // Calling the merge to update the attributes and remove the block to be merged 25617 25618 25619 var updatedAttributes = blockType.merge(blockA.attributes, blocksWithTheSameType[0].attributes); 25620 dispatch(Object(_actions__WEBPACK_IMPORTED_MODULE_8__["selectBlock"])(blockA.clientId, -1)); 25621 dispatch(Object(_actions__WEBPACK_IMPORTED_MODULE_8__["replaceBlocks"])([blockA.clientId, blockB.clientId], [Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_2__["default"])({}, blockA, { 25622 attributes: Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_2__["default"])({}, blockA.attributes, updatedAttributes) 25623 })].concat(Object(_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_0__["default"])(blocksWithTheSameType.slice(1))))); 25624 }, 25625 SETUP_EDITOR: function SETUP_EDITOR(action, store) { 25626 var post = action.post, 25627 autosave = action.autosave; 25628 var state = store.getState(); // Parse content as blocks 25629 25630 var blocks = Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_5__["parse"])(post.content.raw); // Apply a template for new posts only, if exists. 25631 25632 var isNewPost = post.status === 'auto-draft'; 25633 var template = Object(_selectors__WEBPACK_IMPORTED_MODULE_9__["getTemplate"])(state); 25634 25635 if (isNewPost && template) { 25636 blocks = Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_5__["synchronizeBlocksWithTemplate"])(blocks, template); 25637 } // Include auto draft title in edits while not flagging post as dirty 25638 25639 25640 var edits = {}; 25641 25642 if (isNewPost) { 25643 edits.title = post.title.raw; 25644 } // Check the auto-save status 25645 25646 25647 var autosaveAction; 25648 25649 if (autosave) { 25650 var noticeMessage = Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_6__["__"])('There is an autosave of this post that is more recent than the version below.'); 25651 25652 autosaveAction = Object(_actions__WEBPACK_IMPORTED_MODULE_8__["createWarningNotice"])(Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__["createElement"])("p", null, noticeMessage, ' ', Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__["createElement"])("a", { 25653 href: autosave.editLink 25654 }, Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_6__["__"])('View the autosave'))), { 25655 id: _effects_posts__WEBPACK_IMPORTED_MODULE_11__["AUTOSAVE_POST_NOTICE_ID"], 25656 spokenMessage: noticeMessage 25657 }); 25658 } 25659 25660 var setupAction = Object(_actions__WEBPACK_IMPORTED_MODULE_8__["setupEditorState"])(post, blocks, edits); 25661 return Object(lodash__WEBPACK_IMPORTED_MODULE_4__["compact"])([setupAction, autosaveAction, // TODO: This is temporary, necessary only so long as editor setup 25662 // is a separate action from block resetting. 25663 // 25664 // See: https://github.com/WordPress/gutenberg/pull/9403 25665 validateBlocksToTemplate(setupAction, store)]); 25666 }, 25667 RESET_BLOCKS: [validateBlocksToTemplate], 25668 SYNCHRONIZE_TEMPLATE: function SYNCHRONIZE_TEMPLATE(action, _ref) { 25669 var getState = _ref.getState; 25670 var state = getState(); 25671 var blocks = Object(_selectors__WEBPACK_IMPORTED_MODULE_9__["getBlocks"])(state); 25672 var template = Object(_selectors__WEBPACK_IMPORTED_MODULE_9__["getTemplate"])(state); 25673 var updatedBlockList = Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_5__["synchronizeBlocksWithTemplate"])(blocks, template); 25674 return Object(_actions__WEBPACK_IMPORTED_MODULE_8__["resetBlocks"])(updatedBlockList); 25675 }, 25676 CHECK_TEMPLATE_VALIDITY: function CHECK_TEMPLATE_VALIDITY(action, _ref2) { 25677 var getState = _ref2.getState; 25678 var state = getState(); 25679 var blocks = Object(_selectors__WEBPACK_IMPORTED_MODULE_9__["getBlocks"])(state); 25680 var template = Object(_selectors__WEBPACK_IMPORTED_MODULE_9__["getTemplate"])(state); 25681 var templateLock = Object(_selectors__WEBPACK_IMPORTED_MODULE_9__["getTemplateLock"])(state); 25682 var isValid = !template || templateLock !== 'all' || Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_5__["doBlocksMatchTemplate"])(blocks, template); 25683 return Object(_actions__WEBPACK_IMPORTED_MODULE_8__["setTemplateValidity"])(isValid); 25684 }, 25685 FETCH_REUSABLE_BLOCKS: function FETCH_REUSABLE_BLOCKS(action, store) { 25686 Object(_effects_reusable_blocks__WEBPACK_IMPORTED_MODULE_10__["fetchReusableBlocks"])(action, store); 25687 }, 25688 SAVE_REUSABLE_BLOCK: function SAVE_REUSABLE_BLOCK(action, store) { 25689 Object(_effects_reusable_blocks__WEBPACK_IMPORTED_MODULE_10__["saveReusableBlocks"])(action, store); 25690 }, 25691 DELETE_REUSABLE_BLOCK: function DELETE_REUSABLE_BLOCK(action, store) { 25692 Object(_effects_reusable_blocks__WEBPACK_IMPORTED_MODULE_10__["deleteReusableBlocks"])(action, store); 25693 }, 25694 RECEIVE_REUSABLE_BLOCKS: _effects_reusable_blocks__WEBPACK_IMPORTED_MODULE_10__["receiveReusableBlocks"], 25695 CONVERT_BLOCK_TO_STATIC: _effects_reusable_blocks__WEBPACK_IMPORTED_MODULE_10__["convertBlockToStatic"], 25696 CONVERT_BLOCK_TO_REUSABLE: _effects_reusable_blocks__WEBPACK_IMPORTED_MODULE_10__["convertBlockToReusable"], 25697 CREATE_NOTICE: function CREATE_NOTICE(_ref3) { 25698 var _ref3$notice = _ref3.notice, 25699 content = _ref3$notice.content, 25700 spokenMessage = _ref3$notice.spokenMessage; 25701 var message = spokenMessage || content; 25702 Object(_wordpress_a11y__WEBPACK_IMPORTED_MODULE_7__["speak"])(message, 'assertive'); 25703 }, 25704 REMOVE_BLOCKS: [selectPreviousBlock, ensureDefaultBlock], 25705 REPLACE_BLOCKS: [ensureDefaultBlock] 25706 }); 25707 25708 25709 /***/ }), 25710 25711 /***/ "./node_modules/@wordpress/editor/build-module/store/effects/posts.js": 25712 /*!****************************************************************************!*\ 25713 !*** ./node_modules/@wordpress/editor/build-module/store/effects/posts.js ***! 25714 \****************************************************************************/ 25715 /*! exports provided: AUTOSAVE_POST_NOTICE_ID, requestPostUpdate, requestPostUpdateSuccess, requestPostUpdateFailure, trashPost, trashPostFailure, refreshPost */ 25716 /***/ (function(module, __webpack_exports__, __webpack_require__) { 25717 25718 "use strict"; 25719 __webpack_require__.r(__webpack_exports__); 25720 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AUTOSAVE_POST_NOTICE_ID", function() { return AUTOSAVE_POST_NOTICE_ID; }); 25721 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "requestPostUpdate", function() { return requestPostUpdate; }); 25722 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "requestPostUpdateSuccess", function() { return requestPostUpdateSuccess; }); 25723 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "requestPostUpdateFailure", function() { return requestPostUpdateFailure; }); 25724 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "trashPost", function() { return trashPost; }); 25725 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "trashPostFailure", function() { return trashPostFailure; }); 25726 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "refreshPost", function() { return refreshPost; }); 25727 /* harmony import */ var _babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectSpread */ "./node_modules/@babel/runtime/helpers/esm/objectSpread.js"); 25728 /* harmony import */ var _babel_runtime_helpers_esm_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/asyncToGenerator */ "./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js"); 25729 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); 25730 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__); 25731 /* harmony import */ var redux_optimist__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! redux-optimist */ "./node_modules/redux-optimist/index.js"); 25732 /* harmony import */ var redux_optimist__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(redux_optimist__WEBPACK_IMPORTED_MODULE_3__); 25733 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! lodash */ "lodash"); 25734 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_4__); 25735 /* harmony import */ var _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/api-fetch */ "@wordpress/api-fetch"); 25736 /* harmony import */ var _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_5__); 25737 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); 25738 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_6__); 25739 /* harmony import */ var _wordpress_url__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @wordpress/url */ "@wordpress/url"); 25740 /* harmony import */ var _wordpress_url__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_wordpress_url__WEBPACK_IMPORTED_MODULE_7__); 25741 /* harmony import */ var _actions__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../actions */ "./node_modules/@wordpress/editor/build-module/store/actions.js"); 25742 /* harmony import */ var _selectors__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../selectors */ "./node_modules/@wordpress/editor/build-module/store/selectors.js"); 25743 /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./utils */ "./node_modules/@wordpress/editor/build-module/store/effects/utils.js"); 25744 25745 25746 25747 25748 /** 25749 * External dependencies 25750 */ 25751 25752 25753 /** 25754 * WordPress dependencies 25755 */ 25756 25757 25758 25759 25760 /** 25761 * Internal dependencies 25762 */ 25763 25764 25765 25766 25767 /** 25768 * Module Constants 25769 */ 25770 25771 var SAVE_POST_NOTICE_ID = 'SAVE_POST_NOTICE_ID'; 25772 var AUTOSAVE_POST_NOTICE_ID = 'AUTOSAVE_POST_NOTICE_ID'; 25773 var TRASH_POST_NOTICE_ID = 'TRASH_POST_NOTICE_ID'; 25774 /** 25775 * Request Post Update Effect handler 25776 * 25777 * @param {Object} action the fetchReusableBlocks action object. 25778 * @param {Object} store Redux Store. 25779 */ 25780 25781 var requestPostUpdate = 25782 /*#__PURE__*/ 25783 function () { 25784 var _ref = Object(_babel_runtime_helpers_esm_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__["default"])( 25785 /*#__PURE__*/ 25786 regeneratorRuntime.mark(function _callee(action, store) { 25787 var dispatch, getState, state, post, isAutosave, isSaveable, edits, toSend, postType, request, newPost, reset, isRevision; 25788 return regeneratorRuntime.wrap(function _callee$(_context) { 25789 while (1) { 25790 switch (_context.prev = _context.next) { 25791 case 0: 25792 dispatch = store.dispatch, getState = store.getState; 25793 state = getState(); 25794 post = Object(_selectors__WEBPACK_IMPORTED_MODULE_9__["getCurrentPost"])(state); 25795 isAutosave = !!action.options.autosave; // Prevent save if not saveable. 25796 25797 isSaveable = isAutosave ? _selectors__WEBPACK_IMPORTED_MODULE_9__["isEditedPostAutosaveable"] : _selectors__WEBPACK_IMPORTED_MODULE_9__["isEditedPostSaveable"]; 25798 25799 if (isSaveable(state)) { 25800 _context.next = 7; 25801 break; 25802 } 25803 25804 return _context.abrupt("return"); 25805 25806 case 7: 25807 edits = Object(_selectors__WEBPACK_IMPORTED_MODULE_9__["getPostEdits"])(state); 25808 25809 if (isAutosave) { 25810 edits = Object(lodash__WEBPACK_IMPORTED_MODULE_4__["pick"])(edits, ['title', 'content', 'excerpt']); 25811 } // New posts (with auto-draft status) must be explicitly assigned draft 25812 // status if there is not already a status assigned in edits (publish). 25813 // Otherwise, they are wrongly left as auto-draft. Status is not always 25814 // respected for autosaves, so it cannot simply be included in the pick 25815 // above. This behavior relies on an assumption that an auto-draft post 25816 // would never be saved by anyone other than the owner of the post, per 25817 // logic within autosaves REST controller to save status field only for 25818 // draft/auto-draft by current user. 25819 // 25820 // See: https://core.trac.wordpress.org/ticket/43316#comment:88 25821 // See: https://core.trac.wordpress.org/ticket/43316#comment:89 25822 25823 25824 if (Object(_selectors__WEBPACK_IMPORTED_MODULE_9__["isEditedPostNew"])(state)) { 25825 edits = Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_0__["default"])({ 25826 status: 'draft' 25827 }, edits); 25828 } 25829 25830 toSend = Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_0__["default"])({}, edits, { 25831 content: Object(_selectors__WEBPACK_IMPORTED_MODULE_9__["getEditedPostContent"])(state), 25832 id: post.id 25833 }); 25834 _context.next = 13; 25835 return Object(_utils__WEBPACK_IMPORTED_MODULE_10__["resolveSelector"])('core', 'getPostType', Object(_selectors__WEBPACK_IMPORTED_MODULE_9__["getCurrentPostType"])(state)); 25836 25837 case 13: 25838 postType = _context.sent; 25839 dispatch({ 25840 type: 'REQUEST_POST_UPDATE_START', 25841 optimist: { 25842 type: redux_optimist__WEBPACK_IMPORTED_MODULE_3__["BEGIN"], 25843 id: _selectors__WEBPACK_IMPORTED_MODULE_9__["POST_UPDATE_TRANSACTION_ID"] 25844 }, 25845 isAutosave: isAutosave 25846 }); // Optimistically apply updates under the assumption that the post 25847 // will be updated. See below logic in success resolution for revert 25848 // if the autosave is applied as a revision. 25849 25850 dispatch(Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_0__["default"])({}, Object(_actions__WEBPACK_IMPORTED_MODULE_8__["updatePost"])(toSend), { 25851 optimist: { 25852 id: _selectors__WEBPACK_IMPORTED_MODULE_9__["POST_UPDATE_TRANSACTION_ID"] 25853 } 25854 })); 25855 25856 if (isAutosave) { 25857 // Ensure autosaves contain all expected fields, using autosave or 25858 // post values as fallback if not otherwise included in edits. 25859 toSend = Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_0__["default"])({}, Object(lodash__WEBPACK_IMPORTED_MODULE_4__["pick"])(post, ['title', 'content', 'excerpt']), Object(_selectors__WEBPACK_IMPORTED_MODULE_9__["getAutosave"])(state), toSend, { 25860 parent: post.id 25861 }); 25862 request = _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_5___default()({ 25863 path: "/wp/v2/".concat(postType.rest_base, "/").concat(post.id, "/autosaves"), 25864 method: 'POST', 25865 data: toSend 25866 }); 25867 } else { 25868 dispatch(Object(_actions__WEBPACK_IMPORTED_MODULE_8__["removeNotice"])(SAVE_POST_NOTICE_ID)); 25869 dispatch(Object(_actions__WEBPACK_IMPORTED_MODULE_8__["removeNotice"])(AUTOSAVE_POST_NOTICE_ID)); 25870 request = _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_5___default()({ 25871 path: "/wp/v2/".concat(postType.rest_base, "/").concat(post.id), 25872 method: 'PUT', 25873 data: toSend 25874 }); 25875 } 25876 25877 _context.prev = 17; 25878 _context.next = 20; 25879 return request; 25880 25881 case 20: 25882 newPost = _context.sent; 25883 reset = isAutosave ? _actions__WEBPACK_IMPORTED_MODULE_8__["resetAutosave"] : _actions__WEBPACK_IMPORTED_MODULE_8__["resetPost"]; 25884 dispatch(reset(newPost)); // An autosave may be processed by the server as a regular save 25885 // when its update is requested by the author and the post was 25886 // draft or auto-draft. 25887 25888 isRevision = newPost.id !== post.id; 25889 dispatch({ 25890 type: 'REQUEST_POST_UPDATE_SUCCESS', 25891 previousPost: post, 25892 post: newPost, 25893 optimist: { 25894 // Note: REVERT is not a failure case here. Rather, it 25895 // is simply reversing the assumption that the updates 25896 // were applied to the post proper, such that the post 25897 // treated as having unsaved changes. 25898 type: isRevision ? redux_optimist__WEBPACK_IMPORTED_MODULE_3__["REVERT"] : redux_optimist__WEBPACK_IMPORTED_MODULE_3__["COMMIT"], 25899 id: _selectors__WEBPACK_IMPORTED_MODULE_9__["POST_UPDATE_TRANSACTION_ID"] 25900 }, 25901 isAutosave: isAutosave 25902 }); 25903 _context.next = 30; 25904 break; 25905 25906 case 27: 25907 _context.prev = 27; 25908 _context.t0 = _context["catch"](17); 25909 dispatch({ 25910 type: 'REQUEST_POST_UPDATE_FAILURE', 25911 optimist: { 25912 type: redux_optimist__WEBPACK_IMPORTED_MODULE_3__["REVERT"], 25913 id: _selectors__WEBPACK_IMPORTED_MODULE_9__["POST_UPDATE_TRANSACTION_ID"] 25914 }, 25915 post: post, 25916 edits: edits, 25917 error: _context.t0 25918 }); 25919 25920 case 30: 25921 case "end": 25922 return _context.stop(); 25923 } 25924 } 25925 }, _callee, this, [[17, 27]]); 25926 })); 25927 25928 return function requestPostUpdate(_x, _x2) { 25929 return _ref.apply(this, arguments); 25930 }; 25931 }(); 25932 /** 25933 * Request Post Update Success Effect handler 25934 * 25935 * @param {Object} action action object. 25936 * @param {Object} store Redux Store. 25937 */ 25938 25939 var requestPostUpdateSuccess = function requestPostUpdateSuccess(action, store) { 25940 var previousPost = action.previousPost, 25941 post = action.post, 25942 isAutosave = action.isAutosave; 25943 var dispatch = store.dispatch, 25944 getState = store.getState; // TEMPORARY: If edits remain after a save completes, the user must be 25945 // prompted about unsaved changes. This should be refactored as part of 25946 // the `isEditedPostDirty` selector instead. 25947 // 25948 // See: https://github.com/WordPress/gutenberg/issues/7409 25949 25950 if (Object.keys(Object(_selectors__WEBPACK_IMPORTED_MODULE_9__["getPostEdits"])(getState())).length) { 25951 dispatch({ 25952 type: 'DIRTY_ARTIFICIALLY' 25953 }); 25954 } // Autosaves are neither shown a notice nor redirected. 25955 25956 25957 if (isAutosave) { 25958 return; 25959 } 25960 25961 var publishStatus = ['publish', 'private', 'future']; 25962 var isPublished = Object(lodash__WEBPACK_IMPORTED_MODULE_4__["includes"])(publishStatus, previousPost.status); 25963 var willPublish = Object(lodash__WEBPACK_IMPORTED_MODULE_4__["includes"])(publishStatus, post.status); 25964 var noticeMessage; 25965 var shouldShowLink = true; 25966 25967 if (!isPublished && !willPublish) { 25968 // If saving a non-published post, don't show notice. 25969 noticeMessage = null; 25970 } else if (isPublished && !willPublish) { 25971 // If undoing publish status, show specific notice 25972 noticeMessage = Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_6__["__"])('Post reverted to draft.'); 25973 shouldShowLink = false; 25974 } else if (!isPublished && willPublish) { 25975 // If publishing or scheduling a post, show the corresponding 25976 // publish message 25977 noticeMessage = { 25978 publish: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_6__["__"])('Post published!'), 25979 private: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_6__["__"])('Post published privately!'), 25980 future: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_6__["__"])('Post scheduled!') 25981 }[post.status]; 25982 } else { 25983 // Generic fallback notice 25984 noticeMessage = Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_6__["__"])('Post updated!'); 25985 } 25986 25987 if (noticeMessage) { 25988 dispatch(Object(_actions__WEBPACK_IMPORTED_MODULE_8__["createSuccessNotice"])(Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["createElement"])("p", null, noticeMessage, ' ', shouldShowLink && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["createElement"])("a", { 25989 href: post.link 25990 }, Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_6__["__"])('View post'))), { 25991 id: SAVE_POST_NOTICE_ID, 25992 spokenMessage: noticeMessage 25993 })); 25994 } 25995 }; 25996 /** 25997 * Request Post Update Failure Effect handler 25998 * 25999 * @param {Object} action action object. 26000 * @param {Object} store Redux Store. 26001 */ 26002 26003 var requestPostUpdateFailure = function requestPostUpdateFailure(action, store) { 26004 var post = action.post, 26005 edits = action.edits, 26006 error = action.error; 26007 26008 if (error && 'rest_autosave_no_changes' === error.code) { 26009 // Autosave requested a new autosave, but there were no changes. This shouldn't 26010 // result in an error notice for the user. 26011 return; 26012 } 26013 26014 var dispatch = store.dispatch; 26015 var publishStatus = ['publish', 'private', 'future']; 26016 var isPublished = publishStatus.indexOf(post.status) !== -1; // If the post was being published, we show the corresponding publish error message 26017 // Unless we publish an "updating failed" message 26018 26019 var messages = { 26020 publish: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_6__["__"])('Publishing failed'), 26021 private: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_6__["__"])('Publishing failed'), 26022 future: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_6__["__"])('Scheduling failed') 26023 }; 26024 var noticeMessage = !isPublished && publishStatus.indexOf(edits.status) !== -1 ? messages[edits.status] : Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_6__["__"])('Updating failed'); 26025 var cloudflareDetailsLink = Object(_wordpress_url__WEBPACK_IMPORTED_MODULE_7__["addQueryArgs"])('post.php', { 26026 post: post.id, 26027 action: 'edit', 26028 'classic-editor': '', 26029 'cloudflare-error': '' 26030 }); 26031 var cloudflaredMessage = error && 'cloudflare_error' === error.code ? Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["createElement"])("p", null, noticeMessage, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["createElement"])("br", null), Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_6__["__"])('Cloudflare is blocking REST API requests.'), ' ', Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["createElement"])("a", { 26032 href: cloudflareDetailsLink 26033 }, Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_6__["__"])('Learn More'), " ")) : noticeMessage; 26034 dispatch(Object(_actions__WEBPACK_IMPORTED_MODULE_8__["createErrorNotice"])(cloudflaredMessage, { 26035 id: SAVE_POST_NOTICE_ID 26036 })); 26037 }; 26038 /** 26039 * Trash Post Effect handler 26040 * 26041 * @param {Object} action action object. 26042 * @param {Object} store Redux Store. 26043 */ 26044 26045 var trashPost = 26046 /*#__PURE__*/ 26047 function () { 26048 var _ref2 = Object(_babel_runtime_helpers_esm_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__["default"])( 26049 /*#__PURE__*/ 26050 regeneratorRuntime.mark(function _callee2(action, store) { 26051 var dispatch, getState, postId, postTypeSlug, postType, post; 26052 return regeneratorRuntime.wrap(function _callee2$(_context2) { 26053 while (1) { 26054 switch (_context2.prev = _context2.next) { 26055 case 0: 26056 dispatch = store.dispatch, getState = store.getState; 26057 postId = action.postId; 26058 postTypeSlug = Object(_selectors__WEBPACK_IMPORTED_MODULE_9__["getCurrentPostType"])(getState()); 26059 _context2.next = 5; 26060 return Object(_utils__WEBPACK_IMPORTED_MODULE_10__["resolveSelector"])('core', 'getPostType', postTypeSlug); 26061 26062 case 5: 26063 postType = _context2.sent; 26064 dispatch(Object(_actions__WEBPACK_IMPORTED_MODULE_8__["removeNotice"])(TRASH_POST_NOTICE_ID)); 26065 _context2.prev = 7; 26066 _context2.next = 10; 26067 return _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_5___default()({ 26068 path: "/wp/v2/".concat(postType.rest_base, "/").concat(postId), 26069 method: 'DELETE' 26070 }); 26071 26072 case 10: 26073 post = Object(_selectors__WEBPACK_IMPORTED_MODULE_9__["getCurrentPost"])(getState()); // TODO: This should be an updatePost action (updating subsets of post properties), 26074 // But right now editPost is tied with change detection. 26075 26076 dispatch(Object(_actions__WEBPACK_IMPORTED_MODULE_8__["resetPost"])(Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_0__["default"])({}, post, { 26077 status: 'trash' 26078 }))); 26079 _context2.next = 17; 26080 break; 26081 26082 case 14: 26083 _context2.prev = 14; 26084 _context2.t0 = _context2["catch"](7); 26085 dispatch(Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_0__["default"])({}, action, { 26086 type: 'TRASH_POST_FAILURE', 26087 error: _context2.t0 26088 })); 26089 26090 case 17: 26091 case "end": 26092 return _context2.stop(); 26093 } 26094 } 26095 }, _callee2, this, [[7, 14]]); 26096 })); 26097 26098 return function trashPost(_x3, _x4) { 26099 return _ref2.apply(this, arguments); 26100 }; 26101 }(); 26102 /** 26103 * Trash Post Failure Effect handler 26104 * 26105 * @param {Object} action action object. 26106 * @param {Object} store Redux Store. 26107 */ 26108 26109 var trashPostFailure = function trashPostFailure(action, store) { 26110 var message = action.error.message && action.error.code !== 'unknown_error' ? action.error.message : Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_6__["__"])('Trashing failed'); 26111 store.dispatch(Object(_actions__WEBPACK_IMPORTED_MODULE_8__["createErrorNotice"])(message, { 26112 id: TRASH_POST_NOTICE_ID 26113 })); 26114 }; 26115 /** 26116 * Refresh Post Effect handler 26117 * 26118 * @param {Object} action action object. 26119 * @param {Object} store Redux Store. 26120 */ 26121 26122 var refreshPost = 26123 /*#__PURE__*/ 26124 function () { 26125 var _ref3 = Object(_babel_runtime_helpers_esm_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__["default"])( 26126 /*#__PURE__*/ 26127 regeneratorRuntime.mark(function _callee3(action, store) { 26128 var dispatch, getState, state, post, postTypeSlug, postType, newPost; 26129 return regeneratorRuntime.wrap(function _callee3$(_context3) { 26130 while (1) { 26131 switch (_context3.prev = _context3.next) { 26132 case 0: 26133 dispatch = store.dispatch, getState = store.getState; 26134 state = getState(); 26135 post = Object(_selectors__WEBPACK_IMPORTED_MODULE_9__["getCurrentPost"])(state); 26136 postTypeSlug = Object(_selectors__WEBPACK_IMPORTED_MODULE_9__["getCurrentPostType"])(getState()); 26137 _context3.next = 6; 26138 return Object(_utils__WEBPACK_IMPORTED_MODULE_10__["resolveSelector"])('core', 'getPostType', postTypeSlug); 26139 26140 case 6: 26141 postType = _context3.sent; 26142 _context3.next = 9; 26143 return _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_5___default()({ 26144 path: "/wp/v2/".concat(postType.rest_base, "/").concat(post.id), 26145 data: { 26146 context: 'edit' 26147 } 26148 }); 26149 26150 case 9: 26151 newPost = _context3.sent; 26152 dispatch(Object(_actions__WEBPACK_IMPORTED_MODULE_8__["resetPost"])(newPost)); 26153 26154 case 11: 26155 case "end": 26156 return _context3.stop(); 26157 } 26158 } 26159 }, _callee3, this); 26160 })); 26161 26162 return function refreshPost(_x5, _x6) { 26163 return _ref3.apply(this, arguments); 26164 }; 26165 }(); 26166 26167 26168 /***/ }), 26169 26170 /***/ "./node_modules/@wordpress/editor/build-module/store/effects/reusable-blocks.js": 26171 /*!**************************************************************************************!*\ 26172 !*** ./node_modules/@wordpress/editor/build-module/store/effects/reusable-blocks.js ***! 26173 \**************************************************************************************/ 26174 /*! exports provided: fetchReusableBlocks, saveReusableBlocks, deleteReusableBlocks, receiveReusableBlocks, convertBlockToStatic, convertBlockToReusable */ 26175 /***/ (function(module, __webpack_exports__, __webpack_require__) { 26176 26177 "use strict"; 26178 __webpack_require__.r(__webpack_exports__); 26179 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fetchReusableBlocks", function() { return fetchReusableBlocks; }); 26180 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "saveReusableBlocks", function() { return saveReusableBlocks; }); 26181 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "deleteReusableBlocks", function() { return deleteReusableBlocks; }); 26182 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "receiveReusableBlocks", function() { return receiveReusableBlocks; }); 26183 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "convertBlockToStatic", function() { return convertBlockToStatic; }); 26184 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "convertBlockToReusable", function() { return convertBlockToReusable; }); 26185 /* harmony import */ var _babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/toConsumableArray */ "./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js"); 26186 /* harmony import */ var _babel_runtime_helpers_esm_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/asyncToGenerator */ "./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js"); 26187 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! lodash */ "lodash"); 26188 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_2__); 26189 /* harmony import */ var redux_optimist__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! redux-optimist */ "./node_modules/redux-optimist/index.js"); 26190 /* harmony import */ var redux_optimist__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(redux_optimist__WEBPACK_IMPORTED_MODULE_3__); 26191 /* harmony import */ var _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/api-fetch */ "@wordpress/api-fetch"); 26192 /* harmony import */ var _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_4__); 26193 /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks"); 26194 /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_5__); 26195 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); 26196 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_6__); 26197 /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./utils */ "./node_modules/@wordpress/editor/build-module/store/effects/utils.js"); 26198 /* harmony import */ var _actions__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../actions */ "./node_modules/@wordpress/editor/build-module/store/actions.js"); 26199 /* harmony import */ var _selectors__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../selectors */ "./node_modules/@wordpress/editor/build-module/store/selectors.js"); 26200 26201 26202 26203 /** 26204 * External dependencies 26205 */ 26206 26207 26208 /** 26209 * WordPress dependencies 26210 */ 26211 26212 26213 26214 26215 /** 26216 * Internal dependencies 26217 */ 26218 26219 26220 26221 26222 /** 26223 * Module Constants 26224 */ 26225 26226 var REUSABLE_BLOCK_NOTICE_ID = 'REUSABLE_BLOCK_NOTICE_ID'; 26227 /** 26228 * Fetch Reusable Blocks Effect Handler. 26229 * 26230 * @param {Object} action action object. 26231 * @param {Object} store Redux Store. 26232 */ 26233 26234 var fetchReusableBlocks = 26235 /*#__PURE__*/ 26236 function () { 26237 var _ref = Object(_babel_runtime_helpers_esm_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__["default"])( 26238 /*#__PURE__*/ 26239 regeneratorRuntime.mark(function _callee(action, store) { 26240 var id, dispatch, postType, result, reusableBlockOrBlocks; 26241 return regeneratorRuntime.wrap(function _callee$(_context) { 26242 while (1) { 26243 switch (_context.prev = _context.next) { 26244 case 0: 26245 id = action.id; 26246 dispatch = store.dispatch; // TODO: these are potentially undefined, this fix is in place 26247 // until there is a filter to not use reusable blocks if undefined 26248 26249 _context.next = 4; 26250 return Object(_utils__WEBPACK_IMPORTED_MODULE_7__["resolveSelector"])('core', 'getPostType', 'wp_block'); 26251 26252 case 4: 26253 postType = _context.sent; 26254 26255 if (postType) { 26256 _context.next = 7; 26257 break; 26258 } 26259 26260 return _context.abrupt("return"); 26261 26262 case 7: 26263 if (id) { 26264 result = _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_4___default()({ 26265 path: "/wp/v2/".concat(postType.rest_base, "/").concat(id) 26266 }); 26267 } else { 26268 result = _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_4___default()({ 26269 path: "/wp/v2/".concat(postType.rest_base, "?per_page=-1") 26270 }); 26271 } 26272 26273 _context.prev = 8; 26274 _context.next = 11; 26275 return result; 26276 26277 case 11: 26278 reusableBlockOrBlocks = _context.sent; 26279 dispatch(Object(_actions__WEBPACK_IMPORTED_MODULE_8__["receiveReusableBlocks"])(Object(lodash__WEBPACK_IMPORTED_MODULE_2__["map"])(Object(lodash__WEBPACK_IMPORTED_MODULE_2__["castArray"])(reusableBlockOrBlocks), function (reusableBlock) { 26280 var parsedBlocks = Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_5__["parse"])(reusableBlock.content); 26281 26282 if (parsedBlocks.length === 1) { 26283 return { 26284 reusableBlock: reusableBlock, 26285 parsedBlock: parsedBlocks[0] 26286 }; 26287 } 26288 26289 return { 26290 reusableBlock: reusableBlock, 26291 parsedBlock: Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_5__["createBlock"])('core/template', {}, parsedBlocks) 26292 }; 26293 }))); 26294 dispatch({ 26295 type: 'FETCH_REUSABLE_BLOCKS_SUCCESS', 26296 id: id 26297 }); 26298 _context.next = 19; 26299 break; 26300 26301 case 16: 26302 _context.prev = 16; 26303 _context.t0 = _context["catch"](8); 26304 dispatch({ 26305 type: 'FETCH_REUSABLE_BLOCKS_FAILURE', 26306 id: id, 26307 error: _context.t0 26308 }); 26309 26310 case 19: 26311 case "end": 26312 return _context.stop(); 26313 } 26314 } 26315 }, _callee, this, [[8, 16]]); 26316 })); 26317 26318 return function fetchReusableBlocks(_x, _x2) { 26319 return _ref.apply(this, arguments); 26320 }; 26321 }(); 26322 /** 26323 * Save Reusable Blocks Effect Handler. 26324 * 26325 * @param {Object} action action object. 26326 * @param {Object} store Redux Store. 26327 */ 26328 26329 var saveReusableBlocks = 26330 /*#__PURE__*/ 26331 function () { 26332 var _ref2 = Object(_babel_runtime_helpers_esm_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__["default"])( 26333 /*#__PURE__*/ 26334 regeneratorRuntime.mark(function _callee2(action, store) { 26335 var postType, id, dispatch, state, _getReusableBlock, clientId, title, isTemporary, reusableBlock, content, data, path, method, updatedReusableBlock, message; 26336 26337 return regeneratorRuntime.wrap(function _callee2$(_context2) { 26338 while (1) { 26339 switch (_context2.prev = _context2.next) { 26340 case 0: 26341 _context2.next = 2; 26342 return Object(_utils__WEBPACK_IMPORTED_MODULE_7__["resolveSelector"])('core', 'getPostType', 'wp_block'); 26343 26344 case 2: 26345 postType = _context2.sent; 26346 26347 if (postType) { 26348 _context2.next = 5; 26349 break; 26350 } 26351 26352 return _context2.abrupt("return"); 26353 26354 case 5: 26355 id = action.id; 26356 dispatch = store.dispatch; 26357 state = store.getState(); 26358 _getReusableBlock = Object(_selectors__WEBPACK_IMPORTED_MODULE_9__["getReusableBlock"])(state, id), clientId = _getReusableBlock.clientId, title = _getReusableBlock.title, isTemporary = _getReusableBlock.isTemporary; 26359 reusableBlock = Object(_selectors__WEBPACK_IMPORTED_MODULE_9__["getBlock"])(state, clientId); 26360 content = Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_5__["serialize"])(reusableBlock.name === 'core/template' ? reusableBlock.innerBlocks : reusableBlock); 26361 data = isTemporary ? { 26362 title: title, 26363 content: content 26364 } : { 26365 id: id, 26366 title: title, 26367 content: content 26368 }; 26369 path = isTemporary ? "/wp/v2/".concat(postType.rest_base) : "/wp/v2/".concat(postType.rest_base, "/").concat(id); 26370 method = isTemporary ? 'POST' : 'PUT'; 26371 _context2.prev = 14; 26372 _context2.next = 17; 26373 return _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_4___default()({ 26374 path: path, 26375 data: data, 26376 method: method 26377 }); 26378 26379 case 17: 26380 updatedReusableBlock = _context2.sent; 26381 dispatch({ 26382 type: 'SAVE_REUSABLE_BLOCK_SUCCESS', 26383 updatedId: updatedReusableBlock.id, 26384 id: id 26385 }); 26386 message = isTemporary ? Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_6__["__"])('Block created.') : Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_6__["__"])('Block updated.'); 26387 dispatch(Object(_actions__WEBPACK_IMPORTED_MODULE_8__["createSuccessNotice"])(message, { 26388 id: REUSABLE_BLOCK_NOTICE_ID 26389 })); 26390 _context2.next = 27; 26391 break; 26392 26393 case 23: 26394 _context2.prev = 23; 26395 _context2.t0 = _context2["catch"](14); 26396 dispatch({ 26397 type: 'SAVE_REUSABLE_BLOCK_FAILURE', 26398 id: id 26399 }); 26400 dispatch(Object(_actions__WEBPACK_IMPORTED_MODULE_8__["createErrorNotice"])(_context2.t0.message, { 26401 id: REUSABLE_BLOCK_NOTICE_ID, 26402 spokenMessage: _context2.t0.message 26403 })); 26404 26405 case 27: 26406 case "end": 26407 return _context2.stop(); 26408 } 26409 } 26410 }, _callee2, this, [[14, 23]]); 26411 })); 26412 26413 return function saveReusableBlocks(_x3, _x4) { 26414 return _ref2.apply(this, arguments); 26415 }; 26416 }(); 26417 /** 26418 * Delete Reusable Blocks Effect Handler. 26419 * 26420 * @param {Object} action action object. 26421 * @param {Object} store Redux Store. 26422 */ 26423 26424 var deleteReusableBlocks = 26425 /*#__PURE__*/ 26426 function () { 26427 var _ref3 = Object(_babel_runtime_helpers_esm_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__["default"])( 26428 /*#__PURE__*/ 26429 regeneratorRuntime.mark(function _callee3(action, store) { 26430 var postType, id, getState, dispatch, reusableBlock, allBlocks, associatedBlocks, associatedBlockClientIds, transactionId, message; 26431 return regeneratorRuntime.wrap(function _callee3$(_context3) { 26432 while (1) { 26433 switch (_context3.prev = _context3.next) { 26434 case 0: 26435 _context3.next = 2; 26436 return Object(_utils__WEBPACK_IMPORTED_MODULE_7__["resolveSelector"])('core', 'getPostType', 'wp_block'); 26437 26438 case 2: 26439 postType = _context3.sent; 26440 26441 if (postType) { 26442 _context3.next = 5; 26443 break; 26444 } 26445 26446 return _context3.abrupt("return"); 26447 26448 case 5: 26449 id = action.id; 26450 getState = store.getState, dispatch = store.dispatch; // Don't allow a reusable block with a temporary ID to be deleted 26451 26452 reusableBlock = Object(_selectors__WEBPACK_IMPORTED_MODULE_9__["getReusableBlock"])(getState(), id); 26453 26454 if (!(!reusableBlock || reusableBlock.isTemporary)) { 26455 _context3.next = 10; 26456 break; 26457 } 26458 26459 return _context3.abrupt("return"); 26460 26461 case 10: 26462 // Remove any other blocks that reference this reusable block 26463 allBlocks = Object(_selectors__WEBPACK_IMPORTED_MODULE_9__["getBlocks"])(getState()); 26464 associatedBlocks = allBlocks.filter(function (block) { 26465 return Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_5__["isReusableBlock"])(block) && block.attributes.ref === id; 26466 }); 26467 associatedBlockClientIds = associatedBlocks.map(function (block) { 26468 return block.clientId; 26469 }); 26470 transactionId = Object(lodash__WEBPACK_IMPORTED_MODULE_2__["uniqueId"])(); 26471 dispatch({ 26472 type: 'REMOVE_REUSABLE_BLOCK', 26473 id: id, 26474 optimist: { 26475 type: redux_optimist__WEBPACK_IMPORTED_MODULE_3__["BEGIN"], 26476 id: transactionId 26477 } 26478 }); // Remove the parsed block. 26479 26480 dispatch(Object(_actions__WEBPACK_IMPORTED_MODULE_8__["removeBlocks"])(Object(_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_0__["default"])(associatedBlockClientIds).concat([reusableBlock.clientId]))); 26481 _context3.prev = 16; 26482 _context3.next = 19; 26483 return _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_4___default()({ 26484 path: "/wp/v2/".concat(postType.rest_base, "/").concat(id), 26485 method: 'DELETE' 26486 }); 26487 26488 case 19: 26489 dispatch({ 26490 type: 'DELETE_REUSABLE_BLOCK_SUCCESS', 26491 id: id, 26492 optimist: { 26493 type: redux_optimist__WEBPACK_IMPORTED_MODULE_3__["COMMIT"], 26494 id: transactionId 26495 } 26496 }); 26497 message = Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_6__["__"])('Block deleted.'); 26498 dispatch(Object(_actions__WEBPACK_IMPORTED_MODULE_8__["createSuccessNotice"])(message, { 26499 id: REUSABLE_BLOCK_NOTICE_ID 26500 })); 26501 _context3.next = 28; 26502 break; 26503 26504 case 24: 26505 _context3.prev = 24; 26506 _context3.t0 = _context3["catch"](16); 26507 dispatch({ 26508 type: 'DELETE_REUSABLE_BLOCK_FAILURE', 26509 id: id, 26510 optimist: { 26511 type: redux_optimist__WEBPACK_IMPORTED_MODULE_3__["REVERT"], 26512 id: transactionId 26513 } 26514 }); 26515 dispatch(Object(_actions__WEBPACK_IMPORTED_MODULE_8__["createErrorNotice"])(_context3.t0.message, { 26516 id: REUSABLE_BLOCK_NOTICE_ID, 26517 spokenMessage: _context3.t0.message 26518 })); 26519 26520 case 28: 26521 case "end": 26522 return _context3.stop(); 26523 } 26524 } 26525 }, _callee3, this, [[16, 24]]); 26526 })); 26527 26528 return function deleteReusableBlocks(_x5, _x6) { 26529 return _ref3.apply(this, arguments); 26530 }; 26531 }(); 26532 /** 26533 * Receive Reusable Blocks Effect Handler. 26534 * 26535 * @param {Object} action action object. 26536 * @return {Object} receive blocks action 26537 */ 26538 26539 var receiveReusableBlocks = function receiveReusableBlocks(action) { 26540 return Object(_actions__WEBPACK_IMPORTED_MODULE_8__["receiveBlocks"])(Object(lodash__WEBPACK_IMPORTED_MODULE_2__["map"])(action.results, 'parsedBlock')); 26541 }; 26542 /** 26543 * Convert a reusable block to a static block effect handler 26544 * 26545 * @param {Object} action action object. 26546 * @param {Object} store Redux Store. 26547 */ 26548 26549 var convertBlockToStatic = function convertBlockToStatic(action, store) { 26550 var state = store.getState(); 26551 var oldBlock = Object(_selectors__WEBPACK_IMPORTED_MODULE_9__["getBlock"])(state, action.clientId); 26552 var reusableBlock = Object(_selectors__WEBPACK_IMPORTED_MODULE_9__["getReusableBlock"])(state, oldBlock.attributes.ref); 26553 var referencedBlock = Object(_selectors__WEBPACK_IMPORTED_MODULE_9__["getBlock"])(state, reusableBlock.clientId); 26554 var newBlocks; 26555 26556 if (referencedBlock.name === 'core/template') { 26557 newBlocks = referencedBlock.innerBlocks.map(function (innerBlock) { 26558 return Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_5__["cloneBlock"])(innerBlock); 26559 }); 26560 } else { 26561 newBlocks = [Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_5__["createBlock"])(referencedBlock.name, referencedBlock.attributes)]; 26562 } 26563 26564 store.dispatch(Object(_actions__WEBPACK_IMPORTED_MODULE_8__["replaceBlocks"])(oldBlock.clientId, newBlocks)); 26565 }; 26566 /** 26567 * Convert a static block to a reusable block effect handler 26568 * 26569 * @param {Object} action action object. 26570 * @param {Object} store Redux Store. 26571 */ 26572 26573 var convertBlockToReusable = function convertBlockToReusable(action, store) { 26574 var getState = store.getState, 26575 dispatch = store.dispatch; 26576 var parsedBlock; 26577 26578 if (action.clientIds.length === 1) { 26579 parsedBlock = Object(_selectors__WEBPACK_IMPORTED_MODULE_9__["getBlock"])(getState(), action.clientIds[0]); 26580 } else { 26581 parsedBlock = Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_5__["createBlock"])('core/template', {}, Object(_selectors__WEBPACK_IMPORTED_MODULE_9__["getBlocksByClientId"])(getState(), action.clientIds)); // This shouldn't be necessary but at the moment 26582 // we expect the content of the shared blocks to live in the blocks state. 26583 26584 dispatch(Object(_actions__WEBPACK_IMPORTED_MODULE_8__["receiveBlocks"])([parsedBlock])); 26585 } 26586 26587 var reusableBlock = { 26588 id: Object(lodash__WEBPACK_IMPORTED_MODULE_2__["uniqueId"])('reusable'), 26589 clientId: parsedBlock.clientId, 26590 title: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_6__["__"])('Untitled Reusable Block') 26591 }; 26592 dispatch(Object(_actions__WEBPACK_IMPORTED_MODULE_8__["receiveReusableBlocks"])([{ 26593 reusableBlock: reusableBlock, 26594 parsedBlock: parsedBlock 26595 }])); 26596 dispatch(Object(_actions__WEBPACK_IMPORTED_MODULE_8__["saveReusableBlock"])(reusableBlock.id)); 26597 dispatch(Object(_actions__WEBPACK_IMPORTED_MODULE_8__["replaceBlocks"])(action.clientIds, Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_5__["createBlock"])('core/block', { 26598 ref: reusableBlock.id, 26599 layout: parsedBlock.attributes.layout 26600 }))); // Re-add the original block to the store, since replaceBlock() will have removed it 26601 26602 dispatch(Object(_actions__WEBPACK_IMPORTED_MODULE_8__["receiveBlocks"])([parsedBlock])); 26603 }; 26604 26605 26606 /***/ }), 26607 26608 /***/ "./node_modules/@wordpress/editor/build-module/store/effects/utils.js": 26609 /*!****************************************************************************!*\ 26610 !*** ./node_modules/@wordpress/editor/build-module/store/effects/utils.js ***! 26611 \****************************************************************************/ 26612 /*! exports provided: resolveSelector */ 26613 /***/ (function(module, __webpack_exports__, __webpack_require__) { 26614 26615 "use strict"; 26616 __webpack_require__.r(__webpack_exports__); 26617 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "resolveSelector", function() { return resolveSelector; }); 26618 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); 26619 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_0__); 26620 /** 26621 * WordPress dependencies 26622 */ 26623 26624 /** 26625 * Waits for the resolution of a selector before returning the selector's value. 26626 * 26627 * @param {string} namespace Store namespace. 26628 * @param {string} selectorName Selector name. 26629 * @param {Array} args Selector args. 26630 * 26631 * @return {Promise} Selector result. 26632 */ 26633 26634 function resolveSelector(namespace, selectorName) { 26635 for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) { 26636 args[_key - 2] = arguments[_key]; 26637 } 26638 26639 return new Promise(function (resolve) { 26640 var hasFinished = function hasFinished() { 26641 return Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_0__["select"])('core/data').hasFinishedResolution(namespace, selectorName, args); 26642 }; 26643 26644 var getResult = function getResult() { 26645 return Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_0__["select"])(namespace)[selectorName].apply(null, args); 26646 }; // We need to trigger the selector (to trigger the resolver) 26647 26648 26649 var result = getResult(); 26650 26651 if (hasFinished()) { 26652 return resolve(result); 26653 } 26654 26655 var unsubscribe = Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_0__["subscribe"])(function () { 26656 if (hasFinished()) { 26657 unsubscribe(); 26658 resolve(getResult()); 26659 } 26660 }); 26661 }); 26662 } 26663 26664 26665 /***/ }), 26666 26667 /***/ "./node_modules/@wordpress/editor/build-module/store/index.js": 26668 /*!********************************************************************!*\ 26669 !*** ./node_modules/@wordpress/editor/build-module/store/index.js ***! 26670 \********************************************************************/ 26671 /*! exports provided: default */ 26672 /***/ (function(module, __webpack_exports__, __webpack_require__) { 26673 26674 "use strict"; 26675 __webpack_require__.r(__webpack_exports__); 26676 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash */ "lodash"); 26677 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_0__); 26678 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); 26679 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_1__); 26680 /* harmony import */ var _reducer__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./reducer */ "./node_modules/@wordpress/editor/build-module/store/reducer.js"); 26681 /* harmony import */ var _middlewares__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./middlewares */ "./node_modules/@wordpress/editor/build-module/store/middlewares.js"); 26682 /* harmony import */ var _selectors__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./selectors */ "./node_modules/@wordpress/editor/build-module/store/selectors.js"); 26683 /* harmony import */ var _actions__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./actions */ "./node_modules/@wordpress/editor/build-module/store/actions.js"); 26684 /* harmony import */ var _components_rich_text_core_tokens__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../components/rich-text/core-tokens */ "./node_modules/@wordpress/editor/build-module/components/rich-text/core-tokens/index.js"); 26685 /* harmony import */ var _components_rich_text_tokens__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../components/rich-text/tokens */ "./node_modules/@wordpress/editor/build-module/components/rich-text/tokens/index.js"); 26686 /** 26687 * External Dependencies 26688 */ 26689 26690 /** 26691 * WordPress Dependencies 26692 */ 26693 26694 26695 /** 26696 * Internal dependencies 26697 */ 26698 26699 26700 26701 26702 26703 26704 26705 /** 26706 * Module Constants 26707 */ 26708 26709 var MODULE_KEY = 'core/editor'; 26710 var store = Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_1__["registerStore"])(MODULE_KEY, { 26711 reducer: _reducer__WEBPACK_IMPORTED_MODULE_2__["default"], 26712 selectors: _selectors__WEBPACK_IMPORTED_MODULE_4__, 26713 actions: _actions__WEBPACK_IMPORTED_MODULE_5__, 26714 persist: ['preferences'] 26715 }); 26716 Object(_middlewares__WEBPACK_IMPORTED_MODULE_3__["default"])(store); 26717 Object(lodash__WEBPACK_IMPORTED_MODULE_0__["forOwn"])(_components_rich_text_core_tokens__WEBPACK_IMPORTED_MODULE_6__, function (_ref) { 26718 var name = _ref.name, 26719 settings = _ref.settings; 26720 settings = Object(_components_rich_text_tokens__WEBPACK_IMPORTED_MODULE_7__["validateTokenSettings"])(name, settings, store.getState()); 26721 26722 if (settings) { 26723 store.dispatch(_actions__WEBPACK_IMPORTED_MODULE_5__["registerToken"](name, settings)); 26724 } 26725 }); 26726 /* harmony default export */ __webpack_exports__["default"] = (store); 26727 26728 26729 /***/ }), 26730 26731 /***/ "./node_modules/@wordpress/editor/build-module/store/middlewares.js": 26732 /*!**************************************************************************!*\ 26733 !*** ./node_modules/@wordpress/editor/build-module/store/middlewares.js ***! 26734 \**************************************************************************/ 26735 /*! exports provided: default */ 26736 /***/ (function(module, __webpack_exports__, __webpack_require__) { 26737 26738 "use strict"; 26739 __webpack_require__.r(__webpack_exports__); 26740 /* harmony import */ var _babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/toConsumableArray */ "./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js"); 26741 /* harmony import */ var refx__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! refx */ "./node_modules/refx/refx.js"); 26742 /* harmony import */ var refx__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(refx__WEBPACK_IMPORTED_MODULE_1__); 26743 /* harmony import */ var redux_multi__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! redux-multi */ "./node_modules/redux-multi/lib/index.js"); 26744 /* harmony import */ var redux_multi__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(redux_multi__WEBPACK_IMPORTED_MODULE_2__); 26745 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! lodash */ "lodash"); 26746 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_3__); 26747 /* harmony import */ var _effects__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./effects */ "./node_modules/@wordpress/editor/build-module/store/effects.js"); 26748 26749 26750 /** 26751 * External dependencies 26752 */ 26753 26754 26755 26756 /** 26757 * Internal dependencies 26758 */ 26759 26760 26761 /** 26762 * Applies the custom middlewares used specifically in the editor module. 26763 * 26764 * @param {Object} store Store Object. 26765 * 26766 * @return {Object} Update Store Object. 26767 */ 26768 26769 function applyMiddlewares(store) { 26770 var middlewares = [refx__WEBPACK_IMPORTED_MODULE_1___default()(_effects__WEBPACK_IMPORTED_MODULE_4__["default"]), redux_multi__WEBPACK_IMPORTED_MODULE_2___default.a]; 26771 26772 var enhancedDispatch = function enhancedDispatch() { 26773 throw new Error('Dispatching while constructing your middleware is not allowed. ' + 'Other middleware would not be applied to this dispatch.'); 26774 }; 26775 26776 var chain = []; 26777 var middlewareAPI = { 26778 getState: store.getState, 26779 dispatch: function dispatch() { 26780 return enhancedDispatch.apply(void 0, arguments); 26781 } 26782 }; 26783 chain = middlewares.map(function (middleware) { 26784 return middleware(middlewareAPI); 26785 }); 26786 enhancedDispatch = lodash__WEBPACK_IMPORTED_MODULE_3__["flowRight"].apply(void 0, Object(_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_0__["default"])(chain))(store.dispatch); 26787 store.dispatch = enhancedDispatch; 26788 return store; 26789 } 26790 26791 /* harmony default export */ __webpack_exports__["default"] = (applyMiddlewares); 26792 26793 26794 /***/ }), 26795 26796 /***/ "./node_modules/@wordpress/editor/build-module/store/reducer.js": 26797 /*!**********************************************************************!*\ 26798 !*** ./node_modules/@wordpress/editor/build-module/store/reducer.js ***! 26799 \**********************************************************************/ 26800 /*! exports provided: getPostRawValue, hasSameKeys, isUpdatingSameBlockAttribute, isUpdatingSamePostProperty, shouldOverwriteState, editor, currentPost, isTyping, blockSelection, blocksMode, isInsertionPointVisible, template, settings, preferences, saving, notices, postLock, reusableBlocks, blockListSettings, autosave, tokens, default */ 26801 /***/ (function(module, __webpack_exports__, __webpack_require__) { 26802 26803 "use strict"; 26804 __webpack_require__.r(__webpack_exports__); 26805 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getPostRawValue", function() { return getPostRawValue; }); 26806 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "hasSameKeys", function() { return hasSameKeys; }); 26807 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isUpdatingSameBlockAttribute", function() { return isUpdatingSameBlockAttribute; }); 26808 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isUpdatingSamePostProperty", function() { return isUpdatingSamePostProperty; }); 26809 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "shouldOverwriteState", function() { return shouldOverwriteState; }); 26810 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "editor", function() { return editor; }); 26811 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "currentPost", function() { return currentPost; }); 26812 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isTyping", function() { return isTyping; }); 26813 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "blockSelection", function() { return blockSelection; }); 26814 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "blocksMode", function() { return blocksMode; }); 26815 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isInsertionPointVisible", function() { return isInsertionPointVisible; }); 26816 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "template", function() { return template; }); 26817 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "settings", function() { return settings; }); 26818 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "preferences", function() { return preferences; }); 26819 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "saving", function() { return saving; }); 26820 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "notices", function() { return notices; }); 26821 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "postLock", function() { return postLock; }); 26822 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "reusableBlocks", function() { return reusableBlocks; }); 26823 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "blockListSettings", function() { return blockListSettings; }); 26824 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "autosave", function() { return autosave; }); 26825 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "tokens", function() { return tokens; }); 26826 /* harmony import */ var _babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/slicedToArray */ "./node_modules/@babel/runtime/helpers/esm/slicedToArray.js"); 26827 /* harmony import */ var _babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectSpread */ "./node_modules/@babel/runtime/helpers/esm/objectSpread.js"); 26828 /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutProperties */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js"); 26829 /* harmony import */ var _babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/esm/toConsumableArray */ "./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js"); 26830 /* harmony import */ var _babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/esm/defineProperty */ "./node_modules/@babel/runtime/helpers/esm/defineProperty.js"); 26831 /* harmony import */ var _babel_runtime_helpers_esm_typeof__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/helpers/esm/typeof */ "./node_modules/@babel/runtime/helpers/esm/typeof.js"); 26832 /* harmony import */ var redux_optimist__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! redux-optimist */ "./node_modules/redux-optimist/index.js"); 26833 /* harmony import */ var redux_optimist__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(redux_optimist__WEBPACK_IMPORTED_MODULE_6__); 26834 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! lodash */ "lodash"); 26835 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_7__); 26836 /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks"); 26837 /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_8__); 26838 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); 26839 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_9__); 26840 /* harmony import */ var _utils_with_history__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../utils/with-history */ "./node_modules/@wordpress/editor/build-module/utils/with-history/index.js"); 26841 /* harmony import */ var _utils_with_change_detection__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../utils/with-change-detection */ "./node_modules/@wordpress/editor/build-module/utils/with-change-detection/index.js"); 26842 /* harmony import */ var _defaults__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./defaults */ "./node_modules/@wordpress/editor/build-module/store/defaults.js"); 26843 /* harmony import */ var _array__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./array */ "./node_modules/@wordpress/editor/build-module/store/array.js"); 26844 26845 26846 26847 26848 26849 26850 26851 /** 26852 * External dependencies 26853 */ 26854 26855 26856 /** 26857 * WordPress dependencies 26858 */ 26859 26860 26861 26862 /** 26863 * Internal dependencies 26864 */ 26865 26866 26867 26868 26869 26870 /** 26871 * Returns a post attribute value, flattening nested rendered content using its 26872 * raw value in place of its original object form. 26873 * 26874 * @param {*} value Original value. 26875 * 26876 * @return {*} Raw value. 26877 */ 26878 26879 function getPostRawValue(value) { 26880 if (value && 'object' === Object(_babel_runtime_helpers_esm_typeof__WEBPACK_IMPORTED_MODULE_5__["default"])(value) && 'raw' in value) { 26881 return value.raw; 26882 } 26883 26884 return value; 26885 } 26886 /** 26887 * Given an array of blocks, returns an object where each key is a nesting 26888 * context, the value of which is an array of block client IDs existing within 26889 * that nesting context. 26890 * 26891 * @param {Array} blocks Blocks to map. 26892 * @param {?string} rootClientId Assumed root client ID. 26893 * 26894 * @return {Object} Block order map object. 26895 */ 26896 26897 function mapBlockOrder(blocks) { 26898 var rootClientId = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ''; 26899 26900 var result = Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_4__["default"])({}, rootClientId, []); 26901 26902 blocks.forEach(function (block) { 26903 var clientId = block.clientId, 26904 innerBlocks = block.innerBlocks; 26905 result[rootClientId].push(clientId); 26906 Object.assign(result, mapBlockOrder(innerBlocks, clientId)); 26907 }); 26908 return result; 26909 } 26910 /** 26911 * Given an array of blocks, returns an object containing all blocks, recursing 26912 * into inner blocks. Keys correspond to the block client ID, the value of 26913 * which is the block object. 26914 * 26915 * @param {Array} blocks Blocks to flatten. 26916 * 26917 * @return {Object} Flattened blocks object. 26918 */ 26919 26920 26921 function getFlattenedBlocks(blocks) { 26922 var flattenedBlocks = {}; 26923 26924 var stack = Object(_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_3__["default"])(blocks); 26925 26926 while (stack.length) { 26927 // `innerBlocks` is redundant data which can fall out of sync, since 26928 // this is reflected in `blockOrder`, so exclude from appended block. 26929 var _stack$shift = stack.shift(), 26930 innerBlocks = _stack$shift.innerBlocks, 26931 block = Object(_babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_2__["default"])(_stack$shift, ["innerBlocks"]); 26932 26933 stack.push.apply(stack, Object(_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_3__["default"])(innerBlocks)); 26934 flattenedBlocks[block.clientId] = block; 26935 } 26936 26937 return flattenedBlocks; 26938 } 26939 /** 26940 * Returns true if the two object arguments have the same keys, or false 26941 * otherwise. 26942 * 26943 * @param {Object} a First object. 26944 * @param {Object} b Second object. 26945 * 26946 * @return {boolean} Whether the two objects have the same keys. 26947 */ 26948 26949 26950 function hasSameKeys(a, b) { 26951 return Object(lodash__WEBPACK_IMPORTED_MODULE_7__["isEqual"])(Object(lodash__WEBPACK_IMPORTED_MODULE_7__["keys"])(a), Object(lodash__WEBPACK_IMPORTED_MODULE_7__["keys"])(b)); 26952 } 26953 /** 26954 * Returns true if, given the currently dispatching action and the previously 26955 * dispatched action, the two actions are updating the same block attribute, or 26956 * false otherwise. 26957 * 26958 * @param {Object} action Currently dispatching action. 26959 * @param {Object} previousAction Previously dispatched action. 26960 * 26961 * @return {boolean} Whether actions are updating the same block attribute. 26962 */ 26963 26964 function isUpdatingSameBlockAttribute(action, previousAction) { 26965 return action.type === 'UPDATE_BLOCK_ATTRIBUTES' && action.clientId === previousAction.clientId && hasSameKeys(action.attributes, previousAction.attributes); 26966 } 26967 /** 26968 * Returns true if, given the currently dispatching action and the previously 26969 * dispatched action, the two actions are editing the same post property, or 26970 * false otherwise. 26971 * 26972 * @param {Object} action Currently dispatching action. 26973 * @param {Object} previousAction Previously dispatched action. 26974 * 26975 * @return {boolean} Whether actions are updating the same post property. 26976 */ 26977 26978 function isUpdatingSamePostProperty(action, previousAction) { 26979 return action.type === 'EDIT_POST' && hasSameKeys(action.edits, previousAction.edits); 26980 } 26981 /** 26982 * Returns true if, given the currently dispatching action and the previously 26983 * dispatched action, the two actions are modifying the same property such that 26984 * undo history should be batched. 26985 * 26986 * @param {Object} action Currently dispatching action. 26987 * @param {Object} previousAction Previously dispatched action. 26988 * 26989 * @return {boolean} Whether to overwrite present state. 26990 */ 26991 26992 function shouldOverwriteState(action, previousAction) { 26993 if (!previousAction || action.type !== previousAction.type) { 26994 return false; 26995 } 26996 26997 return Object(lodash__WEBPACK_IMPORTED_MODULE_7__["overSome"])([isUpdatingSameBlockAttribute, isUpdatingSamePostProperty])(action, previousAction); 26998 } 26999 /** 27000 * Higher-order reducer targeting the combined editor reducer, augmenting 27001 * block client IDs in remove action to include cascade of inner blocks. 27002 * 27003 * @param {Function} reducer Original reducer function. 27004 * 27005 * @return {Function} Enhanced reducer function. 27006 */ 27007 27008 var withInnerBlocksRemoveCascade = function withInnerBlocksRemoveCascade(reducer) { 27009 return function (state, action) { 27010 if (state && action.type === 'REMOVE_BLOCKS') { 27011 var clientIds = Object(_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_3__["default"])(action.clientIds); // For each removed client ID, include its inner blocks to remove, 27012 // recursing into those so long as inner blocks exist. 27013 27014 27015 for (var i = 0; i < clientIds.length; i++) { 27016 clientIds.push.apply(clientIds, Object(_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_3__["default"])(state.blockOrder[clientIds[i]])); 27017 } 27018 27019 action = Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_1__["default"])({}, action, { 27020 clientIds: clientIds 27021 }); 27022 } 27023 27024 return reducer(state, action); 27025 }; 27026 }; 27027 /** 27028 * Undoable reducer returning the editor post state, including blocks parsed 27029 * from current HTML markup. 27030 * 27031 * Handles the following state keys: 27032 * - edits: an object describing changes to be made to the current post, in 27033 * the format accepted by the WP REST API 27034 * - blocksByClientId: post content blocks keyed by client ID 27035 * - blockOrder: object where each key is a client ID, its value an array of 27036 * client IDs representing the order of its inner blocks 27037 * 27038 * @param {Object} state Current state. 27039 * @param {Object} action Dispatched action. 27040 * 27041 * @returns {Object} Updated state. 27042 */ 27043 27044 27045 var editor = Object(lodash__WEBPACK_IMPORTED_MODULE_7__["flow"])([_wordpress_data__WEBPACK_IMPORTED_MODULE_9__["combineReducers"], withInnerBlocksRemoveCascade, // Track undo history, starting at editor initialization. 27046 Object(_utils_with_history__WEBPACK_IMPORTED_MODULE_10__["default"])({ 27047 resetTypes: ['SETUP_EDITOR_STATE'], 27048 ignoreTypes: ['RECEIVE_BLOCKS', 'RESET_POST', 'UPDATE_POST'], 27049 shouldOverwriteState: shouldOverwriteState 27050 }), // Track whether changes exist, resetting at each post save. Relies on 27051 // editor initialization firing post reset as an effect. 27052 Object(_utils_with_change_detection__WEBPACK_IMPORTED_MODULE_11__["default"])({ 27053 resetTypes: ['SETUP_EDITOR_STATE', 'REQUEST_POST_UPDATE_START'], 27054 ignoreTypes: ['RECEIVE_BLOCKS', 'RESET_POST', 'UPDATE_POST'] 27055 })])({ 27056 edits: function edits() { 27057 var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; 27058 var action = arguments.length > 1 ? arguments[1] : undefined; 27059 27060 switch (action.type) { 27061 case 'EDIT_POST': 27062 case 'SETUP_EDITOR_STATE': 27063 return Object(lodash__WEBPACK_IMPORTED_MODULE_7__["reduce"])(action.edits, function (result, value, key) { 27064 // Only assign into result if not already same value 27065 if (value !== state[key]) { 27066 // Avoid mutating original state by creating shallow 27067 // clone. Should only occur once per reduce. 27068 if (result === state) { 27069 result = Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_1__["default"])({}, state); 27070 } 27071 27072 result[key] = value; 27073 } 27074 27075 return result; 27076 }, state); 27077 27078 case 'RESET_BLOCKS': 27079 if ('content' in state) { 27080 return Object(lodash__WEBPACK_IMPORTED_MODULE_7__["omit"])(state, 'content'); 27081 } 27082 27083 return state; 27084 27085 case 'DIRTY_ARTIFICIALLY': 27086 return Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_1__["default"])({}, state); 27087 27088 case 'UPDATE_POST': 27089 case 'RESET_POST': 27090 var getCanonicalValue = action.type === 'UPDATE_POST' ? function (key) { 27091 return action.edits[key]; 27092 } : function (key) { 27093 return getPostRawValue(action.post[key]); 27094 }; 27095 return Object(lodash__WEBPACK_IMPORTED_MODULE_7__["reduce"])(state, function (result, value, key) { 27096 if (value !== getCanonicalValue(key)) { 27097 return result; 27098 } 27099 27100 if (state === result) { 27101 result = Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_1__["default"])({}, state); 27102 } 27103 27104 delete result[key]; 27105 return result; 27106 }, state); 27107 } 27108 27109 return state; 27110 }, 27111 blocksByClientId: function blocksByClientId() { 27112 var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; 27113 var action = arguments.length > 1 ? arguments[1] : undefined; 27114 27115 switch (action.type) { 27116 case 'RESET_BLOCKS': 27117 case 'SETUP_EDITOR_STATE': 27118 return getFlattenedBlocks(action.blocks); 27119 27120 case 'RECEIVE_BLOCKS': 27121 return Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_1__["default"])({}, state, getFlattenedBlocks(action.blocks)); 27122 27123 case 'UPDATE_BLOCK_ATTRIBUTES': 27124 // Ignore updates if block isn't known 27125 if (!state[action.clientId]) { 27126 return state; 27127 } // Consider as updates only changed values 27128 27129 27130 var nextAttributes = Object(lodash__WEBPACK_IMPORTED_MODULE_7__["reduce"])(action.attributes, function (result, value, key) { 27131 if (value !== result[key]) { 27132 // Avoid mutating original block by creating shallow clone 27133 if (result === state[action.clientId].attributes) { 27134 result = Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_1__["default"])({}, result); 27135 } 27136 27137 result[key] = value; 27138 } 27139 27140 return result; 27141 }, state[action.clientId].attributes); // Skip update if nothing has been changed. The reference will 27142 // match the original block if `reduce` had no changed values. 27143 27144 if (nextAttributes === state[action.clientId].attributes) { 27145 return state; 27146 } // Otherwise merge attributes into state 27147 27148 27149 return Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_1__["default"])({}, state, Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_4__["default"])({}, action.clientId, Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_1__["default"])({}, state[action.clientId], { 27150 attributes: nextAttributes 27151 }))); 27152 27153 case 'MOVE_BLOCK_TO_POSITION': 27154 // Avoid creating a new instance if the layout didn't change. 27155 if (state[action.clientId].attributes.layout === action.layout) { 27156 return state; 27157 } 27158 27159 return Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_1__["default"])({}, state, Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_4__["default"])({}, action.clientId, Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_1__["default"])({}, state[action.clientId], { 27160 attributes: Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_1__["default"])({}, state[action.clientId].attributes, { 27161 layout: action.layout 27162 }) 27163 }))); 27164 27165 case 'UPDATE_BLOCK': 27166 // Ignore updates if block isn't known 27167 if (!state[action.clientId]) { 27168 return state; 27169 } 27170 27171 return Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_1__["default"])({}, state, Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_4__["default"])({}, action.clientId, Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_1__["default"])({}, state[action.clientId], action.updates))); 27172 27173 case 'INSERT_BLOCKS': 27174 return Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_1__["default"])({}, state, getFlattenedBlocks(action.blocks)); 27175 27176 case 'REPLACE_BLOCKS': 27177 if (!action.blocks) { 27178 return state; 27179 } 27180 27181 return Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_1__["default"])({}, Object(lodash__WEBPACK_IMPORTED_MODULE_7__["omit"])(state, action.clientIds), getFlattenedBlocks(action.blocks)); 27182 27183 case 'REMOVE_BLOCKS': 27184 return Object(lodash__WEBPACK_IMPORTED_MODULE_7__["omit"])(state, action.clientIds); 27185 27186 case 'SAVE_REUSABLE_BLOCK_SUCCESS': 27187 { 27188 var id = action.id, 27189 updatedId = action.updatedId; // If a temporary reusable block is saved, we swap the temporary id with the final one 27190 27191 if (id === updatedId) { 27192 return state; 27193 } 27194 27195 return Object(lodash__WEBPACK_IMPORTED_MODULE_7__["mapValues"])(state, function (block) { 27196 if (block.name === 'core/block' && block.attributes.ref === id) { 27197 return Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_1__["default"])({}, block, { 27198 attributes: Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_1__["default"])({}, block.attributes, { 27199 ref: updatedId 27200 }) 27201 }); 27202 } 27203 27204 return block; 27205 }); 27206 } 27207 } 27208 27209 return state; 27210 }, 27211 blockOrder: function blockOrder() { 27212 var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; 27213 var action = arguments.length > 1 ? arguments[1] : undefined; 27214 27215 switch (action.type) { 27216 case 'RESET_BLOCKS': 27217 case 'SETUP_EDITOR_STATE': 27218 return mapBlockOrder(action.blocks); 27219 27220 case 'RECEIVE_BLOCKS': 27221 return Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_1__["default"])({}, state, Object(lodash__WEBPACK_IMPORTED_MODULE_7__["omit"])(mapBlockOrder(action.blocks), '')); 27222 27223 case 'INSERT_BLOCKS': 27224 { 27225 var _action$rootClientId = action.rootClientId, 27226 rootClientId = _action$rootClientId === void 0 ? '' : _action$rootClientId, 27227 blocks = action.blocks; 27228 var subState = state[rootClientId] || []; 27229 var mappedBlocks = mapBlockOrder(blocks, rootClientId); 27230 var _action$index = action.index, 27231 index = _action$index === void 0 ? subState.length : _action$index; 27232 return Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_1__["default"])({}, state, mappedBlocks, Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_4__["default"])({}, rootClientId, Object(_array__WEBPACK_IMPORTED_MODULE_13__["insertAt"])(subState, mappedBlocks[rootClientId], index))); 27233 } 27234 27235 case 'MOVE_BLOCK_TO_POSITION': 27236 { 27237 var _objectSpread7; 27238 27239 var _action$fromRootClien = action.fromRootClientId, 27240 fromRootClientId = _action$fromRootClien === void 0 ? '' : _action$fromRootClien, 27241 _action$toRootClientI = action.toRootClientId, 27242 toRootClientId = _action$toRootClientI === void 0 ? '' : _action$toRootClientI, 27243 clientId = action.clientId; 27244 27245 var _action$index2 = action.index, 27246 _index = _action$index2 === void 0 ? state[toRootClientId].length : _action$index2; // Moving inside the same parent block 27247 27248 27249 if (fromRootClientId === toRootClientId) { 27250 var _subState = state[toRootClientId]; 27251 27252 var fromIndex = _subState.indexOf(clientId); 27253 27254 return Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_1__["default"])({}, state, Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_4__["default"])({}, toRootClientId, Object(_array__WEBPACK_IMPORTED_MODULE_13__["moveTo"])(state[toRootClientId], fromIndex, _index))); 27255 } // Moving from a parent block to another 27256 27257 27258 return Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_1__["default"])({}, state, (_objectSpread7 = {}, Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_4__["default"])(_objectSpread7, fromRootClientId, Object(lodash__WEBPACK_IMPORTED_MODULE_7__["without"])(state[fromRootClientId], clientId)), Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_4__["default"])(_objectSpread7, toRootClientId, Object(_array__WEBPACK_IMPORTED_MODULE_13__["insertAt"])(state[toRootClientId], clientId, _index)), _objectSpread7)); 27259 } 27260 27261 case 'MOVE_BLOCKS_UP': 27262 { 27263 var clientIds = action.clientIds, 27264 _action$rootClientId2 = action.rootClientId, 27265 _rootClientId = _action$rootClientId2 === void 0 ? '' : _action$rootClientId2; 27266 27267 var firstClientId = Object(lodash__WEBPACK_IMPORTED_MODULE_7__["first"])(clientIds); 27268 var _subState2 = state[_rootClientId]; 27269 27270 if (!_subState2.length || firstClientId === Object(lodash__WEBPACK_IMPORTED_MODULE_7__["first"])(_subState2)) { 27271 return state; 27272 } 27273 27274 var firstIndex = _subState2.indexOf(firstClientId); 27275 27276 return Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_1__["default"])({}, state, Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_4__["default"])({}, _rootClientId, Object(_array__WEBPACK_IMPORTED_MODULE_13__["moveTo"])(_subState2, firstIndex, firstIndex - 1, clientIds.length))); 27277 } 27278 27279 case 'MOVE_BLOCKS_DOWN': 27280 { 27281 var _clientIds = action.clientIds, 27282 _action$rootClientId3 = action.rootClientId, 27283 _rootClientId2 = _action$rootClientId3 === void 0 ? '' : _action$rootClientId3; 27284 27285 var _firstClientId = Object(lodash__WEBPACK_IMPORTED_MODULE_7__["first"])(_clientIds); 27286 27287 var lastClientId = Object(lodash__WEBPACK_IMPORTED_MODULE_7__["last"])(_clientIds); 27288 var _subState3 = state[_rootClientId2]; 27289 27290 if (!_subState3.length || lastClientId === Object(lodash__WEBPACK_IMPORTED_MODULE_7__["last"])(_subState3)) { 27291 return state; 27292 } 27293 27294 var _firstIndex = _subState3.indexOf(_firstClientId); 27295 27296 return Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_1__["default"])({}, state, Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_4__["default"])({}, _rootClientId2, Object(_array__WEBPACK_IMPORTED_MODULE_13__["moveTo"])(_subState3, _firstIndex, _firstIndex + 1, _clientIds.length))); 27297 } 27298 27299 case 'REPLACE_BLOCKS': 27300 { 27301 var _blocks = action.blocks, 27302 _clientIds2 = action.clientIds; 27303 27304 if (!_blocks) { 27305 return state; 27306 } 27307 27308 var _mappedBlocks = mapBlockOrder(_blocks); 27309 27310 return Object(lodash__WEBPACK_IMPORTED_MODULE_7__["flow"])([function (nextState) { 27311 return Object(lodash__WEBPACK_IMPORTED_MODULE_7__["omit"])(nextState, _clientIds2); 27312 }, function (nextState) { 27313 return Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_1__["default"])({}, nextState, Object(lodash__WEBPACK_IMPORTED_MODULE_7__["omit"])(_mappedBlocks, '')); 27314 }, function (nextState) { 27315 return Object(lodash__WEBPACK_IMPORTED_MODULE_7__["mapValues"])(nextState, function (subState) { 27316 return Object(lodash__WEBPACK_IMPORTED_MODULE_7__["reduce"])(subState, function (result, clientId) { 27317 if (clientId === _clientIds2[0]) { 27318 return Object(_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_3__["default"])(result).concat(Object(_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_3__["default"])(_mappedBlocks[''])); 27319 } 27320 27321 if (_clientIds2.indexOf(clientId) === -1) { 27322 result.push(clientId); 27323 } 27324 27325 return result; 27326 }, []); 27327 }); 27328 }])(state); 27329 } 27330 27331 case 'REMOVE_BLOCKS': 27332 return Object(lodash__WEBPACK_IMPORTED_MODULE_7__["flow"])([// Remove inner block ordering for removed blocks 27333 function (nextState) { 27334 return Object(lodash__WEBPACK_IMPORTED_MODULE_7__["omit"])(nextState, action.clientIds); 27335 }, // Remove deleted blocks from other blocks' orderings 27336 function (nextState) { 27337 return Object(lodash__WEBPACK_IMPORTED_MODULE_7__["mapValues"])(nextState, function (subState) { 27338 return lodash__WEBPACK_IMPORTED_MODULE_7__["without"].apply(void 0, [subState].concat(Object(_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_3__["default"])(action.clientIds))); 27339 }); 27340 }])(state); 27341 } 27342 27343 return state; 27344 } 27345 }); 27346 /** 27347 * Reducer returning the last-known state of the current post, in the format 27348 * returned by the WP REST API. 27349 * 27350 * @param {Object} state Current state. 27351 * @param {Object} action Dispatched action. 27352 * 27353 * @return {Object} Updated state. 27354 */ 27355 27356 function currentPost() { 27357 var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; 27358 var action = arguments.length > 1 ? arguments[1] : undefined; 27359 27360 switch (action.type) { 27361 case 'SETUP_EDITOR_STATE': 27362 case 'RESET_POST': 27363 case 'UPDATE_POST': 27364 var post; 27365 27366 if (action.post) { 27367 post = action.post; 27368 } else if (action.edits) { 27369 post = Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_1__["default"])({}, state, action.edits); 27370 } else { 27371 return state; 27372 } 27373 27374 return Object(lodash__WEBPACK_IMPORTED_MODULE_7__["mapValues"])(post, getPostRawValue); 27375 } 27376 27377 return state; 27378 } 27379 /** 27380 * Reducer returning typing state. 27381 * 27382 * @param {boolean} state Current state. 27383 * @param {Object} action Dispatched action. 27384 * 27385 * @return {boolean} Updated state. 27386 */ 27387 27388 function isTyping() { 27389 var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; 27390 var action = arguments.length > 1 ? arguments[1] : undefined; 27391 27392 switch (action.type) { 27393 case 'START_TYPING': 27394 return true; 27395 27396 case 'STOP_TYPING': 27397 return false; 27398 } 27399 27400 return state; 27401 } 27402 /** 27403 * Reducer returning the block selection's state. 27404 * 27405 * @param {Object} state Current state. 27406 * @param {Object} action Dispatched action. 27407 * 27408 * @return {Object} Updated state. 27409 */ 27410 27411 function blockSelection() { 27412 var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : { 27413 start: null, 27414 end: null, 27415 isMultiSelecting: false, 27416 isEnabled: true, 27417 initialPosition: null 27418 }; 27419 var action = arguments.length > 1 ? arguments[1] : undefined; 27420 27421 switch (action.type) { 27422 case 'CLEAR_SELECTED_BLOCK': 27423 if (state.start === null && state.end === null && !state.isMultiSelecting) { 27424 return state; 27425 } 27426 27427 return Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_1__["default"])({}, state, { 27428 start: null, 27429 end: null, 27430 isMultiSelecting: false, 27431 initialPosition: null 27432 }); 27433 27434 case 'START_MULTI_SELECT': 27435 if (state.isMultiSelecting) { 27436 return state; 27437 } 27438 27439 return Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_1__["default"])({}, state, { 27440 isMultiSelecting: true, 27441 initialPosition: null 27442 }); 27443 27444 case 'STOP_MULTI_SELECT': 27445 if (!state.isMultiSelecting) { 27446 return state; 27447 } 27448 27449 return Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_1__["default"])({}, state, { 27450 isMultiSelecting: false, 27451 initialPosition: null 27452 }); 27453 27454 case 'MULTI_SELECT': 27455 return Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_1__["default"])({}, state, { 27456 start: action.start, 27457 end: action.end, 27458 initialPosition: null 27459 }); 27460 27461 case 'SELECT_BLOCK': 27462 if (action.clientId === state.start && action.clientId === state.end) { 27463 return state; 27464 } 27465 27466 return Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_1__["default"])({}, state, { 27467 start: action.clientId, 27468 end: action.clientId, 27469 initialPosition: action.initialPosition 27470 }); 27471 27472 case 'INSERT_BLOCKS': 27473 return Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_1__["default"])({}, state, { 27474 start: action.blocks[0].clientId, 27475 end: action.blocks[0].clientId, 27476 initialPosition: null, 27477 isMultiSelecting: false 27478 }); 27479 27480 case 'REMOVE_BLOCKS': 27481 if (!action.clientIds || !action.clientIds.length || action.clientIds.indexOf(state.start) === -1) { 27482 return state; 27483 } 27484 27485 return Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_1__["default"])({}, state, { 27486 start: null, 27487 end: null, 27488 initialPosition: null, 27489 isMultiSelecting: false 27490 }); 27491 27492 case 'REPLACE_BLOCKS': 27493 if (action.clientIds.indexOf(state.start) === -1) { 27494 return state; 27495 } // If there is replacement block(s), assign first's client ID as 27496 // the next selected block. If empty replacement, reset to null. 27497 27498 27499 var nextSelectedBlockClientId = Object(lodash__WEBPACK_IMPORTED_MODULE_7__["get"])(action.blocks, [0, 'clientId'], null); 27500 return Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_1__["default"])({}, state, { 27501 start: nextSelectedBlockClientId, 27502 end: nextSelectedBlockClientId, 27503 initialPosition: null, 27504 isMultiSelecting: false 27505 }); 27506 27507 case 'TOGGLE_SELECTION': 27508 return Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_1__["default"])({}, state, { 27509 isEnabled: action.isSelectionEnabled 27510 }); 27511 } 27512 27513 return state; 27514 } 27515 function blocksMode() { 27516 var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; 27517 var action = arguments.length > 1 ? arguments[1] : undefined; 27518 27519 if (action.type === 'TOGGLE_BLOCK_MODE') { 27520 var clientId = action.clientId; 27521 return Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_1__["default"])({}, state, Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_4__["default"])({}, clientId, state[clientId] && state[clientId] === 'html' ? 'visual' : 'html')); 27522 } 27523 27524 return state; 27525 } 27526 /** 27527 * Reducer returning the block insertion point visibility, a boolean value 27528 * reflecting whether the insertion point should be shown. 27529 * 27530 * @param {Object} state Current state. 27531 * @param {Object} action Dispatched action. 27532 * 27533 * @return {Object} Updated state. 27534 */ 27535 27536 function isInsertionPointVisible() { 27537 var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; 27538 var action = arguments.length > 1 ? arguments[1] : undefined; 27539 27540 switch (action.type) { 27541 case 'SHOW_INSERTION_POINT': 27542 return true; 27543 27544 case 'HIDE_INSERTION_POINT': 27545 return false; 27546 } 27547 27548 return state; 27549 } 27550 /** 27551 * Reducer returning whether the post blocks match the defined template or not. 27552 * 27553 * @param {Object} state Current state. 27554 * @param {Object} action Dispatched action. 27555 * 27556 * @return {boolean} Updated state. 27557 */ 27558 27559 function template() { 27560 var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : { 27561 isValid: true 27562 }; 27563 var action = arguments.length > 1 ? arguments[1] : undefined; 27564 27565 switch (action.type) { 27566 case 'SET_TEMPLATE_VALIDITY': 27567 return Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_1__["default"])({}, state, { 27568 isValid: action.isValid 27569 }); 27570 } 27571 27572 return state; 27573 } 27574 /** 27575 * Reducer returning the editor setting. 27576 * 27577 * @param {Object} state Current state. 27578 * @param {Object} action Dispatched action. 27579 * 27580 * @return {Object} Updated state. 27581 */ 27582 27583 function settings() { 27584 var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _defaults__WEBPACK_IMPORTED_MODULE_12__["EDITOR_SETTINGS_DEFAULTS"]; 27585 var action = arguments.length > 1 ? arguments[1] : undefined; 27586 27587 switch (action.type) { 27588 case 'UPDATE_EDITOR_SETTINGS': 27589 return Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_1__["default"])({}, state, action.settings); 27590 } 27591 27592 return state; 27593 } 27594 /** 27595 * Reducer returning the user preferences. 27596 * 27597 * @param {Object} state Current state. 27598 * @param {Object} action Dispatched action. 27599 * 27600 * @return {string} Updated state. 27601 */ 27602 27603 function preferences() { 27604 var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _defaults__WEBPACK_IMPORTED_MODULE_12__["PREFERENCES_DEFAULTS"]; 27605 var action = arguments.length > 1 ? arguments[1] : undefined; 27606 27607 switch (action.type) { 27608 case 'INSERT_BLOCKS': 27609 case 'REPLACE_BLOCKS': 27610 return action.blocks.reduce(function (prevState, block) { 27611 var id = block.name; 27612 var insert = { 27613 name: block.name 27614 }; 27615 27616 if (Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_8__["isReusableBlock"])(block)) { 27617 insert.ref = block.attributes.ref; 27618 id += '/' + block.attributes.ref; 27619 } 27620 27621 return Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_1__["default"])({}, prevState, { 27622 insertUsage: Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_1__["default"])({}, prevState.insertUsage, Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_4__["default"])({}, id, { 27623 time: action.time, 27624 count: prevState.insertUsage[id] ? prevState.insertUsage[id].count + 1 : 1, 27625 insert: insert 27626 })) 27627 }); 27628 }, state); 27629 27630 case 'REMOVE_REUSABLE_BLOCK': 27631 return Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_1__["default"])({}, state, { 27632 insertUsage: Object(lodash__WEBPACK_IMPORTED_MODULE_7__["omitBy"])(state.insertUsage, function (_ref) { 27633 var insert = _ref.insert; 27634 return insert.ref === action.id; 27635 }) 27636 }); 27637 27638 case 'ENABLE_PUBLISH_SIDEBAR': 27639 return Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_1__["default"])({}, state, { 27640 isPublishSidebarEnabled: true 27641 }); 27642 27643 case 'DISABLE_PUBLISH_SIDEBAR': 27644 return Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_1__["default"])({}, state, { 27645 isPublishSidebarEnabled: false 27646 }); 27647 } 27648 27649 return state; 27650 } 27651 /** 27652 * Reducer returning current network request state (whether a request to 27653 * the WP REST API is in progress, successful, or failed). 27654 * 27655 * @param {Object} state Current state. 27656 * @param {Object} action Dispatched action. 27657 * 27658 * @return {Object} Updated state. 27659 */ 27660 27661 function saving() { 27662 var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; 27663 var action = arguments.length > 1 ? arguments[1] : undefined; 27664 27665 switch (action.type) { 27666 case 'REQUEST_POST_UPDATE_START': 27667 return { 27668 requesting: true, 27669 successful: false, 27670 error: null, 27671 isAutosave: action.isAutosave 27672 }; 27673 27674 case 'REQUEST_POST_UPDATE_SUCCESS': 27675 return { 27676 requesting: false, 27677 successful: true, 27678 error: null 27679 }; 27680 27681 case 'REQUEST_POST_UPDATE_FAILURE': 27682 return { 27683 requesting: false, 27684 successful: false, 27685 error: action.error 27686 }; 27687 } 27688 27689 return state; 27690 } 27691 function notices() { 27692 var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; 27693 var action = arguments.length > 1 ? arguments[1] : undefined; 27694 27695 switch (action.type) { 27696 case 'CREATE_NOTICE': 27697 return Object(_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_3__["default"])(Object(lodash__WEBPACK_IMPORTED_MODULE_7__["reject"])(state, { 27698 id: action.notice.id 27699 })).concat([action.notice]); 27700 27701 case 'REMOVE_NOTICE': 27702 var noticeId = action.noticeId; 27703 var index = Object(lodash__WEBPACK_IMPORTED_MODULE_7__["findIndex"])(state, { 27704 id: noticeId 27705 }); 27706 27707 if (index === -1) { 27708 return state; 27709 } 27710 27711 return Object(_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_3__["default"])(state.slice(0, index)).concat(Object(_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_3__["default"])(state.slice(index + 1))); 27712 } 27713 27714 return state; 27715 } 27716 /** 27717 * Post Lock State. 27718 * 27719 * @typedef {Object} PostLockState 27720 * 27721 * @property {boolean} isLocked Whether the post is locked. 27722 * @property {?boolean} isTakeover Whether the post editing has been taken over. 27723 * @property {?boolean} activePostLock Active post lock value. 27724 * @property {?Object} user User that took over the post. 27725 */ 27726 27727 /** 27728 * Reducer returning the post lock status. 27729 * 27730 * @param {PostLockState} state Current state. 27731 * @param {Object} action Dispatched action. 27732 * 27733 * @return {PostLockState} Updated state. 27734 */ 27735 27736 function postLock() { 27737 var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : { 27738 isLocked: false 27739 }; 27740 var action = arguments.length > 1 ? arguments[1] : undefined; 27741 27742 switch (action.type) { 27743 case 'UPDATE_POST_LOCK': 27744 return action.lock; 27745 } 27746 27747 return state; 27748 } 27749 var reusableBlocks = Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_9__["combineReducers"])({ 27750 data: function data() { 27751 var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; 27752 var action = arguments.length > 1 ? arguments[1] : undefined; 27753 27754 switch (action.type) { 27755 case 'RECEIVE_REUSABLE_BLOCKS': 27756 { 27757 return Object(lodash__WEBPACK_IMPORTED_MODULE_7__["reduce"])(action.results, function (nextState, result) { 27758 var _result$reusableBlock = result.reusableBlock, 27759 id = _result$reusableBlock.id, 27760 title = _result$reusableBlock.title; 27761 var clientId = result.parsedBlock.clientId; 27762 var value = { 27763 clientId: clientId, 27764 title: title 27765 }; 27766 27767 if (!Object(lodash__WEBPACK_IMPORTED_MODULE_7__["isEqual"])(nextState[id], value)) { 27768 if (nextState === state) { 27769 nextState = Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_1__["default"])({}, nextState); 27770 } 27771 27772 nextState[id] = value; 27773 } 27774 27775 return nextState; 27776 }, state); 27777 } 27778 27779 case 'UPDATE_REUSABLE_BLOCK_TITLE': 27780 { 27781 var id = action.id, 27782 title = action.title; 27783 27784 if (!state[id] || state[id].title === title) { 27785 return state; 27786 } 27787 27788 return Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_1__["default"])({}, state, Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_4__["default"])({}, id, Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_1__["default"])({}, state[id], { 27789 title: title 27790 }))); 27791 } 27792 27793 case 'SAVE_REUSABLE_BLOCK_SUCCESS': 27794 { 27795 var _id = action.id, 27796 updatedId = action.updatedId; // If a temporary reusable block is saved, we swap the temporary id with the final one 27797 27798 if (_id === updatedId) { 27799 return state; 27800 } 27801 27802 var value = state[_id]; 27803 return Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_1__["default"])({}, Object(lodash__WEBPACK_IMPORTED_MODULE_7__["omit"])(state, _id), Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_4__["default"])({}, updatedId, value)); 27804 } 27805 27806 case 'REMOVE_REUSABLE_BLOCK': 27807 { 27808 var _id2 = action.id; 27809 return Object(lodash__WEBPACK_IMPORTED_MODULE_7__["omit"])(state, _id2); 27810 } 27811 } 27812 27813 return state; 27814 }, 27815 isFetching: function isFetching() { 27816 var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; 27817 var action = arguments.length > 1 ? arguments[1] : undefined; 27818 27819 switch (action.type) { 27820 case 'FETCH_REUSABLE_BLOCKS': 27821 { 27822 var id = action.id; 27823 27824 if (!id) { 27825 return state; 27826 } 27827 27828 return Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_1__["default"])({}, state, Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_4__["default"])({}, id, true)); 27829 } 27830 27831 case 'FETCH_REUSABLE_BLOCKS_SUCCESS': 27832 case 'FETCH_REUSABLE_BLOCKS_FAILURE': 27833 { 27834 var _id3 = action.id; 27835 return Object(lodash__WEBPACK_IMPORTED_MODULE_7__["omit"])(state, _id3); 27836 } 27837 } 27838 27839 return state; 27840 }, 27841 isSaving: function isSaving() { 27842 var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; 27843 var action = arguments.length > 1 ? arguments[1] : undefined; 27844 27845 switch (action.type) { 27846 case 'SAVE_REUSABLE_BLOCK': 27847 return Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_1__["default"])({}, state, Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_4__["default"])({}, action.id, true)); 27848 27849 case 'SAVE_REUSABLE_BLOCK_SUCCESS': 27850 case 'SAVE_REUSABLE_BLOCK_FAILURE': 27851 { 27852 var id = action.id; 27853 return Object(lodash__WEBPACK_IMPORTED_MODULE_7__["omit"])(state, id); 27854 } 27855 } 27856 27857 return state; 27858 } 27859 }); 27860 /** 27861 * Reducer returning an object where each key is a block client ID, its value 27862 * representing the settings for its nested blocks. 27863 * 27864 * @param {Object} state Current state. 27865 * @param {Object} action Dispatched action. 27866 * 27867 * @return {Object} Updated state. 27868 */ 27869 27870 var blockListSettings = function blockListSettings() { 27871 var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; 27872 var action = arguments.length > 1 ? arguments[1] : undefined; 27873 27874 switch (action.type) { 27875 // Even if the replaced blocks have the same client ID, our logic 27876 // should correct the state. 27877 case 'REPLACE_BLOCKS': 27878 case 'REMOVE_BLOCKS': 27879 { 27880 return Object(lodash__WEBPACK_IMPORTED_MODULE_7__["omit"])(state, action.clientIds); 27881 } 27882 27883 case 'UPDATE_BLOCK_LIST_SETTINGS': 27884 { 27885 var clientId = action.clientId; 27886 27887 if (!action.settings) { 27888 if (state.hasOwnProperty(clientId)) { 27889 return Object(lodash__WEBPACK_IMPORTED_MODULE_7__["omit"])(state, clientId); 27890 } 27891 27892 return state; 27893 } 27894 27895 if (Object(lodash__WEBPACK_IMPORTED_MODULE_7__["isEqual"])(state[clientId], action.settings)) { 27896 return state; 27897 } 27898 27899 return Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_1__["default"])({}, state, Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_4__["default"])({}, clientId, action.settings)); 27900 } 27901 } 27902 27903 return state; 27904 }; 27905 /** 27906 * Reducer returning the most recent autosave. 27907 * 27908 * @param {Object} state The autosave object. 27909 * @param {Object} action Dispatched action. 27910 * 27911 * @return {Object} Updated state. 27912 */ 27913 27914 function autosave() { 27915 var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null; 27916 var action = arguments.length > 1 ? arguments[1] : undefined; 27917 27918 switch (action.type) { 27919 case 'RESET_AUTOSAVE': 27920 var post = action.post; 27921 27922 var _map = ['title', 'excerpt', 'content'].map(function (field) { 27923 return getPostRawValue(post[field]); 27924 }), 27925 _map2 = Object(_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_0__["default"])(_map, 3), 27926 title = _map2[0], 27927 excerpt = _map2[1], 27928 content = _map2[2]; 27929 27930 return { 27931 title: title, 27932 excerpt: excerpt, 27933 content: content, 27934 preview_link: post.preview_link 27935 }; 27936 27937 case 'REQUEST_POST_UPDATE': 27938 // Invalidate known preview link when autosave starts. 27939 if (state && action.options.autosave) { 27940 return Object(lodash__WEBPACK_IMPORTED_MODULE_7__["omit"])(state, 'preview_link'); 27941 } 27942 27943 break; 27944 } 27945 27946 return state; 27947 } 27948 /** 27949 * Reducer managing the block types 27950 * 27951 * @param {Object} state Current state. 27952 * @param {Object} action Dispatched action. 27953 * 27954 * @return {Object} Updated state. 27955 */ 27956 27957 function tokens() { 27958 var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; 27959 var action = arguments.length > 1 ? arguments[1] : undefined; 27960 27961 switch (action.type) { 27962 case 'REGISTER_TOKEN': 27963 return Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_1__["default"])({}, state, Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_4__["default"])({}, action.name, action.settings)); 27964 27965 case 'UNREGISTER_TOKEN': 27966 return Object(lodash__WEBPACK_IMPORTED_MODULE_7__["omit"])(state, action.name); 27967 } 27968 27969 return state; 27970 } 27971 /* harmony default export */ __webpack_exports__["default"] = (redux_optimist__WEBPACK_IMPORTED_MODULE_6___default()(Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_9__["combineReducers"])({ 27972 editor: editor, 27973 currentPost: currentPost, 27974 isTyping: isTyping, 27975 blockSelection: blockSelection, 27976 blocksMode: blocksMode, 27977 blockListSettings: blockListSettings, 27978 isInsertionPointVisible: isInsertionPointVisible, 27979 preferences: preferences, 27980 saving: saving, 27981 postLock: postLock, 27982 notices: notices, 27983 reusableBlocks: reusableBlocks, 27984 template: template, 27985 autosave: autosave, 27986 settings: settings, 27987 tokens: tokens 27988 }))); 27989 27990 27991 /***/ }), 27992 27993 /***/ "./node_modules/@wordpress/editor/build-module/store/selectors.js": 27994 /*!************************************************************************!*\ 27995 !*** ./node_modules/@wordpress/editor/build-module/store/selectors.js ***! 27996 \************************************************************************/ 27997 /*! exports provided: POST_UPDATE_TRANSACTION_ID, INSERTER_UTILITY_HIGH, INSERTER_UTILITY_MEDIUM, INSERTER_UTILITY_LOW, INSERTER_UTILITY_NONE, hasEditorUndo, hasEditorRedo, isEditedPostNew, isEditedPostDirty, isCleanNewPost, getCurrentPost, getCurrentPostType, getCurrentPostId, getCurrentPostRevisionsCount, getCurrentPostLastRevisionId, getPostEdits, getCurrentPostAttribute, getEditedPostAttribute, getAutosaveAttribute, getEditedPostVisibility, isCurrentPostPending, isCurrentPostPublished, isCurrentPostScheduled, isEditedPostPublishable, isEditedPostSaveable, isEditedPostEmpty, isEditedPostAutosaveable, getAutosave, hasAutosave, isEditedPostBeingScheduled, isEditedPostDateFloating, getBlockDependantsCacheBust, getBlockName, getBlock, getBlocks, getClientIdsOfDescendants, getClientIdsWithDescendants, getGlobalBlockCount, getBlocksByClientId, getBlockCount, getBlockSelectionStart, getBlockSelectionEnd, getSelectedBlockCount, hasSelectedBlock, getSelectedBlockClientId, getSelectedBlock, getBlockRootClientId, getAdjacentBlockClientId, getPreviousBlockClientId, getNextBlockClientId, getSelectedBlocksInitialCaretPosition, getMultiSelectedBlockClientIds, getMultiSelectedBlocks, getFirstMultiSelectedBlockClientId, getLastMultiSelectedBlockClientId, isFirstMultiSelectedBlock, isBlockMultiSelected, isAncestorMultiSelected, getMultiSelectedBlocksStartClientId, getMultiSelectedBlocksEndClientId, getBlockOrder, getBlockIndex, isBlockSelected, hasSelectedInnerBlock, isBlockWithinSelection, hasMultiSelection, isMultiSelecting, isSelectionEnabled, getBlockMode, isTyping, getBlockInsertionPoint, isBlockInsertionPointVisible, isValidTemplate, getTemplate, getTemplateLock, isSavingPost, didPostSaveRequestSucceed, didPostSaveRequestFail, isAutosavingPost, getSuggestedPostFormat, getBlocksForSerialization, getEditedPostContent, getNotices, canInsertBlockType, getInserterItems, getReusableBlock, isSavingReusableBlock, isFetchingReusableBlock, getReusableBlocks, getStateBeforeOptimisticTransaction, isPublishingPost, isPermalinkEditable, getPermalink, getPermalinkParts, inSomeHistory, getBlockListSettings, getEditorSettings, getTokenSettings, isPostLocked, isPostLockTakeover, getPostLockUser, getActivePostLock, canUserUseUnfilteredHTML, isPublishSidebarEnabled */ 27998 /***/ (function(module, __webpack_exports__, __webpack_require__) { 27999 28000 "use strict"; 28001 __webpack_require__.r(__webpack_exports__); 28002 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "POST_UPDATE_TRANSACTION_ID", function() { return POST_UPDATE_TRANSACTION_ID; }); 28003 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "INSERTER_UTILITY_HIGH", function() { return INSERTER_UTILITY_HIGH; }); 28004 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "INSERTER_UTILITY_MEDIUM", function() { return INSERTER_UTILITY_MEDIUM; }); 28005 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "INSERTER_UTILITY_LOW", function() { return INSERTER_UTILITY_LOW; }); 28006 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "INSERTER_UTILITY_NONE", function() { return INSERTER_UTILITY_NONE; }); 28007 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "hasEditorUndo", function() { return hasEditorUndo; }); 28008 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "hasEditorRedo", function() { return hasEditorRedo; }); 28009 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isEditedPostNew", function() { return isEditedPostNew; }); 28010 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isEditedPostDirty", function() { return isEditedPostDirty; }); 28011 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isCleanNewPost", function() { return isCleanNewPost; }); 28012 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getCurrentPost", function() { return getCurrentPost; }); 28013 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getCurrentPostType", function() { return getCurrentPostType; }); 28014 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getCurrentPostId", function() { return getCurrentPostId; }); 28015 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getCurrentPostRevisionsCount", function() { return getCurrentPostRevisionsCount; }); 28016 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getCurrentPostLastRevisionId", function() { return getCurrentPostLastRevisionId; }); 28017 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getPostEdits", function() { return getPostEdits; }); 28018 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getCurrentPostAttribute", function() { return getCurrentPostAttribute; }); 28019 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getEditedPostAttribute", function() { return getEditedPostAttribute; }); 28020 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getAutosaveAttribute", function() { return getAutosaveAttribute; }); 28021 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getEditedPostVisibility", function() { return getEditedPostVisibility; }); 28022 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isCurrentPostPending", function() { return isCurrentPostPending; }); 28023 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isCurrentPostPublished", function() { return isCurrentPostPublished; }); 28024 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isCurrentPostScheduled", function() { return isCurrentPostScheduled; }); 28025 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isEditedPostPublishable", function() { return isEditedPostPublishable; }); 28026 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isEditedPostSaveable", function() { return isEditedPostSaveable; }); 28027 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isEditedPostEmpty", function() { return isEditedPostEmpty; }); 28028 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isEditedPostAutosaveable", function() { return isEditedPostAutosaveable; }); 28029 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getAutosave", function() { return getAutosave; }); 28030 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "hasAutosave", function() { return hasAutosave; }); 28031 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isEditedPostBeingScheduled", function() { return isEditedPostBeingScheduled; }); 28032 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isEditedPostDateFloating", function() { return isEditedPostDateFloating; }); 28033 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getBlockDependantsCacheBust", function() { return getBlockDependantsCacheBust; }); 28034 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getBlockName", function() { return getBlockName; }); 28035 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getBlock", function() { return getBlock; }); 28036 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getBlocks", function() { return getBlocks; }); 28037 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getClientIdsOfDescendants", function() { return getClientIdsOfDescendants; }); 28038 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getClientIdsWithDescendants", function() { return getClientIdsWithDescendants; }); 28039 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getGlobalBlockCount", function() { return getGlobalBlockCount; }); 28040 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getBlocksByClientId", function() { return getBlocksByClientId; }); 28041 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getBlockCount", function() { return getBlockCount; }); 28042 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getBlockSelectionStart", function() { return getBlockSelectionStart; }); 28043 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getBlockSelectionEnd", function() { return getBlockSelectionEnd; }); 28044 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getSelectedBlockCount", function() { return getSelectedBlockCount; }); 28045 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "hasSelectedBlock", function() { return hasSelectedBlock; }); 28046 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getSelectedBlockClientId", function() { return getSelectedBlockClientId; }); 28047 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getSelectedBlock", function() { return getSelectedBlock; }); 28048 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getBlockRootClientId", function() { return getBlockRootClientId; }); 28049 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getAdjacentBlockClientId", function() { return getAdjacentBlockClientId; }); 28050 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getPreviousBlockClientId", function() { return getPreviousBlockClientId; }); 28051 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getNextBlockClientId", function() { return getNextBlockClientId; }); 28052 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getSelectedBlocksInitialCaretPosition", function() { return getSelectedBlocksInitialCaretPosition; }); 28053 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getMultiSelectedBlockClientIds", function() { return getMultiSelectedBlockClientIds; }); 28054 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getMultiSelectedBlocks", function() { return getMultiSelectedBlocks; }); 28055 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getFirstMultiSelectedBlockClientId", function() { return getFirstMultiSelectedBlockClientId; }); 28056 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getLastMultiSelectedBlockClientId", function() { return getLastMultiSelectedBlockClientId; }); 28057 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isFirstMultiSelectedBlock", function() { return isFirstMultiSelectedBlock; }); 28058 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isBlockMultiSelected", function() { return isBlockMultiSelected; }); 28059 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isAncestorMultiSelected", function() { return isAncestorMultiSelected; }); 28060 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getMultiSelectedBlocksStartClientId", function() { return getMultiSelectedBlocksStartClientId; }); 28061 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getMultiSelectedBlocksEndClientId", function() { return getMultiSelectedBlocksEndClientId; }); 28062 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getBlockOrder", function() { return getBlockOrder; }); 28063 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getBlockIndex", function() { return getBlockIndex; }); 28064 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isBlockSelected", function() { return isBlockSelected; }); 28065 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "hasSelectedInnerBlock", function() { return hasSelectedInnerBlock; }); 28066 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isBlockWithinSelection", function() { return isBlockWithinSelection; }); 28067 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "hasMultiSelection", function() { return hasMultiSelection; }); 28068 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isMultiSelecting", function() { return isMultiSelecting; }); 28069 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isSelectionEnabled", function() { return isSelectionEnabled; }); 28070 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getBlockMode", function() { return getBlockMode; }); 28071 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isTyping", function() { return isTyping; }); 28072 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getBlockInsertionPoint", function() { return getBlockInsertionPoint; }); 28073 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isBlockInsertionPointVisible", function() { return isBlockInsertionPointVisible; }); 28074 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isValidTemplate", function() { return isValidTemplate; }); 28075 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getTemplate", function() { return getTemplate; }); 28076 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getTemplateLock", function() { return getTemplateLock; }); 28077 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isSavingPost", function() { return isSavingPost; }); 28078 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "didPostSaveRequestSucceed", function() { return didPostSaveRequestSucceed; }); 28079 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "didPostSaveRequestFail", function() { return didPostSaveRequestFail; }); 28080 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isAutosavingPost", function() { return isAutosavingPost; }); 28081 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getSuggestedPostFormat", function() { return getSuggestedPostFormat; }); 28082 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getBlocksForSerialization", function() { return getBlocksForSerialization; }); 28083 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getEditedPostContent", function() { return getEditedPostContent; }); 28084 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getNotices", function() { return getNotices; }); 28085 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "canInsertBlockType", function() { return canInsertBlockType; }); 28086 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getInserterItems", function() { return getInserterItems; }); 28087 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getReusableBlock", function() { return getReusableBlock; }); 28088 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isSavingReusableBlock", function() { return isSavingReusableBlock; }); 28089 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isFetchingReusableBlock", function() { return isFetchingReusableBlock; }); 28090 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getReusableBlocks", function() { return getReusableBlocks; }); 28091 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getStateBeforeOptimisticTransaction", function() { return getStateBeforeOptimisticTransaction; }); 28092 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isPublishingPost", function() { return isPublishingPost; }); 28093 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isPermalinkEditable", function() { return isPermalinkEditable; }); 28094 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getPermalink", function() { return getPermalink; }); 28095 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getPermalinkParts", function() { return getPermalinkParts; }); 28096 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "inSomeHistory", function() { return inSomeHistory; }); 28097 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getBlockListSettings", function() { return getBlockListSettings; }); 28098 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getEditorSettings", function() { return getEditorSettings; }); 28099 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getTokenSettings", function() { return getTokenSettings; }); 28100 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isPostLocked", function() { return isPostLocked; }); 28101 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isPostLockTakeover", function() { return isPostLockTakeover; }); 28102 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getPostLockUser", function() { return getPostLockUser; }); 28103 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getActivePostLock", function() { return getActivePostLock; }); 28104 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "canUserUseUnfilteredHTML", function() { return canUserUseUnfilteredHTML; }); 28105 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isPublishSidebarEnabled", function() { return isPublishSidebarEnabled; }); 28106 /* harmony import */ var _babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/slicedToArray */ "./node_modules/@babel/runtime/helpers/esm/slicedToArray.js"); 28107 /* harmony import */ var _babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/toConsumableArray */ "./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js"); 28108 /* harmony import */ var _babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectSpread */ "./node_modules/@babel/runtime/helpers/esm/objectSpread.js"); 28109 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! lodash */ "lodash"); 28110 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_3__); 28111 /* harmony import */ var rememo__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! rememo */ "./node_modules/rememo/es/rememo.js"); 28112 /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks"); 28113 /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_5__); 28114 /* harmony import */ var _wordpress_date__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @wordpress/date */ "@wordpress/date"); 28115 /* harmony import */ var _wordpress_date__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_wordpress_date__WEBPACK_IMPORTED_MODULE_6__); 28116 /* harmony import */ var _wordpress_autop__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @wordpress/autop */ "@wordpress/autop"); 28117 /* harmony import */ var _wordpress_autop__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_wordpress_autop__WEBPACK_IMPORTED_MODULE_7__); 28118 /* harmony import */ var _defaults__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./defaults */ "./node_modules/@wordpress/editor/build-module/store/defaults.js"); 28119 28120 28121 28122 28123 /** 28124 * External dependencies 28125 */ 28126 28127 28128 /** 28129 * WordPress dependencies 28130 */ 28131 28132 28133 28134 28135 /** 28136 * Dependencies 28137 */ 28138 28139 28140 /*** 28141 * Module constants 28142 */ 28143 28144 var POST_UPDATE_TRANSACTION_ID = 'post-update'; 28145 var PERMALINK_POSTNAME_REGEX = /%(?:postname|pagename)%/; 28146 var INSERTER_UTILITY_HIGH = 3; 28147 var INSERTER_UTILITY_MEDIUM = 2; 28148 var INSERTER_UTILITY_LOW = 1; 28149 var INSERTER_UTILITY_NONE = 0; 28150 var MILLISECONDS_PER_HOUR = 3600 * 1000; 28151 var MILLISECONDS_PER_DAY = 24 * 3600 * 1000; 28152 var MILLISECONDS_PER_WEEK = 7 * 24 * 3600 * 1000; 28153 /** 28154 * Shared reference to an empty array for cases where it is important to avoid 28155 * returning a new array reference on every invocation, as in a connected or 28156 * other pure component which performs `shouldComponentUpdate` check on props. 28157 * This should be used as a last resort, since the normalized data should be 28158 * maintained by the reducer result in state. 28159 * 28160 * @type {Array} 28161 */ 28162 28163 var EMPTY_ARRAY = []; 28164 /** 28165 * Returns true if any past editor history snapshots exist, or false otherwise. 28166 * 28167 * @param {Object} state Global application state. 28168 * 28169 * @return {boolean} Whether undo history exists. 28170 */ 28171 28172 function hasEditorUndo(state) { 28173 return state.editor.past.length > 0; 28174 } 28175 /** 28176 * Returns true if any future editor history snapshots exist, or false 28177 * otherwise. 28178 * 28179 * @param {Object} state Global application state. 28180 * 28181 * @return {boolean} Whether redo history exists. 28182 */ 28183 28184 function hasEditorRedo(state) { 28185 return state.editor.future.length > 0; 28186 } 28187 /** 28188 * Returns true if the currently edited post is yet to be saved, or false if 28189 * the post has been saved. 28190 * 28191 * @param {Object} state Global application state. 28192 * 28193 * @return {boolean} Whether the post is new. 28194 */ 28195 28196 function isEditedPostNew(state) { 28197 return getCurrentPost(state).status === 'auto-draft'; 28198 } 28199 /** 28200 * Returns true if there are unsaved values for the current edit session, or 28201 * false if the editing state matches the saved or new post. 28202 * 28203 * @param {Object} state Global application state. 28204 * 28205 * @return {boolean} Whether unsaved values exist. 28206 */ 28207 28208 function isEditedPostDirty(state) { 28209 return state.editor.isDirty || inSomeHistory(state, isEditedPostDirty); 28210 } 28211 /** 28212 * Returns true if there are no unsaved values for the current edit session and 28213 * if the currently edited post is new (has never been saved before). 28214 * 28215 * @param {Object} state Global application state. 28216 * 28217 * @return {boolean} Whether new post and unsaved values exist. 28218 */ 28219 28220 function isCleanNewPost(state) { 28221 return !isEditedPostDirty(state) && isEditedPostNew(state); 28222 } 28223 /** 28224 * Returns the post currently being edited in its last known saved state, not 28225 * including unsaved edits. Returns an object containing relevant default post 28226 * values if the post has not yet been saved. 28227 * 28228 * @param {Object} state Global application state. 28229 * 28230 * @return {Object} Post object. 28231 */ 28232 28233 function getCurrentPost(state) { 28234 return state.currentPost; 28235 } 28236 /** 28237 * Returns the post type of the post currently being edited. 28238 * 28239 * @param {Object} state Global application state. 28240 * 28241 * @return {string} Post type. 28242 */ 28243 28244 function getCurrentPostType(state) { 28245 return state.currentPost.type; 28246 } 28247 /** 28248 * Returns the ID of the post currently being edited, or null if the post has 28249 * not yet been saved. 28250 * 28251 * @param {Object} state Global application state. 28252 * 28253 * @return {?number} ID of current post. 28254 */ 28255 28256 function getCurrentPostId(state) { 28257 return getCurrentPost(state).id || null; 28258 } 28259 /** 28260 * Returns the number of revisions of the post currently being edited. 28261 * 28262 * @param {Object} state Global application state. 28263 * 28264 * @return {number} Number of revisions. 28265 */ 28266 28267 function getCurrentPostRevisionsCount(state) { 28268 return Object(lodash__WEBPACK_IMPORTED_MODULE_3__["get"])(getCurrentPost(state), ['_links', 'version-history', 0, 'count'], 0); 28269 } 28270 /** 28271 * Returns the last revision ID of the post currently being edited, 28272 * or null if the post has no revisions. 28273 * 28274 * @param {Object} state Global application state. 28275 * 28276 * @return {?number} ID of the last revision. 28277 */ 28278 28279 function getCurrentPostLastRevisionId(state) { 28280 return Object(lodash__WEBPACK_IMPORTED_MODULE_3__["get"])(getCurrentPost(state), ['_links', 'predecessor-version', 0, 'id'], null); 28281 } 28282 /** 28283 * Returns any post values which have been changed in the editor but not yet 28284 * been saved. 28285 * 28286 * @param {Object} state Global application state. 28287 * 28288 * @return {Object} Object of key value pairs comprising unsaved edits. 28289 */ 28290 28291 function getPostEdits(state) { 28292 return state.editor.present.edits; 28293 } 28294 /** 28295 * Returns an attribute value of the saved post. 28296 * 28297 * @param {Object} state Global application state. 28298 * @param {string} attributeName Post attribute name. 28299 * 28300 * @return {*} Post attribute value. 28301 */ 28302 28303 function getCurrentPostAttribute(state, attributeName) { 28304 var post = getCurrentPost(state); 28305 28306 if (post.hasOwnProperty(attributeName)) { 28307 return post[attributeName]; 28308 } 28309 } 28310 /** 28311 * Returns a single attribute of the post being edited, preferring the unsaved 28312 * edit if one exists, but falling back to the attribute for the last known 28313 * saved state of the post. 28314 * 28315 * @param {Object} state Global application state. 28316 * @param {string} attributeName Post attribute name. 28317 * 28318 * @return {*} Post attribute value. 28319 */ 28320 28321 function getEditedPostAttribute(state, attributeName) { 28322 var edits = getPostEdits(state); // Special cases 28323 28324 switch (attributeName) { 28325 case 'content': 28326 return getEditedPostContent(state); 28327 } 28328 28329 if (!edits.hasOwnProperty(attributeName)) { 28330 return getCurrentPostAttribute(state, attributeName); 28331 } 28332 28333 return edits[attributeName]; 28334 } 28335 /** 28336 * Returns an attribute value of the current autosave revision for a post, or 28337 * null if there is no autosave for the post. 28338 * 28339 * @param {Object} state Global application state. 28340 * @param {string} attributeName Autosave attribute name. 28341 * 28342 * @return {*} Autosave attribute value. 28343 */ 28344 28345 function getAutosaveAttribute(state, attributeName) { 28346 if (!hasAutosave(state)) { 28347 return null; 28348 } 28349 28350 var autosave = getAutosave(state); 28351 28352 if (autosave.hasOwnProperty(attributeName)) { 28353 return autosave[attributeName]; 28354 } 28355 } 28356 /** 28357 * Returns the current visibility of the post being edited, preferring the 28358 * unsaved value if different than the saved post. The return value is one of 28359 * "private", "password", or "public". 28360 * 28361 * @param {Object} state Global application state. 28362 * 28363 * @return {string} Post visibility. 28364 */ 28365 28366 function getEditedPostVisibility(state) { 28367 var status = getEditedPostAttribute(state, 'status'); 28368 var password = getEditedPostAttribute(state, 'password'); 28369 28370 if (status === 'private') { 28371 return 'private'; 28372 } else if (password) { 28373 return 'password'; 28374 } 28375 28376 return 'public'; 28377 } 28378 /** 28379 * Returns true if post is pending review. 28380 * 28381 * @param {Object} state Global application state. 28382 * 28383 * @return {boolean} Whether current post is pending review. 28384 */ 28385 28386 function isCurrentPostPending(state) { 28387 return getCurrentPost(state).status === 'pending'; 28388 } 28389 /** 28390 * Return true if the current post has already been published. 28391 * 28392 * @param {Object} state Global application state. 28393 * 28394 * @return {boolean} Whether the post has been published. 28395 */ 28396 28397 function isCurrentPostPublished(state) { 28398 var post = getCurrentPost(state); 28399 return ['publish', 'private'].indexOf(post.status) !== -1 || post.status === 'future' && Object(_wordpress_date__WEBPACK_IMPORTED_MODULE_6__["moment"])(post.date).isBefore(Object(_wordpress_date__WEBPACK_IMPORTED_MODULE_6__["moment"])()); 28400 } 28401 /** 28402 * Returns true if post is already scheduled. 28403 * 28404 * @param {Object} state Global application state. 28405 * 28406 * @return {boolean} Whether current post is scheduled to be posted. 28407 */ 28408 28409 function isCurrentPostScheduled(state) { 28410 return getCurrentPost(state).status === 'future' && !isCurrentPostPublished(state); 28411 } 28412 /** 28413 * Return true if the post being edited can be published. 28414 * 28415 * @param {Object} state Global application state. 28416 * 28417 * @return {boolean} Whether the post can been published. 28418 */ 28419 28420 function isEditedPostPublishable(state) { 28421 var post = getCurrentPost(state); // TODO: Post being publishable should be superset of condition of post 28422 // being saveable. Currently this restriction is imposed at UI. 28423 // 28424 // See: <PostPublishButton /> (`isButtonEnabled` assigned by `isSaveable`) 28425 28426 return isEditedPostDirty(state) || ['publish', 'private', 'future'].indexOf(post.status) === -1; 28427 } 28428 /** 28429 * Returns true if the post can be saved, or false otherwise. A post must 28430 * contain a title, an excerpt, or non-empty content to be valid for save. 28431 * 28432 * @param {Object} state Global application state. 28433 * 28434 * @return {boolean} Whether the post can be saved. 28435 */ 28436 28437 function isEditedPostSaveable(state) { 28438 if (isSavingPost(state)) { 28439 return false; 28440 } // TODO: Post should not be saveable if not dirty. Cannot be added here at 28441 // this time since posts where meta boxes are present can be saved even if 28442 // the post is not dirty. Currently this restriction is imposed at UI, but 28443 // should be moved here. 28444 // 28445 // See: `isEditedPostPublishable` (includes `isEditedPostDirty` condition) 28446 // See: <PostSavedState /> (`forceIsDirty` prop) 28447 // See: <PostPublishButton /> (`forceIsDirty` prop) 28448 // See: https://github.com/WordPress/gutenberg/pull/4184 28449 28450 28451 return !!getEditedPostAttribute(state, 'title') || !!getEditedPostAttribute(state, 'excerpt') || !isEditedPostEmpty(state); 28452 } 28453 /** 28454 * Returns true if the edited post has content. A post has content if it has at 28455 * least one saveable block or otherwise has a non-empty content property 28456 * assigned. 28457 * 28458 * @param {Object} state Global application state. 28459 * 28460 * @return {boolean} Whether post has content. 28461 */ 28462 28463 function isEditedPostEmpty(state) { 28464 // While the condition of truthy content string would be sufficient for 28465 // determining emptiness, testing saveable blocks length is a trivial 28466 // operation by comparison. Since this function can be called frequently, 28467 // optimize for the fast case where saveable blocks are non-empty. 28468 return !getBlocksForSerialization(state).length && !getEditedPostAttribute(state, 'content'); 28469 } 28470 /** 28471 * Returns true if the post can be autosaved, or false otherwise. 28472 * 28473 * @param {Object} state Global application state. 28474 * 28475 * @return {boolean} Whether the post can be autosaved. 28476 */ 28477 28478 function isEditedPostAutosaveable(state) { 28479 // A post must contain a title, an excerpt, or non-empty content to be valid for autosaving. 28480 if (!isEditedPostSaveable(state)) { 28481 return false; 28482 } // If we don't already have an autosave, the post is autosaveable. 28483 28484 28485 if (!hasAutosave(state)) { 28486 return true; 28487 } // If the title, excerpt or content has changed, the post is autosaveable. 28488 28489 28490 var autosave = getAutosave(state); 28491 return ['title', 'excerpt', 'content'].some(function (field) { 28492 return autosave[field] !== getEditedPostAttribute(state, field); 28493 }); 28494 } 28495 /** 28496 * Returns the current autosave, or null if one is not set (i.e. if the post 28497 * has yet to be autosaved, or has been saved or published since the last 28498 * autosave). 28499 * 28500 * @param {Object} state Editor state. 28501 * 28502 * @return {?Object} Current autosave, if exists. 28503 */ 28504 28505 function getAutosave(state) { 28506 return state.autosave; 28507 } 28508 /** 28509 * Returns the true if there is an existing autosave, otherwise false. 28510 * 28511 * @param {Object} state Global application state. 28512 * 28513 * @return {boolean} Whether there is an existing autosave. 28514 */ 28515 28516 function hasAutosave(state) { 28517 return !!getAutosave(state); 28518 } 28519 /** 28520 * Return true if the post being edited is being scheduled. Preferring the 28521 * unsaved status values. 28522 * 28523 * @param {Object} state Global application state. 28524 * 28525 * @return {boolean} Whether the post has been published. 28526 */ 28527 28528 function isEditedPostBeingScheduled(state) { 28529 var date = Object(_wordpress_date__WEBPACK_IMPORTED_MODULE_6__["moment"])(getEditedPostAttribute(state, 'date')); // Adding 1 minute as an error threshold between the server and the client dates. 28530 28531 var now = Object(_wordpress_date__WEBPACK_IMPORTED_MODULE_6__["moment"])().add(1, 'minute'); 28532 return date.isAfter(now); 28533 } 28534 /** 28535 * Returns whether the current post should be considered to have a "floating" 28536 * date (i.e. that it would publish "Immediately" rather than at a set time). 28537 * 28538 * Unlike in the PHP backend, the REST API returns a full date string for posts 28539 * where the 0000-00-00T00:00:00 placeholder is present in the database. To 28540 * infer that a post is set to publish "Immediately" we check whether the date 28541 * and modified date are the same. 28542 * 28543 * @param {Object} state Editor state. 28544 * 28545 * @return {boolean} Whether the edited post has a floating date value. 28546 */ 28547 28548 function isEditedPostDateFloating(state) { 28549 var date = getEditedPostAttribute(state, 'date'); 28550 var modified = getEditedPostAttribute(state, 'modified'); 28551 var status = getEditedPostAttribute(state, 'status'); 28552 28553 if (status === 'draft' || status === 'auto-draft') { 28554 return date === modified; 28555 } 28556 28557 return false; 28558 } 28559 /** 28560 * Returns a new reference when the inner blocks of a given block client ID 28561 * change. This is used exclusively as a memoized selector dependant, relying 28562 * on this selector's shared return value and recursively those of its inner 28563 * blocks defined as dependencies. This abuses mechanics of the selector 28564 * memoization to return from the original selector function only when 28565 * dependants change. 28566 * 28567 * @param {Object} state Editor state. 28568 * @param {string} clientId Block client ID. 28569 * 28570 * @return {*} A value whose reference will change only when inner blocks of 28571 * the given block client ID change. 28572 */ 28573 28574 var getBlockDependantsCacheBust = Object(rememo__WEBPACK_IMPORTED_MODULE_4__["default"])(function () { 28575 return []; 28576 }, function (state, clientId) { 28577 return Object(lodash__WEBPACK_IMPORTED_MODULE_3__["map"])(getBlockOrder(state, clientId), function (innerBlockClientId) { 28578 return getBlock(state, innerBlockClientId); 28579 }); 28580 }); 28581 /** 28582 * Returns a block's name given its client ID, or null if no block exists with 28583 * the client ID. 28584 * 28585 * @param {Object} state Editor state. 28586 * @param {string} clientId Block client ID. 28587 * 28588 * @return {string} Block name. 28589 */ 28590 28591 function getBlockName(state, clientId) { 28592 var block = state.editor.present.blocksByClientId[clientId]; 28593 return block ? block.name : null; 28594 } 28595 /** 28596 * Returns a block given its client ID. This is a parsed copy of the block, 28597 * containing its `blockName`, `clientId`, and current `attributes` state. This 28598 * is not the block's registration settings, which must be retrieved from the 28599 * blocks module registration store. 28600 * 28601 * @param {Object} state Editor state. 28602 * @param {string} clientId Block client ID. 28603 * 28604 * @return {Object} Parsed block object. 28605 */ 28606 28607 var getBlock = Object(rememo__WEBPACK_IMPORTED_MODULE_4__["default"])(function (state, clientId) { 28608 var block = state.editor.present.blocksByClientId[clientId]; 28609 28610 if (!block) { 28611 return null; 28612 } 28613 28614 var attributes = block.attributes; // Inject custom source attribute values. 28615 // 28616 // TODO: Create generic external sourcing pattern, not explicitly 28617 // targeting meta attributes. 28618 28619 var type = Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_5__["getBlockType"])(block.name); 28620 28621 if (type) { 28622 attributes = Object(lodash__WEBPACK_IMPORTED_MODULE_3__["reduce"])(type.attributes, function (result, value, key) { 28623 if (value.source === 'meta') { 28624 if (result === attributes) { 28625 result = Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_2__["default"])({}, result); 28626 } 28627 28628 result[key] = getPostMeta(state, value.meta); 28629 } 28630 28631 return result; 28632 }, attributes); 28633 } 28634 28635 return Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_2__["default"])({}, block, { 28636 attributes: attributes, 28637 innerBlocks: getBlocks(state, clientId) 28638 }); 28639 }, function (state, clientId) { 28640 return [state.editor.present.blocksByClientId[clientId], getBlockDependantsCacheBust(state, clientId), state.editor.present.edits.meta, state.currentPost.meta]; 28641 }); 28642 28643 function getPostMeta(state, key) { 28644 return Object(lodash__WEBPACK_IMPORTED_MODULE_3__["has"])(state, ['editor', 'present', 'edits', 'meta', key]) ? Object(lodash__WEBPACK_IMPORTED_MODULE_3__["get"])(state, ['editor', 'present', 'edits', 'meta', key]) : Object(lodash__WEBPACK_IMPORTED_MODULE_3__["get"])(state, ['currentPost', 'meta', key]); 28645 } 28646 /** 28647 * Returns all block objects for the current post being edited as an array in 28648 * the order they appear in the post. 28649 * 28650 * Note: It's important to memoize this selector to avoid return a new instance 28651 * on each call 28652 * 28653 * @param {Object} state Editor state. 28654 * @param {?String} rootClientId Optional root client ID of block list. 28655 * 28656 * @return {Object[]} Post blocks. 28657 */ 28658 28659 28660 var getBlocks = Object(rememo__WEBPACK_IMPORTED_MODULE_4__["default"])(function (state, rootClientId) { 28661 return Object(lodash__WEBPACK_IMPORTED_MODULE_3__["map"])(getBlockOrder(state, rootClientId), function (clientId) { 28662 return getBlock(state, clientId); 28663 }); 28664 }, function (state) { 28665 return [state.editor.present.blockOrder, state.editor.present.blocksByClientId]; 28666 }); 28667 /** 28668 * Returns an array containing the clientIds of all descendants 28669 * of the blocks given. 28670 * 28671 * @param {Object} state Global application state. 28672 * @param {Array} clientIds Array of blocks to inspect. 28673 * 28674 * @return {Array} ids of descendants. 28675 */ 28676 28677 var getClientIdsOfDescendants = function getClientIdsOfDescendants(state, clientIds) { 28678 return Object(lodash__WEBPACK_IMPORTED_MODULE_3__["flatMap"])(clientIds, function (clientId) { 28679 var descendants = getBlockOrder(state, clientId); 28680 return Object(_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_1__["default"])(descendants).concat(Object(_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_1__["default"])(getClientIdsOfDescendants(state, descendants))); 28681 }); 28682 }; 28683 /** 28684 * Returns an array containing the clientIds of the top-level blocks 28685 * and their descendants of any depth (for nested blocks). 28686 * 28687 * @param {Object} state Global application state. 28688 * 28689 * @return {Array} ids of top-level and descendant blocks. 28690 */ 28691 28692 var getClientIdsWithDescendants = Object(rememo__WEBPACK_IMPORTED_MODULE_4__["default"])(function (state) { 28693 var topLevelIds = getBlockOrder(state); 28694 return Object(_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_1__["default"])(topLevelIds).concat(Object(_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_1__["default"])(getClientIdsOfDescendants(state, topLevelIds))); 28695 }, function (state) { 28696 return [state.editor.present.blockOrder]; 28697 }); 28698 /** 28699 * Returns the total number of blocks, or the total number of blocks with a specific name in a post. 28700 * The number returned includes nested blocks. 28701 * 28702 * @param {Object} state Global application state. 28703 * @param {?String} blockName Optional block name, if specified only blocks of that type will be counted. 28704 * 28705 * @return {number} Number of blocks in the post, or number of blocks with name equal to blockName. 28706 */ 28707 28708 var getGlobalBlockCount = Object(rememo__WEBPACK_IMPORTED_MODULE_4__["default"])(function (state, blockName) { 28709 if (!blockName) { 28710 return Object(lodash__WEBPACK_IMPORTED_MODULE_3__["size"])(state.editor.present.blocksByClientId); 28711 } 28712 28713 return Object(lodash__WEBPACK_IMPORTED_MODULE_3__["reduce"])(state.editor.present.blocksByClientId, function (count, block) { 28714 return block.name === blockName ? count + 1 : count; 28715 }, 0); 28716 }, function (state) { 28717 return [state.editor.present.blocksByClientId]; 28718 }); 28719 /** 28720 * Given an array of block client IDs, returns the corresponding array of block 28721 * objects. 28722 * 28723 * @param {Object} state Editor state. 28724 * @param {string[]} clientIds Client IDs for which blocks are to be returned. 28725 * 28726 * @return {WPBlock[]} Block objects. 28727 */ 28728 28729 var getBlocksByClientId = Object(rememo__WEBPACK_IMPORTED_MODULE_4__["default"])(function (state, clientIds) { 28730 return Object(lodash__WEBPACK_IMPORTED_MODULE_3__["map"])(Object(lodash__WEBPACK_IMPORTED_MODULE_3__["castArray"])(clientIds), function (clientId) { 28731 return getBlock(state, clientId); 28732 }); 28733 }, function (state) { 28734 return [state.editor.present.blocksByClientId, state.editor.present.blockOrder, state.editor.present.edits.meta, state.currentPost.meta, state.editor.present.blocksByClientId]; 28735 }); 28736 /** 28737 * Returns the number of blocks currently present in the post. 28738 * 28739 * @param {Object} state Editor state. 28740 * @param {?string} rootClientId Optional root client ID of block list. 28741 * 28742 * @return {number} Number of blocks in the post. 28743 */ 28744 28745 function getBlockCount(state, rootClientId) { 28746 return getBlockOrder(state, rootClientId).length; 28747 } 28748 /** 28749 * Returns the current block selection start. This value may be null, and it 28750 * may represent either a singular block selection or multi-selection start. 28751 * A selection is singular if its start and end match. 28752 * 28753 * @param {Object} state Global application state. 28754 * 28755 * @return {?string} Client ID of block selection start. 28756 */ 28757 28758 function getBlockSelectionStart(state) { 28759 return state.blockSelection.start; 28760 } 28761 /** 28762 * Returns the current block selection end. This value may be null, and it 28763 * may represent either a singular block selection or multi-selection end. 28764 * A selection is singular if its start and end match. 28765 * 28766 * @param {Object} state Global application state. 28767 * 28768 * @return {?string} Client ID of block selection end. 28769 */ 28770 28771 function getBlockSelectionEnd(state) { 28772 return state.blockSelection.end; 28773 } 28774 /** 28775 * Returns the number of blocks currently selected in the post. 28776 * 28777 * @param {Object} state Global application state. 28778 * 28779 * @return {number} Number of blocks selected in the post. 28780 */ 28781 28782 function getSelectedBlockCount(state) { 28783 var multiSelectedBlockCount = getMultiSelectedBlockClientIds(state).length; 28784 28785 if (multiSelectedBlockCount) { 28786 return multiSelectedBlockCount; 28787 } 28788 28789 return state.blockSelection.start ? 1 : 0; 28790 } 28791 /** 28792 * Returns true if there is a single selected block, or false otherwise. 28793 * 28794 * @param {Object} state Editor state. 28795 * 28796 * @return {boolean} Whether a single block is selected. 28797 */ 28798 28799 function hasSelectedBlock(state) { 28800 var _state$blockSelection = state.blockSelection, 28801 start = _state$blockSelection.start, 28802 end = _state$blockSelection.end; 28803 return !!start && start === end; 28804 } 28805 /** 28806 * Returns the currently selected block client ID, or null if there is no 28807 * selected block. 28808 * 28809 * @param {Object} state Editor state. 28810 * 28811 * @return {?string} Selected block client ID. 28812 */ 28813 28814 function getSelectedBlockClientId(state) { 28815 var _state$blockSelection2 = state.blockSelection, 28816 start = _state$blockSelection2.start, 28817 end = _state$blockSelection2.end; 28818 return start === end && start ? start : null; 28819 } 28820 /** 28821 * Returns the currently selected block, or null if there is no selected block. 28822 * 28823 * @param {Object} state Global application state. 28824 * 28825 * @return {?Object} Selected block. 28826 */ 28827 28828 function getSelectedBlock(state) { 28829 var clientId = getSelectedBlockClientId(state); 28830 return clientId ? getBlock(state, clientId) : null; 28831 } 28832 /** 28833 * Given a block client ID, returns the root block from which the block is 28834 * nested, an empty string for top-level blocks, or null if the block does not 28835 * exist. 28836 * 28837 * @param {Object} state Editor state. 28838 * @param {string} clientId Block from which to find root client ID. 28839 * 28840 * @return {?string} Root client ID, if exists 28841 */ 28842 28843 function getBlockRootClientId(state, clientId) { 28844 var blockOrder = state.editor.present.blockOrder; 28845 28846 for (var rootClientId in blockOrder) { 28847 if (Object(lodash__WEBPACK_IMPORTED_MODULE_3__["includes"])(blockOrder[rootClientId], clientId)) { 28848 return rootClientId; 28849 } 28850 } 28851 28852 return null; 28853 } 28854 /** 28855 * Returns the client ID of the block adjacent one at the given reference 28856 * startClientId and modifier directionality. Defaults start startClientId to 28857 * the selected block, and direction as next block. Returns null if there is no 28858 * adjacent block. 28859 * 28860 * @param {Object} state Editor state. 28861 * @param {?string} startClientId Optional client ID of block from which to 28862 * search. 28863 * @param {?number} modifier Directionality multiplier (1 next, -1 28864 * previous). 28865 * 28866 * @return {?string} Return the client ID of the block, or null if none exists. 28867 */ 28868 28869 function getAdjacentBlockClientId(state, startClientId) { 28870 var modifier = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1; 28871 28872 // Default to selected block. 28873 if (startClientId === undefined) { 28874 startClientId = getSelectedBlockClientId(state); 28875 } // Try multi-selection starting at extent based on modifier. 28876 28877 28878 if (startClientId === undefined) { 28879 if (modifier < 0) { 28880 startClientId = getFirstMultiSelectedBlockClientId(state); 28881 } else { 28882 startClientId = getLastMultiSelectedBlockClientId(state); 28883 } 28884 } // Validate working start client ID. 28885 28886 28887 if (!startClientId) { 28888 return null; 28889 } // Retrieve start block root client ID, being careful to allow the falsey 28890 // empty string top-level root by explicitly testing against null. 28891 28892 28893 var rootClientId = getBlockRootClientId(state, startClientId); 28894 28895 if (rootClientId === null) { 28896 return null; 28897 } 28898 28899 var blockOrder = state.editor.present.blockOrder; 28900 var orderSet = blockOrder[rootClientId]; 28901 var index = orderSet.indexOf(startClientId); 28902 var nextIndex = index + 1 * modifier; // Block was first in set and we're attempting to get previous. 28903 28904 if (nextIndex < 0) { 28905 return null; 28906 } // Block was last in set and we're attempting to get next. 28907 28908 28909 if (nextIndex === orderSet.length) { 28910 return null; 28911 } // Assume incremented index is within the set. 28912 28913 28914 return orderSet[nextIndex]; 28915 } 28916 /** 28917 * Returns the previous block's client ID from the given reference start ID. 28918 * Defaults start to the selected block. Returns null if there is no previous 28919 * block. 28920 * 28921 * @param {Object} state Editor state. 28922 * @param {?string} startClientId Optional client ID of block from which to 28923 * search. 28924 * 28925 * @return {?string} Adjacent block's client ID, or null if none exists. 28926 */ 28927 28928 function getPreviousBlockClientId(state, startClientId) { 28929 return getAdjacentBlockClientId(state, startClientId, -1); 28930 } 28931 /** 28932 * Returns the next block's client ID from the given reference start ID. 28933 * Defaults start to the selected block. Returns null if there is no next 28934 * block. 28935 * 28936 * @param {Object} state Editor state. 28937 * @param {?string} startClientId Optional client ID of block from which to 28938 * search. 28939 * 28940 * @return {?string} Adjacent block's client ID, or null if none exists. 28941 */ 28942 28943 function getNextBlockClientId(state, startClientId) { 28944 return getAdjacentBlockClientId(state, startClientId, 1); 28945 } 28946 /** 28947 * Returns the initial caret position for the selected block. 28948 * This position is to used to position the caret properly when the selected block changes. 28949 * 28950 * @param {Object} state Global application state. 28951 * 28952 * @return {?Object} Selected block. 28953 */ 28954 28955 function getSelectedBlocksInitialCaretPosition(state) { 28956 var _state$blockSelection3 = state.blockSelection, 28957 start = _state$blockSelection3.start, 28958 end = _state$blockSelection3.end; 28959 28960 if (start !== end || !start) { 28961 return null; 28962 } 28963 28964 return state.blockSelection.initialPosition; 28965 } 28966 /** 28967 * Returns the current multi-selection set of block client IDs, or an empty 28968 * array if there is no multi-selection. 28969 * 28970 * @param {Object} state Editor state. 28971 * 28972 * @return {Array} Multi-selected block client IDs. 28973 */ 28974 28975 var getMultiSelectedBlockClientIds = Object(rememo__WEBPACK_IMPORTED_MODULE_4__["default"])(function (state) { 28976 var _state$blockSelection4 = state.blockSelection, 28977 start = _state$blockSelection4.start, 28978 end = _state$blockSelection4.end; 28979 28980 if (start === end) { 28981 return []; 28982 } // Retrieve root client ID to aid in retrieving relevant nested block 28983 // order, being careful to allow the falsey empty string top-level root 28984 // by explicitly testing against null. 28985 28986 28987 var rootClientId = getBlockRootClientId(state, start); 28988 28989 if (rootClientId === null) { 28990 return []; 28991 } 28992 28993 var blockOrder = getBlockOrder(state, rootClientId); 28994 var startIndex = blockOrder.indexOf(start); 28995 var endIndex = blockOrder.indexOf(end); 28996 28997 if (startIndex > endIndex) { 28998 return blockOrder.slice(endIndex, startIndex + 1); 28999 } 29000 29001 return blockOrder.slice(startIndex, endIndex + 1); 29002 }, function (state) { 29003 return [state.editor.present.blockOrder, state.blockSelection.start, state.blockSelection.end]; 29004 }); 29005 /** 29006 * Returns the current multi-selection set of blocks, or an empty array if 29007 * there is no multi-selection. 29008 * 29009 * @param {Object} state Editor state. 29010 * 29011 * @return {Array} Multi-selected block objects. 29012 */ 29013 29014 var getMultiSelectedBlocks = Object(rememo__WEBPACK_IMPORTED_MODULE_4__["default"])(function (state) { 29015 var multiSelectedBlockClientIds = getMultiSelectedBlockClientIds(state); 29016 29017 if (!multiSelectedBlockClientIds.length) { 29018 return EMPTY_ARRAY; 29019 } 29020 29021 return multiSelectedBlockClientIds.map(function (clientId) { 29022 return getBlock(state, clientId); 29023 }); 29024 }, function (state) { 29025 return [state.editor.present.blockOrder, state.blockSelection.start, state.blockSelection.end, state.editor.present.blocksByClientId, state.editor.present.edits.meta, state.currentPost.meta]; 29026 }); 29027 /** 29028 * Returns the client ID of the first block in the multi-selection set, or null 29029 * if there is no multi-selection. 29030 * 29031 * @param {Object} state Editor state. 29032 * 29033 * @return {?string} First block client ID in the multi-selection set. 29034 */ 29035 29036 function getFirstMultiSelectedBlockClientId(state) { 29037 return Object(lodash__WEBPACK_IMPORTED_MODULE_3__["first"])(getMultiSelectedBlockClientIds(state)) || null; 29038 } 29039 /** 29040 * Returns the client ID of the last block in the multi-selection set, or null 29041 * if there is no multi-selection. 29042 * 29043 * @param {Object} state Editor state. 29044 * 29045 * @return {?string} Last block client ID in the multi-selection set. 29046 */ 29047 29048 function getLastMultiSelectedBlockClientId(state) { 29049 return Object(lodash__WEBPACK_IMPORTED_MODULE_3__["last"])(getMultiSelectedBlockClientIds(state)) || null; 29050 } 29051 /** 29052 * Returns true if a multi-selection exists, and the block corresponding to the 29053 * specified client ID is the first block of the multi-selection set, or false 29054 * otherwise. 29055 * 29056 * @param {Object} state Editor state. 29057 * @param {string} clientId Block client ID. 29058 * 29059 * @return {boolean} Whether block is first in mult-selection. 29060 */ 29061 29062 function isFirstMultiSelectedBlock(state, clientId) { 29063 return getFirstMultiSelectedBlockClientId(state) === clientId; 29064 } 29065 /** 29066 * Returns true if the client ID occurs within the block multi-selection, or 29067 * false otherwise. 29068 * 29069 * @param {Object} state Editor state. 29070 * @param {string} clientId Block client ID. 29071 * 29072 * @return {boolean} Whether block is in multi-selection set. 29073 */ 29074 29075 function isBlockMultiSelected(state, clientId) { 29076 return getMultiSelectedBlockClientIds(state).indexOf(clientId) !== -1; 29077 } 29078 /** 29079 * Returns true if an ancestor of the block is multi-selected, or false 29080 * otherwise. 29081 * 29082 * @param {Object} state Editor state. 29083 * @param {string} clientId Block client ID. 29084 * 29085 * @return {boolean} Whether an ancestor of the block is in multi-selection 29086 * set. 29087 */ 29088 29089 var isAncestorMultiSelected = Object(rememo__WEBPACK_IMPORTED_MODULE_4__["default"])(function (state, clientId) { 29090 var ancestorClientId = clientId; 29091 var isMultiSelected = false; 29092 29093 while (ancestorClientId && !isMultiSelected) { 29094 ancestorClientId = getBlockRootClientId(state, ancestorClientId); 29095 isMultiSelected = isBlockMultiSelected(state, ancestorClientId); 29096 } 29097 29098 return isMultiSelected; 29099 }, function (state) { 29100 return [state.editor.present.blockOrder, state.blockSelection.start, state.blockSelection.end]; 29101 }); 29102 /** 29103 * Returns the client ID of the block which begins the multi-selection set, or 29104 * null if there is no multi-selection. 29105 * 29106 * This is not necessarily the first client ID in the selection. 29107 * 29108 * @see getFirstMultiSelectedBlockClientId 29109 * 29110 * @param {Object} state Editor state. 29111 * 29112 * @return {?string} Client ID of block beginning multi-selection. 29113 */ 29114 29115 function getMultiSelectedBlocksStartClientId(state) { 29116 var _state$blockSelection5 = state.blockSelection, 29117 start = _state$blockSelection5.start, 29118 end = _state$blockSelection5.end; 29119 29120 if (start === end) { 29121 return null; 29122 } 29123 29124 return start || null; 29125 } 29126 /** 29127 * Returns the client ID of the block which ends the multi-selection set, or 29128 * null if there is no multi-selection. 29129 * 29130 * This is not necessarily the last client ID in the selection. 29131 * 29132 * @see getLastMultiSelectedBlockClientId 29133 * 29134 * @param {Object} state Editor state. 29135 * 29136 * @return {?string} Client ID of block ending multi-selection. 29137 */ 29138 29139 function getMultiSelectedBlocksEndClientId(state) { 29140 var _state$blockSelection6 = state.blockSelection, 29141 start = _state$blockSelection6.start, 29142 end = _state$blockSelection6.end; 29143 29144 if (start === end) { 29145 return null; 29146 } 29147 29148 return end || null; 29149 } 29150 /** 29151 * Returns an array containing all block client IDs in the editor in the order 29152 * they appear. Optionally accepts a root client ID of the block list for which 29153 * the order should be returned, defaulting to the top-level block order. 29154 * 29155 * @param {Object} state Editor state. 29156 * @param {?string} rootClientId Optional root client ID of block list. 29157 * 29158 * @return {Array} Ordered client IDs of editor blocks. 29159 */ 29160 29161 function getBlockOrder(state, rootClientId) { 29162 return state.editor.present.blockOrder[rootClientId || ''] || EMPTY_ARRAY; 29163 } 29164 /** 29165 * Returns the index at which the block corresponding to the specified client 29166 * ID occurs within the block order, or `-1` if the block does not exist. 29167 * 29168 * @param {Object} state Editor state. 29169 * @param {string} clientId Block client ID. 29170 * @param {?string} rootClientId Optional root client ID of block list. 29171 * 29172 * @return {number} Index at which block exists in order. 29173 */ 29174 29175 function getBlockIndex(state, clientId, rootClientId) { 29176 return getBlockOrder(state, rootClientId).indexOf(clientId); 29177 } 29178 /** 29179 * Returns true if the block corresponding to the specified client ID is 29180 * currently selected and no multi-selection exists, or false otherwise. 29181 * 29182 * @param {Object} state Editor state. 29183 * @param {string} clientId Block client ID. 29184 * 29185 * @return {boolean} Whether block is selected and multi-selection exists. 29186 */ 29187 29188 function isBlockSelected(state, clientId) { 29189 var _state$blockSelection7 = state.blockSelection, 29190 start = _state$blockSelection7.start, 29191 end = _state$blockSelection7.end; 29192 29193 if (start !== end) { 29194 return false; 29195 } 29196 29197 return start === clientId; 29198 } 29199 /** 29200 * Returns true if one of the block's inner blocks is selected. 29201 * 29202 * @param {Object} state Editor state. 29203 * @param {string} clientId Block client ID. 29204 * @param {boolean} deep Perform a deep check. 29205 * 29206 * @return {boolean} Whether the block as an inner block selected 29207 */ 29208 29209 function hasSelectedInnerBlock(state, clientId) { 29210 var deep = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; 29211 return Object(lodash__WEBPACK_IMPORTED_MODULE_3__["some"])(getBlockOrder(state, clientId), function (innerClientId) { 29212 return isBlockSelected(state, innerClientId) || isBlockMultiSelected(state, innerClientId) || deep && hasSelectedInnerBlock(state, innerClientId, deep); 29213 }); 29214 } 29215 /** 29216 * Returns true if the block corresponding to the specified client ID is 29217 * currently selected but isn't the last of the selected blocks. Here "last" 29218 * refers to the block sequence in the document, _not_ the sequence of 29219 * multi-selection, which is why `state.blockSelection.end` isn't used. 29220 * 29221 * @param {Object} state Editor state. 29222 * @param {string} clientId Block client ID. 29223 * 29224 * @return {boolean} Whether block is selected and not the last in the 29225 * selection. 29226 */ 29227 29228 function isBlockWithinSelection(state, clientId) { 29229 if (!clientId) { 29230 return false; 29231 } 29232 29233 var clientIds = getMultiSelectedBlockClientIds(state); 29234 var index = clientIds.indexOf(clientId); 29235 return index > -1 && index < clientIds.length - 1; 29236 } 29237 /** 29238 * Returns true if a multi-selection has been made, or false otherwise. 29239 * 29240 * @param {Object} state Editor state. 29241 * 29242 * @return {boolean} Whether multi-selection has been made. 29243 */ 29244 29245 function hasMultiSelection(state) { 29246 var _state$blockSelection8 = state.blockSelection, 29247 start = _state$blockSelection8.start, 29248 end = _state$blockSelection8.end; 29249 return start !== end; 29250 } 29251 /** 29252 * Whether in the process of multi-selecting or not. This flag is only true 29253 * while the multi-selection is being selected (by mouse move), and is false 29254 * once the multi-selection has been settled. 29255 * 29256 * @see hasMultiSelection 29257 * 29258 * @param {Object} state Global application state. 29259 * 29260 * @return {boolean} True if multi-selecting, false if not. 29261 */ 29262 29263 function isMultiSelecting(state) { 29264 return state.blockSelection.isMultiSelecting; 29265 } 29266 /** 29267 * Whether is selection disable or not. 29268 * 29269 * @param {Object} state Global application state. 29270 * 29271 * @return {boolean} True if multi is disable, false if not. 29272 */ 29273 29274 function isSelectionEnabled(state) { 29275 return state.blockSelection.isEnabled; 29276 } 29277 /** 29278 * Returns the block's editing mode, defaulting to "visual" if not explicitly 29279 * assigned. 29280 * 29281 * @param {Object} state Editor state. 29282 * @param {string} clientId Block client ID. 29283 * 29284 * @return {Object} Block editing mode. 29285 */ 29286 29287 function getBlockMode(state, clientId) { 29288 return state.blocksMode[clientId] || 'visual'; 29289 } 29290 /** 29291 * Returns true if the user is typing, or false otherwise. 29292 * 29293 * @param {Object} state Global application state. 29294 * 29295 * @return {boolean} Whether user is typing. 29296 */ 29297 29298 function isTyping(state) { 29299 return state.isTyping; 29300 } 29301 /** 29302 * Returns the insertion point, the index at which the new inserted block would 29303 * be placed. Defaults to the last index. 29304 * 29305 * @param {Object} state Editor state. 29306 * 29307 * @return {Object} Insertion point object with `rootClientId`, `layout`, 29308 * `index`. 29309 */ 29310 29311 function getBlockInsertionPoint(state) { 29312 var rootClientId, layout, index; 29313 var end = state.blockSelection.end; 29314 29315 if (end) { 29316 rootClientId = getBlockRootClientId(state, end) || undefined; 29317 layout = Object(lodash__WEBPACK_IMPORTED_MODULE_3__["get"])(getBlock(state, end), ['attributes', 'layout']); 29318 index = getBlockIndex(state, end, rootClientId) + 1; 29319 } else { 29320 index = getBlockOrder(state).length; 29321 } 29322 29323 return { 29324 rootClientId: rootClientId, 29325 layout: layout, 29326 index: index 29327 }; 29328 } 29329 /** 29330 * Returns true if we should show the block insertion point. 29331 * 29332 * @param {Object} state Global application state. 29333 * 29334 * @return {?boolean} Whether the insertion point is visible or not. 29335 */ 29336 29337 function isBlockInsertionPointVisible(state) { 29338 return state.isInsertionPointVisible; 29339 } 29340 /** 29341 * Returns whether the blocks matches the template or not. 29342 * 29343 * @param {boolean} state 29344 * @return {?boolean} Whether the template is valid or not. 29345 */ 29346 29347 function isValidTemplate(state) { 29348 return state.template.isValid; 29349 } 29350 /** 29351 * Returns the defined block template 29352 * 29353 * @param {boolean} state 29354 * @return {?Array} Block Template 29355 */ 29356 29357 function getTemplate(state) { 29358 return state.settings.template; 29359 } 29360 /** 29361 * Returns the defined block template lock. Optionally accepts a root block 29362 * client ID as context, otherwise defaulting to the global context. 29363 * 29364 * @param {Object} state Editor state. 29365 * @param {?string} rootClientId Optional block root client ID. 29366 * 29367 * @return {?string} Block Template Lock 29368 */ 29369 29370 function getTemplateLock(state, rootClientId) { 29371 if (!rootClientId) { 29372 return state.settings.templateLock; 29373 } 29374 29375 var blockListSettings = getBlockListSettings(state, rootClientId); 29376 29377 if (!blockListSettings) { 29378 return null; 29379 } 29380 29381 return blockListSettings.templateLock; 29382 } 29383 /** 29384 * Returns true if the post is currently being saved, or false otherwise. 29385 * 29386 * @param {Object} state Global application state. 29387 * 29388 * @return {boolean} Whether post is being saved. 29389 */ 29390 29391 function isSavingPost(state) { 29392 return state.saving.requesting; 29393 } 29394 /** 29395 * Returns true if a previous post save was attempted successfully, or false 29396 * otherwise. 29397 * 29398 * @param {Object} state Global application state. 29399 * 29400 * @return {boolean} Whether the post was saved successfully. 29401 */ 29402 29403 function didPostSaveRequestSucceed(state) { 29404 return state.saving.successful; 29405 } 29406 /** 29407 * Returns true if a previous post save was attempted but failed, or false 29408 * otherwise. 29409 * 29410 * @param {Object} state Global application state. 29411 * 29412 * @return {boolean} Whether the post save failed. 29413 */ 29414 29415 function didPostSaveRequestFail(state) { 29416 return !!state.saving.error; 29417 } 29418 /** 29419 * Returns true if the post is autosaving, or false otherwise. 29420 * 29421 * @param {Object} state Global application state. 29422 * 29423 * @return {boolean} Whether the post is autosaving. 29424 */ 29425 29426 function isAutosavingPost(state) { 29427 return isSavingPost(state) && state.saving.isAutosave; 29428 } 29429 /** 29430 * Returns a suggested post format for the current post, inferred only if there 29431 * is a single block within the post and it is of a type known to match a 29432 * default post format. Returns null if the format cannot be determined. 29433 * 29434 * @param {Object} state Global application state. 29435 * 29436 * @return {?string} Suggested post format. 29437 */ 29438 29439 function getSuggestedPostFormat(state) { 29440 var blocks = getBlockOrder(state); 29441 var name; // If there is only one block in the content of the post grab its name 29442 // so we can derive a suitable post format from it. 29443 29444 if (blocks.length === 1) { 29445 name = getBlock(state, blocks[0]).name; 29446 } // If there are two blocks in the content and the last one is a text blocks 29447 // grab the name of the first one to also suggest a post format from it. 29448 29449 29450 if (blocks.length === 2) { 29451 if (getBlock(state, blocks[1]).name === 'core/paragraph') { 29452 name = getBlock(state, blocks[0]).name; 29453 } 29454 } // We only convert to default post formats in core. 29455 29456 29457 switch (name) { 29458 case 'core/image': 29459 return 'image'; 29460 29461 case 'core/quote': 29462 case 'core/pullquote': 29463 return 'quote'; 29464 29465 case 'core/gallery': 29466 return 'gallery'; 29467 29468 case 'core/video': 29469 case 'core-embed/youtube': 29470 case 'core-embed/vimeo': 29471 return 'video'; 29472 29473 case 'core/audio': 29474 case 'core-embed/spotify': 29475 case 'core-embed/soundcloud': 29476 return 'audio'; 29477 } 29478 29479 return null; 29480 } 29481 /** 29482 * Returns a set of blocks which are to be used in consideration of the post's 29483 * generated save content. 29484 * 29485 * @param {Object} state Editor state. 29486 * 29487 * @return {WPBlock[]} Filtered set of blocks for save. 29488 */ 29489 29490 function getBlocksForSerialization(state) { 29491 var blocks = getBlocks(state); // A single unmodified default block is assumed to be equivalent to an 29492 // empty post. 29493 29494 var isSingleUnmodifiedDefaultBlock = blocks.length === 1 && Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_5__["isUnmodifiedDefaultBlock"])(blocks[0]); 29495 29496 if (isSingleUnmodifiedDefaultBlock) { 29497 return []; 29498 } 29499 29500 return blocks; 29501 } 29502 /** 29503 * Returns the content of the post being edited, preferring raw string edit 29504 * before falling back to serialization of block state. 29505 * 29506 * @param {Object} state Global application state. 29507 * 29508 * @return {string} Post content. 29509 */ 29510 29511 var getEditedPostContent = Object(rememo__WEBPACK_IMPORTED_MODULE_4__["default"])(function (state) { 29512 var edits = getPostEdits(state); 29513 29514 if ('content' in edits) { 29515 return edits.content; 29516 } 29517 29518 var blocks = getBlocksForSerialization(state); 29519 var content = Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_5__["serialize"])(blocks); // For compatibility purposes, treat a post consisting of a single 29520 // unknown block as legacy content and downgrade to a pre-block-editor 29521 // removep'd content format. 29522 29523 var isSingleUnknownBlock = blocks.length === 1 && blocks[0].name === Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_5__["getUnknownTypeHandlerName"])(); 29524 29525 if (isSingleUnknownBlock) { 29526 return Object(_wordpress_autop__WEBPACK_IMPORTED_MODULE_7__["removep"])(content); 29527 } 29528 29529 return content; 29530 }, function (state) { 29531 return [state.editor.present.edits.content, state.editor.present.blocksByClientId, state.editor.present.blockOrder]; 29532 }); 29533 /** 29534 * Returns the user notices array. 29535 * 29536 * @param {Object} state Global application state. 29537 * 29538 * @return {Array} List of notices. 29539 */ 29540 29541 function getNotices(state) { 29542 return state.notices; 29543 } 29544 /** 29545 * Determines if the given block type is allowed to be inserted, and, if 29546 * parentClientId is provided, whether it is allowed to be nested within the 29547 * given parent. 29548 * 29549 * @param {Object} state Editor state. 29550 * @param {string} blockName The name of the given block type, e.g. 29551 * 'core/paragraph'. 29552 * @param {?string} parentClientId The parent that the given block is to be 29553 * nested within, or null. 29554 * 29555 * @return {boolean} Whether the given block type is allowed to be inserted. 29556 */ 29557 29558 var canInsertBlockType = Object(rememo__WEBPACK_IMPORTED_MODULE_4__["default"])(function (state, blockName) { 29559 var parentClientId = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null; 29560 29561 var checkAllowList = function checkAllowList(list, item) { 29562 var defaultResult = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null; 29563 29564 if (Object(lodash__WEBPACK_IMPORTED_MODULE_3__["isBoolean"])(list)) { 29565 return list; 29566 } 29567 29568 if (Object(lodash__WEBPACK_IMPORTED_MODULE_3__["isArray"])(list)) { 29569 return Object(lodash__WEBPACK_IMPORTED_MODULE_3__["includes"])(list, item); 29570 } 29571 29572 return defaultResult; 29573 }; 29574 29575 var blockType = Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_5__["getBlockType"])(blockName); 29576 29577 if (!blockType) { 29578 return false; 29579 } 29580 29581 var _getEditorSettings = getEditorSettings(state), 29582 allowedBlockTypes = _getEditorSettings.allowedBlockTypes; 29583 29584 var isBlockAllowedInEditor = checkAllowList(allowedBlockTypes, blockName, true); 29585 29586 if (!isBlockAllowedInEditor) { 29587 return false; 29588 } 29589 29590 var isLocked = !!getTemplateLock(state, parentClientId); 29591 29592 if (isLocked) { 29593 return false; 29594 } 29595 29596 var parentBlockListSettings = getBlockListSettings(state, parentClientId); 29597 var parentAllowedBlocks = Object(lodash__WEBPACK_IMPORTED_MODULE_3__["get"])(parentBlockListSettings, ['allowedBlocks']); 29598 var hasParentAllowedBlock = checkAllowList(parentAllowedBlocks, blockName); 29599 var blockAllowedParentBlocks = blockType.parent; 29600 var parentName = getBlockName(state, parentClientId); 29601 var hasBlockAllowedParent = checkAllowList(blockAllowedParentBlocks, parentName); 29602 29603 if (hasParentAllowedBlock !== null && hasBlockAllowedParent !== null) { 29604 return hasParentAllowedBlock || hasBlockAllowedParent; 29605 } else if (hasParentAllowedBlock !== null) { 29606 return hasParentAllowedBlock; 29607 } else if (hasBlockAllowedParent !== null) { 29608 return hasBlockAllowedParent; 29609 } 29610 29611 return true; 29612 }, function (state, blockName, parentClientId) { 29613 return [state.blockListSettings[parentClientId], state.editor.present.blocksByClientId[parentClientId], state.settings.allowedBlockTypes, state.settings.templateLock]; 29614 }); 29615 /** 29616 * Returns information about how recently and frequently a block has been inserted. 29617 * 29618 * @param {Object} state Global application state. 29619 * @param {string} id A string which identifies the insert, e.g. 'core/block/12' 29620 * 29621 * @return {?{ time: number, count: number }} An object containing `time` which is when the last 29622 * insert occured as a UNIX epoch, and `count` which is 29623 * the number of inserts that have occurred. 29624 */ 29625 29626 function getInsertUsage(state, id) { 29627 return state.preferences.insertUsage[id] || null; 29628 } 29629 /** 29630 * Determines the items that appear in the inserter. Includes both static 29631 * items (e.g. a regular block type) and dynamic items (e.g. a reusable block). 29632 * 29633 * Each item object contains what's necessary to display a button in the 29634 * inserter and handle its selection. 29635 * 29636 * The 'utility' property indicates how useful we think an item will be to the 29637 * user. There are 4 levels of utility: 29638 * 29639 * 1. Blocks that are contextually useful (utility = 3) 29640 * 2. Blocks that have been previously inserted (utility = 2) 29641 * 3. Blocks that are in the common category (utility = 1) 29642 * 4. All other blocks (utility = 0) 29643 * 29644 * The 'frecency' property is a heuristic (https://en.wikipedia.org/wiki/Frecency) 29645 * that combines block usage frequenty and recency. 29646 * 29647 * Items are returned ordered descendingly by their 'utility' and 'frecency'. 29648 * 29649 * @param {Object} state Editor state. 29650 * @param {?string} parentClientId The block we are inserting into, if any. 29651 * 29652 * @return {Editor.InserterItem[]} Items that appear in inserter. 29653 * 29654 * @typedef {Object} Editor.InserterItem 29655 * @property {string} id Unique identifier for the item. 29656 * @property {string} name The type of block to create. 29657 * @property {Object} initialAttributes Attributes to pass to the newly created block. 29658 * @property {string} title Title of the item, as it appears in the inserter. 29659 * @property {string} icon Dashicon for the item, as it appears in the inserter. 29660 * @property {string} category Block category that the item is associated with. 29661 * @property {string[]} keywords Keywords that can be searched to find this item. 29662 * @property {boolean} isDisabled Whether or not the user should be prevented from inserting 29663 * this item. 29664 * @property {number} utility How useful we think this item is, between 0 and 3. 29665 * @property {number} frecency Hueristic that combines frequency and recency. 29666 */ 29667 29668 29669 var getInserterItems = Object(rememo__WEBPACK_IMPORTED_MODULE_4__["default"])(function (state) { 29670 var parentClientId = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; 29671 29672 var calculateUtility = function calculateUtility(category, count, isContextual) { 29673 if (isContextual) { 29674 return INSERTER_UTILITY_HIGH; 29675 } else if (count > 0) { 29676 return INSERTER_UTILITY_MEDIUM; 29677 } else if (category === 'common') { 29678 return INSERTER_UTILITY_LOW; 29679 } 29680 29681 return INSERTER_UTILITY_NONE; 29682 }; 29683 29684 var calculateFrecency = function calculateFrecency(time, count) { 29685 if (!time) { 29686 return count; 29687 } // The selector is cached, which means Date.now() is the last time that the 29688 // relevant state changed. This suits our needs. 29689 29690 29691 var duration = Date.now() - time; 29692 29693 switch (true) { 29694 case duration < MILLISECONDS_PER_HOUR: 29695 return count * 4; 29696 29697 case duration < MILLISECONDS_PER_DAY: 29698 return count * 2; 29699 29700 case duration < MILLISECONDS_PER_WEEK: 29701 return count / 2; 29702 29703 default: 29704 return count / 4; 29705 } 29706 }; 29707 29708 var shouldIncludeBlockType = function shouldIncludeBlockType(blockType) { 29709 if (!Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_5__["hasBlockSupport"])(blockType, 'inserter', true)) { 29710 return false; 29711 } 29712 29713 return canInsertBlockType(state, blockType.name, parentClientId); 29714 }; 29715 29716 var buildBlockTypeInserterItem = function buildBlockTypeInserterItem(blockType) { 29717 var id = blockType.name; 29718 var isDisabled = false; 29719 29720 if (!Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_5__["hasBlockSupport"])(blockType.name, 'multiple', true)) { 29721 isDisabled = Object(lodash__WEBPACK_IMPORTED_MODULE_3__["some"])(getBlocksByClientId(state, getClientIdsWithDescendants(state)), { 29722 name: blockType.name 29723 }); 29724 } 29725 29726 var isContextual = Object(lodash__WEBPACK_IMPORTED_MODULE_3__["isArray"])(blockType.parent); 29727 29728 var _ref = getInsertUsage(state, id) || {}, 29729 time = _ref.time, 29730 _ref$count = _ref.count, 29731 count = _ref$count === void 0 ? 0 : _ref$count; 29732 29733 return { 29734 id: id, 29735 name: blockType.name, 29736 initialAttributes: {}, 29737 title: blockType.title, 29738 icon: blockType.icon, 29739 category: blockType.category, 29740 keywords: blockType.keywords, 29741 isDisabled: isDisabled, 29742 utility: calculateUtility(blockType.category, count, isContextual), 29743 frecency: calculateFrecency(time, count), 29744 hasChildBlocksWithInserterSupport: Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_5__["hasChildBlocksWithInserterSupport"])(blockType.name) 29745 }; 29746 }; 29747 29748 var shouldIncludeReusableBlock = function shouldIncludeReusableBlock(reusableBlock) { 29749 if (!canInsertBlockType(state, 'core/block', parentClientId)) { 29750 return false; 29751 } 29752 29753 var referencedBlock = getBlock(state, reusableBlock.clientId); 29754 29755 if (!referencedBlock) { 29756 return false; 29757 } 29758 29759 var referencedBlockType = Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_5__["getBlockType"])(referencedBlock.name); 29760 29761 if (!referencedBlockType) { 29762 return false; 29763 } 29764 29765 if (!canInsertBlockType(state, referencedBlockType.name, parentClientId)) { 29766 return false; 29767 } 29768 29769 return true; 29770 }; 29771 29772 var buildReusableBlockInserterItem = function buildReusableBlockInserterItem(reusableBlock) { 29773 var id = "core/block/".concat(reusableBlock.id); 29774 var referencedBlock = getBlock(state, reusableBlock.clientId); 29775 var referencedBlockType = Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_5__["getBlockType"])(referencedBlock.name); 29776 29777 var _ref2 = getInsertUsage(state, id) || {}, 29778 time = _ref2.time, 29779 _ref2$count = _ref2.count, 29780 count = _ref2$count === void 0 ? 0 : _ref2$count; 29781 29782 var utility = calculateUtility('reusable', count, false); 29783 var frecency = calculateFrecency(time, count); 29784 return { 29785 id: id, 29786 name: 'core/block', 29787 initialAttributes: { 29788 ref: reusableBlock.id 29789 }, 29790 title: reusableBlock.title, 29791 icon: referencedBlockType.icon, 29792 category: 'reusable', 29793 keywords: [], 29794 isDisabled: false, 29795 utility: utility, 29796 frecency: frecency 29797 }; 29798 }; 29799 29800 var blockTypeInserterItems = Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_5__["getBlockTypes"])().filter(shouldIncludeBlockType).map(buildBlockTypeInserterItem); 29801 var reusableBlockInserterItems = getReusableBlocks(state).filter(shouldIncludeReusableBlock).map(buildReusableBlockInserterItem); 29802 return Object(lodash__WEBPACK_IMPORTED_MODULE_3__["orderBy"])(Object(_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_1__["default"])(blockTypeInserterItems).concat(Object(_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_1__["default"])(reusableBlockInserterItems)), ['utility', 'frecency'], ['desc', 'desc']); 29803 }, function (state, parentClientId) { 29804 return [state.blockListSettings[parentClientId], state.editor.present.blockOrder, state.editor.present.blocksByClientId, state.preferences.insertUsage, state.settings.allowedBlockTypes, state.settings.templateLock, state.reusableBlocks.data, Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_5__["getBlockTypes"])()]; 29805 }); 29806 /** 29807 * Returns the reusable block with the given ID. 29808 * 29809 * @param {Object} state Global application state. 29810 * @param {number|string} ref The reusable block's ID. 29811 * 29812 * @return {Object} The reusable block, or null if none exists. 29813 */ 29814 29815 var getReusableBlock = Object(rememo__WEBPACK_IMPORTED_MODULE_4__["default"])(function (state, ref) { 29816 var block = state.reusableBlocks.data[ref]; 29817 29818 if (!block) { 29819 return null; 29820 } 29821 29822 var isTemporary = isNaN(parseInt(ref)); 29823 return Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_2__["default"])({}, block, { 29824 id: isTemporary ? ref : +ref, 29825 isTemporary: isTemporary 29826 }); 29827 }, function (state, ref) { 29828 return [state.reusableBlocks.data[ref]]; 29829 }); 29830 /** 29831 * Returns whether or not the reusable block with the given ID is being saved. 29832 * 29833 * @param {Object} state Global application state. 29834 * @param {string} ref The reusable block's ID. 29835 * 29836 * @return {boolean} Whether or not the reusable block is being saved. 29837 */ 29838 29839 function isSavingReusableBlock(state, ref) { 29840 return state.reusableBlocks.isSaving[ref] || false; 29841 } 29842 /** 29843 * Returns true if the reusable block with the given ID is being fetched, or 29844 * false otherwise. 29845 * 29846 * @param {Object} state Global application state. 29847 * @param {string} ref The reusable block's ID. 29848 * 29849 * @return {boolean} Whether the reusable block is being fetched. 29850 */ 29851 29852 function isFetchingReusableBlock(state, ref) { 29853 return !!state.reusableBlocks.isFetching[ref]; 29854 } 29855 /** 29856 * Returns an array of all reusable blocks. 29857 * 29858 * @param {Object} state Global application state. 29859 * 29860 * @return {Array} An array of all reusable blocks. 29861 */ 29862 29863 function getReusableBlocks(state) { 29864 return Object(lodash__WEBPACK_IMPORTED_MODULE_3__["map"])(state.reusableBlocks.data, function (value, ref) { 29865 return getReusableBlock(state, ref); 29866 }); 29867 } 29868 /** 29869 * Returns state object prior to a specified optimist transaction ID, or `null` 29870 * if the transaction corresponding to the given ID cannot be found. 29871 * 29872 * @param {Object} state Current global application state. 29873 * @param {Object} transactionId Optimist transaction ID. 29874 * 29875 * @return {Object} Global application state prior to transaction. 29876 */ 29877 29878 function getStateBeforeOptimisticTransaction(state, transactionId) { 29879 var transaction = Object(lodash__WEBPACK_IMPORTED_MODULE_3__["find"])(state.optimist, function (entry) { 29880 return entry.beforeState && Object(lodash__WEBPACK_IMPORTED_MODULE_3__["get"])(entry.action, ['optimist', 'id']) === transactionId; 29881 }); 29882 return transaction ? transaction.beforeState : null; 29883 } 29884 /** 29885 * Returns true if the post is being published, or false otherwise. 29886 * 29887 * @param {Object} state Global application state. 29888 * 29889 * @return {boolean} Whether post is being published. 29890 */ 29891 29892 function isPublishingPost(state) { 29893 if (!isSavingPost(state)) { 29894 return false; 29895 } // Saving is optimistic, so assume that current post would be marked as 29896 // published if publishing 29897 29898 29899 if (!isCurrentPostPublished(state)) { 29900 return false; 29901 } // Use post update transaction ID to retrieve the state prior to the 29902 // optimistic transaction 29903 29904 29905 var stateBeforeRequest = getStateBeforeOptimisticTransaction(state, POST_UPDATE_TRANSACTION_ID); // Consider as publishing when current post prior to request was not 29906 // considered published 29907 29908 return !!stateBeforeRequest && !isCurrentPostPublished(stateBeforeRequest); 29909 } 29910 /** 29911 * Returns whether the permalink is editable or not. 29912 * 29913 * @param {Object} state Editor state. 29914 * 29915 * @return {boolean} Whether or not the permalink is editable. 29916 */ 29917 29918 function isPermalinkEditable(state) { 29919 var permalinkTemplate = getEditedPostAttribute(state, 'permalink_template'); 29920 return PERMALINK_POSTNAME_REGEX.test(permalinkTemplate); 29921 } 29922 /** 29923 * Returns the permalink for the post. 29924 * 29925 * @param {Object} state Editor state. 29926 * 29927 * @return {string} The permalink. 29928 */ 29929 29930 function getPermalink(state) { 29931 var _getPermalinkParts = getPermalinkParts(state), 29932 prefix = _getPermalinkParts.prefix, 29933 postName = _getPermalinkParts.postName, 29934 suffix = _getPermalinkParts.suffix; 29935 29936 if (isPermalinkEditable(state)) { 29937 return prefix + postName + suffix; 29938 } 29939 29940 return prefix; 29941 } 29942 /** 29943 * Returns the permalink for a post, split into it's three parts: the prefix, the postName, and the suffix. 29944 * 29945 * @param {Object} state Editor state. 29946 * 29947 * @return {Object} The prefix, postName, and suffix for the permalink. 29948 */ 29949 29950 function getPermalinkParts(state) { 29951 var permalinkTemplate = getEditedPostAttribute(state, 'permalink_template'); 29952 var postName = getEditedPostAttribute(state, 'slug') || getEditedPostAttribute(state, 'generated_slug'); 29953 29954 var _permalinkTemplate$sp = permalinkTemplate.split(PERMALINK_POSTNAME_REGEX), 29955 _permalinkTemplate$sp2 = Object(_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_0__["default"])(_permalinkTemplate$sp, 2), 29956 prefix = _permalinkTemplate$sp2[0], 29957 suffix = _permalinkTemplate$sp2[1]; 29958 29959 return { 29960 prefix: prefix, 29961 postName: postName, 29962 suffix: suffix 29963 }; 29964 } 29965 /** 29966 * Returns true if an optimistic transaction is pending commit, for which the 29967 * before state satisfies the given predicate function. 29968 * 29969 * @param {Object} state Editor state. 29970 * @param {Function} predicate Function given state, returning true if match. 29971 * 29972 * @return {boolean} Whether predicate matches for some history. 29973 */ 29974 29975 function inSomeHistory(state, predicate) { 29976 var optimist = state.optimist; // In recursion, optimist state won't exist. Assume exhausted options. 29977 29978 if (!optimist) { 29979 return false; 29980 } 29981 29982 return optimist.some(function (_ref3) { 29983 var beforeState = _ref3.beforeState; 29984 return beforeState && predicate(beforeState); 29985 }); 29986 } 29987 /** 29988 * Returns the Block List settings of a block, if any exist. 29989 * 29990 * @param {Object} state Editor state. 29991 * @param {?string} clientId Block client ID. 29992 * 29993 * @return {?Object} Block settings of the block if set. 29994 */ 29995 29996 function getBlockListSettings(state, clientId) { 29997 return state.blockListSettings[clientId]; 29998 } 29999 /* 30000 * Returns the editor settings. 30001 * 30002 * @param {Object} state Editor state. 30003 * 30004 * @return {Object} The editor settings object 30005 */ 30006 30007 function getEditorSettings(state) { 30008 return state.settings; 30009 } 30010 /* 30011 * Returns the editor settings. 30012 * 30013 * @param {Object} state Editor state. 30014 * 30015 * @return {Object} The editor settings object 30016 */ 30017 30018 function getTokenSettings(state, name) { 30019 if (!name) { 30020 return state.tokens; 30021 } 30022 30023 return state.tokens[name]; 30024 } 30025 /** 30026 * Returns whether the post is locked. 30027 * 30028 * @param {Object} state Global application state. 30029 * 30030 * @return {boolean} Is locked. 30031 */ 30032 30033 function isPostLocked(state) { 30034 return state.postLock.isLocked; 30035 } 30036 /** 30037 * Returns whether the edition of the post has been taken over. 30038 * 30039 * @param {Object} state Global application state. 30040 * 30041 * @return {boolean} Is post lock takeover. 30042 */ 30043 30044 function isPostLockTakeover(state) { 30045 return state.postLock.isTakeover; 30046 } 30047 /** 30048 * Returns details about the post lock user. 30049 * 30050 * @param {Object} state Global application state. 30051 * 30052 * @return {Object} A user object. 30053 */ 30054 30055 function getPostLockUser(state) { 30056 return state.postLock.user; 30057 } 30058 /** 30059 * Returns the active post lock. 30060 * 30061 * @param {Object} state Global application state. 30062 * 30063 * @return {Object} The lock object. 30064 */ 30065 30066 function getActivePostLock(state) { 30067 return state.postLock.activePostLock; 30068 } 30069 /** 30070 * Returns whether or not the user has the unfiltered_html capability. 30071 * 30072 * @param {Object} state Editor state. 30073 * 30074 * @return {boolean} Whether the user can or can't post unfiltered HTML. 30075 */ 30076 30077 function canUserUseUnfilteredHTML(state) { 30078 return Object(lodash__WEBPACK_IMPORTED_MODULE_3__["has"])(getCurrentPost(state), ['_links', 'wp:action-unfiltered-html']); 30079 } 30080 /** 30081 * Returns whether the pre-publish panel should be shown 30082 * or skipped when the user clicks the "publish" button. 30083 * 30084 * @param {Object} state Global application state. 30085 * 30086 * @return {boolean} Whether the pre-publish panel should be shown or not. 30087 */ 30088 30089 function isPublishSidebarEnabled(state) { 30090 if (state.preferences.hasOwnProperty('isPublishSidebarEnabled')) { 30091 return state.preferences.isPublishSidebarEnabled; 30092 } 30093 30094 return _defaults__WEBPACK_IMPORTED_MODULE_8__["PREFERENCES_DEFAULTS"].isPublishSidebarEnabled; 30095 } 30096 30097 30098 /***/ }), 30099 30100 /***/ "./node_modules/@wordpress/editor/build-module/utils/dom.js": 30101 /*!******************************************************************!*\ 30102 !*** ./node_modules/@wordpress/editor/build-module/utils/dom.js ***! 30103 \******************************************************************/ 30104 /*! exports provided: getBlockDOMNode, getBlockFocusableWrapper, isBlockFocusStop, isInSameBlock, hasInnerBlocksContext */ 30105 /***/ (function(module, __webpack_exports__, __webpack_require__) { 30106 30107 "use strict"; 30108 __webpack_require__.r(__webpack_exports__); 30109 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getBlockDOMNode", function() { return getBlockDOMNode; }); 30110 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getBlockFocusableWrapper", function() { return getBlockFocusableWrapper; }); 30111 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isBlockFocusStop", function() { return isBlockFocusStop; }); 30112 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isInSameBlock", function() { return isInSameBlock; }); 30113 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "hasInnerBlocksContext", function() { return hasInnerBlocksContext; }); 30114 /** 30115 * Given a block client ID, returns the corresponding DOM node for the block, 30116 * if exists. As much as possible, this helper should be avoided, and used only 30117 * in cases where isolated behaviors need remote access to a block node. 30118 * 30119 * @param {string} clientId Block client ID. 30120 * 30121 * @return {Element} Block DOM node. 30122 */ 30123 function getBlockDOMNode(clientId) { 30124 return document.querySelector('[data-block="' + clientId + '"]'); 30125 } 30126 /** 30127 * Given a block client ID, returns the corresponding DOM node for the block 30128 * focusable wrapper, if exists. As much as possible, this helper should be 30129 * avoided, and used only in cases where isolated behaviors need remote access 30130 * to a block node. 30131 * 30132 * @param {string} clientId Block client ID. 30133 * 30134 * @return {Element} Block DOM node. 30135 */ 30136 30137 function getBlockFocusableWrapper(clientId) { 30138 return getBlockDOMNode(clientId).closest('.editor-block-list__block'); 30139 } 30140 /** 30141 * Returns true if the given HTMLElement is a block focus stop. Blocks without 30142 * their own text fields rely on the focus stop to be keyboard navigable. 30143 * 30144 * @param {HTMLElement} element Element to test. 30145 * 30146 * @return {boolean} Whether element is a block focus stop. 30147 */ 30148 30149 function isBlockFocusStop(element) { 30150 return element.classList.contains('editor-block-list__block'); 30151 } 30152 /** 30153 * Returns true if two elements are contained within the same block. 30154 * 30155 * @param {HTMLElement} a First element. 30156 * @param {HTMLElement} b Second element. 30157 * 30158 * @return {boolean} Whether elements are in the same block. 30159 */ 30160 30161 function isInSameBlock(a, b) { 30162 return a.closest('[data-block]') === b.closest('[data-block]'); 30163 } 30164 /** 30165 * Returns true if the given HTMLElement contains inner blocks (an InnerBlocks 30166 * element). 30167 * 30168 * @param {HTMLElement} element Element to test. 30169 * 30170 * @return {boolean} Whether element contains inner blocks. 30171 */ 30172 30173 function hasInnerBlocksContext(element) { 30174 return !!element.querySelector('.editor-block-list__layout'); 30175 } 30176 30177 30178 /***/ }), 30179 30180 /***/ "./node_modules/@wordpress/editor/build-module/utils/index.js": 30181 /*!********************************************************************!*\ 30182 !*** ./node_modules/@wordpress/editor/build-module/utils/index.js ***! 30183 \********************************************************************/ 30184 /*! exports provided: mediaUpload */ 30185 /***/ (function(module, __webpack_exports__, __webpack_require__) { 30186 30187 "use strict"; 30188 __webpack_require__.r(__webpack_exports__); 30189 /* harmony import */ var _media_upload__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./media-upload */ "./node_modules/@wordpress/editor/build-module/utils/media-upload/index.js"); 30190 /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "mediaUpload", function() { return _media_upload__WEBPACK_IMPORTED_MODULE_0__["default"]; }); 30191 30192 /** 30193 * Internal dependencies 30194 */ 30195 30196 30197 30198 30199 /***/ }), 30200 30201 /***/ "./node_modules/@wordpress/editor/build-module/utils/media-upload/index.js": 30202 /*!*********************************************************************************!*\ 30203 !*** ./node_modules/@wordpress/editor/build-module/utils/media-upload/index.js ***! 30204 \*********************************************************************************/ 30205 /*! exports provided: default */ 30206 /***/ (function(module, __webpack_exports__, __webpack_require__) { 30207 30208 "use strict"; 30209 __webpack_require__.r(__webpack_exports__); 30210 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash */ "lodash"); 30211 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_0__); 30212 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); 30213 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_1__); 30214 /* harmony import */ var _wordpress_deprecated__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/deprecated */ "@wordpress/deprecated"); 30215 /* harmony import */ var _wordpress_deprecated__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_deprecated__WEBPACK_IMPORTED_MODULE_2__); 30216 /* harmony import */ var _media_upload__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./media-upload */ "./node_modules/@wordpress/editor/build-module/utils/media-upload/media-upload.js"); 30217 /** 30218 * External dependencies 30219 */ 30220 30221 /** 30222 * WordPress dependencies 30223 */ 30224 30225 30226 30227 /** 30228 * Internal dependencies 30229 */ 30230 30231 30232 /** 30233 * Upload a media file when the file upload button is activated. 30234 * Wrapper around mediaUpload() that injects the current post ID. 30235 * 30236 * @param {Object} $0 Parameters object passed to the function. 30237 * @param {string} $0.allowedTypes Array with the types of media that can be uploaded, if unset all types are allowed. 30238 * @param {Array} $0.filesList List of files. 30239 * @param {?number} $0.maxUploadFileSize Maximum upload size in bytes allowed for the site. 30240 * @param {Function} $0.onError Function called when an error happens. 30241 * @param {Function} $0.onFileChange Function called each time a file or a temporary representation of the file is available. 30242 */ 30243 30244 /* harmony default export */ __webpack_exports__["default"] = (function (_ref) { 30245 var allowedTypes = _ref.allowedTypes, 30246 filesList = _ref.filesList, 30247 maxUploadFileSize = _ref.maxUploadFileSize, 30248 _ref$onError = _ref.onError, 30249 _onError = _ref$onError === void 0 ? lodash__WEBPACK_IMPORTED_MODULE_0__["noop"] : _ref$onError, 30250 onFileChange = _ref.onFileChange, 30251 allowedType = _ref.allowedType; 30252 30253 _wordpress_deprecated__WEBPACK_IMPORTED_MODULE_2___default()('mediaDetails in object passed to onFileChange callback of wp.editor.mediaUpload', { 30254 version: '4.2', 30255 alternative: 'media_details property containing exactly the property as returned by the rest api' 30256 }); 30257 30258 var _select = Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_1__["select"])('core/editor'), 30259 getCurrentPostId = _select.getCurrentPostId, 30260 getEditorSettings = _select.getEditorSettings; 30261 30262 var wpAllowedMimeTypes = getEditorSettings().allowedMimeTypes; 30263 maxUploadFileSize = maxUploadFileSize || getEditorSettings().maxUploadFileSize; 30264 var allowedTypesToUse = allowedTypes; 30265 30266 if (!allowedTypes && allowedType) { 30267 _wordpress_deprecated__WEBPACK_IMPORTED_MODULE_2___default()('allowedType parameter property of wp.editor.mediaUpload', { 30268 version: '4.2', 30269 alternative: 'allowedTypes property containing an array with the allowedTypes or do not pass any property if all types are allowed' 30270 }); 30271 30272 if (allowedType === '*') { 30273 allowedTypesToUse = undefined; 30274 } else { 30275 allowedTypesToUse = [allowedType]; 30276 } 30277 } 30278 30279 Object(_media_upload__WEBPACK_IMPORTED_MODULE_3__["mediaUpload"])({ 30280 allowedTypes: allowedTypesToUse, 30281 filesList: filesList, 30282 onFileChange: onFileChange, 30283 additionalData: { 30284 post: getCurrentPostId() 30285 }, 30286 maxUploadFileSize: maxUploadFileSize, 30287 onError: function onError(_ref2) { 30288 var message = _ref2.message; 30289 return _onError(message); 30290 }, 30291 wpAllowedMimeTypes: wpAllowedMimeTypes 30292 }); 30293 }); 30294 30295 30296 /***/ }), 30297 30298 /***/ "./node_modules/@wordpress/editor/build-module/utils/media-upload/media-upload.js": 30299 /*!****************************************************************************************!*\ 30300 !*** ./node_modules/@wordpress/editor/build-module/utils/media-upload/media-upload.js ***! 30301 \****************************************************************************************/ 30302 /*! exports provided: getMimeTypesArray, mediaUpload */ 30303 /***/ (function(module, __webpack_exports__, __webpack_require__) { 30304 30305 "use strict"; 30306 __webpack_require__.r(__webpack_exports__); 30307 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getMimeTypesArray", function() { return getMimeTypesArray; }); 30308 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "mediaUpload", function() { return mediaUpload; }); 30309 /* harmony import */ var _babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectSpread */ "./node_modules/@babel/runtime/helpers/esm/objectSpread.js"); 30310 /* harmony import */ var _babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/toConsumableArray */ "./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js"); 30311 /* harmony import */ var _babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/slicedToArray */ "./node_modules/@babel/runtime/helpers/esm/slicedToArray.js"); 30312 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); 30313 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__); 30314 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! lodash */ "lodash"); 30315 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_4__); 30316 /* harmony import */ var _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/api-fetch */ "@wordpress/api-fetch"); 30317 /* harmony import */ var _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_5__); 30318 /* harmony import */ var _wordpress_blob__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @wordpress/blob */ "@wordpress/blob"); 30319 /* harmony import */ var _wordpress_blob__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blob__WEBPACK_IMPORTED_MODULE_6__); 30320 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); 30321 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_7__); 30322 30323 30324 30325 30326 30327 /** 30328 * External Dependencies 30329 */ 30330 30331 /** 30332 * WordPress dependencies 30333 */ 30334 30335 30336 30337 30338 /** 30339 * Browsers may use unexpected mime types, and they differ from browser to browser. 30340 * This function computes a flexible array of mime types from the mime type structured provided by the server. 30341 * Converts { jpg|jpeg|jpe: "image/jpeg" } into [ "image/jpeg", "image/jpg", "image/jpeg", "image/jpe" ] 30342 * The computation of this array instead of directly using the object, 30343 * solves the problem in chrome where mp3 files have audio/mp3 as mime type instead of audio/mpeg. 30344 * https://bugs.chromium.org/p/chromium/issues/detail?id=227004 30345 * 30346 * @param {?Object} wpMimeTypesObject Mime type object received from the server. 30347 * Extensions are keys separated by '|' and values are mime types associated with an extension. 30348 * 30349 * @return {?Array} An array of mime types or the parameter passed if it was "falsy". 30350 */ 30351 30352 function getMimeTypesArray(wpMimeTypesObject) { 30353 if (!wpMimeTypesObject) { 30354 return wpMimeTypesObject; 30355 } 30356 30357 return Object(lodash__WEBPACK_IMPORTED_MODULE_4__["flatMap"])(wpMimeTypesObject, function (mime, extensionsString) { 30358 var _mime$split = mime.split('/'), 30359 _mime$split2 = Object(_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_2__["default"])(_mime$split, 1), 30360 type = _mime$split2[0]; 30361 30362 var extensions = extensionsString.split('|'); 30363 return [mime].concat(Object(_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_1__["default"])(Object(lodash__WEBPACK_IMPORTED_MODULE_4__["map"])(extensions, function (extension) { 30364 return "".concat(type, "/").concat(extension); 30365 }))); 30366 }); 30367 } 30368 /** 30369 * Media Upload is used by audio, image, gallery, video, and file blocks to 30370 * handle uploading a media file when a file upload button is activated. 30371 * 30372 * TODO: future enhancement to add an upload indicator. 30373 * 30374 * @param {Object} $0 Parameters object passed to the function. 30375 * @param {?Array} $0.allowedTypes Array with the types of media that can be uploaded, if unset all types are allowed. 30376 * @param {?Object} $0.additionalData Additional data to include in the request. 30377 * @param {Array} $0.filesList List of files. 30378 * @param {?number} $0.maxUploadFileSize Maximum upload size in bytes allowed for the site. 30379 * @param {Function} $0.onError Function called when an error happens. 30380 * @param {Function} $0.onFileChange Function called each time a file or a temporary representation of the file is available. 30381 * @param {?Object} $0.wpAllowedMimeTypes List of allowed mime types and file extensions. 30382 */ 30383 30384 function mediaUpload(_ref) { 30385 var allowedTypes = _ref.allowedTypes, 30386 _ref$additionalData = _ref.additionalData, 30387 additionalData = _ref$additionalData === void 0 ? {} : _ref$additionalData, 30388 filesList = _ref.filesList, 30389 maxUploadFileSize = _ref.maxUploadFileSize, 30390 _ref$onError = _ref.onError, 30391 onError = _ref$onError === void 0 ? lodash__WEBPACK_IMPORTED_MODULE_4__["noop"] : _ref$onError, 30392 onFileChange = _ref.onFileChange, 30393 _ref$wpAllowedMimeTyp = _ref.wpAllowedMimeTypes, 30394 wpAllowedMimeTypes = _ref$wpAllowedMimeTyp === void 0 ? null : _ref$wpAllowedMimeTyp; 30395 30396 // Cast filesList to array 30397 var files = Object(_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_1__["default"])(filesList); 30398 30399 var filesSet = []; 30400 30401 var setAndUpdateFiles = function setAndUpdateFiles(idx, value) { 30402 Object(_wordpress_blob__WEBPACK_IMPORTED_MODULE_6__["revokeBlobURL"])(Object(lodash__WEBPACK_IMPORTED_MODULE_4__["get"])(filesSet, [idx, 'url'])); 30403 filesSet[idx] = value; 30404 onFileChange(Object(lodash__WEBPACK_IMPORTED_MODULE_4__["compact"])(filesSet)); 30405 }; // Allowed type specified by consumer 30406 30407 30408 var isAllowedType = function isAllowedType(fileType) { 30409 if (!allowedTypes) { 30410 return true; 30411 } 30412 30413 return Object(lodash__WEBPACK_IMPORTED_MODULE_4__["some"])(allowedTypes, function (allowedType) { 30414 // If a complete mimetype is specified verify if it matches exactly the mime type of the file. 30415 if (Object(lodash__WEBPACK_IMPORTED_MODULE_4__["includes"])(allowedType, '/')) { 30416 return allowedType === fileType; 30417 } // Otherwise a general mime type is used and we should verify if the file mimetype starts with it. 30418 30419 30420 return Object(lodash__WEBPACK_IMPORTED_MODULE_4__["startsWith"])(fileType, "".concat(allowedType, "/")); 30421 }); 30422 }; // Allowed types for the current WP_User 30423 30424 30425 var allowedMimeTypesForUser = getMimeTypesArray(wpAllowedMimeTypes); 30426 30427 var isAllowedMimeTypeForUser = function isAllowedMimeTypeForUser(fileType) { 30428 return Object(lodash__WEBPACK_IMPORTED_MODULE_4__["includes"])(allowedMimeTypesForUser, fileType); 30429 }; // Build the error message including the filename 30430 30431 30432 var triggerError = function triggerError(error) { 30433 error.message = [Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__["createElement"])("strong", { 30434 key: "filename" 30435 }, error.file.name), ': ', error.message]; 30436 onError(error); 30437 }; 30438 30439 files.forEach(function (mediaFile, idx) { 30440 // verify if user is allowed to upload this mime type 30441 if (allowedMimeTypesForUser && !isAllowedMimeTypeForUser(mediaFile.type)) { 30442 triggerError({ 30443 code: 'MIME_TYPE_NOT_ALLOWED_FOR_USER', 30444 message: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_7__["__"])('Sorry, this file type is not permitted for security reasons.'), 30445 file: mediaFile 30446 }); 30447 return; 30448 } // Check if the block supports this mime type 30449 30450 30451 if (!isAllowedType(mediaFile.type)) { 30452 triggerError({ 30453 code: 'MIME_TYPE_NOT_SUPPORTED', 30454 message: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_7__["__"])('Sorry, this file type is not supported here.'), 30455 file: mediaFile 30456 }); 30457 return; 30458 } // verify if file is greater than the maximum file upload size allowed for the site. 30459 30460 30461 if (maxUploadFileSize && mediaFile.size > maxUploadFileSize) { 30462 triggerError({ 30463 code: 'SIZE_ABOVE_LIMIT', 30464 message: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_7__["__"])('This file exceeds the maximum upload size for this site.'), 30465 file: mediaFile 30466 }); 30467 return; 30468 } // Don't allow empty files to be uploaded. 30469 30470 30471 if (mediaFile.size <= 0) { 30472 triggerError({ 30473 code: 'EMPTY_FILE', 30474 message: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_7__["__"])('This file is empty.'), 30475 file: mediaFile 30476 }); 30477 return; 30478 } // Set temporary URL to create placeholder media file, this is replaced 30479 // with final file from media gallery when upload is `done` below 30480 30481 30482 filesSet.push({ 30483 url: Object(_wordpress_blob__WEBPACK_IMPORTED_MODULE_6__["createBlobURL"])(mediaFile) 30484 }); 30485 onFileChange(filesSet); 30486 return createMediaFromFile(mediaFile, additionalData).then(function (savedMedia) { 30487 var mediaObject = Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_0__["default"])({}, Object(lodash__WEBPACK_IMPORTED_MODULE_4__["omit"])(savedMedia, ['alt_text', 'source_url']), { 30488 alt: savedMedia.alt_text, 30489 caption: Object(lodash__WEBPACK_IMPORTED_MODULE_4__["get"])(savedMedia, ['caption', 'raw'], ''), 30490 title: savedMedia.title.raw, 30491 url: savedMedia.source_url, 30492 mediaDetails: {} 30493 }); 30494 30495 if (Object(lodash__WEBPACK_IMPORTED_MODULE_4__["has"])(savedMedia, ['media_details', 'sizes'])) { 30496 mediaObject.mediaDetails.sizes = Object(lodash__WEBPACK_IMPORTED_MODULE_4__["get"])(savedMedia, ['media_details', 'sizes'], {}); 30497 } 30498 30499 setAndUpdateFiles(idx, mediaObject); 30500 }).catch(function (error) { 30501 // Reset to empty on failure. 30502 setAndUpdateFiles(idx, null); 30503 var message; 30504 30505 if (Object(lodash__WEBPACK_IMPORTED_MODULE_4__["has"])(error, ['message'])) { 30506 message = Object(lodash__WEBPACK_IMPORTED_MODULE_4__["get"])(error, ['message']); 30507 } else { 30508 message = Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_7__["sprintf"])( // translators: %s: file name 30509 Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_7__["__"])('Error while uploading file %s to the media library.'), mediaFile.name); 30510 } 30511 30512 onError({ 30513 code: 'GENERAL', 30514 message: message, 30515 file: mediaFile 30516 }); 30517 }); 30518 }); 30519 } 30520 /** 30521 * @param {File} file Media File to Save. 30522 * @param {?Object} additionalData Additional data to include in the request. 30523 * 30524 * @return {Promise} Media Object Promise. 30525 */ 30526 30527 function createMediaFromFile(file, additionalData) { 30528 // Create upload payload 30529 var data = new window.FormData(); 30530 data.append('file', file, file.name || file.type.replace('/', '.')); 30531 data.append('title', file.name ? file.name.replace(/\.[^.]+$/, '') : file.type.replace('/', '.')); 30532 Object(lodash__WEBPACK_IMPORTED_MODULE_4__["forEach"])(additionalData, function (value, key) { 30533 return data.append(key, value); 30534 }); 30535 return _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_5___default()({ 30536 path: '/wp/v2/media', 30537 body: data, 30538 method: 'POST' 30539 }); 30540 } 30541 30542 30543 /***/ }), 30544 30545 /***/ "./node_modules/@wordpress/editor/build-module/utils/terms.js": 30546 /*!********************************************************************!*\ 30547 !*** ./node_modules/@wordpress/editor/build-module/utils/terms.js ***! 30548 \********************************************************************/ 30549 /*! exports provided: buildTermsTree */ 30550 /***/ (function(module, __webpack_exports__, __webpack_require__) { 30551 30552 "use strict"; 30553 __webpack_require__.r(__webpack_exports__); 30554 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "buildTermsTree", function() { return buildTermsTree; }); 30555 /* harmony import */ var _babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectSpread */ "./node_modules/@babel/runtime/helpers/esm/objectSpread.js"); 30556 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lodash */ "lodash"); 30557 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_1__); 30558 30559 30560 /** 30561 * External dependencies 30562 */ 30563 30564 /** 30565 * Returns terms in a tree form. 30566 * 30567 * @param {Array} flatTerms Array of terms in flat format. 30568 * 30569 * @return {Array} Array of terms in tree format. 30570 */ 30571 30572 function buildTermsTree(flatTerms) { 30573 var termsByParent = Object(lodash__WEBPACK_IMPORTED_MODULE_1__["groupBy"])(flatTerms, 'parent'); 30574 30575 var fillWithChildren = function fillWithChildren(terms) { 30576 return terms.map(function (term) { 30577 var children = termsByParent[term.id]; 30578 return Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_0__["default"])({}, term, { 30579 children: children && children.length ? fillWithChildren(children) : [] 30580 }); 30581 }); 30582 }; 30583 30584 return fillWithChildren(termsByParent['0'] || []); 30585 } 30586 30587 30588 /***/ }), 30589 30590 /***/ "./node_modules/@wordpress/editor/build-module/utils/url.js": 30591 /*!******************************************************************!*\ 30592 !*** ./node_modules/@wordpress/editor/build-module/utils/url.js ***! 30593 \******************************************************************/ 30594 /*! exports provided: getWPAdminURL, filterURLForDisplay */ 30595 /***/ (function(module, __webpack_exports__, __webpack_require__) { 30596 30597 "use strict"; 30598 __webpack_require__.r(__webpack_exports__); 30599 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getWPAdminURL", function() { return getWPAdminURL; }); 30600 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "filterURLForDisplay", function() { return filterURLForDisplay; }); 30601 /* harmony import */ var _wordpress_url__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/url */ "@wordpress/url"); 30602 /* harmony import */ var _wordpress_url__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_url__WEBPACK_IMPORTED_MODULE_0__); 30603 /** 30604 * WordPress dependencies 30605 */ 30606 30607 /** 30608 * Returns the URL of a WPAdmin Page. 30609 * 30610 * TODO: This should be moved to a module less specific to the editor. 30611 * 30612 * @param {string} page Page to navigate to. 30613 * @param {Object} query Query Args. 30614 * 30615 * @return {string} WPAdmin URL. 30616 */ 30617 30618 function getWPAdminURL(page, query) { 30619 return Object(_wordpress_url__WEBPACK_IMPORTED_MODULE_0__["addQueryArgs"])(page, query); 30620 } 30621 /** 30622 * Returns a URL for display. 30623 * 30624 * @param {string} url Original URL. 30625 * 30626 * @return {string} Displayed URL. 30627 */ 30628 30629 function filterURLForDisplay(url) { 30630 // remove protocol and www prefixes 30631 var filteredURL = url.replace(new RegExp('^https?://(www\.)?'), ''); // ends with / and only has that single slash, strip it 30632 30633 if (filteredURL.match('^[^/]+/$')) { 30634 return filteredURL.replace('/', ''); 30635 } 30636 30637 return filteredURL; 30638 } 30639 30640 30641 /***/ }), 30642 30643 /***/ "./node_modules/@wordpress/editor/build-module/utils/with-change-detection/index.js": 30644 /*!******************************************************************************************!*\ 30645 !*** ./node_modules/@wordpress/editor/build-module/utils/with-change-detection/index.js ***! 30646 \******************************************************************************************/ 30647 /*! exports provided: default */ 30648 /***/ (function(module, __webpack_exports__, __webpack_require__) { 30649 30650 "use strict"; 30651 __webpack_require__.r(__webpack_exports__); 30652 /* harmony import */ var _babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectSpread */ "./node_modules/@babel/runtime/helpers/esm/objectSpread.js"); 30653 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lodash */ "lodash"); 30654 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_1__); 30655 30656 30657 /** 30658 * External dependencies 30659 */ 30660 30661 /** 30662 * Higher-order reducer creator for tracking changes to state over time. The 30663 * returned reducer will include a `isDirty` property on the object reflecting 30664 * whether the original reference of the reducer has changed. 30665 * 30666 * @param {?Object} options Optional options. 30667 * @param {?Array} options.ignoreTypes Action types upon which to skip check. 30668 * @param {?Array} options.resetTypes Action types upon which to reset dirty. 30669 * 30670 * @return {Function} Higher-order reducer. 30671 */ 30672 30673 var withChangeDetection = function withChangeDetection() { 30674 var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; 30675 return function (reducer) { 30676 return function (state, action) { 30677 var nextState = reducer(state, action); // Reset at: 30678 // - Initial state 30679 // - Reset types 30680 30681 var isReset = state === undefined || Object(lodash__WEBPACK_IMPORTED_MODULE_1__["includes"])(options.resetTypes, action.type); 30682 var isChanging = state !== nextState; // If not intending to update dirty flag, return early and avoid clone. 30683 30684 if (!isChanging && !isReset) { 30685 return state; 30686 } // Avoid mutating state, unless it's already changing by original 30687 // reducer and not initial. 30688 30689 30690 if (!isChanging || state === undefined) { 30691 nextState = Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_0__["default"])({}, nextState); 30692 } 30693 30694 var isIgnored = Object(lodash__WEBPACK_IMPORTED_MODULE_1__["includes"])(options.ignoreTypes, action.type); 30695 30696 if (isIgnored) { 30697 // Preserve the original value if ignored. 30698 nextState.isDirty = state.isDirty; 30699 } else { 30700 nextState.isDirty = !isReset && isChanging; 30701 } 30702 30703 return nextState; 30704 }; 30705 }; 30706 }; 30707 30708 /* harmony default export */ __webpack_exports__["default"] = (withChangeDetection); 30709 30710 30711 /***/ }), 30712 30713 /***/ "./node_modules/@wordpress/editor/build-module/utils/with-history/index.js": 30714 /*!*********************************************************************************!*\ 30715 !*** ./node_modules/@wordpress/editor/build-module/utils/with-history/index.js ***! 30716 \*********************************************************************************/ 30717 /*! exports provided: default */ 30718 /***/ (function(module, __webpack_exports__, __webpack_require__) { 30719 30720 "use strict"; 30721 __webpack_require__.r(__webpack_exports__); 30722 /* harmony import */ var _babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/toConsumableArray */ "./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js"); 30723 /* harmony import */ var _babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectSpread */ "./node_modules/@babel/runtime/helpers/esm/objectSpread.js"); 30724 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! lodash */ "lodash"); 30725 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_2__); 30726 30727 30728 30729 /** 30730 * External dependencies 30731 */ 30732 30733 /** 30734 * Default options for withHistory reducer enhancer. Refer to withHistory 30735 * documentation for options explanation. 30736 * 30737 * @see withHistory 30738 * 30739 * @type {Object} 30740 */ 30741 30742 var DEFAULT_OPTIONS = { 30743 resetTypes: [], 30744 ignoreTypes: [], 30745 shouldOverwriteState: function shouldOverwriteState() { 30746 return false; 30747 } 30748 }; 30749 /** 30750 * Higher-order reducer creator which transforms the result of the original 30751 * reducer into an object tracking its own history (past, present, future). 30752 * 30753 * @param {?Object} options Optional options. 30754 * @param {?Array} options.resetTypes Action types upon which to 30755 * clear past. 30756 * @param {?Array} options.ignoreTypes Action types upon which to 30757 * avoid history tracking. 30758 * @param {?Function} options.shouldOverwriteState Function receiving last and 30759 * current actions, returning 30760 * boolean indicating whether 30761 * present should be merged, 30762 * rather than add undo level. 30763 * 30764 * @return {Function} Higher-order reducer. 30765 */ 30766 30767 var withHistory = function withHistory() { 30768 var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; 30769 return function (reducer) { 30770 options = Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_1__["default"])({}, DEFAULT_OPTIONS, options); // `ignoreTypes` is simply a convenience for `shouldOverwriteState` 30771 30772 options.shouldOverwriteState = Object(lodash__WEBPACK_IMPORTED_MODULE_2__["overSome"])([options.shouldOverwriteState, function (action) { 30773 return Object(lodash__WEBPACK_IMPORTED_MODULE_2__["includes"])(options.ignoreTypes, action.type); 30774 }]); 30775 var initialState = { 30776 past: [], 30777 present: reducer(undefined, {}), 30778 future: [], 30779 lastAction: null, 30780 shouldCreateUndoLevel: false 30781 }; 30782 var _options = options, 30783 _options$resetTypes = _options.resetTypes, 30784 resetTypes = _options$resetTypes === void 0 ? [] : _options$resetTypes, 30785 _options$shouldOverwr = _options.shouldOverwriteState, 30786 shouldOverwriteState = _options$shouldOverwr === void 0 ? function () { 30787 return false; 30788 } : _options$shouldOverwr; 30789 return function () { 30790 var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initialState; 30791 var action = arguments.length > 1 ? arguments[1] : undefined; 30792 var past = state.past, 30793 present = state.present, 30794 future = state.future, 30795 lastAction = state.lastAction, 30796 shouldCreateUndoLevel = state.shouldCreateUndoLevel; 30797 var previousAction = lastAction; 30798 30799 switch (action.type) { 30800 case 'UNDO': 30801 // Can't undo if no past. 30802 if (!past.length) { 30803 return state; 30804 } 30805 30806 return { 30807 past: Object(lodash__WEBPACK_IMPORTED_MODULE_2__["dropRight"])(past), 30808 present: Object(lodash__WEBPACK_IMPORTED_MODULE_2__["last"])(past), 30809 future: [present].concat(Object(_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_0__["default"])(future)), 30810 lastAction: null, 30811 shouldCreateUndoLevel: false 30812 }; 30813 30814 case 'REDO': 30815 // Can't redo if no future. 30816 if (!future.length) { 30817 return state; 30818 } 30819 30820 return { 30821 past: Object(_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_0__["default"])(past).concat([present]), 30822 present: Object(lodash__WEBPACK_IMPORTED_MODULE_2__["first"])(future), 30823 future: Object(lodash__WEBPACK_IMPORTED_MODULE_2__["drop"])(future), 30824 lastAction: null, 30825 shouldCreateUndoLevel: false 30826 }; 30827 30828 case 'CREATE_UNDO_LEVEL': 30829 return Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_1__["default"])({}, state, { 30830 lastAction: null, 30831 shouldCreateUndoLevel: true 30832 }); 30833 } 30834 30835 var nextPresent = reducer(present, action); 30836 30837 if (Object(lodash__WEBPACK_IMPORTED_MODULE_2__["includes"])(resetTypes, action.type)) { 30838 return { 30839 past: [], 30840 present: nextPresent, 30841 future: [], 30842 lastAction: null, 30843 shouldCreateUndoLevel: false 30844 }; 30845 } 30846 30847 if (present === nextPresent) { 30848 return state; 30849 } 30850 30851 var nextPast = past; 30852 30853 if (shouldCreateUndoLevel || !past.length || !shouldOverwriteState(action, previousAction)) { 30854 nextPast = Object(_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_0__["default"])(past).concat([present]); 30855 } 30856 30857 return { 30858 past: nextPast, 30859 present: nextPresent, 30860 future: [], 30861 shouldCreateUndoLevel: false, 30862 lastAction: action 30863 }; 30864 }; 30865 }; 30866 }; 30867 30868 /* harmony default export */ __webpack_exports__["default"] = (withHistory); 30869 30870 30871 /***/ }), 30872 30873 /***/ "./node_modules/autosize/dist/autosize.js": 30874 /*!************************************************!*\ 30875 !*** ./node_modules/autosize/dist/autosize.js ***! 30876 \************************************************/ 30877 /*! no static exports found */ 30878 /***/ (function(module, exports, __webpack_require__) { 30879 30880 var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*! 30881 autosize 4.0.2 30882 license: MIT 30883 http://www.jacklmoore.com/autosize 30884 */ 30885 (function (global, factory) { 30886 if (true) { 30887 !(__WEBPACK_AMD_DEFINE_ARRAY__ = [module, exports], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), 30888 __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? 30889 (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), 30890 __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); 30891 } else { var mod; } 30892 })(this, function (module, exports) { 30893 'use strict'; 30894 30895 var map = typeof Map === "function" ? new Map() : function () { 30896 var keys = []; 30897 var values = []; 30898 30899 return { 30900 has: function has(key) { 30901 return keys.indexOf(key) > -1; 30902 }, 30903 get: function get(key) { 30904 return values[keys.indexOf(key)]; 30905 }, 30906 set: function set(key, value) { 30907 if (keys.indexOf(key) === -1) { 30908 keys.push(key); 30909 values.push(value); 30910 } 30911 }, 30912 delete: function _delete(key) { 30913 var index = keys.indexOf(key); 30914 if (index > -1) { 30915 keys.splice(index, 1); 30916 values.splice(index, 1); 30917 } 30918 } 30919 }; 30920 }(); 30921 30922 var createEvent = function createEvent(name) { 30923 return new Event(name, { bubbles: true }); 30924 }; 30925 try { 30926 new Event('test'); 30927 } catch (e) { 30928 // IE does not support `new Event()` 30929 createEvent = function createEvent(name) { 30930 var evt = document.createEvent('Event'); 30931 evt.initEvent(name, true, false); 30932 return evt; 30933 }; 30934 } 30935 30936 function assign(ta) { 30937 if (!ta || !ta.nodeName || ta.nodeName !== 'TEXTAREA' || map.has(ta)) return; 30938 30939 var heightOffset = null; 30940 var clientWidth = null; 30941 var cachedHeight = null; 30942 30943 function init() { 30944 var style = window.getComputedStyle(ta, null); 30945 30946 if (style.resize === 'vertical') { 30947 ta.style.resize = 'none'; 30948 } else if (style.resize === 'both') { 30949 ta.style.resize = 'horizontal'; 30950 } 30951 30952 if (style.boxSizing === 'content-box') { 30953 heightOffset = -(parseFloat(style.paddingTop) + parseFloat(style.paddingBottom)); 30954 } else { 30955 heightOffset = parseFloat(style.borderTopWidth) + parseFloat(style.borderBottomWidth); 30956 } 30957 // Fix when a textarea is not on document body and heightOffset is Not a Number 30958 if (isNaN(heightOffset)) { 30959 heightOffset = 0; 30960 } 30961 30962 update(); 30963 } 30964 30965 function changeOverflow(value) { 30966 { 30967 // Chrome/Safari-specific fix: 30968 // When the textarea y-overflow is hidden, Chrome/Safari do not reflow the text to account for the space 30969 // made available by removing the scrollbar. The following forces the necessary text reflow. 30970 var width = ta.style.width; 30971 ta.style.width = '0px'; 30972 // Force reflow: 30973 /* jshint ignore:start */ 30974 ta.offsetWidth; 30975 /* jshint ignore:end */ 30976 ta.style.width = width; 30977 } 30978 30979 ta.style.overflowY = value; 30980 } 30981 30982 function getParentOverflows(el) { 30983 var arr = []; 30984 30985 while (el && el.parentNode && el.parentNode instanceof Element) { 30986 if (el.parentNode.scrollTop) { 30987 arr.push({ 30988 node: el.parentNode, 30989 scrollTop: el.parentNode.scrollTop 30990 }); 30991 } 30992 el = el.parentNode; 30993 } 30994 30995 return arr; 30996 } 30997 30998 function resize() { 30999 if (ta.scrollHeight === 0) { 31000 // If the scrollHeight is 0, then the element probably has display:none or is detached from the DOM. 31001 return; 31002 } 31003 31004 var overflows = getParentOverflows(ta); 31005 var docTop = document.documentElement && document.documentElement.scrollTop; // Needed for Mobile IE (ticket #240) 31006 31007 ta.style.height = ''; 31008 ta.style.height = ta.scrollHeight + heightOffset + 'px'; 31009 31010 // used to check if an update is actually necessary on window.resize 31011 clientWidth = ta.clientWidth; 31012 31013 // prevents scroll-position jumping 31014 overflows.forEach(function (el) { 31015 el.node.scrollTop = el.scrollTop; 31016 }); 31017 31018 if (docTop) { 31019 document.documentElement.scrollTop = docTop; 31020 } 31021 } 31022 31023 function update() { 31024 resize(); 31025 31026 var styleHeight = Math.round(parseFloat(ta.style.height)); 31027 var computed = window.getComputedStyle(ta, null); 31028 31029 // Using offsetHeight as a replacement for computed.height in IE, because IE does not account use of border-box 31030 var actualHeight = computed.boxSizing === 'content-box' ? Math.round(parseFloat(computed.height)) : ta.offsetHeight; 31031 31032 // The actual height not matching the style height (set via the resize method) indicates that 31033 // the max-height has been exceeded, in which case the overflow should be allowed. 31034 if (actualHeight < styleHeight) { 31035 if (computed.overflowY === 'hidden') { 31036 changeOverflow('scroll'); 31037 resize(); 31038 actualHeight = computed.boxSizing === 'content-box' ? Math.round(parseFloat(window.getComputedStyle(ta, null).height)) : ta.offsetHeight; 31039 } 31040 } else { 31041 // Normally keep overflow set to hidden, to avoid flash of scrollbar as the textarea expands. 31042 if (computed.overflowY !== 'hidden') { 31043 changeOverflow('hidden'); 31044 resize(); 31045 actualHeight = computed.boxSizing === 'content-box' ? Math.round(parseFloat(window.getComputedStyle(ta, null).height)) : ta.offsetHeight; 31046 } 31047 } 31048 31049 if (cachedHeight !== actualHeight) { 31050 cachedHeight = actualHeight; 31051 var evt = createEvent('autosize:resized'); 31052 try { 31053 ta.dispatchEvent(evt); 31054 } catch (err) { 31055 // Firefox will throw an error on dispatchEvent for a detached element 31056 // https://bugzilla.mozilla.org/show_bug.cgi?id=889376 31057 } 31058 } 31059 } 31060 31061 var pageResize = function pageResize() { 31062 if (ta.clientWidth !== clientWidth) { 31063 update(); 31064 } 31065 }; 31066 31067 var destroy = function (style) { 31068 window.removeEventListener('resize', pageResize, false); 31069 ta.removeEventListener('input', update, false); 31070 ta.removeEventListener('keyup', update, false); 31071 ta.removeEventListener('autosize:destroy', destroy, false); 31072 ta.removeEventListener('autosize:update', update, false); 31073 31074 Object.keys(style).forEach(function (key) { 31075 ta.style[key] = style[key]; 31076 }); 31077 31078 map.delete(ta); 31079 }.bind(ta, { 31080 height: ta.style.height, 31081 resize: ta.style.resize, 31082 overflowY: ta.style.overflowY, 31083 overflowX: ta.style.overflowX, 31084 wordWrap: ta.style.wordWrap 31085 }); 31086 31087 ta.addEventListener('autosize:destroy', destroy, false); 31088 31089 // IE9 does not fire onpropertychange or oninput for deletions, 31090 // so binding to onkeyup to catch most of those events. 31091 // There is no way that I know of to detect something like 'cut' in IE9. 31092 if ('onpropertychange' in ta && 'oninput' in ta) { 31093 ta.addEventListener('keyup', update, false); 31094 } 31095 31096 window.addEventListener('resize', pageResize, false); 31097 ta.addEventListener('input', update, false); 31098 ta.addEventListener('autosize:update', update, false); 31099 ta.style.overflowX = 'hidden'; 31100 ta.style.wordWrap = 'break-word'; 31101 31102 map.set(ta, { 31103 destroy: destroy, 31104 update: update 31105 }); 31106 31107 init(); 31108 } 31109 31110 function destroy(ta) { 31111 var methods = map.get(ta); 31112 if (methods) { 31113 methods.destroy(); 31114 } 31115 } 31116 31117 function update(ta) { 31118 var methods = map.get(ta); 31119 if (methods) { 31120 methods.update(); 31121 } 31122 } 31123 31124 var autosize = null; 31125 31126 // Do nothing in Node.js environment and IE8 (or lower) 31127 if (typeof window === 'undefined' || typeof window.getComputedStyle !== 'function') { 31128 autosize = function autosize(el) { 31129 return el; 31130 }; 31131 autosize.destroy = function (el) { 31132 return el; 31133 }; 31134 autosize.update = function (el) { 31135 return el; 31136 }; 31137 } else { 31138 autosize = function autosize(el, options) { 31139 if (el) { 31140 Array.prototype.forEach.call(el.length ? el : [el], function (x) { 31141 return assign(x, options); 31142 }); 31143 } 31144 return el; 31145 }; 31146 autosize.destroy = function (el) { 31147 if (el) { 31148 Array.prototype.forEach.call(el.length ? el : [el], destroy); 31149 } 31150 return el; 31151 }; 31152 autosize.update = function (el) { 31153 if (el) { 31154 Array.prototype.forEach.call(el.length ? el : [el], update); 31155 } 31156 return el; 31157 }; 31158 } 31159 31160 exports.default = autosize; 31161 module.exports = exports['default']; 31162 }); 31163 31164 /***/ }), 31165 31166 /***/ "./node_modules/classnames/index.js": 31167 /*!******************************************!*\ 31168 !*** ./node_modules/classnames/index.js ***! 31169 \******************************************/ 31170 /*! no static exports found */ 31171 /***/ (function(module, exports, __webpack_require__) { 31172 31173 var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*! 31174 Copyright (c) 2017 Jed Watson. 31175 Licensed under the MIT License (MIT), see 31176 http://jedwatson.github.io/classnames 31177 */ 31178 /* global define */ 31179 31180 (function () { 31181 'use strict'; 31182 31183 var hasOwn = {}.hasOwnProperty; 31184 31185 function classNames () { 31186 var classes = []; 31187 31188 for (var i = 0; i < arguments.length; i++) { 31189 var arg = arguments[i]; 31190 if (!arg) continue; 31191 31192 var argType = typeof arg; 31193 31194 if (argType === 'string' || argType === 'number') { 31195 classes.push(arg); 31196 } else if (Array.isArray(arg) && arg.length) { 31197 var inner = classNames.apply(null, arg); 31198 if (inner) { 31199 classes.push(inner); 31200 } 31201 } else if (argType === 'object') { 31202 for (var key in arg) { 31203 if (hasOwn.call(arg, key) && arg[key]) { 31204 classes.push(key); 31205 } 31206 } 31207 } 31208 } 31209 31210 return classes.join(' '); 31211 } 31212 31213 if ( true && module.exports) { 31214 classNames.default = classNames; 31215 module.exports = classNames; 31216 } else if (true) { 31217 // register as 'classnames', consistent with npm package name 31218 !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = (function () { 31219 return classNames; 31220 }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), 31221 __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); 31222 } else {} 31223 }()); 31224 31225 31226 /***/ }), 31227 31228 /***/ "./node_modules/computed-style/dist/computedStyle.commonjs.js": 31229 /*!********************************************************************!*\ 31230 !*** ./node_modules/computed-style/dist/computedStyle.commonjs.js ***! 31231 \********************************************************************/ 31232 /*! no static exports found */ 31233 /***/ (function(module, exports) { 31234 31235 // This code has been refactored for 140 bytes 31236 // You can see the original here: https://github.com/twolfson/computedStyle/blob/04cd1da2e30fa45844f95f5cb1ac898e9b9ef050/lib/computedStyle.js 31237 var computedStyle = function (el, prop, getComputedStyle) { 31238 getComputedStyle = window.getComputedStyle; 31239 31240 // In one fell swoop 31241 return ( 31242 // If we have getComputedStyle 31243 getComputedStyle ? 31244 // Query it 31245 // TODO: From CSS-Query notes, we might need (node, null) for FF 31246 getComputedStyle(el) : 31247 31248 // Otherwise, we are in IE and use currentStyle 31249 el.currentStyle 31250 )[ 31251 // Switch to camelCase for CSSOM 31252 // DEV: Grabbed from jQuery 31253 // https://github.com/jquery/jquery/blob/1.9-stable/src/css.js#L191-L194 31254 // https://github.com/jquery/jquery/blob/1.9-stable/src/core.js#L593-L597 31255 prop.replace(/-(\w)/gi, function (word, letter) { 31256 return letter.toUpperCase(); 31257 }) 31258 ]; 31259 }; 31260 31261 module.exports = computedStyle; 31262 31263 31264 /***/ }), 31265 31266 /***/ "./node_modules/diff/dist/diff.js": 31267 /*!****************************************!*\ 31268 !*** ./node_modules/diff/dist/diff.js ***! 31269 \****************************************/ 31270 /*! no static exports found */ 31271 /***/ (function(module, exports, __webpack_require__) { 31272 31273 /*! 31274 31275 diff v3.5.0 31276 31277 Software License Agreement (BSD License) 31278 31279 Copyright (c) 2009-2015, Kevin Decker <kpdecker@gmail.com> 31280 31281 All rights reserved. 31282 31283 Redistribution and use of this software in source and binary forms, with or without modification, 31284 are permitted provided that the following conditions are met: 31285 31286 * Redistributions of source code must retain the above 31287 copyright notice, this list of conditions and the 31288 following disclaimer. 31289 31290 * Redistributions in binary form must reproduce the above 31291 copyright notice, this list of conditions and the 31292 following disclaimer in the documentation and/or other 31293 materials provided with the distribution. 31294 31295 * Neither the name of Kevin Decker nor the names of its 31296 contributors may be used to endorse or promote products 31297 derived from this software without specific prior 31298 written permission. 31299 31300 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR 31301 IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 31302 FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 31303 CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 31304 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 31305 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER 31306 IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 31307 OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31308 @license 31309 */ 31310 (function webpackUniversalModuleDefinition(root, factory) { 31311 if(true) 31312 module.exports = factory(); 31313 else {} 31314 })(this, function() { 31315 return /******/ (function(modules) { // webpackBootstrap 31316 /******/ // The module cache 31317 /******/ var installedModules = {}; 31318 31319 /******/ // The require function 31320 /******/ function __webpack_require__(moduleId) { 31321 31322 /******/ // Check if module is in cache 31323 /******/ if(installedModules[moduleId]) 31324 /******/ return installedModules[moduleId].exports; 31325 31326 /******/ // Create a new module (and put it into the cache) 31327 /******/ var module = installedModules[moduleId] = { 31328 /******/ exports: {}, 31329 /******/ id: moduleId, 31330 /******/ loaded: false 31331 /******/ }; 31332 31333 /******/ // Execute the module function 31334 /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); 31335 31336 /******/ // Flag the module as loaded 31337 /******/ module.loaded = true; 31338 31339 /******/ // Return the exports of the module 31340 /******/ return module.exports; 31341 /******/ } 31342 31343 31344 /******/ // expose the modules object (__webpack_modules__) 31345 /******/ __webpack_require__.m = modules; 31346 31347 /******/ // expose the module cache 31348 /******/ __webpack_require__.c = installedModules; 31349 31350 /******/ // __webpack_public_path__ 31351 /******/ __webpack_require__.p = ""; 31352 31353 /******/ // Load entry module and return exports 31354 /******/ return __webpack_require__(0); 31355 /******/ }) 31356 /************************************************************************/ 31357 /******/ ([ 31358 /* 0 */ 31359 /***/ (function(module, exports, __webpack_require__) { 31360 31361 /*istanbul ignore start*/'use strict'; 31362 31363 exports.__esModule = true; 31364 exports.canonicalize = exports.convertChangesToXML = exports.convertChangesToDMP = exports.merge = exports.parsePatch = exports.applyPatches = exports.applyPatch = exports.createPatch = exports.createTwoFilesPatch = exports.structuredPatch = exports.diffArrays = exports.diffJson = exports.diffCss = exports.diffSentences = exports.diffTrimmedLines = exports.diffLines = exports.diffWordsWithSpace = exports.diffWords = exports.diffChars = exports.Diff = undefined; 31365 31366 /*istanbul ignore end*/var /*istanbul ignore start*/_base = __webpack_require__(1) /*istanbul ignore end*/; 31367 31368 /*istanbul ignore start*/var _base2 = _interopRequireDefault(_base); 31369 31370 /*istanbul ignore end*/var /*istanbul ignore start*/_character = __webpack_require__(2) /*istanbul ignore end*/; 31371 31372 var /*istanbul ignore start*/_word = __webpack_require__(3) /*istanbul ignore end*/; 31373 31374 var /*istanbul ignore start*/_line = __webpack_require__(5) /*istanbul ignore end*/; 31375 31376 var /*istanbul ignore start*/_sentence = __webpack_require__(6) /*istanbul ignore end*/; 31377 31378 var /*istanbul ignore start*/_css = __webpack_require__(7) /*istanbul ignore end*/; 31379 31380 var /*istanbul ignore start*/_json = __webpack_require__(8) /*istanbul ignore end*/; 31381 31382 var /*istanbul ignore start*/_array = __webpack_require__(9) /*istanbul ignore end*/; 31383 31384 var /*istanbul ignore start*/_apply = __webpack_require__(10) /*istanbul ignore end*/; 31385 31386 var /*istanbul ignore start*/_parse = __webpack_require__(11) /*istanbul ignore end*/; 31387 31388 var /*istanbul ignore start*/_merge = __webpack_require__(13) /*istanbul ignore end*/; 31389 31390 var /*istanbul ignore start*/_create = __webpack_require__(14) /*istanbul ignore end*/; 31391 31392 var /*istanbul ignore start*/_dmp = __webpack_require__(16) /*istanbul ignore end*/; 31393 31394 var /*istanbul ignore start*/_xml = __webpack_require__(17) /*istanbul ignore end*/; 31395 31396 /*istanbul ignore start*/function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } 31397 31398 /* See LICENSE file for terms of use */ 31399 31400 /* 31401 * Text diff implementation. 31402 * 31403 * This library supports the following APIS: 31404 * JsDiff.diffChars: Character by character diff 31405 * JsDiff.diffWords: Word (as defined by \b regex) diff which ignores whitespace 31406 * JsDiff.diffLines: Line based diff 31407 * 31408 * JsDiff.diffCss: Diff targeted at CSS content 31409 * 31410 * These methods are based on the implementation proposed in 31411 * "An O(ND) Difference Algorithm and its Variations" (Myers, 1986). 31412 * http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.4.6927 31413 */ 31414 exports. /*istanbul ignore end*/Diff = _base2['default']; 31415 /*istanbul ignore start*/exports. /*istanbul ignore end*/diffChars = _character.diffChars; 31416 /*istanbul ignore start*/exports. /*istanbul ignore end*/diffWords = _word.diffWords; 31417 /*istanbul ignore start*/exports. /*istanbul ignore end*/diffWordsWithSpace = _word.diffWordsWithSpace; 31418 /*istanbul ignore start*/exports. /*istanbul ignore end*/diffLines = _line.diffLines; 31419 /*istanbul ignore start*/exports. /*istanbul ignore end*/diffTrimmedLines = _line.diffTrimmedLines; 31420 /*istanbul ignore start*/exports. /*istanbul ignore end*/diffSentences = _sentence.diffSentences; 31421 /*istanbul ignore start*/exports. /*istanbul ignore end*/diffCss = _css.diffCss; 31422 /*istanbul ignore start*/exports. /*istanbul ignore end*/diffJson = _json.diffJson; 31423 /*istanbul ignore start*/exports. /*istanbul ignore end*/diffArrays = _array.diffArrays; 31424 /*istanbul ignore start*/exports. /*istanbul ignore end*/structuredPatch = _create.structuredPatch; 31425 /*istanbul ignore start*/exports. /*istanbul ignore end*/createTwoFilesPatch = _create.createTwoFilesPatch; 31426 /*istanbul ignore start*/exports. /*istanbul ignore end*/createPatch = _create.createPatch; 31427 /*istanbul ignore start*/exports. /*istanbul ignore end*/applyPatch = _apply.applyPatch; 31428 /*istanbul ignore start*/exports. /*istanbul ignore end*/applyPatches = _apply.applyPatches; 31429 /*istanbul ignore start*/exports. /*istanbul ignore end*/parsePatch = _parse.parsePatch; 31430 /*istanbul ignore start*/exports. /*istanbul ignore end*/merge = _merge.merge; 31431 /*istanbul ignore start*/exports. /*istanbul ignore end*/convertChangesToDMP = _dmp.convertChangesToDMP; 31432 /*istanbul ignore start*/exports. /*istanbul ignore end*/convertChangesToXML = _xml.convertChangesToXML; 31433 /*istanbul ignore start*/exports. /*istanbul ignore end*/canonicalize = _json.canonicalize; 31434 //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9pbmRleC5qcyJdLCJuYW1lcyI6WyJEaWZmIiwiZGlmZkNoYXJzIiwiZGlmZldvcmRzIiwiZGlmZldvcmRzV2l0aFNwYWNlIiwiZGlmZkxpbmVzIiwiZGlmZlRyaW1tZWRMaW5lcyIsImRpZmZTZW50ZW5jZXMiLCJkaWZmQ3NzIiwiZGlmZkpzb24iLCJkaWZmQXJyYXlzIiwic3RydWN0dXJlZFBhdGNoIiwiY3JlYXRlVHdvRmlsZXNQYXRjaCIsImNyZWF0ZVBhdGNoIiwiYXBwbHlQYXRjaCIsImFwcGx5UGF0Y2hlcyIsInBhcnNlUGF0Y2giLCJtZXJnZSIsImNvbnZlcnRDaGFuZ2VzVG9ETVAiLCJjb252ZXJ0Q2hhbmdlc1RvWE1MIiwiY2Fub25pY2FsaXplIl0sIm1hcHBpbmdzIjoiOzs7Ozt1QkFnQkE7Ozs7dUJBQ0E7O0FBQ0E7O0FBQ0E7O0FBQ0E7O0FBRUE7O0FBQ0E7O0FBRUE7O0FBRUE7O0FBQ0E7O0FBQ0E7O0FBQ0E7O0FBRUE7O0FBQ0E7Ozs7QUFqQ0E7O0FBRUE7Ozs7Ozs7Ozs7Ozs7O2dDQWtDRUEsSTt5REFFQUMsUzt5REFDQUMsUzt5REFDQUMsa0I7eURBQ0FDLFM7eURBQ0FDLGdCO3lEQUNBQyxhO3lEQUVBQyxPO3lEQUNBQyxRO3lEQUVBQyxVO3lEQUVBQyxlO3lEQUNBQyxtQjt5REFDQUMsVzt5REFDQUMsVTt5REFDQUMsWTt5REFDQUMsVTt5REFDQUMsSzt5REFDQUMsbUI7eURBQ0FDLG1CO3lEQUNBQyxZIiwiZmlsZSI6ImluZGV4LmpzIiwic291cmNlc0NvbnRlbnQiOlsiLyogU2VlIExJQ0VOU0UgZmlsZSBmb3IgdGVybXMgb2YgdXNlICovXG5cbi8qXG4gKiBUZXh0IGRpZmYgaW1wbGVtZW50YXRpb24uXG4gKlxuICogVGhpcyBsaWJyYXJ5IHN1cHBvcnRzIHRoZSBmb2xsb3dpbmcgQVBJUzpcbiAqIEpzRGlmZi5kaWZmQ2hhcnM6IENoYXJhY3RlciBieSBjaGFyYWN0ZXIgZGlmZlxuICogSnNEaWZmLmRpZmZXb3JkczogV29yZCAoYXMgZGVmaW5lZCBieSBcXGIgcmVnZXgpIGRpZmYgd2hpY2ggaWdub3JlcyB3aGl0ZXNwYWNlXG4gKiBKc0RpZmYuZGlmZkxpbmVzOiBMaW5lIGJhc2VkIGRpZmZcbiAqXG4gKiBKc0RpZmYuZGlmZkNzczogRGlmZiB0YXJnZXRlZCBhdCBDU1MgY29udGVudFxuICpcbiAqIFRoZXNlIG1ldGhvZHMgYXJlIGJhc2VkIG9uIHRoZSBpbXBsZW1lbnRhdGlvbiBwcm9wb3NlZCBpblxuICogXCJBbiBPKE5EKSBEaWZmZXJlbmNlIEFsZ29yaXRobSBhbmQgaXRzIFZhcmlhdGlvbnNcIiAoTXllcnMsIDE5ODYpLlxuICogaHR0cDovL2NpdGVzZWVyeC5pc3QucHN1LmVkdS92aWV3ZG9jL3N1bW1hcnk/ZG9pPTEwLjEuMS40LjY5MjdcbiAqL1xuaW1wb3J0IERpZmYgZnJvbSAnLi9kaWZmL2Jhc2UnO1xuaW1wb3J0IHtkaWZmQ2hhcnN9IGZyb20gJy4vZGlmZi9jaGFyYWN0ZXInO1xuaW1wb3J0IHtkaWZmV29yZHMsIGRpZmZXb3Jkc1dpdGhTcGFjZX0gZnJvbSAnLi9kaWZmL3dvcmQnO1xuaW1wb3J0IHtkaWZmTGluZXMsIGRpZmZUcmltbWVkTGluZXN9IGZyb20gJy4vZGlmZi9saW5lJztcbmltcG9ydCB7ZGlmZlNlbnRlbmNlc30gZnJvbSAnLi9kaWZmL3NlbnRlbmNlJztcblxuaW1wb3J0IHtkaWZmQ3NzfSBmcm9tICcuL2RpZmYvY3NzJztcbmltcG9ydCB7ZGlmZkpzb24sIGNhbm9uaWNhbGl6ZX0gZnJvbSAnLi9kaWZmL2pzb24nO1xuXG5pbXBvcnQge2RpZmZBcnJheXN9IGZyb20gJy4vZGlmZi9hcnJheSc7XG5cbmltcG9ydCB7YXBwbHlQYXRjaCwgYXBwbHlQYXRjaGVzfSBmcm9tICcuL3BhdGNoL2FwcGx5JztcbmltcG9ydCB7cGFyc2VQYXRjaH0gZnJvbSAnLi9wYXRjaC9wYXJzZSc7XG5pbXBvcnQge21lcmdlfSBmcm9tICcuL3BhdGNoL21lcmdlJztcbmltcG9ydCB7c3RydWN0dXJlZFBhdGNoLCBjcmVhdGVUd29GaWxlc1BhdGNoLCBjcmVhdGVQYXRjaH0gZnJvbSAnLi9wYXRjaC9jcmVhdGUnO1xuXG5pbXBvcnQge2NvbnZlcnRDaGFuZ2VzVG9ETVB9IGZyb20gJy4vY29udmVydC9kbXAnO1xuaW1wb3J0IHtjb252ZXJ0Q2hhbmdlc1RvWE1MfSBmcm9tICcuL2NvbnZlcnQveG1sJztcblxuZXhwb3J0IHtcbiAgRGlmZixcblxuICBkaWZmQ2hhcnMsXG4gIGRpZmZXb3JkcyxcbiAgZGlmZldvcmRzV2l0aFNwYWNlLFxuICBkaWZmTGluZXMsXG4gIGRpZmZUcmltbWVkTGluZXMsXG4gIGRpZmZTZW50ZW5jZXMsXG5cbiAgZGlmZkNzcyxcbiAgZGlmZkpzb24sXG5cbiAgZGlmZkFycmF5cyxcblxuICBzdHJ1Y3R1cmVkUGF0Y2gsXG4gIGNyZWF0ZVR3b0ZpbGVzUGF0Y2gsXG4gIGNyZWF0ZVBhdGNoLFxuICBhcHBseVBhdGNoLFxuICBhcHBseVBhdGNoZXMsXG4gIHBhcnNlUGF0Y2gsXG4gIG1lcmdlLFxuICBjb252ZXJ0Q2hhbmdlc1RvRE1QLFxuICBjb252ZXJ0Q2hhbmdlc1RvWE1MLFxuICBjYW5vbmljYWxpemVcbn07XG4iXX0= 31435 31436 31437 /***/ }), 31438 /* 1 */ 31439 /***/ (function(module, exports) { 31440 31441 /*istanbul ignore start*/'use strict'; 31442 31443 exports.__esModule = true; 31444 exports['default'] = /*istanbul ignore end*/Diff; 31445 function Diff() {} 31446 31447 Diff.prototype = { 31448 /*istanbul ignore start*/ /*istanbul ignore end*/diff: function diff(oldString, newString) { 31449 /*istanbul ignore start*/var /*istanbul ignore end*/options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; 31450 31451 var callback = options.callback; 31452 if (typeof options === 'function') { 31453 callback = options; 31454 options = {}; 31455 } 31456 this.options = options; 31457 31458 var self = this; 31459 31460 function done(value) { 31461 if (callback) { 31462 setTimeout(function () { 31463 callback(undefined, value); 31464 }, 0); 31465 return true; 31466 } else { 31467 return value; 31468 } 31469 } 31470 31471 // Allow subclasses to massage the input prior to running 31472 oldString = this.castInput(oldString); 31473 newString = this.castInput(newString); 31474 31475 oldString = this.removeEmpty(this.tokenize(oldString)); 31476 newString = this.removeEmpty(this.tokenize(newString)); 31477 31478 var newLen = newString.length, 31479 oldLen = oldString.length; 31480 var editLength = 1; 31481 var maxEditLength = newLen + oldLen; 31482 var bestPath = [{ newPos: -1, components: [] }]; 31483 31484 // Seed editLength = 0, i.e. the content starts with the same values 31485 var oldPos = this.extractCommon(bestPath[0], newString, oldString, 0); 31486 if (bestPath[0].newPos + 1 >= newLen && oldPos + 1 >= oldLen) { 31487 // Identity per the equality and tokenizer 31488 return done([{ value: this.join(newString), count: newString.length }]); 31489 } 31490 31491 // Main worker method. checks all permutations of a given edit length for acceptance. 31492 function execEditLength() { 31493 for (var diagonalPath = -1 * editLength; diagonalPath <= editLength; diagonalPath += 2) { 31494 var basePath = /*istanbul ignore start*/void 0 /*istanbul ignore end*/; 31495 var addPath = bestPath[diagonalPath - 1], 31496 removePath = bestPath[diagonalPath + 1], 31497 _oldPos = (removePath ? removePath.newPos : 0) - diagonalPath; 31498 if (addPath) { 31499 // No one else is going to attempt to use this value, clear it 31500 bestPath[diagonalPath - 1] = undefined; 31501 } 31502 31503 var canAdd = addPath && addPath.newPos + 1 < newLen, 31504 canRemove = removePath && 0 <= _oldPos && _oldPos < oldLen; 31505 if (!canAdd && !canRemove) { 31506 // If this path is a terminal then prune 31507 bestPath[diagonalPath] = undefined; 31508 continue; 31509 } 31510 31511 // Select the diagonal that we want to branch from. We select the prior 31512 // path whose position in the new string is the farthest from the origin 31513 // and does not pass the bounds of the diff graph 31514 if (!canAdd || canRemove && addPath.newPos < removePath.newPos) { 31515 basePath = clonePath(removePath); 31516 self.pushComponent(basePath.components, undefined, true); 31517 } else { 31518 basePath = addPath; // No need to clone, we've pulled it from the list 31519 basePath.newPos++; 31520 self.pushComponent(basePath.components, true, undefined); 31521 } 31522 31523 _oldPos = self.extractCommon(basePath, newString, oldString, diagonalPath); 31524 31525 // If we have hit the end of both strings, then we are done 31526 if (basePath.newPos + 1 >= newLen && _oldPos + 1 >= oldLen) { 31527 return done(buildValues(self, basePath.components, newString, oldString, self.useLongestToken)); 31528 } else { 31529 // Otherwise track this path as a potential candidate and continue. 31530 bestPath[diagonalPath] = basePath; 31531 } 31532 } 31533 31534 editLength++; 31535 } 31536 31537 // Performs the length of edit iteration. Is a bit fugly as this has to support the 31538 // sync and async mode which is never fun. Loops over execEditLength until a value 31539 // is produced. 31540 if (callback) { 31541 (function exec() { 31542 setTimeout(function () { 31543 // This should not happen, but we want to be safe. 31544 /* istanbul ignore next */ 31545 if (editLength > maxEditLength) { 31546 return callback(); 31547 } 31548 31549 if (!execEditLength()) { 31550 exec(); 31551 } 31552 }, 0); 31553 })(); 31554 } else { 31555 while (editLength <= maxEditLength) { 31556 var ret = execEditLength(); 31557 if (ret) { 31558 return ret; 31559 } 31560 } 31561 } 31562 }, 31563 /*istanbul ignore start*/ /*istanbul ignore end*/pushComponent: function pushComponent(components, added, removed) { 31564 var last = components[components.length - 1]; 31565 if (last && last.added === added && last.removed === removed) { 31566 // We need to clone here as the component clone operation is just 31567 // as shallow array clone 31568 components[components.length - 1] = { count: last.count + 1, added: added, removed: removed }; 31569 } else { 31570 components.push({ count: 1, added: added, removed: removed }); 31571 } 31572 }, 31573 /*istanbul ignore start*/ /*istanbul ignore end*/extractCommon: function extractCommon(basePath, newString, oldString, diagonalPath) { 31574 var newLen = newString.length, 31575 oldLen = oldString.length, 31576 newPos = basePath.newPos, 31577 oldPos = newPos - diagonalPath, 31578 commonCount = 0; 31579 while (newPos + 1 < newLen && oldPos + 1 < oldLen && this.equals(newString[newPos + 1], oldString[oldPos + 1])) { 31580 newPos++; 31581 oldPos++; 31582 commonCount++; 31583 } 31584 31585 if (commonCount) { 31586 basePath.components.push({ count: commonCount }); 31587 } 31588 31589 basePath.newPos = newPos; 31590 return oldPos; 31591 }, 31592 /*istanbul ignore start*/ /*istanbul ignore end*/equals: function equals(left, right) { 31593 if (this.options.comparator) { 31594 return this.options.comparator(left, right); 31595 } else { 31596 return left === right || this.options.ignoreCase && left.toLowerCase() === right.toLowerCase(); 31597 } 31598 }, 31599 /*istanbul ignore start*/ /*istanbul ignore end*/removeEmpty: function removeEmpty(array) { 31600 var ret = []; 31601 for (var i = 0; i < array.length; i++) { 31602 if (array[i]) { 31603 ret.push(array[i]); 31604 } 31605 } 31606 return ret; 31607 }, 31608 /*istanbul ignore start*/ /*istanbul ignore end*/castInput: function castInput(value) { 31609 return value; 31610 }, 31611 /*istanbul ignore start*/ /*istanbul ignore end*/tokenize: function tokenize(value) { 31612 return value.split(''); 31613 }, 31614 /*istanbul ignore start*/ /*istanbul ignore end*/join: function join(chars) { 31615 return chars.join(''); 31616 } 31617 }; 31618 31619 function buildValues(diff, components, newString, oldString, useLongestToken) { 31620 var componentPos = 0, 31621 componentLen = components.length, 31622 newPos = 0, 31623 oldPos = 0; 31624 31625 for (; componentPos < componentLen; componentPos++) { 31626 var component = components[componentPos]; 31627 if (!component.removed) { 31628 if (!component.added && useLongestToken) { 31629 var value = newString.slice(newPos, newPos + component.count); 31630 value = value.map(function (value, i) { 31631 var oldValue = oldString[oldPos + i]; 31632 return oldValue.length > value.length ? oldValue : value; 31633 }); 31634 31635 component.value = diff.join(value); 31636 } else { 31637 component.value = diff.join(newString.slice(newPos, newPos + component.count)); 31638 } 31639 newPos += component.count; 31640 31641 // Common case 31642 if (!component.added) { 31643 oldPos += component.count; 31644 } 31645 } else { 31646 component.value = diff.join(oldString.slice(oldPos, oldPos + component.count)); 31647 oldPos += component.count; 31648 31649 // Reverse add and remove so removes are output first to match common convention 31650 // The diffing algorithm is tied to add then remove output and this is the simplest 31651 // route to get the desired output with minimal overhead. 31652 if (componentPos && components[componentPos - 1].added) { 31653 var tmp = components[componentPos - 1]; 31654 components[componentPos - 1] = components[componentPos]; 31655 components[componentPos] = tmp; 31656 } 31657 } 31658 } 31659 31660 // Special case handle for when one terminal is ignored (i.e. whitespace). 31661 // For this case we merge the terminal into the prior string and drop the change. 31662 // This is only available for string mode. 31663 var lastComponent = components[componentLen - 1]; 31664 if (componentLen > 1 && typeof lastComponent.value === 'string' && (lastComponent.added || lastComponent.removed) && diff.equals('', lastComponent.value)) { 31665 components[componentLen - 2].value += lastComponent.value; 31666 components.pop(); 31667 } 31668 31669 return components; 31670 } 31671 31672 function clonePath(path) { 31673 return { newPos: path.newPos, components: path.components.slice(0) }; 31674 } 31675 //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9kaWZmL2Jhc2UuanMiXSwibmFtZXMiOlsiRGlmZiIsInByb3RvdHlwZSIsImRpZmYiLCJvbGRTdHJpbmciLCJuZXdTdHJpbmciLCJvcHRpb25zIiwiY2FsbGJhY2siLCJzZWxmIiwiZG9uZSIsInZhbHVlIiwic2V0VGltZW91dCIsInVuZGVmaW5lZCIsImNhc3RJbnB1dCIsInJlbW92ZUVtcHR5IiwidG9rZW5pemUiLCJuZXdMZW4iLCJsZW5ndGgiLCJvbGRMZW4iLCJlZGl0TGVuZ3RoIiwibWF4RWRpdExlbmd0aCIsImJlc3RQYXRoIiwibmV3UG9zIiwiY29tcG9uZW50cyIsIm9sZFBvcyIsImV4dHJhY3RDb21tb24iLCJqb2luIiwiY291bnQiLCJleGVjRWRpdExlbmd0aCIsImRpYWdvbmFsUGF0aCIsImJhc2VQYXRoIiwiYWRkUGF0aCIsInJlbW92ZVBhdGgiLCJjYW5BZGQiLCJjYW5SZW1vdmUiLCJjbG9uZVBhdGgiLCJwdXNoQ29tcG9uZW50IiwiYnVpbGRWYWx1ZXMiLCJ1c2VMb25nZXN0VG9rZW4iLCJleGVjIiwicmV0IiwiYWRkZWQiLCJyZW1vdmVkIiwibGFzdCIsInB1c2giLCJjb21tb25Db3VudCIsImVxdWFscyIsImxlZnQiLCJyaWdodCIsImNvbXBhcmF0b3IiLCJpZ25vcmVDYXNlIiwidG9Mb3dlckNhc2UiLCJhcnJheSIsImkiLCJzcGxpdCIsImNoYXJzIiwiY29tcG9uZW50UG9zIiwiY29tcG9uZW50TGVuIiwiY29tcG9uZW50Iiwic2xpY2UiLCJtYXAiLCJvbGRWYWx1ZSIsInRtcCIsImxhc3RDb21wb25lbnQiLCJwb3AiLCJwYXRoIl0sIm1hcHBpbmdzIjoiOzs7NENBQXdCQSxJO0FBQVQsU0FBU0EsSUFBVCxHQUFnQixDQUFFOztBQUVqQ0EsS0FBS0MsU0FBTCxHQUFpQjtBQUFBLG1EQUNmQyxJQURlLGdCQUNWQyxTQURVLEVBQ0NDLFNBREQsRUFDMEI7QUFBQSx3REFBZEMsT0FBYyx1RUFBSixFQUFJOztBQUN2QyxRQUFJQyxXQUFXRCxRQUFRQyxRQUF2QjtBQUNBLFFBQUksT0FBT0QsT0FBUCxLQUFtQixVQUF2QixFQUFtQztBQUNqQ0MsaUJBQVdELE9BQVg7QUFDQUEsZ0JBQVUsRUFBVjtBQUNEO0FBQ0QsU0FBS0EsT0FBTCxHQUFlQSxPQUFmOztBQUVBLFFBQUlFLE9BQU8sSUFBWDs7QUFFQSxhQUFTQyxJQUFULENBQWNDLEtBQWQsRUFBcUI7QUFDbkIsVUFBSUgsUUFBSixFQUFjO0FBQ1pJLG1CQUFXLFlBQVc7QUFBRUosbUJBQVNLLFNBQVQsRUFBb0JGLEtBQXBCO0FBQTZCLFNBQXJELEVBQXVELENBQXZEO0FBQ0EsZUFBTyxJQUFQO0FBQ0QsT0FIRCxNQUdPO0FBQ0wsZUFBT0EsS0FBUDtBQUNEO0FBQ0Y7O0FBRUQ7QUFDQU4sZ0JBQVksS0FBS1MsU0FBTCxDQUFlVCxTQUFmLENBQVo7QUFDQUMsZ0JBQVksS0FBS1EsU0FBTCxDQUFlUixTQUFmLENBQVo7O0FBRUFELGdCQUFZLEtBQUtVLFdBQUwsQ0FBaUIsS0FBS0MsUUFBTCxDQUFjWCxTQUFkLENBQWpCLENBQVo7QUFDQUMsZ0JBQVksS0FBS1MsV0FBTCxDQUFpQixLQUFLQyxRQUFMLENBQWNWLFNBQWQsQ0FBakIsQ0FBWjs7QUFFQSxRQUFJVyxTQUFTWCxVQUFVWSxNQUF2QjtBQUFBLFFBQStCQyxTQUFTZCxVQUFVYSxNQUFsRDtBQUNBLFFBQUlFLGFBQWEsQ0FBakI7QUFDQSxRQUFJQyxnQkFBZ0JKLFNBQVNFLE1BQTdCO0FBQ0EsUUFBSUcsV0FBVyxDQUFDLEVBQUVDLFFBQVEsQ0FBQyxDQUFYLEVBQWNDLFlBQVksRUFBMUIsRUFBRCxDQUFmOztBQUVBO0FBQ0EsUUFBSUMsU0FBUyxLQUFLQyxhQUFMLENBQW1CSixTQUFTLENBQVQsQ0FBbkIsRUFBZ0NoQixTQUFoQyxFQUEyQ0QsU0FBM0MsRUFBc0QsQ0FBdEQsQ0FBYjtBQUNBLFFBQUlpQixTQUFTLENBQVQsRUFBWUMsTUFBWixHQUFxQixDQUFyQixJQUEwQk4sTUFBMUIsSUFBb0NRLFNBQVMsQ0FBVCxJQUFjTixNQUF0RCxFQUE4RDtBQUM1RDtBQUNBLGFBQU9ULEtBQUssQ0FBQyxFQUFDQyxPQUFPLEtBQUtnQixJQUFMLENBQVVyQixTQUFWLENBQVIsRUFBOEJzQixPQUFPdEIsVUFBVVksTUFBL0MsRUFBRCxDQUFMLENBQVA7QUFDRDs7QUFFRDtBQUNBLGFBQVNXLGNBQVQsR0FBMEI7QUFDeEIsV0FBSyxJQUFJQyxlQUFlLENBQUMsQ0FBRCxHQUFLVixVQUE3QixFQUF5Q1UsZ0JBQWdCVixVQUF6RCxFQUFxRVUsZ0JBQWdCLENBQXJGLEVBQXdGO0FBQ3RGLFlBQUlDLDBDQUFKO0FBQ0EsWUFBSUMsVUFBVVYsU0FBU1EsZUFBZSxDQUF4QixDQUFkO0FBQUEsWUFDSUcsYUFBYVgsU0FBU1EsZUFBZSxDQUF4QixDQURqQjtBQUFBLFlBRUlMLFVBQVMsQ0FBQ1EsYUFBYUEsV0FBV1YsTUFBeEIsR0FBaUMsQ0FBbEMsSUFBdUNPLFlBRnBEO0FBR0EsWUFBSUUsT0FBSixFQUFhO0FBQ1g7QUFDQVYsbUJBQVNRLGVBQWUsQ0FBeEIsSUFBNkJqQixTQUE3QjtBQUNEOztBQUVELFlBQUlxQixTQUFTRixXQUFXQSxRQUFRVCxNQUFSLEdBQWlCLENBQWpCLEdBQXFCTixNQUE3QztBQUFBLFlBQ0lrQixZQUFZRixjQUFjLEtBQUtSLE9BQW5CLElBQTZCQSxVQUFTTixNQUR0RDtBQUVBLFlBQUksQ0FBQ2UsTUFBRCxJQUFXLENBQUNDLFNBQWhCLEVBQTJCO0FBQ3pCO0FBQ0FiLG1CQUFTUSxZQUFULElBQXlCakIsU0FBekI7QUFDQTtBQUNEOztBQUVEO0FBQ0E7QUFDQTtBQUNBLFlBQUksQ0FBQ3FCLE1BQUQsSUFBWUMsYUFBYUgsUUFBUVQsTUFBUixHQUFpQlUsV0FBV1YsTUFBekQsRUFBa0U7QUFDaEVRLHFCQUFXSyxVQUFVSCxVQUFWLENBQVg7QUFDQXhCLGVBQUs0QixhQUFMLENBQW1CTixTQUFTUCxVQUE1QixFQUF3Q1gsU0FBeEMsRUFBbUQsSUFBbkQ7QUFDRCxTQUhELE1BR087QUFDTGtCLHFCQUFXQyxPQUFYLENBREssQ0FDaUI7QUFDdEJELG1CQUFTUixNQUFUO0FBQ0FkLGVBQUs0QixhQUFMLENBQW1CTixTQUFTUCxVQUE1QixFQUF3QyxJQUF4QyxFQUE4Q1gsU0FBOUM7QUFDRDs7QUFFRFksa0JBQVNoQixLQUFLaUIsYUFBTCxDQUFtQkssUUFBbkIsRUFBNkJ6QixTQUE3QixFQUF3Q0QsU0FBeEMsRUFBbUR5QixZQUFuRCxDQUFUOztBQUVBO0FBQ0EsWUFBSUMsU0FBU1IsTUFBVCxHQUFrQixDQUFsQixJQUF1Qk4sTUFBdkIsSUFBaUNRLFVBQVMsQ0FBVCxJQUFjTixNQUFuRCxFQUEyRDtBQUN6RCxpQkFBT1QsS0FBSzRCLFlBQVk3QixJQUFaLEVBQWtCc0IsU0FBU1AsVUFBM0IsRUFBdUNsQixTQUF2QyxFQUFrREQsU0FBbEQsRUFBNkRJLEtBQUs4QixlQUFsRSxDQUFMLENBQVA7QUFDRCxTQUZELE1BRU87QUFDTDtBQUNBakIsbUJBQVNRLFlBQVQsSUFBeUJDLFFBQXpCO0FBQ0Q7QUFDRjs7QUFFRFg7QUFDRDs7QUFFRDtBQUNBO0FBQ0E7QUFDQSxRQUFJWixRQUFKLEVBQWM7QUFDWCxnQkFBU2dDLElBQVQsR0FBZ0I7QUFDZjVCLG1CQUFXLFlBQVc7QUFDcEI7QUFDQTtBQUNBLGNBQUlRLGFBQWFDLGFBQWpCLEVBQWdDO0FBQzlCLG1CQUFPYixVQUFQO0FBQ0Q7O0FBRUQsY0FBSSxDQUFDcUIsZ0JBQUwsRUFBdUI7QUFDckJXO0FBQ0Q7QUFDRixTQVZELEVBVUcsQ0FWSDtBQVdELE9BWkEsR0FBRDtBQWFELEtBZEQsTUFjTztBQUNMLGFBQU9wQixjQUFjQyxhQUFyQixFQUFvQztBQUNsQyxZQUFJb0IsTUFBTVosZ0JBQVY7QUFDQSxZQUFJWSxHQUFKLEVBQVM7QUFDUCxpQkFBT0EsR0FBUDtBQUNEO0FBQ0Y7QUFDRjtBQUNGLEdBOUdjO0FBQUEsbURBZ0hmSixhQWhIZSx5QkFnSERiLFVBaEhDLEVBZ0hXa0IsS0FoSFgsRUFnSGtCQyxPQWhIbEIsRUFnSDJCO0FBQ3hDLFFBQUlDLE9BQU9wQixXQUFXQSxXQUFXTixNQUFYLEdBQW9CLENBQS9CLENBQVg7QUFDQSxRQUFJMEIsUUFBUUEsS0FBS0YsS0FBTCxLQUFlQSxLQUF2QixJQUFnQ0UsS0FBS0QsT0FBTCxLQUFpQkEsT0FBckQsRUFBOEQ7QUFDNUQ7QUFDQTtBQUNBbkIsaUJBQVdBLFdBQVdOLE1BQVgsR0FBb0IsQ0FBL0IsSUFBb0MsRUFBQ1UsT0FBT2dCLEtBQUtoQixLQUFMLEdBQWEsQ0FBckIsRUFBd0JjLE9BQU9BLEtBQS9CLEVBQXNDQyxTQUFTQSxPQUEvQyxFQUFwQztBQUNELEtBSkQsTUFJTztBQUNMbkIsaUJBQVdxQixJQUFYLENBQWdCLEVBQUNqQixPQUFPLENBQVIsRUFBV2MsT0FBT0EsS0FBbEIsRUFBeUJDLFNBQVNBLE9BQWxDLEVBQWhCO0FBQ0Q7QUFDRixHQXpIYztBQUFBLG1EQTBIZmpCLGFBMUhlLHlCQTBIREssUUExSEMsRUEwSFN6QixTQTFIVCxFQTBIb0JELFNBMUhwQixFQTBIK0J5QixZQTFIL0IsRUEwSDZDO0FBQzFELFFBQUliLFNBQVNYLFVBQVVZLE1BQXZCO0FBQUEsUUFDSUMsU0FBU2QsVUFBVWEsTUFEdkI7QUFBQSxRQUVJSyxTQUFTUSxTQUFTUixNQUZ0QjtBQUFBLFFBR0lFLFNBQVNGLFNBQVNPLFlBSHRCO0FBQUEsUUFLSWdCLGNBQWMsQ0FMbEI7QUFNQSxXQUFPdkIsU0FBUyxDQUFULEdBQWFOLE1BQWIsSUFBdUJRLFNBQVMsQ0FBVCxHQUFhTixNQUFwQyxJQUE4QyxLQUFLNEIsTUFBTCxDQUFZekMsVUFBVWlCLFNBQVMsQ0FBbkIsQ0FBWixFQUFtQ2xCLFVBQVVvQixTQUFTLENBQW5CLENBQW5DLENBQXJELEVBQWdIO0FBQzlHRjtBQUNBRTtBQUNBcUI7QUFDRDs7QUFFRCxRQUFJQSxXQUFKLEVBQWlCO0FBQ2ZmLGVBQVNQLFVBQVQsQ0FBb0JxQixJQUFwQixDQUF5QixFQUFDakIsT0FBT2tCLFdBQVIsRUFBekI7QUFDRDs7QUFFRGYsYUFBU1IsTUFBVCxHQUFrQkEsTUFBbEI7QUFDQSxXQUFPRSxNQUFQO0FBQ0QsR0E3SWM7QUFBQSxtREErSWZzQixNQS9JZSxrQkErSVJDLElBL0lRLEVBK0lGQyxLQS9JRSxFQStJSztBQUNsQixRQUFJLEtBQUsxQyxPQUFMLENBQWEyQyxVQUFqQixFQUE2QjtBQUMzQixhQUFPLEtBQUszQyxPQUFMLENBQWEyQyxVQUFiLENBQXdCRixJQUF4QixFQUE4QkMsS0FBOUIsQ0FBUDtBQUNELEtBRkQsTUFFTztBQUNMLGFBQU9ELFNBQVNDLEtBQVQsSUFDRCxLQUFLMUMsT0FBTCxDQUFhNEMsVUFBYixJQUEyQkgsS0FBS0ksV0FBTCxPQUF1QkgsTUFBTUcsV0FBTixFQUR4RDtBQUVEO0FBQ0YsR0F0SmM7QUFBQSxtREF1SmZyQyxXQXZKZSx1QkF1SkhzQyxLQXZKRyxFQXVKSTtBQUNqQixRQUFJWixNQUFNLEVBQVY7QUFDQSxTQUFLLElBQUlhLElBQUksQ0FBYixFQUFnQkEsSUFBSUQsTUFBTW5DLE1BQTFCLEVBQWtDb0MsR0FBbEMsRUFBdUM7QUFDckMsVUFBSUQsTUFBTUMsQ0FBTixDQUFKLEVBQWM7QUFDWmIsWUFBSUksSUFBSixDQUFTUSxNQUFNQyxDQUFOLENBQVQ7QUFDRDtBQUNGO0FBQ0QsV0FBT2IsR0FBUDtBQUNELEdBL0pjO0FBQUEsbURBZ0tmM0IsU0FoS2UscUJBZ0tMSCxLQWhLSyxFQWdLRTtBQUNmLFdBQU9BLEtBQVA7QUFDRCxHQWxLYztBQUFBLG1EQW1LZkssUUFuS2Usb0JBbUtOTCxLQW5LTSxFQW1LQztBQUNkLFdBQU9BLE1BQU00QyxLQUFOLENBQVksRUFBWixDQUFQO0FBQ0QsR0FyS2M7QUFBQSxtREFzS2Y1QixJQXRLZSxnQkFzS1Y2QixLQXRLVSxFQXNLSDtBQUNWLFdBQU9BLE1BQU03QixJQUFOLENBQVcsRUFBWCxDQUFQO0FBQ0Q7QUF4S2MsQ0FBakI7O0FBMktBLFNBQVNXLFdBQVQsQ0FBcUJsQyxJQUFyQixFQUEyQm9CLFVBQTNCLEVBQXVDbEIsU0FBdkMsRUFBa0RELFNBQWxELEVBQTZEa0MsZUFBN0QsRUFBOEU7QUFDNUUsTUFBSWtCLGVBQWUsQ0FBbkI7QUFBQSxNQUNJQyxlQUFlbEMsV0FBV04sTUFEOUI7QUFBQSxNQUVJSyxTQUFTLENBRmI7QUFBQSxNQUdJRSxTQUFTLENBSGI7O0FBS0EsU0FBT2dDLGVBQWVDLFlBQXRCLEVBQW9DRCxjQUFwQyxFQUFvRDtBQUNsRCxRQUFJRSxZQUFZbkMsV0FBV2lDLFlBQVgsQ0FBaEI7QUFDQSxRQUFJLENBQUNFLFVBQVVoQixPQUFmLEVBQXdCO0FBQ3RCLFVBQUksQ0FBQ2dCLFVBQVVqQixLQUFYLElBQW9CSCxlQUF4QixFQUF5QztBQUN2QyxZQUFJNUIsUUFBUUwsVUFBVXNELEtBQVYsQ0FBZ0JyQyxNQUFoQixFQUF3QkEsU0FBU29DLFVBQVUvQixLQUEzQyxDQUFaO0FBQ0FqQixnQkFBUUEsTUFBTWtELEdBQU4sQ0FBVSxVQUFTbEQsS0FBVCxFQUFnQjJDLENBQWhCLEVBQW1CO0FBQ25DLGNBQUlRLFdBQVd6RCxVQUFVb0IsU0FBUzZCLENBQW5CLENBQWY7QUFDQSxpQkFBT1EsU0FBUzVDLE1BQVQsR0FBa0JQLE1BQU1PLE1BQXhCLEdBQWlDNEMsUUFBakMsR0FBNENuRCxLQUFuRDtBQUNELFNBSE8sQ0FBUjs7QUFLQWdELGtCQUFVaEQsS0FBVixHQUFrQlAsS0FBS3VCLElBQUwsQ0FBVWhCLEtBQVYsQ0FBbEI7QUFDRCxPQVJELE1BUU87QUFDTGdELGtCQUFVaEQsS0FBVixHQUFrQlAsS0FBS3VCLElBQUwsQ0FBVXJCLFVBQVVzRCxLQUFWLENBQWdCckMsTUFBaEIsRUFBd0JBLFNBQVNvQyxVQUFVL0IsS0FBM0MsQ0FBVixDQUFsQjtBQUNEO0FBQ0RMLGdCQUFVb0MsVUFBVS9CLEtBQXBCOztBQUVBO0FBQ0EsVUFBSSxDQUFDK0IsVUFBVWpCLEtBQWYsRUFBc0I7QUFDcEJqQixrQkFBVWtDLFVBQVUvQixLQUFwQjtBQUNEO0FBQ0YsS0FsQkQsTUFrQk87QUFDTCtCLGdCQUFVaEQsS0FBVixHQUFrQlAsS0FBS3VCLElBQUwsQ0FBVXRCLFVBQVV1RCxLQUFWLENBQWdCbkMsTUFBaEIsRUFBd0JBLFNBQVNrQyxVQUFVL0IsS0FBM0MsQ0FBVixDQUFsQjtBQUNBSCxnQkFBVWtDLFVBQVUvQixLQUFwQjs7QUFFQTtBQUNBO0FBQ0E7QUFDQSxVQUFJNkIsZ0JBQWdCakMsV0FBV2lDLGVBQWUsQ0FBMUIsRUFBNkJmLEtBQWpELEVBQXdEO0FBQ3RELFlBQUlxQixNQUFNdkMsV0FBV2lDLGVBQWUsQ0FBMUIsQ0FBVjtBQUNBakMsbUJBQVdpQyxlQUFlLENBQTFCLElBQStCakMsV0FBV2lDLFlBQVgsQ0FBL0I7QUFDQWpDLG1CQUFXaUMsWUFBWCxJQUEyQk0sR0FBM0I7QUFDRDtBQUNGO0FBQ0Y7O0FBRUQ7QUFDQTtBQUNBO0FBQ0EsTUFBSUMsZ0JBQWdCeEMsV0FBV2tDLGVBQWUsQ0FBMUIsQ0FBcEI7QUFDQSxNQUFJQSxlQUFlLENBQWYsSUFDRyxPQUFPTSxjQUFjckQsS0FBckIsS0FBK0IsUUFEbEMsS0FFSXFELGNBQWN0QixLQUFkLElBQXVCc0IsY0FBY3JCLE9BRnpDLEtBR0d2QyxLQUFLMkMsTUFBTCxDQUFZLEVBQVosRUFBZ0JpQixjQUFjckQsS0FBOUIsQ0FIUCxFQUc2QztBQUMzQ2EsZUFBV2tDLGVBQWUsQ0FBMUIsRUFBNkIvQyxLQUE3QixJQUFzQ3FELGNBQWNyRCxLQUFwRDtBQUNBYSxlQUFXeUMsR0FBWDtBQUNEOztBQUVELFNBQU96QyxVQUFQO0FBQ0Q7O0FBRUQsU0FBU1ksU0FBVCxDQUFtQjhCLElBQW5CLEVBQXlCO0FBQ3ZCLFNBQU8sRUFBRTNDLFFBQVEyQyxLQUFLM0MsTUFBZixFQUF1QkMsWUFBWTBDLEtBQUsxQyxVQUFMLENBQWdCb0MsS0FBaEIsQ0FBc0IsQ0FBdEIsQ0FBbkMsRUFBUDtBQUNEIiwiZmlsZSI6ImJhc2UuanMiLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgZGVmYXVsdCBmdW5jdGlvbiBEaWZmKCkge31cblxuRGlmZi5wcm90b3R5cGUgPSB7XG4gIGRpZmYob2xkU3RyaW5nLCBuZXdTdHJpbmcsIG9wdGlvbnMgPSB7fSkge1xuICAgIGxldCBjYWxsYmFjayA9IG9wdGlvbnMuY2FsbGJhY2s7XG4gICAgaWYgKHR5cGVvZiBvcHRpb25zID09PSAnZnVuY3Rpb24nKSB7XG4gICAgICBjYWxsYmFjayA9IG9wdGlvbnM7XG4gICAgICBvcHRpb25zID0ge307XG4gICAgfVxuICAgIHRoaXMub3B0aW9ucyA9IG9wdGlvbnM7XG5cbiAgICBsZXQgc2VsZiA9IHRoaXM7XG5cbiAgICBmdW5jdGlvbiBkb25lKHZhbHVlKSB7XG4gICAgICBpZiAoY2FsbGJhY2spIHtcbiAgICAgICAgc2V0VGltZW91dChmdW5jdGlvbigpIHsgY2FsbGJhY2sodW5kZWZpbmVkLCB2YWx1ZSk7IH0sIDApO1xuICAgICAgICByZXR1cm4gdHJ1ZTtcbiAgICAgIH0gZWxzZSB7XG4gICAgICAgIHJldHVybiB2YWx1ZTtcbiAgICAgIH1cbiAgICB9XG5cbiAgICAvLyBBbGxvdyBzdWJjbGFzc2VzIHRvIG1hc3NhZ2UgdGhlIGlucHV0IHByaW9yIHRvIHJ1bm5pbmdcbiAgICBvbGRTdHJpbmcgPSB0aGlzLmNhc3RJbnB1dChvbGRTdHJpbmcpO1xuICAgIG5ld1N0cmluZyA9IHRoaXMuY2FzdElucHV0KG5ld1N0cmluZyk7XG5cbiAgICBvbGRTdHJpbmcgPSB0aGlzLnJlbW92ZUVtcHR5KHRoaXMudG9rZW5pemUob2xkU3RyaW5nKSk7XG4gICAgbmV3U3RyaW5nID0gdGhpcy5yZW1vdmVFbXB0eSh0aGlzLnRva2VuaXplKG5ld1N0cmluZykpO1xuXG4gICAgbGV0IG5ld0xlbiA9IG5ld1N0cmluZy5sZW5ndGgsIG9sZExlbiA9IG9sZFN0cmluZy5sZW5ndGg7XG4gICAgbGV0IGVkaXRMZW5ndGggPSAxO1xuICAgIGxldCBtYXhFZGl0TGVuZ3RoID0gbmV3TGVuICsgb2xkTGVuO1xuICAgIGxldCBiZXN0UGF0aCA9IFt7IG5ld1BvczogLTEsIGNvbXBvbmVudHM6IFtdIH1dO1xuXG4gICAgLy8gU2VlZCBlZGl0TGVuZ3RoID0gMCwgaS5lLiB0aGUgY29udGVudCBzdGFydHMgd2l0aCB0aGUgc2FtZSB2YWx1ZXNcbiAgICBsZXQgb2xkUG9zID0gdGhpcy5leHRyYWN0Q29tbW9uKGJlc3RQYXRoWzBdLCBuZXdTdHJpbmcsIG9sZFN0cmluZywgMCk7XG4gICAgaWYgKGJlc3RQYXRoWzBdLm5ld1BvcyArIDEgPj0gbmV3TGVuICYmIG9sZFBvcyArIDEgPj0gb2xkTGVuKSB7XG4gICAgICAvLyBJZGVudGl0eSBwZXIgdGhlIGVxdWFsaXR5IGFuZCB0b2tlbml6ZXJcbiAgICAgIHJldHVybiBkb25lKFt7dmFsdWU6IHRoaXMuam9pbihuZXdTdHJpbmcpLCBjb3VudDogbmV3U3RyaW5nLmxlbmd0aH1dKTtcbiAgICB9XG5cbiAgICAvLyBNYWluIHdvcmtlciBtZXRob2QuIGNoZWNrcyBhbGwgcGVybXV0YXRpb25zIG9mIGEgZ2l2ZW4gZWRpdCBsZW5ndGggZm9yIGFjY2VwdGFuY2UuXG4gICAgZnVuY3Rpb24gZXhlY0VkaXRMZW5ndGgoKSB7XG4gICAgICBmb3IgKGxldCBkaWFnb25hbFBhdGggPSAtMSAqIGVkaXRMZW5ndGg7IGRpYWdvbmFsUGF0aCA8PSBlZGl0TGVuZ3RoOyBkaWFnb25hbFBhdGggKz0gMikge1xuICAgICAgICBsZXQgYmFzZVBhdGg7XG4gICAgICAgIGxldCBhZGRQYXRoID0gYmVzdFBhdGhbZGlhZ29uYWxQYXRoIC0gMV0sXG4gICAgICAgICAgICByZW1vdmVQYXRoID0gYmVzdFBhdGhbZGlhZ29uYWxQYXRoICsgMV0sXG4gICAgICAgICAgICBvbGRQb3MgPSAocmVtb3ZlUGF0aCA/IHJlbW92ZVBhdGgubmV3UG9zIDogMCkgLSBkaWFnb25hbFBhdGg7XG4gICAgICAgIGlmIChhZGRQYXRoKSB7XG4gICAgICAgICAgLy8gTm8gb25lIGVsc2UgaXMgZ29pbmcgdG8gYXR0ZW1wdCB0byB1c2UgdGhpcyB2YWx1ZSwgY2xlYXIgaXRcbiAgICAgICAgICBiZXN0UGF0aFtkaWFnb25hbFBhdGggLSAxXSA9IHVuZGVmaW5lZDtcbiAgICAgICAgfVxuXG4gICAgICAgIGxldCBjYW5BZGQgPSBhZGRQYXRoICYmIGFkZFBhdGgubmV3UG9zICsgMSA8IG5ld0xlbixcbiAgICAgICAgICAgIGNhblJlbW92ZSA9IHJlbW92ZVBhdGggJiYgMCA8PSBvbGRQb3MgJiYgb2xkUG9zIDwgb2xkTGVuO1xuICAgICAgICBpZiAoIWNhbkFkZCAmJiAhY2FuUmVtb3ZlKSB7XG4gICAgICAgICAgLy8gSWYgdGhpcyBwYXRoIGlzIGEgdGVybWluYWwgdGhlbiBwcnVuZVxuICAgICAgICAgIGJlc3RQYXRoW2RpYWdvbmFsUGF0aF0gPSB1bmRlZmluZWQ7XG4gICAgICAgICAgY29udGludWU7XG4gICAgICAgIH1cblxuICAgICAgICAvLyBTZWxlY3QgdGhlIGRpYWdvbmFsIHRoYXQgd2Ugd2FudCB0byBicmFuY2ggZnJvbS4gV2Ugc2VsZWN0IHRoZSBwcmlvclxuICAgICAgICAvLyBwYXRoIHdob3NlIHBvc2l0aW9uIGluIHRoZSBuZXcgc3RyaW5nIGlzIHRoZSBmYXJ0aGVzdCBmcm9tIHRoZSBvcmlnaW5cbiAgICAgICAgLy8gYW5kIGRvZXMgbm90IHBhc3MgdGhlIGJvdW5kcyBvZiB0aGUgZGlmZiBncmFwaFxuICAgICAgICBpZiAoIWNhbkFkZCB8fCAoY2FuUmVtb3ZlICYmIGFkZFBhdGgubmV3UG9zIDwgcmVtb3ZlUGF0aC5uZXdQb3MpKSB7XG4gICAgICAgICAgYmFzZVBhdGggPSBjbG9uZVBhdGgocmVtb3ZlUGF0aCk7XG4gICAgICAgICAgc2VsZi5wdXNoQ29tcG9uZW50KGJhc2VQYXRoLmNvbXBvbmVudHMsIHVuZGVmaW5lZCwgdHJ1ZSk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgYmFzZVBhdGggPSBhZGRQYXRoOyAgIC8vIE5vIG5lZWQgdG8gY2xvbmUsIHdlJ3ZlIHB1bGxlZCBpdCBmcm9tIHRoZSBsaXN0XG4gICAgICAgICAgYmFzZVBhdGgubmV3UG9zKys7XG4gICAgICAgICAgc2VsZi5wdXNoQ29tcG9uZW50KGJhc2VQYXRoLmNvbXBvbmVudHMsIHRydWUsIHVuZGVmaW5lZCk7XG4gICAgICAgIH1cblxuICAgICAgICBvbGRQb3MgPSBzZWxmLmV4dHJhY3RDb21tb24oYmFzZVBhdGgsIG5ld1N0cmluZywgb2xkU3RyaW5nLCBkaWFnb25hbFBhdGgpO1xuXG4gICAgICAgIC8vIElmIHdlIGhhdmUgaGl0IHRoZSBlbmQgb2YgYm90aCBzdHJpbmdzLCB0aGVuIHdlIGFyZSBkb25lXG4gICAgICAgIGlmIChiYXNlUGF0aC5uZXdQb3MgKyAxID49IG5ld0xlbiAmJiBvbGRQb3MgKyAxID49IG9sZExlbikge1xuICAgICAgICAgIHJldHVybiBkb25lKGJ1aWxkVmFsdWVzKHNlbGYsIGJhc2VQYXRoLmNvbXBvbmVudHMsIG5ld1N0cmluZywgb2xkU3RyaW5nLCBzZWxmLnVzZUxvbmdlc3RUb2tlbikpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIC8vIE90aGVyd2lzZSB0cmFjayB0aGlzIHBhdGggYXMgYSBwb3RlbnRpYWwgY2FuZGlkYXRlIGFuZCBjb250aW51ZS5cbiAgICAgICAgICBiZXN0UGF0aFtkaWFnb25hbFBhdGhdID0gYmFzZVBhdGg7XG4gICAgICAgIH1cbiAgICAgIH1cblxuICAgICAgZWRpdExlbmd0aCsrO1xuICAgIH1cblxuICAgIC8vIFBlcmZvcm1zIHRoZSBsZW5ndGggb2YgZWRpdCBpdGVyYXRpb24uIElzIGEgYml0IGZ1Z2x5IGFzIHRoaXMgaGFzIHRvIHN1cHBvcnQgdGhlXG4gICAgLy8gc3luYyBhbmQgYXN5bmMgbW9kZSB3aGljaCBpcyBuZXZlciBmdW4uIExvb3BzIG92ZXIgZXhlY0VkaXRMZW5ndGggdW50aWwgYSB2YWx1ZVxuICAgIC8vIGlzIHByb2R1Y2VkLlxuICAgIGlmIChjYWxsYmFjaykge1xuICAgICAgKGZ1bmN0aW9uIGV4ZWMoKSB7XG4gICAgICAgIHNldFRpbWVvdXQoZnVuY3Rpb24oKSB7XG4gICAgICAgICAgLy8gVGhpcyBzaG91bGQgbm90IGhhcHBlbiwgYnV0IHdlIHdhbnQgdG8gYmUgc2FmZS5cbiAgICAgICAgICAvKiBpc3RhbmJ1bCBpZ25vcmUgbmV4dCAqL1xuICAgICAgICAgIGlmIChlZGl0TGVuZ3RoID4gbWF4RWRpdExlbmd0aCkge1xuICAgICAgICAgICAgcmV0dXJuIGNhbGxiYWNrKCk7XG4gICAgICAgICAgfVxuXG4gICAgICAgICAgaWYgKCFleGVjRWRpdExlbmd0aCgpKSB7XG4gICAgICAgICAgICBleGVjKCk7XG4gICAgICAgICAgfVxuICAgICAgICB9LCAwKTtcbiAgICAgIH0oKSk7XG4gICAgfSBlbHNlIHtcbiAgICAgIHdoaWxlIChlZGl0TGVuZ3RoIDw9IG1heEVkaXRMZW5ndGgpIHtcbiAgICAgICAgbGV0IHJldCA9IGV4ZWNFZGl0TGVuZ3RoKCk7XG4gICAgICAgIGlmIChyZXQpIHtcbiAgICAgICAgICByZXR1cm4gcmV0O1xuICAgICAgICB9XG4gICAgICB9XG4gICAgfVxuICB9LFxuXG4gIHB1c2hDb21wb25lbnQoY29tcG9uZW50cywgYWRkZWQsIHJlbW92ZWQpIHtcbiAgICBsZXQgbGFzdCA9IGNvbXBvbmVudHNbY29tcG9uZW50cy5sZW5ndGggLSAxXTtcbiAgICBpZiAobGFzdCAmJiBsYXN0LmFkZGVkID09PSBhZGRlZCAmJiBsYXN0LnJlbW92ZWQgPT09IHJlbW92ZWQpIHtcbiAgICAgIC8vIFdlIG5lZWQgdG8gY2xvbmUgaGVyZSBhcyB0aGUgY29tcG9uZW50IGNsb25lIG9wZXJhdGlvbiBpcyBqdXN0XG4gICAgICAvLyBhcyBzaGFsbG93IGFycmF5IGNsb25lXG4gICAgICBjb21wb25lbnRzW2NvbXBvbmVudHMubGVuZ3RoIC0gMV0gPSB7Y291bnQ6IGxhc3QuY291bnQgKyAxLCBhZGRlZDogYWRkZWQsIHJlbW92ZWQ6IHJlbW92ZWQgfTtcbiAgICB9IGVsc2Uge1xuICAgICAgY29tcG9uZW50cy5wdXNoKHtjb3VudDogMSwgYWRkZWQ6IGFkZGVkLCByZW1vdmVkOiByZW1vdmVkIH0pO1xuICAgIH1cbiAgfSxcbiAgZXh0cmFjdENvbW1vbihiYXNlUGF0aCwgbmV3U3RyaW5nLCBvbGRTdHJpbmcsIGRpYWdvbmFsUGF0aCkge1xuICAgIGxldCBuZXdMZW4gPSBuZXdTdHJpbmcubGVuZ3RoLFxuICAgICAgICBvbGRMZW4gPSBvbGRTdHJpbmcubGVuZ3RoLFxuICAgICAgICBuZXdQb3MgPSBiYXNlUGF0aC5uZXdQb3MsXG4gICAgICAgIG9sZFBvcyA9IG5ld1BvcyAtIGRpYWdvbmFsUGF0aCxcblxuICAgICAgICBjb21tb25Db3VudCA9IDA7XG4gICAgd2hpbGUgKG5ld1BvcyArIDEgPCBuZXdMZW4gJiYgb2xkUG9zICsgMSA8IG9sZExlbiAmJiB0aGlzLmVxdWFscyhuZXdTdHJpbmdbbmV3UG9zICsgMV0sIG9sZFN0cmluZ1tvbGRQb3MgKyAxXSkpIHtcbiAgICAgIG5ld1BvcysrO1xuICAgICAgb2xkUG9zKys7XG4gICAgICBjb21tb25Db3VudCsrO1xuICAgIH1cblxuICAgIGlmIChjb21tb25Db3VudCkge1xuICAgICAgYmFzZVBhdGguY29tcG9uZW50cy5wdXNoKHtjb3VudDogY29tbW9uQ291bnR9KTtcbiAgICB9XG5cbiAgICBiYXNlUGF0aC5uZXdQb3MgPSBuZXdQb3M7XG4gICAgcmV0dXJuIG9sZFBvcztcbiAgfSxcblxuICBlcXVhbHMobGVmdCwgcmlnaHQpIHtcbiAgICBpZiAodGhpcy5vcHRpb25zLmNvbXBhcmF0b3IpIHtcbiAgICAgIHJldHVybiB0aGlzLm9wdGlvbnMuY29tcGFyYXRvcihsZWZ0LCByaWdodCk7XG4gICAgfSBlbHNlIHtcbiAgICAgIHJldHVybiBsZWZ0ID09PSByaWdodFxuICAgICAgICB8fCAodGhpcy5vcHRpb25zLmlnbm9yZUNhc2UgJiYgbGVmdC50b0xvd2VyQ2FzZSgpID09PSByaWdodC50b0xvd2VyQ2FzZSgpKTtcbiAgICB9XG4gIH0sXG4gIHJlbW92ZUVtcHR5KGFycmF5KSB7XG4gICAgbGV0IHJldCA9IFtdO1xuICAgIGZvciAobGV0IGkgPSAwOyBpIDwgYXJyYXkubGVuZ3RoOyBpKyspIHtcbiAgICAgIGlmIChhcnJheVtpXSkge1xuICAgICAgICByZXQucHVzaChhcnJheVtpXSk7XG4gICAgICB9XG4gICAgfVxuICAgIHJldHVybiByZXQ7XG4gIH0sXG4gIGNhc3RJbnB1dCh2YWx1ZSkge1xuICAgIHJldHVybiB2YWx1ZTtcbiAgfSxcbiAgdG9rZW5pemUodmFsdWUpIHtcbiAgICByZXR1cm4gdmFsdWUuc3BsaXQoJycpO1xuICB9LFxuICBqb2luKGNoYXJzKSB7XG4gICAgcmV0dXJuIGNoYXJzLmpvaW4oJycpO1xuICB9XG59O1xuXG5mdW5jdGlvbiBidWlsZFZhbHVlcyhkaWZmLCBjb21wb25lbnRzLCBuZXdTdHJpbmcsIG9sZFN0cmluZywgdXNlTG9uZ2VzdFRva2VuKSB7XG4gIGxldCBjb21wb25lbnRQb3MgPSAwLFxuICAgICAgY29tcG9uZW50TGVuID0gY29tcG9uZW50cy5sZW5ndGgsXG4gICAgICBuZXdQb3MgPSAwLFxuICAgICAgb2xkUG9zID0gMDtcblxuICBmb3IgKDsgY29tcG9uZW50UG9zIDwgY29tcG9uZW50TGVuOyBjb21wb25lbnRQb3MrKykge1xuICAgIGxldCBjb21wb25lbnQgPSBjb21wb25lbnRzW2NvbXBvbmVudFBvc107XG4gICAgaWYgKCFjb21wb25lbnQucmVtb3ZlZCkge1xuICAgICAgaWYgKCFjb21wb25lbnQuYWRkZWQgJiYgdXNlTG9uZ2VzdFRva2VuKSB7XG4gICAgICAgIGxldCB2YWx1ZSA9IG5ld1N0cmluZy5zbGljZShuZXdQb3MsIG5ld1BvcyArIGNvbXBvbmVudC5jb3VudCk7XG4gICAgICAgIHZhbHVlID0gdmFsdWUubWFwKGZ1bmN0aW9uKHZhbHVlLCBpKSB7XG4gICAgICAgICAgbGV0IG9sZFZhbHVlID0gb2xkU3RyaW5nW29sZFBvcyArIGldO1xuICAgICAgICAgIHJldHVybiBvbGRWYWx1ZS5sZW5ndGggPiB2YWx1ZS5sZW5ndGggPyBvbGRWYWx1ZSA6IHZhbHVlO1xuICAgICAgICB9KTtcblxuICAgICAgICBjb21wb25lbnQudmFsdWUgPSBkaWZmLmpvaW4odmFsdWUpO1xuICAgICAgfSBlbHNlIHtcbiAgICAgICAgY29tcG9uZW50LnZhbHVlID0gZGlmZi5qb2luKG5ld1N0cmluZy5zbGljZShuZXdQb3MsIG5ld1BvcyArIGNvbXBvbmVudC5jb3VudCkpO1xuICAgICAgfVxuICAgICAgbmV3UG9zICs9IGNvbXBvbmVudC5jb3VudDtcblxuICAgICAgLy8gQ29tbW9uIGNhc2VcbiAgICAgIGlmICghY29tcG9uZW50LmFkZGVkKSB7XG4gICAgICAgIG9sZFBvcyArPSBjb21wb25lbnQuY291bnQ7XG4gICAgICB9XG4gICAgfSBlbHNlIHtcbiAgICAgIGNvbXBvbmVudC52YWx1ZSA9IGRpZmYuam9pbihvbGRTdHJpbmcuc2xpY2Uob2xkUG9zLCBvbGRQb3MgKyBjb21wb25lbnQuY291bnQpKTtcbiAgICAgIG9sZFBvcyArPSBjb21wb25lbnQuY291bnQ7XG5cbiAgICAgIC8vIFJldmVyc2UgYWRkIGFuZCByZW1vdmUgc28gcmVtb3ZlcyBhcmUgb3V0cHV0IGZpcnN0IHRvIG1hdGNoIGNvbW1vbiBjb252ZW50aW9uXG4gICAgICAvLyBUaGUgZGlmZmluZyBhbGdvcml0aG0gaXMgdGllZCB0byBhZGQgdGhlbiByZW1vdmUgb3V0cHV0IGFuZCB0aGlzIGlzIHRoZSBzaW1wbGVzdFxuICAgICAgLy8gcm91dGUgdG8gZ2V0IHRoZSBkZXNpcmVkIG91dHB1dCB3aXRoIG1pbmltYWwgb3ZlcmhlYWQuXG4gICAgICBpZiAoY29tcG9uZW50UG9zICYmIGNvbXBvbmVudHNbY29tcG9uZW50UG9zIC0gMV0uYWRkZWQpIHtcbiAgICAgICAgbGV0IHRtcCA9IGNvbXBvbmVudHNbY29tcG9uZW50UG9zIC0gMV07XG4gICAgICAgIGNvbXBvbmVudHNbY29tcG9uZW50UG9zIC0gMV0gPSBjb21wb25lbnRzW2NvbXBvbmVudFBvc107XG4gICAgICAgIGNvbXBvbmVudHNbY29tcG9uZW50UG9zXSA9IHRtcDtcbiAgICAgIH1cbiAgICB9XG4gIH1cblxuICAvLyBTcGVjaWFsIGNhc2UgaGFuZGxlIGZvciB3aGVuIG9uZSB0ZXJtaW5hbCBpcyBpZ25vcmVkIChpLmUuIHdoaXRlc3BhY2UpLlxuICAvLyBGb3IgdGhpcyBjYXNlIHdlIG1lcmdlIHRoZSB0ZXJtaW5hbCBpbnRvIHRoZSBwcmlvciBzdHJpbmcgYW5kIGRyb3AgdGhlIGNoYW5nZS5cbiAgLy8gVGhpcyBpcyBvbmx5IGF2YWlsYWJsZSBmb3Igc3RyaW5nIG1vZGUuXG4gIGxldCBsYXN0Q29tcG9uZW50ID0gY29tcG9uZW50c1tjb21wb25lbnRMZW4gLSAxXTtcbiAgaWYgKGNvbXBvbmVudExlbiA+IDFcbiAgICAgICYmIHR5cGVvZiBsYXN0Q29tcG9uZW50LnZhbHVlID09PSAnc3RyaW5nJ1xuICAgICAgJiYgKGxhc3RDb21wb25lbnQuYWRkZWQgfHwgbGFzdENvbXBvbmVudC5yZW1vdmVkKVxuICAgICAgJiYgZGlmZi5lcXVhbHMoJycsIGxhc3RDb21wb25lbnQudmFsdWUpKSB7XG4gICAgY29tcG9uZW50c1tjb21wb25lbnRMZW4gLSAyXS52YWx1ZSArPSBsYXN0Q29tcG9uZW50LnZhbHVlO1xuICAgIGNvbXBvbmVudHMucG9wKCk7XG4gIH1cblxuICByZXR1cm4gY29tcG9uZW50cztcbn1cblxuZnVuY3Rpb24gY2xvbmVQYXRoKHBhdGgpIHtcbiAgcmV0dXJuIHsgbmV3UG9zOiBwYXRoLm5ld1BvcywgY29tcG9uZW50czogcGF0aC5jb21wb25lbnRzLnNsaWNlKDApIH07XG59XG4iXX0= 31676 31677 31678 /***/ }), 31679 /* 2 */ 31680 /***/ (function(module, exports, __webpack_require__) { 31681 31682 /*istanbul ignore start*/'use strict'; 31683 31684 exports.__esModule = true; 31685 exports.characterDiff = undefined; 31686 exports. /*istanbul ignore end*/diffChars = diffChars; 31687 31688 var /*istanbul ignore start*/_base = __webpack_require__(1) /*istanbul ignore end*/; 31689 31690 /*istanbul ignore start*/var _base2 = _interopRequireDefault(_base); 31691 31692 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } 31693 31694 /*istanbul ignore end*/var characterDiff = /*istanbul ignore start*/exports. /*istanbul ignore end*/characterDiff = new /*istanbul ignore start*/_base2['default'] /*istanbul ignore end*/(); 31695 function diffChars(oldStr, newStr, options) { 31696 return characterDiff.diff(oldStr, newStr, options); 31697 } 31698 //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9kaWZmL2NoYXJhY3Rlci5qcyJdLCJuYW1lcyI6WyJkaWZmQ2hhcnMiLCJjaGFyYWN0ZXJEaWZmIiwib2xkU3RyIiwibmV3U3RyIiwib3B0aW9ucyIsImRpZmYiXSwibWFwcGluZ3MiOiI7Ozs7Z0NBR2dCQSxTLEdBQUFBLFM7O0FBSGhCOzs7Ozs7dUJBRU8sSUFBTUMseUZBQWdCLHdFQUF0QjtBQUNBLFNBQVNELFNBQVQsQ0FBbUJFLE1BQW5CLEVBQTJCQyxNQUEzQixFQUFtQ0MsT0FBbkMsRUFBNEM7QUFBRSxTQUFPSCxjQUFjSSxJQUFkLENBQW1CSCxNQUFuQixFQUEyQkMsTUFBM0IsRUFBbUNDLE9BQW5DLENBQVA7QUFBcUQiLCJmaWxlIjoiY2hhcmFjdGVyLmpzIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IERpZmYgZnJvbSAnLi9iYXNlJztcblxuZXhwb3J0IGNvbnN0IGNoYXJhY3RlckRpZmYgPSBuZXcgRGlmZigpO1xuZXhwb3J0IGZ1bmN0aW9uIGRpZmZDaGFycyhvbGRTdHIsIG5ld1N0ciwgb3B0aW9ucykgeyByZXR1cm4gY2hhcmFjdGVyRGlmZi5kaWZmKG9sZFN0ciwgbmV3U3RyLCBvcHRpb25zKTsgfVxuIl19 31699 31700 31701 /***/ }), 31702 /* 3 */ 31703 /***/ (function(module, exports, __webpack_require__) { 31704 31705 /*istanbul ignore start*/'use strict'; 31706 31707 exports.__esModule = true; 31708 exports.wordDiff = undefined; 31709 exports. /*istanbul ignore end*/diffWords = diffWords; 31710 /*istanbul ignore start*/exports. /*istanbul ignore end*/diffWordsWithSpace = diffWordsWithSpace; 31711 31712 var /*istanbul ignore start*/_base = __webpack_require__(1) /*istanbul ignore end*/; 31713 31714 /*istanbul ignore start*/var _base2 = _interopRequireDefault(_base); 31715 31716 /*istanbul ignore end*/var /*istanbul ignore start*/_params = __webpack_require__(4) /*istanbul ignore end*/; 31717 31718 /*istanbul ignore start*/function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } 31719 31720 /*istanbul ignore end*/ // Based on https://en.wikipedia.org/wiki/Latin_script_in_Unicode 31721 // 31722 // Ranges and exceptions: 31723 // Latin-1 Supplement, 0080–00FF 31724 // - U+00D7 × Multiplication sign 31725 // - U+00F7 ÷ Division sign 31726 // Latin Extended-A, 0100–017F 31727 // Latin Extended-B, 0180–024F 31728 // IPA Extensions, 0250–02AF 31729 // Spacing Modifier Letters, 02B0–02FF 31730 // - U+02C7 ˇ ˇ Caron 31731 // - U+02D8 ˘ ˘ Breve 31732 // - U+02D9 ˙ ˙ Dot Above 31733 // - U+02DA ˚ ˚ Ring Above 31734 // - U+02DB ˛ ˛ Ogonek 31735 // - U+02DC ˜ ˜ Small Tilde 31736 // - U+02DD ˝ ˝ Double Acute Accent 31737 // Latin Extended Additional, 1E00–1EFF 31738 var extendedWordChars = /^[A-Za-z\xC0-\u02C6\u02C8-\u02D7\u02DE-\u02FF\u1E00-\u1EFF]+$/; 31739 31740 var reWhitespace = /\S/; 31741 31742 var wordDiff = /*istanbul ignore start*/exports. /*istanbul ignore end*/wordDiff = new /*istanbul ignore start*/_base2['default'] /*istanbul ignore end*/(); 31743 wordDiff.equals = function (left, right) { 31744 if (this.options.ignoreCase) { 31745 left = left.toLowerCase(); 31746 right = right.toLowerCase(); 31747 } 31748 return left === right || this.options.ignoreWhitespace && !reWhitespace.test(left) && !reWhitespace.test(right); 31749 }; 31750 wordDiff.tokenize = function (value) { 31751 var tokens = value.split(/(\s+|\b)/); 31752 31753 // Join the boundary splits that we do not consider to be boundaries. This is primarily the extended Latin character set. 31754 for (var i = 0; i < tokens.length - 1; i++) { 31755 // If we have an empty string in the next field and we have only word chars before and after, merge 31756 if (!tokens[i + 1] && tokens[i + 2] && extendedWordChars.test(tokens[i]) && extendedWordChars.test(tokens[i + 2])) { 31757 tokens[i] += tokens[i + 2]; 31758 tokens.splice(i + 1, 2); 31759 i--; 31760 } 31761 } 31762 31763 return tokens; 31764 }; 31765 31766 function diffWords(oldStr, newStr, options) { 31767 options = /*istanbul ignore start*/(0, _params.generateOptions) /*istanbul ignore end*/(options, { ignoreWhitespace: true }); 31768 return wordDiff.diff(oldStr, newStr, options); 31769 } 31770 31771 function diffWordsWithSpace(oldStr, newStr, options) { 31772 return wordDiff.diff(oldStr, newStr, options); 31773 } 31774 //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9kaWZmL3dvcmQuanMiXSwibmFtZXMiOlsiZGlmZldvcmRzIiwiZGlmZldvcmRzV2l0aFNwYWNlIiwiZXh0ZW5kZWRXb3JkQ2hhcnMiLCJyZVdoaXRlc3BhY2UiLCJ3b3JkRGlmZiIsImVxdWFscyIsImxlZnQiLCJyaWdodCIsIm9wdGlvbnMiLCJpZ25vcmVDYXNlIiwidG9Mb3dlckNhc2UiLCJpZ25vcmVXaGl0ZXNwYWNlIiwidGVzdCIsInRva2VuaXplIiwidmFsdWUiLCJ0b2tlbnMiLCJzcGxpdCIsImkiLCJsZW5ndGgiLCJzcGxpY2UiLCJvbGRTdHIiLCJuZXdTdHIiLCJkaWZmIl0sIm1hcHBpbmdzIjoiOzs7O2dDQW1EZ0JBLFMsR0FBQUEsUzt5REFLQUMsa0IsR0FBQUEsa0I7O0FBeERoQjs7Ozt1QkFDQTs7Ozt3QkFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSxJQUFNQyxvQkFBb0IsK0RBQTFCOztBQUVBLElBQU1DLGVBQWUsSUFBckI7O0FBRU8sSUFBTUMsK0VBQVcsd0VBQWpCO0FBQ1BBLFNBQVNDLE1BQVQsR0FBa0IsVUFBU0MsSUFBVCxFQUFlQyxLQUFmLEVBQXNCO0FBQ3RDLE1BQUksS0FBS0MsT0FBTCxDQUFhQyxVQUFqQixFQUE2QjtBQUMzQkgsV0FBT0EsS0FBS0ksV0FBTCxFQUFQO0FBQ0FILFlBQVFBLE1BQU1HLFdBQU4sRUFBUjtBQUNEO0FBQ0QsU0FBT0osU0FBU0MsS0FBVCxJQUFtQixLQUFLQyxPQUFMLENBQWFHLGdCQUFiLElBQWlDLENBQUNSLGFBQWFTLElBQWIsQ0FBa0JOLElBQWxCLENBQWxDLElBQTZELENBQUNILGFBQWFTLElBQWIsQ0FBa0JMLEtBQWxCLENBQXhGO0FBQ0QsQ0FORDtBQU9BSCxTQUFTUyxRQUFULEdBQW9CLFVBQVNDLEtBQVQsRUFBZ0I7QUFDbEMsTUFBSUMsU0FBU0QsTUFBTUUsS0FBTixDQUFZLFVBQVosQ0FBYjs7QUFFQTtBQUNBLE9BQUssSUFBSUMsSUFBSSxDQUFiLEVBQWdCQSxJQUFJRixPQUFPRyxNQUFQLEdBQWdCLENBQXBDLEVBQXVDRCxHQUF2QyxFQUE0QztBQUMxQztBQUNBLFFBQUksQ0FBQ0YsT0FBT0UsSUFBSSxDQUFYLENBQUQsSUFBa0JGLE9BQU9FLElBQUksQ0FBWCxDQUFsQixJQUNLZixrQkFBa0JVLElBQWxCLENBQXVCRyxPQUFPRSxDQUFQLENBQXZCLENBREwsSUFFS2Ysa0JBQWtCVSxJQUFsQixDQUF1QkcsT0FBT0UsSUFBSSxDQUFYLENBQXZCLENBRlQsRUFFZ0Q7QUFDOUNGLGFBQU9FLENBQVAsS0FBYUYsT0FBT0UsSUFBSSxDQUFYLENBQWI7QUFDQUYsYUFBT0ksTUFBUCxDQUFjRixJQUFJLENBQWxCLEVBQXFCLENBQXJCO0FBQ0FBO0FBQ0Q7QUFDRjs7QUFFRCxTQUFPRixNQUFQO0FBQ0QsQ0FoQkQ7O0FBa0JPLFNBQVNmLFNBQVQsQ0FBbUJvQixNQUFuQixFQUEyQkMsTUFBM0IsRUFBbUNiLE9BQW5DLEVBQTRDO0FBQ2pEQSxZQUFVLDhFQUFnQkEsT0FBaEIsRUFBeUIsRUFBQ0csa0JBQWtCLElBQW5CLEVBQXpCLENBQVY7QUFDQSxTQUFPUCxTQUFTa0IsSUFBVCxDQUFjRixNQUFkLEVBQXNCQyxNQUF0QixFQUE4QmIsT0FBOUIsQ0FBUDtBQUNEOztBQUVNLFNBQVNQLGtCQUFULENBQTRCbUIsTUFBNUIsRUFBb0NDLE1BQXBDLEVBQTRDYixPQUE1QyxFQUFxRDtBQUMxRCxTQUFPSixTQUFTa0IsSUFBVCxDQUFjRixNQUFkLEVBQXNCQyxNQUF0QixFQUE4QmIsT0FBOUIsQ0FBUDtBQUNEIiwiZmlsZSI6IndvcmQuanMiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgRGlmZiBmcm9tICcuL2Jhc2UnO1xuaW1wb3J0IHtnZW5lcmF0ZU9wdGlvbnN9IGZyb20gJy4uL3V0aWwvcGFyYW1zJztcblxuLy8gQmFzZWQgb24gaHR0cHM6Ly9lbi53aWtpcGVkaWEub3JnL3dpa2kvTGF0aW5fc2NyaXB0X2luX1VuaWNvZGVcbi8vXG4vLyBSYW5nZXMgYW5kIGV4Y2VwdGlvbnM6XG4vLyBMYXRpbi0xIFN1cHBsZW1lbnQsIDAwODDigJMwMEZGXG4vLyAgLSBVKzAwRDcgIMOXIE11bHRpcGxpY2F0aW9uIHNpZ25cbi8vICAtIFUrMDBGNyAgw7cgRGl2aXNpb24gc2lnblxuLy8gTGF0aW4gRXh0ZW5kZWQtQSwgMDEwMOKAkzAxN0Zcbi8vIExhdGluIEV4dGVuZGVkLUIsIDAxODDigJMwMjRGXG4vLyBJUEEgRXh0ZW5zaW9ucywgMDI1MOKAkzAyQUZcbi8vIFNwYWNpbmcgTW9kaWZpZXIgTGV0dGVycywgMDJCMOKAkzAyRkZcbi8vICAtIFUrMDJDNyAgy4cgJiM3MTE7ICBDYXJvblxuLy8gIC0gVSswMkQ4ICDLmCAmIzcyODsgIEJyZXZlXG4vLyAgLSBVKzAyRDkgIMuZICYjNzI5OyAgRG90IEFib3ZlXG4vLyAgLSBVKzAyREEgIMuaICYjNzMwOyAgUmluZyBBYm92ZVxuLy8gIC0gVSswMkRCICDLmyAmIzczMTsgIE9nb25la1xuLy8gIC0gVSswMkRDICDLnCAmIzczMjsgIFNtYWxsIFRpbGRlXG4vLyAgLSBVKzAyREQgIMudICYjNzMzOyAgRG91YmxlIEFjdXRlIEFjY2VudFxuLy8gTGF0aW4gRXh0ZW5kZWQgQWRkaXRpb25hbCwgMUUwMOKAkzFFRkZcbmNvbnN0IGV4dGVuZGVkV29yZENoYXJzID0gL15bYS16QS1aXFx1e0MwfS1cXHV7RkZ9XFx1e0Q4fS1cXHV7RjZ9XFx1e0Y4fS1cXHV7MkM2fVxcdXsyQzh9LVxcdXsyRDd9XFx1ezJERX0tXFx1ezJGRn1cXHV7MUUwMH0tXFx1ezFFRkZ9XSskL3U7XG5cbmNvbnN0IHJlV2hpdGVzcGFjZSA9IC9cXFMvO1xuXG5leHBvcnQgY29uc3Qgd29yZERpZmYgPSBuZXcgRGlmZigpO1xud29yZERpZmYuZXF1YWxzID0gZnVuY3Rpb24obGVmdCwgcmlnaHQpIHtcbiAgaWYgKHRoaXMub3B0aW9ucy5pZ25vcmVDYXNlKSB7XG4gICAgbGVmdCA9IGxlZnQudG9Mb3dlckNhc2UoKTtcbiAgICByaWdodCA9IHJpZ2h0LnRvTG93ZXJDYXNlKCk7XG4gIH1cbiAgcmV0dXJuIGxlZnQgPT09IHJpZ2h0IHx8ICh0aGlzLm9wdGlvbnMuaWdub3JlV2hpdGVzcGFjZSAmJiAhcmVXaGl0ZXNwYWNlLnRlc3QobGVmdCkgJiYgIXJlV2hpdGVzcGFjZS50ZXN0KHJpZ2h0KSk7XG59O1xud29yZERpZmYudG9rZW5pemUgPSBmdW5jdGlvbih2YWx1ZSkge1xuICBsZXQgdG9rZW5zID0gdmFsdWUuc3BsaXQoLyhcXHMrfFxcYikvKTtcblxuICAvLyBKb2luIHRoZSBib3VuZGFyeSBzcGxpdHMgdGhhdCB3ZSBkbyBub3QgY29uc2lkZXIgdG8gYmUgYm91bmRhcmllcy4gVGhpcyBpcyBwcmltYXJpbHkgdGhlIGV4dGVuZGVkIExhdGluIGNoYXJhY3RlciBzZXQuXG4gIGZvciAobGV0IGkgPSAwOyBpIDwgdG9rZW5zLmxlbmd0aCAtIDE7IGkrKykge1xuICAgIC8vIElmIHdlIGhhdmUgYW4gZW1wdHkgc3RyaW5nIGluIHRoZSBuZXh0IGZpZWxkIGFuZCB3ZSBoYXZlIG9ubHkgd29yZCBjaGFycyBiZWZvcmUgYW5kIGFmdGVyLCBtZXJnZVxuICAgIGlmICghdG9rZW5zW2kgKyAxXSAmJiB0b2tlbnNbaSArIDJdXG4gICAgICAgICAgJiYgZXh0ZW5kZWRXb3JkQ2hhcnMudGVzdCh0b2tlbnNbaV0pXG4gICAgICAgICAgJiYgZXh0ZW5kZWRXb3JkQ2hhcnMudGVzdCh0b2tlbnNbaSArIDJdKSkge1xuICAgICAgdG9rZW5zW2ldICs9IHRva2Vuc1tpICsgMl07XG4gICAgICB0b2tlbnMuc3BsaWNlKGkgKyAxLCAyKTtcbiAgICAgIGktLTtcbiAgICB9XG4gIH1cblxuICByZXR1cm4gdG9rZW5zO1xufTtcblxuZXhwb3J0IGZ1bmN0aW9uIGRpZmZXb3JkcyhvbGRTdHIsIG5ld1N0ciwgb3B0aW9ucykge1xuICBvcHRpb25zID0gZ2VuZXJhdGVPcHRpb25zKG9wdGlvbnMsIHtpZ25vcmVXaGl0ZXNwYWNlOiB0cnVlfSk7XG4gIHJldHVybiB3b3JkRGlmZi5kaWZmKG9sZFN0ciwgbmV3U3RyLCBvcHRpb25zKTtcbn1cblxuZXhwb3J0IGZ1bmN0aW9uIGRpZmZXb3Jkc1dpdGhTcGFjZShvbGRTdHIsIG5ld1N0ciwgb3B0aW9ucykge1xuICByZXR1cm4gd29yZERpZmYuZGlmZihvbGRTdHIsIG5ld1N0ciwgb3B0aW9ucyk7XG59XG4iXX0= 31775 31776 31777 /***/ }), 31778 /* 4 */ 31779 /***/ (function(module, exports) { 31780 31781 /*istanbul ignore start*/'use strict'; 31782 31783 exports.__esModule = true; 31784 exports. /*istanbul ignore end*/generateOptions = generateOptions; 31785 function generateOptions(options, defaults) { 31786 if (typeof options === 'function') { 31787 defaults.callback = options; 31788 } else if (options) { 31789 for (var name in options) { 31790 /* istanbul ignore else */ 31791 if (options.hasOwnProperty(name)) { 31792 defaults[name] = options[name]; 31793 } 31794 } 31795 } 31796 return defaults; 31797 } 31798 //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy91dGlsL3BhcmFtcy5qcyJdLCJuYW1lcyI6WyJnZW5lcmF0ZU9wdGlvbnMiLCJvcHRpb25zIiwiZGVmYXVsdHMiLCJjYWxsYmFjayIsIm5hbWUiLCJoYXNPd25Qcm9wZXJ0eSJdLCJtYXBwaW5ncyI6Ijs7O2dDQUFnQkEsZSxHQUFBQSxlO0FBQVQsU0FBU0EsZUFBVCxDQUF5QkMsT0FBekIsRUFBa0NDLFFBQWxDLEVBQTRDO0FBQ2pELE1BQUksT0FBT0QsT0FBUCxLQUFtQixVQUF2QixFQUFtQztBQUNqQ0MsYUFBU0MsUUFBVCxHQUFvQkYsT0FBcEI7QUFDRCxHQUZELE1BRU8sSUFBSUEsT0FBSixFQUFhO0FBQ2xCLFNBQUssSUFBSUcsSUFBVCxJQUFpQkgsT0FBakIsRUFBMEI7QUFDeEI7QUFDQSxVQUFJQSxRQUFRSSxjQUFSLENBQXVCRCxJQUF2QixDQUFKLEVBQWtDO0FBQ2hDRixpQkFBU0UsSUFBVCxJQUFpQkgsUUFBUUcsSUFBUixDQUFqQjtBQUNEO0FBQ0Y7QUFDRjtBQUNELFNBQU9GLFFBQVA7QUFDRCIsImZpbGUiOiJwYXJhbXMuanMiLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgZnVuY3Rpb24gZ2VuZXJhdGVPcHRpb25zKG9wdGlvbnMsIGRlZmF1bHRzKSB7XG4gIGlmICh0eXBlb2Ygb3B0aW9ucyA9PT0gJ2Z1bmN0aW9uJykge1xuICAgIGRlZmF1bHRzLmNhbGxiYWNrID0gb3B0aW9ucztcbiAgfSBlbHNlIGlmIChvcHRpb25zKSB7XG4gICAgZm9yIChsZXQgbmFtZSBpbiBvcHRpb25zKSB7XG4gICAgICAvKiBpc3RhbmJ1bCBpZ25vcmUgZWxzZSAqL1xuICAgICAgaWYgKG9wdGlvbnMuaGFzT3duUHJvcGVydHkobmFtZSkpIHtcbiAgICAgICAgZGVmYXVsdHNbbmFtZV0gPSBvcHRpb25zW25hbWVdO1xuICAgICAgfVxuICAgIH1cbiAgfVxuICByZXR1cm4gZGVmYXVsdHM7XG59XG4iXX0= 31799 31800 31801 /***/ }), 31802 /* 5 */ 31803 /***/ (function(module, exports, __webpack_require__) { 31804 31805 /*istanbul ignore start*/'use strict'; 31806 31807 exports.__esModule = true; 31808 exports.lineDiff = undefined; 31809 exports. /*istanbul ignore end*/diffLines = diffLines; 31810 /*istanbul ignore start*/exports. /*istanbul ignore end*/diffTrimmedLines = diffTrimmedLines; 31811 31812 var /*istanbul ignore start*/_base = __webpack_require__(1) /*istanbul ignore end*/; 31813 31814 /*istanbul ignore start*/var _base2 = _interopRequireDefault(_base); 31815 31816 /*istanbul ignore end*/var /*istanbul ignore start*/_params = __webpack_require__(4) /*istanbul ignore end*/; 31817 31818 /*istanbul ignore start*/function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } 31819 31820 /*istanbul ignore end*/var lineDiff = /*istanbul ignore start*/exports. /*istanbul ignore end*/lineDiff = new /*istanbul ignore start*/_base2['default'] /*istanbul ignore end*/(); 31821 lineDiff.tokenize = function (value) { 31822 var retLines = [], 31823 linesAndNewlines = value.split(/(\n|\r\n)/); 31824 31825 // Ignore the final empty token that occurs if the string ends with a new line 31826 if (!linesAndNewlines[linesAndNewlines.length - 1]) { 31827 linesAndNewlines.pop(); 31828 } 31829 31830 // Merge the content and line separators into single tokens 31831 for (var i = 0; i < linesAndNewlines.length; i++) { 31832 var line = linesAndNewlines[i]; 31833 31834 if (i % 2 && !this.options.newlineIsToken) { 31835 retLines[retLines.length - 1] += line; 31836 } else { 31837 if (this.options.ignoreWhitespace) { 31838 line = line.trim(); 31839 } 31840 retLines.push(line); 31841 } 31842 } 31843 31844 return retLines; 31845 }; 31846 31847 function diffLines(oldStr, newStr, callback) { 31848 return lineDiff.diff(oldStr, newStr, callback); 31849 } 31850 function diffTrimmedLines(oldStr, newStr, callback) { 31851 var options = /*istanbul ignore start*/(0, _params.generateOptions) /*istanbul ignore end*/(callback, { ignoreWhitespace: true }); 31852 return lineDiff.diff(oldStr, newStr, options); 31853 } 31854 //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9kaWZmL2xpbmUuanMiXSwibmFtZXMiOlsiZGlmZkxpbmVzIiwiZGlmZlRyaW1tZWRMaW5lcyIsImxpbmVEaWZmIiwidG9rZW5pemUiLCJ2YWx1ZSIsInJldExpbmVzIiwibGluZXNBbmROZXdsaW5lcyIsInNwbGl0IiwibGVuZ3RoIiwicG9wIiwiaSIsImxpbmUiLCJvcHRpb25zIiwibmV3bGluZUlzVG9rZW4iLCJpZ25vcmVXaGl0ZXNwYWNlIiwidHJpbSIsInB1c2giLCJvbGRTdHIiLCJuZXdTdHIiLCJjYWxsYmFjayIsImRpZmYiXSwibWFwcGluZ3MiOiI7Ozs7Z0NBOEJnQkEsUyxHQUFBQSxTO3lEQUNBQyxnQixHQUFBQSxnQjs7QUEvQmhCOzs7O3VCQUNBOzs7O3VCQUVPLElBQU1DLCtFQUFXLHdFQUFqQjtBQUNQQSxTQUFTQyxRQUFULEdBQW9CLFVBQVNDLEtBQVQsRUFBZ0I7QUFDbEMsTUFBSUMsV0FBVyxFQUFmO0FBQUEsTUFDSUMsbUJBQW1CRixNQUFNRyxLQUFOLENBQVksV0FBWixDQUR2Qjs7QUFHQTtBQUNBLE1BQUksQ0FBQ0QsaUJBQWlCQSxpQkFBaUJFLE1BQWpCLEdBQTBCLENBQTNDLENBQUwsRUFBb0Q7QUFDbERGLHFCQUFpQkcsR0FBakI7QUFDRDs7QUFFRDtBQUNBLE9BQUssSUFBSUMsSUFBSSxDQUFiLEVBQWdCQSxJQUFJSixpQkFBaUJFLE1BQXJDLEVBQTZDRSxHQUE3QyxFQUFrRDtBQUNoRCxRQUFJQyxPQUFPTCxpQkFBaUJJLENBQWpCLENBQVg7O0FBRUEsUUFBSUEsSUFBSSxDQUFKLElBQVMsQ0FBQyxLQUFLRSxPQUFMLENBQWFDLGNBQTNCLEVBQTJDO0FBQ3pDUixlQUFTQSxTQUFTRyxNQUFULEdBQWtCLENBQTNCLEtBQWlDRyxJQUFqQztBQUNELEtBRkQsTUFFTztBQUNMLFVBQUksS0FBS0MsT0FBTCxDQUFhRSxnQkFBakIsRUFBbUM7QUFDakNILGVBQU9BLEtBQUtJLElBQUwsRUFBUDtBQUNEO0FBQ0RWLGVBQVNXLElBQVQsQ0FBY0wsSUFBZDtBQUNEO0FBQ0Y7O0FBRUQsU0FBT04sUUFBUDtBQUNELENBeEJEOztBQTBCTyxTQUFTTCxTQUFULENBQW1CaUIsTUFBbkIsRUFBMkJDLE1BQTNCLEVBQW1DQyxRQUFuQyxFQUE2QztBQUFFLFNBQU9qQixTQUFTa0IsSUFBVCxDQUFjSCxNQUFkLEVBQXNCQyxNQUF0QixFQUE4QkMsUUFBOUIsQ0FBUDtBQUFpRDtBQUNoRyxTQUFTbEIsZ0JBQVQsQ0FBMEJnQixNQUExQixFQUFrQ0MsTUFBbEMsRUFBMENDLFFBQTFDLEVBQW9EO0FBQ3pELE1BQUlQLFVBQVUsOEVBQWdCTyxRQUFoQixFQUEwQixFQUFDTCxrQkFBa0IsSUFBbkIsRUFBMUIsQ0FBZDtBQUNBLFNBQU9aLFNBQVNrQixJQUFULENBQWNILE1BQWQsRUFBc0JDLE1BQXRCLEVBQThCTixPQUE5QixDQUFQO0FBQ0QiLCJmaWxlIjoibGluZS5qcyIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBEaWZmIGZyb20gJy4vYmFzZSc7XG5pbXBvcnQge2dlbmVyYXRlT3B0aW9uc30gZnJvbSAnLi4vdXRpbC9wYXJhbXMnO1xuXG5leHBvcnQgY29uc3QgbGluZURpZmYgPSBuZXcgRGlmZigpO1xubGluZURpZmYudG9rZW5pemUgPSBmdW5jdGlvbih2YWx1ZSkge1xuICBsZXQgcmV0TGluZXMgPSBbXSxcbiAgICAgIGxpbmVzQW5kTmV3bGluZXMgPSB2YWx1ZS5zcGxpdCgvKFxcbnxcXHJcXG4pLyk7XG5cbiAgLy8gSWdub3JlIHRoZSBmaW5hbCBlbXB0eSB0b2tlbiB0aGF0IG9jY3VycyBpZiB0aGUgc3RyaW5nIGVuZHMgd2l0aCBhIG5ldyBsaW5lXG4gIGlmICghbGluZXNBbmROZXdsaW5lc1tsaW5lc0FuZE5ld2xpbmVzLmxlbmd0aCAtIDFdKSB7XG4gICAgbGluZXNBbmROZXdsaW5lcy5wb3AoKTtcbiAgfVxuXG4gIC8vIE1lcmdlIHRoZSBjb250ZW50IGFuZCBsaW5lIHNlcGFyYXRvcnMgaW50byBzaW5nbGUgdG9rZW5zXG4gIGZvciAobGV0IGkgPSAwOyBpIDwgbGluZXNBbmROZXdsaW5lcy5sZW5ndGg7IGkrKykge1xuICAgIGxldCBsaW5lID0gbGluZXNBbmROZXdsaW5lc1tpXTtcblxuICAgIGlmIChpICUgMiAmJiAhdGhpcy5vcHRpb25zLm5ld2xpbmVJc1Rva2VuKSB7XG4gICAgICByZXRMaW5lc1tyZXRMaW5lcy5sZW5ndGggLSAxXSArPSBsaW5lO1xuICAgIH0gZWxzZSB7XG4gICAgICBpZiAodGhpcy5vcHRpb25zLmlnbm9yZVdoaXRlc3BhY2UpIHtcbiAgICAgICAgbGluZSA9IGxpbmUudHJpbSgpO1xuICAgICAgfVxuICAgICAgcmV0TGluZXMucHVzaChsaW5lKTtcbiAgICB9XG4gIH1cblxuICByZXR1cm4gcmV0TGluZXM7XG59O1xuXG5leHBvcnQgZnVuY3Rpb24gZGlmZkxpbmVzKG9sZFN0ciwgbmV3U3RyLCBjYWxsYmFjaykgeyByZXR1cm4gbGluZURpZmYuZGlmZihvbGRTdHIsIG5ld1N0ciwgY2FsbGJhY2spOyB9XG5leHBvcnQgZnVuY3Rpb24gZGlmZlRyaW1tZWRMaW5lcyhvbGRTdHIsIG5ld1N0ciwgY2FsbGJhY2spIHtcbiAgbGV0IG9wdGlvbnMgPSBnZW5lcmF0ZU9wdGlvbnMoY2FsbGJhY2ssIHtpZ25vcmVXaGl0ZXNwYWNlOiB0cnVlfSk7XG4gIHJldHVybiBsaW5lRGlmZi5kaWZmKG9sZFN0ciwgbmV3U3RyLCBvcHRpb25zKTtcbn1cbiJdfQ== 31855 31856 31857 /***/ }), 31858 /* 6 */ 31859 /***/ (function(module, exports, __webpack_require__) { 31860 31861 /*istanbul ignore start*/'use strict'; 31862 31863 exports.__esModule = true; 31864 exports.sentenceDiff = undefined; 31865 exports. /*istanbul ignore end*/diffSentences = diffSentences; 31866 31867 var /*istanbul ignore start*/_base = __webpack_require__(1) /*istanbul ignore end*/; 31868 31869 /*istanbul ignore start*/var _base2 = _interopRequireDefault(_base); 31870 31871 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } 31872 31873 /*istanbul ignore end*/var sentenceDiff = /*istanbul ignore start*/exports. /*istanbul ignore end*/sentenceDiff = new /*istanbul ignore start*/_base2['default'] /*istanbul ignore end*/(); 31874 sentenceDiff.tokenize = function (value) { 31875 return value.split(/(\S.+?[.!?])(?=\s+|$)/); 31876 }; 31877 31878 function diffSentences(oldStr, newStr, callback) { 31879 return sentenceDiff.diff(oldStr, newStr, callback); 31880 } 31881 //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9kaWZmL3NlbnRlbmNlLmpzIl0sIm5hbWVzIjpbImRpZmZTZW50ZW5jZXMiLCJzZW50ZW5jZURpZmYiLCJ0b2tlbml6ZSIsInZhbHVlIiwic3BsaXQiLCJvbGRTdHIiLCJuZXdTdHIiLCJjYWxsYmFjayIsImRpZmYiXSwibWFwcGluZ3MiOiI7Ozs7Z0NBUWdCQSxhLEdBQUFBLGE7O0FBUmhCOzs7Ozs7dUJBR08sSUFBTUMsdUZBQWUsd0VBQXJCO0FBQ1BBLGFBQWFDLFFBQWIsR0FBd0IsVUFBU0MsS0FBVCxFQUFnQjtBQUN0QyxTQUFPQSxNQUFNQyxLQUFOLENBQVksdUJBQVosQ0FBUDtBQUNELENBRkQ7O0FBSU8sU0FBU0osYUFBVCxDQUF1QkssTUFBdkIsRUFBK0JDLE1BQS9CLEVBQXVDQyxRQUF2QyxFQUFpRDtBQUFFLFNBQU9OLGFBQWFPLElBQWIsQ0FBa0JILE1BQWxCLEVBQTBCQyxNQUExQixFQUFrQ0MsUUFBbEMsQ0FBUDtBQUFxRCIsImZpbGUiOiJzZW50ZW5jZS5qcyIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBEaWZmIGZyb20gJy4vYmFzZSc7XG5cblxuZXhwb3J0IGNvbnN0IHNlbnRlbmNlRGlmZiA9IG5ldyBEaWZmKCk7XG5zZW50ZW5jZURpZmYudG9rZW5pemUgPSBmdW5jdGlvbih2YWx1ZSkge1xuICByZXR1cm4gdmFsdWUuc3BsaXQoLyhcXFMuKz9bLiE/XSkoPz1cXHMrfCQpLyk7XG59O1xuXG5leHBvcnQgZnVuY3Rpb24gZGlmZlNlbnRlbmNlcyhvbGRTdHIsIG5ld1N0ciwgY2FsbGJhY2spIHsgcmV0dXJuIHNlbnRlbmNlRGlmZi5kaWZmKG9sZFN0ciwgbmV3U3RyLCBjYWxsYmFjayk7IH1cbiJdfQ== 31882 31883 31884 /***/ }), 31885 /* 7 */ 31886 /***/ (function(module, exports, __webpack_require__) { 31887 31888 /*istanbul ignore start*/'use strict'; 31889 31890 exports.__esModule = true; 31891 exports.cssDiff = undefined; 31892 exports. /*istanbul ignore end*/diffCss = diffCss; 31893 31894 var /*istanbul ignore start*/_base = __webpack_require__(1) /*istanbul ignore end*/; 31895 31896 /*istanbul ignore start*/var _base2 = _interopRequireDefault(_base); 31897 31898 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } 31899 31900 /*istanbul ignore end*/var cssDiff = /*istanbul ignore start*/exports. /*istanbul ignore end*/cssDiff = new /*istanbul ignore start*/_base2['default'] /*istanbul ignore end*/(); 31901 cssDiff.tokenize = function (value) { 31902 return value.split(/([{}:;,]|\s+)/); 31903 }; 31904 31905 function diffCss(oldStr, newStr, callback) { 31906 return cssDiff.diff(oldStr, newStr, callback); 31907 } 31908 //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9kaWZmL2Nzcy5qcyJdLCJuYW1lcyI6WyJkaWZmQ3NzIiwiY3NzRGlmZiIsInRva2VuaXplIiwidmFsdWUiLCJzcGxpdCIsIm9sZFN0ciIsIm5ld1N0ciIsImNhbGxiYWNrIiwiZGlmZiJdLCJtYXBwaW5ncyI6Ijs7OztnQ0FPZ0JBLE8sR0FBQUEsTzs7QUFQaEI7Ozs7Ozt1QkFFTyxJQUFNQyw2RUFBVSx3RUFBaEI7QUFDUEEsUUFBUUMsUUFBUixHQUFtQixVQUFTQyxLQUFULEVBQWdCO0FBQ2pDLFNBQU9BLE1BQU1DLEtBQU4sQ0FBWSxlQUFaLENBQVA7QUFDRCxDQUZEOztBQUlPLFNBQVNKLE9BQVQsQ0FBaUJLLE1BQWpCLEVBQXlCQyxNQUF6QixFQUFpQ0MsUUFBakMsRUFBMkM7QUFBRSxTQUFPTixRQUFRTyxJQUFSLENBQWFILE1BQWIsRUFBcUJDLE1BQXJCLEVBQTZCQyxRQUE3QixDQUFQO0FBQWdEIiwiZmlsZSI6ImNzcy5qcyIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBEaWZmIGZyb20gJy4vYmFzZSc7XG5cbmV4cG9ydCBjb25zdCBjc3NEaWZmID0gbmV3IERpZmYoKTtcbmNzc0RpZmYudG9rZW5pemUgPSBmdW5jdGlvbih2YWx1ZSkge1xuICByZXR1cm4gdmFsdWUuc3BsaXQoLyhbe306OyxdfFxccyspLyk7XG59O1xuXG5leHBvcnQgZnVuY3Rpb24gZGlmZkNzcyhvbGRTdHIsIG5ld1N0ciwgY2FsbGJhY2spIHsgcmV0dXJuIGNzc0RpZmYuZGlmZihvbGRTdHIsIG5ld1N0ciwgY2FsbGJhY2spOyB9XG4iXX0= 31909 31910 31911 /***/ }), 31912 /* 8 */ 31913 /***/ (function(module, exports, __webpack_require__) { 31914 31915 /*istanbul ignore start*/'use strict'; 31916 31917 exports.__esModule = true; 31918 exports.jsonDiff = undefined; 31919 31920 var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; 31921 31922 exports. /*istanbul ignore end*/diffJson = diffJson; 31923 /*istanbul ignore start*/exports. /*istanbul ignore end*/canonicalize = canonicalize; 31924 31925 var /*istanbul ignore start*/_base = __webpack_require__(1) /*istanbul ignore end*/; 31926 31927 /*istanbul ignore start*/var _base2 = _interopRequireDefault(_base); 31928 31929 /*istanbul ignore end*/var /*istanbul ignore start*/_line = __webpack_require__(5) /*istanbul ignore end*/; 31930 31931 /*istanbul ignore start*/function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } 31932 31933 /*istanbul ignore end*/var objectPrototypeToString = Object.prototype.toString; 31934 31935 var jsonDiff = /*istanbul ignore start*/exports. /*istanbul ignore end*/jsonDiff = new /*istanbul ignore start*/_base2['default'] /*istanbul ignore end*/(); 31936 // Discriminate between two lines of pretty-printed, serialized JSON where one of them has a 31937 // dangling comma and the other doesn't. Turns out including the dangling comma yields the nicest output: 31938 jsonDiff.useLongestToken = true; 31939 31940 jsonDiff.tokenize = /*istanbul ignore start*/_line.lineDiff /*istanbul ignore end*/.tokenize; 31941 jsonDiff.castInput = function (value) { 31942 /*istanbul ignore start*/var _options = /*istanbul ignore end*/this.options, 31943 undefinedReplacement = _options.undefinedReplacement, 31944 _options$stringifyRep = _options.stringifyReplacer, 31945 stringifyReplacer = _options$stringifyRep === undefined ? function (k, v) /*istanbul ignore start*/{ 31946 return (/*istanbul ignore end*/typeof v === 'undefined' ? undefinedReplacement : v 31947 ); 31948 } : _options$stringifyRep; 31949 31950 31951 return typeof value === 'string' ? value : JSON.stringify(canonicalize(value, null, null, stringifyReplacer), stringifyReplacer, ' '); 31952 }; 31953 jsonDiff.equals = function (left, right) { 31954 return (/*istanbul ignore start*/_base2['default'] /*istanbul ignore end*/.prototype.equals.call(jsonDiff, left.replace(/,([\r\n])/g, '$1'), right.replace(/,([\r\n])/g, '$1')) 31955 ); 31956 }; 31957 31958 function diffJson(oldObj, newObj, options) { 31959 return jsonDiff.diff(oldObj, newObj, options); 31960 } 31961 31962 // This function handles the presence of circular references by bailing out when encountering an 31963 // object that is already on the "stack" of items being processed. Accepts an optional replacer 31964 function canonicalize(obj, stack, replacementStack, replacer, key) { 31965 stack = stack || []; 31966 replacementStack = replacementStack || []; 31967 31968 if (replacer) { 31969 obj = replacer(key, obj); 31970 } 31971 31972 var i = /*istanbul ignore start*/void 0 /*istanbul ignore end*/; 31973 31974 for (i = 0; i < stack.length; i += 1) { 31975 if (stack[i] === obj) { 31976 return replacementStack[i]; 31977 } 31978 } 31979 31980 var canonicalizedObj = /*istanbul ignore start*/void 0 /*istanbul ignore end*/; 31981 31982 if ('[object Array]' === objectPrototypeToString.call(obj)) { 31983 stack.push(obj); 31984 canonicalizedObj = new Array(obj.length); 31985 replacementStack.push(canonicalizedObj); 31986 for (i = 0; i < obj.length; i += 1) { 31987 canonicalizedObj[i] = canonicalize(obj[i], stack, replacementStack, replacer, key); 31988 } 31989 stack.pop(); 31990 replacementStack.pop(); 31991 return canonicalizedObj; 31992 } 31993 31994 if (obj && obj.toJSON) { 31995 obj = obj.toJSON(); 31996 } 31997 31998 if ( /*istanbul ignore start*/(typeof /*istanbul ignore end*/obj === 'undefined' ? 'undefined' : _typeof(obj)) === 'object' && obj !== null) { 31999 stack.push(obj); 32000 canonicalizedObj = {}; 32001 replacementStack.push(canonicalizedObj); 32002 var sortedKeys = [], 32003 _key = /*istanbul ignore start*/void 0 /*istanbul ignore end*/; 32004 for (_key in obj) { 32005 /* istanbul ignore else */ 32006 if (obj.hasOwnProperty(_key)) { 32007 sortedKeys.push(_key); 32008 } 32009 } 32010 sortedKeys.sort(); 32011 for (i = 0; i < sortedKeys.length; i += 1) { 32012 _key = sortedKeys[i]; 32013 canonicalizedObj[_key] = canonicalize(obj[_key], stack, replacementStack, replacer, _key); 32014 } 32015 stack.pop(); 32016 replacementStack.pop(); 32017 } else { 32018 canonicalizedObj = obj; 32019 } 32020 return canonicalizedObj; 32021 } 32022 //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9kaWZmL2pzb24uanMiXSwibmFtZXMiOlsiZGlmZkpzb24iLCJjYW5vbmljYWxpemUiLCJvYmplY3RQcm90b3R5cGVUb1N0cmluZyIsIk9iamVjdCIsInByb3RvdHlwZSIsInRvU3RyaW5nIiwianNvbkRpZmYiLCJ1c2VMb25nZXN0VG9rZW4iLCJ0b2tlbml6ZSIsImNhc3RJbnB1dCIsInZhbHVlIiwib3B0aW9ucyIsInVuZGVmaW5lZFJlcGxhY2VtZW50Iiwic3RyaW5naWZ5UmVwbGFjZXIiLCJrIiwidiIsIkpTT04iLCJzdHJpbmdpZnkiLCJlcXVhbHMiLCJsZWZ0IiwicmlnaHQiLCJjYWxsIiwicmVwbGFjZSIsIm9sZE9iaiIsIm5ld09iaiIsImRpZmYiLCJvYmoiLCJzdGFjayIsInJlcGxhY2VtZW50U3RhY2siLCJyZXBsYWNlciIsImtleSIsImkiLCJsZW5ndGgiLCJjYW5vbmljYWxpemVkT2JqIiwicHVzaCIsIkFycmF5IiwicG9wIiwidG9KU09OIiwic29ydGVkS2V5cyIsImhhc093blByb3BlcnR5Iiwic29ydCJdLCJtYXBwaW5ncyI6Ijs7Ozs7OztnQ0FxQmdCQSxRLEdBQUFBLFE7eURBSUFDLFksR0FBQUEsWTs7QUF6QmhCOzs7O3VCQUNBOzs7O3VCQUVBLElBQU1DLDBCQUEwQkMsT0FBT0MsU0FBUCxDQUFpQkMsUUFBakQ7O0FBR08sSUFBTUMsK0VBQVcsd0VBQWpCO0FBQ1A7QUFDQTtBQUNBQSxTQUFTQyxlQUFULEdBQTJCLElBQTNCOztBQUVBRCxTQUFTRSxRQUFULEdBQW9CLGdFQUFTQSxRQUE3QjtBQUNBRixTQUFTRyxTQUFULEdBQXFCLFVBQVNDLEtBQVQsRUFBZ0I7QUFBQSxpRUFDK0UsS0FBS0MsT0FEcEY7QUFBQSxNQUM1QkMsb0JBRDRCLFlBQzVCQSxvQkFENEI7QUFBQSx1Q0FDTkMsaUJBRE07QUFBQSxNQUNOQSxpQkFETSx5Q0FDYyxVQUFDQyxDQUFELEVBQUlDLENBQUo7QUFBQSxtQ0FBVSxPQUFPQSxDQUFQLEtBQWEsV0FBYixHQUEyQkgsb0JBQTNCLEdBQWtERztBQUE1RDtBQUFBLEdBRGQ7OztBQUduQyxTQUFPLE9BQU9MLEtBQVAsS0FBaUIsUUFBakIsR0FBNEJBLEtBQTVCLEdBQW9DTSxLQUFLQyxTQUFMLENBQWVoQixhQUFhUyxLQUFiLEVBQW9CLElBQXBCLEVBQTBCLElBQTFCLEVBQWdDRyxpQkFBaEMsQ0FBZixFQUFtRUEsaUJBQW5FLEVBQXNGLElBQXRGLENBQTNDO0FBQ0QsQ0FKRDtBQUtBUCxTQUFTWSxNQUFULEdBQWtCLFVBQVNDLElBQVQsRUFBZUMsS0FBZixFQUFzQjtBQUN0QyxTQUFPLG9FQUFLaEIsU0FBTCxDQUFlYyxNQUFmLENBQXNCRyxJQUF0QixDQUEyQmYsUUFBM0IsRUFBcUNhLEtBQUtHLE9BQUwsQ0FBYSxZQUFiLEVBQTJCLElBQTNCLENBQXJDLEVBQXVFRixNQUFNRSxPQUFOLENBQWMsWUFBZCxFQUE0QixJQUE1QixDQUF2RTtBQUFQO0FBQ0QsQ0FGRDs7QUFJTyxTQUFTdEIsUUFBVCxDQUFrQnVCLE1BQWxCLEVBQTBCQyxNQUExQixFQUFrQ2IsT0FBbEMsRUFBMkM7QUFBRSxTQUFPTCxTQUFTbUIsSUFBVCxDQUFjRixNQUFkLEVBQXNCQyxNQUF0QixFQUE4QmIsT0FBOUIsQ0FBUDtBQUFnRDs7QUFFcEc7QUFDQTtBQUNPLFNBQVNWLFlBQVQsQ0FBc0J5QixHQUF0QixFQUEyQkMsS0FBM0IsRUFBa0NDLGdCQUFsQyxFQUFvREMsUUFBcEQsRUFBOERDLEdBQTlELEVBQW1FO0FBQ3hFSCxVQUFRQSxTQUFTLEVBQWpCO0FBQ0FDLHFCQUFtQkEsb0JBQW9CLEVBQXZDOztBQUVBLE1BQUlDLFFBQUosRUFBYztBQUNaSCxVQUFNRyxTQUFTQyxHQUFULEVBQWNKLEdBQWQsQ0FBTjtBQUNEOztBQUVELE1BQUlLLG1DQUFKOztBQUVBLE9BQUtBLElBQUksQ0FBVCxFQUFZQSxJQUFJSixNQUFNSyxNQUF0QixFQUE4QkQsS0FBSyxDQUFuQyxFQUFzQztBQUNwQyxRQUFJSixNQUFNSSxDQUFOLE1BQWFMLEdBQWpCLEVBQXNCO0FBQ3BCLGFBQU9FLGlCQUFpQkcsQ0FBakIsQ0FBUDtBQUNEO0FBQ0Y7O0FBRUQsTUFBSUUsa0RBQUo7O0FBRUEsTUFBSSxxQkFBcUIvQix3QkFBd0JtQixJQUF4QixDQUE2QkssR0FBN0IsQ0FBekIsRUFBNEQ7QUFDMURDLFVBQU1PLElBQU4sQ0FBV1IsR0FBWDtBQUNBTyx1QkFBbUIsSUFBSUUsS0FBSixDQUFVVCxJQUFJTSxNQUFkLENBQW5CO0FBQ0FKLHFCQUFpQk0sSUFBakIsQ0FBc0JELGdCQUF0QjtBQUNBLFNBQUtGLElBQUksQ0FBVCxFQUFZQSxJQUFJTCxJQUFJTSxNQUFwQixFQUE0QkQsS0FBSyxDQUFqQyxFQUFvQztBQUNsQ0UsdUJBQWlCRixDQUFqQixJQUFzQjlCLGFBQWF5QixJQUFJSyxDQUFKLENBQWIsRUFBcUJKLEtBQXJCLEVBQTRCQyxnQkFBNUIsRUFBOENDLFFBQTlDLEVBQXdEQyxHQUF4RCxDQUF0QjtBQUNEO0FBQ0RILFVBQU1TLEdBQU47QUFDQVIscUJBQWlCUSxHQUFqQjtBQUNBLFdBQU9ILGdCQUFQO0FBQ0Q7O0FBRUQsTUFBSVAsT0FBT0EsSUFBSVcsTUFBZixFQUF1QjtBQUNyQlgsVUFBTUEsSUFBSVcsTUFBSixFQUFOO0FBQ0Q7O0FBRUQsTUFBSSx5REFBT1gsR0FBUCx5Q0FBT0EsR0FBUCxPQUFlLFFBQWYsSUFBMkJBLFFBQVEsSUFBdkMsRUFBNkM7QUFDM0NDLFVBQU1PLElBQU4sQ0FBV1IsR0FBWDtBQUNBTyx1QkFBbUIsRUFBbkI7QUFDQUwscUJBQWlCTSxJQUFqQixDQUFzQkQsZ0JBQXRCO0FBQ0EsUUFBSUssYUFBYSxFQUFqQjtBQUFBLFFBQ0lSLHNDQURKO0FBRUEsU0FBS0EsSUFBTCxJQUFZSixHQUFaLEVBQWlCO0FBQ2Y7QUFDQSxVQUFJQSxJQUFJYSxjQUFKLENBQW1CVCxJQUFuQixDQUFKLEVBQTZCO0FBQzNCUSxtQkFBV0osSUFBWCxDQUFnQkosSUFBaEI7QUFDRDtBQUNGO0FBQ0RRLGVBQVdFLElBQVg7QUFDQSxTQUFLVCxJQUFJLENBQVQsRUFBWUEsSUFBSU8sV0FBV04sTUFBM0IsRUFBbUNELEtBQUssQ0FBeEMsRUFBMkM7QUFDekNELGFBQU1RLFdBQVdQLENBQVgsQ0FBTjtBQUNBRSx1QkFBaUJILElBQWpCLElBQXdCN0IsYUFBYXlCLElBQUlJLElBQUosQ0FBYixFQUF1QkgsS0FBdkIsRUFBOEJDLGdCQUE5QixFQUFnREMsUUFBaEQsRUFBMERDLElBQTFELENBQXhCO0FBQ0Q7QUFDREgsVUFBTVMsR0FBTjtBQUNBUixxQkFBaUJRLEdBQWpCO0FBQ0QsR0FuQkQsTUFtQk87QUFDTEgsdUJBQW1CUCxHQUFuQjtBQUNEO0FBQ0QsU0FBT08sZ0JBQVA7QUFDRCIsImZpbGUiOiJqc29uLmpzIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IERpZmYgZnJvbSAnLi9iYXNlJztcbmltcG9ydCB7bGluZURpZmZ9IGZyb20gJy4vbGluZSc7XG5cbmNvbnN0IG9iamVjdFByb3RvdHlwZVRvU3RyaW5nID0gT2JqZWN0LnByb3RvdHlwZS50b1N0cmluZztcblxuXG5leHBvcnQgY29uc3QganNvbkRpZmYgPSBuZXcgRGlmZigpO1xuLy8gRGlzY3JpbWluYXRlIGJldHdlZW4gdHdvIGxpbmVzIG9mIHByZXR0eS1wcmludGVkLCBzZXJpYWxpemVkIEpTT04gd2hlcmUgb25lIG9mIHRoZW0gaGFzIGFcbi8vIGRhbmdsaW5nIGNvbW1hIGFuZCB0aGUgb3RoZXIgZG9lc24ndC4gVHVybnMgb3V0IGluY2x1ZGluZyB0aGUgZGFuZ2xpbmcgY29tbWEgeWllbGRzIHRoZSBuaWNlc3Qgb3V0cHV0OlxuanNvbkRpZmYudXNlTG9uZ2VzdFRva2VuID0gdHJ1ZTtcblxuanNvbkRpZmYudG9rZW5pemUgPSBsaW5lRGlmZi50b2tlbml6ZTtcbmpzb25EaWZmLmNhc3RJbnB1dCA9IGZ1bmN0aW9uKHZhbHVlKSB7XG4gIGNvbnN0IHt1bmRlZmluZWRSZXBsYWNlbWVudCwgc3RyaW5naWZ5UmVwbGFjZXIgPSAoaywgdikgPT4gdHlwZW9mIHYgPT09ICd1bmRlZmluZWQnID8gdW5kZWZpbmVkUmVwbGFjZW1lbnQgOiB2fSA9IHRoaXMub3B0aW9ucztcblxuICByZXR1cm4gdHlwZW9mIHZhbHVlID09PSAnc3RyaW5nJyA/IHZhbHVlIDogSlNPTi5zdHJpbmdpZnkoY2Fub25pY2FsaXplKHZhbHVlLCBudWxsLCBudWxsLCBzdHJpbmdpZnlSZXBsYWNlciksIHN0cmluZ2lmeVJlcGxhY2VyLCAnICAnKTtcbn07XG5qc29uRGlmZi5lcXVhbHMgPSBmdW5jdGlvbihsZWZ0LCByaWdodCkge1xuICByZXR1cm4gRGlmZi5wcm90b3R5cGUuZXF1YWxzLmNhbGwoanNvbkRpZmYsIGxlZnQucmVwbGFjZSgvLChbXFxyXFxuXSkvZywgJyQxJyksIHJpZ2h0LnJlcGxhY2UoLywoW1xcclxcbl0pL2csICckMScpKTtcbn07XG5cbmV4cG9ydCBmdW5jdGlvbiBkaWZmSnNvbihvbGRPYmosIG5ld09iaiwgb3B0aW9ucykgeyByZXR1cm4ganNvbkRpZmYuZGlmZihvbGRPYmosIG5ld09iaiwgb3B0aW9ucyk7IH1cblxuLy8gVGhpcyBmdW5jdGlvbiBoYW5kbGVzIHRoZSBwcmVzZW5jZSBvZiBjaXJjdWxhciByZWZlcmVuY2VzIGJ5IGJhaWxpbmcgb3V0IHdoZW4gZW5jb3VudGVyaW5nIGFuXG4vLyBvYmplY3QgdGhhdCBpcyBhbHJlYWR5IG9uIHRoZSBcInN0YWNrXCIgb2YgaXRlbXMgYmVpbmcgcHJvY2Vzc2VkLiBBY2NlcHRzIGFuIG9wdGlvbmFsIHJlcGxhY2VyXG5leHBvcnQgZnVuY3Rpb24gY2Fub25pY2FsaXplKG9iaiwgc3RhY2ssIHJlcGxhY2VtZW50U3RhY2ssIHJlcGxhY2VyLCBrZXkpIHtcbiAgc3RhY2sgPSBzdGFjayB8fCBbXTtcbiAgcmVwbGFjZW1lbnRTdGFjayA9IHJlcGxhY2VtZW50U3RhY2sgfHwgW107XG5cbiAgaWYgKHJlcGxhY2VyKSB7XG4gICAgb2JqID0gcmVwbGFjZXIoa2V5LCBvYmopO1xuICB9XG5cbiAgbGV0IGk7XG5cbiAgZm9yIChpID0gMDsgaSA8IHN0YWNrLmxlbmd0aDsgaSArPSAxKSB7XG4gICAgaWYgKHN0YWNrW2ldID09PSBvYmopIHtcbiAgICAgIHJldHVybiByZXBsYWNlbWVudFN0YWNrW2ldO1xuICAgIH1cbiAgfVxuXG4gIGxldCBjYW5vbmljYWxpemVkT2JqO1xuXG4gIGlmICgnW29iamVjdCBBcnJheV0nID09PSBvYmplY3RQcm90b3R5cGVUb1N0cmluZy5jYWxsKG9iaikpIHtcbiAgICBzdGFjay5wdXNoKG9iaik7XG4gICAgY2Fub25pY2FsaXplZE9iaiA9IG5ldyBBcnJheShvYmoubGVuZ3RoKTtcbiAgICByZXBsYWNlbWVudFN0YWNrLnB1c2goY2Fub25pY2FsaXplZE9iaik7XG4gICAgZm9yIChpID0gMDsgaSA8IG9iai5sZW5ndGg7IGkgKz0gMSkge1xuICAgICAgY2Fub25pY2FsaXplZE9ialtpXSA9IGNhbm9uaWNhbGl6ZShvYmpbaV0sIHN0YWNrLCByZXBsYWNlbWVudFN0YWNrLCByZXBsYWNlciwga2V5KTtcbiAgICB9XG4gICAgc3RhY2sucG9wKCk7XG4gICAgcmVwbGFjZW1lbnRTdGFjay5wb3AoKTtcbiAgICByZXR1cm4gY2Fub25pY2FsaXplZE9iajtcbiAgfVxuXG4gIGlmIChvYmogJiYgb2JqLnRvSlNPTikge1xuICAgIG9iaiA9IG9iai50b0pTT04oKTtcbiAgfVxuXG4gIGlmICh0eXBlb2Ygb2JqID09PSAnb2JqZWN0JyAmJiBvYmogIT09IG51bGwpIHtcbiAgICBzdGFjay5wdXNoKG9iaik7XG4gICAgY2Fub25pY2FsaXplZE9iaiA9IHt9O1xuICAgIHJlcGxhY2VtZW50U3RhY2sucHVzaChjYW5vbmljYWxpemVkT2JqKTtcbiAgICBsZXQgc29ydGVkS2V5cyA9IFtdLFxuICAgICAgICBrZXk7XG4gICAgZm9yIChrZXkgaW4gb2JqKSB7XG4gICAgICAvKiBpc3RhbmJ1bCBpZ25vcmUgZWxzZSAqL1xuICAgICAgaWYgKG9iai5oYXNPd25Qcm9wZXJ0eShrZXkpKSB7XG4gICAgICAgIHNvcnRlZEtleXMucHVzaChrZXkpO1xuICAgICAgfVxuICAgIH1cbiAgICBzb3J0ZWRLZXlzLnNvcnQoKTtcbiAgICBmb3IgKGkgPSAwOyBpIDwgc29ydGVkS2V5cy5sZW5ndGg7IGkgKz0gMSkge1xuICAgICAga2V5ID0gc29ydGVkS2V5c1tpXTtcbiAgICAgIGNhbm9uaWNhbGl6ZWRPYmpba2V5XSA9IGNhbm9uaWNhbGl6ZShvYmpba2V5XSwgc3RhY2ssIHJlcGxhY2VtZW50U3RhY2ssIHJlcGxhY2VyLCBrZXkpO1xuICAgIH1cbiAgICBzdGFjay5wb3AoKTtcbiAgICByZXBsYWNlbWVudFN0YWNrLnBvcCgpO1xuICB9IGVsc2Uge1xuICAgIGNhbm9uaWNhbGl6ZWRPYmogPSBvYmo7XG4gIH1cbiAgcmV0dXJuIGNhbm9uaWNhbGl6ZWRPYmo7XG59XG4iXX0= 32023 32024 32025 /***/ }), 32026 /* 9 */ 32027 /***/ (function(module, exports, __webpack_require__) { 32028 32029 /*istanbul ignore start*/'use strict'; 32030 32031 exports.__esModule = true; 32032 exports.arrayDiff = undefined; 32033 exports. /*istanbul ignore end*/diffArrays = diffArrays; 32034 32035 var /*istanbul ignore start*/_base = __webpack_require__(1) /*istanbul ignore end*/; 32036 32037 /*istanbul ignore start*/var _base2 = _interopRequireDefault(_base); 32038 32039 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } 32040 32041 /*istanbul ignore end*/var arrayDiff = /*istanbul ignore start*/exports. /*istanbul ignore end*/arrayDiff = new /*istanbul ignore start*/_base2['default'] /*istanbul ignore end*/(); 32042 arrayDiff.tokenize = function (value) { 32043 return value.slice(); 32044 }; 32045 arrayDiff.join = arrayDiff.removeEmpty = function (value) { 32046 return value; 32047 }; 32048 32049 function diffArrays(oldArr, newArr, callback) { 32050 return arrayDiff.diff(oldArr, newArr, callback); 32051 } 32052 //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9kaWZmL2FycmF5LmpzIl0sIm5hbWVzIjpbImRpZmZBcnJheXMiLCJhcnJheURpZmYiLCJ0b2tlbml6ZSIsInZhbHVlIiwic2xpY2UiLCJqb2luIiwicmVtb3ZlRW1wdHkiLCJvbGRBcnIiLCJuZXdBcnIiLCJjYWxsYmFjayIsImRpZmYiXSwibWFwcGluZ3MiOiI7Ozs7Z0NBVWdCQSxVLEdBQUFBLFU7O0FBVmhCOzs7Ozs7dUJBRU8sSUFBTUMsaUZBQVksd0VBQWxCO0FBQ1BBLFVBQVVDLFFBQVYsR0FBcUIsVUFBU0MsS0FBVCxFQUFnQjtBQUNuQyxTQUFPQSxNQUFNQyxLQUFOLEVBQVA7QUFDRCxDQUZEO0FBR0FILFVBQVVJLElBQVYsR0FBaUJKLFVBQVVLLFdBQVYsR0FBd0IsVUFBU0gsS0FBVCxFQUFnQjtBQUN2RCxTQUFPQSxLQUFQO0FBQ0QsQ0FGRDs7QUFJTyxTQUFTSCxVQUFULENBQW9CTyxNQUFwQixFQUE0QkMsTUFBNUIsRUFBb0NDLFFBQXBDLEVBQThDO0FBQUUsU0FBT1IsVUFBVVMsSUFBVixDQUFlSCxNQUFmLEVBQXVCQyxNQUF2QixFQUErQkMsUUFBL0IsQ0FBUDtBQUFrRCIsImZpbGUiOiJhcnJheS5qcyIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBEaWZmIGZyb20gJy4vYmFzZSc7XG5cbmV4cG9ydCBjb25zdCBhcnJheURpZmYgPSBuZXcgRGlmZigpO1xuYXJyYXlEaWZmLnRva2VuaXplID0gZnVuY3Rpb24odmFsdWUpIHtcbiAgcmV0dXJuIHZhbHVlLnNsaWNlKCk7XG59O1xuYXJyYXlEaWZmLmpvaW4gPSBhcnJheURpZmYucmVtb3ZlRW1wdHkgPSBmdW5jdGlvbih2YWx1ZSkge1xuICByZXR1cm4gdmFsdWU7XG59O1xuXG5leHBvcnQgZnVuY3Rpb24gZGlmZkFycmF5cyhvbGRBcnIsIG5ld0FyciwgY2FsbGJhY2spIHsgcmV0dXJuIGFycmF5RGlmZi5kaWZmKG9sZEFyciwgbmV3QXJyLCBjYWxsYmFjayk7IH1cbiJdfQ== 32053 32054 32055 /***/ }), 32056 /* 10 */ 32057 /***/ (function(module, exports, __webpack_require__) { 32058 32059 /*istanbul ignore start*/'use strict'; 32060 32061 exports.__esModule = true; 32062 exports. /*istanbul ignore end*/applyPatch = applyPatch; 32063 /*istanbul ignore start*/exports. /*istanbul ignore end*/applyPatches = applyPatches; 32064 32065 var /*istanbul ignore start*/_parse = __webpack_require__(11) /*istanbul ignore end*/; 32066 32067 var /*istanbul ignore start*/_distanceIterator = __webpack_require__(12) /*istanbul ignore end*/; 32068 32069 /*istanbul ignore start*/var _distanceIterator2 = _interopRequireDefault(_distanceIterator); 32070 32071 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } 32072 32073 /*istanbul ignore end*/function applyPatch(source, uniDiff) { 32074 /*istanbul ignore start*/var /*istanbul ignore end*/options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; 32075 32076 if (typeof uniDiff === 'string') { 32077 uniDiff = /*istanbul ignore start*/(0, _parse.parsePatch) /*istanbul ignore end*/(uniDiff); 32078 } 32079 32080 if (Array.isArray(uniDiff)) { 32081 if (uniDiff.length > 1) { 32082 throw new Error('applyPatch only works with a single input.'); 32083 } 32084 32085 uniDiff = uniDiff[0]; 32086 } 32087 32088 // Apply the diff to the input 32089 var lines = source.split(/\r\n|[\n\v\f\r\x85]/), 32090 delimiters = source.match(/\r\n|[\n\v\f\r\x85]/g) || [], 32091 hunks = uniDiff.hunks, 32092 compareLine = options.compareLine || function (lineNumber, line, operation, patchContent) /*istanbul ignore start*/{ 32093 return (/*istanbul ignore end*/line === patchContent 32094 ); 32095 }, 32096 errorCount = 0, 32097 fuzzFactor = options.fuzzFactor || 0, 32098 minLine = 0, 32099 offset = 0, 32100 removeEOFNL = /*istanbul ignore start*/void 0 /*istanbul ignore end*/, 32101 addEOFNL = /*istanbul ignore start*/void 0 /*istanbul ignore end*/; 32102 32103 /** 32104 * Checks if the hunk exactly fits on the provided location 32105 */ 32106 function hunkFits(hunk, toPos) { 32107 for (var j = 0; j < hunk.lines.length; j++) { 32108 var line = hunk.lines[j], 32109 operation = line.length > 0 ? line[0] : ' ', 32110 content = line.length > 0 ? line.substr(1) : line; 32111 32112 if (operation === ' ' || operation === '-') { 32113 // Context sanity check 32114 if (!compareLine(toPos + 1, lines[toPos], operation, content)) { 32115 errorCount++; 32116 32117 if (errorCount > fuzzFactor) { 32118 return false; 32119 } 32120 } 32121 toPos++; 32122 } 32123 } 32124 32125 return true; 32126 } 32127 32128 // Search best fit offsets for each hunk based on the previous ones 32129 for (var i = 0; i < hunks.length; i++) { 32130 var hunk = hunks[i], 32131 maxLine = lines.length - hunk.oldLines, 32132 localOffset = 0, 32133 toPos = offset + hunk.oldStart - 1; 32134 32135 var iterator = /*istanbul ignore start*/(0, _distanceIterator2['default']) /*istanbul ignore end*/(toPos, minLine, maxLine); 32136 32137 for (; localOffset !== undefined; localOffset = iterator()) { 32138 if (hunkFits(hunk, toPos + localOffset)) { 32139 hunk.offset = offset += localOffset; 32140 break; 32141 } 32142 } 32143 32144 if (localOffset === undefined) { 32145 return false; 32146 } 32147 32148 // Set lower text limit to end of the current hunk, so next ones don't try 32149 // to fit over already patched text 32150 minLine = hunk.offset + hunk.oldStart + hunk.oldLines; 32151 } 32152 32153 // Apply patch hunks 32154 var diffOffset = 0; 32155 for (var _i = 0; _i < hunks.length; _i++) { 32156 var _hunk = hunks[_i], 32157 _toPos = _hunk.oldStart + _hunk.offset + diffOffset - 1; 32158 diffOffset += _hunk.newLines - _hunk.oldLines; 32159 32160 if (_toPos < 0) { 32161 // Creating a new file 32162 _toPos = 0; 32163 } 32164 32165 for (var j = 0; j < _hunk.lines.length; j++) { 32166 var line = _hunk.lines[j], 32167 operation = line.length > 0 ? line[0] : ' ', 32168 content = line.length > 0 ? line.substr(1) : line, 32169 delimiter = _hunk.linedelimiters[j]; 32170 32171 if (operation === ' ') { 32172 _toPos++; 32173 } else if (operation === '-') { 32174 lines.splice(_toPos, 1); 32175 delimiters.splice(_toPos, 1); 32176 /* istanbul ignore else */ 32177 } else if (operation === '+') { 32178 lines.splice(_toPos, 0, content); 32179 delimiters.splice(_toPos, 0, delimiter); 32180 _toPos++; 32181 } else if (operation === '\\') { 32182 var previousOperation = _hunk.lines[j - 1] ? _hunk.lines[j - 1][0] : null; 32183 if (previousOperation === '+') { 32184 removeEOFNL = true; 32185 } else if (previousOperation === '-') { 32186 addEOFNL = true; 32187 } 32188 } 32189 } 32190 } 32191 32192 // Handle EOFNL insertion/removal 32193 if (removeEOFNL) { 32194 while (!lines[lines.length - 1]) { 32195 lines.pop(); 32196 delimiters.pop(); 32197 } 32198 } else if (addEOFNL) { 32199 lines.push(''); 32200 delimiters.push('\n'); 32201 } 32202 for (var _k = 0; _k < lines.length - 1; _k++) { 32203 lines[_k] = lines[_k] + delimiters[_k]; 32204 } 32205 return lines.join(''); 32206 } 32207 32208 // Wrapper that supports multiple file patches via callbacks. 32209 function applyPatches(uniDiff, options) { 32210 if (typeof uniDiff === 'string') { 32211 uniDiff = /*istanbul ignore start*/(0, _parse.parsePatch) /*istanbul ignore end*/(uniDiff); 32212 } 32213 32214 var currentIndex = 0; 32215 function processIndex() { 32216 var index = uniDiff[currentIndex++]; 32217 if (!index) { 32218 return options.complete(); 32219 } 32220 32221 options.loadFile(index, function (err, data) { 32222 if (err) { 32223 return options.complete(err); 32224 } 32225 32226 var updatedContent = applyPatch(data, index, options); 32227 options.patched(index, updatedContent, function (err) { 32228 if (err) { 32229 return options.complete(err); 32230 } 32231 32232 processIndex(); 32233 }); 32234 }); 32235 } 32236 processIndex(); 32237 } 32238 //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9wYXRjaC9hcHBseS5qcyJdLCJuYW1lcyI6WyJhcHBseVBhdGNoIiwiYXBwbHlQYXRjaGVzIiwic291cmNlIiwidW5pRGlmZiIsIm9wdGlvbnMiLCJBcnJheSIsImlzQXJyYXkiLCJsZW5ndGgiLCJFcnJvciIsImxpbmVzIiwic3BsaXQiLCJkZWxpbWl0ZXJzIiwibWF0Y2giLCJodW5rcyIsImNvbXBhcmVMaW5lIiwibGluZU51bWJlciIsImxpbmUiLCJvcGVyYXRpb24iLCJwYXRjaENvbnRlbnQiLCJlcnJvckNvdW50IiwiZnV6ekZhY3RvciIsIm1pbkxpbmUiLCJvZmZzZXQiLCJyZW1vdmVFT0ZOTCIsImFkZEVPRk5MIiwiaHVua0ZpdHMiLCJodW5rIiwidG9Qb3MiLCJqIiwiY29udGVudCIsInN1YnN0ciIsImkiLCJtYXhMaW5lIiwib2xkTGluZXMiLCJsb2NhbE9mZnNldCIsIm9sZFN0YXJ0IiwiaXRlcmF0b3IiLCJ1bmRlZmluZWQiLCJkaWZmT2Zmc2V0IiwibmV3TGluZXMiLCJkZWxpbWl0ZXIiLCJsaW5lZGVsaW1pdGVycyIsInNwbGljZSIsInByZXZpb3VzT3BlcmF0aW9uIiwicG9wIiwicHVzaCIsIl9rIiwiam9pbiIsImN1cnJlbnRJbmRleCIsInByb2Nlc3NJbmRleCIsImluZGV4IiwiY29tcGxldGUiLCJsb2FkRmlsZSIsImVyciIsImRhdGEiLCJ1cGRhdGVkQ29udGVudCIsInBhdGNoZWQiXSwibWFwcGluZ3MiOiI7OztnQ0FHZ0JBLFUsR0FBQUEsVTt5REFvSUFDLFksR0FBQUEsWTs7QUF2SWhCOztBQUNBOzs7Ozs7dUJBRU8sU0FBU0QsVUFBVCxDQUFvQkUsTUFBcEIsRUFBNEJDLE9BQTVCLEVBQW1EO0FBQUEsc0RBQWRDLE9BQWMsdUVBQUosRUFBSTs7QUFDeEQsTUFBSSxPQUFPRCxPQUFQLEtBQW1CLFFBQXZCLEVBQWlDO0FBQy9CQSxjQUFVLHdFQUFXQSxPQUFYLENBQVY7QUFDRDs7QUFFRCxNQUFJRSxNQUFNQyxPQUFOLENBQWNILE9BQWQsQ0FBSixFQUE0QjtBQUMxQixRQUFJQSxRQUFRSSxNQUFSLEdBQWlCLENBQXJCLEVBQXdCO0FBQ3RCLFlBQU0sSUFBSUMsS0FBSixDQUFVLDRDQUFWLENBQU47QUFDRDs7QUFFREwsY0FBVUEsUUFBUSxDQUFSLENBQVY7QUFDRDs7QUFFRDtBQUNBLE1BQUlNLFFBQVFQLE9BQU9RLEtBQVAsQ0FBYSxxQkFBYixDQUFaO0FBQUEsTUFDSUMsYUFBYVQsT0FBT1UsS0FBUCxDQUFhLHNCQUFiLEtBQXdDLEVBRHpEO0FBQUEsTUFFSUMsUUFBUVYsUUFBUVUsS0FGcEI7QUFBQSxNQUlJQyxjQUFjVixRQUFRVSxXQUFSLElBQXdCLFVBQUNDLFVBQUQsRUFBYUMsSUFBYixFQUFtQkMsU0FBbkIsRUFBOEJDLFlBQTlCO0FBQUEsbUNBQStDRixTQUFTRTtBQUF4RDtBQUFBLEdBSjFDO0FBQUEsTUFLSUMsYUFBYSxDQUxqQjtBQUFBLE1BTUlDLGFBQWFoQixRQUFRZ0IsVUFBUixJQUFzQixDQU52QztBQUFBLE1BT0lDLFVBQVUsQ0FQZDtBQUFBLE1BUUlDLFNBQVMsQ0FSYjtBQUFBLE1BVUlDLDZDQVZKO0FBQUEsTUFXSUMsMENBWEo7O0FBYUE7OztBQUdBLFdBQVNDLFFBQVQsQ0FBa0JDLElBQWxCLEVBQXdCQyxLQUF4QixFQUErQjtBQUM3QixTQUFLLElBQUlDLElBQUksQ0FBYixFQUFnQkEsSUFBSUYsS0FBS2pCLEtBQUwsQ0FBV0YsTUFBL0IsRUFBdUNxQixHQUF2QyxFQUE0QztBQUMxQyxVQUFJWixPQUFPVSxLQUFLakIsS0FBTCxDQUFXbUIsQ0FBWCxDQUFYO0FBQUEsVUFDSVgsWUFBYUQsS0FBS1QsTUFBTCxHQUFjLENBQWQsR0FBa0JTLEtBQUssQ0FBTCxDQUFsQixHQUE0QixHQUQ3QztBQUFBLFVBRUlhLFVBQVdiLEtBQUtULE1BQUwsR0FBYyxDQUFkLEdBQWtCUyxLQUFLYyxNQUFMLENBQVksQ0FBWixDQUFsQixHQUFtQ2QsSUFGbEQ7O0FBSUEsVUFBSUMsY0FBYyxHQUFkLElBQXFCQSxjQUFjLEdBQXZDLEVBQTRDO0FBQzFDO0FBQ0EsWUFBSSxDQUFDSCxZQUFZYSxRQUFRLENBQXBCLEVBQXVCbEIsTUFBTWtCLEtBQU4sQ0FBdkIsRUFBcUNWLFNBQXJDLEVBQWdEWSxPQUFoRCxDQUFMLEVBQStEO0FBQzdEVjs7QUFFQSxjQUFJQSxhQUFhQyxVQUFqQixFQUE2QjtBQUMzQixtQkFBTyxLQUFQO0FBQ0Q7QUFDRjtBQUNETztBQUNEO0FBQ0Y7O0FBRUQsV0FBTyxJQUFQO0FBQ0Q7O0FBRUQ7QUFDQSxPQUFLLElBQUlJLElBQUksQ0FBYixFQUFnQkEsSUFBSWxCLE1BQU1OLE1BQTFCLEVBQWtDd0IsR0FBbEMsRUFBdUM7QUFDckMsUUFBSUwsT0FBT2IsTUFBTWtCLENBQU4sQ0FBWDtBQUFBLFFBQ0lDLFVBQVV2QixNQUFNRixNQUFOLEdBQWVtQixLQUFLTyxRQURsQztBQUFBLFFBRUlDLGNBQWMsQ0FGbEI7QUFBQSxRQUdJUCxRQUFRTCxTQUFTSSxLQUFLUyxRQUFkLEdBQXlCLENBSHJDOztBQUtBLFFBQUlDLFdBQVcsb0ZBQWlCVCxLQUFqQixFQUF3Qk4sT0FBeEIsRUFBaUNXLE9BQWpDLENBQWY7O0FBRUEsV0FBT0UsZ0JBQWdCRyxTQUF2QixFQUFrQ0gsY0FBY0UsVUFBaEQsRUFBNEQ7QUFDMUQsVUFBSVgsU0FBU0MsSUFBVCxFQUFlQyxRQUFRTyxXQUF2QixDQUFKLEVBQXlDO0FBQ3ZDUixhQUFLSixNQUFMLEdBQWNBLFVBQVVZLFdBQXhCO0FBQ0E7QUFDRDtBQUNGOztBQUVELFFBQUlBLGdCQUFnQkcsU0FBcEIsRUFBK0I7QUFDN0IsYUFBTyxLQUFQO0FBQ0Q7O0FBRUQ7QUFDQTtBQUNBaEIsY0FBVUssS0FBS0osTUFBTCxHQUFjSSxLQUFLUyxRQUFuQixHQUE4QlQsS0FBS08sUUFBN0M7QUFDRDs7QUFFRDtBQUNBLE1BQUlLLGFBQWEsQ0FBakI7QUFDQSxPQUFLLElBQUlQLEtBQUksQ0FBYixFQUFnQkEsS0FBSWxCLE1BQU1OLE1BQTFCLEVBQWtDd0IsSUFBbEMsRUFBdUM7QUFDckMsUUFBSUwsUUFBT2IsTUFBTWtCLEVBQU4sQ0FBWDtBQUFBLFFBQ0lKLFNBQVFELE1BQUtTLFFBQUwsR0FBZ0JULE1BQUtKLE1BQXJCLEdBQThCZ0IsVUFBOUIsR0FBMkMsQ0FEdkQ7QUFFQUEsa0JBQWNaLE1BQUthLFFBQUwsR0FBZ0JiLE1BQUtPLFFBQW5DOztBQUVBLFFBQUlOLFNBQVEsQ0FBWixFQUFlO0FBQUU7QUFDZkEsZUFBUSxDQUFSO0FBQ0Q7O0FBRUQsU0FBSyxJQUFJQyxJQUFJLENBQWIsRUFBZ0JBLElBQUlGLE1BQUtqQixLQUFMLENBQVdGLE1BQS9CLEVBQXVDcUIsR0FBdkMsRUFBNEM7QUFDMUMsVUFBSVosT0FBT1UsTUFBS2pCLEtBQUwsQ0FBV21CLENBQVgsQ0FBWDtBQUFBLFVBQ0lYLFlBQWFELEtBQUtULE1BQUwsR0FBYyxDQUFkLEdBQWtCUyxLQUFLLENBQUwsQ0FBbEIsR0FBNEIsR0FEN0M7QUFBQSxVQUVJYSxVQUFXYixLQUFLVCxNQUFMLEdBQWMsQ0FBZCxHQUFrQlMsS0FBS2MsTUFBTCxDQUFZLENBQVosQ0FBbEIsR0FBbUNkLElBRmxEO0FBQUEsVUFHSXdCLFlBQVlkLE1BQUtlLGNBQUwsQ0FBb0JiLENBQXBCLENBSGhCOztBQUtBLFVBQUlYLGNBQWMsR0FBbEIsRUFBdUI7QUFDckJVO0FBQ0QsT0FGRCxNQUVPLElBQUlWLGNBQWMsR0FBbEIsRUFBdUI7QUFDNUJSLGNBQU1pQyxNQUFOLENBQWFmLE1BQWIsRUFBb0IsQ0FBcEI7QUFDQWhCLG1CQUFXK0IsTUFBWCxDQUFrQmYsTUFBbEIsRUFBeUIsQ0FBekI7QUFDRjtBQUNDLE9BSk0sTUFJQSxJQUFJVixjQUFjLEdBQWxCLEVBQXVCO0FBQzVCUixjQUFNaUMsTUFBTixDQUFhZixNQUFiLEVBQW9CLENBQXBCLEVBQXVCRSxPQUF2QjtBQUNBbEIsbUJBQVcrQixNQUFYLENBQWtCZixNQUFsQixFQUF5QixDQUF6QixFQUE0QmEsU0FBNUI7QUFDQWI7QUFDRCxPQUpNLE1BSUEsSUFBSVYsY0FBYyxJQUFsQixFQUF3QjtBQUM3QixZQUFJMEIsb0JBQW9CakIsTUFBS2pCLEtBQUwsQ0FBV21CLElBQUksQ0FBZixJQUFvQkYsTUFBS2pCLEtBQUwsQ0FBV21CLElBQUksQ0FBZixFQUFrQixDQUFsQixDQUFwQixHQUEyQyxJQUFuRTtBQUNBLFlBQUllLHNCQUFzQixHQUExQixFQUErQjtBQUM3QnBCLHdCQUFjLElBQWQ7QUFDRCxTQUZELE1BRU8sSUFBSW9CLHNCQUFzQixHQUExQixFQUErQjtBQUNwQ25CLHFCQUFXLElBQVg7QUFDRDtBQUNGO0FBQ0Y7QUFDRjs7QUFFRDtBQUNBLE1BQUlELFdBQUosRUFBaUI7QUFDZixXQUFPLENBQUNkLE1BQU1BLE1BQU1GLE1BQU4sR0FBZSxDQUFyQixDQUFSLEVBQWlDO0FBQy9CRSxZQUFNbUMsR0FBTjtBQUNBakMsaUJBQVdpQyxHQUFYO0FBQ0Q7QUFDRixHQUxELE1BS08sSUFBSXBCLFFBQUosRUFBYztBQUNuQmYsVUFBTW9DLElBQU4sQ0FBVyxFQUFYO0FBQ0FsQyxlQUFXa0MsSUFBWCxDQUFnQixJQUFoQjtBQUNEO0FBQ0QsT0FBSyxJQUFJQyxLQUFLLENBQWQsRUFBaUJBLEtBQUtyQyxNQUFNRixNQUFOLEdBQWUsQ0FBckMsRUFBd0N1QyxJQUF4QyxFQUE4QztBQUM1Q3JDLFVBQU1xQyxFQUFOLElBQVlyQyxNQUFNcUMsRUFBTixJQUFZbkMsV0FBV21DLEVBQVgsQ0FBeEI7QUFDRDtBQUNELFNBQU9yQyxNQUFNc0MsSUFBTixDQUFXLEVBQVgsQ0FBUDtBQUNEOztBQUVEO0FBQ08sU0FBUzlDLFlBQVQsQ0FBc0JFLE9BQXRCLEVBQStCQyxPQUEvQixFQUF3QztBQUM3QyxNQUFJLE9BQU9ELE9BQVAsS0FBbUIsUUFBdkIsRUFBaUM7QUFDL0JBLGNBQVUsd0VBQVdBLE9BQVgsQ0FBVjtBQUNEOztBQUVELE1BQUk2QyxlQUFlLENBQW5CO0FBQ0EsV0FBU0MsWUFBVCxHQUF3QjtBQUN0QixRQUFJQyxRQUFRL0MsUUFBUTZDLGNBQVIsQ0FBWjtBQUNBLFFBQUksQ0FBQ0UsS0FBTCxFQUFZO0FBQ1YsYUFBTzlDLFFBQVErQyxRQUFSLEVBQVA7QUFDRDs7QUFFRC9DLFlBQVFnRCxRQUFSLENBQWlCRixLQUFqQixFQUF3QixVQUFTRyxHQUFULEVBQWNDLElBQWQsRUFBb0I7QUFDMUMsVUFBSUQsR0FBSixFQUFTO0FBQ1AsZUFBT2pELFFBQVErQyxRQUFSLENBQWlCRSxHQUFqQixDQUFQO0FBQ0Q7O0FBRUQsVUFBSUUsaUJBQWlCdkQsV0FBV3NELElBQVgsRUFBaUJKLEtBQWpCLEVBQXdCOUMsT0FBeEIsQ0FBckI7QUFDQUEsY0FBUW9ELE9BQVIsQ0FBZ0JOLEtBQWhCLEVBQXVCSyxjQUF2QixFQUF1QyxVQUFTRixHQUFULEVBQWM7QUFDbkQsWUFBSUEsR0FBSixFQUFTO0FBQ1AsaUJBQU9qRCxRQUFRK0MsUUFBUixDQUFpQkUsR0FBakIsQ0FBUDtBQUNEOztBQUVESjtBQUNELE9BTkQ7QUFPRCxLQWJEO0FBY0Q7QUFDREE7QUFDRCIsImZpbGUiOiJhcHBseS5qcyIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7cGFyc2VQYXRjaH0gZnJvbSAnLi9wYXJzZSc7XG5pbXBvcnQgZGlzdGFuY2VJdGVyYXRvciBmcm9tICcuLi91dGlsL2Rpc3RhbmNlLWl0ZXJhdG9yJztcblxuZXhwb3J0IGZ1bmN0aW9uIGFwcGx5UGF0Y2goc291cmNlLCB1bmlEaWZmLCBvcHRpb25zID0ge30pIHtcbiAgaWYgKHR5cGVvZiB1bmlEaWZmID09PSAnc3RyaW5nJykge1xuICAgIHVuaURpZmYgPSBwYXJzZVBhdGNoKHVuaURpZmYpO1xuICB9XG5cbiAgaWYgKEFycmF5LmlzQXJyYXkodW5pRGlmZikpIHtcbiAgICBpZiAodW5pRGlmZi5sZW5ndGggPiAxKSB7XG4gICAgICB0aHJvdyBuZXcgRXJyb3IoJ2FwcGx5UGF0Y2ggb25seSB3b3JrcyB3aXRoIGEgc2luZ2xlIGlucHV0LicpO1xuICAgIH1cblxuICAgIHVuaURpZmYgPSB1bmlEaWZmWzBdO1xuICB9XG5cbiAgLy8gQXBwbHkgdGhlIGRpZmYgdG8gdGhlIGlucHV0XG4gIGxldCBsaW5lcyA9IHNvdXJjZS5zcGxpdCgvXFxyXFxufFtcXG5cXHZcXGZcXHJcXHg4NV0vKSxcbiAgICAgIGRlbGltaXRlcnMgPSBzb3VyY2UubWF0Y2goL1xcclxcbnxbXFxuXFx2XFxmXFxyXFx4ODVdL2cpIHx8IFtdLFxuICAgICAgaHVua3MgPSB1bmlEaWZmLmh1bmtzLFxuXG4gICAgICBjb21wYXJlTGluZSA9IG9wdGlvbnMuY29tcGFyZUxpbmUgfHwgKChsaW5lTnVtYmVyLCBsaW5lLCBvcGVyYXRpb24sIHBhdGNoQ29udGVudCkgPT4gbGluZSA9PT0gcGF0Y2hDb250ZW50KSxcbiAgICAgIGVycm9yQ291bnQgPSAwLFxuICAgICAgZnV6ekZhY3RvciA9IG9wdGlvbnMuZnV6ekZhY3RvciB8fCAwLFxuICAgICAgbWluTGluZSA9IDAsXG4gICAgICBvZmZzZXQgPSAwLFxuXG4gICAgICByZW1vdmVFT0ZOTCxcbiAgICAgIGFkZEVPRk5MO1xuXG4gIC8qKlxuICAgKiBDaGVja3MgaWYgdGhlIGh1bmsgZXhhY3RseSBmaXRzIG9uIHRoZSBwcm92aWRlZCBsb2NhdGlvblxuICAgKi9cbiAgZnVuY3Rpb24gaHVua0ZpdHMoaHVuaywgdG9Qb3MpIHtcbiAgICBmb3IgKGxldCBqID0gMDsgaiA8IGh1bmsubGluZXMubGVuZ3RoOyBqKyspIHtcbiAgICAgIGxldCBsaW5lID0gaHVuay5saW5lc1tqXSxcbiAgICAgICAgICBvcGVyYXRpb24gPSAobGluZS5sZW5ndGggPiAwID8gbGluZVswXSA6ICcgJyksXG4gICAgICAgICAgY29udGVudCA9IChsaW5lLmxlbmd0aCA+IDAgPyBsaW5lLnN1YnN0cigxKSA6IGxpbmUpO1xuXG4gICAgICBpZiAob3BlcmF0aW9uID09PSAnICcgfHwgb3BlcmF0aW9uID09PSAnLScpIHtcbiAgICAgICAgLy8gQ29udGV4dCBzYW5pdHkgY2hlY2tcbiAgICAgICAgaWYgKCFjb21wYXJlTGluZSh0b1BvcyArIDEsIGxpbmVzW3RvUG9zXSwgb3BlcmF0aW9uLCBjb250ZW50KSkge1xuICAgICAgICAgIGVycm9yQ291bnQrKztcblxuICAgICAgICAgIGlmIChlcnJvckNvdW50ID4gZnV6ekZhY3Rvcikge1xuICAgICAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICB0b1BvcysrO1xuICAgICAgfVxuICAgIH1cblxuICAgIHJldHVybiB0cnVlO1xuICB9XG5cbiAgLy8gU2VhcmNoIGJlc3QgZml0IG9mZnNldHMgZm9yIGVhY2ggaHVuayBiYXNlZCBvbiB0aGUgcHJldmlvdXMgb25lc1xuICBmb3IgKGxldCBpID0gMDsgaSA8IGh1bmtzLmxlbmd0aDsgaSsrKSB7XG4gICAgbGV0IGh1bmsgPSBodW5rc1tpXSxcbiAgICAgICAgbWF4TGluZSA9IGxpbmVzLmxlbmd0aCAtIGh1bmsub2xkTGluZXMsXG4gICAgICAgIGxvY2FsT2Zmc2V0ID0gMCxcbiAgICAgICAgdG9Qb3MgPSBvZmZzZXQgKyBodW5rLm9sZFN0YXJ0IC0gMTtcblxuICAgIGxldCBpdGVyYXRvciA9IGRpc3RhbmNlSXRlcmF0b3IodG9Qb3MsIG1pbkxpbmUsIG1heExpbmUpO1xuXG4gICAgZm9yICg7IGxvY2FsT2Zmc2V0ICE9PSB1bmRlZmluZWQ7IGxvY2FsT2Zmc2V0ID0gaXRlcmF0b3IoKSkge1xuICAgICAgaWYgKGh1bmtGaXRzKGh1bmssIHRvUG9zICsgbG9jYWxPZmZzZXQpKSB7XG4gICAgICAgIGh1bmsub2Zmc2V0ID0gb2Zmc2V0ICs9IGxvY2FsT2Zmc2V0O1xuICAgICAgICBicmVhaztcbiAgICAgIH1cbiAgICB9XG5cbiAgICBpZiAobG9jYWxPZmZzZXQgPT09IHVuZGVmaW5lZCkge1xuICAgICAgcmV0dXJuIGZhbHNlO1xuICAgIH1cblxuICAgIC8vIFNldCBsb3dlciB0ZXh0IGxpbWl0IHRvIGVuZCBvZiB0aGUgY3VycmVudCBodW5rLCBzbyBuZXh0IG9uZXMgZG9uJ3QgdHJ5XG4gICAgLy8gdG8gZml0IG92ZXIgYWxyZWFkeSBwYXRjaGVkIHRleHRcbiAgICBtaW5MaW5lID0gaHVuay5vZmZzZXQgKyBodW5rLm9sZFN0YXJ0ICsgaHVuay5vbGRMaW5lcztcbiAgfVxuXG4gIC8vIEFwcGx5IHBhdGNoIGh1bmtzXG4gIGxldCBkaWZmT2Zmc2V0ID0gMDtcbiAgZm9yIChsZXQgaSA9IDA7IGkgPCBodW5rcy5sZW5ndGg7IGkrKykge1xuICAgIGxldCBodW5rID0gaHVua3NbaV0sXG4gICAgICAgIHRvUG9zID0gaHVuay5vbGRTdGFydCArIGh1bmsub2Zmc2V0ICsgZGlmZk9mZnNldCAtIDE7XG4gICAgZGlmZk9mZnNldCArPSBodW5rLm5ld0xpbmVzIC0gaHVuay5vbGRMaW5lcztcblxuICAgIGlmICh0b1BvcyA8IDApIHsgLy8gQ3JlYXRpbmcgYSBuZXcgZmlsZVxuICAgICAgdG9Qb3MgPSAwO1xuICAgIH1cblxuICAgIGZvciAobGV0IGogPSAwOyBqIDwgaHVuay5saW5lcy5sZW5ndGg7IGorKykge1xuICAgICAgbGV0IGxpbmUgPSBodW5rLmxpbmVzW2pdLFxuICAgICAgICAgIG9wZXJhdGlvbiA9IChsaW5lLmxlbmd0aCA+IDAgPyBsaW5lWzBdIDogJyAnKSxcbiAgICAgICAgICBjb250ZW50ID0gKGxpbmUubGVuZ3RoID4gMCA/IGxpbmUuc3Vic3RyKDEpIDogbGluZSksXG4gICAgICAgICAgZGVsaW1pdGVyID0gaHVuay5saW5lZGVsaW1pdGVyc1tqXTtcblxuICAgICAgaWYgKG9wZXJhdGlvbiA9PT0gJyAnKSB7XG4gICAgICAgIHRvUG9zKys7XG4gICAgICB9IGVsc2UgaWYgKG9wZXJhdGlvbiA9PT0gJy0nKSB7XG4gICAgICAgIGxpbmVzLnNwbGljZSh0b1BvcywgMSk7XG4gICAgICAgIGRlbGltaXRlcnMuc3BsaWNlKHRvUG9zLCAxKTtcbiAgICAgIC8qIGlzdGFuYnVsIGlnbm9yZSBlbHNlICovXG4gICAgICB9IGVsc2UgaWYgKG9wZXJhdGlvbiA9PT0gJysnKSB7XG4gICAgICAgIGxpbmVzLnNwbGljZSh0b1BvcywgMCwgY29udGVudCk7XG4gICAgICAgIGRlbGltaXRlcnMuc3BsaWNlKHRvUG9zLCAwLCBkZWxpbWl0ZXIpO1xuICAgICAgICB0b1BvcysrO1xuICAgICAgfSBlbHNlIGlmIChvcGVyYXRpb24gPT09ICdcXFxcJykge1xuICAgICAgICBsZXQgcHJldmlvdXNPcGVyYXRpb24gPSBodW5rLmxpbmVzW2ogLSAxXSA/IGh1bmsubGluZXNbaiAtIDFdWzBdIDogbnVsbDtcbiAgICAgICAgaWYgKHByZXZpb3VzT3BlcmF0aW9uID09PSAnKycpIHtcbiAgICAgICAgICByZW1vdmVFT0ZOTCA9IHRydWU7XG4gICAgICAgIH0gZWxzZSBpZiAocHJldmlvdXNPcGVyYXRpb24gPT09ICctJykge1xuICAgICAgICAgIGFkZEVPRk5MID0gdHJ1ZTtcbiAgICAgICAgfVxuICAgICAgfVxuICAgIH1cbiAgfVxuXG4gIC8vIEhhbmRsZSBFT0ZOTCBpbnNlcnRpb24vcmVtb3ZhbFxuICBpZiAocmVtb3ZlRU9GTkwpIHtcbiAgICB3aGlsZSAoIWxpbmVzW2xpbmVzLmxlbmd0aCAtIDFdKSB7XG4gICAgICBsaW5lcy5wb3AoKTtcbiAgICAgIGRlbGltaXRlcnMucG9wKCk7XG4gICAgfVxuICB9IGVsc2UgaWYgKGFkZEVPRk5MKSB7XG4gICAgbGluZXMucHVzaCgnJyk7XG4gICAgZGVsaW1pdGVycy5wdXNoKCdcXG4nKTtcbiAgfVxuICBmb3IgKGxldCBfayA9IDA7IF9rIDwgbGluZXMubGVuZ3RoIC0gMTsgX2srKykge1xuICAgIGxpbmVzW19rXSA9IGxpbmVzW19rXSArIGRlbGltaXRlcnNbX2tdO1xuICB9XG4gIHJldHVybiBsaW5lcy5qb2luKCcnKTtcbn1cblxuLy8gV3JhcHBlciB0aGF0IHN1cHBvcnRzIG11bHRpcGxlIGZpbGUgcGF0Y2hlcyB2aWEgY2FsbGJhY2tzLlxuZXhwb3J0IGZ1bmN0aW9uIGFwcGx5UGF0Y2hlcyh1bmlEaWZmLCBvcHRpb25zKSB7XG4gIGlmICh0eXBlb2YgdW5pRGlmZiA9PT0gJ3N0cmluZycpIHtcbiAgICB1bmlEaWZmID0gcGFyc2VQYXRjaCh1bmlEaWZmKTtcbiAgfVxuXG4gIGxldCBjdXJyZW50SW5kZXggPSAwO1xuICBmdW5jdGlvbiBwcm9jZXNzSW5kZXgoKSB7XG4gICAgbGV0IGluZGV4ID0gdW5pRGlmZltjdXJyZW50SW5kZXgrK107XG4gICAgaWYgKCFpbmRleCkge1xuICAgICAgcmV0dXJuIG9wdGlvbnMuY29tcGxldGUoKTtcbiAgICB9XG5cbiAgICBvcHRpb25zLmxvYWRGaWxlKGluZGV4LCBmdW5jdGlvbihlcnIsIGRhdGEpIHtcbiAgICAgIGlmIChlcnIpIHtcbiAgICAgICAgcmV0dXJuIG9wdGlvbnMuY29tcGxldGUoZXJyKTtcbiAgICAgIH1cblxuICAgICAgbGV0IHVwZGF0ZWRDb250ZW50ID0gYXBwbHlQYXRjaChkYXRhLCBpbmRleCwgb3B0aW9ucyk7XG4gICAgICBvcHRpb25zLnBhdGNoZWQoaW5kZXgsIHVwZGF0ZWRDb250ZW50LCBmdW5jdGlvbihlcnIpIHtcbiAgICAgICAgaWYgKGVycikge1xuICAgICAgICAgIHJldHVybiBvcHRpb25zLmNvbXBsZXRlKGVycik7XG4gICAgICAgIH1cblxuICAgICAgICBwcm9jZXNzSW5kZXgoKTtcbiAgICAgIH0pO1xuICAgIH0pO1xuICB9XG4gIHByb2Nlc3NJbmRleCgpO1xufVxuIl19 32239 32240 32241 /***/ }), 32242 /* 11 */ 32243 /***/ (function(module, exports) { 32244 32245 /*istanbul ignore start*/'use strict'; 32246 32247 exports.__esModule = true; 32248 exports. /*istanbul ignore end*/parsePatch = parsePatch; 32249 function parsePatch(uniDiff) { 32250 /*istanbul ignore start*/var /*istanbul ignore end*/options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; 32251 32252 var diffstr = uniDiff.split(/\r\n|[\n\v\f\r\x85]/), 32253 delimiters = uniDiff.match(/\r\n|[\n\v\f\r\x85]/g) || [], 32254 list = [], 32255 i = 0; 32256 32257 function parseIndex() { 32258 var index = {}; 32259 list.push(index); 32260 32261 // Parse diff metadata 32262 while (i < diffstr.length) { 32263 var line = diffstr[i]; 32264 32265 // File header found, end parsing diff metadata 32266 if (/^(\-\-\-|\+\+\+|@@)\s/.test(line)) { 32267 break; 32268 } 32269 32270 // Diff index 32271 var header = /^(?:Index:|diff(?: -r \w+)+)\s+(.+?)\s*$/.exec(line); 32272 if (header) { 32273 index.index = header[1]; 32274 } 32275 32276 i++; 32277 } 32278 32279 // Parse file headers if they are defined. Unified diff requires them, but 32280 // there's no technical issues to have an isolated hunk without file header 32281 parseFileHeader(index); 32282 parseFileHeader(index); 32283 32284 // Parse hunks 32285 index.hunks = []; 32286 32287 while (i < diffstr.length) { 32288 var _line = diffstr[i]; 32289 32290 if (/^(Index:|diff|\-\-\-|\+\+\+)\s/.test(_line)) { 32291 break; 32292 } else if (/^@@/.test(_line)) { 32293 index.hunks.push(parseHunk()); 32294 } else if (_line && options.strict) { 32295 // Ignore unexpected content unless in strict mode 32296 throw new Error('Unknown line ' + (i + 1) + ' ' + JSON.stringify(_line)); 32297 } else { 32298 i++; 32299 } 32300 } 32301 } 32302 32303 // Parses the --- and +++ headers, if none are found, no lines 32304 // are consumed. 32305 function parseFileHeader(index) { 32306 var fileHeader = /^(---|\+\+\+)\s+(.*)$/.exec(diffstr[i]); 32307 if (fileHeader) { 32308 var keyPrefix = fileHeader[1] === '---' ? 'old' : 'new'; 32309 var data = fileHeader[2].split('\t', 2); 32310 var fileName = data[0].replace(/\\\\/g, '\\'); 32311 if (/^".*"$/.test(fileName)) { 32312 fileName = fileName.substr(1, fileName.length - 2); 32313 } 32314 index[keyPrefix + 'FileName'] = fileName; 32315 index[keyPrefix + 'Header'] = (data[1] || '').trim(); 32316 32317 i++; 32318 } 32319 } 32320 32321 // Parses a hunk 32322 // This assumes that we are at the start of a hunk. 32323 function parseHunk() { 32324 var chunkHeaderIndex = i, 32325 chunkHeaderLine = diffstr[i++], 32326 chunkHeader = chunkHeaderLine.split(/@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@/); 32327 32328 var hunk = { 32329 oldStart: +chunkHeader[1], 32330 oldLines: +chunkHeader[2] || 1, 32331 newStart: +chunkHeader[3], 32332 newLines: +chunkHeader[4] || 1, 32333 lines: [], 32334 linedelimiters: [] 32335 }; 32336 32337 var addCount = 0, 32338 removeCount = 0; 32339 for (; i < diffstr.length; i++) { 32340 // Lines starting with '---' could be mistaken for the "remove line" operation 32341 // But they could be the header for the next file. Therefore prune such cases out. 32342 if (diffstr[i].indexOf('--- ') === 0 && i + 2 < diffstr.length && diffstr[i + 1].indexOf('+++ ') === 0 && diffstr[i + 2].indexOf('@@') === 0) { 32343 break; 32344 } 32345 var operation = diffstr[i].length == 0 && i != diffstr.length - 1 ? ' ' : diffstr[i][0]; 32346 32347 if (operation === '+' || operation === '-' || operation === ' ' || operation === '\\') { 32348 hunk.lines.push(diffstr[i]); 32349 hunk.linedelimiters.push(delimiters[i] || '\n'); 32350 32351 if (operation === '+') { 32352 addCount++; 32353 } else if (operation === '-') { 32354 removeCount++; 32355 } else if (operation === ' ') { 32356 addCount++; 32357 removeCount++; 32358 } 32359 } else { 32360 break; 32361 } 32362 } 32363 32364 // Handle the empty block count case 32365 if (!addCount && hunk.newLines === 1) { 32366 hunk.newLines = 0; 32367 } 32368 if (!removeCount && hunk.oldLines === 1) { 32369 hunk.oldLines = 0; 32370 } 32371 32372 // Perform optional sanity checking 32373 if (options.strict) { 32374 if (addCount !== hunk.newLines) { 32375 throw new Error('Added line count did not match for hunk at line ' + (chunkHeaderIndex + 1)); 32376 } 32377 if (removeCount !== hunk.oldLines) { 32378 throw new Error('Removed line count did not match for hunk at line ' + (chunkHeaderIndex + 1)); 32379 } 32380 } 32381 32382 return hunk; 32383 } 32384 32385 while (i < diffstr.length) { 32386 parseIndex(); 32387 } 32388 32389 return list; 32390 } 32391 //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9wYXRjaC9wYXJzZS5qcyJdLCJuYW1lcyI6WyJwYXJzZVBhdGNoIiwidW5pRGlmZiIsIm9wdGlvbnMiLCJkaWZmc3RyIiwic3BsaXQiLCJkZWxpbWl0ZXJzIiwibWF0Y2giLCJsaXN0IiwiaSIsInBhcnNlSW5kZXgiLCJpbmRleCIsInB1c2giLCJsZW5ndGgiLCJsaW5lIiwidGVzdCIsImhlYWRlciIsImV4ZWMiLCJwYXJzZUZpbGVIZWFkZXIiLCJodW5rcyIsInBhcnNlSHVuayIsInN0cmljdCIsIkVycm9yIiwiSlNPTiIsInN0cmluZ2lmeSIsImZpbGVIZWFkZXIiLCJrZXlQcmVmaXgiLCJkYXRhIiwiZmlsZU5hbWUiLCJyZXBsYWNlIiwic3Vic3RyIiwidHJpbSIsImNodW5rSGVhZGVySW5kZXgiLCJjaHVua0hlYWRlckxpbmUiLCJjaHVua0hlYWRlciIsImh1bmsiLCJvbGRTdGFydCIsIm9sZExpbmVzIiwibmV3U3RhcnQiLCJuZXdMaW5lcyIsImxpbmVzIiwibGluZWRlbGltaXRlcnMiLCJhZGRDb3VudCIsInJlbW92ZUNvdW50IiwiaW5kZXhPZiIsIm9wZXJhdGlvbiJdLCJtYXBwaW5ncyI6Ijs7O2dDQUFnQkEsVSxHQUFBQSxVO0FBQVQsU0FBU0EsVUFBVCxDQUFvQkMsT0FBcEIsRUFBMkM7QUFBQSxzREFBZEMsT0FBYyx1RUFBSixFQUFJOztBQUNoRCxNQUFJQyxVQUFVRixRQUFRRyxLQUFSLENBQWMscUJBQWQsQ0FBZDtBQUFBLE1BQ0lDLGFBQWFKLFFBQVFLLEtBQVIsQ0FBYyxzQkFBZCxLQUF5QyxFQUQxRDtBQUFBLE1BRUlDLE9BQU8sRUFGWDtBQUFBLE1BR0lDLElBQUksQ0FIUjs7QUFLQSxXQUFTQyxVQUFULEdBQXNCO0FBQ3BCLFFBQUlDLFFBQVEsRUFBWjtBQUNBSCxTQUFLSSxJQUFMLENBQVVELEtBQVY7O0FBRUE7QUFDQSxXQUFPRixJQUFJTCxRQUFRUyxNQUFuQixFQUEyQjtBQUN6QixVQUFJQyxPQUFPVixRQUFRSyxDQUFSLENBQVg7O0FBRUE7QUFDQSxVQUFJLHdCQUF3Qk0sSUFBeEIsQ0FBNkJELElBQTdCLENBQUosRUFBd0M7QUFDdEM7QUFDRDs7QUFFRDtBQUNBLFVBQUlFLFNBQVUsMENBQUQsQ0FBNkNDLElBQTdDLENBQWtESCxJQUFsRCxDQUFiO0FBQ0EsVUFBSUUsTUFBSixFQUFZO0FBQ1ZMLGNBQU1BLEtBQU4sR0FBY0ssT0FBTyxDQUFQLENBQWQ7QUFDRDs7QUFFRFA7QUFDRDs7QUFFRDtBQUNBO0FBQ0FTLG9CQUFnQlAsS0FBaEI7QUFDQU8sb0JBQWdCUCxLQUFoQjs7QUFFQTtBQUNBQSxVQUFNUSxLQUFOLEdBQWMsRUFBZDs7QUFFQSxXQUFPVixJQUFJTCxRQUFRUyxNQUFuQixFQUEyQjtBQUN6QixVQUFJQyxRQUFPVixRQUFRSyxDQUFSLENBQVg7O0FBRUEsVUFBSSxpQ0FBaUNNLElBQWpDLENBQXNDRCxLQUF0QyxDQUFKLEVBQWlEO0FBQy9DO0FBQ0QsT0FGRCxNQUVPLElBQUksTUFBTUMsSUFBTixDQUFXRCxLQUFYLENBQUosRUFBc0I7QUFDM0JILGNBQU1RLEtBQU4sQ0FBWVAsSUFBWixDQUFpQlEsV0FBakI7QUFDRCxPQUZNLE1BRUEsSUFBSU4sU0FBUVgsUUFBUWtCLE1BQXBCLEVBQTRCO0FBQ2pDO0FBQ0EsY0FBTSxJQUFJQyxLQUFKLENBQVUsbUJBQW1CYixJQUFJLENBQXZCLElBQTRCLEdBQTVCLEdBQWtDYyxLQUFLQyxTQUFMLENBQWVWLEtBQWYsQ0FBNUMsQ0FBTjtBQUNELE9BSE0sTUFHQTtBQUNMTDtBQUNEO0FBQ0Y7QUFDRjs7QUFFRDtBQUNBO0FBQ0EsV0FBU1MsZUFBVCxDQUF5QlAsS0FBekIsRUFBZ0M7QUFDOUIsUUFBTWMsYUFBYyx1QkFBRCxDQUEwQlIsSUFBMUIsQ0FBK0JiLFFBQVFLLENBQVIsQ0FBL0IsQ0FBbkI7QUFDQSxRQUFJZ0IsVUFBSixFQUFnQjtBQUNkLFVBQUlDLFlBQVlELFdBQVcsQ0FBWCxNQUFrQixLQUFsQixHQUEwQixLQUExQixHQUFrQyxLQUFsRDtBQUNBLFVBQU1FLE9BQU9GLFdBQVcsQ0FBWCxFQUFjcEIsS0FBZCxDQUFvQixJQUFwQixFQUEwQixDQUExQixDQUFiO0FBQ0EsVUFBSXVCLFdBQVdELEtBQUssQ0FBTCxFQUFRRSxPQUFSLENBQWdCLE9BQWhCLEVBQXlCLElBQXpCLENBQWY7QUFDQSxVQUFJLFNBQVNkLElBQVQsQ0FBY2EsUUFBZCxDQUFKLEVBQTZCO0FBQzNCQSxtQkFBV0EsU0FBU0UsTUFBVCxDQUFnQixDQUFoQixFQUFtQkYsU0FBU2YsTUFBVCxHQUFrQixDQUFyQyxDQUFYO0FBQ0Q7QUFDREYsWUFBTWUsWUFBWSxVQUFsQixJQUFnQ0UsUUFBaEM7QUFDQWpCLFlBQU1lLFlBQVksUUFBbEIsSUFBOEIsQ0FBQ0MsS0FBSyxDQUFMLEtBQVcsRUFBWixFQUFnQkksSUFBaEIsRUFBOUI7O0FBRUF0QjtBQUNEO0FBQ0Y7O0FBRUQ7QUFDQTtBQUNBLFdBQVNXLFNBQVQsR0FBcUI7QUFDbkIsUUFBSVksbUJBQW1CdkIsQ0FBdkI7QUFBQSxRQUNJd0Isa0JBQWtCN0IsUUFBUUssR0FBUixDQUR0QjtBQUFBLFFBRUl5QixjQUFjRCxnQkFBZ0I1QixLQUFoQixDQUFzQiw0Q0FBdEIsQ0FGbEI7O0FBSUEsUUFBSThCLE9BQU87QUFDVEMsZ0JBQVUsQ0FBQ0YsWUFBWSxDQUFaLENBREY7QUFFVEcsZ0JBQVUsQ0FBQ0gsWUFBWSxDQUFaLENBQUQsSUFBbUIsQ0FGcEI7QUFHVEksZ0JBQVUsQ0FBQ0osWUFBWSxDQUFaLENBSEY7QUFJVEssZ0JBQVUsQ0FBQ0wsWUFBWSxDQUFaLENBQUQsSUFBbUIsQ0FKcEI7QUFLVE0sYUFBTyxFQUxFO0FBTVRDLHNCQUFnQjtBQU5QLEtBQVg7O0FBU0EsUUFBSUMsV0FBVyxDQUFmO0FBQUEsUUFDSUMsY0FBYyxDQURsQjtBQUVBLFdBQU9sQyxJQUFJTCxRQUFRUyxNQUFuQixFQUEyQkosR0FBM0IsRUFBZ0M7QUFDOUI7QUFDQTtBQUNBLFVBQUlMLFFBQVFLLENBQVIsRUFBV21DLE9BQVgsQ0FBbUIsTUFBbkIsTUFBK0IsQ0FBL0IsSUFDTW5DLElBQUksQ0FBSixHQUFRTCxRQUFRUyxNQUR0QixJQUVLVCxRQUFRSyxJQUFJLENBQVosRUFBZW1DLE9BQWYsQ0FBdUIsTUFBdkIsTUFBbUMsQ0FGeEMsSUFHS3hDLFFBQVFLLElBQUksQ0FBWixFQUFlbUMsT0FBZixDQUF1QixJQUF2QixNQUFpQyxDQUgxQyxFQUc2QztBQUN6QztBQUNIO0FBQ0QsVUFBSUMsWUFBYXpDLFFBQVFLLENBQVIsRUFBV0ksTUFBWCxJQUFxQixDQUFyQixJQUEwQkosS0FBTUwsUUFBUVMsTUFBUixHQUFpQixDQUFsRCxHQUF3RCxHQUF4RCxHQUE4RFQsUUFBUUssQ0FBUixFQUFXLENBQVgsQ0FBOUU7O0FBRUEsVUFBSW9DLGNBQWMsR0FBZCxJQUFxQkEsY0FBYyxHQUFuQyxJQUEwQ0EsY0FBYyxHQUF4RCxJQUErREEsY0FBYyxJQUFqRixFQUF1RjtBQUNyRlYsYUFBS0ssS0FBTCxDQUFXNUIsSUFBWCxDQUFnQlIsUUFBUUssQ0FBUixDQUFoQjtBQUNBMEIsYUFBS00sY0FBTCxDQUFvQjdCLElBQXBCLENBQXlCTixXQUFXRyxDQUFYLEtBQWlCLElBQTFDOztBQUVBLFlBQUlvQyxjQUFjLEdBQWxCLEVBQXVCO0FBQ3JCSDtBQUNELFNBRkQsTUFFTyxJQUFJRyxjQUFjLEdBQWxCLEVBQXVCO0FBQzVCRjtBQUNELFNBRk0sTUFFQSxJQUFJRSxjQUFjLEdBQWxCLEVBQXVCO0FBQzVCSDtBQUNBQztBQUNEO0FBQ0YsT0FaRCxNQVlPO0FBQ0w7QUFDRDtBQUNGOztBQUVEO0FBQ0EsUUFBSSxDQUFDRCxRQUFELElBQWFQLEtBQUtJLFFBQUwsS0FBa0IsQ0FBbkMsRUFBc0M7QUFDcENKLFdBQUtJLFFBQUwsR0FBZ0IsQ0FBaEI7QUFDRDtBQUNELFFBQUksQ0FBQ0ksV0FBRCxJQUFnQlIsS0FBS0UsUUFBTCxLQUFrQixDQUF0QyxFQUF5QztBQUN2Q0YsV0FBS0UsUUFBTCxHQUFnQixDQUFoQjtBQUNEOztBQUVEO0FBQ0EsUUFBSWxDLFFBQVFrQixNQUFaLEVBQW9CO0FBQ2xCLFVBQUlxQixhQUFhUCxLQUFLSSxRQUF0QixFQUFnQztBQUM5QixjQUFNLElBQUlqQixLQUFKLENBQVUsc0RBQXNEVSxtQkFBbUIsQ0FBekUsQ0FBVixDQUFOO0FBQ0Q7QUFDRCxVQUFJVyxnQkFBZ0JSLEtBQUtFLFFBQXpCLEVBQW1DO0FBQ2pDLGNBQU0sSUFBSWYsS0FBSixDQUFVLHdEQUF3RFUsbUJBQW1CLENBQTNFLENBQVYsQ0FBTjtBQUNEO0FBQ0Y7O0FBRUQsV0FBT0csSUFBUDtBQUNEOztBQUVELFNBQU8xQixJQUFJTCxRQUFRUyxNQUFuQixFQUEyQjtBQUN6Qkg7QUFDRDs7QUFFRCxTQUFPRixJQUFQO0FBQ0QiLCJmaWxlIjoicGFyc2UuanMiLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgZnVuY3Rpb24gcGFyc2VQYXRjaCh1bmlEaWZmLCBvcHRpb25zID0ge30pIHtcbiAgbGV0IGRpZmZzdHIgPSB1bmlEaWZmLnNwbGl0KC9cXHJcXG58W1xcblxcdlxcZlxcclxceDg1XS8pLFxuICAgICAgZGVsaW1pdGVycyA9IHVuaURpZmYubWF0Y2goL1xcclxcbnxbXFxuXFx2XFxmXFxyXFx4ODVdL2cpIHx8IFtdLFxuICAgICAgbGlzdCA9IFtdLFxuICAgICAgaSA9IDA7XG5cbiAgZnVuY3Rpb24gcGFyc2VJbmRleCgpIHtcbiAgICBsZXQgaW5kZXggPSB7fTtcbiAgICBsaXN0LnB1c2goaW5kZXgpO1xuXG4gICAgLy8gUGFyc2UgZGlmZiBtZXRhZGF0YVxuICAgIHdoaWxlIChpIDwgZGlmZnN0ci5sZW5ndGgpIHtcbiAgICAgIGxldCBsaW5lID0gZGlmZnN0cltpXTtcblxuICAgICAgLy8gRmlsZSBoZWFkZXIgZm91bmQsIGVuZCBwYXJzaW5nIGRpZmYgbWV0YWRhdGFcbiAgICAgIGlmICgvXihcXC1cXC1cXC18XFwrXFwrXFwrfEBAKVxccy8udGVzdChsaW5lKSkge1xuICAgICAgICBicmVhaztcbiAgICAgIH1cblxuICAgICAgLy8gRGlmZiBpbmRleFxuICAgICAgbGV0IGhlYWRlciA9ICgvXig/OkluZGV4OnxkaWZmKD86IC1yIFxcdyspKylcXHMrKC4rPylcXHMqJC8pLmV4ZWMobGluZSk7XG4gICAgICBpZiAoaGVhZGVyKSB7XG4gICAgICAgIGluZGV4LmluZGV4ID0gaGVhZGVyWzFdO1xuICAgICAgfVxuXG4gICAgICBpKys7XG4gICAgfVxuXG4gICAgLy8gUGFyc2UgZmlsZSBoZWFkZXJzIGlmIHRoZXkgYXJlIGRlZmluZWQuIFVuaWZpZWQgZGlmZiByZXF1aXJlcyB0aGVtLCBidXRcbiAgICAvLyB0aGVyZSdzIG5vIHRlY2huaWNhbCBpc3N1ZXMgdG8gaGF2ZSBhbiBpc29sYXRlZCBodW5rIHdpdGhvdXQgZmlsZSBoZWFkZXJcbiAgICBwYXJzZUZpbGVIZWFkZXIoaW5kZXgpO1xuICAgIHBhcnNlRmlsZUhlYWRlcihpbmRleCk7XG5cbiAgICAvLyBQYXJzZSBodW5rc1xuICAgIGluZGV4Lmh1bmtzID0gW107XG5cbiAgICB3aGlsZSAoaSA8IGRpZmZzdHIubGVuZ3RoKSB7XG4gICAgICBsZXQgbGluZSA9IGRpZmZzdHJbaV07XG5cbiAgICAgIGlmICgvXihJbmRleDp8ZGlmZnxcXC1cXC1cXC18XFwrXFwrXFwrKVxccy8udGVzdChsaW5lKSkge1xuICAgICAgICBicmVhaztcbiAgICAgIH0gZWxzZSBpZiAoL15AQC8udGVzdChsaW5lKSkge1xuICAgICAgICBpbmRleC5odW5rcy5wdXNoKHBhcnNlSHVuaygpKTtcbiAgICAgIH0gZWxzZSBpZiAobGluZSAmJiBvcHRpb25zLnN0cmljdCkge1xuICAgICAgICAvLyBJZ25vcmUgdW5leHBlY3RlZCBjb250ZW50IHVubGVzcyBpbiBzdHJpY3QgbW9kZVxuICAgICAgICB0aHJvdyBuZXcgRXJyb3IoJ1Vua25vd24gbGluZSAnICsgKGkgKyAxKSArICcgJyArIEpTT04uc3RyaW5naWZ5KGxpbmUpKTtcbiAgICAgIH0gZWxzZSB7XG4gICAgICAgIGkrKztcbiAgICAgIH1cbiAgICB9XG4gIH1cblxuICAvLyBQYXJzZXMgdGhlIC0tLSBhbmQgKysrIGhlYWRlcnMsIGlmIG5vbmUgYXJlIGZvdW5kLCBubyBsaW5lc1xuICAvLyBhcmUgY29uc3VtZWQuXG4gIGZ1bmN0aW9uIHBhcnNlRmlsZUhlYWRlcihpbmRleCkge1xuICAgIGNvbnN0IGZpbGVIZWFkZXIgPSAoL14oLS0tfFxcK1xcK1xcKylcXHMrKC4qKSQvKS5leGVjKGRpZmZzdHJbaV0pO1xuICAgIGlmIChmaWxlSGVhZGVyKSB7XG4gICAgICBsZXQga2V5UHJlZml4ID0gZmlsZUhlYWRlclsxXSA9PT0gJy0tLScgPyAnb2xkJyA6ICduZXcnO1xuICAgICAgY29uc3QgZGF0YSA9IGZpbGVIZWFkZXJbMl0uc3BsaXQoJ1xcdCcsIDIpO1xuICAgICAgbGV0IGZpbGVOYW1lID0gZGF0YVswXS5yZXBsYWNlKC9cXFxcXFxcXC9nLCAnXFxcXCcpO1xuICAgICAgaWYgKC9eXCIuKlwiJC8udGVzdChmaWxlTmFtZSkpIHtcbiAgICAgICAgZmlsZU5hbWUgPSBmaWxlTmFtZS5zdWJzdHIoMSwgZmlsZU5hbWUubGVuZ3RoIC0gMik7XG4gICAgICB9XG4gICAgICBpbmRleFtrZXlQcmVmaXggKyAnRmlsZU5hbWUnXSA9IGZpbGVOYW1lO1xuICAgICAgaW5kZXhba2V5UHJlZml4ICsgJ0hlYWRlciddID0gKGRhdGFbMV0gfHwgJycpLnRyaW0oKTtcblxuICAgICAgaSsrO1xuICAgIH1cbiAgfVxuXG4gIC8vIFBhcnNlcyBhIGh1bmtcbiAgLy8gVGhpcyBhc3N1bWVzIHRoYXQgd2UgYXJlIGF0IHRoZSBzdGFydCBvZiBhIGh1bmsuXG4gIGZ1bmN0aW9uIHBhcnNlSHVuaygpIHtcbiAgICBsZXQgY2h1bmtIZWFkZXJJbmRleCA9IGksXG4gICAgICAgIGNodW5rSGVhZGVyTGluZSA9IGRpZmZzdHJbaSsrXSxcbiAgICAgICAgY2h1bmtIZWFkZXIgPSBjaHVua0hlYWRlckxpbmUuc3BsaXQoL0BAIC0oXFxkKykoPzosKFxcZCspKT8gXFwrKFxcZCspKD86LChcXGQrKSk/IEBALyk7XG5cbiAgICBsZXQgaHVuayA9IHtcbiAgICAgIG9sZFN0YXJ0OiArY2h1bmtIZWFkZXJbMV0sXG4gICAgICBvbGRMaW5lczogK2NodW5rSGVhZGVyWzJdIHx8IDEsXG4gICAgICBuZXdTdGFydDogK2NodW5rSGVhZGVyWzNdLFxuICAgICAgbmV3TGluZXM6ICtjaHVua0hlYWRlcls0XSB8fCAxLFxuICAgICAgbGluZXM6IFtdLFxuICAgICAgbGluZWRlbGltaXRlcnM6IFtdXG4gICAgfTtcblxuICAgIGxldCBhZGRDb3VudCA9IDAsXG4gICAgICAgIHJlbW92ZUNvdW50ID0gMDtcbiAgICBmb3IgKDsgaSA8IGRpZmZzdHIubGVuZ3RoOyBpKyspIHtcbiAgICAgIC8vIExpbmVzIHN0YXJ0aW5nIHdpdGggJy0tLScgY291bGQgYmUgbWlzdGFrZW4gZm9yIHRoZSBcInJlbW92ZSBsaW5lXCIgb3BlcmF0aW9uXG4gICAgICAvLyBCdXQgdGhleSBjb3VsZCBiZSB0aGUgaGVhZGVyIGZvciB0aGUgbmV4dCBmaWxlLiBUaGVyZWZvcmUgcHJ1bmUgc3VjaCBjYXNlcyBvdXQuXG4gICAgICBpZiAoZGlmZnN0cltpXS5pbmRleE9mKCctLS0gJykgPT09IDBcbiAgICAgICAgICAgICYmIChpICsgMiA8IGRpZmZzdHIubGVuZ3RoKVxuICAgICAgICAgICAgJiYgZGlmZnN0cltpICsgMV0uaW5kZXhPZignKysrICcpID09PSAwXG4gICAgICAgICAgICAmJiBkaWZmc3RyW2kgKyAyXS5pbmRleE9mKCdAQCcpID09PSAwKSB7XG4gICAgICAgICAgYnJlYWs7XG4gICAgICB9XG4gICAgICBsZXQgb3BlcmF0aW9uID0gKGRpZmZzdHJbaV0ubGVuZ3RoID09IDAgJiYgaSAhPSAoZGlmZnN0ci5sZW5ndGggLSAxKSkgPyAnICcgOiBkaWZmc3RyW2ldWzBdO1xuXG4gICAgICBpZiAob3BlcmF0aW9uID09PSAnKycgfHwgb3BlcmF0aW9uID09PSAnLScgfHwgb3BlcmF0aW9uID09PSAnICcgfHwgb3BlcmF0aW9uID09PSAnXFxcXCcpIHtcbiAgICAgICAgaHVuay5saW5lcy5wdXNoKGRpZmZzdHJbaV0pO1xuICAgICAgICBodW5rLmxpbmVkZWxpbWl0ZXJzLnB1c2goZGVsaW1pdGVyc1tpXSB8fCAnXFxuJyk7XG5cbiAgICAgICAgaWYgKG9wZXJhdGlvbiA9PT0gJysnKSB7XG4gICAgICAgICAgYWRkQ291bnQrKztcbiAgICAgICAgfSBlbHNlIGlmIChvcGVyYXRpb24gPT09ICctJykge1xuICAgICAgICAgIHJlbW92ZUNvdW50Kys7XG4gICAgICAgIH0gZWxzZSBpZiAob3BlcmF0aW9uID09PSAnICcpIHtcbiAgICAgICAgICBhZGRDb3VudCsrO1xuICAgICAgICAgIHJlbW92ZUNvdW50Kys7XG4gICAgICAgIH1cbiAgICAgIH0gZWxzZSB7XG4gICAgICAgIGJyZWFrO1xuICAgICAgfVxuICAgIH1cblxuICAgIC8vIEhhbmRsZSB0aGUgZW1wdHkgYmxvY2sgY291bnQgY2FzZVxuICAgIGlmICghYWRkQ291bnQgJiYgaHVuay5uZXdMaW5lcyA9PT0gMSkge1xuICAgICAgaHVuay5uZXdMaW5lcyA9IDA7XG4gICAgfVxuICAgIGlmICghcmVtb3ZlQ291bnQgJiYgaHVuay5vbGRMaW5lcyA9PT0gMSkge1xuICAgICAgaHVuay5vbGRMaW5lcyA9IDA7XG4gICAgfVxuXG4gICAgLy8gUGVyZm9ybSBvcHRpb25hbCBzYW5pdHkgY2hlY2tpbmdcbiAgICBpZiAob3B0aW9ucy5zdHJpY3QpIHtcbiAgICAgIGlmIChhZGRDb3VudCAhPT0gaHVuay5uZXdMaW5lcykge1xuICAgICAgICB0aHJvdyBuZXcgRXJyb3IoJ0FkZGVkIGxpbmUgY291bnQgZGlkIG5vdCBtYXRjaCBmb3IgaHVuayBhdCBsaW5lICcgKyAoY2h1bmtIZWFkZXJJbmRleCArIDEpKTtcbiAgICAgIH1cbiAgICAgIGlmIChyZW1vdmVDb3VudCAhPT0gaHVuay5vbGRMaW5lcykge1xuICAgICAgICB0aHJvdyBuZXcgRXJyb3IoJ1JlbW92ZWQgbGluZSBjb3VudCBkaWQgbm90IG1hdGNoIGZvciBodW5rIGF0IGxpbmUgJyArIChjaHVua0hlYWRlckluZGV4ICsgMSkpO1xuICAgICAgfVxuICAgIH1cblxuICAgIHJldHVybiBodW5rO1xuICB9XG5cbiAgd2hpbGUgKGkgPCBkaWZmc3RyLmxlbmd0aCkge1xuICAgIHBhcnNlSW5kZXgoKTtcbiAgfVxuXG4gIHJldHVybiBsaXN0O1xufVxuIl19 32392 32393 32394 /***/ }), 32395 /* 12 */ 32396 /***/ (function(module, exports) { 32397 32398 /*istanbul ignore start*/"use strict"; 32399 32400 exports.__esModule = true; 32401 32402 exports["default"] = /*istanbul ignore end*/function (start, minLine, maxLine) { 32403 var wantForward = true, 32404 backwardExhausted = false, 32405 forwardExhausted = false, 32406 localOffset = 1; 32407 32408 return function iterator() { 32409 if (wantForward && !forwardExhausted) { 32410 if (backwardExhausted) { 32411 localOffset++; 32412 } else { 32413 wantForward = false; 32414 } 32415 32416 // Check if trying to fit beyond text length, and if not, check it fits 32417 // after offset location (or desired location on first iteration) 32418 if (start + localOffset <= maxLine) { 32419 return localOffset; 32420 } 32421 32422 forwardExhausted = true; 32423 } 32424 32425 if (!backwardExhausted) { 32426 if (!forwardExhausted) { 32427 wantForward = true; 32428 } 32429 32430 // Check if trying to fit before text beginning, and if not, check it fits 32431 // before offset location 32432 if (minLine <= start - localOffset) { 32433 return -localOffset++; 32434 } 32435 32436 backwardExhausted = true; 32437 return iterator(); 32438 } 32439 32440 // We tried to fit hunk before text beginning and beyond text length, then 32441 // hunk can't fit on the text. Return undefined 32442 }; 32443 }; 32444 //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy91dGlsL2Rpc3RhbmNlLWl0ZXJhdG9yLmpzIl0sIm5hbWVzIjpbInN0YXJ0IiwibWluTGluZSIsIm1heExpbmUiLCJ3YW50Rm9yd2FyZCIsImJhY2t3YXJkRXhoYXVzdGVkIiwiZm9yd2FyZEV4aGF1c3RlZCIsImxvY2FsT2Zmc2V0IiwiaXRlcmF0b3IiXSwibWFwcGluZ3MiOiI7Ozs7NENBR2UsVUFBU0EsS0FBVCxFQUFnQkMsT0FBaEIsRUFBeUJDLE9BQXpCLEVBQWtDO0FBQy9DLE1BQUlDLGNBQWMsSUFBbEI7QUFBQSxNQUNJQyxvQkFBb0IsS0FEeEI7QUFBQSxNQUVJQyxtQkFBbUIsS0FGdkI7QUFBQSxNQUdJQyxjQUFjLENBSGxCOztBQUtBLFNBQU8sU0FBU0MsUUFBVCxHQUFvQjtBQUN6QixRQUFJSixlQUFlLENBQUNFLGdCQUFwQixFQUFzQztBQUNwQyxVQUFJRCxpQkFBSixFQUF1QjtBQUNyQkU7QUFDRCxPQUZELE1BRU87QUFDTEgsc0JBQWMsS0FBZDtBQUNEOztBQUVEO0FBQ0E7QUFDQSxVQUFJSCxRQUFRTSxXQUFSLElBQXVCSixPQUEzQixFQUFvQztBQUNsQyxlQUFPSSxXQUFQO0FBQ0Q7O0FBRURELHlCQUFtQixJQUFuQjtBQUNEOztBQUVELFFBQUksQ0FBQ0QsaUJBQUwsRUFBd0I7QUFDdEIsVUFBSSxDQUFDQyxnQkFBTCxFQUF1QjtBQUNyQkYsc0JBQWMsSUFBZDtBQUNEOztBQUVEO0FBQ0E7QUFDQSxVQUFJRixXQUFXRCxRQUFRTSxXQUF2QixFQUFvQztBQUNsQyxlQUFPLENBQUNBLGFBQVI7QUFDRDs7QUFFREYsMEJBQW9CLElBQXBCO0FBQ0EsYUFBT0csVUFBUDtBQUNEOztBQUVEO0FBQ0E7QUFDRCxHQWxDRDtBQW1DRCxDIiwiZmlsZSI6ImRpc3RhbmNlLWl0ZXJhdG9yLmpzIiwic291cmNlc0NvbnRlbnQiOlsiLy8gSXRlcmF0b3IgdGhhdCB0cmF2ZXJzZXMgaW4gdGhlIHJhbmdlIG9mIFttaW4sIG1heF0sIHN0ZXBwaW5nXG4vLyBieSBkaXN0YW5jZSBmcm9tIGEgZ2l2ZW4gc3RhcnQgcG9zaXRpb24uIEkuZS4gZm9yIFswLCA0XSwgd2l0aFxuLy8gc3RhcnQgb2YgMiwgdGhpcyB3aWxsIGl0ZXJhdGUgMiwgMywgMSwgNCwgMC5cbmV4cG9ydCBkZWZhdWx0IGZ1bmN0aW9uKHN0YXJ0LCBtaW5MaW5lLCBtYXhMaW5lKSB7XG4gIGxldCB3YW50Rm9yd2FyZCA9IHRydWUsXG4gICAgICBiYWNrd2FyZEV4aGF1c3RlZCA9IGZhbHNlLFxuICAgICAgZm9yd2FyZEV4aGF1c3RlZCA9IGZhbHNlLFxuICAgICAgbG9jYWxPZmZzZXQgPSAxO1xuXG4gIHJldHVybiBmdW5jdGlvbiBpdGVyYXRvcigpIHtcbiAgICBpZiAod2FudEZvcndhcmQgJiYgIWZvcndhcmRFeGhhdXN0ZWQpIHtcbiAgICAgIGlmIChiYWNrd2FyZEV4aGF1c3RlZCkge1xuICAgICAgICBsb2NhbE9mZnNldCsrO1xuICAgICAgfSBlbHNlIHtcbiAgICAgICAgd2FudEZvcndhcmQgPSBmYWxzZTtcbiAgICAgIH1cblxuICAgICAgLy8gQ2hlY2sgaWYgdHJ5aW5nIHRvIGZpdCBiZXlvbmQgdGV4dCBsZW5ndGgsIGFuZCBpZiBub3QsIGNoZWNrIGl0IGZpdHNcbiAgICAgIC8vIGFmdGVyIG9mZnNldCBsb2NhdGlvbiAob3IgZGVzaXJlZCBsb2NhdGlvbiBvbiBmaXJzdCBpdGVyYXRpb24pXG4gICAgICBpZiAoc3RhcnQgKyBsb2NhbE9mZnNldCA8PSBtYXhMaW5lKSB7XG4gICAgICAgIHJldHVybiBsb2NhbE9mZnNldDtcbiAgICAgIH1cblxuICAgICAgZm9yd2FyZEV4aGF1c3RlZCA9IHRydWU7XG4gICAgfVxuXG4gICAgaWYgKCFiYWNrd2FyZEV4aGF1c3RlZCkge1xuICAgICAgaWYgKCFmb3J3YXJkRXhoYXVzdGVkKSB7XG4gICAgICAgIHdhbnRGb3J3YXJkID0gdHJ1ZTtcbiAgICAgIH1cblxuICAgICAgLy8gQ2hlY2sgaWYgdHJ5aW5nIHRvIGZpdCBiZWZvcmUgdGV4dCBiZWdpbm5pbmcsIGFuZCBpZiBub3QsIGNoZWNrIGl0IGZpdHNcbiAgICAgIC8vIGJlZm9yZSBvZmZzZXQgbG9jYXRpb25cbiAgICAgIGlmIChtaW5MaW5lIDw9IHN0YXJ0IC0gbG9jYWxPZmZzZXQpIHtcbiAgICAgICAgcmV0dXJuIC1sb2NhbE9mZnNldCsrO1xuICAgICAgfVxuXG4gICAgICBiYWNrd2FyZEV4aGF1c3RlZCA9IHRydWU7XG4gICAgICByZXR1cm4gaXRlcmF0b3IoKTtcbiAgICB9XG5cbiAgICAvLyBXZSB0cmllZCB0byBmaXQgaHVuayBiZWZvcmUgdGV4dCBiZWdpbm5pbmcgYW5kIGJleW9uZCB0ZXh0IGxlbmd0aCwgdGhlblxuICAgIC8vIGh1bmsgY2FuJ3QgZml0IG9uIHRoZSB0ZXh0LiBSZXR1cm4gdW5kZWZpbmVkXG4gIH07XG59XG4iXX0= 32445 32446 32447 /***/ }), 32448 /* 13 */ 32449 /***/ (function(module, exports, __webpack_require__) { 32450 32451 /*istanbul ignore start*/'use strict'; 32452 32453 exports.__esModule = true; 32454 exports. /*istanbul ignore end*/calcLineCount = calcLineCount; 32455 /*istanbul ignore start*/exports. /*istanbul ignore end*/merge = merge; 32456 32457 var /*istanbul ignore start*/_create = __webpack_require__(14) /*istanbul ignore end*/; 32458 32459 var /*istanbul ignore start*/_parse = __webpack_require__(11) /*istanbul ignore end*/; 32460 32461 var /*istanbul ignore start*/_array = __webpack_require__(15) /*istanbul ignore end*/; 32462 32463 /*istanbul ignore start*/function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } 32464 32465 /*istanbul ignore end*/function calcLineCount(hunk) { 32466 /*istanbul ignore start*/var _calcOldNewLineCount = /*istanbul ignore end*/calcOldNewLineCount(hunk.lines), 32467 oldLines = _calcOldNewLineCount.oldLines, 32468 newLines = _calcOldNewLineCount.newLines; 32469 32470 if (oldLines !== undefined) { 32471 hunk.oldLines = oldLines; 32472 } else { 32473 delete hunk.oldLines; 32474 } 32475 32476 if (newLines !== undefined) { 32477 hunk.newLines = newLines; 32478 } else { 32479 delete hunk.newLines; 32480 } 32481 } 32482 32483 function merge(mine, theirs, base) { 32484 mine = loadPatch(mine, base); 32485 theirs = loadPatch(theirs, base); 32486 32487 var ret = {}; 32488 32489 // For index we just let it pass through as it doesn't have any necessary meaning. 32490 // Leaving sanity checks on this to the API consumer that may know more about the 32491 // meaning in their own context. 32492 if (mine.index || theirs.index) { 32493 ret.index = mine.index || theirs.index; 32494 } 32495 32496 if (mine.newFileName || theirs.newFileName) { 32497 if (!fileNameChanged(mine)) { 32498 // No header or no change in ours, use theirs (and ours if theirs does not exist) 32499 ret.oldFileName = theirs.oldFileName || mine.oldFileName; 32500 ret.newFileName = theirs.newFileName || mine.newFileName; 32501 ret.oldHeader = theirs.oldHeader || mine.oldHeader; 32502 ret.newHeader = theirs.newHeader || mine.newHeader; 32503 } else if (!fileNameChanged(theirs)) { 32504 // No header or no change in theirs, use ours 32505 ret.oldFileName = mine.oldFileName; 32506 ret.newFileName = mine.newFileName; 32507 ret.oldHeader = mine.oldHeader; 32508 ret.newHeader = mine.newHeader; 32509 } else { 32510 // Both changed... figure it out 32511 ret.oldFileName = selectField(ret, mine.oldFileName, theirs.oldFileName); 32512 ret.newFileName = selectField(ret, mine.newFileName, theirs.newFileName); 32513 ret.oldHeader = selectField(ret, mine.oldHeader, theirs.oldHeader); 32514 ret.newHeader = selectField(ret, mine.newHeader, theirs.newHeader); 32515 } 32516 } 32517 32518 ret.hunks = []; 32519 32520 var mineIndex = 0, 32521 theirsIndex = 0, 32522 mineOffset = 0, 32523 theirsOffset = 0; 32524 32525 while (mineIndex < mine.hunks.length || theirsIndex < theirs.hunks.length) { 32526 var mineCurrent = mine.hunks[mineIndex] || { oldStart: Infinity }, 32527 theirsCurrent = theirs.hunks[theirsIndex] || { oldStart: Infinity }; 32528 32529 if (hunkBefore(mineCurrent, theirsCurrent)) { 32530 // This patch does not overlap with any of the others, yay. 32531 ret.hunks.push(cloneHunk(mineCurrent, mineOffset)); 32532 mineIndex++; 32533 theirsOffset += mineCurrent.newLines - mineCurrent.oldLines; 32534 } else if (hunkBefore(theirsCurrent, mineCurrent)) { 32535 // This patch does not overlap with any of the others, yay. 32536 ret.hunks.push(cloneHunk(theirsCurrent, theirsOffset)); 32537 theirsIndex++; 32538 mineOffset += theirsCurrent.newLines - theirsCurrent.oldLines; 32539 } else { 32540 // Overlap, merge as best we can 32541 var mergedHunk = { 32542 oldStart: Math.min(mineCurrent.oldStart, theirsCurrent.oldStart), 32543 oldLines: 0, 32544 newStart: Math.min(mineCurrent.newStart + mineOffset, theirsCurrent.oldStart + theirsOffset), 32545 newLines: 0, 32546 lines: [] 32547 }; 32548 mergeLines(mergedHunk, mineCurrent.oldStart, mineCurrent.lines, theirsCurrent.oldStart, theirsCurrent.lines); 32549 theirsIndex++; 32550 mineIndex++; 32551 32552 ret.hunks.push(mergedHunk); 32553 } 32554 } 32555 32556 return ret; 32557 } 32558 32559 function loadPatch(param, base) { 32560 if (typeof param === 'string') { 32561 if (/^@@/m.test(param) || /^Index:/m.test(param)) { 32562 return (/*istanbul ignore start*/(0, _parse.parsePatch) /*istanbul ignore end*/(param)[0] 32563 ); 32564 } 32565 32566 if (!base) { 32567 throw new Error('Must provide a base reference or pass in a patch'); 32568 } 32569 return (/*istanbul ignore start*/(0, _create.structuredPatch) /*istanbul ignore end*/(undefined, undefined, base, param) 32570 ); 32571 } 32572 32573 return param; 32574 } 32575 32576 function fileNameChanged(patch) { 32577 return patch.newFileName && patch.newFileName !== patch.oldFileName; 32578 } 32579 32580 function selectField(index, mine, theirs) { 32581 if (mine === theirs) { 32582 return mine; 32583 } else { 32584 index.conflict = true; 32585 return { mine: mine, theirs: theirs }; 32586 } 32587 } 32588 32589 function hunkBefore(test, check) { 32590 return test.oldStart < check.oldStart && test.oldStart + test.oldLines < check.oldStart; 32591 } 32592 32593 function cloneHunk(hunk, offset) { 32594 return { 32595 oldStart: hunk.oldStart, oldLines: hunk.oldLines, 32596 newStart: hunk.newStart + offset, newLines: hunk.newLines, 32597 lines: hunk.lines 32598 }; 32599 } 32600 32601 function mergeLines(hunk, mineOffset, mineLines, theirOffset, theirLines) { 32602 // This will generally result in a conflicted hunk, but there are cases where the context 32603 // is the only overlap where we can successfully merge the content here. 32604 var mine = { offset: mineOffset, lines: mineLines, index: 0 }, 32605 their = { offset: theirOffset, lines: theirLines, index: 0 }; 32606 32607 // Handle any leading content 32608 insertLeading(hunk, mine, their); 32609 insertLeading(hunk, their, mine); 32610 32611 // Now in the overlap content. Scan through and select the best changes from each. 32612 while (mine.index < mine.lines.length && their.index < their.lines.length) { 32613 var mineCurrent = mine.lines[mine.index], 32614 theirCurrent = their.lines[their.index]; 32615 32616 if ((mineCurrent[0] === '-' || mineCurrent[0] === '+') && (theirCurrent[0] === '-' || theirCurrent[0] === '+')) { 32617 // Both modified ... 32618 mutualChange(hunk, mine, their); 32619 } else if (mineCurrent[0] === '+' && theirCurrent[0] === ' ') { 32620 /*istanbul ignore start*/var _hunk$lines; 32621 32622 /*istanbul ignore end*/ // Mine inserted 32623 /*istanbul ignore start*/(_hunk$lines = /*istanbul ignore end*/hunk.lines).push. /*istanbul ignore start*/apply /*istanbul ignore end*/( /*istanbul ignore start*/_hunk$lines /*istanbul ignore end*/, /*istanbul ignore start*/_toConsumableArray( /*istanbul ignore end*/collectChange(mine))); 32624 } else if (theirCurrent[0] === '+' && mineCurrent[0] === ' ') { 32625 /*istanbul ignore start*/var _hunk$lines2; 32626 32627 /*istanbul ignore end*/ // Theirs inserted 32628 /*istanbul ignore start*/(_hunk$lines2 = /*istanbul ignore end*/hunk.lines).push. /*istanbul ignore start*/apply /*istanbul ignore end*/( /*istanbul ignore start*/_hunk$lines2 /*istanbul ignore end*/, /*istanbul ignore start*/_toConsumableArray( /*istanbul ignore end*/collectChange(their))); 32629 } else if (mineCurrent[0] === '-' && theirCurrent[0] === ' ') { 32630 // Mine removed or edited 32631 removal(hunk, mine, their); 32632 } else if (theirCurrent[0] === '-' && mineCurrent[0] === ' ') { 32633 // Their removed or edited 32634 removal(hunk, their, mine, true); 32635 } else if (mineCurrent === theirCurrent) { 32636 // Context identity 32637 hunk.lines.push(mineCurrent); 32638 mine.index++; 32639 their.index++; 32640 } else { 32641 // Context mismatch 32642 conflict(hunk, collectChange(mine), collectChange(their)); 32643 } 32644 } 32645 32646 // Now push anything that may be remaining 32647 insertTrailing(hunk, mine); 32648 insertTrailing(hunk, their); 32649 32650 calcLineCount(hunk); 32651 } 32652 32653 function mutualChange(hunk, mine, their) { 32654 var myChanges = collectChange(mine), 32655 theirChanges = collectChange(their); 32656 32657 if (allRemoves(myChanges) && allRemoves(theirChanges)) { 32658 // Special case for remove changes that are supersets of one another 32659 if ( /*istanbul ignore start*/(0, _array.arrayStartsWith) /*istanbul ignore end*/(myChanges, theirChanges) && skipRemoveSuperset(their, myChanges, myChanges.length - theirChanges.length)) { 32660 /*istanbul ignore start*/var _hunk$lines3; 32661 32662 /*istanbul ignore end*/ /*istanbul ignore start*/(_hunk$lines3 = /*istanbul ignore end*/hunk.lines).push. /*istanbul ignore start*/apply /*istanbul ignore end*/( /*istanbul ignore start*/_hunk$lines3 /*istanbul ignore end*/, /*istanbul ignore start*/_toConsumableArray( /*istanbul ignore end*/myChanges)); 32663 return; 32664 } else if ( /*istanbul ignore start*/(0, _array.arrayStartsWith) /*istanbul ignore end*/(theirChanges, myChanges) && skipRemoveSuperset(mine, theirChanges, theirChanges.length - myChanges.length)) { 32665 /*istanbul ignore start*/var _hunk$lines4; 32666 32667 /*istanbul ignore end*/ /*istanbul ignore start*/(_hunk$lines4 = /*istanbul ignore end*/hunk.lines).push. /*istanbul ignore start*/apply /*istanbul ignore end*/( /*istanbul ignore start*/_hunk$lines4 /*istanbul ignore end*/, /*istanbul ignore start*/_toConsumableArray( /*istanbul ignore end*/theirChanges)); 32668 return; 32669 } 32670 } else if ( /*istanbul ignore start*/(0, _array.arrayEqual) /*istanbul ignore end*/(myChanges, theirChanges)) { 32671 /*istanbul ignore start*/var _hunk$lines5; 32672 32673 /*istanbul ignore end*/ /*istanbul ignore start*/(_hunk$lines5 = /*istanbul ignore end*/hunk.lines).push. /*istanbul ignore start*/apply /*istanbul ignore end*/( /*istanbul ignore start*/_hunk$lines5 /*istanbul ignore end*/, /*istanbul ignore start*/_toConsumableArray( /*istanbul ignore end*/myChanges)); 32674 return; 32675 } 32676 32677 conflict(hunk, myChanges, theirChanges); 32678 } 32679 32680 function removal(hunk, mine, their, swap) { 32681 var myChanges = collectChange(mine), 32682 theirChanges = collectContext(their, myChanges); 32683 if (theirChanges.merged) { 32684 /*istanbul ignore start*/var _hunk$lines6; 32685 32686 /*istanbul ignore end*/ /*istanbul ignore start*/(_hunk$lines6 = /*istanbul ignore end*/hunk.lines).push. /*istanbul ignore start*/apply /*istanbul ignore end*/( /*istanbul ignore start*/_hunk$lines6 /*istanbul ignore end*/, /*istanbul ignore start*/_toConsumableArray( /*istanbul ignore end*/theirChanges.merged)); 32687 } else { 32688 conflict(hunk, swap ? theirChanges : myChanges, swap ? myChanges : theirChanges); 32689 } 32690 } 32691 32692 function conflict(hunk, mine, their) { 32693 hunk.conflict = true; 32694 hunk.lines.push({ 32695 conflict: true, 32696 mine: mine, 32697 theirs: their 32698 }); 32699 } 32700 32701 function insertLeading(hunk, insert, their) { 32702 while (insert.offset < their.offset && insert.index < insert.lines.length) { 32703 var line = insert.lines[insert.index++]; 32704 hunk.lines.push(line); 32705 insert.offset++; 32706 } 32707 } 32708 function insertTrailing(hunk, insert) { 32709 while (insert.index < insert.lines.length) { 32710 var line = insert.lines[insert.index++]; 32711 hunk.lines.push(line); 32712 } 32713 } 32714 32715 function collectChange(state) { 32716 var ret = [], 32717 operation = state.lines[state.index][0]; 32718 while (state.index < state.lines.length) { 32719 var line = state.lines[state.index]; 32720 32721 // Group additions that are immediately after subtractions and treat them as one "atomic" modify change. 32722 if (operation === '-' && line[0] === '+') { 32723 operation = '+'; 32724 } 32725 32726 if (operation === line[0]) { 32727 ret.push(line); 32728 state.index++; 32729 } else { 32730 break; 32731 } 32732 } 32733 32734 return ret; 32735 } 32736 function collectContext(state, matchChanges) { 32737 var changes = [], 32738 merged = [], 32739 matchIndex = 0, 32740 contextChanges = false, 32741 conflicted = false; 32742 while (matchIndex < matchChanges.length && state.index < state.lines.length) { 32743 var change = state.lines[state.index], 32744 match = matchChanges[matchIndex]; 32745 32746 // Once we've hit our add, then we are done 32747 if (match[0] === '+') { 32748 break; 32749 } 32750 32751 contextChanges = contextChanges || change[0] !== ' '; 32752 32753 merged.push(match); 32754 matchIndex++; 32755 32756 // Consume any additions in the other block as a conflict to attempt 32757 // to pull in the remaining context after this 32758 if (change[0] === '+') { 32759 conflicted = true; 32760 32761 while (change[0] === '+') { 32762 changes.push(change); 32763 change = state.lines[++state.index]; 32764 } 32765 } 32766 32767 if (match.substr(1) === change.substr(1)) { 32768 changes.push(change); 32769 state.index++; 32770 } else { 32771 conflicted = true; 32772 } 32773 } 32774 32775 if ((matchChanges[matchIndex] || '')[0] === '+' && contextChanges) { 32776 conflicted = true; 32777 } 32778 32779 if (conflicted) { 32780 return changes; 32781 } 32782 32783 while (matchIndex < matchChanges.length) { 32784 merged.push(matchChanges[matchIndex++]); 32785 } 32786 32787 return { 32788 merged: merged, 32789 changes: changes 32790 }; 32791 } 32792 32793 function allRemoves(changes) { 32794 return changes.reduce(function (prev, change) { 32795 return prev && change[0] === '-'; 32796 }, true); 32797 } 32798 function skipRemoveSuperset(state, removeChanges, delta) { 32799 for (var i = 0; i < delta; i++) { 32800 var changeContent = removeChanges[removeChanges.length - delta + i].substr(1); 32801 if (state.lines[state.index + i] !== ' ' + changeContent) { 32802 return false; 32803 } 32804 } 32805 32806 state.index += delta; 32807 return true; 32808 } 32809 32810 function calcOldNewLineCount(lines) { 32811 var oldLines = 0; 32812 var newLines = 0; 32813 32814 lines.forEach(function (line) { 32815 if (typeof line !== 'string') { 32816 var myCount = calcOldNewLineCount(line.mine); 32817 var theirCount = calcOldNewLineCount(line.theirs); 32818 32819 if (oldLines !== undefined) { 32820 if (myCount.oldLines === theirCount.oldLines) { 32821 oldLines += myCount.oldLines; 32822 } else { 32823 oldLines = undefined; 32824 } 32825 } 32826 32827 if (newLines !== undefined) { 32828 if (myCount.newLines === theirCount.newLines) { 32829 newLines += myCount.newLines; 32830 } else { 32831 newLines = undefined; 32832 } 32833 } 32834 } else { 32835 if (newLines !== undefined && (line[0] === '+' || line[0] === ' ')) { 32836 newLines++; 32837 } 32838 if (oldLines !== undefined && (line[0] === '-' || line[0] === ' ')) { 32839 oldLines++; 32840 } 32841 } 32842 }); 32843 32844 return { oldLines: oldLines, newLines: newLines }; 32845 } 32846 //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9wYXRjaC9tZXJnZS5qcyJdLCJuYW1lcyI6WyJjYWxjTGluZUNvdW50IiwibWVyZ2UiLCJodW5rIiwiY2FsY09sZE5ld0xpbmVDb3VudCIsImxpbmVzIiwib2xkTGluZXMiLCJuZXdMaW5lcyIsInVuZGVmaW5lZCIsIm1pbmUiLCJ0aGVpcnMiLCJiYXNlIiwibG9hZFBhdGNoIiwicmV0IiwiaW5kZXgiLCJuZXdGaWxlTmFtZSIsImZpbGVOYW1lQ2hhbmdlZCIsIm9sZEZpbGVOYW1lIiwib2xkSGVhZGVyIiwibmV3SGVhZGVyIiwic2VsZWN0RmllbGQiLCJodW5rcyIsIm1pbmVJbmRleCIsInRoZWlyc0luZGV4IiwibWluZU9mZnNldCIsInRoZWlyc09mZnNldCIsImxlbmd0aCIsIm1pbmVDdXJyZW50Iiwib2xkU3RhcnQiLCJJbmZpbml0eSIsInRoZWlyc0N1cnJlbnQiLCJodW5rQmVmb3JlIiwicHVzaCIsImNsb25lSHVuayIsIm1lcmdlZEh1bmsiLCJNYXRoIiwibWluIiwibmV3U3RhcnQiLCJtZXJnZUxpbmVzIiwicGFyYW0iLCJ0ZXN0IiwiRXJyb3IiLCJwYXRjaCIsImNvbmZsaWN0IiwiY2hlY2siLCJvZmZzZXQiLCJtaW5lTGluZXMiLCJ0aGVpck9mZnNldCIsInRoZWlyTGluZXMiLCJ0aGVpciIsImluc2VydExlYWRpbmciLCJ0aGVpckN1cnJlbnQiLCJtdXR1YWxDaGFuZ2UiLCJjb2xsZWN0Q2hhbmdlIiwicmVtb3ZhbCIsImluc2VydFRyYWlsaW5nIiwibXlDaGFuZ2VzIiwidGhlaXJDaGFuZ2VzIiwiYWxsUmVtb3ZlcyIsInNraXBSZW1vdmVTdXBlcnNldCIsInN3YXAiLCJjb2xsZWN0Q29udGV4dCIsIm1lcmdlZCIsImluc2VydCIsImxpbmUiLCJzdGF0ZSIsIm9wZXJhdGlvbiIsIm1hdGNoQ2hhbmdlcyIsImNoYW5nZXMiLCJtYXRjaEluZGV4IiwiY29udGV4dENoYW5nZXMiLCJjb25mbGljdGVkIiwiY2hhbmdlIiwibWF0Y2giLCJzdWJzdHIiLCJyZWR1Y2UiLCJwcmV2IiwicmVtb3ZlQ2hhbmdlcyIsImRlbHRhIiwiaSIsImNoYW5nZUNvbnRlbnQiLCJmb3JFYWNoIiwibXlDb3VudCIsInRoZWlyQ291bnQiXSwibWFwcGluZ3MiOiI7OztnQ0FLZ0JBLGEsR0FBQUEsYTt5REFnQkFDLEssR0FBQUEsSzs7QUFyQmhCOztBQUNBOztBQUVBOzs7O3VCQUVPLFNBQVNELGFBQVQsQ0FBdUJFLElBQXZCLEVBQTZCO0FBQUEsNkVBQ0xDLG9CQUFvQkQsS0FBS0UsS0FBekIsQ0FESztBQUFBLE1BQzNCQyxRQUQyQix3QkFDM0JBLFFBRDJCO0FBQUEsTUFDakJDLFFBRGlCLHdCQUNqQkEsUUFEaUI7O0FBR2xDLE1BQUlELGFBQWFFLFNBQWpCLEVBQTRCO0FBQzFCTCxTQUFLRyxRQUFMLEdBQWdCQSxRQUFoQjtBQUNELEdBRkQsTUFFTztBQUNMLFdBQU9ILEtBQUtHLFFBQVo7QUFDRDs7QUFFRCxNQUFJQyxhQUFhQyxTQUFqQixFQUE0QjtBQUMxQkwsU0FBS0ksUUFBTCxHQUFnQkEsUUFBaEI7QUFDRCxHQUZELE1BRU87QUFDTCxXQUFPSixLQUFLSSxRQUFaO0FBQ0Q7QUFDRjs7QUFFTSxTQUFTTCxLQUFULENBQWVPLElBQWYsRUFBcUJDLE1BQXJCLEVBQTZCQyxJQUE3QixFQUFtQztBQUN4Q0YsU0FBT0csVUFBVUgsSUFBVixFQUFnQkUsSUFBaEIsQ0FBUDtBQUNBRCxXQUFTRSxVQUFVRixNQUFWLEVBQWtCQyxJQUFsQixDQUFUOztBQUVBLE1BQUlFLE1BQU0sRUFBVjs7QUFFQTtBQUNBO0FBQ0E7QUFDQSxNQUFJSixLQUFLSyxLQUFMLElBQWNKLE9BQU9JLEtBQXpCLEVBQWdDO0FBQzlCRCxRQUFJQyxLQUFKLEdBQVlMLEtBQUtLLEtBQUwsSUFBY0osT0FBT0ksS0FBakM7QUFDRDs7QUFFRCxNQUFJTCxLQUFLTSxXQUFMLElBQW9CTCxPQUFPSyxXQUEvQixFQUE0QztBQUMxQyxRQUFJLENBQUNDLGdCQUFnQlAsSUFBaEIsQ0FBTCxFQUE0QjtBQUMxQjtBQUNBSSxVQUFJSSxXQUFKLEdBQWtCUCxPQUFPTyxXQUFQLElBQXNCUixLQUFLUSxXQUE3QztBQUNBSixVQUFJRSxXQUFKLEdBQWtCTCxPQUFPSyxXQUFQLElBQXNCTixLQUFLTSxXQUE3QztBQUNBRixVQUFJSyxTQUFKLEdBQWdCUixPQUFPUSxTQUFQLElBQW9CVCxLQUFLUyxTQUF6QztBQUNBTCxVQUFJTSxTQUFKLEdBQWdCVCxPQUFPUyxTQUFQLElBQW9CVixLQUFLVSxTQUF6QztBQUNELEtBTkQsTUFNTyxJQUFJLENBQUNILGdCQUFnQk4sTUFBaEIsQ0FBTCxFQUE4QjtBQUNuQztBQUNBRyxVQUFJSSxXQUFKLEdBQWtCUixLQUFLUSxXQUF2QjtBQUNBSixVQUFJRSxXQUFKLEdBQWtCTixLQUFLTSxXQUF2QjtBQUNBRixVQUFJSyxTQUFKLEdBQWdCVCxLQUFLUyxTQUFyQjtBQUNBTCxVQUFJTSxTQUFKLEdBQWdCVixLQUFLVSxTQUFyQjtBQUNELEtBTk0sTUFNQTtBQUNMO0FBQ0FOLFVBQUlJLFdBQUosR0FBa0JHLFlBQVlQLEdBQVosRUFBaUJKLEtBQUtRLFdBQXRCLEVBQW1DUCxPQUFPTyxXQUExQyxDQUFsQjtBQUNBSixVQUFJRSxXQUFKLEdBQWtCSyxZQUFZUCxHQUFaLEVBQWlCSixLQUFLTSxXQUF0QixFQUFtQ0wsT0FBT0ssV0FBMUMsQ0FBbEI7QUFDQUYsVUFBSUssU0FBSixHQUFnQkUsWUFBWVAsR0FBWixFQUFpQkosS0FBS1MsU0FBdEIsRUFBaUNSLE9BQU9RLFNBQXhDLENBQWhCO0FBQ0FMLFVBQUlNLFNBQUosR0FBZ0JDLFlBQVlQLEdBQVosRUFBaUJKLEtBQUtVLFNBQXRCLEVBQWlDVCxPQUFPUyxTQUF4QyxDQUFoQjtBQUNEO0FBQ0Y7O0FBRUROLE1BQUlRLEtBQUosR0FBWSxFQUFaOztBQUVBLE1BQUlDLFlBQVksQ0FBaEI7QUFBQSxNQUNJQyxjQUFjLENBRGxCO0FBQUEsTUFFSUMsYUFBYSxDQUZqQjtBQUFBLE1BR0lDLGVBQWUsQ0FIbkI7O0FBS0EsU0FBT0gsWUFBWWIsS0FBS1ksS0FBTCxDQUFXSyxNQUF2QixJQUFpQ0gsY0FBY2IsT0FBT1csS0FBUCxDQUFhSyxNQUFuRSxFQUEyRTtBQUN6RSxRQUFJQyxjQUFjbEIsS0FBS1ksS0FBTCxDQUFXQyxTQUFYLEtBQXlCLEVBQUNNLFVBQVVDLFFBQVgsRUFBM0M7QUFBQSxRQUNJQyxnQkFBZ0JwQixPQUFPVyxLQUFQLENBQWFFLFdBQWIsS0FBNkIsRUFBQ0ssVUFBVUMsUUFBWCxFQURqRDs7QUFHQSxRQUFJRSxXQUFXSixXQUFYLEVBQXdCRyxhQUF4QixDQUFKLEVBQTRDO0FBQzFDO0FBQ0FqQixVQUFJUSxLQUFKLENBQVVXLElBQVYsQ0FBZUMsVUFBVU4sV0FBVixFQUF1QkgsVUFBdkIsQ0FBZjtBQUNBRjtBQUNBRyxzQkFBZ0JFLFlBQVlwQixRQUFaLEdBQXVCb0IsWUFBWXJCLFFBQW5EO0FBQ0QsS0FMRCxNQUtPLElBQUl5QixXQUFXRCxhQUFYLEVBQTBCSCxXQUExQixDQUFKLEVBQTRDO0FBQ2pEO0FBQ0FkLFVBQUlRLEtBQUosQ0FBVVcsSUFBVixDQUFlQyxVQUFVSCxhQUFWLEVBQXlCTCxZQUF6QixDQUFmO0FBQ0FGO0FBQ0FDLG9CQUFjTSxjQUFjdkIsUUFBZCxHQUF5QnVCLGNBQWN4QixRQUFyRDtBQUNELEtBTE0sTUFLQTtBQUNMO0FBQ0EsVUFBSTRCLGFBQWE7QUFDZk4sa0JBQVVPLEtBQUtDLEdBQUwsQ0FBU1QsWUFBWUMsUUFBckIsRUFBK0JFLGNBQWNGLFFBQTdDLENBREs7QUFFZnRCLGtCQUFVLENBRks7QUFHZitCLGtCQUFVRixLQUFLQyxHQUFMLENBQVNULFlBQVlVLFFBQVosR0FBdUJiLFVBQWhDLEVBQTRDTSxjQUFjRixRQUFkLEdBQXlCSCxZQUFyRSxDQUhLO0FBSWZsQixrQkFBVSxDQUpLO0FBS2ZGLGVBQU87QUFMUSxPQUFqQjtBQU9BaUMsaUJBQVdKLFVBQVgsRUFBdUJQLFlBQVlDLFFBQW5DLEVBQTZDRCxZQUFZdEIsS0FBekQsRUFBZ0V5QixjQUFjRixRQUE5RSxFQUF3RkUsY0FBY3pCLEtBQXRHO0FBQ0FrQjtBQUNBRDs7QUFFQVQsVUFBSVEsS0FBSixDQUFVVyxJQUFWLENBQWVFLFVBQWY7QUFDRDtBQUNGOztBQUVELFNBQU9yQixHQUFQO0FBQ0Q7O0FBRUQsU0FBU0QsU0FBVCxDQUFtQjJCLEtBQW5CLEVBQTBCNUIsSUFBMUIsRUFBZ0M7QUFDOUIsTUFBSSxPQUFPNEIsS0FBUCxLQUFpQixRQUFyQixFQUErQjtBQUM3QixRQUFJLE9BQU9DLElBQVAsQ0FBWUQsS0FBWixLQUF1QixXQUFXQyxJQUFYLENBQWdCRCxLQUFoQixDQUEzQixFQUFvRDtBQUNsRCxhQUFPLHlFQUFXQSxLQUFYLEVBQWtCLENBQWxCO0FBQVA7QUFDRDs7QUFFRCxRQUFJLENBQUM1QixJQUFMLEVBQVc7QUFDVCxZQUFNLElBQUk4QixLQUFKLENBQVUsa0RBQVYsQ0FBTjtBQUNEO0FBQ0QsV0FBTywrRUFBZ0JqQyxTQUFoQixFQUEyQkEsU0FBM0IsRUFBc0NHLElBQXRDLEVBQTRDNEIsS0FBNUM7QUFBUDtBQUNEOztBQUVELFNBQU9BLEtBQVA7QUFDRDs7QUFFRCxTQUFTdkIsZUFBVCxDQUF5QjBCLEtBQXpCLEVBQWdDO0FBQzlCLFNBQU9BLE1BQU0zQixXQUFOLElBQXFCMkIsTUFBTTNCLFdBQU4sS0FBc0IyQixNQUFNekIsV0FBeEQ7QUFDRDs7QUFFRCxTQUFTRyxXQUFULENBQXFCTixLQUFyQixFQUE0QkwsSUFBNUIsRUFBa0NDLE1BQWxDLEVBQTBDO0FBQ3hDLE1BQUlELFNBQVNDLE1BQWIsRUFBcUI7QUFDbkIsV0FBT0QsSUFBUDtBQUNELEdBRkQsTUFFTztBQUNMSyxVQUFNNkIsUUFBTixHQUFpQixJQUFqQjtBQUNBLFdBQU8sRUFBQ2xDLFVBQUQsRUFBT0MsY0FBUCxFQUFQO0FBQ0Q7QUFDRjs7QUFFRCxTQUFTcUIsVUFBVCxDQUFvQlMsSUFBcEIsRUFBMEJJLEtBQTFCLEVBQWlDO0FBQy9CLFNBQU9KLEtBQUtaLFFBQUwsR0FBZ0JnQixNQUFNaEIsUUFBdEIsSUFDRFksS0FBS1osUUFBTCxHQUFnQlksS0FBS2xDLFFBQXRCLEdBQWtDc0MsTUFBTWhCLFFBRDdDO0FBRUQ7O0FBRUQsU0FBU0ssU0FBVCxDQUFtQjlCLElBQW5CLEVBQXlCMEMsTUFBekIsRUFBaUM7QUFDL0IsU0FBTztBQUNMakIsY0FBVXpCLEtBQUt5QixRQURWLEVBQ29CdEIsVUFBVUgsS0FBS0csUUFEbkM7QUFFTCtCLGNBQVVsQyxLQUFLa0MsUUFBTCxHQUFnQlEsTUFGckIsRUFFNkJ0QyxVQUFVSixLQUFLSSxRQUY1QztBQUdMRixXQUFPRixLQUFLRTtBQUhQLEdBQVA7QUFLRDs7QUFFRCxTQUFTaUMsVUFBVCxDQUFvQm5DLElBQXBCLEVBQTBCcUIsVUFBMUIsRUFBc0NzQixTQUF0QyxFQUFpREMsV0FBakQsRUFBOERDLFVBQTlELEVBQTBFO0FBQ3hFO0FBQ0E7QUFDQSxNQUFJdkMsT0FBTyxFQUFDb0MsUUFBUXJCLFVBQVQsRUFBcUJuQixPQUFPeUMsU0FBNUIsRUFBdUNoQyxPQUFPLENBQTlDLEVBQVg7QUFBQSxNQUNJbUMsUUFBUSxFQUFDSixRQUFRRSxXQUFULEVBQXNCMUMsT0FBTzJDLFVBQTdCLEVBQXlDbEMsT0FBTyxDQUFoRCxFQURaOztBQUdBO0FBQ0FvQyxnQkFBYy9DLElBQWQsRUFBb0JNLElBQXBCLEVBQTBCd0MsS0FBMUI7QUFDQUMsZ0JBQWMvQyxJQUFkLEVBQW9COEMsS0FBcEIsRUFBMkJ4QyxJQUEzQjs7QUFFQTtBQUNBLFNBQU9BLEtBQUtLLEtBQUwsR0FBYUwsS0FBS0osS0FBTCxDQUFXcUIsTUFBeEIsSUFBa0N1QixNQUFNbkMsS0FBTixHQUFjbUMsTUFBTTVDLEtBQU4sQ0FBWXFCLE1BQW5FLEVBQTJFO0FBQ3pFLFFBQUlDLGNBQWNsQixLQUFLSixLQUFMLENBQVdJLEtBQUtLLEtBQWhCLENBQWxCO0FBQUEsUUFDSXFDLGVBQWVGLE1BQU01QyxLQUFOLENBQVk0QyxNQUFNbkMsS0FBbEIsQ0FEbkI7O0FBR0EsUUFBSSxDQUFDYSxZQUFZLENBQVosTUFBbUIsR0FBbkIsSUFBMEJBLFlBQVksQ0FBWixNQUFtQixHQUE5QyxNQUNJd0IsYUFBYSxDQUFiLE1BQW9CLEdBQXBCLElBQTJCQSxhQUFhLENBQWIsTUFBb0IsR0FEbkQsQ0FBSixFQUM2RDtBQUMzRDtBQUNBQyxtQkFBYWpELElBQWIsRUFBbUJNLElBQW5CLEVBQXlCd0MsS0FBekI7QUFDRCxLQUpELE1BSU8sSUFBSXRCLFlBQVksQ0FBWixNQUFtQixHQUFuQixJQUEwQndCLGFBQWEsQ0FBYixNQUFvQixHQUFsRCxFQUF1RDtBQUFBOztBQUFBLDhCQUM1RDtBQUNBLDBFQUFLOUMsS0FBTCxFQUFXMkIsSUFBWCw0TEFBb0JxQixjQUFjNUMsSUFBZCxDQUFwQjtBQUNELEtBSE0sTUFHQSxJQUFJMEMsYUFBYSxDQUFiLE1BQW9CLEdBQXBCLElBQTJCeEIsWUFBWSxDQUFaLE1BQW1CLEdBQWxELEVBQXVEO0FBQUE7O0FBQUEsOEJBQzVEO0FBQ0EsMkVBQUt0QixLQUFMLEVBQVcyQixJQUFYLDZMQUFvQnFCLGNBQWNKLEtBQWQsQ0FBcEI7QUFDRCxLQUhNLE1BR0EsSUFBSXRCLFlBQVksQ0FBWixNQUFtQixHQUFuQixJQUEwQndCLGFBQWEsQ0FBYixNQUFvQixHQUFsRCxFQUF1RDtBQUM1RDtBQUNBRyxjQUFRbkQsSUFBUixFQUFjTSxJQUFkLEVBQW9Cd0MsS0FBcEI7QUFDRCxLQUhNLE1BR0EsSUFBSUUsYUFBYSxDQUFiLE1BQW9CLEdBQXBCLElBQTJCeEIsWUFBWSxDQUFaLE1BQW1CLEdBQWxELEVBQXVEO0FBQzVEO0FBQ0EyQixjQUFRbkQsSUFBUixFQUFjOEMsS0FBZCxFQUFxQnhDLElBQXJCLEVBQTJCLElBQTNCO0FBQ0QsS0FITSxNQUdBLElBQUlrQixnQkFBZ0J3QixZQUFwQixFQUFrQztBQUN2QztBQUNBaEQsV0FBS0UsS0FBTCxDQUFXMkIsSUFBWCxDQUFnQkwsV0FBaEI7QUFDQWxCLFdBQUtLLEtBQUw7QUFDQW1DLFlBQU1uQyxLQUFOO0FBQ0QsS0FMTSxNQUtBO0FBQ0w7QUFDQTZCLGVBQVN4QyxJQUFULEVBQWVrRCxjQUFjNUMsSUFBZCxDQUFmLEVBQW9DNEMsY0FBY0osS0FBZCxDQUFwQztBQUNEO0FBQ0Y7O0FBRUQ7QUFDQU0saUJBQWVwRCxJQUFmLEVBQXFCTSxJQUFyQjtBQUNBOEMsaUJBQWVwRCxJQUFmLEVBQXFCOEMsS0FBckI7O0FBRUFoRCxnQkFBY0UsSUFBZDtBQUNEOztBQUVELFNBQVNpRCxZQUFULENBQXNCakQsSUFBdEIsRUFBNEJNLElBQTVCLEVBQWtDd0MsS0FBbEMsRUFBeUM7QUFDdkMsTUFBSU8sWUFBWUgsY0FBYzVDLElBQWQsQ0FBaEI7QUFBQSxNQUNJZ0QsZUFBZUosY0FBY0osS0FBZCxDQURuQjs7QUFHQSxNQUFJUyxXQUFXRixTQUFYLEtBQXlCRSxXQUFXRCxZQUFYLENBQTdCLEVBQXVEO0FBQ3JEO0FBQ0EsUUFBSSw4RUFBZ0JELFNBQWhCLEVBQTJCQyxZQUEzQixLQUNHRSxtQkFBbUJWLEtBQW5CLEVBQTBCTyxTQUExQixFQUFxQ0EsVUFBVTlCLE1BQVYsR0FBbUIrQixhQUFhL0IsTUFBckUsQ0FEUCxFQUNxRjtBQUFBOztBQUFBLDZCQUNuRixzRUFBS3JCLEtBQUwsRUFBVzJCLElBQVgsNkxBQW9Cd0IsU0FBcEI7QUFDQTtBQUNELEtBSkQsTUFJTyxJQUFJLDhFQUFnQkMsWUFBaEIsRUFBOEJELFNBQTlCLEtBQ0pHLG1CQUFtQmxELElBQW5CLEVBQXlCZ0QsWUFBekIsRUFBdUNBLGFBQWEvQixNQUFiLEdBQXNCOEIsVUFBVTlCLE1BQXZFLENBREEsRUFDZ0Y7QUFBQTs7QUFBQSw2QkFDckYsc0VBQUtyQixLQUFMLEVBQVcyQixJQUFYLDZMQUFvQnlCLFlBQXBCO0FBQ0E7QUFDRDtBQUNGLEdBWEQsTUFXTyxJQUFJLHlFQUFXRCxTQUFYLEVBQXNCQyxZQUF0QixDQUFKLEVBQXlDO0FBQUE7O0FBQUEsMkJBQzlDLHNFQUFLcEQsS0FBTCxFQUFXMkIsSUFBWCw2TEFBb0J3QixTQUFwQjtBQUNBO0FBQ0Q7O0FBRURiLFdBQVN4QyxJQUFULEVBQWVxRCxTQUFmLEVBQTBCQyxZQUExQjtBQUNEOztBQUVELFNBQVNILE9BQVQsQ0FBaUJuRCxJQUFqQixFQUF1Qk0sSUFBdkIsRUFBNkJ3QyxLQUE3QixFQUFvQ1csSUFBcEMsRUFBMEM7QUFDeEMsTUFBSUosWUFBWUgsY0FBYzVDLElBQWQsQ0FBaEI7QUFBQSxNQUNJZ0QsZUFBZUksZUFBZVosS0FBZixFQUFzQk8sU0FBdEIsQ0FEbkI7QUFFQSxNQUFJQyxhQUFhSyxNQUFqQixFQUF5QjtBQUFBOztBQUFBLDJCQUN2QixzRUFBS3pELEtBQUwsRUFBVzJCLElBQVgsNkxBQW9CeUIsYUFBYUssTUFBakM7QUFDRCxHQUZELE1BRU87QUFDTG5CLGFBQVN4QyxJQUFULEVBQWV5RCxPQUFPSCxZQUFQLEdBQXNCRCxTQUFyQyxFQUFnREksT0FBT0osU0FBUCxHQUFtQkMsWUFBbkU7QUFDRDtBQUNGOztBQUVELFNBQVNkLFFBQVQsQ0FBa0J4QyxJQUFsQixFQUF3Qk0sSUFBeEIsRUFBOEJ3QyxLQUE5QixFQUFxQztBQUNuQzlDLE9BQUt3QyxRQUFMLEdBQWdCLElBQWhCO0FBQ0F4QyxPQUFLRSxLQUFMLENBQVcyQixJQUFYLENBQWdCO0FBQ2RXLGNBQVUsSUFESTtBQUVkbEMsVUFBTUEsSUFGUTtBQUdkQyxZQUFRdUM7QUFITSxHQUFoQjtBQUtEOztBQUVELFNBQVNDLGFBQVQsQ0FBdUIvQyxJQUF2QixFQUE2QjRELE1BQTdCLEVBQXFDZCxLQUFyQyxFQUE0QztBQUMxQyxTQUFPYyxPQUFPbEIsTUFBUCxHQUFnQkksTUFBTUosTUFBdEIsSUFBZ0NrQixPQUFPakQsS0FBUCxHQUFlaUQsT0FBTzFELEtBQVAsQ0FBYXFCLE1BQW5FLEVBQTJFO0FBQ3pFLFFBQUlzQyxPQUFPRCxPQUFPMUQsS0FBUCxDQUFhMEQsT0FBT2pELEtBQVAsRUFBYixDQUFYO0FBQ0FYLFNBQUtFLEtBQUwsQ0FBVzJCLElBQVgsQ0FBZ0JnQyxJQUFoQjtBQUNBRCxXQUFPbEIsTUFBUDtBQUNEO0FBQ0Y7QUFDRCxTQUFTVSxjQUFULENBQXdCcEQsSUFBeEIsRUFBOEI0RCxNQUE5QixFQUFzQztBQUNwQyxTQUFPQSxPQUFPakQsS0FBUCxHQUFlaUQsT0FBTzFELEtBQVAsQ0FBYXFCLE1BQW5DLEVBQTJDO0FBQ3pDLFFBQUlzQyxPQUFPRCxPQUFPMUQsS0FBUCxDQUFhMEQsT0FBT2pELEtBQVAsRUFBYixDQUFYO0FBQ0FYLFNBQUtFLEtBQUwsQ0FBVzJCLElBQVgsQ0FBZ0JnQyxJQUFoQjtBQUNEO0FBQ0Y7O0FBRUQsU0FBU1gsYUFBVCxDQUF1QlksS0FBdkIsRUFBOEI7QUFDNUIsTUFBSXBELE1BQU0sRUFBVjtBQUFBLE1BQ0lxRCxZQUFZRCxNQUFNNUQsS0FBTixDQUFZNEQsTUFBTW5ELEtBQWxCLEVBQXlCLENBQXpCLENBRGhCO0FBRUEsU0FBT21ELE1BQU1uRCxLQUFOLEdBQWNtRCxNQUFNNUQsS0FBTixDQUFZcUIsTUFBakMsRUFBeUM7QUFDdkMsUUFBSXNDLE9BQU9DLE1BQU01RCxLQUFOLENBQVk0RCxNQUFNbkQsS0FBbEIsQ0FBWDs7QUFFQTtBQUNBLFFBQUlvRCxjQUFjLEdBQWQsSUFBcUJGLEtBQUssQ0FBTCxNQUFZLEdBQXJDLEVBQTBDO0FBQ3hDRSxrQkFBWSxHQUFaO0FBQ0Q7O0FBRUQsUUFBSUEsY0FBY0YsS0FBSyxDQUFMLENBQWxCLEVBQTJCO0FBQ3pCbkQsVUFBSW1CLElBQUosQ0FBU2dDLElBQVQ7QUFDQUMsWUFBTW5ELEtBQU47QUFDRCxLQUhELE1BR087QUFDTDtBQUNEO0FBQ0Y7O0FBRUQsU0FBT0QsR0FBUDtBQUNEO0FBQ0QsU0FBU2dELGNBQVQsQ0FBd0JJLEtBQXhCLEVBQStCRSxZQUEvQixFQUE2QztBQUMzQyxNQUFJQyxVQUFVLEVBQWQ7QUFBQSxNQUNJTixTQUFTLEVBRGI7QUFBQSxNQUVJTyxhQUFhLENBRmpCO0FBQUEsTUFHSUMsaUJBQWlCLEtBSHJCO0FBQUEsTUFJSUMsYUFBYSxLQUpqQjtBQUtBLFNBQU9GLGFBQWFGLGFBQWF6QyxNQUExQixJQUNFdUMsTUFBTW5ELEtBQU4sR0FBY21ELE1BQU01RCxLQUFOLENBQVlxQixNQURuQyxFQUMyQztBQUN6QyxRQUFJOEMsU0FBU1AsTUFBTTVELEtBQU4sQ0FBWTRELE1BQU1uRCxLQUFsQixDQUFiO0FBQUEsUUFDSTJELFFBQVFOLGFBQWFFLFVBQWIsQ0FEWjs7QUFHQTtBQUNBLFFBQUlJLE1BQU0sQ0FBTixNQUFhLEdBQWpCLEVBQXNCO0FBQ3BCO0FBQ0Q7O0FBRURILHFCQUFpQkEsa0JBQWtCRSxPQUFPLENBQVAsTUFBYyxHQUFqRDs7QUFFQVYsV0FBTzlCLElBQVAsQ0FBWXlDLEtBQVo7QUFDQUo7O0FBRUE7QUFDQTtBQUNBLFFBQUlHLE9BQU8sQ0FBUCxNQUFjLEdBQWxCLEVBQXVCO0FBQ3JCRCxtQkFBYSxJQUFiOztBQUVBLGFBQU9DLE9BQU8sQ0FBUCxNQUFjLEdBQXJCLEVBQTBCO0FBQ3hCSixnQkFBUXBDLElBQVIsQ0FBYXdDLE1BQWI7QUFDQUEsaUJBQVNQLE1BQU01RCxLQUFOLENBQVksRUFBRTRELE1BQU1uRCxLQUFwQixDQUFUO0FBQ0Q7QUFDRjs7QUFFRCxRQUFJMkQsTUFBTUMsTUFBTixDQUFhLENBQWIsTUFBb0JGLE9BQU9FLE1BQVAsQ0FBYyxDQUFkLENBQXhCLEVBQTBDO0FBQ3hDTixjQUFRcEMsSUFBUixDQUFhd0MsTUFBYjtBQUNBUCxZQUFNbkQsS0FBTjtBQUNELEtBSEQsTUFHTztBQUNMeUQsbUJBQWEsSUFBYjtBQUNEO0FBQ0Y7O0FBRUQsTUFBSSxDQUFDSixhQUFhRSxVQUFiLEtBQTRCLEVBQTdCLEVBQWlDLENBQWpDLE1BQXdDLEdBQXhDLElBQ0dDLGNBRFAsRUFDdUI7QUFDckJDLGlCQUFhLElBQWI7QUFDRDs7QUFFRCxNQUFJQSxVQUFKLEVBQWdCO0FBQ2QsV0FBT0gsT0FBUDtBQUNEOztBQUVELFNBQU9DLGFBQWFGLGFBQWF6QyxNQUFqQyxFQUF5QztBQUN2Q29DLFdBQU85QixJQUFQLENBQVltQyxhQUFhRSxZQUFiLENBQVo7QUFDRDs7QUFFRCxTQUFPO0FBQ0xQLGtCQURLO0FBRUxNO0FBRkssR0FBUDtBQUlEOztBQUVELFNBQVNWLFVBQVQsQ0FBb0JVLE9BQXBCLEVBQTZCO0FBQzNCLFNBQU9BLFFBQVFPLE1BQVIsQ0FBZSxVQUFTQyxJQUFULEVBQWVKLE1BQWYsRUFBdUI7QUFDM0MsV0FBT0ksUUFBUUosT0FBTyxDQUFQLE1BQWMsR0FBN0I7QUFDRCxHQUZNLEVBRUosSUFGSSxDQUFQO0FBR0Q7QUFDRCxTQUFTYixrQkFBVCxDQUE0Qk0sS0FBNUIsRUFBbUNZLGFBQW5DLEVBQWtEQyxLQUFsRCxFQUF5RDtBQUN2RCxPQUFLLElBQUlDLElBQUksQ0FBYixFQUFnQkEsSUFBSUQsS0FBcEIsRUFBMkJDLEdBQTNCLEVBQWdDO0FBQzlCLFFBQUlDLGdCQUFnQkgsY0FBY0EsY0FBY25ELE1BQWQsR0FBdUJvRCxLQUF2QixHQUErQkMsQ0FBN0MsRUFBZ0RMLE1BQWhELENBQXVELENBQXZELENBQXBCO0FBQ0EsUUFBSVQsTUFBTTVELEtBQU4sQ0FBWTRELE1BQU1uRCxLQUFOLEdBQWNpRSxDQUExQixNQUFpQyxNQUFNQyxhQUEzQyxFQUEwRDtBQUN4RCxhQUFPLEtBQVA7QUFDRDtBQUNGOztBQUVEZixRQUFNbkQsS0FBTixJQUFlZ0UsS0FBZjtBQUNBLFNBQU8sSUFBUDtBQUNEOztBQUVELFNBQVMxRSxtQkFBVCxDQUE2QkMsS0FBN0IsRUFBb0M7QUFDbEMsTUFBSUMsV0FBVyxDQUFmO0FBQ0EsTUFBSUMsV0FBVyxDQUFmOztBQUVBRixRQUFNNEUsT0FBTixDQUFjLFVBQVNqQixJQUFULEVBQWU7QUFDM0IsUUFBSSxPQUFPQSxJQUFQLEtBQWdCLFFBQXBCLEVBQThCO0FBQzVCLFVBQUlrQixVQUFVOUUsb0JBQW9CNEQsS0FBS3ZELElBQXpCLENBQWQ7QUFDQSxVQUFJMEUsYUFBYS9FLG9CQUFvQjRELEtBQUt0RCxNQUF6QixDQUFqQjs7QUFFQSxVQUFJSixhQUFhRSxTQUFqQixFQUE0QjtBQUMxQixZQUFJMEUsUUFBUTVFLFFBQVIsS0FBcUI2RSxXQUFXN0UsUUFBcEMsRUFBOEM7QUFDNUNBLHNCQUFZNEUsUUFBUTVFLFFBQXBCO0FBQ0QsU0FGRCxNQUVPO0FBQ0xBLHFCQUFXRSxTQUFYO0FBQ0Q7QUFDRjs7QUFFRCxVQUFJRCxhQUFhQyxTQUFqQixFQUE0QjtBQUMxQixZQUFJMEUsUUFBUTNFLFFBQVIsS0FBcUI0RSxXQUFXNUUsUUFBcEMsRUFBOEM7QUFDNUNBLHNCQUFZMkUsUUFBUTNFLFFBQXBCO0FBQ0QsU0FGRCxNQUVPO0FBQ0xBLHFCQUFXQyxTQUFYO0FBQ0Q7QUFDRjtBQUNGLEtBbkJELE1BbUJPO0FBQ0wsVUFBSUQsYUFBYUMsU0FBYixLQUEyQndELEtBQUssQ0FBTCxNQUFZLEdBQVosSUFBbUJBLEtBQUssQ0FBTCxNQUFZLEdBQTFELENBQUosRUFBb0U7QUFDbEV6RDtBQUNEO0FBQ0QsVUFBSUQsYUFBYUUsU0FBYixLQUEyQndELEtBQUssQ0FBTCxNQUFZLEdBQVosSUFBbUJBLEtBQUssQ0FBTCxNQUFZLEdBQTFELENBQUosRUFBb0U7QUFDbEUxRDtBQUNEO0FBQ0Y7QUFDRixHQTVCRDs7QUE4QkEsU0FBTyxFQUFDQSxrQkFBRCxFQUFXQyxrQkFBWCxFQUFQO0FBQ0QiLCJmaWxlIjoibWVyZ2UuanMiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQge3N0cnVjdHVyZWRQYXRjaH0gZnJvbSAnLi9jcmVhdGUnO1xuaW1wb3J0IHtwYXJzZVBhdGNofSBmcm9tICcuL3BhcnNlJztcblxuaW1wb3J0IHthcnJheUVxdWFsLCBhcnJheVN0YXJ0c1dpdGh9IGZyb20gJy4uL3V0aWwvYXJyYXknO1xuXG5leHBvcnQgZnVuY3Rpb24gY2FsY0xpbmVDb3VudChodW5rKSB7XG4gIGNvbnN0IHtvbGRMaW5lcywgbmV3TGluZXN9ID0gY2FsY09sZE5ld0xpbmVDb3VudChodW5rLmxpbmVzKTtcblxuICBpZiAob2xkTGluZXMgIT09IHVuZGVmaW5lZCkge1xuICAgIGh1bmsub2xkTGluZXMgPSBvbGRMaW5lcztcbiAgfSBlbHNlIHtcbiAgICBkZWxldGUgaHVuay5vbGRMaW5lcztcbiAgfVxuXG4gIGlmIChuZXdMaW5lcyAhPT0gdW5kZWZpbmVkKSB7XG4gICAgaHVuay5uZXdMaW5lcyA9IG5ld0xpbmVzO1xuICB9IGVsc2Uge1xuICAgIGRlbGV0ZSBodW5rLm5ld0xpbmVzO1xuICB9XG59XG5cbmV4cG9ydCBmdW5jdGlvbiBtZXJnZShtaW5lLCB0aGVpcnMsIGJhc2UpIHtcbiAgbWluZSA9IGxvYWRQYXRjaChtaW5lLCBiYXNlKTtcbiAgdGhlaXJzID0gbG9hZFBhdGNoKHRoZWlycywgYmFzZSk7XG5cbiAgbGV0IHJldCA9IHt9O1xuXG4gIC8vIEZvciBpbmRleCB3ZSBqdXN0IGxldCBpdCBwYXNzIHRocm91Z2ggYXMgaXQgZG9lc24ndCBoYXZlIGFueSBuZWNlc3NhcnkgbWVhbmluZy5cbiAgLy8gTGVhdmluZyBzYW5pdHkgY2hlY2tzIG9uIHRoaXMgdG8gdGhlIEFQSSBjb25zdW1lciB0aGF0IG1heSBrbm93IG1vcmUgYWJvdXQgdGhlXG4gIC8vIG1lYW5pbmcgaW4gdGhlaXIgb3duIGNvbnRleHQuXG4gIGlmIChtaW5lLmluZGV4IHx8IHRoZWlycy5pbmRleCkge1xuICAgIHJldC5pbmRleCA9IG1pbmUuaW5kZXggfHwgdGhlaXJzLmluZGV4O1xuICB9XG5cbiAgaWYgKG1pbmUubmV3RmlsZU5hbWUgfHwgdGhlaXJzLm5ld0ZpbGVOYW1lKSB7XG4gICAgaWYgKCFmaWxlTmFtZUNoYW5nZWQobWluZSkpIHtcbiAgICAgIC8vIE5vIGhlYWRlciBvciBubyBjaGFuZ2UgaW4gb3VycywgdXNlIHRoZWlycyAoYW5kIG91cnMgaWYgdGhlaXJzIGRvZXMgbm90IGV4aXN0KVxuICAgICAgcmV0Lm9sZEZpbGVOYW1lID0gdGhlaXJzLm9sZEZpbGVOYW1lIHx8IG1pbmUub2xkRmlsZU5hbWU7XG4gICAgICByZXQubmV3RmlsZU5hbWUgPSB0aGVpcnMubmV3RmlsZU5hbWUgfHwgbWluZS5uZXdGaWxlTmFtZTtcbiAgICAgIHJldC5vbGRIZWFkZXIgPSB0aGVpcnMub2xkSGVhZGVyIHx8IG1pbmUub2xkSGVhZGVyO1xuICAgICAgcmV0Lm5ld0hlYWRlciA9IHRoZWlycy5uZXdIZWFkZXIgfHwgbWluZS5uZXdIZWFkZXI7XG4gICAgfSBlbHNlIGlmICghZmlsZU5hbWVDaGFuZ2VkKHRoZWlycykpIHtcbiAgICAgIC8vIE5vIGhlYWRlciBvciBubyBjaGFuZ2UgaW4gdGhlaXJzLCB1c2Ugb3Vyc1xuICAgICAgcmV0Lm9sZEZpbGVOYW1lID0gbWluZS5vbGRGaWxlTmFtZTtcbiAgICAgIHJldC5uZXdGaWxlTmFtZSA9IG1pbmUubmV3RmlsZU5hbWU7XG4gICAgICByZXQub2xkSGVhZGVyID0gbWluZS5vbGRIZWFkZXI7XG4gICAgICByZXQubmV3SGVhZGVyID0gbWluZS5uZXdIZWFkZXI7XG4gICAgfSBlbHNlIHtcbiAgICAgIC8vIEJvdGggY2hhbmdlZC4uLiBmaWd1cmUgaXQgb3V0XG4gICAgICByZXQub2xkRmlsZU5hbWUgPSBzZWxlY3RGaWVsZChyZXQsIG1pbmUub2xkRmlsZU5hbWUsIHRoZWlycy5vbGRGaWxlTmFtZSk7XG4gICAgICByZXQubmV3RmlsZU5hbWUgPSBzZWxlY3RGaWVsZChyZXQsIG1pbmUubmV3RmlsZU5hbWUsIHRoZWlycy5uZXdGaWxlTmFtZSk7XG4gICAgICByZXQub2xkSGVhZGVyID0gc2VsZWN0RmllbGQocmV0LCBtaW5lLm9sZEhlYWRlciwgdGhlaXJzLm9sZEhlYWRlcik7XG4gICAgICByZXQubmV3SGVhZGVyID0gc2VsZWN0RmllbGQocmV0LCBtaW5lLm5ld0hlYWRlciwgdGhlaXJzLm5ld0hlYWRlcik7XG4gICAgfVxuICB9XG5cbiAgcmV0Lmh1bmtzID0gW107XG5cbiAgbGV0IG1pbmVJbmRleCA9IDAsXG4gICAgICB0aGVpcnNJbmRleCA9IDAsXG4gICAgICBtaW5lT2Zmc2V0ID0gMCxcbiAgICAgIHRoZWlyc09mZnNldCA9IDA7XG5cbiAgd2hpbGUgKG1pbmVJbmRleCA8IG1pbmUuaHVua3MubGVuZ3RoIHx8IHRoZWlyc0luZGV4IDwgdGhlaXJzLmh1bmtzLmxlbmd0aCkge1xuICAgIGxldCBtaW5lQ3VycmVudCA9IG1pbmUuaHVua3NbbWluZUluZGV4XSB8fCB7b2xkU3RhcnQ6IEluZmluaXR5fSxcbiAgICAgICAgdGhlaXJzQ3VycmVudCA9IHRoZWlycy5odW5rc1t0aGVpcnNJbmRleF0gfHwge29sZFN0YXJ0OiBJbmZpbml0eX07XG5cbiAgICBpZiAoaHVua0JlZm9yZShtaW5lQ3VycmVudCwgdGhlaXJzQ3VycmVudCkpIHtcbiAgICAgIC8vIFRoaXMgcGF0Y2ggZG9lcyBub3Qgb3ZlcmxhcCB3aXRoIGFueSBvZiB0aGUgb3RoZXJzLCB5YXkuXG4gICAgICByZXQuaHVua3MucHVzaChjbG9uZUh1bmsobWluZUN1cnJlbnQsIG1pbmVPZmZzZXQpKTtcbiAgICAgIG1pbmVJbmRleCsrO1xuICAgICAgdGhlaXJzT2Zmc2V0ICs9IG1pbmVDdXJyZW50Lm5ld0xpbmVzIC0gbWluZUN1cnJlbnQub2xkTGluZXM7XG4gICAgfSBlbHNlIGlmIChodW5rQmVmb3JlKHRoZWlyc0N1cnJlbnQsIG1pbmVDdXJyZW50KSkge1xuICAgICAgLy8gVGhpcyBwYXRjaCBkb2VzIG5vdCBvdmVybGFwIHdpdGggYW55IG9mIHRoZSBvdGhlcnMsIHlheS5cbiAgICAgIHJldC5odW5rcy5wdXNoKGNsb25lSHVuayh0aGVpcnNDdXJyZW50LCB0aGVpcnNPZmZzZXQpKTtcbiAgICAgIHRoZWlyc0luZGV4Kys7XG4gICAgICBtaW5lT2Zmc2V0ICs9IHRoZWlyc0N1cnJlbnQubmV3TGluZXMgLSB0aGVpcnNDdXJyZW50Lm9sZExpbmVzO1xuICAgIH0gZWxzZSB7XG4gICAgICAvLyBPdmVybGFwLCBtZXJnZSBhcyBiZXN0IHdlIGNhblxuICAgICAgbGV0IG1lcmdlZEh1bmsgPSB7XG4gICAgICAgIG9sZFN0YXJ0OiBNYXRoLm1pbihtaW5lQ3VycmVudC5vbGRTdGFydCwgdGhlaXJzQ3VycmVudC5vbGRTdGFydCksXG4gICAgICAgIG9sZExpbmVzOiAwLFxuICAgICAgICBuZXdTdGFydDogTWF0aC5taW4obWluZUN1cnJlbnQubmV3U3RhcnQgKyBtaW5lT2Zmc2V0LCB0aGVpcnNDdXJyZW50Lm9sZFN0YXJ0ICsgdGhlaXJzT2Zmc2V0KSxcbiAgICAgICAgbmV3TGluZXM6IDAsXG4gICAgICAgIGxpbmVzOiBbXVxuICAgICAgfTtcbiAgICAgIG1lcmdlTGluZXMobWVyZ2VkSHVuaywgbWluZUN1cnJlbnQub2xkU3RhcnQsIG1pbmVDdXJyZW50LmxpbmVzLCB0aGVpcnNDdXJyZW50Lm9sZFN0YXJ0LCB0aGVpcnNDdXJyZW50LmxpbmVzKTtcbiAgICAgIHRoZWlyc0luZGV4Kys7XG4gICAgICBtaW5lSW5kZXgrKztcblxuICAgICAgcmV0Lmh1bmtzLnB1c2gobWVyZ2VkSHVuayk7XG4gICAgfVxuICB9XG5cbiAgcmV0dXJuIHJldDtcbn1cblxuZnVuY3Rpb24gbG9hZFBhdGNoKHBhcmFtLCBiYXNlKSB7XG4gIGlmICh0eXBlb2YgcGFyYW0gPT09ICdzdHJpbmcnKSB7XG4gICAgaWYgKC9eQEAvbS50ZXN0KHBhcmFtKSB8fCAoL15JbmRleDovbS50ZXN0KHBhcmFtKSkpIHtcbiAgICAgIHJldHVybiBwYXJzZVBhdGNoKHBhcmFtKVswXTtcbiAgICB9XG5cbiAgICBpZiAoIWJhc2UpIHtcbiAgICAgIHRocm93IG5ldyBFcnJvcignTXVzdCBwcm92aWRlIGEgYmFzZSByZWZlcmVuY2Ugb3IgcGFzcyBpbiBhIHBhdGNoJyk7XG4gICAgfVxuICAgIHJldHVybiBzdHJ1Y3R1cmVkUGF0Y2godW5kZWZpbmVkLCB1bmRlZmluZWQsIGJhc2UsIHBhcmFtKTtcbiAgfVxuXG4gIHJldHVybiBwYXJhbTtcbn1cblxuZnVuY3Rpb24gZmlsZU5hbWVDaGFuZ2VkKHBhdGNoKSB7XG4gIHJldHVybiBwYXRjaC5uZXdGaWxlTmFtZSAmJiBwYXRjaC5uZXdGaWxlTmFtZSAhPT0gcGF0Y2gub2xkRmlsZU5hbWU7XG59XG5cbmZ1bmN0aW9uIHNlbGVjdEZpZWxkKGluZGV4LCBtaW5lLCB0aGVpcnMpIHtcbiAgaWYgKG1pbmUgPT09IHRoZWlycykge1xuICAgIHJldHVybiBtaW5lO1xuICB9IGVsc2Uge1xuICAgIGluZGV4LmNvbmZsaWN0ID0gdHJ1ZTtcbiAgICByZXR1cm4ge21pbmUsIHRoZWlyc307XG4gIH1cbn1cblxuZnVuY3Rpb24gaHVua0JlZm9yZSh0ZXN0LCBjaGVjaykge1xuICByZXR1cm4gdGVzdC5vbGRTdGFydCA8IGNoZWNrLm9sZFN0YXJ0XG4gICAgJiYgKHRlc3Qub2xkU3RhcnQgKyB0ZXN0Lm9sZExpbmVzKSA8IGNoZWNrLm9sZFN0YXJ0O1xufVxuXG5mdW5jdGlvbiBjbG9uZUh1bmsoaHVuaywgb2Zmc2V0KSB7XG4gIHJldHVybiB7XG4gICAgb2xkU3RhcnQ6IGh1bmsub2xkU3RhcnQsIG9sZExpbmVzOiBodW5rLm9sZExpbmVzLFxuICAgIG5ld1N0YXJ0OiBodW5rLm5ld1N0YXJ0ICsgb2Zmc2V0LCBuZXdMaW5lczogaHVuay5uZXdMaW5lcyxcbiAgICBsaW5lczogaHVuay5saW5lc1xuICB9O1xufVxuXG5mdW5jdGlvbiBtZXJnZUxpbmVzKGh1bmssIG1pbmVPZmZzZXQsIG1pbmVMaW5lcywgdGhlaXJPZmZzZXQsIHRoZWlyTGluZXMpIHtcbiAgLy8gVGhpcyB3aWxsIGdlbmVyYWxseSByZXN1bHQgaW4gYSBjb25mbGljdGVkIGh1bmssIGJ1dCB0aGVyZSBhcmUgY2FzZXMgd2hlcmUgdGhlIGNvbnRleHRcbiAgLy8gaXMgdGhlIG9ubHkgb3ZlcmxhcCB3aGVyZSB3ZSBjYW4gc3VjY2Vzc2Z1bGx5IG1lcmdlIHRoZSBjb250ZW50IGhlcmUuXG4gIGxldCBtaW5lID0ge29mZnNldDogbWluZU9mZnNldCwgbGluZXM6IG1pbmVMaW5lcywgaW5kZXg6IDB9LFxuICAgICAgdGhlaXIgPSB7b2Zmc2V0OiB0aGVpck9mZnNldCwgbGluZXM6IHRoZWlyTGluZXMsIGluZGV4OiAwfTtcblxuICAvLyBIYW5kbGUgYW55IGxlYWRpbmcgY29udGVudFxuICBpbnNlcnRMZWFkaW5nKGh1bmssIG1pbmUsIHRoZWlyKTtcbiAgaW5zZXJ0TGVhZGluZyhodW5rLCB0aGVpciwgbWluZSk7XG5cbiAgLy8gTm93IGluIHRoZSBvdmVybGFwIGNvbnRlbnQuIFNjYW4gdGhyb3VnaCBhbmQgc2VsZWN0IHRoZSBiZXN0IGNoYW5nZXMgZnJvbSBlYWNoLlxuICB3aGlsZSAobWluZS5pbmRleCA8IG1pbmUubGluZXMubGVuZ3RoICYmIHRoZWlyLmluZGV4IDwgdGhlaXIubGluZXMubGVuZ3RoKSB7XG4gICAgbGV0IG1pbmVDdXJyZW50ID0gbWluZS5saW5lc1ttaW5lLmluZGV4XSxcbiAgICAgICAgdGhlaXJDdXJyZW50ID0gdGhlaXIubGluZXNbdGhlaXIuaW5kZXhdO1xuXG4gICAgaWYgKChtaW5lQ3VycmVudFswXSA9PT0gJy0nIHx8IG1pbmVDdXJyZW50WzBdID09PSAnKycpXG4gICAgICAgICYmICh0aGVpckN1cnJlbnRbMF0gPT09ICctJyB8fCB0aGVpckN1cnJlbnRbMF0gPT09ICcrJykpIHtcbiAgICAgIC8vIEJvdGggbW9kaWZpZWQgLi4uXG4gICAgICBtdXR1YWxDaGFuZ2UoaHVuaywgbWluZSwgdGhlaXIpO1xuICAgIH0gZWxzZSBpZiAobWluZUN1cnJlbnRbMF0gPT09ICcrJyAmJiB0aGVpckN1cnJlbnRbMF0gPT09ICcgJykge1xuICAgICAgLy8gTWluZSBpbnNlcnRlZFxuICAgICAgaHVuay5saW5lcy5wdXNoKC4uLiBjb2xsZWN0Q2hhbmdlKG1pbmUpKTtcbiAgICB9IGVsc2UgaWYgKHRoZWlyQ3VycmVudFswXSA9PT0gJysnICYmIG1pbmVDdXJyZW50WzBdID09PSAnICcpIHtcbiAgICAgIC8vIFRoZWlycyBpbnNlcnRlZFxuICAgICAgaHVuay5saW5lcy5wdXNoKC4uLiBjb2xsZWN0Q2hhbmdlKHRoZWlyKSk7XG4gICAgfSBlbHNlIGlmIChtaW5lQ3VycmVudFswXSA9PT0gJy0nICYmIHRoZWlyQ3VycmVudFswXSA9PT0gJyAnKSB7XG4gICAgICAvLyBNaW5lIHJlbW92ZWQgb3IgZWRpdGVkXG4gICAgICByZW1vdmFsKGh1bmssIG1pbmUsIHRoZWlyKTtcbiAgICB9IGVsc2UgaWYgKHRoZWlyQ3VycmVudFswXSA9PT0gJy0nICYmIG1pbmVDdXJyZW50WzBdID09PSAnICcpIHtcbiAgICAgIC8vIFRoZWlyIHJlbW92ZWQgb3IgZWRpdGVkXG4gICAgICByZW1vdmFsKGh1bmssIHRoZWlyLCBtaW5lLCB0cnVlKTtcbiAgICB9IGVsc2UgaWYgKG1pbmVDdXJyZW50ID09PSB0aGVpckN1cnJlbnQpIHtcbiAgICAgIC8vIENvbnRleHQgaWRlbnRpdHlcbiAgICAgIGh1bmsubGluZXMucHVzaChtaW5lQ3VycmVudCk7XG4gICAgICBtaW5lLmluZGV4Kys7XG4gICAgICB0aGVpci5pbmRleCsrO1xuICAgIH0gZWxzZSB7XG4gICAgICAvLyBDb250ZXh0IG1pc21hdGNoXG4gICAgICBjb25mbGljdChodW5rLCBjb2xsZWN0Q2hhbmdlKG1pbmUpLCBjb2xsZWN0Q2hhbmdlKHRoZWlyKSk7XG4gICAgfVxuICB9XG5cbiAgLy8gTm93IHB1c2ggYW55dGhpbmcgdGhhdCBtYXkgYmUgcmVtYWluaW5nXG4gIGluc2VydFRyYWlsaW5nKGh1bmssIG1pbmUpO1xuICBpbnNlcnRUcmFpbGluZyhodW5rLCB0aGVpcik7XG5cbiAgY2FsY0xpbmVDb3VudChodW5rKTtcbn1cblxuZnVuY3Rpb24gbXV0dWFsQ2hhbmdlKGh1bmssIG1pbmUsIHRoZWlyKSB7XG4gIGxldCBteUNoYW5nZXMgPSBjb2xsZWN0Q2hhbmdlKG1pbmUpLFxuICAgICAgdGhlaXJDaGFuZ2VzID0gY29sbGVjdENoYW5nZSh0aGVpcik7XG5cbiAgaWYgKGFsbFJlbW92ZXMobXlDaGFuZ2VzKSAmJiBhbGxSZW1vdmVzKHRoZWlyQ2hhbmdlcykpIHtcbiAgICAvLyBTcGVjaWFsIGNhc2UgZm9yIHJlbW92ZSBjaGFuZ2VzIHRoYXQgYXJlIHN1cGVyc2V0cyBvZiBvbmUgYW5vdGhlclxuICAgIGlmIChhcnJheVN0YXJ0c1dpdGgobXlDaGFuZ2VzLCB0aGVpckNoYW5nZXMpXG4gICAgICAgICYmIHNraXBSZW1vdmVTdXBlcnNldCh0aGVpciwgbXlDaGFuZ2VzLCBteUNoYW5nZXMubGVuZ3RoIC0gdGhlaXJDaGFuZ2VzLmxlbmd0aCkpIHtcbiAgICAgIGh1bmsubGluZXMucHVzaCguLi4gbXlDaGFuZ2VzKTtcbiAgICAgIHJldHVybjtcbiAgICB9IGVsc2UgaWYgKGFycmF5U3RhcnRzV2l0aCh0aGVpckNoYW5nZXMsIG15Q2hhbmdlcylcbiAgICAgICAgJiYgc2tpcFJlbW92ZVN1cGVyc2V0KG1pbmUsIHRoZWlyQ2hhbmdlcywgdGhlaXJDaGFuZ2VzLmxlbmd0aCAtIG15Q2hhbmdlcy5sZW5ndGgpKSB7XG4gICAgICBodW5rLmxpbmVzLnB1c2goLi4uIHRoZWlyQ2hhbmdlcyk7XG4gICAgICByZXR1cm47XG4gICAgfVxuICB9IGVsc2UgaWYgKGFycmF5RXF1YWwobXlDaGFuZ2VzLCB0aGVpckNoYW5nZXMpKSB7XG4gICAgaHVuay5saW5lcy5wdXNoKC4uLiBteUNoYW5nZXMpO1xuICAgIHJldHVybjtcbiAgfVxuXG4gIGNvbmZsaWN0KGh1bmssIG15Q2hhbmdlcywgdGhlaXJDaGFuZ2VzKTtcbn1cblxuZnVuY3Rpb24gcmVtb3ZhbChodW5rLCBtaW5lLCB0aGVpciwgc3dhcCkge1xuICBsZXQgbXlDaGFuZ2VzID0gY29sbGVjdENoYW5nZShtaW5lKSxcbiAgICAgIHRoZWlyQ2hhbmdlcyA9IGNvbGxlY3RDb250ZXh0KHRoZWlyLCBteUNoYW5nZXMpO1xuICBpZiAodGhlaXJDaGFuZ2VzLm1lcmdlZCkge1xuICAgIGh1bmsubGluZXMucHVzaCguLi4gdGhlaXJDaGFuZ2VzLm1lcmdlZCk7XG4gIH0gZWxzZSB7XG4gICAgY29uZmxpY3QoaHVuaywgc3dhcCA/IHRoZWlyQ2hhbmdlcyA6IG15Q2hhbmdlcywgc3dhcCA/IG15Q2hhbmdlcyA6IHRoZWlyQ2hhbmdlcyk7XG4gIH1cbn1cblxuZnVuY3Rpb24gY29uZmxpY3QoaHVuaywgbWluZSwgdGhlaXIpIHtcbiAgaHVuay5jb25mbGljdCA9IHRydWU7XG4gIGh1bmsubGluZXMucHVzaCh7XG4gICAgY29uZmxpY3Q6IHRydWUsXG4gICAgbWluZTogbWluZSxcbiAgICB0aGVpcnM6IHRoZWlyXG4gIH0pO1xufVxuXG5mdW5jdGlvbiBpbnNlcnRMZWFkaW5nKGh1bmssIGluc2VydCwgdGhlaXIpIHtcbiAgd2hpbGUgKGluc2VydC5vZmZzZXQgPCB0aGVpci5vZmZzZXQgJiYgaW5zZXJ0LmluZGV4IDwgaW5zZXJ0LmxpbmVzLmxlbmd0aCkge1xuICAgIGxldCBsaW5lID0gaW5zZXJ0LmxpbmVzW2luc2VydC5pbmRleCsrXTtcbiAgICBodW5rLmxpbmVzLnB1c2gobGluZSk7XG4gICAgaW5zZXJ0Lm9mZnNldCsrO1xuICB9XG59XG5mdW5jdGlvbiBpbnNlcnRUcmFpbGluZyhodW5rLCBpbnNlcnQpIHtcbiAgd2hpbGUgKGluc2VydC5pbmRleCA8IGluc2VydC5saW5lcy5sZW5ndGgpIHtcbiAgICBsZXQgbGluZSA9IGluc2VydC5saW5lc1tpbnNlcnQuaW5kZXgrK107XG4gICAgaHVuay5saW5lcy5wdXNoKGxpbmUpO1xuICB9XG59XG5cbmZ1bmN0aW9uIGNvbGxlY3RDaGFuZ2Uoc3RhdGUpIHtcbiAgbGV0IHJldCA9IFtdLFxuICAgICAgb3BlcmF0aW9uID0gc3RhdGUubGluZXNbc3RhdGUuaW5kZXhdWzBdO1xuICB3aGlsZSAoc3RhdGUuaW5kZXggPCBzdGF0ZS5saW5lcy5sZW5ndGgpIHtcbiAgICBsZXQgbGluZSA9IHN0YXRlLmxpbmVzW3N0YXRlLmluZGV4XTtcblxuICAgIC8vIEdyb3VwIGFkZGl0aW9ucyB0aGF0IGFyZSBpbW1lZGlhdGVseSBhZnRlciBzdWJ0cmFjdGlvbnMgYW5kIHRyZWF0IHRoZW0gYXMgb25lIFwiYXRvbWljXCIgbW9kaWZ5IGNoYW5nZS5cbiAgICBpZiAob3BlcmF0aW9uID09PSAnLScgJiYgbGluZVswXSA9PT0gJysnKSB7XG4gICAgICBvcGVyYXRpb24gPSAnKyc7XG4gICAgfVxuXG4gICAgaWYgKG9wZXJhdGlvbiA9PT0gbGluZVswXSkge1xuICAgICAgcmV0LnB1c2gobGluZSk7XG4gICAgICBzdGF0ZS5pbmRleCsrO1xuICAgIH0gZWxzZSB7XG4gICAgICBicmVhaztcbiAgICB9XG4gIH1cblxuICByZXR1cm4gcmV0O1xufVxuZnVuY3Rpb24gY29sbGVjdENvbnRleHQoc3RhdGUsIG1hdGNoQ2hhbmdlcykge1xuICBsZXQgY2hhbmdlcyA9IFtdLFxuICAgICAgbWVyZ2VkID0gW10sXG4gICAgICBtYXRjaEluZGV4ID0gMCxcbiAgICAgIGNvbnRleHRDaGFuZ2VzID0gZmFsc2UsXG4gICAgICBjb25mbGljdGVkID0gZmFsc2U7XG4gIHdoaWxlIChtYXRjaEluZGV4IDwgbWF0Y2hDaGFuZ2VzLmxlbmd0aFxuICAgICAgICAmJiBzdGF0ZS5pbmRleCA8IHN0YXRlLmxpbmVzLmxlbmd0aCkge1xuICAgIGxldCBjaGFuZ2UgPSBzdGF0ZS5saW5lc1tzdGF0ZS5pbmRleF0sXG4gICAgICAgIG1hdGNoID0gbWF0Y2hDaGFuZ2VzW21hdGNoSW5kZXhdO1xuXG4gICAgLy8gT25jZSB3ZSd2ZSBoaXQgb3VyIGFkZCwgdGhlbiB3ZSBhcmUgZG9uZVxuICAgIGlmIChtYXRjaFswXSA9PT0gJysnKSB7XG4gICAgICBicmVhaztcbiAgICB9XG5cbiAgICBjb250ZXh0Q2hhbmdlcyA9IGNvbnRleHRDaGFuZ2VzIHx8IGNoYW5nZVswXSAhPT0gJyAnO1xuXG4gICAgbWVyZ2VkLnB1c2gobWF0Y2gpO1xuICAgIG1hdGNoSW5kZXgrKztcblxuICAgIC8vIENvbnN1bWUgYW55IGFkZGl0aW9ucyBpbiB0aGUgb3RoZXIgYmxvY2sgYXMgYSBjb25mbGljdCB0byBhdHRlbXB0XG4gICAgLy8gdG8gcHVsbCBpbiB0aGUgcmVtYWluaW5nIGNvbnRleHQgYWZ0ZXIgdGhpc1xuICAgIGlmIChjaGFuZ2VbMF0gPT09ICcrJykge1xuICAgICAgY29uZmxpY3RlZCA9IHRydWU7XG5cbiAgICAgIHdoaWxlIChjaGFuZ2VbMF0gPT09ICcrJykge1xuICAgICAgICBjaGFuZ2VzLnB1c2goY2hhbmdlKTtcbiAgICAgICAgY2hhbmdlID0gc3RhdGUubGluZXNbKytzdGF0ZS5pbmRleF07XG4gICAgICB9XG4gICAgfVxuXG4gICAgaWYgKG1hdGNoLnN1YnN0cigxKSA9PT0gY2hhbmdlLnN1YnN0cigxKSkge1xuICAgICAgY2hhbmdlcy5wdXNoKGNoYW5nZSk7XG4gICAgICBzdGF0ZS5pbmRleCsrO1xuICAgIH0gZWxzZSB7XG4gICAgICBjb25mbGljdGVkID0gdHJ1ZTtcbiAgICB9XG4gIH1cblxuICBpZiAoKG1hdGNoQ2hhbmdlc1ttYXRjaEluZGV4XSB8fCAnJylbMF0gPT09ICcrJ1xuICAgICAgJiYgY29udGV4dENoYW5nZXMpIHtcbiAgICBjb25mbGljdGVkID0gdHJ1ZTtcbiAgfVxuXG4gIGlmIChjb25mbGljdGVkKSB7XG4gICAgcmV0dXJuIGNoYW5nZXM7XG4gIH1cblxuICB3aGlsZSAobWF0Y2hJbmRleCA8IG1hdGNoQ2hhbmdlcy5sZW5ndGgpIHtcbiAgICBtZXJnZWQucHVzaChtYXRjaENoYW5nZXNbbWF0Y2hJbmRleCsrXSk7XG4gIH1cblxuICByZXR1cm4ge1xuICAgIG1lcmdlZCxcbiAgICBjaGFuZ2VzXG4gIH07XG59XG5cbmZ1bmN0aW9uIGFsbFJlbW92ZXMoY2hhbmdlcykge1xuICByZXR1cm4gY2hhbmdlcy5yZWR1Y2UoZnVuY3Rpb24ocHJldiwgY2hhbmdlKSB7XG4gICAgcmV0dXJuIHByZXYgJiYgY2hhbmdlWzBdID09PSAnLSc7XG4gIH0sIHRydWUpO1xufVxuZnVuY3Rpb24gc2tpcFJlbW92ZVN1cGVyc2V0KHN0YXRlLCByZW1vdmVDaGFuZ2VzLCBkZWx0YSkge1xuICBmb3IgKGxldCBpID0gMDsgaSA8IGRlbHRhOyBpKyspIHtcbiAgICBsZXQgY2hhbmdlQ29udGVudCA9IHJlbW92ZUNoYW5nZXNbcmVtb3ZlQ2hhbmdlcy5sZW5ndGggLSBkZWx0YSArIGldLnN1YnN0cigxKTtcbiAgICBpZiAoc3RhdGUubGluZXNbc3RhdGUuaW5kZXggKyBpXSAhPT0gJyAnICsgY2hhbmdlQ29udGVudCkge1xuICAgICAgcmV0dXJuIGZhbHNlO1xuICAgIH1cbiAgfVxuXG4gIHN0YXRlLmluZGV4ICs9IGRlbHRhO1xuICByZXR1cm4gdHJ1ZTtcbn1cblxuZnVuY3Rpb24gY2FsY09sZE5ld0xpbmVDb3VudChsaW5lcykge1xuICBsZXQgb2xkTGluZXMgPSAwO1xuICBsZXQgbmV3TGluZXMgPSAwO1xuXG4gIGxpbmVzLmZvckVhY2goZnVuY3Rpb24obGluZSkge1xuICAgIGlmICh0eXBlb2YgbGluZSAhPT0gJ3N0cmluZycpIHtcbiAgICAgIGxldCBteUNvdW50ID0gY2FsY09sZE5ld0xpbmVDb3VudChsaW5lLm1pbmUpO1xuICAgICAgbGV0IHRoZWlyQ291bnQgPSBjYWxjT2xkTmV3TGluZUNvdW50KGxpbmUudGhlaXJzKTtcblxuICAgICAgaWYgKG9sZExpbmVzICE9PSB1bmRlZmluZWQpIHtcbiAgICAgICAgaWYgKG15Q291bnQub2xkTGluZXMgPT09IHRoZWlyQ291bnQub2xkTGluZXMpIHtcbiAgICAgICAgICBvbGRMaW5lcyArPSBteUNvdW50Lm9sZExpbmVzO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIG9sZExpbmVzID0gdW5kZWZpbmVkO1xuICAgICAgICB9XG4gICAgICB9XG5cbiAgICAgIGlmIChuZXdMaW5lcyAhPT0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGlmIChteUNvdW50Lm5ld0xpbmVzID09PSB0aGVpckNvdW50Lm5ld0xpbmVzKSB7XG4gICAgICAgICAgbmV3TGluZXMgKz0gbXlDb3VudC5uZXdMaW5lcztcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICBuZXdMaW5lcyA9IHVuZGVmaW5lZDtcbiAgICAgICAgfVxuICAgICAgfVxuICAgIH0gZWxzZSB7XG4gICAgICBpZiAobmV3TGluZXMgIT09IHVuZGVmaW5lZCAmJiAobGluZVswXSA9PT0gJysnIHx8IGxpbmVbMF0gPT09ICcgJykpIHtcbiAgICAgICAgbmV3TGluZXMrKztcbiAgICAgIH1cbiAgICAgIGlmIChvbGRMaW5lcyAhPT0gdW5kZWZpbmVkICYmIChsaW5lWzBdID09PSAnLScgfHwgbGluZVswXSA9PT0gJyAnKSkge1xuICAgICAgICBvbGRMaW5lcysrO1xuICAgICAgfVxuICAgIH1cbiAgfSk7XG5cbiAgcmV0dXJuIHtvbGRMaW5lcywgbmV3TGluZXN9O1xufVxuIl19 32847 32848 32849 /***/ }), 32850 /* 14 */ 32851 /***/ (function(module, exports, __webpack_require__) { 32852 32853 /*istanbul ignore start*/'use strict'; 32854 32855 exports.__esModule = true; 32856 exports. /*istanbul ignore end*/structuredPatch = structuredPatch; 32857 /*istanbul ignore start*/exports. /*istanbul ignore end*/createTwoFilesPatch = createTwoFilesPatch; 32858 /*istanbul ignore start*/exports. /*istanbul ignore end*/createPatch = createPatch; 32859 32860 var /*istanbul ignore start*/_line = __webpack_require__(5) /*istanbul ignore end*/; 32861 32862 /*istanbul ignore start*/function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } 32863 32864 /*istanbul ignore end*/function structuredPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader, options) { 32865 if (!options) { 32866 options = {}; 32867 } 32868 if (typeof options.context === 'undefined') { 32869 options.context = 4; 32870 } 32871 32872 var diff = /*istanbul ignore start*/(0, _line.diffLines) /*istanbul ignore end*/(oldStr, newStr, options); 32873 diff.push({ value: '', lines: [] }); // Append an empty value to make cleanup easier 32874 32875 function contextLines(lines) { 32876 return lines.map(function (entry) { 32877 return ' ' + entry; 32878 }); 32879 } 32880 32881 var hunks = []; 32882 var oldRangeStart = 0, 32883 newRangeStart = 0, 32884 curRange = [], 32885 oldLine = 1, 32886 newLine = 1; 32887 32888 /*istanbul ignore start*/var _loop = function _loop( /*istanbul ignore end*/i) { 32889 var current = diff[i], 32890 lines = current.lines || current.value.replace(/\n$/, '').split('\n'); 32891 current.lines = lines; 32892 32893 if (current.added || current.removed) { 32894 /*istanbul ignore start*/var _curRange; 32895 32896 /*istanbul ignore end*/ // If we have previous context, start with that 32897 if (!oldRangeStart) { 32898 var prev = diff[i - 1]; 32899 oldRangeStart = oldLine; 32900 newRangeStart = newLine; 32901 32902 if (prev) { 32903 curRange = options.context > 0 ? contextLines(prev.lines.slice(-options.context)) : []; 32904 oldRangeStart -= curRange.length; 32905 newRangeStart -= curRange.length; 32906 } 32907 } 32908 32909 // Output our changes 32910 /*istanbul ignore start*/(_curRange = /*istanbul ignore end*/curRange).push. /*istanbul ignore start*/apply /*istanbul ignore end*/( /*istanbul ignore start*/_curRange /*istanbul ignore end*/, /*istanbul ignore start*/_toConsumableArray( /*istanbul ignore end*/lines.map(function (entry) { 32911 return (current.added ? '+' : '-') + entry; 32912 }))); 32913 32914 // Track the updated file position 32915 if (current.added) { 32916 newLine += lines.length; 32917 } else { 32918 oldLine += lines.length; 32919 } 32920 } else { 32921 // Identical context lines. Track line changes 32922 if (oldRangeStart) { 32923 // Close out any changes that have been output (or join overlapping) 32924 if (lines.length <= options.context * 2 && i < diff.length - 2) { 32925 /*istanbul ignore start*/var _curRange2; 32926 32927 /*istanbul ignore end*/ // Overlapping 32928 /*istanbul ignore start*/(_curRange2 = /*istanbul ignore end*/curRange).push. /*istanbul ignore start*/apply /*istanbul ignore end*/( /*istanbul ignore start*/_curRange2 /*istanbul ignore end*/, /*istanbul ignore start*/_toConsumableArray( /*istanbul ignore end*/contextLines(lines))); 32929 } else { 32930 /*istanbul ignore start*/var _curRange3; 32931 32932 /*istanbul ignore end*/ // end the range and output 32933 var contextSize = Math.min(lines.length, options.context); 32934 /*istanbul ignore start*/(_curRange3 = /*istanbul ignore end*/curRange).push. /*istanbul ignore start*/apply /*istanbul ignore end*/( /*istanbul ignore start*/_curRange3 /*istanbul ignore end*/, /*istanbul ignore start*/_toConsumableArray( /*istanbul ignore end*/contextLines(lines.slice(0, contextSize)))); 32935 32936 var hunk = { 32937 oldStart: oldRangeStart, 32938 oldLines: oldLine - oldRangeStart + contextSize, 32939 newStart: newRangeStart, 32940 newLines: newLine - newRangeStart + contextSize, 32941 lines: curRange 32942 }; 32943 if (i >= diff.length - 2 && lines.length <= options.context) { 32944 // EOF is inside this hunk 32945 var oldEOFNewline = /\n$/.test(oldStr); 32946 var newEOFNewline = /\n$/.test(newStr); 32947 if (lines.length == 0 && !oldEOFNewline) { 32948 // special case: old has no eol and no trailing context; no-nl can end up before adds 32949 curRange.splice(hunk.oldLines, 0, '\\ No newline at end of file'); 32950 } else if (!oldEOFNewline || !newEOFNewline) { 32951 curRange.push('\\ No newline at end of file'); 32952 } 32953 } 32954 hunks.push(hunk); 32955 32956 oldRangeStart = 0; 32957 newRangeStart = 0; 32958 curRange = []; 32959 } 32960 } 32961 oldLine += lines.length; 32962 newLine += lines.length; 32963 } 32964 }; 32965 32966 for (var i = 0; i < diff.length; i++) { 32967 /*istanbul ignore start*/_loop( /*istanbul ignore end*/i); 32968 } 32969 32970 return { 32971 oldFileName: oldFileName, newFileName: newFileName, 32972 oldHeader: oldHeader, newHeader: newHeader, 32973 hunks: hunks 32974 }; 32975 } 32976 32977 function createTwoFilesPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader, options) { 32978 var diff = structuredPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader, options); 32979 32980 var ret = []; 32981 if (oldFileName == newFileName) { 32982 ret.push('Index: ' + oldFileName); 32983 } 32984 ret.push('==================================================================='); 32985 ret.push('--- ' + diff.oldFileName + (typeof diff.oldHeader === 'undefined' ? '' : '\t' + diff.oldHeader)); 32986 ret.push('+++ ' + diff.newFileName + (typeof diff.newHeader === 'undefined' ? '' : '\t' + diff.newHeader)); 32987 32988 for (var i = 0; i < diff.hunks.length; i++) { 32989 var hunk = diff.hunks[i]; 32990 ret.push('@@ -' + hunk.oldStart + ',' + hunk.oldLines + ' +' + hunk.newStart + ',' + hunk.newLines + ' @@'); 32991 ret.push.apply(ret, hunk.lines); 32992 } 32993 32994 return ret.join('\n') + '\n'; 32995 } 32996 32997 function createPatch(fileName, oldStr, newStr, oldHeader, newHeader, options) { 32998 return createTwoFilesPatch(fileName, fileName, oldStr, newStr, oldHeader, newHeader, options); 32999 } 33000 //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9wYXRjaC9jcmVhdGUuanMiXSwibmFtZXMiOlsic3RydWN0dXJlZFBhdGNoIiwiY3JlYXRlVHdvRmlsZXNQYXRjaCIsImNyZWF0ZVBhdGNoIiwib2xkRmlsZU5hbWUiLCJuZXdGaWxlTmFtZSIsIm9sZFN0ciIsIm5ld1N0ciIsIm9sZEhlYWRlciIsIm5ld0hlYWRlciIsIm9wdGlvbnMiLCJjb250ZXh0IiwiZGlmZiIsInB1c2giLCJ2YWx1ZSIsImxpbmVzIiwiY29udGV4dExpbmVzIiwibWFwIiwiZW50cnkiLCJodW5rcyIsIm9sZFJhbmdlU3RhcnQiLCJuZXdSYW5nZVN0YXJ0IiwiY3VyUmFuZ2UiLCJvbGRMaW5lIiwibmV3TGluZSIsImkiLCJjdXJyZW50IiwicmVwbGFjZSIsInNwbGl0IiwiYWRkZWQiLCJyZW1vdmVkIiwicHJldiIsInNsaWNlIiwibGVuZ3RoIiwiY29udGV4dFNpemUiLCJNYXRoIiwibWluIiwiaHVuayIsIm9sZFN0YXJ0Iiwib2xkTGluZXMiLCJuZXdTdGFydCIsIm5ld0xpbmVzIiwib2xkRU9GTmV3bGluZSIsInRlc3QiLCJuZXdFT0ZOZXdsaW5lIiwic3BsaWNlIiwicmV0IiwiYXBwbHkiLCJqb2luIiwiZmlsZU5hbWUiXSwibWFwcGluZ3MiOiI7OztnQ0FFZ0JBLGUsR0FBQUEsZTt5REFpR0FDLG1CLEdBQUFBLG1CO3lEQXdCQUMsVyxHQUFBQSxXOztBQTNIaEI7Ozs7dUJBRU8sU0FBU0YsZUFBVCxDQUF5QkcsV0FBekIsRUFBc0NDLFdBQXRDLEVBQW1EQyxNQUFuRCxFQUEyREMsTUFBM0QsRUFBbUVDLFNBQW5FLEVBQThFQyxTQUE5RSxFQUF5RkMsT0FBekYsRUFBa0c7QUFDdkcsTUFBSSxDQUFDQSxPQUFMLEVBQWM7QUFDWkEsY0FBVSxFQUFWO0FBQ0Q7QUFDRCxNQUFJLE9BQU9BLFFBQVFDLE9BQWYsS0FBMkIsV0FBL0IsRUFBNEM7QUFDMUNELFlBQVFDLE9BQVIsR0FBa0IsQ0FBbEI7QUFDRDs7QUFFRCxNQUFNQyxPQUFPLHNFQUFVTixNQUFWLEVBQWtCQyxNQUFsQixFQUEwQkcsT0FBMUIsQ0FBYjtBQUNBRSxPQUFLQyxJQUFMLENBQVUsRUFBQ0MsT0FBTyxFQUFSLEVBQVlDLE9BQU8sRUFBbkIsRUFBVixFQVR1RyxDQVNsRTs7QUFFckMsV0FBU0MsWUFBVCxDQUFzQkQsS0FBdEIsRUFBNkI7QUFDM0IsV0FBT0EsTUFBTUUsR0FBTixDQUFVLFVBQVNDLEtBQVQsRUFBZ0I7QUFBRSxhQUFPLE1BQU1BLEtBQWI7QUFBcUIsS0FBakQsQ0FBUDtBQUNEOztBQUVELE1BQUlDLFFBQVEsRUFBWjtBQUNBLE1BQUlDLGdCQUFnQixDQUFwQjtBQUFBLE1BQXVCQyxnQkFBZ0IsQ0FBdkM7QUFBQSxNQUEwQ0MsV0FBVyxFQUFyRDtBQUFBLE1BQ0lDLFVBQVUsQ0FEZDtBQUFBLE1BQ2lCQyxVQUFVLENBRDNCOztBQWhCdUcsOEVBa0I5RkMsQ0FsQjhGO0FBbUJyRyxRQUFNQyxVQUFVZCxLQUFLYSxDQUFMLENBQWhCO0FBQUEsUUFDTVYsUUFBUVcsUUFBUVgsS0FBUixJQUFpQlcsUUFBUVosS0FBUixDQUFjYSxPQUFkLENBQXNCLEtBQXRCLEVBQTZCLEVBQTdCLEVBQWlDQyxLQUFqQyxDQUF1QyxJQUF2QyxDQUQvQjtBQUVBRixZQUFRWCxLQUFSLEdBQWdCQSxLQUFoQjs7QUFFQSxRQUFJVyxRQUFRRyxLQUFSLElBQWlCSCxRQUFRSSxPQUE3QixFQUFzQztBQUFBOztBQUFBLDhCQUNwQztBQUNBLFVBQUksQ0FBQ1YsYUFBTCxFQUFvQjtBQUNsQixZQUFNVyxPQUFPbkIsS0FBS2EsSUFBSSxDQUFULENBQWI7QUFDQUwsd0JBQWdCRyxPQUFoQjtBQUNBRix3QkFBZ0JHLE9BQWhCOztBQUVBLFlBQUlPLElBQUosRUFBVTtBQUNSVCxxQkFBV1osUUFBUUMsT0FBUixHQUFrQixDQUFsQixHQUFzQkssYUFBYWUsS0FBS2hCLEtBQUwsQ0FBV2lCLEtBQVgsQ0FBaUIsQ0FBQ3RCLFFBQVFDLE9BQTFCLENBQWIsQ0FBdEIsR0FBeUUsRUFBcEY7QUFDQVMsMkJBQWlCRSxTQUFTVyxNQUExQjtBQUNBWiwyQkFBaUJDLFNBQVNXLE1BQTFCO0FBQ0Q7QUFDRjs7QUFFRDtBQUNBLDZFQUFTcEIsSUFBVCwwTEFBa0JFLE1BQU1FLEdBQU4sQ0FBVSxVQUFTQyxLQUFULEVBQWdCO0FBQzFDLGVBQU8sQ0FBQ1EsUUFBUUcsS0FBUixHQUFnQixHQUFoQixHQUFzQixHQUF2QixJQUE4QlgsS0FBckM7QUFDRCxPQUZpQixDQUFsQjs7QUFJQTtBQUNBLFVBQUlRLFFBQVFHLEtBQVosRUFBbUI7QUFDakJMLG1CQUFXVCxNQUFNa0IsTUFBakI7QUFDRCxPQUZELE1BRU87QUFDTFYsbUJBQVdSLE1BQU1rQixNQUFqQjtBQUNEO0FBQ0YsS0F6QkQsTUF5Qk87QUFDTDtBQUNBLFVBQUliLGFBQUosRUFBbUI7QUFDakI7QUFDQSxZQUFJTCxNQUFNa0IsTUFBTixJQUFnQnZCLFFBQVFDLE9BQVIsR0FBa0IsQ0FBbEMsSUFBdUNjLElBQUliLEtBQUtxQixNQUFMLEdBQWMsQ0FBN0QsRUFBZ0U7QUFBQTs7QUFBQSxrQ0FDOUQ7QUFDQSxrRkFBU3BCLElBQVQsMkxBQWtCRyxhQUFhRCxLQUFiLENBQWxCO0FBQ0QsU0FIRCxNQUdPO0FBQUE7O0FBQUEsa0NBQ0w7QUFDQSxjQUFJbUIsY0FBY0MsS0FBS0MsR0FBTCxDQUFTckIsTUFBTWtCLE1BQWYsRUFBdUJ2QixRQUFRQyxPQUEvQixDQUFsQjtBQUNBLGtGQUFTRSxJQUFULDJMQUFrQkcsYUFBYUQsTUFBTWlCLEtBQU4sQ0FBWSxDQUFaLEVBQWVFLFdBQWYsQ0FBYixDQUFsQjs7QUFFQSxjQUFJRyxPQUFPO0FBQ1RDLHNCQUFVbEIsYUFERDtBQUVUbUIsc0JBQVdoQixVQUFVSCxhQUFWLEdBQTBCYyxXQUY1QjtBQUdUTSxzQkFBVW5CLGFBSEQ7QUFJVG9CLHNCQUFXakIsVUFBVUgsYUFBVixHQUEwQmEsV0FKNUI7QUFLVG5CLG1CQUFPTztBQUxFLFdBQVg7QUFPQSxjQUFJRyxLQUFLYixLQUFLcUIsTUFBTCxHQUFjLENBQW5CLElBQXdCbEIsTUFBTWtCLE1BQU4sSUFBZ0J2QixRQUFRQyxPQUFwRCxFQUE2RDtBQUMzRDtBQUNBLGdCQUFJK0IsZ0JBQWlCLE1BQU1DLElBQU4sQ0FBV3JDLE1BQVgsQ0FBckI7QUFDQSxnQkFBSXNDLGdCQUFpQixNQUFNRCxJQUFOLENBQVdwQyxNQUFYLENBQXJCO0FBQ0EsZ0JBQUlRLE1BQU1rQixNQUFOLElBQWdCLENBQWhCLElBQXFCLENBQUNTLGFBQTFCLEVBQXlDO0FBQ3ZDO0FBQ0FwQix1QkFBU3VCLE1BQVQsQ0FBZ0JSLEtBQUtFLFFBQXJCLEVBQStCLENBQS9CLEVBQWtDLDhCQUFsQztBQUNELGFBSEQsTUFHTyxJQUFJLENBQUNHLGFBQUQsSUFBa0IsQ0FBQ0UsYUFBdkIsRUFBc0M7QUFDM0N0Qix1QkFBU1QsSUFBVCxDQUFjLDhCQUFkO0FBQ0Q7QUFDRjtBQUNETSxnQkFBTU4sSUFBTixDQUFXd0IsSUFBWDs7QUFFQWpCLDBCQUFnQixDQUFoQjtBQUNBQywwQkFBZ0IsQ0FBaEI7QUFDQUMscUJBQVcsRUFBWDtBQUNEO0FBQ0Y7QUFDREMsaUJBQVdSLE1BQU1rQixNQUFqQjtBQUNBVCxpQkFBV1QsTUFBTWtCLE1BQWpCO0FBQ0Q7QUF2Rm9HOztBQWtCdkcsT0FBSyxJQUFJUixJQUFJLENBQWIsRUFBZ0JBLElBQUliLEtBQUtxQixNQUF6QixFQUFpQ1IsR0FBakMsRUFBc0M7QUFBQSwyREFBN0JBLENBQTZCO0FBc0VyQzs7QUFFRCxTQUFPO0FBQ0xyQixpQkFBYUEsV0FEUixFQUNxQkMsYUFBYUEsV0FEbEM7QUFFTEcsZUFBV0EsU0FGTixFQUVpQkMsV0FBV0EsU0FGNUI7QUFHTFUsV0FBT0E7QUFIRixHQUFQO0FBS0Q7O0FBRU0sU0FBU2pCLG1CQUFULENBQTZCRSxXQUE3QixFQUEwQ0MsV0FBMUMsRUFBdURDLE1BQXZELEVBQStEQyxNQUEvRCxFQUF1RUMsU0FBdkUsRUFBa0ZDLFNBQWxGLEVBQTZGQyxPQUE3RixFQUFzRztBQUMzRyxNQUFNRSxPQUFPWCxnQkFBZ0JHLFdBQWhCLEVBQTZCQyxXQUE3QixFQUEwQ0MsTUFBMUMsRUFBa0RDLE1BQWxELEVBQTBEQyxTQUExRCxFQUFxRUMsU0FBckUsRUFBZ0ZDLE9BQWhGLENBQWI7O0FBRUEsTUFBTW9DLE1BQU0sRUFBWjtBQUNBLE1BQUkxQyxlQUFlQyxXQUFuQixFQUFnQztBQUM5QnlDLFFBQUlqQyxJQUFKLENBQVMsWUFBWVQsV0FBckI7QUFDRDtBQUNEMEMsTUFBSWpDLElBQUosQ0FBUyxxRUFBVDtBQUNBaUMsTUFBSWpDLElBQUosQ0FBUyxTQUFTRCxLQUFLUixXQUFkLElBQTZCLE9BQU9RLEtBQUtKLFNBQVosS0FBMEIsV0FBMUIsR0FBd0MsRUFBeEMsR0FBNkMsT0FBT0ksS0FBS0osU0FBdEYsQ0FBVDtBQUNBc0MsTUFBSWpDLElBQUosQ0FBUyxTQUFTRCxLQUFLUCxXQUFkLElBQTZCLE9BQU9PLEtBQUtILFNBQVosS0FBMEIsV0FBMUIsR0FBd0MsRUFBeEMsR0FBNkMsT0FBT0csS0FBS0gsU0FBdEYsQ0FBVDs7QUFFQSxPQUFLLElBQUlnQixJQUFJLENBQWIsRUFBZ0JBLElBQUliLEtBQUtPLEtBQUwsQ0FBV2MsTUFBL0IsRUFBdUNSLEdBQXZDLEVBQTRDO0FBQzFDLFFBQU1ZLE9BQU96QixLQUFLTyxLQUFMLENBQVdNLENBQVgsQ0FBYjtBQUNBcUIsUUFBSWpDLElBQUosQ0FDRSxTQUFTd0IsS0FBS0MsUUFBZCxHQUF5QixHQUF6QixHQUErQkQsS0FBS0UsUUFBcEMsR0FDRSxJQURGLEdBQ1NGLEtBQUtHLFFBRGQsR0FDeUIsR0FEekIsR0FDK0JILEtBQUtJLFFBRHBDLEdBRUUsS0FISjtBQUtBSyxRQUFJakMsSUFBSixDQUFTa0MsS0FBVCxDQUFlRCxHQUFmLEVBQW9CVCxLQUFLdEIsS0FBekI7QUFDRDs7QUFFRCxTQUFPK0IsSUFBSUUsSUFBSixDQUFTLElBQVQsSUFBaUIsSUFBeEI7QUFDRDs7QUFFTSxTQUFTN0MsV0FBVCxDQUFxQjhDLFFBQXJCLEVBQStCM0MsTUFBL0IsRUFBdUNDLE1BQXZDLEVBQStDQyxTQUEvQyxFQUEwREMsU0FBMUQsRUFBcUVDLE9BQXJFLEVBQThFO0FBQ25GLFNBQU9SLG9CQUFvQitDLFFBQXBCLEVBQThCQSxRQUE5QixFQUF3QzNDLE1BQXhDLEVBQWdEQyxNQUFoRCxFQUF3REMsU0FBeEQsRUFBbUVDLFNBQW5FLEVBQThFQyxPQUE5RSxDQUFQO0FBQ0QiLCJmaWxlIjoiY3JlYXRlLmpzIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHtkaWZmTGluZXN9IGZyb20gJy4uL2RpZmYvbGluZSc7XG5cbmV4cG9ydCBmdW5jdGlvbiBzdHJ1Y3R1cmVkUGF0Y2gob2xkRmlsZU5hbWUsIG5ld0ZpbGVOYW1lLCBvbGRTdHIsIG5ld1N0ciwgb2xkSGVhZGVyLCBuZXdIZWFkZXIsIG9wdGlvbnMpIHtcbiAgaWYgKCFvcHRpb25zKSB7XG4gICAgb3B0aW9ucyA9IHt9O1xuICB9XG4gIGlmICh0eXBlb2Ygb3B0aW9ucy5jb250ZXh0ID09PSAndW5kZWZpbmVkJykge1xuICAgIG9wdGlvbnMuY29udGV4dCA9IDQ7XG4gIH1cblxuICBjb25zdCBkaWZmID0gZGlmZkxpbmVzKG9sZFN0ciwgbmV3U3RyLCBvcHRpb25zKTtcbiAgZGlmZi5wdXNoKHt2YWx1ZTogJycsIGxpbmVzOiBbXX0pOyAgIC8vIEFwcGVuZCBhbiBlbXB0eSB2YWx1ZSB0byBtYWtlIGNsZWFudXAgZWFzaWVyXG5cbiAgZnVuY3Rpb24gY29udGV4dExpbmVzKGxpbmVzKSB7XG4gICAgcmV0dXJuIGxpbmVzLm1hcChmdW5jdGlvbihlbnRyeSkgeyByZXR1cm4gJyAnICsgZW50cnk7IH0pO1xuICB9XG5cbiAgbGV0IGh1bmtzID0gW107XG4gIGxldCBvbGRSYW5nZVN0YXJ0ID0gMCwgbmV3UmFuZ2VTdGFydCA9IDAsIGN1clJhbmdlID0gW10sXG4gICAgICBvbGRMaW5lID0gMSwgbmV3TGluZSA9IDE7XG4gIGZvciAobGV0IGkgPSAwOyBpIDwgZGlmZi5sZW5ndGg7IGkrKykge1xuICAgIGNvbnN0IGN1cnJlbnQgPSBkaWZmW2ldLFxuICAgICAgICAgIGxpbmVzID0gY3VycmVudC5saW5lcyB8fCBjdXJyZW50LnZhbHVlLnJlcGxhY2UoL1xcbiQvLCAnJykuc3BsaXQoJ1xcbicpO1xuICAgIGN1cnJlbnQubGluZXMgPSBsaW5lcztcblxuICAgIGlmIChjdXJyZW50LmFkZGVkIHx8IGN1cnJlbnQucmVtb3ZlZCkge1xuICAgICAgLy8gSWYgd2UgaGF2ZSBwcmV2aW91cyBjb250ZXh0LCBzdGFydCB3aXRoIHRoYXRcbiAgICAgIGlmICghb2xkUmFuZ2VTdGFydCkge1xuICAgICAgICBjb25zdCBwcmV2ID0gZGlmZltpIC0gMV07XG4gICAgICAgIG9sZFJhbmdlU3RhcnQgPSBvbGRMaW5lO1xuICAgICAgICBuZXdSYW5nZVN0YXJ0ID0gbmV3TGluZTtcblxuICAgICAgICBpZiAocHJldikge1xuICAgICAgICAgIGN1clJhbmdlID0gb3B0aW9ucy5jb250ZXh0ID4gMCA/IGNvbnRleHRMaW5lcyhwcmV2LmxpbmVzLnNsaWNlKC1vcHRpb25zLmNvbnRleHQpKSA6IFtdO1xuICAgICAgICAgIG9sZFJhbmdlU3RhcnQgLT0gY3VyUmFuZ2UubGVuZ3RoO1xuICAgICAgICAgIG5ld1JhbmdlU3RhcnQgLT0gY3VyUmFuZ2UubGVuZ3RoO1xuICAgICAgICB9XG4gICAgICB9XG5cbiAgICAgIC8vIE91dHB1dCBvdXIgY2hhbmdlc1xuICAgICAgY3VyUmFuZ2UucHVzaCguLi4gbGluZXMubWFwKGZ1bmN0aW9uKGVudHJ5KSB7XG4gICAgICAgIHJldHVybiAoY3VycmVudC5hZGRlZCA/ICcrJyA6ICctJykgKyBlbnRyeTtcbiAgICAgIH0pKTtcblxuICAgICAgLy8gVHJhY2sgdGhlIHVwZGF0ZWQgZmlsZSBwb3NpdGlvblxuICAgICAgaWYgKGN1cnJlbnQuYWRkZWQpIHtcbiAgICAgICAgbmV3TGluZSArPSBsaW5lcy5sZW5ndGg7XG4gICAgICB9IGVsc2Uge1xuICAgICAgICBvbGRMaW5lICs9IGxpbmVzLmxlbmd0aDtcbiAgICAgIH1cbiAgICB9IGVsc2Uge1xuICAgICAgLy8gSWRlbnRpY2FsIGNvbnRleHQgbGluZXMuIFRyYWNrIGxpbmUgY2hhbmdlc1xuICAgICAgaWYgKG9sZFJhbmdlU3RhcnQpIHtcbiAgICAgICAgLy8gQ2xvc2Ugb3V0IGFueSBjaGFuZ2VzIHRoYXQgaGF2ZSBiZWVuIG91dHB1dCAob3Igam9pbiBvdmVybGFwcGluZylcbiAgICAgICAgaWYgKGxpbmVzLmxlbmd0aCA8PSBvcHRpb25zLmNvbnRleHQgKiAyICYmIGkgPCBkaWZmLmxlbmd0aCAtIDIpIHtcbiAgICAgICAgICAvLyBPdmVybGFwcGluZ1xuICAgICAgICAgIGN1clJhbmdlLnB1c2goLi4uIGNvbnRleHRMaW5lcyhsaW5lcykpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIC8vIGVuZCB0aGUgcmFuZ2UgYW5kIG91dHB1dFxuICAgICAgICAgIGxldCBjb250ZXh0U2l6ZSA9IE1hdGgubWluKGxpbmVzLmxlbmd0aCwgb3B0aW9ucy5jb250ZXh0KTtcbiAgICAgICAgICBjdXJSYW5nZS5wdXNoKC4uLiBjb250ZXh0TGluZXMobGluZXMuc2xpY2UoMCwgY29udGV4dFNpemUpKSk7XG5cbiAgICAgICAgICBsZXQgaHVuayA9IHtcbiAgICAgICAgICAgIG9sZFN0YXJ0OiBvbGRSYW5nZVN0YXJ0LFxuICAgICAgICAgICAgb2xkTGluZXM6IChvbGRMaW5lIC0gb2xkUmFuZ2VTdGFydCArIGNvbnRleHRTaXplKSxcbiAgICAgICAgICAgIG5ld1N0YXJ0OiBuZXdSYW5nZVN0YXJ0LFxuICAgICAgICAgICAgbmV3TGluZXM6IChuZXdMaW5lIC0gbmV3UmFuZ2VTdGFydCArIGNvbnRleHRTaXplKSxcbiAgICAgICAgICAgIGxpbmVzOiBjdXJSYW5nZVxuICAgICAgICAgIH07XG4gICAgICAgICAgaWYgKGkgPj0gZGlmZi5sZW5ndGggLSAyICYmIGxpbmVzLmxlbmd0aCA8PSBvcHRpb25zLmNvbnRleHQpIHtcbiAgICAgICAgICAgIC8vIEVPRiBpcyBpbnNpZGUgdGhpcyBodW5rXG4gICAgICAgICAgICBsZXQgb2xkRU9GTmV3bGluZSA9ICgvXFxuJC8udGVzdChvbGRTdHIpKTtcbiAgICAgICAgICAgIGxldCBuZXdFT0ZOZXdsaW5lID0gKC9cXG4kLy50ZXN0KG5ld1N0cikpO1xuICAgICAgICAgICAgaWYgKGxpbmVzLmxlbmd0aCA9PSAwICYmICFvbGRFT0ZOZXdsaW5lKSB7XG4gICAgICAgICAgICAgIC8vIHNwZWNpYWwgY2FzZTogb2xkIGhhcyBubyBlb2wgYW5kIG5vIHRyYWlsaW5nIGNvbnRleHQ7IG5vLW5sIGNhbiBlbmQgdXAgYmVmb3JlIGFkZHNcbiAgICAgICAgICAgICAgY3VyUmFuZ2Uuc3BsaWNlKGh1bmsub2xkTGluZXMsIDAsICdcXFxcIE5vIG5ld2xpbmUgYXQgZW5kIG9mIGZpbGUnKTtcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoIW9sZEVPRk5ld2xpbmUgfHwgIW5ld0VPRk5ld2xpbmUpIHtcbiAgICAgICAgICAgICAgY3VyUmFuZ2UucHVzaCgnXFxcXCBObyBuZXdsaW5lIGF0IGVuZCBvZiBmaWxlJyk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuICAgICAgICAgIGh1bmtzLnB1c2goaHVuayk7XG5cbiAgICAgICAgICBvbGRSYW5nZVN0YXJ0ID0gMDtcbiAgICAgICAgICBuZXdSYW5nZVN0YXJ0ID0gMDtcbiAgICAgICAgICBjdXJSYW5nZSA9IFtdO1xuICAgICAgICB9XG4gICAgICB9XG4gICAgICBvbGRMaW5lICs9IGxpbmVzLmxlbmd0aDtcbiAgICAgIG5ld0xpbmUgKz0gbGluZXMubGVuZ3RoO1xuICAgIH1cbiAgfVxuXG4gIHJldHVybiB7XG4gICAgb2xkRmlsZU5hbWU6IG9sZEZpbGVOYW1lLCBuZXdGaWxlTmFtZTogbmV3RmlsZU5hbWUsXG4gICAgb2xkSGVhZGVyOiBvbGRIZWFkZXIsIG5ld0hlYWRlcjogbmV3SGVhZGVyLFxuICAgIGh1bmtzOiBodW5rc1xuICB9O1xufVxuXG5leHBvcnQgZnVuY3Rpb24gY3JlYXRlVHdvRmlsZXNQYXRjaChvbGRGaWxlTmFtZSwgbmV3RmlsZU5hbWUsIG9sZFN0ciwgbmV3U3RyLCBvbGRIZWFkZXIsIG5ld0hlYWRlciwgb3B0aW9ucykge1xuICBjb25zdCBkaWZmID0gc3RydWN0dXJlZFBhdGNoKG9sZEZpbGVOYW1lLCBuZXdGaWxlTmFtZSwgb2xkU3RyLCBuZXdTdHIsIG9sZEhlYWRlciwgbmV3SGVhZGVyLCBvcHRpb25zKTtcblxuICBjb25zdCByZXQgPSBbXTtcbiAgaWYgKG9sZEZpbGVOYW1lID09IG5ld0ZpbGVOYW1lKSB7XG4gICAgcmV0LnB1c2goJ0luZGV4OiAnICsgb2xkRmlsZU5hbWUpO1xuICB9XG4gIHJldC5wdXNoKCc9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Jyk7XG4gIHJldC5wdXNoKCctLS0gJyArIGRpZmYub2xkRmlsZU5hbWUgKyAodHlwZW9mIGRpZmYub2xkSGVhZGVyID09PSAndW5kZWZpbmVkJyA/ICcnIDogJ1xcdCcgKyBkaWZmLm9sZEhlYWRlcikpO1xuICByZXQucHVzaCgnKysrICcgKyBkaWZmLm5ld0ZpbGVOYW1lICsgKHR5cGVvZiBkaWZmLm5ld0hlYWRlciA9PT0gJ3VuZGVmaW5lZCcgPyAnJyA6ICdcXHQnICsgZGlmZi5uZXdIZWFkZXIpKTtcblxuICBmb3IgKGxldCBpID0gMDsgaSA8IGRpZmYuaHVua3MubGVuZ3RoOyBpKyspIHtcbiAgICBjb25zdCBodW5rID0gZGlmZi5odW5rc1tpXTtcbiAgICByZXQucHVzaChcbiAgICAgICdAQCAtJyArIGh1bmsub2xkU3RhcnQgKyAnLCcgKyBodW5rLm9sZExpbmVzXG4gICAgICArICcgKycgKyBodW5rLm5ld1N0YXJ0ICsgJywnICsgaHVuay5uZXdMaW5lc1xuICAgICAgKyAnIEBAJ1xuICAgICk7XG4gICAgcmV0LnB1c2guYXBwbHkocmV0LCBodW5rLmxpbmVzKTtcbiAgfVxuXG4gIHJldHVybiByZXQuam9pbignXFxuJykgKyAnXFxuJztcbn1cblxuZXhwb3J0IGZ1bmN0aW9uIGNyZWF0ZVBhdGNoKGZpbGVOYW1lLCBvbGRTdHIsIG5ld1N0ciwgb2xkSGVhZGVyLCBuZXdIZWFkZXIsIG9wdGlvbnMpIHtcbiAgcmV0dXJuIGNyZWF0ZVR3b0ZpbGVzUGF0Y2goZmlsZU5hbWUsIGZpbGVOYW1lLCBvbGRTdHIsIG5ld1N0ciwgb2xkSGVhZGVyLCBuZXdIZWFkZXIsIG9wdGlvbnMpO1xufVxuIl19 33001 33002 33003 /***/ }), 33004 /* 15 */ 33005 /***/ (function(module, exports) { 33006 33007 /*istanbul ignore start*/"use strict"; 33008 33009 exports.__esModule = true; 33010 exports. /*istanbul ignore end*/arrayEqual = arrayEqual; 33011 /*istanbul ignore start*/exports. /*istanbul ignore end*/arrayStartsWith = arrayStartsWith; 33012 function arrayEqual(a, b) { 33013 if (a.length !== b.length) { 33014 return false; 33015 } 33016 33017 return arrayStartsWith(a, b); 33018 } 33019 33020 function arrayStartsWith(array, start) { 33021 if (start.length > array.length) { 33022 return false; 33023 } 33024 33025 for (var i = 0; i < start.length; i++) { 33026 if (start[i] !== array[i]) { 33027 return false; 33028 } 33029 } 33030 33031 return true; 33032 } 33033 //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy91dGlsL2FycmF5LmpzIl0sIm5hbWVzIjpbImFycmF5RXF1YWwiLCJhcnJheVN0YXJ0c1dpdGgiLCJhIiwiYiIsImxlbmd0aCIsImFycmF5Iiwic3RhcnQiLCJpIl0sIm1hcHBpbmdzIjoiOzs7Z0NBQWdCQSxVLEdBQUFBLFU7eURBUUFDLGUsR0FBQUEsZTtBQVJULFNBQVNELFVBQVQsQ0FBb0JFLENBQXBCLEVBQXVCQyxDQUF2QixFQUEwQjtBQUMvQixNQUFJRCxFQUFFRSxNQUFGLEtBQWFELEVBQUVDLE1BQW5CLEVBQTJCO0FBQ3pCLFdBQU8sS0FBUDtBQUNEOztBQUVELFNBQU9ILGdCQUFnQkMsQ0FBaEIsRUFBbUJDLENBQW5CLENBQVA7QUFDRDs7QUFFTSxTQUFTRixlQUFULENBQXlCSSxLQUF6QixFQUFnQ0MsS0FBaEMsRUFBdUM7QUFDNUMsTUFBSUEsTUFBTUYsTUFBTixHQUFlQyxNQUFNRCxNQUF6QixFQUFpQztBQUMvQixXQUFPLEtBQVA7QUFDRDs7QUFFRCxPQUFLLElBQUlHLElBQUksQ0FBYixFQUFnQkEsSUFBSUQsTUFBTUYsTUFBMUIsRUFBa0NHLEdBQWxDLEVBQXVDO0FBQ3JDLFFBQUlELE1BQU1DLENBQU4sTUFBYUYsTUFBTUUsQ0FBTixDQUFqQixFQUEyQjtBQUN6QixhQUFPLEtBQVA7QUFDRDtBQUNGOztBQUVELFNBQU8sSUFBUDtBQUNEIiwiZmlsZSI6ImFycmF5LmpzIiwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0IGZ1bmN0aW9uIGFycmF5RXF1YWwoYSwgYikge1xuICBpZiAoYS5sZW5ndGggIT09IGIubGVuZ3RoKSB7XG4gICAgcmV0dXJuIGZhbHNlO1xuICB9XG5cbiAgcmV0dXJuIGFycmF5U3RhcnRzV2l0aChhLCBiKTtcbn1cblxuZXhwb3J0IGZ1bmN0aW9uIGFycmF5U3RhcnRzV2l0aChhcnJheSwgc3RhcnQpIHtcbiAgaWYgKHN0YXJ0Lmxlbmd0aCA+IGFycmF5Lmxlbmd0aCkge1xuICAgIHJldHVybiBmYWxzZTtcbiAgfVxuXG4gIGZvciAobGV0IGkgPSAwOyBpIDwgc3RhcnQubGVuZ3RoOyBpKyspIHtcbiAgICBpZiAoc3RhcnRbaV0gIT09IGFycmF5W2ldKSB7XG4gICAgICByZXR1cm4gZmFsc2U7XG4gICAgfVxuICB9XG5cbiAgcmV0dXJuIHRydWU7XG59XG4iXX0= 33034 33035 33036 /***/ }), 33037 /* 16 */ 33038 /***/ (function(module, exports) { 33039 33040 /*istanbul ignore start*/"use strict"; 33041 33042 exports.__esModule = true; 33043 exports. /*istanbul ignore end*/convertChangesToDMP = convertChangesToDMP; 33044 // See: http://code.google.com/p/google-diff-match-patch/wiki/API 33045 function convertChangesToDMP(changes) { 33046 var ret = [], 33047 change = /*istanbul ignore start*/void 0 /*istanbul ignore end*/, 33048 operation = /*istanbul ignore start*/void 0 /*istanbul ignore end*/; 33049 for (var i = 0; i < changes.length; i++) { 33050 change = changes[i]; 33051 if (change.added) { 33052 operation = 1; 33053 } else if (change.removed) { 33054 operation = -1; 33055 } else { 33056 operation = 0; 33057 } 33058 33059 ret.push([operation, change.value]); 33060 } 33061 return ret; 33062 } 33063 //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9jb252ZXJ0L2RtcC5qcyJdLCJuYW1lcyI6WyJjb252ZXJ0Q2hhbmdlc1RvRE1QIiwiY2hhbmdlcyIsInJldCIsImNoYW5nZSIsIm9wZXJhdGlvbiIsImkiLCJsZW5ndGgiLCJhZGRlZCIsInJlbW92ZWQiLCJwdXNoIiwidmFsdWUiXSwibWFwcGluZ3MiOiI7OztnQ0FDZ0JBLG1CLEdBQUFBLG1CO0FBRGhCO0FBQ08sU0FBU0EsbUJBQVQsQ0FBNkJDLE9BQTdCLEVBQXNDO0FBQzNDLE1BQUlDLE1BQU0sRUFBVjtBQUFBLE1BQ0lDLHdDQURKO0FBQUEsTUFFSUMsMkNBRko7QUFHQSxPQUFLLElBQUlDLElBQUksQ0FBYixFQUFnQkEsSUFBSUosUUFBUUssTUFBNUIsRUFBb0NELEdBQXBDLEVBQXlDO0FBQ3ZDRixhQUFTRixRQUFRSSxDQUFSLENBQVQ7QUFDQSxRQUFJRixPQUFPSSxLQUFYLEVBQWtCO0FBQ2hCSCxrQkFBWSxDQUFaO0FBQ0QsS0FGRCxNQUVPLElBQUlELE9BQU9LLE9BQVgsRUFBb0I7QUFDekJKLGtCQUFZLENBQUMsQ0FBYjtBQUNELEtBRk0sTUFFQTtBQUNMQSxrQkFBWSxDQUFaO0FBQ0Q7O0FBRURGLFFBQUlPLElBQUosQ0FBUyxDQUFDTCxTQUFELEVBQVlELE9BQU9PLEtBQW5CLENBQVQ7QUFDRDtBQUNELFNBQU9SLEdBQVA7QUFDRCIsImZpbGUiOiJkbXAuanMiLCJzb3VyY2VzQ29udGVudCI6WyIvLyBTZWU6IGh0dHA6Ly9jb2RlLmdvb2dsZS5jb20vcC9nb29nbGUtZGlmZi1tYXRjaC1wYXRjaC93aWtpL0FQSVxuZXhwb3J0IGZ1bmN0aW9uIGNvbnZlcnRDaGFuZ2VzVG9ETVAoY2hhbmdlcykge1xuICBsZXQgcmV0ID0gW10sXG4gICAgICBjaGFuZ2UsXG4gICAgICBvcGVyYXRpb247XG4gIGZvciAobGV0IGkgPSAwOyBpIDwgY2hhbmdlcy5sZW5ndGg7IGkrKykge1xuICAgIGNoYW5nZSA9IGNoYW5nZXNbaV07XG4gICAgaWYgKGNoYW5nZS5hZGRlZCkge1xuICAgICAgb3BlcmF0aW9uID0gMTtcbiAgICB9IGVsc2UgaWYgKGNoYW5nZS5yZW1vdmVkKSB7XG4gICAgICBvcGVyYXRpb24gPSAtMTtcbiAgICB9IGVsc2Uge1xuICAgICAgb3BlcmF0aW9uID0gMDtcbiAgICB9XG5cbiAgICByZXQucHVzaChbb3BlcmF0aW9uLCBjaGFuZ2UudmFsdWVdKTtcbiAgfVxuICByZXR1cm4gcmV0O1xufVxuIl19 33064 33065 33066 /***/ }), 33067 /* 17 */ 33068 /***/ (function(module, exports) { 33069 33070 /*istanbul ignore start*/'use strict'; 33071 33072 exports.__esModule = true; 33073 exports. /*istanbul ignore end*/convertChangesToXML = convertChangesToXML; 33074 function convertChangesToXML(changes) { 33075 var ret = []; 33076 for (var i = 0; i < changes.length; i++) { 33077 var change = changes[i]; 33078 if (change.added) { 33079 ret.push('<ins>'); 33080 } else if (change.removed) { 33081 ret.push('<del>'); 33082 } 33083 33084 ret.push(escapeHTML(change.value)); 33085 33086 if (change.added) { 33087 ret.push('</ins>'); 33088 } else if (change.removed) { 33089 ret.push('</del>'); 33090 } 33091 } 33092 return ret.join(''); 33093 } 33094 33095 function escapeHTML(s) { 33096 var n = s; 33097 n = n.replace(/&/g, '&'); 33098 n = n.replace(/</g, '<'); 33099 n = n.replace(/>/g, '>'); 33100 n = n.replace(/"/g, '"'); 33101 33102 return n; 33103 } 33104 33105 33106 /***/ }) 33107 /******/ ]) 33108 }); 33109 ; 33110 33111 /***/ }), 33112 33113 /***/ "./node_modules/dom-scroll-into-view/lib/dom-scroll-into-view.js": 33114 /*!***********************************************************************!*\ 33115 !*** ./node_modules/dom-scroll-into-view/lib/dom-scroll-into-view.js ***! 33116 \***********************************************************************/ 33117 /*! no static exports found */ 33118 /***/ (function(module, exports, __webpack_require__) { 33119 33120 "use strict"; 33121 33122 33123 var util = __webpack_require__(/*! ./util */ "./node_modules/dom-scroll-into-view/lib/util.js"); 33124 33125 function scrollIntoView(elem, container, config) { 33126 config = config || {}; 33127 // document 归一化到 window 33128 if (container.nodeType === 9) { 33129 container = util.getWindow(container); 33130 } 33131 33132 var allowHorizontalScroll = config.allowHorizontalScroll; 33133 var onlyScrollIfNeeded = config.onlyScrollIfNeeded; 33134 var alignWithTop = config.alignWithTop; 33135 var alignWithLeft = config.alignWithLeft; 33136 var offsetTop = config.offsetTop || 0; 33137 var offsetLeft = config.offsetLeft || 0; 33138 var offsetBottom = config.offsetBottom || 0; 33139 var offsetRight = config.offsetRight || 0; 33140 33141 allowHorizontalScroll = allowHorizontalScroll === undefined ? true : allowHorizontalScroll; 33142 33143 var isWin = util.isWindow(container); 33144 var elemOffset = util.offset(elem); 33145 var eh = util.outerHeight(elem); 33146 var ew = util.outerWidth(elem); 33147 var containerOffset = undefined; 33148 var ch = undefined; 33149 var cw = undefined; 33150 var containerScroll = undefined; 33151 var diffTop = undefined; 33152 var diffBottom = undefined; 33153 var win = undefined; 33154 var winScroll = undefined; 33155 var ww = undefined; 33156 var wh = undefined; 33157 33158 if (isWin) { 33159 win = container; 33160 wh = util.height(win); 33161 ww = util.width(win); 33162 winScroll = { 33163 left: util.scrollLeft(win), 33164 top: util.scrollTop(win) 33165 }; 33166 // elem 相对 container 可视视窗的距离 33167 diffTop = { 33168 left: elemOffset.left - winScroll.left - offsetLeft, 33169 top: elemOffset.top - winScroll.top - offsetTop 33170 }; 33171 diffBottom = { 33172 left: elemOffset.left + ew - (winScroll.left + ww) + offsetRight, 33173 top: elemOffset.top + eh - (winScroll.top + wh) + offsetBottom 33174 }; 33175 containerScroll = winScroll; 33176 } else { 33177 containerOffset = util.offset(container); 33178 ch = container.clientHeight; 33179 cw = container.clientWidth; 33180 containerScroll = { 33181 left: container.scrollLeft, 33182 top: container.scrollTop 33183 }; 33184 // elem 相对 container 可视视窗的距离 33185 // 注意边框, offset 是边框到根节点 33186 diffTop = { 33187 left: elemOffset.left - (containerOffset.left + (parseFloat(util.css(container, 'borderLeftWidth')) || 0)) - offsetLeft, 33188 top: elemOffset.top - (containerOffset.top + (parseFloat(util.css(container, 'borderTopWidth')) || 0)) - offsetTop 33189 }; 33190 diffBottom = { 33191 left: elemOffset.left + ew - (containerOffset.left + cw + (parseFloat(util.css(container, 'borderRightWidth')) || 0)) + offsetRight, 33192 top: elemOffset.top + eh - (containerOffset.top + ch + (parseFloat(util.css(container, 'borderBottomWidth')) || 0)) + offsetBottom 33193 }; 33194 } 33195 33196 if (diffTop.top < 0 || diffBottom.top > 0) { 33197 // 强制向上 33198 if (alignWithTop === true) { 33199 util.scrollTop(container, containerScroll.top + diffTop.top); 33200 } else if (alignWithTop === false) { 33201 util.scrollTop(container, containerScroll.top + diffBottom.top); 33202 } else { 33203 // 自动调整 33204 if (diffTop.top < 0) { 33205 util.scrollTop(container, containerScroll.top + diffTop.top); 33206 } else { 33207 util.scrollTop(container, containerScroll.top + diffBottom.top); 33208 } 33209 } 33210 } else { 33211 if (!onlyScrollIfNeeded) { 33212 alignWithTop = alignWithTop === undefined ? true : !!alignWithTop; 33213 if (alignWithTop) { 33214 util.scrollTop(container, containerScroll.top + diffTop.top); 33215 } else { 33216 util.scrollTop(container, containerScroll.top + diffBottom.top); 33217 } 33218 } 33219 } 33220 33221 if (allowHorizontalScroll) { 33222 if (diffTop.left < 0 || diffBottom.left > 0) { 33223 // 强制向上 33224 if (alignWithLeft === true) { 33225 util.scrollLeft(container, containerScroll.left + diffTop.left); 33226 } else if (alignWithLeft === false) { 33227 util.scrollLeft(container, containerScroll.left + diffBottom.left); 33228 } else { 33229 // 自动调整 33230 if (diffTop.left < 0) { 33231 util.scrollLeft(container, containerScroll.left + diffTop.left); 33232 } else { 33233 util.scrollLeft(container, containerScroll.left + diffBottom.left); 33234 } 33235 } 33236 } else { 33237 if (!onlyScrollIfNeeded) { 33238 alignWithLeft = alignWithLeft === undefined ? true : !!alignWithLeft; 33239 if (alignWithLeft) { 33240 util.scrollLeft(container, containerScroll.left + diffTop.left); 33241 } else { 33242 util.scrollLeft(container, containerScroll.left + diffBottom.left); 33243 } 33244 } 33245 } 33246 } 33247 } 33248 33249 module.exports = scrollIntoView; 33250 33251 /***/ }), 33252 33253 /***/ "./node_modules/dom-scroll-into-view/lib/index.js": 33254 /*!********************************************************!*\ 33255 !*** ./node_modules/dom-scroll-into-view/lib/index.js ***! 33256 \********************************************************/ 33257 /*! no static exports found */ 33258 /***/ (function(module, exports, __webpack_require__) { 33259 33260 "use strict"; 33261 33262 33263 module.exports = __webpack_require__(/*! ./dom-scroll-into-view */ "./node_modules/dom-scroll-into-view/lib/dom-scroll-into-view.js"); 33264 33265 /***/ }), 33266 33267 /***/ "./node_modules/dom-scroll-into-view/lib/util.js": 33268 /*!*******************************************************!*\ 33269 !*** ./node_modules/dom-scroll-into-view/lib/util.js ***! 33270 \*******************************************************/ 33271 /*! no static exports found */ 33272 /***/ (function(module, exports, __webpack_require__) { 33273 33274 "use strict"; 33275 33276 33277 var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; 33278 33279 var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; 33280 33281 var RE_NUM = /[\-+]?(?:\d*\.|)\d+(?:[eE][\-+]?\d+|)/.source; 33282 33283 function getClientPosition(elem) { 33284 var box = undefined; 33285 var x = undefined; 33286 var y = undefined; 33287 var doc = elem.ownerDocument; 33288 var body = doc.body; 33289 var docElem = doc && doc.documentElement; 33290 // 根据 GBS 最新数据,A-Grade Browsers 都已支持 getBoundingClientRect 方法,不用再考虑传统的实现方式 33291 box = elem.getBoundingClientRect(); 33292 33293 // 注:jQuery 还考虑减去 docElem.clientLeft/clientTop 33294 // 但测试发现,这样反而会导致当 html 和 body 有边距/边框样式时,获取的值不正确 33295 // 此外,ie6 会忽略 html 的 margin 值,幸运地是没有谁会去设置 html 的 margin 33296 33297 x = box.left; 33298 y = box.top; 33299 33300 // In IE, most of the time, 2 extra pixels are added to the top and left 33301 // due to the implicit 2-pixel inset border. In IE6/7 quirks mode and 33302 // IE6 standards mode, this border can be overridden by setting the 33303 // document element's border to zero -- thus, we cannot rely on the 33304 // offset always being 2 pixels. 33305 33306 // In quirks mode, the offset can be determined by querying the body's 33307 // clientLeft/clientTop, but in standards mode, it is found by querying 33308 // the document element's clientLeft/clientTop. Since we already called 33309 // getClientBoundingRect we have already forced a reflow, so it is not 33310 // too expensive just to query them all. 33311 33312 // ie 下应该减去窗口的边框吧,毕竟默认 absolute 都是相对窗口定位的 33313 // 窗口边框标准是设 documentElement ,quirks 时设置 body 33314 // 最好禁止在 body 和 html 上边框 ,但 ie < 9 html 默认有 2px ,减去 33315 // 但是非 ie 不可能设置窗口边框,body html 也不是窗口 ,ie 可以通过 html,body 设置 33316 // 标准 ie 下 docElem.clientTop 就是 border-top 33317 // ie7 html 即窗口边框改变不了。永远为 2 33318 // 但标准 firefox/chrome/ie9 下 docElem.clientTop 是窗口边框,即使设了 border-top 也为 0 33319 33320 x -= docElem.clientLeft || body.clientLeft || 0; 33321 y -= docElem.clientTop || body.clientTop || 0; 33322 33323 return { 33324 left: x, 33325 top: y 33326 }; 33327 } 33328 33329 function getScroll(w, top) { 33330 var ret = w['page' + (top ? 'Y' : 'X') + 'Offset']; 33331 var method = 'scroll' + (top ? 'Top' : 'Left'); 33332 if (typeof ret !== 'number') { 33333 var d = w.document; 33334 // ie6,7,8 standard mode 33335 ret = d.documentElement[method]; 33336 if (typeof ret !== 'number') { 33337 // quirks mode 33338 ret = d.body[method]; 33339 } 33340 } 33341 return ret; 33342 } 33343 33344 function getScrollLeft(w) { 33345 return getScroll(w); 33346 } 33347 33348 function getScrollTop(w) { 33349 return getScroll(w, true); 33350 } 33351 33352 function getOffset(el) { 33353 var pos = getClientPosition(el); 33354 var doc = el.ownerDocument; 33355 var w = doc.defaultView || doc.parentWindow; 33356 pos.left += getScrollLeft(w); 33357 pos.top += getScrollTop(w); 33358 return pos; 33359 } 33360 function _getComputedStyle(elem, name, computedStyle_) { 33361 var val = ''; 33362 var d = elem.ownerDocument; 33363 var computedStyle = computedStyle_ || d.defaultView.getComputedStyle(elem, null); 33364 33365 // https://github.com/kissyteam/kissy/issues/61 33366 if (computedStyle) { 33367 val = computedStyle.getPropertyValue(name) || computedStyle[name]; 33368 } 33369 33370 return val; 33371 } 33372 33373 var _RE_NUM_NO_PX = new RegExp('^(' + RE_NUM + ')(?!px)[a-z%]+$', 'i'); 33374 var RE_POS = /^(top|right|bottom|left)$/; 33375 var CURRENT_STYLE = 'currentStyle'; 33376 var RUNTIME_STYLE = 'runtimeStyle'; 33377 var LEFT = 'left'; 33378 var PX = 'px'; 33379 33380 function _getComputedStyleIE(elem, name) { 33381 // currentStyle maybe null 33382 // http://msdn.microsoft.com/en-us/library/ms535231.aspx 33383 var ret = elem[CURRENT_STYLE] && elem[CURRENT_STYLE][name]; 33384 33385 // 当 width/height 设置为百分比时,通过 pixelLeft 方式转换的 width/height 值 33386 // 一开始就处理了! CUSTOM_STYLE.height,CUSTOM_STYLE.width ,cssHook 解决@2011-08-19 33387 // 在 ie 下不对,需要直接用 offset 方式 33388 // borderWidth 等值也有问题,但考虑到 borderWidth 设为百分比的概率很小,这里就不考虑了 33389 33390 // From the awesome hack by Dean Edwards 33391 // http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291 33392 // If we're not dealing with a regular pixel number 33393 // but a number that has a weird ending, we need to convert it to pixels 33394 // exclude left right for relativity 33395 if (_RE_NUM_NO_PX.test(ret) && !RE_POS.test(name)) { 33396 // Remember the original values 33397 var style = elem.style; 33398 var left = style[LEFT]; 33399 var rsLeft = elem[RUNTIME_STYLE][LEFT]; 33400 33401 // prevent flashing of content 33402 elem[RUNTIME_STYLE][LEFT] = elem[CURRENT_STYLE][LEFT]; 33403 33404 // Put in the new values to get a computed value out 33405 style[LEFT] = name === 'fontSize' ? '1em' : ret || 0; 33406 ret = style.pixelLeft + PX; 33407 33408 // Revert the changed values 33409 style[LEFT] = left; 33410 33411 elem[RUNTIME_STYLE][LEFT] = rsLeft; 33412 } 33413 return ret === '' ? 'auto' : ret; 33414 } 33415 33416 var getComputedStyleX = undefined; 33417 if (typeof window !== 'undefined') { 33418 getComputedStyleX = window.getComputedStyle ? _getComputedStyle : _getComputedStyleIE; 33419 } 33420 33421 function each(arr, fn) { 33422 for (var i = 0; i < arr.length; i++) { 33423 fn(arr[i]); 33424 } 33425 } 33426 33427 function isBorderBoxFn(elem) { 33428 return getComputedStyleX(elem, 'boxSizing') === 'border-box'; 33429 } 33430 33431 var BOX_MODELS = ['margin', 'border', 'padding']; 33432 var CONTENT_INDEX = -1; 33433 var PADDING_INDEX = 2; 33434 var BORDER_INDEX = 1; 33435 var MARGIN_INDEX = 0; 33436 33437 function swap(elem, options, callback) { 33438 var old = {}; 33439 var style = elem.style; 33440 var name = undefined; 33441 33442 // Remember the old values, and insert the new ones 33443 for (name in options) { 33444 if (options.hasOwnProperty(name)) { 33445 old[name] = style[name]; 33446 style[name] = options[name]; 33447 } 33448 } 33449 33450 callback.call(elem); 33451 33452 // Revert the old values 33453 for (name in options) { 33454 if (options.hasOwnProperty(name)) { 33455 style[name] = old[name]; 33456 } 33457 } 33458 } 33459 33460 function getPBMWidth(elem, props, which) { 33461 var value = 0; 33462 var prop = undefined; 33463 var j = undefined; 33464 var i = undefined; 33465 for (j = 0; j < props.length; j++) { 33466 prop = props[j]; 33467 if (prop) { 33468 for (i = 0; i < which.length; i++) { 33469 var cssProp = undefined; 33470 if (prop === 'border') { 33471 cssProp = prop + which[i] + 'Width'; 33472 } else { 33473 cssProp = prop + which[i]; 33474 } 33475 value += parseFloat(getComputedStyleX(elem, cssProp)) || 0; 33476 } 33477 } 33478 } 33479 return value; 33480 } 33481 33482 /** 33483 * A crude way of determining if an object is a window 33484 * @member util 33485 */ 33486 function isWindow(obj) { 33487 // must use == for ie8 33488 /* eslint eqeqeq:0 */ 33489 return obj != null && obj == obj.window; 33490 } 33491 33492 var domUtils = {}; 33493 33494 each(['Width', 'Height'], function (name) { 33495 domUtils['doc' + name] = function (refWin) { 33496 var d = refWin.document; 33497 return Math.max( 33498 // firefox chrome documentElement.scrollHeight< body.scrollHeight 33499 // ie standard mode : documentElement.scrollHeight> body.scrollHeight 33500 d.documentElement['scroll' + name], 33501 // quirks : documentElement.scrollHeight 最大等于可视窗口多一点? 33502 d.body['scroll' + name], domUtils['viewport' + name](d)); 33503 }; 33504 33505 domUtils['viewport' + name] = function (win) { 33506 // pc browser includes scrollbar in window.innerWidth 33507 var prop = 'client' + name; 33508 var doc = win.document; 33509 var body = doc.body; 33510 var documentElement = doc.documentElement; 33511 var documentElementProp = documentElement[prop]; 33512 // 标准模式取 documentElement 33513 // backcompat 取 body 33514 return doc.compatMode === 'CSS1Compat' && documentElementProp || body && body[prop] || documentElementProp; 33515 }; 33516 }); 33517 33518 /* 33519 得到元素的大小信息 33520 @param elem 33521 @param name 33522 @param {String} [extra] 'padding' : (css width) + padding 33523 'border' : (css width) + padding + border 33524 'margin' : (css width) + padding + border + margin 33525 */ 33526 function getWH(elem, name, extra) { 33527 if (isWindow(elem)) { 33528 return name === 'width' ? domUtils.viewportWidth(elem) : domUtils.viewportHeight(elem); 33529 } else if (elem.nodeType === 9) { 33530 return name === 'width' ? domUtils.docWidth(elem) : domUtils.docHeight(elem); 33531 } 33532 var which = name === 'width' ? ['Left', 'Right'] : ['Top', 'Bottom']; 33533 var borderBoxValue = name === 'width' ? elem.offsetWidth : elem.offsetHeight; 33534 var computedStyle = getComputedStyleX(elem); 33535 var isBorderBox = isBorderBoxFn(elem, computedStyle); 33536 var cssBoxValue = 0; 33537 if (borderBoxValue == null || borderBoxValue <= 0) { 33538 borderBoxValue = undefined; 33539 // Fall back to computed then un computed css if necessary 33540 cssBoxValue = getComputedStyleX(elem, name); 33541 if (cssBoxValue == null || Number(cssBoxValue) < 0) { 33542 cssBoxValue = elem.style[name] || 0; 33543 } 33544 // Normalize '', auto, and prepare for extra 33545 cssBoxValue = parseFloat(cssBoxValue) || 0; 33546 } 33547 if (extra === undefined) { 33548 extra = isBorderBox ? BORDER_INDEX : CONTENT_INDEX; 33549 } 33550 var borderBoxValueOrIsBorderBox = borderBoxValue !== undefined || isBorderBox; 33551 var val = borderBoxValue || cssBoxValue; 33552 if (extra === CONTENT_INDEX) { 33553 if (borderBoxValueOrIsBorderBox) { 33554 return val - getPBMWidth(elem, ['border', 'padding'], which, computedStyle); 33555 } 33556 return cssBoxValue; 33557 } 33558 if (borderBoxValueOrIsBorderBox) { 33559 var padding = extra === PADDING_INDEX ? -getPBMWidth(elem, ['border'], which, computedStyle) : getPBMWidth(elem, ['margin'], which, computedStyle); 33560 return val + (extra === BORDER_INDEX ? 0 : padding); 33561 } 33562 return cssBoxValue + getPBMWidth(elem, BOX_MODELS.slice(extra), which, computedStyle); 33563 } 33564 33565 var cssShow = { 33566 position: 'absolute', 33567 visibility: 'hidden', 33568 display: 'block' 33569 }; 33570 33571 // fix #119 : https://github.com/kissyteam/kissy/issues/119 33572 function getWHIgnoreDisplay(elem) { 33573 var val = undefined; 33574 var args = arguments; 33575 // in case elem is window 33576 // elem.offsetWidth === undefined 33577 if (elem.offsetWidth !== 0) { 33578 val = getWH.apply(undefined, args); 33579 } else { 33580 swap(elem, cssShow, function () { 33581 val = getWH.apply(undefined, args); 33582 }); 33583 } 33584 return val; 33585 } 33586 33587 function css(el, name, v) { 33588 var value = v; 33589 if ((typeof name === 'undefined' ? 'undefined' : _typeof(name)) === 'object') { 33590 for (var i in name) { 33591 if (name.hasOwnProperty(i)) { 33592 css(el, i, name[i]); 33593 } 33594 } 33595 return undefined; 33596 } 33597 if (typeof value !== 'undefined') { 33598 if (typeof value === 'number') { 33599 value += 'px'; 33600 } 33601 el.style[name] = value; 33602 return undefined; 33603 } 33604 return getComputedStyleX(el, name); 33605 } 33606 33607 each(['width', 'height'], function (name) { 33608 var first = name.charAt(0).toUpperCase() + name.slice(1); 33609 domUtils['outer' + first] = function (el, includeMargin) { 33610 return el && getWHIgnoreDisplay(el, name, includeMargin ? MARGIN_INDEX : BORDER_INDEX); 33611 }; 33612 var which = name === 'width' ? ['Left', 'Right'] : ['Top', 'Bottom']; 33613 33614 domUtils[name] = function (elem, val) { 33615 if (val !== undefined) { 33616 if (elem) { 33617 var computedStyle = getComputedStyleX(elem); 33618 var isBorderBox = isBorderBoxFn(elem); 33619 if (isBorderBox) { 33620 val += getPBMWidth(elem, ['padding', 'border'], which, computedStyle); 33621 } 33622 return css(elem, name, val); 33623 } 33624 return undefined; 33625 } 33626 return elem && getWHIgnoreDisplay(elem, name, CONTENT_INDEX); 33627 }; 33628 }); 33629 33630 // 设置 elem 相对 elem.ownerDocument 的坐标 33631 function setOffset(elem, offset) { 33632 // set position first, in-case top/left are set even on static elem 33633 if (css(elem, 'position') === 'static') { 33634 elem.style.position = 'relative'; 33635 } 33636 33637 var old = getOffset(elem); 33638 var ret = {}; 33639 var current = undefined; 33640 var key = undefined; 33641 33642 for (key in offset) { 33643 if (offset.hasOwnProperty(key)) { 33644 current = parseFloat(css(elem, key)) || 0; 33645 ret[key] = current + offset[key] - old[key]; 33646 } 33647 } 33648 css(elem, ret); 33649 } 33650 33651 module.exports = _extends({ 33652 getWindow: function getWindow(node) { 33653 var doc = node.ownerDocument || node; 33654 return doc.defaultView || doc.parentWindow; 33655 }, 33656 offset: function offset(el, value) { 33657 if (typeof value !== 'undefined') { 33658 setOffset(el, value); 33659 } else { 33660 return getOffset(el); 33661 } 33662 }, 33663 33664 isWindow: isWindow, 33665 each: each, 33666 css: css, 33667 clone: function clone(obj) { 33668 var ret = {}; 33669 for (var i in obj) { 33670 if (obj.hasOwnProperty(i)) { 33671 ret[i] = obj[i]; 33672 } 33673 } 33674 var overflow = obj.overflow; 33675 if (overflow) { 33676 for (var i in obj) { 33677 if (obj.hasOwnProperty(i)) { 33678 ret.overflow[i] = obj.overflow[i]; 33679 } 33680 } 33681 } 33682 return ret; 33683 }, 33684 scrollLeft: function scrollLeft(w, v) { 33685 if (isWindow(w)) { 33686 if (v === undefined) { 33687 return getScrollLeft(w); 33688 } 33689 window.scrollTo(v, getScrollTop(w)); 33690 } else { 33691 if (v === undefined) { 33692 return w.scrollLeft; 33693 } 33694 w.scrollLeft = v; 33695 } 33696 }, 33697 scrollTop: function scrollTop(w, v) { 33698 if (isWindow(w)) { 33699 if (v === undefined) { 33700 return getScrollTop(w); 33701 } 33702 window.scrollTo(getScrollLeft(w), v); 33703 } else { 33704 if (v === undefined) { 33705 return w.scrollTop; 33706 } 33707 w.scrollTop = v; 33708 } 33709 }, 33710 33711 viewportWidth: 0, 33712 viewportHeight: 0 33713 }, domUtils); 33714 33715 /***/ }), 33716 33717 /***/ "./node_modules/inherits/inherits_browser.js": 33718 /*!***************************************************!*\ 33719 !*** ./node_modules/inherits/inherits_browser.js ***! 33720 \***************************************************/ 33721 /*! no static exports found */ 33722 /***/ (function(module, exports) { 33723 33724 if (typeof Object.create === 'function') { 33725 // implementation from standard node.js 'util' module 33726 module.exports = function inherits(ctor, superCtor) { 33727 ctor.super_ = superCtor 33728 ctor.prototype = Object.create(superCtor.prototype, { 33729 constructor: { 33730 value: ctor, 33731 enumerable: false, 33732 writable: true, 33733 configurable: true 33734 } 33735 }); 33736 }; 33737 } else { 33738 // old school shim for old browsers 33739 module.exports = function inherits(ctor, superCtor) { 33740 ctor.super_ = superCtor 33741 var TempCtor = function () {} 33742 TempCtor.prototype = superCtor.prototype 33743 ctor.prototype = new TempCtor() 33744 ctor.prototype.constructor = ctor 33745 } 33746 } 33747 33748 33749 /***/ }), 33750 33751 /***/ "./node_modules/line-height/lib/line-height.js": 33752 /*!*****************************************************!*\ 33753 !*** ./node_modules/line-height/lib/line-height.js ***! 33754 \*****************************************************/ 33755 /*! no static exports found */ 33756 /***/ (function(module, exports, __webpack_require__) { 33757 33758 // Load in dependencies 33759 var computedStyle = __webpack_require__(/*! computed-style */ "./node_modules/computed-style/dist/computedStyle.commonjs.js"); 33760 33761 /** 33762 * Calculate the `line-height` of a given node 33763 * @param {HTMLElement} node Element to calculate line height of. Must be in the DOM. 33764 * @returns {Number} `line-height` of the element in pixels 33765 */ 33766 function lineHeight(node) { 33767 // Grab the line-height via style 33768 var lnHeightStr = computedStyle(node, 'line-height'); 33769 var lnHeight = parseFloat(lnHeightStr, 10); 33770 33771 // If the lineHeight did not contain a unit (i.e. it was numeric), convert it to ems (e.g. '2.3' === '2.3em') 33772 if (lnHeightStr === lnHeight + '') { 33773 // Save the old lineHeight style and update the em unit to the element 33774 var _lnHeightStyle = node.style.lineHeight; 33775 node.style.lineHeight = lnHeightStr + 'em'; 33776 33777 // Calculate the em based height 33778 lnHeightStr = computedStyle(node, 'line-height'); 33779 lnHeight = parseFloat(lnHeightStr, 10); 33780 33781 // Revert the lineHeight style 33782 if (_lnHeightStyle) { 33783 node.style.lineHeight = _lnHeightStyle; 33784 } else { 33785 delete node.style.lineHeight; 33786 } 33787 } 33788 33789 // If the lineHeight is in `pt`, convert it to pixels (4px for 3pt) 33790 // DEV: `em` units are converted to `pt` in IE6 33791 // Conversion ratio from https://developer.mozilla.org/en-US/docs/Web/CSS/length 33792 if (lnHeightStr.indexOf('pt') !== -1) { 33793 lnHeight *= 4; 33794 lnHeight /= 3; 33795 // Otherwise, if the lineHeight is in `mm`, convert it to pixels (96px for 25.4mm) 33796 } else if (lnHeightStr.indexOf('mm') !== -1) { 33797 lnHeight *= 96; 33798 lnHeight /= 25.4; 33799 // Otherwise, if the lineHeight is in `cm`, convert it to pixels (96px for 2.54cm) 33800 } else if (lnHeightStr.indexOf('cm') !== -1) { 33801 lnHeight *= 96; 33802 lnHeight /= 2.54; 33803 // Otherwise, if the lineHeight is in `in`, convert it to pixels (96px for 1in) 33804 } else if (lnHeightStr.indexOf('in') !== -1) { 33805 lnHeight *= 96; 33806 // Otherwise, if the lineHeight is in `pc`, convert it to pixels (12pt for 1pc) 33807 } else if (lnHeightStr.indexOf('pc') !== -1) { 33808 lnHeight *= 16; 33809 } 33810 33811 // Continue our computation 33812 lnHeight = Math.round(lnHeight); 33813 33814 // If the line-height is "normal", calculate by font-size 33815 if (lnHeightStr === 'normal') { 33816 // Create a temporary node 33817 var nodeName = node.nodeName; 33818 var _node = document.createElement(nodeName); 33819 _node.innerHTML = ' '; 33820 33821 // If we have a text area, reset it to only 1 row 33822 // https://github.com/twolfson/line-height/issues/4 33823 if (nodeName.toUpperCase() === 'TEXTAREA') { 33824 _node.setAttribute('rows', '1'); 33825 } 33826 33827 // Set the font-size of the element 33828 var fontSizeStr = computedStyle(node, 'font-size'); 33829 _node.style.fontSize = fontSizeStr; 33830 33831 // Remove default padding/border which can affect offset height 33832 // https://github.com/twolfson/line-height/issues/4 33833 // https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/offsetHeight 33834 _node.style.padding = '0px'; 33835 _node.style.border = '0px'; 33836 33837 // Append it to the body 33838 var body = document.body; 33839 body.appendChild(_node); 33840 33841 // Assume the line height of the element is the height 33842 var height = _node.offsetHeight; 33843 lnHeight = height; 33844 33845 // Remove our child from the DOM 33846 body.removeChild(_node); 33847 } 33848 33849 // Return the calculated height 33850 return lnHeight; 33851 } 33852 33853 // Export lineHeight 33854 module.exports = lineHeight; 33855 33856 33857 /***/ }), 33858 33859 /***/ "./node_modules/memize/index.js": 33860 /*!**************************************!*\ 33861 !*** ./node_modules/memize/index.js ***! 33862 \**************************************/ 33863 /*! no static exports found */ 33864 /***/ (function(module, exports, __webpack_require__) { 33865 33866 module.exports = function memize( fn, options ) { 33867 var size = 0, 33868 maxSize, head, tail; 33869 33870 if ( options && options.maxSize ) { 33871 maxSize = options.maxSize; 33872 } 33873 33874 function memoized( /* ...args */ ) { 33875 var node = head, 33876 len = arguments.length, 33877 args, i; 33878 33879 searchCache: while ( node ) { 33880 // Perform a shallow equality test to confirm that whether the node 33881 // under test is a candidate for the arguments passed. Two arrays 33882 // are shallowly equal if their length matches and each entry is 33883 // strictly equal between the two sets. Avoid abstracting to a 33884 // function which could incur an arguments leaking deoptimization. 33885 33886 // Check whether node arguments match arguments length 33887 if ( node.args.length !== arguments.length ) { 33888 node = node.next; 33889 continue; 33890 } 33891 33892 // Check whether node arguments match arguments values 33893 for ( i = 0; i < len; i++ ) { 33894 if ( node.args[ i ] !== arguments[ i ] ) { 33895 node = node.next; 33896 continue searchCache; 33897 } 33898 } 33899 33900 // At this point we can assume we've found a match 33901 33902 // Surface matched node to head if not already 33903 if ( node !== head ) { 33904 // As tail, shift to previous. Must only shift if not also 33905 // head, since if both head and tail, there is no previous. 33906 if ( node === tail ) { 33907 tail = node.prev; 33908 } 33909 33910 // Adjust siblings to point to each other. If node was tail, 33911 // this also handles new tail's empty `next` assignment. 33912 node.prev.next = node.next; 33913 if ( node.next ) { 33914 node.next.prev = node.prev; 33915 } 33916 33917 node.next = head; 33918 node.prev = null; 33919 head.prev = node; 33920 head = node; 33921 } 33922 33923 // Return immediately 33924 return node.val; 33925 } 33926 33927 // No cached value found. Continue to insertion phase: 33928 33929 // Create a copy of arguments (avoid leaking deoptimization) 33930 args = new Array( len ); 33931 for ( i = 0; i < len; i++ ) { 33932 args[ i ] = arguments[ i ]; 33933 } 33934 33935 node = { 33936 args: args, 33937 33938 // Generate the result from original function 33939 val: fn.apply( null, args ) 33940 }; 33941 33942 // Don't need to check whether node is already head, since it would 33943 // have been returned above already if it was 33944 33945 // Shift existing head down list 33946 if ( head ) { 33947 head.prev = node; 33948 node.next = head; 33949 } else { 33950 // If no head, follows that there's no tail (at initial or reset) 33951 tail = node; 33952 } 33953 33954 // Trim tail if we're reached max size and are pending cache insertion 33955 if ( size === maxSize ) { 33956 tail = tail.prev; 33957 tail.next = null; 33958 } else { 33959 size++; 33960 } 33961 33962 head = node; 33963 33964 return node.val; 33965 } 33966 33967 memoized.clear = function() { 33968 head = null; 33969 tail = null; 33970 size = 0; 33971 }; 33972 33973 if ( false ) {} 33974 33975 return memoized; 33976 }; 33977 33978 33979 /***/ }), 33980 33981 /***/ "./node_modules/object-assign/index.js": 33982 /*!*********************************************!*\ 33983 !*** ./node_modules/object-assign/index.js ***! 33984 \*********************************************/ 33985 /*! no static exports found */ 33986 /***/ (function(module, exports, __webpack_require__) { 33987 33988 "use strict"; 33989 /* 33990 object-assign 33991 (c) Sindre Sorhus 33992 @license MIT 33993 */ 33994 33995 33996 /* eslint-disable no-unused-vars */ 33997 var getOwnPropertySymbols = Object.getOwnPropertySymbols; 33998 var hasOwnProperty = Object.prototype.hasOwnProperty; 33999 var propIsEnumerable = Object.prototype.propertyIsEnumerable; 34000 34001 function toObject(val) { 34002 if (val === null || val === undefined) { 34003 throw new TypeError('Object.assign cannot be called with null or undefined'); 34004 } 34005 34006 return Object(val); 34007 } 34008 34009 function shouldUseNative() { 34010 try { 34011 if (!Object.assign) { 34012 return false; 34013 } 34014 34015 // Detect buggy property enumeration order in older V8 versions. 34016 34017 // https://bugs.chromium.org/p/v8/issues/detail?id=4118 34018 var test1 = new String('abc'); // eslint-disable-line no-new-wrappers 34019 test1[5] = 'de'; 34020 if (Object.getOwnPropertyNames(test1)[0] === '5') { 34021 return false; 34022 } 34023 34024 // https://bugs.chromium.org/p/v8/issues/detail?id=3056 34025 var test2 = {}; 34026 for (var i = 0; i < 10; i++) { 34027 test2['_' + String.fromCharCode(i)] = i; 34028 } 34029 var order2 = Object.getOwnPropertyNames(test2).map(function (n) { 34030 return test2[n]; 34031 }); 34032 if (order2.join('') !== '0123456789') { 34033 return false; 34034 } 34035 34036 // https://bugs.chromium.org/p/v8/issues/detail?id=3056 34037 var test3 = {}; 34038 'abcdefghijklmnopqrst'.split('').forEach(function (letter) { 34039 test3[letter] = letter; 34040 }); 34041 if (Object.keys(Object.assign({}, test3)).join('') !== 34042 'abcdefghijklmnopqrst') { 34043 return false; 34044 } 34045 34046 return true; 34047 } catch (err) { 34048 // We don't expect any of the above to throw, but better to be safe. 34049 return false; 34050 } 34051 } 34052 34053 module.exports = shouldUseNative() ? Object.assign : function (target, source) { 34054 var from; 34055 var to = toObject(target); 34056 var symbols; 34057 34058 for (var s = 1; s < arguments.length; s++) { 34059 from = Object(arguments[s]); 34060 34061 for (var key in from) { 34062 if (hasOwnProperty.call(from, key)) { 34063 to[key] = from[key]; 34064 } 34065 } 34066 34067 if (getOwnPropertySymbols) { 34068 symbols = getOwnPropertySymbols(from); 34069 for (var i = 0; i < symbols.length; i++) { 34070 if (propIsEnumerable.call(from, symbols[i])) { 34071 to[symbols[i]] = from[symbols[i]]; 34072 } 34073 } 34074 } 34075 } 34076 34077 return to; 34078 }; 34079 34080 34081 /***/ }), 34082 34083 /***/ "./node_modules/prop-types/checkPropTypes.js": 34084 /*!***************************************************!*\ 34085 !*** ./node_modules/prop-types/checkPropTypes.js ***! 34086 \***************************************************/ 34087 /*! no static exports found */ 34088 /***/ (function(module, exports, __webpack_require__) { 34089 34090 "use strict"; 34091 /** 34092 * Copyright (c) 2013-present, Facebook, Inc. 34093 * 34094 * This source code is licensed under the MIT license found in the 34095 * LICENSE file in the root directory of this source tree. 34096 */ 34097 34098 34099 34100 var printWarning = function() {}; 34101 34102 if (true) { 34103 var ReactPropTypesSecret = __webpack_require__(/*! ./lib/ReactPropTypesSecret */ "./node_modules/prop-types/lib/ReactPropTypesSecret.js"); 34104 var loggedTypeFailures = {}; 34105 34106 printWarning = function(text) { 34107 var message = 'Warning: ' + text; 34108 if (typeof console !== 'undefined') { 34109 console.error(message); 34110 } 34111 try { 34112 // --- Welcome to debugging React --- 34113 // This error was thrown as a convenience so that you can use this stack 34114 // to find the callsite that caused this warning to fire. 34115 throw new Error(message); 34116 } catch (x) {} 34117 }; 34118 } 34119 34120 /** 34121 * Assert that the values match with the type specs. 34122 * Error messages are memorized and will only be shown once. 34123 * 34124 * @param {object} typeSpecs Map of name to a ReactPropType 34125 * @param {object} values Runtime values that need to be type-checked 34126 * @param {string} location e.g. "prop", "context", "child context" 34127 * @param {string} componentName Name of the component for error messages. 34128 * @param {?Function} getStack Returns the component stack. 34129 * @private 34130 */ 34131 function checkPropTypes(typeSpecs, values, location, componentName, getStack) { 34132 if (true) { 34133 for (var typeSpecName in typeSpecs) { 34134 if (typeSpecs.hasOwnProperty(typeSpecName)) { 34135 var error; 34136 // Prop type validation may throw. In case they do, we don't want to 34137 // fail the render phase where it didn't fail before. So we log it. 34138 // After these have been cleaned up, we'll let them throw. 34139 try { 34140 // This is intentionally an invariant that gets caught. It's the same 34141 // behavior as without this statement except with a better message. 34142 if (typeof typeSpecs[typeSpecName] !== 'function') { 34143 var err = Error( 34144 (componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' + 34145 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' 34146 ); 34147 err.name = 'Invariant Violation'; 34148 throw err; 34149 } 34150 error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret); 34151 } catch (ex) { 34152 error = ex; 34153 } 34154 if (error && !(error instanceof Error)) { 34155 printWarning( 34156 (componentName || 'React class') + ': type specification of ' + 34157 location + ' `' + typeSpecName + '` is invalid; the type checker ' + 34158 'function must return `null` or an `Error` but returned a ' + typeof error + '. ' + 34159 'You may have forgotten to pass an argument to the type checker ' + 34160 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 34161 'shape all require an argument).' 34162 ) 34163 34164 } 34165 if (error instanceof Error && !(error.message in loggedTypeFailures)) { 34166 // Only monitor this failure once because there tends to be a lot of the 34167 // same error. 34168 loggedTypeFailures[error.message] = true; 34169 34170 var stack = getStack ? getStack() : ''; 34171 34172 printWarning( 34173 'Failed ' + location + ' type: ' + error.message + (stack != null ? stack : '') 34174 ); 34175 } 34176 } 34177 } 34178 } 34179 } 34180 34181 module.exports = checkPropTypes; 34182 34183 34184 /***/ }), 34185 34186 /***/ "./node_modules/prop-types/factoryWithTypeCheckers.js": 34187 /*!************************************************************!*\ 34188 !*** ./node_modules/prop-types/factoryWithTypeCheckers.js ***! 34189 \************************************************************/ 34190 /*! no static exports found */ 34191 /***/ (function(module, exports, __webpack_require__) { 34192 34193 "use strict"; 34194 /** 34195 * Copyright (c) 2013-present, Facebook, Inc. 34196 * 34197 * This source code is licensed under the MIT license found in the 34198 * LICENSE file in the root directory of this source tree. 34199 */ 34200 34201 34202 34203 var assign = __webpack_require__(/*! object-assign */ "./node_modules/object-assign/index.js"); 34204 34205 var ReactPropTypesSecret = __webpack_require__(/*! ./lib/ReactPropTypesSecret */ "./node_modules/prop-types/lib/ReactPropTypesSecret.js"); 34206 var checkPropTypes = __webpack_require__(/*! ./checkPropTypes */ "./node_modules/prop-types/checkPropTypes.js"); 34207 34208 var printWarning = function() {}; 34209 34210 if (true) { 34211 printWarning = function(text) { 34212 var message = 'Warning: ' + text; 34213 if (typeof console !== 'undefined') { 34214 console.error(message); 34215 } 34216 try { 34217 // --- Welcome to debugging React --- 34218 // This error was thrown as a convenience so that you can use this stack 34219 // to find the callsite that caused this warning to fire. 34220 throw new Error(message); 34221 } catch (x) {} 34222 }; 34223 } 34224 34225 function emptyFunctionThatReturnsNull() { 34226 return null; 34227 } 34228 34229 module.exports = function(isValidElement, throwOnDirectAccess) { 34230 /* global Symbol */ 34231 var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator; 34232 var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec. 34233 34234 /** 34235 * Returns the iterator method function contained on the iterable object. 34236 * 34237 * Be sure to invoke the function with the iterable as context: 34238 * 34239 * var iteratorFn = getIteratorFn(myIterable); 34240 * if (iteratorFn) { 34241 * var iterator = iteratorFn.call(myIterable); 34242 * ... 34243 * } 34244 * 34245 * @param {?object} maybeIterable 34246 * @return {?function} 34247 */ 34248 function getIteratorFn(maybeIterable) { 34249 var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]); 34250 if (typeof iteratorFn === 'function') { 34251 return iteratorFn; 34252 } 34253 } 34254 34255 /** 34256 * Collection of methods that allow declaration and validation of props that are 34257 * supplied to React components. Example usage: 34258 * 34259 * var Props = require('ReactPropTypes'); 34260 * var MyArticle = React.createClass({ 34261 * propTypes: { 34262 * // An optional string prop named "description". 34263 * description: Props.string, 34264 * 34265 * // A required enum prop named "category". 34266 * category: Props.oneOf(['News','Photos']).isRequired, 34267 * 34268 * // A prop named "dialog" that requires an instance of Dialog. 34269 * dialog: Props.instanceOf(Dialog).isRequired 34270 * }, 34271 * render: function() { ... } 34272 * }); 34273 * 34274 * A more formal specification of how these methods are used: 34275 * 34276 * type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...) 34277 * decl := ReactPropTypes.{type}(.isRequired)? 34278 * 34279 * Each and every declaration produces a function with the same signature. This 34280 * allows the creation of custom validation functions. For example: 34281 * 34282 * var MyLink = React.createClass({ 34283 * propTypes: { 34284 * // An optional string or URI prop named "href". 34285 * href: function(props, propName, componentName) { 34286 * var propValue = props[propName]; 34287 * if (propValue != null && typeof propValue !== 'string' && 34288 * !(propValue instanceof URI)) { 34289 * return new Error( 34290 * 'Expected a string or an URI for ' + propName + ' in ' + 34291 * componentName 34292 * ); 34293 * } 34294 * } 34295 * }, 34296 * render: function() {...} 34297 * }); 34298 * 34299 * @internal 34300 */ 34301 34302 var ANONYMOUS = '<<anonymous>>'; 34303 34304 // Important! 34305 // Keep this list in sync with production version in `./factoryWithThrowingShims.js`. 34306 var ReactPropTypes = { 34307 array: createPrimitiveTypeChecker('array'), 34308 bool: createPrimitiveTypeChecker('boolean'), 34309 func: createPrimitiveTypeChecker('function'), 34310 number: createPrimitiveTypeChecker('number'), 34311 object: createPrimitiveTypeChecker('object'), 34312 string: createPrimitiveTypeChecker('string'), 34313 symbol: createPrimitiveTypeChecker('symbol'), 34314 34315 any: createAnyTypeChecker(), 34316 arrayOf: createArrayOfTypeChecker, 34317 element: createElementTypeChecker(), 34318 instanceOf: createInstanceTypeChecker, 34319 node: createNodeChecker(), 34320 objectOf: createObjectOfTypeChecker, 34321 oneOf: createEnumTypeChecker, 34322 oneOfType: createUnionTypeChecker, 34323 shape: createShapeTypeChecker, 34324 exact: createStrictShapeTypeChecker, 34325 }; 34326 34327 /** 34328 * inlined Object.is polyfill to avoid requiring consumers ship their own 34329 * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is 34330 */ 34331 /*eslint-disable no-self-compare*/ 34332 function is(x, y) { 34333 // SameValue algorithm 34334 if (x === y) { 34335 // Steps 1-5, 7-10 34336 // Steps 6.b-6.e: +0 != -0 34337 return x !== 0 || 1 / x === 1 / y; 34338 } else { 34339 // Step 6.a: NaN == NaN 34340 return x !== x && y !== y; 34341 } 34342 } 34343 /*eslint-enable no-self-compare*/ 34344 34345 /** 34346 * We use an Error-like object for backward compatibility as people may call 34347 * PropTypes directly and inspect their output. However, we don't use real 34348 * Errors anymore. We don't inspect their stack anyway, and creating them 34349 * is prohibitively expensive if they are created too often, such as what 34350 * happens in oneOfType() for any type before the one that matched. 34351 */ 34352 function PropTypeError(message) { 34353 this.message = message; 34354 this.stack = ''; 34355 } 34356 // Make `instanceof Error` still work for returned errors. 34357 PropTypeError.prototype = Error.prototype; 34358 34359 function createChainableTypeChecker(validate) { 34360 if (true) { 34361 var manualPropTypeCallCache = {}; 34362 var manualPropTypeWarningCount = 0; 34363 } 34364 function checkType(isRequired, props, propName, componentName, location, propFullName, secret) { 34365 componentName = componentName || ANONYMOUS; 34366 propFullName = propFullName || propName; 34367 34368 if (secret !== ReactPropTypesSecret) { 34369 if (throwOnDirectAccess) { 34370 // New behavior only for users of `prop-types` package 34371 var err = new Error( 34372 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' + 34373 'Use `PropTypes.checkPropTypes()` to call them. ' + 34374 'Read more at http://fb.me/use-check-prop-types' 34375 ); 34376 err.name = 'Invariant Violation'; 34377 throw err; 34378 } else if ( true && typeof console !== 'undefined') { 34379 // Old behavior for people using React.PropTypes 34380 var cacheKey = componentName + ':' + propName; 34381 if ( 34382 !manualPropTypeCallCache[cacheKey] && 34383 // Avoid spamming the console because they are often not actionable except for lib authors 34384 manualPropTypeWarningCount < 3 34385 ) { 34386 printWarning( 34387 'You are manually calling a React.PropTypes validation ' + 34388 'function for the `' + propFullName + '` prop on `' + componentName + '`. This is deprecated ' + 34389 'and will throw in the standalone `prop-types` package. ' + 34390 'You may be seeing this warning due to a third-party PropTypes ' + 34391 'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.' 34392 ); 34393 manualPropTypeCallCache[cacheKey] = true; 34394 manualPropTypeWarningCount++; 34395 } 34396 } 34397 } 34398 if (props[propName] == null) { 34399 if (isRequired) { 34400 if (props[propName] === null) { 34401 return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required ' + ('in `' + componentName + '`, but its value is `null`.')); 34402 } 34403 return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required in ' + ('`' + componentName + '`, but its value is `undefined`.')); 34404 } 34405 return null; 34406 } else { 34407 return validate(props, propName, componentName, location, propFullName); 34408 } 34409 } 34410 34411 var chainedCheckType = checkType.bind(null, false); 34412 chainedCheckType.isRequired = checkType.bind(null, true); 34413 34414 return chainedCheckType; 34415 } 34416 34417 function createPrimitiveTypeChecker(expectedType) { 34418 function validate(props, propName, componentName, location, propFullName, secret) { 34419 var propValue = props[propName]; 34420 var propType = getPropType(propValue); 34421 if (propType !== expectedType) { 34422 // `propValue` being instance of, say, date/regexp, pass the 'object' 34423 // check, but we can offer a more precise error message here rather than 34424 // 'of type `object`'. 34425 var preciseType = getPreciseType(propValue); 34426 34427 return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.')); 34428 } 34429 return null; 34430 } 34431 return createChainableTypeChecker(validate); 34432 } 34433 34434 function createAnyTypeChecker() { 34435 return createChainableTypeChecker(emptyFunctionThatReturnsNull); 34436 } 34437 34438 function createArrayOfTypeChecker(typeChecker) { 34439 function validate(props, propName, componentName, location, propFullName) { 34440 if (typeof typeChecker !== 'function') { 34441 return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.'); 34442 } 34443 var propValue = props[propName]; 34444 if (!Array.isArray(propValue)) { 34445 var propType = getPropType(propValue); 34446 return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.')); 34447 } 34448 for (var i = 0; i < propValue.length; i++) { 34449 var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret); 34450 if (error instanceof Error) { 34451 return error; 34452 } 34453 } 34454 return null; 34455 } 34456 return createChainableTypeChecker(validate); 34457 } 34458 34459 function createElementTypeChecker() { 34460 function validate(props, propName, componentName, location, propFullName) { 34461 var propValue = props[propName]; 34462 if (!isValidElement(propValue)) { 34463 var propType = getPropType(propValue); 34464 return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement.')); 34465 } 34466 return null; 34467 } 34468 return createChainableTypeChecker(validate); 34469 } 34470 34471 function createInstanceTypeChecker(expectedClass) { 34472 function validate(props, propName, componentName, location, propFullName) { 34473 if (!(props[propName] instanceof expectedClass)) { 34474 var expectedClassName = expectedClass.name || ANONYMOUS; 34475 var actualClassName = getClassName(props[propName]); 34476 return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.')); 34477 } 34478 return null; 34479 } 34480 return createChainableTypeChecker(validate); 34481 } 34482 34483 function createEnumTypeChecker(expectedValues) { 34484 if (!Array.isArray(expectedValues)) { 34485 true ? printWarning('Invalid argument supplied to oneOf, expected an instance of array.') : undefined; 34486 return emptyFunctionThatReturnsNull; 34487 } 34488 34489 function validate(props, propName, componentName, location, propFullName) { 34490 var propValue = props[propName]; 34491 for (var i = 0; i < expectedValues.length; i++) { 34492 if (is(propValue, expectedValues[i])) { 34493 return null; 34494 } 34495 } 34496 34497 var valuesString = JSON.stringify(expectedValues); 34498 return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of value `' + propValue + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.')); 34499 } 34500 return createChainableTypeChecker(validate); 34501 } 34502 34503 function createObjectOfTypeChecker(typeChecker) { 34504 function validate(props, propName, componentName, location, propFullName) { 34505 if (typeof typeChecker !== 'function') { 34506 return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.'); 34507 } 34508 var propValue = props[propName]; 34509 var propType = getPropType(propValue); 34510 if (propType !== 'object') { 34511 return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.')); 34512 } 34513 for (var key in propValue) { 34514 if (propValue.hasOwnProperty(key)) { 34515 var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret); 34516 if (error instanceof Error) { 34517 return error; 34518 } 34519 } 34520 } 34521 return null; 34522 } 34523 return createChainableTypeChecker(validate); 34524 } 34525 34526 function createUnionTypeChecker(arrayOfTypeCheckers) { 34527 if (!Array.isArray(arrayOfTypeCheckers)) { 34528 true ? printWarning('Invalid argument supplied to oneOfType, expected an instance of array.') : undefined; 34529 return emptyFunctionThatReturnsNull; 34530 } 34531 34532 for (var i = 0; i < arrayOfTypeCheckers.length; i++) { 34533 var checker = arrayOfTypeCheckers[i]; 34534 if (typeof checker !== 'function') { 34535 printWarning( 34536 'Invalid argument supplied to oneOfType. Expected an array of check functions, but ' + 34537 'received ' + getPostfixForTypeWarning(checker) + ' at index ' + i + '.' 34538 ); 34539 return emptyFunctionThatReturnsNull; 34540 } 34541 } 34542 34543 function validate(props, propName, componentName, location, propFullName) { 34544 for (var i = 0; i < arrayOfTypeCheckers.length; i++) { 34545 var checker = arrayOfTypeCheckers[i]; 34546 if (checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret) == null) { 34547 return null; 34548 } 34549 } 34550 34551 return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`.')); 34552 } 34553 return createChainableTypeChecker(validate); 34554 } 34555 34556 function createNodeChecker() { 34557 function validate(props, propName, componentName, location, propFullName) { 34558 if (!isNode(props[propName])) { 34559 return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.')); 34560 } 34561 return null; 34562 } 34563 return createChainableTypeChecker(validate); 34564 } 34565 34566 function createShapeTypeChecker(shapeTypes) { 34567 function validate(props, propName, componentName, location, propFullName) { 34568 var propValue = props[propName]; 34569 var propType = getPropType(propValue); 34570 if (propType !== 'object') { 34571 return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.')); 34572 } 34573 for (var key in shapeTypes) { 34574 var checker = shapeTypes[key]; 34575 if (!checker) { 34576 continue; 34577 } 34578 var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret); 34579 if (error) { 34580 return error; 34581 } 34582 } 34583 return null; 34584 } 34585 return createChainableTypeChecker(validate); 34586 } 34587 34588 function createStrictShapeTypeChecker(shapeTypes) { 34589 function validate(props, propName, componentName, location, propFullName) { 34590 var propValue = props[propName]; 34591 var propType = getPropType(propValue); 34592 if (propType !== 'object') { 34593 return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.')); 34594 } 34595 // We need to check all keys in case some are required but missing from 34596 // props. 34597 var allKeys = assign({}, props[propName], shapeTypes); 34598 for (var key in allKeys) { 34599 var checker = shapeTypes[key]; 34600 if (!checker) { 34601 return new PropTypeError( 34602 'Invalid ' + location + ' `' + propFullName + '` key `' + key + '` supplied to `' + componentName + '`.' + 34603 '\nBad object: ' + JSON.stringify(props[propName], null, ' ') + 34604 '\nValid keys: ' + JSON.stringify(Object.keys(shapeTypes), null, ' ') 34605 ); 34606 } 34607 var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret); 34608 if (error) { 34609 return error; 34610 } 34611 } 34612 return null; 34613 } 34614 34615 return createChainableTypeChecker(validate); 34616 } 34617 34618 function isNode(propValue) { 34619 switch (typeof propValue) { 34620 case 'number': 34621 case 'string': 34622 case 'undefined': 34623 return true; 34624 case 'boolean': 34625 return !propValue; 34626 case 'object': 34627 if (Array.isArray(propValue)) { 34628 return propValue.every(isNode); 34629 } 34630 if (propValue === null || isValidElement(propValue)) { 34631 return true; 34632 } 34633 34634 var iteratorFn = getIteratorFn(propValue); 34635 if (iteratorFn) { 34636 var iterator = iteratorFn.call(propValue); 34637 var step; 34638 if (iteratorFn !== propValue.entries) { 34639 while (!(step = iterator.next()).done) { 34640 if (!isNode(step.value)) { 34641 return false; 34642 } 34643 } 34644 } else { 34645 // Iterator will provide entry [k,v] tuples rather than values. 34646 while (!(step = iterator.next()).done) { 34647 var entry = step.value; 34648 if (entry) { 34649 if (!isNode(entry[1])) { 34650 return false; 34651 } 34652 } 34653 } 34654 } 34655 } else { 34656 return false; 34657 } 34658 34659 return true; 34660 default: 34661 return false; 34662 } 34663 } 34664 34665 function isSymbol(propType, propValue) { 34666 // Native Symbol. 34667 if (propType === 'symbol') { 34668 return true; 34669 } 34670 34671 // 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol' 34672 if (propValue['@@toStringTag'] === 'Symbol') { 34673 return true; 34674 } 34675 34676 // Fallback for non-spec compliant Symbols which are polyfilled. 34677 if (typeof Symbol === 'function' && propValue instanceof Symbol) { 34678 return true; 34679 } 34680 34681 return false; 34682 } 34683 34684 // Equivalent of `typeof` but with special handling for array and regexp. 34685 function getPropType(propValue) { 34686 var propType = typeof propValue; 34687 if (Array.isArray(propValue)) { 34688 return 'array'; 34689 } 34690 if (propValue instanceof RegExp) { 34691 // Old webkits (at least until Android 4.0) return 'function' rather than 34692 // 'object' for typeof a RegExp. We'll normalize this here so that /bla/ 34693 // passes PropTypes.object. 34694 return 'object'; 34695 } 34696 if (isSymbol(propType, propValue)) { 34697 return 'symbol'; 34698 } 34699 return propType; 34700 } 34701 34702 // This handles more types than `getPropType`. Only used for error messages. 34703 // See `createPrimitiveTypeChecker`. 34704 function getPreciseType(propValue) { 34705 if (typeof propValue === 'undefined' || propValue === null) { 34706 return '' + propValue; 34707 } 34708 var propType = getPropType(propValue); 34709 if (propType === 'object') { 34710 if (propValue instanceof Date) { 34711 return 'date'; 34712 } else if (propValue instanceof RegExp) { 34713 return 'regexp'; 34714 } 34715 } 34716 return propType; 34717 } 34718 34719 // Returns a string that is postfixed to a warning about an invalid type. 34720 // For example, "undefined" or "of type array" 34721 function getPostfixForTypeWarning(value) { 34722 var type = getPreciseType(value); 34723 switch (type) { 34724 case 'array': 34725 case 'object': 34726 return 'an ' + type; 34727 case 'boolean': 34728 case 'date': 34729 case 'regexp': 34730 return 'a ' + type; 34731 default: 34732 return type; 34733 } 34734 } 34735 34736 // Returns class name of the object, if any. 34737 function getClassName(propValue) { 34738 if (!propValue.constructor || !propValue.constructor.name) { 34739 return ANONYMOUS; 34740 } 34741 return propValue.constructor.name; 34742 } 34743 34744 ReactPropTypes.checkPropTypes = checkPropTypes; 34745 ReactPropTypes.PropTypes = ReactPropTypes; 34746 34747 return ReactPropTypes; 34748 }; 34749 34750 34751 /***/ }), 34752 34753 /***/ "./node_modules/prop-types/index.js": 34754 /*!******************************************!*\ 34755 !*** ./node_modules/prop-types/index.js ***! 34756 \******************************************/ 34757 /*! no static exports found */ 34758 /***/ (function(module, exports, __webpack_require__) { 34759 34760 /** 34761 * Copyright (c) 2013-present, Facebook, Inc. 34762 * 34763 * This source code is licensed under the MIT license found in the 34764 * LICENSE file in the root directory of this source tree. 34765 */ 34766 34767 if (true) { 34768 var REACT_ELEMENT_TYPE = (typeof Symbol === 'function' && 34769 Symbol.for && 34770 Symbol.for('react.element')) || 34771 0xeac7; 34772 34773 var isValidElement = function(object) { 34774 return typeof object === 'object' && 34775 object !== null && 34776 object.$$typeof === REACT_ELEMENT_TYPE; 34777 }; 34778 34779 // By explicitly using `prop-types` you are opting into new development behavior. 34780 // http://fb.me/prop-types-in-prod 34781 var throwOnDirectAccess = true; 34782 module.exports = __webpack_require__(/*! ./factoryWithTypeCheckers */ "./node_modules/prop-types/factoryWithTypeCheckers.js")(isValidElement, throwOnDirectAccess); 34783 } else {} 34784 34785 34786 /***/ }), 34787 34788 /***/ "./node_modules/prop-types/lib/ReactPropTypesSecret.js": 34789 /*!*************************************************************!*\ 34790 !*** ./node_modules/prop-types/lib/ReactPropTypesSecret.js ***! 34791 \*************************************************************/ 34792 /*! no static exports found */ 34793 /***/ (function(module, exports, __webpack_require__) { 34794 34795 "use strict"; 34796 /** 34797 * Copyright (c) 2013-present, Facebook, Inc. 34798 * 34799 * This source code is licensed under the MIT license found in the 34800 * LICENSE file in the root directory of this source tree. 34801 */ 34802 34803 34804 34805 var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED'; 34806 34807 module.exports = ReactPropTypesSecret; 34808 34809 34810 /***/ }), 34811 34812 /***/ "./node_modules/punycode/punycode.js": 34813 /*!*******************************************!*\ 34814 !*** ./node_modules/punycode/punycode.js ***! 34815 \*******************************************/ 34816 /*! no static exports found */ 34817 /***/ (function(module, exports, __webpack_require__) { 34818 34819 /* WEBPACK VAR INJECTION */(function(module, global) {var __WEBPACK_AMD_DEFINE_RESULT__;/*! https://mths.be/punycode v1.4.1 by @mathias */ 34820 ;(function(root) { 34821 34822 /** Detect free variables */ 34823 var freeExports = true && exports && 34824 !exports.nodeType && exports; 34825 var freeModule = true && module && 34826 !module.nodeType && module; 34827 var freeGlobal = typeof global == 'object' && global; 34828 if ( 34829 freeGlobal.global === freeGlobal || 34830 freeGlobal.window === freeGlobal || 34831 freeGlobal.self === freeGlobal 34832 ) { 34833 root = freeGlobal; 34834 } 34835 34836 /** 34837 * The `punycode` object. 34838 * @name punycode 34839 * @type Object 34840 */ 34841 var punycode, 34842 34843 /** Highest positive signed 32-bit float value */ 34844 maxInt = 2147483647, // aka. 0x7FFFFFFF or 2^31-1 34845 34846 /** Bootstring parameters */ 34847 base = 36, 34848 tMin = 1, 34849 tMax = 26, 34850 skew = 38, 34851 damp = 700, 34852 initialBias = 72, 34853 initialN = 128, // 0x80 34854 delimiter = '-', // '\x2D' 34855 34856 /** Regular expressions */ 34857 regexPunycode = /^xn--/, 34858 regexNonASCII = /[^\x20-\x7E]/, // unprintable ASCII chars + non-ASCII chars 34859 regexSeparators = /[\x2E\u3002\uFF0E\uFF61]/g, // RFC 3490 separators 34860 34861 /** Error messages */ 34862 errors = { 34863 'overflow': 'Overflow: input needs wider integers to process', 34864 'not-basic': 'Illegal input >= 0x80 (not a basic code point)', 34865 'invalid-input': 'Invalid input' 34866 }, 34867 34868 /** Convenience shortcuts */ 34869 baseMinusTMin = base - tMin, 34870 floor = Math.floor, 34871 stringFromCharCode = String.fromCharCode, 34872 34873 /** Temporary variable */ 34874 key; 34875 34876 /*--------------------------------------------------------------------------*/ 34877 34878 /** 34879 * A generic error utility function. 34880 * @private 34881 * @param {String} type The error type. 34882 * @returns {Error} Throws a `RangeError` with the applicable error message. 34883 */ 34884 function error(type) { 34885 throw new RangeError(errors[type]); 34886 } 34887 34888 /** 34889 * A generic `Array#map` utility function. 34890 * @private 34891 * @param {Array} array The array to iterate over. 34892 * @param {Function} callback The function that gets called for every array 34893 * item. 34894 * @returns {Array} A new array of values returned by the callback function. 34895 */ 34896 function map(array, fn) { 34897 var length = array.length; 34898 var result = []; 34899 while (length--) { 34900 result[length] = fn(array[length]); 34901 } 34902 return result; 34903 } 34904 34905 /** 34906 * A simple `Array#map`-like wrapper to work with domain name strings or email 34907 * addresses. 34908 * @private 34909 * @param {String} domain The domain name or email address. 34910 * @param {Function} callback The function that gets called for every 34911 * character. 34912 * @returns {Array} A new string of characters returned by the callback 34913 * function. 34914 */ 34915 function mapDomain(string, fn) { 34916 var parts = string.split('@'); 34917 var result = ''; 34918 if (parts.length > 1) { 34919 // In email addresses, only the domain name should be punycoded. Leave 34920 // the local part (i.e. everything up to `@`) intact. 34921 result = parts[0] + '@'; 34922 string = parts[1]; 34923 } 34924 // Avoid `split(regex)` for IE8 compatibility. See #17. 34925 string = string.replace(regexSeparators, '\x2E'); 34926 var labels = string.split('.'); 34927 var encoded = map(labels, fn).join('.'); 34928 return result + encoded; 34929 } 34930 34931 /** 34932 * Creates an array containing the numeric code points of each Unicode 34933 * character in the string. While JavaScript uses UCS-2 internally, 34934 * this function will convert a pair of surrogate halves (each of which 34935 * UCS-2 exposes as separate characters) into a single code point, 34936 * matching UTF-16. 34937 * @see `punycode.ucs2.encode` 34938 * @see <https://mathiasbynens.be/notes/javascript-encoding> 34939 * @memberOf punycode.ucs2 34940 * @name decode 34941 * @param {String} string The Unicode input string (UCS-2). 34942 * @returns {Array} The new array of code points. 34943 */ 34944 function ucs2decode(string) { 34945 var output = [], 34946 counter = 0, 34947 length = string.length, 34948 value, 34949 extra; 34950 while (counter < length) { 34951 value = string.charCodeAt(counter++); 34952 if (value >= 0xD800 && value <= 0xDBFF && counter < length) { 34953 // high surrogate, and there is a next character 34954 extra = string.charCodeAt(counter++); 34955 if ((extra & 0xFC00) == 0xDC00) { // low surrogate 34956 output.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000); 34957 } else { 34958 // unmatched surrogate; only append this code unit, in case the next 34959 // code unit is the high surrogate of a surrogate pair 34960 output.push(value); 34961 counter--; 34962 } 34963 } else { 34964 output.push(value); 34965 } 34966 } 34967 return output; 34968 } 34969 34970 /** 34971 * Creates a string based on an array of numeric code points. 34972 * @see `punycode.ucs2.decode` 34973 * @memberOf punycode.ucs2 34974 * @name encode 34975 * @param {Array} codePoints The array of numeric code points. 34976 * @returns {String} The new Unicode string (UCS-2). 34977 */ 34978 function ucs2encode(array) { 34979 return map(array, function(value) { 34980 var output = ''; 34981 if (value > 0xFFFF) { 34982 value -= 0x10000; 34983 output += stringFromCharCode(value >>> 10 & 0x3FF | 0xD800); 34984 value = 0xDC00 | value & 0x3FF; 34985 } 34986 output += stringFromCharCode(value); 34987 return output; 34988 }).join(''); 34989 } 34990 34991 /** 34992 * Converts a basic code point into a digit/integer. 34993 * @see `digitToBasic()` 34994 * @private 34995 * @param {Number} codePoint The basic numeric code point value. 34996 * @returns {Number} The numeric value of a basic code point (for use in 34997 * representing integers) in the range `0` to `base - 1`, or `base` if 34998 * the code point does not represent a value. 34999 */ 35000 function basicToDigit(codePoint) { 35001 if (codePoint - 48 < 10) { 35002 return codePoint - 22; 35003 } 35004 if (codePoint - 65 < 26) { 35005 return codePoint - 65; 35006 } 35007 if (codePoint - 97 < 26) { 35008 return codePoint - 97; 35009 } 35010 return base; 35011 } 35012 35013 /** 35014 * Converts a digit/integer into a basic code point. 35015 * @see `basicToDigit()` 35016 * @private 35017 * @param {Number} digit The numeric value of a basic code point. 35018 * @returns {Number} The basic code point whose value (when used for 35019 * representing integers) is `digit`, which needs to be in the range 35020 * `0` to `base - 1`. If `flag` is non-zero, the uppercase form is 35021 * used; else, the lowercase form is used. The behavior is undefined 35022 * if `flag` is non-zero and `digit` has no uppercase form. 35023 */ 35024 function digitToBasic(digit, flag) { 35025 // 0..25 map to ASCII a..z or A..Z 35026 // 26..35 map to ASCII 0..9 35027 return digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5); 35028 } 35029 35030 /** 35031 * Bias adaptation function as per section 3.4 of RFC 3492. 35032 * https://tools.ietf.org/html/rfc3492#section-3.4 35033 * @private 35034 */ 35035 function adapt(delta, numPoints, firstTime) { 35036 var k = 0; 35037 delta = firstTime ? floor(delta / damp) : delta >> 1; 35038 delta += floor(delta / numPoints); 35039 for (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) { 35040 delta = floor(delta / baseMinusTMin); 35041 } 35042 return floor(k + (baseMinusTMin + 1) * delta / (delta + skew)); 35043 } 35044 35045 /** 35046 * Converts a Punycode string of ASCII-only symbols to a string of Unicode 35047 * symbols. 35048 * @memberOf punycode 35049 * @param {String} input The Punycode string of ASCII-only symbols. 35050 * @returns {String} The resulting string of Unicode symbols. 35051 */ 35052 function decode(input) { 35053 // Don't use UCS-2 35054 var output = [], 35055 inputLength = input.length, 35056 out, 35057 i = 0, 35058 n = initialN, 35059 bias = initialBias, 35060 basic, 35061 j, 35062 index, 35063 oldi, 35064 w, 35065 k, 35066 digit, 35067 t, 35068 /** Cached calculation results */ 35069 baseMinusT; 35070 35071 // Handle the basic code points: let `basic` be the number of input code 35072 // points before the last delimiter, or `0` if there is none, then copy 35073 // the first basic code points to the output. 35074 35075 basic = input.lastIndexOf(delimiter); 35076 if (basic < 0) { 35077 basic = 0; 35078 } 35079 35080 for (j = 0; j < basic; ++j) { 35081 // if it's not a basic code point 35082 if (input.charCodeAt(j) >= 0x80) { 35083 error('not-basic'); 35084 } 35085 output.push(input.charCodeAt(j)); 35086 } 35087 35088 // Main decoding loop: start just after the last delimiter if any basic code 35089 // points were copied; start at the beginning otherwise. 35090 35091 for (index = basic > 0 ? basic + 1 : 0; index < inputLength; /* no final expression */) { 35092 35093 // `index` is the index of the next character to be consumed. 35094 // Decode a generalized variable-length integer into `delta`, 35095 // which gets added to `i`. The overflow checking is easier 35096 // if we increase `i` as we go, then subtract off its starting 35097 // value at the end to obtain `delta`. 35098 for (oldi = i, w = 1, k = base; /* no condition */; k += base) { 35099 35100 if (index >= inputLength) { 35101 error('invalid-input'); 35102 } 35103 35104 digit = basicToDigit(input.charCodeAt(index++)); 35105 35106 if (digit >= base || digit > floor((maxInt - i) / w)) { 35107 error('overflow'); 35108 } 35109 35110 i += digit * w; 35111 t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias); 35112 35113 if (digit < t) { 35114 break; 35115 } 35116 35117 baseMinusT = base - t; 35118 if (w > floor(maxInt / baseMinusT)) { 35119 error('overflow'); 35120 } 35121 35122 w *= baseMinusT; 35123 35124 } 35125 35126 out = output.length + 1; 35127 bias = adapt(i - oldi, out, oldi == 0); 35128 35129 // `i` was supposed to wrap around from `out` to `0`, 35130 // incrementing `n` each time, so we'll fix that now: 35131 if (floor(i / out) > maxInt - n) { 35132 error('overflow'); 35133 } 35134 35135 n += floor(i / out); 35136 i %= out; 35137 35138 // Insert `n` at position `i` of the output 35139 output.splice(i++, 0, n); 35140 35141 } 35142 35143 return ucs2encode(output); 35144 } 35145 35146 /** 35147 * Converts a string of Unicode symbols (e.g. a domain name label) to a 35148 * Punycode string of ASCII-only symbols. 35149 * @memberOf punycode 35150 * @param {String} input The string of Unicode symbols. 35151 * @returns {String} The resulting Punycode string of ASCII-only symbols. 35152 */ 35153 function encode(input) { 35154 var n, 35155 delta, 35156 handledCPCount, 35157 basicLength, 35158 bias, 35159 j, 35160 m, 35161 q, 35162 k, 35163 t, 35164 currentValue, 35165 output = [], 35166 /** `inputLength` will hold the number of code points in `input`. */ 35167 inputLength, 35168 /** Cached calculation results */ 35169 handledCPCountPlusOne, 35170 baseMinusT, 35171 qMinusT; 35172 35173 // Convert the input in UCS-2 to Unicode 35174 input = ucs2decode(input); 35175 35176 // Cache the length 35177 inputLength = input.length; 35178 35179 // Initialize the state 35180 n = initialN; 35181 delta = 0; 35182 bias = initialBias; 35183 35184 // Handle the basic code points 35185 for (j = 0; j < inputLength; ++j) { 35186 currentValue = input[j]; 35187 if (currentValue < 0x80) { 35188 output.push(stringFromCharCode(currentValue)); 35189 } 35190 } 35191 35192 handledCPCount = basicLength = output.length; 35193 35194 // `handledCPCount` is the number of code points that have been handled; 35195 // `basicLength` is the number of basic code points. 35196 35197 // Finish the basic string - if it is not empty - with a delimiter 35198 if (basicLength) { 35199 output.push(delimiter); 35200 } 35201 35202 // Main encoding loop: 35203 while (handledCPCount < inputLength) { 35204 35205 // All non-basic code points < n have been handled already. Find the next 35206 // larger one: 35207 for (m = maxInt, j = 0; j < inputLength; ++j) { 35208 currentValue = input[j]; 35209 if (currentValue >= n && currentValue < m) { 35210 m = currentValue; 35211 } 35212 } 35213 35214 // Increase `delta` enough to advance the decoder's <n,i> state to <m,0>, 35215 // but guard against overflow 35216 handledCPCountPlusOne = handledCPCount + 1; 35217 if (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) { 35218 error('overflow'); 35219 } 35220 35221 delta += (m - n) * handledCPCountPlusOne; 35222 n = m; 35223 35224 for (j = 0; j < inputLength; ++j) { 35225 currentValue = input[j]; 35226 35227 if (currentValue < n && ++delta > maxInt) { 35228 error('overflow'); 35229 } 35230 35231 if (currentValue == n) { 35232 // Represent delta as a generalized variable-length integer 35233 for (q = delta, k = base; /* no condition */; k += base) { 35234 t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias); 35235 if (q < t) { 35236 break; 35237 } 35238 qMinusT = q - t; 35239 baseMinusT = base - t; 35240 output.push( 35241 stringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0)) 35242 ); 35243 q = floor(qMinusT / baseMinusT); 35244 } 35245 35246 output.push(stringFromCharCode(digitToBasic(q, 0))); 35247 bias = adapt(delta, handledCPCountPlusOne, handledCPCount == basicLength); 35248 delta = 0; 35249 ++handledCPCount; 35250 } 35251 } 35252 35253 ++delta; 35254 ++n; 35255 35256 } 35257 return output.join(''); 35258 } 35259 35260 /** 35261 * Converts a Punycode string representing a domain name or an email address 35262 * to Unicode. Only the Punycoded parts of the input will be converted, i.e. 35263 * it doesn't matter if you call it on a string that has already been 35264 * converted to Unicode. 35265 * @memberOf punycode 35266 * @param {String} input The Punycoded domain name or email address to 35267 * convert to Unicode. 35268 * @returns {String} The Unicode representation of the given Punycode 35269 * string. 35270 */ 35271 function toUnicode(input) { 35272 return mapDomain(input, function(string) { 35273 return regexPunycode.test(string) 35274 ? decode(string.slice(4).toLowerCase()) 35275 : string; 35276 }); 35277 } 35278 35279 /** 35280 * Converts a Unicode string representing a domain name or an email address to 35281 * Punycode. Only the non-ASCII parts of the domain name will be converted, 35282 * i.e. it doesn't matter if you call it with a domain that's already in 35283 * ASCII. 35284 * @memberOf punycode 35285 * @param {String} input The domain name or email address to convert, as a 35286 * Unicode string. 35287 * @returns {String} The Punycode representation of the given domain name or 35288 * email address. 35289 */ 35290 function toASCII(input) { 35291 return mapDomain(input, function(string) { 35292 return regexNonASCII.test(string) 35293 ? 'xn--' + encode(string) 35294 : string; 35295 }); 35296 } 35297 35298 /*--------------------------------------------------------------------------*/ 35299 35300 /** Define the public API */ 35301 punycode = { 35302 /** 35303 * A string representing the current Punycode.js version number. 35304 * @memberOf punycode 35305 * @type String 35306 */ 35307 'version': '1.4.1', 35308 /** 35309 * An object of methods to convert from JavaScript's internal character 35310 * representation (UCS-2) to Unicode code points, and back. 35311 * @see <https://mathiasbynens.be/notes/javascript-encoding> 35312 * @memberOf punycode 35313 * @type Object 35314 */ 35315 'ucs2': { 35316 'decode': ucs2decode, 35317 'encode': ucs2encode 35318 }, 35319 'decode': decode, 35320 'encode': encode, 35321 'toASCII': toASCII, 35322 'toUnicode': toUnicode 35323 }; 35324 35325 /** Expose `punycode` */ 35326 // Some AMD build optimizers, like r.js, check for specific condition patterns 35327 // like the following: 35328 if ( 35329 true 35330 ) { 35331 !(__WEBPACK_AMD_DEFINE_RESULT__ = (function() { 35332 return punycode; 35333 }).call(exports, __webpack_require__, exports, module), 35334 __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); 35335 } else {} 35336 35337 }(this)); 35338 35339 /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../webpack/buildin/module.js */ "./node_modules/webpack/buildin/module.js")(module), __webpack_require__(/*! ./../webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js"))) 35340 35341 /***/ }), 35342 35343 /***/ "./node_modules/querystring-es3/decode.js": 35344 /*!************************************************!*\ 35345 !*** ./node_modules/querystring-es3/decode.js ***! 35346 \************************************************/ 35347 /*! no static exports found */ 35348 /***/ (function(module, exports, __webpack_require__) { 35349 35350 "use strict"; 35351 // Copyright Joyent, Inc. and other Node contributors. 35352 // 35353 // Permission is hereby granted, free of charge, to any person obtaining a 35354 // copy of this software and associated documentation files (the 35355 // "Software"), to deal in the Software without restriction, including 35356 // without limitation the rights to use, copy, modify, merge, publish, 35357 // distribute, sublicense, and/or sell copies of the Software, and to permit 35358 // persons to whom the Software is furnished to do so, subject to the 35359 // following conditions: 35360 // 35361 // The above copyright notice and this permission notice shall be included 35362 // in all copies or substantial portions of the Software. 35363 // 35364 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 35365 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 35366 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN 35367 // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 35368 // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 35369 // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE 35370 // USE OR OTHER DEALINGS IN THE SOFTWARE. 35371 35372 35373 35374 // If obj.hasOwnProperty has been overridden, then calling 35375 // obj.hasOwnProperty(prop) will break. 35376 // See: https://github.com/joyent/node/issues/1707 35377 function hasOwnProperty(obj, prop) { 35378 return Object.prototype.hasOwnProperty.call(obj, prop); 35379 } 35380 35381 module.exports = function(qs, sep, eq, options) { 35382 sep = sep || '&'; 35383 eq = eq || '='; 35384 var obj = {}; 35385 35386 if (typeof qs !== 'string' || qs.length === 0) { 35387 return obj; 35388 } 35389 35390 var regexp = /\+/g; 35391 qs = qs.split(sep); 35392 35393 var maxKeys = 1000; 35394 if (options && typeof options.maxKeys === 'number') { 35395 maxKeys = options.maxKeys; 35396 } 35397 35398 var len = qs.length; 35399 // maxKeys <= 0 means that we should not limit keys count 35400 if (maxKeys > 0 && len > maxKeys) { 35401 len = maxKeys; 35402 } 35403 35404 for (var i = 0; i < len; ++i) { 35405 var x = qs[i].replace(regexp, '%20'), 35406 idx = x.indexOf(eq), 35407 kstr, vstr, k, v; 35408 35409 if (idx >= 0) { 35410 kstr = x.substr(0, idx); 35411 vstr = x.substr(idx + 1); 35412 } else { 35413 kstr = x; 35414 vstr = ''; 35415 } 35416 35417 k = decodeURIComponent(kstr); 35418 v = decodeURIComponent(vstr); 35419 35420 if (!hasOwnProperty(obj, k)) { 35421 obj[k] = v; 35422 } else if (isArray(obj[k])) { 35423 obj[k].push(v); 35424 } else { 35425 obj[k] = [obj[k], v]; 35426 } 35427 } 35428 35429 return obj; 35430 }; 35431 35432 var isArray = Array.isArray || function (xs) { 35433 return Object.prototype.toString.call(xs) === '[object Array]'; 35434 }; 35435 35436 35437 /***/ }), 35438 35439 /***/ "./node_modules/querystring-es3/encode.js": 35440 /*!************************************************!*\ 35441 !*** ./node_modules/querystring-es3/encode.js ***! 35442 \************************************************/ 35443 /*! no static exports found */ 35444 /***/ (function(module, exports, __webpack_require__) { 35445 35446 "use strict"; 35447 // Copyright Joyent, Inc. and other Node contributors. 35448 // 35449 // Permission is hereby granted, free of charge, to any person obtaining a 35450 // copy of this software and associated documentation files (the 35451 // "Software"), to deal in the Software without restriction, including 35452 // without limitation the rights to use, copy, modify, merge, publish, 35453 // distribute, sublicense, and/or sell copies of the Software, and to permit 35454 // persons to whom the Software is furnished to do so, subject to the 35455 // following conditions: 35456 // 35457 // The above copyright notice and this permission notice shall be included 35458 // in all copies or substantial portions of the Software. 35459 // 35460 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 35461 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 35462 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN 35463 // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 35464 // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 35465 // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE 35466 // USE OR OTHER DEALINGS IN THE SOFTWARE. 35467 35468 35469 35470 var stringifyPrimitive = function(v) { 35471 switch (typeof v) { 35472 case 'string': 35473 return v; 35474 35475 case 'boolean': 35476 return v ? 'true' : 'false'; 35477 35478 case 'number': 35479 return isFinite(v) ? v : ''; 35480 35481 default: 35482 return ''; 35483 } 35484 }; 35485 35486 module.exports = function(obj, sep, eq, name) { 35487 sep = sep || '&'; 35488 eq = eq || '='; 35489 if (obj === null) { 35490 obj = undefined; 35491 } 35492 35493 if (typeof obj === 'object') { 35494 return map(objectKeys(obj), function(k) { 35495 var ks = encodeURIComponent(stringifyPrimitive(k)) + eq; 35496 if (isArray(obj[k])) { 35497 return map(obj[k], function(v) { 35498 return ks + encodeURIComponent(stringifyPrimitive(v)); 35499 }).join(sep); 35500 } else { 35501 return ks + encodeURIComponent(stringifyPrimitive(obj[k])); 35502 } 35503 }).join(sep); 35504 35505 } 35506 35507 if (!name) return ''; 35508 return encodeURIComponent(stringifyPrimitive(name)) + eq + 35509 encodeURIComponent(stringifyPrimitive(obj)); 35510 }; 35511 35512 var isArray = Array.isArray || function (xs) { 35513 return Object.prototype.toString.call(xs) === '[object Array]'; 35514 }; 35515 35516 function map (xs, f) { 35517 if (xs.map) return xs.map(f); 35518 var res = []; 35519 for (var i = 0; i < xs.length; i++) { 35520 res.push(f(xs[i], i)); 35521 } 35522 return res; 35523 } 35524 35525 var objectKeys = Object.keys || function (obj) { 35526 var res = []; 35527 for (var key in obj) { 35528 if (Object.prototype.hasOwnProperty.call(obj, key)) res.push(key); 35529 } 35530 return res; 35531 }; 35532 35533 35534 /***/ }), 35535 35536 /***/ "./node_modules/querystring-es3/index.js": 35537 /*!***********************************************!*\ 35538 !*** ./node_modules/querystring-es3/index.js ***! 35539 \***********************************************/ 35540 /*! no static exports found */ 35541 /***/ (function(module, exports, __webpack_require__) { 35542 35543 "use strict"; 35544 35545 35546 exports.decode = exports.parse = __webpack_require__(/*! ./decode */ "./node_modules/querystring-es3/decode.js"); 35547 exports.encode = exports.stringify = __webpack_require__(/*! ./encode */ "./node_modules/querystring-es3/encode.js"); 35548 35549 35550 /***/ }), 35551 35552 /***/ "./node_modules/react-autosize-textarea/lib/TextareaAutosize.js": 35553 /*!**********************************************************************!*\ 35554 !*** ./node_modules/react-autosize-textarea/lib/TextareaAutosize.js ***! 35555 \**********************************************************************/ 35556 /*! no static exports found */ 35557 /***/ (function(module, exports, __webpack_require__) { 35558 35559 "use strict"; 35560 35561 var __extends = (this && this.__extends) || (function () { 35562 var extendStatics = Object.setPrototypeOf || 35563 ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || 35564 function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; 35565 return function (d, b) { 35566 extendStatics(d, b); 35567 function __() { this.constructor = d; } 35568 d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); 35569 }; 35570 })(); 35571 var __assign = (this && this.__assign) || Object.assign || function(t) { 35572 for (var s, i = 1, n = arguments.length; i < n; i++) { 35573 s = arguments[i]; 35574 for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) 35575 t[p] = s[p]; 35576 } 35577 return t; 35578 }; 35579 var __rest = (this && this.__rest) || function (s, e) { 35580 var t = {}; 35581 for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) 35582 t[p] = s[p]; 35583 if (s != null && typeof Object.getOwnPropertySymbols === "function") 35584 for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0) 35585 t[p[i]] = s[p[i]]; 35586 return t; 35587 }; 35588 exports.__esModule = true; 35589 var React = __webpack_require__(/*! react */ "react"); 35590 var PropTypes = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); 35591 var autosize = __webpack_require__(/*! autosize */ "./node_modules/autosize/dist/autosize.js"); 35592 var _getLineHeight = __webpack_require__(/*! line-height */ "./node_modules/line-height/lib/line-height.js"); 35593 var getLineHeight = _getLineHeight; 35594 var UPDATE = 'autosize:update'; 35595 var DESTROY = 'autosize:destroy'; 35596 var RESIZED = 'autosize:resized'; 35597 /** 35598 * A light replacement for built-in textarea component 35599 * which automaticaly adjusts its height to match the content 35600 */ 35601 var TextareaAutosize = /** @class */ (function (_super) { 35602 __extends(TextareaAutosize, _super); 35603 function TextareaAutosize() { 35604 var _this = _super !== null && _super.apply(this, arguments) || this; 35605 _this.state = { 35606 lineHeight: null 35607 }; 35608 _this.dispatchEvent = function (EVENT_TYPE) { 35609 var event = document.createEvent('Event'); 35610 event.initEvent(EVENT_TYPE, true, false); 35611 _this.textarea.dispatchEvent(event); 35612 }; 35613 _this.updateLineHeight = function () { 35614 _this.setState({ 35615 lineHeight: getLineHeight(_this.textarea) 35616 }); 35617 }; 35618 _this.onChange = function (e) { 35619 var onChange = _this.props.onChange; 35620 _this.currentValue = e.currentTarget.value; 35621 onChange && onChange(e); 35622 }; 35623 _this.saveDOMNodeRef = function (ref) { 35624 var innerRef = _this.props.innerRef; 35625 if (innerRef) { 35626 innerRef(ref); 35627 } 35628 _this.textarea = ref; 35629 }; 35630 _this.getLocals = function () { 35631 var _a = _this, _b = _a.props, onResize = _b.onResize, maxRows = _b.maxRows, onChange = _b.onChange, style = _b.style, innerRef = _b.innerRef, props = __rest(_b, ["onResize", "maxRows", "onChange", "style", "innerRef"]), lineHeight = _a.state.lineHeight, saveDOMNodeRef = _a.saveDOMNodeRef; 35632 var maxHeight = maxRows && lineHeight ? lineHeight * maxRows : null; 35633 return __assign({}, props, { saveDOMNodeRef: saveDOMNodeRef, style: maxHeight ? __assign({}, style, { maxHeight: maxHeight }) : style, onChange: _this.onChange }); 35634 }; 35635 return _this; 35636 } 35637 TextareaAutosize.prototype.componentDidMount = function () { 35638 var _this = this; 35639 var _a = this.props, onResize = _a.onResize, maxRows = _a.maxRows; 35640 if (typeof maxRows === 'number') { 35641 this.updateLineHeight(); 35642 } 35643 /* 35644 the defer is needed to: 35645 - force "autosize" to activate the scrollbar when this.props.maxRows is passed 35646 - support StyledComponents (see #71) 35647 */ 35648 setTimeout(function () { return autosize(_this.textarea); }); 35649 if (onResize) { 35650 this.textarea.addEventListener(RESIZED, onResize); 35651 } 35652 }; 35653 TextareaAutosize.prototype.componentWillUnmount = function () { 35654 var onResize = this.props.onResize; 35655 if (onResize) { 35656 this.textarea.removeEventListener(RESIZED, onResize); 35657 } 35658 this.dispatchEvent(DESTROY); 35659 }; 35660 TextareaAutosize.prototype.render = function () { 35661 var _a = this.getLocals(), children = _a.children, saveDOMNodeRef = _a.saveDOMNodeRef, locals = __rest(_a, ["children", "saveDOMNodeRef"]); 35662 return (React.createElement("textarea", __assign({}, locals, { ref: saveDOMNodeRef }), children)); 35663 }; 35664 TextareaAutosize.prototype.componentDidUpdate = function (prevProps) { 35665 if (this.props.value !== this.currentValue || this.props.rows !== prevProps.rows) { 35666 this.dispatchEvent(UPDATE); 35667 } 35668 }; 35669 TextareaAutosize.defaultProps = { 35670 rows: 1 35671 }; 35672 TextareaAutosize.propTypes = { 35673 rows: PropTypes.number, 35674 maxRows: PropTypes.number, 35675 onResize: PropTypes.func, 35676 innerRef: PropTypes.func 35677 }; 35678 return TextareaAutosize; 35679 }(React.Component)); 35680 exports["default"] = TextareaAutosize; 35681 35682 35683 /***/ }), 35684 35685 /***/ "./node_modules/react-autosize-textarea/lib/index.js": 35686 /*!***********************************************************!*\ 35687 !*** ./node_modules/react-autosize-textarea/lib/index.js ***! 35688 \***********************************************************/ 35689 /*! no static exports found */ 35690 /***/ (function(module, exports, __webpack_require__) { 35691 35692 "use strict"; 35693 35694 exports.__esModule = true; 35695 var TextareaAutosize_1 = __webpack_require__(/*! ./TextareaAutosize */ "./node_modules/react-autosize-textarea/lib/TextareaAutosize.js"); 35696 exports["default"] = TextareaAutosize_1["default"]; 35697 35698 35699 /***/ }), 35700 35701 /***/ "./node_modules/redux-multi/lib/index.js": 35702 /*!***********************************************!*\ 35703 !*** ./node_modules/redux-multi/lib/index.js ***! 35704 \***********************************************/ 35705 /*! no static exports found */ 35706 /***/ (function(module, exports, __webpack_require__) { 35707 35708 "use strict"; 35709 35710 35711 Object.defineProperty(exports, "__esModule", { 35712 value: true 35713 }); 35714 /** 35715 * Redux dispatch multiple actions 35716 */ 35717 35718 function multi(_ref) { 35719 var dispatch = _ref.dispatch; 35720 35721 return function (next) { 35722 return function (action) { 35723 return Array.isArray(action) ? action.filter(Boolean).map(dispatch) : next(action); 35724 }; 35725 }; 35726 } 35727 35728 /** 35729 * Exports 35730 */ 35731 35732 exports.default = multi; 35733 35734 /***/ }), 35735 35736 /***/ "./node_modules/redux-optimist/index.js": 35737 /*!**********************************************!*\ 35738 !*** ./node_modules/redux-optimist/index.js ***! 35739 \**********************************************/ 35740 /*! no static exports found */ 35741 /***/ (function(module, exports, __webpack_require__) { 35742 35743 module.exports = __webpack_require__(/*! ./lib/index.js */ "./node_modules/redux-optimist/lib/index.js"); 35744 35745 35746 /***/ }), 35747 35748 /***/ "./node_modules/redux-optimist/lib/index.js": 35749 /*!**************************************************!*\ 35750 !*** ./node_modules/redux-optimist/lib/index.js ***! 35751 \**************************************************/ 35752 /*! no static exports found */ 35753 /***/ (function(module, exports, __webpack_require__) { 35754 35755 "use strict"; 35756 35757 35758 var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; 35759 35760 function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; } 35761 35762 var BEGIN = 'BEGIN'; 35763 var COMMIT = 'COMMIT'; 35764 var REVERT = 'REVERT'; 35765 // Array({transactionID: string or null, beforeState: {object}, action: {object}} 35766 var INITIAL_OPTIMIST = []; 35767 35768 module.exports = optimist; 35769 module.exports.BEGIN = BEGIN; 35770 module.exports.COMMIT = COMMIT; 35771 module.exports.REVERT = REVERT; 35772 function optimist(fn) { 35773 function beginReducer(state, action) { 35774 var _separateState = separateState(state); 35775 35776 var optimist = _separateState.optimist; 35777 var innerState = _separateState.innerState; 35778 35779 optimist = optimist.concat([{ beforeState: innerState, action: action }]); 35780 innerState = fn(innerState, action); 35781 validateState(innerState, action); 35782 return _extends({ optimist: optimist }, innerState); 35783 } 35784 function commitReducer(state, action) { 35785 var _separateState2 = separateState(state); 35786 35787 var optimist = _separateState2.optimist; 35788 var innerState = _separateState2.innerState; 35789 35790 var newOptimist = [], 35791 started = false, 35792 committed = false; 35793 optimist.forEach(function (entry) { 35794 if (started) { 35795 if (entry.beforeState && matchesTransaction(entry.action, action.optimist.id)) { 35796 committed = true; 35797 newOptimist.push({ action: entry.action }); 35798 } else { 35799 newOptimist.push(entry); 35800 } 35801 } else if (entry.beforeState && !matchesTransaction(entry.action, action.optimist.id)) { 35802 started = true; 35803 newOptimist.push(entry); 35804 } else if (entry.beforeState && matchesTransaction(entry.action, action.optimist.id)) { 35805 committed = true; 35806 } 35807 }); 35808 if (!committed) { 35809 console.error('Cannot commit transaction with id "' + action.optimist.id + '" because it does not exist'); 35810 } 35811 optimist = newOptimist; 35812 return baseReducer(optimist, innerState, action); 35813 } 35814 function revertReducer(state, action) { 35815 var _separateState3 = separateState(state); 35816 35817 var optimist = _separateState3.optimist; 35818 var innerState = _separateState3.innerState; 35819 35820 var newOptimist = [], 35821 started = false, 35822 gotInitialState = false, 35823 currentState = innerState; 35824 optimist.forEach(function (entry) { 35825 if (entry.beforeState && matchesTransaction(entry.action, action.optimist.id)) { 35826 currentState = entry.beforeState; 35827 gotInitialState = true; 35828 } 35829 if (!matchesTransaction(entry.action, action.optimist.id)) { 35830 if (entry.beforeState) { 35831 started = true; 35832 } 35833 if (started) { 35834 if (gotInitialState && entry.beforeState) { 35835 newOptimist.push({ 35836 beforeState: currentState, 35837 action: entry.action 35838 }); 35839 } else { 35840 newOptimist.push(entry); 35841 } 35842 } 35843 if (gotInitialState) { 35844 currentState = fn(currentState, entry.action); 35845 validateState(innerState, action); 35846 } 35847 } 35848 }); 35849 if (!gotInitialState) { 35850 console.error('Cannot revert transaction with id "' + action.optimist.id + '" because it does not exist'); 35851 } 35852 optimist = newOptimist; 35853 return baseReducer(optimist, currentState, action); 35854 } 35855 function baseReducer(optimist, innerState, action) { 35856 if (optimist.length) { 35857 optimist = optimist.concat([{ action: action }]); 35858 } 35859 innerState = fn(innerState, action); 35860 validateState(innerState, action); 35861 return _extends({ optimist: optimist }, innerState); 35862 } 35863 return function (state, action) { 35864 if (action.optimist) { 35865 switch (action.optimist.type) { 35866 case BEGIN: 35867 return beginReducer(state, action); 35868 case COMMIT: 35869 return commitReducer(state, action); 35870 case REVERT: 35871 return revertReducer(state, action); 35872 } 35873 } 35874 35875 var _separateState4 = separateState(state); 35876 35877 var optimist = _separateState4.optimist; 35878 var innerState = _separateState4.innerState; 35879 35880 if (state && !optimist.length) { 35881 var nextState = fn(innerState, action); 35882 if (nextState === innerState) { 35883 return state; 35884 } 35885 validateState(nextState, action); 35886 return _extends({ optimist: optimist }, nextState); 35887 } 35888 return baseReducer(optimist, innerState, action); 35889 }; 35890 } 35891 35892 function matchesTransaction(action, id) { 35893 return action.optimist && action.optimist.id === id; 35894 } 35895 35896 function validateState(newState, action) { 35897 if (!newState || typeof newState !== 'object' || Array.isArray(newState)) { 35898 throw new TypeError('Error while handling "' + action.type + '": Optimist requires that state is always a plain object.'); 35899 } 35900 } 35901 35902 function separateState(state) { 35903 if (!state) { 35904 return { optimist: INITIAL_OPTIMIST, innerState: state }; 35905 } else { 35906 var _state$optimist = state.optimist; 35907 35908 var _optimist = _state$optimist === undefined ? INITIAL_OPTIMIST : _state$optimist; 35909 35910 var innerState = _objectWithoutProperties(state, ['optimist']); 35911 35912 return { optimist: _optimist, innerState: innerState }; 35913 } 35914 } 35915 35916 /***/ }), 35917 35918 /***/ "./node_modules/refx/refx.js": 35919 /*!***********************************!*\ 35920 !*** ./node_modules/refx/refx.js ***! 35921 \***********************************/ 35922 /*! no static exports found */ 35923 /***/ (function(module, exports, __webpack_require__) { 35924 35925 "use strict"; 35926 35927 35928 function flattenIntoMap( map, effects ) { 35929 var i; 35930 if ( Array.isArray( effects ) ) { 35931 for ( i = 0; i < effects.length; i++ ) { 35932 flattenIntoMap( map, effects[ i ] ); 35933 } 35934 } else { 35935 for ( i in effects ) { 35936 map[ i ] = ( map[ i ] || [] ).concat( effects[ i ] ); 35937 } 35938 } 35939 } 35940 35941 function refx( effects ) { 35942 var map = {}, 35943 middleware; 35944 35945 flattenIntoMap( map, effects ); 35946 35947 middleware = function( store ) { 35948 return function( next ) { 35949 return function( action ) { 35950 var handlers = map[ action.type ], 35951 result = next( action ), 35952 i, handlerAction; 35953 35954 if ( handlers ) { 35955 for ( i = 0; i < handlers.length; i++ ) { 35956 handlerAction = handlers[ i ]( action, store ); 35957 if ( handlerAction ) { 35958 store.dispatch( handlerAction ); 35959 } 35960 } 35961 } 35962 35963 return result; 35964 }; 35965 }; 35966 }; 35967 35968 middleware.effects = map; 35969 35970 return middleware; 35971 } 35972 35973 module.exports = refx; 35974 35975 35976 /***/ }), 35977 35978 /***/ "./node_modules/rememo/es/rememo.js": 35979 /*!******************************************!*\ 35980 !*** ./node_modules/rememo/es/rememo.js ***! 35981 \******************************************/ 35982 /*! exports provided: default */ 35983 /***/ (function(module, __webpack_exports__, __webpack_require__) { 35984 35985 "use strict"; 35986 __webpack_require__.r(__webpack_exports__); 35987 35988 35989 var LEAF_KEY, hasWeakMap; 35990 35991 /** 35992 * Arbitrary value used as key for referencing cache object in WeakMap tree. 35993 * 35994 * @type {Object} 35995 */ 35996 LEAF_KEY = {}; 35997 35998 /** 35999 * Whether environment supports WeakMap. 36000 * 36001 * @type {boolean} 36002 */ 36003 hasWeakMap = typeof WeakMap !== 'undefined'; 36004 36005 /** 36006 * Returns the first argument as the sole entry in an array. 36007 * 36008 * @param {*} value Value to return. 36009 * 36010 * @return {Array} Value returned as entry in array. 36011 */ 36012 function arrayOf( value ) { 36013 return [ value ]; 36014 } 36015 36016 /** 36017 * Returns true if the value passed is object-like, or false otherwise. A value 36018 * is object-like if it can support property assignment, e.g. object or array. 36019 * 36020 * @param {*} value Value to test. 36021 * 36022 * @return {boolean} Whether value is object-like. 36023 */ 36024 function isObjectLike( value ) { 36025 return !! value && 'object' === typeof value; 36026 } 36027 36028 /** 36029 * Creates and returns a new cache object. 36030 * 36031 * @return {Object} Cache object. 36032 */ 36033 function createCache() { 36034 var cache = { 36035 clear: function() { 36036 cache.head = null; 36037 }, 36038 }; 36039 36040 return cache; 36041 } 36042 36043 /** 36044 * Returns true if entries within the two arrays are strictly equal by 36045 * reference from a starting index. 36046 * 36047 * @param {Array} a First array. 36048 * @param {Array} b Second array. 36049 * @param {number} fromIndex Index from which to start comparison. 36050 * 36051 * @return {boolean} Whether arrays are shallowly equal. 36052 */ 36053 function isShallowEqual( a, b, fromIndex ) { 36054 var i; 36055 36056 if ( a.length !== b.length ) { 36057 return false; 36058 } 36059 36060 for ( i = fromIndex; i < a.length; i++ ) { 36061 if ( a[ i ] !== b[ i ] ) { 36062 return false; 36063 } 36064 } 36065 36066 return true; 36067 } 36068 36069 /** 36070 * Returns a memoized selector function. The getDependants function argument is 36071 * called before the memoized selector and is expected to return an immutable 36072 * reference or array of references on which the selector depends for computing 36073 * its own return value. The memoize cache is preserved only as long as those 36074 * dependant references remain the same. If getDependants returns a different 36075 * reference(s), the cache is cleared and the selector value regenerated. 36076 * 36077 * @param {Function} selector Selector function. 36078 * @param {Function} getDependants Dependant getter returning an immutable 36079 * reference or array of reference used in 36080 * cache bust consideration. 36081 * 36082 * @return {Function} Memoized selector. 36083 */ 36084 /* harmony default export */ __webpack_exports__["default"] = (function( selector, getDependants ) { 36085 var rootCache, getCache; 36086 36087 // Use object source as dependant if getter not provided 36088 if ( ! getDependants ) { 36089 getDependants = arrayOf; 36090 } 36091 36092 /** 36093 * Returns the root cache. If WeakMap is supported, this is assigned to the 36094 * root WeakMap cache set, otherwise it is a shared instance of the default 36095 * cache object. 36096 * 36097 * @return {(WeakMap|Object)} Root cache object. 36098 */ 36099 function getRootCache() { 36100 return rootCache; 36101 } 36102 36103 /** 36104 * Returns the cache for a given dependants array. When possible, a WeakMap 36105 * will be used to create a unique cache for each set of dependants. This 36106 * is feasible due to the nature of WeakMap in allowing garbage collection 36107 * to occur on entries where the key object is no longer referenced. Since 36108 * WeakMap requires the key to be an object, this is only possible when the 36109 * dependant is object-like. The root cache is created as a hierarchy where 36110 * each top-level key is the first entry in a dependants set, the value a 36111 * WeakMap where each key is the next dependant, and so on. This continues 36112 * so long as the dependants are object-like. If no dependants are object- 36113 * like, then the cache is shared across all invocations. 36114 * 36115 * @see isObjectLike 36116 * 36117 * @param {Array} dependants Selector dependants. 36118 * 36119 * @return {Object} Cache object. 36120 */ 36121 function getWeakMapCache( dependants ) { 36122 var caches = rootCache, 36123 isUniqueByDependants = true, 36124 i, dependant, map, cache; 36125 36126 for ( i = 0; i < dependants.length; i++ ) { 36127 dependant = dependants[ i ]; 36128 36129 // Can only compose WeakMap from object-like key. 36130 if ( ! isObjectLike( dependant ) ) { 36131 isUniqueByDependants = false; 36132 break; 36133 } 36134 36135 // Does current segment of cache already have a WeakMap? 36136 if ( caches.has( dependant ) ) { 36137 // Traverse into nested WeakMap. 36138 caches = caches.get( dependant ); 36139 } else { 36140 // Create, set, and traverse into a new one. 36141 map = new WeakMap(); 36142 caches.set( dependant, map ); 36143 caches = map; 36144 } 36145 } 36146 36147 // We use an arbitrary (but consistent) object as key for the last item 36148 // in the WeakMap to serve as our running cache. 36149 if ( ! caches.has( LEAF_KEY ) ) { 36150 cache = createCache(); 36151 cache.isUniqueByDependants = isUniqueByDependants; 36152 caches.set( LEAF_KEY, cache ); 36153 } 36154 36155 return caches.get( LEAF_KEY ); 36156 } 36157 36158 // Assign cache handler by availability of WeakMap 36159 getCache = hasWeakMap ? getWeakMapCache : getRootCache; 36160 36161 /** 36162 * Resets root memoization cache. 36163 */ 36164 function clear() { 36165 rootCache = hasWeakMap ? new WeakMap() : createCache(); 36166 } 36167 36168 // eslint-disable-next-line jsdoc/check-param-names 36169 /** 36170 * The augmented selector call, considering first whether dependants have 36171 * changed before passing it to underlying memoize function. 36172 * 36173 * @param {Object} source Source object for derivation. 36174 * @param {...*} extraArgs Additional arguments to pass to selector. 36175 * 36176 * @return {*} Selector result. 36177 */ 36178 function callSelector( /* source, ...extraArgs */ ) { 36179 var len = arguments.length, 36180 cache, node, i, args, dependants; 36181 36182 // Create copy of arguments (avoid leaking deoptimization). 36183 args = new Array( len ); 36184 for ( i = 0; i < len; i++ ) { 36185 args[ i ] = arguments[ i ]; 36186 } 36187 36188 dependants = getDependants.apply( null, args ); 36189 cache = getCache( dependants ); 36190 36191 // If not guaranteed uniqueness by dependants (primitive type or lack 36192 // of WeakMap support), shallow compare against last dependants and, if 36193 // references have changed, destroy cache to recalculate result. 36194 if ( ! cache.isUniqueByDependants ) { 36195 if ( cache.lastDependants && ! isShallowEqual( dependants, cache.lastDependants, 0 ) ) { 36196 cache.clear(); 36197 } 36198 36199 cache.lastDependants = dependants; 36200 } 36201 36202 node = cache.head; 36203 while ( node ) { 36204 // Check whether node arguments match arguments 36205 if ( ! isShallowEqual( node.args, args, 1 ) ) { 36206 node = node.next; 36207 continue; 36208 } 36209 36210 // At this point we can assume we've found a match 36211 36212 // Surface matched node to head if not already 36213 if ( node !== cache.head ) { 36214 // Adjust siblings to point to each other. 36215 node.prev.next = node.next; 36216 if ( node.next ) { 36217 node.next.prev = node.prev; 36218 } 36219 36220 node.next = cache.head; 36221 node.prev = null; 36222 cache.head.prev = node; 36223 cache.head = node; 36224 } 36225 36226 // Return immediately 36227 return node.val; 36228 } 36229 36230 // No cached value found. Continue to insertion phase: 36231 36232 node = { 36233 // Generate the result from original function 36234 val: selector.apply( null, args ), 36235 }; 36236 36237 // Avoid including the source object in the cache. 36238 args[ 0 ] = null; 36239 node.args = args; 36240 36241 // Don't need to check whether node is already head, since it would 36242 // have been returned above already if it was 36243 36244 // Shift existing head down list 36245 if ( cache.head ) { 36246 cache.head.prev = node; 36247 node.next = cache.head; 36248 } 36249 36250 cache.head = node; 36251 36252 return node.val; 36253 } 36254 36255 callSelector.getDependants = getDependants; 36256 callSelector.clear = clear; 36257 clear(); 36258 36259 return callSelector; 36260 }); 36261 36262 36263 /***/ }), 36264 36265 /***/ "./node_modules/tinycolor2/tinycolor.js": 36266 /*!**********************************************!*\ 36267 !*** ./node_modules/tinycolor2/tinycolor.js ***! 36268 \**********************************************/ 36269 /*! no static exports found */ 36270 /***/ (function(module, exports, __webpack_require__) { 36271 36272 var __WEBPACK_AMD_DEFINE_RESULT__;// TinyColor v1.4.1 36273 // https://github.com/bgrins/TinyColor 36274 // Brian Grinstead, MIT License 36275 36276 (function(Math) { 36277 36278 var trimLeft = /^\s+/, 36279 trimRight = /\s+$/, 36280 tinyCounter = 0, 36281 mathRound = Math.round, 36282 mathMin = Math.min, 36283 mathMax = Math.max, 36284 mathRandom = Math.random; 36285 36286 function tinycolor (color, opts) { 36287 36288 color = (color) ? color : ''; 36289 opts = opts || { }; 36290 36291 // If input is already a tinycolor, return itself 36292 if (color instanceof tinycolor) { 36293 return color; 36294 } 36295 // If we are called as a function, call using new instead 36296 if (!(this instanceof tinycolor)) { 36297 return new tinycolor(color, opts); 36298 } 36299 36300 var rgb = inputToRGB(color); 36301 this._originalInput = color, 36302 this._r = rgb.r, 36303 this._g = rgb.g, 36304 this._b = rgb.b, 36305 this._a = rgb.a, 36306 this._roundA = mathRound(100*this._a) / 100, 36307 this._format = opts.format || rgb.format; 36308 this._gradientType = opts.gradientType; 36309 36310 // Don't let the range of [0,255] come back in [0,1]. 36311 // Potentially lose a little bit of precision here, but will fix issues where 36312 // .5 gets interpreted as half of the total, instead of half of 1 36313 // If it was supposed to be 128, this was already taken care of by `inputToRgb` 36314 if (this._r < 1) { this._r = mathRound(this._r); } 36315 if (this._g < 1) { this._g = mathRound(this._g); } 36316 if (this._b < 1) { this._b = mathRound(this._b); } 36317 36318 this._ok = rgb.ok; 36319 this._tc_id = tinyCounter++; 36320 } 36321 36322 tinycolor.prototype = { 36323 isDark: function() { 36324 return this.getBrightness() < 128; 36325 }, 36326 isLight: function() { 36327 return !this.isDark(); 36328 }, 36329 isValid: function() { 36330 return this._ok; 36331 }, 36332 getOriginalInput: function() { 36333 return this._originalInput; 36334 }, 36335 getFormat: function() { 36336 return this._format; 36337 }, 36338 getAlpha: function() { 36339 return this._a; 36340 }, 36341 getBrightness: function() { 36342 //http://www.w3.org/TR/AERT#color-contrast 36343 var rgb = this.toRgb(); 36344 return (rgb.r * 299 + rgb.g * 587 + rgb.b * 114) / 1000; 36345 }, 36346 getLuminance: function() { 36347 //http://www.w3.org/TR/2008/REC-WCAG20-20081211/#relativeluminancedef 36348 var rgb = this.toRgb(); 36349 var RsRGB, GsRGB, BsRGB, R, G, B; 36350 RsRGB = rgb.r/255; 36351 GsRGB = rgb.g/255; 36352 BsRGB = rgb.b/255; 36353 36354 if (RsRGB <= 0.03928) {R = RsRGB / 12.92;} else {R = Math.pow(((RsRGB + 0.055) / 1.055), 2.4);} 36355 if (GsRGB <= 0.03928) {G = GsRGB / 12.92;} else {G = Math.pow(((GsRGB + 0.055) / 1.055), 2.4);} 36356 if (BsRGB <= 0.03928) {B = BsRGB / 12.92;} else {B = Math.pow(((BsRGB + 0.055) / 1.055), 2.4);} 36357 return (0.2126 * R) + (0.7152 * G) + (0.0722 * B); 36358 }, 36359 setAlpha: function(value) { 36360 this._a = boundAlpha(value); 36361 this._roundA = mathRound(100*this._a) / 100; 36362 return this; 36363 }, 36364 toHsv: function() { 36365 var hsv = rgbToHsv(this._r, this._g, this._b); 36366 return { h: hsv.h * 360, s: hsv.s, v: hsv.v, a: this._a }; 36367 }, 36368 toHsvString: function() { 36369 var hsv = rgbToHsv(this._r, this._g, this._b); 36370 var h = mathRound(hsv.h * 360), s = mathRound(hsv.s * 100), v = mathRound(hsv.v * 100); 36371 return (this._a == 1) ? 36372 "hsv(" + h + ", " + s + "%, " + v + "%)" : 36373 "hsva(" + h + ", " + s + "%, " + v + "%, "+ this._roundA + ")"; 36374 }, 36375 toHsl: function() { 36376 var hsl = rgbToHsl(this._r, this._g, this._b); 36377 return { h: hsl.h * 360, s: hsl.s, l: hsl.l, a: this._a }; 36378 }, 36379 toHslString: function() { 36380 var hsl = rgbToHsl(this._r, this._g, this._b); 36381 var h = mathRound(hsl.h * 360), s = mathRound(hsl.s * 100), l = mathRound(hsl.l * 100); 36382 return (this._a == 1) ? 36383 "hsl(" + h + ", " + s + "%, " + l + "%)" : 36384 "hsla(" + h + ", " + s + "%, " + l + "%, "+ this._roundA + ")"; 36385 }, 36386 toHex: function(allow3Char) { 36387 return rgbToHex(this._r, this._g, this._b, allow3Char); 36388 }, 36389 toHexString: function(allow3Char) { 36390 return '#' + this.toHex(allow3Char); 36391 }, 36392 toHex8: function(allow4Char) { 36393 return rgbaToHex(this._r, this._g, this._b, this._a, allow4Char); 36394 }, 36395 toHex8String: function(allow4Char) { 36396 return '#' + this.toHex8(allow4Char); 36397 }, 36398 toRgb: function() { 36399 return { r: mathRound(this._r), g: mathRound(this._g), b: mathRound(this._b), a: this._a }; 36400 }, 36401 toRgbString: function() { 36402 return (this._a == 1) ? 36403 "rgb(" + mathRound(this._r) + ", " + mathRound(this._g) + ", " + mathRound(this._b) + ")" : 36404 "rgba(" + mathRound(this._r) + ", " + mathRound(this._g) + ", " + mathRound(this._b) + ", " + this._roundA + ")"; 36405 }, 36406 toPercentageRgb: function() { 36407 return { r: mathRound(bound01(this._r, 255) * 100) + "%", g: mathRound(bound01(this._g, 255) * 100) + "%", b: mathRound(bound01(this._b, 255) * 100) + "%", a: this._a }; 36408 }, 36409 toPercentageRgbString: function() { 36410 return (this._a == 1) ? 36411 "rgb(" + mathRound(bound01(this._r, 255) * 100) + "%, " + mathRound(bound01(this._g, 255) * 100) + "%, " + mathRound(bound01(this._b, 255) * 100) + "%)" : 36412 "rgba(" + mathRound(bound01(this._r, 255) * 100) + "%, " + mathRound(bound01(this._g, 255) * 100) + "%, " + mathRound(bound01(this._b, 255) * 100) + "%, " + this._roundA + ")"; 36413 }, 36414 toName: function() { 36415 if (this._a === 0) { 36416 return "transparent"; 36417 } 36418 36419 if (this._a < 1) { 36420 return false; 36421 } 36422 36423 return hexNames[rgbToHex(this._r, this._g, this._b, true)] || false; 36424 }, 36425 toFilter: function(secondColor) { 36426 var hex8String = '#' + rgbaToArgbHex(this._r, this._g, this._b, this._a); 36427 var secondHex8String = hex8String; 36428 var gradientType = this._gradientType ? "GradientType = 1, " : ""; 36429 36430 if (secondColor) { 36431 var s = tinycolor(secondColor); 36432 secondHex8String = '#' + rgbaToArgbHex(s._r, s._g, s._b, s._a); 36433 } 36434 36435 return "progid:DXImageTransform.Microsoft.gradient("+gradientType+"startColorstr="+hex8String+",endColorstr="+secondHex8String+")"; 36436 }, 36437 toString: function(format) { 36438 var formatSet = !!format; 36439 format = format || this._format; 36440 36441 var formattedString = false; 36442 var hasAlpha = this._a < 1 && this._a >= 0; 36443 var needsAlphaFormat = !formatSet && hasAlpha && (format === "hex" || format === "hex6" || format === "hex3" || format === "hex4" || format === "hex8" || format === "name"); 36444 36445 if (needsAlphaFormat) { 36446 // Special case for "transparent", all other non-alpha formats 36447 // will return rgba when there is transparency. 36448 if (format === "name" && this._a === 0) { 36449 return this.toName(); 36450 } 36451 return this.toRgbString(); 36452 } 36453 if (format === "rgb") { 36454 formattedString = this.toRgbString(); 36455 } 36456 if (format === "prgb") { 36457 formattedString = this.toPercentageRgbString(); 36458 } 36459 if (format === "hex" || format === "hex6") { 36460 formattedString = this.toHexString(); 36461 } 36462 if (format === "hex3") { 36463 formattedString = this.toHexString(true); 36464 } 36465 if (format === "hex4") { 36466 formattedString = this.toHex8String(true); 36467 } 36468 if (format === "hex8") { 36469 formattedString = this.toHex8String(); 36470 } 36471 if (format === "name") { 36472 formattedString = this.toName(); 36473 } 36474 if (format === "hsl") { 36475 formattedString = this.toHslString(); 36476 } 36477 if (format === "hsv") { 36478 formattedString = this.toHsvString(); 36479 } 36480 36481 return formattedString || this.toHexString(); 36482 }, 36483 clone: function() { 36484 return tinycolor(this.toString()); 36485 }, 36486 36487 _applyModification: function(fn, args) { 36488 var color = fn.apply(null, [this].concat([].slice.call(args))); 36489 this._r = color._r; 36490 this._g = color._g; 36491 this._b = color._b; 36492 this.setAlpha(color._a); 36493 return this; 36494 }, 36495 lighten: function() { 36496 return this._applyModification(lighten, arguments); 36497 }, 36498 brighten: function() { 36499 return this._applyModification(brighten, arguments); 36500 }, 36501 darken: function() { 36502 return this._applyModification(darken, arguments); 36503 }, 36504 desaturate: function() { 36505 return this._applyModification(desaturate, arguments); 36506 }, 36507 saturate: function() { 36508 return this._applyModification(saturate, arguments); 36509 }, 36510 greyscale: function() { 36511 return this._applyModification(greyscale, arguments); 36512 }, 36513 spin: function() { 36514 return this._applyModification(spin, arguments); 36515 }, 36516 36517 _applyCombination: function(fn, args) { 36518 return fn.apply(null, [this].concat([].slice.call(args))); 36519 }, 36520 analogous: function() { 36521 return this._applyCombination(analogous, arguments); 36522 }, 36523 complement: function() { 36524 return this._applyCombination(complement, arguments); 36525 }, 36526 monochromatic: function() { 36527 return this._applyCombination(monochromatic, arguments); 36528 }, 36529 splitcomplement: function() { 36530 return this._applyCombination(splitcomplement, arguments); 36531 }, 36532 triad: function() { 36533 return this._applyCombination(triad, arguments); 36534 }, 36535 tetrad: function() { 36536 return this._applyCombination(tetrad, arguments); 36537 } 36538 }; 36539 36540 // If input is an object, force 1 into "1.0" to handle ratios properly 36541 // String input requires "1.0" as input, so 1 will be treated as 1 36542 tinycolor.fromRatio = function(color, opts) { 36543 if (typeof color == "object") { 36544 var newColor = {}; 36545 for (var i in color) { 36546 if (color.hasOwnProperty(i)) { 36547 if (i === "a") { 36548 newColor[i] = color[i]; 36549 } 36550 else { 36551 newColor[i] = convertToPercentage(color[i]); 36552 } 36553 } 36554 } 36555 color = newColor; 36556 } 36557 36558 return tinycolor(color, opts); 36559 }; 36560 36561 // Given a string or object, convert that input to RGB 36562 // Possible string inputs: 36563 // 36564 // "red" 36565 // "#f00" or "f00" 36566 // "#ff0000" or "ff0000" 36567 // "#ff000000" or "ff000000" 36568 // "rgb 255 0 0" or "rgb (255, 0, 0)" 36569 // "rgb 1.0 0 0" or "rgb (1, 0, 0)" 36570 // "rgba (255, 0, 0, 1)" or "rgba 255, 0, 0, 1" 36571 // "rgba (1.0, 0, 0, 1)" or "rgba 1.0, 0, 0, 1" 36572 // "hsl(0, 100%, 50%)" or "hsl 0 100% 50%" 36573 // "hsla(0, 100%, 50%, 1)" or "hsla 0 100% 50%, 1" 36574 // "hsv(0, 100%, 100%)" or "hsv 0 100% 100%" 36575 // 36576 function inputToRGB(color) { 36577 36578 var rgb = { r: 0, g: 0, b: 0 }; 36579 var a = 1; 36580 var s = null; 36581 var v = null; 36582 var l = null; 36583 var ok = false; 36584 var format = false; 36585 36586 if (typeof color == "string") { 36587 color = stringInputToObject(color); 36588 } 36589 36590 if (typeof color == "object") { 36591 if (isValidCSSUnit(color.r) && isValidCSSUnit(color.g) && isValidCSSUnit(color.b)) { 36592 rgb = rgbToRgb(color.r, color.g, color.b); 36593 ok = true; 36594 format = String(color.r).substr(-1) === "%" ? "prgb" : "rgb"; 36595 } 36596 else if (isValidCSSUnit(color.h) && isValidCSSUnit(color.s) && isValidCSSUnit(color.v)) { 36597 s = convertToPercentage(color.s); 36598 v = convertToPercentage(color.v); 36599 rgb = hsvToRgb(color.h, s, v); 36600 ok = true; 36601 format = "hsv"; 36602 } 36603 else if (isValidCSSUnit(color.h) && isValidCSSUnit(color.s) && isValidCSSUnit(color.l)) { 36604 s = convertToPercentage(color.s); 36605 l = convertToPercentage(color.l); 36606 rgb = hslToRgb(color.h, s, l); 36607 ok = true; 36608 format = "hsl"; 36609 } 36610 36611 if (color.hasOwnProperty("a")) { 36612 a = color.a; 36613 } 36614 } 36615 36616 a = boundAlpha(a); 36617 36618 return { 36619 ok: ok, 36620 format: color.format || format, 36621 r: mathMin(255, mathMax(rgb.r, 0)), 36622 g: mathMin(255, mathMax(rgb.g, 0)), 36623 b: mathMin(255, mathMax(rgb.b, 0)), 36624 a: a 36625 }; 36626 } 36627 36628 36629 // Conversion Functions 36630 // -------------------- 36631 36632 // `rgbToHsl`, `rgbToHsv`, `hslToRgb`, `hsvToRgb` modified from: 36633 // <http://mjijackson.com/2008/02/rgb-to-hsl-and-rgb-to-hsv-color-model-conversion-algorithms-in-javascript> 36634 36635 // `rgbToRgb` 36636 // Handle bounds / percentage checking to conform to CSS color spec 36637 // <http://www.w3.org/TR/css3-color/> 36638 // *Assumes:* r, g, b in [0, 255] or [0, 1] 36639 // *Returns:* { r, g, b } in [0, 255] 36640 function rgbToRgb(r, g, b){ 36641 return { 36642 r: bound01(r, 255) * 255, 36643 g: bound01(g, 255) * 255, 36644 b: bound01(b, 255) * 255 36645 }; 36646 } 36647 36648 // `rgbToHsl` 36649 // Converts an RGB color value to HSL. 36650 // *Assumes:* r, g, and b are contained in [0, 255] or [0, 1] 36651 // *Returns:* { h, s, l } in [0,1] 36652 function rgbToHsl(r, g, b) { 36653 36654 r = bound01(r, 255); 36655 g = bound01(g, 255); 36656 b = bound01(b, 255); 36657 36658 var max = mathMax(r, g, b), min = mathMin(r, g, b); 36659 var h, s, l = (max + min) / 2; 36660 36661 if(max == min) { 36662 h = s = 0; // achromatic 36663 } 36664 else { 36665 var d = max - min; 36666 s = l > 0.5 ? d / (2 - max - min) : d / (max + min); 36667 switch(max) { 36668 case r: h = (g - b) / d + (g < b ? 6 : 0); break; 36669 case g: h = (b - r) / d + 2; break; 36670 case b: h = (r - g) / d + 4; break; 36671 } 36672 36673 h /= 6; 36674 } 36675 36676 return { h: h, s: s, l: l }; 36677 } 36678 36679 // `hslToRgb` 36680 // Converts an HSL color value to RGB. 36681 // *Assumes:* h is contained in [0, 1] or [0, 360] and s and l are contained [0, 1] or [0, 100] 36682 // *Returns:* { r, g, b } in the set [0, 255] 36683 function hslToRgb(h, s, l) { 36684 var r, g, b; 36685 36686 h = bound01(h, 360); 36687 s = bound01(s, 100); 36688 l = bound01(l, 100); 36689 36690 function hue2rgb(p, q, t) { 36691 if(t < 0) t += 1; 36692 if(t > 1) t -= 1; 36693 if(t < 1/6) return p + (q - p) * 6 * t; 36694 if(t < 1/2) return q; 36695 if(t < 2/3) return p + (q - p) * (2/3 - t) * 6; 36696 return p; 36697 } 36698 36699 if(s === 0) { 36700 r = g = b = l; // achromatic 36701 } 36702 else { 36703 var q = l < 0.5 ? l * (1 + s) : l + s - l * s; 36704 var p = 2 * l - q; 36705 r = hue2rgb(p, q, h + 1/3); 36706 g = hue2rgb(p, q, h); 36707 b = hue2rgb(p, q, h - 1/3); 36708 } 36709 36710 return { r: r * 255, g: g * 255, b: b * 255 }; 36711 } 36712 36713 // `rgbToHsv` 36714 // Converts an RGB color value to HSV 36715 // *Assumes:* r, g, and b are contained in the set [0, 255] or [0, 1] 36716 // *Returns:* { h, s, v } in [0,1] 36717 function rgbToHsv(r, g, b) { 36718 36719 r = bound01(r, 255); 36720 g = bound01(g, 255); 36721 b = bound01(b, 255); 36722 36723 var max = mathMax(r, g, b), min = mathMin(r, g, b); 36724 var h, s, v = max; 36725 36726 var d = max - min; 36727 s = max === 0 ? 0 : d / max; 36728 36729 if(max == min) { 36730 h = 0; // achromatic 36731 } 36732 else { 36733 switch(max) { 36734 case r: h = (g - b) / d + (g < b ? 6 : 0); break; 36735 case g: h = (b - r) / d + 2; break; 36736 case b: h = (r - g) / d + 4; break; 36737 } 36738 h /= 6; 36739 } 36740 return { h: h, s: s, v: v }; 36741 } 36742 36743 // `hsvToRgb` 36744 // Converts an HSV color value to RGB. 36745 // *Assumes:* h is contained in [0, 1] or [0, 360] and s and v are contained in [0, 1] or [0, 100] 36746 // *Returns:* { r, g, b } in the set [0, 255] 36747 function hsvToRgb(h, s, v) { 36748 36749 h = bound01(h, 360) * 6; 36750 s = bound01(s, 100); 36751 v = bound01(v, 100); 36752 36753 var i = Math.floor(h), 36754 f = h - i, 36755 p = v * (1 - s), 36756 q = v * (1 - f * s), 36757 t = v * (1 - (1 - f) * s), 36758 mod = i % 6, 36759 r = [v, q, p, p, t, v][mod], 36760 g = [t, v, v, q, p, p][mod], 36761 b = [p, p, t, v, v, q][mod]; 36762 36763 return { r: r * 255, g: g * 255, b: b * 255 }; 36764 } 36765 36766 // `rgbToHex` 36767 // Converts an RGB color to hex 36768 // Assumes r, g, and b are contained in the set [0, 255] 36769 // Returns a 3 or 6 character hex 36770 function rgbToHex(r, g, b, allow3Char) { 36771 36772 var hex = [ 36773 pad2(mathRound(r).toString(16)), 36774 pad2(mathRound(g).toString(16)), 36775 pad2(mathRound(b).toString(16)) 36776 ]; 36777 36778 // Return a 3 character hex if possible 36779 if (allow3Char && hex[0].charAt(0) == hex[0].charAt(1) && hex[1].charAt(0) == hex[1].charAt(1) && hex[2].charAt(0) == hex[2].charAt(1)) { 36780 return hex[0].charAt(0) + hex[1].charAt(0) + hex[2].charAt(0); 36781 } 36782 36783 return hex.join(""); 36784 } 36785 36786 // `rgbaToHex` 36787 // Converts an RGBA color plus alpha transparency to hex 36788 // Assumes r, g, b are contained in the set [0, 255] and 36789 // a in [0, 1]. Returns a 4 or 8 character rgba hex 36790 function rgbaToHex(r, g, b, a, allow4Char) { 36791 36792 var hex = [ 36793 pad2(mathRound(r).toString(16)), 36794 pad2(mathRound(g).toString(16)), 36795 pad2(mathRound(b).toString(16)), 36796 pad2(convertDecimalToHex(a)) 36797 ]; 36798 36799 // Return a 4 character hex if possible 36800 if (allow4Char && hex[0].charAt(0) == hex[0].charAt(1) && hex[1].charAt(0) == hex[1].charAt(1) && hex[2].charAt(0) == hex[2].charAt(1) && hex[3].charAt(0) == hex[3].charAt(1)) { 36801 return hex[0].charAt(0) + hex[1].charAt(0) + hex[2].charAt(0) + hex[3].charAt(0); 36802 } 36803 36804 return hex.join(""); 36805 } 36806 36807 // `rgbaToArgbHex` 36808 // Converts an RGBA color to an ARGB Hex8 string 36809 // Rarely used, but required for "toFilter()" 36810 function rgbaToArgbHex(r, g, b, a) { 36811 36812 var hex = [ 36813 pad2(convertDecimalToHex(a)), 36814 pad2(mathRound(r).toString(16)), 36815 pad2(mathRound(g).toString(16)), 36816 pad2(mathRound(b).toString(16)) 36817 ]; 36818 36819 return hex.join(""); 36820 } 36821 36822 // `equals` 36823 // Can be called with any tinycolor input 36824 tinycolor.equals = function (color1, color2) { 36825 if (!color1 || !color2) { return false; } 36826 return tinycolor(color1).toRgbString() == tinycolor(color2).toRgbString(); 36827 }; 36828 36829 tinycolor.random = function() { 36830 return tinycolor.fromRatio({ 36831 r: mathRandom(), 36832 g: mathRandom(), 36833 b: mathRandom() 36834 }); 36835 }; 36836 36837 36838 // Modification Functions 36839 // ---------------------- 36840 // Thanks to less.js for some of the basics here 36841 // <https://github.com/cloudhead/less.js/blob/master/lib/less/functions.js> 36842 36843 function desaturate(color, amount) { 36844 amount = (amount === 0) ? 0 : (amount || 10); 36845 var hsl = tinycolor(color).toHsl(); 36846 hsl.s -= amount / 100; 36847 hsl.s = clamp01(hsl.s); 36848 return tinycolor(hsl); 36849 } 36850 36851 function saturate(color, amount) { 36852 amount = (amount === 0) ? 0 : (amount || 10); 36853 var hsl = tinycolor(color).toHsl(); 36854 hsl.s += amount / 100; 36855 hsl.s = clamp01(hsl.s); 36856 return tinycolor(hsl); 36857 } 36858 36859 function greyscale(color) { 36860 return tinycolor(color).desaturate(100); 36861 } 36862 36863 function lighten (color, amount) { 36864 amount = (amount === 0) ? 0 : (amount || 10); 36865 var hsl = tinycolor(color).toHsl(); 36866 hsl.l += amount / 100; 36867 hsl.l = clamp01(hsl.l); 36868 return tinycolor(hsl); 36869 } 36870 36871 function brighten(color, amount) { 36872 amount = (amount === 0) ? 0 : (amount || 10); 36873 var rgb = tinycolor(color).toRgb(); 36874 rgb.r = mathMax(0, mathMin(255, rgb.r - mathRound(255 * - (amount / 100)))); 36875 rgb.g = mathMax(0, mathMin(255, rgb.g - mathRound(255 * - (amount / 100)))); 36876 rgb.b = mathMax(0, mathMin(255, rgb.b - mathRound(255 * - (amount / 100)))); 36877 return tinycolor(rgb); 36878 } 36879 36880 function darken (color, amount) { 36881 amount = (amount === 0) ? 0 : (amount || 10); 36882 var hsl = tinycolor(color).toHsl(); 36883 hsl.l -= amount / 100; 36884 hsl.l = clamp01(hsl.l); 36885 return tinycolor(hsl); 36886 } 36887 36888 // Spin takes a positive or negative amount within [-360, 360] indicating the change of hue. 36889 // Values outside of this range will be wrapped into this range. 36890 function spin(color, amount) { 36891 var hsl = tinycolor(color).toHsl(); 36892 var hue = (hsl.h + amount) % 360; 36893 hsl.h = hue < 0 ? 360 + hue : hue; 36894 return tinycolor(hsl); 36895 } 36896 36897 // Combination Functions 36898 // --------------------- 36899 // Thanks to jQuery xColor for some of the ideas behind these 36900 // <https://github.com/infusion/jQuery-xcolor/blob/master/jquery.xcolor.js> 36901 36902 function complement(color) { 36903 var hsl = tinycolor(color).toHsl(); 36904 hsl.h = (hsl.h + 180) % 360; 36905 return tinycolor(hsl); 36906 } 36907 36908 function triad(color) { 36909 var hsl = tinycolor(color).toHsl(); 36910 var h = hsl.h; 36911 return [ 36912 tinycolor(color), 36913 tinycolor({ h: (h + 120) % 360, s: hsl.s, l: hsl.l }), 36914 tinycolor({ h: (h + 240) % 360, s: hsl.s, l: hsl.l }) 36915 ]; 36916 } 36917 36918 function tetrad(color) { 36919 var hsl = tinycolor(color).toHsl(); 36920 var h = hsl.h; 36921 return [ 36922 tinycolor(color), 36923 tinycolor({ h: (h + 90) % 360, s: hsl.s, l: hsl.l }), 36924 tinycolor({ h: (h + 180) % 360, s: hsl.s, l: hsl.l }), 36925 tinycolor({ h: (h + 270) % 360, s: hsl.s, l: hsl.l }) 36926 ]; 36927 } 36928 36929 function splitcomplement(color) { 36930 var hsl = tinycolor(color).toHsl(); 36931 var h = hsl.h; 36932 return [ 36933 tinycolor(color), 36934 tinycolor({ h: (h + 72) % 360, s: hsl.s, l: hsl.l}), 36935 tinycolor({ h: (h + 216) % 360, s: hsl.s, l: hsl.l}) 36936 ]; 36937 } 36938 36939 function analogous(color, results, slices) { 36940 results = results || 6; 36941 slices = slices || 30; 36942 36943 var hsl = tinycolor(color).toHsl(); 36944 var part = 360 / slices; 36945 var ret = [tinycolor(color)]; 36946 36947 for (hsl.h = ((hsl.h - (part * results >> 1)) + 720) % 360; --results; ) { 36948 hsl.h = (hsl.h + part) % 360; 36949 ret.push(tinycolor(hsl)); 36950 } 36951 return ret; 36952 } 36953 36954 function monochromatic(color, results) { 36955 results = results || 6; 36956 var hsv = tinycolor(color).toHsv(); 36957 var h = hsv.h, s = hsv.s, v = hsv.v; 36958 var ret = []; 36959 var modification = 1 / results; 36960 36961 while (results--) { 36962 ret.push(tinycolor({ h: h, s: s, v: v})); 36963 v = (v + modification) % 1; 36964 } 36965 36966 return ret; 36967 } 36968 36969 // Utility Functions 36970 // --------------------- 36971 36972 tinycolor.mix = function(color1, color2, amount) { 36973 amount = (amount === 0) ? 0 : (amount || 50); 36974 36975 var rgb1 = tinycolor(color1).toRgb(); 36976 var rgb2 = tinycolor(color2).toRgb(); 36977 36978 var p = amount / 100; 36979 36980 var rgba = { 36981 r: ((rgb2.r - rgb1.r) * p) + rgb1.r, 36982 g: ((rgb2.g - rgb1.g) * p) + rgb1.g, 36983 b: ((rgb2.b - rgb1.b) * p) + rgb1.b, 36984 a: ((rgb2.a - rgb1.a) * p) + rgb1.a 36985 }; 36986 36987 return tinycolor(rgba); 36988 }; 36989 36990 36991 // Readability Functions 36992 // --------------------- 36993 // <http://www.w3.org/TR/2008/REC-WCAG20-20081211/#contrast-ratiodef (WCAG Version 2) 36994 36995 // `contrast` 36996 // Analyze the 2 colors and returns the color contrast defined by (WCAG Version 2) 36997 tinycolor.readability = function(color1, color2) { 36998 var c1 = tinycolor(color1); 36999 var c2 = tinycolor(color2); 37000 return (Math.max(c1.getLuminance(),c2.getLuminance())+0.05) / (Math.min(c1.getLuminance(),c2.getLuminance())+0.05); 37001 }; 37002 37003 // `isReadable` 37004 // Ensure that foreground and background color combinations meet WCAG2 guidelines. 37005 // The third argument is an optional Object. 37006 // the 'level' property states 'AA' or 'AAA' - if missing or invalid, it defaults to 'AA'; 37007 // the 'size' property states 'large' or 'small' - if missing or invalid, it defaults to 'small'. 37008 // If the entire object is absent, isReadable defaults to {level:"AA",size:"small"}. 37009 37010 // *Example* 37011 // tinycolor.isReadable("#000", "#111") => false 37012 // tinycolor.isReadable("#000", "#111",{level:"AA",size:"large"}) => false 37013 tinycolor.isReadable = function(color1, color2, wcag2) { 37014 var readability = tinycolor.readability(color1, color2); 37015 var wcag2Parms, out; 37016 37017 out = false; 37018 37019 wcag2Parms = validateWCAG2Parms(wcag2); 37020 switch (wcag2Parms.level + wcag2Parms.size) { 37021 case "AAsmall": 37022 case "AAAlarge": 37023 out = readability >= 4.5; 37024 break; 37025 case "AAlarge": 37026 out = readability >= 3; 37027 break; 37028 case "AAAsmall": 37029 out = readability >= 7; 37030 break; 37031 } 37032 return out; 37033 37034 }; 37035 37036 // `mostReadable` 37037 // Given a base color and a list of possible foreground or background 37038 // colors for that base, returns the most readable color. 37039 // Optionally returns Black or White if the most readable color is unreadable. 37040 // *Example* 37041 // tinycolor.mostReadable(tinycolor.mostReadable("#123", ["#124", "#125"],{includeFallbackColors:false}).toHexString(); // "#112255" 37042 // tinycolor.mostReadable(tinycolor.mostReadable("#123", ["#124", "#125"],{includeFallbackColors:true}).toHexString(); // "#ffffff" 37043 // tinycolor.mostReadable("#a8015a", ["#faf3f3"],{includeFallbackColors:true,level:"AAA",size:"large"}).toHexString(); // "#faf3f3" 37044 // tinycolor.mostReadable("#a8015a", ["#faf3f3"],{includeFallbackColors:true,level:"AAA",size:"small"}).toHexString(); // "#ffffff" 37045 tinycolor.mostReadable = function(baseColor, colorList, args) { 37046 var bestColor = null; 37047 var bestScore = 0; 37048 var readability; 37049 var includeFallbackColors, level, size ; 37050 args = args || {}; 37051 includeFallbackColors = args.includeFallbackColors ; 37052 level = args.level; 37053 size = args.size; 37054 37055 for (var i= 0; i < colorList.length ; i++) { 37056 readability = tinycolor.readability(baseColor, colorList[i]); 37057 if (readability > bestScore) { 37058 bestScore = readability; 37059 bestColor = tinycolor(colorList[i]); 37060 } 37061 } 37062 37063 if (tinycolor.isReadable(baseColor, bestColor, {"level":level,"size":size}) || !includeFallbackColors) { 37064 return bestColor; 37065 } 37066 else { 37067 args.includeFallbackColors=false; 37068 return tinycolor.mostReadable(baseColor,["#fff", "#000"],args); 37069 } 37070 }; 37071 37072 37073 // Big List of Colors 37074 // ------------------ 37075 // <http://www.w3.org/TR/css3-color/#svg-color> 37076 var names = tinycolor.names = { 37077 aliceblue: "f0f8ff", 37078 antiquewhite: "faebd7", 37079 aqua: "0ff", 37080 aquamarine: "7fffd4", 37081 azure: "f0ffff", 37082 beige: "f5f5dc", 37083 bisque: "ffe4c4", 37084 black: "000", 37085 blanchedalmond: "ffebcd", 37086 blue: "00f", 37087 blueviolet: "8a2be2", 37088 brown: "a52a2a", 37089 burlywood: "deb887", 37090 burntsienna: "ea7e5d", 37091 cadetblue: "5f9ea0", 37092 chartreuse: "7fff00", 37093 chocolate: "d2691e", 37094 coral: "ff7f50", 37095 cornflowerblue: "6495ed", 37096 cornsilk: "fff8dc", 37097 crimson: "dc143c", 37098 cyan: "0ff", 37099 darkblue: "00008b", 37100 darkcyan: "008b8b", 37101 darkgoldenrod: "b8860b", 37102 darkgray: "a9a9a9", 37103 darkgreen: "006400", 37104 darkgrey: "a9a9a9", 37105 darkkhaki: "bdb76b", 37106 darkmagenta: "8b008b", 37107 darkolivegreen: "556b2f", 37108 darkorange: "ff8c00", 37109 darkorchid: "9932cc", 37110 darkred: "8b0000", 37111 darksalmon: "e9967a", 37112 darkseagreen: "8fbc8f", 37113 darkslateblue: "483d8b", 37114 darkslategray: "2f4f4f", 37115 darkslategrey: "2f4f4f", 37116 darkturquoise: "00ced1", 37117 darkviolet: "9400d3", 37118 deeppink: "ff1493", 37119 deepskyblue: "00bfff", 37120 dimgray: "696969", 37121 dimgrey: "696969", 37122 dodgerblue: "1e90ff", 37123 firebrick: "b22222", 37124 floralwhite: "fffaf0", 37125 forestgreen: "228b22", 37126 fuchsia: "f0f", 37127 gainsboro: "dcdcdc", 37128 ghostwhite: "f8f8ff", 37129 gold: "ffd700", 37130 goldenrod: "daa520", 37131 gray: "808080", 37132 green: "008000", 37133 greenyellow: "adff2f", 37134 grey: "808080", 37135 honeydew: "f0fff0", 37136 hotpink: "ff69b4", 37137 indianred: "cd5c5c", 37138 indigo: "4b0082", 37139 ivory: "fffff0", 37140 khaki: "f0e68c", 37141 lavender: "e6e6fa", 37142 lavenderblush: "fff0f5", 37143 lawngreen: "7cfc00", 37144 lemonchiffon: "fffacd", 37145 lightblue: "add8e6", 37146 lightcoral: "f08080", 37147 lightcyan: "e0ffff", 37148 lightgoldenrodyellow: "fafad2", 37149 lightgray: "d3d3d3", 37150 lightgreen: "90ee90", 37151 lightgrey: "d3d3d3", 37152 lightpink: "ffb6c1", 37153 lightsalmon: "ffa07a", 37154 lightseagreen: "20b2aa", 37155 lightskyblue: "87cefa", 37156 lightslategray: "789", 37157 lightslategrey: "789", 37158 lightsteelblue: "b0c4de", 37159 lightyellow: "ffffe0", 37160 lime: "0f0", 37161 limegreen: "32cd32", 37162 linen: "faf0e6", 37163 magenta: "f0f", 37164 maroon: "800000", 37165 mediumaquamarine: "66cdaa", 37166 mediumblue: "0000cd", 37167 mediumorchid: "ba55d3", 37168 mediumpurple: "9370db", 37169 mediumseagreen: "3cb371", 37170 mediumslateblue: "7b68ee", 37171 mediumspringgreen: "00fa9a", 37172 mediumturquoise: "48d1cc", 37173 mediumvioletred: "c71585", 37174 midnightblue: "191970", 37175 mintcream: "f5fffa", 37176 mistyrose: "ffe4e1", 37177 moccasin: "ffe4b5", 37178 navajowhite: "ffdead", 37179 navy: "000080", 37180 oldlace: "fdf5e6", 37181 olive: "808000", 37182 olivedrab: "6b8e23", 37183 orange: "ffa500", 37184 orangered: "ff4500", 37185 orchid: "da70d6", 37186 palegoldenrod: "eee8aa", 37187 palegreen: "98fb98", 37188 paleturquoise: "afeeee", 37189 palevioletred: "db7093", 37190 papayawhip: "ffefd5", 37191 peachpuff: "ffdab9", 37192 peru: "cd853f", 37193 pink: "ffc0cb", 37194 plum: "dda0dd", 37195 powderblue: "b0e0e6", 37196 purple: "800080", 37197 rebeccapurple: "663399", 37198 red: "f00", 37199 rosybrown: "bc8f8f", 37200 royalblue: "4169e1", 37201 saddlebrown: "8b4513", 37202 salmon: "fa8072", 37203 sandybrown: "f4a460", 37204 seagreen: "2e8b57", 37205 seashell: "fff5ee", 37206 sienna: "a0522d", 37207 silver: "c0c0c0", 37208 skyblue: "87ceeb", 37209 slateblue: "6a5acd", 37210 slategray: "708090", 37211 slategrey: "708090", 37212 snow: "fffafa", 37213 springgreen: "00ff7f", 37214 steelblue: "4682b4", 37215 tan: "d2b48c", 37216 teal: "008080", 37217 thistle: "d8bfd8", 37218 tomato: "ff6347", 37219 turquoise: "40e0d0", 37220 violet: "ee82ee", 37221 wheat: "f5deb3", 37222 white: "fff", 37223 whitesmoke: "f5f5f5", 37224 yellow: "ff0", 37225 yellowgreen: "9acd32" 37226 }; 37227 37228 // Make it easy to access colors via `hexNames[hex]` 37229 var hexNames = tinycolor.hexNames = flip(names); 37230 37231 37232 // Utilities 37233 // --------- 37234 37235 // `{ 'name1': 'val1' }` becomes `{ 'val1': 'name1' }` 37236 function flip(o) { 37237 var flipped = { }; 37238 for (var i in o) { 37239 if (o.hasOwnProperty(i)) { 37240 flipped[o[i]] = i; 37241 } 37242 } 37243 return flipped; 37244 } 37245 37246 // Return a valid alpha value [0,1] with all invalid values being set to 1 37247 function boundAlpha(a) { 37248 a = parseFloat(a); 37249 37250 if (isNaN(a) || a < 0 || a > 1) { 37251 a = 1; 37252 } 37253 37254 return a; 37255 } 37256 37257 // Take input from [0, n] and return it as [0, 1] 37258 function bound01(n, max) { 37259 if (isOnePointZero(n)) { n = "100%"; } 37260 37261 var processPercent = isPercentage(n); 37262 n = mathMin(max, mathMax(0, parseFloat(n))); 37263 37264 // Automatically convert percentage into number 37265 if (processPercent) { 37266 n = parseInt(n * max, 10) / 100; 37267 } 37268 37269 // Handle floating point rounding errors 37270 if ((Math.abs(n - max) < 0.000001)) { 37271 return 1; 37272 } 37273 37274 // Convert into [0, 1] range if it isn't already 37275 return (n % max) / parseFloat(max); 37276 } 37277 37278 // Force a number between 0 and 1 37279 function clamp01(val) { 37280 return mathMin(1, mathMax(0, val)); 37281 } 37282 37283 // Parse a base-16 hex value into a base-10 integer 37284 function parseIntFromHex(val) { 37285 return parseInt(val, 16); 37286 } 37287 37288 // Need to handle 1.0 as 100%, since once it is a number, there is no difference between it and 1 37289 // <http://stackoverflow.com/questions/7422072/javascript-how-to-detect-number-as-a-decimal-including-1-0> 37290 function isOnePointZero(n) { 37291 return typeof n == "string" && n.indexOf('.') != -1 && parseFloat(n) === 1; 37292 } 37293 37294 // Check to see if string passed in is a percentage 37295 function isPercentage(n) { 37296 return typeof n === "string" && n.indexOf('%') != -1; 37297 } 37298 37299 // Force a hex value to have 2 characters 37300 function pad2(c) { 37301 return c.length == 1 ? '0' + c : '' + c; 37302 } 37303 37304 // Replace a decimal with it's percentage value 37305 function convertToPercentage(n) { 37306 if (n <= 1) { 37307 n = (n * 100) + "%"; 37308 } 37309 37310 return n; 37311 } 37312 37313 // Converts a decimal to a hex value 37314 function convertDecimalToHex(d) { 37315 return Math.round(parseFloat(d) * 255).toString(16); 37316 } 37317 // Converts a hex value to a decimal 37318 function convertHexToDecimal(h) { 37319 return (parseIntFromHex(h) / 255); 37320 } 37321 37322 var matchers = (function() { 37323 37324 // <http://www.w3.org/TR/css3-values/#integers> 37325 var CSS_INTEGER = "[-\\+]?\\d+%?"; 37326 37327 // <http://www.w3.org/TR/css3-values/#number-value> 37328 var CSS_NUMBER = "[-\\+]?\\d*\\.\\d+%?"; 37329 37330 // Allow positive/negative integer/number. Don't capture the either/or, just the entire outcome. 37331 var CSS_UNIT = "(?:" + CSS_NUMBER + ")|(?:" + CSS_INTEGER + ")"; 37332 37333 // Actual matching. 37334 // Parentheses and commas are optional, but not required. 37335 // Whitespace can take the place of commas or opening paren 37336 var PERMISSIVE_MATCH3 = "[\\s|\\(]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")\\s*\\)?"; 37337 var PERMISSIVE_MATCH4 = "[\\s|\\(]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")\\s*\\)?"; 37338 37339 return { 37340 CSS_UNIT: new RegExp(CSS_UNIT), 37341 rgb: new RegExp("rgb" + PERMISSIVE_MATCH3), 37342 rgba: new RegExp("rgba" + PERMISSIVE_MATCH4), 37343 hsl: new RegExp("hsl" + PERMISSIVE_MATCH3), 37344 hsla: new RegExp("hsla" + PERMISSIVE_MATCH4), 37345 hsv: new RegExp("hsv" + PERMISSIVE_MATCH3), 37346 hsva: new RegExp("hsva" + PERMISSIVE_MATCH4), 37347 hex3: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/, 37348 hex6: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/, 37349 hex4: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/, 37350 hex8: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/ 37351 }; 37352 })(); 37353 37354 // `isValidCSSUnit` 37355 // Take in a single string / number and check to see if it looks like a CSS unit 37356 // (see `matchers` above for definition). 37357 function isValidCSSUnit(color) { 37358 return !!matchers.CSS_UNIT.exec(color); 37359 } 37360 37361 // `stringInputToObject` 37362 // Permissive string parsing. Take in a number of formats, and output an object 37363 // based on detected format. Returns `{ r, g, b }` or `{ h, s, l }` or `{ h, s, v}` 37364 function stringInputToObject(color) { 37365 37366 color = color.replace(trimLeft,'').replace(trimRight, '').toLowerCase(); 37367 var named = false; 37368 if (names[color]) { 37369 color = names[color]; 37370 named = true; 37371 } 37372 else if (color == 'transparent') { 37373 return { r: 0, g: 0, b: 0, a: 0, format: "name" }; 37374 } 37375 37376 // Try to match string input using regular expressions. 37377 // Keep most of the number bounding out of this function - don't worry about [0,1] or [0,100] or [0,360] 37378 // Just return an object and let the conversion functions handle that. 37379 // This way the result will be the same whether the tinycolor is initialized with string or object. 37380 var match; 37381 if ((match = matchers.rgb.exec(color))) { 37382 return { r: match[1], g: match[2], b: match[3] }; 37383 } 37384 if ((match = matchers.rgba.exec(color))) { 37385 return { r: match[1], g: match[2], b: match[3], a: match[4] }; 37386 } 37387 if ((match = matchers.hsl.exec(color))) { 37388 return { h: match[1], s: match[2], l: match[3] }; 37389 } 37390 if ((match = matchers.hsla.exec(color))) { 37391 return { h: match[1], s: match[2], l: match[3], a: match[4] }; 37392 } 37393 if ((match = matchers.hsv.exec(color))) { 37394 return { h: match[1], s: match[2], v: match[3] }; 37395 } 37396 if ((match = matchers.hsva.exec(color))) { 37397 return { h: match[1], s: match[2], v: match[3], a: match[4] }; 37398 } 37399 if ((match = matchers.hex8.exec(color))) { 37400 return { 37401 r: parseIntFromHex(match[1]), 37402 g: parseIntFromHex(match[2]), 37403 b: parseIntFromHex(match[3]), 37404 a: convertHexToDecimal(match[4]), 37405 format: named ? "name" : "hex8" 37406 }; 37407 } 37408 if ((match = matchers.hex6.exec(color))) { 37409 return { 37410 r: parseIntFromHex(match[1]), 37411 g: parseIntFromHex(match[2]), 37412 b: parseIntFromHex(match[3]), 37413 format: named ? "name" : "hex" 37414 }; 37415 } 37416 if ((match = matchers.hex4.exec(color))) { 37417 return { 37418 r: parseIntFromHex(match[1] + '' + match[1]), 37419 g: parseIntFromHex(match[2] + '' + match[2]), 37420 b: parseIntFromHex(match[3] + '' + match[3]), 37421 a: convertHexToDecimal(match[4] + '' + match[4]), 37422 format: named ? "name" : "hex8" 37423 }; 37424 } 37425 if ((match = matchers.hex3.exec(color))) { 37426 return { 37427 r: parseIntFromHex(match[1] + '' + match[1]), 37428 g: parseIntFromHex(match[2] + '' + match[2]), 37429 b: parseIntFromHex(match[3] + '' + match[3]), 37430 format: named ? "name" : "hex" 37431 }; 37432 } 37433 37434 return false; 37435 } 37436 37437 function validateWCAG2Parms(parms) { 37438 // return valid WCAG2 parms for isReadable. 37439 // If input parms are invalid, return {"level":"AA", "size":"small"} 37440 var level, size; 37441 parms = parms || {"level":"AA", "size":"small"}; 37442 level = (parms.level || "AA").toUpperCase(); 37443 size = (parms.size || "small").toLowerCase(); 37444 if (level !== "AA" && level !== "AAA") { 37445 level = "AA"; 37446 } 37447 if (size !== "small" && size !== "large") { 37448 size = "small"; 37449 } 37450 return {"level":level, "size":size}; 37451 } 37452 37453 // Node: Export function 37454 if ( true && module.exports) { 37455 module.exports = tinycolor; 37456 } 37457 // AMD/requirejs: Define the module 37458 else if (true) { 37459 !(__WEBPACK_AMD_DEFINE_RESULT__ = (function () {return tinycolor;}).call(exports, __webpack_require__, exports, module), 37460 __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); 37461 } 37462 // Browser: Expose to window 37463 else {} 37464 37465 })(Math); 37466 37467 37468 /***/ }), 37469 37470 /***/ "./node_modules/traverse/index.js": 37471 /*!****************************************!*\ 37472 !*** ./node_modules/traverse/index.js ***! 37473 \****************************************/ 37474 /*! no static exports found */ 37475 /***/ (function(module, exports) { 37476 37477 var traverse = module.exports = function (obj) { 37478 return new Traverse(obj); 37479 }; 37480 37481 function Traverse (obj) { 37482 this.value = obj; 37483 } 37484 37485 Traverse.prototype.get = function (ps) { 37486 var node = this.value; 37487 for (var i = 0; i < ps.length; i ++) { 37488 var key = ps[i]; 37489 if (!node || !hasOwnProperty.call(node, key)) { 37490 node = undefined; 37491 break; 37492 } 37493 node = node[key]; 37494 } 37495 return node; 37496 }; 37497 37498 Traverse.prototype.has = function (ps) { 37499 var node = this.value; 37500 for (var i = 0; i < ps.length; i ++) { 37501 var key = ps[i]; 37502 if (!node || !hasOwnProperty.call(node, key)) { 37503 return false; 37504 } 37505 node = node[key]; 37506 } 37507 return true; 37508 }; 37509 37510 Traverse.prototype.set = function (ps, value) { 37511 var node = this.value; 37512 for (var i = 0; i < ps.length - 1; i ++) { 37513 var key = ps[i]; 37514 if (!hasOwnProperty.call(node, key)) node[key] = {}; 37515 node = node[key]; 37516 } 37517 node[ps[i]] = value; 37518 return value; 37519 }; 37520 37521 Traverse.prototype.map = function (cb) { 37522 return walk(this.value, cb, true); 37523 }; 37524 37525 Traverse.prototype.forEach = function (cb) { 37526 this.value = walk(this.value, cb, false); 37527 return this.value; 37528 }; 37529 37530 Traverse.prototype.reduce = function (cb, init) { 37531 var skip = arguments.length === 1; 37532 var acc = skip ? this.value : init; 37533 this.forEach(function (x) { 37534 if (!this.isRoot || !skip) { 37535 acc = cb.call(this, acc, x); 37536 } 37537 }); 37538 return acc; 37539 }; 37540 37541 Traverse.prototype.paths = function () { 37542 var acc = []; 37543 this.forEach(function (x) { 37544 acc.push(this.path); 37545 }); 37546 return acc; 37547 }; 37548 37549 Traverse.prototype.nodes = function () { 37550 var acc = []; 37551 this.forEach(function (x) { 37552 acc.push(this.node); 37553 }); 37554 return acc; 37555 }; 37556 37557 Traverse.prototype.clone = function () { 37558 var parents = [], nodes = []; 37559 37560 return (function clone (src) { 37561 for (var i = 0; i < parents.length; i++) { 37562 if (parents[i] === src) { 37563 return nodes[i]; 37564 } 37565 } 37566 37567 if (typeof src === 'object' && src !== null) { 37568 var dst = copy(src); 37569 37570 parents.push(src); 37571 nodes.push(dst); 37572 37573 forEach(objectKeys(src), function (key) { 37574 dst[key] = clone(src[key]); 37575 }); 37576 37577 parents.pop(); 37578 nodes.pop(); 37579 return dst; 37580 } 37581 else { 37582 return src; 37583 } 37584 })(this.value); 37585 }; 37586 37587 function walk (root, cb, immutable) { 37588 var path = []; 37589 var parents = []; 37590 var alive = true; 37591 37592 return (function walker (node_) { 37593 var node = immutable ? copy(node_) : node_; 37594 var modifiers = {}; 37595 37596 var keepGoing = true; 37597 37598 var state = { 37599 node : node, 37600 node_ : node_, 37601 path : [].concat(path), 37602 parent : parents[parents.length - 1], 37603 parents : parents, 37604 key : path.slice(-1)[0], 37605 isRoot : path.length === 0, 37606 level : path.length, 37607 circular : null, 37608 update : function (x, stopHere) { 37609 if (!state.isRoot) { 37610 state.parent.node[state.key] = x; 37611 } 37612 state.node = x; 37613 if (stopHere) keepGoing = false; 37614 }, 37615 'delete' : function (stopHere) { 37616 delete state.parent.node[state.key]; 37617 if (stopHere) keepGoing = false; 37618 }, 37619 remove : function (stopHere) { 37620 if (isArray(state.parent.node)) { 37621 state.parent.node.splice(state.key, 1); 37622 } 37623 else { 37624 delete state.parent.node[state.key]; 37625 } 37626 if (stopHere) keepGoing = false; 37627 }, 37628 keys : null, 37629 before : function (f) { modifiers.before = f }, 37630 after : function (f) { modifiers.after = f }, 37631 pre : function (f) { modifiers.pre = f }, 37632 post : function (f) { modifiers.post = f }, 37633 stop : function () { alive = false }, 37634 block : function () { keepGoing = false } 37635 }; 37636 37637 if (!alive) return state; 37638 37639 function updateState() { 37640 if (typeof state.node === 'object' && state.node !== null) { 37641 if (!state.keys || state.node_ !== state.node) { 37642 state.keys = objectKeys(state.node) 37643 } 37644 37645 state.isLeaf = state.keys.length == 0; 37646 37647 for (var i = 0; i < parents.length; i++) { 37648 if (parents[i].node_ === node_) { 37649 state.circular = parents[i]; 37650 break; 37651 } 37652 } 37653 } 37654 else { 37655 state.isLeaf = true; 37656 state.keys = null; 37657 } 37658 37659 state.notLeaf = !state.isLeaf; 37660 state.notRoot = !state.isRoot; 37661 } 37662 37663 updateState(); 37664 37665 // use return values to update if defined 37666 var ret = cb.call(state, state.node); 37667 if (ret !== undefined && state.update) state.update(ret); 37668 37669 if (modifiers.before) modifiers.before.call(state, state.node); 37670 37671 if (!keepGoing) return state; 37672 37673 if (typeof state.node == 'object' 37674 && state.node !== null && !state.circular) { 37675 parents.push(state); 37676 37677 updateState(); 37678 37679 forEach(state.keys, function (key, i) { 37680 path.push(key); 37681 37682 if (modifiers.pre) modifiers.pre.call(state, state.node[key], key); 37683 37684 var child = walker(state.node[key]); 37685 if (immutable && hasOwnProperty.call(state.node, key)) { 37686 state.node[key] = child.node; 37687 } 37688 37689 child.isLast = i == state.keys.length - 1; 37690 child.isFirst = i == 0; 37691 37692 if (modifiers.post) modifiers.post.call(state, child); 37693 37694 path.pop(); 37695 }); 37696 parents.pop(); 37697 } 37698 37699 if (modifiers.after) modifiers.after.call(state, state.node); 37700 37701 return state; 37702 })(root).node; 37703 } 37704 37705 function copy (src) { 37706 if (typeof src === 'object' && src !== null) { 37707 var dst; 37708 37709 if (isArray(src)) { 37710 dst = []; 37711 } 37712 else if (isDate(src)) { 37713 dst = new Date(src.getTime ? src.getTime() : src); 37714 } 37715 else if (isRegExp(src)) { 37716 dst = new RegExp(src); 37717 } 37718 else if (isError(src)) { 37719 dst = { message: src.message }; 37720 } 37721 else if (isBoolean(src)) { 37722 dst = new Boolean(src); 37723 } 37724 else if (isNumber(src)) { 37725 dst = new Number(src); 37726 } 37727 else if (isString(src)) { 37728 dst = new String(src); 37729 } 37730 else if (Object.create && Object.getPrototypeOf) { 37731 dst = Object.create(Object.getPrototypeOf(src)); 37732 } 37733 else if (src.constructor === Object) { 37734 dst = {}; 37735 } 37736 else { 37737 var proto = 37738 (src.constructor && src.constructor.prototype) 37739 || src.__proto__ 37740 || {} 37741 ; 37742 var T = function () {}; 37743 T.prototype = proto; 37744 dst = new T; 37745 } 37746 37747 forEach(objectKeys(src), function (key) { 37748 dst[key] = src[key]; 37749 }); 37750 return dst; 37751 } 37752 else return src; 37753 } 37754 37755 var objectKeys = Object.keys || function keys (obj) { 37756 var res = []; 37757 for (var key in obj) res.push(key) 37758 return res; 37759 }; 37760 37761 function toS (obj) { return Object.prototype.toString.call(obj) } 37762 function isDate (obj) { return toS(obj) === '[object Date]' } 37763 function isRegExp (obj) { return toS(obj) === '[object RegExp]' } 37764 function isError (obj) { return toS(obj) === '[object Error]' } 37765 function isBoolean (obj) { return toS(obj) === '[object Boolean]' } 37766 function isNumber (obj) { return toS(obj) === '[object Number]' } 37767 function isString (obj) { return toS(obj) === '[object String]' } 37768 37769 var isArray = Array.isArray || function isArray (xs) { 37770 return Object.prototype.toString.call(xs) === '[object Array]'; 37771 }; 37772 37773 var forEach = function (xs, fn) { 37774 if (xs.forEach) return xs.forEach(fn) 37775 else for (var i = 0; i < xs.length; i++) { 37776 fn(xs[i], i, xs); 37777 } 37778 }; 37779 37780 forEach(objectKeys(Traverse.prototype), function (key) { 37781 traverse[key] = function (obj) { 37782 var args = [].slice.call(arguments, 1); 37783 var t = new Traverse(obj); 37784 return t[key].apply(t, args); 37785 }; 37786 }); 37787 37788 var hasOwnProperty = Object.hasOwnProperty || function (obj, key) { 37789 return key in obj; 37790 }; 37791 37792 37793 /***/ }), 37794 37795 /***/ "./node_modules/url/url.js": 37796 /*!*********************************!*\ 37797 !*** ./node_modules/url/url.js ***! 37798 \*********************************/ 37799 /*! no static exports found */ 37800 /***/ (function(module, exports, __webpack_require__) { 37801 37802 "use strict"; 37803 // Copyright Joyent, Inc. and other Node contributors. 37804 // 37805 // Permission is hereby granted, free of charge, to any person obtaining a 37806 // copy of this software and associated documentation files (the 37807 // "Software"), to deal in the Software without restriction, including 37808 // without limitation the rights to use, copy, modify, merge, publish, 37809 // distribute, sublicense, and/or sell copies of the Software, and to permit 37810 // persons to whom the Software is furnished to do so, subject to the 37811 // following conditions: 37812 // 37813 // The above copyright notice and this permission notice shall be included 37814 // in all copies or substantial portions of the Software. 37815 // 37816 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 37817 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 37818 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN 37819 // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 37820 // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 37821 // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE 37822 // USE OR OTHER DEALINGS IN THE SOFTWARE. 37823 37824 37825 37826 var punycode = __webpack_require__(/*! punycode */ "./node_modules/punycode/punycode.js"); 37827 var util = __webpack_require__(/*! ./util */ "./node_modules/url/util.js"); 37828 37829 exports.parse = urlParse; 37830 exports.resolve = urlResolve; 37831 exports.resolveObject = urlResolveObject; 37832 exports.format = urlFormat; 37833 37834 exports.Url = Url; 37835 37836 function Url() { 37837 this.protocol = null; 37838 this.slashes = null; 37839 this.auth = null; 37840 this.host = null; 37841 this.port = null; 37842 this.hostname = null; 37843 this.hash = null; 37844 this.search = null; 37845 this.query = null; 37846 this.pathname = null; 37847 this.path = null; 37848 this.href = null; 37849 } 37850 37851 // Reference: RFC 3986, RFC 1808, RFC 2396 37852 37853 // define these here so at least they only have to be 37854 // compiled once on the first module load. 37855 var protocolPattern = /^([a-z0-9.+-]+:)/i, 37856 portPattern = /:[0-9]*$/, 37857 37858 // Special case for a simple path URL 37859 simplePathPattern = /^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/, 37860 37861 // RFC 2396: characters reserved for delimiting URLs. 37862 // We actually just auto-escape these. 37863 delims = ['<', '>', '"', '`', ' ', '\r', '\n', '\t'], 37864 37865 // RFC 2396: characters not allowed for various reasons. 37866 unwise = ['{', '}', '|', '\\', '^', '`'].concat(delims), 37867 37868 // Allowed by RFCs, but cause of XSS attacks. Always escape these. 37869 autoEscape = ['\''].concat(unwise), 37870 // Characters that are never ever allowed in a hostname. 37871 // Note that any invalid chars are also handled, but these 37872 // are the ones that are *expected* to be seen, so we fast-path 37873 // them. 37874 nonHostChars = ['%', '/', '?', ';', '#'].concat(autoEscape), 37875 hostEndingChars = ['/', '?', '#'], 37876 hostnameMaxLen = 255, 37877 hostnamePartPattern = /^[+a-z0-9A-Z_-]{0,63}$/, 37878 hostnamePartStart = /^([+a-z0-9A-Z_-]{0,63})(.*)$/, 37879 // protocols that can allow "unsafe" and "unwise" chars. 37880 unsafeProtocol = { 37881 'javascript': true, 37882 'javascript:': true 37883 }, 37884 // protocols that never have a hostname. 37885 hostlessProtocol = { 37886 'javascript': true, 37887 'javascript:': true 37888 }, 37889 // protocols that always contain a // bit. 37890 slashedProtocol = { 37891 'http': true, 37892 'https': true, 37893 'ftp': true, 37894 'gopher': true, 37895 'file': true, 37896 'http:': true, 37897 'https:': true, 37898 'ftp:': true, 37899 'gopher:': true, 37900 'file:': true 37901 }, 37902 querystring = __webpack_require__(/*! querystring */ "./node_modules/querystring-es3/index.js"); 37903 37904 function urlParse(url, parseQueryString, slashesDenoteHost) { 37905 if (url && util.isObject(url) && url instanceof Url) return url; 37906 37907 var u = new Url; 37908 u.parse(url, parseQueryString, slashesDenoteHost); 37909 return u; 37910 } 37911 37912 Url.prototype.parse = function(url, parseQueryString, slashesDenoteHost) { 37913 if (!util.isString(url)) { 37914 throw new TypeError("Parameter 'url' must be a string, not " + typeof url); 37915 } 37916 37917 // Copy chrome, IE, opera backslash-handling behavior. 37918 // Back slashes before the query string get converted to forward slashes 37919 // See: https://code.google.com/p/chromium/issues/detail?id=25916 37920 var queryIndex = url.indexOf('?'), 37921 splitter = 37922 (queryIndex !== -1 && queryIndex < url.indexOf('#')) ? '?' : '#', 37923 uSplit = url.split(splitter), 37924 slashRegex = /\\/g; 37925 uSplit[0] = uSplit[0].replace(slashRegex, '/'); 37926 url = uSplit.join(splitter); 37927 37928 var rest = url; 37929 37930 // trim before proceeding. 37931 // This is to support parse stuff like " http://foo.com \n" 37932 rest = rest.trim(); 37933 37934 if (!slashesDenoteHost && url.split('#').length === 1) { 37935 // Try fast path regexp 37936 var simplePath = simplePathPattern.exec(rest); 37937 if (simplePath) { 37938 this.path = rest; 37939 this.href = rest; 37940 this.pathname = simplePath[1]; 37941 if (simplePath[2]) { 37942 this.search = simplePath[2]; 37943 if (parseQueryString) { 37944 this.query = querystring.parse(this.search.substr(1)); 37945 } else { 37946 this.query = this.search.substr(1); 37947 } 37948 } else if (parseQueryString) { 37949 this.search = ''; 37950 this.query = {}; 37951 } 37952 return this; 37953 } 37954 } 37955 37956 var proto = protocolPattern.exec(rest); 37957 if (proto) { 37958 proto = proto[0]; 37959 var lowerProto = proto.toLowerCase(); 37960 this.protocol = lowerProto; 37961 rest = rest.substr(proto.length); 37962 } 37963 37964 // figure out if it's got a host 37965 // user@server is *always* interpreted as a hostname, and url 37966 // resolution will treat //foo/bar as host=foo,path=bar because that's 37967 // how the browser resolves relative URLs. 37968 if (slashesDenoteHost || proto || rest.match(/^\/\/[^@\/]+@[^@\/]+/)) { 37969 var slashes = rest.substr(0, 2) === '//'; 37970 if (slashes && !(proto && hostlessProtocol[proto])) { 37971 rest = rest.substr(2); 37972 this.slashes = true; 37973 } 37974 } 37975 37976 if (!hostlessProtocol[proto] && 37977 (slashes || (proto && !slashedProtocol[proto]))) { 37978 37979 // there's a hostname. 37980 // the first instance of /, ?, ;, or # ends the host. 37981 // 37982 // If there is an @ in the hostname, then non-host chars *are* allowed 37983 // to the left of the last @ sign, unless some host-ending character 37984 // comes *before* the @-sign. 37985 // URLs are obnoxious. 37986 // 37987 // ex: 37988 // http://a@b@c/ => user:a@b host:c 37989 // http://a@b?@c => user:a host:c path:/?@c 37990 37991 // v0.12 TODO(isaacs): This is not quite how Chrome does things. 37992 // Review our test case against browsers more comprehensively. 37993 37994 // find the first instance of any hostEndingChars 37995 var hostEnd = -1; 37996 for (var i = 0; i < hostEndingChars.length; i++) { 37997 var hec = rest.indexOf(hostEndingChars[i]); 37998 if (hec !== -1 && (hostEnd === -1 || hec < hostEnd)) 37999 hostEnd = hec; 38000 } 38001 38002 // at this point, either we have an explicit point where the 38003 // auth portion cannot go past, or the last @ char is the decider. 38004 var auth, atSign; 38005 if (hostEnd === -1) { 38006 // atSign can be anywhere. 38007 atSign = rest.lastIndexOf('@'); 38008 } else { 38009 // atSign must be in auth portion. 38010 // http://a@b/c@d => host:b auth:a path:/c@d 38011 atSign = rest.lastIndexOf('@', hostEnd); 38012 } 38013 38014 // Now we have a portion which is definitely the auth. 38015 // Pull that off. 38016 if (atSign !== -1) { 38017 auth = rest.slice(0, atSign); 38018 rest = rest.slice(atSign + 1); 38019 this.auth = decodeURIComponent(auth); 38020 } 38021 38022 // the host is the remaining to the left of the first non-host char 38023 hostEnd = -1; 38024 for (var i = 0; i < nonHostChars.length; i++) { 38025 var hec = rest.indexOf(nonHostChars[i]); 38026 if (hec !== -1 && (hostEnd === -1 || hec < hostEnd)) 38027 hostEnd = hec; 38028 } 38029 // if we still have not hit it, then the entire thing is a host. 38030 if (hostEnd === -1) 38031 hostEnd = rest.length; 38032 38033 this.host = rest.slice(0, hostEnd); 38034 rest = rest.slice(hostEnd); 38035 38036 // pull out port. 38037 this.parseHost(); 38038 38039 // we've indicated that there is a hostname, 38040 // so even if it's empty, it has to be present. 38041 this.hostname = this.hostname || ''; 38042 38043 // if hostname begins with [ and ends with ] 38044 // assume that it's an IPv6 address. 38045 var ipv6Hostname = this.hostname[0] === '[' && 38046 this.hostname[this.hostname.length - 1] === ']'; 38047 38048 // validate a little. 38049 if (!ipv6Hostname) { 38050 var hostparts = this.hostname.split(/\./); 38051 for (var i = 0, l = hostparts.length; i < l; i++) { 38052 var part = hostparts[i]; 38053 if (!part) continue; 38054 if (!part.match(hostnamePartPattern)) { 38055 var newpart = ''; 38056 for (var j = 0, k = part.length; j < k; j++) { 38057 if (part.charCodeAt(j) > 127) { 38058 // we replace non-ASCII char with a temporary placeholder 38059 // we need this to make sure size of hostname is not 38060 // broken by replacing non-ASCII by nothing 38061 newpart += 'x'; 38062 } else { 38063 newpart += part[j]; 38064 } 38065 } 38066 // we test again with ASCII char only 38067 if (!newpart.match(hostnamePartPattern)) { 38068 var validParts = hostparts.slice(0, i); 38069 var notHost = hostparts.slice(i + 1); 38070 var bit = part.match(hostnamePartStart); 38071 if (bit) { 38072 validParts.push(bit[1]); 38073 notHost.unshift(bit[2]); 38074 } 38075 if (notHost.length) { 38076 rest = '/' + notHost.join('.') + rest; 38077 } 38078 this.hostname = validParts.join('.'); 38079 break; 38080 } 38081 } 38082 } 38083 } 38084 38085 if (this.hostname.length > hostnameMaxLen) { 38086 this.hostname = ''; 38087 } else { 38088 // hostnames are always lower case. 38089 this.hostname = this.hostname.toLowerCase(); 38090 } 38091 38092 if (!ipv6Hostname) { 38093 // IDNA Support: Returns a punycoded representation of "domain". 38094 // It only converts parts of the domain name that 38095 // have non-ASCII characters, i.e. it doesn't matter if 38096 // you call it with a domain that already is ASCII-only. 38097 this.hostname = punycode.toASCII(this.hostname); 38098 } 38099 38100 var p = this.port ? ':' + this.port : ''; 38101 var h = this.hostname || ''; 38102 this.host = h + p; 38103 this.href += this.host; 38104 38105 // strip [ and ] from the hostname 38106 // the host field still retains them, though 38107 if (ipv6Hostname) { 38108 this.hostname = this.hostname.substr(1, this.hostname.length - 2); 38109 if (rest[0] !== '/') { 38110 rest = '/' + rest; 38111 } 38112 } 38113 } 38114 38115 // now rest is set to the post-host stuff. 38116 // chop off any delim chars. 38117 if (!unsafeProtocol[lowerProto]) { 38118 38119 // First, make 100% sure that any "autoEscape" chars get 38120 // escaped, even if encodeURIComponent doesn't think they 38121 // need to be. 38122 for (var i = 0, l = autoEscape.length; i < l; i++) { 38123 var ae = autoEscape[i]; 38124 if (rest.indexOf(ae) === -1) 38125 continue; 38126 var esc = encodeURIComponent(ae); 38127 if (esc === ae) { 38128 esc = escape(ae); 38129 } 38130 rest = rest.split(ae).join(esc); 38131 } 38132 } 38133 38134 38135 // chop off from the tail first. 38136 var hash = rest.indexOf('#'); 38137 if (hash !== -1) { 38138 // got a fragment string. 38139 this.hash = rest.substr(hash); 38140 rest = rest.slice(0, hash); 38141 } 38142 var qm = rest.indexOf('?'); 38143 if (qm !== -1) { 38144 this.search = rest.substr(qm); 38145 this.query = rest.substr(qm + 1); 38146 if (parseQueryString) { 38147 this.query = querystring.parse(this.query); 38148 } 38149 rest = rest.slice(0, qm); 38150 } else if (parseQueryString) { 38151 // no query string, but parseQueryString still requested 38152 this.search = ''; 38153 this.query = {}; 38154 } 38155 if (rest) this.pathname = rest; 38156 if (slashedProtocol[lowerProto] && 38157 this.hostname && !this.pathname) { 38158 this.pathname = '/'; 38159 } 38160 38161 //to support http.request 38162 if (this.pathname || this.search) { 38163 var p = this.pathname || ''; 38164 var s = this.search || ''; 38165 this.path = p + s; 38166 } 38167 38168 // finally, reconstruct the href based on what has been validated. 38169 this.href = this.format(); 38170 return this; 38171 }; 38172 38173 // format a parsed object into a url string 38174 function urlFormat(obj) { 38175 // ensure it's an object, and not a string url. 38176 // If it's an obj, this is a no-op. 38177 // this way, you can call url_format() on strings 38178 // to clean up potentially wonky urls. 38179 if (util.isString(obj)) obj = urlParse(obj); 38180 if (!(obj instanceof Url)) return Url.prototype.format.call(obj); 38181 return obj.format(); 38182 } 38183 38184 Url.prototype.format = function() { 38185 var auth = this.auth || ''; 38186 if (auth) { 38187 auth = encodeURIComponent(auth); 38188 auth = auth.replace(/%3A/i, ':'); 38189 auth += '@'; 38190 } 38191 38192 var protocol = this.protocol || '', 38193 pathname = this.pathname || '', 38194 hash = this.hash || '', 38195 host = false, 38196 query = ''; 38197 38198 if (this.host) { 38199 host = auth + this.host; 38200 } else if (this.hostname) { 38201 host = auth + (this.hostname.indexOf(':') === -1 ? 38202 this.hostname : 38203 '[' + this.hostname + ']'); 38204 if (this.port) { 38205 host += ':' + this.port; 38206 } 38207 } 38208 38209 if (this.query && 38210 util.isObject(this.query) && 38211 Object.keys(this.query).length) { 38212 query = querystring.stringify(this.query); 38213 } 38214 38215 var search = this.search || (query && ('?' + query)) || ''; 38216 38217 if (protocol && protocol.substr(-1) !== ':') protocol += ':'; 38218 38219 // only the slashedProtocols get the //. Not mailto:, xmpp:, etc. 38220 // unless they had them to begin with. 38221 if (this.slashes || 38222 (!protocol || slashedProtocol[protocol]) && host !== false) { 38223 host = '//' + (host || ''); 38224 if (pathname && pathname.charAt(0) !== '/') pathname = '/' + pathname; 38225 } else if (!host) { 38226 host = ''; 38227 } 38228 38229 if (hash && hash.charAt(0) !== '#') hash = '#' + hash; 38230 if (search && search.charAt(0) !== '?') search = '?' + search; 38231 38232 pathname = pathname.replace(/[?#]/g, function(match) { 38233 return encodeURIComponent(match); 38234 }); 38235 search = search.replace('#', '%23'); 38236 38237 return protocol + host + pathname + search + hash; 38238 }; 38239 38240 function urlResolve(source, relative) { 38241 return urlParse(source, false, true).resolve(relative); 38242 } 38243 38244 Url.prototype.resolve = function(relative) { 38245 return this.resolveObject(urlParse(relative, false, true)).format(); 38246 }; 38247 38248 function urlResolveObject(source, relative) { 38249 if (!source) return relative; 38250 return urlParse(source, false, true).resolveObject(relative); 38251 } 38252 38253 Url.prototype.resolveObject = function(relative) { 38254 if (util.isString(relative)) { 38255 var rel = new Url(); 38256 rel.parse(relative, false, true); 38257 relative = rel; 38258 } 38259 38260 var result = new Url(); 38261 var tkeys = Object.keys(this); 38262 for (var tk = 0; tk < tkeys.length; tk++) { 38263 var tkey = tkeys[tk]; 38264 result[tkey] = this[tkey]; 38265 } 38266 38267 // hash is always overridden, no matter what. 38268 // even href="" will remove it. 38269 result.hash = relative.hash; 38270 38271 // if the relative url is empty, then there's nothing left to do here. 38272 if (relative.href === '') { 38273 result.href = result.format(); 38274 return result; 38275 } 38276 38277 // hrefs like //foo/bar always cut to the protocol. 38278 if (relative.slashes && !relative.protocol) { 38279 // take everything except the protocol from relative 38280 var rkeys = Object.keys(relative); 38281 for (var rk = 0; rk < rkeys.length; rk++) { 38282 var rkey = rkeys[rk]; 38283 if (rkey !== 'protocol') 38284 result[rkey] = relative[rkey]; 38285 } 38286 38287 //urlParse appends trailing / to urls like http://www.example.com 38288 if (slashedProtocol[result.protocol] && 38289 result.hostname && !result.pathname) { 38290 result.path = result.pathname = '/'; 38291 } 38292 38293 result.href = result.format(); 38294 return result; 38295 } 38296 38297 if (relative.protocol && relative.protocol !== result.protocol) { 38298 // if it's a known url protocol, then changing 38299 // the protocol does weird things 38300 // first, if it's not file:, then we MUST have a host, 38301 // and if there was a path 38302 // to begin with, then we MUST have a path. 38303 // if it is file:, then the host is dropped, 38304 // because that's known to be hostless. 38305 // anything else is assumed to be absolute. 38306 if (!slashedProtocol[relative.protocol]) { 38307 var keys = Object.keys(relative); 38308 for (var v = 0; v < keys.length; v++) { 38309 var k = keys[v]; 38310 result[k] = relative[k]; 38311 } 38312 result.href = result.format(); 38313 return result; 38314 } 38315 38316 result.protocol = relative.protocol; 38317 if (!relative.host && !hostlessProtocol[relative.protocol]) { 38318 var relPath = (relative.pathname || '').split('/'); 38319 while (relPath.length && !(relative.host = relPath.shift())); 38320 if (!relative.host) relative.host = ''; 38321 if (!relative.hostname) relative.hostname = ''; 38322 if (relPath[0] !== '') relPath.unshift(''); 38323 if (relPath.length < 2) relPath.unshift(''); 38324 result.pathname = relPath.join('/'); 38325 } else { 38326 result.pathname = relative.pathname; 38327 } 38328 result.search = relative.search; 38329 result.query = relative.query; 38330 result.host = relative.host || ''; 38331 result.auth = relative.auth; 38332 result.hostname = relative.hostname || relative.host; 38333 result.port = relative.port; 38334 // to support http.request 38335 if (result.pathname || result.search) { 38336 var p = result.pathname || ''; 38337 var s = result.search || ''; 38338 result.path = p + s; 38339 } 38340 result.slashes = result.slashes || relative.slashes; 38341 result.href = result.format(); 38342 return result; 38343 } 38344 38345 var isSourceAbs = (result.pathname && result.pathname.charAt(0) === '/'), 38346 isRelAbs = ( 38347 relative.host || 38348 relative.pathname && relative.pathname.charAt(0) === '/' 38349 ), 38350 mustEndAbs = (isRelAbs || isSourceAbs || 38351 (result.host && relative.pathname)), 38352 removeAllDots = mustEndAbs, 38353 srcPath = result.pathname && result.pathname.split('/') || [], 38354 relPath = relative.pathname && relative.pathname.split('/') || [], 38355 psychotic = result.protocol && !slashedProtocol[result.protocol]; 38356 38357 // if the url is a non-slashed url, then relative 38358 // links like ../.. should be able 38359 // to crawl up to the hostname, as well. This is strange. 38360 // result.protocol has already been set by now. 38361 // Later on, put the first path part into the host field. 38362 if (psychotic) { 38363 result.hostname = ''; 38364 result.port = null; 38365 if (result.host) { 38366 if (srcPath[0] === '') srcPath[0] = result.host; 38367 else srcPath.unshift(result.host); 38368 } 38369 result.host = ''; 38370 if (relative.protocol) { 38371 relative.hostname = null; 38372 relative.port = null; 38373 if (relative.host) { 38374 if (relPath[0] === '') relPath[0] = relative.host; 38375 else relPath.unshift(relative.host); 38376 } 38377 relative.host = null; 38378 } 38379 mustEndAbs = mustEndAbs && (relPath[0] === '' || srcPath[0] === ''); 38380 } 38381 38382 if (isRelAbs) { 38383 // it's absolute. 38384 result.host = (relative.host || relative.host === '') ? 38385 relative.host : result.host; 38386 result.hostname = (relative.hostname || relative.hostname === '') ? 38387 relative.hostname : result.hostname; 38388 result.search = relative.search; 38389 result.query = relative.query; 38390 srcPath = relPath; 38391 // fall through to the dot-handling below. 38392 } else if (relPath.length) { 38393 // it's relative 38394 // throw away the existing file, and take the new path instead. 38395 if (!srcPath) srcPath = []; 38396 srcPath.pop(); 38397 srcPath = srcPath.concat(relPath); 38398 result.search = relative.search; 38399 result.query = relative.query; 38400 } else if (!util.isNullOrUndefined(relative.search)) { 38401 // just pull out the search. 38402 // like href='?foo'. 38403 // Put this after the other two cases because it simplifies the booleans 38404 if (psychotic) { 38405 result.hostname = result.host = srcPath.shift(); 38406 //occationaly the auth can get stuck only in host 38407 //this especially happens in cases like 38408 //url.resolveObject('mailto:local1@domain1', 'local2@domain2') 38409 var authInHost = result.host && result.host.indexOf('@') > 0 ? 38410 result.host.split('@') : false; 38411 if (authInHost) { 38412 result.auth = authInHost.shift(); 38413 result.host = result.hostname = authInHost.shift(); 38414 } 38415 } 38416 result.search = relative.search; 38417 result.query = relative.query; 38418 //to support http.request 38419 if (!util.isNull(result.pathname) || !util.isNull(result.search)) { 38420 result.path = (result.pathname ? result.pathname : '') + 38421 (result.search ? result.search : ''); 38422 } 38423 result.href = result.format(); 38424 return result; 38425 } 38426 38427 if (!srcPath.length) { 38428 // no path at all. easy. 38429 // we've already handled the other stuff above. 38430 result.pathname = null; 38431 //to support http.request 38432 if (result.search) { 38433 result.path = '/' + result.search; 38434 } else { 38435 result.path = null; 38436 } 38437 result.href = result.format(); 38438 return result; 38439 } 38440 38441 // if a url ENDs in . or .., then it must get a trailing slash. 38442 // however, if it ends in anything else non-slashy, 38443 // then it must NOT get a trailing slash. 38444 var last = srcPath.slice(-1)[0]; 38445 var hasTrailingSlash = ( 38446 (result.host || relative.host || srcPath.length > 1) && 38447 (last === '.' || last === '..') || last === ''); 38448 38449 // strip single dots, resolve double dots to parent dir 38450 // if the path tries to go above the root, `up` ends up > 0 38451 var up = 0; 38452 for (var i = srcPath.length; i >= 0; i--) { 38453 last = srcPath[i]; 38454 if (last === '.') { 38455 srcPath.splice(i, 1); 38456 } else if (last === '..') { 38457 srcPath.splice(i, 1); 38458 up++; 38459 } else if (up) { 38460 srcPath.splice(i, 1); 38461 up--; 38462 } 38463 } 38464 38465 // if the path is allowed to go above the root, restore leading ..s 38466 if (!mustEndAbs && !removeAllDots) { 38467 for (; up--; up) { 38468 srcPath.unshift('..'); 38469 } 38470 } 38471 38472 if (mustEndAbs && srcPath[0] !== '' && 38473 (!srcPath[0] || srcPath[0].charAt(0) !== '/')) { 38474 srcPath.unshift(''); 38475 } 38476 38477 if (hasTrailingSlash && (srcPath.join('/').substr(-1) !== '/')) { 38478 srcPath.push(''); 38479 } 38480 38481 var isAbsolute = srcPath[0] === '' || 38482 (srcPath[0] && srcPath[0].charAt(0) === '/'); 38483 38484 // put the host back 38485 if (psychotic) { 38486 result.hostname = result.host = isAbsolute ? '' : 38487 srcPath.length ? srcPath.shift() : ''; 38488 //occationaly the auth can get stuck only in host 38489 //this especially happens in cases like 38490 //url.resolveObject('mailto:local1@domain1', 'local2@domain2') 38491 var authInHost = result.host && result.host.indexOf('@') > 0 ? 38492 result.host.split('@') : false; 38493 if (authInHost) { 38494 result.auth = authInHost.shift(); 38495 result.host = result.hostname = authInHost.shift(); 38496 } 38497 } 38498 38499 mustEndAbs = mustEndAbs || (result.host && srcPath.length); 38500 38501 if (mustEndAbs && !isAbsolute) { 38502 srcPath.unshift(''); 38503 } 38504 38505 if (!srcPath.length) { 38506 result.pathname = null; 38507 result.path = null; 38508 } else { 38509 result.pathname = srcPath.join('/'); 38510 } 38511 38512 //to support request.http 38513 if (!util.isNull(result.pathname) || !util.isNull(result.search)) { 38514 result.path = (result.pathname ? result.pathname : '') + 38515 (result.search ? result.search : ''); 38516 } 38517 result.auth = relative.auth || result.auth; 38518 result.slashes = result.slashes || relative.slashes; 38519 result.href = result.format(); 38520 return result; 38521 }; 38522 38523 Url.prototype.parseHost = function() { 38524 var host = this.host; 38525 var port = portPattern.exec(host); 38526 if (port) { 38527 port = port[0]; 38528 if (port !== ':') { 38529 this.port = port.substr(1); 38530 } 38531 host = host.substr(0, host.length - port.length); 38532 } 38533 if (host) this.hostname = host; 38534 }; 38535 38536 38537 /***/ }), 38538 38539 /***/ "./node_modules/url/util.js": 38540 /*!**********************************!*\ 38541 !*** ./node_modules/url/util.js ***! 38542 \**********************************/ 38543 /*! no static exports found */ 38544 /***/ (function(module, exports, __webpack_require__) { 38545 38546 "use strict"; 38547 38548 38549 module.exports = { 38550 isString: function(arg) { 38551 return typeof(arg) === 'string'; 38552 }, 38553 isObject: function(arg) { 38554 return typeof(arg) === 'object' && arg !== null; 38555 }, 38556 isNull: function(arg) { 38557 return arg === null; 38558 }, 38559 isNullOrUndefined: function(arg) { 38560 return arg == null; 38561 } 38562 }; 38563 38564 38565 /***/ }), 38566 38567 /***/ "./node_modules/uuid/lib/bytesToUuid.js": 38568 /*!**********************************************!*\ 38569 !*** ./node_modules/uuid/lib/bytesToUuid.js ***! 38570 \**********************************************/ 38571 /*! no static exports found */ 38572 /***/ (function(module, exports) { 38573 38574 /** 38575 * Convert array of 16 byte values to UUID string format of the form: 38576 * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX 38577 */ 38578 var byteToHex = []; 38579 for (var i = 0; i < 256; ++i) { 38580 byteToHex[i] = (i + 0x100).toString(16).substr(1); 38581 } 38582 38583 function bytesToUuid(buf, offset) { 38584 var i = offset || 0; 38585 var bth = byteToHex; 38586 // join used to fix memory issue caused by concatenation: https://bugs.chromium.org/p/v8/issues/detail?id=3175#c4 38587 return ([bth[buf[i++]], bth[buf[i++]], 38588 bth[buf[i++]], bth[buf[i++]], '-', 38589 bth[buf[i++]], bth[buf[i++]], '-', 38590 bth[buf[i++]], bth[buf[i++]], '-', 38591 bth[buf[i++]], bth[buf[i++]], '-', 38592 bth[buf[i++]], bth[buf[i++]], 38593 bth[buf[i++]], bth[buf[i++]], 38594 bth[buf[i++]], bth[buf[i++]]]).join(''); 38595 } 38596 38597 module.exports = bytesToUuid; 38598 38599 38600 /***/ }), 38601 38602 /***/ "./node_modules/uuid/lib/rng-browser.js": 38603 /*!**********************************************!*\ 38604 !*** ./node_modules/uuid/lib/rng-browser.js ***! 38605 \**********************************************/ 38606 /*! no static exports found */ 38607 /***/ (function(module, exports) { 38608 38609 // Unique ID creation requires a high quality random # generator. In the 38610 // browser this is a little complicated due to unknown quality of Math.random() 38611 // and inconsistent support for the `crypto` API. We do the best we can via 38612 // feature-detection 38613 38614 // getRandomValues needs to be invoked in a context where "this" is a Crypto 38615 // implementation. Also, find the complete implementation of crypto on IE11. 38616 var getRandomValues = (typeof(crypto) != 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto)) || 38617 (typeof(msCrypto) != 'undefined' && typeof window.msCrypto.getRandomValues == 'function' && msCrypto.getRandomValues.bind(msCrypto)); 38618 38619 if (getRandomValues) { 38620 // WHATWG crypto RNG - http://wiki.whatwg.org/wiki/Crypto 38621 var rnds8 = new Uint8Array(16); // eslint-disable-line no-undef 38622 38623 module.exports = function whatwgRNG() { 38624 getRandomValues(rnds8); 38625 return rnds8; 38626 }; 38627 } else { 38628 // Math.random()-based (RNG) 38629 // 38630 // If all else fails, use Math.random(). It's fast, but is of unspecified 38631 // quality. 38632 var rnds = new Array(16); 38633 38634 module.exports = function mathRNG() { 38635 for (var i = 0, r; i < 16; i++) { 38636 if ((i & 0x03) === 0) r = Math.random() * 0x100000000; 38637 rnds[i] = r >>> ((i & 0x03) << 3) & 0xff; 38638 } 38639 38640 return rnds; 38641 }; 38642 } 38643 38644 38645 /***/ }), 38646 38647 /***/ "./node_modules/uuid/v4.js": 38648 /*!*********************************!*\ 38649 !*** ./node_modules/uuid/v4.js ***! 38650 \*********************************/ 38651 /*! no static exports found */ 38652 /***/ (function(module, exports, __webpack_require__) { 38653 38654 var rng = __webpack_require__(/*! ./lib/rng */ "./node_modules/uuid/lib/rng-browser.js"); 38655 var bytesToUuid = __webpack_require__(/*! ./lib/bytesToUuid */ "./node_modules/uuid/lib/bytesToUuid.js"); 38656 38657 function v4(options, buf, offset) { 38658 var i = buf && offset || 0; 38659 38660 if (typeof(options) == 'string') { 38661 buf = options === 'binary' ? new Array(16) : null; 38662 options = null; 38663 } 38664 options = options || {}; 38665 38666 var rnds = options.random || (options.rng || rng)(); 38667 38668 // Per 4.4, set bits for version and `clock_seq_hi_and_reserved` 38669 rnds[6] = (rnds[6] & 0x0f) | 0x40; 38670 rnds[8] = (rnds[8] & 0x3f) | 0x80; 38671 38672 // Copy bytes to buffer, if provided 38673 if (buf) { 38674 for (var ii = 0; ii < 16; ++ii) { 38675 buf[i + ii] = rnds[ii]; 38676 } 38677 } 38678 38679 return buf || bytesToUuid(rnds); 38680 } 38681 38682 module.exports = v4; 38683 38684 38685 /***/ }), 38686 38687 /***/ "./node_modules/webpack/buildin/global.js": 38688 /*!***********************************!*\ 38689 !*** (webpack)/buildin/global.js ***! 38690 \***********************************/ 38691 /*! no static exports found */ 38692 /***/ (function(module, exports) { 38693 38694 var g; 38695 38696 // This works in non-strict mode 38697 g = (function() { 38698 return this; 38699 })(); 38700 38701 try { 38702 // This works if eval is allowed (see CSP) 38703 g = g || new Function("return this")(); 38704 } catch (e) { 38705 // This works if the window reference is available 38706 if (typeof window === "object") g = window; 38707 } 38708 38709 // g can still be undefined, but nothing to do about it... 38710 // We return undefined, instead of nothing here, so it's 38711 // easier to handle this case. if(!global) { ...} 38712 38713 module.exports = g; 38714 38715 38716 /***/ }), 38717 38718 /***/ "./node_modules/webpack/buildin/module.js": 38719 /*!***********************************!*\ 38720 !*** (webpack)/buildin/module.js ***! 38721 \***********************************/ 38722 /*! no static exports found */ 38723 /***/ (function(module, exports) { 38724 38725 module.exports = function(module) { 38726 if (!module.webpackPolyfill) { 38727 module.deprecate = function() {}; 38728 module.paths = []; 38729 // module.parent = undefined by default 38730 if (!module.children) module.children = []; 38731 Object.defineProperty(module, "loaded", { 38732 enumerable: true, 38733 get: function() { 38734 return module.l; 38735 } 38736 }); 38737 Object.defineProperty(module, "id", { 38738 enumerable: true, 38739 get: function() { 38740 return module.i; 38741 } 38742 }); 38743 module.webpackPolyfill = 1; 38744 } 38745 return module; 38746 }; 38747 38748 38749 /***/ }), 38750 38751 /***/ "@wordpress/a11y": 38752 /*!***************************************!*\ 38753 !*** external {"this":["wp","a11y"]} ***! 38754 \***************************************/ 38755 /*! no static exports found */ 38756 /***/ (function(module, exports) { 38757 38758 (function() { module.exports = this["wp"]["a11y"]; }()); 38759 38760 /***/ }), 38761 38762 /***/ "@wordpress/api-fetch": 38763 /*!*******************************************!*\ 38764 !*** external {"this":["wp","apiFetch"]} ***! 38765 \*******************************************/ 38766 /*! no static exports found */ 38767 /***/ (function(module, exports) { 38768 38769 (function() { module.exports = this["wp"]["apiFetch"]; }()); 38770 38771 /***/ }), 38772 38773 /***/ "@wordpress/autop": 38774 /*!****************************************!*\ 38775 !*** external {"this":["wp","autop"]} ***! 38776 \****************************************/ 38777 /*! no static exports found */ 38778 /***/ (function(module, exports) { 38779 38780 (function() { module.exports = this["wp"]["autop"]; }()); 38781 38782 /***/ }), 38783 38784 /***/ "@wordpress/blob": 38785 /*!***************************************!*\ 38786 !*** external {"this":["wp","blob"]} ***! 38787 \***************************************/ 38788 /*! no static exports found */ 38789 /***/ (function(module, exports) { 38790 38791 (function() { module.exports = this["wp"]["blob"]; }()); 38792 38793 /***/ }), 38794 38795 /***/ "@wordpress/blocks": 38796 /*!*****************************************!*\ 38797 !*** external {"this":["wp","blocks"]} ***! 38798 \*****************************************/ 38799 /*! no static exports found */ 38800 /***/ (function(module, exports) { 38801 38802 (function() { module.exports = this["wp"]["blocks"]; }()); 38803 38804 /***/ }), 38805 38806 /***/ "@wordpress/components": 38807 /*!*********************************************!*\ 38808 !*** external {"this":["wp","components"]} ***! 38809 \*********************************************/ 38810 /*! no static exports found */ 38811 /***/ (function(module, exports) { 38812 38813 (function() { module.exports = this["wp"]["components"]; }()); 38814 38815 /***/ }), 38816 38817 /***/ "@wordpress/compose": 38818 /*!******************************************!*\ 38819 !*** external {"this":["wp","compose"]} ***! 38820 \******************************************/ 38821 /*! no static exports found */ 38822 /***/ (function(module, exports) { 38823 38824 (function() { module.exports = this["wp"]["compose"]; }()); 38825 38826 /***/ }), 38827 38828 /***/ "@wordpress/core-data": 38829 /*!*******************************************!*\ 38830 !*** external {"this":["wp","coreData"]} ***! 38831 \*******************************************/ 38832 /*! no static exports found */ 38833 /***/ (function(module, exports) { 38834 38835 (function() { module.exports = this["wp"]["coreData"]; }()); 38836 38837 /***/ }), 38838 38839 /***/ "@wordpress/data": 38840 /*!***************************************!*\ 38841 !*** external {"this":["wp","data"]} ***! 38842 \***************************************/ 38843 /*! no static exports found */ 38844 /***/ (function(module, exports) { 38845 38846 (function() { module.exports = this["wp"]["data"]; }()); 38847 38848 /***/ }), 38849 38850 /***/ "@wordpress/date": 38851 /*!***************************************!*\ 38852 !*** external {"this":["wp","date"]} ***! 38853 \***************************************/ 38854 /*! no static exports found */ 38855 /***/ (function(module, exports) { 38856 38857 (function() { module.exports = this["wp"]["date"]; }()); 38858 38859 /***/ }), 38860 38861 /***/ "@wordpress/deprecated": 38862 /*!*********************************************!*\ 38863 !*** external {"this":["wp","deprecated"]} ***! 38864 \*********************************************/ 38865 /*! no static exports found */ 38866 /***/ (function(module, exports) { 38867 38868 (function() { module.exports = this["wp"]["deprecated"]; }()); 38869 38870 /***/ }), 38871 38872 /***/ "@wordpress/dom": 38873 /*!**************************************!*\ 38874 !*** external {"this":["wp","dom"]} ***! 38875 \**************************************/ 38876 /*! no static exports found */ 38877 /***/ (function(module, exports) { 38878 38879 (function() { module.exports = this["wp"]["dom"]; }()); 38880 38881 /***/ }), 38882 38883 /***/ "@wordpress/element": 38884 /*!******************************************!*\ 38885 !*** external {"this":["wp","element"]} ***! 38886 \******************************************/ 38887 /*! no static exports found */ 38888 /***/ (function(module, exports) { 38889 38890 (function() { module.exports = this["wp"]["element"]; }()); 38891 38892 /***/ }), 38893 38894 /***/ "@wordpress/hooks": 38895 /*!****************************************!*\ 38896 !*** external {"this":["wp","hooks"]} ***! 38897 \****************************************/ 38898 /*! no static exports found */ 38899 /***/ (function(module, exports) { 38900 38901 (function() { module.exports = this["wp"]["hooks"]; }()); 38902 38903 /***/ }), 38904 38905 /***/ "@wordpress/html-entities": 38906 /*!***********************************************!*\ 38907 !*** external {"this":["wp","htmlEntities"]} ***! 38908 \***********************************************/ 38909 /*! no static exports found */ 38910 /***/ (function(module, exports) { 38911 38912 (function() { module.exports = this["wp"]["htmlEntities"]; }()); 38913 38914 /***/ }), 38915 38916 /***/ "@wordpress/i18n": 38917 /*!***************************************!*\ 38918 !*** external {"this":["wp","i18n"]} ***! 38919 \***************************************/ 38920 /*! no static exports found */ 38921 /***/ (function(module, exports) { 38922 38923 (function() { module.exports = this["wp"]["i18n"]; }()); 38924 38925 /***/ }), 38926 38927 /***/ "@wordpress/is-shallow-equal": 38928 /*!*************************************************!*\ 38929 !*** external {"this":["wp","isShallowEqual"]} ***! 38930 \*************************************************/ 38931 /*! no static exports found */ 38932 /***/ (function(module, exports) { 38933 38934 (function() { module.exports = this["wp"]["isShallowEqual"]; }()); 38935 38936 /***/ }), 38937 38938 /***/ "@wordpress/keycodes": 38939 /*!*******************************************!*\ 38940 !*** external {"this":["wp","keycodes"]} ***! 38941 \*******************************************/ 38942 /*! no static exports found */ 38943 /***/ (function(module, exports) { 38944 38945 (function() { module.exports = this["wp"]["keycodes"]; }()); 38946 38947 /***/ }), 38948 38949 /***/ "@wordpress/nux": 38950 /*!**************************************!*\ 38951 !*** external {"this":["wp","nux"]} ***! 38952 \**************************************/ 38953 /*! no static exports found */ 38954 /***/ (function(module, exports) { 38955 38956 (function() { module.exports = this["wp"]["nux"]; }()); 38957 38958 /***/ }), 38959 38960 /***/ "@wordpress/rich-text": 38961 /*!*******************************************!*\ 38962 !*** external {"this":["wp","richText"]} ***! 38963 \*******************************************/ 38964 /*! no static exports found */ 38965 /***/ (function(module, exports) { 38966 38967 (function() { module.exports = this["wp"]["richText"]; }()); 38968 38969 /***/ }), 38970 38971 /***/ "@wordpress/token-list": 38972 /*!********************************************!*\ 38973 !*** external {"this":["wp","tokenList"]} ***! 38974 \********************************************/ 38975 /*! no static exports found */ 38976 /***/ (function(module, exports) { 38977 38978 (function() { module.exports = this["wp"]["tokenList"]; }()); 38979 38980 /***/ }), 38981 38982 /***/ "@wordpress/url": 38983 /*!**************************************!*\ 38984 !*** external {"this":["wp","url"]} ***! 38985 \**************************************/ 38986 /*! no static exports found */ 38987 /***/ (function(module, exports) { 38988 38989 (function() { module.exports = this["wp"]["url"]; }()); 38990 38991 /***/ }), 38992 38993 /***/ "@wordpress/viewport": 38994 /*!*******************************************!*\ 38995 !*** external {"this":["wp","viewport"]} ***! 38996 \*******************************************/ 38997 /*! no static exports found */ 38998 /***/ (function(module, exports) { 38999 39000 (function() { module.exports = this["wp"]["viewport"]; }()); 39001 39002 /***/ }), 39003 39004 /***/ "@wordpress/wordcount": 39005 /*!********************************************!*\ 39006 !*** external {"this":["wp","wordcount"]} ***! 39007 \********************************************/ 39008 /*! no static exports found */ 39009 /***/ (function(module, exports) { 39010 39011 (function() { module.exports = this["wp"]["wordcount"]; }()); 39012 39013 /***/ }), 39014 39015 /***/ "jquery": 39016 /*!*************************!*\ 39017 !*** external "jQuery" ***! 39018 \*************************/ 39019 /*! no static exports found */ 39020 /***/ (function(module, exports) { 39021 39022 (function() { module.exports = this["jQuery"]; }()); 39023 39024 /***/ }), 39025 39026 /***/ "lodash": 39027 /*!*************************!*\ 39028 !*** external "lodash" ***! 39029 \*************************/ 39030 /*! no static exports found */ 39031 /***/ (function(module, exports) { 39032 39033 (function() { module.exports = this["lodash"]; }()); 39034 39035 /***/ }), 39036 39037 /***/ "react": 39038 /*!************************!*\ 39039 !*** external "React" ***! 39040 \************************/ 39041 /*! no static exports found */ 39042 /***/ (function(module, exports) { 39043 39044 (function() { module.exports = this["React"]; }()); 39045 39046 /***/ }), 39047 39048 /***/ "tinymce": 39049 /*!**************************!*\ 39050 !*** external "tinymce" ***! 39051 \**************************/ 39052 /*! no static exports found */ 39053 /***/ (function(module, exports) { 39054 39055 (function() { module.exports = this["tinymce"]; }()); 39056 39057 /***/ }) 39058 39059 /******/ }); 39060 //# sourceMappingURL=editor.js.map
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
Generated: Mon Jan 7 01:00:05 2019 | Cross-referenced by PHPXref 0.7.1 |