| 1 |
/*! elementor - v3.0.7 - 09-09-2020 */ |
| 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 = 708); |
| 86 |
/******/ }) |
| 87 |
/************************************************************************/ |
| 88 |
/******/ ([ |
| 89 |
/* 0 */ |
| 90 |
/***/ (function(module, exports) { |
| 91 |
|
| 92 |
function _interopRequireDefault(obj) { |
| 93 |
return obj && obj.__esModule ? obj : { |
| 94 |
"default": obj |
| 95 |
}; |
| 96 |
} |
| 97 |
|
| 98 |
module.exports = _interopRequireDefault; |
| 99 |
|
| 100 |
/***/ }), |
| 101 |
/* 1 */ |
| 102 |
/***/ (function(module, exports, __webpack_require__) { |
| 103 |
|
| 104 |
module.exports = __webpack_require__(156); |
| 105 |
|
| 106 |
/***/ }), |
| 107 |
/* 2 */ |
| 108 |
/***/ (function(module, exports) { |
| 109 |
|
| 110 |
function _classCallCheck(instance, Constructor) { |
| 111 |
if (!(instance instanceof Constructor)) { |
| 112 |
throw new TypeError("Cannot call a class as a function"); |
| 113 |
} |
| 114 |
} |
| 115 |
|
| 116 |
module.exports = _classCallCheck; |
| 117 |
|
| 118 |
/***/ }), |
| 119 |
/* 3 */ |
| 120 |
/***/ (function(module, exports, __webpack_require__) { |
| 121 |
|
| 122 |
var _Object$defineProperty = __webpack_require__(1); |
| 123 |
|
| 124 |
function _defineProperties(target, props) { |
| 125 |
for (var i = 0; i < props.length; i++) { |
| 126 |
var descriptor = props[i]; |
| 127 |
descriptor.enumerable = descriptor.enumerable || false; |
| 128 |
descriptor.configurable = true; |
| 129 |
if ("value" in descriptor) descriptor.writable = true; |
| 130 |
|
| 131 |
_Object$defineProperty(target, descriptor.key, descriptor); |
| 132 |
} |
| 133 |
} |
| 134 |
|
| 135 |
function _createClass(Constructor, protoProps, staticProps) { |
| 136 |
if (protoProps) _defineProperties(Constructor.prototype, protoProps); |
| 137 |
if (staticProps) _defineProperties(Constructor, staticProps); |
| 138 |
return Constructor; |
| 139 |
} |
| 140 |
|
| 141 |
module.exports = _createClass; |
| 142 |
|
| 143 |
/***/ }), |
| 144 |
/* 4 */ |
| 145 |
/***/ (function(module, exports, __webpack_require__) { |
| 146 |
|
| 147 |
var _Object$create = __webpack_require__(139); |
| 148 |
|
| 149 |
var setPrototypeOf = __webpack_require__(137); |
| 150 |
|
| 151 |
function _inherits(subClass, superClass) { |
| 152 |
if (typeof superClass !== "function" && superClass !== null) { |
| 153 |
throw new TypeError("Super expression must either be null or a function"); |
| 154 |
} |
| 155 |
|
| 156 |
subClass.prototype = _Object$create(superClass && superClass.prototype, { |
| 157 |
constructor: { |
| 158 |
value: subClass, |
| 159 |
writable: true, |
| 160 |
configurable: true |
| 161 |
} |
| 162 |
}); |
| 163 |
if (superClass) setPrototypeOf(subClass, superClass); |
| 164 |
} |
| 165 |
|
| 166 |
module.exports = _inherits; |
| 167 |
|
| 168 |
/***/ }), |
| 169 |
/* 5 */ |
| 170 |
/***/ (function(module, exports, __webpack_require__) { |
| 171 |
|
| 172 |
var _Reflect$construct = __webpack_require__(107); |
| 173 |
|
| 174 |
var getPrototypeOf = __webpack_require__(16); |
| 175 |
|
| 176 |
var isNativeReflectConstruct = __webpack_require__(149); |
| 177 |
|
| 178 |
var possibleConstructorReturn = __webpack_require__(171); |
| 179 |
|
| 180 |
function _createSuper(Derived) { |
| 181 |
var hasNativeReflectConstruct = isNativeReflectConstruct(); |
| 182 |
return function _createSuperInternal() { |
| 183 |
var Super = getPrototypeOf(Derived), |
| 184 |
result; |
| 185 |
|
| 186 |
if (hasNativeReflectConstruct) { |
| 187 |
var NewTarget = getPrototypeOf(this).constructor; |
| 188 |
result = _Reflect$construct(Super, arguments, NewTarget); |
| 189 |
} else { |
| 190 |
result = Super.apply(this, arguments); |
| 191 |
} |
| 192 |
|
| 193 |
return possibleConstructorReturn(this, result); |
| 194 |
}; |
| 195 |
} |
| 196 |
|
| 197 |
module.exports = _createSuper; |
| 198 |
|
| 199 |
/***/ }), |
| 200 |
/* 6 */ |
| 201 |
/***/ (function(module, exports) { |
| 202 |
|
| 203 |
var core = module.exports = { version: '2.6.11' }; |
| 204 |
if (typeof __e == 'number') __e = core; // eslint-disable-line no-undef |
| 205 |
|
| 206 |
|
| 207 |
/***/ }), |
| 208 |
/* 7 */ |
| 209 |
/***/ (function(module, exports, __webpack_require__) { |
| 210 |
|
| 211 |
var global = __webpack_require__(8); |
| 212 |
var core = __webpack_require__(6); |
| 213 |
var ctx = __webpack_require__(31); |
| 214 |
var hide = __webpack_require__(24); |
| 215 |
var has = __webpack_require__(19); |
| 216 |
var PROTOTYPE = 'prototype'; |
| 217 |
|
| 218 |
var $export = function (type, name, source) { |
| 219 |
var IS_FORCED = type & $export.F; |
| 220 |
var IS_GLOBAL = type & $export.G; |
| 221 |
var IS_STATIC = type & $export.S; |
| 222 |
var IS_PROTO = type & $export.P; |
| 223 |
var IS_BIND = type & $export.B; |
| 224 |
var IS_WRAP = type & $export.W; |
| 225 |
var exports = IS_GLOBAL ? core : core[name] || (core[name] = {}); |
| 226 |
var expProto = exports[PROTOTYPE]; |
| 227 |
var target = IS_GLOBAL ? global : IS_STATIC ? global[name] : (global[name] || {})[PROTOTYPE]; |
| 228 |
var key, own, out; |
| 229 |
if (IS_GLOBAL) source = name; |
| 230 |
for (key in source) { |
| 231 |
// contains in native |
| 232 |
own = !IS_FORCED && target && target[key] !== undefined; |
| 233 |
if (own && has(exports, key)) continue; |
| 234 |
// export native or passed |
| 235 |
out = own ? target[key] : source[key]; |
| 236 |
// prevent global pollution for namespaces |
| 237 |
exports[key] = IS_GLOBAL && typeof target[key] != 'function' ? source[key] |
| 238 |
// bind timers to global for call from export context |
| 239 |
: IS_BIND && own ? ctx(out, global) |
| 240 |
// wrap global constructors for prevent change them in library |
| 241 |
: IS_WRAP && target[key] == out ? (function (C) { |
| 242 |
var F = function (a, b, c) { |
| 243 |
if (this instanceof C) { |
| 244 |
switch (arguments.length) { |
| 245 |
case 0: return new C(); |
| 246 |
case 1: return new C(a); |
| 247 |
case 2: return new C(a, b); |
| 248 |
} return new C(a, b, c); |
| 249 |
} return C.apply(this, arguments); |
| 250 |
}; |
| 251 |
F[PROTOTYPE] = C[PROTOTYPE]; |
| 252 |
return F; |
| 253 |
// make static versions for prototype methods |
| 254 |
})(out) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out; |
| 255 |
// export proto methods to core.%CONSTRUCTOR%.methods.%NAME% |
| 256 |
if (IS_PROTO) { |
| 257 |
(exports.virtual || (exports.virtual = {}))[key] = out; |
| 258 |
// export proto methods to core.%CONSTRUCTOR%.prototype.%NAME% |
| 259 |
if (type & $export.R && expProto && !expProto[key]) hide(expProto, key, out); |
| 260 |
} |
| 261 |
} |
| 262 |
}; |
| 263 |
// type bitmap |
| 264 |
$export.F = 1; // forced |
| 265 |
$export.G = 2; // global |
| 266 |
$export.S = 4; // static |
| 267 |
$export.P = 8; // proto |
| 268 |
$export.B = 16; // bind |
| 269 |
$export.W = 32; // wrap |
| 270 |
$export.U = 64; // safe |
| 271 |
$export.R = 128; // real proto method for `library` |
| 272 |
module.exports = $export; |
| 273 |
|
| 274 |
|
| 275 |
/***/ }), |
| 276 |
/* 8 */ |
| 277 |
/***/ (function(module, exports) { |
| 278 |
|
| 279 |
// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028 |
| 280 |
var global = module.exports = typeof window != 'undefined' && window.Math == Math |
| 281 |
? window : typeof self != 'undefined' && self.Math == Math ? self |
| 282 |
// eslint-disable-next-line no-new-func |
| 283 |
: Function('return this')(); |
| 284 |
if (typeof __g == 'number') __g = global; // eslint-disable-line no-undef |
| 285 |
|
| 286 |
|
| 287 |
/***/ }), |
| 288 |
/* 9 */ |
| 289 |
/***/ (function(module, exports) { |
| 290 |
|
| 291 |
module.exports = function (it) { |
| 292 |
return typeof it === 'object' ? it !== null : typeof it === 'function'; |
| 293 |
}; |
| 294 |
|
| 295 |
|
| 296 |
/***/ }), |
| 297 |
/* 10 */ |
| 298 |
/***/ (function(module, exports, __webpack_require__) { |
| 299 |
|
| 300 |
var store = __webpack_require__(76)('wks'); |
| 301 |
var uid = __webpack_require__(59); |
| 302 |
var Symbol = __webpack_require__(8).Symbol; |
| 303 |
var USE_SYMBOL = typeof Symbol == 'function'; |
| 304 |
|
| 305 |
var $exports = module.exports = function (name) { |
| 306 |
return store[name] || (store[name] = |
| 307 |
USE_SYMBOL && Symbol[name] || (USE_SYMBOL ? Symbol : uid)('Symbol.' + name)); |
| 308 |
}; |
| 309 |
|
| 310 |
$exports.store = store; |
| 311 |
|
| 312 |
|
| 313 |
/***/ }), |
| 314 |
/* 11 */ |
| 315 |
/***/ (function(module, exports) { |
| 316 |
|
| 317 |
module.exports = React; |
| 318 |
|
| 319 |
/***/ }), |
| 320 |
/* 12 */ |
| 321 |
/***/ (function(module, exports, __webpack_require__) { |
| 322 |
|
| 323 |
var store = __webpack_require__(67)('wks'); |
| 324 |
var uid = __webpack_require__(68); |
| 325 |
var Symbol = __webpack_require__(17).Symbol; |
| 326 |
var USE_SYMBOL = typeof Symbol == 'function'; |
| 327 |
|
| 328 |
var $exports = module.exports = function (name) { |
| 329 |
return store[name] || (store[name] = |
| 330 |
USE_SYMBOL && Symbol[name] || (USE_SYMBOL ? Symbol : uid)('Symbol.' + name)); |
| 331 |
}; |
| 332 |
|
| 333 |
$exports.store = store; |
| 334 |
|
| 335 |
|
| 336 |
/***/ }), |
| 337 |
/* 13 */ |
| 338 |
/***/ (function(module, exports, __webpack_require__) { |
| 339 |
|
| 340 |
var isObject = __webpack_require__(9); |
| 341 |
module.exports = function (it) { |
| 342 |
if (!isObject(it)) throw TypeError(it + ' is not an object!'); |
| 343 |
return it; |
| 344 |
}; |
| 345 |
|
| 346 |
|
| 347 |
/***/ }), |
| 348 |
/* 14 */ |
| 349 |
/***/ (function(module, exports, __webpack_require__) { |
| 350 |
|
| 351 |
// Thank's IE8 for his funny defineProperty |
| 352 |
module.exports = !__webpack_require__(22)(function () { |
| 353 |
return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7; |
| 354 |
}); |
| 355 |
|
| 356 |
|
| 357 |
/***/ }), |
| 358 |
/* 15 */ |
| 359 |
/***/ (function(module, exports, __webpack_require__) { |
| 360 |
|
| 361 |
var anObject = __webpack_require__(13); |
| 362 |
var IE8_DOM_DEFINE = __webpack_require__(114); |
| 363 |
var toPrimitive = __webpack_require__(74); |
| 364 |
var dP = Object.defineProperty; |
| 365 |
|
| 366 |
exports.f = __webpack_require__(14) ? Object.defineProperty : function defineProperty(O, P, Attributes) { |
| 367 |
anObject(O); |
| 368 |
P = toPrimitive(P, true); |
| 369 |
anObject(Attributes); |
| 370 |
if (IE8_DOM_DEFINE) try { |
| 371 |
return dP(O, P, Attributes); |
| 372 |
} catch (e) { /* empty */ } |
| 373 |
if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported!'); |
| 374 |
if ('value' in Attributes) O[P] = Attributes.value; |
| 375 |
return O; |
| 376 |
}; |
| 377 |
|
| 378 |
|
| 379 |
/***/ }), |
| 380 |
/* 16 */ |
| 381 |
/***/ (function(module, exports, __webpack_require__) { |
| 382 |
|
| 383 |
var _Object$getPrototypeOf = __webpack_require__(158); |
| 384 |
|
| 385 |
var _Object$setPrototypeOf = __webpack_require__(115); |
| 386 |
|
| 387 |
function _getPrototypeOf(o) { |
| 388 |
module.exports = _getPrototypeOf = _Object$setPrototypeOf ? _Object$getPrototypeOf : function _getPrototypeOf(o) { |
| 389 |
return o.__proto__ || _Object$getPrototypeOf(o); |
| 390 |
}; |
| 391 |
return _getPrototypeOf(o); |
| 392 |
} |
| 393 |
|
| 394 |
module.exports = _getPrototypeOf; |
| 395 |
|
| 396 |
/***/ }), |
| 397 |
/* 17 */ |
| 398 |
/***/ (function(module, exports) { |
| 399 |
|
| 400 |
// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028 |
| 401 |
var global = module.exports = typeof window != 'undefined' && window.Math == Math |
| 402 |
? window : typeof self != 'undefined' && self.Math == Math ? self |
| 403 |
// eslint-disable-next-line no-new-func |
| 404 |
: Function('return this')(); |
| 405 |
if (typeof __g == 'number') __g = global; // eslint-disable-line no-undef |
| 406 |
|
| 407 |
|
| 408 |
/***/ }), |
| 409 |
/* 18 */ |
| 410 |
/***/ (function(module, exports, __webpack_require__) { |
| 411 |
|
| 412 |
var isObject = __webpack_require__(30); |
| 413 |
module.exports = function (it) { |
| 414 |
if (!isObject(it)) throw TypeError(it + ' is not an object!'); |
| 415 |
return it; |
| 416 |
}; |
| 417 |
|
| 418 |
|
| 419 |
/***/ }), |
| 420 |
/* 19 */ |
| 421 |
/***/ (function(module, exports) { |
| 422 |
|
| 423 |
var hasOwnProperty = {}.hasOwnProperty; |
| 424 |
module.exports = function (it, key) { |
| 425 |
return hasOwnProperty.call(it, key); |
| 426 |
}; |
| 427 |
|
| 428 |
|
| 429 |
/***/ }), |
| 430 |
/* 20 */ |
| 431 |
/***/ (function(module, exports, __webpack_require__) { |
| 432 |
|
| 433 |
// to indexed object, toObject with fallback for non-array-like ES3 strings |
| 434 |
var IObject = __webpack_require__(104); |
| 435 |
var defined = __webpack_require__(65); |
| 436 |
module.exports = function (it) { |
| 437 |
return IObject(defined(it)); |
| 438 |
}; |
| 439 |
|
| 440 |
|
| 441 |
/***/ }), |
| 442 |
/* 21 */ |
| 443 |
/***/ (function(module, exports, __webpack_require__) { |
| 444 |
|
| 445 |
"use strict"; |
| 446 |
|
| 447 |
|
| 448 |
var _interopRequireDefault = __webpack_require__(0); |
| 449 |
|
| 450 |
var _Object$defineProperty = __webpack_require__(1); |
| 451 |
|
| 452 |
_Object$defineProperty(exports, "__esModule", { |
| 453 |
value: true |
| 454 |
}); |
| 455 |
|
| 456 |
exports.default = void 0; |
| 457 |
|
| 458 |
var _typeof2 = _interopRequireDefault(__webpack_require__(48)); |
| 459 |
|
| 460 |
var _regenerator = _interopRequireDefault(__webpack_require__(82)); |
| 461 |
|
| 462 |
__webpack_require__(147); |
| 463 |
|
| 464 |
__webpack_require__(117); |
| 465 |
|
| 466 |
__webpack_require__(72); |
| 467 |
|
| 468 |
__webpack_require__(271); |
| 469 |
|
| 470 |
var _promise = _interopRequireDefault(__webpack_require__(133)); |
| 471 |
|
| 472 |
var _isArray = _interopRequireDefault(__webpack_require__(84)); |
| 473 |
|
| 474 |
__webpack_require__(66); |
| 475 |
|
| 476 |
var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(83)); |
| 477 |
|
| 478 |
var _classCallCheck2 = _interopRequireDefault(__webpack_require__(2)); |
| 479 |
|
| 480 |
var _assertThisInitialized2 = _interopRequireDefault(__webpack_require__(49)); |
| 481 |
|
| 482 |
var _createClass2 = _interopRequireDefault(__webpack_require__(3)); |
| 483 |
|
| 484 |
var _inherits2 = _interopRequireDefault(__webpack_require__(4)); |
| 485 |
|
| 486 |
var _createSuper2 = _interopRequireDefault(__webpack_require__(5)); |
| 487 |
|
| 488 |
var _defineProperty2 = _interopRequireDefault(__webpack_require__(28)); |
| 489 |
|
| 490 |
var _argsObject = _interopRequireDefault(__webpack_require__(223)); |
| 491 |
|
| 492 |
var CommandBase = /*#__PURE__*/function (_ArgsObject) { |
| 493 |
(0, _inherits2.default)(CommandBase, _ArgsObject); |
| 494 |
|
| 495 |
var _super = (0, _createSuper2.default)(CommandBase); |
| 496 |
|
| 497 |
(0, _createClass2.default)(CommandBase, null, [{ |
| 498 |
key: "getInstanceType", |
| 499 |
value: function getInstanceType() { |
| 500 |
return 'CommandBase'; |
| 501 |
} |
| 502 |
/** |
| 503 |
* Current component. |
| 504 |
* |
| 505 |
* @type {Component} |
| 506 |
*/ |
| 507 |
|
| 508 |
}]); |
| 509 |
|
| 510 |
/** |
| 511 |
* Function constructor(). |
| 512 |
* |
| 513 |
* Create Commands Base. |
| 514 |
* |
| 515 |
* @param [args={}] |
| 516 |
* @param [commandsAPI={}] |
| 517 |
*/ |
| 518 |
function CommandBase(args) { |
| 519 |
var _this; |
| 520 |
|
| 521 |
var commandsAPI = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : $e.commands; |
| 522 |
(0, _classCallCheck2.default)(this, CommandBase); |
| 523 |
_this = _super.call(this, args); // Acknowledge self about which command it run. |
| 524 |
|
| 525 |
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "component", void 0); |
| 526 |
_this.currentCommand = commandsAPI.getCurrentLast(); // Assign instance of current component. |
| 527 |
|
| 528 |
_this.component = commandsAPI.getComponent(_this.currentCommand); // Who ever need do something before without `super` the constructor can use `initialize` method. |
| 529 |
|
| 530 |
_this.initialize(args); // Refresh args, maybe the changed via `initialize`. |
| 531 |
|
| 532 |
|
| 533 |
args = _this.args; // Validate args before run. |
| 534 |
|
| 535 |
_this.validateArgs(args); |
| 536 |
|
| 537 |
return _this; |
| 538 |
} |
| 539 |
/** |
| 540 |
* Function requireContainer(). |
| 541 |
* |
| 542 |
* Validate `arg.container` & `arg.containers`. |
| 543 |
* |
| 544 |
* @param {{}} args |
| 545 |
* |
| 546 |
* @throws {Error} |
| 547 |
*/ |
| 548 |
|
| 549 |
|
| 550 |
(0, _createClass2.default)(CommandBase, [{ |
| 551 |
key: "requireContainer", |
| 552 |
value: function requireContainer() { |
| 553 |
var _this2 = this; |
| 554 |
|
| 555 |
var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.args; |
| 556 |
|
| 557 |
if (!args.container && !args.containers) { |
| 558 |
throw Error('container or containers are required.'); |
| 559 |
} |
| 560 |
|
| 561 |
if (args.container && args.containers) { |
| 562 |
throw Error('container and containers cannot go together please select one of them.'); |
| 563 |
} |
| 564 |
|
| 565 |
var containers = args.containers || [args.container]; |
| 566 |
containers.forEach(function (container) { |
| 567 |
_this2.requireArgumentInstance('container', elementorModules.editor.Container, { |
| 568 |
container: container |
| 569 |
}); |
| 570 |
}); |
| 571 |
} |
| 572 |
/** |
| 573 |
* Function initialize(). |
| 574 |
* |
| 575 |
* Initialize command, called after construction. |
| 576 |
* |
| 577 |
* @param [args={}] |
| 578 |
*/ |
| 579 |
|
| 580 |
}, { |
| 581 |
key: "initialize", |
| 582 |
value: function initialize() { |
| 583 |
var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; |
| 584 |
} // eslint-disable-line no-unused-vars |
| 585 |
|
| 586 |
/** |
| 587 |
* Function validateArgs(). |
| 588 |
* |
| 589 |
* Validate command arguments. |
| 590 |
* |
| 591 |
* @param [args={}] |
| 592 |
*/ |
| 593 |
|
| 594 |
}, { |
| 595 |
key: "validateArgs", |
| 596 |
value: function validateArgs() { |
| 597 |
var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; |
| 598 |
} // eslint-disable-line no-unused-vars |
| 599 |
|
| 600 |
/** |
| 601 |
* Function isDataChanged(). |
| 602 |
* |
| 603 |
* Whether the editor needs to set change flag on/off. |
| 604 |
* |
| 605 |
* @returns {boolean} |
| 606 |
*/ |
| 607 |
|
| 608 |
}, { |
| 609 |
key: "isDataChanged", |
| 610 |
value: function isDataChanged() { |
| 611 |
return false; |
| 612 |
} |
| 613 |
/** |
| 614 |
* Function apply(). |
| 615 |
* |
| 616 |
* Do the actual command. |
| 617 |
* |
| 618 |
* @param [args={}] |
| 619 |
* |
| 620 |
* @returns {*} |
| 621 |
*/ |
| 622 |
|
| 623 |
}, { |
| 624 |
key: "apply", |
| 625 |
value: function apply() { |
| 626 |
var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; |
| 627 |
// eslint-disable-line no-unused-vars |
| 628 |
elementorModules.ForceMethodImplementation(); |
| 629 |
} |
| 630 |
/** |
| 631 |
* Function run(). |
| 632 |
* |
| 633 |
* Run command with history & hooks. |
| 634 |
* |
| 635 |
* @returns {*} |
| 636 |
*/ |
| 637 |
|
| 638 |
}, { |
| 639 |
key: "run", |
| 640 |
value: function run() { |
| 641 |
var result; // For UI Hooks. |
| 642 |
|
| 643 |
this.onBeforeRun(this.args); |
| 644 |
|
| 645 |
try { |
| 646 |
// For Data hooks. |
| 647 |
this.onBeforeApply(this.args); |
| 648 |
result = this.apply(this.args); |
| 649 |
} catch (e) { |
| 650 |
this.onCatchApply(e); // Catch 'Hook-Break' that comes from hooks base. |
| 651 |
|
| 652 |
if (e instanceof $e.modules.HookBreak) { |
| 653 |
// Bypass. |
| 654 |
return false; |
| 655 |
} |
| 656 |
} |
| 657 |
|
| 658 |
return this.runAfter(result); |
| 659 |
} |
| 660 |
}, { |
| 661 |
key: "runAfter", |
| 662 |
value: function runAfter(result) { |
| 663 |
var _this3 = this; |
| 664 |
|
| 665 |
var onAfter = function onAfter(_result) { |
| 666 |
// Run Data hooks. |
| 667 |
_this3.onAfterApply(_this3.args, _result); // TODO: Create Command-Base for Command-Document and apply it on after. |
| 668 |
|
| 669 |
|
| 670 |
if (_this3.isDataChanged()) { |
| 671 |
$e.internal('document/save/set-is-modified', { |
| 672 |
status: true |
| 673 |
}); |
| 674 |
} // For UI hooks. |
| 675 |
|
| 676 |
|
| 677 |
_this3.onAfterRun(_this3.args, _result); |
| 678 |
}, |
| 679 |
asyncOnAfter = /*#__PURE__*/function () { |
| 680 |
var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(_result) { |
| 681 |
var results, promises; |
| 682 |
return _regenerator.default.wrap(function _callee$(_context) { |
| 683 |
while (1) { |
| 684 |
switch (_context.prev = _context.next) { |
| 685 |
case 0: |
| 686 |
// Run Data hooks. |
| 687 |
results = _this3.onAfterApply(_this3.args, _result), promises = (0, _isArray.default)(results) ? results.flat().filter(function (filtered) { |
| 688 |
return filtered instanceof _promise.default; |
| 689 |
}) : []; |
| 690 |
|
| 691 |
if (!promises.length) { |
| 692 |
_context.next = 4; |
| 693 |
break; |
| 694 |
} |
| 695 |
|
| 696 |
_context.next = 4; |
| 697 |
return _promise.default.all(promises); |
| 698 |
|
| 699 |
case 4: |
| 700 |
if (_this3.isDataChanged()) { |
| 701 |
// TODO: Create Command-Base for Command-Document and apply it on after. |
| 702 |
$e.internal('document/save/set-is-modified', { |
| 703 |
status: true |
| 704 |
}); |
| 705 |
} // For UI hooks. |
| 706 |
|
| 707 |
|
| 708 |
_this3.onAfterRun(_this3.args, _result); |
| 709 |
|
| 710 |
case 6: |
| 711 |
case "end": |
| 712 |
return _context.stop(); |
| 713 |
} |
| 714 |
} |
| 715 |
}, _callee); |
| 716 |
})); |
| 717 |
|
| 718 |
return function asyncOnAfter(_x) { |
| 719 |
return _ref.apply(this, arguments); |
| 720 |
}; |
| 721 |
}(); // TODO: Temp code determine if it's a jQuery deferred object. |
| 722 |
|
| 723 |
|
| 724 |
if (result && 'object' === (0, _typeof2.default)(result) && result.promise && result.then && result.fail) { |
| 725 |
result.fail(this.onCatchApply.bind(this)); |
| 726 |
result.done(onAfter); |
| 727 |
} else if (result instanceof _promise.default) { |
| 728 |
// Override initial result ( promise ) to await onAfter promises, first!. |
| 729 |
return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2() { |
| 730 |
return _regenerator.default.wrap(function _callee2$(_context2) { |
| 731 |
while (1) { |
| 732 |
switch (_context2.prev = _context2.next) { |
| 733 |
case 0: |
| 734 |
_context2.next = 2; |
| 735 |
return result.catch(_this3.onCatchApply.bind(_this3)); |
| 736 |
|
| 737 |
case 2: |
| 738 |
_context2.next = 4; |
| 739 |
return result.then(function (_result) { |
| 740 |
return asyncOnAfter(_result); |
| 741 |
}); |
| 742 |
|
| 743 |
case 4: |
| 744 |
return _context2.abrupt("return", result); |
| 745 |
|
| 746 |
case 5: |
| 747 |
case "end": |
| 748 |
return _context2.stop(); |
| 749 |
} |
| 750 |
} |
| 751 |
}, _callee2); |
| 752 |
}))(); |
| 753 |
} else { |
| 754 |
onAfter(result); |
| 755 |
} |
| 756 |
|
| 757 |
return result; |
| 758 |
} |
| 759 |
/** |
| 760 |
* Function onBeforeRun. |
| 761 |
* |
| 762 |
* Called before run(). |
| 763 |
* |
| 764 |
* @param [args={}] |
| 765 |
*/ |
| 766 |
|
| 767 |
}, { |
| 768 |
key: "onBeforeRun", |
| 769 |
value: function onBeforeRun() { |
| 770 |
var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; |
| 771 |
$e.hooks.runUIBefore(this.currentCommand, args); |
| 772 |
} |
| 773 |
/** |
| 774 |
* Function onAfterRun. |
| 775 |
* |
| 776 |
* Called after run(). |
| 777 |
* |
| 778 |
* @param [args={}] |
| 779 |
* @param [result={*}] |
| 780 |
*/ |
| 781 |
|
| 782 |
}, { |
| 783 |
key: "onAfterRun", |
| 784 |
value: function onAfterRun() { |
| 785 |
var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; |
| 786 |
var result = arguments.length > 1 ? arguments[1] : undefined; |
| 787 |
$e.hooks.runUIAfter(this.currentCommand, args, result); |
| 788 |
} |
| 789 |
/** |
| 790 |
* Function onBeforeApply. |
| 791 |
* |
| 792 |
* Called before apply(). |
| 793 |
* |
| 794 |
* @param [args={}] |
| 795 |
*/ |
| 796 |
|
| 797 |
}, { |
| 798 |
key: "onBeforeApply", |
| 799 |
value: function onBeforeApply() { |
| 800 |
var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; |
| 801 |
$e.hooks.runDataDependency(this.currentCommand, args); |
| 802 |
} |
| 803 |
/** |
| 804 |
* Function onAfterApply. |
| 805 |
* |
| 806 |
* Called after apply(). |
| 807 |
* |
| 808 |
* @param [args={}] |
| 809 |
* @param [result={*}] |
| 810 |
*/ |
| 811 |
|
| 812 |
}, { |
| 813 |
key: "onAfterApply", |
| 814 |
value: function onAfterApply() { |
| 815 |
var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; |
| 816 |
var result = arguments.length > 1 ? arguments[1] : undefined; |
| 817 |
return $e.hooks.runDataAfter(this.currentCommand, args, result); |
| 818 |
} |
| 819 |
/** |
| 820 |
* Function onCatchApply. |
| 821 |
* |
| 822 |
* Called after apply() failed. |
| 823 |
* |
| 824 |
* @param {Error} e |
| 825 |
*/ |
| 826 |
|
| 827 |
}, { |
| 828 |
key: "onCatchApply", |
| 829 |
value: function onCatchApply(e) { |
| 830 |
$e.hooks.runDataCatch(this.currentCommand, this.args, e); |
| 831 |
elementorCommon.helpers.consoleError(e); |
| 832 |
$e.hooks.runUICatch(this.currentCommand, this.args, e); |
| 833 |
} |
| 834 |
}]); |
| 835 |
return CommandBase; |
| 836 |
}(_argsObject.default); |
| 837 |
|
| 838 |
exports.default = CommandBase; |
| 839 |
|
| 840 |
/***/ }), |
| 841 |
/* 22 */ |
| 842 |
/***/ (function(module, exports) { |
| 843 |
|
| 844 |
module.exports = function (exec) { |
| 845 |
try { |
| 846 |
return !!exec(); |
| 847 |
} catch (e) { |
| 848 |
return true; |
| 849 |
} |
| 850 |
}; |
| 851 |
|
| 852 |
|
| 853 |
/***/ }), |
| 854 |
/* 23 */ |
| 855 |
/***/ (function(module, exports, __webpack_require__) { |
| 856 |
|
| 857 |
module.exports = __webpack_require__(201); |
| 858 |
|
| 859 |
/***/ }), |
| 860 |
/* 24 */ |
| 861 |
/***/ (function(module, exports, __webpack_require__) { |
| 862 |
|
| 863 |
var dP = __webpack_require__(15); |
| 864 |
var createDesc = __webpack_require__(44); |
| 865 |
module.exports = __webpack_require__(14) ? function (object, key, value) { |
| 866 |
return dP.f(object, key, createDesc(1, value)); |
| 867 |
} : function (object, key, value) { |
| 868 |
object[key] = value; |
| 869 |
return object; |
| 870 |
}; |
| 871 |
|
| 872 |
|
| 873 |
/***/ }), |
| 874 |
/* 25 */ |
| 875 |
/***/ (function(module, exports, __webpack_require__) { |
| 876 |
|
| 877 |
"use strict"; |
| 878 |
|
| 879 |
// 22.1.3.8 Array.prototype.find(predicate, thisArg = undefined) |
| 880 |
var $export = __webpack_require__(34); |
| 881 |
var $find = __webpack_require__(182)(5); |
| 882 |
var KEY = 'find'; |
| 883 |
var forced = true; |
| 884 |
// Shouldn't skip holes |
| 885 |
if (KEY in []) Array(1)[KEY](function () { forced = false; }); |
| 886 |
$export($export.P + $export.F * forced, 'Array', { |
| 887 |
find: function find(callbackfn /* , that = undefined */) { |
| 888 |
return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); |
| 889 |
} |
| 890 |
}); |
| 891 |
__webpack_require__(87)(KEY); |
| 892 |
|
| 893 |
|
| 894 |
/***/ }), |
| 895 |
/* 26 */ |
| 896 |
/***/ (function(module, exports, __webpack_require__) { |
| 897 |
|
| 898 |
var _Object$getOwnPropertyDescriptor = __webpack_require__(124); |
| 899 |
|
| 900 |
var _Reflect$get = __webpack_require__(193); |
| 901 |
|
| 902 |
var superPropBase = __webpack_require__(196); |
| 903 |
|
| 904 |
function _get(target, property, receiver) { |
| 905 |
if (typeof Reflect !== "undefined" && _Reflect$get) { |
| 906 |
module.exports = _get = _Reflect$get; |
| 907 |
} else { |
| 908 |
module.exports = _get = function _get(target, property, receiver) { |
| 909 |
var base = superPropBase(target, property); |
| 910 |
if (!base) return; |
| 911 |
|
| 912 |
var desc = _Object$getOwnPropertyDescriptor(base, property); |
| 913 |
|
| 914 |
if (desc.get) { |
| 915 |
return desc.get.call(receiver); |
| 916 |
} |
| 917 |
|
| 918 |
return desc.value; |
| 919 |
}; |
| 920 |
} |
| 921 |
|
| 922 |
return _get(target, property, receiver || target); |
| 923 |
} |
| 924 |
|
| 925 |
module.exports = _get; |
| 926 |
|
| 927 |
/***/ }), |
| 928 |
/* 27 */ |
| 929 |
/***/ (function(module, exports, __webpack_require__) { |
| 930 |
|
| 931 |
// Thank's IE8 for his funny defineProperty |
| 932 |
module.exports = !__webpack_require__(33)(function () { |
| 933 |
return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7; |
| 934 |
}); |
| 935 |
|
| 936 |
|
| 937 |
/***/ }), |
| 938 |
/* 28 */ |
| 939 |
/***/ (function(module, exports, __webpack_require__) { |
| 940 |
|
| 941 |
var _Object$defineProperty = __webpack_require__(1); |
| 942 |
|
| 943 |
function _defineProperty(obj, key, value) { |
| 944 |
if (key in obj) { |
| 945 |
_Object$defineProperty(obj, key, { |
| 946 |
value: value, |
| 947 |
enumerable: true, |
| 948 |
configurable: true, |
| 949 |
writable: true |
| 950 |
}); |
| 951 |
} else { |
| 952 |
obj[key] = value; |
| 953 |
} |
| 954 |
|
| 955 |
return obj; |
| 956 |
} |
| 957 |
|
| 958 |
module.exports = _defineProperty; |
| 959 |
|
| 960 |
/***/ }), |
| 961 |
/* 29 */ |
| 962 |
/***/ (function(module, exports, __webpack_require__) { |
| 963 |
|
| 964 |
var dP = __webpack_require__(45); |
| 965 |
var createDesc = __webpack_require__(103); |
| 966 |
module.exports = __webpack_require__(27) ? function (object, key, value) { |
| 967 |
return dP.f(object, key, createDesc(1, value)); |
| 968 |
} : function (object, key, value) { |
| 969 |
object[key] = value; |
| 970 |
return object; |
| 971 |
}; |
| 972 |
|
| 973 |
|
| 974 |
/***/ }), |
| 975 |
/* 30 */ |
| 976 |
/***/ (function(module, exports) { |
| 977 |
|
| 978 |
module.exports = function (it) { |
| 979 |
return typeof it === 'object' ? it !== null : typeof it === 'function'; |
| 980 |
}; |
| 981 |
|
| 982 |
|
| 983 |
/***/ }), |
| 984 |
/* 31 */ |
| 985 |
/***/ (function(module, exports, __webpack_require__) { |
| 986 |
|
| 987 |
// optional / simple context binding |
| 988 |
var aFunction = __webpack_require__(38); |
| 989 |
module.exports = function (fn, that, length) { |
| 990 |
aFunction(fn); |
| 991 |
if (that === undefined) return fn; |
| 992 |
switch (length) { |
| 993 |
case 1: return function (a) { |
| 994 |
return fn.call(that, a); |
| 995 |
}; |
| 996 |
case 2: return function (a, b) { |
| 997 |
return fn.call(that, a, b); |
| 998 |
}; |
| 999 |
case 3: return function (a, b, c) { |
| 1000 |
return fn.call(that, a, b, c); |
| 1001 |
}; |
| 1002 |
} |
| 1003 |
return function (/* ...args */) { |
| 1004 |
return fn.apply(that, arguments); |
| 1005 |
}; |
| 1006 |
}; |
| 1007 |
|
| 1008 |
|
| 1009 |
/***/ }), |
| 1010 |
/* 32 */ |
| 1011 |
/***/ (function(module, exports, __webpack_require__) { |
| 1012 |
|
| 1013 |
// 7.1.13 ToObject(argument) |
| 1014 |
var defined = __webpack_require__(65); |
| 1015 |
module.exports = function (it) { |
| 1016 |
return Object(defined(it)); |
| 1017 |
}; |
| 1018 |
|
| 1019 |
|
| 1020 |
/***/ }), |
| 1021 |
/* 33 */ |
| 1022 |
/***/ (function(module, exports) { |
| 1023 |
|
| 1024 |
module.exports = function (exec) { |
| 1025 |
try { |
| 1026 |
return !!exec(); |
| 1027 |
} catch (e) { |
| 1028 |
return true; |
| 1029 |
} |
| 1030 |
}; |
| 1031 |
|
| 1032 |
|
| 1033 |
/***/ }), |
| 1034 |
/* 34 */ |
| 1035 |
/***/ (function(module, exports, __webpack_require__) { |
| 1036 |
|
| 1037 |
var global = __webpack_require__(17); |
| 1038 |
var core = __webpack_require__(54); |
| 1039 |
var hide = __webpack_require__(29); |
| 1040 |
var redefine = __webpack_require__(37); |
| 1041 |
var ctx = __webpack_require__(73); |
| 1042 |
var PROTOTYPE = 'prototype'; |
| 1043 |
|
| 1044 |
var $export = function (type, name, source) { |
| 1045 |
var IS_FORCED = type & $export.F; |
| 1046 |
var IS_GLOBAL = type & $export.G; |
| 1047 |
var IS_STATIC = type & $export.S; |
| 1048 |
var IS_PROTO = type & $export.P; |
| 1049 |
var IS_BIND = type & $export.B; |
| 1050 |
var target = IS_GLOBAL ? global : IS_STATIC ? global[name] || (global[name] = {}) : (global[name] || {})[PROTOTYPE]; |
| 1051 |
var exports = IS_GLOBAL ? core : core[name] || (core[name] = {}); |
| 1052 |
var expProto = exports[PROTOTYPE] || (exports[PROTOTYPE] = {}); |
| 1053 |
var key, own, out, exp; |
| 1054 |
if (IS_GLOBAL) source = name; |
| 1055 |
for (key in source) { |
| 1056 |
// contains in native |
| 1057 |
own = !IS_FORCED && target && target[key] !== undefined; |
| 1058 |
// export native or passed |
| 1059 |
out = (own ? target : source)[key]; |
| 1060 |
// bind timers to global for call from export context |
| 1061 |
exp = IS_BIND && own ? ctx(out, global) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out; |
| 1062 |
// extend global |
| 1063 |
if (target) redefine(target, key, out, type & $export.U); |
| 1064 |
// export |
| 1065 |
if (exports[key] != out) hide(exports, key, exp); |
| 1066 |
if (IS_PROTO && expProto[key] != out) expProto[key] = out; |
| 1067 |
} |
| 1068 |
}; |
| 1069 |
global.core = core; |
| 1070 |
// type bitmap |
| 1071 |
$export.F = 1; // forced |
| 1072 |
$export.G = 2; // global |
| 1073 |
$export.S = 4; // static |
| 1074 |
$export.P = 8; // proto |
| 1075 |
$export.B = 16; // bind |
| 1076 |
$export.W = 32; // wrap |
| 1077 |
$export.U = 64; // safe |
| 1078 |
$export.R = 128; // real proto method for `library` |
| 1079 |
module.exports = $export; |
| 1080 |
|
| 1081 |
|
| 1082 |
/***/ }), |
| 1083 |
/* 35 */ |
| 1084 |
/***/ (function(module, exports) { |
| 1085 |
|
| 1086 |
module.exports = {}; |
| 1087 |
|
| 1088 |
|
| 1089 |
/***/ }), |
| 1090 |
/* 36 */ |
| 1091 |
/***/ (function(module, exports, __webpack_require__) { |
| 1092 |
|
| 1093 |
var _Object$getOwnPropertyDescriptor = __webpack_require__(124); |
| 1094 |
|
| 1095 |
var _Object$defineProperty = __webpack_require__(1); |
| 1096 |
|
| 1097 |
var _typeof = __webpack_require__(48); |
| 1098 |
|
| 1099 |
var _WeakMap = __webpack_require__(263); |
| 1100 |
|
| 1101 |
function _getRequireWildcardCache() { |
| 1102 |
if (typeof _WeakMap !== "function") return null; |
| 1103 |
var cache = new _WeakMap(); |
| 1104 |
|
| 1105 |
_getRequireWildcardCache = function _getRequireWildcardCache() { |
| 1106 |
return cache; |
| 1107 |
}; |
| 1108 |
|
| 1109 |
return cache; |
| 1110 |
} |
| 1111 |
|
| 1112 |
function _interopRequireWildcard(obj) { |
| 1113 |
if (obj && obj.__esModule) { |
| 1114 |
return obj; |
| 1115 |
} |
| 1116 |
|
| 1117 |
if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { |
| 1118 |
return { |
| 1119 |
"default": obj |
| 1120 |
}; |
| 1121 |
} |
| 1122 |
|
| 1123 |
var cache = _getRequireWildcardCache(); |
| 1124 |
|
| 1125 |
if (cache && cache.has(obj)) { |
| 1126 |
return cache.get(obj); |
| 1127 |
} |
| 1128 |
|
| 1129 |
var newObj = {}; |
| 1130 |
var hasPropertyDescriptor = _Object$defineProperty && _Object$getOwnPropertyDescriptor; |
| 1131 |
|
| 1132 |
for (var key in obj) { |
| 1133 |
if (Object.prototype.hasOwnProperty.call(obj, key)) { |
| 1134 |
var desc = hasPropertyDescriptor ? _Object$getOwnPropertyDescriptor(obj, key) : null; |
| 1135 |
|
| 1136 |
if (desc && (desc.get || desc.set)) { |
| 1137 |
_Object$defineProperty(newObj, key, desc); |
| 1138 |
} else { |
| 1139 |
newObj[key] = obj[key]; |
| 1140 |
} |
| 1141 |
} |
| 1142 |
} |
| 1143 |
|
| 1144 |
newObj["default"] = obj; |
| 1145 |
|
| 1146 |
if (cache) { |
| 1147 |
cache.set(obj, newObj); |
| 1148 |
} |
| 1149 |
|
| 1150 |
return newObj; |
| 1151 |
} |
| 1152 |
|
| 1153 |
module.exports = _interopRequireWildcard; |
| 1154 |
|
| 1155 |
/***/ }), |
| 1156 |
/* 37 */ |
| 1157 |
/***/ (function(module, exports, __webpack_require__) { |
| 1158 |
|
| 1159 |
var global = __webpack_require__(17); |
| 1160 |
var hide = __webpack_require__(29); |
| 1161 |
var has = __webpack_require__(61); |
| 1162 |
var SRC = __webpack_require__(68)('src'); |
| 1163 |
var $toString = __webpack_require__(145); |
| 1164 |
var TO_STRING = 'toString'; |
| 1165 |
var TPL = ('' + $toString).split(TO_STRING); |
| 1166 |
|
| 1167 |
__webpack_require__(54).inspectSource = function (it) { |
| 1168 |
return $toString.call(it); |
| 1169 |
}; |
| 1170 |
|
| 1171 |
(module.exports = function (O, key, val, safe) { |
| 1172 |
var isFunction = typeof val == 'function'; |
| 1173 |
if (isFunction) has(val, 'name') || hide(val, 'name', key); |
| 1174 |
if (O[key] === val) return; |
| 1175 |
if (isFunction) has(val, SRC) || hide(val, SRC, O[key] ? '' + O[key] : TPL.join(String(key))); |
| 1176 |
if (O === global) { |
| 1177 |
O[key] = val; |
| 1178 |
} else if (!safe) { |
| 1179 |
delete O[key]; |
| 1180 |
hide(O, key, val); |
| 1181 |
} else if (O[key]) { |
| 1182 |
O[key] = val; |
| 1183 |
} else { |
| 1184 |
hide(O, key, val); |
| 1185 |
} |
| 1186 |
// add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative |
| 1187 |
})(Function.prototype, TO_STRING, function toString() { |
| 1188 |
return typeof this == 'function' && this[SRC] || $toString.call(this); |
| 1189 |
}); |
| 1190 |
|
| 1191 |
|
| 1192 |
/***/ }), |
| 1193 |
/* 38 */ |
| 1194 |
/***/ (function(module, exports) { |
| 1195 |
|
| 1196 |
module.exports = function (it) { |
| 1197 |
if (typeof it != 'function') throw TypeError(it + ' is not a function!'); |
| 1198 |
return it; |
| 1199 |
}; |
| 1200 |
|
| 1201 |
|
| 1202 |
/***/ }), |
| 1203 |
/* 39 */ |
| 1204 |
/***/ (function(module, exports, __webpack_require__) { |
| 1205 |
|
| 1206 |
var dP = __webpack_require__(45).f; |
| 1207 |
var FProto = Function.prototype; |
| 1208 |
var nameRE = /^\s*function ([^ (]*)/; |
| 1209 |
var NAME = 'name'; |
| 1210 |
|
| 1211 |
// 19.2.4.2 name |
| 1212 |
NAME in FProto || __webpack_require__(27) && dP(FProto, NAME, { |
| 1213 |
configurable: true, |
| 1214 |
get: function () { |
| 1215 |
try { |
| 1216 |
return ('' + this).match(nameRE)[1]; |
| 1217 |
} catch (e) { |
| 1218 |
return ''; |
| 1219 |
} |
| 1220 |
} |
| 1221 |
}); |
| 1222 |
|
| 1223 |
|
| 1224 |
/***/ }), |
| 1225 |
/* 40 */ |
| 1226 |
/***/ (function(module, exports, __webpack_require__) { |
| 1227 |
|
| 1228 |
// 19.1.2.14 / 15.2.3.14 Object.keys(O) |
| 1229 |
var $keys = __webpack_require__(116); |
| 1230 |
var enumBugKeys = __webpack_require__(78); |
| 1231 |
|
| 1232 |
module.exports = Object.keys || function keys(O) { |
| 1233 |
return $keys(O, enumBugKeys); |
| 1234 |
}; |
| 1235 |
|
| 1236 |
|
| 1237 |
/***/ }), |
| 1238 |
/* 41 */ |
| 1239 |
/***/ (function(module, exports, __webpack_require__) { |
| 1240 |
|
| 1241 |
/** |
| 1242 |
* Copyright (c) 2013-present, Facebook, Inc. |
| 1243 |
* |
| 1244 |
* This source code is licensed under the MIT license found in the |
| 1245 |
* LICENSE file in the root directory of this source tree. |
| 1246 |
*/ |
| 1247 |
|
| 1248 |
if (false) { var throwOnDirectAccess, ReactIs; } else { |
| 1249 |
// By explicitly using `prop-types` you are opting into new production behavior. |
| 1250 |
// http://fb.me/prop-types-in-prod |
| 1251 |
module.exports = __webpack_require__(325)(); |
| 1252 |
} |
| 1253 |
|
| 1254 |
|
| 1255 |
/***/ }), |
| 1256 |
/* 42 */ |
| 1257 |
/***/ (function(module, exports) { |
| 1258 |
|
| 1259 |
// 7.2.1 RequireObjectCoercible(argument) |
| 1260 |
module.exports = function (it) { |
| 1261 |
if (it == undefined) throw TypeError("Can't call method on " + it); |
| 1262 |
return it; |
| 1263 |
}; |
| 1264 |
|
| 1265 |
|
| 1266 |
/***/ }), |
| 1267 |
/* 43 */ |
| 1268 |
/***/ (function(module, exports, __webpack_require__) { |
| 1269 |
|
| 1270 |
// 7.1.15 ToLength |
| 1271 |
var toInteger = __webpack_require__(57); |
| 1272 |
var min = Math.min; |
| 1273 |
module.exports = function (it) { |
| 1274 |
return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991 |
| 1275 |
}; |
| 1276 |
|
| 1277 |
|
| 1278 |
/***/ }), |
| 1279 |
/* 44 */ |
| 1280 |
/***/ (function(module, exports) { |
| 1281 |
|
| 1282 |
module.exports = function (bitmap, value) { |
| 1283 |
return { |
| 1284 |
enumerable: !(bitmap & 1), |
| 1285 |
configurable: !(bitmap & 2), |
| 1286 |
writable: !(bitmap & 4), |
| 1287 |
value: value |
| 1288 |
}; |
| 1289 |
}; |
| 1290 |
|
| 1291 |
|
| 1292 |
/***/ }), |
| 1293 |
/* 45 */ |
| 1294 |
/***/ (function(module, exports, __webpack_require__) { |
| 1295 |
|
| 1296 |
var anObject = __webpack_require__(18); |
| 1297 |
var IE8_DOM_DEFINE = __webpack_require__(129); |
| 1298 |
var toPrimitive = __webpack_require__(123); |
| 1299 |
var dP = Object.defineProperty; |
| 1300 |
|
| 1301 |
exports.f = __webpack_require__(27) ? Object.defineProperty : function defineProperty(O, P, Attributes) { |
| 1302 |
anObject(O); |
| 1303 |
P = toPrimitive(P, true); |
| 1304 |
anObject(Attributes); |
| 1305 |
if (IE8_DOM_DEFINE) try { |
| 1306 |
return dP(O, P, Attributes); |
| 1307 |
} catch (e) { /* empty */ } |
| 1308 |
if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported!'); |
| 1309 |
if ('value' in Attributes) O[P] = Attributes.value; |
| 1310 |
return O; |
| 1311 |
}; |
| 1312 |
|
| 1313 |
|
| 1314 |
/***/ }), |
| 1315 |
/* 46 */ |
| 1316 |
/***/ (function(module, exports) { |
| 1317 |
|
| 1318 |
var toString = {}.toString; |
| 1319 |
|
| 1320 |
module.exports = function (it) { |
| 1321 |
return toString.call(it).slice(8, -1); |
| 1322 |
}; |
| 1323 |
|
| 1324 |
|
| 1325 |
/***/ }), |
| 1326 |
/* 47 */ |
| 1327 |
/***/ (function(module, exports) { |
| 1328 |
|
| 1329 |
module.exports = true; |
| 1330 |
|
| 1331 |
|
| 1332 |
/***/ }), |
| 1333 |
/* 48 */ |
| 1334 |
/***/ (function(module, exports, __webpack_require__) { |
| 1335 |
|
| 1336 |
var _Symbol$iterator = __webpack_require__(151); |
| 1337 |
|
| 1338 |
var _Symbol = __webpack_require__(111); |
| 1339 |
|
| 1340 |
function _typeof(obj) { |
| 1341 |
"@babel/helpers - typeof"; |
| 1342 |
|
| 1343 |
if (typeof _Symbol === "function" && typeof _Symbol$iterator === "symbol") { |
| 1344 |
module.exports = _typeof = function _typeof(obj) { |
| 1345 |
return typeof obj; |
| 1346 |
}; |
| 1347 |
} else { |
| 1348 |
module.exports = _typeof = function _typeof(obj) { |
| 1349 |
return obj && typeof _Symbol === "function" && obj.constructor === _Symbol && obj !== _Symbol.prototype ? "symbol" : typeof obj; |
| 1350 |
}; |
| 1351 |
} |
| 1352 |
|
| 1353 |
return _typeof(obj); |
| 1354 |
} |
| 1355 |
|
| 1356 |
module.exports = _typeof; |
| 1357 |
|
| 1358 |
/***/ }), |
| 1359 |
/* 49 */ |
| 1360 |
/***/ (function(module, exports) { |
| 1361 |
|
| 1362 |
function _assertThisInitialized(self) { |
| 1363 |
if (self === void 0) { |
| 1364 |
throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); |
| 1365 |
} |
| 1366 |
|
| 1367 |
return self; |
| 1368 |
} |
| 1369 |
|
| 1370 |
module.exports = _assertThisInitialized; |
| 1371 |
|
| 1372 |
/***/ }), |
| 1373 |
/* 50 */ |
| 1374 |
/***/ (function(module, exports) { |
| 1375 |
|
| 1376 |
exports.f = {}.propertyIsEnumerable; |
| 1377 |
|
| 1378 |
|
| 1379 |
/***/ }), |
| 1380 |
/* 51 */ |
| 1381 |
/***/ (function(module, exports, __webpack_require__) { |
| 1382 |
|
| 1383 |
var pIE = __webpack_require__(50); |
| 1384 |
var createDesc = __webpack_require__(44); |
| 1385 |
var toIObject = __webpack_require__(20); |
| 1386 |
var toPrimitive = __webpack_require__(74); |
| 1387 |
var has = __webpack_require__(19); |
| 1388 |
var IE8_DOM_DEFINE = __webpack_require__(114); |
| 1389 |
var gOPD = Object.getOwnPropertyDescriptor; |
| 1390 |
|
| 1391 |
exports.f = __webpack_require__(14) ? gOPD : function getOwnPropertyDescriptor(O, P) { |
| 1392 |
O = toIObject(O); |
| 1393 |
P = toPrimitive(P, true); |
| 1394 |
if (IE8_DOM_DEFINE) try { |
| 1395 |
return gOPD(O, P); |
| 1396 |
} catch (e) { /* empty */ } |
| 1397 |
if (has(O, P)) return createDesc(!pIE.f.call(O, P), O[P]); |
| 1398 |
}; |
| 1399 |
|
| 1400 |
|
| 1401 |
/***/ }), |
| 1402 |
/* 52 */ |
| 1403 |
/***/ (function(module, exports, __webpack_require__) { |
| 1404 |
|
| 1405 |
// 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties]) |
| 1406 |
var anObject = __webpack_require__(13); |
| 1407 |
var dPs = __webpack_require__(136); |
| 1408 |
var enumBugKeys = __webpack_require__(78); |
| 1409 |
var IE_PROTO = __webpack_require__(75)('IE_PROTO'); |
| 1410 |
var Empty = function () { /* empty */ }; |
| 1411 |
var PROTOTYPE = 'prototype'; |
| 1412 |
|
| 1413 |
// Create object with fake `null` prototype: use iframe Object with cleared prototype |
| 1414 |
var createDict = function () { |
| 1415 |
// Thrash, waste and sodomy: IE GC bug |
| 1416 |
var iframe = __webpack_require__(92)('iframe'); |
| 1417 |
var i = enumBugKeys.length; |
| 1418 |
var lt = '<'; |
| 1419 |
var gt = '>'; |
| 1420 |
var iframeDocument; |
| 1421 |
iframe.style.display = 'none'; |
| 1422 |
__webpack_require__(131).appendChild(iframe); |
| 1423 |
iframe.src = 'javascript:'; // eslint-disable-line no-script-url |
| 1424 |
// createDict = iframe.contentWindow.Object; |
| 1425 |
// html.removeChild(iframe); |
| 1426 |
iframeDocument = iframe.contentWindow.document; |
| 1427 |
iframeDocument.open(); |
| 1428 |
iframeDocument.write(lt + 'script' + gt + 'document.F=Object' + lt + '/script' + gt); |
| 1429 |
iframeDocument.close(); |
| 1430 |
createDict = iframeDocument.F; |
| 1431 |
while (i--) delete createDict[PROTOTYPE][enumBugKeys[i]]; |
| 1432 |
return createDict(); |
| 1433 |
}; |
| 1434 |
|
| 1435 |
module.exports = Object.create || function create(O, Properties) { |
| 1436 |
var result; |
| 1437 |
if (O !== null) { |
| 1438 |
Empty[PROTOTYPE] = anObject(O); |
| 1439 |
result = new Empty(); |
| 1440 |
Empty[PROTOTYPE] = null; |
| 1441 |
// add "__proto__" for Object.getPrototypeOf polyfill |
| 1442 |
result[IE_PROTO] = O; |
| 1443 |
} else result = createDict(); |
| 1444 |
return Properties === undefined ? result : dPs(result, Properties); |
| 1445 |
}; |
| 1446 |
|
| 1447 |
|
| 1448 |
/***/ }), |
| 1449 |
/* 53 */ |
| 1450 |
/***/ (function(module, exports, __webpack_require__) { |
| 1451 |
|
| 1452 |
var def = __webpack_require__(15).f; |
| 1453 |
var has = __webpack_require__(19); |
| 1454 |
var TAG = __webpack_require__(10)('toStringTag'); |
| 1455 |
|
| 1456 |
module.exports = function (it, tag, stat) { |
| 1457 |
if (it && !has(it = stat ? it : it.prototype, TAG)) def(it, TAG, { configurable: true, value: tag }); |
| 1458 |
}; |
| 1459 |
|
| 1460 |
|
| 1461 |
/***/ }), |
| 1462 |
/* 54 */ |
| 1463 |
/***/ (function(module, exports) { |
| 1464 |
|
| 1465 |
var core = module.exports = { version: '2.6.11' }; |
| 1466 |
if (typeof __e == 'number') __e = core; // eslint-disable-line no-undef |
| 1467 |
|
| 1468 |
|
| 1469 |
/***/ }), |
| 1470 |
/* 55 */ |
| 1471 |
/***/ (function(module, exports, __webpack_require__) { |
| 1472 |
|
| 1473 |
module.exports = __webpack_require__(239); |
| 1474 |
|
| 1475 |
/***/ }), |
| 1476 |
/* 56 */ |
| 1477 |
/***/ (function(module, exports) { |
| 1478 |
|
| 1479 |
var toString = {}.toString; |
| 1480 |
|
| 1481 |
module.exports = function (it) { |
| 1482 |
return toString.call(it).slice(8, -1); |
| 1483 |
}; |
| 1484 |
|
| 1485 |
|
| 1486 |
/***/ }), |
| 1487 |
/* 57 */ |
| 1488 |
/***/ (function(module, exports) { |
| 1489 |
|
| 1490 |
// 7.1.4 ToInteger |
| 1491 |
var ceil = Math.ceil; |
| 1492 |
var floor = Math.floor; |
| 1493 |
module.exports = function (it) { |
| 1494 |
return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it); |
| 1495 |
}; |
| 1496 |
|
| 1497 |
|
| 1498 |
/***/ }), |
| 1499 |
/* 58 */ |
| 1500 |
/***/ (function(module, exports, __webpack_require__) { |
| 1501 |
|
| 1502 |
"use strict"; |
| 1503 |
|
| 1504 |
|
| 1505 |
var anObject = __webpack_require__(18); |
| 1506 |
var toObject = __webpack_require__(96); |
| 1507 |
var toLength = __webpack_require__(43); |
| 1508 |
var toInteger = __webpack_require__(57); |
| 1509 |
var advanceStringIndex = __webpack_require__(105); |
| 1510 |
var regExpExec = __webpack_require__(94); |
| 1511 |
var max = Math.max; |
| 1512 |
var min = Math.min; |
| 1513 |
var floor = Math.floor; |
| 1514 |
var SUBSTITUTION_SYMBOLS = /\$([$&`']|\d\d?|<[^>]*>)/g; |
| 1515 |
var SUBSTITUTION_SYMBOLS_NO_NAMED = /\$([$&`']|\d\d?)/g; |
| 1516 |
|
| 1517 |
var maybeToString = function (it) { |
| 1518 |
return it === undefined ? it : String(it); |
| 1519 |
}; |
| 1520 |
|
| 1521 |
// @@replace logic |
| 1522 |
__webpack_require__(95)('replace', 2, function (defined, REPLACE, $replace, maybeCallNative) { |
| 1523 |
return [ |
| 1524 |
// `String.prototype.replace` method |
| 1525 |
// https://tc39.github.io/ecma262/#sec-string.prototype.replace |
| 1526 |
function replace(searchValue, replaceValue) { |
| 1527 |
var O = defined(this); |
| 1528 |
var fn = searchValue == undefined ? undefined : searchValue[REPLACE]; |
| 1529 |
return fn !== undefined |
| 1530 |
? fn.call(searchValue, O, replaceValue) |
| 1531 |
: $replace.call(String(O), searchValue, replaceValue); |
| 1532 |
}, |
| 1533 |
// `RegExp.prototype[@@replace]` method |
| 1534 |
// https://tc39.github.io/ecma262/#sec-regexp.prototype-@@replace |
| 1535 |
function (regexp, replaceValue) { |
| 1536 |
var res = maybeCallNative($replace, regexp, this, replaceValue); |
| 1537 |
if (res.done) return res.value; |
| 1538 |
|
| 1539 |
var rx = anObject(regexp); |
| 1540 |
var S = String(this); |
| 1541 |
var functionalReplace = typeof replaceValue === 'function'; |
| 1542 |
if (!functionalReplace) replaceValue = String(replaceValue); |
| 1543 |
var global = rx.global; |
| 1544 |
if (global) { |
| 1545 |
var fullUnicode = rx.unicode; |
| 1546 |
rx.lastIndex = 0; |
| 1547 |
} |
| 1548 |
var results = []; |
| 1549 |
while (true) { |
| 1550 |
var result = regExpExec(rx, S); |
| 1551 |
if (result === null) break; |
| 1552 |
results.push(result); |
| 1553 |
if (!global) break; |
| 1554 |
var matchStr = String(result[0]); |
| 1555 |
if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode); |
| 1556 |
} |
| 1557 |
var accumulatedResult = ''; |
| 1558 |
var nextSourcePosition = 0; |
| 1559 |
for (var i = 0; i < results.length; i++) { |
| 1560 |
result = results[i]; |
| 1561 |
var matched = String(result[0]); |
| 1562 |
var position = max(min(toInteger(result.index), S.length), 0); |
| 1563 |
var captures = []; |
| 1564 |
// NOTE: This is equivalent to |
| 1565 |
// captures = result.slice(1).map(maybeToString) |
| 1566 |
// but for some reason `nativeSlice.call(result, 1, result.length)` (called in |
| 1567 |
// the slice polyfill when slicing native arrays) "doesn't work" in safari 9 and |
| 1568 |
// causes a crash (https://pastebin.com/N21QzeQA) when trying to debug it. |
| 1569 |
for (var j = 1; j < result.length; j++) captures.push(maybeToString(result[j])); |
| 1570 |
var namedCaptures = result.groups; |
| 1571 |
if (functionalReplace) { |
| 1572 |
var replacerArgs = [matched].concat(captures, position, S); |
| 1573 |
if (namedCaptures !== undefined) replacerArgs.push(namedCaptures); |
| 1574 |
var replacement = String(replaceValue.apply(undefined, replacerArgs)); |
| 1575 |
} else { |
| 1576 |
replacement = getSubstitution(matched, S, position, captures, namedCaptures, replaceValue); |
| 1577 |
} |
| 1578 |
if (position >= nextSourcePosition) { |
| 1579 |
accumulatedResult += S.slice(nextSourcePosition, position) + replacement; |
| 1580 |
nextSourcePosition = position + matched.length; |
| 1581 |
} |
| 1582 |
} |
| 1583 |
return accumulatedResult + S.slice(nextSourcePosition); |
| 1584 |
} |
| 1585 |
]; |
| 1586 |
|
| 1587 |
// https://tc39.github.io/ecma262/#sec-getsubstitution |
| 1588 |
function getSubstitution(matched, str, position, captures, namedCaptures, replacement) { |
| 1589 |
var tailPos = position + matched.length; |
| 1590 |
var m = captures.length; |
| 1591 |
var symbols = SUBSTITUTION_SYMBOLS_NO_NAMED; |
| 1592 |
if (namedCaptures !== undefined) { |
| 1593 |
namedCaptures = toObject(namedCaptures); |
| 1594 |
symbols = SUBSTITUTION_SYMBOLS; |
| 1595 |
} |
| 1596 |
return $replace.call(replacement, symbols, function (match, ch) { |
| 1597 |
var capture; |
| 1598 |
switch (ch.charAt(0)) { |
| 1599 |
case '$': return '$'; |
| 1600 |
case '&': return matched; |
| 1601 |
case '`': return str.slice(0, position); |
| 1602 |
case "'": return str.slice(tailPos); |
| 1603 |
case '<': |
| 1604 |
capture = namedCaptures[ch.slice(1, -1)]; |
| 1605 |
break; |
| 1606 |
default: // \d\d? |
| 1607 |
var n = +ch; |
| 1608 |
if (n === 0) return match; |
| 1609 |
if (n > m) { |
| 1610 |
var f = floor(n / 10); |
| 1611 |
if (f === 0) return match; |
| 1612 |
if (f <= m) return captures[f - 1] === undefined ? ch.charAt(1) : captures[f - 1] + ch.charAt(1); |
| 1613 |
return match; |
| 1614 |
} |
| 1615 |
capture = captures[n - 1]; |
| 1616 |
} |
| 1617 |
return capture === undefined ? '' : capture; |
| 1618 |
}); |
| 1619 |
} |
| 1620 |
}); |
| 1621 |
|
| 1622 |
|
| 1623 |
/***/ }), |
| 1624 |
/* 59 */ |
| 1625 |
/***/ (function(module, exports) { |
| 1626 |
|
| 1627 |
var id = 0; |
| 1628 |
var px = Math.random(); |
| 1629 |
module.exports = function (key) { |
| 1630 |
return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36)); |
| 1631 |
}; |
| 1632 |
|
| 1633 |
|
| 1634 |
/***/ }), |
| 1635 |
/* 60 */ |
| 1636 |
/***/ (function(module, exports, __webpack_require__) { |
| 1637 |
|
| 1638 |
"use strict"; |
| 1639 |
|
| 1640 |
var $at = __webpack_require__(173)(true); |
| 1641 |
|
| 1642 |
// 21.1.3.27 String.prototype[@@iterator]() |
| 1643 |
__webpack_require__(108)(String, 'String', function (iterated) { |
| 1644 |
this._t = String(iterated); // target |
| 1645 |
this._i = 0; // next index |
| 1646 |
// 21.1.5.2.1 %StringIteratorPrototype%.next() |
| 1647 |
}, function () { |
| 1648 |
var O = this._t; |
| 1649 |
var index = this._i; |
| 1650 |
var point; |
| 1651 |
if (index >= O.length) return { value: undefined, done: true }; |
| 1652 |
point = $at(O, index); |
| 1653 |
this._i += point.length; |
| 1654 |
return { value: point, done: false }; |
| 1655 |
}); |
| 1656 |
|
| 1657 |
|
| 1658 |
/***/ }), |
| 1659 |
/* 61 */ |
| 1660 |
/***/ (function(module, exports) { |
| 1661 |
|
| 1662 |
var hasOwnProperty = {}.hasOwnProperty; |
| 1663 |
module.exports = function (it, key) { |
| 1664 |
return hasOwnProperty.call(it, key); |
| 1665 |
}; |
| 1666 |
|
| 1667 |
|
| 1668 |
/***/ }), |
| 1669 |
/* 62 */ |
| 1670 |
/***/ (function(module, exports, __webpack_require__) { |
| 1671 |
|
| 1672 |
__webpack_require__(175); |
| 1673 |
var global = __webpack_require__(8); |
| 1674 |
var hide = __webpack_require__(24); |
| 1675 |
var Iterators = __webpack_require__(35); |
| 1676 |
var TO_STRING_TAG = __webpack_require__(10)('toStringTag'); |
| 1677 |
|
| 1678 |
var DOMIterables = ('CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,' + |
| 1679 |
'DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,' + |
| 1680 |
'MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,' + |
| 1681 |
'SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,' + |
| 1682 |
'TextTrackList,TouchList').split(','); |
| 1683 |
|
| 1684 |
for (var i = 0; i < DOMIterables.length; i++) { |
| 1685 |
var NAME = DOMIterables[i]; |
| 1686 |
var Collection = global[NAME]; |
| 1687 |
var proto = Collection && Collection.prototype; |
| 1688 |
if (proto && !proto[TO_STRING_TAG]) hide(proto, TO_STRING_TAG, NAME); |
| 1689 |
Iterators[NAME] = Iterators.Array; |
| 1690 |
} |
| 1691 |
|
| 1692 |
|
| 1693 |
/***/ }), |
| 1694 |
/* 63 */ |
| 1695 |
/***/ (function(module, exports, __webpack_require__) { |
| 1696 |
|
| 1697 |
exports.f = __webpack_require__(10); |
| 1698 |
|
| 1699 |
|
| 1700 |
/***/ }), |
| 1701 |
/* 64 */ |
| 1702 |
/***/ (function(module, exports, __webpack_require__) { |
| 1703 |
|
| 1704 |
// 19.1.2.9 / 15.2.3.2 Object.getPrototypeOf(O) |
| 1705 |
var has = __webpack_require__(19); |
| 1706 |
var toObject = __webpack_require__(32); |
| 1707 |
var IE_PROTO = __webpack_require__(75)('IE_PROTO'); |
| 1708 |
var ObjectProto = Object.prototype; |
| 1709 |
|
| 1710 |
module.exports = Object.getPrototypeOf || function (O) { |
| 1711 |
O = toObject(O); |
| 1712 |
if (has(O, IE_PROTO)) return O[IE_PROTO]; |
| 1713 |
if (typeof O.constructor == 'function' && O instanceof O.constructor) { |
| 1714 |
return O.constructor.prototype; |
| 1715 |
} return O instanceof Object ? ObjectProto : null; |
| 1716 |
}; |
| 1717 |
|
| 1718 |
|
| 1719 |
/***/ }), |
| 1720 |
/* 65 */ |
| 1721 |
/***/ (function(module, exports) { |
| 1722 |
|
| 1723 |
// 7.2.1 RequireObjectCoercible(argument) |
| 1724 |
module.exports = function (it) { |
| 1725 |
if (it == undefined) throw TypeError("Can't call method on " + it); |
| 1726 |
return it; |
| 1727 |
}; |
| 1728 |
|
| 1729 |
|
| 1730 |
/***/ }), |
| 1731 |
/* 66 */ |
| 1732 |
/***/ (function(module, exports, __webpack_require__) { |
| 1733 |
|
| 1734 |
/** |
| 1735 |
* Copyright (c) 2014-present, Facebook, Inc. |
| 1736 |
* |
| 1737 |
* This source code is licensed under the MIT license found in the |
| 1738 |
* LICENSE file in the root directory of this source tree. |
| 1739 |
*/ |
| 1740 |
|
| 1741 |
var runtime = (function (exports) { |
| 1742 |
"use strict"; |
| 1743 |
|
| 1744 |
var Op = Object.prototype; |
| 1745 |
var hasOwn = Op.hasOwnProperty; |
| 1746 |
var undefined; // More compressible than void 0. |
| 1747 |
var $Symbol = typeof Symbol === "function" ? Symbol : {}; |
| 1748 |
var iteratorSymbol = $Symbol.iterator || "@@iterator"; |
| 1749 |
var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator"; |
| 1750 |
var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; |
| 1751 |
|
| 1752 |
function define(obj, key, value) { |
| 1753 |
Object.defineProperty(obj, key, { |
| 1754 |
value: value, |
| 1755 |
enumerable: true, |
| 1756 |
configurable: true, |
| 1757 |
writable: true |
| 1758 |
}); |
| 1759 |
return obj[key]; |
| 1760 |
} |
| 1761 |
try { |
| 1762 |
// IE 8 has a broken Object.defineProperty that only works on DOM objects. |
| 1763 |
define({}, ""); |
| 1764 |
} catch (err) { |
| 1765 |
define = function(obj, key, value) { |
| 1766 |
return obj[key] = value; |
| 1767 |
}; |
| 1768 |
} |
| 1769 |
|
| 1770 |
function wrap(innerFn, outerFn, self, tryLocsList) { |
| 1771 |
// If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator. |
| 1772 |
var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator; |
| 1773 |
var generator = Object.create(protoGenerator.prototype); |
| 1774 |
var context = new Context(tryLocsList || []); |
| 1775 |
|
| 1776 |
// The ._invoke method unifies the implementations of the .next, |
| 1777 |
// .throw, and .return methods. |
| 1778 |
generator._invoke = makeInvokeMethod(innerFn, self, context); |
| 1779 |
|
| 1780 |
return generator; |
| 1781 |
} |
| 1782 |
exports.wrap = wrap; |
| 1783 |
|
| 1784 |
// Try/catch helper to minimize deoptimizations. Returns a completion |
| 1785 |
// record like context.tryEntries[i].completion. This interface could |
| 1786 |
// have been (and was previously) designed to take a closure to be |
| 1787 |
// invoked without arguments, but in all the cases we care about we |
| 1788 |
// already have an existing method we want to call, so there's no need |
| 1789 |
// to create a new function object. We can even get away with assuming |
| 1790 |
// the method takes exactly one argument, since that happens to be true |
| 1791 |
// in every case, so we don't have to touch the arguments object. The |
| 1792 |
// only additional allocation required is the completion record, which |
| 1793 |
// has a stable shape and so hopefully should be cheap to allocate. |
| 1794 |
function tryCatch(fn, obj, arg) { |
| 1795 |
try { |
| 1796 |
return { type: "normal", arg: fn.call(obj, arg) }; |
| 1797 |
} catch (err) { |
| 1798 |
return { type: "throw", arg: err }; |
| 1799 |
} |
| 1800 |
} |
| 1801 |
|
| 1802 |
var GenStateSuspendedStart = "suspendedStart"; |
| 1803 |
var GenStateSuspendedYield = "suspendedYield"; |
| 1804 |
var GenStateExecuting = "executing"; |
| 1805 |
var GenStateCompleted = "completed"; |
| 1806 |
|
| 1807 |
// Returning this object from the innerFn has the same effect as |
| 1808 |
// breaking out of the dispatch switch statement. |
| 1809 |
var ContinueSentinel = {}; |
| 1810 |
|
| 1811 |
// Dummy constructor functions that we use as the .constructor and |
| 1812 |
// .constructor.prototype properties for functions that return Generator |
| 1813 |
// objects. For full spec compliance, you may wish to configure your |
| 1814 |
// minifier not to mangle the names of these two functions. |
| 1815 |
function Generator() {} |
| 1816 |
function GeneratorFunction() {} |
| 1817 |
function GeneratorFunctionPrototype() {} |
| 1818 |
|
| 1819 |
// This is a polyfill for %IteratorPrototype% for environments that |
| 1820 |
// don't natively support it. |
| 1821 |
var IteratorPrototype = {}; |
| 1822 |
IteratorPrototype[iteratorSymbol] = function () { |
| 1823 |
return this; |
| 1824 |
}; |
| 1825 |
|
| 1826 |
var getProto = Object.getPrototypeOf; |
| 1827 |
var NativeIteratorPrototype = getProto && getProto(getProto(values([]))); |
| 1828 |
if (NativeIteratorPrototype && |
| 1829 |
NativeIteratorPrototype !== Op && |
| 1830 |
hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) { |
| 1831 |
// This environment has a native %IteratorPrototype%; use it instead |
| 1832 |
// of the polyfill. |
| 1833 |
IteratorPrototype = NativeIteratorPrototype; |
| 1834 |
} |
| 1835 |
|
| 1836 |
var Gp = GeneratorFunctionPrototype.prototype = |
| 1837 |
Generator.prototype = Object.create(IteratorPrototype); |
| 1838 |
GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype; |
| 1839 |
GeneratorFunctionPrototype.constructor = GeneratorFunction; |
| 1840 |
GeneratorFunction.displayName = define( |
| 1841 |
GeneratorFunctionPrototype, |
| 1842 |
toStringTagSymbol, |
| 1843 |
"GeneratorFunction" |
| 1844 |
); |
| 1845 |
|
| 1846 |
// Helper for defining the .next, .throw, and .return methods of the |
| 1847 |
// Iterator interface in terms of a single ._invoke method. |
| 1848 |
function defineIteratorMethods(prototype) { |
| 1849 |
["next", "throw", "return"].forEach(function(method) { |
| 1850 |
define(prototype, method, function(arg) { |
| 1851 |
return this._invoke(method, arg); |
| 1852 |
}); |
| 1853 |
}); |
| 1854 |
} |
| 1855 |
|
| 1856 |
exports.isGeneratorFunction = function(genFun) { |
| 1857 |
var ctor = typeof genFun === "function" && genFun.constructor; |
| 1858 |
return ctor |
| 1859 |
? ctor === GeneratorFunction || |
| 1860 |
// For the native GeneratorFunction constructor, the best we can |
| 1861 |
// do is to check its .name property. |
| 1862 |
(ctor.displayName || ctor.name) === "GeneratorFunction" |
| 1863 |
: false; |
| 1864 |
}; |
| 1865 |
|
| 1866 |
exports.mark = function(genFun) { |
| 1867 |
if (Object.setPrototypeOf) { |
| 1868 |
Object.setPrototypeOf(genFun, GeneratorFunctionPrototype); |
| 1869 |
} else { |
| 1870 |
genFun.__proto__ = GeneratorFunctionPrototype; |
| 1871 |
define(genFun, toStringTagSymbol, "GeneratorFunction"); |
| 1872 |
} |
| 1873 |
genFun.prototype = Object.create(Gp); |
| 1874 |
return genFun; |
| 1875 |
}; |
| 1876 |
|
| 1877 |
// Within the body of any async function, `await x` is transformed to |
| 1878 |
// `yield regeneratorRuntime.awrap(x)`, so that the runtime can test |
| 1879 |
// `hasOwn.call(value, "__await")` to determine if the yielded value is |
| 1880 |
// meant to be awaited. |
| 1881 |
exports.awrap = function(arg) { |
| 1882 |
return { __await: arg }; |
| 1883 |
}; |
| 1884 |
|
| 1885 |
function AsyncIterator(generator, PromiseImpl) { |
| 1886 |
function invoke(method, arg, resolve, reject) { |
| 1887 |
var record = tryCatch(generator[method], generator, arg); |
| 1888 |
if (record.type === "throw") { |
| 1889 |
reject(record.arg); |
| 1890 |
} else { |
| 1891 |
var result = record.arg; |
| 1892 |
var value = result.value; |
| 1893 |
if (value && |
| 1894 |
typeof value === "object" && |
| 1895 |
hasOwn.call(value, "__await")) { |
| 1896 |
return PromiseImpl.resolve(value.__await).then(function(value) { |
| 1897 |
invoke("next", value, resolve, reject); |
| 1898 |
}, function(err) { |
| 1899 |
invoke("throw", err, resolve, reject); |
| 1900 |
}); |
| 1901 |
} |
| 1902 |
|
| 1903 |
return PromiseImpl.resolve(value).then(function(unwrapped) { |
| 1904 |
// When a yielded Promise is resolved, its final value becomes |
| 1905 |
// the .value of the Promise<{value,done}> result for the |
| 1906 |
// current iteration. |
| 1907 |
result.value = unwrapped; |
| 1908 |
resolve(result); |
| 1909 |
}, function(error) { |
| 1910 |
// If a rejected Promise was yielded, throw the rejection back |
| 1911 |
// into the async generator function so it can be handled there. |
| 1912 |
return invoke("throw", error, resolve, reject); |
| 1913 |
}); |
| 1914 |
} |
| 1915 |
} |
| 1916 |
|
| 1917 |
var previousPromise; |
| 1918 |
|
| 1919 |
function enqueue(method, arg) { |
| 1920 |
function callInvokeWithMethodAndArg() { |
| 1921 |
return new PromiseImpl(function(resolve, reject) { |
| 1922 |
invoke(method, arg, resolve, reject); |
| 1923 |
}); |
| 1924 |
} |
| 1925 |
|
| 1926 |
return previousPromise = |
| 1927 |
// If enqueue has been called before, then we want to wait until |
| 1928 |
// all previous Promises have been resolved before calling invoke, |
| 1929 |
// so that results are always delivered in the correct order. If |
| 1930 |
// enqueue has not been called before, then it is important to |
| 1931 |
// call invoke immediately, without waiting on a callback to fire, |
| 1932 |
// so that the async generator function has the opportunity to do |
| 1933 |
// any necessary setup in a predictable way. This predictability |
| 1934 |
// is why the Promise constructor synchronously invokes its |
| 1935 |
// executor callback, and why async functions synchronously |
| 1936 |
// execute code before the first await. Since we implement simple |
| 1937 |
// async functions in terms of async generators, it is especially |
| 1938 |
// important to get this right, even though it requires care. |
| 1939 |
previousPromise ? previousPromise.then( |
| 1940 |
callInvokeWithMethodAndArg, |
| 1941 |
// Avoid propagating failures to Promises returned by later |
| 1942 |
// invocations of the iterator. |
| 1943 |
callInvokeWithMethodAndArg |
| 1944 |
) : callInvokeWithMethodAndArg(); |
| 1945 |
} |
| 1946 |
|
| 1947 |
// Define the unified helper method that is used to implement .next, |
| 1948 |
// .throw, and .return (see defineIteratorMethods). |
| 1949 |
this._invoke = enqueue; |
| 1950 |
} |
| 1951 |
|
| 1952 |
defineIteratorMethods(AsyncIterator.prototype); |
| 1953 |
AsyncIterator.prototype[asyncIteratorSymbol] = function () { |
| 1954 |
return this; |
| 1955 |
}; |
| 1956 |
exports.AsyncIterator = AsyncIterator; |
| 1957 |
|
| 1958 |
// Note that simple async functions are implemented on top of |
| 1959 |
// AsyncIterator objects; they just return a Promise for the value of |
| 1960 |
// the final result produced by the iterator. |
| 1961 |
exports.async = function(innerFn, outerFn, self, tryLocsList, PromiseImpl) { |
| 1962 |
if (PromiseImpl === void 0) PromiseImpl = Promise; |
| 1963 |
|
| 1964 |
var iter = new AsyncIterator( |
| 1965 |
wrap(innerFn, outerFn, self, tryLocsList), |
| 1966 |
PromiseImpl |
| 1967 |
); |
| 1968 |
|
| 1969 |
return exports.isGeneratorFunction(outerFn) |
| 1970 |
? iter // If outerFn is a generator, return the full iterator. |
| 1971 |
: iter.next().then(function(result) { |
| 1972 |
return result.done ? result.value : iter.next(); |
| 1973 |
}); |
| 1974 |
}; |
| 1975 |
|
| 1976 |
function makeInvokeMethod(innerFn, self, context) { |
| 1977 |
var state = GenStateSuspendedStart; |
| 1978 |
|
| 1979 |
return function invoke(method, arg) { |
| 1980 |
if (state === GenStateExecuting) { |
| 1981 |
throw new Error("Generator is already running"); |
| 1982 |
} |
| 1983 |
|
| 1984 |
if (state === GenStateCompleted) { |
| 1985 |
if (method === "throw") { |
| 1986 |
throw arg; |
| 1987 |
} |
| 1988 |
|
| 1989 |
// Be forgiving, per 25.3.3.3.3 of the spec: |
| 1990 |
// https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume |
| 1991 |
return doneResult(); |
| 1992 |
} |
| 1993 |
|
| 1994 |
context.method = method; |
| 1995 |
context.arg = arg; |
| 1996 |
|
| 1997 |
while (true) { |
| 1998 |
var delegate = context.delegate; |
| 1999 |
if (delegate) { |
| 2000 |
var delegateResult = maybeInvokeDelegate(delegate, context); |
| 2001 |
if (delegateResult) { |
| 2002 |
if (delegateResult === ContinueSentinel) continue; |
| 2003 |
return delegateResult; |
| 2004 |
} |
| 2005 |
} |
| 2006 |
|
| 2007 |
if (context.method === "next") { |
| 2008 |
// Setting context._sent for legacy support of Babel's |
| 2009 |
// function.sent implementation. |
| 2010 |
context.sent = context._sent = context.arg; |
| 2011 |
|
| 2012 |
} else if (context.method === "throw") { |
| 2013 |
if (state === GenStateSuspendedStart) { |
| 2014 |
state = GenStateCompleted; |
| 2015 |
throw context.arg; |
| 2016 |
} |
| 2017 |
|
| 2018 |
context.dispatchException(context.arg); |
| 2019 |
|
| 2020 |
} else if (context.method === "return") { |
| 2021 |
context.abrupt("return", context.arg); |
| 2022 |
} |
| 2023 |
|
| 2024 |
state = GenStateExecuting; |
| 2025 |
|
| 2026 |
var record = tryCatch(innerFn, self, context); |
| 2027 |
if (record.type === "normal") { |
| 2028 |
// If an exception is thrown from innerFn, we leave state === |
| 2029 |
// GenStateExecuting and loop back for another invocation. |
| 2030 |
state = context.done |
| 2031 |
? GenStateCompleted |
| 2032 |
: GenStateSuspendedYield; |
| 2033 |
|
| 2034 |
if (record.arg === ContinueSentinel) { |
| 2035 |
continue; |
| 2036 |
} |
| 2037 |
|
| 2038 |
return { |
| 2039 |
value: record.arg, |
| 2040 |
done: context.done |
| 2041 |
}; |
| 2042 |
|
| 2043 |
} else if (record.type === "throw") { |
| 2044 |
state = GenStateCompleted; |
| 2045 |
// Dispatch the exception by looping back around to the |
| 2046 |
// context.dispatchException(context.arg) call above. |
| 2047 |
context.method = "throw"; |
| 2048 |
context.arg = record.arg; |
| 2049 |
} |
| 2050 |
} |
| 2051 |
}; |
| 2052 |
} |
| 2053 |
|
| 2054 |
// Call delegate.iterator[context.method](context.arg) and handle the |
| 2055 |
// result, either by returning a { value, done } result from the |
| 2056 |
// delegate iterator, or by modifying context.method and context.arg, |
| 2057 |
// setting context.delegate to null, and returning the ContinueSentinel. |
| 2058 |
function maybeInvokeDelegate(delegate, context) { |
| 2059 |
var method = delegate.iterator[context.method]; |
| 2060 |
if (method === undefined) { |
| 2061 |
// A .throw or .return when the delegate iterator has no .throw |
| 2062 |
// method always terminates the yield* loop. |
| 2063 |
context.delegate = null; |
| 2064 |
|
| 2065 |
if (context.method === "throw") { |
| 2066 |
// Note: ["return"] must be used for ES3 parsing compatibility. |
| 2067 |
if (delegate.iterator["return"]) { |
| 2068 |
// If the delegate iterator has a return method, give it a |
| 2069 |
// chance to clean up. |
| 2070 |
context.method = "return"; |
| 2071 |
context.arg = undefined; |
| 2072 |
maybeInvokeDelegate(delegate, context); |
| 2073 |
|
| 2074 |
if (context.method === "throw") { |
| 2075 |
// If maybeInvokeDelegate(context) changed context.method from |
| 2076 |
// "return" to "throw", let that override the TypeError below. |
| 2077 |
return ContinueSentinel; |
| 2078 |
} |
| 2079 |
} |
| 2080 |
|
| 2081 |
context.method = "throw"; |
| 2082 |
context.arg = new TypeError( |
| 2083 |
"The iterator does not provide a 'throw' method"); |
| 2084 |
} |
| 2085 |
|
| 2086 |
return ContinueSentinel; |
| 2087 |
} |
| 2088 |
|
| 2089 |
var record = tryCatch(method, delegate.iterator, context.arg); |
| 2090 |
|
| 2091 |
if (record.type === "throw") { |
| 2092 |
context.method = "throw"; |
| 2093 |
context.arg = record.arg; |
| 2094 |
context.delegate = null; |
| 2095 |
return ContinueSentinel; |
| 2096 |
} |
| 2097 |
|
| 2098 |
var info = record.arg; |
| 2099 |
|
| 2100 |
if (! info) { |
| 2101 |
context.method = "throw"; |
| 2102 |
context.arg = new TypeError("iterator result is not an object"); |
| 2103 |
context.delegate = null; |
| 2104 |
return ContinueSentinel; |
| 2105 |
} |
| 2106 |
|
| 2107 |
if (info.done) { |
| 2108 |
// Assign the result of the finished delegate to the temporary |
| 2109 |
// variable specified by delegate.resultName (see delegateYield). |
| 2110 |
context[delegate.resultName] = info.value; |
| 2111 |
|
| 2112 |
// Resume execution at the desired location (see delegateYield). |
| 2113 |
context.next = delegate.nextLoc; |
| 2114 |
|
| 2115 |
// If context.method was "throw" but the delegate handled the |
| 2116 |
// exception, let the outer generator proceed normally. If |
| 2117 |
// context.method was "next", forget context.arg since it has been |
| 2118 |
// "consumed" by the delegate iterator. If context.method was |
| 2119 |
// "return", allow the original .return call to continue in the |
| 2120 |
// outer generator. |
| 2121 |
if (context.method !== "return") { |
| 2122 |
context.method = "next"; |
| 2123 |
context.arg = undefined; |
| 2124 |
} |
| 2125 |
|
| 2126 |
} else { |
| 2127 |
// Re-yield the result returned by the delegate method. |
| 2128 |
return info; |
| 2129 |
} |
| 2130 |
|
| 2131 |
// The delegate iterator is finished, so forget it and continue with |
| 2132 |
// the outer generator. |
| 2133 |
context.delegate = null; |
| 2134 |
return ContinueSentinel; |
| 2135 |
} |
| 2136 |
|
| 2137 |
// Define Generator.prototype.{next,throw,return} in terms of the |
| 2138 |
// unified ._invoke helper method. |
| 2139 |
defineIteratorMethods(Gp); |
| 2140 |
|
| 2141 |
define(Gp, toStringTagSymbol, "Generator"); |
| 2142 |
|
| 2143 |
// A Generator should always return itself as the iterator object when the |
| 2144 |
// @@iterator function is called on it. Some browsers' implementations of the |
| 2145 |
// iterator prototype chain incorrectly implement this, causing the Generator |
| 2146 |
// object to not be returned from this call. This ensures that doesn't happen. |
| 2147 |
// See https://github.com/facebook/regenerator/issues/274 for more details. |
| 2148 |
Gp[iteratorSymbol] = function() { |
| 2149 |
return this; |
| 2150 |
}; |
| 2151 |
|
| 2152 |
Gp.toString = function() { |
| 2153 |
return "[object Generator]"; |
| 2154 |
}; |
| 2155 |
|
| 2156 |
function pushTryEntry(locs) { |
| 2157 |
var entry = { tryLoc: locs[0] }; |
| 2158 |
|
| 2159 |
if (1 in locs) { |
| 2160 |
entry.catchLoc = locs[1]; |
| 2161 |
} |
| 2162 |
|
| 2163 |
if (2 in locs) { |
| 2164 |
entry.finallyLoc = locs[2]; |
| 2165 |
entry.afterLoc = locs[3]; |
| 2166 |
} |
| 2167 |
|
| 2168 |
this.tryEntries.push(entry); |
| 2169 |
} |
| 2170 |
|
| 2171 |
function resetTryEntry(entry) { |
| 2172 |
var record = entry.completion || {}; |
| 2173 |
record.type = "normal"; |
| 2174 |
delete record.arg; |
| 2175 |
entry.completion = record; |
| 2176 |
} |
| 2177 |
|
| 2178 |
function Context(tryLocsList) { |
| 2179 |
// The root entry object (effectively a try statement without a catch |
| 2180 |
// or a finally block) gives us a place to store values thrown from |
| 2181 |
// locations where there is no enclosing try statement. |
| 2182 |
this.tryEntries = [{ tryLoc: "root" }]; |
| 2183 |
tryLocsList.forEach(pushTryEntry, this); |
| 2184 |
this.reset(true); |
| 2185 |
} |
| 2186 |
|
| 2187 |
exports.keys = function(object) { |
| 2188 |
var keys = []; |
| 2189 |
for (var key in object) { |
| 2190 |
keys.push(key); |
| 2191 |
} |
| 2192 |
keys.reverse(); |
| 2193 |
|
| 2194 |
// Rather than returning an object with a next method, we keep |
| 2195 |
// things simple and return the next function itself. |
| 2196 |
return function next() { |
| 2197 |
while (keys.length) { |
| 2198 |
var key = keys.pop(); |
| 2199 |
if (key in object) { |
| 2200 |
next.value = key; |
| 2201 |
next.done = false; |
| 2202 |
return next; |
| 2203 |
} |
| 2204 |
} |
| 2205 |
|
| 2206 |
// To avoid creating an additional object, we just hang the .value |
| 2207 |
// and .done properties off the next function object itself. This |
| 2208 |
// also ensures that the minifier will not anonymize the function. |
| 2209 |
next.done = true; |
| 2210 |
return next; |
| 2211 |
}; |
| 2212 |
}; |
| 2213 |
|
| 2214 |
function values(iterable) { |
| 2215 |
if (iterable) { |
| 2216 |
var iteratorMethod = iterable[iteratorSymbol]; |
| 2217 |
if (iteratorMethod) { |
| 2218 |
return iteratorMethod.call(iterable); |
| 2219 |
} |
| 2220 |
|
| 2221 |
if (typeof iterable.next === "function") { |
| 2222 |
return iterable; |
| 2223 |
} |
| 2224 |
|
| 2225 |
if (!isNaN(iterable.length)) { |
| 2226 |
var i = -1, next = function next() { |
| 2227 |
while (++i < iterable.length) { |
| 2228 |
if (hasOwn.call(iterable, i)) { |
| 2229 |
next.value = iterable[i]; |
| 2230 |
next.done = false; |
| 2231 |
return next; |
| 2232 |
} |
| 2233 |
} |
| 2234 |
|
| 2235 |
next.value = undefined; |
| 2236 |
next.done = true; |
| 2237 |
|
| 2238 |
return next; |
| 2239 |
}; |
| 2240 |
|
| 2241 |
return next.next = next; |
| 2242 |
} |
| 2243 |
} |
| 2244 |
|
| 2245 |
// Return an iterator with no values. |
| 2246 |
return { next: doneResult }; |
| 2247 |
} |
| 2248 |
exports.values = values; |
| 2249 |
|
| 2250 |
function doneResult() { |
| 2251 |
return { value: undefined, done: true }; |
| 2252 |
} |
| 2253 |
|
| 2254 |
Context.prototype = { |
| 2255 |
constructor: Context, |
| 2256 |
|
| 2257 |
reset: function(skipTempReset) { |
| 2258 |
this.prev = 0; |
| 2259 |
this.next = 0; |
| 2260 |
// Resetting context._sent for legacy support of Babel's |
| 2261 |
// function.sent implementation. |
| 2262 |
this.sent = this._sent = undefined; |
| 2263 |
this.done = false; |
| 2264 |
this.delegate = null; |
| 2265 |
|
| 2266 |
this.method = "next"; |
| 2267 |
this.arg = undefined; |
| 2268 |
|
| 2269 |
this.tryEntries.forEach(resetTryEntry); |
| 2270 |
|
| 2271 |
if (!skipTempReset) { |
| 2272 |
for (var name in this) { |
| 2273 |
// Not sure about the optimal order of these conditions: |
| 2274 |
if (name.charAt(0) === "t" && |
| 2275 |
hasOwn.call(this, name) && |
| 2276 |
!isNaN(+name.slice(1))) { |
| 2277 |
this[name] = undefined; |
| 2278 |
} |
| 2279 |
} |
| 2280 |
} |
| 2281 |
}, |
| 2282 |
|
| 2283 |
stop: function() { |
| 2284 |
this.done = true; |
| 2285 |
|
| 2286 |
var rootEntry = this.tryEntries[0]; |
| 2287 |
var rootRecord = rootEntry.completion; |
| 2288 |
if (rootRecord.type === "throw") { |
| 2289 |
throw rootRecord.arg; |
| 2290 |
} |
| 2291 |
|
| 2292 |
return this.rval; |
| 2293 |
}, |
| 2294 |
|
| 2295 |
dispatchException: function(exception) { |
| 2296 |
if (this.done) { |
| 2297 |
throw exception; |
| 2298 |
} |
| 2299 |
|
| 2300 |
var context = this; |
| 2301 |
function handle(loc, caught) { |
| 2302 |
record.type = "throw"; |
| 2303 |
record.arg = exception; |
| 2304 |
context.next = loc; |
| 2305 |
|
| 2306 |
if (caught) { |
| 2307 |
// If the dispatched exception was caught by a catch block, |
| 2308 |
// then let that catch block handle the exception normally. |
| 2309 |
context.method = "next"; |
| 2310 |
context.arg = undefined; |
| 2311 |
} |
| 2312 |
|
| 2313 |
return !! caught; |
| 2314 |
} |
| 2315 |
|
| 2316 |
for (var i = this.tryEntries.length - 1; i >= 0; --i) { |
| 2317 |
var entry = this.tryEntries[i]; |
| 2318 |
var record = entry.completion; |
| 2319 |
|
| 2320 |
if (entry.tryLoc === "root") { |
| 2321 |
// Exception thrown outside of any try block that could handle |
| 2322 |
// it, so set the completion value of the entire function to |
| 2323 |
// throw the exception. |
| 2324 |
return handle("end"); |
| 2325 |
} |
| 2326 |
|
| 2327 |
if (entry.tryLoc <= this.prev) { |
| 2328 |
var hasCatch = hasOwn.call(entry, "catchLoc"); |
| 2329 |
var hasFinally = hasOwn.call(entry, "finallyLoc"); |
| 2330 |
|
| 2331 |
if (hasCatch && hasFinally) { |
| 2332 |
if (this.prev < entry.catchLoc) { |
| 2333 |
return handle(entry.catchLoc, true); |
| 2334 |
} else if (this.prev < entry.finallyLoc) { |
| 2335 |
return handle(entry.finallyLoc); |
| 2336 |
} |
| 2337 |
|
| 2338 |
} else if (hasCatch) { |
| 2339 |
if (this.prev < entry.catchLoc) { |
| 2340 |
return handle(entry.catchLoc, true); |
| 2341 |
} |
| 2342 |
|
| 2343 |
} else if (hasFinally) { |
| 2344 |
if (this.prev < entry.finallyLoc) { |
| 2345 |
return handle(entry.finallyLoc); |
| 2346 |
} |
| 2347 |
|
| 2348 |
} else { |
| 2349 |
throw new Error("try statement without catch or finally"); |
| 2350 |
} |
| 2351 |
} |
| 2352 |
} |
| 2353 |
}, |
| 2354 |
|
| 2355 |
abrupt: function(type, arg) { |
| 2356 |
for (var i = this.tryEntries.length - 1; i >= 0; --i) { |
| 2357 |
var entry = this.tryEntries[i]; |
| 2358 |
if (entry.tryLoc <= this.prev && |
| 2359 |
hasOwn.call(entry, "finallyLoc") && |
| 2360 |
this.prev < entry.finallyLoc) { |
| 2361 |
var finallyEntry = entry; |
| 2362 |
break; |
| 2363 |
} |
| 2364 |
} |
| 2365 |
|
| 2366 |
if (finallyEntry && |
| 2367 |
(type === "break" || |
| 2368 |
type === "continue") && |
| 2369 |
finallyEntry.tryLoc <= arg && |
| 2370 |
arg <= finallyEntry.finallyLoc) { |
| 2371 |
// Ignore the finally entry if control is not jumping to a |
| 2372 |
// location outside the try/catch block. |
| 2373 |
finallyEntry = null; |
| 2374 |
} |
| 2375 |
|
| 2376 |
var record = finallyEntry ? finallyEntry.completion : {}; |
| 2377 |
record.type = type; |
| 2378 |
record.arg = arg; |
| 2379 |
|
| 2380 |
if (finallyEntry) { |
| 2381 |
this.method = "next"; |
| 2382 |
this.next = finallyEntry.finallyLoc; |
| 2383 |
return ContinueSentinel; |
| 2384 |
} |
| 2385 |
|
| 2386 |
return this.complete(record); |
| 2387 |
}, |
| 2388 |
|
| 2389 |
complete: function(record, afterLoc) { |
| 2390 |
if (record.type === "throw") { |
| 2391 |
throw record.arg; |
| 2392 |
} |
| 2393 |
|
| 2394 |
if (record.type === "break" || |
| 2395 |
record.type === "continue") { |
| 2396 |
this.next = record.arg; |
| 2397 |
} else if (record.type === "return") { |
| 2398 |
this.rval = this.arg = record.arg; |
| 2399 |
this.method = "return"; |
| 2400 |
this.next = "end"; |
| 2401 |
} else if (record.type === "normal" && afterLoc) { |
| 2402 |
this.next = afterLoc; |
| 2403 |
} |
| 2404 |
|
| 2405 |
return ContinueSentinel; |
| 2406 |
}, |
| 2407 |
|
| 2408 |
finish: function(finallyLoc) { |
| 2409 |
for (var i = this.tryEntries.length - 1; i >= 0; --i) { |
| 2410 |
var entry = this.tryEntries[i]; |
| 2411 |
if (entry.finallyLoc === finallyLoc) { |
| 2412 |
this.complete(entry.completion, entry.afterLoc); |
| 2413 |
resetTryEntry(entry); |
| 2414 |
return ContinueSentinel; |
| 2415 |
} |
| 2416 |
} |
| 2417 |
}, |
| 2418 |
|
| 2419 |
"catch": function(tryLoc) { |
| 2420 |
for (var i = this.tryEntries.length - 1; i >= 0; --i) { |
| 2421 |
var entry = this.tryEntries[i]; |
| 2422 |
if (entry.tryLoc === tryLoc) { |
| 2423 |
var record = entry.completion; |
| 2424 |
if (record.type === "throw") { |
| 2425 |
var thrown = record.arg; |
| 2426 |
resetTryEntry(entry); |
| 2427 |
} |
| 2428 |
return thrown; |
| 2429 |
} |
| 2430 |
} |
| 2431 |
|
| 2432 |
// The context.catch method must only be called with a location |
| 2433 |
// argument that corresponds to a known catch block. |
| 2434 |
throw new Error("illegal catch attempt"); |
| 2435 |
}, |
| 2436 |
|
| 2437 |
delegateYield: function(iterable, resultName, nextLoc) { |
| 2438 |
this.delegate = { |
| 2439 |
iterator: values(iterable), |
| 2440 |
resultName: resultName, |
| 2441 |
nextLoc: nextLoc |
| 2442 |
}; |
| 2443 |
|
| 2444 |
if (this.method === "next") { |
| 2445 |
// Deliberately forget the last sent value so that we don't |
| 2446 |
// accidentally pass it on to the delegate. |
| 2447 |
this.arg = undefined; |
| 2448 |
} |
| 2449 |
|
| 2450 |
return ContinueSentinel; |
| 2451 |
} |
| 2452 |
}; |
| 2453 |
|
| 2454 |
// Regardless of whether this script is executing as a CommonJS module |
| 2455 |
// or not, return the runtime object so that we can declare the variable |
| 2456 |
// regeneratorRuntime in the outer scope, which allows this module to be |
| 2457 |
// injected easily by `bin/regenerator --include-runtime script.js`. |
| 2458 |
return exports; |
| 2459 |
|
| 2460 |
}( |
| 2461 |
// If this script is executing as a CommonJS module, use module.exports |
| 2462 |
// as the regeneratorRuntime namespace. Otherwise create a new empty |
| 2463 |
// object. Either way, the resulting object will be used to initialize |
| 2464 |
// the regeneratorRuntime variable at the top of this file. |
| 2465 |
true ? module.exports : undefined |
| 2466 |
)); |
| 2467 |
|
| 2468 |
try { |
| 2469 |
regeneratorRuntime = runtime; |
| 2470 |
} catch (accidentalStrictMode) { |
| 2471 |
// This module should not be running in strict mode, so the above |
| 2472 |
// assignment should always work unless something is misconfigured. Just |
| 2473 |
// in case runtime.js accidentally runs in strict mode, we can escape |
| 2474 |
// strict mode using a global Function call. This could conceivably fail |
| 2475 |
// if a Content Security Policy forbids using Function, but in that case |
| 2476 |
// the proper solution is to fix the accidental strict mode problem. If |
| 2477 |
// you've misconfigured your bundler to force strict mode and applied a |
| 2478 |
// CSP to forbid Function, and you're not willing to fix either of those |
| 2479 |
// problems, please detail your unique predicament in a GitHub issue. |
| 2480 |
Function("r", "regeneratorRuntime = r")(runtime); |
| 2481 |
} |
| 2482 |
|
| 2483 |
|
| 2484 |
/***/ }), |
| 2485 |
/* 67 */ |
| 2486 |
/***/ (function(module, exports, __webpack_require__) { |
| 2487 |
|
| 2488 |
var core = __webpack_require__(54); |
| 2489 |
var global = __webpack_require__(17); |
| 2490 |
var SHARED = '__core-js_shared__'; |
| 2491 |
var store = global[SHARED] || (global[SHARED] = {}); |
| 2492 |
|
| 2493 |
(module.exports = function (key, value) { |
| 2494 |
return store[key] || (store[key] = value !== undefined ? value : {}); |
| 2495 |
})('versions', []).push({ |
| 2496 |
version: core.version, |
| 2497 |
mode: __webpack_require__(110) ? 'pure' : 'global', |
| 2498 |
copyright: '© 2019 Denis Pushkarev (zloirock.ru)' |
| 2499 |
}); |
| 2500 |
|
| 2501 |
|
| 2502 |
/***/ }), |
| 2503 |
/* 68 */ |
| 2504 |
/***/ (function(module, exports) { |
| 2505 |
|
| 2506 |
var id = 0; |
| 2507 |
var px = Math.random(); |
| 2508 |
module.exports = function (key) { |
| 2509 |
return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36)); |
| 2510 |
}; |
| 2511 |
|
| 2512 |
|
| 2513 |
/***/ }), |
| 2514 |
/* 69 */ |
| 2515 |
/***/ (function(module, exports, __webpack_require__) { |
| 2516 |
|
| 2517 |
// 7.1.15 ToLength |
| 2518 |
var toInteger = __webpack_require__(77); |
| 2519 |
var min = Math.min; |
| 2520 |
module.exports = function (it) { |
| 2521 |
return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991 |
| 2522 |
}; |
| 2523 |
|
| 2524 |
|
| 2525 |
/***/ }), |
| 2526 |
/* 70 */ |
| 2527 |
/***/ (function(module, exports, __webpack_require__) { |
| 2528 |
|
| 2529 |
var META = __webpack_require__(59)('meta'); |
| 2530 |
var isObject = __webpack_require__(9); |
| 2531 |
var has = __webpack_require__(19); |
| 2532 |
var setDesc = __webpack_require__(15).f; |
| 2533 |
var id = 0; |
| 2534 |
var isExtensible = Object.isExtensible || function () { |
| 2535 |
return true; |
| 2536 |
}; |
| 2537 |
var FREEZE = !__webpack_require__(22)(function () { |
| 2538 |
return isExtensible(Object.preventExtensions({})); |
| 2539 |
}); |
| 2540 |
var setMeta = function (it) { |
| 2541 |
setDesc(it, META, { value: { |
| 2542 |
i: 'O' + ++id, // object ID |
| 2543 |
w: {} // weak collections IDs |
| 2544 |
} }); |
| 2545 |
}; |
| 2546 |
var fastKey = function (it, create) { |
| 2547 |
// return primitive with prefix |
| 2548 |
if (!isObject(it)) return typeof it == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it; |
| 2549 |
if (!has(it, META)) { |
| 2550 |
// can't set metadata to uncaught frozen object |
| 2551 |
if (!isExtensible(it)) return 'F'; |
| 2552 |
// not necessary to add metadata |
| 2553 |
if (!create) return 'E'; |
| 2554 |
// add missing metadata |
| 2555 |
setMeta(it); |
| 2556 |
// return object ID |
| 2557 |
} return it[META].i; |
| 2558 |
}; |
| 2559 |
var getWeak = function (it, create) { |
| 2560 |
if (!has(it, META)) { |
| 2561 |
// can't set metadata to uncaught frozen object |
| 2562 |
if (!isExtensible(it)) return true; |
| 2563 |
// not necessary to add metadata |
| 2564 |
if (!create) return false; |
| 2565 |
// add missing metadata |
| 2566 |
setMeta(it); |
| 2567 |
// return hash weak collections IDs |
| 2568 |
} return it[META].w; |
| 2569 |
}; |
| 2570 |
// add metadata on freeze-family methods calling |
| 2571 |
var onFreeze = function (it) { |
| 2572 |
if (FREEZE && meta.NEED && isExtensible(it) && !has(it, META)) setMeta(it); |
| 2573 |
return it; |
| 2574 |
}; |
| 2575 |
var meta = module.exports = { |
| 2576 |
KEY: META, |
| 2577 |
NEED: false, |
| 2578 |
fastKey: fastKey, |
| 2579 |
getWeak: getWeak, |
| 2580 |
onFreeze: onFreeze |
| 2581 |
}; |
| 2582 |
|
| 2583 |
|
| 2584 |
/***/ }), |
| 2585 |
/* 71 */ |
| 2586 |
/***/ (function(module, exports) { |
| 2587 |
|
| 2588 |
exports.f = Object.getOwnPropertySymbols; |
| 2589 |
|
| 2590 |
|
| 2591 |
/***/ }), |
| 2592 |
/* 72 */ |
| 2593 |
/***/ (function(module, exports, __webpack_require__) { |
| 2594 |
|
| 2595 |
"use strict"; |
| 2596 |
|
| 2597 |
// 19.1.3.6 Object.prototype.toString() |
| 2598 |
var classof = __webpack_require__(113); |
| 2599 |
var test = {}; |
| 2600 |
test[__webpack_require__(12)('toStringTag')] = 'z'; |
| 2601 |
if (test + '' != '[object z]') { |
| 2602 |
__webpack_require__(37)(Object.prototype, 'toString', function toString() { |
| 2603 |
return '[object ' + classof(this) + ']'; |
| 2604 |
}, true); |
| 2605 |
} |
| 2606 |
|
| 2607 |
|
| 2608 |
/***/ }), |
| 2609 |
/* 73 */ |
| 2610 |
/***/ (function(module, exports, __webpack_require__) { |
| 2611 |
|
| 2612 |
// optional / simple context binding |
| 2613 |
var aFunction = __webpack_require__(91); |
| 2614 |
module.exports = function (fn, that, length) { |
| 2615 |
aFunction(fn); |
| 2616 |
if (that === undefined) return fn; |
| 2617 |
switch (length) { |
| 2618 |
case 1: return function (a) { |
| 2619 |
return fn.call(that, a); |
| 2620 |
}; |
| 2621 |
case 2: return function (a, b) { |
| 2622 |
return fn.call(that, a, b); |
| 2623 |
}; |
| 2624 |
case 3: return function (a, b, c) { |
| 2625 |
return fn.call(that, a, b, c); |
| 2626 |
}; |
| 2627 |
} |
| 2628 |
return function (/* ...args */) { |
| 2629 |
return fn.apply(that, arguments); |
| 2630 |
}; |
| 2631 |
}; |
| 2632 |
|
| 2633 |
|
| 2634 |
/***/ }), |
| 2635 |
/* 74 */ |
| 2636 |
/***/ (function(module, exports, __webpack_require__) { |
| 2637 |
|
| 2638 |
// 7.1.1 ToPrimitive(input [, PreferredType]) |
| 2639 |
var isObject = __webpack_require__(9); |
| 2640 |
// instead of the ES6 spec version, we didn't implement @@toPrimitive case |
| 2641 |
// and the second argument - flag - preferred type is a string |
| 2642 |
module.exports = function (it, S) { |
| 2643 |
if (!isObject(it)) return it; |
| 2644 |
var fn, val; |
| 2645 |
if (S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val; |
| 2646 |
if (typeof (fn = it.valueOf) == 'function' && !isObject(val = fn.call(it))) return val; |
| 2647 |
if (!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val; |
| 2648 |
throw TypeError("Can't convert object to primitive value"); |
| 2649 |
}; |
| 2650 |
|
| 2651 |
|
| 2652 |
/***/ }), |
| 2653 |
/* 75 */ |
| 2654 |
/***/ (function(module, exports, __webpack_require__) { |
| 2655 |
|
| 2656 |
var shared = __webpack_require__(76)('keys'); |
| 2657 |
var uid = __webpack_require__(59); |
| 2658 |
module.exports = function (key) { |
| 2659 |
return shared[key] || (shared[key] = uid(key)); |
| 2660 |
}; |
| 2661 |
|
| 2662 |
|
| 2663 |
/***/ }), |
| 2664 |
/* 76 */ |
| 2665 |
/***/ (function(module, exports, __webpack_require__) { |
| 2666 |
|
| 2667 |
var core = __webpack_require__(6); |
| 2668 |
var global = __webpack_require__(8); |
| 2669 |
var SHARED = '__core-js_shared__'; |
| 2670 |
var store = global[SHARED] || (global[SHARED] = {}); |
| 2671 |
|
| 2672 |
(module.exports = function (key, value) { |
| 2673 |
return store[key] || (store[key] = value !== undefined ? value : {}); |
| 2674 |
})('versions', []).push({ |
| 2675 |
version: core.version, |
| 2676 |
mode: __webpack_require__(47) ? 'pure' : 'global', |
| 2677 |
copyright: '© 2019 Denis Pushkarev (zloirock.ru)' |
| 2678 |
}); |
| 2679 |
|
| 2680 |
|
| 2681 |
/***/ }), |
| 2682 |
/* 77 */ |
| 2683 |
/***/ (function(module, exports) { |
| 2684 |
|
| 2685 |
// 7.1.4 ToInteger |
| 2686 |
var ceil = Math.ceil; |
| 2687 |
var floor = Math.floor; |
| 2688 |
module.exports = function (it) { |
| 2689 |
return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it); |
| 2690 |
}; |
| 2691 |
|
| 2692 |
|
| 2693 |
/***/ }), |
| 2694 |
/* 78 */ |
| 2695 |
/***/ (function(module, exports) { |
| 2696 |
|
| 2697 |
// IE 8- don't enum bug keys |
| 2698 |
module.exports = ( |
| 2699 |
'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf' |
| 2700 |
).split(','); |
| 2701 |
|
| 2702 |
|
| 2703 |
/***/ }), |
| 2704 |
/* 79 */ |
| 2705 |
/***/ (function(module, exports, __webpack_require__) { |
| 2706 |
|
| 2707 |
var global = __webpack_require__(8); |
| 2708 |
var core = __webpack_require__(6); |
| 2709 |
var LIBRARY = __webpack_require__(47); |
| 2710 |
var wksExt = __webpack_require__(63); |
| 2711 |
var defineProperty = __webpack_require__(15).f; |
| 2712 |
module.exports = function (name) { |
| 2713 |
var $Symbol = core.Symbol || (core.Symbol = LIBRARY ? {} : global.Symbol || {}); |
| 2714 |
if (name.charAt(0) != '_' && !(name in $Symbol)) defineProperty($Symbol, name, { value: wksExt.f(name) }); |
| 2715 |
}; |
| 2716 |
|
| 2717 |
|
| 2718 |
/***/ }), |
| 2719 |
/* 80 */ |
| 2720 |
/***/ (function(module, exports, __webpack_require__) { |
| 2721 |
|
| 2722 |
"use strict"; |
| 2723 |
|
| 2724 |
|
| 2725 |
var isRegExp = __webpack_require__(122); |
| 2726 |
var anObject = __webpack_require__(18); |
| 2727 |
var speciesConstructor = __webpack_require__(154); |
| 2728 |
var advanceStringIndex = __webpack_require__(105); |
| 2729 |
var toLength = __webpack_require__(43); |
| 2730 |
var callRegExpExec = __webpack_require__(94); |
| 2731 |
var regexpExec = __webpack_require__(90); |
| 2732 |
var fails = __webpack_require__(33); |
| 2733 |
var $min = Math.min; |
| 2734 |
var $push = [].push; |
| 2735 |
var $SPLIT = 'split'; |
| 2736 |
var LENGTH = 'length'; |
| 2737 |
var LAST_INDEX = 'lastIndex'; |
| 2738 |
var MAX_UINT32 = 0xffffffff; |
| 2739 |
|
| 2740 |
// babel-minify transpiles RegExp('x', 'y') -> /x/y and it causes SyntaxError |
| 2741 |
var SUPPORTS_Y = !fails(function () { RegExp(MAX_UINT32, 'y'); }); |
| 2742 |
|
| 2743 |
// @@split logic |
| 2744 |
__webpack_require__(95)('split', 2, function (defined, SPLIT, $split, maybeCallNative) { |
| 2745 |
var internalSplit; |
| 2746 |
if ( |
| 2747 |
'abbc'[$SPLIT](/(b)*/)[1] == 'c' || |
| 2748 |
'test'[$SPLIT](/(?:)/, -1)[LENGTH] != 4 || |
| 2749 |
'ab'[$SPLIT](/(?:ab)*/)[LENGTH] != 2 || |
| 2750 |
'.'[$SPLIT](/(.?)(.?)/)[LENGTH] != 4 || |
| 2751 |
'.'[$SPLIT](/()()/)[LENGTH] > 1 || |
| 2752 |
''[$SPLIT](/.?/)[LENGTH] |
| 2753 |
) { |
| 2754 |
// based on es5-shim implementation, need to rework it |
| 2755 |
internalSplit = function (separator, limit) { |
| 2756 |
var string = String(this); |
| 2757 |
if (separator === undefined && limit === 0) return []; |
| 2758 |
// If `separator` is not a regex, use native split |
| 2759 |
if (!isRegExp(separator)) return $split.call(string, separator, limit); |
| 2760 |
var output = []; |
| 2761 |
var flags = (separator.ignoreCase ? 'i' : '') + |
| 2762 |
(separator.multiline ? 'm' : '') + |
| 2763 |
(separator.unicode ? 'u' : '') + |
| 2764 |
(separator.sticky ? 'y' : ''); |
| 2765 |
var lastLastIndex = 0; |
| 2766 |
var splitLimit = limit === undefined ? MAX_UINT32 : limit >>> 0; |
| 2767 |
// Make `global` and avoid `lastIndex` issues by working with a copy |
| 2768 |
var separatorCopy = new RegExp(separator.source, flags + 'g'); |
| 2769 |
var match, lastIndex, lastLength; |
| 2770 |
while (match = regexpExec.call(separatorCopy, string)) { |
| 2771 |
lastIndex = separatorCopy[LAST_INDEX]; |
| 2772 |
if (lastIndex > lastLastIndex) { |
| 2773 |
output.push(string.slice(lastLastIndex, match.index)); |
| 2774 |
if (match[LENGTH] > 1 && match.index < string[LENGTH]) $push.apply(output, match.slice(1)); |
| 2775 |
lastLength = match[0][LENGTH]; |
| 2776 |
lastLastIndex = lastIndex; |
| 2777 |
if (output[LENGTH] >= splitLimit) break; |
| 2778 |
} |
| 2779 |
if (separatorCopy[LAST_INDEX] === match.index) separatorCopy[LAST_INDEX]++; // Avoid an infinite loop |
| 2780 |
} |
| 2781 |
if (lastLastIndex === string[LENGTH]) { |
| 2782 |
if (lastLength || !separatorCopy.test('')) output.push(''); |
| 2783 |
} else output.push(string.slice(lastLastIndex)); |
| 2784 |
return output[LENGTH] > splitLimit ? output.slice(0, splitLimit) : output; |
| 2785 |
}; |
| 2786 |
// Chakra, V8 |
| 2787 |
} else if ('0'[$SPLIT](undefined, 0)[LENGTH]) { |
| 2788 |
internalSplit = function (separator, limit) { |
| 2789 |
return separator === undefined && limit === 0 ? [] : $split.call(this, separator, limit); |
| 2790 |
}; |
| 2791 |
} else { |
| 2792 |
internalSplit = $split; |
| 2793 |
} |
| 2794 |
|
| 2795 |
return [ |
| 2796 |
// `String.prototype.split` method |
| 2797 |
// https://tc39.github.io/ecma262/#sec-string.prototype.split |
| 2798 |
function split(separator, limit) { |
| 2799 |
var O = defined(this); |
| 2800 |
var splitter = separator == undefined ? undefined : separator[SPLIT]; |
| 2801 |
return splitter !== undefined |
| 2802 |
? splitter.call(separator, O, limit) |
| 2803 |
: internalSplit.call(String(O), separator, limit); |
| 2804 |
}, |
| 2805 |
// `RegExp.prototype[@@split]` method |
| 2806 |
// https://tc39.github.io/ecma262/#sec-regexp.prototype-@@split |
| 2807 |
// |
| 2808 |
// NOTE: This cannot be properly polyfilled in engines that don't support |
| 2809 |
// the 'y' flag. |
| 2810 |
function (regexp, limit) { |
| 2811 |
var res = maybeCallNative(internalSplit, regexp, this, limit, internalSplit !== $split); |
| 2812 |
if (res.done) return res.value; |
| 2813 |
|
| 2814 |
var rx = anObject(regexp); |
| 2815 |
var S = String(this); |
| 2816 |
var C = speciesConstructor(rx, RegExp); |
| 2817 |
|
| 2818 |
var unicodeMatching = rx.unicode; |
| 2819 |
var flags = (rx.ignoreCase ? 'i' : '') + |
| 2820 |
(rx.multiline ? 'm' : '') + |
| 2821 |
(rx.unicode ? 'u' : '') + |
| 2822 |
(SUPPORTS_Y ? 'y' : 'g'); |
| 2823 |
|
| 2824 |
// ^(? + rx + ) is needed, in combination with some S slicing, to |
| 2825 |
// simulate the 'y' flag. |
| 2826 |
var splitter = new C(SUPPORTS_Y ? rx : '^(?:' + rx.source + ')', flags); |
| 2827 |
var lim = limit === undefined ? MAX_UINT32 : limit >>> 0; |
| 2828 |
if (lim === 0) return []; |
| 2829 |
if (S.length === 0) return callRegExpExec(splitter, S) === null ? [S] : []; |
| 2830 |
var p = 0; |
| 2831 |
var q = 0; |
| 2832 |
var A = []; |
| 2833 |
while (q < S.length) { |
| 2834 |
splitter.lastIndex = SUPPORTS_Y ? q : 0; |
| 2835 |
var z = callRegExpExec(splitter, SUPPORTS_Y ? S : S.slice(q)); |
| 2836 |
var e; |
| 2837 |
if ( |
| 2838 |
z === null || |
| 2839 |
(e = $min(toLength(splitter.lastIndex + (SUPPORTS_Y ? 0 : q)), S.length)) === p |
| 2840 |
) { |
| 2841 |
q = advanceStringIndex(S, q, unicodeMatching); |
| 2842 |
} else { |
| 2843 |
A.push(S.slice(p, q)); |
| 2844 |
if (A.length === lim) return A; |
| 2845 |
for (var i = 1; i <= z.length - 1; i++) { |
| 2846 |
A.push(z[i]); |
| 2847 |
if (A.length === lim) return A; |
| 2848 |
} |
| 2849 |
q = p = e; |
| 2850 |
} |
| 2851 |
} |
| 2852 |
A.push(S.slice(p)); |
| 2853 |
return A; |
| 2854 |
} |
| 2855 |
]; |
| 2856 |
}); |
| 2857 |
|
| 2858 |
|
| 2859 |
/***/ }), |
| 2860 |
/* 81 */, |
| 2861 |
/* 82 */ |
| 2862 |
/***/ (function(module, exports, __webpack_require__) { |
| 2863 |
|
| 2864 |
module.exports = __webpack_require__(66); |
| 2865 |
|
| 2866 |
|
| 2867 |
/***/ }), |
| 2868 |
/* 83 */ |
| 2869 |
/***/ (function(module, exports, __webpack_require__) { |
| 2870 |
|
| 2871 |
var _Promise = __webpack_require__(133); |
| 2872 |
|
| 2873 |
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { |
| 2874 |
try { |
| 2875 |
var info = gen[key](arg); |
| 2876 |
var value = info.value; |
| 2877 |
} catch (error) { |
| 2878 |
reject(error); |
| 2879 |
return; |
| 2880 |
} |
| 2881 |
|
| 2882 |
if (info.done) { |
| 2883 |
resolve(value); |
| 2884 |
} else { |
| 2885 |
_Promise.resolve(value).then(_next, _throw); |
| 2886 |
} |
| 2887 |
} |
| 2888 |
|
| 2889 |
function _asyncToGenerator(fn) { |
| 2890 |
return function () { |
| 2891 |
var self = this, |
| 2892 |
args = arguments; |
| 2893 |
return new _Promise(function (resolve, reject) { |
| 2894 |
var gen = fn.apply(self, args); |
| 2895 |
|
| 2896 |
function _next(value) { |
| 2897 |
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); |
| 2898 |
} |
| 2899 |
|
| 2900 |
function _throw(err) { |
| 2901 |
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); |
| 2902 |
} |
| 2903 |
|
| 2904 |
_next(undefined); |
| 2905 |
}); |
| 2906 |
}; |
| 2907 |
} |
| 2908 |
|
| 2909 |
module.exports = _asyncToGenerator; |
| 2910 |
|
| 2911 |
/***/ }), |
| 2912 |
/* 84 */ |
| 2913 |
/***/ (function(module, exports, __webpack_require__) { |
| 2914 |
|
| 2915 |
module.exports = __webpack_require__(220); |
| 2916 |
|
| 2917 |
/***/ }), |
| 2918 |
/* 85 */ |
| 2919 |
/***/ (function(module, exports, __webpack_require__) { |
| 2920 |
|
| 2921 |
"use strict"; |
| 2922 |
|
| 2923 |
|
| 2924 |
var _interopRequireDefault = __webpack_require__(0); |
| 2925 |
|
| 2926 |
var _Object$defineProperty = __webpack_require__(1); |
| 2927 |
|
| 2928 |
_Object$defineProperty(exports, "__esModule", { |
| 2929 |
value: true |
| 2930 |
}); |
| 2931 |
|
| 2932 |
exports.default = void 0; |
| 2933 |
|
| 2934 |
__webpack_require__(58); |
| 2935 |
|
| 2936 |
var _keys = _interopRequireDefault(__webpack_require__(23)); |
| 2937 |
|
| 2938 |
__webpack_require__(80); |
| 2939 |
|
| 2940 |
var _values = _interopRequireDefault(__webpack_require__(55)); |
| 2941 |
|
| 2942 |
var _slicedToArray2 = _interopRequireDefault(__webpack_require__(102)); |
| 2943 |
|
| 2944 |
var _entries = _interopRequireDefault(__webpack_require__(89)); |
| 2945 |
|
| 2946 |
var _classCallCheck2 = _interopRequireDefault(__webpack_require__(2)); |
| 2947 |
|
| 2948 |
var _createClass2 = _interopRequireDefault(__webpack_require__(3)); |
| 2949 |
|
| 2950 |
var _inherits2 = _interopRequireDefault(__webpack_require__(4)); |
| 2951 |
|
| 2952 |
var _createSuper2 = _interopRequireDefault(__webpack_require__(5)); |
| 2953 |
|
| 2954 |
var ComponentBase = /*#__PURE__*/function (_elementorModules$Mod) { |
| 2955 |
(0, _inherits2.default)(ComponentBase, _elementorModules$Mod); |
| 2956 |
|
| 2957 |
var _super = (0, _createSuper2.default)(ComponentBase); |
| 2958 |
|
| 2959 |
function ComponentBase() { |
| 2960 |
(0, _classCallCheck2.default)(this, ComponentBase); |
| 2961 |
return _super.apply(this, arguments); |
| 2962 |
} |
| 2963 |
|
| 2964 |
(0, _createClass2.default)(ComponentBase, [{ |
| 2965 |
key: "__construct", |
| 2966 |
value: function __construct() { |
| 2967 |
var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; |
| 2968 |
|
| 2969 |
if (args.manager) { |
| 2970 |
this.manager = args.manager; |
| 2971 |
} |
| 2972 |
|
| 2973 |
this.commands = this.defaultCommands(); |
| 2974 |
this.commandsInternal = this.defaultCommandsInternal(); |
| 2975 |
this.hooks = this.defaultHooks(); |
| 2976 |
this.routes = this.defaultRoutes(); |
| 2977 |
this.tabs = this.defaultTabs(); |
| 2978 |
this.shortcuts = this.defaultShortcuts(); |
| 2979 |
this.utils = this.defaultUtils(); |
| 2980 |
this.data = this.defaultData(); |
| 2981 |
this.defaultRoute = ''; |
| 2982 |
this.currentTab = ''; |
| 2983 |
} |
| 2984 |
}, { |
| 2985 |
key: "registerAPI", |
| 2986 |
value: function registerAPI() { |
| 2987 |
var _this = this; |
| 2988 |
|
| 2989 |
(0, _entries.default)(this.getTabs()).forEach(function (tab) { |
| 2990 |
return _this.registerTabRoute(tab[0]); |
| 2991 |
}); |
| 2992 |
(0, _entries.default)(this.getRoutes()).forEach(function (_ref) { |
| 2993 |
var _ref2 = (0, _slicedToArray2.default)(_ref, 2), |
| 2994 |
route = _ref2[0], |
| 2995 |
callback = _ref2[1]; |
| 2996 |
|
| 2997 |
return _this.registerRoute(route, callback); |
| 2998 |
}); |
| 2999 |
(0, _entries.default)(this.getCommands()).forEach(function (_ref3) { |
| 3000 |
var _ref4 = (0, _slicedToArray2.default)(_ref3, 2), |
| 3001 |
command = _ref4[0], |
| 3002 |
callback = _ref4[1]; |
| 3003 |
|
| 3004 |
return _this.registerCommand(command, callback); |
| 3005 |
}); |
| 3006 |
(0, _entries.default)(this.getCommandsInternal()).forEach(function (_ref5) { |
| 3007 |
var _ref6 = (0, _slicedToArray2.default)(_ref5, 2), |
| 3008 |
command = _ref6[0], |
| 3009 |
callback = _ref6[1]; |
| 3010 |
|
| 3011 |
return _this.registerCommandInternal(command, callback); |
| 3012 |
}); |
| 3013 |
(0, _values.default)(this.getHooks()).forEach(function (instance) { |
| 3014 |
return _this.registerHook(instance); |
| 3015 |
}); |
| 3016 |
(0, _entries.default)(this.getData()).forEach(function (_ref7) { |
| 3017 |
var _ref8 = (0, _slicedToArray2.default)(_ref7, 2), |
| 3018 |
command = _ref8[0], |
| 3019 |
callback = _ref8[1]; |
| 3020 |
|
| 3021 |
return _this.registerData(command, callback); |
| 3022 |
}); |
| 3023 |
} |
| 3024 |
/** |
| 3025 |
* @returns {string} |
| 3026 |
*/ |
| 3027 |
|
| 3028 |
}, { |
| 3029 |
key: "getNamespace", |
| 3030 |
value: function getNamespace() { |
| 3031 |
elementorModules.ForceMethodImplementation(); |
| 3032 |
} |
| 3033 |
}, { |
| 3034 |
key: "getRootContainer", |
| 3035 |
value: function getRootContainer() { |
| 3036 |
var parts = this.getNamespace().split('/'); |
| 3037 |
return parts[0]; |
| 3038 |
} |
| 3039 |
}, { |
| 3040 |
key: "defaultTabs", |
| 3041 |
value: function defaultTabs() { |
| 3042 |
return {}; |
| 3043 |
} |
| 3044 |
}, { |
| 3045 |
key: "defaultRoutes", |
| 3046 |
value: function defaultRoutes() { |
| 3047 |
return {}; |
| 3048 |
} |
| 3049 |
}, { |
| 3050 |
key: "defaultCommands", |
| 3051 |
value: function defaultCommands() { |
| 3052 |
return {}; |
| 3053 |
} |
| 3054 |
}, { |
| 3055 |
key: "defaultCommandsInternal", |
| 3056 |
value: function defaultCommandsInternal() { |
| 3057 |
return {}; |
| 3058 |
} |
| 3059 |
}, { |
| 3060 |
key: "defaultHooks", |
| 3061 |
value: function defaultHooks() { |
| 3062 |
return {}; |
| 3063 |
} |
| 3064 |
}, { |
| 3065 |
key: "defaultShortcuts", |
| 3066 |
value: function defaultShortcuts() { |
| 3067 |
return {}; |
| 3068 |
} |
| 3069 |
}, { |
| 3070 |
key: "defaultUtils", |
| 3071 |
value: function defaultUtils() { |
| 3072 |
return {}; |
| 3073 |
} |
| 3074 |
}, { |
| 3075 |
key: "defaultData", |
| 3076 |
value: function defaultData() { |
| 3077 |
return {}; |
| 3078 |
} |
| 3079 |
}, { |
| 3080 |
key: "getCommands", |
| 3081 |
value: function getCommands() { |
| 3082 |
return this.commands; |
| 3083 |
} |
| 3084 |
}, { |
| 3085 |
key: "getCommandsInternal", |
| 3086 |
value: function getCommandsInternal() { |
| 3087 |
return this.commandsInternal; |
| 3088 |
} |
| 3089 |
}, { |
| 3090 |
key: "getHooks", |
| 3091 |
value: function getHooks() { |
| 3092 |
return this.hooks; |
| 3093 |
} |
| 3094 |
}, { |
| 3095 |
key: "getRoutes", |
| 3096 |
value: function getRoutes() { |
| 3097 |
return this.routes; |
| 3098 |
} |
| 3099 |
}, { |
| 3100 |
key: "getTabs", |
| 3101 |
value: function getTabs() { |
| 3102 |
return this.tabs; |
| 3103 |
} |
| 3104 |
}, { |
| 3105 |
key: "getShortcuts", |
| 3106 |
value: function getShortcuts() { |
| 3107 |
return this.shortcuts; |
| 3108 |
} |
| 3109 |
}, { |
| 3110 |
key: "getData", |
| 3111 |
value: function getData() { |
| 3112 |
return this.data; |
| 3113 |
} |
| 3114 |
}, { |
| 3115 |
key: "registerCommand", |
| 3116 |
value: function registerCommand(command, callback) { |
| 3117 |
$e.commands.register(this, command, callback); |
| 3118 |
} |
| 3119 |
/** |
| 3120 |
* @param {HookBase} instance |
| 3121 |
*/ |
| 3122 |
|
| 3123 |
}, { |
| 3124 |
key: "registerHook", |
| 3125 |
value: function registerHook(instance) { |
| 3126 |
return instance.register(); |
| 3127 |
} |
| 3128 |
}, { |
| 3129 |
key: "registerCommandInternal", |
| 3130 |
value: function registerCommandInternal(command, callback) { |
| 3131 |
$e.commandsInternal.register(this, command, callback); |
| 3132 |
} |
| 3133 |
}, { |
| 3134 |
key: "registerRoute", |
| 3135 |
value: function registerRoute(route, callback) { |
| 3136 |
$e.routes.register(this, route, callback); |
| 3137 |
} |
| 3138 |
}, { |
| 3139 |
key: "registerData", |
| 3140 |
value: function registerData(command, callback) { |
| 3141 |
$e.data.register(this, command, callback); |
| 3142 |
} |
| 3143 |
}, { |
| 3144 |
key: "unregisterRoute", |
| 3145 |
value: function unregisterRoute(route) { |
| 3146 |
$e.routes.unregister(this, route); |
| 3147 |
} |
| 3148 |
}, { |
| 3149 |
key: "registerTabRoute", |
| 3150 |
value: function registerTabRoute(tab) { |
| 3151 |
var _this2 = this; |
| 3152 |
|
| 3153 |
this.registerRoute(tab, function (args) { |
| 3154 |
return _this2.activateTab(tab, args); |
| 3155 |
}); |
| 3156 |
} |
| 3157 |
}, { |
| 3158 |
key: "dependency", |
| 3159 |
value: function dependency() { |
| 3160 |
return true; |
| 3161 |
} |
| 3162 |
}, { |
| 3163 |
key: "open", |
| 3164 |
value: function open() { |
| 3165 |
return true; |
| 3166 |
} |
| 3167 |
}, { |
| 3168 |
key: "close", |
| 3169 |
value: function close() { |
| 3170 |
if (!this.isOpen) { |
| 3171 |
return false; |
| 3172 |
} |
| 3173 |
|
| 3174 |
this.isOpen = false; |
| 3175 |
this.inactivate(); |
| 3176 |
$e.routes.clearCurrent(this.getNamespace()); |
| 3177 |
$e.routes.clearHistory(this.getRootContainer()); |
| 3178 |
return true; |
| 3179 |
} |
| 3180 |
}, { |
| 3181 |
key: "activate", |
| 3182 |
value: function activate() { |
| 3183 |
$e.components.activate(this.getNamespace()); |
| 3184 |
} |
| 3185 |
}, { |
| 3186 |
key: "inactivate", |
| 3187 |
value: function inactivate() { |
| 3188 |
$e.components.inactivate(this.getNamespace()); |
| 3189 |
} |
| 3190 |
}, { |
| 3191 |
key: "isActive", |
| 3192 |
value: function isActive() { |
| 3193 |
return $e.components.isActive(this.getNamespace()); |
| 3194 |
} |
| 3195 |
}, { |
| 3196 |
key: "onRoute", |
| 3197 |
value: function onRoute(route) { |
| 3198 |
this.toggleRouteClass(route, true); |
| 3199 |
this.toggleHistoryClass(); |
| 3200 |
this.activate(); |
| 3201 |
this.trigger('route/open', route); |
| 3202 |
} |
| 3203 |
}, { |
| 3204 |
key: "onCloseRoute", |
| 3205 |
value: function onCloseRoute(route) { |
| 3206 |
this.toggleRouteClass(route, false); |
| 3207 |
this.inactivate(); |
| 3208 |
this.trigger('route/close', route); |
| 3209 |
} |
| 3210 |
}, { |
| 3211 |
key: "setDefaultRoute", |
| 3212 |
value: function setDefaultRoute(route) { |
| 3213 |
this.defaultRoute = this.getNamespace() + '/' + route; |
| 3214 |
} |
| 3215 |
}, { |
| 3216 |
key: "getDefaultRoute", |
| 3217 |
value: function getDefaultRoute() { |
| 3218 |
return this.defaultRoute; |
| 3219 |
} |
| 3220 |
}, { |
| 3221 |
key: "removeTab", |
| 3222 |
value: function removeTab(tab) { |
| 3223 |
delete this.tabs[tab]; |
| 3224 |
this.unregisterRoute(tab); |
| 3225 |
} |
| 3226 |
}, { |
| 3227 |
key: "hasTab", |
| 3228 |
value: function hasTab(tab) { |
| 3229 |
return !!this.tabs[tab]; |
| 3230 |
} |
| 3231 |
}, { |
| 3232 |
key: "addTab", |
| 3233 |
value: function addTab(tab, args, position) { |
| 3234 |
var _this3 = this; |
| 3235 |
|
| 3236 |
this.tabs[tab] = args; // It can be 0. |
| 3237 |
|
| 3238 |
if ('undefined' !== typeof position) { |
| 3239 |
var newTabs = {}; |
| 3240 |
var ids = (0, _keys.default)(this.tabs); // Remove new tab |
| 3241 |
|
| 3242 |
ids.pop(); // Add it to position. |
| 3243 |
|
| 3244 |
ids.splice(position, 0, tab); |
| 3245 |
ids.forEach(function (id) { |
| 3246 |
newTabs[id] = _this3.tabs[id]; |
| 3247 |
}); |
| 3248 |
this.tabs = newTabs; |
| 3249 |
} |
| 3250 |
|
| 3251 |
this.registerTabRoute(tab); |
| 3252 |
} |
| 3253 |
}, { |
| 3254 |
key: "getTabsWrapperSelector", |
| 3255 |
value: function getTabsWrapperSelector() { |
| 3256 |
return ''; |
| 3257 |
} |
| 3258 |
}, { |
| 3259 |
key: "getTabRoute", |
| 3260 |
value: function getTabRoute(tab) { |
| 3261 |
return this.getNamespace() + '/' + tab; |
| 3262 |
} |
| 3263 |
}, { |
| 3264 |
key: "renderTab", |
| 3265 |
value: function renderTab(tab) {} // eslint-disable-line |
| 3266 |
|
| 3267 |
}, { |
| 3268 |
key: "activateTab", |
| 3269 |
value: function activateTab(tab, args) { |
| 3270 |
var _this4 = this; |
| 3271 |
|
| 3272 |
this.currentTab = tab; |
| 3273 |
this.renderTab(tab, args); |
| 3274 |
jQuery(this.getTabsWrapperSelector() + ' .elementor-component-tab').off('click').on('click', function (event) { |
| 3275 |
$e.route(_this4.getTabRoute(event.currentTarget.dataset.tab), args); |
| 3276 |
}).removeClass('elementor-active').filter('[data-tab="' + tab + '"]').addClass('elementor-active'); |
| 3277 |
} |
| 3278 |
}, { |
| 3279 |
key: "getActiveTabConfig", |
| 3280 |
value: function getActiveTabConfig() { |
| 3281 |
return this.tabs[this.currentTab] || {}; |
| 3282 |
} |
| 3283 |
}, { |
| 3284 |
key: "getBodyClass", |
| 3285 |
value: function getBodyClass(route) { |
| 3286 |
return 'e-route-' + route.replace(/\//g, '-'); |
| 3287 |
} |
| 3288 |
/** |
| 3289 |
* If command includes uppercase character convert it to lowercase and add `-`. |
| 3290 |
* e.g: `CopyAll` is converted to `copy-all`. |
| 3291 |
*/ |
| 3292 |
|
| 3293 |
}, { |
| 3294 |
key: "normalizeCommandName", |
| 3295 |
value: function normalizeCommandName(commandName) { |
| 3296 |
return commandName.replace(/[A-Z]/g, function (match, offset) { |
| 3297 |
return (offset > 0 ? '-' : '') + match.toLowerCase(); |
| 3298 |
}); |
| 3299 |
} |
| 3300 |
}, { |
| 3301 |
key: "importCommands", |
| 3302 |
value: function importCommands(commandsFromImport) { |
| 3303 |
var _this5 = this; |
| 3304 |
|
| 3305 |
var commands = {}; // Convert `Commands` to `ComponentBase` workable format. |
| 3306 |
|
| 3307 |
(0, _entries.default)(commandsFromImport).forEach(function (_ref9) { |
| 3308 |
var _ref10 = (0, _slicedToArray2.default)(_ref9, 2), |
| 3309 |
className = _ref10[0], |
| 3310 |
Class = _ref10[1]; |
| 3311 |
|
| 3312 |
var command = _this5.normalizeCommandName(className); |
| 3313 |
|
| 3314 |
commands[command] = function (args) { |
| 3315 |
return new Class(args).run(); |
| 3316 |
}; // TODO: Temporary code, remove after merge with 'require-commands-base' branch. |
| 3317 |
// should not return callback, but Class or Instance without run ( gain performance ). |
| 3318 |
|
| 3319 |
|
| 3320 |
$e.commands.classes[_this5.getNamespace() + '/' + command] = Class; |
| 3321 |
}); |
| 3322 |
return commands; |
| 3323 |
} |
| 3324 |
}, { |
| 3325 |
key: "importHooks", |
| 3326 |
value: function importHooks(hooksFromImport) { |
| 3327 |
var hooks = {}; |
| 3328 |
|
| 3329 |
for (var key in hooksFromImport) { |
| 3330 |
var hook = new hooksFromImport[key](); |
| 3331 |
hooks[hook.getId()] = hook; |
| 3332 |
} |
| 3333 |
|
| 3334 |
return hooks; |
| 3335 |
} |
| 3336 |
}, { |
| 3337 |
key: "toggleRouteClass", |
| 3338 |
value: function toggleRouteClass(route, state) { |
| 3339 |
elementorCommon.elements.$body.toggleClass(this.getBodyClass(route), state); |
| 3340 |
} |
| 3341 |
}, { |
| 3342 |
key: "toggleHistoryClass", |
| 3343 |
value: function toggleHistoryClass() { |
| 3344 |
elementorCommon.elements.$body.toggleClass('e-routes-has-history', !!$e.routes.getHistory(this.getRootContainer()).length); |
| 3345 |
} |
| 3346 |
}]); |
| 3347 |
return ComponentBase; |
| 3348 |
}(elementorModules.Module); |
| 3349 |
|
| 3350 |
exports.default = ComponentBase; |
| 3351 |
|
| 3352 |
/***/ }), |
| 3353 |
/* 86 */ |
| 3354 |
/***/ (function(module, exports, __webpack_require__) { |
| 3355 |
|
| 3356 |
// most Object methods by ES6 should accept primitives |
| 3357 |
var $export = __webpack_require__(7); |
| 3358 |
var core = __webpack_require__(6); |
| 3359 |
var fails = __webpack_require__(22); |
| 3360 |
module.exports = function (KEY, exec) { |
| 3361 |
var fn = (core.Object || {})[KEY] || Object[KEY]; |
| 3362 |
var exp = {}; |
| 3363 |
exp[KEY] = exec(fn); |
| 3364 |
$export($export.S + $export.F * fails(function () { fn(1); }), 'Object', exp); |
| 3365 |
}; |
| 3366 |
|
| 3367 |
|
| 3368 |
/***/ }), |
| 3369 |
/* 87 */ |
| 3370 |
/***/ (function(module, exports, __webpack_require__) { |
| 3371 |
|
| 3372 |
// 22.1.3.31 Array.prototype[@@unscopables] |
| 3373 |
var UNSCOPABLES = __webpack_require__(12)('unscopables'); |
| 3374 |
var ArrayProto = Array.prototype; |
| 3375 |
if (ArrayProto[UNSCOPABLES] == undefined) __webpack_require__(29)(ArrayProto, UNSCOPABLES, {}); |
| 3376 |
module.exports = function (key) { |
| 3377 |
ArrayProto[UNSCOPABLES][key] = true; |
| 3378 |
}; |
| 3379 |
|
| 3380 |
|
| 3381 |
/***/ }), |
| 3382 |
/* 88 */ |
| 3383 |
/***/ (function(module, exports, __webpack_require__) { |
| 3384 |
|
| 3385 |
var ctx = __webpack_require__(31); |
| 3386 |
var call = __webpack_require__(141); |
| 3387 |
var isArrayIter = __webpack_require__(142); |
| 3388 |
var anObject = __webpack_require__(13); |
| 3389 |
var toLength = __webpack_require__(69); |
| 3390 |
var getIterFn = __webpack_require__(112); |
| 3391 |
var BREAK = {}; |
| 3392 |
var RETURN = {}; |
| 3393 |
var exports = module.exports = function (iterable, entries, fn, that, ITERATOR) { |
| 3394 |
var iterFn = ITERATOR ? function () { return iterable; } : getIterFn(iterable); |
| 3395 |
var f = ctx(fn, that, entries ? 2 : 1); |
| 3396 |
var index = 0; |
| 3397 |
var length, step, iterator, result; |
| 3398 |
if (typeof iterFn != 'function') throw TypeError(iterable + ' is not iterable!'); |
| 3399 |
// fast case for arrays with default iterator |
| 3400 |
if (isArrayIter(iterFn)) for (length = toLength(iterable.length); length > index; index++) { |
| 3401 |
result = entries ? f(anObject(step = iterable[index])[0], step[1]) : f(iterable[index]); |
| 3402 |
if (result === BREAK || result === RETURN) return result; |
| 3403 |
} else for (iterator = iterFn.call(iterable); !(step = iterator.next()).done;) { |
| 3404 |
result = call(iterator, f, step.value, entries); |
| 3405 |
if (result === BREAK || result === RETURN) return result; |
| 3406 |
} |
| 3407 |
}; |
| 3408 |
exports.BREAK = BREAK; |
| 3409 |
exports.RETURN = RETURN; |
| 3410 |
|
| 3411 |
|
| 3412 |
/***/ }), |
| 3413 |
/* 89 */ |
| 3414 |
/***/ (function(module, exports, __webpack_require__) { |
| 3415 |
|
| 3416 |
module.exports = __webpack_require__(269); |
| 3417 |
|
| 3418 |
/***/ }), |
| 3419 |
/* 90 */ |
| 3420 |
/***/ (function(module, exports, __webpack_require__) { |
| 3421 |
|
| 3422 |
"use strict"; |
| 3423 |
|
| 3424 |
|
| 3425 |
var regexpFlags = __webpack_require__(106); |
| 3426 |
|
| 3427 |
var nativeExec = RegExp.prototype.exec; |
| 3428 |
// This always refers to the native implementation, because the |
| 3429 |
// String#replace polyfill uses ./fix-regexp-well-known-symbol-logic.js, |
| 3430 |
// which loads this file before patching the method. |
| 3431 |
var nativeReplace = String.prototype.replace; |
| 3432 |
|
| 3433 |
var patchedExec = nativeExec; |
| 3434 |
|
| 3435 |
var LAST_INDEX = 'lastIndex'; |
| 3436 |
|
| 3437 |
var UPDATES_LAST_INDEX_WRONG = (function () { |
| 3438 |
var re1 = /a/, |
| 3439 |
re2 = /b*/g; |
| 3440 |
nativeExec.call(re1, 'a'); |
| 3441 |
nativeExec.call(re2, 'a'); |
| 3442 |
return re1[LAST_INDEX] !== 0 || re2[LAST_INDEX] !== 0; |
| 3443 |
})(); |
| 3444 |
|
| 3445 |
// nonparticipating capturing group, copied from es5-shim's String#split patch. |
| 3446 |
var NPCG_INCLUDED = /()??/.exec('')[1] !== undefined; |
| 3447 |
|
| 3448 |
var PATCH = UPDATES_LAST_INDEX_WRONG || NPCG_INCLUDED; |
| 3449 |
|
| 3450 |
if (PATCH) { |
| 3451 |
patchedExec = function exec(str) { |
| 3452 |
var re = this; |
| 3453 |
var lastIndex, reCopy, match, i; |
| 3454 |
|
| 3455 |
if (NPCG_INCLUDED) { |
| 3456 |
reCopy = new RegExp('^' + re.source + '$(?!\\s)', regexpFlags.call(re)); |
| 3457 |
} |
| 3458 |
if (UPDATES_LAST_INDEX_WRONG) lastIndex = re[LAST_INDEX]; |
| 3459 |
|
| 3460 |
match = nativeExec.call(re, str); |
| 3461 |
|
| 3462 |
if (UPDATES_LAST_INDEX_WRONG && match) { |
| 3463 |
re[LAST_INDEX] = re.global ? match.index + match[0].length : lastIndex; |
| 3464 |
} |
| 3465 |
if (NPCG_INCLUDED && match && match.length > 1) { |
| 3466 |
// Fix browsers whose `exec` methods don't consistently return `undefined` |
| 3467 |
// for NPCG, like IE8. NOTE: This doesn' work for /(.?)?/ |
| 3468 |
// eslint-disable-next-line no-loop-func |
| 3469 |
nativeReplace.call(match[0], reCopy, function () { |
| 3470 |
for (i = 1; i < arguments.length - 2; i++) { |
| 3471 |
if (arguments[i] === undefined) match[i] = undefined; |
| 3472 |
} |
| 3473 |
}); |
| 3474 |
} |
| 3475 |
|
| 3476 |
return match; |
| 3477 |
}; |
| 3478 |
} |
| 3479 |
|
| 3480 |
module.exports = patchedExec; |
| 3481 |
|
| 3482 |
|
| 3483 |
/***/ }), |
| 3484 |
/* 91 */ |
| 3485 |
/***/ (function(module, exports) { |
| 3486 |
|
| 3487 |
module.exports = function (it) { |
| 3488 |
if (typeof it != 'function') throw TypeError(it + ' is not a function!'); |
| 3489 |
return it; |
| 3490 |
}; |
| 3491 |
|
| 3492 |
|
| 3493 |
/***/ }), |
| 3494 |
/* 92 */ |
| 3495 |
/***/ (function(module, exports, __webpack_require__) { |
| 3496 |
|
| 3497 |
var isObject = __webpack_require__(9); |
| 3498 |
var document = __webpack_require__(8).document; |
| 3499 |
// typeof document.createElement is 'object' in old IE |
| 3500 |
var is = isObject(document) && isObject(document.createElement); |
| 3501 |
module.exports = function (it) { |
| 3502 |
return is ? document.createElement(it) : {}; |
| 3503 |
}; |
| 3504 |
|
| 3505 |
|
| 3506 |
/***/ }), |
| 3507 |
/* 93 */ |
| 3508 |
/***/ (function(module, exports, __webpack_require__) { |
| 3509 |
|
| 3510 |
module.exports = __webpack_require__(24); |
| 3511 |
|
| 3512 |
|
| 3513 |
/***/ }), |
| 3514 |
/* 94 */ |
| 3515 |
/***/ (function(module, exports, __webpack_require__) { |
| 3516 |
|
| 3517 |
"use strict"; |
| 3518 |
|
| 3519 |
|
| 3520 |
var classof = __webpack_require__(113); |
| 3521 |
var builtinExec = RegExp.prototype.exec; |
| 3522 |
|
| 3523 |
// `RegExpExec` abstract operation |
| 3524 |
// https://tc39.github.io/ecma262/#sec-regexpexec |
| 3525 |
module.exports = function (R, S) { |
| 3526 |
var exec = R.exec; |
| 3527 |
if (typeof exec === 'function') { |
| 3528 |
var result = exec.call(R, S); |
| 3529 |
if (typeof result !== 'object') { |
| 3530 |
throw new TypeError('RegExp exec method returned something other than an Object or null'); |
| 3531 |
} |
| 3532 |
return result; |
| 3533 |
} |
| 3534 |
if (classof(R) !== 'RegExp') { |
| 3535 |
throw new TypeError('RegExp#exec called on incompatible receiver'); |
| 3536 |
} |
| 3537 |
return builtinExec.call(R, S); |
| 3538 |
}; |
| 3539 |
|
| 3540 |
|
| 3541 |
/***/ }), |
| 3542 |
/* 95 */ |
| 3543 |
/***/ (function(module, exports, __webpack_require__) { |
| 3544 |
|
| 3545 |
"use strict"; |
| 3546 |
|
| 3547 |
__webpack_require__(190); |
| 3548 |
var redefine = __webpack_require__(37); |
| 3549 |
var hide = __webpack_require__(29); |
| 3550 |
var fails = __webpack_require__(33); |
| 3551 |
var defined = __webpack_require__(42); |
| 3552 |
var wks = __webpack_require__(12); |
| 3553 |
var regexpExec = __webpack_require__(90); |
| 3554 |
|
| 3555 |
var SPECIES = wks('species'); |
| 3556 |
|
| 3557 |
var REPLACE_SUPPORTS_NAMED_GROUPS = !fails(function () { |
| 3558 |
// #replace needs built-in support for named groups. |
| 3559 |
// #match works fine because it just return the exec results, even if it has |
| 3560 |
// a "grops" property. |
| 3561 |
var re = /./; |
| 3562 |
re.exec = function () { |
| 3563 |
var result = []; |
| 3564 |
result.groups = { a: '7' }; |
| 3565 |
return result; |
| 3566 |
}; |
| 3567 |
return ''.replace(re, '$<a>') !== '7'; |
| 3568 |
}); |
| 3569 |
|
| 3570 |
var SPLIT_WORKS_WITH_OVERWRITTEN_EXEC = (function () { |
| 3571 |
// Chrome 51 has a buggy "split" implementation when RegExp#exec !== nativeExec |
| 3572 |
var re = /(?:)/; |
| 3573 |
var originalExec = re.exec; |
| 3574 |
re.exec = function () { return originalExec.apply(this, arguments); }; |
| 3575 |
var result = 'ab'.split(re); |
| 3576 |
return result.length === 2 && result[0] === 'a' && result[1] === 'b'; |
| 3577 |
})(); |
| 3578 |
|
| 3579 |
module.exports = function (KEY, length, exec) { |
| 3580 |
var SYMBOL = wks(KEY); |
| 3581 |
|
| 3582 |
var DELEGATES_TO_SYMBOL = !fails(function () { |
| 3583 |
// String methods call symbol-named RegEp methods |
| 3584 |
var O = {}; |
| 3585 |
O[SYMBOL] = function () { return 7; }; |
| 3586 |
return ''[KEY](O) != 7; |
| 3587 |
}); |
| 3588 |
|
| 3589 |
var DELEGATES_TO_EXEC = DELEGATES_TO_SYMBOL ? !fails(function () { |
| 3590 |
// Symbol-named RegExp methods call .exec |
| 3591 |
var execCalled = false; |
| 3592 |
var re = /a/; |
| 3593 |
re.exec = function () { execCalled = true; return null; }; |
| 3594 |
if (KEY === 'split') { |
| 3595 |
// RegExp[@@split] doesn't call the regex's exec method, but first creates |
| 3596 |
// a new one. We need to return the patched regex when creating the new one. |
| 3597 |
re.constructor = {}; |
| 3598 |
re.constructor[SPECIES] = function () { return re; }; |
| 3599 |
} |
| 3600 |
re[SYMBOL](''); |
| 3601 |
return !execCalled; |
| 3602 |
}) : undefined; |
| 3603 |
|
| 3604 |
if ( |
| 3605 |
!DELEGATES_TO_SYMBOL || |
| 3606 |
!DELEGATES_TO_EXEC || |
| 3607 |
(KEY === 'replace' && !REPLACE_SUPPORTS_NAMED_GROUPS) || |
| 3608 |
(KEY === 'split' && !SPLIT_WORKS_WITH_OVERWRITTEN_EXEC) |
| 3609 |
) { |
| 3610 |
var nativeRegExpMethod = /./[SYMBOL]; |
| 3611 |
var fns = exec( |
| 3612 |
defined, |
| 3613 |
SYMBOL, |
| 3614 |
''[KEY], |
| 3615 |
function maybeCallNative(nativeMethod, regexp, str, arg2, forceStringMethod) { |
| 3616 |
if (regexp.exec === regexpExec) { |
| 3617 |
if (DELEGATES_TO_SYMBOL && !forceStringMethod) { |
| 3618 |
// The native String method already delegates to @@method (this |
| 3619 |
// polyfilled function), leasing to infinite recursion. |
| 3620 |
// We avoid it by directly calling the native @@method method. |
| 3621 |
return { done: true, value: nativeRegExpMethod.call(regexp, str, arg2) }; |
| 3622 |
} |
| 3623 |
return { done: true, value: nativeMethod.call(str, regexp, arg2) }; |
| 3624 |
} |
| 3625 |
return { done: false }; |
| 3626 |
} |
| 3627 |
); |
| 3628 |
var strfn = fns[0]; |
| 3629 |
var rxfn = fns[1]; |
| 3630 |
|
| 3631 |
redefine(String.prototype, KEY, strfn); |
| 3632 |
hide(RegExp.prototype, SYMBOL, length == 2 |
| 3633 |
// 21.2.5.8 RegExp.prototype[@@replace](string, replaceValue) |
| 3634 |
// 21.2.5.11 RegExp.prototype[@@split](string, limit) |
| 3635 |
? function (string, arg) { return rxfn.call(string, this, arg); } |
| 3636 |
// 21.2.5.6 RegExp.prototype[@@match](string) |
| 3637 |
// 21.2.5.9 RegExp.prototype[@@search](string) |
| 3638 |
: function (string) { return rxfn.call(string, this); } |
| 3639 |
); |
| 3640 |
} |
| 3641 |
}; |
| 3642 |
|
| 3643 |
|
| 3644 |
/***/ }), |
| 3645 |
/* 96 */ |
| 3646 |
/***/ (function(module, exports, __webpack_require__) { |
| 3647 |
|
| 3648 |
// 7.1.13 ToObject(argument) |
| 3649 |
var defined = __webpack_require__(42); |
| 3650 |
module.exports = function (it) { |
| 3651 |
return Object(defined(it)); |
| 3652 |
}; |
| 3653 |
|
| 3654 |
|
| 3655 |
/***/ }), |
| 3656 |
/* 97 */ |
| 3657 |
/***/ (function(module, exports, __webpack_require__) { |
| 3658 |
|
| 3659 |
// 7.2.2 IsArray(argument) |
| 3660 |
var cof = __webpack_require__(56); |
| 3661 |
module.exports = Array.isArray || function isArray(arg) { |
| 3662 |
return cof(arg) == 'Array'; |
| 3663 |
}; |
| 3664 |
|
| 3665 |
|
| 3666 |
/***/ }), |
| 3667 |
/* 98 */ |
| 3668 |
/***/ (function(module, exports, __webpack_require__) { |
| 3669 |
|
| 3670 |
// to indexed object, toObject with fallback for non-array-like ES3 strings |
| 3671 |
var IObject = __webpack_require__(120); |
| 3672 |
var defined = __webpack_require__(42); |
| 3673 |
module.exports = function (it) { |
| 3674 |
return IObject(defined(it)); |
| 3675 |
}; |
| 3676 |
|
| 3677 |
|
| 3678 |
/***/ }), |
| 3679 |
/* 99 */ |
| 3680 |
/***/ (function(module, exports, __webpack_require__) { |
| 3681 |
|
| 3682 |
// 19.1.2.7 / 15.2.3.4 Object.getOwnPropertyNames(O) |
| 3683 |
var $keys = __webpack_require__(116); |
| 3684 |
var hiddenKeys = __webpack_require__(78).concat('length', 'prototype'); |
| 3685 |
|
| 3686 |
exports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) { |
| 3687 |
return $keys(O, hiddenKeys); |
| 3688 |
}; |
| 3689 |
|
| 3690 |
|
| 3691 |
/***/ }), |
| 3692 |
/* 100 */ |
| 3693 |
/***/ (function(module, exports) { |
| 3694 |
|
| 3695 |
|
| 3696 |
|
| 3697 |
/***/ }), |
| 3698 |
/* 101 */ |
| 3699 |
/***/ (function(module, exports, __webpack_require__) { |
| 3700 |
|
| 3701 |
// getting tag from 19.1.3.6 Object.prototype.toString() |
| 3702 |
var cof = __webpack_require__(56); |
| 3703 |
var TAG = __webpack_require__(10)('toStringTag'); |
| 3704 |
// ES3 wrong here |
| 3705 |
var ARG = cof(function () { return arguments; }()) == 'Arguments'; |
| 3706 |
|
| 3707 |
// fallback for IE11 Script Access Denied error |
| 3708 |
var tryGet = function (it, key) { |
| 3709 |
try { |
| 3710 |
return it[key]; |
| 3711 |
} catch (e) { /* empty */ } |
| 3712 |
}; |
| 3713 |
|
| 3714 |
module.exports = function (it) { |
| 3715 |
var O, T, B; |
| 3716 |
return it === undefined ? 'Undefined' : it === null ? 'Null' |
| 3717 |
// @@toStringTag case |
| 3718 |
: typeof (T = tryGet(O = Object(it), TAG)) == 'string' ? T |
| 3719 |
// builtinTag case |
| 3720 |
: ARG ? cof(O) |
| 3721 |
// ES3 arguments fallback |
| 3722 |
: (B = cof(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : B; |
| 3723 |
}; |
| 3724 |
|
| 3725 |
|
| 3726 |
/***/ }), |
| 3727 |
/* 102 */ |
| 3728 |
/***/ (function(module, exports, __webpack_require__) { |
| 3729 |
|
| 3730 |
var arrayWithHoles = __webpack_require__(247); |
| 3731 |
|
| 3732 |
var iterableToArrayLimit = __webpack_require__(248); |
| 3733 |
|
| 3734 |
var unsupportedIterableToArray = __webpack_require__(187); |
| 3735 |
|
| 3736 |
var nonIterableRest = __webpack_require__(251); |
| 3737 |
|
| 3738 |
function _slicedToArray(arr, i) { |
| 3739 |
return arrayWithHoles(arr) || iterableToArrayLimit(arr, i) || unsupportedIterableToArray(arr, i) || nonIterableRest(); |
| 3740 |
} |
| 3741 |
|
| 3742 |
module.exports = _slicedToArray; |
| 3743 |
|
| 3744 |
/***/ }), |
| 3745 |
/* 103 */ |
| 3746 |
/***/ (function(module, exports) { |
| 3747 |
|
| 3748 |
module.exports = function (bitmap, value) { |
| 3749 |
return { |
| 3750 |
enumerable: !(bitmap & 1), |
| 3751 |
configurable: !(bitmap & 2), |
| 3752 |
writable: !(bitmap & 4), |
| 3753 |
value: value |
| 3754 |
}; |
| 3755 |
}; |
| 3756 |
|
| 3757 |
|
| 3758 |
/***/ }), |
| 3759 |
/* 104 */ |
| 3760 |
/***/ (function(module, exports, __webpack_require__) { |
| 3761 |
|
| 3762 |
// fallback for non-array-like ES3 and non-enumerable old V8 strings |
| 3763 |
var cof = __webpack_require__(56); |
| 3764 |
// eslint-disable-next-line no-prototype-builtins |
| 3765 |
module.exports = Object('z').propertyIsEnumerable(0) ? Object : function (it) { |
| 3766 |
return cof(it) == 'String' ? it.split('') : Object(it); |
| 3767 |
}; |
| 3768 |
|
| 3769 |
|
| 3770 |
/***/ }), |
| 3771 |
/* 105 */ |
| 3772 |
/***/ (function(module, exports, __webpack_require__) { |
| 3773 |
|
| 3774 |
"use strict"; |
| 3775 |
|
| 3776 |
var at = __webpack_require__(144)(true); |
| 3777 |
|
| 3778 |
// `AdvanceStringIndex` abstract operation |
| 3779 |
// https://tc39.github.io/ecma262/#sec-advancestringindex |
| 3780 |
module.exports = function (S, index, unicode) { |
| 3781 |
return index + (unicode ? at(S, index).length : 1); |
| 3782 |
}; |
| 3783 |
|
| 3784 |
|
| 3785 |
/***/ }), |
| 3786 |
/* 106 */ |
| 3787 |
/***/ (function(module, exports, __webpack_require__) { |
| 3788 |
|
| 3789 |
"use strict"; |
| 3790 |
|
| 3791 |
// 21.2.5.3 get RegExp.prototype.flags |
| 3792 |
var anObject = __webpack_require__(18); |
| 3793 |
module.exports = function () { |
| 3794 |
var that = anObject(this); |
| 3795 |
var result = ''; |
| 3796 |
if (that.global) result += 'g'; |
| 3797 |
if (that.ignoreCase) result += 'i'; |
| 3798 |
if (that.multiline) result += 'm'; |
| 3799 |
if (that.unicode) result += 'u'; |
| 3800 |
if (that.sticky) result += 'y'; |
| 3801 |
return result; |
| 3802 |
}; |
| 3803 |
|
| 3804 |
|
| 3805 |
/***/ }), |
| 3806 |
/* 107 */ |
| 3807 |
/***/ (function(module, exports, __webpack_require__) { |
| 3808 |
|
| 3809 |
module.exports = __webpack_require__(168); |
| 3810 |
|
| 3811 |
/***/ }), |
| 3812 |
/* 108 */ |
| 3813 |
/***/ (function(module, exports, __webpack_require__) { |
| 3814 |
|
| 3815 |
"use strict"; |
| 3816 |
|
| 3817 |
var LIBRARY = __webpack_require__(47); |
| 3818 |
var $export = __webpack_require__(7); |
| 3819 |
var redefine = __webpack_require__(93); |
| 3820 |
var hide = __webpack_require__(24); |
| 3821 |
var Iterators = __webpack_require__(35); |
| 3822 |
var $iterCreate = __webpack_require__(174); |
| 3823 |
var setToStringTag = __webpack_require__(53); |
| 3824 |
var getPrototypeOf = __webpack_require__(64); |
| 3825 |
var ITERATOR = __webpack_require__(10)('iterator'); |
| 3826 |
var BUGGY = !([].keys && 'next' in [].keys()); // Safari has buggy iterators w/o `next` |
| 3827 |
var FF_ITERATOR = '@@iterator'; |
| 3828 |
var KEYS = 'keys'; |
| 3829 |
var VALUES = 'values'; |
| 3830 |
|
| 3831 |
var returnThis = function () { return this; }; |
| 3832 |
|
| 3833 |
module.exports = function (Base, NAME, Constructor, next, DEFAULT, IS_SET, FORCED) { |
| 3834 |
$iterCreate(Constructor, NAME, next); |
| 3835 |
var getMethod = function (kind) { |
| 3836 |
if (!BUGGY && kind in proto) return proto[kind]; |
| 3837 |
switch (kind) { |
| 3838 |
case KEYS: return function keys() { return new Constructor(this, kind); }; |
| 3839 |
case VALUES: return function values() { return new Constructor(this, kind); }; |
| 3840 |
} return function entries() { return new Constructor(this, kind); }; |
| 3841 |
}; |
| 3842 |
var TAG = NAME + ' Iterator'; |
| 3843 |
var DEF_VALUES = DEFAULT == VALUES; |
| 3844 |
var VALUES_BUG = false; |
| 3845 |
var proto = Base.prototype; |
| 3846 |
var $native = proto[ITERATOR] || proto[FF_ITERATOR] || DEFAULT && proto[DEFAULT]; |
| 3847 |
var $default = $native || getMethod(DEFAULT); |
| 3848 |
var $entries = DEFAULT ? !DEF_VALUES ? $default : getMethod('entries') : undefined; |
| 3849 |
var $anyNative = NAME == 'Array' ? proto.entries || $native : $native; |
| 3850 |
var methods, key, IteratorPrototype; |
| 3851 |
// Fix native |
| 3852 |
if ($anyNative) { |
| 3853 |
IteratorPrototype = getPrototypeOf($anyNative.call(new Base())); |
| 3854 |
if (IteratorPrototype !== Object.prototype && IteratorPrototype.next) { |
| 3855 |
// Set @@toStringTag to native iterators |
| 3856 |
setToStringTag(IteratorPrototype, TAG, true); |
| 3857 |
// fix for some old engines |
| 3858 |
if (!LIBRARY && typeof IteratorPrototype[ITERATOR] != 'function') hide(IteratorPrototype, ITERATOR, returnThis); |
| 3859 |
} |
| 3860 |
} |
| 3861 |
// fix Array#{values, @@iterator}.name in V8 / FF |
| 3862 |
if (DEF_VALUES && $native && $native.name !== VALUES) { |
| 3863 |
VALUES_BUG = true; |
| 3864 |
$default = function values() { return $native.call(this); }; |
| 3865 |
} |
| 3866 |
// Define iterator |
| 3867 |
if ((!LIBRARY || FORCED) && (BUGGY || VALUES_BUG || !proto[ITERATOR])) { |
| 3868 |
hide(proto, ITERATOR, $default); |
| 3869 |
} |
| 3870 |
// Plug for library |
| 3871 |
Iterators[NAME] = $default; |
| 3872 |
Iterators[TAG] = returnThis; |
| 3873 |
if (DEFAULT) { |
| 3874 |
methods = { |
| 3875 |
values: DEF_VALUES ? $default : getMethod(VALUES), |
| 3876 |
keys: IS_SET ? $default : getMethod(KEYS), |
| 3877 |
entries: $entries |
| 3878 |
}; |
| 3879 |
if (FORCED) for (key in methods) { |
| 3880 |
if (!(key in proto)) redefine(proto, key, methods[key]); |
| 3881 |
} else $export($export.P + $export.F * (BUGGY || VALUES_BUG), NAME, methods); |
| 3882 |
} |
| 3883 |
return methods; |
| 3884 |
}; |
| 3885 |
|
| 3886 |
|
| 3887 |
/***/ }), |
| 3888 |
/* 109 */ |
| 3889 |
/***/ (function(module, exports, __webpack_require__) { |
| 3890 |
|
| 3891 |
var isObject = __webpack_require__(30); |
| 3892 |
var document = __webpack_require__(17).document; |
| 3893 |
// typeof document.createElement is 'object' in old IE |
| 3894 |
var is = isObject(document) && isObject(document.createElement); |
| 3895 |
module.exports = function (it) { |
| 3896 |
return is ? document.createElement(it) : {}; |
| 3897 |
}; |
| 3898 |
|
| 3899 |
|
| 3900 |
/***/ }), |
| 3901 |
/* 110 */ |
| 3902 |
/***/ (function(module, exports) { |
| 3903 |
|
| 3904 |
module.exports = false; |
| 3905 |
|
| 3906 |
|
| 3907 |
/***/ }), |
| 3908 |
/* 111 */ |
| 3909 |
/***/ (function(module, exports, __webpack_require__) { |
| 3910 |
|
| 3911 |
module.exports = __webpack_require__(177); |
| 3912 |
|
| 3913 |
/***/ }), |
| 3914 |
/* 112 */ |
| 3915 |
/***/ (function(module, exports, __webpack_require__) { |
| 3916 |
|
| 3917 |
var classof = __webpack_require__(101); |
| 3918 |
var ITERATOR = __webpack_require__(10)('iterator'); |
| 3919 |
var Iterators = __webpack_require__(35); |
| 3920 |
module.exports = __webpack_require__(6).getIteratorMethod = function (it) { |
| 3921 |
if (it != undefined) return it[ITERATOR] |
| 3922 |
|| it['@@iterator'] |
| 3923 |
|| Iterators[classof(it)]; |
| 3924 |
}; |
| 3925 |
|
| 3926 |
|
| 3927 |
/***/ }), |
| 3928 |
/* 113 */ |
| 3929 |
/***/ (function(module, exports, __webpack_require__) { |
| 3930 |
|
| 3931 |
// getting tag from 19.1.3.6 Object.prototype.toString() |
| 3932 |
var cof = __webpack_require__(46); |
| 3933 |
var TAG = __webpack_require__(12)('toStringTag'); |
| 3934 |
// ES3 wrong here |
| 3935 |
var ARG = cof(function () { return arguments; }()) == 'Arguments'; |
| 3936 |
|
| 3937 |
// fallback for IE11 Script Access Denied error |
| 3938 |
var tryGet = function (it, key) { |
| 3939 |
try { |
| 3940 |
return it[key]; |
| 3941 |
} catch (e) { /* empty */ } |
| 3942 |
}; |
| 3943 |
|
| 3944 |
module.exports = function (it) { |
| 3945 |
var O, T, B; |
| 3946 |
return it === undefined ? 'Undefined' : it === null ? 'Null' |
| 3947 |
// @@toStringTag case |
| 3948 |
: typeof (T = tryGet(O = Object(it), TAG)) == 'string' ? T |
| 3949 |
// builtinTag case |
| 3950 |
: ARG ? cof(O) |
| 3951 |
// ES3 arguments fallback |
| 3952 |
: (B = cof(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : B; |
| 3953 |
}; |
| 3954 |
|
| 3955 |
|
| 3956 |
/***/ }), |
| 3957 |
/* 114 */ |
| 3958 |
/***/ (function(module, exports, __webpack_require__) { |
| 3959 |
|
| 3960 |
module.exports = !__webpack_require__(14) && !__webpack_require__(22)(function () { |
| 3961 |
return Object.defineProperty(__webpack_require__(92)('div'), 'a', { get: function () { return 7; } }).a != 7; |
| 3962 |
}); |
| 3963 |
|
| 3964 |
|
| 3965 |
/***/ }), |
| 3966 |
/* 115 */ |
| 3967 |
/***/ (function(module, exports, __webpack_require__) { |
| 3968 |
|
| 3969 |
module.exports = __webpack_require__(161); |
| 3970 |
|
| 3971 |
/***/ }), |
| 3972 |
/* 116 */ |
| 3973 |
/***/ (function(module, exports, __webpack_require__) { |
| 3974 |
|
| 3975 |
var has = __webpack_require__(19); |
| 3976 |
var toIObject = __webpack_require__(20); |
| 3977 |
var arrayIndexOf = __webpack_require__(166)(false); |
| 3978 |
var IE_PROTO = __webpack_require__(75)('IE_PROTO'); |
| 3979 |
|
| 3980 |
module.exports = function (object, names) { |
| 3981 |
var O = toIObject(object); |
| 3982 |
var i = 0; |
| 3983 |
var result = []; |
| 3984 |
var key; |
| 3985 |
for (key in O) if (key != IE_PROTO) has(O, key) && result.push(key); |
| 3986 |
// Don't enum bug & hidden keys |
| 3987 |
while (names.length > i) if (has(O, key = names[i++])) { |
| 3988 |
~arrayIndexOf(result, key) || result.push(key); |
| 3989 |
} |
| 3990 |
return result; |
| 3991 |
}; |
| 3992 |
|
| 3993 |
|
| 3994 |
/***/ }), |
| 3995 |
/* 117 */ |
| 3996 |
/***/ (function(module, exports, __webpack_require__) { |
| 3997 |
|
| 3998 |
"use strict"; |
| 3999 |
|
| 4000 |
var addToUnscopables = __webpack_require__(87); |
| 4001 |
var step = __webpack_require__(241); |
| 4002 |
var Iterators = __webpack_require__(118); |
| 4003 |
var toIObject = __webpack_require__(98); |
| 4004 |
|
| 4005 |
// 22.1.3.4 Array.prototype.entries() |
| 4006 |
// 22.1.3.13 Array.prototype.keys() |
| 4007 |
// 22.1.3.29 Array.prototype.values() |
| 4008 |
// 22.1.3.30 Array.prototype[@@iterator]() |
| 4009 |
module.exports = __webpack_require__(197)(Array, 'Array', function (iterated, kind) { |
| 4010 |
this._t = toIObject(iterated); // target |
| 4011 |
this._i = 0; // next index |
| 4012 |
this._k = kind; // kind |
| 4013 |
// 22.1.5.2.1 %ArrayIteratorPrototype%.next() |
| 4014 |
}, function () { |
| 4015 |
var O = this._t; |
| 4016 |
var kind = this._k; |
| 4017 |
var index = this._i++; |
| 4018 |
if (!O || index >= O.length) { |
| 4019 |
this._t = undefined; |
| 4020 |
return step(1); |
| 4021 |
} |
| 4022 |
if (kind == 'keys') return step(0, index); |
| 4023 |
if (kind == 'values') return step(0, O[index]); |
| 4024 |
return step(0, [index, O[index]]); |
| 4025 |
}, 'values'); |
| 4026 |
|
| 4027 |
// argumentsList[@@iterator] is %ArrayProto_values% (9.4.4.6, 9.4.4.7) |
| 4028 |
Iterators.Arguments = Iterators.Array; |
| 4029 |
|
| 4030 |
addToUnscopables('keys'); |
| 4031 |
addToUnscopables('values'); |
| 4032 |
addToUnscopables('entries'); |
| 4033 |
|
| 4034 |
|
| 4035 |
/***/ }), |
| 4036 |
/* 118 */ |
| 4037 |
/***/ (function(module, exports) { |
| 4038 |
|
| 4039 |
module.exports = {}; |
| 4040 |
|
| 4041 |
|
| 4042 |
/***/ }), |
| 4043 |
/* 119 */ |
| 4044 |
/***/ (function(module, exports, __webpack_require__) { |
| 4045 |
|
| 4046 |
"use strict"; |
| 4047 |
|
| 4048 |
|
| 4049 |
var anObject = __webpack_require__(18); |
| 4050 |
var toLength = __webpack_require__(43); |
| 4051 |
var advanceStringIndex = __webpack_require__(105); |
| 4052 |
var regExpExec = __webpack_require__(94); |
| 4053 |
|
| 4054 |
// @@match logic |
| 4055 |
__webpack_require__(95)('match', 1, function (defined, MATCH, $match, maybeCallNative) { |
| 4056 |
return [ |
| 4057 |
// `String.prototype.match` method |
| 4058 |
// https://tc39.github.io/ecma262/#sec-string.prototype.match |
| 4059 |
function match(regexp) { |
| 4060 |
var O = defined(this); |
| 4061 |
var fn = regexp == undefined ? undefined : regexp[MATCH]; |
| 4062 |
return fn !== undefined ? fn.call(regexp, O) : new RegExp(regexp)[MATCH](String(O)); |
| 4063 |
}, |
| 4064 |
// `RegExp.prototype[@@match]` method |
| 4065 |
// https://tc39.github.io/ecma262/#sec-regexp.prototype-@@match |
| 4066 |
function (regexp) { |
| 4067 |
var res = maybeCallNative($match, regexp, this); |
| 4068 |
if (res.done) return res.value; |
| 4069 |
var rx = anObject(regexp); |
| 4070 |
var S = String(this); |
| 4071 |
if (!rx.global) return regExpExec(rx, S); |
| 4072 |
var fullUnicode = rx.unicode; |
| 4073 |
rx.lastIndex = 0; |
| 4074 |
var A = []; |
| 4075 |
var n = 0; |
| 4076 |
var result; |
| 4077 |
while ((result = regExpExec(rx, S)) !== null) { |
| 4078 |
var matchStr = String(result[0]); |
| 4079 |
A[n] = matchStr; |
| 4080 |
if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode); |
| 4081 |
n++; |
| 4082 |
} |
| 4083 |
return n === 0 ? null : A; |
| 4084 |
} |
| 4085 |
]; |
| 4086 |
}); |
| 4087 |
|
| 4088 |
|
| 4089 |
/***/ }), |
| 4090 |
/* 120 */ |
| 4091 |
/***/ (function(module, exports, __webpack_require__) { |
| 4092 |
|
| 4093 |
// fallback for non-array-like ES3 and non-enumerable old V8 strings |
| 4094 |
var cof = __webpack_require__(46); |
| 4095 |
// eslint-disable-next-line no-prototype-builtins |
| 4096 |
module.exports = Object('z').propertyIsEnumerable(0) ? Object : function (it) { |
| 4097 |
return cof(it) == 'String' ? it.split('') : Object(it); |
| 4098 |
}; |
| 4099 |
|
| 4100 |
|
| 4101 |
/***/ }), |
| 4102 |
/* 121 */ |
| 4103 |
/***/ (function(module, exports, __webpack_require__) { |
| 4104 |
|
| 4105 |
var isObject = __webpack_require__(9); |
| 4106 |
module.exports = function (it, TYPE) { |
| 4107 |
if (!isObject(it) || it._t !== TYPE) throw TypeError('Incompatible receiver, ' + TYPE + ' required!'); |
| 4108 |
return it; |
| 4109 |
}; |
| 4110 |
|
| 4111 |
|
| 4112 |
/***/ }), |
| 4113 |
/* 122 */ |
| 4114 |
/***/ (function(module, exports, __webpack_require__) { |
| 4115 |
|
| 4116 |
// 7.2.8 IsRegExp(argument) |
| 4117 |
var isObject = __webpack_require__(30); |
| 4118 |
var cof = __webpack_require__(46); |
| 4119 |
var MATCH = __webpack_require__(12)('match'); |
| 4120 |
module.exports = function (it) { |
| 4121 |
var isRegExp; |
| 4122 |
return isObject(it) && ((isRegExp = it[MATCH]) !== undefined ? !!isRegExp : cof(it) == 'RegExp'); |
| 4123 |
}; |
| 4124 |
|
| 4125 |
|
| 4126 |
/***/ }), |
| 4127 |
/* 123 */ |
| 4128 |
/***/ (function(module, exports, __webpack_require__) { |
| 4129 |
|
| 4130 |
// 7.1.1 ToPrimitive(input [, PreferredType]) |
| 4131 |
var isObject = __webpack_require__(30); |
| 4132 |
// instead of the ES6 spec version, we didn't implement @@toPrimitive case |
| 4133 |
// and the second argument - flag - preferred type is a string |
| 4134 |
module.exports = function (it, S) { |
| 4135 |
if (!isObject(it)) return it; |
| 4136 |
var fn, val; |
| 4137 |
if (S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val; |
| 4138 |
if (typeof (fn = it.valueOf) == 'function' && !isObject(val = fn.call(it))) return val; |
| 4139 |
if (!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val; |
| 4140 |
throw TypeError("Can't convert object to primitive value"); |
| 4141 |
}; |
| 4142 |
|
| 4143 |
|
| 4144 |
/***/ }), |
| 4145 |
/* 124 */ |
| 4146 |
/***/ (function(module, exports, __webpack_require__) { |
| 4147 |
|
| 4148 |
module.exports = __webpack_require__(191); |
| 4149 |
|
| 4150 |
/***/ }), |
| 4151 |
/* 125 */ |
| 4152 |
/***/ (function(module, exports) { |
| 4153 |
|
| 4154 |
module.exports = function (it, Constructor, name, forbiddenField) { |
| 4155 |
if (!(it instanceof Constructor) || (forbiddenField !== undefined && forbiddenField in it)) { |
| 4156 |
throw TypeError(name + ': incorrect invocation!'); |
| 4157 |
} return it; |
| 4158 |
}; |
| 4159 |
|
| 4160 |
|
| 4161 |
/***/ }), |
| 4162 |
/* 126 */ |
| 4163 |
/***/ (function(module, exports, __webpack_require__) { |
| 4164 |
|
| 4165 |
var hide = __webpack_require__(24); |
| 4166 |
module.exports = function (target, src, safe) { |
| 4167 |
for (var key in src) { |
| 4168 |
if (safe && target[key]) target[key] = src[key]; |
| 4169 |
else hide(target, key, src[key]); |
| 4170 |
} return target; |
| 4171 |
}; |
| 4172 |
|
| 4173 |
|
| 4174 |
/***/ }), |
| 4175 |
/* 127 */ |
| 4176 |
/***/ (function(module, exports, __webpack_require__) { |
| 4177 |
|
| 4178 |
"use strict"; |
| 4179 |
|
| 4180 |
|
| 4181 |
var _interopRequireDefault = __webpack_require__(0); |
| 4182 |
|
| 4183 |
__webpack_require__(25); |
| 4184 |
|
| 4185 |
var _defineProperty2 = _interopRequireDefault(__webpack_require__(28)); |
| 4186 |
|
| 4187 |
var ControlBaseView = __webpack_require__(281), |
| 4188 |
TagsBehavior = __webpack_require__(421), |
| 4189 |
Validator = __webpack_require__(300), |
| 4190 |
ControlBaseDataView; |
| 4191 |
|
| 4192 |
ControlBaseDataView = ControlBaseView.extend({ |
| 4193 |
ui: function ui() { |
| 4194 |
var ui = ControlBaseView.prototype.ui.apply(this, arguments); |
| 4195 |
|
| 4196 |
_.extend(ui, { |
| 4197 |
input: 'input[data-setting][type!="checkbox"][type!="radio"]', |
| 4198 |
checkbox: 'input[data-setting][type="checkbox"]', |
| 4199 |
radio: 'input[data-setting][type="radio"]', |
| 4200 |
select: 'select[data-setting]', |
| 4201 |
textarea: 'textarea[data-setting]', |
| 4202 |
responsiveSwitchers: '.elementor-responsive-switcher', |
| 4203 |
contentEditable: '[contenteditable="true"]' |
| 4204 |
}); |
| 4205 |
|
| 4206 |
return ui; |
| 4207 |
}, |
| 4208 |
templateHelpers: function templateHelpers() { |
| 4209 |
var controlData = ControlBaseView.prototype.templateHelpers.apply(this, arguments); |
| 4210 |
controlData.data.controlValue = this.getControlValue(); |
| 4211 |
return controlData; |
| 4212 |
}, |
| 4213 |
events: function events() { |
| 4214 |
return { |
| 4215 |
'input @ui.input': 'onBaseInputTextChange', |
| 4216 |
'change @ui.checkbox': 'onBaseInputChange', |
| 4217 |
'change @ui.radio': 'onBaseInputChange', |
| 4218 |
'input @ui.textarea': 'onBaseInputTextChange', |
| 4219 |
'change @ui.select': 'onBaseInputChange', |
| 4220 |
'input @ui.contentEditable': 'onBaseInputTextChange', |
| 4221 |
'click @ui.responsiveSwitchers': 'onResponsiveSwitchersClick' |
| 4222 |
}; |
| 4223 |
}, |
| 4224 |
behaviors: function behaviors() { |
| 4225 |
var behaviors = ControlBaseView.prototype.behaviors.apply(this, arguments), |
| 4226 |
dynamicSettings = this.options.model.get('dynamic'); |
| 4227 |
|
| 4228 |
if (dynamicSettings && dynamicSettings.active) { |
| 4229 |
var tags = _.filter(elementor.dynamicTags.getConfig('tags'), function (tag) { |
| 4230 |
return tag.editable && _.intersection(tag.categories, dynamicSettings.categories).length; |
| 4231 |
}); |
| 4232 |
|
| 4233 |
if (tags.length || elementor.config.user.is_administrator) { |
| 4234 |
behaviors.tags = { |
| 4235 |
behaviorClass: TagsBehavior, |
| 4236 |
tags: tags, |
| 4237 |
dynamicSettings: dynamicSettings |
| 4238 |
}; |
| 4239 |
} |
| 4240 |
} |
| 4241 |
|
| 4242 |
return behaviors; |
| 4243 |
}, |
| 4244 |
initialize: function initialize() { |
| 4245 |
ControlBaseView.prototype.initialize.apply(this, arguments); |
| 4246 |
this.registerValidators(); // TODO: this.elementSettingsModel is deprecated since 2.8.0. |
| 4247 |
|
| 4248 |
var settings = this.container ? this.container.settings : this.elementSettingsModel; |
| 4249 |
this.listenTo(settings, 'change:external:' + this.model.get('name'), this.onAfterExternalChange); |
| 4250 |
}, |
| 4251 |
getControlValue: function getControlValue() { |
| 4252 |
return this.container.settings.get(this.model.get('name')); |
| 4253 |
}, |
| 4254 |
getGlobalKey: function getGlobalKey() { |
| 4255 |
return this.container.globals.get(this.model.get('name')); |
| 4256 |
}, |
| 4257 |
getGlobalValue: function getGlobalValue() { |
| 4258 |
return this.globalValue; |
| 4259 |
}, |
| 4260 |
getGlobalDefault: function getGlobalDefault() { |
| 4261 |
var controlGlobalArgs = this.model.get('global'); |
| 4262 |
|
| 4263 |
if (controlGlobalArgs === null || controlGlobalArgs === void 0 ? void 0 : controlGlobalArgs.default) { |
| 4264 |
// If the control is a color/typography control and default colors/typography are disabled, don't return the global value. |
| 4265 |
if (!elementor.config.globals.defaults_enabled[this.getGlobalMeta().controlType]) { |
| 4266 |
return ''; |
| 4267 |
} |
| 4268 |
|
| 4269 |
var _$e$data$commandExtra = $e.data.commandExtractArgs(controlGlobalArgs.default), |
| 4270 |
command = _$e$data$commandExtra.command, |
| 4271 |
args = _$e$data$commandExtra.args, |
| 4272 |
result = $e.data.getCache($e.components.get('globals'), command, args.query); |
| 4273 |
|
| 4274 |
return result === null || result === void 0 ? void 0 : result.value; |
| 4275 |
} // No global default. |
| 4276 |
|
| 4277 |
|
| 4278 |
return ''; |
| 4279 |
}, |
| 4280 |
getCurrentValue: function getCurrentValue() { |
| 4281 |
if (this.getGlobalKey() && !this.globalValue) { |
| 4282 |
return ''; |
| 4283 |
} |
| 4284 |
|
| 4285 |
if (this.globalValue) { |
| 4286 |
return this.globalValue; |
| 4287 |
} |
| 4288 |
|
| 4289 |
var controlValue = this.getControlValue(); |
| 4290 |
|
| 4291 |
if (controlValue) { |
| 4292 |
return controlValue; |
| 4293 |
} |
| 4294 |
|
| 4295 |
return this.getGlobalDefault(); |
| 4296 |
}, |
| 4297 |
isGlobalActive: function isGlobalActive() { |
| 4298 |
var _this$options$model$g; |
| 4299 |
|
| 4300 |
return (_this$options$model$g = this.options.model.get('global')) === null || _this$options$model$g === void 0 ? void 0 : _this$options$model$g.active; |
| 4301 |
}, |
| 4302 |
setValue: function setValue(value) { |
| 4303 |
this.setSettingsModel(value); |
| 4304 |
}, |
| 4305 |
setSettingsModel: function setSettingsModel(value) { |
| 4306 |
var key = this.model.get('name'); |
| 4307 |
$e.run('document/elements/settings', { |
| 4308 |
container: this.options.container, |
| 4309 |
settings: (0, _defineProperty2.default)({}, key, value) |
| 4310 |
}); |
| 4311 |
this.triggerMethod('settings:change'); |
| 4312 |
}, |
| 4313 |
applySavedValue: function applySavedValue() { |
| 4314 |
this.setInputValue('[data-setting="' + this.model.get('name') + '"]', this.getControlValue()); |
| 4315 |
}, |
| 4316 |
getEditSettings: function getEditSettings(setting) { |
| 4317 |
var settings = this.getOption('elementEditSettings').toJSON(); |
| 4318 |
|
| 4319 |
if (setting) { |
| 4320 |
return settings[setting]; |
| 4321 |
} |
| 4322 |
|
| 4323 |
return settings; |
| 4324 |
}, |
| 4325 |
setEditSetting: function setEditSetting(settingKey, settingValue) { |
| 4326 |
var settings = this.getOption('elementEditSettings') || this.getOption('container').settings; |
| 4327 |
settings.set(settingKey, settingValue); |
| 4328 |
}, |
| 4329 |
getInputValue: function getInputValue(input) { |
| 4330 |
var $input = this.$(input); |
| 4331 |
|
| 4332 |
if ($input.is('[contenteditable="true"]')) { |
| 4333 |
return $input.html(); |
| 4334 |
} |
| 4335 |
|
| 4336 |
var inputValue = $input.val(), |
| 4337 |
inputType = $input.attr('type'); |
| 4338 |
|
| 4339 |
if (-1 !== ['radio', 'checkbox'].indexOf(inputType)) { |
| 4340 |
return $input.prop('checked') ? inputValue : ''; |
| 4341 |
} |
| 4342 |
|
| 4343 |
if ('number' === inputType && _.isFinite(inputValue)) { |
| 4344 |
return +inputValue; |
| 4345 |
} // Temp fix for jQuery (< 3.0) that return null instead of empty array |
| 4346 |
|
| 4347 |
|
| 4348 |
if ('SELECT' === input.tagName && $input.prop('multiple') && null === inputValue) { |
| 4349 |
inputValue = []; |
| 4350 |
} |
| 4351 |
|
| 4352 |
return inputValue; |
| 4353 |
}, |
| 4354 |
setInputValue: function setInputValue(input, value) { |
| 4355 |
var $input = this.$(input), |
| 4356 |
inputType = $input.attr('type'); |
| 4357 |
|
| 4358 |
if ('checkbox' === inputType) { |
| 4359 |
$input.prop('checked', !!value); |
| 4360 |
} else if ('radio' === inputType) { |
| 4361 |
$input.filter('[value="' + value + '"]').prop('checked', true); |
| 4362 |
} else { |
| 4363 |
$input.val(value); |
| 4364 |
} |
| 4365 |
}, |
| 4366 |
addValidator: function addValidator(validator) { |
| 4367 |
this.validators.push(validator); |
| 4368 |
}, |
| 4369 |
registerValidators: function registerValidators() { |
| 4370 |
this.validators = []; |
| 4371 |
var validationTerms = {}; |
| 4372 |
|
| 4373 |
if (this.model.get('required')) { |
| 4374 |
validationTerms.required = true; |
| 4375 |
} |
| 4376 |
|
| 4377 |
if (!jQuery.isEmptyObject(validationTerms)) { |
| 4378 |
this.addValidator(new Validator({ |
| 4379 |
validationTerms: validationTerms |
| 4380 |
})); |
| 4381 |
} |
| 4382 |
}, |
| 4383 |
onRender: function onRender() { |
| 4384 |
ControlBaseView.prototype.onRender.apply(this, arguments); |
| 4385 |
|
| 4386 |
if (this.model.get('responsive')) { |
| 4387 |
this.renderResponsiveSwitchers(); |
| 4388 |
} |
| 4389 |
|
| 4390 |
this.applySavedValue(); |
| 4391 |
this.triggerMethod('ready'); |
| 4392 |
this.toggleControlVisibility(); |
| 4393 |
this.addTooltip(); |
| 4394 |
}, |
| 4395 |
onBaseInputTextChange: function onBaseInputTextChange(event) { |
| 4396 |
this.onBaseInputChange(event); |
| 4397 |
}, |
| 4398 |
onBaseInputChange: function onBaseInputChange(event) { |
| 4399 |
clearTimeout(this.correctionTimeout); |
| 4400 |
var input = event.currentTarget, |
| 4401 |
value = this.getInputValue(input), |
| 4402 |
validators = this.validators.slice(0), |
| 4403 |
settingsValidators = this.container.settings.validators[this.model.get('name')]; |
| 4404 |
|
| 4405 |
if (settingsValidators) { |
| 4406 |
validators = validators.concat(settingsValidators); |
| 4407 |
} |
| 4408 |
|
| 4409 |
if (validators) { |
| 4410 |
var oldValue = this.getControlValue(input.dataset.setting); |
| 4411 |
var isValidValue = validators.every(function (validator) { |
| 4412 |
return validator.isValid(value, oldValue); |
| 4413 |
}); |
| 4414 |
|
| 4415 |
if (!isValidValue) { |
| 4416 |
this.correctionTimeout = setTimeout(this.setInputValue.bind(this, input, oldValue), 1200); |
| 4417 |
return; |
| 4418 |
} |
| 4419 |
} |
| 4420 |
|
| 4421 |
this.updateElementModel(value, input); |
| 4422 |
this.triggerMethod('input:change', event); |
| 4423 |
}, |
| 4424 |
onResponsiveSwitchersClick: function onResponsiveSwitchersClick(event) { |
| 4425 |
var $switcher = jQuery(event.currentTarget), |
| 4426 |
device = $switcher.data('device'), |
| 4427 |
$switchersWrapper = this.ui.responsiveSwitchersWrapper, |
| 4428 |
selectedOption = $switcher.index(); |
| 4429 |
$switchersWrapper.toggleClass('elementor-responsive-switchers-open'); |
| 4430 |
$switchersWrapper[0].style.setProperty('--selected-option', selectedOption); |
| 4431 |
this.triggerMethod('responsive:switcher:click', device); |
| 4432 |
elementor.changeDeviceMode(device); |
| 4433 |
}, |
| 4434 |
renderResponsiveSwitchers: function renderResponsiveSwitchers() { |
| 4435 |
var templateHtml = Marionette.Renderer.render('#tmpl-elementor-control-responsive-switchers', this.model.attributes); |
| 4436 |
this.ui.controlTitle.after(templateHtml); |
| 4437 |
this.ui.responsiveSwitchersWrapper = this.$el.find('.elementor-control-responsive-switchers'); |
| 4438 |
}, |
| 4439 |
onAfterExternalChange: function onAfterExternalChange() { |
| 4440 |
this.hideTooltip(); |
| 4441 |
this.applySavedValue(); |
| 4442 |
}, |
| 4443 |
addTooltip: function addTooltip() { |
| 4444 |
this.ui.tooltipTargets = this.$el.find('.tooltip-target'); |
| 4445 |
|
| 4446 |
if (!this.ui.tooltipTargets.length) { |
| 4447 |
return; |
| 4448 |
} // Create tooltip on controls |
| 4449 |
|
| 4450 |
|
| 4451 |
this.ui.tooltipTargets.tipsy({ |
| 4452 |
gravity: function gravity() { |
| 4453 |
// `n` for down, `s` for up |
| 4454 |
var gravity = jQuery(this).data('tooltip-pos'); |
| 4455 |
|
| 4456 |
if (undefined !== gravity) { |
| 4457 |
return gravity; |
| 4458 |
} |
| 4459 |
|
| 4460 |
return 's'; |
| 4461 |
}, |
| 4462 |
title: function title() { |
| 4463 |
return this.getAttribute('data-tooltip'); |
| 4464 |
} |
| 4465 |
}); |
| 4466 |
}, |
| 4467 |
hideTooltip: function hideTooltip() { |
| 4468 |
if (this.ui.tooltipTargets.length) { |
| 4469 |
this.ui.tooltipTargets.tipsy('hide'); |
| 4470 |
} |
| 4471 |
}, |
| 4472 |
updateElementModel: function updateElementModel(value) { |
| 4473 |
this.setValue(value); |
| 4474 |
} |
| 4475 |
}, { |
| 4476 |
// Static methods |
| 4477 |
getStyleValue: function getStyleValue(placeholder, controlValue, controlData) { |
| 4478 |
if ('DEFAULT' === placeholder) { |
| 4479 |
return controlData.default; |
| 4480 |
} |
| 4481 |
|
| 4482 |
return controlValue; |
| 4483 |
}, |
| 4484 |
onPasteStyle: function onPasteStyle() { |
| 4485 |
return true; |
| 4486 |
} |
| 4487 |
}); |
| 4488 |
module.exports = ControlBaseDataView; |
| 4489 |
|
| 4490 |
/***/ }), |
| 4491 |
/* 128 */, |
| 4492 |
/* 129 */ |
| 4493 |
/***/ (function(module, exports, __webpack_require__) { |
| 4494 |
|
| 4495 |
module.exports = !__webpack_require__(27) && !__webpack_require__(33)(function () { |
| 4496 |
return Object.defineProperty(__webpack_require__(109)('div'), 'a', { get: function () { return 7; } }).a != 7; |
| 4497 |
}); |
| 4498 |
|
| 4499 |
|
| 4500 |
/***/ }), |
| 4501 |
/* 130 */ |
| 4502 |
/***/ (function(module, exports, __webpack_require__) { |
| 4503 |
|
| 4504 |
var shared = __webpack_require__(67)('keys'); |
| 4505 |
var uid = __webpack_require__(68); |
| 4506 |
module.exports = function (key) { |
| 4507 |
return shared[key] || (shared[key] = uid(key)); |
| 4508 |
}; |
| 4509 |
|
| 4510 |
|
| 4511 |
/***/ }), |
| 4512 |
/* 131 */ |
| 4513 |
/***/ (function(module, exports, __webpack_require__) { |
| 4514 |
|
| 4515 |
var document = __webpack_require__(8).document; |
| 4516 |
module.exports = document && document.documentElement; |
| 4517 |
|
| 4518 |
|
| 4519 |
/***/ }), |
| 4520 |
/* 132 */ |
| 4521 |
/***/ (function(module, exports) { |
| 4522 |
|
| 4523 |
// fast apply, http://jsperf.lnkit.com/fast-apply/5 |
| 4524 |
module.exports = function (fn, args, that) { |
| 4525 |
var un = that === undefined; |
| 4526 |
switch (args.length) { |
| 4527 |
case 0: return un ? fn() |
| 4528 |
: fn.call(that); |
| 4529 |
case 1: return un ? fn(args[0]) |
| 4530 |
: fn.call(that, args[0]); |
| 4531 |
case 2: return un ? fn(args[0], args[1]) |
| 4532 |
: fn.call(that, args[0], args[1]); |
| 4533 |
case 3: return un ? fn(args[0], args[1], args[2]) |
| 4534 |
: fn.call(that, args[0], args[1], args[2]); |
| 4535 |
case 4: return un ? fn(args[0], args[1], args[2], args[3]) |
| 4536 |
: fn.call(that, args[0], args[1], args[2], args[3]); |
| 4537 |
} return fn.apply(that, args); |
| 4538 |
}; |
| 4539 |
|
| 4540 |
|
| 4541 |
/***/ }), |
| 4542 |
/* 133 */ |
| 4543 |
/***/ (function(module, exports, __webpack_require__) { |
| 4544 |
|
| 4545 |
module.exports = __webpack_require__(257); |
| 4546 |
|
| 4547 |
/***/ }), |
| 4548 |
/* 134 */ |
| 4549 |
/***/ (function(module, exports, __webpack_require__) { |
| 4550 |
|
| 4551 |
module.exports = __webpack_require__(288); |
| 4552 |
|
| 4553 |
/***/ }), |
| 4554 |
/* 135 */ |
| 4555 |
/***/ (function(module, exports, __webpack_require__) { |
| 4556 |
|
| 4557 |
"use strict"; |
| 4558 |
|
| 4559 |
// https://github.com/tc39/Array.prototype.includes |
| 4560 |
var $export = __webpack_require__(34); |
| 4561 |
var $includes = __webpack_require__(143)(true); |
| 4562 |
|
| 4563 |
$export($export.P, 'Array', { |
| 4564 |
includes: function includes(el /* , fromIndex = 0 */) { |
| 4565 |
return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined); |
| 4566 |
} |
| 4567 |
}); |
| 4568 |
|
| 4569 |
__webpack_require__(87)('includes'); |
| 4570 |
|
| 4571 |
|
| 4572 |
/***/ }), |
| 4573 |
/* 136 */ |
| 4574 |
/***/ (function(module, exports, __webpack_require__) { |
| 4575 |
|
| 4576 |
var dP = __webpack_require__(15); |
| 4577 |
var anObject = __webpack_require__(13); |
| 4578 |
var getKeys = __webpack_require__(40); |
| 4579 |
|
| 4580 |
module.exports = __webpack_require__(14) ? Object.defineProperties : function defineProperties(O, Properties) { |
| 4581 |
anObject(O); |
| 4582 |
var keys = getKeys(Properties); |
| 4583 |
var length = keys.length; |
| 4584 |
var i = 0; |
| 4585 |
var P; |
| 4586 |
while (length > i) dP.f(O, P = keys[i++], Properties[P]); |
| 4587 |
return O; |
| 4588 |
}; |
| 4589 |
|
| 4590 |
|
| 4591 |
/***/ }), |
| 4592 |
/* 137 */ |
| 4593 |
/***/ (function(module, exports, __webpack_require__) { |
| 4594 |
|
| 4595 |
var _Object$setPrototypeOf = __webpack_require__(115); |
| 4596 |
|
| 4597 |
function _setPrototypeOf(o, p) { |
| 4598 |
module.exports = _setPrototypeOf = _Object$setPrototypeOf || function _setPrototypeOf(o, p) { |
| 4599 |
o.__proto__ = p; |
| 4600 |
return o; |
| 4601 |
}; |
| 4602 |
|
| 4603 |
return _setPrototypeOf(o, p); |
| 4604 |
} |
| 4605 |
|
| 4606 |
module.exports = _setPrototypeOf; |
| 4607 |
|
| 4608 |
/***/ }), |
| 4609 |
/* 138 */ |
| 4610 |
/***/ (function(module, exports, __webpack_require__) { |
| 4611 |
|
| 4612 |
// 0 -> Array#forEach |
| 4613 |
// 1 -> Array#map |
| 4614 |
// 2 -> Array#filter |
| 4615 |
// 3 -> Array#some |
| 4616 |
// 4 -> Array#every |
| 4617 |
// 5 -> Array#find |
| 4618 |
// 6 -> Array#findIndex |
| 4619 |
var ctx = __webpack_require__(31); |
| 4620 |
var IObject = __webpack_require__(104); |
| 4621 |
var toObject = __webpack_require__(32); |
| 4622 |
var toLength = __webpack_require__(69); |
| 4623 |
var asc = __webpack_require__(245); |
| 4624 |
module.exports = function (TYPE, $create) { |
| 4625 |
var IS_MAP = TYPE == 1; |
| 4626 |
var IS_FILTER = TYPE == 2; |
| 4627 |
var IS_SOME = TYPE == 3; |
| 4628 |
var IS_EVERY = TYPE == 4; |
| 4629 |
var IS_FIND_INDEX = TYPE == 6; |
| 4630 |
var NO_HOLES = TYPE == 5 || IS_FIND_INDEX; |
| 4631 |
var create = $create || asc; |
| 4632 |
return function ($this, callbackfn, that) { |
| 4633 |
var O = toObject($this); |
| 4634 |
var self = IObject(O); |
| 4635 |
var f = ctx(callbackfn, that, 3); |
| 4636 |
var length = toLength(self.length); |
| 4637 |
var index = 0; |
| 4638 |
var result = IS_MAP ? create($this, length) : IS_FILTER ? create($this, 0) : undefined; |
| 4639 |
var val, res; |
| 4640 |
for (;length > index; index++) if (NO_HOLES || index in self) { |
| 4641 |
val = self[index]; |
| 4642 |
res = f(val, index, O); |
| 4643 |
if (TYPE) { |
| 4644 |
if (IS_MAP) result[index] = res; // map |
| 4645 |
else if (res) switch (TYPE) { |
| 4646 |
case 3: return true; // some |
| 4647 |
case 5: return val; // find |
| 4648 |
case 6: return index; // findIndex |
| 4649 |
case 2: result.push(val); // filter |
| 4650 |
} else if (IS_EVERY) return false; // every |
| 4651 |
} |
| 4652 |
} |
| 4653 |
return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : result; |
| 4654 |
}; |
| 4655 |
}; |
| 4656 |
|
| 4657 |
|
| 4658 |
/***/ }), |
| 4659 |
/* 139 */ |
| 4660 |
/***/ (function(module, exports, __webpack_require__) { |
| 4661 |
|
| 4662 |
module.exports = __webpack_require__(164); |
| 4663 |
|
| 4664 |
/***/ }), |
| 4665 |
/* 140 */ |
| 4666 |
/***/ (function(module, exports, __webpack_require__) { |
| 4667 |
|
| 4668 |
"use strict"; |
| 4669 |
|
| 4670 |
// ECMAScript 6 symbols shim |
| 4671 |
var global = __webpack_require__(8); |
| 4672 |
var has = __webpack_require__(19); |
| 4673 |
var DESCRIPTORS = __webpack_require__(14); |
| 4674 |
var $export = __webpack_require__(7); |
| 4675 |
var redefine = __webpack_require__(93); |
| 4676 |
var META = __webpack_require__(70).KEY; |
| 4677 |
var $fails = __webpack_require__(22); |
| 4678 |
var shared = __webpack_require__(76); |
| 4679 |
var setToStringTag = __webpack_require__(53); |
| 4680 |
var uid = __webpack_require__(59); |
| 4681 |
var wks = __webpack_require__(10); |
| 4682 |
var wksExt = __webpack_require__(63); |
| 4683 |
var wksDefine = __webpack_require__(79); |
| 4684 |
var enumKeys = __webpack_require__(178); |
| 4685 |
var isArray = __webpack_require__(97); |
| 4686 |
var anObject = __webpack_require__(13); |
| 4687 |
var isObject = __webpack_require__(9); |
| 4688 |
var toObject = __webpack_require__(32); |
| 4689 |
var toIObject = __webpack_require__(20); |
| 4690 |
var toPrimitive = __webpack_require__(74); |
| 4691 |
var createDesc = __webpack_require__(44); |
| 4692 |
var _create = __webpack_require__(52); |
| 4693 |
var gOPNExt = __webpack_require__(179); |
| 4694 |
var $GOPD = __webpack_require__(51); |
| 4695 |
var $GOPS = __webpack_require__(71); |
| 4696 |
var $DP = __webpack_require__(15); |
| 4697 |
var $keys = __webpack_require__(40); |
| 4698 |
var gOPD = $GOPD.f; |
| 4699 |
var dP = $DP.f; |
| 4700 |
var gOPN = gOPNExt.f; |
| 4701 |
var $Symbol = global.Symbol; |
| 4702 |
var $JSON = global.JSON; |
| 4703 |
var _stringify = $JSON && $JSON.stringify; |
| 4704 |
var PROTOTYPE = 'prototype'; |
| 4705 |
var HIDDEN = wks('_hidden'); |
| 4706 |
var TO_PRIMITIVE = wks('toPrimitive'); |
| 4707 |
var isEnum = {}.propertyIsEnumerable; |
| 4708 |
var SymbolRegistry = shared('symbol-registry'); |
| 4709 |
var AllSymbols = shared('symbols'); |
| 4710 |
var OPSymbols = shared('op-symbols'); |
| 4711 |
var ObjectProto = Object[PROTOTYPE]; |
| 4712 |
var USE_NATIVE = typeof $Symbol == 'function' && !!$GOPS.f; |
| 4713 |
var QObject = global.QObject; |
| 4714 |
// Don't use setters in Qt Script, https://github.com/zloirock/core-js/issues/173 |
| 4715 |
var setter = !QObject || !QObject[PROTOTYPE] || !QObject[PROTOTYPE].findChild; |
| 4716 |
|
| 4717 |
// fallback for old Android, https://code.google.com/p/v8/issues/detail?id=687 |
| 4718 |
var setSymbolDesc = DESCRIPTORS && $fails(function () { |
| 4719 |
return _create(dP({}, 'a', { |
| 4720 |
get: function () { return dP(this, 'a', { value: 7 }).a; } |
| 4721 |
})).a != 7; |
| 4722 |
}) ? function (it, key, D) { |
| 4723 |
var protoDesc = gOPD(ObjectProto, key); |
| 4724 |
if (protoDesc) delete ObjectProto[key]; |
| 4725 |
dP(it, key, D); |
| 4726 |
if (protoDesc && it !== ObjectProto) dP(ObjectProto, key, protoDesc); |
| 4727 |
} : dP; |
| 4728 |
|
| 4729 |
var wrap = function (tag) { |
| 4730 |
var sym = AllSymbols[tag] = _create($Symbol[PROTOTYPE]); |
| 4731 |
sym._k = tag; |
| 4732 |
return sym; |
| 4733 |
}; |
| 4734 |
|
| 4735 |
var isSymbol = USE_NATIVE && typeof $Symbol.iterator == 'symbol' ? function (it) { |
| 4736 |
return typeof it == 'symbol'; |
| 4737 |
} : function (it) { |
| 4738 |
return it instanceof $Symbol; |
| 4739 |
}; |
| 4740 |
|
| 4741 |
var $defineProperty = function defineProperty(it, key, D) { |
| 4742 |
if (it === ObjectProto) $defineProperty(OPSymbols, key, D); |
| 4743 |
anObject(it); |
| 4744 |
key = toPrimitive(key, true); |
| 4745 |
anObject(D); |
| 4746 |
if (has(AllSymbols, key)) { |
| 4747 |
if (!D.enumerable) { |
| 4748 |
if (!has(it, HIDDEN)) dP(it, HIDDEN, createDesc(1, {})); |
| 4749 |
it[HIDDEN][key] = true; |
| 4750 |
} else { |
| 4751 |
if (has(it, HIDDEN) && it[HIDDEN][key]) it[HIDDEN][key] = false; |
| 4752 |
D = _create(D, { enumerable: createDesc(0, false) }); |
| 4753 |
} return setSymbolDesc(it, key, D); |
| 4754 |
} return dP(it, key, D); |
| 4755 |
}; |
| 4756 |
var $defineProperties = function defineProperties(it, P) { |
| 4757 |
anObject(it); |
| 4758 |
var keys = enumKeys(P = toIObject(P)); |
| 4759 |
var i = 0; |
| 4760 |
var l = keys.length; |
| 4761 |
var key; |
| 4762 |
while (l > i) $defineProperty(it, key = keys[i++], P[key]); |
| 4763 |
return it; |
| 4764 |
}; |
| 4765 |
var $create = function create(it, P) { |
| 4766 |
return P === undefined ? _create(it) : $defineProperties(_create(it), P); |
| 4767 |
}; |
| 4768 |
var $propertyIsEnumerable = function propertyIsEnumerable(key) { |
| 4769 |
var E = isEnum.call(this, key = toPrimitive(key, true)); |
| 4770 |
if (this === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key)) return false; |
| 4771 |
return E || !has(this, key) || !has(AllSymbols, key) || has(this, HIDDEN) && this[HIDDEN][key] ? E : true; |
| 4772 |
}; |
| 4773 |
var $getOwnPropertyDescriptor = function getOwnPropertyDescriptor(it, key) { |
| 4774 |
it = toIObject(it); |
| 4775 |
key = toPrimitive(key, true); |
| 4776 |
if (it === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key)) return; |
| 4777 |
var D = gOPD(it, key); |
| 4778 |
if (D && has(AllSymbols, key) && !(has(it, HIDDEN) && it[HIDDEN][key])) D.enumerable = true; |
| 4779 |
return D; |
| 4780 |
}; |
| 4781 |
var $getOwnPropertyNames = function getOwnPropertyNames(it) { |
| 4782 |
var names = gOPN(toIObject(it)); |
| 4783 |
var result = []; |
| 4784 |
var i = 0; |
| 4785 |
var key; |
| 4786 |
while (names.length > i) { |
| 4787 |
if (!has(AllSymbols, key = names[i++]) && key != HIDDEN && key != META) result.push(key); |
| 4788 |
} return result; |
| 4789 |
}; |
| 4790 |
var $getOwnPropertySymbols = function getOwnPropertySymbols(it) { |
| 4791 |
var IS_OP = it === ObjectProto; |
| 4792 |
var names = gOPN(IS_OP ? OPSymbols : toIObject(it)); |
| 4793 |
var result = []; |
| 4794 |
var i = 0; |
| 4795 |
var key; |
| 4796 |
while (names.length > i) { |
| 4797 |
if (has(AllSymbols, key = names[i++]) && (IS_OP ? has(ObjectProto, key) : true)) result.push(AllSymbols[key]); |
| 4798 |
} return result; |
| 4799 |
}; |
| 4800 |
|
| 4801 |
// 19.4.1.1 Symbol([description]) |
| 4802 |
if (!USE_NATIVE) { |
| 4803 |
$Symbol = function Symbol() { |
| 4804 |
if (this instanceof $Symbol) throw TypeError('Symbol is not a constructor!'); |
| 4805 |
var tag = uid(arguments.length > 0 ? arguments[0] : undefined); |
| 4806 |
var $set = function (value) { |
| 4807 |
if (this === ObjectProto) $set.call(OPSymbols, value); |
| 4808 |
if (has(this, HIDDEN) && has(this[HIDDEN], tag)) this[HIDDEN][tag] = false; |
| 4809 |
setSymbolDesc(this, tag, createDesc(1, value)); |
| 4810 |
}; |
| 4811 |
if (DESCRIPTORS && setter) setSymbolDesc(ObjectProto, tag, { configurable: true, set: $set }); |
| 4812 |
return wrap(tag); |
| 4813 |
}; |
| 4814 |
redefine($Symbol[PROTOTYPE], 'toString', function toString() { |
| 4815 |
return this._k; |
| 4816 |
}); |
| 4817 |
|
| 4818 |
$GOPD.f = $getOwnPropertyDescriptor; |
| 4819 |
$DP.f = $defineProperty; |
| 4820 |
__webpack_require__(99).f = gOPNExt.f = $getOwnPropertyNames; |
| 4821 |
__webpack_require__(50).f = $propertyIsEnumerable; |
| 4822 |
$GOPS.f = $getOwnPropertySymbols; |
| 4823 |
|
| 4824 |
if (DESCRIPTORS && !__webpack_require__(47)) { |
| 4825 |
redefine(ObjectProto, 'propertyIsEnumerable', $propertyIsEnumerable, true); |
| 4826 |
} |
| 4827 |
|
| 4828 |
wksExt.f = function (name) { |
| 4829 |
return wrap(wks(name)); |
| 4830 |
}; |
| 4831 |
} |
| 4832 |
|
| 4833 |
$export($export.G + $export.W + $export.F * !USE_NATIVE, { Symbol: $Symbol }); |
| 4834 |
|
| 4835 |
for (var es6Symbols = ( |
| 4836 |
// 19.4.2.2, 19.4.2.3, 19.4.2.4, 19.4.2.6, 19.4.2.8, 19.4.2.9, 19.4.2.10, 19.4.2.11, 19.4.2.12, 19.4.2.13, 19.4.2.14 |
| 4837 |
'hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables' |
| 4838 |
).split(','), j = 0; es6Symbols.length > j;)wks(es6Symbols[j++]); |
| 4839 |
|
| 4840 |
for (var wellKnownSymbols = $keys(wks.store), k = 0; wellKnownSymbols.length > k;) wksDefine(wellKnownSymbols[k++]); |
| 4841 |
|
| 4842 |
$export($export.S + $export.F * !USE_NATIVE, 'Symbol', { |
| 4843 |
// 19.4.2.1 Symbol.for(key) |
| 4844 |
'for': function (key) { |
| 4845 |
return has(SymbolRegistry, key += '') |
| 4846 |
? SymbolRegistry[key] |
| 4847 |
: SymbolRegistry[key] = $Symbol(key); |
| 4848 |
}, |
| 4849 |
// 19.4.2.5 Symbol.keyFor(sym) |
| 4850 |
keyFor: function keyFor(sym) { |
| 4851 |
if (!isSymbol(sym)) throw TypeError(sym + ' is not a symbol!'); |
| 4852 |
for (var key in SymbolRegistry) if (SymbolRegistry[key] === sym) return key; |
| 4853 |
}, |
| 4854 |
useSetter: function () { setter = true; }, |
| 4855 |
useSimple: function () { setter = false; } |
| 4856 |
}); |
| 4857 |
|
| 4858 |
$export($export.S + $export.F * !USE_NATIVE, 'Object', { |
| 4859 |
// 19.1.2.2 Object.create(O [, Properties]) |
| 4860 |
create: $create, |
| 4861 |
// 19.1.2.4 Object.defineProperty(O, P, Attributes) |
| 4862 |
defineProperty: $defineProperty, |
| 4863 |
// 19.1.2.3 Object.defineProperties(O, Properties) |
| 4864 |
defineProperties: $defineProperties, |
| 4865 |
// 19.1.2.6 Object.getOwnPropertyDescriptor(O, P) |
| 4866 |
getOwnPropertyDescriptor: $getOwnPropertyDescriptor, |
| 4867 |
// 19.1.2.7 Object.getOwnPropertyNames(O) |
| 4868 |
getOwnPropertyNames: $getOwnPropertyNames, |
| 4869 |
// 19.1.2.8 Object.getOwnPropertySymbols(O) |
| 4870 |
getOwnPropertySymbols: $getOwnPropertySymbols |
| 4871 |
}); |
| 4872 |
|
| 4873 |
// Chrome 38 and 39 `Object.getOwnPropertySymbols` fails on primitives |
| 4874 |
// https://bugs.chromium.org/p/v8/issues/detail?id=3443 |
| 4875 |
var FAILS_ON_PRIMITIVES = $fails(function () { $GOPS.f(1); }); |
| 4876 |
|
| 4877 |
$export($export.S + $export.F * FAILS_ON_PRIMITIVES, 'Object', { |
| 4878 |
getOwnPropertySymbols: function getOwnPropertySymbols(it) { |
| 4879 |
return $GOPS.f(toObject(it)); |
| 4880 |
} |
| 4881 |
}); |
| 4882 |
|
| 4883 |
// 24.3.2 JSON.stringify(value [, replacer [, space]]) |
| 4884 |
$JSON && $export($export.S + $export.F * (!USE_NATIVE || $fails(function () { |
| 4885 |
var S = $Symbol(); |
| 4886 |
// MS Edge converts symbol values to JSON as {} |
| 4887 |
// WebKit converts symbol values to JSON as null |
| 4888 |
// V8 throws on boxed symbols |
| 4889 |
return _stringify([S]) != '[null]' || _stringify({ a: S }) != '{}' || _stringify(Object(S)) != '{}'; |
| 4890 |
})), 'JSON', { |
| 4891 |
stringify: function stringify(it) { |
| 4892 |
var args = [it]; |
| 4893 |
var i = 1; |
| 4894 |
var replacer, $replacer; |
| 4895 |
while (arguments.length > i) args.push(arguments[i++]); |
| 4896 |
$replacer = replacer = args[1]; |
| 4897 |
if (!isObject(replacer) && it === undefined || isSymbol(it)) return; // IE8 returns string on undefined |
| 4898 |
if (!isArray(replacer)) replacer = function (key, value) { |
| 4899 |
if (typeof $replacer == 'function') value = $replacer.call(this, key, value); |
| 4900 |
if (!isSymbol(value)) return value; |
| 4901 |
}; |
| 4902 |
args[1] = replacer; |
| 4903 |
return _stringify.apply($JSON, args); |
| 4904 |
} |
| 4905 |
}); |
| 4906 |
|
| 4907 |
// 19.4.3.4 Symbol.prototype[@@toPrimitive](hint) |
| 4908 |
$Symbol[PROTOTYPE][TO_PRIMITIVE] || __webpack_require__(24)($Symbol[PROTOTYPE], TO_PRIMITIVE, $Symbol[PROTOTYPE].valueOf); |
| 4909 |
// 19.4.3.5 Symbol.prototype[@@toStringTag] |
| 4910 |
setToStringTag($Symbol, 'Symbol'); |
| 4911 |
// 20.2.1.9 Math[@@toStringTag] |
| 4912 |
setToStringTag(Math, 'Math', true); |
| 4913 |
// 24.3.3 JSON[@@toStringTag] |
| 4914 |
setToStringTag(global.JSON, 'JSON', true); |
| 4915 |
|
| 4916 |
|
| 4917 |
/***/ }), |
| 4918 |
/* 141 */ |
| 4919 |
/***/ (function(module, exports, __webpack_require__) { |
| 4920 |
|
| 4921 |
// call something on iterator step with safe closing on error |
| 4922 |
var anObject = __webpack_require__(13); |
| 4923 |
module.exports = function (iterator, fn, value, entries) { |
| 4924 |
try { |
| 4925 |
return entries ? fn(anObject(value)[0], value[1]) : fn(value); |
| 4926 |
// 7.4.6 IteratorClose(iterator, completion) |
| 4927 |
} catch (e) { |
| 4928 |
var ret = iterator['return']; |
| 4929 |
if (ret !== undefined) anObject(ret.call(iterator)); |
| 4930 |
throw e; |
| 4931 |
} |
| 4932 |
}; |
| 4933 |
|
| 4934 |
|
| 4935 |
/***/ }), |
| 4936 |
/* 142 */ |
| 4937 |
/***/ (function(module, exports, __webpack_require__) { |
| 4938 |
|
| 4939 |
// check on default Array iterator |
| 4940 |
var Iterators = __webpack_require__(35); |
| 4941 |
var ITERATOR = __webpack_require__(10)('iterator'); |
| 4942 |
var ArrayProto = Array.prototype; |
| 4943 |
|
| 4944 |
module.exports = function (it) { |
| 4945 |
return it !== undefined && (Iterators.Array === it || ArrayProto[ITERATOR] === it); |
| 4946 |
}; |
| 4947 |
|
| 4948 |
|
| 4949 |
/***/ }), |
| 4950 |
/* 143 */ |
| 4951 |
/***/ (function(module, exports, __webpack_require__) { |
| 4952 |
|
| 4953 |
// false -> Array#indexOf |
| 4954 |
// true -> Array#includes |
| 4955 |
var toIObject = __webpack_require__(98); |
| 4956 |
var toLength = __webpack_require__(43); |
| 4957 |
var toAbsoluteIndex = __webpack_require__(198); |
| 4958 |
module.exports = function (IS_INCLUDES) { |
| 4959 |
return function ($this, el, fromIndex) { |
| 4960 |
var O = toIObject($this); |
| 4961 |
var length = toLength(O.length); |
| 4962 |
var index = toAbsoluteIndex(fromIndex, length); |
| 4963 |
var value; |
| 4964 |
// Array#includes uses SameValueZero equality algorithm |
| 4965 |
// eslint-disable-next-line no-self-compare |
| 4966 |
if (IS_INCLUDES && el != el) while (length > index) { |
| 4967 |
value = O[index++]; |
| 4968 |
// eslint-disable-next-line no-self-compare |
| 4969 |
if (value != value) return true; |
| 4970 |
// Array#indexOf ignores holes, Array#includes - not |
| 4971 |
} else for (;length > index; index++) if (IS_INCLUDES || index in O) { |
| 4972 |
if (O[index] === el) return IS_INCLUDES || index || 0; |
| 4973 |
} return !IS_INCLUDES && -1; |
| 4974 |
}; |
| 4975 |
}; |
| 4976 |
|
| 4977 |
|
| 4978 |
/***/ }), |
| 4979 |
/* 144 */ |
| 4980 |
/***/ (function(module, exports, __webpack_require__) { |
| 4981 |
|
| 4982 |
var toInteger = __webpack_require__(57); |
| 4983 |
var defined = __webpack_require__(42); |
| 4984 |
// true -> String#at |
| 4985 |
// false -> String#codePointAt |
| 4986 |
module.exports = function (TO_STRING) { |
| 4987 |
return function (that, pos) { |
| 4988 |
var s = String(defined(that)); |
| 4989 |
var i = toInteger(pos); |
| 4990 |
var l = s.length; |
| 4991 |
var a, b; |
| 4992 |
if (i < 0 || i >= l) return TO_STRING ? '' : undefined; |
| 4993 |
a = s.charCodeAt(i); |
| 4994 |
return a < 0xd800 || a > 0xdbff || i + 1 === l || (b = s.charCodeAt(i + 1)) < 0xdc00 || b > 0xdfff |
| 4995 |
? TO_STRING ? s.charAt(i) : a |
| 4996 |
: TO_STRING ? s.slice(i, i + 2) : (a - 0xd800 << 10) + (b - 0xdc00) + 0x10000; |
| 4997 |
}; |
| 4998 |
}; |
| 4999 |
|
| 5000 |
|
| 5001 |
/***/ }), |
| 5002 |
/* 145 */ |
| 5003 |
/***/ (function(module, exports, __webpack_require__) { |
| 5004 |
|
| 5005 |
module.exports = __webpack_require__(67)('native-function-to-string', Function.toString); |
| 5006 |
|
| 5007 |
|
| 5008 |
/***/ }), |
| 5009 |
/* 146 */ |
| 5010 |
/***/ (function(module, exports, __webpack_require__) { |
| 5011 |
|
| 5012 |
"use strict"; |
| 5013 |
|
| 5014 |
// 25.4.1.5 NewPromiseCapability(C) |
| 5015 |
var aFunction = __webpack_require__(38); |
| 5016 |
|
| 5017 |
function PromiseCapability(C) { |
| 5018 |
var resolve, reject; |
| 5019 |
this.promise = new C(function ($$resolve, $$reject) { |
| 5020 |
if (resolve !== undefined || reject !== undefined) throw TypeError('Bad Promise constructor'); |
| 5021 |
resolve = $$resolve; |
| 5022 |
reject = $$reject; |
| 5023 |
}); |
| 5024 |
this.resolve = aFunction(resolve); |
| 5025 |
this.reject = aFunction(reject); |
| 5026 |
} |
| 5027 |
|
| 5028 |
module.exports.f = function (C) { |
| 5029 |
return new PromiseCapability(C); |
| 5030 |
}; |
| 5031 |
|
| 5032 |
|
| 5033 |
/***/ }), |
| 5034 |
/* 147 */ |
| 5035 |
/***/ (function(module, exports, __webpack_require__) { |
| 5036 |
|
| 5037 |
var $iterators = __webpack_require__(117); |
| 5038 |
var getKeys = __webpack_require__(184); |
| 5039 |
var redefine = __webpack_require__(37); |
| 5040 |
var global = __webpack_require__(17); |
| 5041 |
var hide = __webpack_require__(29); |
| 5042 |
var Iterators = __webpack_require__(118); |
| 5043 |
var wks = __webpack_require__(12); |
| 5044 |
var ITERATOR = wks('iterator'); |
| 5045 |
var TO_STRING_TAG = wks('toStringTag'); |
| 5046 |
var ArrayValues = Iterators.Array; |
| 5047 |
|
| 5048 |
var DOMIterables = { |
| 5049 |
CSSRuleList: true, // TODO: Not spec compliant, should be false. |
| 5050 |
CSSStyleDeclaration: false, |
| 5051 |
CSSValueList: false, |
| 5052 |
ClientRectList: false, |
| 5053 |
DOMRectList: false, |
| 5054 |
DOMStringList: false, |
| 5055 |
DOMTokenList: true, |
| 5056 |
DataTransferItemList: false, |
| 5057 |
FileList: false, |
| 5058 |
HTMLAllCollection: false, |
| 5059 |
HTMLCollection: false, |
| 5060 |
HTMLFormElement: false, |
| 5061 |
HTMLSelectElement: false, |
| 5062 |
MediaList: true, // TODO: Not spec compliant, should be false. |
| 5063 |
MimeTypeArray: false, |
| 5064 |
NamedNodeMap: false, |
| 5065 |
NodeList: true, |
| 5066 |
PaintRequestList: false, |
| 5067 |
Plugin: false, |
| 5068 |
PluginArray: false, |
| 5069 |
SVGLengthList: false, |
| 5070 |
SVGNumberList: false, |
| 5071 |
SVGPathSegList: false, |
| 5072 |
SVGPointList: false, |
| 5073 |
SVGStringList: false, |
| 5074 |
SVGTransformList: false, |
| 5075 |
SourceBufferList: false, |
| 5076 |
StyleSheetList: true, // TODO: Not spec compliant, should be false. |
| 5077 |
TextTrackCueList: false, |
| 5078 |
TextTrackList: false, |
| 5079 |
TouchList: false |
| 5080 |
}; |
| 5081 |
|
| 5082 |
for (var collections = getKeys(DOMIterables), i = 0; i < collections.length; i++) { |
| 5083 |
var NAME = collections[i]; |
| 5084 |
var explicit = DOMIterables[NAME]; |
| 5085 |
var Collection = global[NAME]; |
| 5086 |
var proto = Collection && Collection.prototype; |
| 5087 |
var key; |
| 5088 |
if (proto) { |
| 5089 |
if (!proto[ITERATOR]) hide(proto, ITERATOR, ArrayValues); |
| 5090 |
if (!proto[TO_STRING_TAG]) hide(proto, TO_STRING_TAG, NAME); |
| 5091 |
Iterators[NAME] = ArrayValues; |
| 5092 |
if (explicit) for (key in $iterators) if (!proto[key]) redefine(proto, key, $iterators[key], true); |
| 5093 |
} |
| 5094 |
} |
| 5095 |
|
| 5096 |
|
| 5097 |
/***/ }), |
| 5098 |
/* 148 */ |
| 5099 |
/***/ (function(module, exports) { |
| 5100 |
|
| 5101 |
// IE 8- don't enum bug keys |
| 5102 |
module.exports = ( |
| 5103 |
'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf' |
| 5104 |
).split(','); |
| 5105 |
|
| 5106 |
|
| 5107 |
/***/ }), |
| 5108 |
/* 149 */ |
| 5109 |
/***/ (function(module, exports, __webpack_require__) { |
| 5110 |
|
| 5111 |
var _Reflect$construct = __webpack_require__(107); |
| 5112 |
|
| 5113 |
function _isNativeReflectConstruct() { |
| 5114 |
if (typeof Reflect === "undefined" || !_Reflect$construct) return false; |
| 5115 |
if (_Reflect$construct.sham) return false; |
| 5116 |
if (typeof Proxy === "function") return true; |
| 5117 |
|
| 5118 |
try { |
| 5119 |
Date.prototype.toString.call(_Reflect$construct(Date, [], function () {})); |
| 5120 |
return true; |
| 5121 |
} catch (e) { |
| 5122 |
return false; |
| 5123 |
} |
| 5124 |
} |
| 5125 |
|
| 5126 |
module.exports = _isNativeReflectConstruct; |
| 5127 |
|
| 5128 |
/***/ }), |
| 5129 |
/* 150 */ |
| 5130 |
/***/ (function(module, exports) { |
| 5131 |
|
| 5132 |
module.exports = function (done, value) { |
| 5133 |
return { value: value, done: !!done }; |
| 5134 |
}; |
| 5135 |
|
| 5136 |
|
| 5137 |
/***/ }), |
| 5138 |
/* 151 */ |
| 5139 |
/***/ (function(module, exports, __webpack_require__) { |
| 5140 |
|
| 5141 |
module.exports = __webpack_require__(172); |
| 5142 |
|
| 5143 |
/***/ }), |
| 5144 |
/* 152 */ |
| 5145 |
/***/ (function(module, exports, __webpack_require__) { |
| 5146 |
|
| 5147 |
var ITERATOR = __webpack_require__(10)('iterator'); |
| 5148 |
var SAFE_CLOSING = false; |
| 5149 |
|
| 5150 |
try { |
| 5151 |
var riter = [7][ITERATOR](); |
| 5152 |
riter['return'] = function () { SAFE_CLOSING = true; }; |
| 5153 |
// eslint-disable-next-line no-throw-literal |
| 5154 |
Array.from(riter, function () { throw 2; }); |
| 5155 |
} catch (e) { /* empty */ } |
| 5156 |
|
| 5157 |
module.exports = function (exec, skipClosing) { |
| 5158 |
if (!skipClosing && !SAFE_CLOSING) return false; |
| 5159 |
var safe = false; |
| 5160 |
try { |
| 5161 |
var arr = [7]; |
| 5162 |
var iter = arr[ITERATOR](); |
| 5163 |
iter.next = function () { return { done: safe = true }; }; |
| 5164 |
arr[ITERATOR] = function () { return iter; }; |
| 5165 |
exec(arr); |
| 5166 |
} catch (e) { /* empty */ } |
| 5167 |
return safe; |
| 5168 |
}; |
| 5169 |
|
| 5170 |
|
| 5171 |
/***/ }), |
| 5172 |
/* 153 */ |
| 5173 |
/***/ (function(module, exports, __webpack_require__) { |
| 5174 |
|
| 5175 |
var def = __webpack_require__(45).f; |
| 5176 |
var has = __webpack_require__(61); |
| 5177 |
var TAG = __webpack_require__(12)('toStringTag'); |
| 5178 |
|
| 5179 |
module.exports = function (it, tag, stat) { |
| 5180 |
if (it && !has(it = stat ? it : it.prototype, TAG)) def(it, TAG, { configurable: true, value: tag }); |
| 5181 |
}; |
| 5182 |
|
| 5183 |
|
| 5184 |
/***/ }), |
| 5185 |
/* 154 */ |
| 5186 |
/***/ (function(module, exports, __webpack_require__) { |
| 5187 |
|
| 5188 |
// 7.3.20 SpeciesConstructor(O, defaultConstructor) |
| 5189 |
var anObject = __webpack_require__(18); |
| 5190 |
var aFunction = __webpack_require__(91); |
| 5191 |
var SPECIES = __webpack_require__(12)('species'); |
| 5192 |
module.exports = function (O, D) { |
| 5193 |
var C = anObject(O).constructor; |
| 5194 |
var S; |
| 5195 |
return C === undefined || (S = anObject(C)[SPECIES]) == undefined ? D : aFunction(S); |
| 5196 |
}; |
| 5197 |
|
| 5198 |
|
| 5199 |
/***/ }), |
| 5200 |
/* 155 */ |
| 5201 |
/***/ (function(module, exports, __webpack_require__) { |
| 5202 |
|
| 5203 |
"use strict"; |
| 5204 |
// 21.1.3.7 String.prototype.includes(searchString, position = 0) |
| 5205 |
|
| 5206 |
var $export = __webpack_require__(34); |
| 5207 |
var context = __webpack_require__(204); |
| 5208 |
var INCLUDES = 'includes'; |
| 5209 |
|
| 5210 |
$export($export.P + $export.F * __webpack_require__(205)(INCLUDES), 'String', { |
| 5211 |
includes: function includes(searchString /* , position = 0 */) { |
| 5212 |
return !!~context(this, searchString, INCLUDES) |
| 5213 |
.indexOf(searchString, arguments.length > 1 ? arguments[1] : undefined); |
| 5214 |
} |
| 5215 |
}); |
| 5216 |
|
| 5217 |
|
| 5218 |
/***/ }), |
| 5219 |
/* 156 */ |
| 5220 |
/***/ (function(module, exports, __webpack_require__) { |
| 5221 |
|
| 5222 |
__webpack_require__(157); |
| 5223 |
var $Object = __webpack_require__(6).Object; |
| 5224 |
module.exports = function defineProperty(it, key, desc) { |
| 5225 |
return $Object.defineProperty(it, key, desc); |
| 5226 |
}; |
| 5227 |
|
| 5228 |
|
| 5229 |
/***/ }), |
| 5230 |
/* 157 */ |
| 5231 |
/***/ (function(module, exports, __webpack_require__) { |
| 5232 |
|
| 5233 |
var $export = __webpack_require__(7); |
| 5234 |
// 19.1.2.4 / 15.2.3.6 Object.defineProperty(O, P, Attributes) |
| 5235 |
$export($export.S + $export.F * !__webpack_require__(14), 'Object', { defineProperty: __webpack_require__(15).f }); |
| 5236 |
|
| 5237 |
|
| 5238 |
/***/ }), |
| 5239 |
/* 158 */ |
| 5240 |
/***/ (function(module, exports, __webpack_require__) { |
| 5241 |
|
| 5242 |
module.exports = __webpack_require__(159); |
| 5243 |
|
| 5244 |
/***/ }), |
| 5245 |
/* 159 */ |
| 5246 |
/***/ (function(module, exports, __webpack_require__) { |
| 5247 |
|
| 5248 |
__webpack_require__(160); |
| 5249 |
module.exports = __webpack_require__(6).Object.getPrototypeOf; |
| 5250 |
|
| 5251 |
|
| 5252 |
/***/ }), |
| 5253 |
/* 160 */ |
| 5254 |
/***/ (function(module, exports, __webpack_require__) { |
| 5255 |
|
| 5256 |
// 19.1.2.9 Object.getPrototypeOf(O) |
| 5257 |
var toObject = __webpack_require__(32); |
| 5258 |
var $getPrototypeOf = __webpack_require__(64); |
| 5259 |
|
| 5260 |
__webpack_require__(86)('getPrototypeOf', function () { |
| 5261 |
return function getPrototypeOf(it) { |
| 5262 |
return $getPrototypeOf(toObject(it)); |
| 5263 |
}; |
| 5264 |
}); |
| 5265 |
|
| 5266 |
|
| 5267 |
/***/ }), |
| 5268 |
/* 161 */ |
| 5269 |
/***/ (function(module, exports, __webpack_require__) { |
| 5270 |
|
| 5271 |
__webpack_require__(162); |
| 5272 |
module.exports = __webpack_require__(6).Object.setPrototypeOf; |
| 5273 |
|
| 5274 |
|
| 5275 |
/***/ }), |
| 5276 |
/* 162 */ |
| 5277 |
/***/ (function(module, exports, __webpack_require__) { |
| 5278 |
|
| 5279 |
// 19.1.3.19 Object.setPrototypeOf(O, proto) |
| 5280 |
var $export = __webpack_require__(7); |
| 5281 |
$export($export.S, 'Object', { setPrototypeOf: __webpack_require__(163).set }); |
| 5282 |
|
| 5283 |
|
| 5284 |
/***/ }), |
| 5285 |
/* 163 */ |
| 5286 |
/***/ (function(module, exports, __webpack_require__) { |
| 5287 |
|
| 5288 |
// Works with __proto__ only. Old v8 can't work with null proto objects. |
| 5289 |
/* eslint-disable no-proto */ |
| 5290 |
var isObject = __webpack_require__(9); |
| 5291 |
var anObject = __webpack_require__(13); |
| 5292 |
var check = function (O, proto) { |
| 5293 |
anObject(O); |
| 5294 |
if (!isObject(proto) && proto !== null) throw TypeError(proto + ": can't set as prototype!"); |
| 5295 |
}; |
| 5296 |
module.exports = { |
| 5297 |
set: Object.setPrototypeOf || ('__proto__' in {} ? // eslint-disable-line |
| 5298 |
function (test, buggy, set) { |
| 5299 |
try { |
| 5300 |
set = __webpack_require__(31)(Function.call, __webpack_require__(51).f(Object.prototype, '__proto__').set, 2); |
| 5301 |
set(test, []); |
| 5302 |
buggy = !(test instanceof Array); |
| 5303 |
} catch (e) { buggy = true; } |
| 5304 |
return function setPrototypeOf(O, proto) { |
| 5305 |
check(O, proto); |
| 5306 |
if (buggy) O.__proto__ = proto; |
| 5307 |
else set(O, proto); |
| 5308 |
return O; |
| 5309 |
}; |
| 5310 |
}({}, false) : undefined), |
| 5311 |
check: check |
| 5312 |
}; |
| 5313 |
|
| 5314 |
|
| 5315 |
/***/ }), |
| 5316 |
/* 164 */ |
| 5317 |
/***/ (function(module, exports, __webpack_require__) { |
| 5318 |
|
| 5319 |
__webpack_require__(165); |
| 5320 |
var $Object = __webpack_require__(6).Object; |
| 5321 |
module.exports = function create(P, D) { |
| 5322 |
return $Object.create(P, D); |
| 5323 |
}; |
| 5324 |
|
| 5325 |
|
| 5326 |
/***/ }), |
| 5327 |
/* 165 */ |
| 5328 |
/***/ (function(module, exports, __webpack_require__) { |
| 5329 |
|
| 5330 |
var $export = __webpack_require__(7); |
| 5331 |
// 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties]) |
| 5332 |
$export($export.S, 'Object', { create: __webpack_require__(52) }); |
| 5333 |
|
| 5334 |
|
| 5335 |
/***/ }), |
| 5336 |
/* 166 */ |
| 5337 |
/***/ (function(module, exports, __webpack_require__) { |
| 5338 |
|
| 5339 |
// false -> Array#indexOf |
| 5340 |
// true -> Array#includes |
| 5341 |
var toIObject = __webpack_require__(20); |
| 5342 |
var toLength = __webpack_require__(69); |
| 5343 |
var toAbsoluteIndex = __webpack_require__(167); |
| 5344 |
module.exports = function (IS_INCLUDES) { |
| 5345 |
return function ($this, el, fromIndex) { |
| 5346 |
var O = toIObject($this); |
| 5347 |
var length = toLength(O.length); |
| 5348 |
var index = toAbsoluteIndex(fromIndex, length); |
| 5349 |
var value; |
| 5350 |
// Array#includes uses SameValueZero equality algorithm |
| 5351 |
// eslint-disable-next-line no-self-compare |
| 5352 |
if (IS_INCLUDES && el != el) while (length > index) { |
| 5353 |
value = O[index++]; |
| 5354 |
// eslint-disable-next-line no-self-compare |
| 5355 |
if (value != value) return true; |
| 5356 |
// Array#indexOf ignores holes, Array#includes - not |
| 5357 |
} else for (;length > index; index++) if (IS_INCLUDES || index in O) { |
| 5358 |
if (O[index] === el) return IS_INCLUDES || index || 0; |
| 5359 |
} return !IS_INCLUDES && -1; |
| 5360 |
}; |
| 5361 |
}; |
| 5362 |
|
| 5363 |
|
| 5364 |
/***/ }), |
| 5365 |
/* 167 */ |
| 5366 |
/***/ (function(module, exports, __webpack_require__) { |
| 5367 |
|
| 5368 |
var toInteger = __webpack_require__(77); |
| 5369 |
var max = Math.max; |
| 5370 |
var min = Math.min; |
| 5371 |
module.exports = function (index, length) { |
| 5372 |
index = toInteger(index); |
| 5373 |
return index < 0 ? max(index + length, 0) : min(index, length); |
| 5374 |
}; |
| 5375 |
|
| 5376 |
|
| 5377 |
/***/ }), |
| 5378 |
/* 168 */ |
| 5379 |
/***/ (function(module, exports, __webpack_require__) { |
| 5380 |
|
| 5381 |
__webpack_require__(169); |
| 5382 |
module.exports = __webpack_require__(6).Reflect.construct; |
| 5383 |
|
| 5384 |
|
| 5385 |
/***/ }), |
| 5386 |
/* 169 */ |
| 5387 |
/***/ (function(module, exports, __webpack_require__) { |
| 5388 |
|
| 5389 |
// 26.1.2 Reflect.construct(target, argumentsList [, newTarget]) |
| 5390 |
var $export = __webpack_require__(7); |
| 5391 |
var create = __webpack_require__(52); |
| 5392 |
var aFunction = __webpack_require__(38); |
| 5393 |
var anObject = __webpack_require__(13); |
| 5394 |
var isObject = __webpack_require__(9); |
| 5395 |
var fails = __webpack_require__(22); |
| 5396 |
var bind = __webpack_require__(170); |
| 5397 |
var rConstruct = (__webpack_require__(8).Reflect || {}).construct; |
| 5398 |
|
| 5399 |
// MS Edge supports only 2 arguments and argumentsList argument is optional |
| 5400 |
// FF Nightly sets third argument as `new.target`, but does not create `this` from it |
| 5401 |
var NEW_TARGET_BUG = fails(function () { |
| 5402 |
function F() { /* empty */ } |
| 5403 |
return !(rConstruct(function () { /* empty */ }, [], F) instanceof F); |
| 5404 |
}); |
| 5405 |
var ARGS_BUG = !fails(function () { |
| 5406 |
rConstruct(function () { /* empty */ }); |
| 5407 |
}); |
| 5408 |
|
| 5409 |
$export($export.S + $export.F * (NEW_TARGET_BUG || ARGS_BUG), 'Reflect', { |
| 5410 |
construct: function construct(Target, args /* , newTarget */) { |
| 5411 |
aFunction(Target); |
| 5412 |
anObject(args); |
| 5413 |
var newTarget = arguments.length < 3 ? Target : aFunction(arguments[2]); |
| 5414 |
if (ARGS_BUG && !NEW_TARGET_BUG) return rConstruct(Target, args, newTarget); |
| 5415 |
if (Target == newTarget) { |
| 5416 |
// w/o altered newTarget, optimization for 0-4 arguments |
| 5417 |
switch (args.length) { |
| 5418 |
case 0: return new Target(); |
| 5419 |
case 1: return new Target(args[0]); |
| 5420 |
case 2: return new Target(args[0], args[1]); |
| 5421 |
case 3: return new Target(args[0], args[1], args[2]); |
| 5422 |
case 4: return new Target(args[0], args[1], args[2], args[3]); |
| 5423 |
} |
| 5424 |
// w/o altered newTarget, lot of arguments case |
| 5425 |
var $args = [null]; |
| 5426 |
$args.push.apply($args, args); |
| 5427 |
return new (bind.apply(Target, $args))(); |
| 5428 |
} |
| 5429 |
// with altered newTarget, not support built-in constructors |
| 5430 |
var proto = newTarget.prototype; |
| 5431 |
var instance = create(isObject(proto) ? proto : Object.prototype); |
| 5432 |
var result = Function.apply.call(Target, instance, args); |
| 5433 |
return isObject(result) ? result : instance; |
| 5434 |
} |
| 5435 |
}); |
| 5436 |
|
| 5437 |
|
| 5438 |
/***/ }), |
| 5439 |
/* 170 */ |
| 5440 |
/***/ (function(module, exports, __webpack_require__) { |
| 5441 |
|
| 5442 |
"use strict"; |
| 5443 |
|
| 5444 |
var aFunction = __webpack_require__(38); |
| 5445 |
var isObject = __webpack_require__(9); |
| 5446 |
var invoke = __webpack_require__(132); |
| 5447 |
var arraySlice = [].slice; |
| 5448 |
var factories = {}; |
| 5449 |
|
| 5450 |
var construct = function (F, len, args) { |
| 5451 |
if (!(len in factories)) { |
| 5452 |
for (var n = [], i = 0; i < len; i++) n[i] = 'a[' + i + ']'; |
| 5453 |
// eslint-disable-next-line no-new-func |
| 5454 |
factories[len] = Function('F,a', 'return new F(' + n.join(',') + ')'); |
| 5455 |
} return factories[len](F, args); |
| 5456 |
}; |
| 5457 |
|
| 5458 |
module.exports = Function.bind || function bind(that /* , ...args */) { |
| 5459 |
var fn = aFunction(this); |
| 5460 |
var partArgs = arraySlice.call(arguments, 1); |
| 5461 |
var bound = function (/* args... */) { |
| 5462 |
var args = partArgs.concat(arraySlice.call(arguments)); |
| 5463 |
return this instanceof bound ? construct(fn, args.length, args) : invoke(fn, args, that); |
| 5464 |
}; |
| 5465 |
if (isObject(fn.prototype)) bound.prototype = fn.prototype; |
| 5466 |
return bound; |
| 5467 |
}; |
| 5468 |
|
| 5469 |
|
| 5470 |
/***/ }), |
| 5471 |
/* 171 */ |
| 5472 |
/***/ (function(module, exports, __webpack_require__) { |
| 5473 |
|
| 5474 |
var _typeof = __webpack_require__(48); |
| 5475 |
|
| 5476 |
var assertThisInitialized = __webpack_require__(49); |
| 5477 |
|
| 5478 |
function _possibleConstructorReturn(self, call) { |
| 5479 |
if (call && (_typeof(call) === "object" || typeof call === "function")) { |
| 5480 |
return call; |
| 5481 |
} |
| 5482 |
|
| 5483 |
return assertThisInitialized(self); |
| 5484 |
} |
| 5485 |
|
| 5486 |
module.exports = _possibleConstructorReturn; |
| 5487 |
|
| 5488 |
/***/ }), |
| 5489 |
/* 172 */ |
| 5490 |
/***/ (function(module, exports, __webpack_require__) { |
| 5491 |
|
| 5492 |
__webpack_require__(60); |
| 5493 |
__webpack_require__(62); |
| 5494 |
module.exports = __webpack_require__(63).f('iterator'); |
| 5495 |
|
| 5496 |
|
| 5497 |
/***/ }), |
| 5498 |
/* 173 */ |
| 5499 |
/***/ (function(module, exports, __webpack_require__) { |
| 5500 |
|
| 5501 |
var toInteger = __webpack_require__(77); |
| 5502 |
var defined = __webpack_require__(65); |
| 5503 |
// true -> String#at |
| 5504 |
// false -> String#codePointAt |
| 5505 |
module.exports = function (TO_STRING) { |
| 5506 |
return function (that, pos) { |
| 5507 |
var s = String(defined(that)); |
| 5508 |
var i = toInteger(pos); |
| 5509 |
var l = s.length; |
| 5510 |
var a, b; |
| 5511 |
if (i < 0 || i >= l) return TO_STRING ? '' : undefined; |
| 5512 |
a = s.charCodeAt(i); |
| 5513 |
return a < 0xd800 || a > 0xdbff || i + 1 === l || (b = s.charCodeAt(i + 1)) < 0xdc00 || b > 0xdfff |
| 5514 |
? TO_STRING ? s.charAt(i) : a |
| 5515 |
: TO_STRING ? s.slice(i, i + 2) : (a - 0xd800 << 10) + (b - 0xdc00) + 0x10000; |
| 5516 |
}; |
| 5517 |
}; |
| 5518 |
|
| 5519 |
|
| 5520 |
/***/ }), |
| 5521 |
/* 174 */ |
| 5522 |
/***/ (function(module, exports, __webpack_require__) { |
| 5523 |
|
| 5524 |
"use strict"; |
| 5525 |
|
| 5526 |
var create = __webpack_require__(52); |
| 5527 |
var descriptor = __webpack_require__(44); |
| 5528 |
var setToStringTag = __webpack_require__(53); |
| 5529 |
var IteratorPrototype = {}; |
| 5530 |
|
| 5531 |
// 25.1.2.1.1 %IteratorPrototype%[@@iterator]() |
| 5532 |
__webpack_require__(24)(IteratorPrototype, __webpack_require__(10)('iterator'), function () { return this; }); |
| 5533 |
|
| 5534 |
module.exports = function (Constructor, NAME, next) { |
| 5535 |
Constructor.prototype = create(IteratorPrototype, { next: descriptor(1, next) }); |
| 5536 |
setToStringTag(Constructor, NAME + ' Iterator'); |
| 5537 |
}; |
| 5538 |
|
| 5539 |
|
| 5540 |
/***/ }), |
| 5541 |
/* 175 */ |
| 5542 |
/***/ (function(module, exports, __webpack_require__) { |
| 5543 |
|
| 5544 |
"use strict"; |
| 5545 |
|
| 5546 |
var addToUnscopables = __webpack_require__(176); |
| 5547 |
var step = __webpack_require__(150); |
| 5548 |
var Iterators = __webpack_require__(35); |
| 5549 |
var toIObject = __webpack_require__(20); |
| 5550 |
|
| 5551 |
// 22.1.3.4 Array.prototype.entries() |
| 5552 |
// 22.1.3.13 Array.prototype.keys() |
| 5553 |
// 22.1.3.29 Array.prototype.values() |
| 5554 |
// 22.1.3.30 Array.prototype[@@iterator]() |
| 5555 |
module.exports = __webpack_require__(108)(Array, 'Array', function (iterated, kind) { |
| 5556 |
this._t = toIObject(iterated); // target |
| 5557 |
this._i = 0; // next index |
| 5558 |
this._k = kind; // kind |
| 5559 |
// 22.1.5.2.1 %ArrayIteratorPrototype%.next() |
| 5560 |
}, function () { |
| 5561 |
var O = this._t; |
| 5562 |
var kind = this._k; |
| 5563 |
var index = this._i++; |
| 5564 |
if (!O || index >= O.length) { |
| 5565 |
this._t = undefined; |
| 5566 |
return step(1); |
| 5567 |
} |
| 5568 |
if (kind == 'keys') return step(0, index); |
| 5569 |
if (kind == 'values') return step(0, O[index]); |
| 5570 |
return step(0, [index, O[index]]); |
| 5571 |
}, 'values'); |
| 5572 |
|
| 5573 |
// argumentsList[@@iterator] is %ArrayProto_values% (9.4.4.6, 9.4.4.7) |
| 5574 |
Iterators.Arguments = Iterators.Array; |
| 5575 |
|
| 5576 |
addToUnscopables('keys'); |
| 5577 |
addToUnscopables('values'); |
| 5578 |
addToUnscopables('entries'); |
| 5579 |
|
| 5580 |
|
| 5581 |
/***/ }), |
| 5582 |
/* 176 */ |
| 5583 |
/***/ (function(module, exports) { |
| 5584 |
|
| 5585 |
module.exports = function () { /* empty */ }; |
| 5586 |
|
| 5587 |
|
| 5588 |
/***/ }), |
| 5589 |
/* 177 */ |
| 5590 |
/***/ (function(module, exports, __webpack_require__) { |
| 5591 |
|
| 5592 |
__webpack_require__(140); |
| 5593 |
__webpack_require__(100); |
| 5594 |
__webpack_require__(180); |
| 5595 |
__webpack_require__(181); |
| 5596 |
module.exports = __webpack_require__(6).Symbol; |
| 5597 |
|
| 5598 |
|
| 5599 |
/***/ }), |
| 5600 |
/* 178 */ |
| 5601 |
/***/ (function(module, exports, __webpack_require__) { |
| 5602 |
|
| 5603 |
// all enumerable object keys, includes symbols |
| 5604 |
var getKeys = __webpack_require__(40); |
| 5605 |
var gOPS = __webpack_require__(71); |
| 5606 |
var pIE = __webpack_require__(50); |
| 5607 |
module.exports = function (it) { |
| 5608 |
var result = getKeys(it); |
| 5609 |
var getSymbols = gOPS.f; |
| 5610 |
if (getSymbols) { |
| 5611 |
var symbols = getSymbols(it); |
| 5612 |
var isEnum = pIE.f; |
| 5613 |
var i = 0; |
| 5614 |
var key; |
| 5615 |
while (symbols.length > i) if (isEnum.call(it, key = symbols[i++])) result.push(key); |
| 5616 |
} return result; |
| 5617 |
}; |
| 5618 |
|
| 5619 |
|
| 5620 |
/***/ }), |
| 5621 |
/* 179 */ |
| 5622 |
/***/ (function(module, exports, __webpack_require__) { |
| 5623 |
|
| 5624 |
// fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window |
| 5625 |
var toIObject = __webpack_require__(20); |
| 5626 |
var gOPN = __webpack_require__(99).f; |
| 5627 |
var toString = {}.toString; |
| 5628 |
|
| 5629 |
var windowNames = typeof window == 'object' && window && Object.getOwnPropertyNames |
| 5630 |
? Object.getOwnPropertyNames(window) : []; |
| 5631 |
|
| 5632 |
var getWindowNames = function (it) { |
| 5633 |
try { |
| 5634 |
return gOPN(it); |
| 5635 |
} catch (e) { |
| 5636 |
return windowNames.slice(); |
| 5637 |
} |
| 5638 |
}; |
| 5639 |
|
| 5640 |
module.exports.f = function getOwnPropertyNames(it) { |
| 5641 |
return windowNames && toString.call(it) == '[object Window]' ? getWindowNames(it) : gOPN(toIObject(it)); |
| 5642 |
}; |
| 5643 |
|
| 5644 |
|
| 5645 |
/***/ }), |
| 5646 |
/* 180 */ |
| 5647 |
/***/ (function(module, exports, __webpack_require__) { |
| 5648 |
|
| 5649 |
__webpack_require__(79)('asyncIterator'); |
| 5650 |
|
| 5651 |
|
| 5652 |
/***/ }), |
| 5653 |
/* 181 */ |
| 5654 |
/***/ (function(module, exports, __webpack_require__) { |
| 5655 |
|
| 5656 |
__webpack_require__(79)('observable'); |
| 5657 |
|
| 5658 |
|
| 5659 |
/***/ }), |
| 5660 |
/* 182 */ |
| 5661 |
/***/ (function(module, exports, __webpack_require__) { |
| 5662 |
|
| 5663 |
// 0 -> Array#forEach |
| 5664 |
// 1 -> Array#map |
| 5665 |
// 2 -> Array#filter |
| 5666 |
// 3 -> Array#some |
| 5667 |
// 4 -> Array#every |
| 5668 |
// 5 -> Array#find |
| 5669 |
// 6 -> Array#findIndex |
| 5670 |
var ctx = __webpack_require__(73); |
| 5671 |
var IObject = __webpack_require__(120); |
| 5672 |
var toObject = __webpack_require__(96); |
| 5673 |
var toLength = __webpack_require__(43); |
| 5674 |
var asc = __webpack_require__(216); |
| 5675 |
module.exports = function (TYPE, $create) { |
| 5676 |
var IS_MAP = TYPE == 1; |
| 5677 |
var IS_FILTER = TYPE == 2; |
| 5678 |
var IS_SOME = TYPE == 3; |
| 5679 |
var IS_EVERY = TYPE == 4; |
| 5680 |
var IS_FIND_INDEX = TYPE == 6; |
| 5681 |
var NO_HOLES = TYPE == 5 || IS_FIND_INDEX; |
| 5682 |
var create = $create || asc; |
| 5683 |
return function ($this, callbackfn, that) { |
| 5684 |
var O = toObject($this); |
| 5685 |
var self = IObject(O); |
| 5686 |
var f = ctx(callbackfn, that, 3); |
| 5687 |
var length = toLength(self.length); |
| 5688 |
var index = 0; |
| 5689 |
var result = IS_MAP ? create($this, length) : IS_FILTER ? create($this, 0) : undefined; |
| 5690 |
var val, res; |
| 5691 |
for (;length > index; index++) if (NO_HOLES || index in self) { |
| 5692 |
val = self[index]; |
| 5693 |
res = f(val, index, O); |
| 5694 |
if (TYPE) { |
| 5695 |
if (IS_MAP) result[index] = res; // map |
| 5696 |
else if (res) switch (TYPE) { |
| 5697 |
case 3: return true; // some |
| 5698 |
case 5: return val; // find |
| 5699 |
case 6: return index; // findIndex |
| 5700 |
case 2: result.push(val); // filter |
| 5701 |
} else if (IS_EVERY) return false; // every |
| 5702 |
} |
| 5703 |
} |
| 5704 |
return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : result; |
| 5705 |
}; |
| 5706 |
}; |
| 5707 |
|
| 5708 |
|
| 5709 |
/***/ }), |
| 5710 |
/* 183 */ |
| 5711 |
/***/ (function(module, exports, __webpack_require__) { |
| 5712 |
|
| 5713 |
"use strict"; |
| 5714 |
|
| 5715 |
__webpack_require__(280); |
| 5716 |
var anObject = __webpack_require__(18); |
| 5717 |
var $flags = __webpack_require__(106); |
| 5718 |
var DESCRIPTORS = __webpack_require__(27); |
| 5719 |
var TO_STRING = 'toString'; |
| 5720 |
var $toString = /./[TO_STRING]; |
| 5721 |
|
| 5722 |
var define = function (fn) { |
| 5723 |
__webpack_require__(37)(RegExp.prototype, TO_STRING, fn, true); |
| 5724 |
}; |
| 5725 |
|
| 5726 |
// 21.2.5.14 RegExp.prototype.toString() |
| 5727 |
if (__webpack_require__(33)(function () { return $toString.call({ source: 'a', flags: 'b' }) != '/a/b'; })) { |
| 5728 |
define(function toString() { |
| 5729 |
var R = anObject(this); |
| 5730 |
return '/'.concat(R.source, '/', |
| 5731 |
'flags' in R ? R.flags : !DESCRIPTORS && R instanceof RegExp ? $flags.call(R) : undefined); |
| 5732 |
}); |
| 5733 |
// FF44- RegExp#toString has a wrong name |
| 5734 |
} else if ($toString.name != TO_STRING) { |
| 5735 |
define(function toString() { |
| 5736 |
return $toString.call(this); |
| 5737 |
}); |
| 5738 |
} |
| 5739 |
|
| 5740 |
|
| 5741 |
/***/ }), |
| 5742 |
/* 184 */ |
| 5743 |
/***/ (function(module, exports, __webpack_require__) { |
| 5744 |
|
| 5745 |
// 19.1.2.14 / 15.2.3.14 Object.keys(O) |
| 5746 |
var $keys = __webpack_require__(219); |
| 5747 |
var enumBugKeys = __webpack_require__(148); |
| 5748 |
|
| 5749 |
module.exports = Object.keys || function keys(O) { |
| 5750 |
return $keys(O, enumBugKeys); |
| 5751 |
}; |
| 5752 |
|
| 5753 |
|
| 5754 |
/***/ }), |
| 5755 |
/* 185 */ |
| 5756 |
/***/ (function(module, exports, __webpack_require__) { |
| 5757 |
|
| 5758 |
var DESCRIPTORS = __webpack_require__(14); |
| 5759 |
var getKeys = __webpack_require__(40); |
| 5760 |
var toIObject = __webpack_require__(20); |
| 5761 |
var isEnum = __webpack_require__(50).f; |
| 5762 |
module.exports = function (isEntries) { |
| 5763 |
return function (it) { |
| 5764 |
var O = toIObject(it); |
| 5765 |
var keys = getKeys(O); |
| 5766 |
var length = keys.length; |
| 5767 |
var i = 0; |
| 5768 |
var result = []; |
| 5769 |
var key; |
| 5770 |
while (length > i) { |
| 5771 |
key = keys[i++]; |
| 5772 |
if (!DESCRIPTORS || isEnum.call(O, key)) { |
| 5773 |
result.push(isEntries ? [key, O[key]] : O[key]); |
| 5774 |
} |
| 5775 |
} |
| 5776 |
return result; |
| 5777 |
}; |
| 5778 |
}; |
| 5779 |
|
| 5780 |
|
| 5781 |
/***/ }), |
| 5782 |
/* 186 */ |
| 5783 |
/***/ (function(module, exports, __webpack_require__) { |
| 5784 |
|
| 5785 |
"use strict"; |
| 5786 |
|
| 5787 |
var $defineProperty = __webpack_require__(15); |
| 5788 |
var createDesc = __webpack_require__(44); |
| 5789 |
|
| 5790 |
module.exports = function (object, index, value) { |
| 5791 |
if (index in object) $defineProperty.f(object, index, createDesc(0, value)); |
| 5792 |
else object[index] = value; |
| 5793 |
}; |
| 5794 |
|
| 5795 |
|
| 5796 |
/***/ }), |
| 5797 |
/* 187 */ |
| 5798 |
/***/ (function(module, exports, __webpack_require__) { |
| 5799 |
|
| 5800 |
var _Array$from = __webpack_require__(200); |
| 5801 |
|
| 5802 |
var arrayLikeToArray = __webpack_require__(199); |
| 5803 |
|
| 5804 |
function _unsupportedIterableToArray(o, minLen) { |
| 5805 |
if (!o) return; |
| 5806 |
if (typeof o === "string") return arrayLikeToArray(o, minLen); |
| 5807 |
var n = Object.prototype.toString.call(o).slice(8, -1); |
| 5808 |
if (n === "Object" && o.constructor) n = o.constructor.name; |
| 5809 |
if (n === "Map" || n === "Set") return _Array$from(o); |
| 5810 |
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return arrayLikeToArray(o, minLen); |
| 5811 |
} |
| 5812 |
|
| 5813 |
module.exports = _unsupportedIterableToArray; |
| 5814 |
|
| 5815 |
/***/ }), |
| 5816 |
/* 188 */ |
| 5817 |
/***/ (function(module, exports, __webpack_require__) { |
| 5818 |
|
| 5819 |
var _Object$assign = __webpack_require__(134); |
| 5820 |
|
| 5821 |
function _extends() { |
| 5822 |
module.exports = _extends = _Object$assign || function (target) { |
| 5823 |
for (var i = 1; i < arguments.length; i++) { |
| 5824 |
var source = arguments[i]; |
| 5825 |
|
| 5826 |
for (var key in source) { |
| 5827 |
if (Object.prototype.hasOwnProperty.call(source, key)) { |
| 5828 |
target[key] = source[key]; |
| 5829 |
} |
| 5830 |
} |
| 5831 |
} |
| 5832 |
|
| 5833 |
return target; |
| 5834 |
}; |
| 5835 |
|
| 5836 |
return _extends.apply(this, arguments); |
| 5837 |
} |
| 5838 |
|
| 5839 |
module.exports = _extends; |
| 5840 |
|
| 5841 |
/***/ }), |
| 5842 |
/* 189 */, |
| 5843 |
/* 190 */ |
| 5844 |
/***/ (function(module, exports, __webpack_require__) { |
| 5845 |
|
| 5846 |
"use strict"; |
| 5847 |
|
| 5848 |
var regexpExec = __webpack_require__(90); |
| 5849 |
__webpack_require__(34)({ |
| 5850 |
target: 'RegExp', |
| 5851 |
proto: true, |
| 5852 |
forced: regexpExec !== /./.exec |
| 5853 |
}, { |
| 5854 |
exec: regexpExec |
| 5855 |
}); |
| 5856 |
|
| 5857 |
|
| 5858 |
/***/ }), |
| 5859 |
/* 191 */ |
| 5860 |
/***/ (function(module, exports, __webpack_require__) { |
| 5861 |
|
| 5862 |
__webpack_require__(192); |
| 5863 |
var $Object = __webpack_require__(6).Object; |
| 5864 |
module.exports = function getOwnPropertyDescriptor(it, key) { |
| 5865 |
return $Object.getOwnPropertyDescriptor(it, key); |
| 5866 |
}; |
| 5867 |
|
| 5868 |
|
| 5869 |
/***/ }), |
| 5870 |
/* 192 */ |
| 5871 |
/***/ (function(module, exports, __webpack_require__) { |
| 5872 |
|
| 5873 |
// 19.1.2.6 Object.getOwnPropertyDescriptor(O, P) |
| 5874 |
var toIObject = __webpack_require__(20); |
| 5875 |
var $getOwnPropertyDescriptor = __webpack_require__(51).f; |
| 5876 |
|
| 5877 |
__webpack_require__(86)('getOwnPropertyDescriptor', function () { |
| 5878 |
return function getOwnPropertyDescriptor(it, key) { |
| 5879 |
return $getOwnPropertyDescriptor(toIObject(it), key); |
| 5880 |
}; |
| 5881 |
}); |
| 5882 |
|
| 5883 |
|
| 5884 |
/***/ }), |
| 5885 |
/* 193 */ |
| 5886 |
/***/ (function(module, exports, __webpack_require__) { |
| 5887 |
|
| 5888 |
module.exports = __webpack_require__(194); |
| 5889 |
|
| 5890 |
/***/ }), |
| 5891 |
/* 194 */ |
| 5892 |
/***/ (function(module, exports, __webpack_require__) { |
| 5893 |
|
| 5894 |
__webpack_require__(195); |
| 5895 |
module.exports = __webpack_require__(6).Reflect.get; |
| 5896 |
|
| 5897 |
|
| 5898 |
/***/ }), |
| 5899 |
/* 195 */ |
| 5900 |
/***/ (function(module, exports, __webpack_require__) { |
| 5901 |
|
| 5902 |
// 26.1.6 Reflect.get(target, propertyKey [, receiver]) |
| 5903 |
var gOPD = __webpack_require__(51); |
| 5904 |
var getPrototypeOf = __webpack_require__(64); |
| 5905 |
var has = __webpack_require__(19); |
| 5906 |
var $export = __webpack_require__(7); |
| 5907 |
var isObject = __webpack_require__(9); |
| 5908 |
var anObject = __webpack_require__(13); |
| 5909 |
|
| 5910 |
function get(target, propertyKey /* , receiver */) { |
| 5911 |
var receiver = arguments.length < 3 ? target : arguments[2]; |
| 5912 |
var desc, proto; |
| 5913 |
if (anObject(target) === receiver) return target[propertyKey]; |
| 5914 |
if (desc = gOPD.f(target, propertyKey)) return has(desc, 'value') |
| 5915 |
? desc.value |
| 5916 |
: desc.get !== undefined |
| 5917 |
? desc.get.call(receiver) |
| 5918 |
: undefined; |
| 5919 |
if (isObject(proto = getPrototypeOf(target))) return get(proto, propertyKey, receiver); |
| 5920 |
} |
| 5921 |
|
| 5922 |
$export($export.S, 'Reflect', { get: get }); |
| 5923 |
|
| 5924 |
|
| 5925 |
/***/ }), |
| 5926 |
/* 196 */ |
| 5927 |
/***/ (function(module, exports, __webpack_require__) { |
| 5928 |
|
| 5929 |
var getPrototypeOf = __webpack_require__(16); |
| 5930 |
|
| 5931 |
function _superPropBase(object, property) { |
| 5932 |
while (!Object.prototype.hasOwnProperty.call(object, property)) { |
| 5933 |
object = getPrototypeOf(object); |
| 5934 |
if (object === null) break; |
| 5935 |
} |
| 5936 |
|
| 5937 |
return object; |
| 5938 |
} |
| 5939 |
|
| 5940 |
module.exports = _superPropBase; |
| 5941 |
|
| 5942 |
/***/ }), |
| 5943 |
/* 197 */ |
| 5944 |
/***/ (function(module, exports, __webpack_require__) { |
| 5945 |
|
| 5946 |
"use strict"; |
| 5947 |
|
| 5948 |
var LIBRARY = __webpack_require__(110); |
| 5949 |
var $export = __webpack_require__(34); |
| 5950 |
var redefine = __webpack_require__(37); |
| 5951 |
var hide = __webpack_require__(29); |
| 5952 |
var Iterators = __webpack_require__(118); |
| 5953 |
var $iterCreate = __webpack_require__(242); |
| 5954 |
var setToStringTag = __webpack_require__(153); |
| 5955 |
var getPrototypeOf = __webpack_require__(244); |
| 5956 |
var ITERATOR = __webpack_require__(12)('iterator'); |
| 5957 |
var BUGGY = !([].keys && 'next' in [].keys()); // Safari has buggy iterators w/o `next` |
| 5958 |
var FF_ITERATOR = '@@iterator'; |
| 5959 |
var KEYS = 'keys'; |
| 5960 |
var VALUES = 'values'; |
| 5961 |
|
| 5962 |
var returnThis = function () { return this; }; |
| 5963 |
|
| 5964 |
module.exports = function (Base, NAME, Constructor, next, DEFAULT, IS_SET, FORCED) { |
| 5965 |
$iterCreate(Constructor, NAME, next); |
| 5966 |
var getMethod = function (kind) { |
| 5967 |
if (!BUGGY && kind in proto) return proto[kind]; |
| 5968 |
switch (kind) { |
| 5969 |
case KEYS: return function keys() { return new Constructor(this, kind); }; |
| 5970 |
case VALUES: return function values() { return new Constructor(this, kind); }; |
| 5971 |
} return function entries() { return new Constructor(this, kind); }; |
| 5972 |
}; |
| 5973 |
var TAG = NAME + ' Iterator'; |
| 5974 |
var DEF_VALUES = DEFAULT == VALUES; |
| 5975 |
var VALUES_BUG = false; |
| 5976 |
var proto = Base.prototype; |
| 5977 |
var $native = proto[ITERATOR] || proto[FF_ITERATOR] || DEFAULT && proto[DEFAULT]; |
| 5978 |
var $default = $native || getMethod(DEFAULT); |
| 5979 |
var $entries = DEFAULT ? !DEF_VALUES ? $default : getMethod('entries') : undefined; |
| 5980 |
var $anyNative = NAME == 'Array' ? proto.entries || $native : $native; |
| 5981 |
var methods, key, IteratorPrototype; |
| 5982 |
// Fix native |
| 5983 |
if ($anyNative) { |
| 5984 |
IteratorPrototype = getPrototypeOf($anyNative.call(new Base())); |
| 5985 |
if (IteratorPrototype !== Object.prototype && IteratorPrototype.next) { |
| 5986 |
// Set @@toStringTag to native iterators |
| 5987 |
setToStringTag(IteratorPrototype, TAG, true); |
| 5988 |
// fix for some old engines |
| 5989 |
if (!LIBRARY && typeof IteratorPrototype[ITERATOR] != 'function') hide(IteratorPrototype, ITERATOR, returnThis); |
| 5990 |
} |
| 5991 |
} |
| 5992 |
// fix Array#{values, @@iterator}.name in V8 / FF |
| 5993 |
if (DEF_VALUES && $native && $native.name !== VALUES) { |
| 5994 |
VALUES_BUG = true; |
| 5995 |
$default = function values() { return $native.call(this); }; |
| 5996 |
} |
| 5997 |
// Define iterator |
| 5998 |
if ((!LIBRARY || FORCED) && (BUGGY || VALUES_BUG || !proto[ITERATOR])) { |
| 5999 |
hide(proto, ITERATOR, $default); |
| 6000 |
} |
| 6001 |
// Plug for library |
| 6002 |
Iterators[NAME] = $default; |
| 6003 |
Iterators[TAG] = returnThis; |
| 6004 |
if (DEFAULT) { |
| 6005 |
methods = { |
| 6006 |
values: DEF_VALUES ? $default : getMethod(VALUES), |
| 6007 |
keys: IS_SET ? $default : getMethod(KEYS), |
| 6008 |
entries: $entries |
| 6009 |
}; |
| 6010 |
if (FORCED) for (key in methods) { |
| 6011 |
if (!(key in proto)) redefine(proto, key, methods[key]); |
| 6012 |
} else $export($export.P + $export.F * (BUGGY || VALUES_BUG), NAME, methods); |
| 6013 |
} |
| 6014 |
return methods; |
| 6015 |
}; |
| 6016 |
|
| 6017 |
|
| 6018 |
/***/ }), |
| 6019 |
/* 198 */ |
| 6020 |
/***/ (function(module, exports, __webpack_require__) { |
| 6021 |
|
| 6022 |
var toInteger = __webpack_require__(57); |
| 6023 |
var max = Math.max; |
| 6024 |
var min = Math.min; |
| 6025 |
module.exports = function (index, length) { |
| 6026 |
index = toInteger(index); |
| 6027 |
return index < 0 ? max(index + length, 0) : min(index, length); |
| 6028 |
}; |
| 6029 |
|
| 6030 |
|
| 6031 |
/***/ }), |
| 6032 |
/* 199 */ |
| 6033 |
/***/ (function(module, exports) { |
| 6034 |
|
| 6035 |
function _arrayLikeToArray(arr, len) { |
| 6036 |
if (len == null || len > arr.length) len = arr.length; |
| 6037 |
|
| 6038 |
for (var i = 0, arr2 = new Array(len); i < len; i++) { |
| 6039 |
arr2[i] = arr[i]; |
| 6040 |
} |
| 6041 |
|
| 6042 |
return arr2; |
| 6043 |
} |
| 6044 |
|
| 6045 |
module.exports = _arrayLikeToArray; |
| 6046 |
|
| 6047 |
/***/ }), |
| 6048 |
/* 200 */ |
| 6049 |
/***/ (function(module, exports, __webpack_require__) { |
| 6050 |
|
| 6051 |
module.exports = __webpack_require__(228); |
| 6052 |
|
| 6053 |
/***/ }), |
| 6054 |
/* 201 */ |
| 6055 |
/***/ (function(module, exports, __webpack_require__) { |
| 6056 |
|
| 6057 |
__webpack_require__(202); |
| 6058 |
module.exports = __webpack_require__(6).Object.keys; |
| 6059 |
|
| 6060 |
|
| 6061 |
/***/ }), |
| 6062 |
/* 202 */ |
| 6063 |
/***/ (function(module, exports, __webpack_require__) { |
| 6064 |
|
| 6065 |
// 19.1.2.14 Object.keys(O) |
| 6066 |
var toObject = __webpack_require__(32); |
| 6067 |
var $keys = __webpack_require__(40); |
| 6068 |
|
| 6069 |
__webpack_require__(86)('keys', function () { |
| 6070 |
return function keys(it) { |
| 6071 |
return $keys(toObject(it)); |
| 6072 |
}; |
| 6073 |
}); |
| 6074 |
|
| 6075 |
|
| 6076 |
/***/ }), |
| 6077 |
/* 203 */ |
| 6078 |
/***/ (function(module, exports, __webpack_require__) { |
| 6079 |
|
| 6080 |
"use strict"; |
| 6081 |
|
| 6082 |
|
| 6083 |
var _interopRequireDefault = __webpack_require__(0); |
| 6084 |
|
| 6085 |
var _Object$defineProperty = __webpack_require__(1); |
| 6086 |
|
| 6087 |
_Object$defineProperty(exports, "__esModule", { |
| 6088 |
value: true |
| 6089 |
}); |
| 6090 |
|
| 6091 |
exports.default = void 0; |
| 6092 |
|
| 6093 |
var _classCallCheck2 = _interopRequireDefault(__webpack_require__(2)); |
| 6094 |
|
| 6095 |
var _createClass2 = _interopRequireDefault(__webpack_require__(3)); |
| 6096 |
|
| 6097 |
var _inherits2 = _interopRequireDefault(__webpack_require__(4)); |
| 6098 |
|
| 6099 |
var _createSuper2 = _interopRequireDefault(__webpack_require__(5)); |
| 6100 |
|
| 6101 |
var _commandBase = _interopRequireDefault(__webpack_require__(21)); |
| 6102 |
|
| 6103 |
var CommandInternalBase = /*#__PURE__*/function (_CommandBase) { |
| 6104 |
(0, _inherits2.default)(CommandInternalBase, _CommandBase); |
| 6105 |
|
| 6106 |
var _super = (0, _createSuper2.default)(CommandInternalBase); |
| 6107 |
|
| 6108 |
(0, _createClass2.default)(CommandInternalBase, null, [{ |
| 6109 |
key: "getInstanceType", |
| 6110 |
value: function getInstanceType() { |
| 6111 |
return 'CommandInternalBase'; |
| 6112 |
} |
| 6113 |
}]); |
| 6114 |
|
| 6115 |
function CommandInternalBase(args) { |
| 6116 |
var commandsAPI = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : $e.commandsInternal; |
| 6117 |
(0, _classCallCheck2.default)(this, CommandInternalBase); |
| 6118 |
return _super.call(this, args, commandsAPI); |
| 6119 |
} |
| 6120 |
|
| 6121 |
return CommandInternalBase; |
| 6122 |
}(_commandBase.default); |
| 6123 |
|
| 6124 |
exports.default = CommandInternalBase; |
| 6125 |
|
| 6126 |
/***/ }), |
| 6127 |
/* 204 */ |
| 6128 |
/***/ (function(module, exports, __webpack_require__) { |
| 6129 |
|
| 6130 |
// helper for String#{startsWith, endsWith, includes} |
| 6131 |
var isRegExp = __webpack_require__(122); |
| 6132 |
var defined = __webpack_require__(42); |
| 6133 |
|
| 6134 |
module.exports = function (that, searchString, NAME) { |
| 6135 |
if (isRegExp(searchString)) throw TypeError('String#' + NAME + " doesn't accept regex!"); |
| 6136 |
return String(defined(that)); |
| 6137 |
}; |
| 6138 |
|
| 6139 |
|
| 6140 |
/***/ }), |
| 6141 |
/* 205 */ |
| 6142 |
/***/ (function(module, exports, __webpack_require__) { |
| 6143 |
|
| 6144 |
var MATCH = __webpack_require__(12)('match'); |
| 6145 |
module.exports = function (KEY) { |
| 6146 |
var re = /./; |
| 6147 |
try { |
| 6148 |
'/./'[KEY](re); |
| 6149 |
} catch (e) { |
| 6150 |
try { |
| 6151 |
re[MATCH] = false; |
| 6152 |
return !'/./'[KEY](re); |
| 6153 |
} catch (f) { /* empty */ } |
| 6154 |
} return true; |
| 6155 |
}; |
| 6156 |
|
| 6157 |
|
| 6158 |
/***/ }), |
| 6159 |
/* 206 */ |
| 6160 |
/***/ (function(module, exports, __webpack_require__) { |
| 6161 |
|
| 6162 |
module.exports = __webpack_require__(316); |
| 6163 |
|
| 6164 |
/***/ }), |
| 6165 |
/* 207 */ |
| 6166 |
/***/ (function(module, exports, __webpack_require__) { |
| 6167 |
|
| 6168 |
// 7.3.20 SpeciesConstructor(O, defaultConstructor) |
| 6169 |
var anObject = __webpack_require__(13); |
| 6170 |
var aFunction = __webpack_require__(38); |
| 6171 |
var SPECIES = __webpack_require__(10)('species'); |
| 6172 |
module.exports = function (O, D) { |
| 6173 |
var C = anObject(O).constructor; |
| 6174 |
var S; |
| 6175 |
return C === undefined || (S = anObject(C)[SPECIES]) == undefined ? D : aFunction(S); |
| 6176 |
}; |
| 6177 |
|
| 6178 |
|
| 6179 |
/***/ }), |
| 6180 |
/* 208 */ |
| 6181 |
/***/ (function(module, exports, __webpack_require__) { |
| 6182 |
|
| 6183 |
var ctx = __webpack_require__(31); |
| 6184 |
var invoke = __webpack_require__(132); |
| 6185 |
var html = __webpack_require__(131); |
| 6186 |
var cel = __webpack_require__(92); |
| 6187 |
var global = __webpack_require__(8); |
| 6188 |
var process = global.process; |
| 6189 |
var setTask = global.setImmediate; |
| 6190 |
var clearTask = global.clearImmediate; |
| 6191 |
var MessageChannel = global.MessageChannel; |
| 6192 |
var Dispatch = global.Dispatch; |
| 6193 |
var counter = 0; |
| 6194 |
var queue = {}; |
| 6195 |
var ONREADYSTATECHANGE = 'onreadystatechange'; |
| 6196 |
var defer, channel, port; |
| 6197 |
var run = function () { |
| 6198 |
var id = +this; |
| 6199 |
// eslint-disable-next-line no-prototype-builtins |
| 6200 |
if (queue.hasOwnProperty(id)) { |
| 6201 |
var fn = queue[id]; |
| 6202 |
delete queue[id]; |
| 6203 |
fn(); |
| 6204 |
} |
| 6205 |
}; |
| 6206 |
var listener = function (event) { |
| 6207 |
run.call(event.data); |
| 6208 |
}; |
| 6209 |
// Node.js 0.9+ & IE10+ has setImmediate, otherwise: |
| 6210 |
if (!setTask || !clearTask) { |
| 6211 |
setTask = function setImmediate(fn) { |
| 6212 |
var args = []; |
| 6213 |
var i = 1; |
| 6214 |
while (arguments.length > i) args.push(arguments[i++]); |
| 6215 |
queue[++counter] = function () { |
| 6216 |
// eslint-disable-next-line no-new-func |
| 6217 |
invoke(typeof fn == 'function' ? fn : Function(fn), args); |
| 6218 |
}; |
| 6219 |
defer(counter); |
| 6220 |
return counter; |
| 6221 |
}; |
| 6222 |
clearTask = function clearImmediate(id) { |
| 6223 |
delete queue[id]; |
| 6224 |
}; |
| 6225 |
// Node.js 0.8- |
| 6226 |
if (__webpack_require__(56)(process) == 'process') { |
| 6227 |
defer = function (id) { |
| 6228 |
process.nextTick(ctx(run, id, 1)); |
| 6229 |
}; |
| 6230 |
// Sphere (JS game engine) Dispatch API |
| 6231 |
} else if (Dispatch && Dispatch.now) { |
| 6232 |
defer = function (id) { |
| 6233 |
Dispatch.now(ctx(run, id, 1)); |
| 6234 |
}; |
| 6235 |
// Browsers with MessageChannel, includes WebWorkers |
| 6236 |
} else if (MessageChannel) { |
| 6237 |
channel = new MessageChannel(); |
| 6238 |
port = channel.port2; |
| 6239 |
channel.port1.onmessage = listener; |
| 6240 |
defer = ctx(port.postMessage, port, 1); |
| 6241 |
// Browsers with postMessage, skip WebWorkers |
| 6242 |
// IE8 has postMessage, but it's sync & typeof its postMessage is 'object' |
| 6243 |
} else if (global.addEventListener && typeof postMessage == 'function' && !global.importScripts) { |
| 6244 |
defer = function (id) { |
| 6245 |
global.postMessage(id + '', '*'); |
| 6246 |
}; |
| 6247 |
global.addEventListener('message', listener, false); |
| 6248 |
// IE8- |
| 6249 |
} else if (ONREADYSTATECHANGE in cel('script')) { |
| 6250 |
defer = function (id) { |
| 6251 |
html.appendChild(cel('script'))[ONREADYSTATECHANGE] = function () { |
| 6252 |
html.removeChild(this); |
| 6253 |
run.call(id); |
| 6254 |
}; |
| 6255 |
}; |
| 6256 |
// Rest old browsers |
| 6257 |
} else { |
| 6258 |
defer = function (id) { |
| 6259 |
setTimeout(ctx(run, id, 1), 0); |
| 6260 |
}; |
| 6261 |
} |
| 6262 |
} |
| 6263 |
module.exports = { |
| 6264 |
set: setTask, |
| 6265 |
clear: clearTask |
| 6266 |
}; |
| 6267 |
|
| 6268 |
|
| 6269 |
/***/ }), |
| 6270 |
/* 209 */ |
| 6271 |
/***/ (function(module, exports) { |
| 6272 |
|
| 6273 |
module.exports = function (exec) { |
| 6274 |
try { |
| 6275 |
return { e: false, v: exec() }; |
| 6276 |
} catch (e) { |
| 6277 |
return { e: true, v: e }; |
| 6278 |
} |
| 6279 |
}; |
| 6280 |
|
| 6281 |
|
| 6282 |
/***/ }), |
| 6283 |
/* 210 */ |
| 6284 |
/***/ (function(module, exports, __webpack_require__) { |
| 6285 |
|
| 6286 |
var anObject = __webpack_require__(13); |
| 6287 |
var isObject = __webpack_require__(9); |
| 6288 |
var newPromiseCapability = __webpack_require__(146); |
| 6289 |
|
| 6290 |
module.exports = function (C, x) { |
| 6291 |
anObject(C); |
| 6292 |
if (isObject(x) && x.constructor === C) return x; |
| 6293 |
var promiseCapability = newPromiseCapability.f(C); |
| 6294 |
var resolve = promiseCapability.resolve; |
| 6295 |
resolve(x); |
| 6296 |
return promiseCapability.promise; |
| 6297 |
}; |
| 6298 |
|
| 6299 |
|
| 6300 |
/***/ }), |
| 6301 |
/* 211 */ |
| 6302 |
/***/ (function(module, exports, __webpack_require__) { |
| 6303 |
|
| 6304 |
module.exports = __webpack_require__(230); |
| 6305 |
|
| 6306 |
/***/ }), |
| 6307 |
/* 212 */ |
| 6308 |
/***/ (function(module, exports, __webpack_require__) { |
| 6309 |
|
| 6310 |
"use strict"; |
| 6311 |
|
| 6312 |
// 19.1.2.1 Object.assign(target, source, ...) |
| 6313 |
var DESCRIPTORS = __webpack_require__(14); |
| 6314 |
var getKeys = __webpack_require__(40); |
| 6315 |
var gOPS = __webpack_require__(71); |
| 6316 |
var pIE = __webpack_require__(50); |
| 6317 |
var toObject = __webpack_require__(32); |
| 6318 |
var IObject = __webpack_require__(104); |
| 6319 |
var $assign = Object.assign; |
| 6320 |
|
| 6321 |
// should work with symbols and should have deterministic property order (V8 bug) |
| 6322 |
module.exports = !$assign || __webpack_require__(22)(function () { |
| 6323 |
var A = {}; |
| 6324 |
var B = {}; |
| 6325 |
// eslint-disable-next-line no-undef |
| 6326 |
var S = Symbol(); |
| 6327 |
var K = 'abcdefghijklmnopqrst'; |
| 6328 |
A[S] = 7; |
| 6329 |
K.split('').forEach(function (k) { B[k] = k; }); |
| 6330 |
return $assign({}, A)[S] != 7 || Object.keys($assign({}, B)).join('') != K; |
| 6331 |
}) ? function assign(target, source) { // eslint-disable-line no-unused-vars |
| 6332 |
var T = toObject(target); |
| 6333 |
var aLen = arguments.length; |
| 6334 |
var index = 1; |
| 6335 |
var getSymbols = gOPS.f; |
| 6336 |
var isEnum = pIE.f; |
| 6337 |
while (aLen > index) { |
| 6338 |
var S = IObject(arguments[index++]); |
| 6339 |
var keys = getSymbols ? getKeys(S).concat(getSymbols(S)) : getKeys(S); |
| 6340 |
var length = keys.length; |
| 6341 |
var j = 0; |
| 6342 |
var key; |
| 6343 |
while (length > j) { |
| 6344 |
key = keys[j++]; |
| 6345 |
if (!DESCRIPTORS || isEnum.call(S, key)) T[key] = S[key]; |
| 6346 |
} |
| 6347 |
} return T; |
| 6348 |
} : $assign; |
| 6349 |
|
| 6350 |
|
| 6351 |
/***/ }), |
| 6352 |
/* 213 */ |
| 6353 |
/***/ (function(module, exports, __webpack_require__) { |
| 6354 |
|
| 6355 |
module.exports = __webpack_require__(282); |
| 6356 |
|
| 6357 |
/***/ }), |
| 6358 |
/* 214 */ |
| 6359 |
/***/ (function(module, exports, __webpack_require__) { |
| 6360 |
|
| 6361 |
var _Object$defineProperty = __webpack_require__(1); |
| 6362 |
|
| 6363 |
var _Object$defineProperties = __webpack_require__(290); |
| 6364 |
|
| 6365 |
var _Object$getOwnPropertyDescriptors = __webpack_require__(303); |
| 6366 |
|
| 6367 |
var _Object$getOwnPropertyDescriptor = __webpack_require__(124); |
| 6368 |
|
| 6369 |
var _Object$getOwnPropertySymbols = __webpack_require__(307); |
| 6370 |
|
| 6371 |
var _Object$keys = __webpack_require__(23); |
| 6372 |
|
| 6373 |
var defineProperty = __webpack_require__(28); |
| 6374 |
|
| 6375 |
function ownKeys(object, enumerableOnly) { |
| 6376 |
var keys = _Object$keys(object); |
| 6377 |
|
| 6378 |
if (_Object$getOwnPropertySymbols) { |
| 6379 |
var symbols = _Object$getOwnPropertySymbols(object); |
| 6380 |
|
| 6381 |
if (enumerableOnly) symbols = symbols.filter(function (sym) { |
| 6382 |
return _Object$getOwnPropertyDescriptor(object, sym).enumerable; |
| 6383 |
}); |
| 6384 |
keys.push.apply(keys, symbols); |
| 6385 |
} |
| 6386 |
|
| 6387 |
return keys; |
| 6388 |
} |
| 6389 |
|
| 6390 |
function _objectSpread2(target) { |
| 6391 |
for (var i = 1; i < arguments.length; i++) { |
| 6392 |
var source = arguments[i] != null ? arguments[i] : {}; |
| 6393 |
|
| 6394 |
if (i % 2) { |
| 6395 |
ownKeys(Object(source), true).forEach(function (key) { |
| 6396 |
defineProperty(target, key, source[key]); |
| 6397 |
}); |
| 6398 |
} else if (_Object$getOwnPropertyDescriptors) { |
| 6399 |
_Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)); |
| 6400 |
} else { |
| 6401 |
ownKeys(Object(source)).forEach(function (key) { |
| 6402 |
_Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); |
| 6403 |
}); |
| 6404 |
} |
| 6405 |
} |
| 6406 |
|
| 6407 |
return target; |
| 6408 |
} |
| 6409 |
|
| 6410 |
module.exports = _objectSpread2; |
| 6411 |
|
| 6412 |
/***/ }), |
| 6413 |
/* 215 */ |
| 6414 |
/***/ (function(module, exports, __webpack_require__) { |
| 6415 |
|
| 6416 |
"use strict"; |
| 6417 |
|
| 6418 |
|
| 6419 |
var _interopRequireDefault = __webpack_require__(0); |
| 6420 |
|
| 6421 |
var _Object$defineProperty = __webpack_require__(1); |
| 6422 |
|
| 6423 |
_Object$defineProperty(exports, "__esModule", { |
| 6424 |
value: true |
| 6425 |
}); |
| 6426 |
|
| 6427 |
exports.default = void 0; |
| 6428 |
|
| 6429 |
var _values = _interopRequireDefault(__webpack_require__(55)); |
| 6430 |
|
| 6431 |
var _classCallCheck2 = _interopRequireDefault(__webpack_require__(2)); |
| 6432 |
|
| 6433 |
var _createClass2 = _interopRequireDefault(__webpack_require__(3)); |
| 6434 |
|
| 6435 |
var _inherits2 = _interopRequireDefault(__webpack_require__(4)); |
| 6436 |
|
| 6437 |
var _createSuper2 = _interopRequireDefault(__webpack_require__(5)); |
| 6438 |
|
| 6439 |
var _helperBc = _interopRequireDefault(__webpack_require__(370)); |
| 6440 |
|
| 6441 |
// TODO: this file should be deleted. |
| 6442 |
var Helper = /*#__PURE__*/function (_BackwardsCompatibili) { |
| 6443 |
(0, _inherits2.default)(Helper, _BackwardsCompatibili); |
| 6444 |
|
| 6445 |
var _super = (0, _createSuper2.default)(Helper); |
| 6446 |
|
| 6447 |
function Helper() { |
| 6448 |
(0, _classCallCheck2.default)(this, Helper); |
| 6449 |
return _super.apply(this, arguments); |
| 6450 |
} |
| 6451 |
|
| 6452 |
(0, _createClass2.default)(Helper, null, [{ |
| 6453 |
key: "isValidChild", |
| 6454 |
// TODO: This is not the right place for this function |
| 6455 |
value: function isValidChild(childModel, parentModel) { |
| 6456 |
var parentElType = parentModel.get('elType'), |
| 6457 |
draggedElType = childModel.get('elType'), |
| 6458 |
parentIsInner = parentModel.get('isInner'), |
| 6459 |
draggedIsInner = childModel.get('isInner'); // Block's inner-section at inner-section column. |
| 6460 |
|
| 6461 |
if (draggedIsInner && 'section' === draggedElType && parentIsInner && 'column' === parentElType) { |
| 6462 |
return false; |
| 6463 |
} |
| 6464 |
|
| 6465 |
if (draggedElType === parentElType) { |
| 6466 |
return false; |
| 6467 |
} |
| 6468 |
|
| 6469 |
if ('section' === draggedElType && !draggedIsInner && 'column' === parentElType) { |
| 6470 |
return false; |
| 6471 |
} |
| 6472 |
|
| 6473 |
var childTypes = elementor.helpers.getElementChildType(parentElType); |
| 6474 |
return childTypes && -1 !== childTypes.indexOf(childModel.get('elType')); |
| 6475 |
} // TODO: This is not the right place for this function |
| 6476 |
|
| 6477 |
}, { |
| 6478 |
key: "isValidGrandChild", |
| 6479 |
value: function isValidGrandChild(childModel, targetContainer) { |
| 6480 |
var result; |
| 6481 |
var childElType = childModel.get('elType'); |
| 6482 |
|
| 6483 |
switch (targetContainer.model.get('elType')) { |
| 6484 |
case 'document': |
| 6485 |
result = true; |
| 6486 |
break; |
| 6487 |
|
| 6488 |
case 'section': |
| 6489 |
result = 'widget' === childElType; |
| 6490 |
break; |
| 6491 |
|
| 6492 |
default: |
| 6493 |
result = false; |
| 6494 |
} |
| 6495 |
|
| 6496 |
return result; |
| 6497 |
} // TODO: This is not the right place for this function |
| 6498 |
|
| 6499 |
}, { |
| 6500 |
key: "isSameElement", |
| 6501 |
value: function isSameElement(sourceModel, targetContainer) { |
| 6502 |
var targetElType = targetContainer.model.get('elType'), |
| 6503 |
sourceElType = sourceModel.get('elType'); |
| 6504 |
|
| 6505 |
if (targetElType !== sourceElType) { |
| 6506 |
return false; |
| 6507 |
} |
| 6508 |
|
| 6509 |
if ('column' === targetElType && 'column' === sourceElType) { |
| 6510 |
return true; |
| 6511 |
} |
| 6512 |
|
| 6513 |
return targetContainer.model.get('isInner') === sourceModel.get('isInner'); |
| 6514 |
} // TODO: This is not the right place for this function |
| 6515 |
|
| 6516 |
}, { |
| 6517 |
key: "getPasteOptions", |
| 6518 |
value: function getPasteOptions(sourceModel, targetContainer) { |
| 6519 |
var result = {}; |
| 6520 |
result.isValidChild = this.isValidChild(sourceModel, targetContainer.model); |
| 6521 |
result.isSameElement = this.isSameElement(sourceModel, targetContainer); |
| 6522 |
result.isValidGrandChild = this.isValidGrandChild(sourceModel, targetContainer); |
| 6523 |
return result; |
| 6524 |
} // TODO: This is not the right place for this function |
| 6525 |
|
| 6526 |
}, { |
| 6527 |
key: "isPasteEnabled", |
| 6528 |
value: function isPasteEnabled(targetContainer) { |
| 6529 |
var storage = elementorCommon.storage.get('clipboard'); // No storage? no paste. |
| 6530 |
|
| 6531 |
if (!storage || !storage[0]) { |
| 6532 |
return false; |
| 6533 |
} |
| 6534 |
|
| 6535 |
if (!(storage[0] instanceof Backbone.Model)) { |
| 6536 |
storage[0] = new Backbone.Model(storage[0]); |
| 6537 |
} |
| 6538 |
|
| 6539 |
var pasteOptions = this.getPasteOptions(storage[0], targetContainer); |
| 6540 |
return (0, _values.default)(pasteOptions).some(function (opt) { |
| 6541 |
return !!opt; |
| 6542 |
}); |
| 6543 |
} |
| 6544 |
}]); |
| 6545 |
return Helper; |
| 6546 |
}(_helperBc.default); |
| 6547 |
|
| 6548 |
exports.default = Helper; |
| 6549 |
|
| 6550 |
/***/ }), |
| 6551 |
/* 216 */ |
| 6552 |
/***/ (function(module, exports, __webpack_require__) { |
| 6553 |
|
| 6554 |
// 9.4.2.3 ArraySpeciesCreate(originalArray, length) |
| 6555 |
var speciesConstructor = __webpack_require__(217); |
| 6556 |
|
| 6557 |
module.exports = function (original, length) { |
| 6558 |
return new (speciesConstructor(original))(length); |
| 6559 |
}; |
| 6560 |
|
| 6561 |
|
| 6562 |
/***/ }), |
| 6563 |
/* 217 */ |
| 6564 |
/***/ (function(module, exports, __webpack_require__) { |
| 6565 |
|
| 6566 |
var isObject = __webpack_require__(30); |
| 6567 |
var isArray = __webpack_require__(218); |
| 6568 |
var SPECIES = __webpack_require__(12)('species'); |
| 6569 |
|
| 6570 |
module.exports = function (original) { |
| 6571 |
var C; |
| 6572 |
if (isArray(original)) { |
| 6573 |
C = original.constructor; |
| 6574 |
// cross-realm fallback |
| 6575 |
if (typeof C == 'function' && (C === Array || isArray(C.prototype))) C = undefined; |
| 6576 |
if (isObject(C)) { |
| 6577 |
C = C[SPECIES]; |
| 6578 |
if (C === null) C = undefined; |
| 6579 |
} |
| 6580 |
} return C === undefined ? Array : C; |
| 6581 |
}; |
| 6582 |
|
| 6583 |
|
| 6584 |
/***/ }), |
| 6585 |
/* 218 */ |
| 6586 |
/***/ (function(module, exports, __webpack_require__) { |
| 6587 |
|
| 6588 |
// 7.2.2 IsArray(argument) |
| 6589 |
var cof = __webpack_require__(46); |
| 6590 |
module.exports = Array.isArray || function isArray(arg) { |
| 6591 |
return cof(arg) == 'Array'; |
| 6592 |
}; |
| 6593 |
|
| 6594 |
|
| 6595 |
/***/ }), |
| 6596 |
/* 219 */ |
| 6597 |
/***/ (function(module, exports, __webpack_require__) { |
| 6598 |
|
| 6599 |
var has = __webpack_require__(61); |
| 6600 |
var toIObject = __webpack_require__(98); |
| 6601 |
var arrayIndexOf = __webpack_require__(143)(false); |
| 6602 |
var IE_PROTO = __webpack_require__(130)('IE_PROTO'); |
| 6603 |
|
| 6604 |
module.exports = function (object, names) { |
| 6605 |
var O = toIObject(object); |
| 6606 |
var i = 0; |
| 6607 |
var result = []; |
| 6608 |
var key; |
| 6609 |
for (key in O) if (key != IE_PROTO) has(O, key) && result.push(key); |
| 6610 |
// Don't enum bug & hidden keys |
| 6611 |
while (names.length > i) if (has(O, key = names[i++])) { |
| 6612 |
~arrayIndexOf(result, key) || result.push(key); |
| 6613 |
} |
| 6614 |
return result; |
| 6615 |
}; |
| 6616 |
|
| 6617 |
|
| 6618 |
/***/ }), |
| 6619 |
/* 220 */ |
| 6620 |
/***/ (function(module, exports, __webpack_require__) { |
| 6621 |
|
| 6622 |
__webpack_require__(221); |
| 6623 |
module.exports = __webpack_require__(6).Array.isArray; |
| 6624 |
|
| 6625 |
|
| 6626 |
/***/ }), |
| 6627 |
/* 221 */ |
| 6628 |
/***/ (function(module, exports, __webpack_require__) { |
| 6629 |
|
| 6630 |
// 22.1.2.2 / 15.4.3.2 Array.isArray(arg) |
| 6631 |
var $export = __webpack_require__(7); |
| 6632 |
|
| 6633 |
$export($export.S, 'Array', { isArray: __webpack_require__(97) }); |
| 6634 |
|
| 6635 |
|
| 6636 |
/***/ }), |
| 6637 |
/* 222 */, |
| 6638 |
/* 223 */ |
| 6639 |
/***/ (function(module, exports, __webpack_require__) { |
| 6640 |
|
| 6641 |
"use strict"; |
| 6642 |
|
| 6643 |
|
| 6644 |
var _interopRequireDefault = __webpack_require__(0); |
| 6645 |
|
| 6646 |
var _Object$defineProperty = __webpack_require__(1); |
| 6647 |
|
| 6648 |
_Object$defineProperty(exports, "__esModule", { |
| 6649 |
value: true |
| 6650 |
}); |
| 6651 |
|
| 6652 |
exports.default = void 0; |
| 6653 |
|
| 6654 |
var _typeof2 = _interopRequireDefault(__webpack_require__(48)); |
| 6655 |
|
| 6656 |
var _classCallCheck2 = _interopRequireDefault(__webpack_require__(2)); |
| 6657 |
|
| 6658 |
var _createClass2 = _interopRequireDefault(__webpack_require__(3)); |
| 6659 |
|
| 6660 |
var _inherits2 = _interopRequireDefault(__webpack_require__(4)); |
| 6661 |
|
| 6662 |
var _createSuper2 = _interopRequireDefault(__webpack_require__(5)); |
| 6663 |
|
| 6664 |
var _instanceType = _interopRequireDefault(__webpack_require__(252)); |
| 6665 |
|
| 6666 |
var ArgsObject = /*#__PURE__*/function (_InstanceType) { |
| 6667 |
(0, _inherits2.default)(ArgsObject, _InstanceType); |
| 6668 |
|
| 6669 |
var _super = (0, _createSuper2.default)(ArgsObject); |
| 6670 |
|
| 6671 |
(0, _createClass2.default)(ArgsObject, null, [{ |
| 6672 |
key: "getInstanceType", |
| 6673 |
value: function getInstanceType() { |
| 6674 |
return 'ArgsObject'; |
| 6675 |
} |
| 6676 |
/** |
| 6677 |
* Function constructor(). |
| 6678 |
* |
| 6679 |
* Create ArgsObject. |
| 6680 |
* |
| 6681 |
* @param {{}} args |
| 6682 |
*/ |
| 6683 |
|
| 6684 |
}]); |
| 6685 |
|
| 6686 |
function ArgsObject(args) { |
| 6687 |
var _this; |
| 6688 |
|
| 6689 |
(0, _classCallCheck2.default)(this, ArgsObject); |
| 6690 |
_this = _super.call(this); |
| 6691 |
_this.args = args; |
| 6692 |
return _this; |
| 6693 |
} |
| 6694 |
/** |
| 6695 |
* Function requireArgument(). |
| 6696 |
* |
| 6697 |
* Validate property in args. |
| 6698 |
* |
| 6699 |
* @param {string} property |
| 6700 |
* @param {{}} args |
| 6701 |
* |
| 6702 |
* @throws {Error} |
| 6703 |
* |
| 6704 |
*/ |
| 6705 |
|
| 6706 |
|
| 6707 |
(0, _createClass2.default)(ArgsObject, [{ |
| 6708 |
key: "requireArgument", |
| 6709 |
value: function requireArgument(property) { |
| 6710 |
var args = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.args; |
| 6711 |
|
| 6712 |
if (!args.hasOwnProperty(property)) { |
| 6713 |
throw Error("".concat(property, " is required.")); |
| 6714 |
} |
| 6715 |
} |
| 6716 |
/** |
| 6717 |
* Function requireArgumentType(). |
| 6718 |
* |
| 6719 |
* Validate property in args using `type === typeof(args.whatever)`. |
| 6720 |
* |
| 6721 |
* @param {string} property |
| 6722 |
* @param {string} type |
| 6723 |
* @param {{}} args |
| 6724 |
* |
| 6725 |
* @throws {Error} |
| 6726 |
* |
| 6727 |
*/ |
| 6728 |
|
| 6729 |
}, { |
| 6730 |
key: "requireArgumentType", |
| 6731 |
value: function requireArgumentType(property, type) { |
| 6732 |
var args = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : this.args; |
| 6733 |
this.requireArgument(property, args); |
| 6734 |
|
| 6735 |
if ((0, _typeof2.default)(args[property]) !== type) { |
| 6736 |
throw Error("".concat(property, " invalid type: ").concat(type, ".")); |
| 6737 |
} |
| 6738 |
} |
| 6739 |
/** |
| 6740 |
* Function requireArgumentInstance(). |
| 6741 |
* |
| 6742 |
* Validate property in args using `args.whatever instanceof instance`. |
| 6743 |
* |
| 6744 |
* @param {string} property |
| 6745 |
* @param {instanceof} instance |
| 6746 |
* @param {{}} args |
| 6747 |
* |
| 6748 |
* @throws {Error} |
| 6749 |
* |
| 6750 |
*/ |
| 6751 |
|
| 6752 |
}, { |
| 6753 |
key: "requireArgumentInstance", |
| 6754 |
value: function requireArgumentInstance(property, instance) { |
| 6755 |
var args = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : this.args; |
| 6756 |
this.requireArgument(property, args); |
| 6757 |
|
| 6758 |
if (!(args[property] instanceof instance)) { |
| 6759 |
throw Error("".concat(property, " invalid instance.")); |
| 6760 |
} |
| 6761 |
} |
| 6762 |
/** |
| 6763 |
* Function requireArgumentConstructor(). |
| 6764 |
* |
| 6765 |
* Validate property in args using `type === args.whatever.constructor`. |
| 6766 |
* |
| 6767 |
* @param {string} property |
| 6768 |
* @param {*} type |
| 6769 |
* @param {{}} args |
| 6770 |
* |
| 6771 |
* @throws {Error} |
| 6772 |
* |
| 6773 |
*/ |
| 6774 |
|
| 6775 |
}, { |
| 6776 |
key: "requireArgumentConstructor", |
| 6777 |
value: function requireArgumentConstructor(property, type) { |
| 6778 |
var args = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : this.args; |
| 6779 |
this.requireArgument(property, args); |
| 6780 |
|
| 6781 |
if (args[property].constructor !== type) { |
| 6782 |
throw Error("".concat(property, " invalid constructor type.")); |
| 6783 |
} |
| 6784 |
} |
| 6785 |
}]); |
| 6786 |
return ArgsObject; |
| 6787 |
}(_instanceType.default); |
| 6788 |
|
| 6789 |
exports.default = ArgsObject; |
| 6790 |
|
| 6791 |
/***/ }), |
| 6792 |
/* 224 */ |
| 6793 |
/***/ (function(module, exports, __webpack_require__) { |
| 6794 |
|
| 6795 |
"use strict"; |
| 6796 |
|
| 6797 |
|
| 6798 |
var _interopRequireDefault = __webpack_require__(0); |
| 6799 |
|
| 6800 |
var _Object$defineProperty = __webpack_require__(1); |
| 6801 |
|
| 6802 |
_Object$defineProperty(exports, "__esModule", { |
| 6803 |
value: true |
| 6804 |
}); |
| 6805 |
|
| 6806 |
exports.default = exports.After = void 0; |
| 6807 |
|
| 6808 |
var _classCallCheck2 = _interopRequireDefault(__webpack_require__(2)); |
| 6809 |
|
| 6810 |
var _createClass2 = _interopRequireDefault(__webpack_require__(3)); |
| 6811 |
|
| 6812 |
var _inherits2 = _interopRequireDefault(__webpack_require__(4)); |
| 6813 |
|
| 6814 |
var _createSuper2 = _interopRequireDefault(__webpack_require__(5)); |
| 6815 |
|
| 6816 |
var _base = _interopRequireDefault(__webpack_require__(286)); |
| 6817 |
|
| 6818 |
var After = /*#__PURE__*/function (_Base) { |
| 6819 |
(0, _inherits2.default)(After, _Base); |
| 6820 |
|
| 6821 |
var _super = (0, _createSuper2.default)(After); |
| 6822 |
|
| 6823 |
function After() { |
| 6824 |
(0, _classCallCheck2.default)(this, After); |
| 6825 |
return _super.apply(this, arguments); |
| 6826 |
} |
| 6827 |
|
| 6828 |
(0, _createClass2.default)(After, [{ |
| 6829 |
key: "register", |
| 6830 |
value: function register() { |
| 6831 |
$e.hooks.registerDataAfter(this); |
| 6832 |
} |
| 6833 |
}]); |
| 6834 |
return After; |
| 6835 |
}(_base.default); |
| 6836 |
|
| 6837 |
exports.After = After; |
| 6838 |
var _default = After; |
| 6839 |
exports.default = _default; |
| 6840 |
|
| 6841 |
/***/ }), |
| 6842 |
/* 225 */ |
| 6843 |
/***/ (function(module, exports, __webpack_require__) { |
| 6844 |
|
| 6845 |
"use strict"; |
| 6846 |
|
| 6847 |
var global = __webpack_require__(8); |
| 6848 |
var core = __webpack_require__(6); |
| 6849 |
var dP = __webpack_require__(15); |
| 6850 |
var DESCRIPTORS = __webpack_require__(14); |
| 6851 |
var SPECIES = __webpack_require__(10)('species'); |
| 6852 |
|
| 6853 |
module.exports = function (KEY) { |
| 6854 |
var C = typeof core[KEY] == 'function' ? core[KEY] : global[KEY]; |
| 6855 |
if (DESCRIPTORS && C && !C[SPECIES]) dP.f(C, SPECIES, { |
| 6856 |
configurable: true, |
| 6857 |
get: function () { return this; } |
| 6858 |
}); |
| 6859 |
}; |
| 6860 |
|
| 6861 |
|
| 6862 |
/***/ }), |
| 6863 |
/* 226 */ |
| 6864 |
/***/ (function(module, exports, __webpack_require__) { |
| 6865 |
|
| 6866 |
// 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties]) |
| 6867 |
var anObject = __webpack_require__(18); |
| 6868 |
var dPs = __webpack_require__(243); |
| 6869 |
var enumBugKeys = __webpack_require__(148); |
| 6870 |
var IE_PROTO = __webpack_require__(130)('IE_PROTO'); |
| 6871 |
var Empty = function () { /* empty */ }; |
| 6872 |
var PROTOTYPE = 'prototype'; |
| 6873 |
|
| 6874 |
// Create object with fake `null` prototype: use iframe Object with cleared prototype |
| 6875 |
var createDict = function () { |
| 6876 |
// Thrash, waste and sodomy: IE GC bug |
| 6877 |
var iframe = __webpack_require__(109)('iframe'); |
| 6878 |
var i = enumBugKeys.length; |
| 6879 |
var lt = '<'; |
| 6880 |
var gt = '>'; |
| 6881 |
var iframeDocument; |
| 6882 |
iframe.style.display = 'none'; |
| 6883 |
__webpack_require__(227).appendChild(iframe); |
| 6884 |
iframe.src = 'javascript:'; // eslint-disable-line no-script-url |
| 6885 |
// createDict = iframe.contentWindow.Object; |
| 6886 |
// html.removeChild(iframe); |
| 6887 |
iframeDocument = iframe.contentWindow.document; |
| 6888 |
iframeDocument.open(); |
| 6889 |
iframeDocument.write(lt + 'script' + gt + 'document.F=Object' + lt + '/script' + gt); |
| 6890 |
iframeDocument.close(); |
| 6891 |
createDict = iframeDocument.F; |
| 6892 |
while (i--) delete createDict[PROTOTYPE][enumBugKeys[i]]; |
| 6893 |
return createDict(); |
| 6894 |
}; |
| 6895 |
|
| 6896 |
module.exports = Object.create || function create(O, Properties) { |
| 6897 |
var result; |
| 6898 |
if (O !== null) { |
| 6899 |
Empty[PROTOTYPE] = anObject(O); |
| 6900 |
result = new Empty(); |
| 6901 |
Empty[PROTOTYPE] = null; |
| 6902 |
// add "__proto__" for Object.getPrototypeOf polyfill |
| 6903 |
result[IE_PROTO] = O; |
| 6904 |
} else result = createDict(); |
| 6905 |
return Properties === undefined ? result : dPs(result, Properties); |
| 6906 |
}; |
| 6907 |
|
| 6908 |
|
| 6909 |
/***/ }), |
| 6910 |
/* 227 */ |
| 6911 |
/***/ (function(module, exports, __webpack_require__) { |
| 6912 |
|
| 6913 |
var document = __webpack_require__(17).document; |
| 6914 |
module.exports = document && document.documentElement; |
| 6915 |
|
| 6916 |
|
| 6917 |
/***/ }), |
| 6918 |
/* 228 */ |
| 6919 |
/***/ (function(module, exports, __webpack_require__) { |
| 6920 |
|
| 6921 |
__webpack_require__(60); |
| 6922 |
__webpack_require__(229); |
| 6923 |
module.exports = __webpack_require__(6).Array.from; |
| 6924 |
|
| 6925 |
|
| 6926 |
/***/ }), |
| 6927 |
/* 229 */ |
| 6928 |
/***/ (function(module, exports, __webpack_require__) { |
| 6929 |
|
| 6930 |
"use strict"; |
| 6931 |
|
| 6932 |
var ctx = __webpack_require__(31); |
| 6933 |
var $export = __webpack_require__(7); |
| 6934 |
var toObject = __webpack_require__(32); |
| 6935 |
var call = __webpack_require__(141); |
| 6936 |
var isArrayIter = __webpack_require__(142); |
| 6937 |
var toLength = __webpack_require__(69); |
| 6938 |
var createProperty = __webpack_require__(186); |
| 6939 |
var getIterFn = __webpack_require__(112); |
| 6940 |
|
| 6941 |
$export($export.S + $export.F * !__webpack_require__(152)(function (iter) { Array.from(iter); }), 'Array', { |
| 6942 |
// 22.1.2.1 Array.from(arrayLike, mapfn = undefined, thisArg = undefined) |
| 6943 |
from: function from(arrayLike /* , mapfn = undefined, thisArg = undefined */) { |
| 6944 |
var O = toObject(arrayLike); |
| 6945 |
var C = typeof this == 'function' ? this : Array; |
| 6946 |
var aLen = arguments.length; |
| 6947 |
var mapfn = aLen > 1 ? arguments[1] : undefined; |
| 6948 |
var mapping = mapfn !== undefined; |
| 6949 |
var index = 0; |
| 6950 |
var iterFn = getIterFn(O); |
| 6951 |
var length, result, step, iterator; |
| 6952 |
if (mapping) mapfn = ctx(mapfn, aLen > 2 ? arguments[2] : undefined, 2); |
| 6953 |
// if object isn't iterable or it's array with default iterator - use simple case |
| 6954 |
if (iterFn != undefined && !(C == Array && isArrayIter(iterFn))) { |
| 6955 |
for (iterator = iterFn.call(O), result = new C(); !(step = iterator.next()).done; index++) { |
| 6956 |
createProperty(result, index, mapping ? call(iterator, mapfn, [step.value, index], true) : step.value); |
| 6957 |
} |
| 6958 |
} else { |
| 6959 |
length = toLength(O.length); |
| 6960 |
for (result = new C(length); length > index; index++) { |
| 6961 |
createProperty(result, index, mapping ? mapfn(O[index], index) : O[index]); |
| 6962 |
} |
| 6963 |
} |
| 6964 |
result.length = index; |
| 6965 |
return result; |
| 6966 |
} |
| 6967 |
}); |
| 6968 |
|
| 6969 |
|
| 6970 |
/***/ }), |
| 6971 |
/* 230 */ |
| 6972 |
/***/ (function(module, exports, __webpack_require__) { |
| 6973 |
|
| 6974 |
__webpack_require__(62); |
| 6975 |
__webpack_require__(60); |
| 6976 |
module.exports = __webpack_require__(231); |
| 6977 |
|
| 6978 |
|
| 6979 |
/***/ }), |
| 6980 |
/* 231 */ |
| 6981 |
/***/ (function(module, exports, __webpack_require__) { |
| 6982 |
|
| 6983 |
var classof = __webpack_require__(101); |
| 6984 |
var ITERATOR = __webpack_require__(10)('iterator'); |
| 6985 |
var Iterators = __webpack_require__(35); |
| 6986 |
module.exports = __webpack_require__(6).isIterable = function (it) { |
| 6987 |
var O = Object(it); |
| 6988 |
return O[ITERATOR] !== undefined |
| 6989 |
|| '@@iterator' in O |
| 6990 |
// eslint-disable-next-line no-prototype-builtins |
| 6991 |
|| Iterators.hasOwnProperty(classof(O)); |
| 6992 |
}; |
| 6993 |
|
| 6994 |
|
| 6995 |
/***/ }), |
| 6996 |
/* 232 */ |
| 6997 |
/***/ (function(module, exports, __webpack_require__) { |
| 6998 |
|
| 6999 |
"use strict"; |
| 7000 |
|
| 7001 |
var global = __webpack_require__(8); |
| 7002 |
var $export = __webpack_require__(7); |
| 7003 |
var meta = __webpack_require__(70); |
| 7004 |
var fails = __webpack_require__(22); |
| 7005 |
var hide = __webpack_require__(24); |
| 7006 |
var redefineAll = __webpack_require__(126); |
| 7007 |
var forOf = __webpack_require__(88); |
| 7008 |
var anInstance = __webpack_require__(125); |
| 7009 |
var isObject = __webpack_require__(9); |
| 7010 |
var setToStringTag = __webpack_require__(53); |
| 7011 |
var dP = __webpack_require__(15).f; |
| 7012 |
var each = __webpack_require__(138)(0); |
| 7013 |
var DESCRIPTORS = __webpack_require__(14); |
| 7014 |
|
| 7015 |
module.exports = function (NAME, wrapper, methods, common, IS_MAP, IS_WEAK) { |
| 7016 |
var Base = global[NAME]; |
| 7017 |
var C = Base; |
| 7018 |
var ADDER = IS_MAP ? 'set' : 'add'; |
| 7019 |
var proto = C && C.prototype; |
| 7020 |
var O = {}; |
| 7021 |
if (!DESCRIPTORS || typeof C != 'function' || !(IS_WEAK || proto.forEach && !fails(function () { |
| 7022 |
new C().entries().next(); |
| 7023 |
}))) { |
| 7024 |
// create collection constructor |
| 7025 |
C = common.getConstructor(wrapper, NAME, IS_MAP, ADDER); |
| 7026 |
redefineAll(C.prototype, methods); |
| 7027 |
meta.NEED = true; |
| 7028 |
} else { |
| 7029 |
C = wrapper(function (target, iterable) { |
| 7030 |
anInstance(target, C, NAME, '_c'); |
| 7031 |
target._c = new Base(); |
| 7032 |
if (iterable != undefined) forOf(iterable, IS_MAP, target[ADDER], target); |
| 7033 |
}); |
| 7034 |
each('add,clear,delete,forEach,get,has,set,keys,values,entries,toJSON'.split(','), function (KEY) { |
| 7035 |
var IS_ADDER = KEY == 'add' || KEY == 'set'; |
| 7036 |
if (KEY in proto && !(IS_WEAK && KEY == 'clear')) hide(C.prototype, KEY, function (a, b) { |
| 7037 |
anInstance(this, C, KEY); |
| 7038 |
if (!IS_ADDER && IS_WEAK && !isObject(a)) return KEY == 'get' ? undefined : false; |
| 7039 |
var result = this._c[KEY](a === 0 ? 0 : a, b); |
| 7040 |
return IS_ADDER ? this : result; |
| 7041 |
}); |
| 7042 |
}); |
| 7043 |
IS_WEAK || dP(C.prototype, 'size', { |
| 7044 |
get: function () { |
| 7045 |
return this._c.size; |
| 7046 |
} |
| 7047 |
}); |
| 7048 |
} |
| 7049 |
|
| 7050 |
setToStringTag(C, NAME); |
| 7051 |
|
| 7052 |
O[NAME] = C; |
| 7053 |
$export($export.G + $export.W + $export.F, O); |
| 7054 |
|
| 7055 |
if (!IS_WEAK) common.setStrong(C, NAME, IS_MAP); |
| 7056 |
|
| 7057 |
return C; |
| 7058 |
}; |
| 7059 |
|
| 7060 |
|
| 7061 |
/***/ }), |
| 7062 |
/* 233 */ |
| 7063 |
/***/ (function(module, exports, __webpack_require__) { |
| 7064 |
|
| 7065 |
"use strict"; |
| 7066 |
|
| 7067 |
// https://tc39.github.io/proposal-setmap-offrom/ |
| 7068 |
var $export = __webpack_require__(7); |
| 7069 |
|
| 7070 |
module.exports = function (COLLECTION) { |
| 7071 |
$export($export.S, COLLECTION, { of: function of() { |
| 7072 |
var length = arguments.length; |
| 7073 |
var A = new Array(length); |
| 7074 |
while (length--) A[length] = arguments[length]; |
| 7075 |
return new this(A); |
| 7076 |
} }); |
| 7077 |
}; |
| 7078 |
|
| 7079 |
|
| 7080 |
/***/ }), |
| 7081 |
/* 234 */ |
| 7082 |
/***/ (function(module, exports, __webpack_require__) { |
| 7083 |
|
| 7084 |
"use strict"; |
| 7085 |
|
| 7086 |
// https://tc39.github.io/proposal-setmap-offrom/ |
| 7087 |
var $export = __webpack_require__(7); |
| 7088 |
var aFunction = __webpack_require__(38); |
| 7089 |
var ctx = __webpack_require__(31); |
| 7090 |
var forOf = __webpack_require__(88); |
| 7091 |
|
| 7092 |
module.exports = function (COLLECTION) { |
| 7093 |
$export($export.S, COLLECTION, { from: function from(source /* , mapFn, thisArg */) { |
| 7094 |
var mapFn = arguments[1]; |
| 7095 |
var mapping, A, n, cb; |
| 7096 |
aFunction(this); |
| 7097 |
mapping = mapFn !== undefined; |
| 7098 |
if (mapping) aFunction(mapFn); |
| 7099 |
if (source == undefined) return new this(); |
| 7100 |
A = []; |
| 7101 |
if (mapping) { |
| 7102 |
n = 0; |
| 7103 |
cb = ctx(mapFn, arguments[2], 2); |
| 7104 |
forOf(source, false, function (nextItem) { |
| 7105 |
A.push(cb(nextItem, n++)); |
| 7106 |
}); |
| 7107 |
} else { |
| 7108 |
forOf(source, false, A.push, A); |
| 7109 |
} |
| 7110 |
return new this(A); |
| 7111 |
} }); |
| 7112 |
}; |
| 7113 |
|
| 7114 |
|
| 7115 |
/***/ }), |
| 7116 |
/* 235 */ |
| 7117 |
/***/ (function(module, exports) { |
| 7118 |
|
| 7119 |
module.exports = '\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003' + |
| 7120 |
'\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF'; |
| 7121 |
|
| 7122 |
|
| 7123 |
/***/ }), |
| 7124 |
/* 236 */ |
| 7125 |
/***/ (function(module, exports, __webpack_require__) { |
| 7126 |
|
| 7127 |
module.exports = __webpack_require__(249); |
| 7128 |
|
| 7129 |
/***/ }), |
| 7130 |
/* 237 */ |
| 7131 |
/***/ (function(module, exports, __webpack_require__) { |
| 7132 |
|
| 7133 |
"use strict"; |
| 7134 |
|
| 7135 |
|
| 7136 |
var _interopRequireDefault = __webpack_require__(0); |
| 7137 |
|
| 7138 |
var _typeof2 = _interopRequireDefault(__webpack_require__(48)); |
| 7139 |
|
| 7140 |
var ControlBaseDataView = __webpack_require__(127), |
| 7141 |
ControlBaseMultipleItemView; |
| 7142 |
|
| 7143 |
ControlBaseMultipleItemView = ControlBaseDataView.extend({ |
| 7144 |
applySavedValue: function applySavedValue() { |
| 7145 |
var values = this.getControlValue(), |
| 7146 |
$inputs = this.$('[data-setting]'), |
| 7147 |
self = this; |
| 7148 |
|
| 7149 |
_.each(values, function (value, key) { |
| 7150 |
var $input = $inputs.filter(function () { |
| 7151 |
return key === this.dataset.setting; |
| 7152 |
}); |
| 7153 |
self.setInputValue($input, value); |
| 7154 |
}); |
| 7155 |
}, |
| 7156 |
getControlValue: function getControlValue(key) { |
| 7157 |
var values = this.container.settings.get(this.model.get('name')); |
| 7158 |
|
| 7159 |
if (!jQuery.isPlainObject(values)) { |
| 7160 |
return {}; |
| 7161 |
} |
| 7162 |
|
| 7163 |
if (key) { |
| 7164 |
var value = values[key]; |
| 7165 |
|
| 7166 |
if (undefined === value) { |
| 7167 |
value = ''; |
| 7168 |
} |
| 7169 |
|
| 7170 |
return value; |
| 7171 |
} |
| 7172 |
|
| 7173 |
return elementorCommon.helpers.cloneObject(values); |
| 7174 |
}, |
| 7175 |
setValue: function setValue(key, value) { |
| 7176 |
var values = this.getControlValue(); |
| 7177 |
|
| 7178 |
if ('object' === (0, _typeof2.default)(key)) { |
| 7179 |
_.each(key, function (internalValue, internalKey) { |
| 7180 |
values[internalKey] = internalValue; |
| 7181 |
}); |
| 7182 |
} else { |
| 7183 |
values[key] = value; |
| 7184 |
} |
| 7185 |
|
| 7186 |
this.setSettingsModel(values); |
| 7187 |
}, |
| 7188 |
updateElementModel: function updateElementModel(value, input) { |
| 7189 |
var key = input.dataset.setting; |
| 7190 |
this.setValue(key, value); |
| 7191 |
} |
| 7192 |
}, { |
| 7193 |
// Static methods |
| 7194 |
getStyleValue: function getStyleValue(placeholder, controlValue) { |
| 7195 |
if (!_.isObject(controlValue)) { |
| 7196 |
return ''; // invalid |
| 7197 |
} |
| 7198 |
|
| 7199 |
return controlValue[placeholder.toLowerCase()]; |
| 7200 |
} |
| 7201 |
}); |
| 7202 |
module.exports = ControlBaseMultipleItemView; |
| 7203 |
|
| 7204 |
/***/ }), |
| 7205 |
/* 238 */, |
| 7206 |
/* 239 */ |
| 7207 |
/***/ (function(module, exports, __webpack_require__) { |
| 7208 |
|
| 7209 |
__webpack_require__(240); |
| 7210 |
module.exports = __webpack_require__(6).Object.values; |
| 7211 |
|
| 7212 |
|
| 7213 |
/***/ }), |
| 7214 |
/* 240 */ |
| 7215 |
/***/ (function(module, exports, __webpack_require__) { |
| 7216 |
|
| 7217 |
// https://github.com/tc39/proposal-object-values-entries |
| 7218 |
var $export = __webpack_require__(7); |
| 7219 |
var $values = __webpack_require__(185)(false); |
| 7220 |
|
| 7221 |
$export($export.S, 'Object', { |
| 7222 |
values: function values(it) { |
| 7223 |
return $values(it); |
| 7224 |
} |
| 7225 |
}); |
| 7226 |
|
| 7227 |
|
| 7228 |
/***/ }), |
| 7229 |
/* 241 */ |
| 7230 |
/***/ (function(module, exports) { |
| 7231 |
|
| 7232 |
module.exports = function (done, value) { |
| 7233 |
return { value: value, done: !!done }; |
| 7234 |
}; |
| 7235 |
|
| 7236 |
|
| 7237 |
/***/ }), |
| 7238 |
/* 242 */ |
| 7239 |
/***/ (function(module, exports, __webpack_require__) { |
| 7240 |
|
| 7241 |
"use strict"; |
| 7242 |
|
| 7243 |
var create = __webpack_require__(226); |
| 7244 |
var descriptor = __webpack_require__(103); |
| 7245 |
var setToStringTag = __webpack_require__(153); |
| 7246 |
var IteratorPrototype = {}; |
| 7247 |
|
| 7248 |
// 25.1.2.1.1 %IteratorPrototype%[@@iterator]() |
| 7249 |
__webpack_require__(29)(IteratorPrototype, __webpack_require__(12)('iterator'), function () { return this; }); |
| 7250 |
|
| 7251 |
module.exports = function (Constructor, NAME, next) { |
| 7252 |
Constructor.prototype = create(IteratorPrototype, { next: descriptor(1, next) }); |
| 7253 |
setToStringTag(Constructor, NAME + ' Iterator'); |
| 7254 |
}; |
| 7255 |
|
| 7256 |
|
| 7257 |
/***/ }), |
| 7258 |
/* 243 */ |
| 7259 |
/***/ (function(module, exports, __webpack_require__) { |
| 7260 |
|
| 7261 |
var dP = __webpack_require__(45); |
| 7262 |
var anObject = __webpack_require__(18); |
| 7263 |
var getKeys = __webpack_require__(184); |
| 7264 |
|
| 7265 |
module.exports = __webpack_require__(27) ? Object.defineProperties : function defineProperties(O, Properties) { |
| 7266 |
anObject(O); |
| 7267 |
var keys = getKeys(Properties); |
| 7268 |
var length = keys.length; |
| 7269 |
var i = 0; |
| 7270 |
var P; |
| 7271 |
while (length > i) dP.f(O, P = keys[i++], Properties[P]); |
| 7272 |
return O; |
| 7273 |
}; |
| 7274 |
|
| 7275 |
|
| 7276 |
/***/ }), |
| 7277 |
/* 244 */ |
| 7278 |
/***/ (function(module, exports, __webpack_require__) { |
| 7279 |
|
| 7280 |
// 19.1.2.9 / 15.2.3.2 Object.getPrototypeOf(O) |
| 7281 |
var has = __webpack_require__(61); |
| 7282 |
var toObject = __webpack_require__(96); |
| 7283 |
var IE_PROTO = __webpack_require__(130)('IE_PROTO'); |
| 7284 |
var ObjectProto = Object.prototype; |
| 7285 |
|
| 7286 |
module.exports = Object.getPrototypeOf || function (O) { |
| 7287 |
O = toObject(O); |
| 7288 |
if (has(O, IE_PROTO)) return O[IE_PROTO]; |
| 7289 |
if (typeof O.constructor == 'function' && O instanceof O.constructor) { |
| 7290 |
return O.constructor.prototype; |
| 7291 |
} return O instanceof Object ? ObjectProto : null; |
| 7292 |
}; |
| 7293 |
|
| 7294 |
|
| 7295 |
/***/ }), |
| 7296 |
/* 245 */ |
| 7297 |
/***/ (function(module, exports, __webpack_require__) { |
| 7298 |
|
| 7299 |
// 9.4.2.3 ArraySpeciesCreate(originalArray, length) |
| 7300 |
var speciesConstructor = __webpack_require__(246); |
| 7301 |
|
| 7302 |
module.exports = function (original, length) { |
| 7303 |
return new (speciesConstructor(original))(length); |
| 7304 |
}; |
| 7305 |
|
| 7306 |
|
| 7307 |
/***/ }), |
| 7308 |
/* 246 */ |
| 7309 |
/***/ (function(module, exports, __webpack_require__) { |
| 7310 |
|
| 7311 |
var isObject = __webpack_require__(9); |
| 7312 |
var isArray = __webpack_require__(97); |
| 7313 |
var SPECIES = __webpack_require__(10)('species'); |
| 7314 |
|
| 7315 |
module.exports = function (original) { |
| 7316 |
var C; |
| 7317 |
if (isArray(original)) { |
| 7318 |
C = original.constructor; |
| 7319 |
// cross-realm fallback |
| 7320 |
if (typeof C == 'function' && (C === Array || isArray(C.prototype))) C = undefined; |
| 7321 |
if (isObject(C)) { |
| 7322 |
C = C[SPECIES]; |
| 7323 |
if (C === null) C = undefined; |
| 7324 |
} |
| 7325 |
} return C === undefined ? Array : C; |
| 7326 |
}; |
| 7327 |
|
| 7328 |
|
| 7329 |
/***/ }), |
| 7330 |
/* 247 */ |
| 7331 |
/***/ (function(module, exports, __webpack_require__) { |
| 7332 |
|
| 7333 |
var _Array$isArray = __webpack_require__(84); |
| 7334 |
|
| 7335 |
function _arrayWithHoles(arr) { |
| 7336 |
if (_Array$isArray(arr)) return arr; |
| 7337 |
} |
| 7338 |
|
| 7339 |
module.exports = _arrayWithHoles; |
| 7340 |
|
| 7341 |
/***/ }), |
| 7342 |
/* 248 */ |
| 7343 |
/***/ (function(module, exports, __webpack_require__) { |
| 7344 |
|
| 7345 |
var _getIterator = __webpack_require__(236); |
| 7346 |
|
| 7347 |
var _isIterable = __webpack_require__(211); |
| 7348 |
|
| 7349 |
var _Symbol = __webpack_require__(111); |
| 7350 |
|
| 7351 |
function _iterableToArrayLimit(arr, i) { |
| 7352 |
if (typeof _Symbol === "undefined" || !_isIterable(Object(arr))) return; |
| 7353 |
var _arr = []; |
| 7354 |
var _n = true; |
| 7355 |
var _d = false; |
| 7356 |
var _e = undefined; |
| 7357 |
|
| 7358 |
try { |
| 7359 |
for (var _i = _getIterator(arr), _s; !(_n = (_s = _i.next()).done); _n = true) { |
| 7360 |
_arr.push(_s.value); |
| 7361 |
|
| 7362 |
if (i && _arr.length === i) break; |
| 7363 |
} |
| 7364 |
} catch (err) { |
| 7365 |
_d = true; |
| 7366 |
_e = err; |
| 7367 |
} finally { |
| 7368 |
try { |
| 7369 |
if (!_n && _i["return"] != null) _i["return"](); |
| 7370 |
} finally { |
| 7371 |
if (_d) throw _e; |
| 7372 |
} |
| 7373 |
} |
| 7374 |
|
| 7375 |
return _arr; |
| 7376 |
} |
| 7377 |
|
| 7378 |
module.exports = _iterableToArrayLimit; |
| 7379 |
|
| 7380 |
/***/ }), |
| 7381 |
/* 249 */ |
| 7382 |
/***/ (function(module, exports, __webpack_require__) { |
| 7383 |
|
| 7384 |
__webpack_require__(62); |
| 7385 |
__webpack_require__(60); |
| 7386 |
module.exports = __webpack_require__(250); |
| 7387 |
|
| 7388 |
|
| 7389 |
/***/ }), |
| 7390 |
/* 250 */ |
| 7391 |
/***/ (function(module, exports, __webpack_require__) { |
| 7392 |
|
| 7393 |
var anObject = __webpack_require__(13); |
| 7394 |
var get = __webpack_require__(112); |
| 7395 |
module.exports = __webpack_require__(6).getIterator = function (it) { |
| 7396 |
var iterFn = get(it); |
| 7397 |
if (typeof iterFn != 'function') throw TypeError(it + ' is not iterable!'); |
| 7398 |
return anObject(iterFn.call(it)); |
| 7399 |
}; |
| 7400 |
|
| 7401 |
|
| 7402 |
/***/ }), |
| 7403 |
/* 251 */ |
| 7404 |
/***/ (function(module, exports) { |
| 7405 |
|
| 7406 |
function _nonIterableRest() { |
| 7407 |
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); |
| 7408 |
} |
| 7409 |
|
| 7410 |
module.exports = _nonIterableRest; |
| 7411 |
|
| 7412 |
/***/ }), |
| 7413 |
/* 252 */ |
| 7414 |
/***/ (function(module, exports, __webpack_require__) { |
| 7415 |
|
| 7416 |
"use strict"; |
| 7417 |
|
| 7418 |
|
| 7419 |
var _interopRequireDefault = __webpack_require__(0); |
| 7420 |
|
| 7421 |
var _Object$defineProperty = __webpack_require__(1); |
| 7422 |
|
| 7423 |
_Object$defineProperty(exports, "__esModule", { |
| 7424 |
value: true |
| 7425 |
}); |
| 7426 |
|
| 7427 |
exports.default = void 0; |
| 7428 |
|
| 7429 |
__webpack_require__(39); |
| 7430 |
|
| 7431 |
var _isArray = _interopRequireDefault(__webpack_require__(84)); |
| 7432 |
|
| 7433 |
var _hasInstance = _interopRequireDefault(__webpack_require__(253)); |
| 7434 |
|
| 7435 |
var _classCallCheck2 = _interopRequireDefault(__webpack_require__(2)); |
| 7436 |
|
| 7437 |
var _createClass2 = _interopRequireDefault(__webpack_require__(3)); |
| 7438 |
|
| 7439 |
var _get2 = _interopRequireDefault(__webpack_require__(26)); |
| 7440 |
|
| 7441 |
var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(16)); |
| 7442 |
|
| 7443 |
var InstanceType = /*#__PURE__*/function () { |
| 7444 |
(0, _createClass2.default)(InstanceType, null, [{ |
| 7445 |
key: _hasInstance.default, |
| 7446 |
value: function value(target) { |
| 7447 |
/** |
| 7448 |
* This is function extending being called each time JS uses instanceOf, since babel use it each time it create new class |
| 7449 |
* its give's opportunity to mange capabilities of instanceOf operator. |
| 7450 |
* saving current class each time will give option later to handle instanceOf manually. |
| 7451 |
*/ |
| 7452 |
var result = (0, _get2.default)((0, _getPrototypeOf2.default)(InstanceType), _hasInstance.default, this).call(this, target); // Act normal when validate a class, which does not have instance type. |
| 7453 |
|
| 7454 |
if (target && !target.constructor.getInstanceType) { |
| 7455 |
return result; |
| 7456 |
} |
| 7457 |
|
| 7458 |
if (target) { |
| 7459 |
if (!target.instanceTypes) { |
| 7460 |
target.instanceTypes = []; |
| 7461 |
} |
| 7462 |
|
| 7463 |
if (!result) { |
| 7464 |
if (this.getInstanceType() === target.constructor.getInstanceType()) { |
| 7465 |
result = true; |
| 7466 |
} |
| 7467 |
} |
| 7468 |
|
| 7469 |
if (result) { |
| 7470 |
var name = this.getInstanceType === InstanceType.getInstanceType ? 'BaseInstanceType' : this.getInstanceType(); |
| 7471 |
|
| 7472 |
if (-1 === target.instanceTypes.indexOf(name)) { |
| 7473 |
target.instanceTypes.push(name); |
| 7474 |
} |
| 7475 |
} |
| 7476 |
} |
| 7477 |
|
| 7478 |
if (!result && target) { |
| 7479 |
// Check if the given 'target', is instance of known types. |
| 7480 |
result = target.instanceTypes && (0, _isArray.default)(target.instanceTypes) && -1 !== target.instanceTypes.indexOf(this.getInstanceType()); |
| 7481 |
} |
| 7482 |
|
| 7483 |
return result; |
| 7484 |
} |
| 7485 |
}]); |
| 7486 |
|
| 7487 |
function InstanceType() { |
| 7488 |
var _this = this; |
| 7489 |
|
| 7490 |
(0, _classCallCheck2.default)(this, InstanceType); |
| 7491 |
// Since anonymous classes sometimes do not get validated by babel, do it manually. |
| 7492 |
var target = this instanceof InstanceType ? this.constructor : void 0; |
| 7493 |
var prototypes = []; |
| 7494 |
|
| 7495 |
while (target.__proto__ && target.__proto__.name) { |
| 7496 |
prototypes.push(target.__proto__); |
| 7497 |
target = target.__proto__; |
| 7498 |
} |
| 7499 |
|
| 7500 |
prototypes.reverse().forEach(function (proto) { |
| 7501 |
return _this instanceof proto; |
| 7502 |
}); |
| 7503 |
} |
| 7504 |
|
| 7505 |
(0, _createClass2.default)(InstanceType, null, [{ |
| 7506 |
key: "getInstanceType", |
| 7507 |
value: function getInstanceType() { |
| 7508 |
elementorModules.ForceMethodImplementation(); |
| 7509 |
} |
| 7510 |
}]); |
| 7511 |
return InstanceType; |
| 7512 |
}(); |
| 7513 |
|
| 7514 |
exports.default = InstanceType; |
| 7515 |
|
| 7516 |
/***/ }), |
| 7517 |
/* 253 */ |
| 7518 |
/***/ (function(module, exports, __webpack_require__) { |
| 7519 |
|
| 7520 |
module.exports = __webpack_require__(254); |
| 7521 |
|
| 7522 |
/***/ }), |
| 7523 |
/* 254 */ |
| 7524 |
/***/ (function(module, exports, __webpack_require__) { |
| 7525 |
|
| 7526 |
__webpack_require__(255); |
| 7527 |
module.exports = __webpack_require__(63).f('hasInstance'); |
| 7528 |
|
| 7529 |
|
| 7530 |
/***/ }), |
| 7531 |
/* 255 */ |
| 7532 |
/***/ (function(module, exports, __webpack_require__) { |
| 7533 |
|
| 7534 |
"use strict"; |
| 7535 |
|
| 7536 |
var isObject = __webpack_require__(9); |
| 7537 |
var getPrototypeOf = __webpack_require__(64); |
| 7538 |
var HAS_INSTANCE = __webpack_require__(10)('hasInstance'); |
| 7539 |
var FunctionProto = Function.prototype; |
| 7540 |
// 19.2.3.6 Function.prototype[@@hasInstance](V) |
| 7541 |
if (!(HAS_INSTANCE in FunctionProto)) __webpack_require__(15).f(FunctionProto, HAS_INSTANCE, { value: function (O) { |
| 7542 |
if (typeof this != 'function' || !isObject(O)) return false; |
| 7543 |
if (!isObject(this.prototype)) return O instanceof this; |
| 7544 |
// for environment w/o native `@@hasInstance` logic enough `instanceof`, but add this: |
| 7545 |
while (O = getPrototypeOf(O)) if (this.prototype === O) return true; |
| 7546 |
return false; |
| 7547 |
} }); |
| 7548 |
|
| 7549 |
|
| 7550 |
/***/ }), |
| 7551 |
/* 256 */ |
| 7552 |
/***/ (function(module, exports, __webpack_require__) { |
| 7553 |
|
| 7554 |
"use strict"; |
| 7555 |
|
| 7556 |
|
| 7557 |
var _interopRequireDefault = __webpack_require__(0); |
| 7558 |
|
| 7559 |
__webpack_require__(25); |
| 7560 |
|
| 7561 |
var _inline = _interopRequireDefault(__webpack_require__(373)); |
| 7562 |
|
| 7563 |
var BaseElementView = __webpack_require__(297); |
| 7564 |
|
| 7565 |
var DEFAULT_INNER_SECTION_COLUMNS = 2, |
| 7566 |
DEFAULT_MIN_COLUMN_SIZE = 2, |
| 7567 |
DEFAULT_MAX_COLUMNS = 10; |
| 7568 |
var SectionView = BaseElementView.extend({ |
| 7569 |
childViewContainer: function childViewContainer() { |
| 7570 |
return elementor.config.legacyMode.elementWrappers ? '> .elementor-container > .elementor-row' : '> .elementor-container'; |
| 7571 |
}, |
| 7572 |
template: Marionette.TemplateCache.get('#tmpl-elementor-section-content'), |
| 7573 |
addSectionView: null, |
| 7574 |
_checkIsFull: function _checkIsFull() { |
| 7575 |
this.toggleSectionIsFull(); |
| 7576 |
elementorCommon.helpers.softDeprecated('_checkIsFull', '2.9.0', 'toggleSectionIsFull()'); |
| 7577 |
}, |
| 7578 |
toggleSectionIsFull: function toggleSectionIsFull() { |
| 7579 |
this.$el.toggleClass('elementor-section-filled', this.isCollectionFilled()); |
| 7580 |
}, |
| 7581 |
addChildModel: function addChildModel(model) { |
| 7582 |
/// TODO: maybe should be part of $e.hooks. |
| 7583 |
var isModelInstance = model instanceof Backbone.Model, |
| 7584 |
isInner = this.isInner(); |
| 7585 |
|
| 7586 |
if (isModelInstance) { |
| 7587 |
// TODO: change to command. |
| 7588 |
model.set('isInner', isInner); |
| 7589 |
} else { |
| 7590 |
model.isInner = isInner; |
| 7591 |
} |
| 7592 |
|
| 7593 |
return BaseElementView.prototype.addChildModel.apply(this, arguments); |
| 7594 |
}, |
| 7595 |
className: function className() { |
| 7596 |
var classes = BaseElementView.prototype.className.apply(this, arguments), |
| 7597 |
type = this.isInner() ? 'inner' : 'top'; |
| 7598 |
return classes + ' elementor-section elementor-' + type + '-section'; |
| 7599 |
}, |
| 7600 |
tagName: function tagName() { |
| 7601 |
return this.model.getSetting('html_tag') || 'section'; |
| 7602 |
}, |
| 7603 |
behaviors: function behaviors() { |
| 7604 |
var behaviors = BaseElementView.prototype.behaviors.apply(this, arguments); |
| 7605 |
|
| 7606 |
_.extend(behaviors, { |
| 7607 |
Sortable: { |
| 7608 |
behaviorClass: __webpack_require__(298), |
| 7609 |
elChildType: 'column' |
| 7610 |
} |
| 7611 |
}); |
| 7612 |
|
| 7613 |
return elementor.hooks.applyFilters('elements/section/behaviors', behaviors, this); |
| 7614 |
}, |
| 7615 |
initialize: function initialize() { |
| 7616 |
BaseElementView.prototype.initialize.apply(this, arguments); |
| 7617 |
this.model.get('editSettings').set('defaultEditRoute', 'layout'); |
| 7618 |
}, |
| 7619 |
getEditButtons: function getEditButtons() { |
| 7620 |
var elementData = elementor.getElementData(this.model), |
| 7621 |
editTools = {}; |
| 7622 |
|
| 7623 |
if (!this.isInner()) { |
| 7624 |
editTools.add = { |
| 7625 |
title: elementor.translate('add_element', [elementData.title]), |
| 7626 |
icon: 'plus' |
| 7627 |
}; |
| 7628 |
} |
| 7629 |
|
| 7630 |
editTools.edit = { |
| 7631 |
title: elementor.translate('edit_element', [elementData.title]), |
| 7632 |
icon: 'handle' |
| 7633 |
}; |
| 7634 |
|
| 7635 |
if (elementor.getPreferences('edit_buttons')) { |
| 7636 |
editTools.duplicate = { |
| 7637 |
title: elementor.translate('duplicate_element', [elementData.title]), |
| 7638 |
icon: 'clone' |
| 7639 |
}; |
| 7640 |
} |
| 7641 |
|
| 7642 |
editTools.remove = { |
| 7643 |
title: elementor.translate('delete_element', [elementData.title]), |
| 7644 |
icon: 'close' |
| 7645 |
}; |
| 7646 |
return editTools; |
| 7647 |
}, |
| 7648 |
getContextMenuGroups: function getContextMenuGroups() { |
| 7649 |
var groups = BaseElementView.prototype.getContextMenuGroups.apply(this, arguments), |
| 7650 |
transferGroupIndex = groups.indexOf(_.findWhere(groups, { |
| 7651 |
name: 'clipboard' |
| 7652 |
})); |
| 7653 |
groups.splice(transferGroupIndex + 1, 0, { |
| 7654 |
name: 'save', |
| 7655 |
actions: [{ |
| 7656 |
name: 'save', |
| 7657 |
title: elementor.translate('save_as_block'), |
| 7658 |
callback: this.save.bind(this) |
| 7659 |
}] |
| 7660 |
}); |
| 7661 |
return groups; |
| 7662 |
}, |
| 7663 |
getSortableOptions: function getSortableOptions() { |
| 7664 |
var sectionConnectClass = this.isInner() ? '.elementor-inner-section' : '.elementor-top-section'; |
| 7665 |
return { |
| 7666 |
connectWith: sectionConnectClass + this.childViewContainer(), |
| 7667 |
handle: '> .elementor-element-overlay .elementor-editor-element-edit', |
| 7668 |
items: '> .elementor-column', |
| 7669 |
forcePlaceholderSize: true, |
| 7670 |
tolerance: 'pointer' |
| 7671 |
}; |
| 7672 |
}, |
| 7673 |
getColumnPercentSize: function getColumnPercentSize(element, size) { |
| 7674 |
return +(size / element.parent().width() * 100).toFixed(3); |
| 7675 |
}, |
| 7676 |
getDefaultStructure: function getDefaultStructure() { |
| 7677 |
return this.collection.length + '0'; |
| 7678 |
}, |
| 7679 |
getStructure: function getStructure() { |
| 7680 |
return this.model.getSetting('structure'); |
| 7681 |
}, |
| 7682 |
getColumnAt: function getColumnAt(index) { |
| 7683 |
var model = this.collection.at(index); |
| 7684 |
return model ? this.children.findByModelCid(model.cid) : null; |
| 7685 |
}, |
| 7686 |
getNextColumn: function getNextColumn(columnView) { |
| 7687 |
return this.getColumnAt(this.collection.indexOf(columnView.model) + 1); |
| 7688 |
}, |
| 7689 |
getPreviousColumn: function getPreviousColumn(columnView) { |
| 7690 |
return this.getColumnAt(this.collection.indexOf(columnView.model) - 1); |
| 7691 |
}, |
| 7692 |
getNeighborContainer: function getNeighborContainer(container) { |
| 7693 |
var parentView = container.parent.view, |
| 7694 |
nextView = parentView.getNextColumn(container.view) || parentView.getPreviousColumn(container.view); |
| 7695 |
|
| 7696 |
if (!nextView) { |
| 7697 |
return false; |
| 7698 |
} |
| 7699 |
|
| 7700 |
return nextView.getContainer(); |
| 7701 |
}, |
| 7702 |
setStructure: function setStructure(structure) { |
| 7703 |
var shouldAdjustColumns = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true; |
| 7704 |
var parsedStructure = elementor.presetsFactory.getParsedStructure(structure); |
| 7705 |
|
| 7706 |
if (+parsedStructure.columnsCount !== this.collection.length) { |
| 7707 |
throw new TypeError('The provided structure doesn\'t match the columns count.'); |
| 7708 |
} |
| 7709 |
|
| 7710 |
$e.run('document/elements/settings', { |
| 7711 |
container: this.getContainer(), |
| 7712 |
settings: { |
| 7713 |
structure: structure |
| 7714 |
}, |
| 7715 |
options: { |
| 7716 |
external: true |
| 7717 |
} |
| 7718 |
}); |
| 7719 |
|
| 7720 |
if (shouldAdjustColumns) { |
| 7721 |
this.adjustColumns(); |
| 7722 |
} |
| 7723 |
}, |
| 7724 |
adjustColumns: function adjustColumns() { |
| 7725 |
var preset = elementor.presetsFactory.getPresetByStructure(this.getStructure()); |
| 7726 |
this.children.each(function (columnView, index) { |
| 7727 |
var container = columnView.getContainer(); |
| 7728 |
$e.run('document/elements/settings', { |
| 7729 |
container: container, |
| 7730 |
settings: { |
| 7731 |
_column_size: preset.preset[index], |
| 7732 |
_inline_size: null |
| 7733 |
} |
| 7734 |
}); |
| 7735 |
}); |
| 7736 |
}, |
| 7737 |
resetLayout: function resetLayout() { |
| 7738 |
var shouldAdjustColumns = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true; |
| 7739 |
this.setStructure(this.getDefaultStructure(), shouldAdjustColumns); |
| 7740 |
}, |
| 7741 |
resetColumnsCustomSize: function resetColumnsCustomSize() { |
| 7742 |
this.children.each(function (columnView) { |
| 7743 |
$e.run('document/elements/settings', { |
| 7744 |
container: columnView.getContainer(), |
| 7745 |
settings: { |
| 7746 |
_inline_size: null |
| 7747 |
}, |
| 7748 |
options: { |
| 7749 |
external: true |
| 7750 |
} |
| 7751 |
}); |
| 7752 |
}); |
| 7753 |
}, |
| 7754 |
isCollectionFilled: function isCollectionFilled() { |
| 7755 |
return DEFAULT_MAX_COLUMNS <= this.collection.length; |
| 7756 |
}, |
| 7757 |
showChildrenPercentsTooltip: function showChildrenPercentsTooltip(columnView, nextColumnView) { |
| 7758 |
columnView.ui.percentsTooltip.show(); |
| 7759 |
columnView.ui.percentsTooltip.attr('data-side', elementorCommon.config.isRTL ? 'right' : 'left'); |
| 7760 |
nextColumnView.ui.percentsTooltip.show(); |
| 7761 |
nextColumnView.ui.percentsTooltip.attr('data-side', elementorCommon.config.isRTL ? 'left' : 'right'); |
| 7762 |
}, |
| 7763 |
hideChildrenPercentsTooltip: function hideChildrenPercentsTooltip(columnView, nextColumnView) { |
| 7764 |
columnView.ui.percentsTooltip.hide(); |
| 7765 |
nextColumnView.ui.percentsTooltip.hide(); |
| 7766 |
}, |
| 7767 |
destroyAddSectionView: function destroyAddSectionView() { |
| 7768 |
if (this.addSectionView && !this.addSectionView.isDestroyed) { |
| 7769 |
this.addSectionView.destroy(); |
| 7770 |
} |
| 7771 |
}, |
| 7772 |
onRender: function onRender() { |
| 7773 |
BaseElementView.prototype.onRender.apply(this, arguments); |
| 7774 |
this.toggleSectionIsFull(); |
| 7775 |
}, |
| 7776 |
onAddButtonClick: function onAddButtonClick() { |
| 7777 |
if (this.addSectionView && !this.addSectionView.isDestroyed) { |
| 7778 |
this.addSectionView.fadeToDeath(); |
| 7779 |
return; |
| 7780 |
} |
| 7781 |
|
| 7782 |
var addSectionView = new _inline.default({ |
| 7783 |
at: this.model.collection.indexOf(this.model) |
| 7784 |
}); |
| 7785 |
addSectionView.render(); |
| 7786 |
this.$el.before(addSectionView.$el); |
| 7787 |
addSectionView.$el.hide(); // Delaying the slide down for slow-render browsers (such as FF) |
| 7788 |
|
| 7789 |
setTimeout(function () { |
| 7790 |
addSectionView.$el.slideDown(null, function () { |
| 7791 |
// Remove inline style, for preview mode. |
| 7792 |
jQuery(this).css('display', ''); |
| 7793 |
}); |
| 7794 |
}); |
| 7795 |
this.addSectionView = addSectionView; |
| 7796 |
}, |
| 7797 |
onChildviewRequestResizeStart: function onChildviewRequestResizeStart(columnView) { |
| 7798 |
var nextColumnView = this.getNextColumn(columnView); |
| 7799 |
|
| 7800 |
if (!nextColumnView) { |
| 7801 |
return; |
| 7802 |
} |
| 7803 |
|
| 7804 |
this.showChildrenPercentsTooltip(columnView, nextColumnView); |
| 7805 |
var $iframes = columnView.$el.find('iframe').add(nextColumnView.$el.find('iframe')); |
| 7806 |
elementor.helpers.disableElementEvents($iframes); |
| 7807 |
}, |
| 7808 |
onChildviewRequestResizeStop: function onChildviewRequestResizeStop(columnView) { |
| 7809 |
var nextColumnView = this.getNextColumn(columnView); |
| 7810 |
|
| 7811 |
if (!nextColumnView) { |
| 7812 |
return; |
| 7813 |
} |
| 7814 |
|
| 7815 |
this.hideChildrenPercentsTooltip(columnView, nextColumnView); |
| 7816 |
var $iframes = columnView.$el.find('iframe').add(nextColumnView.$el.find('iframe')); |
| 7817 |
elementor.helpers.enableElementEvents($iframes); |
| 7818 |
}, |
| 7819 |
onChildviewRequestResize: function onChildviewRequestResize(columnView, ui) { |
| 7820 |
ui.element.css({ |
| 7821 |
width: '', |
| 7822 |
left: 'initial' // Fix for RTL resizing |
| 7823 |
|
| 7824 |
}); |
| 7825 |
$e.run('document/elements/settings', { |
| 7826 |
container: columnView.getContainer(), |
| 7827 |
settings: { |
| 7828 |
_inline_size: this.getColumnPercentSize(ui.element, ui.size.width) |
| 7829 |
} |
| 7830 |
}); |
| 7831 |
}, |
| 7832 |
onDestroy: function onDestroy() { |
| 7833 |
BaseElementView.prototype.onDestroy.apply(this, arguments); |
| 7834 |
this.destroyAddSectionView(); |
| 7835 |
} |
| 7836 |
}); |
| 7837 |
module.exports = SectionView; |
| 7838 |
module.exports.DEFAULT_INNER_SECTION_COLUMNS = DEFAULT_INNER_SECTION_COLUMNS; |
| 7839 |
module.exports.DEFAULT_MIN_COLUMN_SIZE = DEFAULT_MIN_COLUMN_SIZE; |
| 7840 |
module.exports.DEFAULT_MAX_COLUMNS = DEFAULT_MAX_COLUMNS; |
| 7841 |
|
| 7842 |
/***/ }), |
| 7843 |
/* 257 */ |
| 7844 |
/***/ (function(module, exports, __webpack_require__) { |
| 7845 |
|
| 7846 |
__webpack_require__(100); |
| 7847 |
__webpack_require__(60); |
| 7848 |
__webpack_require__(62); |
| 7849 |
__webpack_require__(258); |
| 7850 |
__webpack_require__(261); |
| 7851 |
__webpack_require__(262); |
| 7852 |
module.exports = __webpack_require__(6).Promise; |
| 7853 |
|
| 7854 |
|
| 7855 |
/***/ }), |
| 7856 |
/* 258 */ |
| 7857 |
/***/ (function(module, exports, __webpack_require__) { |
| 7858 |
|
| 7859 |
"use strict"; |
| 7860 |
|
| 7861 |
var LIBRARY = __webpack_require__(47); |
| 7862 |
var global = __webpack_require__(8); |
| 7863 |
var ctx = __webpack_require__(31); |
| 7864 |
var classof = __webpack_require__(101); |
| 7865 |
var $export = __webpack_require__(7); |
| 7866 |
var isObject = __webpack_require__(9); |
| 7867 |
var aFunction = __webpack_require__(38); |
| 7868 |
var anInstance = __webpack_require__(125); |
| 7869 |
var forOf = __webpack_require__(88); |
| 7870 |
var speciesConstructor = __webpack_require__(207); |
| 7871 |
var task = __webpack_require__(208).set; |
| 7872 |
var microtask = __webpack_require__(259)(); |
| 7873 |
var newPromiseCapabilityModule = __webpack_require__(146); |
| 7874 |
var perform = __webpack_require__(209); |
| 7875 |
var userAgent = __webpack_require__(260); |
| 7876 |
var promiseResolve = __webpack_require__(210); |
| 7877 |
var PROMISE = 'Promise'; |
| 7878 |
var TypeError = global.TypeError; |
| 7879 |
var process = global.process; |
| 7880 |
var versions = process && process.versions; |
| 7881 |
var v8 = versions && versions.v8 || ''; |
| 7882 |
var $Promise = global[PROMISE]; |
| 7883 |
var isNode = classof(process) == 'process'; |
| 7884 |
var empty = function () { /* empty */ }; |
| 7885 |
var Internal, newGenericPromiseCapability, OwnPromiseCapability, Wrapper; |
| 7886 |
var newPromiseCapability = newGenericPromiseCapability = newPromiseCapabilityModule.f; |
| 7887 |
|
| 7888 |
var USE_NATIVE = !!function () { |
| 7889 |
try { |
| 7890 |
// correct subclassing with @@species support |
| 7891 |
var promise = $Promise.resolve(1); |
| 7892 |
var FakePromise = (promise.constructor = {})[__webpack_require__(10)('species')] = function (exec) { |
| 7893 |
exec(empty, empty); |
| 7894 |
}; |
| 7895 |
// unhandled rejections tracking support, NodeJS Promise without it fails @@species test |
| 7896 |
return (isNode || typeof PromiseRejectionEvent == 'function') |
| 7897 |
&& promise.then(empty) instanceof FakePromise |
| 7898 |
// v8 6.6 (Node 10 and Chrome 66) have a bug with resolving custom thenables |
| 7899 |
// https://bugs.chromium.org/p/chromium/issues/detail?id=830565 |
| 7900 |
// we can't detect it synchronously, so just check versions |
| 7901 |
&& v8.indexOf('6.6') !== 0 |
| 7902 |
&& userAgent.indexOf('Chrome/66') === -1; |
| 7903 |
} catch (e) { /* empty */ } |
| 7904 |
}(); |
| 7905 |
|
| 7906 |
// helpers |
| 7907 |
var isThenable = function (it) { |
| 7908 |
var then; |
| 7909 |
return isObject(it) && typeof (then = it.then) == 'function' ? then : false; |
| 7910 |
}; |
| 7911 |
var notify = function (promise, isReject) { |
| 7912 |
if (promise._n) return; |
| 7913 |
promise._n = true; |
| 7914 |
var chain = promise._c; |
| 7915 |
microtask(function () { |
| 7916 |
var value = promise._v; |
| 7917 |
var ok = promise._s == 1; |
| 7918 |
var i = 0; |
| 7919 |
var run = function (reaction) { |
| 7920 |
var handler = ok ? reaction.ok : reaction.fail; |
| 7921 |
var resolve = reaction.resolve; |
| 7922 |
var reject = reaction.reject; |
| 7923 |
var domain = reaction.domain; |
| 7924 |
var result, then, exited; |
| 7925 |
try { |
| 7926 |
if (handler) { |
| 7927 |
if (!ok) { |
| 7928 |
if (promise._h == 2) onHandleUnhandled(promise); |
| 7929 |
promise._h = 1; |
| 7930 |
} |
| 7931 |
if (handler === true) result = value; |
| 7932 |
else { |
| 7933 |
if (domain) domain.enter(); |
| 7934 |
result = handler(value); // may throw |
| 7935 |
if (domain) { |
| 7936 |
domain.exit(); |
| 7937 |
exited = true; |
| 7938 |
} |
| 7939 |
} |
| 7940 |
if (result === reaction.promise) { |
| 7941 |
reject(TypeError('Promise-chain cycle')); |
| 7942 |
} else if (then = isThenable(result)) { |
| 7943 |
then.call(result, resolve, reject); |
| 7944 |
} else resolve(result); |
| 7945 |
} else reject(value); |
| 7946 |
} catch (e) { |
| 7947 |
if (domain && !exited) domain.exit(); |
| 7948 |
reject(e); |
| 7949 |
} |
| 7950 |
}; |
| 7951 |
while (chain.length > i) run(chain[i++]); // variable length - can't use forEach |
| 7952 |
promise._c = []; |
| 7953 |
promise._n = false; |
| 7954 |
if (isReject && !promise._h) onUnhandled(promise); |
| 7955 |
}); |
| 7956 |
}; |
| 7957 |
var onUnhandled = function (promise) { |
| 7958 |
task.call(global, function () { |
| 7959 |
var value = promise._v; |
| 7960 |
var unhandled = isUnhandled(promise); |
| 7961 |
var result, handler, console; |
| 7962 |
if (unhandled) { |
| 7963 |
result = perform(function () { |
| 7964 |
if (isNode) { |
| 7965 |
process.emit('unhandledRejection', value, promise); |
| 7966 |
} else if (handler = global.onunhandledrejection) { |
| 7967 |
handler({ promise: promise, reason: value }); |
| 7968 |
} else if ((console = global.console) && console.error) { |
| 7969 |
console.error('Unhandled promise rejection', value); |
| 7970 |
} |
| 7971 |
}); |
| 7972 |
// Browsers should not trigger `rejectionHandled` event if it was handled here, NodeJS - should |
| 7973 |
promise._h = isNode || isUnhandled(promise) ? 2 : 1; |
| 7974 |
} promise._a = undefined; |
| 7975 |
if (unhandled && result.e) throw result.v; |
| 7976 |
}); |
| 7977 |
}; |
| 7978 |
var isUnhandled = function (promise) { |
| 7979 |
return promise._h !== 1 && (promise._a || promise._c).length === 0; |
| 7980 |
}; |
| 7981 |
var onHandleUnhandled = function (promise) { |
| 7982 |
task.call(global, function () { |
| 7983 |
var handler; |
| 7984 |
if (isNode) { |
| 7985 |
process.emit('rejectionHandled', promise); |
| 7986 |
} else if (handler = global.onrejectionhandled) { |
| 7987 |
handler({ promise: promise, reason: promise._v }); |
| 7988 |
} |
| 7989 |
}); |
| 7990 |
}; |
| 7991 |
var $reject = function (value) { |
| 7992 |
var promise = this; |
| 7993 |
if (promise._d) return; |
| 7994 |
promise._d = true; |
| 7995 |
promise = promise._w || promise; // unwrap |
| 7996 |
promise._v = value; |
| 7997 |
promise._s = 2; |
| 7998 |
if (!promise._a) promise._a = promise._c.slice(); |
| 7999 |
notify(promise, true); |
| 8000 |
}; |
| 8001 |
var $resolve = function (value) { |
| 8002 |
var promise = this; |
| 8003 |
var then; |
| 8004 |
if (promise._d) return; |
| 8005 |
promise._d = true; |
| 8006 |
promise = promise._w || promise; // unwrap |
| 8007 |
try { |
| 8008 |
if (promise === value) throw TypeError("Promise can't be resolved itself"); |
| 8009 |
if (then = isThenable(value)) { |
| 8010 |
microtask(function () { |
| 8011 |
var wrapper = { _w: promise, _d: false }; // wrap |
| 8012 |
try { |
| 8013 |
then.call(value, ctx($resolve, wrapper, 1), ctx($reject, wrapper, 1)); |
| 8014 |
} catch (e) { |
| 8015 |
$reject.call(wrapper, e); |
| 8016 |
} |
| 8017 |
}); |
| 8018 |
} else { |
| 8019 |
promise._v = value; |
| 8020 |
promise._s = 1; |
| 8021 |
notify(promise, false); |
| 8022 |
} |
| 8023 |
} catch (e) { |
| 8024 |
$reject.call({ _w: promise, _d: false }, e); // wrap |
| 8025 |
} |
| 8026 |
}; |
| 8027 |
|
| 8028 |
// constructor polyfill |
| 8029 |
if (!USE_NATIVE) { |
| 8030 |
// 25.4.3.1 Promise(executor) |
| 8031 |
$Promise = function Promise(executor) { |
| 8032 |
anInstance(this, $Promise, PROMISE, '_h'); |
| 8033 |
aFunction(executor); |
| 8034 |
Internal.call(this); |
| 8035 |
try { |
| 8036 |
executor(ctx($resolve, this, 1), ctx($reject, this, 1)); |
| 8037 |
} catch (err) { |
| 8038 |
$reject.call(this, err); |
| 8039 |
} |
| 8040 |
}; |
| 8041 |
// eslint-disable-next-line no-unused-vars |
| 8042 |
Internal = function Promise(executor) { |
| 8043 |
this._c = []; // <- awaiting reactions |
| 8044 |
this._a = undefined; // <- checked in isUnhandled reactions |
| 8045 |
this._s = 0; // <- state |
| 8046 |
this._d = false; // <- done |
| 8047 |
this._v = undefined; // <- value |
| 8048 |
this._h = 0; // <- rejection state, 0 - default, 1 - handled, 2 - unhandled |
| 8049 |
this._n = false; // <- notify |
| 8050 |
}; |
| 8051 |
Internal.prototype = __webpack_require__(126)($Promise.prototype, { |
| 8052 |
// 25.4.5.3 Promise.prototype.then(onFulfilled, onRejected) |
| 8053 |
then: function then(onFulfilled, onRejected) { |
| 8054 |
var reaction = newPromiseCapability(speciesConstructor(this, $Promise)); |
| 8055 |
reaction.ok = typeof onFulfilled == 'function' ? onFulfilled : true; |
| 8056 |
reaction.fail = typeof onRejected == 'function' && onRejected; |
| 8057 |
reaction.domain = isNode ? process.domain : undefined; |
| 8058 |
this._c.push(reaction); |
| 8059 |
if (this._a) this._a.push(reaction); |
| 8060 |
if (this._s) notify(this, false); |
| 8061 |
return reaction.promise; |
| 8062 |
}, |
| 8063 |
// 25.4.5.1 Promise.prototype.catch(onRejected) |
| 8064 |
'catch': function (onRejected) { |
| 8065 |
return this.then(undefined, onRejected); |
| 8066 |
} |
| 8067 |
}); |
| 8068 |
OwnPromiseCapability = function () { |
| 8069 |
var promise = new Internal(); |
| 8070 |
this.promise = promise; |
| 8071 |
this.resolve = ctx($resolve, promise, 1); |
| 8072 |
this.reject = ctx($reject, promise, 1); |
| 8073 |
}; |
| 8074 |
newPromiseCapabilityModule.f = newPromiseCapability = function (C) { |
| 8075 |
return C === $Promise || C === Wrapper |
| 8076 |
? new OwnPromiseCapability(C) |
| 8077 |
: newGenericPromiseCapability(C); |
| 8078 |
}; |
| 8079 |
} |
| 8080 |
|
| 8081 |
$export($export.G + $export.W + $export.F * !USE_NATIVE, { Promise: $Promise }); |
| 8082 |
__webpack_require__(53)($Promise, PROMISE); |
| 8083 |
__webpack_require__(225)(PROMISE); |
| 8084 |
Wrapper = __webpack_require__(6)[PROMISE]; |
| 8085 |
|
| 8086 |
// statics |
| 8087 |
$export($export.S + $export.F * !USE_NATIVE, PROMISE, { |
| 8088 |
// 25.4.4.5 Promise.reject(r) |
| 8089 |
reject: function reject(r) { |
| 8090 |
var capability = newPromiseCapability(this); |
| 8091 |
var $$reject = capability.reject; |
| 8092 |
$$reject(r); |
| 8093 |
return capability.promise; |
| 8094 |
} |
| 8095 |
}); |
| 8096 |
$export($export.S + $export.F * (LIBRARY || !USE_NATIVE), PROMISE, { |
| 8097 |
// 25.4.4.6 Promise.resolve(x) |
| 8098 |
resolve: function resolve(x) { |
| 8099 |
return promiseResolve(LIBRARY && this === Wrapper ? $Promise : this, x); |
| 8100 |
} |
| 8101 |
}); |
| 8102 |
$export($export.S + $export.F * !(USE_NATIVE && __webpack_require__(152)(function (iter) { |
| 8103 |
$Promise.all(iter)['catch'](empty); |
| 8104 |
})), PROMISE, { |
| 8105 |
// 25.4.4.1 Promise.all(iterable) |
| 8106 |
all: function all(iterable) { |
| 8107 |
var C = this; |
| 8108 |
var capability = newPromiseCapability(C); |
| 8109 |
var resolve = capability.resolve; |
| 8110 |
var reject = capability.reject; |
| 8111 |
var result = perform(function () { |
| 8112 |
var values = []; |
| 8113 |
var index = 0; |
| 8114 |
var remaining = 1; |
| 8115 |
forOf(iterable, false, function (promise) { |
| 8116 |
var $index = index++; |
| 8117 |
var alreadyCalled = false; |
| 8118 |
values.push(undefined); |
| 8119 |
remaining++; |
| 8120 |
C.resolve(promise).then(function (value) { |
| 8121 |
if (alreadyCalled) return; |
| 8122 |
alreadyCalled = true; |
| 8123 |
values[$index] = value; |
| 8124 |
--remaining || resolve(values); |
| 8125 |
}, reject); |
| 8126 |
}); |
| 8127 |
--remaining || resolve(values); |
| 8128 |
}); |
| 8129 |
if (result.e) reject(result.v); |
| 8130 |
return capability.promise; |
| 8131 |
}, |
| 8132 |
// 25.4.4.4 Promise.race(iterable) |
| 8133 |
race: function race(iterable) { |
| 8134 |
var C = this; |
| 8135 |
var capability = newPromiseCapability(C); |
| 8136 |
var reject = capability.reject; |
| 8137 |
var result = perform(function () { |
| 8138 |
forOf(iterable, false, function (promise) { |
| 8139 |
C.resolve(promise).then(capability.resolve, reject); |
| 8140 |
}); |
| 8141 |
}); |
| 8142 |
if (result.e) reject(result.v); |
| 8143 |
return capability.promise; |
| 8144 |
} |
| 8145 |
}); |
| 8146 |
|
| 8147 |
|
| 8148 |
/***/ }), |
| 8149 |
/* 259 */ |
| 8150 |
/***/ (function(module, exports, __webpack_require__) { |
| 8151 |
|
| 8152 |
var global = __webpack_require__(8); |
| 8153 |
var macrotask = __webpack_require__(208).set; |
| 8154 |
var Observer = global.MutationObserver || global.WebKitMutationObserver; |
| 8155 |
var process = global.process; |
| 8156 |
var Promise = global.Promise; |
| 8157 |
var isNode = __webpack_require__(56)(process) == 'process'; |
| 8158 |
|
| 8159 |
module.exports = function () { |
| 8160 |
var head, last, notify; |
| 8161 |
|
| 8162 |
var flush = function () { |
| 8163 |
var parent, fn; |
| 8164 |
if (isNode && (parent = process.domain)) parent.exit(); |
| 8165 |
while (head) { |
| 8166 |
fn = head.fn; |
| 8167 |
head = head.next; |
| 8168 |
try { |
| 8169 |
fn(); |
| 8170 |
} catch (e) { |
| 8171 |
if (head) notify(); |
| 8172 |
else last = undefined; |
| 8173 |
throw e; |
| 8174 |
} |
| 8175 |
} last = undefined; |
| 8176 |
if (parent) parent.enter(); |
| 8177 |
}; |
| 8178 |
|
| 8179 |
// Node.js |
| 8180 |
if (isNode) { |
| 8181 |
notify = function () { |
| 8182 |
process.nextTick(flush); |
| 8183 |
}; |
| 8184 |
// browsers with MutationObserver, except iOS Safari - https://github.com/zloirock/core-js/issues/339 |
| 8185 |
} else if (Observer && !(global.navigator && global.navigator.standalone)) { |
| 8186 |
var toggle = true; |
| 8187 |
var node = document.createTextNode(''); |
| 8188 |
new Observer(flush).observe(node, { characterData: true }); // eslint-disable-line no-new |
| 8189 |
notify = function () { |
| 8190 |
node.data = toggle = !toggle; |
| 8191 |
}; |
| 8192 |
// environments with maybe non-completely correct, but existent Promise |
| 8193 |
} else if (Promise && Promise.resolve) { |
| 8194 |
// Promise.resolve without an argument throws an error in LG WebOS 2 |
| 8195 |
var promise = Promise.resolve(undefined); |
| 8196 |
notify = function () { |
| 8197 |
promise.then(flush); |
| 8198 |
}; |
| 8199 |
// for other environments - macrotask based on: |
| 8200 |
// - setImmediate |
| 8201 |
// - MessageChannel |
| 8202 |
// - window.postMessag |
| 8203 |
// - onreadystatechange |
| 8204 |
// - setTimeout |
| 8205 |
} else { |
| 8206 |
notify = function () { |
| 8207 |
// strange IE + webpack dev server bug - use .call(global) |
| 8208 |
macrotask.call(global, flush); |
| 8209 |
}; |
| 8210 |
} |
| 8211 |
|
| 8212 |
return function (fn) { |
| 8213 |
var task = { fn: fn, next: undefined }; |
| 8214 |
if (last) last.next = task; |
| 8215 |
if (!head) { |
| 8216 |
head = task; |
| 8217 |
notify(); |
| 8218 |
} last = task; |
| 8219 |
}; |
| 8220 |
}; |
| 8221 |
|
| 8222 |
|
| 8223 |
/***/ }), |
| 8224 |
/* 260 */ |
| 8225 |
/***/ (function(module, exports, __webpack_require__) { |
| 8226 |
|
| 8227 |
var global = __webpack_require__(8); |
| 8228 |
var navigator = global.navigator; |
| 8229 |
|
| 8230 |
module.exports = navigator && navigator.userAgent || ''; |
| 8231 |
|
| 8232 |
|
| 8233 |
/***/ }), |
| 8234 |
/* 261 */ |
| 8235 |
/***/ (function(module, exports, __webpack_require__) { |
| 8236 |
|
| 8237 |
"use strict"; |
| 8238 |
// https://github.com/tc39/proposal-promise-finally |
| 8239 |
|
| 8240 |
var $export = __webpack_require__(7); |
| 8241 |
var core = __webpack_require__(6); |
| 8242 |
var global = __webpack_require__(8); |
| 8243 |
var speciesConstructor = __webpack_require__(207); |
| 8244 |
var promiseResolve = __webpack_require__(210); |
| 8245 |
|
| 8246 |
$export($export.P + $export.R, 'Promise', { 'finally': function (onFinally) { |
| 8247 |
var C = speciesConstructor(this, core.Promise || global.Promise); |
| 8248 |
var isFunction = typeof onFinally == 'function'; |
| 8249 |
return this.then( |
| 8250 |
isFunction ? function (x) { |
| 8251 |
return promiseResolve(C, onFinally()).then(function () { return x; }); |
| 8252 |
} : onFinally, |
| 8253 |
isFunction ? function (e) { |
| 8254 |
return promiseResolve(C, onFinally()).then(function () { throw e; }); |
| 8255 |
} : onFinally |
| 8256 |
); |
| 8257 |
} }); |
| 8258 |
|
| 8259 |
|
| 8260 |
/***/ }), |
| 8261 |
/* 262 */ |
| 8262 |
/***/ (function(module, exports, __webpack_require__) { |
| 8263 |
|
| 8264 |
"use strict"; |
| 8265 |
|
| 8266 |
// https://github.com/tc39/proposal-promise-try |
| 8267 |
var $export = __webpack_require__(7); |
| 8268 |
var newPromiseCapability = __webpack_require__(146); |
| 8269 |
var perform = __webpack_require__(209); |
| 8270 |
|
| 8271 |
$export($export.S, 'Promise', { 'try': function (callbackfn) { |
| 8272 |
var promiseCapability = newPromiseCapability.f(this); |
| 8273 |
var result = perform(callbackfn); |
| 8274 |
(result.e ? promiseCapability.reject : promiseCapability.resolve)(result.v); |
| 8275 |
return promiseCapability.promise; |
| 8276 |
} }); |
| 8277 |
|
| 8278 |
|
| 8279 |
/***/ }), |
| 8280 |
/* 263 */ |
| 8281 |
/***/ (function(module, exports, __webpack_require__) { |
| 8282 |
|
| 8283 |
module.exports = __webpack_require__(264); |
| 8284 |
|
| 8285 |
/***/ }), |
| 8286 |
/* 264 */ |
| 8287 |
/***/ (function(module, exports, __webpack_require__) { |
| 8288 |
|
| 8289 |
__webpack_require__(100); |
| 8290 |
__webpack_require__(62); |
| 8291 |
__webpack_require__(265); |
| 8292 |
__webpack_require__(267); |
| 8293 |
__webpack_require__(268); |
| 8294 |
module.exports = __webpack_require__(6).WeakMap; |
| 8295 |
|
| 8296 |
|
| 8297 |
/***/ }), |
| 8298 |
/* 265 */ |
| 8299 |
/***/ (function(module, exports, __webpack_require__) { |
| 8300 |
|
| 8301 |
"use strict"; |
| 8302 |
|
| 8303 |
var global = __webpack_require__(8); |
| 8304 |
var each = __webpack_require__(138)(0); |
| 8305 |
var redefine = __webpack_require__(93); |
| 8306 |
var meta = __webpack_require__(70); |
| 8307 |
var assign = __webpack_require__(212); |
| 8308 |
var weak = __webpack_require__(266); |
| 8309 |
var isObject = __webpack_require__(9); |
| 8310 |
var validate = __webpack_require__(121); |
| 8311 |
var NATIVE_WEAK_MAP = __webpack_require__(121); |
| 8312 |
var IS_IE11 = !global.ActiveXObject && 'ActiveXObject' in global; |
| 8313 |
var WEAK_MAP = 'WeakMap'; |
| 8314 |
var getWeak = meta.getWeak; |
| 8315 |
var isExtensible = Object.isExtensible; |
| 8316 |
var uncaughtFrozenStore = weak.ufstore; |
| 8317 |
var InternalMap; |
| 8318 |
|
| 8319 |
var wrapper = function (get) { |
| 8320 |
return function WeakMap() { |
| 8321 |
return get(this, arguments.length > 0 ? arguments[0] : undefined); |
| 8322 |
}; |
| 8323 |
}; |
| 8324 |
|
| 8325 |
var methods = { |
| 8326 |
// 23.3.3.3 WeakMap.prototype.get(key) |
| 8327 |
get: function get(key) { |
| 8328 |
if (isObject(key)) { |
| 8329 |
var data = getWeak(key); |
| 8330 |
if (data === true) return uncaughtFrozenStore(validate(this, WEAK_MAP)).get(key); |
| 8331 |
return data ? data[this._i] : undefined; |
| 8332 |
} |
| 8333 |
}, |
| 8334 |
// 23.3.3.5 WeakMap.prototype.set(key, value) |
| 8335 |
set: function set(key, value) { |
| 8336 |
return weak.def(validate(this, WEAK_MAP), key, value); |
| 8337 |
} |
| 8338 |
}; |
| 8339 |
|
| 8340 |
// 23.3 WeakMap Objects |
| 8341 |
var $WeakMap = module.exports = __webpack_require__(232)(WEAK_MAP, wrapper, methods, weak, true, true); |
| 8342 |
|
| 8343 |
// IE11 WeakMap frozen keys fix |
| 8344 |
if (NATIVE_WEAK_MAP && IS_IE11) { |
| 8345 |
InternalMap = weak.getConstructor(wrapper, WEAK_MAP); |
| 8346 |
assign(InternalMap.prototype, methods); |
| 8347 |
meta.NEED = true; |
| 8348 |
each(['delete', 'has', 'get', 'set'], function (key) { |
| 8349 |
var proto = $WeakMap.prototype; |
| 8350 |
var method = proto[key]; |
| 8351 |
redefine(proto, key, function (a, b) { |
| 8352 |
// store frozen objects on internal weakmap shim |
| 8353 |
if (isObject(a) && !isExtensible(a)) { |
| 8354 |
if (!this._f) this._f = new InternalMap(); |
| 8355 |
var result = this._f[key](a, b); |
| 8356 |
return key == 'set' ? this : result; |
| 8357 |
// store all the rest on native weakmap |
| 8358 |
} return method.call(this, a, b); |
| 8359 |
}); |
| 8360 |
}); |
| 8361 |
} |
| 8362 |
|
| 8363 |
|
| 8364 |
/***/ }), |
| 8365 |
/* 266 */ |
| 8366 |
/***/ (function(module, exports, __webpack_require__) { |
| 8367 |
|
| 8368 |
"use strict"; |
| 8369 |
|
| 8370 |
var redefineAll = __webpack_require__(126); |
| 8371 |
var getWeak = __webpack_require__(70).getWeak; |
| 8372 |
var anObject = __webpack_require__(13); |
| 8373 |
var isObject = __webpack_require__(9); |
| 8374 |
var anInstance = __webpack_require__(125); |
| 8375 |
var forOf = __webpack_require__(88); |
| 8376 |
var createArrayMethod = __webpack_require__(138); |
| 8377 |
var $has = __webpack_require__(19); |
| 8378 |
var validate = __webpack_require__(121); |
| 8379 |
var arrayFind = createArrayMethod(5); |
| 8380 |
var arrayFindIndex = createArrayMethod(6); |
| 8381 |
var id = 0; |
| 8382 |
|
| 8383 |
// fallback for uncaught frozen keys |
| 8384 |
var uncaughtFrozenStore = function (that) { |
| 8385 |
return that._l || (that._l = new UncaughtFrozenStore()); |
| 8386 |
}; |
| 8387 |
var UncaughtFrozenStore = function () { |
| 8388 |
this.a = []; |
| 8389 |
}; |
| 8390 |
var findUncaughtFrozen = function (store, key) { |
| 8391 |
return arrayFind(store.a, function (it) { |
| 8392 |
return it[0] === key; |
| 8393 |
}); |
| 8394 |
}; |
| 8395 |
UncaughtFrozenStore.prototype = { |
| 8396 |
get: function (key) { |
| 8397 |
var entry = findUncaughtFrozen(this, key); |
| 8398 |
if (entry) return entry[1]; |
| 8399 |
}, |
| 8400 |
has: function (key) { |
| 8401 |
return !!findUncaughtFrozen(this, key); |
| 8402 |
}, |
| 8403 |
set: function (key, value) { |
| 8404 |
var entry = findUncaughtFrozen(this, key); |
| 8405 |
if (entry) entry[1] = value; |
| 8406 |
else this.a.push([key, value]); |
| 8407 |
}, |
| 8408 |
'delete': function (key) { |
| 8409 |
var index = arrayFindIndex(this.a, function (it) { |
| 8410 |
return it[0] === key; |
| 8411 |
}); |
| 8412 |
if (~index) this.a.splice(index, 1); |
| 8413 |
return !!~index; |
| 8414 |
} |
| 8415 |
}; |
| 8416 |
|
| 8417 |
module.exports = { |
| 8418 |
getConstructor: function (wrapper, NAME, IS_MAP, ADDER) { |
| 8419 |
var C = wrapper(function (that, iterable) { |
| 8420 |
anInstance(that, C, NAME, '_i'); |
| 8421 |
that._t = NAME; // collection type |
| 8422 |
that._i = id++; // collection id |
| 8423 |
that._l = undefined; // leak store for uncaught frozen objects |
| 8424 |
if (iterable != undefined) forOf(iterable, IS_MAP, that[ADDER], that); |
| 8425 |
}); |
| 8426 |
redefineAll(C.prototype, { |
| 8427 |
// 23.3.3.2 WeakMap.prototype.delete(key) |
| 8428 |
// 23.4.3.3 WeakSet.prototype.delete(value) |
| 8429 |
'delete': function (key) { |
| 8430 |
if (!isObject(key)) return false; |
| 8431 |
var data = getWeak(key); |
| 8432 |
if (data === true) return uncaughtFrozenStore(validate(this, NAME))['delete'](key); |
| 8433 |
return data && $has(data, this._i) && delete data[this._i]; |
| 8434 |
}, |
| 8435 |
// 23.3.3.4 WeakMap.prototype.has(key) |
| 8436 |
// 23.4.3.4 WeakSet.prototype.has(value) |
| 8437 |
has: function has(key) { |
| 8438 |
if (!isObject(key)) return false; |
| 8439 |
var data = getWeak(key); |
| 8440 |
if (data === true) return uncaughtFrozenStore(validate(this, NAME)).has(key); |
| 8441 |
return data && $has(data, this._i); |
| 8442 |
} |
| 8443 |
}); |
| 8444 |
return C; |
| 8445 |
}, |
| 8446 |
def: function (that, key, value) { |
| 8447 |
var data = getWeak(anObject(key), true); |
| 8448 |
if (data === true) uncaughtFrozenStore(that).set(key, value); |
| 8449 |
else data[that._i] = value; |
| 8450 |
return that; |
| 8451 |
}, |
| 8452 |
ufstore: uncaughtFrozenStore |
| 8453 |
}; |
| 8454 |
|
| 8455 |
|
| 8456 |
/***/ }), |
| 8457 |
/* 267 */ |
| 8458 |
/***/ (function(module, exports, __webpack_require__) { |
| 8459 |
|
| 8460 |
// https://tc39.github.io/proposal-setmap-offrom/#sec-weakmap.of |
| 8461 |
__webpack_require__(233)('WeakMap'); |
| 8462 |
|
| 8463 |
|
| 8464 |
/***/ }), |
| 8465 |
/* 268 */ |
| 8466 |
/***/ (function(module, exports, __webpack_require__) { |
| 8467 |
|
| 8468 |
// https://tc39.github.io/proposal-setmap-offrom/#sec-weakmap.from |
| 8469 |
__webpack_require__(234)('WeakMap'); |
| 8470 |
|
| 8471 |
|
| 8472 |
/***/ }), |
| 8473 |
/* 269 */ |
| 8474 |
/***/ (function(module, exports, __webpack_require__) { |
| 8475 |
|
| 8476 |
__webpack_require__(270); |
| 8477 |
module.exports = __webpack_require__(6).Object.entries; |
| 8478 |
|
| 8479 |
|
| 8480 |
/***/ }), |
| 8481 |
/* 270 */ |
| 8482 |
/***/ (function(module, exports, __webpack_require__) { |
| 8483 |
|
| 8484 |
// https://github.com/tc39/proposal-object-values-entries |
| 8485 |
var $export = __webpack_require__(7); |
| 8486 |
var $entries = __webpack_require__(185)(true); |
| 8487 |
|
| 8488 |
$export($export.S, 'Object', { |
| 8489 |
entries: function entries(it) { |
| 8490 |
return $entries(it); |
| 8491 |
} |
| 8492 |
}); |
| 8493 |
|
| 8494 |
|
| 8495 |
/***/ }), |
| 8496 |
/* 271 */ |
| 8497 |
/***/ (function(module, exports, __webpack_require__) { |
| 8498 |
|
| 8499 |
"use strict"; |
| 8500 |
|
| 8501 |
var $at = __webpack_require__(144)(true); |
| 8502 |
|
| 8503 |
// 21.1.3.27 String.prototype[@@iterator]() |
| 8504 |
__webpack_require__(197)(String, 'String', function (iterated) { |
| 8505 |
this._t = String(iterated); // target |
| 8506 |
this._i = 0; // next index |
| 8507 |
// 21.1.5.2.1 %StringIteratorPrototype%.next() |
| 8508 |
}, function () { |
| 8509 |
var O = this._t; |
| 8510 |
var index = this._i; |
| 8511 |
var point; |
| 8512 |
if (index >= O.length) return { value: undefined, done: true }; |
| 8513 |
point = $at(O, index); |
| 8514 |
this._i += point.length; |
| 8515 |
return { value: point, done: false }; |
| 8516 |
}); |
| 8517 |
|
| 8518 |
|
| 8519 |
/***/ }), |
| 8520 |
/* 272 */ |
| 8521 |
/***/ (function(module, exports, __webpack_require__) { |
| 8522 |
|
| 8523 |
"use strict"; |
| 8524 |
|
| 8525 |
|
| 8526 |
var _Object$defineProperty = __webpack_require__(1); |
| 8527 |
|
| 8528 |
_Object$defineProperty(exports, "__esModule", { |
| 8529 |
value: true |
| 8530 |
}); |
| 8531 |
|
| 8532 |
exports.default = void 0; |
| 8533 |
var userAgent = navigator.userAgent; |
| 8534 |
var _default = { |
| 8535 |
webkit: -1 !== userAgent.indexOf('AppleWebKit'), |
| 8536 |
firefox: -1 !== userAgent.indexOf('Firefox'), |
| 8537 |
ie: /Trident|MSIE/.test(userAgent), |
| 8538 |
edge: -1 !== userAgent.indexOf('Edge'), |
| 8539 |
mac: -1 !== userAgent.indexOf('Macintosh'), |
| 8540 |
safari: /^((?!chrome|android).)*safari/i.test(userAgent) |
| 8541 |
}; |
| 8542 |
exports.default = _default; |
| 8543 |
|
| 8544 |
/***/ }), |
| 8545 |
/* 273 */ |
| 8546 |
/***/ (function(module, exports, __webpack_require__) { |
| 8547 |
|
| 8548 |
"use strict"; |
| 8549 |
|
| 8550 |
|
| 8551 |
var _interopRequireDefault = __webpack_require__(0); |
| 8552 |
|
| 8553 |
var _base = _interopRequireDefault(__webpack_require__(296)); |
| 8554 |
|
| 8555 |
var ContextMenu = __webpack_require__(372); |
| 8556 |
|
| 8557 |
module.exports = Marionette.Behavior.extend({ |
| 8558 |
defaults: { |
| 8559 |
groups: [], |
| 8560 |
eventTargets: ['el'] |
| 8561 |
}, |
| 8562 |
events: function events() { |
| 8563 |
var events = {}; |
| 8564 |
this.getOption('eventTargets').forEach(function (eventTarget) { |
| 8565 |
var eventName = 'contextmenu'; |
| 8566 |
|
| 8567 |
if ('el' !== eventTarget) { |
| 8568 |
eventName += ' ' + eventTarget; |
| 8569 |
} |
| 8570 |
|
| 8571 |
events[eventName] = 'onContextMenu'; |
| 8572 |
}); |
| 8573 |
return events; |
| 8574 |
}, |
| 8575 |
initialize: function initialize() { |
| 8576 |
this.listenTo(this.view.options.model, 'request:contextmenu', this.onRequestContextMenu); |
| 8577 |
}, |
| 8578 |
initContextMenu: function initContextMenu() { |
| 8579 |
var _this = this; |
| 8580 |
|
| 8581 |
var contextMenuGroups = this.getOption('groups'), |
| 8582 |
deleteGroup = _.findWhere(contextMenuGroups, { |
| 8583 |
name: 'delete' |
| 8584 |
}), |
| 8585 |
afterGroupIndex = contextMenuGroups.indexOf(deleteGroup); |
| 8586 |
|
| 8587 |
if (-1 === afterGroupIndex) { |
| 8588 |
afterGroupIndex = contextMenuGroups.length; |
| 8589 |
} |
| 8590 |
|
| 8591 |
contextMenuGroups.splice(afterGroupIndex, 0, { |
| 8592 |
name: 'tools', |
| 8593 |
actions: [{ |
| 8594 |
name: 'navigator', |
| 8595 |
title: elementor.translate('navigator'), |
| 8596 |
callback: function callback() { |
| 8597 |
return $e.route('navigator', { |
| 8598 |
reOpen: true, |
| 8599 |
model: _this.view.model |
| 8600 |
}); |
| 8601 |
} |
| 8602 |
}] |
| 8603 |
}); |
| 8604 |
this.contextMenu = new ContextMenu({ |
| 8605 |
groups: contextMenuGroups |
| 8606 |
}); |
| 8607 |
this.contextMenu.getModal().on('hide', this.onContextMenuHide); |
| 8608 |
}, |
| 8609 |
getContextMenu: function getContextMenu() { |
| 8610 |
if (!this.contextMenu) { |
| 8611 |
this.initContextMenu(); |
| 8612 |
} |
| 8613 |
|
| 8614 |
return this.contextMenu; |
| 8615 |
}, |
| 8616 |
onContextMenu: function onContextMenu(event) { |
| 8617 |
if ($e.shortcuts.isControlEvent(event)) { |
| 8618 |
return; |
| 8619 |
} |
| 8620 |
|
| 8621 |
var isAddSectionView = this.view instanceof _base.default; |
| 8622 |
|
| 8623 |
if (!isAddSectionView && (!this.view.container || !this.view.container.isDesignable())) { |
| 8624 |
return; |
| 8625 |
} |
| 8626 |
|
| 8627 |
event.preventDefault(); |
| 8628 |
event.stopPropagation(); |
| 8629 |
this.getContextMenu().show(event); |
| 8630 |
elementor.channels.editor.reply('contextMenu:targetView', this.view); |
| 8631 |
}, |
| 8632 |
onRequestContextMenu: function onRequestContextMenu(event) { |
| 8633 |
var modal = this.getContextMenu().getModal(), |
| 8634 |
iframe = modal.getSettings('iframe'), |
| 8635 |
toolsGroup = _.findWhere(this.contextMenu.getSettings('groups'), { |
| 8636 |
name: 'tools' |
| 8637 |
}); |
| 8638 |
|
| 8639 |
toolsGroup.isVisible = false; |
| 8640 |
modal.setSettings('iframe', null); |
| 8641 |
this.onContextMenu(event); |
| 8642 |
toolsGroup.isVisible = true; |
| 8643 |
modal.setSettings('iframe', iframe); |
| 8644 |
}, |
| 8645 |
onContextMenuHide: function onContextMenuHide() { |
| 8646 |
elementor.channels.editor.reply('contextMenu:targetView', null); |
| 8647 |
}, |
| 8648 |
onDestroy: function onDestroy() { |
| 8649 |
if (this.contextMenu) { |
| 8650 |
this.contextMenu.destroy(); |
| 8651 |
} |
| 8652 |
} |
| 8653 |
}); |
| 8654 |
|
| 8655 |
/***/ }), |
| 8656 |
/* 274 */ |
| 8657 |
/***/ (function(module, exports, __webpack_require__) { |
| 8658 |
|
| 8659 |
"use strict"; |
| 8660 |
|
| 8661 |
|
| 8662 |
var ControlBaseDataView = __webpack_require__(127), |
| 8663 |
ControlSelect2ItemView; |
| 8664 |
|
| 8665 |
ControlSelect2ItemView = ControlBaseDataView.extend({ |
| 8666 |
getSelect2Placeholder: function getSelect2Placeholder() { |
| 8667 |
return this.ui.select.children('option:first[value=""]').text(); |
| 8668 |
}, |
| 8669 |
getSelect2DefaultOptions: function getSelect2DefaultOptions() { |
| 8670 |
return { |
| 8671 |
allowClear: true, |
| 8672 |
placeholder: this.getSelect2Placeholder(), |
| 8673 |
dir: elementorCommon.config.isRTL ? 'rtl' : 'ltr' |
| 8674 |
}; |
| 8675 |
}, |
| 8676 |
getSelect2Options: function getSelect2Options() { |
| 8677 |
return jQuery.extend(this.getSelect2DefaultOptions(), this.model.get('select2options')); |
| 8678 |
}, |
| 8679 |
applySavedValue: function applySavedValue() { |
| 8680 |
ControlBaseDataView.prototype.applySavedValue.apply(this, arguments); |
| 8681 |
var select2Instance = this.ui.select.data('select2'); |
| 8682 |
|
| 8683 |
if (!select2Instance) { |
| 8684 |
this.ui.select.select2(this.getSelect2Options()); |
| 8685 |
} else { |
| 8686 |
this.ui.select.trigger('change'); |
| 8687 |
} |
| 8688 |
}, |
| 8689 |
onReady: function onReady() { |
| 8690 |
elementorCommon.helpers.softDeprecated('onReady', '3.0.0'); |
| 8691 |
}, |
| 8692 |
onBeforeDestroy: function onBeforeDestroy() { |
| 8693 |
// We always destroy the select2 instance because there are cases where the DOM element's data cache |
| 8694 |
// itself has been destroyed but the select2 instance on it still exists |
| 8695 |
this.ui.select.select2('destroy'); |
| 8696 |
this.$el.remove(); |
| 8697 |
} |
| 8698 |
}); |
| 8699 |
module.exports = ControlSelect2ItemView; |
| 8700 |
|
| 8701 |
/***/ }), |
| 8702 |
/* 275 */, |
| 8703 |
/* 276 */, |
| 8704 |
/* 277 */ |
| 8705 |
/***/ (function(module, exports, __webpack_require__) { |
| 8706 |
|
| 8707 |
"use strict"; |
| 8708 |
// 21.1.3.18 String.prototype.startsWith(searchString [, position ]) |
| 8709 |
|
| 8710 |
var $export = __webpack_require__(34); |
| 8711 |
var toLength = __webpack_require__(43); |
| 8712 |
var context = __webpack_require__(204); |
| 8713 |
var STARTS_WITH = 'startsWith'; |
| 8714 |
var $startsWith = ''[STARTS_WITH]; |
| 8715 |
|
| 8716 |
$export($export.P + $export.F * __webpack_require__(205)(STARTS_WITH), 'String', { |
| 8717 |
startsWith: function startsWith(searchString /* , position = 0 */) { |
| 8718 |
var that = context(this, searchString, STARTS_WITH); |
| 8719 |
var index = toLength(Math.min(arguments.length > 1 ? arguments[1] : undefined, that.length)); |
| 8720 |
var search = String(searchString); |
| 8721 |
return $startsWith |
| 8722 |
? $startsWith.call(that, search, index) |
| 8723 |
: that.slice(index, index + search.length) === search; |
| 8724 |
} |
| 8725 |
}); |
| 8726 |
|
| 8727 |
|
| 8728 |
/***/ }), |
| 8729 |
/* 278 */, |
| 8730 |
/* 279 */, |
| 8731 |
/* 280 */ |
| 8732 |
/***/ (function(module, exports, __webpack_require__) { |
| 8733 |
|
| 8734 |
// 21.2.5.3 get RegExp.prototype.flags() |
| 8735 |
if (__webpack_require__(27) && /./g.flags != 'g') __webpack_require__(45).f(RegExp.prototype, 'flags', { |
| 8736 |
configurable: true, |
| 8737 |
get: __webpack_require__(106) |
| 8738 |
}); |
| 8739 |
|
| 8740 |
|
| 8741 |
/***/ }), |
| 8742 |
/* 281 */ |
| 8743 |
/***/ (function(module, exports, __webpack_require__) { |
| 8744 |
|
| 8745 |
"use strict"; |
| 8746 |
|
| 8747 |
|
| 8748 |
var _interopRequireDefault = __webpack_require__(0); |
| 8749 |
|
| 8750 |
var _defineProperty = _interopRequireDefault(__webpack_require__(1)); |
| 8751 |
|
| 8752 |
var _keys = _interopRequireDefault(__webpack_require__(23)); |
| 8753 |
|
| 8754 |
var ControlBaseView; |
| 8755 |
ControlBaseView = Marionette.CompositeView.extend({ |
| 8756 |
ui: function ui() { |
| 8757 |
return { |
| 8758 |
controlTitle: '.elementor-control-title' |
| 8759 |
}; |
| 8760 |
}, |
| 8761 |
behaviors: function behaviors() { |
| 8762 |
var behaviors = {}; |
| 8763 |
return elementor.hooks.applyFilters('controls/base/behaviors', behaviors, this); |
| 8764 |
}, |
| 8765 |
getBehavior: function getBehavior(name) { |
| 8766 |
return this._behaviors[(0, _keys.default)(this.behaviors()).indexOf(name)]; |
| 8767 |
}, |
| 8768 |
className: function className() { |
| 8769 |
// TODO: Any better classes for that? |
| 8770 |
var classes = 'elementor-control elementor-control-' + this.model.get('name') + ' elementor-control-type-' + this.model.get('type'), |
| 8771 |
modelClasses = this.model.get('classes'), |
| 8772 |
responsive = this.model.get('responsive'); |
| 8773 |
|
| 8774 |
if (!_.isEmpty(modelClasses)) { |
| 8775 |
classes += ' ' + modelClasses; |
| 8776 |
} |
| 8777 |
|
| 8778 |
if (!_.isEmpty(responsive)) { |
| 8779 |
classes += ' elementor-control-responsive-' + responsive.max; |
| 8780 |
} |
| 8781 |
|
| 8782 |
return classes; |
| 8783 |
}, |
| 8784 |
templateHelpers: function templateHelpers() { |
| 8785 |
var controlData = { |
| 8786 |
_cid: this.model.cid |
| 8787 |
}; |
| 8788 |
return { |
| 8789 |
view: this, |
| 8790 |
data: _.extend({}, this.model.toJSON(), controlData) |
| 8791 |
}; |
| 8792 |
}, |
| 8793 |
getTemplate: function getTemplate() { |
| 8794 |
return Marionette.TemplateCache.get('#tmpl-elementor-control-' + this.model.get('type') + '-content'); |
| 8795 |
}, |
| 8796 |
initialize: function initialize(options) { |
| 8797 |
var label = this.model.get('label'); // TODO: Temp backwards compatibility. since 2.8.0. |
| 8798 |
|
| 8799 |
(0, _defineProperty.default)(this, 'container', { |
| 8800 |
get: function get() { |
| 8801 |
if (!options.container) { |
| 8802 |
var settingsModel = options.elementSettingsModel, |
| 8803 |
view = $e.components.get('document').utils.findViewById(settingsModel.id); // Element control. |
| 8804 |
|
| 8805 |
if (view && view.getContainer) { |
| 8806 |
options.container = view.getContainer(); |
| 8807 |
} else { |
| 8808 |
if (!settingsModel.id) { |
| 8809 |
settingsModel.id = 'bc-' + elementorCommon.helpers.getUniqueId(); |
| 8810 |
} // Document/General/Other control. |
| 8811 |
|
| 8812 |
|
| 8813 |
options.container = new elementorModules.editor.Container({ |
| 8814 |
type: 'bc-container', |
| 8815 |
id: settingsModel.id, |
| 8816 |
model: settingsModel, |
| 8817 |
settings: settingsModel, |
| 8818 |
label: label, |
| 8819 |
view: false, |
| 8820 |
renderer: false, |
| 8821 |
controls: settingsModel.options.controls |
| 8822 |
}); |
| 8823 |
} |
| 8824 |
} |
| 8825 |
|
| 8826 |
return options.container; |
| 8827 |
} |
| 8828 |
}); // Use `defineProperty` because `get elementSettingsModel()` fails during the `Marionette.CompositeView.extend`. |
| 8829 |
|
| 8830 |
(0, _defineProperty.default)(this, 'elementSettingsModel', { |
| 8831 |
get: function get() { |
| 8832 |
elementorCommon.helpers.softDeprecated('elementSettingsModel', '2.8.0', 'container.settings'); |
| 8833 |
return options.container ? options.container.settings : options.elementSettingsModel; |
| 8834 |
} |
| 8835 |
}); |
| 8836 |
var controlType = this.model.get('type'), |
| 8837 |
controlSettings = jQuery.extend(true, {}, elementor.config.controls[controlType], this.model.attributes); |
| 8838 |
this.model.set(controlSettings); // TODO: this.elementSettingsModel is deprecated since 2.8.0. |
| 8839 |
|
| 8840 |
var settings = this.container ? this.container.settings : this.elementSettingsModel; |
| 8841 |
this.listenTo(settings, 'change', this.toggleControlVisibility); |
| 8842 |
}, |
| 8843 |
toggleControlVisibility: function toggleControlVisibility() { |
| 8844 |
// TODO: this.elementSettingsModel is deprecated since 2.8.0. |
| 8845 |
var settings = this.container ? this.container.settings : this.elementSettingsModel; |
| 8846 |
var isVisible = elementor.helpers.isActiveControl(this.model, settings.attributes); |
| 8847 |
this.$el.toggleClass('elementor-hidden-control', !isVisible); |
| 8848 |
elementor.getPanelView().updateScrollbar(); |
| 8849 |
}, |
| 8850 |
onRender: function onRender() { |
| 8851 |
var layoutType = this.model.get('label_block') ? 'block' : 'inline', |
| 8852 |
showLabel = this.model.get('show_label'), |
| 8853 |
elClasses = 'elementor-label-' + layoutType; |
| 8854 |
elClasses += ' elementor-control-separator-' + this.model.get('separator'); |
| 8855 |
|
| 8856 |
if (!showLabel) { |
| 8857 |
elClasses += ' elementor-control-hidden-label'; |
| 8858 |
} |
| 8859 |
|
| 8860 |
this.$el.addClass(elClasses); |
| 8861 |
this.toggleControlVisibility(); |
| 8862 |
} |
| 8863 |
}); |
| 8864 |
module.exports = ControlBaseView; |
| 8865 |
|
| 8866 |
/***/ }), |
| 8867 |
/* 282 */ |
| 8868 |
/***/ (function(module, exports, __webpack_require__) { |
| 8869 |
|
| 8870 |
__webpack_require__(283); |
| 8871 |
module.exports = __webpack_require__(6).parseInt; |
| 8872 |
|
| 8873 |
|
| 8874 |
/***/ }), |
| 8875 |
/* 283 */ |
| 8876 |
/***/ (function(module, exports, __webpack_require__) { |
| 8877 |
|
| 8878 |
var $export = __webpack_require__(7); |
| 8879 |
var $parseInt = __webpack_require__(284); |
| 8880 |
// 18.2.5 parseInt(string, radix) |
| 8881 |
$export($export.G + $export.F * (parseInt != $parseInt), { parseInt: $parseInt }); |
| 8882 |
|
| 8883 |
|
| 8884 |
/***/ }), |
| 8885 |
/* 284 */ |
| 8886 |
/***/ (function(module, exports, __webpack_require__) { |
| 8887 |
|
| 8888 |
var $parseInt = __webpack_require__(8).parseInt; |
| 8889 |
var $trim = __webpack_require__(285).trim; |
| 8890 |
var ws = __webpack_require__(235); |
| 8891 |
var hex = /^[-+]?0[xX]/; |
| 8892 |
|
| 8893 |
module.exports = $parseInt(ws + '08') !== 8 || $parseInt(ws + '0x16') !== 22 ? function parseInt(str, radix) { |
| 8894 |
var string = $trim(String(str), 3); |
| 8895 |
return $parseInt(string, (radix >>> 0) || (hex.test(string) ? 16 : 10)); |
| 8896 |
} : $parseInt; |
| 8897 |
|
| 8898 |
|
| 8899 |
/***/ }), |
| 8900 |
/* 285 */ |
| 8901 |
/***/ (function(module, exports, __webpack_require__) { |
| 8902 |
|
| 8903 |
var $export = __webpack_require__(7); |
| 8904 |
var defined = __webpack_require__(65); |
| 8905 |
var fails = __webpack_require__(22); |
| 8906 |
var spaces = __webpack_require__(235); |
| 8907 |
var space = '[' + spaces + ']'; |
| 8908 |
var non = '\u200b\u0085'; |
| 8909 |
var ltrim = RegExp('^' + space + space + '*'); |
| 8910 |
var rtrim = RegExp(space + space + '*$'); |
| 8911 |
|
| 8912 |
var exporter = function (KEY, exec, ALIAS) { |
| 8913 |
var exp = {}; |
| 8914 |
var FORCE = fails(function () { |
| 8915 |
return !!spaces[KEY]() || non[KEY]() != non; |
| 8916 |
}); |
| 8917 |
var fn = exp[KEY] = FORCE ? exec(trim) : spaces[KEY]; |
| 8918 |
if (ALIAS) exp[ALIAS] = fn; |
| 8919 |
$export($export.P + $export.F * FORCE, 'String', exp); |
| 8920 |
}; |
| 8921 |
|
| 8922 |
// 1 -> String#trimLeft |
| 8923 |
// 2 -> String#trimRight |
| 8924 |
// 3 -> String#trim |
| 8925 |
var trim = exporter.trim = function (string, TYPE) { |
| 8926 |
string = String(defined(string)); |
| 8927 |
if (TYPE & 1) string = string.replace(ltrim, ''); |
| 8928 |
if (TYPE & 2) string = string.replace(rtrim, ''); |
| 8929 |
return string; |
| 8930 |
}; |
| 8931 |
|
| 8932 |
module.exports = exporter; |
| 8933 |
|
| 8934 |
|
| 8935 |
/***/ }), |
| 8936 |
/* 286 */ |
| 8937 |
/***/ (function(module, exports, __webpack_require__) { |
| 8938 |
|
| 8939 |
"use strict"; |
| 8940 |
|
| 8941 |
|
| 8942 |
var _interopRequireDefault = __webpack_require__(0); |
| 8943 |
|
| 8944 |
var _Object$defineProperty = __webpack_require__(1); |
| 8945 |
|
| 8946 |
_Object$defineProperty(exports, "__esModule", { |
| 8947 |
value: true |
| 8948 |
}); |
| 8949 |
|
| 8950 |
exports.default = exports.Base = void 0; |
| 8951 |
|
| 8952 |
var _classCallCheck2 = _interopRequireDefault(__webpack_require__(2)); |
| 8953 |
|
| 8954 |
var _createClass2 = _interopRequireDefault(__webpack_require__(3)); |
| 8955 |
|
| 8956 |
var _inherits2 = _interopRequireDefault(__webpack_require__(4)); |
| 8957 |
|
| 8958 |
var _createSuper2 = _interopRequireDefault(__webpack_require__(5)); |
| 8959 |
|
| 8960 |
var _hookBase = _interopRequireDefault(__webpack_require__(294)); |
| 8961 |
|
| 8962 |
var Base = /*#__PURE__*/function (_HookBase) { |
| 8963 |
(0, _inherits2.default)(Base, _HookBase); |
| 8964 |
|
| 8965 |
var _super = (0, _createSuper2.default)(Base); |
| 8966 |
|
| 8967 |
function Base() { |
| 8968 |
(0, _classCallCheck2.default)(this, Base); |
| 8969 |
return _super.apply(this, arguments); |
| 8970 |
} |
| 8971 |
|
| 8972 |
(0, _createClass2.default)(Base, [{ |
| 8973 |
key: "getType", |
| 8974 |
value: function getType() { |
| 8975 |
return 'data'; |
| 8976 |
} |
| 8977 |
}]); |
| 8978 |
return Base; |
| 8979 |
}(_hookBase.default); |
| 8980 |
|
| 8981 |
exports.Base = Base; |
| 8982 |
var _default = Base; |
| 8983 |
exports.default = _default; |
| 8984 |
|
| 8985 |
/***/ }), |
| 8986 |
/* 287 */ |
| 8987 |
/***/ (function(module, exports, __webpack_require__) { |
| 8988 |
|
| 8989 |
"use strict"; |
| 8990 |
|
| 8991 |
|
| 8992 |
var _interopRequireWildcard = __webpack_require__(36); |
| 8993 |
|
| 8994 |
var _interopRequireDefault = __webpack_require__(0); |
| 8995 |
|
| 8996 |
var _Object$defineProperty = __webpack_require__(1); |
| 8997 |
|
| 8998 |
_Object$defineProperty(exports, "__esModule", { |
| 8999 |
value: true |
| 9000 |
}); |
| 9001 |
|
| 9002 |
exports.default = void 0; |
| 9003 |
|
| 9004 |
var _classCallCheck2 = _interopRequireDefault(__webpack_require__(2)); |
| 9005 |
|
| 9006 |
var _createClass2 = _interopRequireDefault(__webpack_require__(3)); |
| 9007 |
|
| 9008 |
var _get2 = _interopRequireDefault(__webpack_require__(26)); |
| 9009 |
|
| 9010 |
var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(16)); |
| 9011 |
|
| 9012 |
var _inherits2 = _interopRequireDefault(__webpack_require__(4)); |
| 9013 |
|
| 9014 |
var _createSuper2 = _interopRequireDefault(__webpack_require__(5)); |
| 9015 |
|
| 9016 |
var _componentBase = _interopRequireDefault(__webpack_require__(85)); |
| 9017 |
|
| 9018 |
var commands = _interopRequireWildcard(__webpack_require__(321)); |
| 9019 |
|
| 9020 |
var ComponentModalBase = /*#__PURE__*/function (_ComponentBase) { |
| 9021 |
(0, _inherits2.default)(ComponentModalBase, _ComponentBase); |
| 9022 |
|
| 9023 |
var _super = (0, _createSuper2.default)(ComponentModalBase); |
| 9024 |
|
| 9025 |
function ComponentModalBase() { |
| 9026 |
(0, _classCallCheck2.default)(this, ComponentModalBase); |
| 9027 |
return _super.apply(this, arguments); |
| 9028 |
} |
| 9029 |
|
| 9030 |
(0, _createClass2.default)(ComponentModalBase, [{ |
| 9031 |
key: "registerAPI", |
| 9032 |
value: function registerAPI() { |
| 9033 |
var _this = this; |
| 9034 |
|
| 9035 |
(0, _get2.default)((0, _getPrototypeOf2.default)(ComponentModalBase.prototype), "registerAPI", this).call(this); |
| 9036 |
$e.shortcuts.register('esc', { |
| 9037 |
scopes: [this.getNamespace()], |
| 9038 |
callback: function callback() { |
| 9039 |
return _this.close(); |
| 9040 |
} |
| 9041 |
}); |
| 9042 |
} |
| 9043 |
}, { |
| 9044 |
key: "defaultCommands", |
| 9045 |
value: function defaultCommands() { |
| 9046 |
return this.importCommands(commands); |
| 9047 |
} |
| 9048 |
}, { |
| 9049 |
key: "defaultRoutes", |
| 9050 |
value: function defaultRoutes() { |
| 9051 |
return { |
| 9052 |
'': function _() { |
| 9053 |
/* Nothing to do, it's already rendered. */ |
| 9054 |
} |
| 9055 |
}; |
| 9056 |
} |
| 9057 |
}, { |
| 9058 |
key: "open", |
| 9059 |
value: function open() { |
| 9060 |
var _this2 = this; |
| 9061 |
|
| 9062 |
if (!this.layout) { |
| 9063 |
var layout = this.getModalLayout(); |
| 9064 |
this.layout = new layout({ |
| 9065 |
component: this |
| 9066 |
}); |
| 9067 |
this.layout.getModal().on('hide', function () { |
| 9068 |
return _this2.close(); |
| 9069 |
}); |
| 9070 |
} |
| 9071 |
|
| 9072 |
this.layout.showModal(); |
| 9073 |
return true; |
| 9074 |
} |
| 9075 |
}, { |
| 9076 |
key: "close", |
| 9077 |
value: function close() { |
| 9078 |
if (!(0, _get2.default)((0, _getPrototypeOf2.default)(ComponentModalBase.prototype), "close", this).call(this)) { |
| 9079 |
return false; |
| 9080 |
} |
| 9081 |
|
| 9082 |
this.layout.getModal().hide(); |
| 9083 |
return true; |
| 9084 |
} |
| 9085 |
}, { |
| 9086 |
key: "getModalLayout", |
| 9087 |
value: function getModalLayout() { |
| 9088 |
elementorModules.ForceMethodImplementation(); |
| 9089 |
} |
| 9090 |
}]); |
| 9091 |
return ComponentModalBase; |
| 9092 |
}(_componentBase.default); |
| 9093 |
|
| 9094 |
exports.default = ComponentModalBase; |
| 9095 |
|
| 9096 |
/***/ }), |
| 9097 |
/* 288 */ |
| 9098 |
/***/ (function(module, exports, __webpack_require__) { |
| 9099 |
|
| 9100 |
__webpack_require__(289); |
| 9101 |
module.exports = __webpack_require__(6).Object.assign; |
| 9102 |
|
| 9103 |
|
| 9104 |
/***/ }), |
| 9105 |
/* 289 */ |
| 9106 |
/***/ (function(module, exports, __webpack_require__) { |
| 9107 |
|
| 9108 |
// 19.1.3.1 Object.assign(target, source) |
| 9109 |
var $export = __webpack_require__(7); |
| 9110 |
|
| 9111 |
$export($export.S + $export.F, 'Object', { assign: __webpack_require__(212) }); |
| 9112 |
|
| 9113 |
|
| 9114 |
/***/ }), |
| 9115 |
/* 290 */ |
| 9116 |
/***/ (function(module, exports, __webpack_require__) { |
| 9117 |
|
| 9118 |
module.exports = __webpack_require__(291); |
| 9119 |
|
| 9120 |
/***/ }), |
| 9121 |
/* 291 */ |
| 9122 |
/***/ (function(module, exports, __webpack_require__) { |
| 9123 |
|
| 9124 |
__webpack_require__(292); |
| 9125 |
var $Object = __webpack_require__(6).Object; |
| 9126 |
module.exports = function defineProperties(T, D) { |
| 9127 |
return $Object.defineProperties(T, D); |
| 9128 |
}; |
| 9129 |
|
| 9130 |
|
| 9131 |
/***/ }), |
| 9132 |
/* 292 */ |
| 9133 |
/***/ (function(module, exports, __webpack_require__) { |
| 9134 |
|
| 9135 |
var $export = __webpack_require__(7); |
| 9136 |
// 19.1.2.3 / 15.2.3.7 Object.defineProperties(O, Properties) |
| 9137 |
$export($export.S + $export.F * !__webpack_require__(14), 'Object', { defineProperties: __webpack_require__(136) }); |
| 9138 |
|
| 9139 |
|
| 9140 |
/***/ }), |
| 9141 |
/* 293 */ |
| 9142 |
/***/ (function(module, exports, __webpack_require__) { |
| 9143 |
|
| 9144 |
"use strict"; |
| 9145 |
|
| 9146 |
|
| 9147 |
var _interopRequireDefault = __webpack_require__(0); |
| 9148 |
|
| 9149 |
var _keys = _interopRequireDefault(__webpack_require__(23)); |
| 9150 |
|
| 9151 |
__webpack_require__(295); |
| 9152 |
|
| 9153 |
__webpack_require__(119); |
| 9154 |
|
| 9155 |
__webpack_require__(58); |
| 9156 |
|
| 9157 |
__webpack_require__(39); |
| 9158 |
|
| 9159 |
__webpack_require__(25); |
| 9160 |
|
| 9161 |
var Stylesheet = __webpack_require__(332), |
| 9162 |
ControlsCSSParser; |
| 9163 |
|
| 9164 |
ControlsCSSParser = elementorModules.ViewModule.extend({ |
| 9165 |
stylesheet: null, |
| 9166 |
getDefaultSettings: function getDefaultSettings() { |
| 9167 |
return { |
| 9168 |
id: 0, |
| 9169 |
context: null, |
| 9170 |
settingsModel: null, |
| 9171 |
dynamicParsing: {} |
| 9172 |
}; |
| 9173 |
}, |
| 9174 |
getDefaultElements: function getDefaultElements() { |
| 9175 |
var id = "elementor-style-".concat(this.getSettings('id')); |
| 9176 |
var $stylesheet = elementor.$previewContents.find("#".concat(id)); |
| 9177 |
|
| 9178 |
if (!$stylesheet.length) { |
| 9179 |
$stylesheet = jQuery('<style>', { |
| 9180 |
id: id |
| 9181 |
}); |
| 9182 |
} |
| 9183 |
|
| 9184 |
return { |
| 9185 |
$stylesheetElement: $stylesheet |
| 9186 |
}; |
| 9187 |
}, |
| 9188 |
initStylesheet: function initStylesheet() { |
| 9189 |
var breakpoints = elementorFrontend.config.breakpoints; |
| 9190 |
this.stylesheet = new Stylesheet(); |
| 9191 |
this.stylesheet.addDevice('mobile', 0).addDevice('tablet', breakpoints.md).addDevice('desktop', breakpoints.lg); |
| 9192 |
}, |
| 9193 |
addStyleRules: function addStyleRules(styleControls, values, controls, placeholders, replacements) { |
| 9194 |
var _this = this; |
| 9195 |
|
| 9196 |
// If the current element contains dynamic values, parse these values |
| 9197 |
var dynamicParsedValues = this.getSettings('settingsModel').parseDynamicSettings(values, this.getSettings('dynamicParsing'), styleControls); |
| 9198 |
|
| 9199 |
_.each(styleControls, function (control) { |
| 9200 |
var _control$dynamic, _values$__dynamic__; |
| 9201 |
|
| 9202 |
if (control.styleFields && control.styleFields.length) { |
| 9203 |
_this.addRepeaterControlsStyleRules(values[control.name], control.styleFields, control.fields, placeholders, replacements); |
| 9204 |
} // If a dynamic tag includes controls with CSS implementations, Take their CSS and apply it. |
| 9205 |
|
| 9206 |
|
| 9207 |
if (((_control$dynamic = control.dynamic) === null || _control$dynamic === void 0 ? void 0 : _control$dynamic.active) && ((_values$__dynamic__ = values.__dynamic__) === null || _values$__dynamic__ === void 0 ? void 0 : _values$__dynamic__[control.name])) { |
| 9208 |
_this.addDynamicControlStyleRules(values.__dynamic__[control.name], control); |
| 9209 |
} |
| 9210 |
|
| 9211 |
if (!control.selectors) { |
| 9212 |
return; |
| 9213 |
} |
| 9214 |
|
| 9215 |
var context = _this.getSettings('context'); |
| 9216 |
|
| 9217 |
var globalKeys; |
| 9218 |
|
| 9219 |
if (context) { |
| 9220 |
globalKeys = context.model.get('settings').get('__globals__'); |
| 9221 |
} |
| 9222 |
|
| 9223 |
_this.addControlStyleRules(control, dynamicParsedValues, controls, placeholders, replacements, globalKeys); |
| 9224 |
}); |
| 9225 |
}, |
| 9226 |
addControlStyleRules: function addControlStyleRules(control, values, controls, placeholders, replacements, globalKeys) { |
| 9227 |
var _this2 = this; |
| 9228 |
|
| 9229 |
var globalKey; |
| 9230 |
|
| 9231 |
if (globalKeys) { |
| 9232 |
var controlGlobalKey = control.name; |
| 9233 |
|
| 9234 |
if (control.groupType) { |
| 9235 |
controlGlobalKey = control.groupPrefix + control.groupType; |
| 9236 |
} |
| 9237 |
|
| 9238 |
globalKey = globalKeys[controlGlobalKey]; |
| 9239 |
} |
| 9240 |
|
| 9241 |
var value; |
| 9242 |
|
| 9243 |
if (!globalKey) { |
| 9244 |
value = this.getStyleControlValue(control, values); |
| 9245 |
|
| 9246 |
if (undefined === value) { |
| 9247 |
return; |
| 9248 |
} |
| 9249 |
} |
| 9250 |
|
| 9251 |
_.each(control.selectors, function (cssProperty, selector) { |
| 9252 |
var outputCssProperty; |
| 9253 |
|
| 9254 |
if (globalKey) { |
| 9255 |
var selectorGlobalValue = _this2.getSelectorGlobalValue(control, globalKey); |
| 9256 |
|
| 9257 |
if (selectorGlobalValue) { |
| 9258 |
if ('font' === control.type) { |
| 9259 |
$e.data.get(globalKey).then(function (response) { |
| 9260 |
elementor.helpers.enqueueFont(response.data.value.typography_font_family); |
| 9261 |
}); |
| 9262 |
} // This regex handles a case where a control's selector property value includes more than one CSS selector. |
| 9263 |
// Example: 'selector' => 'background: {{VALUE}}; background-color: {{VALUE}};'. |
| 9264 |
|
| 9265 |
|
| 9266 |
outputCssProperty = cssProperty.replace(/(:)[^;]+(;?)/g, '$1' + selectorGlobalValue + '$2'); |
| 9267 |
} |
| 9268 |
} else { |
| 9269 |
try { |
| 9270 |
outputCssProperty = cssProperty.replace(/{{(?:([^.}]+)\.)?([^}| ]*)(?: *\|\| *(?:([^.}]+)\.)?([^}| ]*) *)*}}/g, function (originalPhrase, controlName, placeholder, fallbackControlName, fallbackValue) { |
| 9271 |
var externalControlMissing = controlName && !controls[controlName]; |
| 9272 |
var parsedValue = ''; |
| 9273 |
|
| 9274 |
if (!externalControlMissing) { |
| 9275 |
parsedValue = _this2.parsePropertyPlaceholder(control, value, controls, values, placeholder, controlName); |
| 9276 |
} |
| 9277 |
|
| 9278 |
if (!parsedValue && 0 !== parsedValue) { |
| 9279 |
if (fallbackValue) { |
| 9280 |
parsedValue = fallbackValue; |
| 9281 |
var stringValueMatches = parsedValue.match(/^(['"])(.*)\1$/); |
| 9282 |
|
| 9283 |
if (stringValueMatches) { |
| 9284 |
parsedValue = stringValueMatches[2]; |
| 9285 |
} else if (!isFinite(parsedValue)) { |
| 9286 |
if (fallbackControlName && !controls[fallbackControlName]) { |
| 9287 |
return ''; |
| 9288 |
} |
| 9289 |
|
| 9290 |
parsedValue = _this2.parsePropertyPlaceholder(control, value, controls, values, fallbackValue, fallbackControlName); |
| 9291 |
} |
| 9292 |
} |
| 9293 |
|
| 9294 |
if (!parsedValue && 0 !== parsedValue) { |
| 9295 |
if (externalControlMissing) { |
| 9296 |
return ''; |
| 9297 |
} |
| 9298 |
|
| 9299 |
throw ''; |
| 9300 |
} |
| 9301 |
} |
| 9302 |
|
| 9303 |
if ('font' === control.type) { |
| 9304 |
elementor.helpers.enqueueFont(parsedValue); |
| 9305 |
} |
| 9306 |
|
| 9307 |
return parsedValue; |
| 9308 |
}); |
| 9309 |
} catch (e) { |
| 9310 |
return; |
| 9311 |
} |
| 9312 |
} |
| 9313 |
|
| 9314 |
if (_.isEmpty(outputCssProperty)) { |
| 9315 |
return; |
| 9316 |
} |
| 9317 |
|
| 9318 |
var devicePattern = /^(?:\([^)]+\)){1,2}/, |
| 9319 |
deviceRules = selector.match(devicePattern), |
| 9320 |
query = {}; |
| 9321 |
|
| 9322 |
if (deviceRules) { |
| 9323 |
deviceRules = deviceRules[0]; |
| 9324 |
selector = selector.replace(devicePattern, ''); |
| 9325 |
var pureDevicePattern = /\(([^)]+)\)/g, |
| 9326 |
pureDeviceRules = [], |
| 9327 |
matches; |
| 9328 |
matches = pureDevicePattern.exec(deviceRules); |
| 9329 |
|
| 9330 |
while (matches) { |
| 9331 |
pureDeviceRules.push(matches[1]); |
| 9332 |
matches = pureDevicePattern.exec(deviceRules); |
| 9333 |
} |
| 9334 |
|
| 9335 |
_.each(pureDeviceRules, function (deviceRule) { |
| 9336 |
if ('desktop' === deviceRule) { |
| 9337 |
return; |
| 9338 |
} |
| 9339 |
|
| 9340 |
var device = deviceRule.replace(/\+$/, ''), |
| 9341 |
endPoint = device === deviceRule ? 'max' : 'min'; |
| 9342 |
query[endPoint] = device; |
| 9343 |
}); |
| 9344 |
} |
| 9345 |
|
| 9346 |
_.each(placeholders, function (placeholder, index) { |
| 9347 |
// Check if it's a RegExp |
| 9348 |
var regexp = placeholder.source ? placeholder.source : placeholder, |
| 9349 |
placeholderPattern = new RegExp(regexp, 'g'); |
| 9350 |
selector = selector.replace(placeholderPattern, replacements[index]); |
| 9351 |
}); |
| 9352 |
|
| 9353 |
if (!(0, _keys.default)(query).length && control.responsive) { |
| 9354 |
query = _.pick(elementorCommon.helpers.cloneObject(control.responsive), ['min', 'max']); |
| 9355 |
|
| 9356 |
if ('desktop' === query.max) { |
| 9357 |
delete query.max; |
| 9358 |
} |
| 9359 |
} |
| 9360 |
|
| 9361 |
_this2.stylesheet.addRules(selector, outputCssProperty, query); |
| 9362 |
}); |
| 9363 |
}, |
| 9364 |
parsePropertyPlaceholder: function parsePropertyPlaceholder(control, value, controls, values, placeholder, parserControlName) { |
| 9365 |
if (parserControlName) { |
| 9366 |
control = _.findWhere(controls, { |
| 9367 |
name: parserControlName |
| 9368 |
}); |
| 9369 |
value = this.getStyleControlValue(control, values); |
| 9370 |
} |
| 9371 |
|
| 9372 |
return elementor.getControlView(control.type).getStyleValue(placeholder, value, control); |
| 9373 |
}, |
| 9374 |
getStyleControlValue: function getStyleControlValue(control, values) { |
| 9375 |
var _values$__globals__; |
| 9376 |
|
| 9377 |
if ((_values$__globals__ = values.__globals__) === null || _values$__globals__ === void 0 ? void 0 : _values$__globals__[control.name]) { |
| 9378 |
// When the control itself has no global value, but it refers to another control global value |
| 9379 |
return this.getSelectorGlobalValue(control, values.__globals__[control.name]); |
| 9380 |
} |
| 9381 |
|
| 9382 |
var value = values[control.name]; |
| 9383 |
|
| 9384 |
if (control.selectors_dictionary) { |
| 9385 |
value = control.selectors_dictionary[value] || value; |
| 9386 |
} |
| 9387 |
|
| 9388 |
if (!_.isNumber(value) && _.isEmpty(value)) { |
| 9389 |
return; |
| 9390 |
} |
| 9391 |
|
| 9392 |
return value; |
| 9393 |
}, |
| 9394 |
getSelectorGlobalValue: function getSelectorGlobalValue(control, globalKey) { |
| 9395 |
var globalArgs = $e.data.commandExtractArgs(globalKey), |
| 9396 |
data = $e.data.getCache($e.components.get('globals'), globalArgs.command, globalArgs.args.query); |
| 9397 |
|
| 9398 |
if (!(data === null || data === void 0 ? void 0 : data.value)) { |
| 9399 |
return; |
| 9400 |
} |
| 9401 |
|
| 9402 |
var id = data.id; |
| 9403 |
var value; // it's a global settings with additional controls in group. |
| 9404 |
|
| 9405 |
if (control.groupType) { |
| 9406 |
var propertyName = control.name.replace(control.groupPrefix, '').replace(/(_tablet|_mobile)$/, ''); |
| 9407 |
|
| 9408 |
if (!data.value[elementor.config.kit_config.typography_prefix + propertyName]) { |
| 9409 |
return; |
| 9410 |
} |
| 9411 |
|
| 9412 |
propertyName = propertyName.replace('_', '-'); |
| 9413 |
value = "var( --e-global-".concat(control.groupType, "-").concat(id, "-").concat(propertyName, " )"); |
| 9414 |
} else { |
| 9415 |
value = "var( --e-global-".concat(control.type, "-").concat(id, " )"); |
| 9416 |
} |
| 9417 |
|
| 9418 |
return value; |
| 9419 |
}, |
| 9420 |
addRepeaterControlsStyleRules: function addRepeaterControlsStyleRules(repeaterValues, repeaterControlsItems, controls, placeholders, replacements) { |
| 9421 |
var _this3 = this; |
| 9422 |
|
| 9423 |
repeaterControlsItems.forEach(function (item, index) { |
| 9424 |
var itemModel = repeaterValues.models[index]; |
| 9425 |
|
| 9426 |
_this3.addStyleRules(item, itemModel.attributes, controls, placeholders.concat(['{{CURRENT_ITEM}}']), replacements.concat(['.elementor-repeater-item-' + itemModel.get('_id')])); |
| 9427 |
}); |
| 9428 |
}, |
| 9429 |
addDynamicControlStyleRules: function addDynamicControlStyleRules(value, control) { |
| 9430 |
var self = this; |
| 9431 |
elementor.dynamicTags.parseTagsText(value, control.dynamic, function (id, name, settings) { |
| 9432 |
var tag = elementor.dynamicTags.createTag(id, name, settings); |
| 9433 |
|
| 9434 |
if (!tag) { |
| 9435 |
return; |
| 9436 |
} |
| 9437 |
|
| 9438 |
var tagSettingsModel = tag.model, |
| 9439 |
styleControls = tagSettingsModel.getStyleControls(); |
| 9440 |
|
| 9441 |
if (!styleControls.length) { |
| 9442 |
return; |
| 9443 |
} |
| 9444 |
|
| 9445 |
self.addStyleRules(tagSettingsModel.getStyleControls(), tagSettingsModel.attributes, tagSettingsModel.controls, ['{{WRAPPER}}'], ['#elementor-tag-' + id]); |
| 9446 |
}); |
| 9447 |
}, |
| 9448 |
addStyleToDocument: function addStyleToDocument(position) { |
| 9449 |
var $head = elementor.$previewContents.find('head'); |
| 9450 |
var insertMethod = 'append', |
| 9451 |
$insertBy = $head; |
| 9452 |
|
| 9453 |
if (position) { |
| 9454 |
var $targetElement = $head.children(position.of); |
| 9455 |
|
| 9456 |
if ($targetElement.length) { |
| 9457 |
insertMethod = position.at; |
| 9458 |
$insertBy = $targetElement; |
| 9459 |
} |
| 9460 |
} |
| 9461 |
|
| 9462 |
$insertBy[insertMethod](this.elements.$stylesheetElement); |
| 9463 |
var extraCSS = elementor.hooks.applyFilters('editor/style/styleText', '', this.getSettings('context')); |
| 9464 |
this.elements.$stylesheetElement.text(this.stylesheet + extraCSS); |
| 9465 |
}, |
| 9466 |
removeStyleFromDocument: function removeStyleFromDocument() { |
| 9467 |
this.elements.$stylesheetElement.remove(); |
| 9468 |
}, |
| 9469 |
onInit: function onInit() { |
| 9470 |
elementorModules.ViewModule.prototype.onInit.apply(this, arguments); |
| 9471 |
this.initStylesheet(); |
| 9472 |
} |
| 9473 |
}); |
| 9474 |
module.exports = ControlsCSSParser; |
| 9475 |
|
| 9476 |
/***/ }), |
| 9477 |
/* 294 */ |
| 9478 |
/***/ (function(module, exports, __webpack_require__) { |
| 9479 |
|
| 9480 |
"use strict"; |
| 9481 |
|
| 9482 |
|
| 9483 |
var _interopRequireDefault = __webpack_require__(0); |
| 9484 |
|
| 9485 |
var _Object$defineProperty = __webpack_require__(1); |
| 9486 |
|
| 9487 |
_Object$defineProperty(exports, "__esModule", { |
| 9488 |
value: true |
| 9489 |
}); |
| 9490 |
|
| 9491 |
exports.default = void 0; |
| 9492 |
|
| 9493 |
var _classCallCheck2 = _interopRequireDefault(__webpack_require__(2)); |
| 9494 |
|
| 9495 |
var _createClass2 = _interopRequireDefault(__webpack_require__(3)); |
| 9496 |
|
| 9497 |
var _defineProperty2 = _interopRequireDefault(__webpack_require__(28)); |
| 9498 |
|
| 9499 |
var HookBase = /*#__PURE__*/function () { |
| 9500 |
/** |
| 9501 |
* Callback type, eg ( hook, event ). |
| 9502 |
* |
| 9503 |
* @type {string} |
| 9504 |
*/ |
| 9505 |
|
| 9506 |
/** |
| 9507 |
* Full command address, that will hook the callback. |
| 9508 |
* |
| 9509 |
* @type (string) |
| 9510 |
*/ |
| 9511 |
|
| 9512 |
/** |
| 9513 |
* Unique id of the callback. |
| 9514 |
* |
| 9515 |
* @type {string} |
| 9516 |
*/ |
| 9517 |
|
| 9518 |
/** |
| 9519 |
* Function constructor(). |
| 9520 |
* |
| 9521 |
* Create callback base. |
| 9522 |
*/ |
| 9523 |
function HookBase() { |
| 9524 |
(0, _classCallCheck2.default)(this, HookBase); |
| 9525 |
(0, _defineProperty2.default)(this, "type", void 0); |
| 9526 |
(0, _defineProperty2.default)(this, "command", void 0); |
| 9527 |
(0, _defineProperty2.default)(this, "id", void 0); |
| 9528 |
this.initialize(); |
| 9529 |
this.type = this.getType(); |
| 9530 |
this.command = this.getCommand(); |
| 9531 |
this.id = this.getId(); |
| 9532 |
} |
| 9533 |
/** |
| 9534 |
* Function initialize(). |
| 9535 |
* |
| 9536 |
* Called after creation of the base, used for initialize extras. |
| 9537 |
* Without expending constructor. |
| 9538 |
*/ |
| 9539 |
|
| 9540 |
|
| 9541 |
(0, _createClass2.default)(HookBase, [{ |
| 9542 |
key: "initialize", |
| 9543 |
value: function initialize() {} |
| 9544 |
/** |
| 9545 |
* Function register(). |
| 9546 |
* |
| 9547 |
* Used to register the callback. |
| 9548 |
* |
| 9549 |
* @throws {Error} |
| 9550 |
*/ |
| 9551 |
|
| 9552 |
}, { |
| 9553 |
key: "register", |
| 9554 |
value: function register() { |
| 9555 |
elementorModules.ForceMethodImplementation(); |
| 9556 |
} |
| 9557 |
/** |
| 9558 |
* Function getType(). |
| 9559 |
* |
| 9560 |
* Get type eg: ( hook, event, etc ... ). |
| 9561 |
* |
| 9562 |
* @returns {string} |
| 9563 |
* |
| 9564 |
* @throws {Error} |
| 9565 |
*/ |
| 9566 |
|
| 9567 |
}, { |
| 9568 |
key: "getType", |
| 9569 |
value: function getType() { |
| 9570 |
elementorModules.ForceMethodImplementation(); |
| 9571 |
} |
| 9572 |
/** |
| 9573 |
* Function getCommand(). |
| 9574 |
* |
| 9575 |
* Returns the full command path for callback binding. |
| 9576 |
* |
| 9577 |
* Supports array of strings ( commands ). |
| 9578 |
* |
| 9579 |
* @returns {string} |
| 9580 |
* |
| 9581 |
* @throws {Error} |
| 9582 |
*/ |
| 9583 |
|
| 9584 |
}, { |
| 9585 |
key: "getCommand", |
| 9586 |
value: function getCommand() { |
| 9587 |
elementorModules.ForceMethodImplementation(); |
| 9588 |
} |
| 9589 |
/** |
| 9590 |
* Function getId(). |
| 9591 |
* |
| 9592 |
* Returns command id for the hook (should be unique). |
| 9593 |
* |
| 9594 |
* @returns {string} |
| 9595 |
* |
| 9596 |
* @throws {Error} |
| 9597 |
*/ |
| 9598 |
|
| 9599 |
}, { |
| 9600 |
key: "getId", |
| 9601 |
value: function getId() { |
| 9602 |
elementorModules.ForceMethodImplementation(); |
| 9603 |
} |
| 9604 |
/** |
| 9605 |
* Function getContainerType(). |
| 9606 |
* |
| 9607 |
* Bind eContainer type to callback. |
| 9608 |
* |
| 9609 |
* Used to gain performance. |
| 9610 |
* |
| 9611 |
* @return {string} type |
| 9612 |
*/ |
| 9613 |
|
| 9614 |
}, { |
| 9615 |
key: "getContainerType", |
| 9616 |
value: function getContainerType() {} |
| 9617 |
/** |
| 9618 |
* Function getConditions(). |
| 9619 |
* |
| 9620 |
* Condition for running the callback, if true, call to apply(). |
| 9621 |
* |
| 9622 |
* @param [args={}] |
| 9623 |
* @param [result=*] |
| 9624 |
* |
| 9625 |
* @returns {boolean} |
| 9626 |
*/ |
| 9627 |
|
| 9628 |
}, { |
| 9629 |
key: "getConditions", |
| 9630 |
value: function getConditions() { |
| 9631 |
var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; |
| 9632 |
var result = arguments.length > 1 ? arguments[1] : undefined; |
| 9633 |
// eslint-disable-line no-unused-vars |
| 9634 |
return true; |
| 9635 |
} |
| 9636 |
/** |
| 9637 |
* Function apply(). |
| 9638 |
* |
| 9639 |
* Apply the callback, ( The actual affect of the callback ). |
| 9640 |
* |
| 9641 |
* @param [args={}] |
| 9642 |
* |
| 9643 |
* @returns {*} |
| 9644 |
*/ |
| 9645 |
|
| 9646 |
}, { |
| 9647 |
key: "apply", |
| 9648 |
value: function apply(args) { |
| 9649 |
// eslint-disable-line no-unused-vars |
| 9650 |
elementorModules.ForceMethodImplementation(); |
| 9651 |
} |
| 9652 |
/** |
| 9653 |
* Function run(). |
| 9654 |
* |
| 9655 |
* Run the callback. |
| 9656 |
* |
| 9657 |
* @param {*} args |
| 9658 |
* |
| 9659 |
* @returns {*} |
| 9660 |
*/ |
| 9661 |
|
| 9662 |
}, { |
| 9663 |
key: "run", |
| 9664 |
value: function run() { |
| 9665 |
var _ref = arguments.length <= 0 ? undefined : arguments[0], |
| 9666 |
_ref$options = _ref.options, |
| 9667 |
options = _ref$options === void 0 ? {} : _ref$options; // Disable callback if requested by args.options. |
| 9668 |
|
| 9669 |
|
| 9670 |
if (options.callbacks && false === options.callbacks[this.id]) { |
| 9671 |
return true; |
| 9672 |
} |
| 9673 |
|
| 9674 |
if (this.getConditions.apply(this, arguments)) { |
| 9675 |
if ($e.devTools) { |
| 9676 |
$e.devTools.log.callbacks().active(this.type, this.command, this.id); |
| 9677 |
} |
| 9678 |
|
| 9679 |
return this.apply.apply(this, arguments); |
| 9680 |
} |
| 9681 |
|
| 9682 |
return true; |
| 9683 |
} |
| 9684 |
}]); |
| 9685 |
return HookBase; |
| 9686 |
}(); |
| 9687 |
|
| 9688 |
exports.default = HookBase; |
| 9689 |
|
| 9690 |
/***/ }), |
| 9691 |
/* 295 */ |
| 9692 |
/***/ (function(module, exports, __webpack_require__) { |
| 9693 |
|
| 9694 |
var global = __webpack_require__(17); |
| 9695 |
var inheritIfRequired = __webpack_require__(310); |
| 9696 |
var dP = __webpack_require__(45).f; |
| 9697 |
var gOPN = __webpack_require__(312).f; |
| 9698 |
var isRegExp = __webpack_require__(122); |
| 9699 |
var $flags = __webpack_require__(106); |
| 9700 |
var $RegExp = global.RegExp; |
| 9701 |
var Base = $RegExp; |
| 9702 |
var proto = $RegExp.prototype; |
| 9703 |
var re1 = /a/g; |
| 9704 |
var re2 = /a/g; |
| 9705 |
// "new" creates a new object, old webkit buggy here |
| 9706 |
var CORRECT_NEW = new $RegExp(re1) !== re1; |
| 9707 |
|
| 9708 |
if (__webpack_require__(27) && (!CORRECT_NEW || __webpack_require__(33)(function () { |
| 9709 |
re2[__webpack_require__(12)('match')] = false; |
| 9710 |
// RegExp constructor can alter flags and IsRegExp works correct with @@match |
| 9711 |
return $RegExp(re1) != re1 || $RegExp(re2) == re2 || $RegExp(re1, 'i') != '/a/i'; |
| 9712 |
}))) { |
| 9713 |
$RegExp = function RegExp(p, f) { |
| 9714 |
var tiRE = this instanceof $RegExp; |
| 9715 |
var piRE = isRegExp(p); |
| 9716 |
var fiU = f === undefined; |
| 9717 |
return !tiRE && piRE && p.constructor === $RegExp && fiU ? p |
| 9718 |
: inheritIfRequired(CORRECT_NEW |
| 9719 |
? new Base(piRE && !fiU ? p.source : p, f) |
| 9720 |
: Base((piRE = p instanceof $RegExp) ? p.source : p, piRE && fiU ? $flags.call(p) : f) |
| 9721 |
, tiRE ? this : proto, $RegExp); |
| 9722 |
}; |
| 9723 |
var proxy = function (key) { |
| 9724 |
key in $RegExp || dP($RegExp, key, { |
| 9725 |
configurable: true, |
| 9726 |
get: function () { return Base[key]; }, |
| 9727 |
set: function (it) { Base[key] = it; } |
| 9728 |
}); |
| 9729 |
}; |
| 9730 |
for (var keys = gOPN(Base), i = 0; keys.length > i;) proxy(keys[i++]); |
| 9731 |
proto.constructor = $RegExp; |
| 9732 |
$RegExp.prototype = proto; |
| 9733 |
__webpack_require__(37)(global, 'RegExp', $RegExp); |
| 9734 |
} |
| 9735 |
|
| 9736 |
__webpack_require__(309)('RegExp'); |
| 9737 |
|
| 9738 |
|
| 9739 |
/***/ }), |
| 9740 |
/* 296 */ |
| 9741 |
/***/ (function(module, exports, __webpack_require__) { |
| 9742 |
|
| 9743 |
"use strict"; |
| 9744 |
|
| 9745 |
|
| 9746 |
var _interopRequireDefault = __webpack_require__(0); |
| 9747 |
|
| 9748 |
var _Object$defineProperty = __webpack_require__(1); |
| 9749 |
|
| 9750 |
_Object$defineProperty(exports, "__esModule", { |
| 9751 |
value: true |
| 9752 |
}); |
| 9753 |
|
| 9754 |
exports.default = void 0; |
| 9755 |
|
| 9756 |
var _assign = _interopRequireDefault(__webpack_require__(134)); |
| 9757 |
|
| 9758 |
var _classCallCheck2 = _interopRequireDefault(__webpack_require__(2)); |
| 9759 |
|
| 9760 |
var _createClass2 = _interopRequireDefault(__webpack_require__(3)); |
| 9761 |
|
| 9762 |
var _inherits2 = _interopRequireDefault(__webpack_require__(4)); |
| 9763 |
|
| 9764 |
var _createSuper2 = _interopRequireDefault(__webpack_require__(5)); |
| 9765 |
|
| 9766 |
var _helper = _interopRequireDefault(__webpack_require__(215)); |
| 9767 |
|
| 9768 |
var AddSectionBase = /*#__PURE__*/function (_Marionette$ItemView) { |
| 9769 |
(0, _inherits2.default)(AddSectionBase, _Marionette$ItemView); |
| 9770 |
|
| 9771 |
var _super = (0, _createSuper2.default)(AddSectionBase); |
| 9772 |
|
| 9773 |
function AddSectionBase() { |
| 9774 |
(0, _classCallCheck2.default)(this, AddSectionBase); |
| 9775 |
return _super.apply(this, arguments); |
| 9776 |
} |
| 9777 |
|
| 9778 |
(0, _createClass2.default)(AddSectionBase, [{ |
| 9779 |
key: "template", |
| 9780 |
value: function template() { |
| 9781 |
return Marionette.TemplateCache.get('#tmpl-elementor-add-section'); |
| 9782 |
} |
| 9783 |
}, { |
| 9784 |
key: "attributes", |
| 9785 |
value: function attributes() { |
| 9786 |
return { |
| 9787 |
'data-view': 'choose-action' |
| 9788 |
}; |
| 9789 |
} |
| 9790 |
}, { |
| 9791 |
key: "ui", |
| 9792 |
value: function ui() { |
| 9793 |
return { |
| 9794 |
addNewSection: '.elementor-add-new-section', |
| 9795 |
closeButton: '.elementor-add-section-close', |
| 9796 |
addSectionButton: '.elementor-add-section-button', |
| 9797 |
addTemplateButton: '.elementor-add-template-button', |
| 9798 |
selectPreset: '.elementor-select-preset', |
| 9799 |
presets: '.elementor-preset' |
| 9800 |
}; |
| 9801 |
} |
| 9802 |
}, { |
| 9803 |
key: "events", |
| 9804 |
value: function events() { |
| 9805 |
return { |
| 9806 |
'click @ui.addSectionButton': 'onAddSectionButtonClick', |
| 9807 |
'click @ui.addTemplateButton': 'onAddTemplateButtonClick', |
| 9808 |
'click @ui.closeButton': 'onCloseButtonClick', |
| 9809 |
'click @ui.presets': 'onPresetSelected' |
| 9810 |
}; |
| 9811 |
} |
| 9812 |
}, { |
| 9813 |
key: "behaviors", |
| 9814 |
value: function behaviors() { |
| 9815 |
return { |
| 9816 |
contextMenu: { |
| 9817 |
behaviorClass: __webpack_require__(273), |
| 9818 |
groups: this.getContextMenuGroups() |
| 9819 |
} |
| 9820 |
}; |
| 9821 |
} |
| 9822 |
}, { |
| 9823 |
key: "className", |
| 9824 |
value: function className() { |
| 9825 |
return 'elementor-add-section elementor-visible-desktop'; |
| 9826 |
} |
| 9827 |
}, { |
| 9828 |
key: "setView", |
| 9829 |
value: function setView(view) { |
| 9830 |
this.$el.attr('data-view', view); |
| 9831 |
} |
| 9832 |
}, { |
| 9833 |
key: "showSelectPresets", |
| 9834 |
value: function showSelectPresets() { |
| 9835 |
this.setView('select-preset'); |
| 9836 |
} |
| 9837 |
}, { |
| 9838 |
key: "closeSelectPresets", |
| 9839 |
value: function closeSelectPresets() { |
| 9840 |
this.setView('choose-action'); |
| 9841 |
} |
| 9842 |
}, { |
| 9843 |
key: "getTemplatesModalOptions", |
| 9844 |
value: function getTemplatesModalOptions() { |
| 9845 |
return { |
| 9846 |
importOptions: { |
| 9847 |
at: this.getOption('at') |
| 9848 |
} |
| 9849 |
}; |
| 9850 |
} |
| 9851 |
}, { |
| 9852 |
key: "getContextMenuGroups", |
| 9853 |
value: function getContextMenuGroups() { |
| 9854 |
var _this = this; |
| 9855 |
|
| 9856 |
var hasContent = function hasContent() { |
| 9857 |
return elementor.elements.length > 0; |
| 9858 |
}; |
| 9859 |
|
| 9860 |
return [{ |
| 9861 |
name: 'paste', |
| 9862 |
actions: [{ |
| 9863 |
name: 'paste', |
| 9864 |
title: elementor.translate('paste'), |
| 9865 |
isEnabled: function isEnabled() { |
| 9866 |
return _helper.default.isPasteEnabled(elementor.getPreviewContainer()); |
| 9867 |
}, |
| 9868 |
callback: function callback() { |
| 9869 |
return $e.run('document/ui/paste', { |
| 9870 |
container: elementor.getPreviewContainer(), |
| 9871 |
options: { |
| 9872 |
at: _this.getOption('at'), |
| 9873 |
rebuild: true |
| 9874 |
}, |
| 9875 |
onAfter: function onAfter() { |
| 9876 |
return _this.onAfterPaste(); |
| 9877 |
} |
| 9878 |
}); |
| 9879 |
} |
| 9880 |
}] |
| 9881 |
}, { |
| 9882 |
name: 'content', |
| 9883 |
actions: [{ |
| 9884 |
name: 'copy_all_content', |
| 9885 |
title: elementor.translate('copy_all_content'), |
| 9886 |
isEnabled: hasContent, |
| 9887 |
callback: function callback() { |
| 9888 |
return $e.run('document/elements/copy-all'); |
| 9889 |
} |
| 9890 |
}, { |
| 9891 |
name: 'delete_all_content', |
| 9892 |
title: elementor.translate('delete_all_content'), |
| 9893 |
isEnabled: hasContent, |
| 9894 |
callback: function callback() { |
| 9895 |
return $e.run('document/elements/empty'); |
| 9896 |
} |
| 9897 |
}] |
| 9898 |
}]; |
| 9899 |
} |
| 9900 |
}, { |
| 9901 |
key: "onAddSectionButtonClick", |
| 9902 |
value: function onAddSectionButtonClick() { |
| 9903 |
this.showSelectPresets(); |
| 9904 |
} |
| 9905 |
}, { |
| 9906 |
key: "onAddTemplateButtonClick", |
| 9907 |
value: function onAddTemplateButtonClick() { |
| 9908 |
$e.run('library/open', this.getTemplatesModalOptions()); |
| 9909 |
} |
| 9910 |
}, { |
| 9911 |
key: "onRender", |
| 9912 |
value: function onRender() { |
| 9913 |
this.$el.html5Droppable({ |
| 9914 |
axis: ['vertical'], |
| 9915 |
groups: ['elementor-element'], |
| 9916 |
placeholder: false, |
| 9917 |
currentElementClass: 'elementor-html5dnd-current-element', |
| 9918 |
hasDraggingOnChildClass: 'elementor-dragging-on-child', |
| 9919 |
onDropping: this.onDropping.bind(this) |
| 9920 |
}); |
| 9921 |
} |
| 9922 |
}, { |
| 9923 |
key: "onPresetSelected", |
| 9924 |
value: function onPresetSelected(event) { |
| 9925 |
this.closeSelectPresets(); |
| 9926 |
var selectedStructure = event.currentTarget.dataset.structure, |
| 9927 |
parsedStructure = elementor.presetsFactory.getParsedStructure(selectedStructure); |
| 9928 |
$e.run('document/elements/create', { |
| 9929 |
model: { |
| 9930 |
elType: 'section' |
| 9931 |
}, |
| 9932 |
container: elementor.getPreviewContainer(), |
| 9933 |
columns: parsedStructure.columnsCount, |
| 9934 |
structure: selectedStructure, |
| 9935 |
options: (0, _assign.default)({}, this.options) |
| 9936 |
}); |
| 9937 |
} |
| 9938 |
}, { |
| 9939 |
key: "onDropping", |
| 9940 |
value: function onDropping() { |
| 9941 |
if (elementor.helpers.maybeDisableWidget()) { |
| 9942 |
return; |
| 9943 |
} |
| 9944 |
|
| 9945 |
var selectedElement = elementor.channels.panelElements.request('element:selected'), |
| 9946 |
historyId = $e.internal('document/history/start-log', { |
| 9947 |
type: 'add', |
| 9948 |
title: elementor.helpers.getModelLabel(selectedElement.model) |
| 9949 |
}), |
| 9950 |
eSection = $e.run('document/elements/create', { |
| 9951 |
model: { |
| 9952 |
elType: 'section' |
| 9953 |
}, |
| 9954 |
container: elementor.getPreviewContainer(), |
| 9955 |
columns: 1, |
| 9956 |
options: { |
| 9957 |
at: this.getOption('at'), |
| 9958 |
// BC: Deprecated since 2.8.0 - use `$e.hooks`. |
| 9959 |
trigger: { |
| 9960 |
beforeAdd: 'section:before:drop', |
| 9961 |
afterAdd: 'section:after:drop' |
| 9962 |
} |
| 9963 |
} |
| 9964 |
}); // Create the element in column. |
| 9965 |
|
| 9966 |
eSection.view.children.findByIndex(0).addElementFromPanel(); |
| 9967 |
$e.internal('document/history/end-log', { |
| 9968 |
id: historyId |
| 9969 |
}); |
| 9970 |
} |
| 9971 |
}, { |
| 9972 |
key: "onAfterPaste", |
| 9973 |
value: function onAfterPaste() {} |
| 9974 |
}]); |
| 9975 |
return AddSectionBase; |
| 9976 |
}(Marionette.ItemView); |
| 9977 |
|
| 9978 |
var _default = AddSectionBase; |
| 9979 |
exports.default = _default; |
| 9980 |
|
| 9981 |
/***/ }), |
| 9982 |
/* 297 */ |
| 9983 |
/***/ (function(module, exports, __webpack_require__) { |
| 9984 |
|
| 9985 |
"use strict"; |
| 9986 |
|
| 9987 |
|
| 9988 |
var _interopRequireDefault = __webpack_require__(0); |
| 9989 |
|
| 9990 |
__webpack_require__(25); |
| 9991 |
|
| 9992 |
__webpack_require__(39); |
| 9993 |
|
| 9994 |
var _isArray = _interopRequireDefault(__webpack_require__(84)); |
| 9995 |
|
| 9996 |
var _typeof2 = _interopRequireDefault(__webpack_require__(48)); |
| 9997 |
|
| 9998 |
var _parseInt2 = _interopRequireDefault(__webpack_require__(213)); |
| 9999 |
|
| 10000 |
var _keys = _interopRequireDefault(__webpack_require__(23)); |
| 10001 |
|
| 10002 |
var _environment = _interopRequireDefault(__webpack_require__(272)); |
| 10003 |
|
| 10004 |
var _helper = _interopRequireDefault(__webpack_require__(215)); |
| 10005 |
|
| 10006 |
var ControlsCSSParser = __webpack_require__(293), |
| 10007 |
Validator = __webpack_require__(300), |
| 10008 |
BaseContainer = __webpack_require__(333), |
| 10009 |
BaseElementView; |
| 10010 |
|
| 10011 |
BaseElementView = BaseContainer.extend({ |
| 10012 |
tagName: 'div', |
| 10013 |
controlsCSSParser: null, |
| 10014 |
allowRender: true, |
| 10015 |
toggleEditTools: false, |
| 10016 |
renderAttributes: {}, |
| 10017 |
className: function className() { |
| 10018 |
var classes = 'elementor-element elementor-element-edit-mode ' + this.getElementUniqueID(); |
| 10019 |
|
| 10020 |
if (this.toggleEditTools) { |
| 10021 |
classes += ' elementor-element--toggle-edit-tools'; |
| 10022 |
} |
| 10023 |
|
| 10024 |
return classes; |
| 10025 |
}, |
| 10026 |
attributes: function attributes() { |
| 10027 |
return { |
| 10028 |
'data-id': this.getID(), |
| 10029 |
'data-element_type': this.model.get('elType') |
| 10030 |
}; |
| 10031 |
}, |
| 10032 |
ui: function ui() { |
| 10033 |
return { |
| 10034 |
tools: '> .elementor-element-overlay > .elementor-editor-element-settings', |
| 10035 |
editButton: '> .elementor-element-overlay .elementor-editor-element-edit', |
| 10036 |
duplicateButton: '> .elementor-element-overlay .elementor-editor-element-duplicate', |
| 10037 |
addButton: '> .elementor-element-overlay .elementor-editor-element-add', |
| 10038 |
removeButton: '> .elementor-element-overlay .elementor-editor-element-remove' |
| 10039 |
}; |
| 10040 |
}, |
| 10041 |
behaviors: function behaviors() { |
| 10042 |
var groups = elementor.hooks.applyFilters('elements/' + this.options.model.get('elType') + '/contextMenuGroups', this.getContextMenuGroups(), this); |
| 10043 |
var behaviors = { |
| 10044 |
contextMenu: { |
| 10045 |
behaviorClass: __webpack_require__(273), |
| 10046 |
groups: groups |
| 10047 |
} |
| 10048 |
}; |
| 10049 |
return elementor.hooks.applyFilters('elements/base/behaviors', behaviors, this); |
| 10050 |
}, |
| 10051 |
getBehavior: function getBehavior(name) { |
| 10052 |
return this._behaviors[(0, _keys.default)(this.behaviors()).indexOf(name)]; |
| 10053 |
}, |
| 10054 |
events: function events() { |
| 10055 |
return { |
| 10056 |
mousedown: 'onMouseDown', |
| 10057 |
'click @ui.editButton': 'onEditButtonClick', |
| 10058 |
'click @ui.duplicateButton': 'onDuplicateButtonClick', |
| 10059 |
'click @ui.addButton': 'onAddButtonClick', |
| 10060 |
'click @ui.removeButton': 'onRemoveButtonClick' |
| 10061 |
}; |
| 10062 |
}, |
| 10063 |
getElementType: function getElementType() { |
| 10064 |
return this.model.get('elType'); |
| 10065 |
}, |
| 10066 |
getIDInt: function getIDInt() { |
| 10067 |
return (0, _parseInt2.default)(this.getID(), 16); |
| 10068 |
}, |
| 10069 |
getChildType: function getChildType() { |
| 10070 |
return elementor.helpers.getElementChildType(this.getElementType()); |
| 10071 |
}, |
| 10072 |
getChildView: function getChildView(model) { |
| 10073 |
var ChildView; |
| 10074 |
var elType = model.get('elType'); |
| 10075 |
|
| 10076 |
if ('section' === elType) { |
| 10077 |
ChildView = __webpack_require__(256); |
| 10078 |
} else if ('column' === elType) { |
| 10079 |
ChildView = __webpack_require__(374); |
| 10080 |
} else { |
| 10081 |
ChildView = elementor.modules.elements.views.Widget; |
| 10082 |
} |
| 10083 |
|
| 10084 |
return elementor.hooks.applyFilters('element/view', ChildView, model, this); |
| 10085 |
}, |
| 10086 |
getTemplateType: function getTemplateType() { |
| 10087 |
return 'js'; |
| 10088 |
}, |
| 10089 |
getEditModel: function getEditModel() { |
| 10090 |
return this.model; |
| 10091 |
}, |
| 10092 |
getContainer: function getContainer() { |
| 10093 |
var _this = this; |
| 10094 |
|
| 10095 |
if (!this.container) { |
| 10096 |
var settingsModel = this.model.get('settings'); |
| 10097 |
this.container = new elementorModules.editor.Container({ |
| 10098 |
type: this.model.get('elType'), |
| 10099 |
id: this.model.id, |
| 10100 |
model: this.model, |
| 10101 |
settings: settingsModel, |
| 10102 |
view: this, |
| 10103 |
parent: this._parent ? this._parent.getContainer() : {}, |
| 10104 |
children: [], |
| 10105 |
label: elementor.helpers.getModelLabel(this.model), |
| 10106 |
controls: settingsModel.options.controls |
| 10107 |
}); |
| 10108 |
|
| 10109 |
if ((0, _keys.default)(this.container.parent).length) { |
| 10110 |
this.container.parent.children[this._index] = this.container; |
| 10111 |
this.on('destroy', function () { |
| 10112 |
delete _this.container.parent.children[_this._index]; |
| 10113 |
_this.container.parent.children = _this.container.parent.children.filter(function (child) { |
| 10114 |
return null !== child; |
| 10115 |
}); |
| 10116 |
}); |
| 10117 |
} |
| 10118 |
} |
| 10119 |
|
| 10120 |
return this.container; |
| 10121 |
}, |
| 10122 |
getContextMenuGroups: function getContextMenuGroups() { |
| 10123 |
var _this2 = this; |
| 10124 |
|
| 10125 |
var controlSign = _environment.default.mac ? '⌘' : '^'; |
| 10126 |
return [{ |
| 10127 |
name: 'general', |
| 10128 |
actions: [{ |
| 10129 |
name: 'edit', |
| 10130 |
icon: 'eicon-edit', |
| 10131 |
title: elementor.translate('edit_element', [this.options.model.getTitle()]), |
| 10132 |
callback: function callback() { |
| 10133 |
return $e.run('panel/editor/open', { |
| 10134 |
model: _this2.options.model, |
| 10135 |
// Todo: remove on merge router |
| 10136 |
view: _this2, |
| 10137 |
// Todo: remove on merge router |
| 10138 |
container: _this2.getContainer() |
| 10139 |
}); |
| 10140 |
} |
| 10141 |
}, { |
| 10142 |
name: 'duplicate', |
| 10143 |
icon: 'eicon-clone', |
| 10144 |
title: elementor.translate('duplicate'), |
| 10145 |
shortcut: controlSign + '+D', |
| 10146 |
callback: function callback() { |
| 10147 |
return $e.run('document/elements/duplicate', { |
| 10148 |
container: _this2.getContainer() |
| 10149 |
}); |
| 10150 |
} |
| 10151 |
}] |
| 10152 |
}, { |
| 10153 |
name: 'clipboard', |
| 10154 |
actions: [{ |
| 10155 |
name: 'copy', |
| 10156 |
title: elementor.translate('copy'), |
| 10157 |
shortcut: controlSign + '+C', |
| 10158 |
callback: function callback() { |
| 10159 |
return $e.run('document/elements/copy', { |
| 10160 |
container: _this2.getContainer() |
| 10161 |
}); |
| 10162 |
} |
| 10163 |
}, { |
| 10164 |
name: 'paste', |
| 10165 |
title: elementor.translate('paste'), |
| 10166 |
shortcut: controlSign + '+V', |
| 10167 |
isEnabled: function isEnabled() { |
| 10168 |
return _helper.default.isPasteEnabled(_this2.getContainer()); |
| 10169 |
}, |
| 10170 |
callback: function callback() { |
| 10171 |
return $e.run('document/ui/paste', { |
| 10172 |
container: _this2.getContainer() |
| 10173 |
}); |
| 10174 |
} |
| 10175 |
}, { |
| 10176 |
name: 'pasteStyle', |
| 10177 |
title: elementor.translate('paste_style'), |
| 10178 |
shortcut: controlSign + '+⇧+V', |
| 10179 |
isEnabled: function isEnabled() { |
| 10180 |
return !!elementorCommon.storage.get('clipboard'); |
| 10181 |
}, |
| 10182 |
callback: function callback() { |
| 10183 |
return $e.run('document/elements/paste-style', { |
| 10184 |
container: _this2.getContainer() |
| 10185 |
}); |
| 10186 |
} |
| 10187 |
}, { |
| 10188 |
name: 'resetStyle', |
| 10189 |
title: elementor.translate('reset_style'), |
| 10190 |
callback: function callback() { |
| 10191 |
return $e.run('document/elements/reset-style', { |
| 10192 |
container: _this2.getContainer() |
| 10193 |
}); |
| 10194 |
} |
| 10195 |
}] |
| 10196 |
}, { |
| 10197 |
name: 'delete', |
| 10198 |
actions: [{ |
| 10199 |
name: 'delete', |
| 10200 |
icon: 'eicon-trash', |
| 10201 |
title: elementor.translate('delete'), |
| 10202 |
shortcut: '⌦', |
| 10203 |
callback: function callback() { |
| 10204 |
return $e.run('document/elements/delete', { |
| 10205 |
container: _this2.getContainer() |
| 10206 |
}); |
| 10207 |
} |
| 10208 |
}] |
| 10209 |
}]; |
| 10210 |
}, |
| 10211 |
getEditButtons: function getEditButtons() { |
| 10212 |
return {}; |
| 10213 |
}, |
| 10214 |
initialize: function initialize() { |
| 10215 |
var _this3 = this; |
| 10216 |
|
| 10217 |
BaseContainer.prototype.initialize.apply(this, arguments); |
| 10218 |
var editModel = this.getEditModel(); |
| 10219 |
|
| 10220 |
if (this.collection && this.onCollectionChanged) { |
| 10221 |
elementorCommon.helpers.softDeprecated('onCollectionChanged', '2.8.0', '$e.hooks'); |
| 10222 |
this.listenTo(this.collection, 'add remove reset', this.onCollectionChanged, this); |
| 10223 |
} |
| 10224 |
|
| 10225 |
if (this.onSettingsChanged) { |
| 10226 |
elementorCommon.helpers.softDeprecated('onSettingsChanged', '2.8.0', '$e.hooks'); |
| 10227 |
this.listenTo(editModel.get('settings'), 'change', this.onSettingsChanged); |
| 10228 |
} |
| 10229 |
|
| 10230 |
this.listenTo(editModel.get('editSettings'), 'change', this.onEditSettingsChanged).listenTo(this.model, 'request:edit', this.onEditRequest).listenTo(this.model, 'request:toggleVisibility', this.toggleVisibility); |
| 10231 |
this.initControlsCSSParser(); |
| 10232 |
|
| 10233 |
_.defer(function () { |
| 10234 |
// Init container. Defer - in order to init the container after the element is fully initialized, and properties like `_parent` are available. |
| 10235 |
_this3.getContainer(); |
| 10236 |
}); |
| 10237 |
}, |
| 10238 |
getHandlesOverlay: function getHandlesOverlay() { |
| 10239 |
var $handlesOverlay = jQuery('<div>', { |
| 10240 |
class: 'elementor-element-overlay' |
| 10241 |
}), |
| 10242 |
$overlayList = jQuery('<ul>', { |
| 10243 |
class: "elementor-editor-element-settings elementor-editor-".concat(this.getElementType(), "-settings") |
| 10244 |
}); |
| 10245 |
jQuery.each(this.getEditButtons(), function (toolName, tool) { |
| 10246 |
var $item = jQuery('<li>', { |
| 10247 |
class: "elementor-editor-element-setting elementor-editor-element-".concat(toolName), |
| 10248 |
title: tool.title |
| 10249 |
}), |
| 10250 |
$icon = jQuery('<i>', { |
| 10251 |
class: "eicon-".concat(tool.icon), |
| 10252 |
'aria-hidden': true |
| 10253 |
}), |
| 10254 |
$a11y = jQuery('<span>', { |
| 10255 |
class: 'elementor-screen-only' |
| 10256 |
}); |
| 10257 |
$a11y.text(tool.title); |
| 10258 |
$item.append($icon, $a11y); |
| 10259 |
$overlayList.append($item); |
| 10260 |
}); |
| 10261 |
$handlesOverlay.append($overlayList); |
| 10262 |
return $handlesOverlay; |
| 10263 |
}, |
| 10264 |
attachElContent: function attachElContent(html) { |
| 10265 |
this.$el.empty().append(this.getHandlesOverlay(), html); |
| 10266 |
}, |
| 10267 |
startTransport: function startTransport() { |
| 10268 |
elementorCommon.helpers.softDeprecated('element.startTransport', '2.8.0', "$e.run( 'document/elements/copy' )"); |
| 10269 |
$e.run('document/elements/copy', { |
| 10270 |
container: this.getContainer() |
| 10271 |
}); |
| 10272 |
}, |
| 10273 |
copy: function copy() { |
| 10274 |
elementorCommon.helpers.softDeprecated('element.copy', '2.8.0', "$e.run( 'document/elements/copy' )"); |
| 10275 |
$e.run('document/elements/copy', { |
| 10276 |
container: this.getContainer() |
| 10277 |
}); |
| 10278 |
}, |
| 10279 |
cut: function cut() { |
| 10280 |
elementorCommon.helpers.softDeprecated('element.cut', '2.8.0'); |
| 10281 |
}, |
| 10282 |
paste: function paste() { |
| 10283 |
elementorCommon.helpers.softDeprecated('element.paste', '2.8.0', "$e.run( 'document/elements/paste' )"); |
| 10284 |
$e.run('document/elements/paste', { |
| 10285 |
container: this.getContainer(), |
| 10286 |
at: this._parent.collection.indexOf(this.model) |
| 10287 |
}); |
| 10288 |
}, |
| 10289 |
duplicate: function duplicate() { |
| 10290 |
elementorCommon.helpers.softDeprecated('element.duplicate', '2.8.0', "$e.run( 'document/elements/duplicate' )"); |
| 10291 |
$e.run('document/elements/duplicate', { |
| 10292 |
container: this.getContainer() |
| 10293 |
}); |
| 10294 |
}, |
| 10295 |
pasteStyle: function pasteStyle() { |
| 10296 |
elementorCommon.helpers.softDeprecated('element.pasteStyle', '2.8.0', "$e.run( 'document/elements/paste-style' )"); |
| 10297 |
$e.run('document/elements/paste-style', { |
| 10298 |
container: this.getContainer() |
| 10299 |
}); |
| 10300 |
}, |
| 10301 |
resetStyle: function resetStyle() { |
| 10302 |
elementorCommon.helpers.softDeprecated('element.resetStyle', '2.8.0', "$e.run( 'document/elements/reset-style' )"); |
| 10303 |
$e.run('document/elements/reset-style', { |
| 10304 |
container: this.getContainer() |
| 10305 |
}); |
| 10306 |
}, |
| 10307 |
isStyleTransferControl: function isStyleTransferControl(control) { |
| 10308 |
if (undefined !== control.style_transfer) { |
| 10309 |
return control.style_transfer; |
| 10310 |
} |
| 10311 |
|
| 10312 |
return 'content' !== control.tab || control.selectors || control.prefix_class; |
| 10313 |
}, |
| 10314 |
toggleVisibility: function toggleVisibility() { |
| 10315 |
this.model.set('hidden', !this.model.get('hidden')); |
| 10316 |
this.toggleVisibilityClass(); |
| 10317 |
}, |
| 10318 |
toggleVisibilityClass: function toggleVisibilityClass() { |
| 10319 |
this.$el.toggleClass('elementor-edit-hidden', !!this.model.get('hidden')); |
| 10320 |
}, |
| 10321 |
addElementFromPanel: function addElementFromPanel(options) { |
| 10322 |
options = options || {}; |
| 10323 |
var elementView = elementor.channels.panelElements.request('element:selected'), |
| 10324 |
model = { |
| 10325 |
elType: elementView.model.get('elType') |
| 10326 |
}; |
| 10327 |
|
| 10328 |
if (elementor.helpers.maybeDisableWidget()) { |
| 10329 |
return; |
| 10330 |
} |
| 10331 |
|
| 10332 |
if ('widget' === model.elType) { |
| 10333 |
model.widgetType = elementView.model.get('widgetType'); |
| 10334 |
} else if ('section' === model.elType) { |
| 10335 |
model.isInner = true; |
| 10336 |
} else { |
| 10337 |
return; |
| 10338 |
} |
| 10339 |
|
| 10340 |
var customData = elementView.model.get('custom'); |
| 10341 |
|
| 10342 |
if (customData) { |
| 10343 |
jQuery.extend(model, customData); |
| 10344 |
} |
| 10345 |
|
| 10346 |
return $e.run('document/elements/create', { |
| 10347 |
container: this.getContainer(), |
| 10348 |
model: model, |
| 10349 |
options: options |
| 10350 |
}); |
| 10351 |
}, |
| 10352 |
// TODO: Unused function. |
| 10353 |
addControlValidator: function addControlValidator(controlName, validationCallback) { |
| 10354 |
validationCallback = validationCallback.bind(this); |
| 10355 |
var validator = new Validator({ |
| 10356 |
customValidationMethod: validationCallback |
| 10357 |
}), |
| 10358 |
validators = this.getEditModel().get('settings').validators; |
| 10359 |
|
| 10360 |
if (!validators[controlName]) { |
| 10361 |
validators[controlName] = []; |
| 10362 |
} |
| 10363 |
|
| 10364 |
validators[controlName].push(validator); |
| 10365 |
}, |
| 10366 |
addRenderAttribute: function addRenderAttribute(element, key, value, overwrite) { |
| 10367 |
var self = this; |
| 10368 |
|
| 10369 |
if ('object' === (0, _typeof2.default)(element)) { |
| 10370 |
jQuery.each(element, function (elementKey, elementValue) { |
| 10371 |
self.addRenderAttribute(elementKey, elementValue, null, overwrite); |
| 10372 |
}); |
| 10373 |
return self; |
| 10374 |
} |
| 10375 |
|
| 10376 |
if ('object' === (0, _typeof2.default)(key)) { |
| 10377 |
jQuery.each(key, function (attributeKey, attributeValue) { |
| 10378 |
self.addRenderAttribute(element, attributeKey, attributeValue, overwrite); |
| 10379 |
}); |
| 10380 |
return self; |
| 10381 |
} |
| 10382 |
|
| 10383 |
if (!self.renderAttributes[element]) { |
| 10384 |
self.renderAttributes[element] = {}; |
| 10385 |
} |
| 10386 |
|
| 10387 |
if (!self.renderAttributes[element][key]) { |
| 10388 |
self.renderAttributes[element][key] = []; |
| 10389 |
} |
| 10390 |
|
| 10391 |
if (!(0, _isArray.default)(value)) { |
| 10392 |
value = [value]; |
| 10393 |
} |
| 10394 |
|
| 10395 |
if (overwrite) { |
| 10396 |
self.renderAttributes[element][key] = value; |
| 10397 |
} else { |
| 10398 |
self.renderAttributes[element][key] = self.renderAttributes[element][key].concat(value); |
| 10399 |
} |
| 10400 |
}, |
| 10401 |
getRenderAttributeString: function getRenderAttributeString(element) { |
| 10402 |
if (!this.renderAttributes[element]) { |
| 10403 |
return ''; |
| 10404 |
} |
| 10405 |
|
| 10406 |
var renderAttributes = this.renderAttributes[element], |
| 10407 |
attributes = []; |
| 10408 |
jQuery.each(renderAttributes, function (attributeKey, attributeValue) { |
| 10409 |
attributes.push(attributeKey + '="' + _.escape(attributeValue.join(' ')) + '"'); |
| 10410 |
}); |
| 10411 |
return attributes.join(' '); |
| 10412 |
}, |
| 10413 |
isInner: function isInner() { |
| 10414 |
return !!this.model.get('isInner'); |
| 10415 |
}, |
| 10416 |
initControlsCSSParser: function initControlsCSSParser() { |
| 10417 |
this.controlsCSSParser = new ControlsCSSParser({ |
| 10418 |
id: this.model.get('id'), |
| 10419 |
context: this, |
| 10420 |
settingsModel: this.getEditModel().get('settings'), |
| 10421 |
dynamicParsing: this.getDynamicParsingSettings() |
| 10422 |
}); |
| 10423 |
}, |
| 10424 |
enqueueFonts: function enqueueFonts() { |
| 10425 |
var editModel = this.getEditModel(), |
| 10426 |
settings = editModel.get('settings'); // Enqueue Icon Fonts |
| 10427 |
|
| 10428 |
jQuery.each(settings.getIconsControls(), function (index, control) { |
| 10429 |
var iconType = editModel.getSetting(control.name); |
| 10430 |
|
| 10431 |
if (!iconType || !iconType.library) { |
| 10432 |
return; |
| 10433 |
} |
| 10434 |
|
| 10435 |
elementor.helpers.enqueueIconFonts(iconType.library); |
| 10436 |
}); |
| 10437 |
}, |
| 10438 |
renderStyles: function renderStyles(settings) { |
| 10439 |
if (!settings) { |
| 10440 |
settings = this.getEditModel().get('settings'); |
| 10441 |
} |
| 10442 |
|
| 10443 |
this.controlsCSSParser.stylesheet.empty(); |
| 10444 |
this.controlsCSSParser.addStyleRules(settings.getStyleControls(), settings.attributes, this.getEditModel().get('settings').controls, [/{{ID}}/g, /{{WRAPPER}}/g], [this.getID(), '.elementor-' + elementor.config.document.id + ' .elementor-element.' + this.getElementUniqueID()]); |
| 10445 |
this.controlsCSSParser.addStyleToDocument(); |
| 10446 |
}, |
| 10447 |
renderCustomClasses: function renderCustomClasses() { |
| 10448 |
var self = this; |
| 10449 |
var settings = self.getEditModel().get('settings'), |
| 10450 |
classControls = settings.getClassControls(); // Remove all previous classes |
| 10451 |
|
| 10452 |
_.each(classControls, function (control) { |
| 10453 |
var previousClassValue = settings.previous(control.name); |
| 10454 |
|
| 10455 |
if (control.classes_dictionary) { |
| 10456 |
if (undefined !== control.classes_dictionary[previousClassValue]) { |
| 10457 |
previousClassValue = control.classes_dictionary[previousClassValue]; |
| 10458 |
} |
| 10459 |
} |
| 10460 |
|
| 10461 |
self.$el.removeClass(control.prefix_class + previousClassValue); |
| 10462 |
}); // Add new classes |
| 10463 |
|
| 10464 |
|
| 10465 |
_.each(classControls, function (control) { |
| 10466 |
var value = settings.attributes[control.name]; |
| 10467 |
var classValue = value; |
| 10468 |
|
| 10469 |
if (control.classes_dictionary) { |
| 10470 |
if (undefined !== control.classes_dictionary[value]) { |
| 10471 |
classValue = control.classes_dictionary[value]; |
| 10472 |
} |
| 10473 |
} |
| 10474 |
|
| 10475 |
var isVisible = elementor.helpers.isActiveControl(control, settings.attributes); |
| 10476 |
|
| 10477 |
if (isVisible && (classValue || 0 === classValue)) { |
| 10478 |
self.$el.addClass(control.prefix_class + classValue); |
| 10479 |
} |
| 10480 |
}); |
| 10481 |
|
| 10482 |
self.$el.addClass(_.result(self, 'className')); |
| 10483 |
self.toggleVisibilityClass(); |
| 10484 |
}, |
| 10485 |
renderCustomElementID: function renderCustomElementID() { |
| 10486 |
var customElementID = this.getEditModel().get('settings').get('_element_id'); |
| 10487 |
this.$el.attr('id', customElementID); |
| 10488 |
}, |
| 10489 |
renderUI: function renderUI() { |
| 10490 |
this.renderStyles(); |
| 10491 |
this.renderCustomClasses(); |
| 10492 |
this.renderCustomElementID(); |
| 10493 |
this.enqueueFonts(); |
| 10494 |
}, |
| 10495 |
runReadyTrigger: function runReadyTrigger() { |
| 10496 |
var self = this; |
| 10497 |
|
| 10498 |
_.defer(function () { |
| 10499 |
elementorFrontend.elementsHandler.runReadyTrigger(self.el); |
| 10500 |
|
| 10501 |
if (!elementorFrontend.isEditMode()) { |
| 10502 |
return; |
| 10503 |
} // In edit mode - handle an external elements that loaded by another elements like shortcode etc. |
| 10504 |
|
| 10505 |
|
| 10506 |
self.$el.find('.elementor-element.elementor-' + self.model.get('elType') + ':not(.elementor-element-edit-mode)').each(function () { |
| 10507 |
elementorFrontend.elementsHandler.runReadyTrigger(this); |
| 10508 |
}); |
| 10509 |
}); |
| 10510 |
}, |
| 10511 |
getID: function getID() { |
| 10512 |
return this.model.get('id'); |
| 10513 |
}, |
| 10514 |
getElementUniqueID: function getElementUniqueID() { |
| 10515 |
return 'elementor-element-' + this.getID(); |
| 10516 |
}, |
| 10517 |
renderHTML: function renderHTML() { |
| 10518 |
var templateType = this.getTemplateType(), |
| 10519 |
editModel = this.getEditModel(); |
| 10520 |
|
| 10521 |
if ('js' === templateType) { |
| 10522 |
this.getEditModel().setHtmlCache(); |
| 10523 |
this.render(); |
| 10524 |
editModel.renderOnLeave = true; |
| 10525 |
} else { |
| 10526 |
editModel.renderRemoteServer(); |
| 10527 |
} |
| 10528 |
}, |
| 10529 |
renderOnChange: function renderOnChange(settings) { |
| 10530 |
if (!this.allowRender) { |
| 10531 |
return; |
| 10532 |
} // Make sure is correct model |
| 10533 |
|
| 10534 |
|
| 10535 |
if (settings instanceof elementorModules.editor.elements.models.BaseSettings) { |
| 10536 |
var hasChanged = settings.hasChanged(); |
| 10537 |
var isContentChanged = !hasChanged, |
| 10538 |
isRenderRequired = !hasChanged; |
| 10539 |
|
| 10540 |
_.each(settings.changedAttributes(), function (settingValue, settingKey) { |
| 10541 |
var control = settings.getControl(settingKey); |
| 10542 |
|
| 10543 |
if ('_column_size' === settingKey) { |
| 10544 |
isRenderRequired = true; |
| 10545 |
return; |
| 10546 |
} |
| 10547 |
|
| 10548 |
if (!control) { |
| 10549 |
isRenderRequired = true; |
| 10550 |
isContentChanged = true; |
| 10551 |
return; |
| 10552 |
} |
| 10553 |
|
| 10554 |
if ('none' !== control.render_type) { |
| 10555 |
isRenderRequired = true; |
| 10556 |
} |
| 10557 |
|
| 10558 |
if (-1 !== ['none', 'ui'].indexOf(control.render_type)) { |
| 10559 |
return; |
| 10560 |
} |
| 10561 |
|
| 10562 |
if ('template' === control.render_type || !settings.isStyleControl(settingKey) && !settings.isClassControl(settingKey) && '_element_id' !== settingKey) { |
| 10563 |
isContentChanged = true; |
| 10564 |
} |
| 10565 |
}); |
| 10566 |
|
| 10567 |
if (!isRenderRequired) { |
| 10568 |
return; |
| 10569 |
} |
| 10570 |
|
| 10571 |
if (!isContentChanged) { |
| 10572 |
this.renderUI(); |
| 10573 |
return; |
| 10574 |
} |
| 10575 |
} // Re-render the template |
| 10576 |
|
| 10577 |
|
| 10578 |
this.renderHTML(); |
| 10579 |
}, |
| 10580 |
getDynamicParsingSettings: function getDynamicParsingSettings() { |
| 10581 |
var self = this; |
| 10582 |
return { |
| 10583 |
onServerRequestStart: function onServerRequestStart() { |
| 10584 |
self.$el.addClass('elementor-loading'); |
| 10585 |
}, |
| 10586 |
onServerRequestEnd: function onServerRequestEnd() { |
| 10587 |
self.render(); |
| 10588 |
self.$el.removeClass('elementor-loading'); |
| 10589 |
} |
| 10590 |
}; |
| 10591 |
}, |
| 10592 |
serializeData: function serializeData() { |
| 10593 |
var data = BaseContainer.prototype.serializeData.apply(this, arguments); |
| 10594 |
data.settings = this.getEditModel().get('settings').parseDynamicSettings(data.settings, this.getDynamicParsingSettings()); |
| 10595 |
return data; |
| 10596 |
}, |
| 10597 |
save: function save() { |
| 10598 |
$e.route('library/save-template', { |
| 10599 |
model: this.model |
| 10600 |
}); |
| 10601 |
}, |
| 10602 |
onBeforeRender: function onBeforeRender() { |
| 10603 |
this.renderAttributes = {}; |
| 10604 |
}, |
| 10605 |
onRender: function onRender() { |
| 10606 |
this.renderUI(); |
| 10607 |
this.runReadyTrigger(); |
| 10608 |
|
| 10609 |
if (this.toggleEditTools) { |
| 10610 |
var editButton = this.ui.editButton; // Since this.ui.tools does not exist while testing. |
| 10611 |
|
| 10612 |
if (this.ui.tools) { |
| 10613 |
this.ui.tools.hoverIntent(function () { |
| 10614 |
editButton.addClass('elementor-active'); |
| 10615 |
}, function () { |
| 10616 |
editButton.removeClass('elementor-active'); |
| 10617 |
}, { |
| 10618 |
timeout: 500 |
| 10619 |
}); |
| 10620 |
} |
| 10621 |
} |
| 10622 |
}, |
| 10623 |
onEditSettingsChanged: function onEditSettingsChanged(changedModel) { |
| 10624 |
elementor.channels.editor.trigger('change:editSettings', changedModel, this); |
| 10625 |
}, |
| 10626 |
onEditButtonClick: function onEditButtonClick() { |
| 10627 |
this.model.trigger('request:edit'); |
| 10628 |
}, |
| 10629 |
onEditRequest: function onEditRequest() { |
| 10630 |
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; |
| 10631 |
|
| 10632 |
if (!this.container.isEditable()) { |
| 10633 |
return; |
| 10634 |
} |
| 10635 |
|
| 10636 |
var model = this.getEditModel(), |
| 10637 |
panel = elementor.getPanelView(); |
| 10638 |
|
| 10639 |
if ($e.routes.isPartOf('panel/editor') && panel.getCurrentPageView().model === model) { |
| 10640 |
return; |
| 10641 |
} |
| 10642 |
|
| 10643 |
if (options.scrollIntoView) { |
| 10644 |
elementor.helpers.scrollToView(this.$el, 200); |
| 10645 |
} |
| 10646 |
|
| 10647 |
$e.run('panel/editor/open', { |
| 10648 |
model: model, |
| 10649 |
view: this |
| 10650 |
}); |
| 10651 |
}, |
| 10652 |
onDuplicateButtonClick: function onDuplicateButtonClick(event) { |
| 10653 |
event.stopPropagation(); |
| 10654 |
$e.run('document/elements/duplicate', { |
| 10655 |
container: this.getContainer() |
| 10656 |
}); |
| 10657 |
}, |
| 10658 |
onRemoveButtonClick: function onRemoveButtonClick(event) { |
| 10659 |
event.stopPropagation(); |
| 10660 |
$e.run('document/elements/delete', { |
| 10661 |
container: this.getContainer() |
| 10662 |
}); |
| 10663 |
}, |
| 10664 |
|
| 10665 |
/* jQuery ui sortable preventing any `mousedown` event above any element, and as a result is preventing the `blur` |
| 10666 |
* event on the currently active element. Therefor, we need to blur the active element manually. |
| 10667 |
*/ |
| 10668 |
onMouseDown: function onMouseDown(event) { |
| 10669 |
if (jQuery(event.target).closest('.elementor-inline-editing').length) { |
| 10670 |
return; |
| 10671 |
} |
| 10672 |
|
| 10673 |
elementorFrontend.elements.window.document.activeElement.blur(); |
| 10674 |
}, |
| 10675 |
onDestroy: function onDestroy() { |
| 10676 |
this.controlsCSSParser.removeStyleFromDocument(); |
| 10677 |
this.getEditModel().get('settings').validators = {}; |
| 10678 |
elementor.channels.data.trigger('element:destroy', this.model); |
| 10679 |
} |
| 10680 |
}); |
| 10681 |
module.exports = BaseElementView; |
| 10682 |
|
| 10683 |
/***/ }), |
| 10684 |
/* 298 */ |
| 10685 |
/***/ (function(module, exports, __webpack_require__) { |
| 10686 |
|
| 10687 |
"use strict"; |
| 10688 |
|
| 10689 |
|
| 10690 |
var SortableBehavior; |
| 10691 |
SortableBehavior = Marionette.Behavior.extend({ |
| 10692 |
defaults: { |
| 10693 |
elChildType: 'widget' |
| 10694 |
}, |
| 10695 |
events: { |
| 10696 |
sortstart: 'onSortStart', |
| 10697 |
sortreceive: 'onSortReceive', |
| 10698 |
sortupdate: 'onSortUpdate', |
| 10699 |
sortover: 'onSortOver', |
| 10700 |
sortout: 'onSortOut' |
| 10701 |
}, |
| 10702 |
initialize: function initialize() { |
| 10703 |
this.listenTo(elementor.channels.dataEditMode, 'switch', this.onEditModeSwitched).listenTo(this.view.options.model, 'request:sort:start', this.startSort).listenTo(this.view.options.model, 'request:sort:update', this.updateSort).listenTo(this.view.options.model, 'request:sort:receive', this.receiveSort); |
| 10704 |
}, |
| 10705 |
onEditModeSwitched: function onEditModeSwitched(activeMode) { |
| 10706 |
if ('edit' === activeMode) { |
| 10707 |
this.activate(); |
| 10708 |
} else { |
| 10709 |
this.deactivate(); |
| 10710 |
} |
| 10711 |
}, |
| 10712 |
onRender: function onRender() { |
| 10713 |
var self = this; |
| 10714 |
|
| 10715 |
_.defer(function () { |
| 10716 |
self.onEditModeSwitched(elementor.channels.dataEditMode.request('activeMode')); |
| 10717 |
}); |
| 10718 |
}, |
| 10719 |
onDestroy: function onDestroy() { |
| 10720 |
this.deactivate(); |
| 10721 |
}, |
| 10722 |
activate: function activate() { |
| 10723 |
if (!elementor.userCan('design')) { |
| 10724 |
return; |
| 10725 |
} |
| 10726 |
|
| 10727 |
if (this.getChildViewContainer().sortable('instance')) { |
| 10728 |
return; |
| 10729 |
} |
| 10730 |
|
| 10731 |
var $childViewContainer = this.getChildViewContainer(), |
| 10732 |
defaultSortableOptions = { |
| 10733 |
connectWith: $childViewContainer.selector, |
| 10734 |
placeholder: 'elementor-sortable-placeholder elementor-' + this.getOption('elChildType') + '-placeholder', |
| 10735 |
cursorAt: { |
| 10736 |
top: 20, |
| 10737 |
left: 25 |
| 10738 |
}, |
| 10739 |
helper: this._getSortableHelper.bind(this), |
| 10740 |
cancel: 'input, textarea, button, select, option, .elementor-inline-editing, .elementor-tab-title' |
| 10741 |
}, |
| 10742 |
sortableOptions = _.extend(defaultSortableOptions, this.view.getSortableOptions()); |
| 10743 |
|
| 10744 |
$childViewContainer.sortable(sortableOptions); |
| 10745 |
}, |
| 10746 |
_getSortableHelper: function _getSortableHelper(event, $item) { |
| 10747 |
var model = this.view.collection.get({ |
| 10748 |
cid: $item.data('model-cid') |
| 10749 |
}); |
| 10750 |
return '<div style="height: 84px; width: 125px;" class="elementor-sortable-helper elementor-sortable-helper-' + model.get('elType') + '"><div class="icon"><i class="' + model.getIcon() + '"></i></div><div class="elementor-element-title-wrapper"><div class="title">' + model.getTitle() + '</div></div></div>'; |
| 10751 |
}, |
| 10752 |
getChildViewContainer: function getChildViewContainer() { |
| 10753 |
return this.view.getChildViewContainer(this.view); |
| 10754 |
}, |
| 10755 |
getSortedElementNewIndex: function getSortedElementNewIndex($element) { |
| 10756 |
var draggedModel = elementor.channels.data.request('dragging:model'), |
| 10757 |
draggedElType = draggedModel.get('elType'); |
| 10758 |
var newIndex = $element.index(); |
| 10759 |
|
| 10760 |
if ('widget' === draggedElType && !elementor.config.legacyMode.elementWrappers) { |
| 10761 |
newIndex--; |
| 10762 |
} |
| 10763 |
|
| 10764 |
return newIndex; |
| 10765 |
}, |
| 10766 |
deactivate: function deactivate() { |
| 10767 |
var childViewContainer = this.getChildViewContainer(); |
| 10768 |
|
| 10769 |
if (childViewContainer.sortable('instance')) { |
| 10770 |
childViewContainer.sortable('destroy'); |
| 10771 |
} |
| 10772 |
}, |
| 10773 |
startSort: function startSort(event, ui) { |
| 10774 |
event.stopPropagation(); |
| 10775 |
var container = elementor.getContainer(ui.item.attr('data-id')); |
| 10776 |
elementor.channels.data.reply('dragging:model', container.model).reply('dragging:view', container.view).reply('dragging:parent:view', this.view).trigger('drag:start', container.model).trigger(container.model.get('elType') + ':drag:start'); |
| 10777 |
}, |
| 10778 |
// On sorting element |
| 10779 |
updateSort: function updateSort(ui) { |
| 10780 |
$e.run('document/elements/move', { |
| 10781 |
container: elementor.channels.data.request('dragging:view').getContainer(), |
| 10782 |
target: this.view.getContainer(), |
| 10783 |
options: { |
| 10784 |
at: this.getSortedElementNewIndex(ui.item) |
| 10785 |
} |
| 10786 |
}); |
| 10787 |
}, |
| 10788 |
// On receiving element from another container |
| 10789 |
receiveSort: function receiveSort(event, ui) { |
| 10790 |
event.stopPropagation(); |
| 10791 |
|
| 10792 |
if (this.view.isCollectionFilled()) { |
| 10793 |
jQuery(ui.sender).sortable('cancel'); |
| 10794 |
return; |
| 10795 |
} |
| 10796 |
|
| 10797 |
var model = elementor.channels.data.request('dragging:model'), |
| 10798 |
draggedElType = model.get('elType'), |
| 10799 |
draggedIsInnerSection = 'section' === draggedElType && model.get('isInner'), |
| 10800 |
targetIsInnerColumn = 'column' === this.view.getElementType() && this.view.isInner(); |
| 10801 |
|
| 10802 |
if (draggedIsInnerSection && targetIsInnerColumn) { |
| 10803 |
jQuery(ui.sender).sortable('cancel'); |
| 10804 |
return; |
| 10805 |
} |
| 10806 |
|
| 10807 |
$e.run('document/elements/move', { |
| 10808 |
container: elementor.channels.data.request('dragging:view').getContainer(), |
| 10809 |
target: this.view.getContainer(), |
| 10810 |
options: { |
| 10811 |
at: this.getSortedElementNewIndex(ui.item) |
| 10812 |
} |
| 10813 |
}); |
| 10814 |
}, |
| 10815 |
onSortStart: function onSortStart(event, ui) { |
| 10816 |
if ('column' === this.options.elChildType) { |
| 10817 |
var uiData = ui.item.data('sortableItem'), |
| 10818 |
uiItems = uiData.items, |
| 10819 |
itemHeight = 0; |
| 10820 |
uiItems.forEach(function (item) { |
| 10821 |
if (item.item[0] === ui.item[0]) { |
| 10822 |
itemHeight = item.height; |
| 10823 |
return false; |
| 10824 |
} |
| 10825 |
}); |
| 10826 |
ui.placeholder.height(itemHeight); |
| 10827 |
} |
| 10828 |
|
| 10829 |
this.startSort(event, ui); |
| 10830 |
}, |
| 10831 |
onSortOver: function onSortOver(event) { |
| 10832 |
event.stopPropagation(); |
| 10833 |
var model = elementor.channels.data.request('dragging:model'); |
| 10834 |
jQuery(event.target).addClass('elementor-draggable-over').attr({ |
| 10835 |
'data-dragged-element': model.get('elType'), |
| 10836 |
'data-dragged-is-inner': model.get('isInner') |
| 10837 |
}); |
| 10838 |
this.$el.addClass('elementor-dragging-on-child'); |
| 10839 |
}, |
| 10840 |
onSortOut: function onSortOut(event) { |
| 10841 |
event.stopPropagation(); |
| 10842 |
jQuery(event.target).removeClass('elementor-draggable-over').removeAttr('data-dragged-element data-dragged-is-inner'); |
| 10843 |
this.$el.removeClass('elementor-dragging-on-child'); |
| 10844 |
}, |
| 10845 |
onSortReceive: function onSortReceive(event, ui) { |
| 10846 |
this.receiveSort(event, ui); |
| 10847 |
}, |
| 10848 |
onSortUpdate: function onSortUpdate(event, ui) { |
| 10849 |
event.stopPropagation(); |
| 10850 |
|
| 10851 |
if (this.getChildViewContainer()[0] !== ui.item.parent()[0]) { |
| 10852 |
return; |
| 10853 |
} |
| 10854 |
|
| 10855 |
this.updateSort(ui); |
| 10856 |
}, |
| 10857 |
onAddChild: function onAddChild(view) { |
| 10858 |
view.$el.attr('data-model-cid', view.model.cid); |
| 10859 |
} |
| 10860 |
}); |
| 10861 |
module.exports = SortableBehavior; |
| 10862 |
|
| 10863 |
/***/ }), |
| 10864 |
/* 299 */ |
| 10865 |
/***/ (function(module, exports, __webpack_require__) { |
| 10866 |
|
| 10867 |
var arrayWithoutHoles = __webpack_require__(317); |
| 10868 |
|
| 10869 |
var iterableToArray = __webpack_require__(318); |
| 10870 |
|
| 10871 |
var unsupportedIterableToArray = __webpack_require__(187); |
| 10872 |
|
| 10873 |
var nonIterableSpread = __webpack_require__(319); |
| 10874 |
|
| 10875 |
function _toConsumableArray(arr) { |
| 10876 |
return arrayWithoutHoles(arr) || iterableToArray(arr) || unsupportedIterableToArray(arr) || nonIterableSpread(); |
| 10877 |
} |
| 10878 |
|
| 10879 |
module.exports = _toConsumableArray; |
| 10880 |
|
| 10881 |
/***/ }), |
| 10882 |
/* 300 */ |
| 10883 |
/***/ (function(module, exports, __webpack_require__) { |
| 10884 |
|
| 10885 |
"use strict"; |
| 10886 |
|
| 10887 |
|
| 10888 |
module.exports = elementorModules.Module.extend({ |
| 10889 |
errors: [], |
| 10890 |
__construct: function __construct(settings) { |
| 10891 |
var customValidationMethod = settings.customValidationMethod; |
| 10892 |
|
| 10893 |
if (customValidationMethod) { |
| 10894 |
this.validationMethod = customValidationMethod; |
| 10895 |
} |
| 10896 |
}, |
| 10897 |
getDefaultSettings: function getDefaultSettings() { |
| 10898 |
return { |
| 10899 |
validationTerms: {} |
| 10900 |
}; |
| 10901 |
}, |
| 10902 |
isValid: function isValid() { |
| 10903 |
var validationErrors = this.validationMethod.apply(this, arguments); |
| 10904 |
|
| 10905 |
if (validationErrors.length) { |
| 10906 |
this.errors = validationErrors; |
| 10907 |
return false; |
| 10908 |
} |
| 10909 |
|
| 10910 |
return true; |
| 10911 |
}, |
| 10912 |
validationMethod: function validationMethod(newValue) { |
| 10913 |
var validationTerms = this.getSettings('validationTerms'), |
| 10914 |
errors = []; |
| 10915 |
|
| 10916 |
if (validationTerms.required) { |
| 10917 |
if (!('' + newValue).length) { |
| 10918 |
errors.push('Required value is empty'); |
| 10919 |
} |
| 10920 |
} |
| 10921 |
|
| 10922 |
return errors; |
| 10923 |
} |
| 10924 |
}); |
| 10925 |
|
| 10926 |
/***/ }), |
| 10927 |
/* 301 */ |
| 10928 |
/***/ (function(module, exports, __webpack_require__) { |
| 10929 |
|
| 10930 |
"use strict"; |
| 10931 |
|
| 10932 |
|
| 10933 |
var _interopRequireDefault = __webpack_require__(0); |
| 10934 |
|
| 10935 |
var _Object$defineProperty = __webpack_require__(1); |
| 10936 |
|
| 10937 |
_Object$defineProperty(exports, "__esModule", { |
| 10938 |
value: true |
| 10939 |
}); |
| 10940 |
|
| 10941 |
exports.default = void 0; |
| 10942 |
|
| 10943 |
__webpack_require__(183); |
| 10944 |
|
| 10945 |
__webpack_require__(72); |
| 10946 |
|
| 10947 |
var _classCallCheck2 = _interopRequireDefault(__webpack_require__(2)); |
| 10948 |
|
| 10949 |
var _createClass2 = _interopRequireDefault(__webpack_require__(3)); |
| 10950 |
|
| 10951 |
var _inherits2 = _interopRequireDefault(__webpack_require__(4)); |
| 10952 |
|
| 10953 |
var _createSuper2 = _interopRequireDefault(__webpack_require__(5)); |
| 10954 |
|
| 10955 |
var ColorPicker = /*#__PURE__*/function (_elementorModules$Mod) { |
| 10956 |
(0, _inherits2.default)(ColorPicker, _elementorModules$Mod); |
| 10957 |
|
| 10958 |
var _super = (0, _createSuper2.default)(ColorPicker); |
| 10959 |
|
| 10960 |
function ColorPicker() { |
| 10961 |
var _this; |
| 10962 |
|
| 10963 |
(0, _classCallCheck2.default)(this, ColorPicker); |
| 10964 |
|
| 10965 |
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { |
| 10966 |
args[_key] = arguments[_key]; |
| 10967 |
} |
| 10968 |
|
| 10969 |
_this = _super.call.apply(_super, [this].concat(args)); |
| 10970 |
|
| 10971 |
_this.createPicker(); |
| 10972 |
|
| 10973 |
return _this; |
| 10974 |
} |
| 10975 |
|
| 10976 |
(0, _createClass2.default)(ColorPicker, [{ |
| 10977 |
key: "getDefaultSettings", |
| 10978 |
value: function getDefaultSettings() { |
| 10979 |
return { |
| 10980 |
picker: { |
| 10981 |
theme: 'monolith', |
| 10982 |
position: 'bottom-' + (elementorCommon.config.isRTL ? 'end' : 'start'), |
| 10983 |
components: { |
| 10984 |
opacity: true, |
| 10985 |
hue: true, |
| 10986 |
interaction: { |
| 10987 |
input: true |
| 10988 |
} |
| 10989 |
} |
| 10990 |
}, |
| 10991 |
classes: { |
| 10992 |
active: 'elementor-active', |
| 10993 |
pickerHeader: 'elementor-color-picker__header', |
| 10994 |
pickerToolsContainer: 'e-color-picker__tools', |
| 10995 |
pickerTool: 'e-control-tool', |
| 10996 |
clearButton: 'e-color-picker__clear', |
| 10997 |
plusIcon: 'eicon-plus' |
| 10998 |
} |
| 10999 |
}; |
| 11000 |
} |
| 11001 |
}, { |
| 11002 |
key: "createPicker", |
| 11003 |
value: function createPicker() { |
| 11004 |
var _this2 = this; |
| 11005 |
|
| 11006 |
var pickerSettings = this.getSettings('picker'); |
| 11007 |
pickerSettings.default = pickerSettings.default || null; |
| 11008 |
this.picker = new Pickr(pickerSettings); // Set a default palette. It doesn't affect the selected value. |
| 11009 |
|
| 11010 |
this.picker.setColor(pickerSettings.default || '#020101'); |
| 11011 |
this.color = this.processColor(); |
| 11012 |
this.picker.on('change', function () { |
| 11013 |
return _this2.onPickerChange(); |
| 11014 |
}).on('clear', function () { |
| 11015 |
return _this2.onPickerClear(); |
| 11016 |
}).on('show', function () { |
| 11017 |
return _this2.onPickerShow(); |
| 11018 |
}); |
| 11019 |
this.$pickerAppContainer = jQuery(this.picker.getRoot().app); |
| 11020 |
this.createPickerHeader(); |
| 11021 |
} |
| 11022 |
}, { |
| 11023 |
key: "addTipsyToClearButton", |
| 11024 |
value: function addTipsyToClearButton() { |
| 11025 |
this.$clearButton.tipsy({ |
| 11026 |
title: function title() { |
| 11027 |
return elementor.translate('clear'); |
| 11028 |
}, |
| 11029 |
gravity: function gravity() { |
| 11030 |
return 's'; |
| 11031 |
} |
| 11032 |
}); |
| 11033 |
} |
| 11034 |
}, { |
| 11035 |
key: "processColor", |
| 11036 |
value: function processColor() { |
| 11037 |
var color = this.picker.getColor(); |
| 11038 |
var colorRepresentation; |
| 11039 |
|
| 11040 |
if (1 === color.a) { |
| 11041 |
colorRepresentation = color.toHEXA(); |
| 11042 |
} else { |
| 11043 |
colorRepresentation = color.toRGBA(); |
| 11044 |
} |
| 11045 |
|
| 11046 |
return colorRepresentation.toString(); |
| 11047 |
} |
| 11048 |
}, { |
| 11049 |
key: "getColor", |
| 11050 |
value: function getColor() { |
| 11051 |
return this.color; |
| 11052 |
} |
| 11053 |
}, { |
| 11054 |
key: "createPickerHeader", |
| 11055 |
value: function createPickerHeader() { |
| 11056 |
var _this$getSettings = this.getSettings(), |
| 11057 |
classes = _this$getSettings.classes, |
| 11058 |
$pickerHeader = jQuery('<div>', { |
| 11059 |
class: classes.pickerHeader |
| 11060 |
}).text(elementor.translate('color_picker')), |
| 11061 |
$pickerToolsContainer = jQuery('<div>', { |
| 11062 |
class: classes.pickerToolsContainer |
| 11063 |
}), |
| 11064 |
addButton = this.getSettings('addButton'); |
| 11065 |
|
| 11066 |
this.$pickerToolsContainer = $pickerToolsContainer; |
| 11067 |
|
| 11068 |
if (addButton) { |
| 11069 |
this.createAddButton(); |
| 11070 |
} |
| 11071 |
|
| 11072 |
this.createClearButton(); |
| 11073 |
$pickerToolsContainer.append(this.$clearButton, this.$addButton); |
| 11074 |
$pickerHeader.append($pickerToolsContainer); |
| 11075 |
this.$pickerAppContainer.prepend($pickerHeader); |
| 11076 |
} |
| 11077 |
}, { |
| 11078 |
key: "createAddButton", |
| 11079 |
value: function createAddButton() { |
| 11080 |
var _this3 = this; |
| 11081 |
|
| 11082 |
var _this$getSettings2 = this.getSettings(), |
| 11083 |
classes = _this$getSettings2.classes; |
| 11084 |
|
| 11085 |
this.$addButton = jQuery('<button>', { |
| 11086 |
class: classes.pickerTool |
| 11087 |
}).html(jQuery('<i>', { |
| 11088 |
class: classes.plusIcon |
| 11089 |
})); |
| 11090 |
this.$addButton.on('click', function () { |
| 11091 |
return _this3.onAddButtonClick(); |
| 11092 |
}); |
| 11093 |
this.$addButton.tipsy({ |
| 11094 |
title: function title() { |
| 11095 |
return elementor.translate('create_global_color'); |
| 11096 |
}, |
| 11097 |
gravity: function gravity() { |
| 11098 |
return 's'; |
| 11099 |
} |
| 11100 |
}); |
| 11101 |
} // Move the clear button from Pickr's default location into the Color Picker header. |
| 11102 |
|
| 11103 |
}, { |
| 11104 |
key: "createClearButton", |
| 11105 |
value: function createClearButton() { |
| 11106 |
var _this4 = this; |
| 11107 |
|
| 11108 |
var _this$getSettings3 = this.getSettings(), |
| 11109 |
classes = _this$getSettings3.classes; |
| 11110 |
|
| 11111 |
this.$clearButton = jQuery('<div>', { |
| 11112 |
class: classes.clearButton + ' ' + classes.pickerTool |
| 11113 |
}).html('<i class="eicon-undo"></i>'); |
| 11114 |
this.$clearButton.on('click', function () { |
| 11115 |
return _this4.picker._clearColor(); |
| 11116 |
}); |
| 11117 |
this.addTipsyToClearButton(); |
| 11118 |
} |
| 11119 |
}, { |
| 11120 |
key: "destroy", |
| 11121 |
value: function destroy() { |
| 11122 |
this.picker.destroyAndRemove(); |
| 11123 |
} // TODO: CHECK IF THIS IS STILL NECESSARY |
| 11124 |
|
| 11125 |
}, { |
| 11126 |
key: "fixTipsyForFF", |
| 11127 |
value: function fixTipsyForFF($button) { |
| 11128 |
// There's a bug in FireFox about hiding the tooltip after the button was clicked, |
| 11129 |
// So let's force it to hide. |
| 11130 |
$button.data('tipsy').hide(); |
| 11131 |
} |
| 11132 |
}, { |
| 11133 |
key: "introductionViewed", |
| 11134 |
value: function introductionViewed() { |
| 11135 |
return ColorPicker.droppingIntroductionViewed || elementor.config.user.introduction.colorPickerDropping; |
| 11136 |
} |
| 11137 |
}, { |
| 11138 |
key: "toggleClearButtonState", |
| 11139 |
value: function toggleClearButtonState(active) { |
| 11140 |
this.$clearButton.toggleClass('e-control-tool-disabled', !active); |
| 11141 |
} |
| 11142 |
}, { |
| 11143 |
key: "onPickerChange", |
| 11144 |
value: function onPickerChange() { |
| 11145 |
this.picker.applyColor(); |
| 11146 |
var newColor = this.processColor(); |
| 11147 |
|
| 11148 |
if (newColor === this.color) { |
| 11149 |
return; |
| 11150 |
} |
| 11151 |
|
| 11152 |
this.color = newColor; |
| 11153 |
var onChange = this.getSettings('onChange'); |
| 11154 |
|
| 11155 |
if (onChange) { |
| 11156 |
onChange(); |
| 11157 |
} |
| 11158 |
} |
| 11159 |
}, { |
| 11160 |
key: "onPickerClear", |
| 11161 |
value: function onPickerClear() { |
| 11162 |
this.color = ''; |
| 11163 |
var onClear = this.getSettings('onClear'); |
| 11164 |
|
| 11165 |
if (onClear) { |
| 11166 |
onClear(); |
| 11167 |
} |
| 11168 |
} |
| 11169 |
}, { |
| 11170 |
key: "onPickerShow", |
| 11171 |
value: function onPickerShow() { |
| 11172 |
var _this5 = this; |
| 11173 |
|
| 11174 |
var resultInput = this.picker.getRoot().interaction.result; |
| 11175 |
setTimeout(function () { |
| 11176 |
resultInput.select(); |
| 11177 |
_this5.picker._recalc = true; |
| 11178 |
}, 100); |
| 11179 |
} |
| 11180 |
}, { |
| 11181 |
key: "onAddButtonClick", |
| 11182 |
value: function onAddButtonClick() { |
| 11183 |
this.picker.hide(); |
| 11184 |
var onPickerAddButtonClick = this.getSettings('onAddButtonClick'); |
| 11185 |
|
| 11186 |
if (onPickerAddButtonClick) { |
| 11187 |
onPickerAddButtonClick(); |
| 11188 |
} |
| 11189 |
|
| 11190 |
this.fixTipsyForFF(this.$addButton); |
| 11191 |
} |
| 11192 |
}]); |
| 11193 |
return ColorPicker; |
| 11194 |
}(elementorModules.Module); |
| 11195 |
|
| 11196 |
exports.default = ColorPicker; |
| 11197 |
|
| 11198 |
/***/ }), |
| 11199 |
/* 302 */ |
| 11200 |
/***/ (function(module, exports, __webpack_require__) { |
| 11201 |
|
| 11202 |
"use strict"; |
| 11203 |
|
| 11204 |
// 22.1.3.9 Array.prototype.findIndex(predicate, thisArg = undefined) |
| 11205 |
var $export = __webpack_require__(34); |
| 11206 |
var $find = __webpack_require__(182)(6); |
| 11207 |
var KEY = 'findIndex'; |
| 11208 |
var forced = true; |
| 11209 |
// Shouldn't skip holes |
| 11210 |
if (KEY in []) Array(1)[KEY](function () { forced = false; }); |
| 11211 |
$export($export.P + $export.F * forced, 'Array', { |
| 11212 |
findIndex: function findIndex(callbackfn /* , that = undefined */) { |
| 11213 |
return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); |
| 11214 |
} |
| 11215 |
}); |
| 11216 |
__webpack_require__(87)(KEY); |
| 11217 |
|
| 11218 |
|
| 11219 |
/***/ }), |
| 11220 |
/* 303 */ |
| 11221 |
/***/ (function(module, exports, __webpack_require__) { |
| 11222 |
|
| 11223 |
module.exports = __webpack_require__(304); |
| 11224 |
|
| 11225 |
/***/ }), |
| 11226 |
/* 304 */ |
| 11227 |
/***/ (function(module, exports, __webpack_require__) { |
| 11228 |
|
| 11229 |
__webpack_require__(305); |
| 11230 |
module.exports = __webpack_require__(6).Object.getOwnPropertyDescriptors; |
| 11231 |
|
| 11232 |
|
| 11233 |
/***/ }), |
| 11234 |
/* 305 */ |
| 11235 |
/***/ (function(module, exports, __webpack_require__) { |
| 11236 |
|
| 11237 |
// https://github.com/tc39/proposal-object-getownpropertydescriptors |
| 11238 |
var $export = __webpack_require__(7); |
| 11239 |
var ownKeys = __webpack_require__(306); |
| 11240 |
var toIObject = __webpack_require__(20); |
| 11241 |
var gOPD = __webpack_require__(51); |
| 11242 |
var createProperty = __webpack_require__(186); |
| 11243 |
|
| 11244 |
$export($export.S, 'Object', { |
| 11245 |
getOwnPropertyDescriptors: function getOwnPropertyDescriptors(object) { |
| 11246 |
var O = toIObject(object); |
| 11247 |
var getDesc = gOPD.f; |
| 11248 |
var keys = ownKeys(O); |
| 11249 |
var result = {}; |
| 11250 |
var i = 0; |
| 11251 |
var key, desc; |
| 11252 |
while (keys.length > i) { |
| 11253 |
desc = getDesc(O, key = keys[i++]); |
| 11254 |
if (desc !== undefined) createProperty(result, key, desc); |
| 11255 |
} |
| 11256 |
return result; |
| 11257 |
} |
| 11258 |
}); |
| 11259 |
|
| 11260 |
|
| 11261 |
/***/ }), |
| 11262 |
/* 306 */ |
| 11263 |
/***/ (function(module, exports, __webpack_require__) { |
| 11264 |
|
| 11265 |
// all object keys, includes non-enumerable and symbols |
| 11266 |
var gOPN = __webpack_require__(99); |
| 11267 |
var gOPS = __webpack_require__(71); |
| 11268 |
var anObject = __webpack_require__(13); |
| 11269 |
var Reflect = __webpack_require__(8).Reflect; |
| 11270 |
module.exports = Reflect && Reflect.ownKeys || function ownKeys(it) { |
| 11271 |
var keys = gOPN.f(anObject(it)); |
| 11272 |
var getSymbols = gOPS.f; |
| 11273 |
return getSymbols ? keys.concat(getSymbols(it)) : keys; |
| 11274 |
}; |
| 11275 |
|
| 11276 |
|
| 11277 |
/***/ }), |
| 11278 |
/* 307 */ |
| 11279 |
/***/ (function(module, exports, __webpack_require__) { |
| 11280 |
|
| 11281 |
module.exports = __webpack_require__(308); |
| 11282 |
|
| 11283 |
/***/ }), |
| 11284 |
/* 308 */ |
| 11285 |
/***/ (function(module, exports, __webpack_require__) { |
| 11286 |
|
| 11287 |
__webpack_require__(140); |
| 11288 |
module.exports = __webpack_require__(6).Object.getOwnPropertySymbols; |
| 11289 |
|
| 11290 |
|
| 11291 |
/***/ }), |
| 11292 |
/* 309 */ |
| 11293 |
/***/ (function(module, exports, __webpack_require__) { |
| 11294 |
|
| 11295 |
"use strict"; |
| 11296 |
|
| 11297 |
var global = __webpack_require__(17); |
| 11298 |
var dP = __webpack_require__(45); |
| 11299 |
var DESCRIPTORS = __webpack_require__(27); |
| 11300 |
var SPECIES = __webpack_require__(12)('species'); |
| 11301 |
|
| 11302 |
module.exports = function (KEY) { |
| 11303 |
var C = global[KEY]; |
| 11304 |
if (DESCRIPTORS && C && !C[SPECIES]) dP.f(C, SPECIES, { |
| 11305 |
configurable: true, |
| 11306 |
get: function () { return this; } |
| 11307 |
}); |
| 11308 |
}; |
| 11309 |
|
| 11310 |
|
| 11311 |
/***/ }), |
| 11312 |
/* 310 */ |
| 11313 |
/***/ (function(module, exports, __webpack_require__) { |
| 11314 |
|
| 11315 |
var isObject = __webpack_require__(30); |
| 11316 |
var setPrototypeOf = __webpack_require__(330).set; |
| 11317 |
module.exports = function (that, target, C) { |
| 11318 |
var S = target.constructor; |
| 11319 |
var P; |
| 11320 |
if (S !== C && typeof S == 'function' && (P = S.prototype) !== C.prototype && isObject(P) && setPrototypeOf) { |
| 11321 |
setPrototypeOf(that, P); |
| 11322 |
} return that; |
| 11323 |
}; |
| 11324 |
|
| 11325 |
|
| 11326 |
/***/ }), |
| 11327 |
/* 311 */ |
| 11328 |
/***/ (function(module, exports, __webpack_require__) { |
| 11329 |
|
| 11330 |
var pIE = __webpack_require__(331); |
| 11331 |
var createDesc = __webpack_require__(103); |
| 11332 |
var toIObject = __webpack_require__(98); |
| 11333 |
var toPrimitive = __webpack_require__(123); |
| 11334 |
var has = __webpack_require__(61); |
| 11335 |
var IE8_DOM_DEFINE = __webpack_require__(129); |
| 11336 |
var gOPD = Object.getOwnPropertyDescriptor; |
| 11337 |
|
| 11338 |
exports.f = __webpack_require__(27) ? gOPD : function getOwnPropertyDescriptor(O, P) { |
| 11339 |
O = toIObject(O); |
| 11340 |
P = toPrimitive(P, true); |
| 11341 |
if (IE8_DOM_DEFINE) try { |
| 11342 |
return gOPD(O, P); |
| 11343 |
} catch (e) { /* empty */ } |
| 11344 |
if (has(O, P)) return createDesc(!pIE.f.call(O, P), O[P]); |
| 11345 |
}; |
| 11346 |
|
| 11347 |
|
| 11348 |
/***/ }), |
| 11349 |
/* 312 */ |
| 11350 |
/***/ (function(module, exports, __webpack_require__) { |
| 11351 |
|
| 11352 |
// 19.1.2.7 / 15.2.3.4 Object.getOwnPropertyNames(O) |
| 11353 |
var $keys = __webpack_require__(219); |
| 11354 |
var hiddenKeys = __webpack_require__(148).concat('length', 'prototype'); |
| 11355 |
|
| 11356 |
exports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) { |
| 11357 |
return $keys(O, hiddenKeys); |
| 11358 |
}; |
| 11359 |
|
| 11360 |
|
| 11361 |
/***/ }), |
| 11362 |
/* 313 */, |
| 11363 |
/* 314 */, |
| 11364 |
/* 315 */, |
| 11365 |
/* 316 */ |
| 11366 |
/***/ (function(module, exports, __webpack_require__) { |
| 11367 |
|
| 11368 |
var core = __webpack_require__(6); |
| 11369 |
var $JSON = core.JSON || (core.JSON = { stringify: JSON.stringify }); |
| 11370 |
module.exports = function stringify(it) { // eslint-disable-line no-unused-vars |
| 11371 |
return $JSON.stringify.apply($JSON, arguments); |
| 11372 |
}; |
| 11373 |
|
| 11374 |
|
| 11375 |
/***/ }), |
| 11376 |
/* 317 */ |
| 11377 |
/***/ (function(module, exports, __webpack_require__) { |
| 11378 |
|
| 11379 |
var _Array$isArray = __webpack_require__(84); |
| 11380 |
|
| 11381 |
var arrayLikeToArray = __webpack_require__(199); |
| 11382 |
|
| 11383 |
function _arrayWithoutHoles(arr) { |
| 11384 |
if (_Array$isArray(arr)) return arrayLikeToArray(arr); |
| 11385 |
} |
| 11386 |
|
| 11387 |
module.exports = _arrayWithoutHoles; |
| 11388 |
|
| 11389 |
/***/ }), |
| 11390 |
/* 318 */ |
| 11391 |
/***/ (function(module, exports, __webpack_require__) { |
| 11392 |
|
| 11393 |
var _Array$from = __webpack_require__(200); |
| 11394 |
|
| 11395 |
var _isIterable = __webpack_require__(211); |
| 11396 |
|
| 11397 |
var _Symbol = __webpack_require__(111); |
| 11398 |
|
| 11399 |
function _iterableToArray(iter) { |
| 11400 |
if (typeof _Symbol !== "undefined" && _isIterable(Object(iter))) return _Array$from(iter); |
| 11401 |
} |
| 11402 |
|
| 11403 |
module.exports = _iterableToArray; |
| 11404 |
|
| 11405 |
/***/ }), |
| 11406 |
/* 319 */ |
| 11407 |
/***/ (function(module, exports) { |
| 11408 |
|
| 11409 |
function _nonIterableSpread() { |
| 11410 |
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); |
| 11411 |
} |
| 11412 |
|
| 11413 |
module.exports = _nonIterableSpread; |
| 11414 |
|
| 11415 |
/***/ }), |
| 11416 |
/* 320 */ |
| 11417 |
/***/ (function(module, exports, __webpack_require__) { |
| 11418 |
|
| 11419 |
"use strict"; |
| 11420 |
|
| 11421 |
|
| 11422 |
var _interopRequireDefault = __webpack_require__(0); |
| 11423 |
|
| 11424 |
var _Object$defineProperty = __webpack_require__(1); |
| 11425 |
|
| 11426 |
_Object$defineProperty(exports, "__esModule", { |
| 11427 |
value: true |
| 11428 |
}); |
| 11429 |
|
| 11430 |
exports.default = void 0; |
| 11431 |
|
| 11432 |
var _createClass2 = _interopRequireDefault(__webpack_require__(3)); |
| 11433 |
|
| 11434 |
var _classCallCheck2 = _interopRequireDefault(__webpack_require__(2)); |
| 11435 |
|
| 11436 |
var _defineProperty2 = _interopRequireDefault(__webpack_require__(28)); |
| 11437 |
|
| 11438 |
var _manager = _interopRequireDefault(__webpack_require__(427)); |
| 11439 |
|
| 11440 |
var _manager2 = _interopRequireDefault(__webpack_require__(429)); |
| 11441 |
|
| 11442 |
/** |
| 11443 |
* TODO: Wrong class name + location, conflict with 'editor.js'. |
| 11444 |
*/ |
| 11445 |
var Editor = function Editor() { |
| 11446 |
(0, _classCallCheck2.default)(this, Editor); |
| 11447 |
(0, _defineProperty2.default)(this, "status", 'closed'); |
| 11448 |
(0, _defineProperty2.default)(this, "isSaving", false); |
| 11449 |
(0, _defineProperty2.default)(this, "isChanged", false); |
| 11450 |
(0, _defineProperty2.default)(this, "isChangedDuringSave", false); |
| 11451 |
(0, _defineProperty2.default)(this, "isSaved", true); |
| 11452 |
(0, _defineProperty2.default)(this, "lastSaveHistoryId", 0); |
| 11453 |
}; |
| 11454 |
|
| 11455 |
var Document = /*#__PURE__*/function () { |
| 11456 |
/** |
| 11457 |
* Document id. |
| 11458 |
* |
| 11459 |
* @type {number|null} |
| 11460 |
*/ |
| 11461 |
|
| 11462 |
/** |
| 11463 |
* History of the document. |
| 11464 |
* |
| 11465 |
* @type {HistoryManager} |
| 11466 |
*/ |
| 11467 |
|
| 11468 |
/** |
| 11469 |
* Revisions of the document. |
| 11470 |
* |
| 11471 |
* @type {RevisionsManager} |
| 11472 |
*/ |
| 11473 |
|
| 11474 |
/** |
| 11475 |
* Current container. |
| 11476 |
* |
| 11477 |
* @type {Container} |
| 11478 |
*/ |
| 11479 |
|
| 11480 |
/** |
| 11481 |
* Editor Settings. |
| 11482 |
* |
| 11483 |
* @type {Editor} |
| 11484 |
*/ |
| 11485 |
|
| 11486 |
/** |
| 11487 |
* Function constructor(). |
| 11488 |
* |
| 11489 |
* Create document. |
| 11490 |
* |
| 11491 |
* @param {{}} config |
| 11492 |
*/ |
| 11493 |
function Document(config) { |
| 11494 |
(0, _classCallCheck2.default)(this, Document); |
| 11495 |
(0, _defineProperty2.default)(this, "id", null); |
| 11496 |
(0, _defineProperty2.default)(this, "history", null); |
| 11497 |
(0, _defineProperty2.default)(this, "revisions", null); |
| 11498 |
(0, _defineProperty2.default)(this, "container", null); |
| 11499 |
(0, _defineProperty2.default)(this, "editor", new Editor()); |
| 11500 |
this.config = config; |
| 11501 |
this.id = config.id; |
| 11502 |
this.history = new _manager.default(this); |
| 11503 |
this.revisions = new _manager2.default(this); |
| 11504 |
} |
| 11505 |
|
| 11506 |
(0, _createClass2.default)(Document, [{ |
| 11507 |
key: "isDraft", |
| 11508 |
value: function isDraft() { |
| 11509 |
return this.config.revisions.current_id !== this.config.id; |
| 11510 |
} |
| 11511 |
}]); |
| 11512 |
return Document; |
| 11513 |
}(); |
| 11514 |
|
| 11515 |
exports.default = Document; |
| 11516 |
|
| 11517 |
/***/ }), |
| 11518 |
/* 321 */ |
| 11519 |
/***/ (function(module, exports, __webpack_require__) { |
| 11520 |
|
| 11521 |
"use strict"; |
| 11522 |
|
| 11523 |
|
| 11524 |
var _Object$defineProperty = __webpack_require__(1); |
| 11525 |
|
| 11526 |
_Object$defineProperty(exports, "__esModule", { |
| 11527 |
value: true |
| 11528 |
}); |
| 11529 |
|
| 11530 |
_Object$defineProperty(exports, "Close", { |
| 11531 |
enumerable: true, |
| 11532 |
get: function get() { |
| 11533 |
return _close.Close; |
| 11534 |
} |
| 11535 |
}); |
| 11536 |
|
| 11537 |
_Object$defineProperty(exports, "Open", { |
| 11538 |
enumerable: true, |
| 11539 |
get: function get() { |
| 11540 |
return _open.Open; |
| 11541 |
} |
| 11542 |
}); |
| 11543 |
|
| 11544 |
_Object$defineProperty(exports, "Toggle", { |
| 11545 |
enumerable: true, |
| 11546 |
get: function get() { |
| 11547 |
return _toggle.Toggle; |
| 11548 |
} |
| 11549 |
}); |
| 11550 |
|
| 11551 |
var _close = __webpack_require__(322); |
| 11552 |
|
| 11553 |
var _open = __webpack_require__(323); |
| 11554 |
|
| 11555 |
var _toggle = __webpack_require__(324); |
| 11556 |
|
| 11557 |
/***/ }), |
| 11558 |
/* 322 */ |
| 11559 |
/***/ (function(module, exports, __webpack_require__) { |
| 11560 |
|
| 11561 |
"use strict"; |
| 11562 |
|
| 11563 |
|
| 11564 |
var _interopRequireDefault = __webpack_require__(0); |
| 11565 |
|
| 11566 |
var _Object$defineProperty = __webpack_require__(1); |
| 11567 |
|
| 11568 |
_Object$defineProperty(exports, "__esModule", { |
| 11569 |
value: true |
| 11570 |
}); |
| 11571 |
|
| 11572 |
exports.default = exports.Close = void 0; |
| 11573 |
|
| 11574 |
var _classCallCheck2 = _interopRequireDefault(__webpack_require__(2)); |
| 11575 |
|
| 11576 |
var _createClass2 = _interopRequireDefault(__webpack_require__(3)); |
| 11577 |
|
| 11578 |
var _inherits2 = _interopRequireDefault(__webpack_require__(4)); |
| 11579 |
|
| 11580 |
var _createSuper2 = _interopRequireDefault(__webpack_require__(5)); |
| 11581 |
|
| 11582 |
var _commandBase = _interopRequireDefault(__webpack_require__(21)); |
| 11583 |
|
| 11584 |
var Close = /*#__PURE__*/function (_CommandBase) { |
| 11585 |
(0, _inherits2.default)(Close, _CommandBase); |
| 11586 |
|
| 11587 |
var _super = (0, _createSuper2.default)(Close); |
| 11588 |
|
| 11589 |
function Close() { |
| 11590 |
(0, _classCallCheck2.default)(this, Close); |
| 11591 |
return _super.apply(this, arguments); |
| 11592 |
} |
| 11593 |
|
| 11594 |
(0, _createClass2.default)(Close, [{ |
| 11595 |
key: "apply", |
| 11596 |
value: function apply() { |
| 11597 |
this.component.close(); |
| 11598 |
} |
| 11599 |
}]); |
| 11600 |
return Close; |
| 11601 |
}(_commandBase.default); |
| 11602 |
|
| 11603 |
exports.Close = Close; |
| 11604 |
var _default = Close; |
| 11605 |
exports.default = _default; |
| 11606 |
|
| 11607 |
/***/ }), |
| 11608 |
/* 323 */ |
| 11609 |
/***/ (function(module, exports, __webpack_require__) { |
| 11610 |
|
| 11611 |
"use strict"; |
| 11612 |
|
| 11613 |
|
| 11614 |
var _interopRequireDefault = __webpack_require__(0); |
| 11615 |
|
| 11616 |
var _Object$defineProperty = __webpack_require__(1); |
| 11617 |
|
| 11618 |
_Object$defineProperty(exports, "__esModule", { |
| 11619 |
value: true |
| 11620 |
}); |
| 11621 |
|
| 11622 |
exports.default = exports.Open = void 0; |
| 11623 |
|
| 11624 |
var _classCallCheck2 = _interopRequireDefault(__webpack_require__(2)); |
| 11625 |
|
| 11626 |
var _createClass2 = _interopRequireDefault(__webpack_require__(3)); |
| 11627 |
|
| 11628 |
var _inherits2 = _interopRequireDefault(__webpack_require__(4)); |
| 11629 |
|
| 11630 |
var _createSuper2 = _interopRequireDefault(__webpack_require__(5)); |
| 11631 |
|
| 11632 |
var _commandBase = _interopRequireDefault(__webpack_require__(21)); |
| 11633 |
|
| 11634 |
var Open = /*#__PURE__*/function (_CommandBase) { |
| 11635 |
(0, _inherits2.default)(Open, _CommandBase); |
| 11636 |
|
| 11637 |
var _super = (0, _createSuper2.default)(Open); |
| 11638 |
|
| 11639 |
function Open() { |
| 11640 |
(0, _classCallCheck2.default)(this, Open); |
| 11641 |
return _super.apply(this, arguments); |
| 11642 |
} |
| 11643 |
|
| 11644 |
(0, _createClass2.default)(Open, [{ |
| 11645 |
key: "apply", |
| 11646 |
value: function apply() { |
| 11647 |
$e.route(this.component.getNamespace()); |
| 11648 |
} |
| 11649 |
}]); |
| 11650 |
return Open; |
| 11651 |
}(_commandBase.default); |
| 11652 |
|
| 11653 |
exports.Open = Open; |
| 11654 |
var _default = Open; |
| 11655 |
exports.default = _default; |
| 11656 |
|
| 11657 |
/***/ }), |
| 11658 |
/* 324 */ |
| 11659 |
/***/ (function(module, exports, __webpack_require__) { |
| 11660 |
|
| 11661 |
"use strict"; |
| 11662 |
|
| 11663 |
|
| 11664 |
var _interopRequireDefault = __webpack_require__(0); |
| 11665 |
|
| 11666 |
var _Object$defineProperty = __webpack_require__(1); |
| 11667 |
|
| 11668 |
_Object$defineProperty(exports, "__esModule", { |
| 11669 |
value: true |
| 11670 |
}); |
| 11671 |
|
| 11672 |
exports.default = exports.Toggle = void 0; |
| 11673 |
|
| 11674 |
var _classCallCheck2 = _interopRequireDefault(__webpack_require__(2)); |
| 11675 |
|
| 11676 |
var _createClass2 = _interopRequireDefault(__webpack_require__(3)); |
| 11677 |
|
| 11678 |
var _inherits2 = _interopRequireDefault(__webpack_require__(4)); |
| 11679 |
|
| 11680 |
var _createSuper2 = _interopRequireDefault(__webpack_require__(5)); |
| 11681 |
|
| 11682 |
var _commandBase = _interopRequireDefault(__webpack_require__(21)); |
| 11683 |
|
| 11684 |
var Toggle = /*#__PURE__*/function (_CommandBase) { |
| 11685 |
(0, _inherits2.default)(Toggle, _CommandBase); |
| 11686 |
|
| 11687 |
var _super = (0, _createSuper2.default)(Toggle); |
| 11688 |
|
| 11689 |
function Toggle() { |
| 11690 |
(0, _classCallCheck2.default)(this, Toggle); |
| 11691 |
return _super.apply(this, arguments); |
| 11692 |
} |
| 11693 |
|
| 11694 |
(0, _createClass2.default)(Toggle, [{ |
| 11695 |
key: "apply", |
| 11696 |
value: function apply() { |
| 11697 |
if (this.component.isOpen) { |
| 11698 |
this.component.close(); |
| 11699 |
} else { |
| 11700 |
$e.route(this.component.getNamespace()); |
| 11701 |
} |
| 11702 |
} |
| 11703 |
}]); |
| 11704 |
return Toggle; |
| 11705 |
}(_commandBase.default); |
| 11706 |
|
| 11707 |
exports.Toggle = Toggle; |
| 11708 |
var _default = Toggle; |
| 11709 |
exports.default = _default; |
| 11710 |
|
| 11711 |
/***/ }), |
| 11712 |
/* 325 */ |
| 11713 |
/***/ (function(module, exports, __webpack_require__) { |
| 11714 |
|
| 11715 |
"use strict"; |
| 11716 |
/** |
| 11717 |
* Copyright (c) 2013-present, Facebook, Inc. |
| 11718 |
* |
| 11719 |
* This source code is licensed under the MIT license found in the |
| 11720 |
* LICENSE file in the root directory of this source tree. |
| 11721 |
*/ |
| 11722 |
|
| 11723 |
|
| 11724 |
|
| 11725 |
var ReactPropTypesSecret = __webpack_require__(326); |
| 11726 |
|
| 11727 |
function emptyFunction() {} |
| 11728 |
function emptyFunctionWithReset() {} |
| 11729 |
emptyFunctionWithReset.resetWarningCache = emptyFunction; |
| 11730 |
|
| 11731 |
module.exports = function() { |
| 11732 |
function shim(props, propName, componentName, location, propFullName, secret) { |
| 11733 |
if (secret === ReactPropTypesSecret) { |
| 11734 |
// It is still safe when called from React. |
| 11735 |
return; |
| 11736 |
} |
| 11737 |
var err = new Error( |
| 11738 |
'Calling PropTypes validators directly is not supported by the `prop-types` package. ' + |
| 11739 |
'Use PropTypes.checkPropTypes() to call them. ' + |
| 11740 |
'Read more at http://fb.me/use-check-prop-types' |
| 11741 |
); |
| 11742 |
err.name = 'Invariant Violation'; |
| 11743 |
throw err; |
| 11744 |
}; |
| 11745 |
shim.isRequired = shim; |
| 11746 |
function getShim() { |
| 11747 |
return shim; |
| 11748 |
}; |
| 11749 |
// Important! |
| 11750 |
// Keep this list in sync with production version in `./factoryWithTypeCheckers.js`. |
| 11751 |
var ReactPropTypes = { |
| 11752 |
array: shim, |
| 11753 |
bool: shim, |
| 11754 |
func: shim, |
| 11755 |
number: shim, |
| 11756 |
object: shim, |
| 11757 |
string: shim, |
| 11758 |
symbol: shim, |
| 11759 |
|
| 11760 |
any: shim, |
| 11761 |
arrayOf: getShim, |
| 11762 |
element: shim, |
| 11763 |
elementType: shim, |
| 11764 |
instanceOf: getShim, |
| 11765 |
node: shim, |
| 11766 |
objectOf: getShim, |
| 11767 |
oneOf: getShim, |
| 11768 |
oneOfType: getShim, |
| 11769 |
shape: getShim, |
| 11770 |
exact: getShim, |
| 11771 |
|
| 11772 |
checkPropTypes: emptyFunctionWithReset, |
| 11773 |
resetWarningCache: emptyFunction |
| 11774 |
}; |
| 11775 |
|
| 11776 |
ReactPropTypes.PropTypes = ReactPropTypes; |
| 11777 |
|
| 11778 |
return ReactPropTypes; |
| 11779 |
}; |
| 11780 |
|
| 11781 |
|
| 11782 |
/***/ }), |
| 11783 |
/* 326 */ |
| 11784 |
/***/ (function(module, exports, __webpack_require__) { |
| 11785 |
|
| 11786 |
"use strict"; |
| 11787 |
/** |
| 11788 |
* Copyright (c) 2013-present, Facebook, Inc. |
| 11789 |
* |
| 11790 |
* This source code is licensed under the MIT license found in the |
| 11791 |
* LICENSE file in the root directory of this source tree. |
| 11792 |
*/ |
| 11793 |
|
| 11794 |
|
| 11795 |
|
| 11796 |
var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED'; |
| 11797 |
|
| 11798 |
module.exports = ReactPropTypesSecret; |
| 11799 |
|
| 11800 |
|
| 11801 |
/***/ }), |
| 11802 |
/* 327 */ |
| 11803 |
/***/ (function(module, exports) { |
| 11804 |
|
| 11805 |
module.exports = ReactDOM; |
| 11806 |
|
| 11807 |
/***/ }), |
| 11808 |
/* 328 */ |
| 11809 |
/***/ (function(module, exports, __webpack_require__) { |
| 11810 |
|
| 11811 |
"use strict"; |
| 11812 |
|
| 11813 |
|
| 11814 |
var _interopRequireDefault = __webpack_require__(0); |
| 11815 |
|
| 11816 |
__webpack_require__(147); |
| 11817 |
|
| 11818 |
__webpack_require__(117); |
| 11819 |
|
| 11820 |
__webpack_require__(72); |
| 11821 |
|
| 11822 |
var _controlsStack = _interopRequireDefault(__webpack_require__(368)); |
| 11823 |
|
| 11824 |
module.exports = Marionette.CompositeView.extend({ |
| 11825 |
template: Marionette.TemplateCache.get('#tmpl-elementor-repeater-row'), |
| 11826 |
className: 'elementor-repeater-fields', |
| 11827 |
ui: { |
| 11828 |
duplicateButton: '.elementor-repeater-tool-duplicate', |
| 11829 |
editButton: '.elementor-repeater-tool-edit', |
| 11830 |
removeButton: '.elementor-repeater-tool-remove', |
| 11831 |
itemTitle: '.elementor-repeater-row-item-title' |
| 11832 |
}, |
| 11833 |
behaviors: { |
| 11834 |
HandleInnerTabs: { |
| 11835 |
behaviorClass: __webpack_require__(329) |
| 11836 |
} |
| 11837 |
}, |
| 11838 |
triggers: { |
| 11839 |
'click @ui.removeButton': 'click:remove', |
| 11840 |
'click @ui.duplicateButton': 'click:duplicate', |
| 11841 |
'click @ui.itemTitle': 'click:edit' |
| 11842 |
}, |
| 11843 |
modelEvents: { |
| 11844 |
change: 'onModelChange' |
| 11845 |
}, |
| 11846 |
templateHelpers: function templateHelpers() { |
| 11847 |
return { |
| 11848 |
itemIndex: this.getOption('itemIndex'), |
| 11849 |
itemActions: this.getOption('itemActions') |
| 11850 |
}; |
| 11851 |
}, |
| 11852 |
childViewContainer: '.elementor-repeater-row-controls', |
| 11853 |
getChildView: function getChildView(item) { |
| 11854 |
var controlType = item.get('type'); |
| 11855 |
return elementor.getControlView(controlType); |
| 11856 |
}, |
| 11857 |
childViewOptions: function childViewOptions() { |
| 11858 |
return { |
| 11859 |
container: this.options.container |
| 11860 |
}; |
| 11861 |
}, |
| 11862 |
updateIndex: function updateIndex(newIndex) { |
| 11863 |
this.itemIndex = newIndex; |
| 11864 |
}, |
| 11865 |
setTitle: function setTitle() { |
| 11866 |
var titleField = this.getOption('titleField'); |
| 11867 |
var title = ''; |
| 11868 |
|
| 11869 |
if (titleField) { |
| 11870 |
title = Marionette.TemplateCache.prototype.compileTemplate(titleField)(this.model.parseDynamicSettings()); |
| 11871 |
} |
| 11872 |
|
| 11873 |
if (!title) { |
| 11874 |
title = elementor.translate('Item #%s', [this.getOption('itemIndex')]); |
| 11875 |
} |
| 11876 |
|
| 11877 |
this.ui.itemTitle.html(title); |
| 11878 |
}, |
| 11879 |
toggleSort: function toggleSort(enable) { |
| 11880 |
this.$el.toggleClass('elementor-repeater-row--disable-sort', !enable); |
| 11881 |
}, |
| 11882 |
initialize: function initialize(options) { |
| 11883 |
this.itemIndex = 0; // Collection for Controls list |
| 11884 |
|
| 11885 |
this.collection = new Backbone.Collection(_.values(elementor.mergeControlsSettings(options.controlFields))); |
| 11886 |
}, |
| 11887 |
onRender: function onRender() { |
| 11888 |
this.setTitle(); |
| 11889 |
|
| 11890 |
_controlsStack.default.handlePopovers(this); |
| 11891 |
}, |
| 11892 |
onModelChange: function onModelChange() { |
| 11893 |
if (this.getOption('titleField')) { |
| 11894 |
this.setTitle(); |
| 11895 |
} |
| 11896 |
}, |
| 11897 |
onChildviewResponsiveSwitcherClick: function onChildviewResponsiveSwitcherClick(childView, device) { |
| 11898 |
if ('desktop' === device) { |
| 11899 |
elementor.getPanelView().getCurrentPageView().$el.toggleClass('elementor-responsive-switchers-open'); |
| 11900 |
} |
| 11901 |
} |
| 11902 |
}); |
| 11903 |
|
| 11904 |
/***/ }), |
| 11905 |
/* 329 */ |
| 11906 |
/***/ (function(module, exports, __webpack_require__) { |
| 11907 |
|
| 11908 |
"use strict"; |
| 11909 |
|
| 11910 |
|
| 11911 |
__webpack_require__(25); |
| 11912 |
|
| 11913 |
var InnerTabsBehavior; |
| 11914 |
InnerTabsBehavior = Marionette.Behavior.extend({ |
| 11915 |
onRenderCollection: function onRenderCollection() { |
| 11916 |
this.handleInnerTabs(this.view); |
| 11917 |
}, |
| 11918 |
handleInnerTabs: function handleInnerTabs(parent) { |
| 11919 |
var closedClass = 'elementor-tab-close', |
| 11920 |
activeClass = 'elementor-tab-active', |
| 11921 |
tabsWrappers = parent.children.filter(function (view) { |
| 11922 |
return 'tabs' === view.model.get('type'); |
| 11923 |
}); |
| 11924 |
|
| 11925 |
_.each(tabsWrappers, function (view) { |
| 11926 |
view.$el.find('.elementor-control-content').remove(); |
| 11927 |
var tabsId = view.model.get('name'), |
| 11928 |
tabs = parent.children.filter(function (childView) { |
| 11929 |
return 'tab' === childView.model.get('type') && childView.model.get('tabs_wrapper') === tabsId; |
| 11930 |
}); |
| 11931 |
|
| 11932 |
_.each(tabs, function (childView, index) { |
| 11933 |
view._addChildView(childView); |
| 11934 |
|
| 11935 |
var tabId = childView.model.get('name'), |
| 11936 |
controlsUnderTab = parent.children.filter(function (controlView) { |
| 11937 |
return tabId === controlView.model.get('inner_tab'); |
| 11938 |
}); |
| 11939 |
|
| 11940 |
if (0 === index) { |
| 11941 |
childView.$el.addClass(activeClass); |
| 11942 |
} else { |
| 11943 |
_.each(controlsUnderTab, function (controlView) { |
| 11944 |
controlView.$el.addClass(closedClass); |
| 11945 |
}); |
| 11946 |
} |
| 11947 |
}); |
| 11948 |
}); |
| 11949 |
}, |
| 11950 |
onChildviewControlTabClicked: function onChildviewControlTabClicked(childView) { |
| 11951 |
var closedClass = 'elementor-tab-close', |
| 11952 |
activeClass = 'elementor-tab-active', |
| 11953 |
tabClicked = childView.model.get('name'), |
| 11954 |
childrenUnderTab = this.view.children.filter(function (view) { |
| 11955 |
return 'tab' !== view.model.get('type') && childView.model.get('tabs_wrapper') === view.model.get('tabs_wrapper'); |
| 11956 |
}), |
| 11957 |
siblingTabs = this.view.children.filter(function (view) { |
| 11958 |
return 'tab' === view.model.get('type') && childView.model.get('tabs_wrapper') === view.model.get('tabs_wrapper'); |
| 11959 |
}); |
| 11960 |
|
| 11961 |
_.each(siblingTabs, function (view) { |
| 11962 |
view.$el.removeClass(activeClass); |
| 11963 |
}); |
| 11964 |
|
| 11965 |
childView.$el.addClass(activeClass); |
| 11966 |
|
| 11967 |
_.each(childrenUnderTab, function (view) { |
| 11968 |
if (view.model.get('inner_tab') === tabClicked) { |
| 11969 |
view.$el.removeClass(closedClass); |
| 11970 |
} else { |
| 11971 |
view.$el.addClass(closedClass); |
| 11972 |
} |
| 11973 |
}); |
| 11974 |
|
| 11975 |
elementor.getPanelView().updateScrollbar(); |
| 11976 |
} |
| 11977 |
}); |
| 11978 |
module.exports = InnerTabsBehavior; |
| 11979 |
|
| 11980 |
/***/ }), |
| 11981 |
/* 330 */ |
| 11982 |
/***/ (function(module, exports, __webpack_require__) { |
| 11983 |
|
| 11984 |
// Works with __proto__ only. Old v8 can't work with null proto objects. |
| 11985 |
/* eslint-disable no-proto */ |
| 11986 |
var isObject = __webpack_require__(30); |
| 11987 |
var anObject = __webpack_require__(18); |
| 11988 |
var check = function (O, proto) { |
| 11989 |
anObject(O); |
| 11990 |
if (!isObject(proto) && proto !== null) throw TypeError(proto + ": can't set as prototype!"); |
| 11991 |
}; |
| 11992 |
module.exports = { |
| 11993 |
set: Object.setPrototypeOf || ('__proto__' in {} ? // eslint-disable-line |
| 11994 |
function (test, buggy, set) { |
| 11995 |
try { |
| 11996 |
set = __webpack_require__(73)(Function.call, __webpack_require__(311).f(Object.prototype, '__proto__').set, 2); |
| 11997 |
set(test, []); |
| 11998 |
buggy = !(test instanceof Array); |
| 11999 |
} catch (e) { buggy = true; } |
| 12000 |
return function setPrototypeOf(O, proto) { |
| 12001 |
check(O, proto); |
| 12002 |
if (buggy) O.__proto__ = proto; |
| 12003 |
else set(O, proto); |
| 12004 |
return O; |
| 12005 |
}; |
| 12006 |
}({}, false) : undefined), |
| 12007 |
check: check |
| 12008 |
}; |
| 12009 |
|
| 12010 |
|
| 12011 |
/***/ }), |
| 12012 |
/* 331 */ |
| 12013 |
/***/ (function(module, exports) { |
| 12014 |
|
| 12015 |
exports.f = {}.propertyIsEnumerable; |
| 12016 |
|
| 12017 |
|
| 12018 |
/***/ }), |
| 12019 |
/* 332 */ |
| 12020 |
/***/ (function(module, exports, __webpack_require__) { |
| 12021 |
|
| 12022 |
"use strict"; |
| 12023 |
|
| 12024 |
|
| 12025 |
var _interopRequireDefault = __webpack_require__(0); |
| 12026 |
|
| 12027 |
__webpack_require__(183); |
| 12028 |
|
| 12029 |
__webpack_require__(72); |
| 12030 |
|
| 12031 |
__webpack_require__(58); |
| 12032 |
|
| 12033 |
__webpack_require__(119); |
| 12034 |
|
| 12035 |
__webpack_require__(80); |
| 12036 |
|
| 12037 |
var _keys = _interopRequireDefault(__webpack_require__(23)); |
| 12038 |
|
| 12039 |
(function ($) { |
| 12040 |
var Stylesheet = function Stylesheet() { |
| 12041 |
var self = this, |
| 12042 |
rules = {}, |
| 12043 |
rawCSS = {}, |
| 12044 |
devices = {}; |
| 12045 |
|
| 12046 |
var getDeviceMaxValue = function getDeviceMaxValue(deviceName) { |
| 12047 |
var deviceNames = (0, _keys.default)(devices), |
| 12048 |
deviceNameIndex = deviceNames.indexOf(deviceName), |
| 12049 |
nextIndex = deviceNameIndex + 1; |
| 12050 |
|
| 12051 |
if (nextIndex >= deviceNames.length) { |
| 12052 |
throw new RangeError('Max value for this device is out of range.'); |
| 12053 |
} |
| 12054 |
|
| 12055 |
return devices[deviceNames[nextIndex]] - 1; |
| 12056 |
}; |
| 12057 |
|
| 12058 |
var queryToHash = function queryToHash(query) { |
| 12059 |
var hash = []; |
| 12060 |
$.each(query, function (endPoint) { |
| 12061 |
hash.push(endPoint + '_' + this); |
| 12062 |
}); |
| 12063 |
return hash.join('-'); |
| 12064 |
}; |
| 12065 |
|
| 12066 |
var hashToQuery = function hashToQuery(hash) { |
| 12067 |
var query = {}; |
| 12068 |
hash = hash.split('-').filter(String); |
| 12069 |
hash.forEach(function (singleQuery) { |
| 12070 |
var queryParts = singleQuery.split('_'), |
| 12071 |
endPoint = queryParts[0], |
| 12072 |
deviceName = queryParts[1]; |
| 12073 |
query[endPoint] = 'max' === endPoint ? getDeviceMaxValue(deviceName) : devices[deviceName]; |
| 12074 |
}); |
| 12075 |
return query; |
| 12076 |
}; |
| 12077 |
|
| 12078 |
var addQueryHash = function addQueryHash(queryHash) { |
| 12079 |
rules[queryHash] = {}; |
| 12080 |
var hashes = (0, _keys.default)(rules); |
| 12081 |
|
| 12082 |
if (hashes.length < 2) { |
| 12083 |
return; |
| 12084 |
} // Sort the devices from narrowest to widest |
| 12085 |
|
| 12086 |
|
| 12087 |
hashes.sort(function (a, b) { |
| 12088 |
if ('all' === a) { |
| 12089 |
return -1; |
| 12090 |
} |
| 12091 |
|
| 12092 |
if ('all' === b) { |
| 12093 |
return 1; |
| 12094 |
} |
| 12095 |
|
| 12096 |
var aQuery = hashToQuery(a), |
| 12097 |
bQuery = hashToQuery(b); |
| 12098 |
return bQuery.max - aQuery.max; |
| 12099 |
}); |
| 12100 |
var sortedRules = {}; |
| 12101 |
hashes.forEach(function (deviceName) { |
| 12102 |
sortedRules[deviceName] = rules[deviceName]; |
| 12103 |
}); |
| 12104 |
rules = sortedRules; |
| 12105 |
}; |
| 12106 |
|
| 12107 |
var getQueryHashStyleFormat = function getQueryHashStyleFormat(queryHash) { |
| 12108 |
var query = hashToQuery(queryHash), |
| 12109 |
styleFormat = []; |
| 12110 |
$.each(query, function (endPoint) { |
| 12111 |
styleFormat.push('(' + endPoint + '-width:' + this + 'px)'); |
| 12112 |
}); |
| 12113 |
return '@media' + styleFormat.join(' and '); |
| 12114 |
}; |
| 12115 |
|
| 12116 |
this.addDevice = function (newDeviceName, deviceValue) { |
| 12117 |
devices[newDeviceName] = deviceValue; |
| 12118 |
var deviceNames = (0, _keys.default)(devices); |
| 12119 |
|
| 12120 |
if (deviceNames.length < 2) { |
| 12121 |
return self; |
| 12122 |
} // Sort the devices from narrowest to widest |
| 12123 |
|
| 12124 |
|
| 12125 |
deviceNames.sort(function (a, b) { |
| 12126 |
return devices[a] - devices[b]; |
| 12127 |
}); |
| 12128 |
var sortedDevices = {}; |
| 12129 |
deviceNames.forEach(function (deviceName) { |
| 12130 |
sortedDevices[deviceName] = devices[deviceName]; |
| 12131 |
}); |
| 12132 |
devices = sortedDevices; |
| 12133 |
return self; |
| 12134 |
}; |
| 12135 |
|
| 12136 |
this.addRawCSS = function (key, css) { |
| 12137 |
rawCSS[key] = css; |
| 12138 |
}; |
| 12139 |
|
| 12140 |
this.addRules = function (selector, styleRules, query) { |
| 12141 |
var queryHash = 'all'; |
| 12142 |
|
| 12143 |
if (!_.isEmpty(query)) { |
| 12144 |
queryHash = queryToHash(query); |
| 12145 |
} |
| 12146 |
|
| 12147 |
if (!rules[queryHash]) { |
| 12148 |
addQueryHash(queryHash); |
| 12149 |
} |
| 12150 |
|
| 12151 |
if (!styleRules) { |
| 12152 |
var parsedRules = selector.match(/[^{]+\{[^}]+}/g); |
| 12153 |
$.each(parsedRules, function () { |
| 12154 |
var parsedRule = this.match(/([^{]+)\{([^}]+)}/); |
| 12155 |
|
| 12156 |
if (parsedRule) { |
| 12157 |
self.addRules(parsedRule[1].trim(), parsedRule[2].trim(), query); |
| 12158 |
} |
| 12159 |
}); |
| 12160 |
return; |
| 12161 |
} |
| 12162 |
|
| 12163 |
if (!rules[queryHash][selector]) { |
| 12164 |
rules[queryHash][selector] = {}; |
| 12165 |
} |
| 12166 |
|
| 12167 |
if ('string' === typeof styleRules) { |
| 12168 |
styleRules = styleRules.split(';').filter(String); |
| 12169 |
var orderedRules = {}; |
| 12170 |
|
| 12171 |
try { |
| 12172 |
$.each(styleRules, function () { |
| 12173 |
var property = this.split(/:(.*)?/); |
| 12174 |
orderedRules[property[0].trim()] = property[1].trim().replace(';', ''); |
| 12175 |
}); |
| 12176 |
} catch (error) { |
| 12177 |
// At least one of the properties is incorrect |
| 12178 |
return; |
| 12179 |
} |
| 12180 |
|
| 12181 |
styleRules = orderedRules; |
| 12182 |
} |
| 12183 |
|
| 12184 |
$.extend(rules[queryHash][selector], styleRules); |
| 12185 |
return self; |
| 12186 |
}; |
| 12187 |
|
| 12188 |
this.getRules = function () { |
| 12189 |
return rules; |
| 12190 |
}; |
| 12191 |
|
| 12192 |
this.empty = function () { |
| 12193 |
rules = {}; |
| 12194 |
rawCSS = {}; |
| 12195 |
}; |
| 12196 |
|
| 12197 |
this.toString = function () { |
| 12198 |
var styleText = ''; |
| 12199 |
$.each(rules, function (queryHash) { |
| 12200 |
var deviceText = Stylesheet.parseRules(this); |
| 12201 |
|
| 12202 |
if ('all' !== queryHash) { |
| 12203 |
deviceText = getQueryHashStyleFormat(queryHash) + '{' + deviceText + '}'; |
| 12204 |
} |
| 12205 |
|
| 12206 |
styleText += deviceText; |
| 12207 |
}); |
| 12208 |
$.each(rawCSS, function () { |
| 12209 |
styleText += this; |
| 12210 |
}); |
| 12211 |
return styleText; |
| 12212 |
}; |
| 12213 |
}; |
| 12214 |
|
| 12215 |
Stylesheet.parseRules = function (rules) { |
| 12216 |
var parsedRules = ''; |
| 12217 |
$.each(rules, function (selector) { |
| 12218 |
var selectorContent = Stylesheet.parseProperties(this); |
| 12219 |
|
| 12220 |
if (selectorContent) { |
| 12221 |
parsedRules += selector + '{' + selectorContent + '}'; |
| 12222 |
} |
| 12223 |
}); |
| 12224 |
return parsedRules; |
| 12225 |
}; |
| 12226 |
|
| 12227 |
Stylesheet.parseProperties = function (properties) { |
| 12228 |
var parsedProperties = ''; |
| 12229 |
$.each(properties, function (propertyKey) { |
| 12230 |
if (this) { |
| 12231 |
parsedProperties += propertyKey + ':' + this + ';'; |
| 12232 |
} |
| 12233 |
}); |
| 12234 |
return parsedProperties; |
| 12235 |
}; |
| 12236 |
|
| 12237 |
module.exports = Stylesheet; |
| 12238 |
})(jQuery); |
| 12239 |
|
| 12240 |
/***/ }), |
| 12241 |
/* 333 */ |
| 12242 |
/***/ (function(module, exports, __webpack_require__) { |
| 12243 |
|
| 12244 |
"use strict"; |
| 12245 |
|
| 12246 |
|
| 12247 |
var _interopRequireDefault = __webpack_require__(0); |
| 12248 |
|
| 12249 |
var _keys = _interopRequireDefault(__webpack_require__(23)); |
| 12250 |
|
| 12251 |
module.exports = Marionette.CompositeView.extend({ |
| 12252 |
templateHelpers: function templateHelpers() { |
| 12253 |
return { |
| 12254 |
view: this |
| 12255 |
}; |
| 12256 |
}, |
| 12257 |
getBehavior: function getBehavior(name) { |
| 12258 |
return this._behaviors[(0, _keys.default)(this.behaviors()).indexOf(name)]; |
| 12259 |
}, |
| 12260 |
initialize: function initialize() { |
| 12261 |
this.collection = this.model.get('elements'); |
| 12262 |
}, |
| 12263 |
addChildModel: function addChildModel(model, options) { |
| 12264 |
return this.collection.add(model, options, true); |
| 12265 |
}, |
| 12266 |
addElement: function addElement(data, options) { |
| 12267 |
if (this.isCollectionFilled()) { |
| 12268 |
return; |
| 12269 |
} |
| 12270 |
|
| 12271 |
options = jQuery.extend({ |
| 12272 |
trigger: false, |
| 12273 |
edit: true, |
| 12274 |
onBeforeAdd: null, |
| 12275 |
onAfterAdd: null |
| 12276 |
}, options); |
| 12277 |
var childTypes = this.getChildType(); |
| 12278 |
var newItem, elType; |
| 12279 |
|
| 12280 |
if (data instanceof Backbone.Model) { |
| 12281 |
newItem = data; |
| 12282 |
elType = newItem.get('elType'); |
| 12283 |
} else { |
| 12284 |
newItem = { |
| 12285 |
id: elementorCommon.helpers.getUniqueId(), |
| 12286 |
elType: childTypes[0], |
| 12287 |
settings: {}, |
| 12288 |
elements: [] |
| 12289 |
}; |
| 12290 |
|
| 12291 |
if (data) { |
| 12292 |
jQuery.extend(newItem, data); |
| 12293 |
} |
| 12294 |
|
| 12295 |
elType = newItem.elType; |
| 12296 |
} |
| 12297 |
|
| 12298 |
if (-1 === childTypes.indexOf(elType)) { |
| 12299 |
return this.children.last().addElement(newItem, options); |
| 12300 |
} |
| 12301 |
|
| 12302 |
if (options.clone) { |
| 12303 |
newItem = this.cloneItem(newItem); |
| 12304 |
} |
| 12305 |
|
| 12306 |
if (options.trigger) { |
| 12307 |
elementor.channels.data.trigger(options.trigger.beforeAdd, newItem); |
| 12308 |
} |
| 12309 |
|
| 12310 |
if (options.onBeforeAdd) { |
| 12311 |
options.onBeforeAdd(); |
| 12312 |
} |
| 12313 |
|
| 12314 |
var newModel = this.addChildModel(newItem, { |
| 12315 |
at: options.at |
| 12316 |
}), |
| 12317 |
newView = this.children.findByModel(newModel); |
| 12318 |
|
| 12319 |
if (options.onAfterAdd) { |
| 12320 |
options.onAfterAdd(newModel, newView); |
| 12321 |
} |
| 12322 |
|
| 12323 |
if (options.trigger) { |
| 12324 |
elementor.channels.data.trigger(options.trigger.afterAdd, newItem); |
| 12325 |
} |
| 12326 |
|
| 12327 |
if (options.edit && elementor.documents.getCurrent().history.getActive()) { |
| 12328 |
// Ensure container is created. TODO: Open editor via UI hook after `document/elements/create`. |
| 12329 |
newView.getContainer(); |
| 12330 |
newModel.trigger('request:edit'); |
| 12331 |
} |
| 12332 |
|
| 12333 |
return newView; |
| 12334 |
}, |
| 12335 |
addChildElement: function addChildElement(data, options) { |
| 12336 |
elementorCommon.helpers.softDeprecated('addChildElement', '2.8.0', "$e.run( 'document/elements/create' )"); |
| 12337 |
|
| 12338 |
if (Object !== data.constructor) { |
| 12339 |
data = jQuery.extend({}, data); |
| 12340 |
} |
| 12341 |
|
| 12342 |
$e.run('document/elements/create', { |
| 12343 |
container: this.getContainer(), |
| 12344 |
model: data, |
| 12345 |
options: options |
| 12346 |
}); |
| 12347 |
}, |
| 12348 |
cloneItem: function cloneItem(item) { |
| 12349 |
var self = this; |
| 12350 |
|
| 12351 |
if (item instanceof Backbone.Model) { |
| 12352 |
return item.clone(); |
| 12353 |
} |
| 12354 |
|
| 12355 |
item.id = elementorCommon.helpers.getUniqueId(); |
| 12356 |
item.settings._element_id = ''; |
| 12357 |
item.elements.forEach(function (childItem, index) { |
| 12358 |
item.elements[index] = self.cloneItem(childItem); |
| 12359 |
}); |
| 12360 |
return item; |
| 12361 |
}, |
| 12362 |
lookup: function lookup() { |
| 12363 |
var element = this; |
| 12364 |
|
| 12365 |
if (element.isDisconnected()) { |
| 12366 |
element = $e.components.get('document').utils.findViewById(element.model.id); |
| 12367 |
} |
| 12368 |
|
| 12369 |
return element; |
| 12370 |
}, |
| 12371 |
isDisconnected: function isDisconnected() { |
| 12372 |
return this.isDestroyed || !this.el.isConnected; |
| 12373 |
}, |
| 12374 |
isCollectionFilled: function isCollectionFilled() { |
| 12375 |
return false; |
| 12376 |
} |
| 12377 |
}); |
| 12378 |
|
| 12379 |
/***/ }), |
| 12380 |
/* 334 */ |
| 12381 |
/***/ (function(module, exports, __webpack_require__) { |
| 12382 |
|
| 12383 |
"use strict"; |
| 12384 |
|
| 12385 |
|
| 12386 |
var anObject = __webpack_require__(18); |
| 12387 |
var sameValue = __webpack_require__(386); |
| 12388 |
var regExpExec = __webpack_require__(94); |
| 12389 |
|
| 12390 |
// @@search logic |
| 12391 |
__webpack_require__(95)('search', 1, function (defined, SEARCH, $search, maybeCallNative) { |
| 12392 |
return [ |
| 12393 |
// `String.prototype.search` method |
| 12394 |
// https://tc39.github.io/ecma262/#sec-string.prototype.search |
| 12395 |
function search(regexp) { |
| 12396 |
var O = defined(this); |
| 12397 |
var fn = regexp == undefined ? undefined : regexp[SEARCH]; |
| 12398 |
return fn !== undefined ? fn.call(regexp, O) : new RegExp(regexp)[SEARCH](String(O)); |
| 12399 |
}, |
| 12400 |
// `RegExp.prototype[@@search]` method |
| 12401 |
// https://tc39.github.io/ecma262/#sec-regexp.prototype-@@search |
| 12402 |
function (regexp) { |
| 12403 |
var res = maybeCallNative($search, regexp, this); |
| 12404 |
if (res.done) return res.value; |
| 12405 |
var rx = anObject(regexp); |
| 12406 |
var S = String(this); |
| 12407 |
var previousLastIndex = rx.lastIndex; |
| 12408 |
if (!sameValue(previousLastIndex, 0)) rx.lastIndex = 0; |
| 12409 |
var result = regExpExec(rx, S); |
| 12410 |
if (!sameValue(rx.lastIndex, previousLastIndex)) rx.lastIndex = previousLastIndex; |
| 12411 |
return result === null ? -1 : result.index; |
| 12412 |
} |
| 12413 |
]; |
| 12414 |
}); |
| 12415 |
|
| 12416 |
|
| 12417 |
/***/ }), |
| 12418 |
/* 335 */ |
| 12419 |
/***/ (function(module, exports, __webpack_require__) { |
| 12420 |
|
| 12421 |
"use strict"; |
| 12422 |
|
| 12423 |
|
| 12424 |
var ControlsCSSParser = __webpack_require__(293); |
| 12425 |
|
| 12426 |
module.exports = elementorModules.ViewModule.extend({ |
| 12427 |
model: null, |
| 12428 |
hasChange: false, |
| 12429 |
changeCallbacks: {}, |
| 12430 |
addChangeCallback: function addChangeCallback(attribute, callback) { |
| 12431 |
this.changeCallbacks[attribute] = callback; |
| 12432 |
}, |
| 12433 |
bindEvents: function bindEvents() { |
| 12434 |
elementor.on('document:loaded', this.onElementorDocumentLoaded); |
| 12435 |
this.model.on('change', this.onModelChange); |
| 12436 |
}, |
| 12437 |
unbindEvents: function unbindEvents() { |
| 12438 |
elementor.off('document:loaded', this.onElementorDocumentLoaded); |
| 12439 |
}, |
| 12440 |
addPanelPage: function addPanelPage() { |
| 12441 |
var name = this.getSettings('name'); |
| 12442 |
elementor.getPanelView().addPage(name + '_settings', { |
| 12443 |
view: elementor.settings.panelPages[name] || elementor.settings.panelPages.base, |
| 12444 |
title: this.getSettings('panelPage.title'), |
| 12445 |
options: { |
| 12446 |
editedView: this.getEditedView(), |
| 12447 |
model: this.model, |
| 12448 |
controls: this.model.controls, |
| 12449 |
name: name |
| 12450 |
} |
| 12451 |
}); |
| 12452 |
}, |
| 12453 |
getContainerId: function getContainerId() { |
| 12454 |
return this.getSettings('name') + '_settings'; |
| 12455 |
}, |
| 12456 |
// Emulate an element view/model structure with the parts needed for a container. |
| 12457 |
getEditedView: function getEditedView() { |
| 12458 |
var id = this.getContainerId(), |
| 12459 |
editModel = new Backbone.Model({ |
| 12460 |
id: id, |
| 12461 |
elType: id, |
| 12462 |
settings: this.model |
| 12463 |
}); |
| 12464 |
var container = new elementorModules.editor.Container({ |
| 12465 |
type: id, |
| 12466 |
id: editModel.id, |
| 12467 |
model: editModel, |
| 12468 |
settings: editModel.get('settings'), |
| 12469 |
view: false, |
| 12470 |
label: this.getSettings('panelPage').title, |
| 12471 |
controls: this.model.controls, |
| 12472 |
document: this.getDocument(), |
| 12473 |
renderer: false |
| 12474 |
}); |
| 12475 |
return { |
| 12476 |
getContainer: function getContainer() { |
| 12477 |
return container; |
| 12478 |
}, |
| 12479 |
getEditModel: function getEditModel() { |
| 12480 |
return editModel; |
| 12481 |
}, |
| 12482 |
model: editModel |
| 12483 |
}; |
| 12484 |
}, |
| 12485 |
getDocument: function getDocument() { |
| 12486 |
return false; |
| 12487 |
}, |
| 12488 |
updateStylesheet: function updateStylesheet(keepOldEntries) { |
| 12489 |
var controlsCSS = this.getControlsCSS(); |
| 12490 |
|
| 12491 |
if (!keepOldEntries) { |
| 12492 |
controlsCSS.stylesheet.empty(); |
| 12493 |
} |
| 12494 |
|
| 12495 |
controlsCSS.addStyleRules(this.model.getStyleControls(), this.model.attributes, this.model.controls, [/{{WRAPPER}}/g], [this.getSettings('cssWrapperSelector')]); |
| 12496 |
controlsCSS.addStyleToDocument({ |
| 12497 |
// Ensures we don't override default global style |
| 12498 |
at: 'before', |
| 12499 |
of: '#elementor-style-e-global-style' |
| 12500 |
}); |
| 12501 |
}, |
| 12502 |
initModel: function initModel() { |
| 12503 |
this.model = new elementorModules.editor.elements.models.BaseSettings(this.getSettings('settings'), { |
| 12504 |
controls: this.getSettings('controls') |
| 12505 |
}); |
| 12506 |
}, |
| 12507 |
getStyleId: function getStyleId() { |
| 12508 |
return this.getSettings('name'); |
| 12509 |
}, |
| 12510 |
initControlsCSSParser: function initControlsCSSParser() { |
| 12511 |
var controlsCSS; |
| 12512 |
|
| 12513 |
this.destroyControlsCSS = function () { |
| 12514 |
controlsCSS.removeStyleFromDocument(); |
| 12515 |
}; |
| 12516 |
|
| 12517 |
this.getControlsCSS = function () { |
| 12518 |
if (!controlsCSS) { |
| 12519 |
controlsCSS = new ControlsCSSParser({ |
| 12520 |
id: this.getStyleId(), |
| 12521 |
settingsModel: this.model, |
| 12522 |
context: this.getEditedView() |
| 12523 |
}); |
| 12524 |
} |
| 12525 |
|
| 12526 |
return controlsCSS; |
| 12527 |
}; |
| 12528 |
}, |
| 12529 |
getDataToSave: function getDataToSave(data) { |
| 12530 |
return data; |
| 12531 |
}, |
| 12532 |
save: function save(callback) { |
| 12533 |
var self = this; |
| 12534 |
|
| 12535 |
if (!self.hasChange) { |
| 12536 |
return; |
| 12537 |
} |
| 12538 |
|
| 12539 |
var settings = this.model.toJSON({ |
| 12540 |
remove: ['default'] |
| 12541 |
}), |
| 12542 |
data = this.getDataToSave({ |
| 12543 |
data: settings |
| 12544 |
}); |
| 12545 |
|
| 12546 |
if (!elementorCommonConfig.isTesting) { |
| 12547 |
NProgress.start(); |
| 12548 |
} |
| 12549 |
|
| 12550 |
elementorCommon.ajax.addRequest('save_' + this.getSettings('name') + '_settings', { |
| 12551 |
data: data, |
| 12552 |
success: function success() { |
| 12553 |
if (!elementorCommonConfig.isTesting) { |
| 12554 |
NProgress.done(); |
| 12555 |
} |
| 12556 |
|
| 12557 |
self.setSettings('settings', settings); |
| 12558 |
self.hasChange = false; |
| 12559 |
|
| 12560 |
if (callback) { |
| 12561 |
callback.apply(self, arguments); |
| 12562 |
} |
| 12563 |
}, |
| 12564 |
error: function error() { |
| 12565 |
alert('An error occurred'); |
| 12566 |
} |
| 12567 |
}); |
| 12568 |
}, |
| 12569 |
onInit: function onInit() { |
| 12570 |
this.initModel(); |
| 12571 |
this.initControlsCSSParser(); |
| 12572 |
this.addPanelMenuItem(); |
| 12573 |
this.debounceSave = _.debounce(this.save, 3000); |
| 12574 |
elementorModules.ViewModule.prototype.onInit.apply(this, arguments); |
| 12575 |
}, |
| 12576 |
|
| 12577 |
/** |
| 12578 |
* BC for custom settings without a JS component. |
| 12579 |
*/ |
| 12580 |
addPanelMenuItem: function addPanelMenuItem() { |
| 12581 |
var menuSettings = this.getSettings('panelPage.menu'); |
| 12582 |
|
| 12583 |
if (!menuSettings) { |
| 12584 |
return; |
| 12585 |
} |
| 12586 |
|
| 12587 |
var namespace = 'panel/' + this.getSettings('name') + '-settings', |
| 12588 |
menuItemOptions = { |
| 12589 |
icon: menuSettings.icon, |
| 12590 |
title: this.getSettings('panelPage.title'), |
| 12591 |
type: 'page', |
| 12592 |
pageName: this.getSettings('name') + '_settings', |
| 12593 |
callback: function callback() { |
| 12594 |
return $e.route("".concat(namespace, "/settings")); |
| 12595 |
} |
| 12596 |
}; |
| 12597 |
$e.bc.ensureTab(namespace, 'settings', menuItemOptions.pageName); |
| 12598 |
elementor.modules.layouts.panel.pages.menu.Menu.addItem(menuItemOptions, 'settings', menuSettings.beforeItem); |
| 12599 |
}, |
| 12600 |
onModelChange: function onModelChange(model) { |
| 12601 |
var self = this; |
| 12602 |
self.hasChange = true; |
| 12603 |
this.getControlsCSS().stylesheet.empty(); |
| 12604 |
|
| 12605 |
_.each(model.changed, function (value, key) { |
| 12606 |
if (self.changeCallbacks[key]) { |
| 12607 |
self.changeCallbacks[key].call(self, value); |
| 12608 |
} |
| 12609 |
}); |
| 12610 |
|
| 12611 |
self.updateStylesheet(true); |
| 12612 |
self.debounceSave(); |
| 12613 |
}, |
| 12614 |
onElementorDocumentLoaded: function onElementorDocumentLoaded() { |
| 12615 |
this.updateStylesheet(); |
| 12616 |
this.addPanelPage(); |
| 12617 |
|
| 12618 |
if (!elementor.userCan('design')) { |
| 12619 |
$e.route('panel/page-settings/settings'); |
| 12620 |
} |
| 12621 |
}, |
| 12622 |
destroy: function destroy() { |
| 12623 |
this.unbindEvents(); |
| 12624 |
this.model.destroy(); |
| 12625 |
} |
| 12626 |
}); |
| 12627 |
|
| 12628 |
/***/ }), |
| 12629 |
/* 336 */, |
| 12630 |
/* 337 */, |
| 12631 |
/* 338 */, |
| 12632 |
/* 339 */, |
| 12633 |
/* 340 */, |
| 12634 |
/* 341 */, |
| 12635 |
/* 342 */, |
| 12636 |
/* 343 */, |
| 12637 |
/* 344 */, |
| 12638 |
/* 345 */, |
| 12639 |
/* 346 */, |
| 12640 |
/* 347 */, |
| 12641 |
/* 348 */, |
| 12642 |
/* 349 */ |
| 12643 |
/***/ (function(module, exports, __webpack_require__) { |
| 12644 |
|
| 12645 |
"use strict"; |
| 12646 |
|
| 12647 |
|
| 12648 |
var _interopRequireDefault = __webpack_require__(0); |
| 12649 |
|
| 12650 |
var _Object$defineProperty = __webpack_require__(1); |
| 12651 |
|
| 12652 |
_Object$defineProperty(exports, "__esModule", { |
| 12653 |
value: true |
| 12654 |
}); |
| 12655 |
|
| 12656 |
exports.default = void 0; |
| 12657 |
|
| 12658 |
var _classCallCheck2 = _interopRequireDefault(__webpack_require__(2)); |
| 12659 |
|
| 12660 |
var _createClass2 = _interopRequireDefault(__webpack_require__(3)); |
| 12661 |
|
| 12662 |
var _component = _interopRequireDefault(__webpack_require__(442)); |
| 12663 |
|
| 12664 |
var _component2 = _interopRequireDefault(__webpack_require__(443)); |
| 12665 |
|
| 12666 |
var _component3 = _interopRequireDefault(__webpack_require__(444)); |
| 12667 |
|
| 12668 |
var _panelPage = _interopRequireDefault(__webpack_require__(450)); |
| 12669 |
|
| 12670 |
var Manager = /*#__PURE__*/function () { |
| 12671 |
function Manager() { |
| 12672 |
(0, _classCallCheck2.default)(this, Manager); |
| 12673 |
elementorCommon.elements.$window.on('elementor:loaded', this.init); |
| 12674 |
} |
| 12675 |
|
| 12676 |
(0, _createClass2.default)(Manager, [{ |
| 12677 |
key: "init", |
| 12678 |
value: function init() { |
| 12679 |
$e.components.register(new _component.default()); |
| 12680 |
$e.components.register(new _component2.default()); |
| 12681 |
$e.components.register(new _component3.default()); |
| 12682 |
elementor.on('panel:init', function () { |
| 12683 |
elementor.getPanelView().addPage('historyPage', { |
| 12684 |
view: _panelPage.default, |
| 12685 |
title: elementor.translate('history') |
| 12686 |
}); |
| 12687 |
}); |
| 12688 |
} |
| 12689 |
}, { |
| 12690 |
key: "history", |
| 12691 |
get: function get() { |
| 12692 |
elementorCommon.helpers.softDeprecated('elementor.history.history', '2.9.0', 'elementor.documents.getCurrent().history'); |
| 12693 |
return elementor.documents.getCurrent().history; |
| 12694 |
} |
| 12695 |
}, { |
| 12696 |
key: "revisions", |
| 12697 |
get: function get() { |
| 12698 |
elementorCommon.helpers.softDeprecated('elementor.history.revisions', '2.9.0', 'elementor.documents.getCurrent().revisions'); |
| 12699 |
return elementor.documents.getCurrent().revisions; |
| 12700 |
} |
| 12701 |
}]); |
| 12702 |
return Manager; |
| 12703 |
}(); |
| 12704 |
|
| 12705 |
exports.default = Manager; |
| 12706 |
|
| 12707 |
/***/ }), |
| 12708 |
/* 350 */ |
| 12709 |
/***/ (function(module, exports, __webpack_require__) { |
| 12710 |
|
| 12711 |
"use strict"; |
| 12712 |
|
| 12713 |
|
| 12714 |
var _Object$defineProperty = __webpack_require__(1); |
| 12715 |
|
| 12716 |
_Object$defineProperty(exports, "__esModule", { |
| 12717 |
value: true |
| 12718 |
}); |
| 12719 |
|
| 12720 |
_Object$defineProperty(exports, "Do", { |
| 12721 |
enumerable: true, |
| 12722 |
get: function get() { |
| 12723 |
return _do.Do; |
| 12724 |
} |
| 12725 |
}); |
| 12726 |
|
| 12727 |
_Object$defineProperty(exports, "Redo", { |
| 12728 |
enumerable: true, |
| 12729 |
get: function get() { |
| 12730 |
return _redo.Redo; |
| 12731 |
} |
| 12732 |
}); |
| 12733 |
|
| 12734 |
_Object$defineProperty(exports, "Undo", { |
| 12735 |
enumerable: true, |
| 12736 |
get: function get() { |
| 12737 |
return _undo.Undo; |
| 12738 |
} |
| 12739 |
}); |
| 12740 |
|
| 12741 |
_Object$defineProperty(exports, "UndoAll", { |
| 12742 |
enumerable: true, |
| 12743 |
get: function get() { |
| 12744 |
return _undoAll.UndoAll; |
| 12745 |
} |
| 12746 |
}); |
| 12747 |
|
| 12748 |
var _do = __webpack_require__(351); |
| 12749 |
|
| 12750 |
var _redo = __webpack_require__(352); |
| 12751 |
|
| 12752 |
var _undo = __webpack_require__(353); |
| 12753 |
|
| 12754 |
var _undoAll = __webpack_require__(354); |
| 12755 |
|
| 12756 |
/***/ }), |
| 12757 |
/* 351 */ |
| 12758 |
/***/ (function(module, exports, __webpack_require__) { |
| 12759 |
|
| 12760 |
"use strict"; |
| 12761 |
|
| 12762 |
|
| 12763 |
var _interopRequireDefault = __webpack_require__(0); |
| 12764 |
|
| 12765 |
var _Object$defineProperty = __webpack_require__(1); |
| 12766 |
|
| 12767 |
_Object$defineProperty(exports, "__esModule", { |
| 12768 |
value: true |
| 12769 |
}); |
| 12770 |
|
| 12771 |
exports.default = exports.Do = void 0; |
| 12772 |
|
| 12773 |
var _classCallCheck2 = _interopRequireDefault(__webpack_require__(2)); |
| 12774 |
|
| 12775 |
var _createClass2 = _interopRequireDefault(__webpack_require__(3)); |
| 12776 |
|
| 12777 |
var _inherits2 = _interopRequireDefault(__webpack_require__(4)); |
| 12778 |
|
| 12779 |
var _createSuper2 = _interopRequireDefault(__webpack_require__(5)); |
| 12780 |
|
| 12781 |
var _commandBase = _interopRequireDefault(__webpack_require__(21)); |
| 12782 |
|
| 12783 |
var Do = /*#__PURE__*/function (_CommandBase) { |
| 12784 |
(0, _inherits2.default)(Do, _CommandBase); |
| 12785 |
|
| 12786 |
var _super = (0, _createSuper2.default)(Do); |
| 12787 |
|
| 12788 |
function Do() { |
| 12789 |
(0, _classCallCheck2.default)(this, Do); |
| 12790 |
return _super.apply(this, arguments); |
| 12791 |
} |
| 12792 |
|
| 12793 |
(0, _createClass2.default)(Do, [{ |
| 12794 |
key: "apply", |
| 12795 |
value: function apply(args) { |
| 12796 |
var index = args.index; |
| 12797 |
return elementor.documents.getCurrent().history.doItem(index); |
| 12798 |
} |
| 12799 |
}]); |
| 12800 |
return Do; |
| 12801 |
}(_commandBase.default); |
| 12802 |
|
| 12803 |
exports.Do = Do; |
| 12804 |
var _default = Do; |
| 12805 |
exports.default = _default; |
| 12806 |
|
| 12807 |
/***/ }), |
| 12808 |
/* 352 */ |
| 12809 |
/***/ (function(module, exports, __webpack_require__) { |
| 12810 |
|
| 12811 |
"use strict"; |
| 12812 |
|
| 12813 |
|
| 12814 |
var _interopRequireDefault = __webpack_require__(0); |
| 12815 |
|
| 12816 |
var _Object$defineProperty = __webpack_require__(1); |
| 12817 |
|
| 12818 |
_Object$defineProperty(exports, "__esModule", { |
| 12819 |
value: true |
| 12820 |
}); |
| 12821 |
|
| 12822 |
exports.default = exports.Redo = void 0; |
| 12823 |
|
| 12824 |
var _classCallCheck2 = _interopRequireDefault(__webpack_require__(2)); |
| 12825 |
|
| 12826 |
var _createClass2 = _interopRequireDefault(__webpack_require__(3)); |
| 12827 |
|
| 12828 |
var _inherits2 = _interopRequireDefault(__webpack_require__(4)); |
| 12829 |
|
| 12830 |
var _createSuper2 = _interopRequireDefault(__webpack_require__(5)); |
| 12831 |
|
| 12832 |
var _commandBase = _interopRequireDefault(__webpack_require__(21)); |
| 12833 |
|
| 12834 |
var Redo = /*#__PURE__*/function (_CommandBase) { |
| 12835 |
(0, _inherits2.default)(Redo, _CommandBase); |
| 12836 |
|
| 12837 |
var _super = (0, _createSuper2.default)(Redo); |
| 12838 |
|
| 12839 |
function Redo() { |
| 12840 |
(0, _classCallCheck2.default)(this, Redo); |
| 12841 |
return _super.apply(this, arguments); |
| 12842 |
} |
| 12843 |
|
| 12844 |
(0, _createClass2.default)(Redo, [{ |
| 12845 |
key: "apply", |
| 12846 |
value: function apply() { |
| 12847 |
elementor.documents.getCurrent().history.navigate(true); |
| 12848 |
} |
| 12849 |
}]); |
| 12850 |
return Redo; |
| 12851 |
}(_commandBase.default); |
| 12852 |
|
| 12853 |
exports.Redo = Redo; |
| 12854 |
var _default = Redo; |
| 12855 |
exports.default = _default; |
| 12856 |
|
| 12857 |
/***/ }), |
| 12858 |
/* 353 */ |
| 12859 |
/***/ (function(module, exports, __webpack_require__) { |
| 12860 |
|
| 12861 |
"use strict"; |
| 12862 |
|
| 12863 |
|
| 12864 |
var _interopRequireDefault = __webpack_require__(0); |
| 12865 |
|
| 12866 |
var _Object$defineProperty = __webpack_require__(1); |
| 12867 |
|
| 12868 |
_Object$defineProperty(exports, "__esModule", { |
| 12869 |
value: true |
| 12870 |
}); |
| 12871 |
|
| 12872 |
exports.default = exports.Undo = void 0; |
| 12873 |
|
| 12874 |
var _classCallCheck2 = _interopRequireDefault(__webpack_require__(2)); |
| 12875 |
|
| 12876 |
var _createClass2 = _interopRequireDefault(__webpack_require__(3)); |
| 12877 |
|
| 12878 |
var _inherits2 = _interopRequireDefault(__webpack_require__(4)); |
| 12879 |
|
| 12880 |
var _createSuper2 = _interopRequireDefault(__webpack_require__(5)); |
| 12881 |
|
| 12882 |
var _commandBase = _interopRequireDefault(__webpack_require__(21)); |
| 12883 |
|
| 12884 |
var Undo = /*#__PURE__*/function (_CommandBase) { |
| 12885 |
(0, _inherits2.default)(Undo, _CommandBase); |
| 12886 |
|
| 12887 |
var _super = (0, _createSuper2.default)(Undo); |
| 12888 |
|
| 12889 |
function Undo() { |
| 12890 |
(0, _classCallCheck2.default)(this, Undo); |
| 12891 |
return _super.apply(this, arguments); |
| 12892 |
} |
| 12893 |
|
| 12894 |
(0, _createClass2.default)(Undo, [{ |
| 12895 |
key: "apply", |
| 12896 |
value: function apply() { |
| 12897 |
elementor.documents.getCurrent().history.navigate(); |
| 12898 |
} |
| 12899 |
}]); |
| 12900 |
return Undo; |
| 12901 |
}(_commandBase.default); |
| 12902 |
|
| 12903 |
exports.Undo = Undo; |
| 12904 |
var _default = Undo; |
| 12905 |
exports.default = _default; |
| 12906 |
|
| 12907 |
/***/ }), |
| 12908 |
/* 354 */ |
| 12909 |
/***/ (function(module, exports, __webpack_require__) { |
| 12910 |
|
| 12911 |
"use strict"; |
| 12912 |
|
| 12913 |
|
| 12914 |
var _interopRequireDefault = __webpack_require__(0); |
| 12915 |
|
| 12916 |
var _Object$defineProperty = __webpack_require__(1); |
| 12917 |
|
| 12918 |
_Object$defineProperty(exports, "__esModule", { |
| 12919 |
value: true |
| 12920 |
}); |
| 12921 |
|
| 12922 |
exports.default = exports.UndoAll = void 0; |
| 12923 |
|
| 12924 |
var _classCallCheck2 = _interopRequireDefault(__webpack_require__(2)); |
| 12925 |
|
| 12926 |
var _createClass2 = _interopRequireDefault(__webpack_require__(3)); |
| 12927 |
|
| 12928 |
var _inherits2 = _interopRequireDefault(__webpack_require__(4)); |
| 12929 |
|
| 12930 |
var _createSuper2 = _interopRequireDefault(__webpack_require__(5)); |
| 12931 |
|
| 12932 |
var _commandBase = _interopRequireDefault(__webpack_require__(21)); |
| 12933 |
|
| 12934 |
var UndoAll = /*#__PURE__*/function (_CommandBase) { |
| 12935 |
(0, _inherits2.default)(UndoAll, _CommandBase); |
| 12936 |
|
| 12937 |
var _super = (0, _createSuper2.default)(UndoAll); |
| 12938 |
|
| 12939 |
function UndoAll() { |
| 12940 |
(0, _classCallCheck2.default)(this, UndoAll); |
| 12941 |
return _super.apply(this, arguments); |
| 12942 |
} |
| 12943 |
|
| 12944 |
(0, _createClass2.default)(UndoAll, [{ |
| 12945 |
key: "apply", |
| 12946 |
value: function apply(args) { |
| 12947 |
var document = args.document; |
| 12948 |
document.history.doItem(document.history.getItems().length - 1); |
| 12949 |
} |
| 12950 |
}]); |
| 12951 |
return UndoAll; |
| 12952 |
}(_commandBase.default); |
| 12953 |
|
| 12954 |
exports.UndoAll = UndoAll; |
| 12955 |
var _default = UndoAll; |
| 12956 |
exports.default = _default; |
| 12957 |
|
| 12958 |
/***/ }), |
| 12959 |
/* 355 */ |
| 12960 |
/***/ (function(module, exports, __webpack_require__) { |
| 12961 |
|
| 12962 |
"use strict"; |
| 12963 |
|
| 12964 |
|
| 12965 |
var _interopRequireDefault = __webpack_require__(0); |
| 12966 |
|
| 12967 |
var _Object$defineProperty = __webpack_require__(1); |
| 12968 |
|
| 12969 |
_Object$defineProperty(exports, "__esModule", { |
| 12970 |
value: true |
| 12971 |
}); |
| 12972 |
|
| 12973 |
exports.default = void 0; |
| 12974 |
|
| 12975 |
var _classCallCheck2 = _interopRequireDefault(__webpack_require__(2)); |
| 12976 |
|
| 12977 |
var _createClass2 = _interopRequireDefault(__webpack_require__(3)); |
| 12978 |
|
| 12979 |
var _inherits2 = _interopRequireDefault(__webpack_require__(4)); |
| 12980 |
|
| 12981 |
var _createSuper2 = _interopRequireDefault(__webpack_require__(5)); |
| 12982 |
|
| 12983 |
var _header = _interopRequireDefault(__webpack_require__(356)); |
| 12984 |
|
| 12985 |
var _logo = _interopRequireDefault(__webpack_require__(357)); |
| 12986 |
|
| 12987 |
var _loading = _interopRequireDefault(__webpack_require__(358)); |
| 12988 |
|
| 12989 |
var _default = /*#__PURE__*/function (_Marionette$LayoutVie) { |
| 12990 |
(0, _inherits2.default)(_default, _Marionette$LayoutVie); |
| 12991 |
|
| 12992 |
var _super = (0, _createSuper2.default)(_default); |
| 12993 |
|
| 12994 |
function _default() { |
| 12995 |
(0, _classCallCheck2.default)(this, _default); |
| 12996 |
return _super.apply(this, arguments); |
| 12997 |
} |
| 12998 |
|
| 12999 |
(0, _createClass2.default)(_default, [{ |
| 13000 |
key: "el", |
| 13001 |
value: function el() { |
| 13002 |
return this.getModal().getElements('widget'); |
| 13003 |
} |
| 13004 |
}, { |
| 13005 |
key: "regions", |
| 13006 |
value: function regions() { |
| 13007 |
return { |
| 13008 |
modalHeader: '.dialog-header', |
| 13009 |
modalContent: '.dialog-lightbox-content', |
| 13010 |
modalLoading: '.dialog-lightbox-loading' |
| 13011 |
}; |
| 13012 |
} |
| 13013 |
}, { |
| 13014 |
key: "initialize", |
| 13015 |
value: function initialize() { |
| 13016 |
this.modalHeader.show(new _header.default(this.getHeaderOptions())); |
| 13017 |
} |
| 13018 |
}, { |
| 13019 |
key: "getModal", |
| 13020 |
value: function getModal() { |
| 13021 |
if (!this.modal) { |
| 13022 |
this.initModal(); |
| 13023 |
} |
| 13024 |
|
| 13025 |
return this.modal; |
| 13026 |
} |
| 13027 |
}, { |
| 13028 |
key: "initModal", |
| 13029 |
value: function initModal() { |
| 13030 |
var modalOptions = { |
| 13031 |
className: 'elementor-templates-modal', |
| 13032 |
closeButton: false, |
| 13033 |
draggable: false, |
| 13034 |
hide: { |
| 13035 |
onOutsideClick: false, |
| 13036 |
onEscKeyPress: false |
| 13037 |
} |
| 13038 |
}; |
| 13039 |
jQuery.extend(true, modalOptions, this.getModalOptions()); |
| 13040 |
this.modal = elementorCommon.dialogsManager.createWidget('lightbox', modalOptions); |
| 13041 |
this.modal.getElements('message').append(this.modal.addElement('content'), this.modal.addElement('loading')); |
| 13042 |
|
| 13043 |
if (modalOptions.draggable) { |
| 13044 |
this.draggableModal(); |
| 13045 |
} |
| 13046 |
} |
| 13047 |
}, { |
| 13048 |
key: "showModal", |
| 13049 |
value: function showModal() { |
| 13050 |
this.getModal().show(); |
| 13051 |
} |
| 13052 |
}, { |
| 13053 |
key: "hideModal", |
| 13054 |
value: function hideModal() { |
| 13055 |
this.getModal().hide(); |
| 13056 |
} |
| 13057 |
}, { |
| 13058 |
key: "draggableModal", |
| 13059 |
value: function draggableModal() { |
| 13060 |
var $modalWidgetContent = this.getModal().getElements('widgetContent'); |
| 13061 |
$modalWidgetContent.draggable({ |
| 13062 |
containment: 'parent', |
| 13063 |
stop: function stop() { |
| 13064 |
$modalWidgetContent.height(''); |
| 13065 |
} |
| 13066 |
}); |
| 13067 |
$modalWidgetContent.css('position', 'absolute'); |
| 13068 |
} |
| 13069 |
}, { |
| 13070 |
key: "getModalOptions", |
| 13071 |
value: function getModalOptions() { |
| 13072 |
return {}; |
| 13073 |
} |
| 13074 |
}, { |
| 13075 |
key: "getLogoOptions", |
| 13076 |
value: function getLogoOptions() { |
| 13077 |
return {}; |
| 13078 |
} |
| 13079 |
}, { |
| 13080 |
key: "getHeaderOptions", |
| 13081 |
value: function getHeaderOptions() { |
| 13082 |
return { |
| 13083 |
closeType: 'normal' |
| 13084 |
}; |
| 13085 |
} |
| 13086 |
}, { |
| 13087 |
key: "getHeaderView", |
| 13088 |
value: function getHeaderView() { |
| 13089 |
return this.modalHeader.currentView; |
| 13090 |
} |
| 13091 |
}, { |
| 13092 |
key: "showLoadingView", |
| 13093 |
value: function showLoadingView() { |
| 13094 |
this.modalLoading.show(new _loading.default()); |
| 13095 |
this.modalLoading.$el.show(); |
| 13096 |
this.modalContent.$el.hide(); |
| 13097 |
} |
| 13098 |
}, { |
| 13099 |
key: "hideLoadingView", |
| 13100 |
value: function hideLoadingView() { |
| 13101 |
this.modalContent.$el.show(); |
| 13102 |
this.modalLoading.$el.hide(); |
| 13103 |
} |
| 13104 |
}, { |
| 13105 |
key: "showLogo", |
| 13106 |
value: function showLogo() { |
| 13107 |
this.getHeaderView().logoArea.show(new _logo.default(this.getLogoOptions())); |
| 13108 |
} |
| 13109 |
}]); |
| 13110 |
return _default; |
| 13111 |
}(Marionette.LayoutView); |
| 13112 |
|
| 13113 |
exports.default = _default; |
| 13114 |
|
| 13115 |
/***/ }), |
| 13116 |
/* 356 */ |
| 13117 |
/***/ (function(module, exports, __webpack_require__) { |
| 13118 |
|
| 13119 |
"use strict"; |
| 13120 |
|
| 13121 |
|
| 13122 |
var _interopRequireDefault = __webpack_require__(0); |
| 13123 |
|
| 13124 |
var _Object$defineProperty = __webpack_require__(1); |
| 13125 |
|
| 13126 |
_Object$defineProperty(exports, "__esModule", { |
| 13127 |
value: true |
| 13128 |
}); |
| 13129 |
|
| 13130 |
exports.default = void 0; |
| 13131 |
|
| 13132 |
var _classCallCheck2 = _interopRequireDefault(__webpack_require__(2)); |
| 13133 |
|
| 13134 |
var _createClass2 = _interopRequireDefault(__webpack_require__(3)); |
| 13135 |
|
| 13136 |
var _inherits2 = _interopRequireDefault(__webpack_require__(4)); |
| 13137 |
|
| 13138 |
var _createSuper2 = _interopRequireDefault(__webpack_require__(5)); |
| 13139 |
|
| 13140 |
var _default = /*#__PURE__*/function (_Marionette$LayoutVie) { |
| 13141 |
(0, _inherits2.default)(_default, _Marionette$LayoutVie); |
| 13142 |
|
| 13143 |
var _super = (0, _createSuper2.default)(_default); |
| 13144 |
|
| 13145 |
function _default() { |
| 13146 |
(0, _classCallCheck2.default)(this, _default); |
| 13147 |
return _super.apply(this, arguments); |
| 13148 |
} |
| 13149 |
|
| 13150 |
(0, _createClass2.default)(_default, [{ |
| 13151 |
key: "className", |
| 13152 |
value: function className() { |
| 13153 |
return 'elementor-templates-modal__header'; |
| 13154 |
} |
| 13155 |
}, { |
| 13156 |
key: "getTemplate", |
| 13157 |
value: function getTemplate() { |
| 13158 |
return '#tmpl-elementor-templates-modal__header'; |
| 13159 |
} |
| 13160 |
}, { |
| 13161 |
key: "regions", |
| 13162 |
value: function regions() { |
| 13163 |
return { |
| 13164 |
logoArea: '.elementor-templates-modal__header__logo-area', |
| 13165 |
tools: '#elementor-template-library-header-tools', |
| 13166 |
menuArea: '.elementor-templates-modal__header__menu-area' |
| 13167 |
}; |
| 13168 |
} |
| 13169 |
}, { |
| 13170 |
key: "ui", |
| 13171 |
value: function ui() { |
| 13172 |
return { |
| 13173 |
closeModal: '.elementor-templates-modal__header__close' |
| 13174 |
}; |
| 13175 |
} |
| 13176 |
}, { |
| 13177 |
key: "events", |
| 13178 |
value: function events() { |
| 13179 |
return { |
| 13180 |
'click @ui.closeModal': 'onCloseModalClick' |
| 13181 |
}; |
| 13182 |
} |
| 13183 |
}, { |
| 13184 |
key: "templateHelpers", |
| 13185 |
value: function templateHelpers() { |
| 13186 |
return { |
| 13187 |
closeType: this.getOption('closeType') |
| 13188 |
}; |
| 13189 |
} |
| 13190 |
}, { |
| 13191 |
key: "onCloseModalClick", |
| 13192 |
value: function onCloseModalClick() { |
| 13193 |
this._parent._parent._parent.hideModal(); |
| 13194 |
} |
| 13195 |
}]); |
| 13196 |
return _default; |
| 13197 |
}(Marionette.LayoutView); |
| 13198 |
|
| 13199 |
exports.default = _default; |
| 13200 |
|
| 13201 |
/***/ }), |
| 13202 |
/* 357 */ |
| 13203 |
/***/ (function(module, exports, __webpack_require__) { |
| 13204 |
|
| 13205 |
"use strict"; |
| 13206 |
|
| 13207 |
|
| 13208 |
var _interopRequireDefault = __webpack_require__(0); |
| 13209 |
|
| 13210 |
var _Object$defineProperty = __webpack_require__(1); |
| 13211 |
|
| 13212 |
_Object$defineProperty(exports, "__esModule", { |
| 13213 |
value: true |
| 13214 |
}); |
| 13215 |
|
| 13216 |
exports.default = void 0; |
| 13217 |
|
| 13218 |
var _classCallCheck2 = _interopRequireDefault(__webpack_require__(2)); |
| 13219 |
|
| 13220 |
var _createClass2 = _interopRequireDefault(__webpack_require__(3)); |
| 13221 |
|
| 13222 |
var _inherits2 = _interopRequireDefault(__webpack_require__(4)); |
| 13223 |
|
| 13224 |
var _createSuper2 = _interopRequireDefault(__webpack_require__(5)); |
| 13225 |
|
| 13226 |
var _default = /*#__PURE__*/function (_Marionette$ItemView) { |
| 13227 |
(0, _inherits2.default)(_default, _Marionette$ItemView); |
| 13228 |
|
| 13229 |
var _super = (0, _createSuper2.default)(_default); |
| 13230 |
|
| 13231 |
function _default() { |
| 13232 |
(0, _classCallCheck2.default)(this, _default); |
| 13233 |
return _super.apply(this, arguments); |
| 13234 |
} |
| 13235 |
|
| 13236 |
(0, _createClass2.default)(_default, [{ |
| 13237 |
key: "getTemplate", |
| 13238 |
value: function getTemplate() { |
| 13239 |
return '#tmpl-elementor-templates-modal__header__logo'; |
| 13240 |
} |
| 13241 |
}, { |
| 13242 |
key: "className", |
| 13243 |
value: function className() { |
| 13244 |
return 'elementor-templates-modal__header__logo'; |
| 13245 |
} |
| 13246 |
}, { |
| 13247 |
key: "events", |
| 13248 |
value: function events() { |
| 13249 |
return { |
| 13250 |
click: 'onClick' |
| 13251 |
}; |
| 13252 |
} |
| 13253 |
}, { |
| 13254 |
key: "templateHelpers", |
| 13255 |
value: function templateHelpers() { |
| 13256 |
return { |
| 13257 |
title: this.getOption('title') |
| 13258 |
}; |
| 13259 |
} |
| 13260 |
}, { |
| 13261 |
key: "onClick", |
| 13262 |
value: function onClick() { |
| 13263 |
var clickCallback = this.getOption('click'); |
| 13264 |
|
| 13265 |
if (clickCallback) { |
| 13266 |
clickCallback(); |
| 13267 |
} |
| 13268 |
} |
| 13269 |
}]); |
| 13270 |
return _default; |
| 13271 |
}(Marionette.ItemView); |
| 13272 |
|
| 13273 |
exports.default = _default; |
| 13274 |
|
| 13275 |
/***/ }), |
| 13276 |
/* 358 */ |
| 13277 |
/***/ (function(module, exports, __webpack_require__) { |
| 13278 |
|
| 13279 |
"use strict"; |
| 13280 |
|
| 13281 |
|
| 13282 |
var _interopRequireDefault = __webpack_require__(0); |
| 13283 |
|
| 13284 |
var _Object$defineProperty = __webpack_require__(1); |
| 13285 |
|
| 13286 |
_Object$defineProperty(exports, "__esModule", { |
| 13287 |
value: true |
| 13288 |
}); |
| 13289 |
|
| 13290 |
exports.default = void 0; |
| 13291 |
|
| 13292 |
var _classCallCheck2 = _interopRequireDefault(__webpack_require__(2)); |
| 13293 |
|
| 13294 |
var _createClass2 = _interopRequireDefault(__webpack_require__(3)); |
| 13295 |
|
| 13296 |
var _inherits2 = _interopRequireDefault(__webpack_require__(4)); |
| 13297 |
|
| 13298 |
var _createSuper2 = _interopRequireDefault(__webpack_require__(5)); |
| 13299 |
|
| 13300 |
var _default = /*#__PURE__*/function (_Marionette$ItemView) { |
| 13301 |
(0, _inherits2.default)(_default, _Marionette$ItemView); |
| 13302 |
|
| 13303 |
var _super = (0, _createSuper2.default)(_default); |
| 13304 |
|
| 13305 |
function _default() { |
| 13306 |
(0, _classCallCheck2.default)(this, _default); |
| 13307 |
return _super.apply(this, arguments); |
| 13308 |
} |
| 13309 |
|
| 13310 |
(0, _createClass2.default)(_default, [{ |
| 13311 |
key: "id", |
| 13312 |
value: function id() { |
| 13313 |
return 'elementor-template-library-loading'; |
| 13314 |
} |
| 13315 |
}, { |
| 13316 |
key: "getTemplate", |
| 13317 |
value: function getTemplate() { |
| 13318 |
return '#tmpl-elementor-template-library-loading'; |
| 13319 |
} |
| 13320 |
}]); |
| 13321 |
return _default; |
| 13322 |
}(Marionette.ItemView); |
| 13323 |
|
| 13324 |
exports.default = _default; |
| 13325 |
|
| 13326 |
/***/ }), |
| 13327 |
/* 359 */ |
| 13328 |
/***/ (function(module, exports, __webpack_require__) { |
| 13329 |
|
| 13330 |
"use strict"; |
| 13331 |
|
| 13332 |
|
| 13333 |
var _interopRequireDefault = __webpack_require__(0); |
| 13334 |
|
| 13335 |
var _Object$defineProperty = __webpack_require__(1); |
| 13336 |
|
| 13337 |
_Object$defineProperty(exports, "__esModule", { |
| 13338 |
value: true |
| 13339 |
}); |
| 13340 |
|
| 13341 |
exports.default = void 0; |
| 13342 |
|
| 13343 |
__webpack_require__(39); |
| 13344 |
|
| 13345 |
var _classCallCheck2 = _interopRequireDefault(__webpack_require__(2)); |
| 13346 |
|
| 13347 |
var _createClass2 = _interopRequireDefault(__webpack_require__(3)); |
| 13348 |
|
| 13349 |
var _inherits2 = _interopRequireDefault(__webpack_require__(4)); |
| 13350 |
|
| 13351 |
var _createSuper2 = _interopRequireDefault(__webpack_require__(5)); |
| 13352 |
|
| 13353 |
var _group = _interopRequireDefault(__webpack_require__(473)); |
| 13354 |
|
| 13355 |
var MenuPageView = /*#__PURE__*/function (_Marionette$Composite) { |
| 13356 |
(0, _inherits2.default)(MenuPageView, _Marionette$Composite); |
| 13357 |
|
| 13358 |
var _super = (0, _createSuper2.default)(MenuPageView); |
| 13359 |
|
| 13360 |
function MenuPageView() { |
| 13361 |
(0, _classCallCheck2.default)(this, MenuPageView); |
| 13362 |
return _super.apply(this, arguments); |
| 13363 |
} |
| 13364 |
|
| 13365 |
(0, _createClass2.default)(MenuPageView, [{ |
| 13366 |
key: "id", |
| 13367 |
value: function id() { |
| 13368 |
return 'elementor-panel-page-menu'; |
| 13369 |
} |
| 13370 |
}, { |
| 13371 |
key: "getTemplate", |
| 13372 |
value: function getTemplate() { |
| 13373 |
return '#tmpl-elementor-panel-menu'; |
| 13374 |
} |
| 13375 |
}, { |
| 13376 |
key: "getChildView", |
| 13377 |
value: function getChildView() { |
| 13378 |
return _group.default; |
| 13379 |
} |
| 13380 |
}, { |
| 13381 |
key: "childViewContainer", |
| 13382 |
value: function childViewContainer() { |
| 13383 |
return '#elementor-panel-page-menu-content'; |
| 13384 |
} // Remove empty groups that exist for BC. |
| 13385 |
|
| 13386 |
}, { |
| 13387 |
key: "filter", |
| 13388 |
value: function filter(child) { |
| 13389 |
return child.get('items').length; |
| 13390 |
} |
| 13391 |
}]); |
| 13392 |
return MenuPageView; |
| 13393 |
}(Marionette.CompositeView); |
| 13394 |
|
| 13395 |
exports.default = MenuPageView; |
| 13396 |
|
| 13397 |
MenuPageView.addItem = function (groups, itemData, groupName, before) { |
| 13398 |
var group = groups.findWhere({ |
| 13399 |
name: groupName |
| 13400 |
}); |
| 13401 |
|
| 13402 |
if (!group) { |
| 13403 |
return; |
| 13404 |
} |
| 13405 |
|
| 13406 |
var items = group.get('items'), |
| 13407 |
exists = _.findWhere(items, { |
| 13408 |
name: itemData.name |
| 13409 |
}); // Remove if exist. |
| 13410 |
|
| 13411 |
|
| 13412 |
var beforeItem; |
| 13413 |
|
| 13414 |
if (exists) { |
| 13415 |
items.splice(items.indexOf(exists), 1); |
| 13416 |
} |
| 13417 |
|
| 13418 |
if (before) { |
| 13419 |
beforeItem = _.findWhere(items, { |
| 13420 |
name: before |
| 13421 |
}); |
| 13422 |
} |
| 13423 |
|
| 13424 |
if (beforeItem) { |
| 13425 |
items.splice(items.indexOf(beforeItem), 0, itemData); |
| 13426 |
} else { |
| 13427 |
items.push(itemData); |
| 13428 |
} |
| 13429 |
}; |
| 13430 |
|
| 13431 |
/***/ }), |
| 13432 |
/* 360 */ |
| 13433 |
/***/ (function(module, exports, __webpack_require__) { |
| 13434 |
|
| 13435 |
"use strict"; |
| 13436 |
|
| 13437 |
|
| 13438 |
var _interopRequireDefault = __webpack_require__(0); |
| 13439 |
|
| 13440 |
var _Object$defineProperty = __webpack_require__(1); |
| 13441 |
|
| 13442 |
_Object$defineProperty(exports, "__esModule", { |
| 13443 |
value: true |
| 13444 |
}); |
| 13445 |
|
| 13446 |
exports.default = exports.BaseGlobalsUpdate = void 0; |
| 13447 |
|
| 13448 |
var _assign = _interopRequireDefault(__webpack_require__(134)); |
| 13449 |
|
| 13450 |
var _classCallCheck2 = _interopRequireDefault(__webpack_require__(2)); |
| 13451 |
|
| 13452 |
var _createClass2 = _interopRequireDefault(__webpack_require__(3)); |
| 13453 |
|
| 13454 |
var _inherits2 = _interopRequireDefault(__webpack_require__(4)); |
| 13455 |
|
| 13456 |
var _createSuper2 = _interopRequireDefault(__webpack_require__(5)); |
| 13457 |
|
| 13458 |
var BaseGlobalsUpdate = /*#__PURE__*/function (_$e$modules$hookData$) { |
| 13459 |
(0, _inherits2.default)(BaseGlobalsUpdate, _$e$modules$hookData$); |
| 13460 |
|
| 13461 |
var _super = (0, _createSuper2.default)(BaseGlobalsUpdate); |
| 13462 |
|
| 13463 |
function BaseGlobalsUpdate() { |
| 13464 |
(0, _classCallCheck2.default)(this, BaseGlobalsUpdate); |
| 13465 |
return _super.apply(this, arguments); |
| 13466 |
} |
| 13467 |
|
| 13468 |
(0, _createClass2.default)(BaseGlobalsUpdate, [{ |
| 13469 |
key: "getContainerType", |
| 13470 |
value: function getContainerType() { |
| 13471 |
return 'document'; |
| 13472 |
} |
| 13473 |
}, { |
| 13474 |
key: "getConditions", |
| 13475 |
value: function getConditions() { |
| 13476 |
return $e.routes.isPartOf('panel/global'); |
| 13477 |
} |
| 13478 |
}, { |
| 13479 |
key: "getRepeaterName", |
| 13480 |
value: function getRepeaterName() { |
| 13481 |
elementorModules.ForceMethodImplementation(); |
| 13482 |
} |
| 13483 |
}, { |
| 13484 |
key: "applyModel", |
| 13485 |
value: function applyModel(model, id, value) { |
| 13486 |
elementorModules.ForceMethodImplementation(); |
| 13487 |
} |
| 13488 |
}, { |
| 13489 |
key: "apply", |
| 13490 |
value: function apply(args, result) { |
| 13491 |
var _this = this; |
| 13492 |
|
| 13493 |
var _args$containers = args.containers, |
| 13494 |
containers = _args$containers === void 0 ? [args.container] : _args$containers, |
| 13495 |
model = (0, _assign.default)({}, result.data); |
| 13496 |
var id = model.id, |
| 13497 |
value = model.value; |
| 13498 |
delete model.id; |
| 13499 |
delete model.value; |
| 13500 |
model._id = id; |
| 13501 |
this.applyModel(model, value); |
| 13502 |
containers.forEach(function (container) { |
| 13503 |
$e.run('document/repeater/insert', { |
| 13504 |
container: container, |
| 13505 |
model: model, |
| 13506 |
name: _this.getRepeaterName() |
| 13507 |
}); |
| 13508 |
}); |
| 13509 |
} |
| 13510 |
}]); |
| 13511 |
return BaseGlobalsUpdate; |
| 13512 |
}($e.modules.hookData.After); |
| 13513 |
|
| 13514 |
exports.BaseGlobalsUpdate = BaseGlobalsUpdate; |
| 13515 |
var _default = BaseGlobalsUpdate; |
| 13516 |
exports.default = _default; |
| 13517 |
|
| 13518 |
/***/ }), |
| 13519 |
/* 361 */ |
| 13520 |
/***/ (function(module, exports, __webpack_require__) { |
| 13521 |
|
| 13522 |
"use strict"; |
| 13523 |
|
| 13524 |
|
| 13525 |
var _interopRequireDefault = __webpack_require__(0); |
| 13526 |
|
| 13527 |
var _Object$defineProperty = __webpack_require__(1); |
| 13528 |
|
| 13529 |
_Object$defineProperty(exports, "__esModule", { |
| 13530 |
value: true |
| 13531 |
}); |
| 13532 |
|
| 13533 |
exports.default = void 0; |
| 13534 |
|
| 13535 |
var _classCallCheck2 = _interopRequireDefault(__webpack_require__(2)); |
| 13536 |
|
| 13537 |
var _createClass2 = _interopRequireDefault(__webpack_require__(3)); |
| 13538 |
|
| 13539 |
var _inherits2 = _interopRequireDefault(__webpack_require__(4)); |
| 13540 |
|
| 13541 |
var _createSuper2 = _interopRequireDefault(__webpack_require__(5)); |
| 13542 |
|
| 13543 |
var BaseOpenClose = /*#__PURE__*/function (_$e$modules$hookUI$Af) { |
| 13544 |
(0, _inherits2.default)(BaseOpenClose, _$e$modules$hookUI$Af); |
| 13545 |
|
| 13546 |
var _super = (0, _createSuper2.default)(BaseOpenClose); |
| 13547 |
|
| 13548 |
function BaseOpenClose() { |
| 13549 |
(0, _classCallCheck2.default)(this, BaseOpenClose); |
| 13550 |
return _super.apply(this, arguments); |
| 13551 |
} |
| 13552 |
|
| 13553 |
(0, _createClass2.default)(BaseOpenClose, [{ |
| 13554 |
key: "initialize", |
| 13555 |
value: function initialize() { |
| 13556 |
var _this = this; |
| 13557 |
|
| 13558 |
elementor.on('preview:loaded', function () { |
| 13559 |
_this.component = $e.components.get('panel/global'); |
| 13560 |
}); |
| 13561 |
} |
| 13562 |
}]); |
| 13563 |
return BaseOpenClose; |
| 13564 |
}($e.modules.hookUI.After); |
| 13565 |
|
| 13566 |
exports.default = BaseOpenClose; |
| 13567 |
|
| 13568 |
/***/ }), |
| 13569 |
/* 362 */ |
| 13570 |
/***/ (function(module, exports, __webpack_require__) { |
| 13571 |
|
| 13572 |
"use strict"; |
| 13573 |
|
| 13574 |
var LIBRARY = __webpack_require__(110); |
| 13575 |
var global = __webpack_require__(17); |
| 13576 |
var ctx = __webpack_require__(73); |
| 13577 |
var classof = __webpack_require__(113); |
| 13578 |
var $export = __webpack_require__(34); |
| 13579 |
var isObject = __webpack_require__(30); |
| 13580 |
var aFunction = __webpack_require__(91); |
| 13581 |
var anInstance = __webpack_require__(493); |
| 13582 |
var forOf = __webpack_require__(494); |
| 13583 |
var speciesConstructor = __webpack_require__(154); |
| 13584 |
var task = __webpack_require__(363).set; |
| 13585 |
var microtask = __webpack_require__(499)(); |
| 13586 |
var newPromiseCapabilityModule = __webpack_require__(364); |
| 13587 |
var perform = __webpack_require__(500); |
| 13588 |
var userAgent = __webpack_require__(501); |
| 13589 |
var promiseResolve = __webpack_require__(365); |
| 13590 |
var PROMISE = 'Promise'; |
| 13591 |
var TypeError = global.TypeError; |
| 13592 |
var process = global.process; |
| 13593 |
var versions = process && process.versions; |
| 13594 |
var v8 = versions && versions.v8 || ''; |
| 13595 |
var $Promise = global[PROMISE]; |
| 13596 |
var isNode = classof(process) == 'process'; |
| 13597 |
var empty = function () { /* empty */ }; |
| 13598 |
var Internal, newGenericPromiseCapability, OwnPromiseCapability, Wrapper; |
| 13599 |
var newPromiseCapability = newGenericPromiseCapability = newPromiseCapabilityModule.f; |
| 13600 |
|
| 13601 |
var USE_NATIVE = !!function () { |
| 13602 |
try { |
| 13603 |
// correct subclassing with @@species support |
| 13604 |
var promise = $Promise.resolve(1); |
| 13605 |
var FakePromise = (promise.constructor = {})[__webpack_require__(12)('species')] = function (exec) { |
| 13606 |
exec(empty, empty); |
| 13607 |
}; |
| 13608 |
// unhandled rejections tracking support, NodeJS Promise without it fails @@species test |
| 13609 |
return (isNode || typeof PromiseRejectionEvent == 'function') |
| 13610 |
&& promise.then(empty) instanceof FakePromise |
| 13611 |
// v8 6.6 (Node 10 and Chrome 66) have a bug with resolving custom thenables |
| 13612 |
// https://bugs.chromium.org/p/chromium/issues/detail?id=830565 |
| 13613 |
// we can't detect it synchronously, so just check versions |
| 13614 |
&& v8.indexOf('6.6') !== 0 |
| 13615 |
&& userAgent.indexOf('Chrome/66') === -1; |
| 13616 |
} catch (e) { /* empty */ } |
| 13617 |
}(); |
| 13618 |
|
| 13619 |
// helpers |
| 13620 |
var isThenable = function (it) { |
| 13621 |
var then; |
| 13622 |
return isObject(it) && typeof (then = it.then) == 'function' ? then : false; |
| 13623 |
}; |
| 13624 |
var notify = function (promise, isReject) { |
| 13625 |
if (promise._n) return; |
| 13626 |
promise._n = true; |
| 13627 |
var chain = promise._c; |
| 13628 |
microtask(function () { |
| 13629 |
var value = promise._v; |
| 13630 |
var ok = promise._s == 1; |
| 13631 |
var i = 0; |
| 13632 |
var run = function (reaction) { |
| 13633 |
var handler = ok ? reaction.ok : reaction.fail; |
| 13634 |
var resolve = reaction.resolve; |
| 13635 |
var reject = reaction.reject; |
| 13636 |
var domain = reaction.domain; |
| 13637 |
var result, then, exited; |
| 13638 |
try { |
| 13639 |
if (handler) { |
| 13640 |
if (!ok) { |
| 13641 |
if (promise._h == 2) onHandleUnhandled(promise); |
| 13642 |
promise._h = 1; |
| 13643 |
} |
| 13644 |
if (handler === true) result = value; |
| 13645 |
else { |
| 13646 |
if (domain) domain.enter(); |
| 13647 |
result = handler(value); // may throw |
| 13648 |
if (domain) { |
| 13649 |
domain.exit(); |
| 13650 |
exited = true; |
| 13651 |
} |
| 13652 |
} |
| 13653 |
if (result === reaction.promise) { |
| 13654 |
reject(TypeError('Promise-chain cycle')); |
| 13655 |
} else if (then = isThenable(result)) { |
| 13656 |
then.call(result, resolve, reject); |
| 13657 |
} else resolve(result); |
| 13658 |
} else reject(value); |
| 13659 |
} catch (e) { |
| 13660 |
if (domain && !exited) domain.exit(); |
| 13661 |
reject(e); |
| 13662 |
} |
| 13663 |
}; |
| 13664 |
while (chain.length > i) run(chain[i++]); // variable length - can't use forEach |
| 13665 |
promise._c = []; |
| 13666 |
promise._n = false; |
| 13667 |
if (isReject && !promise._h) onUnhandled(promise); |
| 13668 |
}); |
| 13669 |
}; |
| 13670 |
var onUnhandled = function (promise) { |
| 13671 |
task.call(global, function () { |
| 13672 |
var value = promise._v; |
| 13673 |
var unhandled = isUnhandled(promise); |
| 13674 |
var result, handler, console; |
| 13675 |
if (unhandled) { |
| 13676 |
result = perform(function () { |
| 13677 |
if (isNode) { |
| 13678 |
process.emit('unhandledRejection', value, promise); |
| 13679 |
} else if (handler = global.onunhandledrejection) { |
| 13680 |
handler({ promise: promise, reason: value }); |
| 13681 |
} else if ((console = global.console) && console.error) { |
| 13682 |
console.error('Unhandled promise rejection', value); |
| 13683 |
} |
| 13684 |
}); |
| 13685 |
// Browsers should not trigger `rejectionHandled` event if it was handled here, NodeJS - should |
| 13686 |
promise._h = isNode || isUnhandled(promise) ? 2 : 1; |
| 13687 |
} promise._a = undefined; |
| 13688 |
if (unhandled && result.e) throw result.v; |
| 13689 |
}); |
| 13690 |
}; |
| 13691 |
var isUnhandled = function (promise) { |
| 13692 |
return promise._h !== 1 && (promise._a || promise._c).length === 0; |
| 13693 |
}; |
| 13694 |
var onHandleUnhandled = function (promise) { |
| 13695 |
task.call(global, function () { |
| 13696 |
var handler; |
| 13697 |
if (isNode) { |
| 13698 |
process.emit('rejectionHandled', promise); |
| 13699 |
} else if (handler = global.onrejectionhandled) { |
| 13700 |
handler({ promise: promise, reason: promise._v }); |
| 13701 |
} |
| 13702 |
}); |
| 13703 |
}; |
| 13704 |
var $reject = function (value) { |
| 13705 |
var promise = this; |
| 13706 |
if (promise._d) return; |
| 13707 |
promise._d = true; |
| 13708 |
promise = promise._w || promise; // unwrap |
| 13709 |
promise._v = value; |
| 13710 |
promise._s = 2; |
| 13711 |
if (!promise._a) promise._a = promise._c.slice(); |
| 13712 |
notify(promise, true); |
| 13713 |
}; |
| 13714 |
var $resolve = function (value) { |
| 13715 |
var promise = this; |
| 13716 |
var then; |
| 13717 |
if (promise._d) return; |
| 13718 |
promise._d = true; |
| 13719 |
promise = promise._w || promise; // unwrap |
| 13720 |
try { |
| 13721 |
if (promise === value) throw TypeError("Promise can't be resolved itself"); |
| 13722 |
if (then = isThenable(value)) { |
| 13723 |
microtask(function () { |
| 13724 |
var wrapper = { _w: promise, _d: false }; // wrap |
| 13725 |
try { |
| 13726 |
then.call(value, ctx($resolve, wrapper, 1), ctx($reject, wrapper, 1)); |
| 13727 |
} catch (e) { |
| 13728 |
$reject.call(wrapper, e); |
| 13729 |
} |
| 13730 |
}); |
| 13731 |
} else { |
| 13732 |
promise._v = value; |
| 13733 |
promise._s = 1; |
| 13734 |
notify(promise, false); |
| 13735 |
} |
| 13736 |
} catch (e) { |
| 13737 |
$reject.call({ _w: promise, _d: false }, e); // wrap |
| 13738 |
} |
| 13739 |
}; |
| 13740 |
|
| 13741 |
// constructor polyfill |
| 13742 |
if (!USE_NATIVE) { |
| 13743 |
// 25.4.3.1 Promise(executor) |
| 13744 |
$Promise = function Promise(executor) { |
| 13745 |
anInstance(this, $Promise, PROMISE, '_h'); |
| 13746 |
aFunction(executor); |
| 13747 |
Internal.call(this); |
| 13748 |
try { |
| 13749 |
executor(ctx($resolve, this, 1), ctx($reject, this, 1)); |
| 13750 |
} catch (err) { |
| 13751 |
$reject.call(this, err); |
| 13752 |
} |
| 13753 |
}; |
| 13754 |
// eslint-disable-next-line no-unused-vars |
| 13755 |
Internal = function Promise(executor) { |
| 13756 |
this._c = []; // <- awaiting reactions |
| 13757 |
this._a = undefined; // <- checked in isUnhandled reactions |
| 13758 |
this._s = 0; // <- state |
| 13759 |
this._d = false; // <- done |
| 13760 |
this._v = undefined; // <- value |
| 13761 |
this._h = 0; // <- rejection state, 0 - default, 1 - handled, 2 - unhandled |
| 13762 |
this._n = false; // <- notify |
| 13763 |
}; |
| 13764 |
Internal.prototype = __webpack_require__(502)($Promise.prototype, { |
| 13765 |
// 25.4.5.3 Promise.prototype.then(onFulfilled, onRejected) |
| 13766 |
then: function then(onFulfilled, onRejected) { |
| 13767 |
var reaction = newPromiseCapability(speciesConstructor(this, $Promise)); |
| 13768 |
reaction.ok = typeof onFulfilled == 'function' ? onFulfilled : true; |
| 13769 |
reaction.fail = typeof onRejected == 'function' && onRejected; |
| 13770 |
reaction.domain = isNode ? process.domain : undefined; |
| 13771 |
this._c.push(reaction); |
| 13772 |
if (this._a) this._a.push(reaction); |
| 13773 |
if (this._s) notify(this, false); |
| 13774 |
return reaction.promise; |
| 13775 |
}, |
| 13776 |
// 25.4.5.1 Promise.prototype.catch(onRejected) |
| 13777 |
'catch': function (onRejected) { |
| 13778 |
return this.then(undefined, onRejected); |
| 13779 |
} |
| 13780 |
}); |
| 13781 |
OwnPromiseCapability = function () { |
| 13782 |
var promise = new Internal(); |
| 13783 |
this.promise = promise; |
| 13784 |
this.resolve = ctx($resolve, promise, 1); |
| 13785 |
this.reject = ctx($reject, promise, 1); |
| 13786 |
}; |
| 13787 |
newPromiseCapabilityModule.f = newPromiseCapability = function (C) { |
| 13788 |
return C === $Promise || C === Wrapper |
| 13789 |
? new OwnPromiseCapability(C) |
| 13790 |
: newGenericPromiseCapability(C); |
| 13791 |
}; |
| 13792 |
} |
| 13793 |
|
| 13794 |
$export($export.G + $export.W + $export.F * !USE_NATIVE, { Promise: $Promise }); |
| 13795 |
__webpack_require__(153)($Promise, PROMISE); |
| 13796 |
__webpack_require__(309)(PROMISE); |
| 13797 |
Wrapper = __webpack_require__(54)[PROMISE]; |
| 13798 |
|
| 13799 |
// statics |
| 13800 |
$export($export.S + $export.F * !USE_NATIVE, PROMISE, { |
| 13801 |
// 25.4.4.5 Promise.reject(r) |
| 13802 |
reject: function reject(r) { |
| 13803 |
var capability = newPromiseCapability(this); |
| 13804 |
var $$reject = capability.reject; |
| 13805 |
$$reject(r); |
| 13806 |
return capability.promise; |
| 13807 |
} |
| 13808 |
}); |
| 13809 |
$export($export.S + $export.F * (LIBRARY || !USE_NATIVE), PROMISE, { |
| 13810 |
// 25.4.4.6 Promise.resolve(x) |
| 13811 |
resolve: function resolve(x) { |
| 13812 |
return promiseResolve(LIBRARY && this === Wrapper ? $Promise : this, x); |
| 13813 |
} |
| 13814 |
}); |
| 13815 |
$export($export.S + $export.F * !(USE_NATIVE && __webpack_require__(503)(function (iter) { |
| 13816 |
$Promise.all(iter)['catch'](empty); |
| 13817 |
})), PROMISE, { |
| 13818 |
// 25.4.4.1 Promise.all(iterable) |
| 13819 |
all: function all(iterable) { |
| 13820 |
var C = this; |
| 13821 |
var capability = newPromiseCapability(C); |
| 13822 |
var resolve = capability.resolve; |
| 13823 |
var reject = capability.reject; |
| 13824 |
var result = perform(function () { |
| 13825 |
var values = []; |
| 13826 |
var index = 0; |
| 13827 |
var remaining = 1; |
| 13828 |
forOf(iterable, false, function (promise) { |
| 13829 |
var $index = index++; |
| 13830 |
var alreadyCalled = false; |
| 13831 |
values.push(undefined); |
| 13832 |
remaining++; |
| 13833 |
C.resolve(promise).then(function (value) { |
| 13834 |
if (alreadyCalled) return; |
| 13835 |
alreadyCalled = true; |
| 13836 |
values[$index] = value; |
| 13837 |
--remaining || resolve(values); |
| 13838 |
}, reject); |
| 13839 |
}); |
| 13840 |
--remaining || resolve(values); |
| 13841 |
}); |
| 13842 |
if (result.e) reject(result.v); |
| 13843 |
return capability.promise; |
| 13844 |
}, |
| 13845 |
// 25.4.4.4 Promise.race(iterable) |
| 13846 |
race: function race(iterable) { |
| 13847 |
var C = this; |
| 13848 |
var capability = newPromiseCapability(C); |
| 13849 |
var reject = capability.reject; |
| 13850 |
var result = perform(function () { |
| 13851 |
forOf(iterable, false, function (promise) { |
| 13852 |
C.resolve(promise).then(capability.resolve, reject); |
| 13853 |
}); |
| 13854 |
}); |
| 13855 |
if (result.e) reject(result.v); |
| 13856 |
return capability.promise; |
| 13857 |
} |
| 13858 |
}); |
| 13859 |
|
| 13860 |
|
| 13861 |
/***/ }), |
| 13862 |
/* 363 */ |
| 13863 |
/***/ (function(module, exports, __webpack_require__) { |
| 13864 |
|
| 13865 |
var ctx = __webpack_require__(73); |
| 13866 |
var invoke = __webpack_require__(498); |
| 13867 |
var html = __webpack_require__(227); |
| 13868 |
var cel = __webpack_require__(109); |
| 13869 |
var global = __webpack_require__(17); |
| 13870 |
var process = global.process; |
| 13871 |
var setTask = global.setImmediate; |
| 13872 |
var clearTask = global.clearImmediate; |
| 13873 |
var MessageChannel = global.MessageChannel; |
| 13874 |
var Dispatch = global.Dispatch; |
| 13875 |
var counter = 0; |
| 13876 |
var queue = {}; |
| 13877 |
var ONREADYSTATECHANGE = 'onreadystatechange'; |
| 13878 |
var defer, channel, port; |
| 13879 |
var run = function () { |
| 13880 |
var id = +this; |
| 13881 |
// eslint-disable-next-line no-prototype-builtins |
| 13882 |
if (queue.hasOwnProperty(id)) { |
| 13883 |
var fn = queue[id]; |
| 13884 |
delete queue[id]; |
| 13885 |
fn(); |
| 13886 |
} |
| 13887 |
}; |
| 13888 |
var listener = function (event) { |
| 13889 |
run.call(event.data); |
| 13890 |
}; |
| 13891 |
// Node.js 0.9+ & IE10+ has setImmediate, otherwise: |
| 13892 |
if (!setTask || !clearTask) { |
| 13893 |
setTask = function setImmediate(fn) { |
| 13894 |
var args = []; |
| 13895 |
var i = 1; |
| 13896 |
while (arguments.length > i) args.push(arguments[i++]); |
| 13897 |
queue[++counter] = function () { |
| 13898 |
// eslint-disable-next-line no-new-func |
| 13899 |
invoke(typeof fn == 'function' ? fn : Function(fn), args); |
| 13900 |
}; |
| 13901 |
defer(counter); |
| 13902 |
return counter; |
| 13903 |
}; |
| 13904 |
clearTask = function clearImmediate(id) { |
| 13905 |
delete queue[id]; |
| 13906 |
}; |
| 13907 |
// Node.js 0.8- |
| 13908 |
if (__webpack_require__(46)(process) == 'process') { |
| 13909 |
defer = function (id) { |
| 13910 |
process.nextTick(ctx(run, id, 1)); |
| 13911 |
}; |
| 13912 |
// Sphere (JS game engine) Dispatch API |
| 13913 |
} else if (Dispatch && Dispatch.now) { |
| 13914 |
defer = function (id) { |
| 13915 |
Dispatch.now(ctx(run, id, 1)); |
| 13916 |
}; |
| 13917 |
// Browsers with MessageChannel, includes WebWorkers |
| 13918 |
} else if (MessageChannel) { |
| 13919 |
channel = new MessageChannel(); |
| 13920 |
port = channel.port2; |
| 13921 |
channel.port1.onmessage = listener; |
| 13922 |
defer = ctx(port.postMessage, port, 1); |
| 13923 |
// Browsers with postMessage, skip WebWorkers |
| 13924 |
// IE8 has postMessage, but it's sync & typeof its postMessage is 'object' |
| 13925 |
} else if (global.addEventListener && typeof postMessage == 'function' && !global.importScripts) { |
| 13926 |
defer = function (id) { |
| 13927 |
global.postMessage(id + '', '*'); |
| 13928 |
}; |
| 13929 |
global.addEventListener('message', listener, false); |
| 13930 |
// IE8- |
| 13931 |
} else if (ONREADYSTATECHANGE in cel('script')) { |
| 13932 |
defer = function (id) { |
| 13933 |
html.appendChild(cel('script'))[ONREADYSTATECHANGE] = function () { |
| 13934 |
html.removeChild(this); |
| 13935 |
run.call(id); |
| 13936 |
}; |
| 13937 |
}; |
| 13938 |
// Rest old browsers |
| 13939 |
} else { |
| 13940 |
defer = function (id) { |
| 13941 |
setTimeout(ctx(run, id, 1), 0); |
| 13942 |
}; |
| 13943 |
} |
| 13944 |
} |
| 13945 |
module.exports = { |
| 13946 |
set: setTask, |
| 13947 |
clear: clearTask |
| 13948 |
}; |
| 13949 |
|
| 13950 |
|
| 13951 |
/***/ }), |
| 13952 |
/* 364 */ |
| 13953 |
/***/ (function(module, exports, __webpack_require__) { |
| 13954 |
|
| 13955 |
"use strict"; |
| 13956 |
|
| 13957 |
// 25.4.1.5 NewPromiseCapability(C) |
| 13958 |
var aFunction = __webpack_require__(91); |
| 13959 |
|
| 13960 |
function PromiseCapability(C) { |
| 13961 |
var resolve, reject; |
| 13962 |
this.promise = new C(function ($$resolve, $$reject) { |
| 13963 |
if (resolve !== undefined || reject !== undefined) throw TypeError('Bad Promise constructor'); |
| 13964 |
resolve = $$resolve; |
| 13965 |
reject = $$reject; |
| 13966 |
}); |
| 13967 |
this.resolve = aFunction(resolve); |
| 13968 |
this.reject = aFunction(reject); |
| 13969 |
} |
| 13970 |
|
| 13971 |
module.exports.f = function (C) { |
| 13972 |
return new PromiseCapability(C); |
| 13973 |
}; |
| 13974 |
|
| 13975 |
|
| 13976 |
/***/ }), |
| 13977 |
/* 365 */ |
| 13978 |
/***/ (function(module, exports, __webpack_require__) { |
| 13979 |
|
| 13980 |
var anObject = __webpack_require__(18); |
| 13981 |
var isObject = __webpack_require__(30); |
| 13982 |
var newPromiseCapability = __webpack_require__(364); |
| 13983 |
|
| 13984 |
module.exports = function (C, x) { |
| 13985 |
anObject(C); |
| 13986 |
if (isObject(x) && x.constructor === C) return x; |
| 13987 |
var promiseCapability = newPromiseCapability.f(C); |
| 13988 |
var resolve = promiseCapability.resolve; |
| 13989 |
resolve(x); |
| 13990 |
return promiseCapability.promise; |
| 13991 |
}; |
| 13992 |
|
| 13993 |
|
| 13994 |
/***/ }), |
| 13995 |
/* 366 */ |
| 13996 |
/***/ (function(module, exports, __webpack_require__) { |
| 13997 |
|
| 13998 |
"use strict"; |
| 13999 |
// https://github.com/tc39/proposal-promise-finally |
| 14000 |
|
| 14001 |
var $export = __webpack_require__(34); |
| 14002 |
var core = __webpack_require__(54); |
| 14003 |
var global = __webpack_require__(17); |
| 14004 |
var speciesConstructor = __webpack_require__(154); |
| 14005 |
var promiseResolve = __webpack_require__(365); |
| 14006 |
|
| 14007 |
$export($export.P + $export.R, 'Promise', { 'finally': function (onFinally) { |
| 14008 |
var C = speciesConstructor(this, core.Promise || global.Promise); |
| 14009 |
var isFunction = typeof onFinally == 'function'; |
| 14010 |
return this.then( |
| 14011 |
isFunction ? function (x) { |
| 14012 |
return promiseResolve(C, onFinally()).then(function () { return x; }); |
| 14013 |
} : onFinally, |
| 14014 |
isFunction ? function (e) { |
| 14015 |
return promiseResolve(C, onFinally()).then(function () { throw e; }); |
| 14016 |
} : onFinally |
| 14017 |
); |
| 14018 |
} }); |
| 14019 |
|
| 14020 |
|
| 14021 |
/***/ }), |
| 14022 |
/* 367 */ |
| 14023 |
/***/ (function(module, exports, __webpack_require__) { |
| 14024 |
|
| 14025 |
"use strict"; |
| 14026 |
|
| 14027 |
|
| 14028 |
__webpack_require__(39); |
| 14029 |
|
| 14030 |
__webpack_require__(25); |
| 14031 |
|
| 14032 |
var ControlBaseDataView = __webpack_require__(127), |
| 14033 |
RepeaterRowView = __webpack_require__(328), |
| 14034 |
ControlRepeaterItemView; |
| 14035 |
|
| 14036 |
ControlRepeaterItemView = ControlBaseDataView.extend({ |
| 14037 |
ui: { |
| 14038 |
btnAddRow: '.elementor-repeater-add', |
| 14039 |
fieldContainer: '.elementor-repeater-fields-wrapper' |
| 14040 |
}, |
| 14041 |
events: function events() { |
| 14042 |
return { |
| 14043 |
'click @ui.btnAddRow': 'onButtonAddRowClick', |
| 14044 |
'sortstart @ui.fieldContainer': 'onSortStart', |
| 14045 |
'sortupdate @ui.fieldContainer': 'onSortUpdate', |
| 14046 |
'sortstop @ui.fieldContainer': 'onSortStop' |
| 14047 |
}; |
| 14048 |
}, |
| 14049 |
childView: RepeaterRowView, |
| 14050 |
childViewContainer: '.elementor-repeater-fields-wrapper', |
| 14051 |
templateHelpers: function templateHelpers() { |
| 14052 |
return { |
| 14053 |
itemActions: this.model.get('item_actions'), |
| 14054 |
data: _.extend({}, this.model.toJSON(), { |
| 14055 |
controlValue: [] |
| 14056 |
}) |
| 14057 |
}; |
| 14058 |
}, |
| 14059 |
childViewOptions: function childViewOptions(rowModel, index) { |
| 14060 |
var elementContainer = this.getOption('container'); |
| 14061 |
return { |
| 14062 |
container: elementContainer.repeaters[this.model.get('name')].children[index], |
| 14063 |
controlFields: this.model.get('fields'), |
| 14064 |
titleField: this.model.get('title_field'), |
| 14065 |
itemActions: this.model.get('item_actions') |
| 14066 |
}; |
| 14067 |
}, |
| 14068 |
createItemModel: function createItemModel(attrs, options, controlView) { |
| 14069 |
options.controls = controlView.model.get('fields'); |
| 14070 |
return new elementorModules.editor.elements.models.BaseSettings(attrs, options); |
| 14071 |
}, |
| 14072 |
fillCollection: function fillCollection() { |
| 14073 |
// TODO: elementSettingsModel is deprecated since 2.8.0. |
| 14074 |
var settings = this.container ? this.container.settings : this.elementSettingsModel; |
| 14075 |
var controlName = this.model.get('name'); |
| 14076 |
this.collection = settings.get(controlName); // Hack for history redo/undo |
| 14077 |
|
| 14078 |
if (!(this.collection instanceof Backbone.Collection)) { |
| 14079 |
this.collection = new Backbone.Collection(this.collection, { |
| 14080 |
// Use `partial` to supply the `this` as an argument, but not as context |
| 14081 |
// the `_` is a place holder for original arguments: `attrs` & `options` |
| 14082 |
model: _.partial(this.createItemModel, _, _, this) |
| 14083 |
}); // Set the value silent |
| 14084 |
|
| 14085 |
settings.set(controlName, this.collection, { |
| 14086 |
silent: true |
| 14087 |
}); |
| 14088 |
} |
| 14089 |
}, |
| 14090 |
initialize: function initialize() { |
| 14091 |
ControlBaseDataView.prototype.initialize.apply(this, arguments); |
| 14092 |
this.fillCollection(); |
| 14093 |
this.listenTo(this.collection, 'reset', this.resetContainer.bind(this)); |
| 14094 |
this.listenTo(this.collection, 'add', this.updateContainer.bind(this)); |
| 14095 |
}, |
| 14096 |
editRow: function editRow(rowView) { |
| 14097 |
if (this.currentEditableChild) { |
| 14098 |
var currentEditable = this.currentEditableChild.getChildViewContainer(this.currentEditableChild); |
| 14099 |
currentEditable.removeClass('editable'); // If the repeater contains TinyMCE editors, fire the `hide` trigger to hide floated toolbars |
| 14100 |
|
| 14101 |
currentEditable.find('.elementor-wp-editor').each(function () { |
| 14102 |
tinymce.get(this.id).fire('hide'); |
| 14103 |
}); |
| 14104 |
} |
| 14105 |
|
| 14106 |
if (this.currentEditableChild === rowView) { |
| 14107 |
delete this.currentEditableChild; |
| 14108 |
return; |
| 14109 |
} |
| 14110 |
|
| 14111 |
rowView.getChildViewContainer(rowView).addClass('editable'); |
| 14112 |
this.currentEditableChild = rowView; |
| 14113 |
this.updateActiveRow(); |
| 14114 |
}, |
| 14115 |
toggleMinRowsClass: function toggleMinRowsClass() { |
| 14116 |
if (!this.model.get('prevent_empty')) { |
| 14117 |
return; |
| 14118 |
} |
| 14119 |
|
| 14120 |
this.$el.toggleClass('elementor-repeater-has-minimum-rows', 1 >= this.collection.length); |
| 14121 |
}, |
| 14122 |
updateActiveRow: function updateActiveRow() { |
| 14123 |
var activeItemIndex = 1; |
| 14124 |
|
| 14125 |
if (this.currentEditableChild) { |
| 14126 |
activeItemIndex = this.currentEditableChild.itemIndex; |
| 14127 |
} |
| 14128 |
|
| 14129 |
this.setEditSetting('activeItemIndex', activeItemIndex); |
| 14130 |
}, |
| 14131 |
updateChildIndexes: function updateChildIndexes() { |
| 14132 |
var collection = this.collection; |
| 14133 |
this.children.each(function (view) { |
| 14134 |
view.updateIndex(collection.indexOf(view.model) + 1); |
| 14135 |
view.setTitle(); |
| 14136 |
}); |
| 14137 |
}, |
| 14138 |
onRender: function onRender() { |
| 14139 |
ControlBaseDataView.prototype.onRender.apply(this, arguments); |
| 14140 |
|
| 14141 |
if (this.model.get('item_actions').sort) { |
| 14142 |
this.ui.fieldContainer.sortable({ |
| 14143 |
axis: 'y', |
| 14144 |
handle: '.elementor-repeater-row-tools', |
| 14145 |
items: ' > :not(.elementor-repeater-row--disable-sort)' |
| 14146 |
}); |
| 14147 |
} |
| 14148 |
|
| 14149 |
this.toggleMinRowsClass(); |
| 14150 |
}, |
| 14151 |
onSortStart: function onSortStart(event, ui) { |
| 14152 |
ui.item.data('oldIndex', ui.item.index()); |
| 14153 |
}, |
| 14154 |
onSortStop: function onSortStop(event, ui) { |
| 14155 |
// Reload TinyMCE editors (if exist), it's a bug that TinyMCE content is missing after stop dragging |
| 14156 |
var self = this, |
| 14157 |
sortedIndex = ui.item.index(); |
| 14158 |
|
| 14159 |
if (-1 === sortedIndex) { |
| 14160 |
return; |
| 14161 |
} |
| 14162 |
|
| 14163 |
var sortedRowView = self.children.findByIndex(ui.item.index()), |
| 14164 |
rowControls = sortedRowView.children._views; |
| 14165 |
jQuery.each(rowControls, function () { |
| 14166 |
if ('wysiwyg' === this.model.get('type')) { |
| 14167 |
sortedRowView.render(); |
| 14168 |
delete self.currentEditableChild; |
| 14169 |
return false; |
| 14170 |
} |
| 14171 |
}); |
| 14172 |
}, |
| 14173 |
onSortUpdate: function onSortUpdate(event, ui) { |
| 14174 |
var oldIndex = ui.item.data('oldIndex'), |
| 14175 |
newIndex = ui.item.index(); |
| 14176 |
$e.run('document/repeater/move', { |
| 14177 |
container: this.options.container, |
| 14178 |
name: this.model.get('name'), |
| 14179 |
sourceIndex: oldIndex, |
| 14180 |
targetIndex: newIndex |
| 14181 |
}); |
| 14182 |
}, |
| 14183 |
onAddChild: function onAddChild() { |
| 14184 |
this.updateChildIndexes(); |
| 14185 |
this.updateActiveRow(); |
| 14186 |
}, |
| 14187 |
// BC since 3.0.0, ensure a new child is appear in container children. |
| 14188 |
updateContainer: function updateContainer(model) { |
| 14189 |
var container = this.options.container.repeaters[this.model.get('name')], |
| 14190 |
isInChildren = container.children.filter(function (child) { |
| 14191 |
return child.id === model.get('_id'); |
| 14192 |
}); |
| 14193 |
|
| 14194 |
if (!isInChildren.length) { |
| 14195 |
elementorCommon.helpers.softDeprecated('Don\'t add models directly to the repeater.', '3.0.0', '$e.run( \'document/repeater/insert\' )'); |
| 14196 |
this.options.container.addRepeaterItem(this.model.get('name'), model, model.collection.indexOf(model)); |
| 14197 |
} |
| 14198 |
}, |
| 14199 |
// BC since 3.0.0, ensure a container children are reset on collection reset. |
| 14200 |
resetContainer: function resetContainer() { |
| 14201 |
elementorCommon.helpers.softDeprecated('Don\'t reset repeater collection directly.', '3.0.0', '$e.run( \'document/repeater/remove\' )'); |
| 14202 |
this.options.container.repeaters[this.model.get('name')].children = []; |
| 14203 |
}, |
| 14204 |
getDefaults: function getDefaults() { |
| 14205 |
var defaults = {}; // Get default fields. |
| 14206 |
|
| 14207 |
_.each(this.model.get('fields'), function (field) { |
| 14208 |
defaults[field.name] = field.default; |
| 14209 |
}); |
| 14210 |
|
| 14211 |
return defaults; |
| 14212 |
}, |
| 14213 |
onButtonAddRowClick: function onButtonAddRowClick() { |
| 14214 |
var newModel = $e.run('document/repeater/insert', { |
| 14215 |
container: this.options.container, |
| 14216 |
name: this.model.get('name'), |
| 14217 |
model: this.getDefaults() |
| 14218 |
}); |
| 14219 |
var newChild = this.children.findByModel(newModel); |
| 14220 |
this.editRow(newChild); |
| 14221 |
this.toggleMinRowsClass(); |
| 14222 |
}, |
| 14223 |
onChildviewClickRemove: function onChildviewClickRemove(childView) { |
| 14224 |
if (childView === this.currentEditableChild) { |
| 14225 |
delete this.currentEditableChild; |
| 14226 |
} |
| 14227 |
|
| 14228 |
$e.run('document/repeater/remove', { |
| 14229 |
container: this.options.container, |
| 14230 |
name: this.model.get('name'), |
| 14231 |
index: childView._index |
| 14232 |
}); |
| 14233 |
this.updateActiveRow(); |
| 14234 |
this.updateChildIndexes(); |
| 14235 |
this.toggleMinRowsClass(); |
| 14236 |
}, |
| 14237 |
onChildviewClickDuplicate: function onChildviewClickDuplicate(childView) { |
| 14238 |
$e.run('document/repeater/duplicate', { |
| 14239 |
container: this.options.container, |
| 14240 |
name: this.model.get('name'), |
| 14241 |
index: childView._index |
| 14242 |
}); |
| 14243 |
this.toggleMinRowsClass(); |
| 14244 |
}, |
| 14245 |
onChildviewClickEdit: function onChildviewClickEdit(childView) { |
| 14246 |
this.editRow(childView); |
| 14247 |
}, |
| 14248 |
onAfterExternalChange: function onAfterExternalChange() { |
| 14249 |
// Update the collection with current value |
| 14250 |
this.fillCollection(); |
| 14251 |
ControlBaseDataView.prototype.onAfterExternalChange.apply(this, arguments); |
| 14252 |
} |
| 14253 |
}); |
| 14254 |
module.exports = ControlRepeaterItemView; |
| 14255 |
|
| 14256 |
/***/ }), |
| 14257 |
/* 368 */ |
| 14258 |
/***/ (function(module, exports, __webpack_require__) { |
| 14259 |
|
| 14260 |
"use strict"; |
| 14261 |
|
| 14262 |
|
| 14263 |
var _interopRequireDefault = __webpack_require__(0); |
| 14264 |
|
| 14265 |
__webpack_require__(147); |
| 14266 |
|
| 14267 |
__webpack_require__(117); |
| 14268 |
|
| 14269 |
__webpack_require__(72); |
| 14270 |
|
| 14271 |
var _controlsPopover = _interopRequireDefault(__webpack_require__(369)); |
| 14272 |
|
| 14273 |
var ControlsStack; |
| 14274 |
ControlsStack = Marionette.CompositeView.extend({ |
| 14275 |
classes: { |
| 14276 |
popover: 'elementor-controls-popover' |
| 14277 |
}, |
| 14278 |
activeTab: null, |
| 14279 |
activeSection: null, |
| 14280 |
className: function className() { |
| 14281 |
return 'elementor-controls-stack'; |
| 14282 |
}, |
| 14283 |
templateHelpers: function templateHelpers() { |
| 14284 |
return { |
| 14285 |
elementData: elementor.getElementData(this.model) |
| 14286 |
}; |
| 14287 |
}, |
| 14288 |
childViewOptions: function childViewOptions() { |
| 14289 |
return { |
| 14290 |
// TODO: elementSettingsModel is deprecated since 2.8.0. |
| 14291 |
elementSettingsModel: this.model |
| 14292 |
}; |
| 14293 |
}, |
| 14294 |
ui: function ui() { |
| 14295 |
return { |
| 14296 |
tabs: '.elementor-panel-navigation-tab', |
| 14297 |
reloadButton: '.elementor-update-preview-button' |
| 14298 |
}; |
| 14299 |
}, |
| 14300 |
events: function events() { |
| 14301 |
return { |
| 14302 |
'click @ui.reloadButton': 'onReloadButtonClick' |
| 14303 |
}; |
| 14304 |
}, |
| 14305 |
modelEvents: { |
| 14306 |
destroy: 'onModelDestroy' |
| 14307 |
}, |
| 14308 |
behaviors: { |
| 14309 |
HandleInnerTabs: { |
| 14310 |
behaviorClass: __webpack_require__(329) |
| 14311 |
} |
| 14312 |
}, |
| 14313 |
initialize: function initialize(options) { |
| 14314 |
this.initCollection(); |
| 14315 |
|
| 14316 |
if (options.tab) { |
| 14317 |
this.activeTab = options.tab; |
| 14318 |
this.activateFirstSection(); |
| 14319 |
} |
| 14320 |
|
| 14321 |
this.listenTo(elementor.channels.deviceMode, 'change', this.onDeviceModeChange); |
| 14322 |
}, |
| 14323 |
initCollection: function initCollection() { |
| 14324 |
this.collection = new Backbone.Collection(_.values(elementor.mergeControlsSettings(this.getOption('controls')))); |
| 14325 |
}, |
| 14326 |
filter: function filter(controlModel) { |
| 14327 |
if (controlModel.get('tab') !== this.activeTab) { |
| 14328 |
return false; |
| 14329 |
} |
| 14330 |
|
| 14331 |
if ('section' === controlModel.get('type')) { |
| 14332 |
return true; |
| 14333 |
} |
| 14334 |
|
| 14335 |
var section = controlModel.get('section'); |
| 14336 |
return !section || section === this.activeSection; |
| 14337 |
}, |
| 14338 |
getControlViewByModel: function getControlViewByModel(model) { |
| 14339 |
return this.children.findByModelCid(model.cid); |
| 14340 |
}, |
| 14341 |
getControlViewByName: function getControlViewByName(name) { |
| 14342 |
return this.getControlViewByModel(this.getControlModel(name)); |
| 14343 |
}, |
| 14344 |
getControlModel: function getControlModel(name) { |
| 14345 |
return this.collection.findWhere({ |
| 14346 |
name: name |
| 14347 |
}); |
| 14348 |
}, |
| 14349 |
isVisibleSectionControl: function isVisibleSectionControl(sectionControlModel) { |
| 14350 |
return this.activeTab === sectionControlModel.get('tab'); |
| 14351 |
}, |
| 14352 |
activateTab: function activateTab(tab) { |
| 14353 |
this.activeTab = tab; |
| 14354 |
this.activateFirstSection(); |
| 14355 |
|
| 14356 |
this._renderChildren(); |
| 14357 |
|
| 14358 |
return this; |
| 14359 |
}, |
| 14360 |
activateSection: function activateSection(sectionName) { |
| 14361 |
this.activeSection = sectionName; |
| 14362 |
return this; |
| 14363 |
}, |
| 14364 |
activateFirstSection: function activateFirstSection() { |
| 14365 |
var self = this; |
| 14366 |
var sectionControls = self.collection.filter(function (controlModel) { |
| 14367 |
return 'section' === controlModel.get('type') && self.isVisibleSectionControl(controlModel); |
| 14368 |
}); |
| 14369 |
|
| 14370 |
if (!sectionControls[0]) { |
| 14371 |
return; |
| 14372 |
} |
| 14373 |
|
| 14374 |
var preActivatedSection = sectionControls.filter(function (controlModel) { |
| 14375 |
return self.activeSection === controlModel.get('name'); |
| 14376 |
}); |
| 14377 |
|
| 14378 |
if (preActivatedSection[0]) { |
| 14379 |
return; |
| 14380 |
} |
| 14381 |
|
| 14382 |
self.activateSection(sectionControls[0].get('name')); |
| 14383 |
return this; |
| 14384 |
}, |
| 14385 |
getChildView: function getChildView(item) { |
| 14386 |
var controlType = item.get('type'); |
| 14387 |
return elementor.getControlView(controlType); |
| 14388 |
}, |
| 14389 |
getNamespaceArray: function getNamespaceArray() { |
| 14390 |
return [elementor.getPanelView().getCurrentPageName()]; |
| 14391 |
}, |
| 14392 |
openActiveSection: function openActiveSection() { |
| 14393 |
var activeSection = this.activeSection, |
| 14394 |
activeSectionView = this.children.filter(function (view) { |
| 14395 |
return activeSection === view.model.get('name'); |
| 14396 |
}); |
| 14397 |
|
| 14398 |
if (activeSectionView[0]) { |
| 14399 |
activeSectionView[0].$el.addClass('elementor-open'); |
| 14400 |
var eventNamespace = this.getNamespaceArray(); |
| 14401 |
eventNamespace.push(activeSection, 'activated'); |
| 14402 |
elementor.channels.editor.trigger(eventNamespace.join(':'), this); |
| 14403 |
} |
| 14404 |
}, |
| 14405 |
onRenderCollection: function onRenderCollection() { |
| 14406 |
this.openActiveSection(); |
| 14407 |
ControlsStack.handlePopovers(this); |
| 14408 |
}, |
| 14409 |
onModelDestroy: function onModelDestroy() { |
| 14410 |
this.destroy(); |
| 14411 |
}, |
| 14412 |
onReloadButtonClick: function onReloadButtonClick() { |
| 14413 |
elementor.reloadPreview(); |
| 14414 |
}, |
| 14415 |
onDeviceModeChange: function onDeviceModeChange() { |
| 14416 |
if ('desktop' === elementor.channels.deviceMode.request('currentMode')) { |
| 14417 |
this.$el.removeClass('elementor-responsive-switchers-open'); |
| 14418 |
} |
| 14419 |
}, |
| 14420 |
onChildviewControlSectionClicked: function onChildviewControlSectionClicked(childView) { |
| 14421 |
var isSectionOpen = childView.$el.hasClass('elementor-open'); |
| 14422 |
this.activateSection(isSectionOpen ? null : childView.model.get('name')); |
| 14423 |
|
| 14424 |
this._renderChildren(); |
| 14425 |
}, |
| 14426 |
onChildviewResponsiveSwitcherClick: function onChildviewResponsiveSwitcherClick(childView, device) { |
| 14427 |
if ('desktop' === device) { |
| 14428 |
this.$el.toggleClass('elementor-responsive-switchers-open'); |
| 14429 |
} |
| 14430 |
} |
| 14431 |
}, { |
| 14432 |
handlePopovers: function handlePopovers(view) { |
| 14433 |
var popover; |
| 14434 |
view.popovers = []; |
| 14435 |
this.removePopovers(view); |
| 14436 |
view.children.each(function (control) { |
| 14437 |
if (popover) { |
| 14438 |
popover.addChild(control); |
| 14439 |
} |
| 14440 |
|
| 14441 |
var popoverData = control.model.get('popover'); |
| 14442 |
|
| 14443 |
if (!popoverData) { |
| 14444 |
return; |
| 14445 |
} |
| 14446 |
|
| 14447 |
if (popoverData.start) { |
| 14448 |
popover = new _controlsPopover.default(control); |
| 14449 |
view.popovers.push(popover); |
| 14450 |
} |
| 14451 |
|
| 14452 |
if (popoverData.end) { |
| 14453 |
popover = null; |
| 14454 |
} |
| 14455 |
}); |
| 14456 |
}, |
| 14457 |
removePopovers: function removePopovers(view) { |
| 14458 |
view.popovers.forEach(function (popover) { |
| 14459 |
return popover.destroy(); |
| 14460 |
}); |
| 14461 |
} |
| 14462 |
}); |
| 14463 |
module.exports = ControlsStack; |
| 14464 |
|
| 14465 |
/***/ }), |
| 14466 |
/* 369 */ |
| 14467 |
/***/ (function(module, exports, __webpack_require__) { |
| 14468 |
|
| 14469 |
"use strict"; |
| 14470 |
|
| 14471 |
|
| 14472 |
var _interopRequireDefault = __webpack_require__(0); |
| 14473 |
|
| 14474 |
var _Object$defineProperty = __webpack_require__(1); |
| 14475 |
|
| 14476 |
_Object$defineProperty(exports, "__esModule", { |
| 14477 |
value: true |
| 14478 |
}); |
| 14479 |
|
| 14480 |
exports.default = void 0; |
| 14481 |
|
| 14482 |
var _defineProperty2 = _interopRequireDefault(__webpack_require__(28)); |
| 14483 |
|
| 14484 |
__webpack_require__(25); |
| 14485 |
|
| 14486 |
var _classCallCheck2 = _interopRequireDefault(__webpack_require__(2)); |
| 14487 |
|
| 14488 |
var _createClass2 = _interopRequireDefault(__webpack_require__(3)); |
| 14489 |
|
| 14490 |
var ControlsPopover = /*#__PURE__*/function () { |
| 14491 |
function ControlsPopover(child) { |
| 14492 |
(0, _classCallCheck2.default)(this, ControlsPopover); |
| 14493 |
this.child = child; |
| 14494 |
this.$popover = jQuery('<div>', { |
| 14495 |
class: 'elementor-controls-popover' |
| 14496 |
}); |
| 14497 |
child.$el.before(this.$popover); |
| 14498 |
this.$popover.append(child.$el); |
| 14499 |
this.popoverToggleView = child._parent.children.findByIndex(child._index - 1); // Add the "Typography" header to the popover |
| 14500 |
|
| 14501 |
if ('typography' === this.child.model.attributes.groupType) { |
| 14502 |
this.createPopoverHeader(); |
| 14503 |
} |
| 14504 |
} |
| 14505 |
|
| 14506 |
(0, _createClass2.default)(ControlsPopover, [{ |
| 14507 |
key: "addChild", |
| 14508 |
value: function addChild(child) { |
| 14509 |
this.$popover.append(child.$el); |
| 14510 |
} |
| 14511 |
}, { |
| 14512 |
key: "createPopoverHeader", |
| 14513 |
value: function createPopoverHeader() { |
| 14514 |
var _this = this; |
| 14515 |
|
| 14516 |
var $popoverToggleControl = this.$popover.prev(), |
| 14517 |
// Get the existing reset button. |
| 14518 |
$resetLabel = $popoverToggleControl.find('.elementor-control-popover-toggle-reset-label'); |
| 14519 |
this.$popoverHeader = jQuery('<div>', { |
| 14520 |
class: 'e-group-control-header' |
| 14521 |
}).html('<span>' + elementor.translate('typography') + '</span>'); |
| 14522 |
this.$headerControlsWrapper = jQuery('<div>', { |
| 14523 |
class: 'e-control-tools' |
| 14524 |
}); // Give the reset button the control tool styling, and add a click event so clicking on it closes the popover. |
| 14525 |
|
| 14526 |
$resetLabel.addClass('e-control-tool').on('click', function () { |
| 14527 |
return _this.onResetButtonClick(); |
| 14528 |
}); // Move the popover toggle reset button into the popover header. |
| 14529 |
|
| 14530 |
this.$headerControlsWrapper.append($resetLabel); |
| 14531 |
this.$popoverHeader.append(this.$headerControlsWrapper); |
| 14532 |
var globalConfig = this.popoverToggleView.model.get('global'); |
| 14533 |
|
| 14534 |
if (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.active) { |
| 14535 |
this.createAddButton(); |
| 14536 |
} |
| 14537 |
|
| 14538 |
this.$popover.prepend(this.$popoverHeader).addClass('e-controls-popover--typography'); |
| 14539 |
} |
| 14540 |
}, { |
| 14541 |
key: "onResetButtonClick", |
| 14542 |
value: function onResetButtonClick() { |
| 14543 |
this.$popover.hide(); |
| 14544 |
var groupControlName = this.child.model.get('groupPrefix') + 'typography', |
| 14545 |
args = { |
| 14546 |
container: this.child.options.container, |
| 14547 |
settings: (0, _defineProperty2.default)({}, groupControlName, '') |
| 14548 |
}; |
| 14549 |
|
| 14550 |
if (this.child.options.container.globals.get(groupControlName)) { |
| 14551 |
// The Disable Globals command applies global settings locally, |
| 14552 |
// so disabling the global shouldn't actually change the appearance of the widget. |
| 14553 |
$e.run('document/globals/disable', args); |
| 14554 |
} else { |
| 14555 |
$e.run('document/elements/settings', args); |
| 14556 |
} |
| 14557 |
} |
| 14558 |
}, { |
| 14559 |
key: "onAddButtonClick", |
| 14560 |
value: function onAddButtonClick() { |
| 14561 |
this.popoverToggleView.onAddGlobalButtonClick(); |
| 14562 |
} |
| 14563 |
}, { |
| 14564 |
key: "createAddButton", |
| 14565 |
value: function createAddButton() { |
| 14566 |
var _this2 = this; |
| 14567 |
|
| 14568 |
this.$addButton = jQuery('<button>', { |
| 14569 |
class: 'e-control-tool' |
| 14570 |
}).html(jQuery('<i>', { |
| 14571 |
class: 'eicon-plus' |
| 14572 |
})); |
| 14573 |
this.$headerControlsWrapper.append(this.$addButton); |
| 14574 |
this.$addButton.on('click', function () { |
| 14575 |
return _this2.onAddButtonClick(); |
| 14576 |
}); |
| 14577 |
this.$addButton.tipsy({ |
| 14578 |
title: function title() { |
| 14579 |
return elementor.translate('create_global_font'); |
| 14580 |
}, |
| 14581 |
gravity: function gravity() { |
| 14582 |
return 's'; |
| 14583 |
} |
| 14584 |
}); |
| 14585 |
} |
| 14586 |
}, { |
| 14587 |
key: "destroy", |
| 14588 |
value: function destroy() { |
| 14589 |
this.$popover.remove(); |
| 14590 |
} |
| 14591 |
}]); |
| 14592 |
return ControlsPopover; |
| 14593 |
}(); |
| 14594 |
|
| 14595 |
exports.default = ControlsPopover; |
| 14596 |
|
| 14597 |
/***/ }), |
| 14598 |
/* 370 */ |
| 14599 |
/***/ (function(module, exports, __webpack_require__) { |
| 14600 |
|
| 14601 |
"use strict"; |
| 14602 |
|
| 14603 |
|
| 14604 |
var _interopRequireDefault = __webpack_require__(0); |
| 14605 |
|
| 14606 |
var _Object$defineProperty = __webpack_require__(1); |
| 14607 |
|
| 14608 |
_Object$defineProperty(exports, "__esModule", { |
| 14609 |
value: true |
| 14610 |
}); |
| 14611 |
|
| 14612 |
exports.default = void 0; |
| 14613 |
|
| 14614 |
var _classCallCheck2 = _interopRequireDefault(__webpack_require__(2)); |
| 14615 |
|
| 14616 |
var _createClass2 = _interopRequireDefault(__webpack_require__(3)); |
| 14617 |
|
| 14618 |
var BackwardsCompatibility = /*#__PURE__*/function () { |
| 14619 |
function BackwardsCompatibility() { |
| 14620 |
(0, _classCallCheck2.default)(this, BackwardsCompatibility); |
| 14621 |
} |
| 14622 |
|
| 14623 |
(0, _createClass2.default)(BackwardsCompatibility, null, [{ |
| 14624 |
key: "findViewRecursive", |
| 14625 |
value: function findViewRecursive(parent, key, value) { |
| 14626 |
var multiple = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true; |
| 14627 |
elementorCommon.helpers.softDeprecated('findViewRecursive', '2.9.0', "$e.components.get( 'document' ).utils.findViewRecursive( parent, key, value, multiple )"); |
| 14628 |
return $e.components.get('document').utils.findViewRecursive(parent, key, value, multiple); |
| 14629 |
} |
| 14630 |
}, { |
| 14631 |
key: "findViewById", |
| 14632 |
value: function findViewById(id) { |
| 14633 |
elementorCommon.helpers.softDeprecated('findViewById', '2.9.0', "$e.components.get( 'document' ).utils.findViewById( id )"); |
| 14634 |
return $e.components.get('document').utils.findViewById(id); |
| 14635 |
} |
| 14636 |
}, { |
| 14637 |
key: "findContainerById", |
| 14638 |
value: function findContainerById(id) { |
| 14639 |
elementorCommon.helpers.softDeprecated('findContainerById', '2.9.0', "$e.components.get( 'document' ).utils.findContainerById( id )"); |
| 14640 |
return $e.components.get('document').utils.findContainerById(id); |
| 14641 |
} |
| 14642 |
}]); |
| 14643 |
return BackwardsCompatibility; |
| 14644 |
}(); |
| 14645 |
|
| 14646 |
exports.default = BackwardsCompatibility; |
| 14647 |
|
| 14648 |
/***/ }), |
| 14649 |
/* 371 */ |
| 14650 |
/***/ (function(module, exports, __webpack_require__) { |
| 14651 |
|
| 14652 |
"use strict"; |
| 14653 |
|
| 14654 |
|
| 14655 |
var _interopRequireDefault = __webpack_require__(0); |
| 14656 |
|
| 14657 |
var _keys = _interopRequireDefault(__webpack_require__(23)); |
| 14658 |
|
| 14659 |
module.exports = Marionette.Region.extend({ |
| 14660 |
storage: null, |
| 14661 |
storageSizeKeys: null, |
| 14662 |
constructor: function constructor() { |
| 14663 |
Marionette.Region.prototype.constructor.apply(this, arguments); |
| 14664 |
var savedStorage = elementorCommon.storage.get(this.getStorageKey()); |
| 14665 |
this.storage = savedStorage ? savedStorage : this.getDefaultStorage(); |
| 14666 |
this.storageSizeKeys = (0, _keys.default)(this.storage.size); |
| 14667 |
}, |
| 14668 |
saveStorage: function saveStorage(key, value) { |
| 14669 |
this.storage[key] = value; |
| 14670 |
elementorCommon.storage.set(this.getStorageKey(), this.storage); |
| 14671 |
}, |
| 14672 |
saveSize: function saveSize(size) { |
| 14673 |
if (!size) { |
| 14674 |
size = elementor.helpers.getElementInlineStyle(this.$el, this.storageSizeKeys); |
| 14675 |
} |
| 14676 |
|
| 14677 |
this.saveStorage('size', size); |
| 14678 |
} |
| 14679 |
}); |
| 14680 |
|
| 14681 |
/***/ }), |
| 14682 |
/* 372 */ |
| 14683 |
/***/ (function(module, exports, __webpack_require__) { |
| 14684 |
|
| 14685 |
"use strict"; |
| 14686 |
|
| 14687 |
|
| 14688 |
__webpack_require__(39); |
| 14689 |
|
| 14690 |
module.exports = elementorModules.Module.extend({ |
| 14691 |
getDefaultSettings: function getDefaultSettings() { |
| 14692 |
return { |
| 14693 |
actions: {}, |
| 14694 |
classes: { |
| 14695 |
list: 'elementor-context-menu-list', |
| 14696 |
group: 'elementor-context-menu-list__group', |
| 14697 |
groupPrefix: 'elementor-context-menu-list__group-', |
| 14698 |
item: 'elementor-context-menu-list__item', |
| 14699 |
itemTypePrefix: 'elementor-context-menu-list__item-', |
| 14700 |
itemTitle: 'elementor-context-menu-list__item__title', |
| 14701 |
itemShortcut: 'elementor-context-menu-list__item__shortcut', |
| 14702 |
iconShortcut: 'elementor-context-menu-list__item__icon', |
| 14703 |
itemDisabled: 'elementor-context-menu-list__item--disabled', |
| 14704 |
divider: 'elementor-context-menu-list__divider', |
| 14705 |
hidden: 'elementor-hidden' |
| 14706 |
} |
| 14707 |
}; |
| 14708 |
}, |
| 14709 |
buildActionItem: function buildActionItem(action) { |
| 14710 |
var self = this, |
| 14711 |
classes = self.getSettings('classes'), |
| 14712 |
$item = jQuery('<div>', { |
| 14713 |
class: classes.item + ' ' + classes.itemTypePrefix + action.name |
| 14714 |
}), |
| 14715 |
$itemTitle = jQuery('<div>', { |
| 14716 |
class: classes.itemTitle |
| 14717 |
}).text(action.title), |
| 14718 |
$itemIcon = jQuery('<div>', { |
| 14719 |
class: classes.iconShortcut |
| 14720 |
}); |
| 14721 |
|
| 14722 |
if (action.icon) { |
| 14723 |
$itemIcon.html(jQuery('<i>', { |
| 14724 |
class: action.icon |
| 14725 |
})); |
| 14726 |
} |
| 14727 |
|
| 14728 |
$item.append($itemIcon, $itemTitle); |
| 14729 |
|
| 14730 |
if (action.shortcut) { |
| 14731 |
var $itemShortcut = jQuery('<div>', { |
| 14732 |
class: classes.itemShortcut |
| 14733 |
}).html(action.shortcut); |
| 14734 |
$item.append($itemShortcut); |
| 14735 |
} |
| 14736 |
|
| 14737 |
if (action.callback) { |
| 14738 |
$item.on('click', function () { |
| 14739 |
self.runAction(action); |
| 14740 |
}); |
| 14741 |
} |
| 14742 |
|
| 14743 |
action.$item = $item; |
| 14744 |
return $item; |
| 14745 |
}, |
| 14746 |
buildActionsList: function buildActionsList() { |
| 14747 |
var self = this, |
| 14748 |
classes = self.getSettings('classes'), |
| 14749 |
groups = self.getSettings('groups'), |
| 14750 |
$list = jQuery('<div>', { |
| 14751 |
class: classes.list |
| 14752 |
}); |
| 14753 |
groups.forEach(function (group) { |
| 14754 |
var $group = jQuery('<div>', { |
| 14755 |
class: classes.group + ' ' + classes.groupPrefix + group.name |
| 14756 |
}); |
| 14757 |
group.actions.forEach(function (action) { |
| 14758 |
$group.append(self.buildActionItem(action)); |
| 14759 |
}); |
| 14760 |
$list.append($group); |
| 14761 |
group.$item = $group; |
| 14762 |
}); |
| 14763 |
return $list; |
| 14764 |
}, |
| 14765 |
toggleGroupVisibility: function toggleGroupVisibility(group, state) { |
| 14766 |
group.$item.toggleClass(this.getSettings('classes.hidden'), !state); |
| 14767 |
}, |
| 14768 |
toggleActionVisibility: function toggleActionVisibility(action, state) { |
| 14769 |
action.$item.toggleClass(this.getSettings('classes.hidden'), !state); |
| 14770 |
}, |
| 14771 |
toggleActionUsability: function toggleActionUsability(action, state) { |
| 14772 |
action.$item.toggleClass(this.getSettings('classes.itemDisabled'), !state); |
| 14773 |
}, |
| 14774 |
isActionEnabled: function isActionEnabled(action) { |
| 14775 |
if (!action.callback && !action.groups) { |
| 14776 |
return false; |
| 14777 |
} |
| 14778 |
|
| 14779 |
return action.isEnabled ? action.isEnabled() : true; |
| 14780 |
}, |
| 14781 |
runAction: function runAction(action) { |
| 14782 |
if (!this.isActionEnabled(action)) { |
| 14783 |
return; |
| 14784 |
} |
| 14785 |
|
| 14786 |
action.callback(); |
| 14787 |
this.getModal().hide(); |
| 14788 |
}, |
| 14789 |
initModal: function initModal() { |
| 14790 |
var modal; |
| 14791 |
|
| 14792 |
this.getModal = function () { |
| 14793 |
if (!modal) { |
| 14794 |
modal = elementorCommon.dialogsManager.createWidget('simple', { |
| 14795 |
className: 'elementor-context-menu', |
| 14796 |
message: this.buildActionsList(), |
| 14797 |
iframe: elementor.$preview, |
| 14798 |
effects: { |
| 14799 |
hide: 'hide', |
| 14800 |
show: 'show' |
| 14801 |
}, |
| 14802 |
hide: { |
| 14803 |
onOutsideContextMenu: true |
| 14804 |
}, |
| 14805 |
position: { |
| 14806 |
my: (elementorCommon.config.isRTL ? 'right' : 'left') + ' top', |
| 14807 |
collision: 'fit' |
| 14808 |
} |
| 14809 |
}); |
| 14810 |
} |
| 14811 |
|
| 14812 |
return modal; |
| 14813 |
}; |
| 14814 |
}, |
| 14815 |
show: function show(event) { |
| 14816 |
var self = this, |
| 14817 |
modal = self.getModal(); |
| 14818 |
modal.setSettings('position', { |
| 14819 |
of: event |
| 14820 |
}); |
| 14821 |
self.getSettings('groups').forEach(function (group) { |
| 14822 |
var isGroupVisible = false !== group.isVisible; |
| 14823 |
self.toggleGroupVisibility(group, isGroupVisible); |
| 14824 |
|
| 14825 |
if (isGroupVisible) { |
| 14826 |
group.actions.forEach(function (action) { |
| 14827 |
var isActionVisible = false !== action.isVisible; |
| 14828 |
self.toggleActionVisibility(action, isActionVisible); |
| 14829 |
|
| 14830 |
if (isActionVisible) { |
| 14831 |
self.toggleActionUsability(action, self.isActionEnabled(action)); |
| 14832 |
} |
| 14833 |
}); |
| 14834 |
} |
| 14835 |
}); |
| 14836 |
modal.show(); |
| 14837 |
}, |
| 14838 |
destroy: function destroy() { |
| 14839 |
this.getModal().destroy(); |
| 14840 |
}, |
| 14841 |
onInit: function onInit() { |
| 14842 |
this.initModal(); |
| 14843 |
} |
| 14844 |
}); |
| 14845 |
|
| 14846 |
/***/ }), |
| 14847 |
/* 373 */ |
| 14848 |
/***/ (function(module, exports, __webpack_require__) { |
| 14849 |
|
| 14850 |
"use strict"; |
| 14851 |
|
| 14852 |
|
| 14853 |
var _interopRequireDefault = __webpack_require__(0); |
| 14854 |
|
| 14855 |
var _Object$defineProperty = __webpack_require__(1); |
| 14856 |
|
| 14857 |
_Object$defineProperty(exports, "__esModule", { |
| 14858 |
value: true |
| 14859 |
}); |
| 14860 |
|
| 14861 |
exports.default = void 0; |
| 14862 |
|
| 14863 |
var _classCallCheck2 = _interopRequireDefault(__webpack_require__(2)); |
| 14864 |
|
| 14865 |
var _createClass2 = _interopRequireDefault(__webpack_require__(3)); |
| 14866 |
|
| 14867 |
var _get2 = _interopRequireDefault(__webpack_require__(26)); |
| 14868 |
|
| 14869 |
var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(16)); |
| 14870 |
|
| 14871 |
var _inherits2 = _interopRequireDefault(__webpack_require__(4)); |
| 14872 |
|
| 14873 |
var _createSuper2 = _interopRequireDefault(__webpack_require__(5)); |
| 14874 |
|
| 14875 |
var _base = _interopRequireDefault(__webpack_require__(296)); |
| 14876 |
|
| 14877 |
var AddSectionView = /*#__PURE__*/function (_BaseAddSectionView) { |
| 14878 |
(0, _inherits2.default)(AddSectionView, _BaseAddSectionView); |
| 14879 |
|
| 14880 |
var _super = (0, _createSuper2.default)(AddSectionView); |
| 14881 |
|
| 14882 |
function AddSectionView() { |
| 14883 |
(0, _classCallCheck2.default)(this, AddSectionView); |
| 14884 |
return _super.apply(this, arguments); |
| 14885 |
} |
| 14886 |
|
| 14887 |
(0, _createClass2.default)(AddSectionView, [{ |
| 14888 |
key: "className", |
| 14889 |
value: function className() { |
| 14890 |
return (0, _get2.default)((0, _getPrototypeOf2.default)(AddSectionView.prototype), "className", this).call(this) + ' elementor-add-section-inline'; |
| 14891 |
} |
| 14892 |
}, { |
| 14893 |
key: "fadeToDeath", |
| 14894 |
value: function fadeToDeath() { |
| 14895 |
var self = this; |
| 14896 |
self.$el.slideUp(function () { |
| 14897 |
self.destroy(); |
| 14898 |
}); |
| 14899 |
} |
| 14900 |
}, { |
| 14901 |
key: "onAfterPaste", |
| 14902 |
value: function onAfterPaste() { |
| 14903 |
(0, _get2.default)((0, _getPrototypeOf2.default)(AddSectionView.prototype), "onAfterPaste", this).call(this); |
| 14904 |
this.destroy(); |
| 14905 |
} |
| 14906 |
}, { |
| 14907 |
key: "onCloseButtonClick", |
| 14908 |
value: function onCloseButtonClick() { |
| 14909 |
this.fadeToDeath(); |
| 14910 |
} |
| 14911 |
}, { |
| 14912 |
key: "onPresetSelected", |
| 14913 |
value: function onPresetSelected(event) { |
| 14914 |
(0, _get2.default)((0, _getPrototypeOf2.default)(AddSectionView.prototype), "onPresetSelected", this).call(this, event); |
| 14915 |
this.destroy(); |
| 14916 |
} |
| 14917 |
}, { |
| 14918 |
key: "onAddTemplateButtonClick", |
| 14919 |
value: function onAddTemplateButtonClick() { |
| 14920 |
(0, _get2.default)((0, _getPrototypeOf2.default)(AddSectionView.prototype), "onAddTemplateButtonClick", this).call(this); |
| 14921 |
this.destroy(); |
| 14922 |
} |
| 14923 |
}, { |
| 14924 |
key: "onDropping", |
| 14925 |
value: function onDropping() { |
| 14926 |
(0, _get2.default)((0, _getPrototypeOf2.default)(AddSectionView.prototype), "onDropping", this).call(this); |
| 14927 |
this.destroy(); |
| 14928 |
} |
| 14929 |
}]); |
| 14930 |
return AddSectionView; |
| 14931 |
}(_base.default); |
| 14932 |
|
| 14933 |
var _default = AddSectionView; |
| 14934 |
exports.default = _default; |
| 14935 |
|
| 14936 |
/***/ }), |
| 14937 |
/* 374 */ |
| 14938 |
/***/ (function(module, exports, __webpack_require__) { |
| 14939 |
|
| 14940 |
"use strict"; |
| 14941 |
|
| 14942 |
|
| 14943 |
var _section = __webpack_require__(256); |
| 14944 |
|
| 14945 |
var BaseElementView = __webpack_require__(297), |
| 14946 |
ColumnEmptyView = __webpack_require__(375), |
| 14947 |
ColumnView; |
| 14948 |
|
| 14949 |
ColumnView = BaseElementView.extend({ |
| 14950 |
template: Marionette.TemplateCache.get('#tmpl-elementor-column-content'), |
| 14951 |
emptyView: ColumnEmptyView, |
| 14952 |
childViewContainer: elementor.config.legacyMode.elementWrappers ? '> .elementor-column-wrap > .elementor-widget-wrap' : '> .elementor-widget-wrap', |
| 14953 |
toggleEditTools: true, |
| 14954 |
behaviors: function behaviors() { |
| 14955 |
var behaviors = BaseElementView.prototype.behaviors.apply(this, arguments); |
| 14956 |
|
| 14957 |
_.extend(behaviors, { |
| 14958 |
Sortable: { |
| 14959 |
behaviorClass: __webpack_require__(298), |
| 14960 |
elChildType: 'widget' |
| 14961 |
}, |
| 14962 |
Resizable: { |
| 14963 |
behaviorClass: __webpack_require__(376) |
| 14964 |
} |
| 14965 |
}); |
| 14966 |
|
| 14967 |
return elementor.hooks.applyFilters('elements/column/behaviors', behaviors, this); |
| 14968 |
}, |
| 14969 |
className: function className() { |
| 14970 |
var classes = BaseElementView.prototype.className.apply(this, arguments), |
| 14971 |
type = this.isInner() ? 'inner' : 'top'; |
| 14972 |
return classes + ' elementor-column elementor-' + type + '-column'; |
| 14973 |
}, |
| 14974 |
tagName: function tagName() { |
| 14975 |
return this.model.getSetting('html_tag') || 'div'; |
| 14976 |
}, |
| 14977 |
ui: function ui() { |
| 14978 |
var ui = BaseElementView.prototype.ui.apply(this, arguments); |
| 14979 |
ui.columnInner = elementor.config.legacyMode.elementWrappers ? '> .elementor-column-wrap' : '> .elementor-widget-wrap'; |
| 14980 |
ui.percentsTooltip = '> .elementor-element-overlay .elementor-column-percents-tooltip'; |
| 14981 |
return ui; |
| 14982 |
}, |
| 14983 |
getEditButtons: function getEditButtons() { |
| 14984 |
var elementData = elementor.getElementData(this.model), |
| 14985 |
editTools = {}; |
| 14986 |
editTools.edit = { |
| 14987 |
title: elementor.translate('edit_element', [elementData.title]), |
| 14988 |
icon: 'column' |
| 14989 |
}; |
| 14990 |
|
| 14991 |
if (elementor.getPreferences('edit_buttons')) { |
| 14992 |
editTools.duplicate = { |
| 14993 |
title: elementor.translate('duplicate_element', [elementData.title]), |
| 14994 |
icon: 'clone' |
| 14995 |
}; |
| 14996 |
editTools.add = { |
| 14997 |
title: elementor.translate('add_element', [elementData.title]), |
| 14998 |
icon: 'plus' |
| 14999 |
}; |
| 15000 |
editTools.remove = { |
| 15001 |
title: elementor.translate('delete_element', [elementData.title]), |
| 15002 |
icon: 'close' |
| 15003 |
}; |
| 15004 |
} |
| 15005 |
|
| 15006 |
return editTools; |
| 15007 |
}, |
| 15008 |
initialize: function initialize() { |
| 15009 |
BaseElementView.prototype.initialize.apply(this, arguments); |
| 15010 |
this.model.get('editSettings').set('defaultEditRoute', 'layout'); |
| 15011 |
}, |
| 15012 |
attachElContent: function attachElContent() { |
| 15013 |
BaseElementView.prototype.attachElContent.apply(this, arguments); |
| 15014 |
var $tooltip = jQuery('<div>', { |
| 15015 |
class: 'elementor-column-percents-tooltip' |
| 15016 |
}); |
| 15017 |
this.$el.children('.elementor-element-overlay').append($tooltip); |
| 15018 |
}, |
| 15019 |
getContextMenuGroups: function getContextMenuGroups() { |
| 15020 |
var self = this, |
| 15021 |
groups = BaseElementView.prototype.getContextMenuGroups.apply(this, arguments), |
| 15022 |
generalGroupIndex = groups.indexOf(_.findWhere(groups, { |
| 15023 |
name: 'general' |
| 15024 |
})); |
| 15025 |
groups.splice(generalGroupIndex + 1, 0, { |
| 15026 |
name: 'addNew', |
| 15027 |
actions: [{ |
| 15028 |
name: 'addNew', |
| 15029 |
icon: 'eicon-plus', |
| 15030 |
title: elementor.translate('new_column'), |
| 15031 |
callback: this.addNewColumn.bind(this), |
| 15032 |
isEnabled: function isEnabled() { |
| 15033 |
return self.model.collection.length < _section.DEFAULT_MAX_COLUMNS; |
| 15034 |
} |
| 15035 |
}] |
| 15036 |
}); |
| 15037 |
return groups; |
| 15038 |
}, |
| 15039 |
isDroppingAllowed: function isDroppingAllowed() { |
| 15040 |
// Don't allow dragging items to document which is not editable. |
| 15041 |
if (!this.getContainer().isEditable()) { |
| 15042 |
return false; |
| 15043 |
} |
| 15044 |
|
| 15045 |
var elementView = elementor.channels.panelElements.request('element:selected'); |
| 15046 |
|
| 15047 |
if (!elementView) { |
| 15048 |
return false; |
| 15049 |
} |
| 15050 |
|
| 15051 |
var elType = elementView.model.get('elType'); |
| 15052 |
|
| 15053 |
if ('section' === elType) { |
| 15054 |
return !this.isInner(); |
| 15055 |
} |
| 15056 |
|
| 15057 |
return 'widget' === elType; |
| 15058 |
}, |
| 15059 |
getPercentsForDisplay: function getPercentsForDisplay() { |
| 15060 |
var inlineSize = +this.model.getSetting('_inline_size') || this.getPercentSize(); |
| 15061 |
return inlineSize.toFixed(1) + '%'; |
| 15062 |
}, |
| 15063 |
changeSizeUI: function changeSizeUI() { |
| 15064 |
var self = this, |
| 15065 |
columnSize = self.model.getSetting('_column_size'); |
| 15066 |
self.$el.attr('data-col', columnSize); |
| 15067 |
|
| 15068 |
_.defer(function () { |
| 15069 |
// Wait for the column size to be applied |
| 15070 |
if (self.ui.percentsTooltip) { |
| 15071 |
self.ui.percentsTooltip.text(self.getPercentsForDisplay()); |
| 15072 |
} |
| 15073 |
}); |
| 15074 |
}, |
| 15075 |
getPercentSize: function getPercentSize(size) { |
| 15076 |
if (!size) { |
| 15077 |
size = this.el.getBoundingClientRect().width; |
| 15078 |
} |
| 15079 |
|
| 15080 |
return +(size / this.$el.parent().width() * 100).toFixed(3); |
| 15081 |
}, |
| 15082 |
getSortableOptions: function getSortableOptions() { |
| 15083 |
return { |
| 15084 |
connectWith: '.elementor-widget-wrap', |
| 15085 |
items: '> .elementor-element' |
| 15086 |
}; |
| 15087 |
}, |
| 15088 |
changeChildContainerClasses: function changeChildContainerClasses() { |
| 15089 |
var emptyClass = 'elementor-element-empty', |
| 15090 |
populatedClass = 'elementor-element-populated'; |
| 15091 |
|
| 15092 |
if (this.ui.columnInner) { |
| 15093 |
if (this.collection.isEmpty()) { |
| 15094 |
this.ui.columnInner.removeClass(populatedClass).addClass(emptyClass); |
| 15095 |
} else { |
| 15096 |
this.ui.columnInner.removeClass(emptyClass).addClass(populatedClass); |
| 15097 |
} |
| 15098 |
} |
| 15099 |
}, |
| 15100 |
addNewColumn: function addNewColumn() { |
| 15101 |
$e.run('document/elements/create', { |
| 15102 |
model: { |
| 15103 |
elType: 'column' |
| 15104 |
}, |
| 15105 |
container: this.getContainer().parent, |
| 15106 |
options: { |
| 15107 |
at: this.$el.index() + 1 |
| 15108 |
} |
| 15109 |
}); |
| 15110 |
}, |
| 15111 |
onRender: function onRender() { |
| 15112 |
var _this = this; |
| 15113 |
|
| 15114 |
var isLegacyMode = elementor.config.legacyMode.elementWrappers; |
| 15115 |
var itemsClasses = ''; |
| 15116 |
|
| 15117 |
if (isLegacyMode) { |
| 15118 |
itemsClasses = ' > .elementor-column-wrap > .elementor-widget-wrap > .elementor-element, >.elementor-column-wrap > .elementor-widget-wrap > .elementor-empty-view > .elementor-first-add'; |
| 15119 |
} else { |
| 15120 |
itemsClasses = ' > .elementor-widget-wrap > .elementor-element, >.elementor-widget-wrap > .elementor-empty-view > .elementor-first-add'; |
| 15121 |
} |
| 15122 |
|
| 15123 |
BaseElementView.prototype.onRender.apply(this, arguments); |
| 15124 |
this.changeChildContainerClasses(); |
| 15125 |
this.changeSizeUI(); |
| 15126 |
this.$el.html5Droppable({ |
| 15127 |
items: itemsClasses, |
| 15128 |
axis: ['vertical'], |
| 15129 |
groups: ['elementor-element'], |
| 15130 |
isDroppingAllowed: this.isDroppingAllowed.bind(this), |
| 15131 |
currentElementClass: 'elementor-html5dnd-current-element', |
| 15132 |
placeholderClass: 'elementor-sortable-placeholder elementor-widget-placeholder', |
| 15133 |
hasDraggingOnChildClass: 'elementor-dragging-on-child', |
| 15134 |
onDropping: function onDropping(side, event) { |
| 15135 |
event.stopPropagation(); // Triggering drag end manually, since it won't fired above iframe |
| 15136 |
|
| 15137 |
elementor.getPreviewView().onPanelElementDragEnd(); |
| 15138 |
var newIndex = jQuery(event.currentTarget).index(); // Since 3.0.0, the `.elementor-background-overlay` element sit at the same level as widgets |
| 15139 |
|
| 15140 |
if ('bottom' === side && isLegacyMode) { |
| 15141 |
newIndex++; |
| 15142 |
} else if ('top' === side && !isLegacyMode) { |
| 15143 |
newIndex--; |
| 15144 |
} |
| 15145 |
|
| 15146 |
_this.addElementFromPanel({ |
| 15147 |
at: newIndex |
| 15148 |
}); |
| 15149 |
} |
| 15150 |
}); |
| 15151 |
}, |
| 15152 |
onAddButtonClick: function onAddButtonClick(event) { |
| 15153 |
event.stopPropagation(); |
| 15154 |
this.addNewColumn(); |
| 15155 |
} |
| 15156 |
}); |
| 15157 |
module.exports = ColumnView; |
| 15158 |
|
| 15159 |
/***/ }), |
| 15160 |
/* 375 */ |
| 15161 |
/***/ (function(module, exports, __webpack_require__) { |
| 15162 |
|
| 15163 |
"use strict"; |
| 15164 |
|
| 15165 |
|
| 15166 |
var _interopRequireDefault = __webpack_require__(0); |
| 15167 |
|
| 15168 |
var _helper = _interopRequireDefault(__webpack_require__(215)); |
| 15169 |
|
| 15170 |
module.exports = Marionette.ItemView.extend({ |
| 15171 |
template: '#tmpl-elementor-empty-preview', |
| 15172 |
className: 'elementor-empty-view', |
| 15173 |
events: { |
| 15174 |
click: 'onClickAdd' |
| 15175 |
}, |
| 15176 |
behaviors: function behaviors() { |
| 15177 |
return { |
| 15178 |
contextMenu: { |
| 15179 |
behaviorClass: __webpack_require__(273), |
| 15180 |
groups: this.getContextMenuGroups() |
| 15181 |
} |
| 15182 |
}; |
| 15183 |
}, |
| 15184 |
getContextMenuGroups: function getContextMenuGroups() { |
| 15185 |
var _this = this; |
| 15186 |
|
| 15187 |
return [{ |
| 15188 |
name: 'general', |
| 15189 |
actions: [{ |
| 15190 |
name: 'paste', |
| 15191 |
title: elementor.translate('paste'), |
| 15192 |
isEnabled: function isEnabled() { |
| 15193 |
return _helper.default.isPasteEnabled(_this._parent.getContainer()); |
| 15194 |
}, |
| 15195 |
callback: function callback() { |
| 15196 |
return $e.run('document/ui/paste', { |
| 15197 |
container: _this._parent.getContainer() |
| 15198 |
}); |
| 15199 |
} |
| 15200 |
}] |
| 15201 |
}]; |
| 15202 |
}, |
| 15203 |
onClickAdd: function onClickAdd() { |
| 15204 |
$e.route('panel/elements/categories'); |
| 15205 |
} |
| 15206 |
}); |
| 15207 |
|
| 15208 |
/***/ }), |
| 15209 |
/* 376 */ |
| 15210 |
/***/ (function(module, exports, __webpack_require__) { |
| 15211 |
|
| 15212 |
"use strict"; |
| 15213 |
|
| 15214 |
|
| 15215 |
var ResizableBehavior; |
| 15216 |
ResizableBehavior = Marionette.Behavior.extend({ |
| 15217 |
defaults: { |
| 15218 |
handles: elementorCommon.config.isRTL ? 'w' : 'e' |
| 15219 |
}, |
| 15220 |
events: { |
| 15221 |
resizestart: 'onResizeStart', |
| 15222 |
resizestop: 'onResizeStop', |
| 15223 |
resize: 'onResize' |
| 15224 |
}, |
| 15225 |
initialize: function initialize() { |
| 15226 |
Marionette.Behavior.prototype.initialize.apply(this, arguments); |
| 15227 |
this.listenTo(elementor.channels.dataEditMode, 'switch', this.onEditModeSwitched); |
| 15228 |
}, |
| 15229 |
active: function active() { |
| 15230 |
if (!elementor.userCan('design')) { |
| 15231 |
return; |
| 15232 |
} |
| 15233 |
|
| 15234 |
this.deactivate(); |
| 15235 |
|
| 15236 |
var options = _.clone(this.options); |
| 15237 |
|
| 15238 |
delete options.behaviorClass; |
| 15239 |
|
| 15240 |
var $childViewContainer = this.getChildViewContainer(), |
| 15241 |
defaultResizableOptions = {}, |
| 15242 |
resizableOptions = _.extend(defaultResizableOptions, options); |
| 15243 |
|
| 15244 |
$childViewContainer.resizable(resizableOptions); |
| 15245 |
}, |
| 15246 |
deactivate: function deactivate() { |
| 15247 |
if (this.getChildViewContainer().resizable('instance')) { |
| 15248 |
this.getChildViewContainer().resizable('destroy'); |
| 15249 |
} |
| 15250 |
}, |
| 15251 |
onEditModeSwitched: function onEditModeSwitched(activeMode) { |
| 15252 |
if ('edit' === activeMode) { |
| 15253 |
this.active(); |
| 15254 |
} else { |
| 15255 |
this.deactivate(); |
| 15256 |
} |
| 15257 |
}, |
| 15258 |
onRender: function onRender() { |
| 15259 |
var self = this; |
| 15260 |
|
| 15261 |
_.defer(function () { |
| 15262 |
self.onEditModeSwitched(elementor.channels.dataEditMode.request('activeMode')); |
| 15263 |
}); |
| 15264 |
}, |
| 15265 |
onDestroy: function onDestroy() { |
| 15266 |
this.deactivate(); |
| 15267 |
}, |
| 15268 |
onResizeStart: function onResizeStart(event) { |
| 15269 |
event.stopPropagation(); |
| 15270 |
this.view.$el.data('originalWidth', this.view.el.getBoundingClientRect().width); |
| 15271 |
this.view.triggerMethod('request:resize:start', event); |
| 15272 |
}, |
| 15273 |
onResizeStop: function onResizeStop(event) { |
| 15274 |
event.stopPropagation(); |
| 15275 |
this.view.triggerMethod('request:resize:stop'); |
| 15276 |
}, |
| 15277 |
onResize: function onResize(event, ui) { |
| 15278 |
event.stopPropagation(); |
| 15279 |
this.view.triggerMethod('request:resize', ui, event); |
| 15280 |
}, |
| 15281 |
getChildViewContainer: function getChildViewContainer() { |
| 15282 |
return this.$el; |
| 15283 |
} |
| 15284 |
}); |
| 15285 |
module.exports = ResizableBehavior; |
| 15286 |
|
| 15287 |
/***/ }), |
| 15288 |
/* 377 */ |
| 15289 |
/***/ (function(module, exports, __webpack_require__) { |
| 15290 |
|
| 15291 |
"use strict"; |
| 15292 |
|
| 15293 |
|
| 15294 |
var ControlBaseDataView = __webpack_require__(127), |
| 15295 |
ControlChooseItemView; |
| 15296 |
|
| 15297 |
ControlChooseItemView = ControlBaseDataView.extend({ |
| 15298 |
ui: function ui() { |
| 15299 |
var ui = ControlBaseDataView.prototype.ui.apply(this, arguments); |
| 15300 |
ui.inputs = '[type="radio"]'; |
| 15301 |
return ui; |
| 15302 |
}, |
| 15303 |
events: function events() { |
| 15304 |
return _.extend(ControlBaseDataView.prototype.events.apply(this, arguments), { |
| 15305 |
'mousedown label': 'onMouseDownLabel', |
| 15306 |
'click @ui.inputs': 'onClickInput', |
| 15307 |
'change @ui.inputs': 'onBaseInputChange' |
| 15308 |
}); |
| 15309 |
}, |
| 15310 |
applySavedValue: function applySavedValue() { |
| 15311 |
var currentValue = this.getControlValue(); |
| 15312 |
|
| 15313 |
if (currentValue) { |
| 15314 |
this.ui.inputs.filter('[value="' + currentValue + '"]').prop('checked', true); |
| 15315 |
} else { |
| 15316 |
this.ui.inputs.filter(':checked').prop('checked', false); |
| 15317 |
} |
| 15318 |
}, |
| 15319 |
onMouseDownLabel: function onMouseDownLabel(event) { |
| 15320 |
var $clickedLabel = this.$(event.currentTarget), |
| 15321 |
$selectedInput = this.$('#' + $clickedLabel.attr('for')); |
| 15322 |
$selectedInput.data('checked', $selectedInput.prop('checked')); |
| 15323 |
}, |
| 15324 |
onClickInput: function onClickInput(event) { |
| 15325 |
if (!this.model.get('toggle')) { |
| 15326 |
return; |
| 15327 |
} |
| 15328 |
|
| 15329 |
var $selectedInput = this.$(event.currentTarget); |
| 15330 |
|
| 15331 |
if ($selectedInput.data('checked')) { |
| 15332 |
$selectedInput.prop('checked', false).trigger('change'); |
| 15333 |
} |
| 15334 |
} |
| 15335 |
}, { |
| 15336 |
onPasteStyle: function onPasteStyle(control, clipboardValue) { |
| 15337 |
return '' === clipboardValue || undefined !== control.options[clipboardValue]; |
| 15338 |
} |
| 15339 |
}); |
| 15340 |
module.exports = ControlChooseItemView; |
| 15341 |
|
| 15342 |
/***/ }), |
| 15343 |
/* 378 */ |
| 15344 |
/***/ (function(module, exports, __webpack_require__) { |
| 15345 |
|
| 15346 |
"use strict"; |
| 15347 |
|
| 15348 |
|
| 15349 |
var InsertTemplateHandler; |
| 15350 |
InsertTemplateHandler = Marionette.Behavior.extend({ |
| 15351 |
ui: { |
| 15352 |
insertButton: '.elementor-template-library-template-insert' |
| 15353 |
}, |
| 15354 |
events: { |
| 15355 |
'click @ui.insertButton': 'onInsertButtonClick' |
| 15356 |
}, |
| 15357 |
onInsertButtonClick: function onInsertButtonClick() { |
| 15358 |
var args = { |
| 15359 |
model: this.view.model |
| 15360 |
}; |
| 15361 |
|
| 15362 |
if ('remote' === args.model.get('source') && !elementor.config.library_connect.is_connected) { |
| 15363 |
$e.route('library/connect', args); |
| 15364 |
return; |
| 15365 |
} |
| 15366 |
|
| 15367 |
$e.run('library/insert-template', args); |
| 15368 |
} |
| 15369 |
}); |
| 15370 |
module.exports = InsertTemplateHandler; |
| 15371 |
|
| 15372 |
/***/ }), |
| 15373 |
/* 379 */ |
| 15374 |
/***/ (function(module, exports, __webpack_require__) { |
| 15375 |
|
| 15376 |
"use strict"; |
| 15377 |
|
| 15378 |
|
| 15379 |
var TemplateLibraryInsertTemplateBehavior = __webpack_require__(378), |
| 15380 |
TemplateLibraryTemplateView; |
| 15381 |
|
| 15382 |
TemplateLibraryTemplateView = Marionette.ItemView.extend({ |
| 15383 |
className: function className() { |
| 15384 |
var classes = 'elementor-template-library-template', |
| 15385 |
source = this.model.get('source'); |
| 15386 |
classes += ' elementor-template-library-template-' + source; |
| 15387 |
|
| 15388 |
if ('remote' === source) { |
| 15389 |
classes += ' elementor-template-library-template-' + this.model.get('type'); |
| 15390 |
} |
| 15391 |
|
| 15392 |
if (this.model.get('isPro')) { |
| 15393 |
classes += ' elementor-template-library-pro-template'; |
| 15394 |
} |
| 15395 |
|
| 15396 |
return classes; |
| 15397 |
}, |
| 15398 |
ui: function ui() { |
| 15399 |
return { |
| 15400 |
previewButton: '.elementor-template-library-template-preview' |
| 15401 |
}; |
| 15402 |
}, |
| 15403 |
events: function events() { |
| 15404 |
return { |
| 15405 |
'click @ui.previewButton': 'onPreviewButtonClick' |
| 15406 |
}; |
| 15407 |
}, |
| 15408 |
behaviors: { |
| 15409 |
insertTemplate: { |
| 15410 |
behaviorClass: TemplateLibraryInsertTemplateBehavior |
| 15411 |
} |
| 15412 |
} |
| 15413 |
}); |
| 15414 |
module.exports = TemplateLibraryTemplateView; |
| 15415 |
|
| 15416 |
/***/ }), |
| 15417 |
/* 380 */ |
| 15418 |
/***/ (function(module, exports, __webpack_require__) { |
| 15419 |
|
| 15420 |
"use strict"; |
| 15421 |
|
| 15422 |
|
| 15423 |
var _interopRequireDefault = __webpack_require__(0); |
| 15424 |
|
| 15425 |
__webpack_require__(25); |
| 15426 |
|
| 15427 |
var _colorPicker = _interopRequireDefault(__webpack_require__(301)); |
| 15428 |
|
| 15429 |
var ControlMultipleBaseItemView = __webpack_require__(237), |
| 15430 |
ControlBoxShadowItemView; |
| 15431 |
|
| 15432 |
ControlBoxShadowItemView = ControlMultipleBaseItemView.extend({ |
| 15433 |
ui: function ui() { |
| 15434 |
var ui = ControlMultipleBaseItemView.prototype.ui.apply(this, arguments); |
| 15435 |
ui.sliders = '.elementor-slider'; |
| 15436 |
ui.colorPickerPlaceholder = '.elementor-color-picker-placeholder'; |
| 15437 |
return ui; |
| 15438 |
}, |
| 15439 |
initSliders: function initSliders() { |
| 15440 |
var _this = this; |
| 15441 |
|
| 15442 |
var value = this.getControlValue(); |
| 15443 |
this.ui.sliders.each(function (index, slider) { |
| 15444 |
var $input = jQuery(slider).next('.elementor-slider-input').find('input'); |
| 15445 |
var sliderInstance = noUiSlider.create(slider, { |
| 15446 |
start: [value[slider.dataset.input]], |
| 15447 |
step: 1, |
| 15448 |
range: { |
| 15449 |
min: +$input.attr('min'), |
| 15450 |
max: +$input.attr('max') |
| 15451 |
}, |
| 15452 |
format: { |
| 15453 |
to: function to(sliderValue) { |
| 15454 |
return +sliderValue.toFixed(1); |
| 15455 |
}, |
| 15456 |
from: function from(sliderValue) { |
| 15457 |
return +sliderValue; |
| 15458 |
} |
| 15459 |
} |
| 15460 |
}); |
| 15461 |
sliderInstance.on('slide', function (values) { |
| 15462 |
var type = sliderInstance.target.dataset.input; |
| 15463 |
$input.val(values[0]); |
| 15464 |
|
| 15465 |
_this.setValue(type, values[0]); |
| 15466 |
}); |
| 15467 |
}); |
| 15468 |
}, |
| 15469 |
initColors: function initColors() { |
| 15470 |
var _this2 = this; |
| 15471 |
|
| 15472 |
this.colorPicker = new _colorPicker.default({ |
| 15473 |
picker: { |
| 15474 |
el: this.ui.colorPickerPlaceholder[0], |
| 15475 |
default: this.getControlValue('color') |
| 15476 |
}, |
| 15477 |
onChange: function onChange() { |
| 15478 |
_this2.setValue('color', _this2.colorPicker.getColor()); |
| 15479 |
}, |
| 15480 |
onClear: function onClear() { |
| 15481 |
_this2.setValue('color', ''); |
| 15482 |
} |
| 15483 |
}); |
| 15484 |
}, |
| 15485 |
onInputChange: function onInputChange(event) { |
| 15486 |
var type = event.currentTarget.dataset.setting, |
| 15487 |
$slider = this.ui.sliders.filter('[data-input="' + type + '"]'); |
| 15488 |
$slider[0].noUiSlider.set(this.getControlValue(type)); |
| 15489 |
}, |
| 15490 |
onReady: function onReady() { |
| 15491 |
this.initSliders(); |
| 15492 |
this.initColors(); |
| 15493 |
}, |
| 15494 |
onBeforeDestroy: function onBeforeDestroy() { |
| 15495 |
this.colorPicker.destroy(); |
| 15496 |
} |
| 15497 |
}); |
| 15498 |
module.exports = ControlBoxShadowItemView; |
| 15499 |
|
| 15500 |
/***/ }), |
| 15501 |
/* 381 */ |
| 15502 |
/***/ (function(module, exports, __webpack_require__) { |
| 15503 |
|
| 15504 |
"use strict"; |
| 15505 |
|
| 15506 |
|
| 15507 |
var ControlBaseMultipleItemView = __webpack_require__(237), |
| 15508 |
ControlBaseUnitsItemView; |
| 15509 |
|
| 15510 |
ControlBaseUnitsItemView = ControlBaseMultipleItemView.extend({ |
| 15511 |
getCurrentRange: function getCurrentRange() { |
| 15512 |
return this.getUnitRange(this.getControlValue('unit')); |
| 15513 |
}, |
| 15514 |
getUnitRange: function getUnitRange(unit) { |
| 15515 |
var ranges = this.model.get('range'); |
| 15516 |
|
| 15517 |
if (!ranges || !ranges[unit]) { |
| 15518 |
return false; |
| 15519 |
} |
| 15520 |
|
| 15521 |
return ranges[unit]; |
| 15522 |
} |
| 15523 |
}); |
| 15524 |
module.exports = ControlBaseUnitsItemView; |
| 15525 |
|
| 15526 |
/***/ }), |
| 15527 |
/* 382 */ |
| 15528 |
/***/ (function(module, exports, __webpack_require__) { |
| 15529 |
|
| 15530 |
"use strict"; |
| 15531 |
|
| 15532 |
|
| 15533 |
var _interopRequireDefault = __webpack_require__(0); |
| 15534 |
|
| 15535 |
var _Object$defineProperty = __webpack_require__(1); |
| 15536 |
|
| 15537 |
_Object$defineProperty(exports, "__esModule", { |
| 15538 |
value: true |
| 15539 |
}); |
| 15540 |
|
| 15541 |
exports.default = void 0; |
| 15542 |
|
| 15543 |
__webpack_require__(135); |
| 15544 |
|
| 15545 |
var _classCallCheck2 = _interopRequireDefault(__webpack_require__(2)); |
| 15546 |
|
| 15547 |
var _createClass2 = _interopRequireDefault(__webpack_require__(3)); |
| 15548 |
|
| 15549 |
var FilesUploadHandler = /*#__PURE__*/function () { |
| 15550 |
function FilesUploadHandler() { |
| 15551 |
(0, _classCallCheck2.default)(this, FilesUploadHandler); |
| 15552 |
} |
| 15553 |
|
| 15554 |
(0, _createClass2.default)(FilesUploadHandler, null, [{ |
| 15555 |
key: "isUploadEnabled", |
| 15556 |
value: function isUploadEnabled(mediaType) { |
| 15557 |
var unfilteredFilesTypes = ['svg', 'application/json']; |
| 15558 |
|
| 15559 |
if (!unfilteredFilesTypes.includes(mediaType)) { |
| 15560 |
return true; |
| 15561 |
} |
| 15562 |
|
| 15563 |
return elementor.config.filesUpload.unfilteredFiles; |
| 15564 |
} |
| 15565 |
}, { |
| 15566 |
key: "setUploadTypeCaller", |
| 15567 |
value: function setUploadTypeCaller(frame) { |
| 15568 |
frame.uploader.uploader.param('uploadTypeCaller', 'elementor-editor-upload'); |
| 15569 |
} |
| 15570 |
}, { |
| 15571 |
key: "getUnfilteredFilesNotEnabledDialog", |
| 15572 |
value: function getUnfilteredFilesNotEnabledDialog(callback) { |
| 15573 |
var onConfirm = function onConfirm() { |
| 15574 |
elementorCommon.ajax.addRequest('enable_unfiltered_files_upload', {}, true); |
| 15575 |
elementor.config.filesUpload.unfilteredFiles = true; |
| 15576 |
callback(); |
| 15577 |
}; |
| 15578 |
|
| 15579 |
return elementor.helpers.getSimpleDialog('e-enable-unfiltered-files-dialog', elementor.translate('enable_unfiltered_files_upload'), elementor.translate('dialog_confirm_enable_unfiltered_files_upload'), elementor.translate('enable'), onConfirm); |
| 15580 |
} |
| 15581 |
}]); |
| 15582 |
return FilesUploadHandler; |
| 15583 |
}(); |
| 15584 |
|
| 15585 |
exports.default = FilesUploadHandler; |
| 15586 |
|
| 15587 |
/***/ }), |
| 15588 |
/* 383 */ |
| 15589 |
/***/ (function(module, exports, __webpack_require__) { |
| 15590 |
|
| 15591 |
"use strict"; |
| 15592 |
|
| 15593 |
|
| 15594 |
var _interopRequireDefault = __webpack_require__(0); |
| 15595 |
|
| 15596 |
__webpack_require__(80); |
| 15597 |
|
| 15598 |
var _typeof2 = _interopRequireDefault(__webpack_require__(48)); |
| 15599 |
|
| 15600 |
var ColumnSettingsModel = __webpack_require__(583), |
| 15601 |
ElementModel; |
| 15602 |
|
| 15603 |
ElementModel = Backbone.Model.extend({ |
| 15604 |
defaults: { |
| 15605 |
id: '', |
| 15606 |
elType: '', |
| 15607 |
isInner: false, |
| 15608 |
settings: {}, |
| 15609 |
defaultEditSettings: { |
| 15610 |
defaultEditRoute: 'content' |
| 15611 |
} |
| 15612 |
}, |
| 15613 |
remoteRender: false, |
| 15614 |
_htmlCache: null, |
| 15615 |
_jqueryXhr: null, |
| 15616 |
renderOnLeave: false, |
| 15617 |
initialize: function initialize(options) { |
| 15618 |
var elType = this.get('elType'), |
| 15619 |
elements = this.get('elements'); |
| 15620 |
|
| 15621 |
if (undefined !== elements) { |
| 15622 |
var ElementsCollection = __webpack_require__(384); |
| 15623 |
|
| 15624 |
this.set('elements', new ElementsCollection(elements)); |
| 15625 |
} |
| 15626 |
|
| 15627 |
if ('widget' === elType) { |
| 15628 |
this.remoteRender = true; |
| 15629 |
this.setHtmlCache(options.htmlCache || ''); |
| 15630 |
} // No need this variable anymore |
| 15631 |
|
| 15632 |
|
| 15633 |
delete options.htmlCache; // Make call to remote server as throttle function |
| 15634 |
|
| 15635 |
this.renderRemoteServer = _.throttle(this.renderRemoteServer, 1000); |
| 15636 |
this.initSettings(); |
| 15637 |
this.initEditSettings(); |
| 15638 |
this.on({ |
| 15639 |
destroy: this.onDestroy, |
| 15640 |
'editor:close': this.onCloseEditor |
| 15641 |
}); |
| 15642 |
}, |
| 15643 |
initSettings: function initSettings() { |
| 15644 |
var elType = this.get('elType'), |
| 15645 |
settings = this.get('settings'), |
| 15646 |
settingModels = { |
| 15647 |
column: ColumnSettingsModel |
| 15648 |
}, |
| 15649 |
SettingsModel = settingModels[elType] || elementorModules.editor.elements.models.BaseSettings; |
| 15650 |
|
| 15651 |
if (jQuery.isEmptyObject(settings)) { |
| 15652 |
settings = elementorCommon.helpers.cloneObject(settings); |
| 15653 |
} |
| 15654 |
|
| 15655 |
if ('widget' === elType) { |
| 15656 |
settings.widgetType = this.get('widgetType'); |
| 15657 |
} |
| 15658 |
|
| 15659 |
settings.elType = elType; |
| 15660 |
settings.isInner = this.get('isInner'); |
| 15661 |
settings = new SettingsModel(settings, { |
| 15662 |
controls: elementor.getElementControls(this) |
| 15663 |
}); |
| 15664 |
this.set('settings', settings); |
| 15665 |
elementorFrontend.config.elements.data[this.cid] = settings; |
| 15666 |
}, |
| 15667 |
initEditSettings: function initEditSettings() { |
| 15668 |
var editSettings = new Backbone.Model(this.get('defaultEditSettings')); |
| 15669 |
this.set('editSettings', editSettings); |
| 15670 |
elementorFrontend.config.elements.editSettings[this.cid] = editSettings; |
| 15671 |
}, |
| 15672 |
setSetting: function setSetting(key, value) { |
| 15673 |
var settings = this.get('settings'); |
| 15674 |
|
| 15675 |
if ('object' !== (0, _typeof2.default)(key)) { |
| 15676 |
var keyParts = key.split('.'), |
| 15677 |
isRepeaterKey = 3 === keyParts.length; |
| 15678 |
key = keyParts[0]; |
| 15679 |
|
| 15680 |
if (isRepeaterKey) { |
| 15681 |
settings = settings.get(key).models[keyParts[1]]; |
| 15682 |
key = keyParts[2]; |
| 15683 |
} |
| 15684 |
} |
| 15685 |
|
| 15686 |
settings.setExternalChange(key, value); |
| 15687 |
}, |
| 15688 |
getSetting: function getSetting(key) { |
| 15689 |
var keyParts = key.split('.'), |
| 15690 |
isRepeaterKey = 3 === keyParts.length, |
| 15691 |
settings = this.get('settings'); |
| 15692 |
key = keyParts[0]; |
| 15693 |
var value = settings.get(key); |
| 15694 |
|
| 15695 |
if (undefined === value) { |
| 15696 |
return ''; |
| 15697 |
} |
| 15698 |
|
| 15699 |
if (isRepeaterKey) { |
| 15700 |
value = value.models[keyParts[1]].get(keyParts[2]); |
| 15701 |
} |
| 15702 |
|
| 15703 |
return value; |
| 15704 |
}, |
| 15705 |
setHtmlCache: function setHtmlCache(htmlCache) { |
| 15706 |
this._htmlCache = htmlCache; |
| 15707 |
}, |
| 15708 |
getHtmlCache: function getHtmlCache() { |
| 15709 |
return this._htmlCache; |
| 15710 |
}, |
| 15711 |
getDefaultTitle: function getDefaultTitle() { |
| 15712 |
return elementor.getElementData(this).title; |
| 15713 |
}, |
| 15714 |
getTitle: function getTitle() { |
| 15715 |
var title = this.getSetting('_title'); |
| 15716 |
|
| 15717 |
if (!title) { |
| 15718 |
title = this.getDefaultTitle(); |
| 15719 |
} |
| 15720 |
|
| 15721 |
return title; |
| 15722 |
}, |
| 15723 |
getIcon: function getIcon() { |
| 15724 |
return elementor.getElementData(this).icon; |
| 15725 |
}, |
| 15726 |
createRemoteRenderRequest: function createRemoteRenderRequest() { |
| 15727 |
var data = this.toJSON(); |
| 15728 |
return elementorCommon.ajax.addRequest('render_widget', { |
| 15729 |
unique_id: this.cid, |
| 15730 |
data: { |
| 15731 |
data: data |
| 15732 |
}, |
| 15733 |
success: this.onRemoteGetHtml.bind(this) |
| 15734 |
}, true).jqXhr; |
| 15735 |
}, |
| 15736 |
renderRemoteServer: function renderRemoteServer() { |
| 15737 |
if (!this.remoteRender) { |
| 15738 |
return; |
| 15739 |
} |
| 15740 |
|
| 15741 |
this.renderOnLeave = false; |
| 15742 |
this.trigger('before:remote:render'); |
| 15743 |
|
| 15744 |
if (this.isRemoteRequestActive()) { |
| 15745 |
this._jqueryXhr.abort(); |
| 15746 |
} |
| 15747 |
|
| 15748 |
this._jqueryXhr = this.createRemoteRenderRequest(); |
| 15749 |
}, |
| 15750 |
isRemoteRequestActive: function isRemoteRequestActive() { |
| 15751 |
return this._jqueryXhr && 4 !== this._jqueryXhr.readyState; |
| 15752 |
}, |
| 15753 |
onRemoteGetHtml: function onRemoteGetHtml(data) { |
| 15754 |
this.setHtmlCache(data.render); |
| 15755 |
this.trigger('remote:render'); |
| 15756 |
}, |
| 15757 |
clone: function clone() { |
| 15758 |
var newModel = new this.constructor(elementorCommon.helpers.cloneObject(this.attributes)); |
| 15759 |
newModel.set('id', elementorCommon.helpers.getUniqueId()); |
| 15760 |
newModel.setHtmlCache(this.getHtmlCache()); |
| 15761 |
var elements = this.get('elements'); |
| 15762 |
|
| 15763 |
if (!_.isEmpty(elements)) { |
| 15764 |
newModel.set('elements', elements.clone()); |
| 15765 |
} |
| 15766 |
|
| 15767 |
return newModel; |
| 15768 |
}, |
| 15769 |
toJSON: function toJSON(options) { |
| 15770 |
options = options || {}; // Call parent's toJSON method |
| 15771 |
|
| 15772 |
var data = Backbone.Model.prototype.toJSON.call(this); |
| 15773 |
|
| 15774 |
_.each(data, function (attribute, key) { |
| 15775 |
if (attribute && attribute.toJSON) { |
| 15776 |
data[key] = attribute.toJSON(options); |
| 15777 |
} |
| 15778 |
}); |
| 15779 |
|
| 15780 |
if (options.copyHtmlCache) { |
| 15781 |
data.htmlCache = this.getHtmlCache(); |
| 15782 |
} else { |
| 15783 |
delete data.htmlCache; |
| 15784 |
} |
| 15785 |
|
| 15786 |
if (options.remove) { |
| 15787 |
options.remove.forEach(function (key) { |
| 15788 |
return delete data[key]; |
| 15789 |
}); |
| 15790 |
} |
| 15791 |
|
| 15792 |
return data; |
| 15793 |
}, |
| 15794 |
onCloseEditor: function onCloseEditor() { |
| 15795 |
if (this.renderOnLeave) { |
| 15796 |
this.renderRemoteServer(); |
| 15797 |
} |
| 15798 |
}, |
| 15799 |
onDestroy: function onDestroy() { |
| 15800 |
// Clean the memory for all use instances |
| 15801 |
var settings = this.get('settings'), |
| 15802 |
elements = this.get('elements'); |
| 15803 |
|
| 15804 |
if (undefined !== elements) { |
| 15805 |
_.each(_.clone(elements.models), function (model) { |
| 15806 |
model.destroy(); |
| 15807 |
}); |
| 15808 |
} |
| 15809 |
|
| 15810 |
settings.destroy(); |
| 15811 |
} |
| 15812 |
}); |
| 15813 |
ElementModel.prototype.sync = ElementModel.prototype.fetch = ElementModel.prototype.save = _.noop; |
| 15814 |
module.exports = ElementModel; |
| 15815 |
|
| 15816 |
/***/ }), |
| 15817 |
/* 384 */ |
| 15818 |
/***/ (function(module, exports, __webpack_require__) { |
| 15819 |
|
| 15820 |
"use strict"; |
| 15821 |
|
| 15822 |
|
| 15823 |
var ElementModel = __webpack_require__(383); |
| 15824 |
|
| 15825 |
var ElementsCollection = Backbone.Collection.extend({ |
| 15826 |
add: function add(models, options, isCorrectSet) { |
| 15827 |
if ((!options || !options.silent) && !isCorrectSet) { |
| 15828 |
throw 'Call Error: Adding model to element collection is allowed only by the dedicated addChildModel() method.'; |
| 15829 |
} |
| 15830 |
|
| 15831 |
return Backbone.Collection.prototype.add.call(this, models, options); |
| 15832 |
}, |
| 15833 |
model: function model(attrs, options) { |
| 15834 |
var ModelClass = Backbone.Model; |
| 15835 |
|
| 15836 |
if (attrs.elType) { |
| 15837 |
ModelClass = elementor.hooks.applyFilters('element/model', ElementModel, attrs); |
| 15838 |
} |
| 15839 |
|
| 15840 |
return new ModelClass(attrs, options); |
| 15841 |
}, |
| 15842 |
clone: function clone() { |
| 15843 |
var tempCollection = Backbone.Collection.prototype.clone.apply(this, arguments), |
| 15844 |
newCollection = new ElementsCollection(); |
| 15845 |
tempCollection.forEach(function (model) { |
| 15846 |
newCollection.add(model.clone(), null, true); |
| 15847 |
}); |
| 15848 |
return newCollection; |
| 15849 |
} |
| 15850 |
}); |
| 15851 |
ElementsCollection.prototype.sync = ElementsCollection.prototype.fetch = ElementsCollection.prototype.save = _.noop; |
| 15852 |
module.exports = ElementsCollection; |
| 15853 |
|
| 15854 |
/***/ }), |
| 15855 |
/* 385 */ |
| 15856 |
/***/ (function(module, exports, __webpack_require__) { |
| 15857 |
|
| 15858 |
"use strict"; |
| 15859 |
|
| 15860 |
|
| 15861 |
__webpack_require__(334); |
| 15862 |
|
| 15863 |
module.exports = Marionette.ItemView.extend({ |
| 15864 |
template: '#tmpl-elementor-panel-global', |
| 15865 |
id: 'elementor-panel-global', |
| 15866 |
initialize: function initialize() { |
| 15867 |
elementor.getPanelView().getCurrentPageView().search.reset(); |
| 15868 |
} |
| 15869 |
}); |
| 15870 |
|
| 15871 |
/***/ }), |
| 15872 |
/* 386 */ |
| 15873 |
/***/ (function(module, exports) { |
| 15874 |
|
| 15875 |
// 7.2.9 SameValue(x, y) |
| 15876 |
module.exports = Object.is || function is(x, y) { |
| 15877 |
// eslint-disable-next-line no-self-compare |
| 15878 |
return x === y ? x !== 0 || 1 / x === 1 / y : x != x && y != y; |
| 15879 |
}; |
| 15880 |
|
| 15881 |
|
| 15882 |
/***/ }), |
| 15883 |
/* 387 */ |
| 15884 |
/***/ (function(module, exports, __webpack_require__) { |
| 15885 |
|
| 15886 |
"use strict"; |
| 15887 |
|
| 15888 |
|
| 15889 |
__webpack_require__(58); |
| 15890 |
|
| 15891 |
module.exports = Marionette.ItemView.extend({ |
| 15892 |
template: '#tmpl-elementor-element-library-element', |
| 15893 |
className: function className() { |
| 15894 |
var className = 'elementor-element-wrapper'; |
| 15895 |
|
| 15896 |
if (!this.isEditable()) { |
| 15897 |
className += ' elementor-element--promotion'; |
| 15898 |
} |
| 15899 |
|
| 15900 |
return className; |
| 15901 |
}, |
| 15902 |
events: function events() { |
| 15903 |
var events = {}; |
| 15904 |
|
| 15905 |
if (!this.isEditable()) { |
| 15906 |
events.mousedown = 'onMouseDown'; |
| 15907 |
} |
| 15908 |
|
| 15909 |
return events; |
| 15910 |
}, |
| 15911 |
ui: { |
| 15912 |
element: '.elementor-element' |
| 15913 |
}, |
| 15914 |
isEditable: function isEditable() { |
| 15915 |
return false !== this.model.get('editable'); |
| 15916 |
}, |
| 15917 |
onRender: function onRender() { |
| 15918 |
var _this = this; |
| 15919 |
|
| 15920 |
if (!elementor.userCan('design') || !this.isEditable()) { |
| 15921 |
return; |
| 15922 |
} |
| 15923 |
|
| 15924 |
this.ui.element.html5Draggable({ |
| 15925 |
onDragStart: function onDragStart() { |
| 15926 |
elementor.channels.panelElements.reply('element:selected', _this).trigger('element:drag:start'); |
| 15927 |
}, |
| 15928 |
onDragEnd: function onDragEnd() { |
| 15929 |
elementor.channels.panelElements.trigger('element:drag:end'); |
| 15930 |
}, |
| 15931 |
groups: ['elementor-element'] |
| 15932 |
}); |
| 15933 |
}, |
| 15934 |
onMouseDown: function onMouseDown() { |
| 15935 |
elementor.promotion.showDialog({ |
| 15936 |
headerMessage: elementor.translate('element_promotion_dialog_header', [this.model.get('title')]), |
| 15937 |
message: elementor.translate('element_promotion_dialog_message', [this.model.get('title')]), |
| 15938 |
top: '-7', |
| 15939 |
element: this.el, |
| 15940 |
actionURL: elementor.config.elementPromotionURL.replace('%s', this.model.get('name')) |
| 15941 |
}); |
| 15942 |
} |
| 15943 |
}); |
| 15944 |
|
| 15945 |
/***/ }), |
| 15946 |
/* 388 */ |
| 15947 |
/***/ (function(module, exports, __webpack_require__) { |
| 15948 |
|
| 15949 |
"use strict"; |
| 15950 |
|
| 15951 |
/** |
| 15952 |
* Handles managing all events for whatever you plug it into. Priorities for hooks are based on lowest to highest in |
| 15953 |
* that, lowest priority hooks are fired first. |
| 15954 |
*/ |
| 15955 |
|
| 15956 |
var _interopRequireDefault = __webpack_require__(0); |
| 15957 |
|
| 15958 |
var _parseInt2 = _interopRequireDefault(__webpack_require__(213)); |
| 15959 |
|
| 15960 |
var EventManager = function EventManager() { |
| 15961 |
var slice = Array.prototype.slice, |
| 15962 |
MethodsAvailable; |
| 15963 |
/** |
| 15964 |
* Contains the hooks that get registered with this EventManager. The array for storage utilizes a "flat" |
| 15965 |
* object literal such that looking up the hook utilizes the native object literal hash. |
| 15966 |
*/ |
| 15967 |
|
| 15968 |
var STORAGE = { |
| 15969 |
actions: {}, |
| 15970 |
filters: {} |
| 15971 |
}; |
| 15972 |
/** |
| 15973 |
* Removes the specified hook by resetting the value of it. |
| 15974 |
* |
| 15975 |
* @param type Type of hook, either 'actions' or 'filters' |
| 15976 |
* @param hook The hook (namespace.identifier) to remove |
| 15977 |
* |
| 15978 |
* @private |
| 15979 |
*/ |
| 15980 |
|
| 15981 |
function _removeHook(type, hook, callback, context) { |
| 15982 |
var handlers, handler, i; |
| 15983 |
|
| 15984 |
if (!STORAGE[type][hook]) { |
| 15985 |
return; |
| 15986 |
} |
| 15987 |
|
| 15988 |
if (!callback) { |
| 15989 |
STORAGE[type][hook] = []; |
| 15990 |
} else { |
| 15991 |
handlers = STORAGE[type][hook]; |
| 15992 |
|
| 15993 |
if (!context) { |
| 15994 |
for (i = handlers.length; i--;) { |
| 15995 |
if (handlers[i].callback === callback) { |
| 15996 |
handlers.splice(i, 1); |
| 15997 |
} |
| 15998 |
} |
| 15999 |
} else { |
| 16000 |
for (i = handlers.length; i--;) { |
| 16001 |
handler = handlers[i]; |
| 16002 |
|
| 16003 |
if (handler.callback === callback && handler.context === context) { |
| 16004 |
handlers.splice(i, 1); |
| 16005 |
} |
| 16006 |
} |
| 16007 |
} |
| 16008 |
} |
| 16009 |
} |
| 16010 |
/** |
| 16011 |
* Use an insert sort for keeping our hooks organized based on priority. This function is ridiculously faster |
| 16012 |
* than bubble sort, etc: http://jsperf.com/javascript-sort |
| 16013 |
* |
| 16014 |
* @param hooks The custom array containing all of the appropriate hooks to perform an insert sort on. |
| 16015 |
* @private |
| 16016 |
*/ |
| 16017 |
|
| 16018 |
|
| 16019 |
function _hookInsertSort(hooks) { |
| 16020 |
var tmpHook, j, prevHook; |
| 16021 |
|
| 16022 |
for (var i = 1, len = hooks.length; i < len; i++) { |
| 16023 |
tmpHook = hooks[i]; |
| 16024 |
j = i; |
| 16025 |
|
| 16026 |
while ((prevHook = hooks[j - 1]) && prevHook.priority > tmpHook.priority) { |
| 16027 |
hooks[j] = hooks[j - 1]; |
| 16028 |
--j; |
| 16029 |
} |
| 16030 |
|
| 16031 |
hooks[j] = tmpHook; |
| 16032 |
} |
| 16033 |
|
| 16034 |
return hooks; |
| 16035 |
} |
| 16036 |
/** |
| 16037 |
* Adds the hook to the appropriate storage container |
| 16038 |
* |
| 16039 |
* @param type 'actions' or 'filters' |
| 16040 |
* @param hook The hook (namespace.identifier) to add to our event manager |
| 16041 |
* @param callback The function that will be called when the hook is executed. |
| 16042 |
* @param priority The priority of this hook. Must be an integer. |
| 16043 |
* @param [context] A value to be used for this |
| 16044 |
* @private |
| 16045 |
*/ |
| 16046 |
|
| 16047 |
|
| 16048 |
function _addHook(type, hook, callback, priority, context) { |
| 16049 |
var hookObject = { |
| 16050 |
callback: callback, |
| 16051 |
priority: priority, |
| 16052 |
context: context |
| 16053 |
}; // Utilize 'prop itself' : http://jsperf.com/hasownproperty-vs-in-vs-undefined/19 |
| 16054 |
|
| 16055 |
var hooks = STORAGE[type][hook]; |
| 16056 |
|
| 16057 |
if (hooks) { |
| 16058 |
// TEMP FIX BUG |
| 16059 |
var hasSameCallback = false; |
| 16060 |
jQuery.each(hooks, function () { |
| 16061 |
if (this.callback === callback) { |
| 16062 |
hasSameCallback = true; |
| 16063 |
return false; |
| 16064 |
} |
| 16065 |
}); |
| 16066 |
|
| 16067 |
if (hasSameCallback) { |
| 16068 |
return; |
| 16069 |
} // END TEMP FIX BUG |
| 16070 |
|
| 16071 |
|
| 16072 |
hooks.push(hookObject); |
| 16073 |
hooks = _hookInsertSort(hooks); |
| 16074 |
} else { |
| 16075 |
hooks = [hookObject]; |
| 16076 |
} |
| 16077 |
|
| 16078 |
STORAGE[type][hook] = hooks; |
| 16079 |
} |
| 16080 |
/** |
| 16081 |
* Runs the specified hook. If it is an action, the value is not modified but if it is a filter, it is. |
| 16082 |
* |
| 16083 |
* @param type 'actions' or 'filters' |
| 16084 |
* @param hook The hook ( namespace.identifier ) to be ran. |
| 16085 |
* @param args Arguments to pass to the action/filter. If it's a filter, args is actually a single parameter. |
| 16086 |
* @private |
| 16087 |
*/ |
| 16088 |
|
| 16089 |
|
| 16090 |
function _runHook(type, hook, args) { |
| 16091 |
var handlers = STORAGE[type][hook], |
| 16092 |
i, |
| 16093 |
len; |
| 16094 |
|
| 16095 |
if (!handlers) { |
| 16096 |
return 'filters' === type ? args[0] : false; |
| 16097 |
} |
| 16098 |
|
| 16099 |
len = handlers.length; |
| 16100 |
|
| 16101 |
if ('filters' === type) { |
| 16102 |
for (i = 0; i < len; i++) { |
| 16103 |
args[0] = handlers[i].callback.apply(handlers[i].context, args); |
| 16104 |
} |
| 16105 |
} else { |
| 16106 |
for (i = 0; i < len; i++) { |
| 16107 |
handlers[i].callback.apply(handlers[i].context, args); |
| 16108 |
} |
| 16109 |
} |
| 16110 |
|
| 16111 |
return 'filters' === type ? args[0] : true; |
| 16112 |
} |
| 16113 |
/** |
| 16114 |
* Adds an action to the event manager. |
| 16115 |
* |
| 16116 |
* @param action Must contain namespace.identifier |
| 16117 |
* @param callback Must be a valid callback function before this action is added |
| 16118 |
* @param [priority=10] Used to control when the function is executed in relation to other callbacks bound to the same hook |
| 16119 |
* @param [context] Supply a value to be used for this |
| 16120 |
*/ |
| 16121 |
|
| 16122 |
|
| 16123 |
function addAction(action, callback, priority, context) { |
| 16124 |
if ('string' === typeof action && 'function' === typeof callback) { |
| 16125 |
priority = (0, _parseInt2.default)(priority || 10, 10); |
| 16126 |
|
| 16127 |
_addHook('actions', action, callback, priority, context); |
| 16128 |
} |
| 16129 |
|
| 16130 |
return MethodsAvailable; |
| 16131 |
} |
| 16132 |
/** |
| 16133 |
* Performs an action if it exists. You can pass as many arguments as you want to this function; the only rule is |
| 16134 |
* that the first argument must always be the action. |
| 16135 |
*/ |
| 16136 |
|
| 16137 |
|
| 16138 |
function doAction() |
| 16139 |
/* action, arg1, arg2, ... */ |
| 16140 |
{ |
| 16141 |
var args = slice.call(arguments); |
| 16142 |
var action = args.shift(); |
| 16143 |
|
| 16144 |
if ('string' === typeof action) { |
| 16145 |
_runHook('actions', action, args); |
| 16146 |
} |
| 16147 |
|
| 16148 |
return MethodsAvailable; |
| 16149 |
} |
| 16150 |
/** |
| 16151 |
* Removes the specified action if it contains a namespace.identifier & exists. |
| 16152 |
* |
| 16153 |
* @param action The action to remove |
| 16154 |
* @param [callback] Callback function to remove |
| 16155 |
*/ |
| 16156 |
|
| 16157 |
|
| 16158 |
function removeAction(action, callback) { |
| 16159 |
if ('string' === typeof action) { |
| 16160 |
_removeHook('actions', action, callback); |
| 16161 |
} |
| 16162 |
|
| 16163 |
return MethodsAvailable; |
| 16164 |
} |
| 16165 |
/** |
| 16166 |
* Adds a filter to the event manager. |
| 16167 |
* |
| 16168 |
* @param filter Must contain namespace.identifier |
| 16169 |
* @param callback Must be a valid callback function before this action is added |
| 16170 |
* @param [priority=10] Used to control when the function is executed in relation to other callbacks bound to the same hook |
| 16171 |
* @param [context] Supply a value to be used for this |
| 16172 |
*/ |
| 16173 |
|
| 16174 |
|
| 16175 |
function addFilter(filter, callback, priority, context) { |
| 16176 |
if ('string' === typeof filter && 'function' === typeof callback) { |
| 16177 |
priority = (0, _parseInt2.default)(priority || 10, 10); |
| 16178 |
|
| 16179 |
_addHook('filters', filter, callback, priority, context); |
| 16180 |
} |
| 16181 |
|
| 16182 |
return MethodsAvailable; |
| 16183 |
} |
| 16184 |
/** |
| 16185 |
* Performs a filter if it exists. You should only ever pass 1 argument to be filtered. The only rule is that |
| 16186 |
* the first argument must always be the filter. |
| 16187 |
*/ |
| 16188 |
|
| 16189 |
|
| 16190 |
function applyFilters() |
| 16191 |
/* filter, filtered arg, arg2, ... */ |
| 16192 |
{ |
| 16193 |
var args = slice.call(arguments); |
| 16194 |
var filter = args.shift(); |
| 16195 |
|
| 16196 |
if ('string' === typeof filter) { |
| 16197 |
return _runHook('filters', filter, args); |
| 16198 |
} |
| 16199 |
|
| 16200 |
return MethodsAvailable; |
| 16201 |
} |
| 16202 |
/** |
| 16203 |
* Removes the specified filter if it contains a namespace.identifier & exists. |
| 16204 |
* |
| 16205 |
* @param filter The action to remove |
| 16206 |
* @param [callback] Callback function to remove |
| 16207 |
*/ |
| 16208 |
|
| 16209 |
|
| 16210 |
function removeFilter(filter, callback) { |
| 16211 |
if ('string' === typeof filter) { |
| 16212 |
_removeHook('filters', filter, callback); |
| 16213 |
} |
| 16214 |
|
| 16215 |
return MethodsAvailable; |
| 16216 |
} |
| 16217 |
/** |
| 16218 |
* Maintain a reference to the object scope so our public methods never get confusing. |
| 16219 |
*/ |
| 16220 |
|
| 16221 |
|
| 16222 |
MethodsAvailable = { |
| 16223 |
removeFilter: removeFilter, |
| 16224 |
applyFilters: applyFilters, |
| 16225 |
addFilter: addFilter, |
| 16226 |
removeAction: removeAction, |
| 16227 |
doAction: doAction, |
| 16228 |
addAction: addAction |
| 16229 |
}; // return all of the publicly available methods |
| 16230 |
|
| 16231 |
return MethodsAvailable; |
| 16232 |
}; |
| 16233 |
|
| 16234 |
module.exports = EventManager; |
| 16235 |
|
| 16236 |
/***/ }), |
| 16237 |
/* 389 */ |
| 16238 |
/***/ (function(module, exports, __webpack_require__) { |
| 16239 |
|
| 16240 |
"use strict"; |
| 16241 |
|
| 16242 |
|
| 16243 |
var PanelElementsElementModel; |
| 16244 |
PanelElementsElementModel = Backbone.Model.extend({ |
| 16245 |
defaults: { |
| 16246 |
title: '', |
| 16247 |
categories: [], |
| 16248 |
keywords: [], |
| 16249 |
icon: '', |
| 16250 |
elType: 'widget', |
| 16251 |
widgetType: '' |
| 16252 |
} |
| 16253 |
}); |
| 16254 |
module.exports = PanelElementsElementModel; |
| 16255 |
|
| 16256 |
/***/ }), |
| 16257 |
/* 390 */ |
| 16258 |
/***/ (function(module, exports, __webpack_require__) { |
| 16259 |
|
| 16260 |
"use strict"; |
| 16261 |
|
| 16262 |
|
| 16263 |
var PanelElementsElementModel = __webpack_require__(389), |
| 16264 |
PanelElementsElementsCollection; |
| 16265 |
|
| 16266 |
PanelElementsElementsCollection = Backbone.Collection.extend({ |
| 16267 |
model: PanelElementsElementModel |
| 16268 |
/*, |
| 16269 |
comparator: 'title'*/ |
| 16270 |
|
| 16271 |
}); |
| 16272 |
module.exports = PanelElementsElementsCollection; |
| 16273 |
|
| 16274 |
/***/ }), |
| 16275 |
/* 391 */ |
| 16276 |
/***/ (function(module, exports, __webpack_require__) { |
| 16277 |
|
| 16278 |
"use strict"; |
| 16279 |
|
| 16280 |
|
| 16281 |
var childViewTypes = { |
| 16282 |
color: __webpack_require__(624), |
| 16283 |
typography: __webpack_require__(625) |
| 16284 |
}, |
| 16285 |
PanelSchemeBaseView; |
| 16286 |
PanelSchemeBaseView = Marionette.CompositeView.extend({ |
| 16287 |
id: function id() { |
| 16288 |
return 'elementor-panel-scheme-' + this.getType(); |
| 16289 |
}, |
| 16290 |
className: function className() { |
| 16291 |
return 'elementor-panel-scheme elementor-panel-scheme-' + this.getUIType(); |
| 16292 |
}, |
| 16293 |
childViewContainer: '.elementor-panel-scheme-items', |
| 16294 |
getTemplate: function getTemplate() { |
| 16295 |
return Marionette.TemplateCache.get('#tmpl-elementor-panel-schemes-' + this.getType()); |
| 16296 |
}, |
| 16297 |
getChildView: function getChildView() { |
| 16298 |
return childViewTypes[this.getUIType()]; |
| 16299 |
}, |
| 16300 |
getUIType: function getUIType() { |
| 16301 |
return this.getType(); |
| 16302 |
}, |
| 16303 |
ui: function ui() { |
| 16304 |
return { |
| 16305 |
saveButton: '.elementor-panel-scheme-save .elementor-button', |
| 16306 |
discardButton: '.elementor-panel-scheme-discard .elementor-button', |
| 16307 |
resetButton: '.elementor-panel-scheme-reset .elementor-button' |
| 16308 |
}; |
| 16309 |
}, |
| 16310 |
events: function events() { |
| 16311 |
return { |
| 16312 |
'click @ui.saveButton': 'saveScheme', |
| 16313 |
'click @ui.discardButton': 'discardScheme', |
| 16314 |
'click @ui.resetButton': 'setDefaultScheme' |
| 16315 |
}; |
| 16316 |
}, |
| 16317 |
initialize: function initialize() { |
| 16318 |
this.model = new Backbone.Model(); |
| 16319 |
this.resetScheme(); |
| 16320 |
}, |
| 16321 |
getType: function getType() {}, |
| 16322 |
getScheme: function getScheme() { |
| 16323 |
return elementor.schemes.getScheme(this.getType()); |
| 16324 |
}, |
| 16325 |
changeChildrenUIValues: function changeChildrenUIValues(schemeItems) { |
| 16326 |
var self = this; |
| 16327 |
|
| 16328 |
_.each(schemeItems, function (value, key) { |
| 16329 |
var model = self.collection.findWhere({ |
| 16330 |
key: key |
| 16331 |
}), |
| 16332 |
childView = self.children.findByModelCid(model.cid); |
| 16333 |
childView.changeUIValue(value); |
| 16334 |
}); |
| 16335 |
}, |
| 16336 |
discardScheme: function discardScheme() { |
| 16337 |
elementor.schemes.resetSchemes(this.getType()); |
| 16338 |
this.onSchemeChange(); |
| 16339 |
this.ui.saveButton.prop('disabled', true); |
| 16340 |
|
| 16341 |
this._renderChildren(); |
| 16342 |
}, |
| 16343 |
setSchemeValue: function setSchemeValue(key, value) { |
| 16344 |
elementor.schemes.setSchemeValue(this.getType(), key, value); |
| 16345 |
this.onSchemeChange(); |
| 16346 |
}, |
| 16347 |
saveScheme: function saveScheme() { |
| 16348 |
NProgress.start(); |
| 16349 |
elementor.schemes.saveScheme(this.getType()).done(NProgress.done); |
| 16350 |
this.ui.saveButton.prop('disabled', true); |
| 16351 |
this.resetScheme(); |
| 16352 |
|
| 16353 |
this._renderChildren(); |
| 16354 |
}, |
| 16355 |
setDefaultScheme: function setDefaultScheme() { |
| 16356 |
var defaultScheme = elementor.config.default_schemes[this.getType()].items; |
| 16357 |
this.changeChildrenUIValues(defaultScheme); |
| 16358 |
}, |
| 16359 |
resetItems: function resetItems() { |
| 16360 |
this.model.set('items', this.getScheme().items); |
| 16361 |
}, |
| 16362 |
resetCollection: function resetCollection() { |
| 16363 |
var self = this, |
| 16364 |
items = self.model.get('items'); |
| 16365 |
self.collection = new Backbone.Collection(); |
| 16366 |
|
| 16367 |
_.each(items, function (item, key) { |
| 16368 |
item.type = self.getType(); |
| 16369 |
item.key = key; |
| 16370 |
self.collection.add(item); |
| 16371 |
}); |
| 16372 |
}, |
| 16373 |
resetScheme: function resetScheme() { |
| 16374 |
this.resetItems(); |
| 16375 |
this.resetCollection(); |
| 16376 |
}, |
| 16377 |
onSchemeChange: function onSchemeChange() { |
| 16378 |
elementor.schemes.printSchemesStyle(); |
| 16379 |
}, |
| 16380 |
onChildviewValueChange: function onChildviewValueChange(childView, newValue) { |
| 16381 |
this.ui.saveButton.removeProp('disabled'); |
| 16382 |
this.setSchemeValue(childView.model.get('key'), newValue); |
| 16383 |
} |
| 16384 |
}); |
| 16385 |
module.exports = PanelSchemeBaseView; |
| 16386 |
|
| 16387 |
/***/ }), |
| 16388 |
/* 392 */ |
| 16389 |
/***/ (function(module, exports, __webpack_require__) { |
| 16390 |
|
| 16391 |
"use strict"; |
| 16392 |
|
| 16393 |
|
| 16394 |
var PanelSchemeItemView; |
| 16395 |
PanelSchemeItemView = Marionette.ItemView.extend({ |
| 16396 |
getTemplate: function getTemplate() { |
| 16397 |
return Marionette.TemplateCache.get('#tmpl-elementor-panel-scheme-' + this.getUIType() + '-item'); |
| 16398 |
}, |
| 16399 |
className: function className() { |
| 16400 |
return 'elementor-panel-scheme-item'; |
| 16401 |
} |
| 16402 |
}); |
| 16403 |
module.exports = PanelSchemeItemView; |
| 16404 |
|
| 16405 |
/***/ }), |
| 16406 |
/* 393 */, |
| 16407 |
/* 394 */, |
| 16408 |
/* 395 */, |
| 16409 |
/* 396 */, |
| 16410 |
/* 397 */, |
| 16411 |
/* 398 */, |
| 16412 |
/* 399 */, |
| 16413 |
/* 400 */, |
| 16414 |
/* 401 */, |
| 16415 |
/* 402 */, |
| 16416 |
/* 403 */, |
| 16417 |
/* 404 */, |
| 16418 |
/* 405 */, |
| 16419 |
/* 406 */, |
| 16420 |
/* 407 */, |
| 16421 |
/* 408 */, |
| 16422 |
/* 409 */, |
| 16423 |
/* 410 */, |
| 16424 |
/* 411 */, |
| 16425 |
/* 412 */, |
| 16426 |
/* 413 */, |
| 16427 |
/* 414 */, |
| 16428 |
/* 415 */, |
| 16429 |
/* 416 */, |
| 16430 |
/* 417 */, |
| 16431 |
/* 418 */, |
| 16432 |
/* 419 */ |
| 16433 |
/***/ (function(module, exports, __webpack_require__) { |
| 16434 |
|
| 16435 |
"use strict"; |
| 16436 |
|
| 16437 |
|
| 16438 |
var _interopRequireDefault = __webpack_require__(0); |
| 16439 |
|
| 16440 |
var _Object$defineProperty2 = __webpack_require__(1); |
| 16441 |
|
| 16442 |
_Object$defineProperty2(exports, "__esModule", { |
| 16443 |
value: true |
| 16444 |
}); |
| 16445 |
|
| 16446 |
exports.default = void 0; |
| 16447 |
|
| 16448 |
__webpack_require__(25); |
| 16449 |
|
| 16450 |
var _defineProperty2 = _interopRequireDefault(__webpack_require__(1)); |
| 16451 |
|
| 16452 |
var _classCallCheck2 = _interopRequireDefault(__webpack_require__(2)); |
| 16453 |
|
| 16454 |
var _createClass2 = _interopRequireDefault(__webpack_require__(3)); |
| 16455 |
|
| 16456 |
var _assertThisInitialized2 = _interopRequireDefault(__webpack_require__(49)); |
| 16457 |
|
| 16458 |
var _inherits2 = _interopRequireDefault(__webpack_require__(4)); |
| 16459 |
|
| 16460 |
var _createSuper2 = _interopRequireDefault(__webpack_require__(5)); |
| 16461 |
|
| 16462 |
var _defineProperty3 = _interopRequireDefault(__webpack_require__(28)); |
| 16463 |
|
| 16464 |
var _color = _interopRequireDefault(__webpack_require__(420)); |
| 16465 |
|
| 16466 |
var _dateTime = _interopRequireDefault(__webpack_require__(425)); |
| 16467 |
|
| 16468 |
var _component = _interopRequireDefault(__webpack_require__(426)); |
| 16469 |
|
| 16470 |
var _environment = _interopRequireDefault(__webpack_require__(272)); |
| 16471 |
|
| 16472 |
var _module = _interopRequireDefault(__webpack_require__(349)); |
| 16473 |
|
| 16474 |
var _hotkeys = _interopRequireDefault(__webpack_require__(458)); |
| 16475 |
|
| 16476 |
var _iconsManager = _interopRequireDefault(__webpack_require__(462)); |
| 16477 |
|
| 16478 |
var _menu = _interopRequireDefault(__webpack_require__(472)); |
| 16479 |
|
| 16480 |
var _promotion = _interopRequireDefault(__webpack_require__(475)); |
| 16481 |
|
| 16482 |
var _manager = _interopRequireDefault(__webpack_require__(476)); |
| 16483 |
|
| 16484 |
var _navigator = _interopRequireDefault(__webpack_require__(514)); |
| 16485 |
|
| 16486 |
var _noticeBar = _interopRequireDefault(__webpack_require__(524)); |
| 16487 |
|
| 16488 |
var _preview = _interopRequireDefault(__webpack_require__(525)); |
| 16489 |
|
| 16490 |
var _popoverToggle = _interopRequireDefault(__webpack_require__(529)); |
| 16491 |
|
| 16492 |
/* global ElementorConfig */ |
| 16493 |
var DEFAULT_DEVICE_MODE = 'desktop'; |
| 16494 |
|
| 16495 |
var EditorBase = /*#__PURE__*/function (_Marionette$Applicati) { |
| 16496 |
(0, _inherits2.default)(EditorBase, _Marionette$Applicati); |
| 16497 |
|
| 16498 |
var _super = (0, _createSuper2.default)(EditorBase); |
| 16499 |
|
| 16500 |
function EditorBase() { |
| 16501 |
var _this; |
| 16502 |
|
| 16503 |
(0, _classCallCheck2.default)(this, EditorBase); |
| 16504 |
|
| 16505 |
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { |
| 16506 |
args[_key] = arguments[_key]; |
| 16507 |
} |
| 16508 |
|
| 16509 |
_this = _super.call.apply(_super, [this].concat(args)); |
| 16510 |
(0, _defineProperty3.default)((0, _assertThisInitialized2.default)(_this), "widgetsCache", {}); |
| 16511 |
(0, _defineProperty3.default)((0, _assertThisInitialized2.default)(_this), "config", {}); |
| 16512 |
(0, _defineProperty3.default)((0, _assertThisInitialized2.default)(_this), "loaded", false); |
| 16513 |
(0, _defineProperty3.default)((0, _assertThisInitialized2.default)(_this), "previewLoadedOnce", false); |
| 16514 |
(0, _defineProperty3.default)((0, _assertThisInitialized2.default)(_this), "helpers", __webpack_require__(530)); |
| 16515 |
(0, _defineProperty3.default)((0, _assertThisInitialized2.default)(_this), "imagesManager", __webpack_require__(534)); |
| 16516 |
(0, _defineProperty3.default)((0, _assertThisInitialized2.default)(_this), "schemes", __webpack_require__(535)); |
| 16517 |
(0, _defineProperty3.default)((0, _assertThisInitialized2.default)(_this), "presetsFactory", __webpack_require__(536)); |
| 16518 |
(0, _defineProperty3.default)((0, _assertThisInitialized2.default)(_this), "templates", __webpack_require__(537)); |
| 16519 |
(0, _defineProperty3.default)((0, _assertThisInitialized2.default)(_this), "ajax", elementorCommon.ajax); |
| 16520 |
(0, _defineProperty3.default)((0, _assertThisInitialized2.default)(_this), "conditions", __webpack_require__(557)); |
| 16521 |
(0, _defineProperty3.default)((0, _assertThisInitialized2.default)(_this), "history", __webpack_require__(349)); |
| 16522 |
(0, _defineProperty3.default)((0, _assertThisInitialized2.default)(_this), "channels", { |
| 16523 |
editor: Backbone.Radio.channel('ELEMENTOR:editor'), |
| 16524 |
data: Backbone.Radio.channel('ELEMENTOR:data'), |
| 16525 |
panelElements: Backbone.Radio.channel('ELEMENTOR:panelElements'), |
| 16526 |
dataEditMode: Backbone.Radio.channel('ELEMENTOR:editmode'), |
| 16527 |
deviceMode: Backbone.Radio.channel('ELEMENTOR:deviceMode'), |
| 16528 |
templates: Backbone.Radio.channel('ELEMENTOR:templates') |
| 16529 |
}); |
| 16530 |
(0, _defineProperty3.default)((0, _assertThisInitialized2.default)(_this), "modules", { |
| 16531 |
// TODO: Deprecated alias since 2.3.0 |
| 16532 |
get Module() { |
| 16533 |
elementorCommon.helpers.hardDeprecated('elementor.modules.Module', '2.3.0', 'elementorModules.Module'); |
| 16534 |
return elementorModules.Module; |
| 16535 |
}, |
| 16536 |
|
| 16537 |
components: { |
| 16538 |
templateLibrary: { |
| 16539 |
views: { |
| 16540 |
// TODO: Deprecated alias since 2.4.0 |
| 16541 |
get BaseModalLayout() { |
| 16542 |
elementorCommon.helpers.hardDeprecated('elementor.modules.components.templateLibrary.views.BaseModalLayout', '2.4.0', 'elementorModules.common.views.modal.Layout'); |
| 16543 |
return elementorModules.common.views.modal.Layout; |
| 16544 |
} |
| 16545 |
|
| 16546 |
} |
| 16547 |
}, |
| 16548 |
saver: { |
| 16549 |
behaviors: { |
| 16550 |
FooterSaver: __webpack_require__(558) |
| 16551 |
} |
| 16552 |
} |
| 16553 |
}, |
| 16554 |
saver: { |
| 16555 |
get footerBehavior() { |
| 16556 |
elementorCommon.helpers.softDeprecated('elementor.modules.saver.footerBehavior.', '2.9.0', 'elementor.modules.components.saver.behaviors.FooterSaver'); |
| 16557 |
return elementor.modules.components.saver.behaviors.FooterSaver; |
| 16558 |
} |
| 16559 |
|
| 16560 |
}, |
| 16561 |
controls: { |
| 16562 |
Animation: __webpack_require__(274), |
| 16563 |
Base: __webpack_require__(281), |
| 16564 |
BaseData: __webpack_require__(127), |
| 16565 |
BaseMultiple: __webpack_require__(237), |
| 16566 |
Box_shadow: __webpack_require__(380), |
| 16567 |
Button: __webpack_require__(559), |
| 16568 |
Choose: __webpack_require__(377), |
| 16569 |
Code: __webpack_require__(560), |
| 16570 |
Color: _color.default, |
| 16571 |
Date_time: _dateTime.default, |
| 16572 |
Dimensions: __webpack_require__(561), |
| 16573 |
Exit_animation: __webpack_require__(274), |
| 16574 |
Font: __webpack_require__(564), |
| 16575 |
Gallery: __webpack_require__(565), |
| 16576 |
Hidden: __webpack_require__(566), |
| 16577 |
Hover_animation: __webpack_require__(274), |
| 16578 |
Icon: __webpack_require__(567), |
| 16579 |
Icons: __webpack_require__(568), |
| 16580 |
Image_dimensions: __webpack_require__(569), |
| 16581 |
Media: __webpack_require__(570), |
| 16582 |
Number: __webpack_require__(571), |
| 16583 |
Order: __webpack_require__(573), |
| 16584 |
Popover_toggle: _popoverToggle.default, |
| 16585 |
Repeater: __webpack_require__(367), |
| 16586 |
RepeaterRow: __webpack_require__(328), |
| 16587 |
Section: __webpack_require__(574), |
| 16588 |
Select: __webpack_require__(575), |
| 16589 |
Select2: __webpack_require__(274), |
| 16590 |
Slider: __webpack_require__(576), |
| 16591 |
Structure: __webpack_require__(577), |
| 16592 |
Switcher: __webpack_require__(578), |
| 16593 |
Tab: __webpack_require__(579), |
| 16594 |
Text_shadow: __webpack_require__(380), |
| 16595 |
Url: __webpack_require__(580), |
| 16596 |
Wp_widget: __webpack_require__(581), |
| 16597 |
Wysiwyg: __webpack_require__(582) |
| 16598 |
}, |
| 16599 |
elements: { |
| 16600 |
models: { |
| 16601 |
// TODO: Deprecated alias since 2.4.0 |
| 16602 |
get BaseSettings() { |
| 16603 |
elementorCommon.helpers.hardDeprecated('elementor.modules.elements.models.BaseSettings', '2.4.0', 'elementorModules.editor.elements.models.BaseSettings'); |
| 16604 |
return elementorModules.editor.elements.models.BaseSettings; |
| 16605 |
}, |
| 16606 |
|
| 16607 |
Element: __webpack_require__(383) |
| 16608 |
}, |
| 16609 |
views: { |
| 16610 |
Widget: __webpack_require__(584) |
| 16611 |
} |
| 16612 |
}, |
| 16613 |
layouts: { |
| 16614 |
panel: { |
| 16615 |
pages: { |
| 16616 |
elements: { |
| 16617 |
views: { |
| 16618 |
Global: __webpack_require__(385), |
| 16619 |
Elements: __webpack_require__(588) |
| 16620 |
} |
| 16621 |
}, |
| 16622 |
menu: { |
| 16623 |
Menu: _menu.default |
| 16624 |
} |
| 16625 |
} |
| 16626 |
} |
| 16627 |
}, |
| 16628 |
views: { |
| 16629 |
// TODO: Deprecated alias since 2.4.0 |
| 16630 |
get ControlsStack() { |
| 16631 |
elementorCommon.helpers.hardDeprecated('elementor.modules.views.ControlsStack', '2.4.0', 'elementorModules.editor.views.ControlsStack'); |
| 16632 |
return elementorModules.editor.views.ControlsStack; |
| 16633 |
} |
| 16634 |
|
| 16635 |
} |
| 16636 |
}); |
| 16637 |
(0, _defineProperty3.default)((0, _assertThisInitialized2.default)(_this), "backgroundClickListeners", { |
| 16638 |
popover: { |
| 16639 |
element: '.elementor-controls-popover', |
| 16640 |
ignore: '.elementor-control-popover-toggle-toggle, .elementor-control-popover-toggle-toggle-label, .select2-container, .pcr-app' |
| 16641 |
}, |
| 16642 |
globalControlsSelect: { |
| 16643 |
element: '.e-global__popover', |
| 16644 |
ignore: '.e-global__popover-toggle' |
| 16645 |
}, |
| 16646 |
tagsList: { |
| 16647 |
element: '.elementor-tags-list', |
| 16648 |
ignore: '.elementor-control-dynamic-switcher' |
| 16649 |
}, |
| 16650 |
panelFooterSubMenus: { |
| 16651 |
element: '.elementor-panel-footer-tool.elementor-toggle-state', |
| 16652 |
ignore: '.elementor-panel-footer-tool.elementor-toggle-state, #elementor-panel-saver-button-publish-label', |
| 16653 |
callback: function callback($elementsToHide) { |
| 16654 |
$elementsToHide.removeClass('elementor-open'); |
| 16655 |
} |
| 16656 |
}, |
| 16657 |
panelResponsiveSwitchers: { |
| 16658 |
element: '.elementor-control-responsive-switchers', |
| 16659 |
callback: function callback($elementsToHide) { |
| 16660 |
$elementsToHide.removeClass('elementor-responsive-switchers-open'); |
| 16661 |
} |
| 16662 |
}, |
| 16663 |
promotion: { |
| 16664 |
ignore: '.elementor-panel-category-items', |
| 16665 |
callback: function callback() { |
| 16666 |
var dialog = elementor.promotion.dialog; |
| 16667 |
|
| 16668 |
if (dialog) { |
| 16669 |
dialog.hide(); |
| 16670 |
} |
| 16671 |
} |
| 16672 |
} |
| 16673 |
}); |
| 16674 |
return _this; |
| 16675 |
} |
| 16676 |
|
| 16677 |
(0, _createClass2.default)(EditorBase, [{ |
| 16678 |
key: "userCan", |
| 16679 |
value: function userCan(capability) { |
| 16680 |
return -1 === this.config.user.restrictions.indexOf(capability); |
| 16681 |
} |
| 16682 |
}, { |
| 16683 |
key: "addControlView", |
| 16684 |
value: function addControlView(controlID, ControlView) { |
| 16685 |
this.modules.controls[elementorCommon.helpers.upperCaseWords(controlID)] = ControlView; |
| 16686 |
} |
| 16687 |
}, { |
| 16688 |
key: "checkEnvCompatibility", |
| 16689 |
value: function checkEnvCompatibility() { |
| 16690 |
return _environment.default.firefox || _environment.default.webkit; |
| 16691 |
} |
| 16692 |
}, { |
| 16693 |
key: "getElementData", |
| 16694 |
value: function getElementData(model) { |
| 16695 |
var elType = model.get('elType'); |
| 16696 |
|
| 16697 |
if ('widget' === elType) { |
| 16698 |
var widgetType = model.get('widgetType'); |
| 16699 |
|
| 16700 |
if (!this.widgetsCache[widgetType]) { |
| 16701 |
return false; |
| 16702 |
} |
| 16703 |
|
| 16704 |
if (!this.widgetsCache[widgetType].commonMerged) { |
| 16705 |
jQuery.extend(this.widgetsCache[widgetType].controls, this.widgetsCache.common.controls); |
| 16706 |
this.widgetsCache[widgetType].commonMerged = true; |
| 16707 |
} |
| 16708 |
|
| 16709 |
return this.widgetsCache[widgetType]; |
| 16710 |
} |
| 16711 |
|
| 16712 |
if (!this.config.elements[elType]) { |
| 16713 |
return false; |
| 16714 |
} |
| 16715 |
|
| 16716 |
var elementConfig = elementorCommon.helpers.cloneObject(this.config.elements[elType]); |
| 16717 |
|
| 16718 |
if ('section' === elType && model.get('isInner')) { |
| 16719 |
elementConfig.title = this.translate('inner_section'); |
| 16720 |
} |
| 16721 |
|
| 16722 |
return elementConfig; |
| 16723 |
} |
| 16724 |
}, { |
| 16725 |
key: "getElementControls", |
| 16726 |
value: function getElementControls(modelElement) { |
| 16727 |
var elementData = this.getElementData(modelElement); |
| 16728 |
|
| 16729 |
if (!elementData) { |
| 16730 |
return false; |
| 16731 |
} |
| 16732 |
|
| 16733 |
var isInner = modelElement.get('isInner'), |
| 16734 |
controls = {}; |
| 16735 |
|
| 16736 |
_.each(elementData.controls, function (controlData, controlKey) { |
| 16737 |
if (isInner && controlData.hide_in_inner || !isInner && controlData.hide_in_top) { |
| 16738 |
return; |
| 16739 |
} |
| 16740 |
|
| 16741 |
controls[controlKey] = controlData; |
| 16742 |
}); |
| 16743 |
|
| 16744 |
return controls; |
| 16745 |
} |
| 16746 |
}, { |
| 16747 |
key: "mergeControlsSettings", |
| 16748 |
value: function mergeControlsSettings(controls) { |
| 16749 |
var _this2 = this; |
| 16750 |
|
| 16751 |
_.each(controls, function (controlData, controlKey) { |
| 16752 |
controls[controlKey] = jQuery.extend(true, {}, _this2.config.controls[controlData.type], controlData); |
| 16753 |
}); |
| 16754 |
|
| 16755 |
return controls; |
| 16756 |
} |
| 16757 |
}, { |
| 16758 |
key: "getControlView", |
| 16759 |
value: function getControlView(controlID) { |
| 16760 |
var capitalizedControlName = elementorCommon.helpers.upperCaseWords(controlID); |
| 16761 |
var View = this.modules.controls[capitalizedControlName]; |
| 16762 |
|
| 16763 |
if (!View) { |
| 16764 |
var controlData = this.config.controls[controlID], |
| 16765 |
isUIControl = controlData && -1 !== controlData.features.indexOf('ui'); |
| 16766 |
View = this.modules.controls[isUIControl ? 'Base' : 'BaseData']; |
| 16767 |
} |
| 16768 |
|
| 16769 |
return View; |
| 16770 |
} |
| 16771 |
}, { |
| 16772 |
key: "getPanelView", |
| 16773 |
value: function getPanelView() { |
| 16774 |
return this.panel.currentView; |
| 16775 |
} |
| 16776 |
}, { |
| 16777 |
key: "getPreviewView", |
| 16778 |
value: function getPreviewView() { |
| 16779 |
return this.previewView; |
| 16780 |
} |
| 16781 |
}, { |
| 16782 |
key: "getPreviewContainer", |
| 16783 |
value: function getPreviewContainer() { |
| 16784 |
return this.getPreviewView().getContainer(); |
| 16785 |
} |
| 16786 |
}, { |
| 16787 |
key: "getContainer", |
| 16788 |
value: function getContainer(id) { |
| 16789 |
if ('document' === id) { |
| 16790 |
return this.getPreviewContainer(); |
| 16791 |
} |
| 16792 |
|
| 16793 |
return $e.components.get('document').utils.findContainerById(id); |
| 16794 |
} |
| 16795 |
}, { |
| 16796 |
key: "initComponents", |
| 16797 |
value: function initComponents() { |
| 16798 |
var EventManager = __webpack_require__(388), |
| 16799 |
DynamicTags = __webpack_require__(589), |
| 16800 |
Settings = __webpack_require__(591), |
| 16801 |
Notifications = __webpack_require__(596); |
| 16802 |
|
| 16803 |
this.hooks = new EventManager(); |
| 16804 |
this.settings = new Settings(); |
| 16805 |
this.dynamicTags = new DynamicTags(); |
| 16806 |
this.initDialogsManager(); |
| 16807 |
this.notifications = new Notifications(); |
| 16808 |
this.kitManager = new _manager.default(); |
| 16809 |
this.hotkeysScreen = new _hotkeys.default(); |
| 16810 |
this.iconManager = new _iconsManager.default(); |
| 16811 |
this.noticeBar = new _noticeBar.default(); |
| 16812 |
this.history = new _module.default(); |
| 16813 |
this.promotion = new _promotion.default(); |
| 16814 |
this.documents = $e.components.register(new _component.default()); |
| 16815 |
elementorCommon.elements.$window.trigger('elementor:init-components'); |
| 16816 |
} // TODO: BC method since 2.3.0 |
| 16817 |
|
| 16818 |
}, { |
| 16819 |
key: "initDialogsManager", |
| 16820 |
value: function initDialogsManager() { |
| 16821 |
this.dialogsManager = elementorCommon.dialogsManager; |
| 16822 |
} |
| 16823 |
}, { |
| 16824 |
key: "initElements", |
| 16825 |
value: function initElements() { |
| 16826 |
var ElementCollection = __webpack_require__(384); |
| 16827 |
|
| 16828 |
var config = this.config.document.elements; // If it's an reload, use the not-saved data |
| 16829 |
|
| 16830 |
if (this.elements && this.elements.length && this.config.document.id === this.config.initial_document.id) { |
| 16831 |
config = this.elements.toJSON(); |
| 16832 |
} |
| 16833 |
|
| 16834 |
this.elements = new ElementCollection(config); |
| 16835 |
this.elementsModel = new Backbone.Model({ |
| 16836 |
elements: this.elements |
| 16837 |
}); |
| 16838 |
} |
| 16839 |
}, { |
| 16840 |
key: "initPreview", |
| 16841 |
value: function initPreview() { |
| 16842 |
var $ = jQuery, |
| 16843 |
previewIframeId = 'elementor-preview-iframe'; |
| 16844 |
this.$previewWrapper = $('#elementor-preview'); |
| 16845 |
this.$previewResponsiveWrapper = $('#elementor-preview-responsive-wrapper'); // Make sure the iFrame does not exist. |
| 16846 |
|
| 16847 |
if (!this.$preview) { |
| 16848 |
this.$preview = $('<iframe>', { |
| 16849 |
id: previewIframeId, |
| 16850 |
src: this.config.initial_document.urls.preview, |
| 16851 |
allowfullscreen: 1 |
| 16852 |
}); |
| 16853 |
this.$previewResponsiveWrapper.append(this.$preview); |
| 16854 |
} |
| 16855 |
|
| 16856 |
this.$preview.on('load', this.onPreviewLoaded.bind(this)); |
| 16857 |
} |
| 16858 |
}, { |
| 16859 |
key: "initPreviewView", |
| 16860 |
value: function initPreviewView(document) { |
| 16861 |
elementor.trigger('document:before:preview', document); |
| 16862 |
var preview = new _preview.default({ |
| 16863 |
el: document.$element[0], |
| 16864 |
model: elementor.elementsModel |
| 16865 |
}); |
| 16866 |
preview.$el.empty(); |
| 16867 |
preview.resetChildViewContainer(); // In order to force rendering of children |
| 16868 |
|
| 16869 |
preview.isRendered = true; |
| 16870 |
|
| 16871 |
preview._renderChildren(); |
| 16872 |
|
| 16873 |
preview.triggerMethod('render'); |
| 16874 |
this.previewView = preview; |
| 16875 |
} |
| 16876 |
}, { |
| 16877 |
key: "initFrontend", |
| 16878 |
value: function initFrontend() { |
| 16879 |
var frontendWindow = this.$preview[0].contentWindow; |
| 16880 |
window.elementorFrontend = frontendWindow.elementorFrontend; |
| 16881 |
frontendWindow.elementor = this; |
| 16882 |
frontendWindow.elementorCommon = elementorCommon; |
| 16883 |
elementorFrontend.init(); |
| 16884 |
this.trigger('frontend:init'); |
| 16885 |
} |
| 16886 |
}, { |
| 16887 |
key: "initClearPageDialog", |
| 16888 |
value: function initClearPageDialog() { |
| 16889 |
var dialog; |
| 16890 |
|
| 16891 |
this.getClearPageDialog = function () { |
| 16892 |
if (dialog) { |
| 16893 |
return dialog; |
| 16894 |
} |
| 16895 |
|
| 16896 |
dialog = elementorCommon.dialogsManager.createWidget('confirm', { |
| 16897 |
id: 'elementor-clear-page-dialog', |
| 16898 |
headerMessage: elementor.translate('clear_page'), |
| 16899 |
message: elementor.translate('dialog_confirm_clear_page'), |
| 16900 |
position: { |
| 16901 |
my: 'center center', |
| 16902 |
at: 'center center' |
| 16903 |
}, |
| 16904 |
strings: { |
| 16905 |
confirm: elementor.translate('delete'), |
| 16906 |
cancel: elementor.translate('cancel') |
| 16907 |
}, |
| 16908 |
onConfirm: function onConfirm() { |
| 16909 |
return $e.run('document/elements/empty', { |
| 16910 |
force: true |
| 16911 |
}); |
| 16912 |
} |
| 16913 |
}); |
| 16914 |
return dialog; |
| 16915 |
}; |
| 16916 |
} |
| 16917 |
}, { |
| 16918 |
key: "getCurrentElement", |
| 16919 |
value: function getCurrentElement() { |
| 16920 |
var isPreview = -1 !== ['BODY', 'IFRAME'].indexOf(document.activeElement.tagName) && 'BODY' === elementorFrontend.elements.window.document.activeElement.tagName; |
| 16921 |
|
| 16922 |
if (!isPreview && !elementorCommonConfig.isTesting) { |
| 16923 |
return false; |
| 16924 |
} |
| 16925 |
|
| 16926 |
var targetElement = elementor.channels.editor.request('contextMenu:targetView'); |
| 16927 |
|
| 16928 |
if (!targetElement) { |
| 16929 |
var panel = elementor.getPanelView(); |
| 16930 |
|
| 16931 |
if ($e.routes.isPartOf('panel/editor')) { |
| 16932 |
targetElement = panel.getCurrentPageView().getOption('editedElementView'); |
| 16933 |
} |
| 16934 |
} |
| 16935 |
|
| 16936 |
if (!targetElement) { |
| 16937 |
targetElement = elementor.getPreviewView(); |
| 16938 |
} |
| 16939 |
|
| 16940 |
return targetElement; |
| 16941 |
} |
| 16942 |
}, { |
| 16943 |
key: "initPanel", |
| 16944 |
value: function initPanel() { |
| 16945 |
this.addRegions({ |
| 16946 |
panel: __webpack_require__(597) |
| 16947 |
}); |
| 16948 |
this.trigger('panel:init'); |
| 16949 |
} |
| 16950 |
}, { |
| 16951 |
key: "initNavigator", |
| 16952 |
value: function initNavigator() { |
| 16953 |
this.addRegions({ |
| 16954 |
navigator: { |
| 16955 |
el: '#elementor-navigator', |
| 16956 |
regionClass: _navigator.default |
| 16957 |
} |
| 16958 |
}); |
| 16959 |
this.trigger('navigator:init'); |
| 16960 |
} |
| 16961 |
}, { |
| 16962 |
key: "setAjax", |
| 16963 |
value: function setAjax() { |
| 16964 |
elementorCommon.ajax.addRequestConstant('editor_post_id', this.config.document.id); |
| 16965 |
elementorCommon.ajax.addRequestConstant('initial_document_id', this.config.initial_document.id); |
| 16966 |
elementorCommon.ajax.on('request:unhandledError', function (xmlHttpRequest) { |
| 16967 |
elementor.notifications.showToast({ |
| 16968 |
message: elementor.createAjaxErrorMessage(xmlHttpRequest) |
| 16969 |
}); |
| 16970 |
}); |
| 16971 |
} |
| 16972 |
}, { |
| 16973 |
key: "createAjaxErrorMessage", |
| 16974 |
value: function createAjaxErrorMessage(xmlHttpRequest) { |
| 16975 |
var message; |
| 16976 |
|
| 16977 |
if (4 === xmlHttpRequest.readyState) { |
| 16978 |
message = this.translate('server_error'); |
| 16979 |
|
| 16980 |
if (200 !== xmlHttpRequest.status) { |
| 16981 |
message += ' (' + xmlHttpRequest.status + ' ' + xmlHttpRequest.statusText + ')'; |
| 16982 |
} |
| 16983 |
} else if (0 === xmlHttpRequest.readyState) { |
| 16984 |
message = this.translate('server_connection_lost'); |
| 16985 |
} else { |
| 16986 |
message = this.translate('unknown_error'); |
| 16987 |
} |
| 16988 |
|
| 16989 |
return message + '.'; |
| 16990 |
} |
| 16991 |
}, { |
| 16992 |
key: "preventClicksInsideEditor", |
| 16993 |
value: function preventClicksInsideEditor() { |
| 16994 |
this.$previewContents.on('submit', function (event) { |
| 16995 |
return event.preventDefault(); |
| 16996 |
}); // Cannot use arrow function here since it use `this.contains`. |
| 16997 |
|
| 16998 |
this.$previewContents.on('click', function (event) { |
| 16999 |
var _elementor$documents$; |
| 17000 |
|
| 17001 |
var $target = jQuery(event.target), |
| 17002 |
isClickInsideElementor = !!$target.closest('.elementor-edit-area, .pen-menu').length, |
| 17003 |
isTargetInsideDocument = this.contains($target[0]); |
| 17004 |
|
| 17005 |
if ($target.closest('a:not(.elementor-clickable)').length) { |
| 17006 |
event.preventDefault(); |
| 17007 |
} |
| 17008 |
|
| 17009 |
if (isClickInsideElementor && elementor.getPreviewContainer().isEditable() || !isTargetInsideDocument) { |
| 17010 |
return; |
| 17011 |
} // It's a click on the preview area, not in the edit area, |
| 17012 |
// and a document is open and has an edit area. |
| 17013 |
|
| 17014 |
|
| 17015 |
if (!isClickInsideElementor && ((_elementor$documents$ = elementor.documents.getCurrent()) === null || _elementor$documents$ === void 0 ? void 0 : _elementor$documents$.$element)) { |
| 17016 |
$e.internal('panel/open-default'); |
| 17017 |
} |
| 17018 |
}); |
| 17019 |
} |
| 17020 |
}, { |
| 17021 |
key: "addBackgroundClickArea", |
| 17022 |
value: function addBackgroundClickArea(element) { |
| 17023 |
element.addEventListener('click', this.onBackgroundClick.bind(this), true); |
| 17024 |
} |
| 17025 |
}, { |
| 17026 |
key: "addBackgroundClickListener", |
| 17027 |
value: function addBackgroundClickListener(key, listener) { |
| 17028 |
this.backgroundClickListeners[key] = listener; |
| 17029 |
} |
| 17030 |
}, { |
| 17031 |
key: "removeBackgroundClickListener", |
| 17032 |
value: function removeBackgroundClickListener(key) { |
| 17033 |
delete this.backgroundClickListeners[key]; |
| 17034 |
} |
| 17035 |
}, { |
| 17036 |
key: "showFatalErrorDialog", |
| 17037 |
value: function showFatalErrorDialog(options) { |
| 17038 |
var defaultOptions = { |
| 17039 |
id: 'elementor-fatal-error-dialog', |
| 17040 |
headerMessage: '', |
| 17041 |
message: '', |
| 17042 |
position: { |
| 17043 |
my: 'center center', |
| 17044 |
at: 'center center' |
| 17045 |
}, |
| 17046 |
strings: { |
| 17047 |
confirm: this.translate('learn_more'), |
| 17048 |
cancel: this.translate('go_back') |
| 17049 |
}, |
| 17050 |
onConfirm: null, |
| 17051 |
onCancel: function onCancel() { |
| 17052 |
return parent.history.go(-1); |
| 17053 |
}, |
| 17054 |
hide: { |
| 17055 |
onBackgroundClick: false, |
| 17056 |
onButtonClick: false |
| 17057 |
} |
| 17058 |
}; |
| 17059 |
options = jQuery.extend(true, defaultOptions, options); |
| 17060 |
elementorCommon.dialogsManager.createWidget('confirm', options).show(); |
| 17061 |
} |
| 17062 |
}, { |
| 17063 |
key: "showFlexBoxAttentionDialog", |
| 17064 |
value: function showFlexBoxAttentionDialog() { |
| 17065 |
var _this3 = this; |
| 17066 |
|
| 17067 |
var introduction = new elementorModules.editor.utils.Introduction({ |
| 17068 |
introductionKey: 'flexbox', |
| 17069 |
dialogType: 'confirm', |
| 17070 |
dialogOptions: { |
| 17071 |
id: 'elementor-flexbox-attention-dialog', |
| 17072 |
headerMessage: this.translate('flexbox_attention_header'), |
| 17073 |
message: this.translate('flexbox_attention_message'), |
| 17074 |
position: { |
| 17075 |
my: 'center center', |
| 17076 |
at: 'center center' |
| 17077 |
}, |
| 17078 |
strings: { |
| 17079 |
confirm: this.translate('learn_more'), |
| 17080 |
cancel: this.translate('got_it') |
| 17081 |
}, |
| 17082 |
hide: { |
| 17083 |
onButtonClick: false |
| 17084 |
}, |
| 17085 |
onCancel: function onCancel() { |
| 17086 |
introduction.setViewed(); |
| 17087 |
introduction.getDialog().hide(); |
| 17088 |
}, |
| 17089 |
onConfirm: function onConfirm() { |
| 17090 |
return open(_this3.config.help_flexbox_bc_url, '_blank'); |
| 17091 |
} |
| 17092 |
} |
| 17093 |
}); |
| 17094 |
introduction.show(); |
| 17095 |
} |
| 17096 |
}, { |
| 17097 |
key: "checkPageStatus", |
| 17098 |
value: function checkPageStatus() { |
| 17099 |
if (elementor.documents.getCurrent().isDraft()) { |
| 17100 |
this.notifications.showToast({ |
| 17101 |
message: this.translate('working_on_draft_notification'), |
| 17102 |
buttons: [{ |
| 17103 |
name: 'view_revisions', |
| 17104 |
text: elementor.translate('view_all_revisions'), |
| 17105 |
callback: function callback() { |
| 17106 |
return $e.route('panel/history/revisions'); |
| 17107 |
} |
| 17108 |
}] |
| 17109 |
}); |
| 17110 |
} |
| 17111 |
} |
| 17112 |
}, { |
| 17113 |
key: "enterPreviewMode", |
| 17114 |
value: function enterPreviewMode(hidePanel) { |
| 17115 |
var $elements = elementorFrontend.elements.$body; |
| 17116 |
|
| 17117 |
if (hidePanel) { |
| 17118 |
$elements = $elements.add(elementorCommon.elements.$body); |
| 17119 |
} |
| 17120 |
|
| 17121 |
$elements.removeClass('elementor-editor-active').addClass('elementor-editor-preview'); |
| 17122 |
var $element = this.documents.getCurrent().$element; |
| 17123 |
|
| 17124 |
if ($element) { |
| 17125 |
$element.removeClass('elementor-edit-area-active'); |
| 17126 |
} |
| 17127 |
|
| 17128 |
if (hidePanel) { |
| 17129 |
// Handle panel resize |
| 17130 |
this.$previewWrapper.css(elementorCommon.config.isRTL ? 'right' : 'left', ''); |
| 17131 |
this.panel.$el.css('width', ''); |
| 17132 |
} |
| 17133 |
} |
| 17134 |
}, { |
| 17135 |
key: "exitPreviewMode", |
| 17136 |
value: function exitPreviewMode() { |
| 17137 |
elementorFrontend.elements.$body.add(elementorCommon.elements.$body).removeClass('elementor-editor-preview').addClass('elementor-editor-active'); |
| 17138 |
|
| 17139 |
if (elementor.config.document.panel.has_elements) { |
| 17140 |
this.documents.getCurrent().$element.addClass('elementor-edit-area-active'); |
| 17141 |
} |
| 17142 |
} |
| 17143 |
}, { |
| 17144 |
key: "changeEditMode", |
| 17145 |
value: function changeEditMode(newMode) { |
| 17146 |
var dataEditMode = elementor.channels.dataEditMode, |
| 17147 |
oldEditMode = dataEditMode.request('activeMode'); |
| 17148 |
dataEditMode.reply('activeMode', newMode); |
| 17149 |
|
| 17150 |
if (newMode !== oldEditMode) { |
| 17151 |
dataEditMode.trigger('switch', newMode); |
| 17152 |
} |
| 17153 |
} |
| 17154 |
}, { |
| 17155 |
key: "reloadPreview", |
| 17156 |
value: function reloadPreview() { |
| 17157 |
// TODO: Should be command? |
| 17158 |
jQuery('#elementor-preview-loading').show(); |
| 17159 |
this.$preview[0].contentWindow.location.reload(true); |
| 17160 |
} |
| 17161 |
}, { |
| 17162 |
key: "changeDeviceMode", |
| 17163 |
value: function changeDeviceMode(newDeviceMode) { |
| 17164 |
var oldDeviceMode = this.channels.deviceMode.request('currentMode'); |
| 17165 |
|
| 17166 |
if (oldDeviceMode === newDeviceMode) { |
| 17167 |
return; |
| 17168 |
} |
| 17169 |
|
| 17170 |
elementorCommon.elements.$body.removeClass('elementor-device-' + oldDeviceMode).addClass('elementor-device-' + newDeviceMode); |
| 17171 |
this.channels.deviceMode.reply('previousMode', oldDeviceMode).reply('currentMode', newDeviceMode).trigger('change'); |
| 17172 |
} |
| 17173 |
}, { |
| 17174 |
key: "translate", |
| 17175 |
value: function translate(stringKey, templateArgs, i18nStack) { |
| 17176 |
// TODO: BC since 2.3.0, it always should be `this.config.i18n` |
| 17177 |
if (!i18nStack) { |
| 17178 |
i18nStack = this.config.i18n; |
| 17179 |
} |
| 17180 |
|
| 17181 |
return elementorCommon.translate(stringKey, null, templateArgs, i18nStack); |
| 17182 |
} |
| 17183 |
}, { |
| 17184 |
key: "logSite", |
| 17185 |
value: function logSite() { |
| 17186 |
var text = '', |
| 17187 |
style = ''; |
| 17188 |
|
| 17189 |
if (_environment.default.firefox) { |
| 17190 |
var asciiText = [' ;;;;;;;;;;;;;;; ', ';;; ;; ;;;', ';;; ;;;;;;;;;;;;', ';;; ;;;;;;;;;;;;', ';;; ;; ;;;', ';;; ;;;;;;;;;;;;', ';;; ;;;;;;;;;;;;', ';;; ;; ;;;', ' ;;;;;;;;;;;;;;; ']; |
| 17191 |
text += '%c' + asciiText.join('\n') + '\n'; |
| 17192 |
style = 'color: #C42961'; |
| 17193 |
} else { |
| 17194 |
text += '%c00'; |
| 17195 |
style = 'font-size: 22px; background-image: url("' + elementorCommon.config.urls.assets + 'images/logo-icon.png"); color: transparent; background-repeat: no-repeat'; |
| 17196 |
} |
| 17197 |
|
| 17198 |
setTimeout(console.log.bind(console, text, style)); // eslint-disable-line |
| 17199 |
|
| 17200 |
text = '%cLove using Elementor? Join our growing community of Elementor developers: %chttps://github.com/elementor/elementor'; |
| 17201 |
setTimeout(console.log.bind(console, text, 'color: #9B0A46', '')); // eslint-disable-line |
| 17202 |
} |
| 17203 |
}, { |
| 17204 |
key: "requestWidgetsConfig", |
| 17205 |
value: function requestWidgetsConfig() { |
| 17206 |
var _this4 = this; |
| 17207 |
|
| 17208 |
var excludeWidgets = {}; |
| 17209 |
jQuery.each(this.widgetsCache, function (widgetName, widgetConfig) { |
| 17210 |
if (widgetConfig.controls) { |
| 17211 |
excludeWidgets[widgetName] = true; |
| 17212 |
} |
| 17213 |
}); |
| 17214 |
elementorCommon.ajax.addRequest('get_widgets_config', { |
| 17215 |
data: { |
| 17216 |
exclude: excludeWidgets |
| 17217 |
}, |
| 17218 |
success: function success(data) { |
| 17219 |
_this4.addWidgetsCache(data); |
| 17220 |
|
| 17221 |
if (_this4.loaded) { |
| 17222 |
_this4.kitManager.renderGlobalsDefaultCSS(); |
| 17223 |
|
| 17224 |
$e.internal('panel/state-ready'); |
| 17225 |
} else { |
| 17226 |
_this4.once('panel:init', function () { |
| 17227 |
$e.internal('panel/state-ready'); |
| 17228 |
}); |
| 17229 |
} |
| 17230 |
} |
| 17231 |
}); |
| 17232 |
} |
| 17233 |
}, { |
| 17234 |
key: "getPreferences", |
| 17235 |
value: function getPreferences(key) { |
| 17236 |
var settings = elementor.settings.editorPreferences.model.attributes; |
| 17237 |
|
| 17238 |
if (key) { |
| 17239 |
return settings[key]; |
| 17240 |
} |
| 17241 |
|
| 17242 |
return settings; |
| 17243 |
} |
| 17244 |
}, { |
| 17245 |
key: "getConfig", |
| 17246 |
value: function getConfig() { |
| 17247 |
return ElementorConfig; |
| 17248 |
} |
| 17249 |
}, { |
| 17250 |
key: "onStart", |
| 17251 |
value: function onStart() { |
| 17252 |
this.config = this.getConfig(); |
| 17253 |
Backbone.Radio.DEBUG = false; |
| 17254 |
Backbone.Radio.tuneIn('ELEMENTOR'); |
| 17255 |
this.initComponents(); |
| 17256 |
|
| 17257 |
if (!this.checkEnvCompatibility()) { |
| 17258 |
this.onEnvNotCompatible(); |
| 17259 |
} |
| 17260 |
|
| 17261 |
this.initPreview(); |
| 17262 |
this.requestWidgetsConfig(); |
| 17263 |
this.channels.dataEditMode.reply('activeMode', 'edit'); |
| 17264 |
this.listenTo(this.channels.dataEditMode, 'switch', this.onEditModeSwitched); |
| 17265 |
this.initClearPageDialog(); |
| 17266 |
this.addBackgroundClickArea(document); |
| 17267 |
this.addDeprecatedConfigProperties(); |
| 17268 |
elementorCommon.elements.$window.trigger('elementor:loaded'); |
| 17269 |
$e.run('editor/documents/open', { |
| 17270 |
id: this.config.initial_document.id |
| 17271 |
}).then(function () { |
| 17272 |
elementorCommon.elements.$window.trigger('elementor:init'); |
| 17273 |
}); |
| 17274 |
this.initNavigator(); |
| 17275 |
this.logSite(); |
| 17276 |
} |
| 17277 |
}, { |
| 17278 |
key: "onPreviewLoaded", |
| 17279 |
value: function onPreviewLoaded() { |
| 17280 |
var previewWindow = this.$preview[0].contentWindow; |
| 17281 |
|
| 17282 |
if (!previewWindow.elementorFrontend) { |
| 17283 |
this.onPreviewLoadingError(); |
| 17284 |
return; |
| 17285 |
} |
| 17286 |
|
| 17287 |
this.$previewContents = this.$preview.contents(); |
| 17288 |
this.initFrontend(); |
| 17289 |
this.schemes.init(); |
| 17290 |
this.preventClicksInsideEditor(); |
| 17291 |
this.addBackgroundClickArea(elementorFrontend.elements.window.document); |
| 17292 |
|
| 17293 |
if (!this.previewLoadedOnce) { |
| 17294 |
this.onFirstPreviewLoaded(); |
| 17295 |
} |
| 17296 |
|
| 17297 |
this.$previewContents.children().addClass('elementor-html'); |
| 17298 |
var $frontendBody = elementorFrontend.elements.$body; |
| 17299 |
$frontendBody.addClass('elementor-editor-active'); |
| 17300 |
|
| 17301 |
if (!elementor.userCan('design')) { |
| 17302 |
$frontendBody.addClass('elementor-editor-content-only'); |
| 17303 |
} |
| 17304 |
|
| 17305 |
this.changeDeviceMode(DEFAULT_DEVICE_MODE); |
| 17306 |
jQuery('#elementor-loading, #elementor-preview-loading').fadeOut(600); |
| 17307 |
|
| 17308 |
_.defer(function () { |
| 17309 |
elementorFrontend.elements.window.jQuery.holdReady(false); |
| 17310 |
}); |
| 17311 |
|
| 17312 |
$e.shortcuts.bindListener(elementorFrontend.elements.$window); |
| 17313 |
this.trigger('preview:loaded', !this.loaded |
| 17314 |
/* isFirst */ |
| 17315 |
); |
| 17316 |
$e.internal('editor/documents/attach-preview'); |
| 17317 |
this.loaded = true; |
| 17318 |
} |
| 17319 |
}, { |
| 17320 |
key: "onFirstPreviewLoaded", |
| 17321 |
value: function onFirstPreviewLoaded() { |
| 17322 |
this.initPanel(); |
| 17323 |
this.previewLoadedOnce = true; |
| 17324 |
} |
| 17325 |
}, { |
| 17326 |
key: "onEditModeSwitched", |
| 17327 |
value: function onEditModeSwitched() { |
| 17328 |
var activeMode = this.channels.dataEditMode.request('activeMode'); |
| 17329 |
|
| 17330 |
if ('edit' === activeMode) { |
| 17331 |
this.exitPreviewMode(); |
| 17332 |
} else { |
| 17333 |
this.enterPreviewMode('preview' === activeMode); |
| 17334 |
} |
| 17335 |
} |
| 17336 |
}, { |
| 17337 |
key: "onEnvNotCompatible", |
| 17338 |
value: function onEnvNotCompatible() { |
| 17339 |
var _this5 = this; |
| 17340 |
|
| 17341 |
this.showFatalErrorDialog({ |
| 17342 |
headerMessage: this.translate('device_incompatible_header'), |
| 17343 |
message: this.translate('device_incompatible_message'), |
| 17344 |
strings: { |
| 17345 |
confirm: elementor.translate('proceed_anyway') |
| 17346 |
}, |
| 17347 |
hide: { |
| 17348 |
onButtonClick: true |
| 17349 |
}, |
| 17350 |
onConfirm: function onConfirm() { |
| 17351 |
return _this5.hide(); |
| 17352 |
} |
| 17353 |
}); |
| 17354 |
} |
| 17355 |
}, { |
| 17356 |
key: "onPreviewLoadingError", |
| 17357 |
value: function onPreviewLoadingError() { |
| 17358 |
var _this6 = this; |
| 17359 |
|
| 17360 |
var debugUrl = this.config.document.urls.preview + '&preview-debug', |
| 17361 |
previewDebugLinkText = this.config.i18n.preview_debug_link_text, |
| 17362 |
previewDebugLink = '<div id="elementor-preview-debug-link-text"><a href="' + debugUrl + '" target="_blank">' + previewDebugLinkText + '</a></div>', |
| 17363 |
debugData = elementor.config.preview.debug_data, |
| 17364 |
dialogOptions = { |
| 17365 |
className: 'elementor-preview-loading-error', |
| 17366 |
headerMessage: debugData.header, |
| 17367 |
message: debugData.message + previewDebugLink, |
| 17368 |
onConfirm: function onConfirm() { |
| 17369 |
return open(debugData.doc_url, '_blank'); |
| 17370 |
} |
| 17371 |
}; |
| 17372 |
|
| 17373 |
if (debugData.error) { |
| 17374 |
this.showFatalErrorDialog(dialogOptions); |
| 17375 |
return; |
| 17376 |
} |
| 17377 |
|
| 17378 |
jQuery.get(debugUrl, function () { |
| 17379 |
_this6.showFatalErrorDialog(dialogOptions); |
| 17380 |
}).fail(function (response) { |
| 17381 |
//Iframe can't be loaded |
| 17382 |
_this6.showFatalErrorDialog({ |
| 17383 |
className: 'elementor-preview-loading-error', |
| 17384 |
headerMessage: debugData.header, |
| 17385 |
message: response.statusText + ' ' + response.status + ' ' + previewDebugLink, |
| 17386 |
onConfirm: function onConfirm() { |
| 17387 |
var url = 500 <= response.status ? elementor.config.preview.help_preview_http_error_500_url : elementor.config.preview.help_preview_http_error_url; |
| 17388 |
open(url, '_blank'); |
| 17389 |
} |
| 17390 |
}); |
| 17391 |
}); |
| 17392 |
} |
| 17393 |
}, { |
| 17394 |
key: "onPreviewElNotFound", |
| 17395 |
value: function onPreviewElNotFound() { |
| 17396 |
var args = this.$preview[0].contentWindow.elementorPreviewErrorArgs; |
| 17397 |
|
| 17398 |
if (!args) { |
| 17399 |
args = { |
| 17400 |
headerMessage: this.translate('preview_el_not_found_header'), |
| 17401 |
message: this.translate('preview_el_not_found_message'), |
| 17402 |
confirmURL: elementor.config.help_the_content_url |
| 17403 |
}; |
| 17404 |
} |
| 17405 |
|
| 17406 |
args.onConfirm = function () { |
| 17407 |
return open(args.confirmURL, '_blank'); |
| 17408 |
}; |
| 17409 |
|
| 17410 |
this.showFatalErrorDialog(args); |
| 17411 |
} |
| 17412 |
}, { |
| 17413 |
key: "onBackgroundClick", |
| 17414 |
value: function onBackgroundClick(event) { |
| 17415 |
jQuery.each(this.backgroundClickListeners, function (index, config) { |
| 17416 |
var $clickedTarget = jQuery(event.target); // If it's a label that associated with an input |
| 17417 |
|
| 17418 |
if ($clickedTarget[0].control) { |
| 17419 |
$clickedTarget = $clickedTarget.add($clickedTarget[0].control); |
| 17420 |
} |
| 17421 |
|
| 17422 |
if (config.ignore && $clickedTarget.closest(config.ignore).length) { |
| 17423 |
return; |
| 17424 |
} |
| 17425 |
|
| 17426 |
var $clickedTargetClosestElement = $clickedTarget.closest(config.element), |
| 17427 |
$elementsToHide = jQuery(config.element).not($clickedTargetClosestElement); |
| 17428 |
|
| 17429 |
if (config.callback) { |
| 17430 |
config.callback($elementsToHide); |
| 17431 |
return; |
| 17432 |
} |
| 17433 |
|
| 17434 |
$elementsToHide.hide(); |
| 17435 |
}); |
| 17436 |
} |
| 17437 |
}, { |
| 17438 |
key: "compileTemplate", |
| 17439 |
value: function compileTemplate(template, data) { |
| 17440 |
return Marionette.TemplateCache.prototype.compileTemplate(template)(data); |
| 17441 |
} |
| 17442 |
}, { |
| 17443 |
key: "addWidgetsCache", |
| 17444 |
value: function addWidgetsCache(widgets) { |
| 17445 |
var _this7 = this; |
| 17446 |
|
| 17447 |
jQuery.each(widgets, function (widgetName, widgetConfig) { |
| 17448 |
_this7.widgetsCache[widgetName] = jQuery.extend(true, {}, _this7.widgetsCache[widgetName], widgetConfig); |
| 17449 |
}); |
| 17450 |
} |
| 17451 |
}, { |
| 17452 |
key: "addDeprecatedConfigProperties", |
| 17453 |
value: function addDeprecatedConfigProperties() { |
| 17454 |
var _this8 = this; |
| 17455 |
|
| 17456 |
var map = { |
| 17457 |
data: { |
| 17458 |
replacement: 'elements', |
| 17459 |
value: function value() { |
| 17460 |
return elementor.config.document.elements; |
| 17461 |
} |
| 17462 |
}, |
| 17463 |
current_user_can_publish: { |
| 17464 |
replacement: 'user.can_publish', |
| 17465 |
value: function value() { |
| 17466 |
return elementor.config.document.user.can_publish; |
| 17467 |
} |
| 17468 |
}, |
| 17469 |
locked_user: { |
| 17470 |
replacement: '', |
| 17471 |
value: function value() { |
| 17472 |
return elementor.config.document.user.locked; |
| 17473 |
} |
| 17474 |
}, |
| 17475 |
revisions_enabled: { |
| 17476 |
replacement: 'revisions.enabled', |
| 17477 |
value: function value() { |
| 17478 |
return elementor.config.document.revisions.enabled; |
| 17479 |
} |
| 17480 |
}, |
| 17481 |
current_revision_id: { |
| 17482 |
replacement: 'revisions.current_id', |
| 17483 |
value: function value() { |
| 17484 |
return elementor.config.document.revisions.current_id; |
| 17485 |
} |
| 17486 |
} |
| 17487 |
}; |
| 17488 |
jQuery.each(map, function (key, data) { |
| 17489 |
// Use `defineProperty` because `get property()` fails during the `Marionette...extend`. |
| 17490 |
(0, _defineProperty2.default)(_this8.config, key, { |
| 17491 |
get: function get() { |
| 17492 |
var replacement = data.replacement ? 'elementor.config.document.' + data.replacement : ''; |
| 17493 |
elementorCommon.helpers.softDeprecated('elementor.config.' + key, '2.9.0', replacement); // return from current document. |
| 17494 |
|
| 17495 |
return data.value(); |
| 17496 |
}, |
| 17497 |
set: function set() { |
| 17498 |
elementorCommon.helpers.softDeprecated('elementor.config.' + key, '2.9.0', 'elementor.config.document.' + data.replacement); |
| 17499 |
throw Error('Deprecated'); |
| 17500 |
} |
| 17501 |
}); |
| 17502 |
}); |
| 17503 |
(0, _defineProperty2.default)(this.config.settings, 'page', { |
| 17504 |
get: function get() { |
| 17505 |
elementorCommon.helpers.softDeprecated('elementor.config.settings.page', '2.9.0', 'elementor.config.document.settings'); |
| 17506 |
return elementor.config.document.settings; |
| 17507 |
} |
| 17508 |
}); |
| 17509 |
(0, _defineProperty2.default)(this.config, 'widgets', { |
| 17510 |
get: function get() { |
| 17511 |
elementorCommon.helpers.softDeprecated('elementor.config.widgets', '2.9.0', 'elementor.widgetsCache'); |
| 17512 |
return elementor.widgetsCache; |
| 17513 |
} |
| 17514 |
}); |
| 17515 |
(0, _defineProperty2.default)(this, '$previewElementorEl', { |
| 17516 |
get: function get() { |
| 17517 |
elementorCommon.helpers.softDeprecated('elementor.$previewElementorEl', '2.9.4', 'elementor.documents.getCurrent().$element'); |
| 17518 |
return elementor.documents.getCurrent().$element; |
| 17519 |
} |
| 17520 |
}); |
| 17521 |
} |
| 17522 |
}, { |
| 17523 |
key: "toggleDocumentCssFiles", |
| 17524 |
value: function toggleDocumentCssFiles(document, state) { |
| 17525 |
var selectors = ["#elementor-post-".concat(document.config.id, "-css"), "#elementor-preview-".concat(document.config.revisions.current_id)], |
| 17526 |
$files = this.$previewContents.find(selectors.join(',')), |
| 17527 |
type = state ? 'text/css' : 'elementor/disabled-css'; |
| 17528 |
$files.attr({ |
| 17529 |
type: type |
| 17530 |
}); |
| 17531 |
} |
| 17532 |
}, { |
| 17533 |
key: "debug", |
| 17534 |
get: function get() { |
| 17535 |
elementorCommon.helpers.softDeprecated('elementor.debug', '3.0.0', 'elementorCommon.debug'); |
| 17536 |
return elementorCommon.debug; |
| 17537 |
} |
| 17538 |
/** |
| 17539 |
* Exporting modules that can be used externally |
| 17540 |
* TODO: All of the following entries should move to `elementorModules.editor` |
| 17541 |
*/ |
| 17542 |
|
| 17543 |
}]); |
| 17544 |
return EditorBase; |
| 17545 |
}(Marionette.Application); |
| 17546 |
|
| 17547 |
exports.default = EditorBase; |
| 17548 |
|
| 17549 |
/***/ }), |
| 17550 |
/* 420 */ |
| 17551 |
/***/ (function(module, exports, __webpack_require__) { |
| 17552 |
|
| 17553 |
"use strict"; |
| 17554 |
|
| 17555 |
|
| 17556 |
var _interopRequireDefault = __webpack_require__(0); |
| 17557 |
|
| 17558 |
var _Object$defineProperty = __webpack_require__(1); |
| 17559 |
|
| 17560 |
_Object$defineProperty(exports, "__esModule", { |
| 17561 |
value: true |
| 17562 |
}); |
| 17563 |
|
| 17564 |
exports.default = void 0; |
| 17565 |
|
| 17566 |
__webpack_require__(183); |
| 17567 |
|
| 17568 |
var _regenerator = _interopRequireDefault(__webpack_require__(82)); |
| 17569 |
|
| 17570 |
__webpack_require__(66); |
| 17571 |
|
| 17572 |
var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(83)); |
| 17573 |
|
| 17574 |
var _values = _interopRequireDefault(__webpack_require__(55)); |
| 17575 |
|
| 17576 |
__webpack_require__(147); |
| 17577 |
|
| 17578 |
__webpack_require__(117); |
| 17579 |
|
| 17580 |
__webpack_require__(72); |
| 17581 |
|
| 17582 |
var _toConsumableArray2 = _interopRequireDefault(__webpack_require__(299)); |
| 17583 |
|
| 17584 |
var _classCallCheck2 = _interopRequireDefault(__webpack_require__(2)); |
| 17585 |
|
| 17586 |
var _createClass2 = _interopRequireDefault(__webpack_require__(3)); |
| 17587 |
|
| 17588 |
var _get2 = _interopRequireDefault(__webpack_require__(26)); |
| 17589 |
|
| 17590 |
var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(16)); |
| 17591 |
|
| 17592 |
var _inherits2 = _interopRequireDefault(__webpack_require__(4)); |
| 17593 |
|
| 17594 |
var _createSuper2 = _interopRequireDefault(__webpack_require__(5)); |
| 17595 |
|
| 17596 |
var _baseData = _interopRequireDefault(__webpack_require__(127)); |
| 17597 |
|
| 17598 |
var _colorPicker = _interopRequireDefault(__webpack_require__(301)); |
| 17599 |
|
| 17600 |
var _default = /*#__PURE__*/function (_ControlBaseDataView) { |
| 17601 |
(0, _inherits2.default)(_default, _ControlBaseDataView); |
| 17602 |
|
| 17603 |
var _super = (0, _createSuper2.default)(_default); |
| 17604 |
|
| 17605 |
function _default() { |
| 17606 |
(0, _classCallCheck2.default)(this, _default); |
| 17607 |
return _super.apply(this, arguments); |
| 17608 |
} |
| 17609 |
|
| 17610 |
(0, _createClass2.default)(_default, [{ |
| 17611 |
key: "ui", |
| 17612 |
value: function ui() { |
| 17613 |
var ui = (0, _get2.default)((0, _getPrototypeOf2.default)(_default.prototype), "ui", this).call(this); |
| 17614 |
ui.pickerContainer = '.elementor-color-picker-placeholder'; |
| 17615 |
return ui; |
| 17616 |
} |
| 17617 |
}, { |
| 17618 |
key: "applySavedValue", |
| 17619 |
value: function applySavedValue() { |
| 17620 |
// Gets the current OR default value of the control. |
| 17621 |
var currentValue = this.getCurrentValue(); |
| 17622 |
|
| 17623 |
if (this.colorPicker) { |
| 17624 |
// When there is a global set on the control but there is no value/it doesn't exist, don't show a value. |
| 17625 |
if (currentValue) { |
| 17626 |
var _this$colorPicker$pic; |
| 17627 |
|
| 17628 |
// Set the picker color without triggering the 'onChange' event. |
| 17629 |
var parsedColor = this.colorPicker.picker._parseLocalColor(currentValue); |
| 17630 |
|
| 17631 |
(_this$colorPicker$pic = this.colorPicker.picker).setHSVA.apply(_this$colorPicker$pic, (0, _toConsumableArray2.default)(parsedColor.values).concat([false])); |
| 17632 |
} else { |
| 17633 |
this.colorPicker.picker._clearColor(true); |
| 17634 |
} |
| 17635 |
} else { |
| 17636 |
this.initPicker(); |
| 17637 |
} |
| 17638 |
|
| 17639 |
this.$el.toggleClass('e-control-color--no-value', !currentValue); |
| 17640 |
} |
| 17641 |
}, { |
| 17642 |
key: "initPicker", |
| 17643 |
value: function initPicker() { |
| 17644 |
var _this$model$get, |
| 17645 |
_this = this; |
| 17646 |
|
| 17647 |
var options = { |
| 17648 |
picker: { |
| 17649 |
el: this.ui.pickerContainer[0], |
| 17650 |
default: this.getCurrentValue(), |
| 17651 |
components: { |
| 17652 |
opacity: this.model.get('alpha') |
| 17653 |
}, |
| 17654 |
defaultRepresentation: 'HEX' |
| 17655 |
}, |
| 17656 |
// Don't create the add button in the Global Settings color pickers. |
| 17657 |
addButton: (_this$model$get = this.model.get('global')) === null || _this$model$get === void 0 ? void 0 : _this$model$get.active, |
| 17658 |
onChange: function onChange() { |
| 17659 |
return _this.onPickerChange(); |
| 17660 |
}, |
| 17661 |
onClear: function onClear() { |
| 17662 |
return _this.onPickerClear(); |
| 17663 |
}, |
| 17664 |
onAddButtonClick: function onAddButtonClick() { |
| 17665 |
return _this.onAddGlobalButtonClick(); |
| 17666 |
} |
| 17667 |
}; |
| 17668 |
this.colorPicker = new _colorPicker.default(options); |
| 17669 |
this.$pickerButton = jQuery(this.colorPicker.picker.getRoot().button); |
| 17670 |
this.addTipsyToPickerButton(); |
| 17671 |
this.$pickerButton.on('click', function () { |
| 17672 |
return _this.onPickerButtonClick(); |
| 17673 |
}); |
| 17674 |
jQuery(this.colorPicker.picker.getRoot().root).addClass('elementor-control-unit-1 elementor-control-tag-area'); |
| 17675 |
} |
| 17676 |
}, { |
| 17677 |
key: "addTipsyToPickerButton", |
| 17678 |
value: function addTipsyToPickerButton() { |
| 17679 |
var _this2 = this; |
| 17680 |
|
| 17681 |
this.$pickerButton.tipsy({ |
| 17682 |
title: function title() { |
| 17683 |
var currentValue = _this2.getCurrentValue(); // If there is a global enabled for the control, but the global has no value. |
| 17684 |
|
| 17685 |
|
| 17686 |
if (_this2.getGlobalKey() && !currentValue) { |
| 17687 |
currentValue = "".concat(elementor.translate('invalid'), " ").concat(elementor.translate('global_color')); |
| 17688 |
} |
| 17689 |
|
| 17690 |
return currentValue || ''; |
| 17691 |
}, |
| 17692 |
offset: 4, |
| 17693 |
gravity: function gravity() { |
| 17694 |
return 's'; |
| 17695 |
} |
| 17696 |
}); |
| 17697 |
} |
| 17698 |
}, { |
| 17699 |
key: "getGlobalMeta", |
| 17700 |
value: function getGlobalMeta() { |
| 17701 |
return { |
| 17702 |
commandName: this.getGlobalCommand(), |
| 17703 |
key: this.model.get('name'), |
| 17704 |
controlType: 'colors', |
| 17705 |
route: 'panel/global/global-colors' |
| 17706 |
}; |
| 17707 |
} |
| 17708 |
}, { |
| 17709 |
key: "getNameAlreadyExistsMessage", |
| 17710 |
value: function getNameAlreadyExistsMessage() { |
| 17711 |
return '<i class="eicon-info-circle"></i> ' + elementor.translate('global_color_already_exists'); |
| 17712 |
} |
| 17713 |
}, { |
| 17714 |
key: "getConfirmTextMessage", |
| 17715 |
value: function getConfirmTextMessage() { |
| 17716 |
return elementor.translate('global_color_confirm_text'); |
| 17717 |
} |
| 17718 |
}, { |
| 17719 |
key: "getAddGlobalConfirmMessage", |
| 17720 |
value: function getAddGlobalConfirmMessage(globalColors) { |
| 17721 |
var colorTitle = elementor.translate('new_global_color'), |
| 17722 |
currentValue = this.getCurrentValue(), |
| 17723 |
$message = jQuery('<div>', { |
| 17724 |
class: 'e-global__confirm-message' |
| 17725 |
}), |
| 17726 |
$messageText = jQuery('<div>', { |
| 17727 |
class: 'e-global__confirm-message-text' |
| 17728 |
}), |
| 17729 |
$inputWrapper = jQuery('<div>', { |
| 17730 |
class: 'e-global__confirm-input-wrapper' |
| 17731 |
}), |
| 17732 |
$colorPreview = jQuery('<div>', { |
| 17733 |
class: 'e-global__color-preview', |
| 17734 |
style: 'background-color: ' + currentValue |
| 17735 |
}), |
| 17736 |
$input = jQuery('<input>', { |
| 17737 |
type: 'text', |
| 17738 |
name: 'global-name', |
| 17739 |
placeholder: colorTitle |
| 17740 |
}).val(colorTitle); |
| 17741 |
var messageContent; // Check if the color already exists in the global colors, and display an appropriate message. |
| 17742 |
|
| 17743 |
for (var _i = 0, _Object$values = (0, _values.default)(globalColors); _i < _Object$values.length; _i++) { |
| 17744 |
var globalColor = _Object$values[_i]; |
| 17745 |
|
| 17746 |
if (currentValue === globalColor.value) { |
| 17747 |
messageContent = this.getNameAlreadyExistsMessage(); |
| 17748 |
break; |
| 17749 |
} else if (colorTitle === globalColor.title) { |
| 17750 |
messageContent = this.getConfirmTextMessage(); |
| 17751 |
break; |
| 17752 |
} else { |
| 17753 |
messageContent = elementor.translate('global_color_confirm_text'); |
| 17754 |
} |
| 17755 |
} |
| 17756 |
|
| 17757 |
$messageText.html(messageContent); |
| 17758 |
$inputWrapper.append($colorPreview, $input); |
| 17759 |
$message.append($messageText, $inputWrapper); |
| 17760 |
return $message; |
| 17761 |
} |
| 17762 |
}, { |
| 17763 |
key: "getGlobalCommand", |
| 17764 |
value: function getGlobalCommand() { |
| 17765 |
return 'globals/colors'; |
| 17766 |
} // The globalData parameter is received from the Data API. |
| 17767 |
|
| 17768 |
}, { |
| 17769 |
key: "createGlobalItemMarkup", |
| 17770 |
value: function createGlobalItemMarkup(globalData) { |
| 17771 |
var $color = jQuery('<div>', { |
| 17772 |
class: 'e-global__preview-item e-global__color', |
| 17773 |
'data-global-id': globalData.id |
| 17774 |
}), |
| 17775 |
$colorPreview = jQuery('<div>', { |
| 17776 |
class: 'e-global__color-preview', |
| 17777 |
style: 'background-color: ' + globalData.value |
| 17778 |
}), |
| 17779 |
$colorTitle = jQuery('<span>', { |
| 17780 |
class: 'e-global__color-title' |
| 17781 |
}).html(globalData.title), |
| 17782 |
$colorHex = jQuery('<span>', { |
| 17783 |
class: 'e-global__color-hex' |
| 17784 |
}).html(globalData.value); |
| 17785 |
$color.append($colorPreview, $colorTitle, $colorHex); |
| 17786 |
return $color; |
| 17787 |
} |
| 17788 |
}, { |
| 17789 |
key: "getGlobalsList", |
| 17790 |
value: function () { |
| 17791 |
var _getGlobalsList = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() { |
| 17792 |
var result; |
| 17793 |
return _regenerator.default.wrap(function _callee$(_context) { |
| 17794 |
while (1) { |
| 17795 |
switch (_context.prev = _context.next) { |
| 17796 |
case 0: |
| 17797 |
_context.next = 2; |
| 17798 |
return $e.data.get(this.getGlobalCommand()); |
| 17799 |
|
| 17800 |
case 2: |
| 17801 |
result = _context.sent; |
| 17802 |
return _context.abrupt("return", result.data); |
| 17803 |
|
| 17804 |
case 4: |
| 17805 |
case "end": |
| 17806 |
return _context.stop(); |
| 17807 |
} |
| 17808 |
} |
| 17809 |
}, _callee, this); |
| 17810 |
})); |
| 17811 |
|
| 17812 |
function getGlobalsList() { |
| 17813 |
return _getGlobalsList.apply(this, arguments); |
| 17814 |
} |
| 17815 |
|
| 17816 |
return getGlobalsList; |
| 17817 |
}() // Create the markup for the colors in the global select dropdown. |
| 17818 |
|
| 17819 |
}, { |
| 17820 |
key: "buildGlobalsList", |
| 17821 |
value: function buildGlobalsList(globalColors) { |
| 17822 |
var _this3 = this; |
| 17823 |
|
| 17824 |
var $globalColorsPreviewContainer = jQuery('<div>', { |
| 17825 |
class: 'e-global__preview-items-container' |
| 17826 |
}); |
| 17827 |
(0, _values.default)(globalColors).forEach(function (color) { |
| 17828 |
if (!color.value) { |
| 17829 |
return; |
| 17830 |
} |
| 17831 |
|
| 17832 |
var $color = _this3.createGlobalItemMarkup(color); |
| 17833 |
|
| 17834 |
$globalColorsPreviewContainer.append($color); |
| 17835 |
}); |
| 17836 |
this.ui.$globalColorsPreviewContainer = $globalColorsPreviewContainer; |
| 17837 |
return $globalColorsPreviewContainer; |
| 17838 |
} |
| 17839 |
}, { |
| 17840 |
key: "onPickerChange", |
| 17841 |
value: function onPickerChange() { |
| 17842 |
this.setValue(this.colorPicker.picker.getColor().toHEXA().toString()); |
| 17843 |
|
| 17844 |
if (!this.isCustom) { |
| 17845 |
this.triggerMethod('value:type:change'); |
| 17846 |
this.colorPicker.toggleClearButtonState(true); |
| 17847 |
|
| 17848 |
if (this.$el.hasClass('e-control-color--no-value')) { |
| 17849 |
this.$el.removeClass('e-control-color--no-value'); |
| 17850 |
} |
| 17851 |
|
| 17852 |
this.isCustom = true; |
| 17853 |
} |
| 17854 |
} |
| 17855 |
}, { |
| 17856 |
key: "onPickerClear", |
| 17857 |
value: function onPickerClear() { |
| 17858 |
this.isCustom = false; // Empty the value saved in the control. |
| 17859 |
|
| 17860 |
this.setValue(''); // Adjust the Global select box text according to the cleared value. |
| 17861 |
|
| 17862 |
this.triggerMethod('value:type:change'); |
| 17863 |
this.applySavedValue(); |
| 17864 |
this.colorPicker.toggleClearButtonState(false); |
| 17865 |
} |
| 17866 |
}, { |
| 17867 |
key: "onPickerButtonClick", |
| 17868 |
value: function onPickerButtonClick() { |
| 17869 |
if (this.getGlobalKey()) { |
| 17870 |
this.triggerMethod('unset:global:value'); |
| 17871 |
} else if (this.isGlobalActive() && !this.getControlValue() && this.getGlobalDefault()) { |
| 17872 |
this.triggerMethod('unlink:global:default'); |
| 17873 |
} // If there is a value in the control, set the clear button to active, if not, deactivate it. |
| 17874 |
|
| 17875 |
|
| 17876 |
this.colorPicker.toggleClearButtonState(!!this.getCurrentValue()); |
| 17877 |
} |
| 17878 |
}, { |
| 17879 |
key: "onAddGlobalButtonClick", |
| 17880 |
value: function onAddGlobalButtonClick() { |
| 17881 |
var _this4 = this; |
| 17882 |
|
| 17883 |
this.getGlobalsList().then(function (globalsList) { |
| 17884 |
_this4.globalsList = globalsList; |
| 17885 |
|
| 17886 |
_this4.triggerMethod('add:global:to:list', _this4.getAddGlobalConfirmMessage(globalsList)); |
| 17887 |
}); |
| 17888 |
} |
| 17889 |
}, { |
| 17890 |
key: "onBeforeDestroy", |
| 17891 |
value: function onBeforeDestroy() { |
| 17892 |
if (this.colorPicker) { |
| 17893 |
this.colorPicker.destroy(); |
| 17894 |
} |
| 17895 |
} |
| 17896 |
}]); |
| 17897 |
return _default; |
| 17898 |
}(_baseData.default); |
| 17899 |
|
| 17900 |
exports.default = _default; |
| 17901 |
|
| 17902 |
/***/ }), |
| 17903 |
/* 421 */ |
| 17904 |
/***/ (function(module, exports, __webpack_require__) { |
| 17905 |
|
| 17906 |
"use strict"; |
| 17907 |
|
| 17908 |
|
| 17909 |
var _interopRequireDefault = __webpack_require__(0); |
| 17910 |
|
| 17911 |
var _defineProperty2 = _interopRequireDefault(__webpack_require__(28)); |
| 17912 |
|
| 17913 |
var _keys = _interopRequireDefault(__webpack_require__(23)); |
| 17914 |
|
| 17915 |
__webpack_require__(39); |
| 17916 |
|
| 17917 |
__webpack_require__(25); |
| 17918 |
|
| 17919 |
var TagPanelView = __webpack_require__(422); |
| 17920 |
|
| 17921 |
module.exports = Marionette.Behavior.extend({ |
| 17922 |
tagView: null, |
| 17923 |
listenerAttached: false, |
| 17924 |
initialize: function initialize() { |
| 17925 |
if (!this.listenerAttached) { |
| 17926 |
this.listenTo(this.view.options.container.settings, 'change:external:__dynamic__', this.onAfterExternalChange); |
| 17927 |
this.listenerAttached = true; |
| 17928 |
} |
| 17929 |
}, |
| 17930 |
renderTools: function renderTools() { |
| 17931 |
var _this = this; |
| 17932 |
|
| 17933 |
if (this.getOption('dynamicSettings').default) { |
| 17934 |
return; |
| 17935 |
} |
| 17936 |
|
| 17937 |
var $dynamicSwitcher = jQuery(Marionette.Renderer.render('#tmpl-elementor-control-dynamic-switcher')); |
| 17938 |
$dynamicSwitcher.on('click', function (event) { |
| 17939 |
return _this.onDynamicSwitcherClick(event); |
| 17940 |
}); |
| 17941 |
this.$el.find('.elementor-control-dynamic-switcher-wrapper').append($dynamicSwitcher); |
| 17942 |
this.ui.dynamicSwitcher = $dynamicSwitcher; |
| 17943 |
|
| 17944 |
if ('color' === this.view.model.get('type')) { |
| 17945 |
if (this.view.colorPicker) { |
| 17946 |
this.moveDynamicSwitcherToColorPicker(); |
| 17947 |
} else { |
| 17948 |
setTimeout(function () { |
| 17949 |
return _this.moveDynamicSwitcherToColorPicker(); |
| 17950 |
}); |
| 17951 |
} |
| 17952 |
} // Add a Tipsy Tooltip to the Dynamic Switcher |
| 17953 |
|
| 17954 |
|
| 17955 |
this.ui.dynamicSwitcher.tipsy({ |
| 17956 |
title: function title() { |
| 17957 |
return this.getAttribute('data-tooltip'); |
| 17958 |
}, |
| 17959 |
gravity: 's' |
| 17960 |
}); |
| 17961 |
}, |
| 17962 |
moveDynamicSwitcherToColorPicker: function moveDynamicSwitcherToColorPicker() { |
| 17963 |
var $colorPickerToolsContainer = this.view.colorPicker.$pickerToolsContainer; |
| 17964 |
this.ui.dynamicSwitcher.removeClass('elementor-control-unit-1').addClass('e-control-tool'); |
| 17965 |
$colorPickerToolsContainer.append(this.ui.dynamicSwitcher); |
| 17966 |
}, |
| 17967 |
toggleDynamicClass: function toggleDynamicClass() { |
| 17968 |
this.$el.toggleClass('elementor-control-dynamic-value', this.isDynamicMode()); |
| 17969 |
}, |
| 17970 |
isDynamicMode: function isDynamicMode() { |
| 17971 |
var dynamicSettings = this.view.container.settings.get('__dynamic__'); |
| 17972 |
return !!(dynamicSettings && dynamicSettings[this.view.model.get('name')]); |
| 17973 |
}, |
| 17974 |
createTagsList: function createTagsList() { |
| 17975 |
var tags = _.groupBy(this.getOption('tags'), 'group'), |
| 17976 |
groups = elementor.dynamicTags.getConfig('groups'), |
| 17977 |
$tagsList = this.ui.tagsList = jQuery('<div>', { |
| 17978 |
class: 'elementor-tags-list' |
| 17979 |
}), |
| 17980 |
$tagsListInner = jQuery('<div>', { |
| 17981 |
class: 'elementor-tags-list__inner' |
| 17982 |
}); |
| 17983 |
|
| 17984 |
$tagsList.append($tagsListInner); |
| 17985 |
jQuery.each(groups, function (groupName) { |
| 17986 |
var groupTags = tags[groupName]; |
| 17987 |
|
| 17988 |
if (!groupTags) { |
| 17989 |
return; |
| 17990 |
} |
| 17991 |
|
| 17992 |
var group = this, |
| 17993 |
$groupTitle = jQuery('<div>', { |
| 17994 |
class: 'elementor-tags-list__group-title' |
| 17995 |
}).text(group.title); |
| 17996 |
$tagsListInner.append($groupTitle); |
| 17997 |
groupTags.forEach(function (tag) { |
| 17998 |
var $tag = jQuery('<div>', { |
| 17999 |
class: 'elementor-tags-list__item' |
| 18000 |
}); |
| 18001 |
$tag.text(tag.title).attr('data-tag-name', tag.name); |
| 18002 |
$tagsListInner.append($tag); |
| 18003 |
}); |
| 18004 |
}); // Create and inject pro dynamic teaser template if Pro is not installed |
| 18005 |
|
| 18006 |
if (!elementor.helpers.hasPro() && (0, _keys.default)(tags).length) { |
| 18007 |
var proTeaser = Marionette.Renderer.render('#tmpl-elementor-dynamic-tags-promo'); |
| 18008 |
$tagsListInner.append(proTeaser); |
| 18009 |
} |
| 18010 |
|
| 18011 |
$tagsListInner.on('click', '.elementor-tags-list__item', this.onTagsListItemClick.bind(this)); |
| 18012 |
elementorCommon.elements.$body.append($tagsList); |
| 18013 |
}, |
| 18014 |
getTagsList: function getTagsList() { |
| 18015 |
if (!this.ui.tagsList) { |
| 18016 |
this.createTagsList(); |
| 18017 |
} |
| 18018 |
|
| 18019 |
return this.ui.tagsList; |
| 18020 |
}, |
| 18021 |
toggleTagsList: function toggleTagsList() { |
| 18022 |
var $tagsList = this.getTagsList(); |
| 18023 |
|
| 18024 |
if ($tagsList.is(':visible')) { |
| 18025 |
$tagsList.hide(); |
| 18026 |
return; |
| 18027 |
} |
| 18028 |
|
| 18029 |
var direction = elementorCommon.config.isRTL ? 'left' : 'right'; |
| 18030 |
$tagsList.show().position({ |
| 18031 |
my: "".concat(direction, " top"), |
| 18032 |
at: "".concat(direction, " bottom+5"), |
| 18033 |
of: this.ui.dynamicSwitcher |
| 18034 |
}); |
| 18035 |
}, |
| 18036 |
setTagView: function setTagView(id, name, settings) { |
| 18037 |
if (this.tagView) { |
| 18038 |
this.tagView.destroy(); |
| 18039 |
} |
| 18040 |
|
| 18041 |
var tagView = this.tagView = new TagPanelView({ |
| 18042 |
id: id, |
| 18043 |
name: name, |
| 18044 |
settings: settings, |
| 18045 |
controlName: this.view.model.get('name'), |
| 18046 |
dynamicSettings: this.getOption('dynamicSettings') |
| 18047 |
}), |
| 18048 |
elementContainer = this.view.options.container, |
| 18049 |
tagViewLabel = elementContainer.controls[tagView.options.controlName].label; |
| 18050 |
tagView.options.container = new elementorModules.editor.Container({ |
| 18051 |
type: 'dynamic', |
| 18052 |
id: id, |
| 18053 |
model: tagView.model, |
| 18054 |
settings: tagView.model, |
| 18055 |
view: tagView, |
| 18056 |
parent: elementContainer, |
| 18057 |
label: elementContainer.label + ' ' + tagViewLabel, |
| 18058 |
controls: tagView.model.options.controls, |
| 18059 |
renderer: elementContainer |
| 18060 |
}); |
| 18061 |
tagView.render(); |
| 18062 |
this.$el.find('.elementor-control-tag-area').after(tagView.el); |
| 18063 |
this.listenTo(tagView, 'remove', this.onTagViewRemove.bind(this)); |
| 18064 |
}, |
| 18065 |
setDefaultTagView: function setDefaultTagView() { |
| 18066 |
var tagData = elementor.dynamicTags.tagTextToTagData(this.getDynamicValue()); |
| 18067 |
this.setTagView(tagData.id, tagData.name, tagData.settings); |
| 18068 |
}, |
| 18069 |
tagViewToTagText: function tagViewToTagText() { |
| 18070 |
var tagView = this.tagView; |
| 18071 |
return elementor.dynamicTags.tagDataToTagText(tagView.getOption('id'), tagView.getOption('name'), tagView.model); |
| 18072 |
}, |
| 18073 |
getDynamicValue: function getDynamicValue() { |
| 18074 |
return this.view.container.dynamic.get(this.view.model.get('name')); |
| 18075 |
}, |
| 18076 |
destroyTagView: function destroyTagView() { |
| 18077 |
if (this.tagView) { |
| 18078 |
this.tagView.destroy(); |
| 18079 |
this.tagView = null; |
| 18080 |
} |
| 18081 |
}, |
| 18082 |
showPromotion: function showPromotion() { |
| 18083 |
var message = elementor.translate('dynamic_promotion_message'); |
| 18084 |
elementor.promotion.showDialog({ |
| 18085 |
headerMessage: elementor.translate('dynamic_content'), |
| 18086 |
message: message, |
| 18087 |
top: '-10', |
| 18088 |
element: this.ui.dynamicSwitcher, |
| 18089 |
actionURL: elementor.config.dynamicPromotionURL |
| 18090 |
}); |
| 18091 |
}, |
| 18092 |
onRender: function onRender() { |
| 18093 |
this.$el.addClass('elementor-control-dynamic'); |
| 18094 |
this.renderTools(); |
| 18095 |
this.toggleDynamicClass(); |
| 18096 |
|
| 18097 |
if (this.isDynamicMode()) { |
| 18098 |
this.setDefaultTagView(); |
| 18099 |
} |
| 18100 |
}, |
| 18101 |
onDynamicSwitcherClick: function onDynamicSwitcherClick(event) { |
| 18102 |
event.stopPropagation(); |
| 18103 |
|
| 18104 |
if (this.getOption('tags').length) { |
| 18105 |
this.toggleTagsList(); |
| 18106 |
} else { |
| 18107 |
this.showPromotion(); |
| 18108 |
} |
| 18109 |
}, |
| 18110 |
onTagsListItemClick: function onTagsListItemClick(event) { |
| 18111 |
var $tag = jQuery(event.currentTarget); |
| 18112 |
this.setTagView(elementorCommon.helpers.getUniqueId(), $tag.data('tagName'), {}); // If an element has an active global value, disable it before applying the dynamic value. |
| 18113 |
|
| 18114 |
if (this.view.getGlobalKey()) { |
| 18115 |
this.view.triggerMethod('unset:global:value'); |
| 18116 |
} |
| 18117 |
|
| 18118 |
if (this.isDynamicMode()) { |
| 18119 |
$e.run('document/dynamic/settings', { |
| 18120 |
container: this.view.options.container, |
| 18121 |
settings: (0, _defineProperty2.default)({}, this.view.model.get('name'), this.tagViewToTagText()) |
| 18122 |
}); |
| 18123 |
} else { |
| 18124 |
$e.run('document/dynamic/enable', { |
| 18125 |
container: this.view.options.container, |
| 18126 |
settings: (0, _defineProperty2.default)({}, this.view.model.get('name'), this.tagViewToTagText()) |
| 18127 |
}); |
| 18128 |
} |
| 18129 |
|
| 18130 |
this.toggleDynamicClass(); |
| 18131 |
this.toggleTagsList(); |
| 18132 |
|
| 18133 |
if (this.tagView.getTagConfig().settings_required) { |
| 18134 |
this.tagView.showSettingsPopup(); |
| 18135 |
} |
| 18136 |
}, |
| 18137 |
onTagViewRemove: function onTagViewRemove() { |
| 18138 |
$e.run('document/dynamic/disable', { |
| 18139 |
container: this.view.options.container, |
| 18140 |
settings: (0, _defineProperty2.default)({}, this.view.model.get('name'), this.tagViewToTagText()) |
| 18141 |
}); |
| 18142 |
this.toggleDynamicClass(); |
| 18143 |
}, |
| 18144 |
onAfterExternalChange: function onAfterExternalChange() { |
| 18145 |
this.destroyTagView(); |
| 18146 |
|
| 18147 |
if (this.isDynamicMode()) { |
| 18148 |
this.setDefaultTagView(); |
| 18149 |
} |
| 18150 |
|
| 18151 |
this.toggleDynamicClass(); |
| 18152 |
}, |
| 18153 |
onDestroy: function onDestroy() { |
| 18154 |
this.destroyTagView(); |
| 18155 |
|
| 18156 |
if (this.ui.tagsList) { |
| 18157 |
this.ui.tagsList.remove(); |
| 18158 |
} |
| 18159 |
} |
| 18160 |
}); |
| 18161 |
|
| 18162 |
/***/ }), |
| 18163 |
/* 422 */ |
| 18164 |
/***/ (function(module, exports, __webpack_require__) { |
| 18165 |
|
| 18166 |
"use strict"; |
| 18167 |
|
| 18168 |
|
| 18169 |
var _interopRequireDefault = __webpack_require__(0); |
| 18170 |
|
| 18171 |
__webpack_require__(39); |
| 18172 |
|
| 18173 |
var _values = _interopRequireDefault(__webpack_require__(55)); |
| 18174 |
|
| 18175 |
var TagControlsStack = __webpack_require__(423); |
| 18176 |
|
| 18177 |
module.exports = Marionette.ItemView.extend({ |
| 18178 |
className: 'elementor-dynamic-cover elementor-input-style', |
| 18179 |
tagControlsStack: null, |
| 18180 |
templateHelpers: function templateHelpers() { |
| 18181 |
var helpers = {}; |
| 18182 |
|
| 18183 |
if (this.model) { |
| 18184 |
helpers.controls = this.model.options.controls; |
| 18185 |
} |
| 18186 |
|
| 18187 |
return helpers; |
| 18188 |
}, |
| 18189 |
ui: { |
| 18190 |
remove: '.elementor-dynamic-cover__remove' |
| 18191 |
}, |
| 18192 |
events: function events() { |
| 18193 |
var events = { |
| 18194 |
'click @ui.remove': 'onRemoveClick' |
| 18195 |
}; |
| 18196 |
|
| 18197 |
if (this.hasSettings()) { |
| 18198 |
events.click = 'onClick'; |
| 18199 |
} |
| 18200 |
|
| 18201 |
return events; |
| 18202 |
}, |
| 18203 |
getTemplate: function getTemplate() { |
| 18204 |
var config = this.getTagConfig(), |
| 18205 |
templateFunction = Marionette.TemplateCache.get('#tmpl-elementor-control-dynamic-cover'), |
| 18206 |
renderedTemplate = Marionette.Renderer.render(templateFunction, { |
| 18207 |
hasSettings: this.hasSettings(), |
| 18208 |
isRemovable: !this.getOption('dynamicSettings').default, |
| 18209 |
title: config.title, |
| 18210 |
content: config.panel_template |
| 18211 |
}); |
| 18212 |
return Marionette.TemplateCache.prototype.compileTemplate(renderedTemplate.trim()); |
| 18213 |
}, |
| 18214 |
getTagConfig: function getTagConfig() { |
| 18215 |
return elementor.dynamicTags.getConfig('tags.' + this.getOption('name')); |
| 18216 |
}, |
| 18217 |
initSettingsPopup: function initSettingsPopup() { |
| 18218 |
var settingsPopupOptions = { |
| 18219 |
className: 'elementor-tag-settings-popup', |
| 18220 |
position: { |
| 18221 |
my: 'left top+5', |
| 18222 |
at: 'left bottom', |
| 18223 |
of: this.$el, |
| 18224 |
autoRefresh: true |
| 18225 |
} |
| 18226 |
}; |
| 18227 |
var settingsPopup = elementorCommon.dialogsManager.createWidget('buttons', settingsPopupOptions); |
| 18228 |
|
| 18229 |
this.getSettingsPopup = function () { |
| 18230 |
return settingsPopup; |
| 18231 |
}; |
| 18232 |
}, |
| 18233 |
hasSettings: function hasSettings() { |
| 18234 |
return !!(0, _values.default)(this.getTagConfig().controls).length; |
| 18235 |
}, |
| 18236 |
showSettingsPopup: function showSettingsPopup() { |
| 18237 |
if (!this.tagControlsStack) { |
| 18238 |
this.initTagControlsStack(); |
| 18239 |
} |
| 18240 |
|
| 18241 |
var settingsPopup = this.getSettingsPopup(); |
| 18242 |
|
| 18243 |
if (settingsPopup.isVisible()) { |
| 18244 |
return; |
| 18245 |
} |
| 18246 |
|
| 18247 |
settingsPopup.show(); |
| 18248 |
}, |
| 18249 |
initTagControlsStack: function initTagControlsStack() { |
| 18250 |
this.tagControlsStack = new TagControlsStack({ |
| 18251 |
model: this.model, |
| 18252 |
controls: this.model.controls, |
| 18253 |
name: this.options.name, |
| 18254 |
controlName: this.options.controlName, |
| 18255 |
container: this.options.container, |
| 18256 |
el: this.getSettingsPopup().getElements('message')[0] |
| 18257 |
}); |
| 18258 |
this.tagControlsStack.render(); |
| 18259 |
}, |
| 18260 |
initModel: function initModel() { |
| 18261 |
this.model = new elementorModules.editor.elements.models.BaseSettings(this.getOption('settings'), { |
| 18262 |
controls: this.getTagConfig().controls |
| 18263 |
}); |
| 18264 |
}, |
| 18265 |
initialize: function initialize() { |
| 18266 |
// The `model` should always be available. |
| 18267 |
this.initModel(); |
| 18268 |
|
| 18269 |
if (!this.hasSettings()) { |
| 18270 |
return; |
| 18271 |
} |
| 18272 |
|
| 18273 |
this.initSettingsPopup(); |
| 18274 |
this.listenTo(this.model, 'change', this.render); |
| 18275 |
}, |
| 18276 |
onClick: function onClick() { |
| 18277 |
this.showSettingsPopup(); |
| 18278 |
}, |
| 18279 |
onRemoveClick: function onRemoveClick(event) { |
| 18280 |
event.stopPropagation(); |
| 18281 |
this.destroy(); |
| 18282 |
this.trigger('remove'); |
| 18283 |
}, |
| 18284 |
onDestroy: function onDestroy() { |
| 18285 |
if (this.hasSettings()) { |
| 18286 |
this.getSettingsPopup().destroy(); |
| 18287 |
} |
| 18288 |
|
| 18289 |
if (this.tagControlsStack) { |
| 18290 |
this.tagControlsStack.destroy(); |
| 18291 |
} |
| 18292 |
} |
| 18293 |
}); |
| 18294 |
|
| 18295 |
/***/ }), |
| 18296 |
/* 423 */ |
| 18297 |
/***/ (function(module, exports, __webpack_require__) { |
| 18298 |
|
| 18299 |
"use strict"; |
| 18300 |
|
| 18301 |
|
| 18302 |
var EmptyView = __webpack_require__(424); |
| 18303 |
|
| 18304 |
module.exports = elementorModules.editor.views.ControlsStack.extend({ |
| 18305 |
activeTab: 'content', |
| 18306 |
template: _.noop, |
| 18307 |
emptyView: EmptyView, |
| 18308 |
isEmpty: function isEmpty() { |
| 18309 |
// Ignore the section control |
| 18310 |
return this.collection.length < 2; |
| 18311 |
}, |
| 18312 |
childViewOptions: function childViewOptions() { |
| 18313 |
return { |
| 18314 |
container: this.options.container |
| 18315 |
}; |
| 18316 |
}, |
| 18317 |
getNamespaceArray: function getNamespaceArray() { |
| 18318 |
var currentPageView = elementor.getPanelView().getCurrentPageView(), |
| 18319 |
eventNamespace = currentPageView.getNamespaceArray(); |
| 18320 |
eventNamespace.push(currentPageView.activeSection); |
| 18321 |
eventNamespace.push(this.getOption('controlName')); |
| 18322 |
eventNamespace.push(this.getOption('name')); |
| 18323 |
return eventNamespace; |
| 18324 |
}, |
| 18325 |
onRenderTemplate: function onRenderTemplate() { |
| 18326 |
this.activateFirstSection(); |
| 18327 |
} |
| 18328 |
}); |
| 18329 |
|
| 18330 |
/***/ }), |
| 18331 |
/* 424 */ |
| 18332 |
/***/ (function(module, exports, __webpack_require__) { |
| 18333 |
|
| 18334 |
"use strict"; |
| 18335 |
|
| 18336 |
|
| 18337 |
module.exports = Marionette.ItemView.extend({ |
| 18338 |
className: 'elementor-tag-controls-stack-empty', |
| 18339 |
template: '#tmpl-elementor-tag-controls-stack-empty' |
| 18340 |
}); |
| 18341 |
|
| 18342 |
/***/ }), |
| 18343 |
/* 425 */ |
| 18344 |
/***/ (function(module, exports, __webpack_require__) { |
| 18345 |
|
| 18346 |
"use strict"; |
| 18347 |
|
| 18348 |
|
| 18349 |
var _interopRequireDefault = __webpack_require__(0); |
| 18350 |
|
| 18351 |
var _Object$defineProperty = __webpack_require__(1); |
| 18352 |
|
| 18353 |
_Object$defineProperty(exports, "__esModule", { |
| 18354 |
value: true |
| 18355 |
}); |
| 18356 |
|
| 18357 |
exports.default = void 0; |
| 18358 |
|
| 18359 |
var _classCallCheck2 = _interopRequireDefault(__webpack_require__(2)); |
| 18360 |
|
| 18361 |
var _createClass2 = _interopRequireDefault(__webpack_require__(3)); |
| 18362 |
|
| 18363 |
var _inherits2 = _interopRequireDefault(__webpack_require__(4)); |
| 18364 |
|
| 18365 |
var _createSuper2 = _interopRequireDefault(__webpack_require__(5)); |
| 18366 |
|
| 18367 |
var ControlBaseDataView = __webpack_require__(127); |
| 18368 |
|
| 18369 |
var _default = /*#__PURE__*/function (_ControlBaseDataView) { |
| 18370 |
(0, _inherits2.default)(_default, _ControlBaseDataView); |
| 18371 |
|
| 18372 |
var _super = (0, _createSuper2.default)(_default); |
| 18373 |
|
| 18374 |
function _default() { |
| 18375 |
(0, _classCallCheck2.default)(this, _default); |
| 18376 |
return _super.apply(this, arguments); |
| 18377 |
} |
| 18378 |
|
| 18379 |
(0, _createClass2.default)(_default, [{ |
| 18380 |
key: "onReady", |
| 18381 |
value: function onReady() { |
| 18382 |
var options = _.extend({ |
| 18383 |
enableTime: true, |
| 18384 |
minuteIncrement: 1 |
| 18385 |
}, this.model.get('picker_options')); |
| 18386 |
|
| 18387 |
this.ui.input.flatpickr(options); |
| 18388 |
} |
| 18389 |
}, { |
| 18390 |
key: "onBeforeDestroy", |
| 18391 |
value: function onBeforeDestroy() { |
| 18392 |
this.ui.input.flatpickr().destroy(); |
| 18393 |
} |
| 18394 |
}]); |
| 18395 |
return _default; |
| 18396 |
}(ControlBaseDataView); |
| 18397 |
|
| 18398 |
exports.default = _default; |
| 18399 |
|
| 18400 |
/***/ }), |
| 18401 |
/* 426 */ |
| 18402 |
/***/ (function(module, exports, __webpack_require__) { |
| 18403 |
|
| 18404 |
"use strict"; |
| 18405 |
|
| 18406 |
|
| 18407 |
var _interopRequireWildcard = __webpack_require__(36); |
| 18408 |
|
| 18409 |
var _interopRequireDefault = __webpack_require__(0); |
| 18410 |
|
| 18411 |
var _Object$defineProperty = __webpack_require__(1); |
| 18412 |
|
| 18413 |
_Object$defineProperty(exports, "__esModule", { |
| 18414 |
value: true |
| 18415 |
}); |
| 18416 |
|
| 18417 |
exports.default = void 0; |
| 18418 |
|
| 18419 |
var _parseInt2 = _interopRequireDefault(__webpack_require__(213)); |
| 18420 |
|
| 18421 |
var _classCallCheck2 = _interopRequireDefault(__webpack_require__(2)); |
| 18422 |
|
| 18423 |
var _createClass2 = _interopRequireDefault(__webpack_require__(3)); |
| 18424 |
|
| 18425 |
var _get2 = _interopRequireDefault(__webpack_require__(26)); |
| 18426 |
|
| 18427 |
var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(16)); |
| 18428 |
|
| 18429 |
var _inherits2 = _interopRequireDefault(__webpack_require__(4)); |
| 18430 |
|
| 18431 |
var _createSuper2 = _interopRequireDefault(__webpack_require__(5)); |
| 18432 |
|
| 18433 |
var _componentBase = _interopRequireDefault(__webpack_require__(85)); |
| 18434 |
|
| 18435 |
var _document = _interopRequireDefault(__webpack_require__(320)); |
| 18436 |
|
| 18437 |
var commands = _interopRequireWildcard(__webpack_require__(432)); |
| 18438 |
|
| 18439 |
var internalCommands = _interopRequireWildcard(__webpack_require__(437)); |
| 18440 |
|
| 18441 |
var Component = /*#__PURE__*/function (_ComponentBase) { |
| 18442 |
(0, _inherits2.default)(Component, _ComponentBase); |
| 18443 |
|
| 18444 |
var _super = (0, _createSuper2.default)(Component); |
| 18445 |
|
| 18446 |
function Component() { |
| 18447 |
(0, _classCallCheck2.default)(this, Component); |
| 18448 |
return _super.apply(this, arguments); |
| 18449 |
} |
| 18450 |
|
| 18451 |
(0, _createClass2.default)(Component, [{ |
| 18452 |
key: "__construct", |
| 18453 |
value: function __construct() { |
| 18454 |
var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; |
| 18455 |
(0, _get2.default)((0, _getPrototypeOf2.default)(Component.prototype), "__construct", this).call(this, args); |
| 18456 |
/** |
| 18457 |
* All the documents. |
| 18458 |
* |
| 18459 |
* @type {Object.<Document>} |
| 18460 |
*/ |
| 18461 |
|
| 18462 |
this.documents = {}; |
| 18463 |
/** |
| 18464 |
* Current document. |
| 18465 |
* |
| 18466 |
* @type {Document} |
| 18467 |
*/ |
| 18468 |
|
| 18469 |
this.currentDocument = null; |
| 18470 |
this.saveInitialDocumentToCache(); |
| 18471 |
} |
| 18472 |
}, { |
| 18473 |
key: "getNamespace", |
| 18474 |
value: function getNamespace() { |
| 18475 |
return 'editor/documents'; |
| 18476 |
} |
| 18477 |
}, { |
| 18478 |
key: "defaultCommands", |
| 18479 |
value: function defaultCommands() { |
| 18480 |
return this.importCommands(commands); |
| 18481 |
} |
| 18482 |
}, { |
| 18483 |
key: "defaultCommandsInternal", |
| 18484 |
value: function defaultCommandsInternal() { |
| 18485 |
return this.importCommands(internalCommands); |
| 18486 |
} |
| 18487 |
/** |
| 18488 |
* Function add(). |
| 18489 |
* |
| 18490 |
* Add's document to the manager. |
| 18491 |
* |
| 18492 |
* @param {Document} document |
| 18493 |
* |
| 18494 |
* @returns {Document} |
| 18495 |
*/ |
| 18496 |
|
| 18497 |
}, { |
| 18498 |
key: "add", |
| 18499 |
value: function add(document) { |
| 18500 |
var id = document.id; // Save the document. |
| 18501 |
|
| 18502 |
this.documents[id] = document; |
| 18503 |
return document; |
| 18504 |
} |
| 18505 |
/** |
| 18506 |
* Function addDocumentByConfig(). |
| 18507 |
* |
| 18508 |
* Add document to manager by config. |
| 18509 |
* |
| 18510 |
* @param {{}} config |
| 18511 |
* |
| 18512 |
* @returns {Document} |
| 18513 |
*/ |
| 18514 |
|
| 18515 |
}, { |
| 18516 |
key: "addDocumentByConfig", |
| 18517 |
value: function addDocumentByConfig(config) { |
| 18518 |
return this.add(new _document.default(config)); |
| 18519 |
} |
| 18520 |
/** |
| 18521 |
* Function get(). |
| 18522 |
* |
| 18523 |
* Get document by id. |
| 18524 |
* |
| 18525 |
* @param {number} id |
| 18526 |
* |
| 18527 |
* @returns {Document|boolean} |
| 18528 |
*/ |
| 18529 |
|
| 18530 |
}, { |
| 18531 |
key: "get", |
| 18532 |
value: function get(id) { |
| 18533 |
if (undefined !== this.documents[id]) { |
| 18534 |
return this.documents[id]; |
| 18535 |
} |
| 18536 |
|
| 18537 |
return false; |
| 18538 |
} |
| 18539 |
/** |
| 18540 |
* Function getCurrent(). |
| 18541 |
* |
| 18542 |
* Return's current document. |
| 18543 |
* |
| 18544 |
* @returns {Document} |
| 18545 |
*/ |
| 18546 |
|
| 18547 |
}, { |
| 18548 |
key: "getCurrent", |
| 18549 |
value: function getCurrent() { |
| 18550 |
return this.currentDocument; |
| 18551 |
} |
| 18552 |
/** |
| 18553 |
* Function getCurrentId(). |
| 18554 |
* |
| 18555 |
* Return's current document id. |
| 18556 |
* |
| 18557 |
* @returns {number} |
| 18558 |
*/ |
| 18559 |
|
| 18560 |
}, { |
| 18561 |
key: "getCurrentId", |
| 18562 |
value: function getCurrentId() { |
| 18563 |
return this.currentDocument.id; |
| 18564 |
} |
| 18565 |
/** |
| 18566 |
* Function setCurrent(). |
| 18567 |
* |
| 18568 |
* set current document by document instance. |
| 18569 |
* |
| 18570 |
* @param {Document} document |
| 18571 |
*/ |
| 18572 |
|
| 18573 |
}, { |
| 18574 |
key: "setCurrent", |
| 18575 |
value: function setCurrent(document) { |
| 18576 |
if (undefined === this.documents[document.id]) { |
| 18577 |
throw Error("The document with id: '".concat(document.id, "' does not exist/loaded")); |
| 18578 |
} |
| 18579 |
|
| 18580 |
if (this.currentDocument) { |
| 18581 |
this.currentDocument.editor.status = 'closed'; |
| 18582 |
} |
| 18583 |
|
| 18584 |
this.currentDocument = this.documents[document.id]; |
| 18585 |
this.currentDocument.editor.status = 'open'; |
| 18586 |
elementorCommon.ajax.addRequestConstant('editor_post_id', document.id); |
| 18587 |
} |
| 18588 |
}, { |
| 18589 |
key: "isCurrent", |
| 18590 |
value: function isCurrent(id) { |
| 18591 |
return (0, _parseInt2.default)(id) === this.currentDocument.id; |
| 18592 |
} |
| 18593 |
}, { |
| 18594 |
key: "unsetCurrent", |
| 18595 |
value: function unsetCurrent() { |
| 18596 |
this.currentDocument = null; |
| 18597 |
elementorCommon.ajax.addRequestConstant('editor_post_id', null); |
| 18598 |
} |
| 18599 |
}, { |
| 18600 |
key: "request", |
| 18601 |
value: function request(id) { |
| 18602 |
return elementorCommon.ajax.load(this.getRequestArgs(id), true); |
| 18603 |
} |
| 18604 |
}, { |
| 18605 |
key: "invalidateCache", |
| 18606 |
value: function invalidateCache(id) { |
| 18607 |
elementorCommon.ajax.invalidateCache(this.getRequestArgs(id)); |
| 18608 |
} |
| 18609 |
}, { |
| 18610 |
key: "getRequestArgs", |
| 18611 |
value: function getRequestArgs(id) { |
| 18612 |
id = (0, _parseInt2.default)(id); |
| 18613 |
return { |
| 18614 |
action: 'get_document_config', |
| 18615 |
unique_id: "document-".concat(id), |
| 18616 |
data: { |
| 18617 |
id: id |
| 18618 |
}, |
| 18619 |
success: function success(config) { |
| 18620 |
return config; |
| 18621 |
}, |
| 18622 |
error: function error(data) { |
| 18623 |
var message; |
| 18624 |
|
| 18625 |
if (_.isString(data)) { |
| 18626 |
message = data; |
| 18627 |
} else if (data.statusText) { |
| 18628 |
message = elementor.createAjaxErrorMessage(data); |
| 18629 |
|
| 18630 |
if (0 === data.readyState) { |
| 18631 |
message += ' ' + elementor.translate('Cannot load editor'); |
| 18632 |
} |
| 18633 |
} else if (data[0] && data[0].code) { |
| 18634 |
message = elementor.translate('server_error') + ' ' + data[0].code; |
| 18635 |
} |
| 18636 |
|
| 18637 |
alert(message); |
| 18638 |
} |
| 18639 |
}; |
| 18640 |
} |
| 18641 |
/** |
| 18642 |
* Temp: Don't request initial document via ajax. |
| 18643 |
* Keep the event `elementor:init` before `preview:loaded`. |
| 18644 |
*/ |
| 18645 |
|
| 18646 |
}, { |
| 18647 |
key: "saveInitialDocumentToCache", |
| 18648 |
value: function saveInitialDocumentToCache() { |
| 18649 |
var document = elementor.config.initial_document; |
| 18650 |
elementorCommon.ajax.addRequestCache(this.getRequestArgs(document.id), document); |
| 18651 |
} |
| 18652 |
}]); |
| 18653 |
return Component; |
| 18654 |
}(_componentBase.default); |
| 18655 |
|
| 18656 |
exports.default = Component; |
| 18657 |
|
| 18658 |
/***/ }), |
| 18659 |
/* 427 */ |
| 18660 |
/***/ (function(module, exports, __webpack_require__) { |
| 18661 |
|
| 18662 |
"use strict"; |
| 18663 |
|
| 18664 |
|
| 18665 |
var _interopRequireDefault = __webpack_require__(0); |
| 18666 |
|
| 18667 |
var _Object$defineProperty = __webpack_require__(1); |
| 18668 |
|
| 18669 |
_Object$defineProperty(exports, "__esModule", { |
| 18670 |
value: true |
| 18671 |
}); |
| 18672 |
|
| 18673 |
exports.default = void 0; |
| 18674 |
|
| 18675 |
var _isArray = _interopRequireDefault(__webpack_require__(84)); |
| 18676 |
|
| 18677 |
__webpack_require__(25); |
| 18678 |
|
| 18679 |
var _classCallCheck2 = _interopRequireDefault(__webpack_require__(2)); |
| 18680 |
|
| 18681 |
var _createClass2 = _interopRequireDefault(__webpack_require__(3)); |
| 18682 |
|
| 18683 |
var _defineProperty2 = _interopRequireDefault(__webpack_require__(28)); |
| 18684 |
|
| 18685 |
var _itemModel = _interopRequireDefault(__webpack_require__(428)); |
| 18686 |
|
| 18687 |
/** |
| 18688 |
* TODO: consider refactor this class. |
| 18689 |
* TODO: should be `Document/History` component. |
| 18690 |
* TODO: should be attached to elementor.history.history + BC. |
| 18691 |
*/ |
| 18692 |
var HistoryManager = /*#__PURE__*/function () { |
| 18693 |
function HistoryManager(document) { |
| 18694 |
(0, _classCallCheck2.default)(this, HistoryManager); |
| 18695 |
(0, _defineProperty2.default)(this, "currentItemID", null); |
| 18696 |
(0, _defineProperty2.default)(this, "items", new Backbone.Collection([], { |
| 18697 |
model: _itemModel.default |
| 18698 |
})); |
| 18699 |
(0, _defineProperty2.default)(this, "active", true); |
| 18700 |
(0, _defineProperty2.default)(this, "translations", { |
| 18701 |
add: elementor.translate('added'), |
| 18702 |
change: elementor.translate('edited'), |
| 18703 |
disable: elementor.translate('disabled'), |
| 18704 |
duplicate: elementor.translate('duplicate'), |
| 18705 |
enable: elementor.translate('enabled'), |
| 18706 |
move: elementor.translate('moved'), |
| 18707 |
paste: elementor.translate('pasted'), |
| 18708 |
paste_style: elementor.translate('style_pasted'), |
| 18709 |
remove: elementor.translate('removed'), |
| 18710 |
reset_style: elementor.translate('style_reset'), |
| 18711 |
reset_settings: elementor.translate('settings_reset') |
| 18712 |
}); |
| 18713 |
this.document = document; |
| 18714 |
this.currentItem = new Backbone.Model({ |
| 18715 |
id: 0 |
| 18716 |
}); |
| 18717 |
} |
| 18718 |
|
| 18719 |
(0, _createClass2.default)(HistoryManager, [{ |
| 18720 |
key: "getActionLabel", |
| 18721 |
value: function getActionLabel(itemData) { |
| 18722 |
// TODO: this function should be static. |
| 18723 |
if (this.translations[itemData.type]) { |
| 18724 |
return this.translations[itemData.type]; |
| 18725 |
} |
| 18726 |
|
| 18727 |
return itemData.type; |
| 18728 |
} |
| 18729 |
}, { |
| 18730 |
key: "navigate", |
| 18731 |
value: function navigate(isRedo) { |
| 18732 |
var currentItem = this.items.find(function (model) { |
| 18733 |
return 'not_applied' === model.get('status'); |
| 18734 |
}), |
| 18735 |
currentItemIndex = this.items.indexOf(currentItem), |
| 18736 |
requiredIndex = isRedo ? currentItemIndex - 1 : currentItemIndex + 1; |
| 18737 |
|
| 18738 |
if (!isRedo && !currentItem || requiredIndex < 0 || requiredIndex >= this.items.length) { |
| 18739 |
return; |
| 18740 |
} |
| 18741 |
|
| 18742 |
this.doItem(requiredIndex); |
| 18743 |
} |
| 18744 |
}, { |
| 18745 |
key: "setActive", |
| 18746 |
value: function setActive(value) { |
| 18747 |
this.active = value; |
| 18748 |
} |
| 18749 |
}, { |
| 18750 |
key: "getActive", |
| 18751 |
value: function getActive(value) { |
| 18752 |
return this.active; |
| 18753 |
} |
| 18754 |
}, { |
| 18755 |
key: "getItems", |
| 18756 |
value: function getItems() { |
| 18757 |
return this.items; |
| 18758 |
} |
| 18759 |
}, { |
| 18760 |
key: "startItem", |
| 18761 |
value: function startItem(itemData) { |
| 18762 |
this.currentItemID = this.addItem(itemData); |
| 18763 |
return this.currentItemID; |
| 18764 |
} |
| 18765 |
}, { |
| 18766 |
key: "endItem", |
| 18767 |
value: function endItem(id) { |
| 18768 |
if (this.currentItemID !== id) { |
| 18769 |
return; |
| 18770 |
} |
| 18771 |
|
| 18772 |
this.currentItemID = null; |
| 18773 |
} |
| 18774 |
}, { |
| 18775 |
key: "deleteItem", |
| 18776 |
value: function deleteItem(id) { |
| 18777 |
var item = this.items.findWhere({ |
| 18778 |
id: id |
| 18779 |
}); |
| 18780 |
this.items.remove(item); |
| 18781 |
this.currentItemID = null; |
| 18782 |
} |
| 18783 |
}, { |
| 18784 |
key: "isItemStarted", |
| 18785 |
value: function isItemStarted() { |
| 18786 |
return null !== this.currentItemID; |
| 18787 |
} |
| 18788 |
}, { |
| 18789 |
key: "getCurrentId", |
| 18790 |
value: function getCurrentId() { |
| 18791 |
return this.currentItemID; |
| 18792 |
} |
| 18793 |
}, { |
| 18794 |
key: "addItem", |
| 18795 |
value: function addItem(itemData) { |
| 18796 |
if (!this.getActive()) { |
| 18797 |
return; |
| 18798 |
} |
| 18799 |
|
| 18800 |
if (!this.items.length) { |
| 18801 |
this.items.add({ |
| 18802 |
status: 'not_applied', |
| 18803 |
title: elementor.translate('editing_started'), |
| 18804 |
subTitle: '', |
| 18805 |
action: '', |
| 18806 |
editing_started: true |
| 18807 |
}); |
| 18808 |
} // Remove old applied items from top of list |
| 18809 |
|
| 18810 |
|
| 18811 |
while (this.items.length && 'applied' === this.items.first().get('status')) { |
| 18812 |
this.items.shift(); |
| 18813 |
} |
| 18814 |
|
| 18815 |
var id = this.currentItemID ? this.currentItemID : new Date().getTime(); |
| 18816 |
var currentItem = this.items.findWhere({ |
| 18817 |
id: id |
| 18818 |
}); |
| 18819 |
|
| 18820 |
if (!currentItem) { |
| 18821 |
currentItem = new _itemModel.default({ |
| 18822 |
id: id, |
| 18823 |
title: itemData.title, |
| 18824 |
subTitle: itemData.subTitle, |
| 18825 |
action: this.getActionLabel(itemData), |
| 18826 |
type: itemData.type |
| 18827 |
}); |
| 18828 |
this.startItemTitle = ''; |
| 18829 |
this.startItemAction = ''; |
| 18830 |
} |
| 18831 |
|
| 18832 |
currentItem.get('items').add(itemData, { |
| 18833 |
at: 0 |
| 18834 |
}); |
| 18835 |
this.items.add(currentItem, { |
| 18836 |
at: 0 |
| 18837 |
}); |
| 18838 |
this.updateCurrentItem(currentItem); |
| 18839 |
return id; |
| 18840 |
} |
| 18841 |
}, { |
| 18842 |
key: "doItem", |
| 18843 |
value: function doItem(index) { |
| 18844 |
// Don't track while restoring the item |
| 18845 |
this.setActive(false); |
| 18846 |
var item = this.items.at(index); |
| 18847 |
|
| 18848 |
if ('not_applied' === item.get('status')) { |
| 18849 |
this.undoItem(index); |
| 18850 |
} else { |
| 18851 |
this.redoItem(index); |
| 18852 |
} |
| 18853 |
|
| 18854 |
this.setActive(true); |
| 18855 |
var panel = elementor.getPanelView(), |
| 18856 |
panelPage = panel.getCurrentPageView(), |
| 18857 |
editedElementView = panelPage.getOption('editedElementView'); |
| 18858 |
var viewToScroll; |
| 18859 |
|
| 18860 |
if ($e.routes.isPartOf('panel/editor') && editedElementView) { |
| 18861 |
if (editedElementView.isDestroyed) { |
| 18862 |
// If the the element isn't exist - show the history panel |
| 18863 |
$e.route('panel/history/actions'); |
| 18864 |
} else { |
| 18865 |
// If element exist - render again, maybe the settings has been changed |
| 18866 |
viewToScroll = editedElementView; |
| 18867 |
} |
| 18868 |
} else if (item instanceof Backbone.Model && item.get('items').length) { |
| 18869 |
var historyItem = item.get('items').first(); |
| 18870 |
|
| 18871 |
if (historyItem.get('restore')) { |
| 18872 |
var container = 'sub-add' === historyItem.get('type') ? historyItem.get('data').containerToRestore : historyItem.get('container') || historyItem.get('containers'); |
| 18873 |
|
| 18874 |
if ((0, _isArray.default)(container)) { |
| 18875 |
container = container[0]; |
| 18876 |
} |
| 18877 |
|
| 18878 |
if (container) { |
| 18879 |
viewToScroll = container.lookup().view; |
| 18880 |
} |
| 18881 |
} |
| 18882 |
} |
| 18883 |
|
| 18884 |
$e.internal('document/save/set-is-modified', { |
| 18885 |
status: item.get('id') !== this.document.editor.lastSaveHistoryId |
| 18886 |
}); |
| 18887 |
this.updateCurrentItem(item); |
| 18888 |
|
| 18889 |
if (viewToScroll && !elementor.helpers.isInViewport(viewToScroll.$el[0], elementor.$previewContents.find('html')[0])) { |
| 18890 |
elementor.helpers.scrollToView(viewToScroll.$el); |
| 18891 |
} |
| 18892 |
} |
| 18893 |
}, { |
| 18894 |
key: "undoItem", |
| 18895 |
value: function undoItem(index) { |
| 18896 |
for (var stepNum = 0; stepNum < index; stepNum++) { |
| 18897 |
var item = this.items.at(stepNum); |
| 18898 |
|
| 18899 |
if ('not_applied' === item.get('status')) { |
| 18900 |
item.get('items').each(function (subItem) { |
| 18901 |
var restore = subItem.get('restore'); |
| 18902 |
|
| 18903 |
if (restore) { |
| 18904 |
restore(subItem); |
| 18905 |
} |
| 18906 |
}); |
| 18907 |
item.set('status', 'applied'); |
| 18908 |
} |
| 18909 |
} |
| 18910 |
} |
| 18911 |
}, { |
| 18912 |
key: "redoItem", |
| 18913 |
value: function redoItem(index) { |
| 18914 |
for (var stepNum = this.items.length - 1; stepNum >= index; stepNum--) { |
| 18915 |
var item = this.items.at(stepNum); |
| 18916 |
|
| 18917 |
if ('applied' === item.get('status')) { |
| 18918 |
var reversedSubItems = _.toArray(item.get('items').models).reverse(); |
| 18919 |
|
| 18920 |
_(reversedSubItems).each(function (subItem) { |
| 18921 |
var restore = subItem.get('restore'); |
| 18922 |
|
| 18923 |
if (restore) { |
| 18924 |
restore(subItem, true); |
| 18925 |
} |
| 18926 |
}); |
| 18927 |
|
| 18928 |
item.set('status', 'not_applied'); |
| 18929 |
} |
| 18930 |
} |
| 18931 |
} |
| 18932 |
}, { |
| 18933 |
key: "updateCurrentItem", |
| 18934 |
value: function updateCurrentItem(item) { |
| 18935 |
// Save last selected item. |
| 18936 |
this.currentItem = item; |
| 18937 |
this.updatePanelPageCurrentItem(); |
| 18938 |
} |
| 18939 |
}, { |
| 18940 |
key: "updatePanelPageCurrentItem", |
| 18941 |
value: function updatePanelPageCurrentItem() { |
| 18942 |
if ($e.routes.is('panel/history/actions')) { |
| 18943 |
elementor.getPanelView().getCurrentPageView().getCurrentTab().updateCurrentItem(); |
| 18944 |
} |
| 18945 |
} |
| 18946 |
}]); |
| 18947 |
return HistoryManager; |
| 18948 |
}(); |
| 18949 |
|
| 18950 |
exports.default = HistoryManager; |
| 18951 |
|
| 18952 |
/***/ }), |
| 18953 |
/* 428 */ |
| 18954 |
/***/ (function(module, exports, __webpack_require__) { |
| 18955 |
|
| 18956 |
"use strict"; |
| 18957 |
|
| 18958 |
|
| 18959 |
module.exports = Backbone.Model.extend({ |
| 18960 |
defaults: { |
| 18961 |
id: 0, |
| 18962 |
type: '', |
| 18963 |
status: 'not_applied', |
| 18964 |
title: '', |
| 18965 |
subTitle: '', |
| 18966 |
action: '', |
| 18967 |
history: {} |
| 18968 |
}, |
| 18969 |
initialize: function initialize() { |
| 18970 |
this.set('items', new Backbone.Collection()); |
| 18971 |
} |
| 18972 |
}); |
| 18973 |
|
| 18974 |
/***/ }), |
| 18975 |
/* 429 */ |
| 18976 |
/***/ (function(module, exports, __webpack_require__) { |
| 18977 |
|
| 18978 |
"use strict"; |
| 18979 |
|
| 18980 |
|
| 18981 |
var _interopRequireDefault = __webpack_require__(0); |
| 18982 |
|
| 18983 |
var _Object$defineProperty = __webpack_require__(1); |
| 18984 |
|
| 18985 |
_Object$defineProperty(exports, "__esModule", { |
| 18986 |
value: true |
| 18987 |
}); |
| 18988 |
|
| 18989 |
exports.default = void 0; |
| 18990 |
|
| 18991 |
var _classCallCheck2 = _interopRequireDefault(__webpack_require__(2)); |
| 18992 |
|
| 18993 |
var _createClass2 = _interopRequireDefault(__webpack_require__(3)); |
| 18994 |
|
| 18995 |
var _defineProperty2 = _interopRequireDefault(__webpack_require__(28)); |
| 18996 |
|
| 18997 |
var RevisionsCollection = __webpack_require__(430); |
| 18998 |
/** |
| 18999 |
* TODO: consider refactor this class. |
| 19000 |
* TODO: Rename to RevisionsModule. |
| 19001 |
*/ |
| 19002 |
|
| 19003 |
|
| 19004 |
var RevisionsManager = /*#__PURE__*/function () { |
| 19005 |
function RevisionsManager(document) { |
| 19006 |
(0, _classCallCheck2.default)(this, RevisionsManager); |
| 19007 |
(0, _defineProperty2.default)(this, "document", void 0); |
| 19008 |
(0, _defineProperty2.default)(this, "revisions", void 0); |
| 19009 |
this.document = document; |
| 19010 |
} |
| 19011 |
|
| 19012 |
(0, _createClass2.default)(RevisionsManager, [{ |
| 19013 |
key: "getItems", |
| 19014 |
value: function getItems() { |
| 19015 |
return this.revisions; |
| 19016 |
} |
| 19017 |
}, { |
| 19018 |
key: "requestRevisions", |
| 19019 |
value: function requestRevisions(callback) { |
| 19020 |
var _this = this; |
| 19021 |
|
| 19022 |
if (this.revisions) { |
| 19023 |
callback(this.revisions); |
| 19024 |
return; |
| 19025 |
} |
| 19026 |
|
| 19027 |
elementorCommon.ajax.addRequest('get_revisions', { |
| 19028 |
success: function success(data) { |
| 19029 |
_this.revisions = new RevisionsCollection(data); |
| 19030 |
|
| 19031 |
_this.revisions.on('update', _this.onRevisionsUpdate.bind(_this)); |
| 19032 |
|
| 19033 |
callback(_this.revisions); |
| 19034 |
} |
| 19035 |
}); |
| 19036 |
} |
| 19037 |
}, { |
| 19038 |
key: "setEditorData", |
| 19039 |
value: function setEditorData(data) { |
| 19040 |
var collection = elementor.getPreviewView().collection; |
| 19041 |
collection.reset(data); |
| 19042 |
} |
| 19043 |
}, { |
| 19044 |
key: "getRevisionDataAsync", |
| 19045 |
value: function getRevisionDataAsync(id, options) { |
| 19046 |
_.extend(options, { |
| 19047 |
data: { |
| 19048 |
id: id |
| 19049 |
} |
| 19050 |
}); |
| 19051 |
|
| 19052 |
return elementorCommon.ajax.addRequest('get_revision_data', options); |
| 19053 |
} |
| 19054 |
}, { |
| 19055 |
key: "addRevisions", |
| 19056 |
value: function addRevisions(items) { |
| 19057 |
var _this2 = this; |
| 19058 |
|
| 19059 |
this.requestRevisions(function () { |
| 19060 |
items.forEach(function (item) { |
| 19061 |
var existedModel = _this2.revisions.findWhere({ |
| 19062 |
id: item.id |
| 19063 |
}); |
| 19064 |
|
| 19065 |
if (existedModel) { |
| 19066 |
_this2.revisions.remove(existedModel, { |
| 19067 |
silent: true |
| 19068 |
}); |
| 19069 |
} |
| 19070 |
|
| 19071 |
_this2.revisions.add(item, { |
| 19072 |
silent: true |
| 19073 |
}); |
| 19074 |
}); |
| 19075 |
|
| 19076 |
_this2.revisions.trigger('update'); |
| 19077 |
}); |
| 19078 |
} |
| 19079 |
}, { |
| 19080 |
key: "deleteRevision", |
| 19081 |
value: function deleteRevision(revisionModel, options) { |
| 19082 |
var params = { |
| 19083 |
data: { |
| 19084 |
id: revisionModel.get('id') |
| 19085 |
}, |
| 19086 |
success: function success() { |
| 19087 |
if (options.success) { |
| 19088 |
options.success(); |
| 19089 |
} |
| 19090 |
|
| 19091 |
revisionModel.destroy(); |
| 19092 |
} |
| 19093 |
}; |
| 19094 |
|
| 19095 |
if (options.error) { |
| 19096 |
params.error = options.error; |
| 19097 |
} |
| 19098 |
|
| 19099 |
elementorCommon.ajax.addRequest('delete_revision', params); |
| 19100 |
} |
| 19101 |
}, { |
| 19102 |
key: "onRevisionsUpdate", |
| 19103 |
value: function onRevisionsUpdate() { |
| 19104 |
if ($e.routes.is('panel/history/revisions')) { |
| 19105 |
$e.routes.refreshContainer('panel'); |
| 19106 |
} |
| 19107 |
} |
| 19108 |
}]); |
| 19109 |
return RevisionsManager; |
| 19110 |
}(); |
| 19111 |
|
| 19112 |
exports.default = RevisionsManager; |
| 19113 |
|
| 19114 |
/***/ }), |
| 19115 |
/* 430 */ |
| 19116 |
/***/ (function(module, exports, __webpack_require__) { |
| 19117 |
|
| 19118 |
"use strict"; |
| 19119 |
|
| 19120 |
|
| 19121 |
var RevisionModel = __webpack_require__(431); |
| 19122 |
|
| 19123 |
module.exports = Backbone.Collection.extend({ |
| 19124 |
model: RevisionModel, |
| 19125 |
comparator: function comparator(model) { |
| 19126 |
return -model.get('timestamp'); |
| 19127 |
} |
| 19128 |
}); |
| 19129 |
|
| 19130 |
/***/ }), |
| 19131 |
/* 431 */ |
| 19132 |
/***/ (function(module, exports, __webpack_require__) { |
| 19133 |
|
| 19134 |
"use strict"; |
| 19135 |
|
| 19136 |
|
| 19137 |
var RevisionModel; |
| 19138 |
RevisionModel = Backbone.Model.extend(); |
| 19139 |
|
| 19140 |
RevisionModel.prototype.sync = function () { |
| 19141 |
return null; |
| 19142 |
}; |
| 19143 |
|
| 19144 |
module.exports = RevisionModel; |
| 19145 |
|
| 19146 |
/***/ }), |
| 19147 |
/* 432 */ |
| 19148 |
/***/ (function(module, exports, __webpack_require__) { |
| 19149 |
|
| 19150 |
"use strict"; |
| 19151 |
|
| 19152 |
|
| 19153 |
var _Object$defineProperty = __webpack_require__(1); |
| 19154 |
|
| 19155 |
_Object$defineProperty(exports, "__esModule", { |
| 19156 |
value: true |
| 19157 |
}); |
| 19158 |
|
| 19159 |
_Object$defineProperty(exports, "Close", { |
| 19160 |
enumerable: true, |
| 19161 |
get: function get() { |
| 19162 |
return _close.Close; |
| 19163 |
} |
| 19164 |
}); |
| 19165 |
|
| 19166 |
_Object$defineProperty(exports, "Open", { |
| 19167 |
enumerable: true, |
| 19168 |
get: function get() { |
| 19169 |
return _open.Open; |
| 19170 |
} |
| 19171 |
}); |
| 19172 |
|
| 19173 |
_Object$defineProperty(exports, "Preview", { |
| 19174 |
enumerable: true, |
| 19175 |
get: function get() { |
| 19176 |
return _preview.Preview; |
| 19177 |
} |
| 19178 |
}); |
| 19179 |
|
| 19180 |
_Object$defineProperty(exports, "Switch", { |
| 19181 |
enumerable: true, |
| 19182 |
get: function get() { |
| 19183 |
return _switch.Switch; |
| 19184 |
} |
| 19185 |
}); |
| 19186 |
|
| 19187 |
var _close = __webpack_require__(433); |
| 19188 |
|
| 19189 |
var _open = __webpack_require__(434); |
| 19190 |
|
| 19191 |
var _preview = __webpack_require__(435); |
| 19192 |
|
| 19193 |
var _switch = __webpack_require__(436); |
| 19194 |
|
| 19195 |
/***/ }), |
| 19196 |
/* 433 */ |
| 19197 |
/***/ (function(module, exports, __webpack_require__) { |
| 19198 |
|
| 19199 |
"use strict"; |
| 19200 |
|
| 19201 |
|
| 19202 |
var _interopRequireDefault = __webpack_require__(0); |
| 19203 |
|
| 19204 |
var _Object$defineProperty = __webpack_require__(1); |
| 19205 |
|
| 19206 |
_Object$defineProperty(exports, "__esModule", { |
| 19207 |
value: true |
| 19208 |
}); |
| 19209 |
|
| 19210 |
exports.default = exports.Close = void 0; |
| 19211 |
|
| 19212 |
var _regenerator = _interopRequireDefault(__webpack_require__(82)); |
| 19213 |
|
| 19214 |
__webpack_require__(66); |
| 19215 |
|
| 19216 |
var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(83)); |
| 19217 |
|
| 19218 |
var _classCallCheck2 = _interopRequireDefault(__webpack_require__(2)); |
| 19219 |
|
| 19220 |
var _createClass2 = _interopRequireDefault(__webpack_require__(3)); |
| 19221 |
|
| 19222 |
var _inherits2 = _interopRequireDefault(__webpack_require__(4)); |
| 19223 |
|
| 19224 |
var _createSuper2 = _interopRequireDefault(__webpack_require__(5)); |
| 19225 |
|
| 19226 |
var _commandBase = _interopRequireDefault(__webpack_require__(21)); |
| 19227 |
|
| 19228 |
var Close = /*#__PURE__*/function (_CommandBase) { |
| 19229 |
(0, _inherits2.default)(Close, _CommandBase); |
| 19230 |
|
| 19231 |
var _super = (0, _createSuper2.default)(Close); |
| 19232 |
|
| 19233 |
function Close() { |
| 19234 |
(0, _classCallCheck2.default)(this, Close); |
| 19235 |
return _super.apply(this, arguments); |
| 19236 |
} |
| 19237 |
|
| 19238 |
(0, _createClass2.default)(Close, [{ |
| 19239 |
key: "validateArgs", |
| 19240 |
value: function validateArgs(args) { |
| 19241 |
this.requireArgument('id', args); |
| 19242 |
} |
| 19243 |
}, { |
| 19244 |
key: "apply", |
| 19245 |
value: function () { |
| 19246 |
var _apply = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(args) { |
| 19247 |
var id, mode, onClose, document, deferred; |
| 19248 |
return _regenerator.default.wrap(function _callee$(_context) { |
| 19249 |
while (1) { |
| 19250 |
switch (_context.prev = _context.next) { |
| 19251 |
case 0: |
| 19252 |
id = args.id, mode = args.mode, onClose = args.onClose, document = elementor.documents.get(id); // Already closed. |
| 19253 |
|
| 19254 |
if (!('closed' === document.editor.status)) { |
| 19255 |
_context.next = 3; |
| 19256 |
break; |
| 19257 |
} |
| 19258 |
|
| 19259 |
return _context.abrupt("return", jQuery.Deferred().resolve()); |
| 19260 |
|
| 19261 |
case 3: |
| 19262 |
if (!(!mode && (document.editor.isChanged || document.isDraft()))) { |
| 19263 |
_context.next = 7; |
| 19264 |
break; |
| 19265 |
} |
| 19266 |
|
| 19267 |
deferred = jQuery.Deferred(); |
| 19268 |
this.getConfirmDialog(deferred).show(); |
| 19269 |
return _context.abrupt("return", deferred.promise()); |
| 19270 |
|
| 19271 |
case 7: |
| 19272 |
_context.t0 = mode; |
| 19273 |
_context.next = _context.t0 === 'autosave' ? 10 : _context.t0 === 'save' ? 13 : _context.t0 === 'discard' ? 16 : 19; |
| 19274 |
break; |
| 19275 |
|
| 19276 |
case 10: |
| 19277 |
_context.next = 12; |
| 19278 |
return $e.run('document/save/auto'); |
| 19279 |
|
| 19280 |
case 12: |
| 19281 |
return _context.abrupt("break", 19); |
| 19282 |
|
| 19283 |
case 13: |
| 19284 |
_context.next = 15; |
| 19285 |
return $e.run('document/save/update'); |
| 19286 |
|
| 19287 |
case 15: |
| 19288 |
return _context.abrupt("break", 19); |
| 19289 |
|
| 19290 |
case 16: |
| 19291 |
_context.next = 18; |
| 19292 |
return $e.run('document/save/discard', { |
| 19293 |
document: document |
| 19294 |
}); |
| 19295 |
|
| 19296 |
case 18: |
| 19297 |
return _context.abrupt("break", 19); |
| 19298 |
|
| 19299 |
case 19: |
| 19300 |
$e.internal('editor/documents/unload', { |
| 19301 |
document: document |
| 19302 |
}); |
| 19303 |
|
| 19304 |
if (!onClose) { |
| 19305 |
_context.next = 23; |
| 19306 |
break; |
| 19307 |
} |
| 19308 |
|
| 19309 |
_context.next = 23; |
| 19310 |
return onClose(document); |
| 19311 |
|
| 19312 |
case 23: |
| 19313 |
return _context.abrupt("return", jQuery.Deferred().resolve()); |
| 19314 |
|
| 19315 |
case 24: |
| 19316 |
case "end": |
| 19317 |
return _context.stop(); |
| 19318 |
} |
| 19319 |
} |
| 19320 |
}, _callee, this); |
| 19321 |
})); |
| 19322 |
|
| 19323 |
function apply(_x) { |
| 19324 |
return _apply.apply(this, arguments); |
| 19325 |
} |
| 19326 |
|
| 19327 |
return apply; |
| 19328 |
}() |
| 19329 |
}, { |
| 19330 |
key: "getConfirmDialog", |
| 19331 |
value: function getConfirmDialog(deferred) { |
| 19332 |
var _this = this; |
| 19333 |
|
| 19334 |
if (this.confirmDialog) { |
| 19335 |
return this.confirmDialog; |
| 19336 |
} |
| 19337 |
|
| 19338 |
this.confirmDialog = elementorCommon.dialogsManager.createWidget('confirm', { |
| 19339 |
id: 'elementor-document-save-on-close', |
| 19340 |
headerMessage: elementor.translate('Save Changes'), |
| 19341 |
message: elementor.translate('Would you like to save the changes you\'ve made?'), |
| 19342 |
position: { |
| 19343 |
my: 'center center', |
| 19344 |
at: 'center center' |
| 19345 |
}, |
| 19346 |
strings: { |
| 19347 |
confirm: elementor.translate('Save'), |
| 19348 |
cancel: elementor.translate('Discard') |
| 19349 |
}, |
| 19350 |
onHide: function onHide() { |
| 19351 |
// If still not action chosen. use `defer` because onHide is called before onConfirm/onCancel. |
| 19352 |
_.defer(function () { |
| 19353 |
if (!_this.args.mode) { |
| 19354 |
deferred.reject('Close document has been canceled.'); |
| 19355 |
} |
| 19356 |
}); |
| 19357 |
}, |
| 19358 |
onConfirm: function onConfirm() { |
| 19359 |
_this.args.mode = 'save'; // Re-run with same args. |
| 19360 |
|
| 19361 |
$e.run('editor/documents/close', _this.args).then(function () { |
| 19362 |
deferred.resolve(); |
| 19363 |
}); |
| 19364 |
}, |
| 19365 |
onCancel: function onCancel() { |
| 19366 |
_this.args.mode = 'discard'; // Re-run with same args. |
| 19367 |
|
| 19368 |
$e.run('editor/documents/close', _this.args).then(function () { |
| 19369 |
deferred.resolve(); |
| 19370 |
}); |
| 19371 |
} |
| 19372 |
}); |
| 19373 |
return this.confirmDialog; |
| 19374 |
} |
| 19375 |
}]); |
| 19376 |
return Close; |
| 19377 |
}(_commandBase.default); |
| 19378 |
|
| 19379 |
exports.Close = Close; |
| 19380 |
var _default = Close; |
| 19381 |
exports.default = _default; |
| 19382 |
|
| 19383 |
/***/ }), |
| 19384 |
/* 434 */ |
| 19385 |
/***/ (function(module, exports, __webpack_require__) { |
| 19386 |
|
| 19387 |
"use strict"; |
| 19388 |
|
| 19389 |
|
| 19390 |
var _interopRequireDefault = __webpack_require__(0); |
| 19391 |
|
| 19392 |
var _Object$defineProperty = __webpack_require__(1); |
| 19393 |
|
| 19394 |
_Object$defineProperty(exports, "__esModule", { |
| 19395 |
value: true |
| 19396 |
}); |
| 19397 |
|
| 19398 |
exports.default = exports.Open = void 0; |
| 19399 |
|
| 19400 |
__webpack_require__(25); |
| 19401 |
|
| 19402 |
var _classCallCheck2 = _interopRequireDefault(__webpack_require__(2)); |
| 19403 |
|
| 19404 |
var _createClass2 = _interopRequireDefault(__webpack_require__(3)); |
| 19405 |
|
| 19406 |
var _inherits2 = _interopRequireDefault(__webpack_require__(4)); |
| 19407 |
|
| 19408 |
var _createSuper2 = _interopRequireDefault(__webpack_require__(5)); |
| 19409 |
|
| 19410 |
var _commandBase = _interopRequireDefault(__webpack_require__(21)); |
| 19411 |
|
| 19412 |
var Open = /*#__PURE__*/function (_CommandBase) { |
| 19413 |
(0, _inherits2.default)(Open, _CommandBase); |
| 19414 |
|
| 19415 |
var _super = (0, _createSuper2.default)(Open); |
| 19416 |
|
| 19417 |
function Open() { |
| 19418 |
(0, _classCallCheck2.default)(this, Open); |
| 19419 |
return _super.apply(this, arguments); |
| 19420 |
} |
| 19421 |
|
| 19422 |
(0, _createClass2.default)(Open, [{ |
| 19423 |
key: "validateArgs", |
| 19424 |
value: function validateArgs(args) { |
| 19425 |
this.requireArgument('id', args); |
| 19426 |
} |
| 19427 |
}, { |
| 19428 |
key: "apply", |
| 19429 |
value: function apply(args) { |
| 19430 |
var id = args.id, |
| 19431 |
currentDocument = elementor.documents.getCurrent(); // Already opened. |
| 19432 |
|
| 19433 |
if (currentDocument && id === currentDocument.id) { |
| 19434 |
return jQuery.Deferred().resolve(); |
| 19435 |
} // TODO: move to $e.hooks.ui. |
| 19436 |
|
| 19437 |
|
| 19438 |
if (elementor.loaded) { |
| 19439 |
elementor.$previewContents.find(".elementor-".concat(id)).addClass('loading'); |
| 19440 |
} |
| 19441 |
|
| 19442 |
return elementor.documents.request(id).then(function (config) { |
| 19443 |
elementorCommon.elements.$body.addClass("elementor-editor-".concat(config.type)); // Tell the editor to load the document. |
| 19444 |
|
| 19445 |
$e.internal('editor/documents/load', { |
| 19446 |
config: config |
| 19447 |
}); |
| 19448 |
}).always(function () { |
| 19449 |
// TODO: move to $e.hooks.ui. |
| 19450 |
if (elementor.loaded) { |
| 19451 |
elementor.$previewContents.find(".elementor-".concat(id)).removeClass('loading'); |
| 19452 |
} |
| 19453 |
}); |
| 19454 |
} |
| 19455 |
}]); |
| 19456 |
return Open; |
| 19457 |
}(_commandBase.default); |
| 19458 |
|
| 19459 |
exports.Open = Open; |
| 19460 |
var _default = Open; |
| 19461 |
exports.default = _default; |
| 19462 |
|
| 19463 |
/***/ }), |
| 19464 |
/* 435 */ |
| 19465 |
/***/ (function(module, exports, __webpack_require__) { |
| 19466 |
|
| 19467 |
"use strict"; |
| 19468 |
|
| 19469 |
|
| 19470 |
var _interopRequireDefault = __webpack_require__(0); |
| 19471 |
|
| 19472 |
var _Object$defineProperty = __webpack_require__(1); |
| 19473 |
|
| 19474 |
_Object$defineProperty(exports, "__esModule", { |
| 19475 |
value: true |
| 19476 |
}); |
| 19477 |
|
| 19478 |
exports.default = exports.Preview = void 0; |
| 19479 |
|
| 19480 |
var _regenerator = _interopRequireDefault(__webpack_require__(82)); |
| 19481 |
|
| 19482 |
__webpack_require__(66); |
| 19483 |
|
| 19484 |
var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(83)); |
| 19485 |
|
| 19486 |
var _classCallCheck2 = _interopRequireDefault(__webpack_require__(2)); |
| 19487 |
|
| 19488 |
var _createClass2 = _interopRequireDefault(__webpack_require__(3)); |
| 19489 |
|
| 19490 |
var _inherits2 = _interopRequireDefault(__webpack_require__(4)); |
| 19491 |
|
| 19492 |
var _createSuper2 = _interopRequireDefault(__webpack_require__(5)); |
| 19493 |
|
| 19494 |
var _commandBase = _interopRequireDefault(__webpack_require__(21)); |
| 19495 |
|
| 19496 |
var Preview = /*#__PURE__*/function (_CommandBase) { |
| 19497 |
(0, _inherits2.default)(Preview, _CommandBase); |
| 19498 |
|
| 19499 |
var _super = (0, _createSuper2.default)(Preview); |
| 19500 |
|
| 19501 |
function Preview() { |
| 19502 |
(0, _classCallCheck2.default)(this, Preview); |
| 19503 |
return _super.apply(this, arguments); |
| 19504 |
} |
| 19505 |
|
| 19506 |
(0, _createClass2.default)(Preview, [{ |
| 19507 |
key: "validateArgs", |
| 19508 |
value: function validateArgs(args) { |
| 19509 |
this.requireArgument('id', args); |
| 19510 |
} // TODO: Check if blocking is required. |
| 19511 |
|
| 19512 |
}, { |
| 19513 |
key: "apply", |
| 19514 |
value: function () { |
| 19515 |
var _apply = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(args) { |
| 19516 |
var id, _$e$components$get, footerSaver, document; |
| 19517 |
|
| 19518 |
return _regenerator.default.wrap(function _callee$(_context) { |
| 19519 |
while (1) { |
| 19520 |
switch (_context.prev = _context.next) { |
| 19521 |
case 0: |
| 19522 |
id = args.id, _$e$components$get = $e.components.get('document/save'), footerSaver = _$e$components$get.footerSaver, document = elementor.documents.get(id); |
| 19523 |
|
| 19524 |
if (!document.editor.isChanged) { |
| 19525 |
_context.next = 4; |
| 19526 |
break; |
| 19527 |
} |
| 19528 |
|
| 19529 |
_context.next = 4; |
| 19530 |
return $e.run('document/save/auto', { |
| 19531 |
force: true |
| 19532 |
}); |
| 19533 |
|
| 19534 |
case 4: |
| 19535 |
// Open immediately in order to avoid popup blockers. |
| 19536 |
footerSaver.previewWindow = open(document.config.urls.wp_preview, "wp-preview-".concat(document.id)); |
| 19537 |
|
| 19538 |
case 5: |
| 19539 |
case "end": |
| 19540 |
return _context.stop(); |
| 19541 |
} |
| 19542 |
} |
| 19543 |
}, _callee); |
| 19544 |
})); |
| 19545 |
|
| 19546 |
function apply(_x) { |
| 19547 |
return _apply.apply(this, arguments); |
| 19548 |
} |
| 19549 |
|
| 19550 |
return apply; |
| 19551 |
}() |
| 19552 |
}]); |
| 19553 |
return Preview; |
| 19554 |
}(_commandBase.default); |
| 19555 |
|
| 19556 |
exports.Preview = Preview; |
| 19557 |
var _default = Preview; |
| 19558 |
exports.default = _default; |
| 19559 |
|
| 19560 |
/***/ }), |
| 19561 |
/* 436 */ |
| 19562 |
/***/ (function(module, exports, __webpack_require__) { |
| 19563 |
|
| 19564 |
"use strict"; |
| 19565 |
|
| 19566 |
|
| 19567 |
var _interopRequireDefault = __webpack_require__(0); |
| 19568 |
|
| 19569 |
var _Object$defineProperty = __webpack_require__(1); |
| 19570 |
|
| 19571 |
_Object$defineProperty(exports, "__esModule", { |
| 19572 |
value: true |
| 19573 |
}); |
| 19574 |
|
| 19575 |
exports.default = exports.Switch = void 0; |
| 19576 |
|
| 19577 |
var _classCallCheck2 = _interopRequireDefault(__webpack_require__(2)); |
| 19578 |
|
| 19579 |
var _createClass2 = _interopRequireDefault(__webpack_require__(3)); |
| 19580 |
|
| 19581 |
var _inherits2 = _interopRequireDefault(__webpack_require__(4)); |
| 19582 |
|
| 19583 |
var _createSuper2 = _interopRequireDefault(__webpack_require__(5)); |
| 19584 |
|
| 19585 |
var _commandBase = _interopRequireDefault(__webpack_require__(21)); |
| 19586 |
|
| 19587 |
var Switch = /*#__PURE__*/function (_CommandBase) { |
| 19588 |
(0, _inherits2.default)(Switch, _CommandBase); |
| 19589 |
|
| 19590 |
var _super = (0, _createSuper2.default)(Switch); |
| 19591 |
|
| 19592 |
function Switch() { |
| 19593 |
(0, _classCallCheck2.default)(this, Switch); |
| 19594 |
return _super.apply(this, arguments); |
| 19595 |
} |
| 19596 |
|
| 19597 |
(0, _createClass2.default)(Switch, [{ |
| 19598 |
key: "validateArgs", |
| 19599 |
value: function validateArgs(args) { |
| 19600 |
this.requireArgument('id', args); |
| 19601 |
} |
| 19602 |
}, { |
| 19603 |
key: "apply", |
| 19604 |
value: function apply(args) { |
| 19605 |
var id = args.id, |
| 19606 |
mode = args.mode, |
| 19607 |
onClose = args.onClose; |
| 19608 |
return $e.run('editor/documents/close', { |
| 19609 |
id: elementor.documents.getCurrentId(), |
| 19610 |
mode: mode, |
| 19611 |
onClose: onClose |
| 19612 |
}).then(function () { |
| 19613 |
return $e.run('editor/documents/open', { |
| 19614 |
id: id |
| 19615 |
}); |
| 19616 |
}); |
| 19617 |
} |
| 19618 |
}]); |
| 19619 |
return Switch; |
| 19620 |
}(_commandBase.default); |
| 19621 |
|
| 19622 |
exports.Switch = Switch; |
| 19623 |
var _default = Switch; |
| 19624 |
exports.default = _default; |
| 19625 |
|
| 19626 |
/***/ }), |
| 19627 |
/* 437 */ |
| 19628 |
/***/ (function(module, exports, __webpack_require__) { |
| 19629 |
|
| 19630 |
"use strict"; |
| 19631 |
|
| 19632 |
|
| 19633 |
var _Object$defineProperty = __webpack_require__(1); |
| 19634 |
|
| 19635 |
_Object$defineProperty(exports, "__esModule", { |
| 19636 |
value: true |
| 19637 |
}); |
| 19638 |
|
| 19639 |
_Object$defineProperty(exports, "AttachPreview", { |
| 19640 |
enumerable: true, |
| 19641 |
get: function get() { |
| 19642 |
return _attachPreview.AttachPreview; |
| 19643 |
} |
| 19644 |
}); |
| 19645 |
|
| 19646 |
_Object$defineProperty(exports, "Load", { |
| 19647 |
enumerable: true, |
| 19648 |
get: function get() { |
| 19649 |
return _load.Load; |
| 19650 |
} |
| 19651 |
}); |
| 19652 |
|
| 19653 |
_Object$defineProperty(exports, "Unload", { |
| 19654 |
enumerable: true, |
| 19655 |
get: function get() { |
| 19656 |
return _unload.Unload; |
| 19657 |
} |
| 19658 |
}); |
| 19659 |
|
| 19660 |
var _attachPreview = __webpack_require__(438); |
| 19661 |
|
| 19662 |
var _load = __webpack_require__(439); |
| 19663 |
|
| 19664 |
var _unload = __webpack_require__(441); |
| 19665 |
|
| 19666 |
/***/ }), |
| 19667 |
/* 438 */ |
| 19668 |
/***/ (function(module, exports, __webpack_require__) { |
| 19669 |
|
| 19670 |
"use strict"; |
| 19671 |
|
| 19672 |
|
| 19673 |
var _interopRequireDefault = __webpack_require__(0); |
| 19674 |
|
| 19675 |
var _Object$defineProperty = __webpack_require__(1); |
| 19676 |
|
| 19677 |
_Object$defineProperty(exports, "__esModule", { |
| 19678 |
value: true |
| 19679 |
}); |
| 19680 |
|
| 19681 |
exports.default = exports.AttachPreview = void 0; |
| 19682 |
|
| 19683 |
__webpack_require__(25); |
| 19684 |
|
| 19685 |
var _promise = _interopRequireDefault(__webpack_require__(133)); |
| 19686 |
|
| 19687 |
var _classCallCheck2 = _interopRequireDefault(__webpack_require__(2)); |
| 19688 |
|
| 19689 |
var _createClass2 = _interopRequireDefault(__webpack_require__(3)); |
| 19690 |
|
| 19691 |
var _inherits2 = _interopRequireDefault(__webpack_require__(4)); |
| 19692 |
|
| 19693 |
var _createSuper2 = _interopRequireDefault(__webpack_require__(5)); |
| 19694 |
|
| 19695 |
var _commandInternalBase = _interopRequireDefault(__webpack_require__(203)); |
| 19696 |
|
| 19697 |
var AttachPreview = /*#__PURE__*/function (_CommandInternalBaseB) { |
| 19698 |
(0, _inherits2.default)(AttachPreview, _CommandInternalBaseB); |
| 19699 |
|
| 19700 |
var _super = (0, _createSuper2.default)(AttachPreview); |
| 19701 |
|
| 19702 |
function AttachPreview() { |
| 19703 |
(0, _classCallCheck2.default)(this, AttachPreview); |
| 19704 |
return _super.apply(this, arguments); |
| 19705 |
} |
| 19706 |
|
| 19707 |
(0, _createClass2.default)(AttachPreview, [{ |
| 19708 |
key: "apply", |
| 19709 |
value: function apply() { |
| 19710 |
var document = elementor.documents.getCurrent(); |
| 19711 |
return this.attachDocumentToPreview(document).then(function () { |
| 19712 |
elementor.toggleDocumentCssFiles(document, false); |
| 19713 |
elementor.onEditModeSwitched(); |
| 19714 |
elementor.checkPageStatus(); |
| 19715 |
elementor.trigger('document:loaded', document); |
| 19716 |
$e.internal('panel/open-default', { |
| 19717 |
refresh: true |
| 19718 |
}); |
| 19719 |
}); |
| 19720 |
} |
| 19721 |
}, { |
| 19722 |
key: "attachDocumentToPreview", |
| 19723 |
value: function attachDocumentToPreview(document) { |
| 19724 |
return new _promise.default(function (resolve, reject) { |
| 19725 |
// Not yet loaded. |
| 19726 |
if (!document) { |
| 19727 |
return reject(); |
| 19728 |
} |
| 19729 |
|
| 19730 |
if (!document.config.elements) { |
| 19731 |
return resolve(); |
| 19732 |
} |
| 19733 |
|
| 19734 |
document.$element = elementor.$previewContents.find('.elementor-' + document.id); |
| 19735 |
|
| 19736 |
if (!document.$element.length) { |
| 19737 |
elementor.onPreviewElNotFound(); |
| 19738 |
return reject(); |
| 19739 |
} |
| 19740 |
|
| 19741 |
document.$element.addClass('elementor-edit-area elementor-edit-mode'); // If not the same document. |
| 19742 |
|
| 19743 |
if (document.id !== elementor.config.initial_document.id) { |
| 19744 |
elementor.$previewElementorEl.addClass('elementor-embedded-editor'); |
| 19745 |
} |
| 19746 |
|
| 19747 |
elementor.initElements(); |
| 19748 |
elementor.initPreviewView(document); |
| 19749 |
document.container.view = elementor.getPreviewView(); |
| 19750 |
document.container.model.attributes.elements = elementor.elements; |
| 19751 |
elementor.helpers.scrollToView(document.$element); |
| 19752 |
document.$element.addClass('elementor-edit-area-active').removeClass('elementor-editor-preview'); |
| 19753 |
resolve(); |
| 19754 |
}); |
| 19755 |
} |
| 19756 |
}]); |
| 19757 |
return AttachPreview; |
| 19758 |
}(_commandInternalBase.default); |
| 19759 |
|
| 19760 |
exports.AttachPreview = AttachPreview; |
| 19761 |
var _default = AttachPreview; |
| 19762 |
exports.default = _default; |
| 19763 |
|
| 19764 |
/***/ }), |
| 19765 |
/* 439 */ |
| 19766 |
/***/ (function(module, exports, __webpack_require__) { |
| 19767 |
|
| 19768 |
"use strict"; |
| 19769 |
|
| 19770 |
|
| 19771 |
var _interopRequireDefault = __webpack_require__(0); |
| 19772 |
|
| 19773 |
var _Object$defineProperty = __webpack_require__(1); |
| 19774 |
|
| 19775 |
_Object$defineProperty(exports, "__esModule", { |
| 19776 |
value: true |
| 19777 |
}); |
| 19778 |
|
| 19779 |
exports.default = exports.Load = void 0; |
| 19780 |
|
| 19781 |
var _classCallCheck2 = _interopRequireDefault(__webpack_require__(2)); |
| 19782 |
|
| 19783 |
var _createClass2 = _interopRequireDefault(__webpack_require__(3)); |
| 19784 |
|
| 19785 |
var _inherits2 = _interopRequireDefault(__webpack_require__(4)); |
| 19786 |
|
| 19787 |
var _createSuper2 = _interopRequireDefault(__webpack_require__(5)); |
| 19788 |
|
| 19789 |
var _commandInternalBase = _interopRequireDefault(__webpack_require__(203)); |
| 19790 |
|
| 19791 |
var _document = _interopRequireDefault(__webpack_require__(320)); |
| 19792 |
|
| 19793 |
var _heartbeat = _interopRequireDefault(__webpack_require__(440)); |
| 19794 |
|
| 19795 |
var Load = /*#__PURE__*/function (_CommandInternalBase) { |
| 19796 |
(0, _inherits2.default)(Load, _CommandInternalBase); |
| 19797 |
|
| 19798 |
var _super = (0, _createSuper2.default)(Load); |
| 19799 |
|
| 19800 |
function Load() { |
| 19801 |
(0, _classCallCheck2.default)(this, Load); |
| 19802 |
return _super.apply(this, arguments); |
| 19803 |
} |
| 19804 |
|
| 19805 |
(0, _createClass2.default)(Load, [{ |
| 19806 |
key: "validateArgs", |
| 19807 |
value: function validateArgs() { |
| 19808 |
var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; |
| 19809 |
this.requireArgument('config', args); |
| 19810 |
} |
| 19811 |
}, { |
| 19812 |
key: "apply", |
| 19813 |
value: function apply(args) { |
| 19814 |
var config = args.config; |
| 19815 |
elementor.config.document = config; |
| 19816 |
elementor.setAjax(); |
| 19817 |
elementor.addWidgetsCache(config.widgets); |
| 19818 |
elementor.templates.init(); |
| 19819 |
var document = new _document.default(config); |
| 19820 |
elementor.documents.add(document); // Must set current before create a container. |
| 19821 |
|
| 19822 |
elementor.documents.setCurrent(document); |
| 19823 |
elementor.settings.page = new elementor.settings.modules.page(config.settings); |
| 19824 |
document.container = elementor.settings.page.getEditedView().getContainer(); // Reference container back to document. |
| 19825 |
|
| 19826 |
document.container.document = document; |
| 19827 |
elementor.heartbeat = new _heartbeat.default(document); |
| 19828 |
var isOldPageVersion = elementor.config.document.version && elementor.helpers.compareVersions(elementor.config.document.version, '2.5.0', '<'); |
| 19829 |
|
| 19830 |
if (!elementor.config.user.introduction.flexbox && isOldPageVersion) { |
| 19831 |
elementor.showFlexBoxAttentionDialog(); |
| 19832 |
} |
| 19833 |
|
| 19834 |
if (elementor.loaded) { |
| 19835 |
// TODO: Find better solution - Fix issue when globals does not render after saving from kit. |
| 19836 |
// The issue is that the css-parser is depends upon cache and cache is not available during this time. |
| 19837 |
$e.data.get('globals/index').then(function () { |
| 19838 |
return $e.internal('editor/documents/attach-preview'); |
| 19839 |
}); |
| 19840 |
} |
| 19841 |
|
| 19842 |
return document; |
| 19843 |
} |
| 19844 |
}]); |
| 19845 |
return Load; |
| 19846 |
}(_commandInternalBase.default); |
| 19847 |
|
| 19848 |
exports.Load = Load; |
| 19849 |
var _default = Load; |
| 19850 |
exports.default = _default; |
| 19851 |
|
| 19852 |
/***/ }), |
| 19853 |
/* 440 */ |
| 19854 |
/***/ (function(module, exports, __webpack_require__) { |
| 19855 |
|
| 19856 |
"use strict"; |
| 19857 |
|
| 19858 |
|
| 19859 |
var _interopRequireDefault = __webpack_require__(0); |
| 19860 |
|
| 19861 |
var _Object$defineProperty = __webpack_require__(1); |
| 19862 |
|
| 19863 |
_Object$defineProperty(exports, "__esModule", { |
| 19864 |
value: true |
| 19865 |
}); |
| 19866 |
|
| 19867 |
exports.default = void 0; |
| 19868 |
|
| 19869 |
var _classCallCheck2 = _interopRequireDefault(__webpack_require__(2)); |
| 19870 |
|
| 19871 |
var _createClass2 = _interopRequireDefault(__webpack_require__(3)); |
| 19872 |
|
| 19873 |
var _defineProperty2 = _interopRequireDefault(__webpack_require__(28)); |
| 19874 |
|
| 19875 |
var Heartbeat = /*#__PURE__*/function () { |
| 19876 |
function Heartbeat(document) { |
| 19877 |
var _this = this; |
| 19878 |
|
| 19879 |
(0, _classCallCheck2.default)(this, Heartbeat); |
| 19880 |
(0, _defineProperty2.default)(this, "modal", null); |
| 19881 |
(0, _defineProperty2.default)(this, "document", null); |
| 19882 |
(0, _defineProperty2.default)(this, "getModal", function () { |
| 19883 |
if (!_this.modal) { |
| 19884 |
_this.modal = _this.initModal(); |
| 19885 |
} |
| 19886 |
|
| 19887 |
return _this.modal; |
| 19888 |
}); |
| 19889 |
this.document = document; |
| 19890 |
this.onSend = this.onSend.bind(this); |
| 19891 |
this.onTick = this.onTick.bind(this); |
| 19892 |
this.onRefreshNonce = this.onRefreshNonce.bind(this); |
| 19893 |
this.bindEvents(); |
| 19894 |
wp.heartbeat.connectNow(); |
| 19895 |
} |
| 19896 |
|
| 19897 |
(0, _createClass2.default)(Heartbeat, [{ |
| 19898 |
key: "initModal", |
| 19899 |
value: function initModal() { |
| 19900 |
var modal = elementorCommon.dialogsManager.createWidget('lightbox', { |
| 19901 |
headerMessage: elementor.translate('take_over') |
| 19902 |
}); |
| 19903 |
modal.addButton({ |
| 19904 |
name: 'go_back', |
| 19905 |
text: elementor.translate('go_back'), |
| 19906 |
callback: function callback() { |
| 19907 |
parent.history.go(-1); |
| 19908 |
} |
| 19909 |
}); |
| 19910 |
modal.addButton({ |
| 19911 |
name: 'take_over', |
| 19912 |
text: elementor.translate('take_over'), |
| 19913 |
callback: function callback() { |
| 19914 |
wp.heartbeat.enqueue('elementor_force_post_lock', true); |
| 19915 |
wp.heartbeat.connectNow(); |
| 19916 |
} |
| 19917 |
}); |
| 19918 |
return modal; |
| 19919 |
} |
| 19920 |
}, { |
| 19921 |
key: "showLockMessage", |
| 19922 |
value: function showLockMessage(lockedUser) { |
| 19923 |
var modal = this.getModal(); |
| 19924 |
modal.setMessage(elementor.translate('dialog_user_taken_over', [lockedUser])).show(); |
| 19925 |
} |
| 19926 |
}, { |
| 19927 |
key: "onSend", |
| 19928 |
value: function onSend(event, data) { |
| 19929 |
data.elementor_post_lock = { |
| 19930 |
post_ID: this.document.id |
| 19931 |
}; |
| 19932 |
} |
| 19933 |
}, { |
| 19934 |
key: "onTick", |
| 19935 |
value: function onTick(event, response) { |
| 19936 |
if (response.locked_user) { |
| 19937 |
if (this.document.editor.isChanged) { |
| 19938 |
$e.run('document/save/auto', { |
| 19939 |
document: this.document |
| 19940 |
}); |
| 19941 |
} |
| 19942 |
|
| 19943 |
this.showLockMessage(response.locked_user); |
| 19944 |
} else { |
| 19945 |
this.getModal().hide(); |
| 19946 |
} |
| 19947 |
|
| 19948 |
elementorCommon.ajax.addRequestConstant('_nonce', response.elementorNonce); |
| 19949 |
} |
| 19950 |
}, { |
| 19951 |
key: "onRefreshNonce", |
| 19952 |
value: function onRefreshNonce(event, response) { |
| 19953 |
var nonces = response['elementor-refresh-nonces']; |
| 19954 |
|
| 19955 |
if (nonces) { |
| 19956 |
if (nonces.heartbeatNonce) { |
| 19957 |
elementorCommon.ajax.addRequestConstant('_nonce', nonces.elementorNonce); |
| 19958 |
} |
| 19959 |
|
| 19960 |
if (nonces.heartbeatNonce) { |
| 19961 |
window.heartbeatSettings.nonce = nonces.heartbeatNonce; |
| 19962 |
} |
| 19963 |
} |
| 19964 |
} |
| 19965 |
}, { |
| 19966 |
key: "bindEvents", |
| 19967 |
value: function bindEvents() { |
| 19968 |
jQuery(document).on({ |
| 19969 |
'heartbeat-send': this.onSend, |
| 19970 |
'heartbeat-tick': this.onTick, |
| 19971 |
'heartbeat-tick.wp-refresh-nonces': this.onRefreshNonce |
| 19972 |
}); |
| 19973 |
} |
| 19974 |
}, { |
| 19975 |
key: "destroy", |
| 19976 |
value: function destroy() { |
| 19977 |
jQuery(document).off({ |
| 19978 |
'heartbeat-send': this.onSend, |
| 19979 |
'heartbeat-tick': this.onTick, |
| 19980 |
'heartbeat-tick.wp-refresh-nonces': this.onRefreshNonce |
| 19981 |
}); |
| 19982 |
} |
| 19983 |
}]); |
| 19984 |
return Heartbeat; |
| 19985 |
}(); |
| 19986 |
|
| 19987 |
exports.default = Heartbeat; |
| 19988 |
|
| 19989 |
/***/ }), |
| 19990 |
/* 441 */ |
| 19991 |
/***/ (function(module, exports, __webpack_require__) { |
| 19992 |
|
| 19993 |
"use strict"; |
| 19994 |
|
| 19995 |
|
| 19996 |
var _interopRequireDefault = __webpack_require__(0); |
| 19997 |
|
| 19998 |
var _Object$defineProperty = __webpack_require__(1); |
| 19999 |
|
| 20000 |
_Object$defineProperty(exports, "__esModule", { |
| 20001 |
value: true |
| 20002 |
}); |
| 20003 |
|
| 20004 |
exports.default = exports.Unload = void 0; |
| 20005 |
|
| 20006 |
var _classCallCheck2 = _interopRequireDefault(__webpack_require__(2)); |
| 20007 |
|
| 20008 |
var _createClass2 = _interopRequireDefault(__webpack_require__(3)); |
| 20009 |
|
| 20010 |
var _inherits2 = _interopRequireDefault(__webpack_require__(4)); |
| 20011 |
|
| 20012 |
var _createSuper2 = _interopRequireDefault(__webpack_require__(5)); |
| 20013 |
|
| 20014 |
var _commandInternalBase = _interopRequireDefault(__webpack_require__(203)); |
| 20015 |
|
| 20016 |
var _document = _interopRequireDefault(__webpack_require__(320)); |
| 20017 |
|
| 20018 |
var Unload = /*#__PURE__*/function (_CommandInternalBase) { |
| 20019 |
(0, _inherits2.default)(Unload, _CommandInternalBase); |
| 20020 |
|
| 20021 |
var _super = (0, _createSuper2.default)(Unload); |
| 20022 |
|
| 20023 |
function Unload() { |
| 20024 |
(0, _classCallCheck2.default)(this, Unload); |
| 20025 |
return _super.apply(this, arguments); |
| 20026 |
} |
| 20027 |
|
| 20028 |
(0, _createClass2.default)(Unload, [{ |
| 20029 |
key: "validateArgs", |
| 20030 |
value: function validateArgs() { |
| 20031 |
var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; |
| 20032 |
this.requireArgumentConstructor('document', _document.default, args); |
| 20033 |
} |
| 20034 |
}, { |
| 20035 |
key: "apply", |
| 20036 |
value: function apply(args) { |
| 20037 |
var document = args.document; |
| 20038 |
|
| 20039 |
if (document.id !== elementor.config.document.id) { |
| 20040 |
return; |
| 20041 |
} |
| 20042 |
|
| 20043 |
elementor.elements = []; |
| 20044 |
elementor.saver.stopAutoSave(document); |
| 20045 |
elementor.channels.dataEditMode.trigger('switch', 'preview'); |
| 20046 |
|
| 20047 |
if (document.$element) { |
| 20048 |
document.$element.removeClass('elementor-edit-area-active elementor-edit-mode').addClass('elementor-editor-preview'); |
| 20049 |
} |
| 20050 |
|
| 20051 |
elementorCommon.elements.$body.removeClass("elementor-editor-".concat(document.config.type)); |
| 20052 |
elementor.settings.page.destroy(); |
| 20053 |
elementor.heartbeat.destroy(); |
| 20054 |
document.editor.status = 'closed'; |
| 20055 |
elementor.config.document = {}; |
| 20056 |
elementor.documents.unsetCurrent(); |
| 20057 |
elementor.trigger('document:unloaded', document); |
| 20058 |
} |
| 20059 |
}]); |
| 20060 |
return Unload; |
| 20061 |
}(_commandInternalBase.default); |
| 20062 |
|
| 20063 |
exports.Unload = Unload; |
| 20064 |
var _default = Unload; |
| 20065 |
exports.default = _default; |
| 20066 |
|
| 20067 |
/***/ }), |
| 20068 |
/* 442 */ |
| 20069 |
/***/ (function(module, exports, __webpack_require__) { |
| 20070 |
|
| 20071 |
"use strict"; |
| 20072 |
|
| 20073 |
|
| 20074 |
var _interopRequireDefault = __webpack_require__(0); |
| 20075 |
|
| 20076 |
var _Object$defineProperty = __webpack_require__(1); |
| 20077 |
|
| 20078 |
_Object$defineProperty(exports, "__esModule", { |
| 20079 |
value: true |
| 20080 |
}); |
| 20081 |
|
| 20082 |
exports.default = void 0; |
| 20083 |
|
| 20084 |
var _classCallCheck2 = _interopRequireDefault(__webpack_require__(2)); |
| 20085 |
|
| 20086 |
var _createClass2 = _interopRequireDefault(__webpack_require__(3)); |
| 20087 |
|
| 20088 |
var _inherits2 = _interopRequireDefault(__webpack_require__(4)); |
| 20089 |
|
| 20090 |
var _createSuper2 = _interopRequireDefault(__webpack_require__(5)); |
| 20091 |
|
| 20092 |
var _componentBase = _interopRequireDefault(__webpack_require__(85)); |
| 20093 |
|
| 20094 |
var Component = /*#__PURE__*/function (_ComponentBase) { |
| 20095 |
(0, _inherits2.default)(Component, _ComponentBase); |
| 20096 |
|
| 20097 |
var _super = (0, _createSuper2.default)(Component); |
| 20098 |
|
| 20099 |
function Component() { |
| 20100 |
(0, _classCallCheck2.default)(this, Component); |
| 20101 |
return _super.apply(this, arguments); |
| 20102 |
} |
| 20103 |
|
| 20104 |
(0, _createClass2.default)(Component, [{ |
| 20105 |
key: "getNamespace", |
| 20106 |
value: function getNamespace() { |
| 20107 |
return 'panel/history'; |
| 20108 |
} |
| 20109 |
}, { |
| 20110 |
key: "defaultTabs", |
| 20111 |
value: function defaultTabs() { |
| 20112 |
return { |
| 20113 |
actions: { |
| 20114 |
title: elementor.translate('actions') |
| 20115 |
}, |
| 20116 |
revisions: { |
| 20117 |
title: elementor.translate('revisions') |
| 20118 |
} |
| 20119 |
}; |
| 20120 |
} |
| 20121 |
}, { |
| 20122 |
key: "defaultShortcuts", |
| 20123 |
value: function defaultShortcuts() { |
| 20124 |
return { |
| 20125 |
actions: { |
| 20126 |
keys: 'ctrl+shift+h' |
| 20127 |
} |
| 20128 |
}; |
| 20129 |
} |
| 20130 |
}, { |
| 20131 |
key: "renderTab", |
| 20132 |
value: function renderTab(tab) { |
| 20133 |
elementor.getPanelView().setPage('historyPage').showView(tab); |
| 20134 |
} |
| 20135 |
}, { |
| 20136 |
key: "activate", |
| 20137 |
value: function activate() { |
| 20138 |
// Activate the tab component itself. |
| 20139 |
$e.components.activate(this.getTabRoute(this.currentTab)); |
| 20140 |
} |
| 20141 |
}, { |
| 20142 |
key: "getTabsWrapperSelector", |
| 20143 |
value: function getTabsWrapperSelector() { |
| 20144 |
return '#elementor-panel-elements-navigation'; |
| 20145 |
} |
| 20146 |
}]); |
| 20147 |
return Component; |
| 20148 |
}(_componentBase.default); |
| 20149 |
|
| 20150 |
exports.default = Component; |
| 20151 |
|
| 20152 |
/***/ }), |
| 20153 |
/* 443 */ |
| 20154 |
/***/ (function(module, exports, __webpack_require__) { |
| 20155 |
|
| 20156 |
"use strict"; |
| 20157 |
|
| 20158 |
|
| 20159 |
var _interopRequireWildcard = __webpack_require__(36); |
| 20160 |
|
| 20161 |
var _interopRequireDefault = __webpack_require__(0); |
| 20162 |
|
| 20163 |
var _Object$defineProperty = __webpack_require__(1); |
| 20164 |
|
| 20165 |
_Object$defineProperty(exports, "__esModule", { |
| 20166 |
value: true |
| 20167 |
}); |
| 20168 |
|
| 20169 |
exports.default = void 0; |
| 20170 |
|
| 20171 |
var _classCallCheck2 = _interopRequireDefault(__webpack_require__(2)); |
| 20172 |
|
| 20173 |
var _createClass2 = _interopRequireDefault(__webpack_require__(3)); |
| 20174 |
|
| 20175 |
var _inherits2 = _interopRequireDefault(__webpack_require__(4)); |
| 20176 |
|
| 20177 |
var _createSuper2 = _interopRequireDefault(__webpack_require__(5)); |
| 20178 |
|
| 20179 |
var _componentBase = _interopRequireDefault(__webpack_require__(85)); |
| 20180 |
|
| 20181 |
var commands = _interopRequireWildcard(__webpack_require__(350)); |
| 20182 |
|
| 20183 |
var Component = /*#__PURE__*/function (_ComponentBase) { |
| 20184 |
(0, _inherits2.default)(Component, _ComponentBase); |
| 20185 |
|
| 20186 |
var _super = (0, _createSuper2.default)(Component); |
| 20187 |
|
| 20188 |
function Component() { |
| 20189 |
(0, _classCallCheck2.default)(this, Component); |
| 20190 |
return _super.apply(this, arguments); |
| 20191 |
} |
| 20192 |
|
| 20193 |
(0, _createClass2.default)(Component, [{ |
| 20194 |
key: "getNamespace", |
| 20195 |
value: function getNamespace() { |
| 20196 |
return 'panel/history/actions'; |
| 20197 |
} |
| 20198 |
}, { |
| 20199 |
key: "defaultCommands", |
| 20200 |
value: function defaultCommands() { |
| 20201 |
return this.importCommands(commands); |
| 20202 |
} |
| 20203 |
}, { |
| 20204 |
key: "defaultShortcuts", |
| 20205 |
value: function defaultShortcuts() { |
| 20206 |
return { |
| 20207 |
undo: { |
| 20208 |
keys: 'ctrl+z', |
| 20209 |
exclude: ['input'], |
| 20210 |
scopes: ['panel', 'navigator'] |
| 20211 |
}, |
| 20212 |
redo: { |
| 20213 |
keys: 'ctrl+shift+z, ctrl+y', |
| 20214 |
exclude: ['input'], |
| 20215 |
scopes: ['panel', 'navigator'] |
| 20216 |
} |
| 20217 |
}; |
| 20218 |
} |
| 20219 |
}]); |
| 20220 |
return Component; |
| 20221 |
}(_componentBase.default); |
| 20222 |
|
| 20223 |
exports.default = Component; |
| 20224 |
|
| 20225 |
/***/ }), |
| 20226 |
/* 444 */ |
| 20227 |
/***/ (function(module, exports, __webpack_require__) { |
| 20228 |
|
| 20229 |
"use strict"; |
| 20230 |
|
| 20231 |
|
| 20232 |
var _interopRequireWildcard = __webpack_require__(36); |
| 20233 |
|
| 20234 |
var _interopRequireDefault = __webpack_require__(0); |
| 20235 |
|
| 20236 |
var _Object$defineProperty = __webpack_require__(1); |
| 20237 |
|
| 20238 |
_Object$defineProperty(exports, "__esModule", { |
| 20239 |
value: true |
| 20240 |
}); |
| 20241 |
|
| 20242 |
exports.default = void 0; |
| 20243 |
|
| 20244 |
var _classCallCheck2 = _interopRequireDefault(__webpack_require__(2)); |
| 20245 |
|
| 20246 |
var _createClass2 = _interopRequireDefault(__webpack_require__(3)); |
| 20247 |
|
| 20248 |
var _inherits2 = _interopRequireDefault(__webpack_require__(4)); |
| 20249 |
|
| 20250 |
var _createSuper2 = _interopRequireDefault(__webpack_require__(5)); |
| 20251 |
|
| 20252 |
var _componentBase = _interopRequireDefault(__webpack_require__(85)); |
| 20253 |
|
| 20254 |
var commands = _interopRequireWildcard(__webpack_require__(445)); |
| 20255 |
|
| 20256 |
var hooks = _interopRequireWildcard(__webpack_require__(448)); |
| 20257 |
|
| 20258 |
var Component = /*#__PURE__*/function (_ComponentBase) { |
| 20259 |
(0, _inherits2.default)(Component, _ComponentBase); |
| 20260 |
|
| 20261 |
var _super = (0, _createSuper2.default)(Component); |
| 20262 |
|
| 20263 |
function Component() { |
| 20264 |
(0, _classCallCheck2.default)(this, Component); |
| 20265 |
return _super.apply(this, arguments); |
| 20266 |
} |
| 20267 |
|
| 20268 |
(0, _createClass2.default)(Component, [{ |
| 20269 |
key: "getNamespace", |
| 20270 |
value: function getNamespace() { |
| 20271 |
return 'panel/history/revisions'; |
| 20272 |
} |
| 20273 |
}, { |
| 20274 |
key: "defaultCommands", |
| 20275 |
value: function defaultCommands() { |
| 20276 |
return this.importCommands(commands); |
| 20277 |
} |
| 20278 |
}, { |
| 20279 |
key: "defaultHooks", |
| 20280 |
value: function defaultHooks() { |
| 20281 |
return this.importHooks(hooks); |
| 20282 |
} |
| 20283 |
}, { |
| 20284 |
key: "defaultShortcuts", |
| 20285 |
value: function defaultShortcuts() { |
| 20286 |
return { |
| 20287 |
up: { |
| 20288 |
keys: 'up', |
| 20289 |
scopes: [this.getNamespace()] |
| 20290 |
}, |
| 20291 |
down: { |
| 20292 |
keys: 'down', |
| 20293 |
scopes: [this.getNamespace()] |
| 20294 |
} |
| 20295 |
}; |
| 20296 |
} |
| 20297 |
}, { |
| 20298 |
key: "navigate", |
| 20299 |
value: function navigate(up) { |
| 20300 |
if (elementor.documents.getCurrent().revisions.getItems().length > 1) { |
| 20301 |
elementor.getPanelView().getCurrentPageView().currentTab.navigate(up); |
| 20302 |
} |
| 20303 |
} |
| 20304 |
}]); |
| 20305 |
return Component; |
| 20306 |
}(_componentBase.default); |
| 20307 |
|
| 20308 |
exports.default = Component; |
| 20309 |
|
| 20310 |
/***/ }), |
| 20311 |
/* 445 */ |
| 20312 |
/***/ (function(module, exports, __webpack_require__) { |
| 20313 |
|
| 20314 |
"use strict"; |
| 20315 |
|
| 20316 |
|
| 20317 |
var _Object$defineProperty = __webpack_require__(1); |
| 20318 |
|
| 20319 |
_Object$defineProperty(exports, "__esModule", { |
| 20320 |
value: true |
| 20321 |
}); |
| 20322 |
|
| 20323 |
_Object$defineProperty(exports, "Down", { |
| 20324 |
enumerable: true, |
| 20325 |
get: function get() { |
| 20326 |
return _down.Down; |
| 20327 |
} |
| 20328 |
}); |
| 20329 |
|
| 20330 |
_Object$defineProperty(exports, "Up", { |
| 20331 |
enumerable: true, |
| 20332 |
get: function get() { |
| 20333 |
return _up.Up; |
| 20334 |
} |
| 20335 |
}); |
| 20336 |
|
| 20337 |
var _down = __webpack_require__(446); |
| 20338 |
|
| 20339 |
var _up = __webpack_require__(447); |
| 20340 |
|
| 20341 |
/***/ }), |
| 20342 |
/* 446 */ |
| 20343 |
/***/ (function(module, exports, __webpack_require__) { |
| 20344 |
|
| 20345 |
"use strict"; |
| 20346 |
|
| 20347 |
|
| 20348 |
var _interopRequireDefault = __webpack_require__(0); |
| 20349 |
|
| 20350 |
var _Object$defineProperty = __webpack_require__(1); |
| 20351 |
|
| 20352 |
_Object$defineProperty(exports, "__esModule", { |
| 20353 |
value: true |
| 20354 |
}); |
| 20355 |
|
| 20356 |
exports.default = exports.Down = void 0; |
| 20357 |
|
| 20358 |
var _classCallCheck2 = _interopRequireDefault(__webpack_require__(2)); |
| 20359 |
|
| 20360 |
var _createClass2 = _interopRequireDefault(__webpack_require__(3)); |
| 20361 |
|
| 20362 |
var _inherits2 = _interopRequireDefault(__webpack_require__(4)); |
| 20363 |
|
| 20364 |
var _createSuper2 = _interopRequireDefault(__webpack_require__(5)); |
| 20365 |
|
| 20366 |
var _commandBase = _interopRequireDefault(__webpack_require__(21)); |
| 20367 |
|
| 20368 |
var Down = /*#__PURE__*/function (_CommandBase) { |
| 20369 |
(0, _inherits2.default)(Down, _CommandBase); |
| 20370 |
|
| 20371 |
var _super = (0, _createSuper2.default)(Down); |
| 20372 |
|
| 20373 |
function Down() { |
| 20374 |
(0, _classCallCheck2.default)(this, Down); |
| 20375 |
return _super.apply(this, arguments); |
| 20376 |
} |
| 20377 |
|
| 20378 |
(0, _createClass2.default)(Down, [{ |
| 20379 |
key: "apply", |
| 20380 |
value: function apply() { |
| 20381 |
this.component.navigate(); |
| 20382 |
} |
| 20383 |
}]); |
| 20384 |
return Down; |
| 20385 |
}(_commandBase.default); |
| 20386 |
|
| 20387 |
exports.Down = Down; |
| 20388 |
var _default = Down; |
| 20389 |
exports.default = _default; |
| 20390 |
|
| 20391 |
/***/ }), |
| 20392 |
/* 447 */ |
| 20393 |
/***/ (function(module, exports, __webpack_require__) { |
| 20394 |
|
| 20395 |
"use strict"; |
| 20396 |
|
| 20397 |
|
| 20398 |
var _interopRequireDefault = __webpack_require__(0); |
| 20399 |
|
| 20400 |
var _Object$defineProperty = __webpack_require__(1); |
| 20401 |
|
| 20402 |
_Object$defineProperty(exports, "__esModule", { |
| 20403 |
value: true |
| 20404 |
}); |
| 20405 |
|
| 20406 |
exports.default = exports.Up = void 0; |
| 20407 |
|
| 20408 |
var _classCallCheck2 = _interopRequireDefault(__webpack_require__(2)); |
| 20409 |
|
| 20410 |
var _createClass2 = _interopRequireDefault(__webpack_require__(3)); |
| 20411 |
|
| 20412 |
var _inherits2 = _interopRequireDefault(__webpack_require__(4)); |
| 20413 |
|
| 20414 |
var _createSuper2 = _interopRequireDefault(__webpack_require__(5)); |
| 20415 |
|
| 20416 |
var _commandBase = _interopRequireDefault(__webpack_require__(21)); |
| 20417 |
|
| 20418 |
var Up = /*#__PURE__*/function (_CommandBase) { |
| 20419 |
(0, _inherits2.default)(Up, _CommandBase); |
| 20420 |
|
| 20421 |
var _super = (0, _createSuper2.default)(Up); |
| 20422 |
|
| 20423 |
function Up() { |
| 20424 |
(0, _classCallCheck2.default)(this, Up); |
| 20425 |
return _super.apply(this, arguments); |
| 20426 |
} |
| 20427 |
|
| 20428 |
(0, _createClass2.default)(Up, [{ |
| 20429 |
key: "apply", |
| 20430 |
value: function apply() { |
| 20431 |
this.component.navigate(true); |
| 20432 |
} |
| 20433 |
}]); |
| 20434 |
return Up; |
| 20435 |
}(_commandBase.default); |
| 20436 |
|
| 20437 |
exports.Up = Up; |
| 20438 |
var _default = Up; |
| 20439 |
exports.default = _default; |
| 20440 |
|
| 20441 |
/***/ }), |
| 20442 |
/* 448 */ |
| 20443 |
/***/ (function(module, exports, __webpack_require__) { |
| 20444 |
|
| 20445 |
"use strict"; |
| 20446 |
|
| 20447 |
|
| 20448 |
var _Object$defineProperty = __webpack_require__(1); |
| 20449 |
|
| 20450 |
_Object$defineProperty(exports, "__esModule", { |
| 20451 |
value: true |
| 20452 |
}); |
| 20453 |
|
| 20454 |
_Object$defineProperty(exports, "RevisionsAfterSave", { |
| 20455 |
enumerable: true, |
| 20456 |
get: function get() { |
| 20457 |
return _save.RevisionsAfterSave; |
| 20458 |
} |
| 20459 |
}); |
| 20460 |
|
| 20461 |
var _save = __webpack_require__(449); |
| 20462 |
|
| 20463 |
/***/ }), |
| 20464 |
/* 449 */ |
| 20465 |
/***/ (function(module, exports, __webpack_require__) { |
| 20466 |
|
| 20467 |
"use strict"; |
| 20468 |
|
| 20469 |
|
| 20470 |
var _interopRequireDefault = __webpack_require__(0); |
| 20471 |
|
| 20472 |
var _Object$defineProperty = __webpack_require__(1); |
| 20473 |
|
| 20474 |
_Object$defineProperty(exports, "__esModule", { |
| 20475 |
value: true |
| 20476 |
}); |
| 20477 |
|
| 20478 |
exports.default = exports.RevisionsAfterSave = void 0; |
| 20479 |
|
| 20480 |
var _classCallCheck2 = _interopRequireDefault(__webpack_require__(2)); |
| 20481 |
|
| 20482 |
var _createClass2 = _interopRequireDefault(__webpack_require__(3)); |
| 20483 |
|
| 20484 |
var _inherits2 = _interopRequireDefault(__webpack_require__(4)); |
| 20485 |
|
| 20486 |
var _createSuper2 = _interopRequireDefault(__webpack_require__(5)); |
| 20487 |
|
| 20488 |
var _after = _interopRequireDefault(__webpack_require__(224)); |
| 20489 |
|
| 20490 |
var RevisionsAfterSave = /*#__PURE__*/function (_HookDataAfter) { |
| 20491 |
(0, _inherits2.default)(RevisionsAfterSave, _HookDataAfter); |
| 20492 |
|
| 20493 |
var _super = (0, _createSuper2.default)(RevisionsAfterSave); |
| 20494 |
|
| 20495 |
function RevisionsAfterSave() { |
| 20496 |
(0, _classCallCheck2.default)(this, RevisionsAfterSave); |
| 20497 |
return _super.apply(this, arguments); |
| 20498 |
} |
| 20499 |
|
| 20500 |
(0, _createClass2.default)(RevisionsAfterSave, [{ |
| 20501 |
key: "getCommand", |
| 20502 |
value: function getCommand() { |
| 20503 |
return 'document/save/save'; |
| 20504 |
} |
| 20505 |
}, { |
| 20506 |
key: "getId", |
| 20507 |
value: function getId() { |
| 20508 |
return 'revisions-after-save'; |
| 20509 |
} |
| 20510 |
}, { |
| 20511 |
key: "apply", |
| 20512 |
value: function apply(args, result) { |
| 20513 |
var data = result.data, |
| 20514 |
revisionsModule = elementor.documents.getCurrent().revisions; |
| 20515 |
|
| 20516 |
if (data.latest_revisions) { |
| 20517 |
revisionsModule.addRevisions(data.latest_revisions); |
| 20518 |
} |
| 20519 |
|
| 20520 |
revisionsModule.requestRevisions(function () { |
| 20521 |
if (data.revisions_ids) { |
| 20522 |
var revisionsToKeep = revisionsModule.revisions.filter(function (revision) { |
| 20523 |
return -1 !== data.revisions_ids.indexOf(revision.get('id')); |
| 20524 |
}); |
| 20525 |
revisionsModule.revisions.reset(revisionsToKeep); |
| 20526 |
} |
| 20527 |
}); |
| 20528 |
} |
| 20529 |
}]); |
| 20530 |
return RevisionsAfterSave; |
| 20531 |
}(_after.default); |
| 20532 |
|
| 20533 |
exports.RevisionsAfterSave = RevisionsAfterSave; |
| 20534 |
var _default = RevisionsAfterSave; |
| 20535 |
exports.default = _default; |
| 20536 |
|
| 20537 |
/***/ }), |
| 20538 |
/* 450 */ |
| 20539 |
/***/ (function(module, exports, __webpack_require__) { |
| 20540 |
|
| 20541 |
"use strict"; |
| 20542 |
|
| 20543 |
|
| 20544 |
var _interopRequireDefault = __webpack_require__(0); |
| 20545 |
|
| 20546 |
var _loading = _interopRequireDefault(__webpack_require__(451)); |
| 20547 |
|
| 20548 |
var _tab = _interopRequireDefault(__webpack_require__(452)); |
| 20549 |
|
| 20550 |
var _empty = _interopRequireDefault(__webpack_require__(454)); |
| 20551 |
|
| 20552 |
var TabHistoryView = __webpack_require__(455); |
| 20553 |
|
| 20554 |
module.exports = Marionette.LayoutView.extend({ |
| 20555 |
template: '#tmpl-elementor-panel-history-page', |
| 20556 |
regions: { |
| 20557 |
content: '#elementor-panel-history-content' |
| 20558 |
}, |
| 20559 |
ui: { |
| 20560 |
tabs: '.elementor-panel-navigation-tab' |
| 20561 |
}, |
| 20562 |
regionViews: {}, |
| 20563 |
currentTab: null, |
| 20564 |
|
| 20565 |
/** |
| 20566 |
* @type {Document} |
| 20567 |
*/ |
| 20568 |
document: null, |
| 20569 |
initialize: function initialize(options) { |
| 20570 |
this.document = options.document || elementor.documents.getCurrent(); |
| 20571 |
this.initRegionViews(); |
| 20572 |
}, |
| 20573 |
initRegionViews: function initRegionViews() { |
| 20574 |
var _this = this; |
| 20575 |
|
| 20576 |
var historyItems = this.document.history.getItems(); |
| 20577 |
this.regionViews = { |
| 20578 |
actions: { |
| 20579 |
view: function view() { |
| 20580 |
return TabHistoryView; |
| 20581 |
}, |
| 20582 |
options: { |
| 20583 |
collection: historyItems, |
| 20584 |
history: this.document.history |
| 20585 |
} |
| 20586 |
}, |
| 20587 |
revisions: { |
| 20588 |
view: function view() { |
| 20589 |
var revisionsItems = _this.document.revisions.getItems(); |
| 20590 |
|
| 20591 |
if (!revisionsItems) { |
| 20592 |
return _loading.default; |
| 20593 |
} |
| 20594 |
|
| 20595 |
if (1 === revisionsItems.length && 'current' === revisionsItems.models[0].get('type')) { |
| 20596 |
return _empty.default; |
| 20597 |
} |
| 20598 |
|
| 20599 |
return _tab.default; |
| 20600 |
}, |
| 20601 |
options: { |
| 20602 |
document: this.document |
| 20603 |
} |
| 20604 |
} |
| 20605 |
}; |
| 20606 |
}, |
| 20607 |
getCurrentTab: function getCurrentTab() { |
| 20608 |
return this.currentTab; |
| 20609 |
}, |
| 20610 |
showView: function showView(viewName) { |
| 20611 |
var viewDetails = this.regionViews[viewName], |
| 20612 |
options = viewDetails.options || {}, |
| 20613 |
View = viewDetails.view(); |
| 20614 |
|
| 20615 |
if (this.currentTab && this.currentTab.constructor === View) { |
| 20616 |
return; |
| 20617 |
} |
| 20618 |
|
| 20619 |
this.currentTab = new View(options); |
| 20620 |
this.content.show(this.currentTab); |
| 20621 |
} |
| 20622 |
}); |
| 20623 |
|
| 20624 |
/***/ }), |
| 20625 |
/* 451 */ |
| 20626 |
/***/ (function(module, exports, __webpack_require__) { |
| 20627 |
|
| 20628 |
"use strict"; |
| 20629 |
|
| 20630 |
|
| 20631 |
var _interopRequireDefault = __webpack_require__(0); |
| 20632 |
|
| 20633 |
var _Object$defineProperty = __webpack_require__(1); |
| 20634 |
|
| 20635 |
_Object$defineProperty(exports, "__esModule", { |
| 20636 |
value: true |
| 20637 |
}); |
| 20638 |
|
| 20639 |
exports.default = void 0; |
| 20640 |
|
| 20641 |
var _classCallCheck2 = _interopRequireDefault(__webpack_require__(2)); |
| 20642 |
|
| 20643 |
var _createClass2 = _interopRequireDefault(__webpack_require__(3)); |
| 20644 |
|
| 20645 |
var _inherits2 = _interopRequireDefault(__webpack_require__(4)); |
| 20646 |
|
| 20647 |
var _createSuper2 = _interopRequireDefault(__webpack_require__(5)); |
| 20648 |
|
| 20649 |
var _default = /*#__PURE__*/function (_Marionette$ItemView) { |
| 20650 |
(0, _inherits2.default)(_default, _Marionette$ItemView); |
| 20651 |
|
| 20652 |
var _super = (0, _createSuper2.default)(_default); |
| 20653 |
|
| 20654 |
function _default() { |
| 20655 |
(0, _classCallCheck2.default)(this, _default); |
| 20656 |
return _super.apply(this, arguments); |
| 20657 |
} |
| 20658 |
|
| 20659 |
(0, _createClass2.default)(_default, [{ |
| 20660 |
key: "getTemplate", |
| 20661 |
value: function getTemplate() { |
| 20662 |
return '#tmpl-elementor-panel-revisions-loading'; |
| 20663 |
} |
| 20664 |
}, { |
| 20665 |
key: "id", |
| 20666 |
value: function id() { |
| 20667 |
return 'elementor-panel-revisions-loading'; |
| 20668 |
} |
| 20669 |
}, { |
| 20670 |
key: "onRender", |
| 20671 |
value: function onRender() { |
| 20672 |
this.options.document.revisions.requestRevisions(function () { |
| 20673 |
setTimeout(function () { |
| 20674 |
return $e.routes.refreshContainer('panel'); |
| 20675 |
}); |
| 20676 |
}); |
| 20677 |
} |
| 20678 |
}]); |
| 20679 |
return _default; |
| 20680 |
}(Marionette.ItemView); |
| 20681 |
|
| 20682 |
exports.default = _default; |
| 20683 |
|
| 20684 |
/***/ }), |
| 20685 |
/* 452 */ |
| 20686 |
/***/ (function(module, exports, __webpack_require__) { |
| 20687 |
|
| 20688 |
"use strict"; |
| 20689 |
|
| 20690 |
|
| 20691 |
module.exports = Marionette.CompositeView.extend({ |
| 20692 |
id: 'elementor-panel-revisions', |
| 20693 |
template: '#tmpl-elementor-panel-revisions', |
| 20694 |
childView: __webpack_require__(453), |
| 20695 |
childViewContainer: '#elementor-revisions-list', |
| 20696 |
ui: { |
| 20697 |
discard: '.elementor-panel-scheme-discard .elementor-button', |
| 20698 |
apply: '.elementor-panel-scheme-save .elementor-button' |
| 20699 |
}, |
| 20700 |
events: { |
| 20701 |
'click @ui.discard': 'onDiscardClick', |
| 20702 |
'click @ui.apply': 'onApplyClick' |
| 20703 |
}, |
| 20704 |
isRevisionApplied: false, |
| 20705 |
currentPreviewId: null, |
| 20706 |
currentPreviewItem: null, |
| 20707 |
document: null, |
| 20708 |
initialize: function initialize(options) { |
| 20709 |
this.document = options.document; |
| 20710 |
this.collection = this.document.revisions.getItems(); |
| 20711 |
this.listenTo(elementor.channels.editor, 'saved', this.onEditorSaved); |
| 20712 |
this.currentPreviewId = elementor.config.document.revisions.current_id; |
| 20713 |
}, |
| 20714 |
getRevisionViewData: function getRevisionViewData(revisionView) { |
| 20715 |
var _this = this; |
| 20716 |
|
| 20717 |
this.document.revisions.getRevisionDataAsync(revisionView.model.get('id'), { |
| 20718 |
success: function success(data) { |
| 20719 |
if (_this.document.config.panel.has_elements) { |
| 20720 |
_this.document.revisions.setEditorData(data.elements); |
| 20721 |
} |
| 20722 |
|
| 20723 |
elementor.settings.page.model.set(data.settings); |
| 20724 |
|
| 20725 |
_this.setRevisionsButtonsActive(true); |
| 20726 |
|
| 20727 |
revisionView.$el.removeClass('elementor-revision-item-loading'); |
| 20728 |
|
| 20729 |
_this.enterReviewMode(); |
| 20730 |
}, |
| 20731 |
error: function error(errorMessage) { |
| 20732 |
revisionView.$el.removeClass('elementor-revision-item-loading'); |
| 20733 |
_this.currentPreviewItem = null; |
| 20734 |
_this.currentPreviewId = null; |
| 20735 |
alert(errorMessage); |
| 20736 |
} |
| 20737 |
}); |
| 20738 |
}, |
| 20739 |
setRevisionsButtonsActive: function setRevisionsButtonsActive(active) { |
| 20740 |
// Check the tab is open. |
| 20741 |
if (!this.isDestroyed) { |
| 20742 |
this.ui.apply.add(this.ui.discard).prop('disabled', !active); |
| 20743 |
} |
| 20744 |
}, |
| 20745 |
deleteRevision: function deleteRevision(revisionView) { |
| 20746 |
var _this2 = this; |
| 20747 |
|
| 20748 |
revisionView.$el.addClass('elementor-revision-item-loading'); |
| 20749 |
this.document.revisions.deleteRevision(revisionView.model, { |
| 20750 |
success: function success() { |
| 20751 |
if (revisionView.model.get('id') === _this2.currentPreviewId) { |
| 20752 |
_this2.onDiscardClick(); |
| 20753 |
} |
| 20754 |
|
| 20755 |
_this2.currentPreviewId = null; |
| 20756 |
}, |
| 20757 |
error: function error() { |
| 20758 |
revisionView.$el.removeClass('elementor-revision-item-loading'); |
| 20759 |
alert('An error occurred'); |
| 20760 |
} |
| 20761 |
}); |
| 20762 |
}, |
| 20763 |
enterReviewMode: function enterReviewMode() { |
| 20764 |
elementor.changeEditMode('review'); |
| 20765 |
}, |
| 20766 |
exitReviewMode: function exitReviewMode() { |
| 20767 |
elementor.changeEditMode('edit'); |
| 20768 |
}, |
| 20769 |
navigate: function navigate(reverse) { |
| 20770 |
if (!this.currentPreviewId || !this.currentPreviewItem || this.children.length <= 1) { |
| 20771 |
return; |
| 20772 |
} |
| 20773 |
|
| 20774 |
var currentPreviewItemIndex = this.collection.indexOf(this.currentPreviewItem.model), |
| 20775 |
requiredIndex = reverse ? currentPreviewItemIndex - 1 : currentPreviewItemIndex + 1; |
| 20776 |
|
| 20777 |
if (requiredIndex < 0) { |
| 20778 |
requiredIndex = this.collection.length - 1; |
| 20779 |
} |
| 20780 |
|
| 20781 |
if (requiredIndex >= this.collection.length) { |
| 20782 |
requiredIndex = 0; |
| 20783 |
} |
| 20784 |
|
| 20785 |
this.children.findByIndex(requiredIndex).ui.detailsArea.trigger('click'); |
| 20786 |
}, |
| 20787 |
onEditorSaved: function onEditorSaved() { |
| 20788 |
this.exitReviewMode(); |
| 20789 |
this.setRevisionsButtonsActive(false); |
| 20790 |
this.currentPreviewId = elementor.config.document.revisions.current_id; |
| 20791 |
}, |
| 20792 |
onApplyClick: function onApplyClick() { |
| 20793 |
$e.internal('document/save/set-is-modified', { |
| 20794 |
status: true |
| 20795 |
}); |
| 20796 |
$e.run('document/save/auto', { |
| 20797 |
force: true |
| 20798 |
}); |
| 20799 |
this.isRevisionApplied = true; |
| 20800 |
this.currentPreviewId = null; |
| 20801 |
this.document.history.getItems().reset(); |
| 20802 |
}, |
| 20803 |
onDiscardClick: function onDiscardClick() { |
| 20804 |
if (this.document.config.panel.has_elements) { |
| 20805 |
this.document.revisions.setEditorData(elementor.config.document.elements); |
| 20806 |
} |
| 20807 |
|
| 20808 |
$e.internal('document/save/set-is-modified', { |
| 20809 |
status: this.isRevisionApplied |
| 20810 |
}); |
| 20811 |
this.isRevisionApplied = false; |
| 20812 |
this.setRevisionsButtonsActive(false); |
| 20813 |
this.currentPreviewId = null; |
| 20814 |
this.exitReviewMode(); |
| 20815 |
|
| 20816 |
if (this.currentPreviewItem) { |
| 20817 |
this.currentPreviewItem.$el.removeClass('elementor-revision-current-preview'); |
| 20818 |
} |
| 20819 |
}, |
| 20820 |
onDestroy: function onDestroy() { |
| 20821 |
if (this.currentPreviewId && this.currentPreviewId !== elementor.config.document.revisions.current_id) { |
| 20822 |
this.onDiscardClick(); |
| 20823 |
} |
| 20824 |
}, |
| 20825 |
onRenderCollection: function onRenderCollection() { |
| 20826 |
if (!this.currentPreviewId) { |
| 20827 |
return; |
| 20828 |
} |
| 20829 |
|
| 20830 |
var currentPreviewModel = this.collection.findWhere({ |
| 20831 |
id: this.currentPreviewId |
| 20832 |
}); // Ensure the model is exist and not deleted during a save. |
| 20833 |
|
| 20834 |
if (currentPreviewModel) { |
| 20835 |
this.currentPreviewItem = this.children.findByModelCid(currentPreviewModel.cid); |
| 20836 |
this.currentPreviewItem.$el.addClass('elementor-revision-current-preview'); |
| 20837 |
} |
| 20838 |
}, |
| 20839 |
onChildviewDetailsAreaClick: function onChildviewDetailsAreaClick(childView) { |
| 20840 |
var _this3 = this; |
| 20841 |
|
| 20842 |
var revisionID = childView.model.get('id'); |
| 20843 |
|
| 20844 |
if (revisionID === this.currentPreviewId) { |
| 20845 |
return; |
| 20846 |
} |
| 20847 |
|
| 20848 |
if (this.currentPreviewItem) { |
| 20849 |
this.currentPreviewItem.$el.removeClass('elementor-revision-current-preview elementor-revision-item-loading'); |
| 20850 |
} |
| 20851 |
|
| 20852 |
childView.$el.addClass('elementor-revision-current-preview elementor-revision-item-loading'); |
| 20853 |
var revision = null === this.currentPreviewId || elementor.config.document.revisions.current_id === this.currentPreviewId; |
| 20854 |
|
| 20855 |
if (revision && elementor.saver.isEditorChanged()) { |
| 20856 |
// TODO: Change to 'document/save/auto' ?. |
| 20857 |
$e.internal('document/save/save', { |
| 20858 |
status: 'autosave', |
| 20859 |
onSuccess: function onSuccess() { |
| 20860 |
_this3.getRevisionViewData(childView); |
| 20861 |
} |
| 20862 |
}); |
| 20863 |
} else { |
| 20864 |
this.getRevisionViewData(childView); |
| 20865 |
} |
| 20866 |
|
| 20867 |
this.currentPreviewItem = childView; |
| 20868 |
this.currentPreviewId = revisionID; |
| 20869 |
} |
| 20870 |
}); |
| 20871 |
|
| 20872 |
/***/ }), |
| 20873 |
/* 453 */ |
| 20874 |
/***/ (function(module, exports, __webpack_require__) { |
| 20875 |
|
| 20876 |
"use strict"; |
| 20877 |
|
| 20878 |
|
| 20879 |
module.exports = Marionette.ItemView.extend({ |
| 20880 |
template: '#tmpl-elementor-panel-revisions-revision-item', |
| 20881 |
className: 'elementor-revision-item', |
| 20882 |
ui: { |
| 20883 |
detailsArea: '.elementor-revision-item__details' |
| 20884 |
}, |
| 20885 |
triggers: { |
| 20886 |
'click @ui.detailsArea': 'detailsArea:click' |
| 20887 |
} |
| 20888 |
}); |
| 20889 |
|
| 20890 |
/***/ }), |
| 20891 |
/* 454 */ |
| 20892 |
/***/ (function(module, exports, __webpack_require__) { |
| 20893 |
|
| 20894 |
"use strict"; |
| 20895 |
|
| 20896 |
|
| 20897 |
module.exports = Marionette.ItemView.extend({ |
| 20898 |
template: '#tmpl-elementor-panel-revisions-no-revisions', |
| 20899 |
id: 'elementor-panel-revisions-no-revisions', |
| 20900 |
className: 'elementor-nerd-box' |
| 20901 |
}); |
| 20902 |
|
| 20903 |
/***/ }), |
| 20904 |
/* 455 */ |
| 20905 |
/***/ (function(module, exports, __webpack_require__) { |
| 20906 |
|
| 20907 |
"use strict"; |
| 20908 |
|
| 20909 |
|
| 20910 |
var _interopRequireDefault = __webpack_require__(0); |
| 20911 |
|
| 20912 |
__webpack_require__(302); |
| 20913 |
|
| 20914 |
__webpack_require__(25); |
| 20915 |
|
| 20916 |
var _itemView = _interopRequireDefault(__webpack_require__(456)); |
| 20917 |
|
| 20918 |
var _empty = _interopRequireDefault(__webpack_require__(457)); |
| 20919 |
|
| 20920 |
module.exports = Marionette.CompositeView.extend({ |
| 20921 |
id: 'elementor-panel-history', |
| 20922 |
template: '#tmpl-elementor-panel-history-tab', |
| 20923 |
childView: _itemView.default, |
| 20924 |
childViewContainer: '#elementor-history-list', |
| 20925 |
emptyView: _empty.default, |
| 20926 |
currentItem: null, |
| 20927 |
updateCurrentItem: function updateCurrentItem() { |
| 20928 |
var _this = this; |
| 20929 |
|
| 20930 |
if (this.children.length <= 1) { |
| 20931 |
return; |
| 20932 |
} |
| 20933 |
|
| 20934 |
_.defer(function () { |
| 20935 |
// Set current item - the first not applied item |
| 20936 |
var currentItem = _this.collection.find(function (model) { |
| 20937 |
return 'not_applied' === model.get('status'); |
| 20938 |
}), |
| 20939 |
currentView = _this.children.findByModel(currentItem); |
| 20940 |
|
| 20941 |
if (!currentView) { |
| 20942 |
return; |
| 20943 |
} |
| 20944 |
|
| 20945 |
var currentItemClass = 'elementor-history-item-current'; |
| 20946 |
|
| 20947 |
if (_this.currentItem) { |
| 20948 |
_this.currentItem.removeClass(currentItemClass); |
| 20949 |
} |
| 20950 |
|
| 20951 |
_this.currentItem = currentView.$el; |
| 20952 |
|
| 20953 |
_this.currentItem.addClass(currentItemClass); |
| 20954 |
}); |
| 20955 |
}, |
| 20956 |
onRender: function onRender() { |
| 20957 |
this.updateCurrentItem(); |
| 20958 |
}, |
| 20959 |
onRenderEmpty: function onRenderEmpty() { |
| 20960 |
this.$el.addClass('elementor-empty'); |
| 20961 |
}, |
| 20962 |
onChildviewClick: function onChildviewClick(childView, event) { |
| 20963 |
if (childView.$el === this.currentItem) { |
| 20964 |
return; |
| 20965 |
} |
| 20966 |
|
| 20967 |
var collection = event.model.collection, |
| 20968 |
index = collection.findIndex(event.model); |
| 20969 |
$e.run('panel/history/actions/do', { |
| 20970 |
index: index |
| 20971 |
}); |
| 20972 |
} |
| 20973 |
}); |
| 20974 |
|
| 20975 |
/***/ }), |
| 20976 |
/* 456 */ |
| 20977 |
/***/ (function(module, exports, __webpack_require__) { |
| 20978 |
|
| 20979 |
"use strict"; |
| 20980 |
|
| 20981 |
|
| 20982 |
var _interopRequireDefault = __webpack_require__(0); |
| 20983 |
|
| 20984 |
var _Object$defineProperty = __webpack_require__(1); |
| 20985 |
|
| 20986 |
_Object$defineProperty(exports, "__esModule", { |
| 20987 |
value: true |
| 20988 |
}); |
| 20989 |
|
| 20990 |
exports.default = void 0; |
| 20991 |
|
| 20992 |
var _classCallCheck2 = _interopRequireDefault(__webpack_require__(2)); |
| 20993 |
|
| 20994 |
var _createClass2 = _interopRequireDefault(__webpack_require__(3)); |
| 20995 |
|
| 20996 |
var _inherits2 = _interopRequireDefault(__webpack_require__(4)); |
| 20997 |
|
| 20998 |
var _createSuper2 = _interopRequireDefault(__webpack_require__(5)); |
| 20999 |
|
| 21000 |
var _default = /*#__PURE__*/function (_Marionette$ItemView) { |
| 21001 |
(0, _inherits2.default)(_default, _Marionette$ItemView); |
| 21002 |
|
| 21003 |
var _super = (0, _createSuper2.default)(_default); |
| 21004 |
|
| 21005 |
function _default() { |
| 21006 |
(0, _classCallCheck2.default)(this, _default); |
| 21007 |
return _super.apply(this, arguments); |
| 21008 |
} |
| 21009 |
|
| 21010 |
(0, _createClass2.default)(_default, [{ |
| 21011 |
key: "getTemplate", |
| 21012 |
value: function getTemplate() { |
| 21013 |
return '#tmpl-elementor-panel-history-item'; |
| 21014 |
} |
| 21015 |
}, { |
| 21016 |
key: "className", |
| 21017 |
value: function className() { |
| 21018 |
return 'elementor-history-item elementor-history-item-' + this.model.get('status'); |
| 21019 |
} |
| 21020 |
}, { |
| 21021 |
key: "triggers", |
| 21022 |
value: function triggers() { |
| 21023 |
return { |
| 21024 |
click: 'click' |
| 21025 |
}; |
| 21026 |
} |
| 21027 |
}]); |
| 21028 |
return _default; |
| 21029 |
}(Marionette.ItemView); |
| 21030 |
|
| 21031 |
exports.default = _default; |
| 21032 |
|
| 21033 |
/***/ }), |
| 21034 |
/* 457 */ |
| 21035 |
/***/ (function(module, exports, __webpack_require__) { |
| 21036 |
|
| 21037 |
"use strict"; |
| 21038 |
|
| 21039 |
|
| 21040 |
var _interopRequireDefault = __webpack_require__(0); |
| 21041 |
|
| 21042 |
var _Object$defineProperty = __webpack_require__(1); |
| 21043 |
|
| 21044 |
_Object$defineProperty(exports, "__esModule", { |
| 21045 |
value: true |
| 21046 |
}); |
| 21047 |
|
| 21048 |
exports.default = void 0; |
| 21049 |
|
| 21050 |
var _classCallCheck2 = _interopRequireDefault(__webpack_require__(2)); |
| 21051 |
|
| 21052 |
var _createClass2 = _interopRequireDefault(__webpack_require__(3)); |
| 21053 |
|
| 21054 |
var _inherits2 = _interopRequireDefault(__webpack_require__(4)); |
| 21055 |
|
| 21056 |
var _createSuper2 = _interopRequireDefault(__webpack_require__(5)); |
| 21057 |
|
| 21058 |
var _default = /*#__PURE__*/function (_Marionette$ItemView) { |
| 21059 |
(0, _inherits2.default)(_default, _Marionette$ItemView); |
| 21060 |
|
| 21061 |
var _super = (0, _createSuper2.default)(_default); |
| 21062 |
|
| 21063 |
function _default() { |
| 21064 |
(0, _classCallCheck2.default)(this, _default); |
| 21065 |
return _super.apply(this, arguments); |
| 21066 |
} |
| 21067 |
|
| 21068 |
(0, _createClass2.default)(_default, [{ |
| 21069 |
key: "getTemplate", |
| 21070 |
value: function getTemplate() { |
| 21071 |
return '#tmpl-elementor-panel-history-no-items'; |
| 21072 |
} |
| 21073 |
}, { |
| 21074 |
key: "id", |
| 21075 |
value: function id() { |
| 21076 |
return 'elementor-panel-history-no-items'; |
| 21077 |
} |
| 21078 |
}, { |
| 21079 |
key: "onDestroy", |
| 21080 |
value: function onDestroy() { |
| 21081 |
this._parent.$el.removeClass('elementor-empty'); |
| 21082 |
} |
| 21083 |
}]); |
| 21084 |
return _default; |
| 21085 |
}(Marionette.ItemView); |
| 21086 |
|
| 21087 |
exports.default = _default; |
| 21088 |
|
| 21089 |
/***/ }), |
| 21090 |
/* 458 */ |
| 21091 |
/***/ (function(module, exports, __webpack_require__) { |
| 21092 |
|
| 21093 |
"use strict"; |
| 21094 |
|
| 21095 |
|
| 21096 |
var _interopRequireDefault = __webpack_require__(0); |
| 21097 |
|
| 21098 |
var _Object$defineProperty = __webpack_require__(1); |
| 21099 |
|
| 21100 |
_Object$defineProperty(exports, "__esModule", { |
| 21101 |
value: true |
| 21102 |
}); |
| 21103 |
|
| 21104 |
exports.default = void 0; |
| 21105 |
|
| 21106 |
var _classCallCheck2 = _interopRequireDefault(__webpack_require__(2)); |
| 21107 |
|
| 21108 |
var _createClass2 = _interopRequireDefault(__webpack_require__(3)); |
| 21109 |
|
| 21110 |
var _inherits2 = _interopRequireDefault(__webpack_require__(4)); |
| 21111 |
|
| 21112 |
var _createSuper2 = _interopRequireDefault(__webpack_require__(5)); |
| 21113 |
|
| 21114 |
var _component = _interopRequireDefault(__webpack_require__(459)); |
| 21115 |
|
| 21116 |
var _default = /*#__PURE__*/function (_elementorModules$Mod) { |
| 21117 |
(0, _inherits2.default)(_default, _elementorModules$Mod); |
| 21118 |
|
| 21119 |
var _super = (0, _createSuper2.default)(_default); |
| 21120 |
|
| 21121 |
function _default() { |
| 21122 |
(0, _classCallCheck2.default)(this, _default); |
| 21123 |
return _super.apply(this, arguments); |
| 21124 |
} |
| 21125 |
|
| 21126 |
(0, _createClass2.default)(_default, [{ |
| 21127 |
key: "onInit", |
| 21128 |
value: function onInit() { |
| 21129 |
$e.components.register(new _component.default({ |
| 21130 |
manager: this |
| 21131 |
})); |
| 21132 |
} |
| 21133 |
}]); |
| 21134 |
return _default; |
| 21135 |
}(elementorModules.Module); |
| 21136 |
|
| 21137 |
exports.default = _default; |
| 21138 |
|
| 21139 |
/***/ }), |
| 21140 |
/* 459 */ |
| 21141 |
/***/ (function(module, exports, __webpack_require__) { |
| 21142 |
|
| 21143 |
"use strict"; |
| 21144 |
|
| 21145 |
|
| 21146 |
var _interopRequireDefault = __webpack_require__(0); |
| 21147 |
|
| 21148 |
var _Object$defineProperty = __webpack_require__(1); |
| 21149 |
|
| 21150 |
_Object$defineProperty(exports, "__esModule", { |
| 21151 |
value: true |
| 21152 |
}); |
| 21153 |
|
| 21154 |
exports.default = void 0; |
| 21155 |
|
| 21156 |
var _classCallCheck2 = _interopRequireDefault(__webpack_require__(2)); |
| 21157 |
|
| 21158 |
var _createClass2 = _interopRequireDefault(__webpack_require__(3)); |
| 21159 |
|
| 21160 |
var _inherits2 = _interopRequireDefault(__webpack_require__(4)); |
| 21161 |
|
| 21162 |
var _createSuper2 = _interopRequireDefault(__webpack_require__(5)); |
| 21163 |
|
| 21164 |
var _componentModalBase = _interopRequireDefault(__webpack_require__(287)); |
| 21165 |
|
| 21166 |
var _modalLayout = _interopRequireDefault(__webpack_require__(460)); |
| 21167 |
|
| 21168 |
var Component = /*#__PURE__*/function (_ComponentModalBase) { |
| 21169 |
(0, _inherits2.default)(Component, _ComponentModalBase); |
| 21170 |
|
| 21171 |
var _super = (0, _createSuper2.default)(Component); |
| 21172 |
|
| 21173 |
function Component() { |
| 21174 |
(0, _classCallCheck2.default)(this, Component); |
| 21175 |
return _super.apply(this, arguments); |
| 21176 |
} |
| 21177 |
|
| 21178 |
(0, _createClass2.default)(Component, [{ |
| 21179 |
key: "getNamespace", |
| 21180 |
value: function getNamespace() { |
| 21181 |
return 'shortcuts'; |
| 21182 |
} |
| 21183 |
}, { |
| 21184 |
key: "defaultShortcuts", |
| 21185 |
value: function defaultShortcuts() { |
| 21186 |
return { |
| 21187 |
'': { |
| 21188 |
keys: 'ctrl+?' |
| 21189 |
} |
| 21190 |
}; |
| 21191 |
} |
| 21192 |
}, { |
| 21193 |
key: "getModalLayout", |
| 21194 |
value: function getModalLayout() { |
| 21195 |
return _modalLayout.default; |
| 21196 |
} |
| 21197 |
}]); |
| 21198 |
return Component; |
| 21199 |
}(_componentModalBase.default); |
| 21200 |
|
| 21201 |
exports.default = Component; |
| 21202 |
|
| 21203 |
/***/ }), |
| 21204 |
/* 460 */ |
| 21205 |
/***/ (function(module, exports, __webpack_require__) { |
| 21206 |
|
| 21207 |
"use strict"; |
| 21208 |
|
| 21209 |
|
| 21210 |
var _interopRequireDefault = __webpack_require__(0); |
| 21211 |
|
| 21212 |
var _Object$defineProperty = __webpack_require__(1); |
| 21213 |
|
| 21214 |
_Object$defineProperty(exports, "__esModule", { |
| 21215 |
value: true |
| 21216 |
}); |
| 21217 |
|
| 21218 |
exports.default = void 0; |
| 21219 |
|
| 21220 |
var _classCallCheck2 = _interopRequireDefault(__webpack_require__(2)); |
| 21221 |
|
| 21222 |
var _createClass2 = _interopRequireDefault(__webpack_require__(3)); |
| 21223 |
|
| 21224 |
var _get3 = _interopRequireDefault(__webpack_require__(26)); |
| 21225 |
|
| 21226 |
var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(16)); |
| 21227 |
|
| 21228 |
var _inherits2 = _interopRequireDefault(__webpack_require__(4)); |
| 21229 |
|
| 21230 |
var _createSuper2 = _interopRequireDefault(__webpack_require__(5)); |
| 21231 |
|
| 21232 |
var _modalContent = _interopRequireDefault(__webpack_require__(461)); |
| 21233 |
|
| 21234 |
var _default = /*#__PURE__*/function (_elementorModules$com) { |
| 21235 |
(0, _inherits2.default)(_default, _elementorModules$com); |
| 21236 |
|
| 21237 |
var _super = (0, _createSuper2.default)(_default); |
| 21238 |
|
| 21239 |
function _default() { |
| 21240 |
(0, _classCallCheck2.default)(this, _default); |
| 21241 |
return _super.apply(this, arguments); |
| 21242 |
} |
| 21243 |
|
| 21244 |
(0, _createClass2.default)(_default, [{ |
| 21245 |
key: "getModalOptions", |
| 21246 |
value: function getModalOptions() { |
| 21247 |
return { |
| 21248 |
id: 'elementor-hotkeys__modal' |
| 21249 |
}; |
| 21250 |
} |
| 21251 |
}, { |
| 21252 |
key: "getLogoOptions", |
| 21253 |
value: function getLogoOptions() { |
| 21254 |
return { |
| 21255 |
title: elementor.translate('keyboard_shortcuts') |
| 21256 |
}; |
| 21257 |
} |
| 21258 |
}, { |
| 21259 |
key: "initialize", |
| 21260 |
value: function initialize() { |
| 21261 |
var _get2; |
| 21262 |
|
| 21263 |
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { |
| 21264 |
args[_key] = arguments[_key]; |
| 21265 |
} |
| 21266 |
|
| 21267 |
(_get2 = (0, _get3.default)((0, _getPrototypeOf2.default)(_default.prototype), "initialize", this)).call.apply(_get2, [this].concat(args)); |
| 21268 |
|
| 21269 |
this.showLogo(); |
| 21270 |
this.showContentView(); |
| 21271 |
} |
| 21272 |
}, { |
| 21273 |
key: "showContentView", |
| 21274 |
value: function showContentView() { |
| 21275 |
this.modalContent.show(new _modalContent.default()); |
| 21276 |
} |
| 21277 |
}]); |
| 21278 |
return _default; |
| 21279 |
}(elementorModules.common.views.modal.Layout); |
| 21280 |
|
| 21281 |
exports.default = _default; |
| 21282 |
|
| 21283 |
/***/ }), |
| 21284 |
/* 461 */ |
| 21285 |
/***/ (function(module, exports, __webpack_require__) { |
| 21286 |
|
| 21287 |
"use strict"; |
| 21288 |
|
| 21289 |
|
| 21290 |
var _interopRequireDefault = __webpack_require__(0); |
| 21291 |
|
| 21292 |
var _Object$defineProperty = __webpack_require__(1); |
| 21293 |
|
| 21294 |
_Object$defineProperty(exports, "__esModule", { |
| 21295 |
value: true |
| 21296 |
}); |
| 21297 |
|
| 21298 |
exports.default = void 0; |
| 21299 |
|
| 21300 |
var _classCallCheck2 = _interopRequireDefault(__webpack_require__(2)); |
| 21301 |
|
| 21302 |
var _createClass2 = _interopRequireDefault(__webpack_require__(3)); |
| 21303 |
|
| 21304 |
var _inherits2 = _interopRequireDefault(__webpack_require__(4)); |
| 21305 |
|
| 21306 |
var _createSuper2 = _interopRequireDefault(__webpack_require__(5)); |
| 21307 |
|
| 21308 |
var _environment = _interopRequireDefault(__webpack_require__(272)); |
| 21309 |
|
| 21310 |
var _default = /*#__PURE__*/function (_Marionette$LayoutVie) { |
| 21311 |
(0, _inherits2.default)(_default, _Marionette$LayoutVie); |
| 21312 |
|
| 21313 |
var _super = (0, _createSuper2.default)(_default); |
| 21314 |
|
| 21315 |
function _default() { |
| 21316 |
(0, _classCallCheck2.default)(this, _default); |
| 21317 |
return _super.apply(this, arguments); |
| 21318 |
} |
| 21319 |
|
| 21320 |
(0, _createClass2.default)(_default, [{ |
| 21321 |
key: "id", |
| 21322 |
value: function id() { |
| 21323 |
return 'elementor-hotkeys'; |
| 21324 |
} |
| 21325 |
}, { |
| 21326 |
key: "templateHelpers", |
| 21327 |
value: function templateHelpers() { |
| 21328 |
return { |
| 21329 |
environment: _environment.default |
| 21330 |
}; |
| 21331 |
} |
| 21332 |
}, { |
| 21333 |
key: "getTemplate", |
| 21334 |
value: function getTemplate() { |
| 21335 |
return '#tmpl-elementor-hotkeys'; |
| 21336 |
} |
| 21337 |
}]); |
| 21338 |
return _default; |
| 21339 |
}(Marionette.LayoutView); |
| 21340 |
|
| 21341 |
exports.default = _default; |
| 21342 |
|
| 21343 |
/***/ }), |
| 21344 |
/* 462 */ |
| 21345 |
/***/ (function(module, exports, __webpack_require__) { |
| 21346 |
|
| 21347 |
"use strict"; |
| 21348 |
|
| 21349 |
|
| 21350 |
var _interopRequireDefault = __webpack_require__(0); |
| 21351 |
|
| 21352 |
var _Object$defineProperty = __webpack_require__(1); |
| 21353 |
|
| 21354 |
_Object$defineProperty(exports, "__esModule", { |
| 21355 |
value: true |
| 21356 |
}); |
| 21357 |
|
| 21358 |
exports.default = void 0; |
| 21359 |
|
| 21360 |
__webpack_require__(58); |
| 21361 |
|
| 21362 |
var _keys = _interopRequireDefault(__webpack_require__(23)); |
| 21363 |
|
| 21364 |
__webpack_require__(39); |
| 21365 |
|
| 21366 |
var _classCallCheck2 = _interopRequireDefault(__webpack_require__(2)); |
| 21367 |
|
| 21368 |
var _createClass2 = _interopRequireDefault(__webpack_require__(3)); |
| 21369 |
|
| 21370 |
var _inherits2 = _interopRequireDefault(__webpack_require__(4)); |
| 21371 |
|
| 21372 |
var _createSuper2 = _interopRequireDefault(__webpack_require__(5)); |
| 21373 |
|
| 21374 |
var _modalLayout = _interopRequireDefault(__webpack_require__(463)); |
| 21375 |
|
| 21376 |
var _iconManager = __webpack_require__(464); |
| 21377 |
|
| 21378 |
var _iconLibrary = _interopRequireDefault(__webpack_require__(470)); |
| 21379 |
|
| 21380 |
var _store = _interopRequireDefault(__webpack_require__(471)); |
| 21381 |
|
| 21382 |
var _reactDom = __webpack_require__(327); |
| 21383 |
|
| 21384 |
var _default = /*#__PURE__*/function (_elementorModules$Mod) { |
| 21385 |
(0, _inherits2.default)(_default, _elementorModules$Mod); |
| 21386 |
|
| 21387 |
var _super = (0, _createSuper2.default)(_default); |
| 21388 |
|
| 21389 |
function _default() { |
| 21390 |
(0, _classCallCheck2.default)(this, _default); |
| 21391 |
return _super.apply(this, arguments); |
| 21392 |
} |
| 21393 |
|
| 21394 |
(0, _createClass2.default)(_default, [{ |
| 21395 |
key: "onInit", |
| 21396 |
value: function onInit() { |
| 21397 |
// Init icon library helper |
| 21398 |
this.library = new _iconLibrary.default(); // Init Icon library Storage helper |
| 21399 |
|
| 21400 |
this.store = new _store.default(); // Fetch fa4 to fa5 migration data |
| 21401 |
|
| 21402 |
elementor.helpers.fetchFa4ToFa5Mapping(); |
| 21403 |
this.cache = {}; |
| 21404 |
} |
| 21405 |
}, { |
| 21406 |
key: "getLayout", |
| 21407 |
value: function getLayout() { |
| 21408 |
var _this = this; |
| 21409 |
|
| 21410 |
if (!this.layout) { |
| 21411 |
this.layout = new _modalLayout.default(); |
| 21412 |
var layoutModal = this.layout.getModal(); |
| 21413 |
layoutModal.addButton({ |
| 21414 |
name: 'insert_icon', |
| 21415 |
text: elementor.translate('Insert'), |
| 21416 |
classes: 'elementor-button elementor-button-success', |
| 21417 |
callback: function callback() { |
| 21418 |
_this.updateControlValue(); |
| 21419 |
|
| 21420 |
_this.unMountIconManager(); |
| 21421 |
} |
| 21422 |
}); |
| 21423 |
layoutModal.on('show', this.onPickerShow.bind(this)).on('hide', this.unMountIconManager); |
| 21424 |
} |
| 21425 |
|
| 21426 |
return this.layout; |
| 21427 |
} |
| 21428 |
}, { |
| 21429 |
key: "getDefaultSettings", |
| 21430 |
value: function getDefaultSettings() { |
| 21431 |
return { |
| 21432 |
selectedIcon: {} |
| 21433 |
}; |
| 21434 |
} |
| 21435 |
}, { |
| 21436 |
key: "unMountIconManager", |
| 21437 |
value: function unMountIconManager() { |
| 21438 |
var containerElement = document.querySelector('#elementor-icons-manager-modal .dialog-content'); |
| 21439 |
(0, _reactDom.unmountComponentAtNode)(containerElement); |
| 21440 |
} |
| 21441 |
}, { |
| 21442 |
key: "loadIconLibraries", |
| 21443 |
value: function loadIconLibraries() { |
| 21444 |
if (!this.cache.loaded) { |
| 21445 |
elementor.config.icons.libraries.forEach(function (library) { |
| 21446 |
if ('all' === library.name) { |
| 21447 |
return; |
| 21448 |
} |
| 21449 |
|
| 21450 |
elementor.iconManager.library.initIconType(library); |
| 21451 |
}); |
| 21452 |
this.cache.loaded = true; |
| 21453 |
} |
| 21454 |
} |
| 21455 |
}, { |
| 21456 |
key: "onPickerShow", |
| 21457 |
value: function onPickerShow() { |
| 21458 |
var controlView = this.getSettings('controlView'), |
| 21459 |
loaded = { |
| 21460 |
GoPro: true |
| 21461 |
}, |
| 21462 |
iconManagerConfig = { |
| 21463 |
recommended: controlView.model.get('recommended') || false |
| 21464 |
}; |
| 21465 |
var selected = controlView.getControlValue(), |
| 21466 |
icons = elementor.config.icons.libraries; |
| 21467 |
|
| 21468 |
if (!selected.library || !selected.value) { |
| 21469 |
selected = { |
| 21470 |
value: '', |
| 21471 |
library: '' |
| 21472 |
}; |
| 21473 |
} |
| 21474 |
|
| 21475 |
iconManagerConfig.selected = selected; |
| 21476 |
this.setSettings('selectedIcon', selected); |
| 21477 |
|
| 21478 |
if (iconManagerConfig.recommended) { |
| 21479 |
var hasRecommended = false; |
| 21480 |
icons.forEach(function (library, index) { |
| 21481 |
if ('recommended' === library.name) { |
| 21482 |
hasRecommended = true; |
| 21483 |
icons[index].icons = iconManagerConfig.recommended; |
| 21484 |
} |
| 21485 |
}); |
| 21486 |
|
| 21487 |
if (!hasRecommended) { |
| 21488 |
icons.unshift({ |
| 21489 |
name: 'recommended', |
| 21490 |
label: 'Recommended', |
| 21491 |
icons: iconManagerConfig.recommended, |
| 21492 |
labelIcon: 'eicon-star-o', |
| 21493 |
native: true |
| 21494 |
}); |
| 21495 |
} |
| 21496 |
} else { |
| 21497 |
icons = icons.filter(function (library) { |
| 21498 |
return 'recommended' !== library.name; |
| 21499 |
}); |
| 21500 |
} |
| 21501 |
|
| 21502 |
icons.forEach(function (tab, index) { |
| 21503 |
if (-1 === ['all', 'recommended'].indexOf(tab.name)) { |
| 21504 |
elementor.iconManager.library.initIconType(tab, function (lib) { |
| 21505 |
icons[index] = lib; |
| 21506 |
}); |
| 21507 |
} |
| 21508 |
|
| 21509 |
loaded[tab.name] = true; |
| 21510 |
}); |
| 21511 |
iconManagerConfig.loaded = loaded; |
| 21512 |
iconManagerConfig.icons = icons; // Set active tab |
| 21513 |
|
| 21514 |
var activeTab = selected.library || icons[0].name; |
| 21515 |
|
| 21516 |
if ('svg' === selected.library) { |
| 21517 |
activeTab = icons[0].name; |
| 21518 |
} // selected Library exists |
| 21519 |
|
| 21520 |
|
| 21521 |
if (!(0, _keys.default)(icons).some(function (library) { |
| 21522 |
return library === activeTab; |
| 21523 |
})) { |
| 21524 |
activeTab = icons[0].name; |
| 21525 |
} // Show recommended tab if selected from it |
| 21526 |
|
| 21527 |
|
| 21528 |
if (iconManagerConfig.recommended && '' !== selected.library && '' !== selected.value && iconManagerConfig.recommended.hasOwnProperty(selected.library)) { |
| 21529 |
var iconLibrary = icons.filter(function (library) { |
| 21530 |
return selected.library === library.name; |
| 21531 |
}); |
| 21532 |
var selectedIconName = selected.value.replace(iconLibrary[0].displayPrefix + ' ' + iconLibrary[0].prefix, ''); |
| 21533 |
|
| 21534 |
if (iconManagerConfig.recommended[selected.library].some(function (icon) { |
| 21535 |
return -1 < icon.indexOf(selectedIconName); |
| 21536 |
})) { |
| 21537 |
activeTab = icons[0].name; |
| 21538 |
} |
| 21539 |
} |
| 21540 |
|
| 21541 |
iconManagerConfig.customIconsURL = elementor.config.customIconsURL; |
| 21542 |
iconManagerConfig.activeTab = activeTab; |
| 21543 |
return (0, _iconManager.renderIconManager)(iconManagerConfig); |
| 21544 |
} |
| 21545 |
}, { |
| 21546 |
key: "updateControlValue", |
| 21547 |
value: function updateControlValue() { |
| 21548 |
var settings = this.getSettings(); |
| 21549 |
settings.controlView.setValue(settings.selectedIcon); |
| 21550 |
settings.controlView.applySavedValue(); |
| 21551 |
} |
| 21552 |
}, { |
| 21553 |
key: "show", |
| 21554 |
value: function show(options) { |
| 21555 |
this.setSettings('controlView', options.view); |
| 21556 |
this.getLayout().showModal(options); |
| 21557 |
} |
| 21558 |
}]); |
| 21559 |
return _default; |
| 21560 |
}(elementorModules.Module); |
| 21561 |
|
| 21562 |
exports.default = _default; |
| 21563 |
|
| 21564 |
/***/ }), |
| 21565 |
/* 463 */ |
| 21566 |
/***/ (function(module, exports, __webpack_require__) { |
| 21567 |
|
| 21568 |
"use strict"; |
| 21569 |
|
| 21570 |
|
| 21571 |
var _interopRequireDefault = __webpack_require__(0); |
| 21572 |
|
| 21573 |
var _Object$defineProperty = __webpack_require__(1); |
| 21574 |
|
| 21575 |
_Object$defineProperty(exports, "__esModule", { |
| 21576 |
value: true |
| 21577 |
}); |
| 21578 |
|
| 21579 |
exports.default = void 0; |
| 21580 |
|
| 21581 |
var _classCallCheck2 = _interopRequireDefault(__webpack_require__(2)); |
| 21582 |
|
| 21583 |
var _createClass2 = _interopRequireDefault(__webpack_require__(3)); |
| 21584 |
|
| 21585 |
var _get3 = _interopRequireDefault(__webpack_require__(26)); |
| 21586 |
|
| 21587 |
var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(16)); |
| 21588 |
|
| 21589 |
var _inherits2 = _interopRequireDefault(__webpack_require__(4)); |
| 21590 |
|
| 21591 |
var _createSuper2 = _interopRequireDefault(__webpack_require__(5)); |
| 21592 |
|
| 21593 |
var _layout = _interopRequireDefault(__webpack_require__(355)); |
| 21594 |
|
| 21595 |
var _default = /*#__PURE__*/function (_BaseModalLayout) { |
| 21596 |
(0, _inherits2.default)(_default, _BaseModalLayout); |
| 21597 |
|
| 21598 |
var _super = (0, _createSuper2.default)(_default); |
| 21599 |
|
| 21600 |
function _default() { |
| 21601 |
(0, _classCallCheck2.default)(this, _default); |
| 21602 |
return _super.apply(this, arguments); |
| 21603 |
} |
| 21604 |
|
| 21605 |
(0, _createClass2.default)(_default, [{ |
| 21606 |
key: "getModalOptions", |
| 21607 |
value: function getModalOptions() { |
| 21608 |
return { |
| 21609 |
id: 'elementor-icons-manager-modal' |
| 21610 |
}; |
| 21611 |
} |
| 21612 |
}, { |
| 21613 |
key: "getLogoOptions", |
| 21614 |
value: function getLogoOptions() { |
| 21615 |
return { |
| 21616 |
title: elementor.translate('icon_library') |
| 21617 |
}; |
| 21618 |
} |
| 21619 |
}, { |
| 21620 |
key: "initialize", |
| 21621 |
value: function initialize() { |
| 21622 |
var _get2; |
| 21623 |
|
| 21624 |
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { |
| 21625 |
args[_key] = arguments[_key]; |
| 21626 |
} |
| 21627 |
|
| 21628 |
(_get2 = (0, _get3.default)((0, _getPrototypeOf2.default)(_default.prototype), "initialize", this)).call.apply(_get2, [this].concat(args)); |
| 21629 |
|
| 21630 |
this.showLogo(); |
| 21631 |
} |
| 21632 |
}]); |
| 21633 |
return _default; |
| 21634 |
}(_layout.default); |
| 21635 |
|
| 21636 |
exports.default = _default; |
| 21637 |
|
| 21638 |
/***/ }), |
| 21639 |
/* 464 */ |
| 21640 |
/***/ (function(module, exports, __webpack_require__) { |
| 21641 |
|
| 21642 |
"use strict"; |
| 21643 |
|
| 21644 |
|
| 21645 |
var _interopRequireDefault = __webpack_require__(0); |
| 21646 |
|
| 21647 |
var _interopRequireWildcard = __webpack_require__(36); |
| 21648 |
|
| 21649 |
var _Object$defineProperty = __webpack_require__(1); |
| 21650 |
|
| 21651 |
_Object$defineProperty(exports, "__esModule", { |
| 21652 |
value: true |
| 21653 |
}); |
| 21654 |
|
| 21655 |
exports.renderIconManager = exports.default = void 0; |
| 21656 |
|
| 21657 |
var _react = _interopRequireWildcard(__webpack_require__(11)); |
| 21658 |
|
| 21659 |
var _extends2 = _interopRequireDefault(__webpack_require__(188)); |
| 21660 |
|
| 21661 |
var _objectSpread2 = _interopRequireDefault(__webpack_require__(214)); |
| 21662 |
|
| 21663 |
__webpack_require__(39); |
| 21664 |
|
| 21665 |
var _classCallCheck2 = _interopRequireDefault(__webpack_require__(2)); |
| 21666 |
|
| 21667 |
var _createClass2 = _interopRequireDefault(__webpack_require__(3)); |
| 21668 |
|
| 21669 |
var _assertThisInitialized2 = _interopRequireDefault(__webpack_require__(49)); |
| 21670 |
|
| 21671 |
var _inherits2 = _interopRequireDefault(__webpack_require__(4)); |
| 21672 |
|
| 21673 |
var _createSuper2 = _interopRequireDefault(__webpack_require__(5)); |
| 21674 |
|
| 21675 |
var _defineProperty2 = _interopRequireDefault(__webpack_require__(28)); |
| 21676 |
|
| 21677 |
var _propTypes = _interopRequireDefault(__webpack_require__(41)); |
| 21678 |
|
| 21679 |
var _reactDom = __webpack_require__(327); |
| 21680 |
|
| 21681 |
var _tab = _interopRequireDefault(__webpack_require__(465)); |
| 21682 |
|
| 21683 |
var _iconsGoPro = _interopRequireDefault(__webpack_require__(469)); |
| 21684 |
|
| 21685 |
var IconsManager = /*#__PURE__*/function (_Component) { |
| 21686 |
(0, _inherits2.default)(IconsManager, _Component); |
| 21687 |
|
| 21688 |
var _super = (0, _createSuper2.default)(IconsManager); |
| 21689 |
|
| 21690 |
function IconsManager() { |
| 21691 |
var _this; |
| 21692 |
|
| 21693 |
(0, _classCallCheck2.default)(this, IconsManager); |
| 21694 |
|
| 21695 |
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { |
| 21696 |
args[_key] = arguments[_key]; |
| 21697 |
} |
| 21698 |
|
| 21699 |
_this = _super.call.apply(_super, [this].concat(args)); |
| 21700 |
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "scrollViewRef", (0, _react.createRef)()); |
| 21701 |
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "state", { |
| 21702 |
activeTab: _this.props.activeTab, |
| 21703 |
selected: { |
| 21704 |
library: '', |
| 21705 |
value: '' |
| 21706 |
}, |
| 21707 |
iconTabs: elementor.config.icons.libraries, |
| 21708 |
loaded: _this.props.loaded, |
| 21709 |
filter: '' |
| 21710 |
}); |
| 21711 |
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "cache", {}); |
| 21712 |
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "loadAllTabs", function () { |
| 21713 |
var loaded = _this.state.loaded; |
| 21714 |
var icons = _this.props.icons; |
| 21715 |
icons.forEach(function (tabSettings) { |
| 21716 |
if (loaded[tabSettings.name]) { |
| 21717 |
return; |
| 21718 |
} |
| 21719 |
|
| 21720 |
if (-1 < ['all', 'recommended'].indexOf(tabSettings.name)) { |
| 21721 |
return; |
| 21722 |
} |
| 21723 |
|
| 21724 |
elementor.iconManager.library.initIconType((0, _objectSpread2.default)({}, tabSettings), function (library) { |
| 21725 |
_this.cache[library.name] = library; |
| 21726 |
loaded[tabSettings.name] = true; |
| 21727 |
}); |
| 21728 |
}); |
| 21729 |
loaded.all = true; |
| 21730 |
loaded.recommended = true; |
| 21731 |
|
| 21732 |
_this.setState({ |
| 21733 |
loaded: loaded |
| 21734 |
}); |
| 21735 |
}); |
| 21736 |
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "getActiveTab", function () { |
| 21737 |
var activeTab = _this.state.activeTab; |
| 21738 |
var loaded = _this.state.loaded, |
| 21739 |
icons = _this.props.icons; |
| 21740 |
|
| 21741 |
if (!activeTab) { |
| 21742 |
if (_this.props.activeTab) { |
| 21743 |
activeTab = _this.props.activeTab; |
| 21744 |
} |
| 21745 |
} |
| 21746 |
|
| 21747 |
if ('GoPro' === activeTab) { |
| 21748 |
return activeTab; |
| 21749 |
} |
| 21750 |
|
| 21751 |
if (!loaded[activeTab]) { |
| 21752 |
return false; |
| 21753 |
} |
| 21754 |
|
| 21755 |
var tabSettings = (0, _objectSpread2.default)({}, icons.filter(function (tab) { |
| 21756 |
return tab.name === activeTab; |
| 21757 |
})[0]); |
| 21758 |
|
| 21759 |
if (loaded[activeTab]) { |
| 21760 |
return (0, _objectSpread2.default)({}, tabSettings); |
| 21761 |
} |
| 21762 |
|
| 21763 |
if ('all' === tabSettings.name && !loaded.all) { |
| 21764 |
return _this.loadAllTabs(); |
| 21765 |
} |
| 21766 |
|
| 21767 |
elementor.iconManager.library.initIconType((0, _objectSpread2.default)({}, tabSettings), function (library) { |
| 21768 |
_this.cache[library.name] = library; |
| 21769 |
|
| 21770 |
_this.updateLoaded(library.name); |
| 21771 |
}); |
| 21772 |
return false; |
| 21773 |
}); |
| 21774 |
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "getIconTabsLinks", function () { |
| 21775 |
var native = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true; |
| 21776 |
return _this.props.icons.map(function (tab) { |
| 21777 |
if (native ^ _this.isNativeTab(tab)) { |
| 21778 |
return ''; |
| 21779 |
} |
| 21780 |
|
| 21781 |
var isCurrentTab = tab.name === _this.state.activeTab; |
| 21782 |
var className = 'elementor-icons-manager__tab-link'; |
| 21783 |
|
| 21784 |
if (isCurrentTab) { |
| 21785 |
className += ' elementor-active'; |
| 21786 |
} |
| 21787 |
|
| 21788 |
return /*#__PURE__*/_react.default.createElement("div", { |
| 21789 |
className: className, |
| 21790 |
key: tab.name, |
| 21791 |
onClick: function onClick() { |
| 21792 |
if (isCurrentTab) { |
| 21793 |
return; |
| 21794 |
} |
| 21795 |
|
| 21796 |
_this.setState({ |
| 21797 |
activeTab: tab.name |
| 21798 |
}); |
| 21799 |
} |
| 21800 |
}, /*#__PURE__*/_react.default.createElement("i", { |
| 21801 |
className: tab.labelIcon |
| 21802 |
}), tab.label); |
| 21803 |
}); |
| 21804 |
}); |
| 21805 |
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "getActiveTabIcons", function (activeTab) { |
| 21806 |
if (activeTab.name) { |
| 21807 |
return _this.getActiveTabIcons(activeTab.name); |
| 21808 |
} |
| 21809 |
|
| 21810 |
if (_this.cache[activeTab]) { |
| 21811 |
return _this.cache[activeTab].icons; |
| 21812 |
} |
| 21813 |
|
| 21814 |
if ('recommended' === activeTab) { |
| 21815 |
return _this.state.iconTabs[0].icons; |
| 21816 |
} |
| 21817 |
|
| 21818 |
if ('all' === activeTab) { |
| 21819 |
return _this.getAllIcons(); |
| 21820 |
} |
| 21821 |
|
| 21822 |
if (!_this.state.loaded[activeTab]) { |
| 21823 |
var librarySettings = _this.props.icons.filter(function (library) { |
| 21824 |
return activeTab === library.name; |
| 21825 |
}); |
| 21826 |
|
| 21827 |
return elementor.iconManager.library.initIconType((0, _objectSpread2.default)({}, librarySettings[0]), function (library) { |
| 21828 |
_this.cache[library.name] = library; |
| 21829 |
|
| 21830 |
_this.updateLoaded(library.name); |
| 21831 |
}); |
| 21832 |
} |
| 21833 |
|
| 21834 |
return elementor.iconManager.store.getIcons(activeTab); |
| 21835 |
}); |
| 21836 |
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "getAllIcons", function () { |
| 21837 |
if (_this.cache.all) { |
| 21838 |
return _this.cache.all.icons; |
| 21839 |
} |
| 21840 |
|
| 21841 |
var icons = {}; |
| 21842 |
|
| 21843 |
_this.props.icons.forEach(function (tabSettings) { |
| 21844 |
if ('all' === tabSettings.name || 'recommended' === tabSettings.name) { |
| 21845 |
return; |
| 21846 |
} |
| 21847 |
|
| 21848 |
icons[tabSettings.name] = _this.getActiveTabIcons(tabSettings.name); |
| 21849 |
}); |
| 21850 |
|
| 21851 |
_this.cache.all = { |
| 21852 |
icons: icons |
| 21853 |
}; |
| 21854 |
return icons; |
| 21855 |
}); |
| 21856 |
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "handleSearch", function (event) { |
| 21857 |
var filter = event.target.value; |
| 21858 |
|
| 21859 |
if (filter && '' !== filter) { |
| 21860 |
filter = filter.toLocaleLowerCase(); |
| 21861 |
|
| 21862 |
if (_this.state.filter === filter) { |
| 21863 |
return; |
| 21864 |
} |
| 21865 |
} else { |
| 21866 |
filter = ''; |
| 21867 |
} |
| 21868 |
|
| 21869 |
_this.setState({ |
| 21870 |
filter: filter |
| 21871 |
}); |
| 21872 |
}); |
| 21873 |
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "setSelected", function (selected) { |
| 21874 |
elementor.iconManager.setSettings('selectedIcon', selected); |
| 21875 |
|
| 21876 |
_this.setState({ |
| 21877 |
selected: selected |
| 21878 |
}); |
| 21879 |
}); |
| 21880 |
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "getSelected", function () { |
| 21881 |
var selected = _this.state.selected; |
| 21882 |
|
| 21883 |
if ('' === selected.value && _this.props.selected && _this.props.selected.value) { |
| 21884 |
selected = { |
| 21885 |
value: _this.props.selected.value, |
| 21886 |
library: _this.props.selected.library |
| 21887 |
}; |
| 21888 |
} |
| 21889 |
|
| 21890 |
return selected; |
| 21891 |
}); |
| 21892 |
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "render", function () { |
| 21893 |
var activeTab = _this.getActiveTab(), |
| 21894 |
activeTabName = activeTab.name ? activeTab.name : activeTab, |
| 21895 |
_this$props$showSearc = _this.props.showSearch, |
| 21896 |
showSearch = _this$props$showSearc === void 0 ? true : _this$props$showSearc, |
| 21897 |
filter = _this.state.filter, |
| 21898 |
selected = _this.getSelected(); |
| 21899 |
|
| 21900 |
if ('GoPro' !== activeTab) { |
| 21901 |
if (!activeTabName || !_this.state.loaded[activeTabName]) { |
| 21902 |
return 'Loading'; |
| 21903 |
} |
| 21904 |
|
| 21905 |
if (activeTab) { |
| 21906 |
activeTab.icons = _this.getActiveTabIcons(activeTab); |
| 21907 |
} |
| 21908 |
} |
| 21909 |
|
| 21910 |
return /*#__PURE__*/_react.default.createElement(_react.Fragment, null, /*#__PURE__*/_react.default.createElement("div", { |
| 21911 |
id: "elementor-icons-manager__sidebar", |
| 21912 |
className: 'elementor-templates-modal__sidebar' |
| 21913 |
}, /*#__PURE__*/_react.default.createElement("div", { |
| 21914 |
id: "elementor-icons-manager__tab-links" |
| 21915 |
}, _this.getIconTabsLinks(), _this.getUploadCustomButton(), _this.getIconTabsLinks(false))), /*#__PURE__*/_react.default.createElement("div", { |
| 21916 |
id: "elementor-icons-manager__main", |
| 21917 |
className: 'elementor-templates-modal__content' |
| 21918 |
}, 'GoPro' === activeTabName ? /*#__PURE__*/_react.default.createElement(_iconsGoPro.default, null) : /*#__PURE__*/_react.default.createElement(_react.Fragment, null, showSearch ? _this.getSearchHTML() : '', /*#__PURE__*/_react.default.createElement("div", { |
| 21919 |
id: "elementor-icons-manager__tab__wrapper", |
| 21920 |
ref: _this.scrollViewRef |
| 21921 |
}, /*#__PURE__*/_react.default.createElement("div", { |
| 21922 |
id: "elementor-icons-manager__tab__title" |
| 21923 |
}, activeTab.label), /*#__PURE__*/_react.default.createElement("div", { |
| 21924 |
id: "elementor-icons-manager__tab__content_wrapper" |
| 21925 |
}, /*#__PURE__*/_react.default.createElement("input", { |
| 21926 |
type: "hidden", |
| 21927 |
name: "icon_value", |
| 21928 |
id: "icon_value", |
| 21929 |
value: selected.value |
| 21930 |
}), /*#__PURE__*/_react.default.createElement("input", { |
| 21931 |
type: "hidden", |
| 21932 |
name: "icon_type", |
| 21933 |
id: "icon_type", |
| 21934 |
value: selected.library |
| 21935 |
}), _this.state.loaded[activeTab.name] ? /*#__PURE__*/_react.default.createElement(_tab.default, (0, _extends2.default)({ |
| 21936 |
setSelected: _this.setSelected, |
| 21937 |
selected: selected, |
| 21938 |
filter: filter, |
| 21939 |
key: activeTab.name, |
| 21940 |
parentRef: _this.scrollViewRef |
| 21941 |
}, activeTab)) : 'Loading'))))); |
| 21942 |
}); |
| 21943 |
return _this; |
| 21944 |
} |
| 21945 |
|
| 21946 |
(0, _createClass2.default)(IconsManager, [{ |
| 21947 |
key: "updateLoaded", |
| 21948 |
value: function updateLoaded(libraryName) { |
| 21949 |
var loaded = this.state.loaded; |
| 21950 |
loaded[libraryName] = true; |
| 21951 |
this.setState({ |
| 21952 |
loaded: loaded |
| 21953 |
}); |
| 21954 |
} |
| 21955 |
}, { |
| 21956 |
key: "isNativeTab", |
| 21957 |
value: function isNativeTab(tab) { |
| 21958 |
return ('all' === tab.name || 'recommended' === tab.name || 'fa-' === tab.name.substr(0, 3)) && tab.native; |
| 21959 |
} |
| 21960 |
}, { |
| 21961 |
key: "getUploadCustomButton", |
| 21962 |
value: function getUploadCustomButton() { |
| 21963 |
var _this2 = this; |
| 21964 |
|
| 21965 |
var onClick = function onClick() { |
| 21966 |
if ('GoPro' === _this2.state.activeTab) { |
| 21967 |
return; |
| 21968 |
} |
| 21969 |
|
| 21970 |
_this2.setState({ |
| 21971 |
activeTab: 'GoPro' |
| 21972 |
}); |
| 21973 |
}; |
| 21974 |
|
| 21975 |
if (this.props.customIconsURL) { |
| 21976 |
onClick = function onClick() { |
| 21977 |
window.open(_this2.props.customIconsURL, '_blank'); |
| 21978 |
}; |
| 21979 |
} |
| 21980 |
|
| 21981 |
return /*#__PURE__*/_react.default.createElement("div", { |
| 21982 |
id: "elementor-icons-manager__upload" |
| 21983 |
}, /*#__PURE__*/_react.default.createElement("div", { |
| 21984 |
id: "elementor-icons-manager__upload__title" |
| 21985 |
}, elementor.translate('my_libraries')), /*#__PURE__*/_react.default.createElement("button", { |
| 21986 |
id: "elementor-icons-manager__upload__button", |
| 21987 |
className: "elementor-button elementor-button-default", |
| 21988 |
onClick: onClick |
| 21989 |
}, elementor.translate('upload'))); |
| 21990 |
} |
| 21991 |
}, { |
| 21992 |
key: "getSearchHTML", |
| 21993 |
value: function getSearchHTML() { |
| 21994 |
return /*#__PURE__*/_react.default.createElement("div", { |
| 21995 |
id: "elementor-icons-manager__search" |
| 21996 |
}, /*#__PURE__*/_react.default.createElement("input", { |
| 21997 |
placeholder: 'Filter by name...', |
| 21998 |
onInput: this.handleSearch |
| 21999 |
}), /*#__PURE__*/_react.default.createElement("i", { |
| 22000 |
className: 'eicon-search' |
| 22001 |
})); |
| 22002 |
} |
| 22003 |
}]); |
| 22004 |
return IconsManager; |
| 22005 |
}(_react.Component); |
| 22006 |
|
| 22007 |
var _default = IconsManager; |
| 22008 |
exports.default = _default; |
| 22009 |
|
| 22010 |
var renderIconManager = function renderIconManager(props) { |
| 22011 |
var containerElement = document.querySelector('#elementor-icons-manager-modal .dialog-content'); |
| 22012 |
return (0, _reactDom.render)( /*#__PURE__*/_react.default.createElement(IconsManager, (0, _extends2.default)({}, props, { |
| 22013 |
containerElement: containerElement |
| 22014 |
})), containerElement); |
| 22015 |
}; |
| 22016 |
|
| 22017 |
exports.renderIconManager = renderIconManager; |
| 22018 |
IconsManager.propTypes = { |
| 22019 |
activeTab: _propTypes.default.any, |
| 22020 |
customIconsURL: _propTypes.default.string, |
| 22021 |
icons: _propTypes.default.any, |
| 22022 |
loaded: _propTypes.default.any, |
| 22023 |
modalView: _propTypes.default.any, |
| 22024 |
recommended: _propTypes.default.oneOfType([_propTypes.default.bool, _propTypes.default.object]), |
| 22025 |
selected: _propTypes.default.any, |
| 22026 |
showSearch: _propTypes.default.bool |
| 22027 |
}; |
| 22028 |
|
| 22029 |
/***/ }), |
| 22030 |
/* 465 */ |
| 22031 |
/***/ (function(module, exports, __webpack_require__) { |
| 22032 |
|
| 22033 |
"use strict"; |
| 22034 |
|
| 22035 |
|
| 22036 |
var _interopRequireDefault = __webpack_require__(0); |
| 22037 |
|
| 22038 |
var _interopRequireWildcard = __webpack_require__(36); |
| 22039 |
|
| 22040 |
var _Object$defineProperty = __webpack_require__(1); |
| 22041 |
|
| 22042 |
_Object$defineProperty(exports, "__esModule", { |
| 22043 |
value: true |
| 22044 |
}); |
| 22045 |
|
| 22046 |
exports.default = void 0; |
| 22047 |
|
| 22048 |
var _react = _interopRequireWildcard(__webpack_require__(11)); |
| 22049 |
|
| 22050 |
__webpack_require__(135); |
| 22051 |
|
| 22052 |
__webpack_require__(155); |
| 22053 |
|
| 22054 |
var _slicedToArray2 = _interopRequireDefault(__webpack_require__(102)); |
| 22055 |
|
| 22056 |
__webpack_require__(147); |
| 22057 |
|
| 22058 |
__webpack_require__(117); |
| 22059 |
|
| 22060 |
__webpack_require__(72); |
| 22061 |
|
| 22062 |
var _createForOfIteratorHelper2 = _interopRequireDefault(__webpack_require__(466)); |
| 22063 |
|
| 22064 |
var _values = _interopRequireDefault(__webpack_require__(55)); |
| 22065 |
|
| 22066 |
__webpack_require__(39); |
| 22067 |
|
| 22068 |
var _toConsumableArray2 = _interopRequireDefault(__webpack_require__(299)); |
| 22069 |
|
| 22070 |
var _entries = _interopRequireDefault(__webpack_require__(89)); |
| 22071 |
|
| 22072 |
var _classCallCheck2 = _interopRequireDefault(__webpack_require__(2)); |
| 22073 |
|
| 22074 |
var _createClass2 = _interopRequireDefault(__webpack_require__(3)); |
| 22075 |
|
| 22076 |
var _assertThisInitialized2 = _interopRequireDefault(__webpack_require__(49)); |
| 22077 |
|
| 22078 |
var _inherits2 = _interopRequireDefault(__webpack_require__(4)); |
| 22079 |
|
| 22080 |
var _createSuper2 = _interopRequireDefault(__webpack_require__(5)); |
| 22081 |
|
| 22082 |
var _defineProperty2 = _interopRequireDefault(__webpack_require__(28)); |
| 22083 |
|
| 22084 |
var _propTypes = _interopRequireDefault(__webpack_require__(41)); |
| 22085 |
|
| 22086 |
var _iconList = _interopRequireDefault(__webpack_require__(467)); |
| 22087 |
|
| 22088 |
var _icon = _interopRequireDefault(__webpack_require__(468)); |
| 22089 |
|
| 22090 |
var Tab = /*#__PURE__*/function (_Component) { |
| 22091 |
(0, _inherits2.default)(Tab, _Component); |
| 22092 |
|
| 22093 |
var _super = (0, _createSuper2.default)(Tab); |
| 22094 |
|
| 22095 |
function Tab() { |
| 22096 |
var _this; |
| 22097 |
|
| 22098 |
(0, _classCallCheck2.default)(this, Tab); |
| 22099 |
|
| 22100 |
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { |
| 22101 |
args[_key] = arguments[_key]; |
| 22102 |
} |
| 22103 |
|
| 22104 |
_this = _super.call.apply(_super, [this].concat(args)); |
| 22105 |
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "componentDidMount", function () { |
| 22106 |
if (_this.props.selected && _this.props.selected.value) { |
| 22107 |
setTimeout(function () { |
| 22108 |
var element = document.querySelector('.elementor-selected'); |
| 22109 |
|
| 22110 |
if (element) { |
| 22111 |
element.scrollIntoView(false); |
| 22112 |
} |
| 22113 |
}, 0); |
| 22114 |
} |
| 22115 |
}); |
| 22116 |
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "handleFullIconList", function () { |
| 22117 |
var fullIconList = []; |
| 22118 |
(0, _entries.default)(_this.props.icons).forEach(function (library) { |
| 22119 |
if ('recommended' !== library[0]) { |
| 22120 |
fullIconList = [].concat((0, _toConsumableArray2.default)(fullIconList), (0, _toConsumableArray2.default)(_this.getIconsOfType(library[0], library[1]))); |
| 22121 |
} |
| 22122 |
}); |
| 22123 |
return fullIconList.sort(function (a, b) { |
| 22124 |
return a.filter === b.filter ? 0 : +(a.filter > b.filter) || -1; |
| 22125 |
}); |
| 22126 |
}); |
| 22127 |
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "getLibrary", function (libraryName) { |
| 22128 |
var icons = elementor.config.icons.libraries.filter(function (library) { |
| 22129 |
return libraryName === library.name; |
| 22130 |
}); |
| 22131 |
return icons; |
| 22132 |
}); |
| 22133 |
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "handleRecommendedList", function () { |
| 22134 |
var recommendedIconList = []; |
| 22135 |
(0, _entries.default)(_this.props.icons).forEach(function (library) { |
| 22136 |
var iconLibrary = _this.getLibrary(library[0]), |
| 22137 |
iconsOfType = iconLibrary[0].icons, |
| 22138 |
recommendedIconsOfType = {}; |
| 22139 |
|
| 22140 |
library[1].forEach(function (iconName) { |
| 22141 |
if (iconsOfType[iconName]) { |
| 22142 |
recommendedIconsOfType[iconName] = iconsOfType[iconName]; |
| 22143 |
} |
| 22144 |
}); |
| 22145 |
recommendedIconList = [].concat((0, _toConsumableArray2.default)(recommendedIconList), (0, _toConsumableArray2.default)(_this.getIconsOfType(library[0], recommendedIconsOfType))); |
| 22146 |
}); |
| 22147 |
return recommendedIconList; |
| 22148 |
}); |
| 22149 |
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "getIconsComponentList", function () { |
| 22150 |
var iconsToShow = []; |
| 22151 |
var _this$props = _this.props, |
| 22152 |
name = _this$props.name, |
| 22153 |
icons = _this$props.icons, |
| 22154 |
filter = _this$props.filter; |
| 22155 |
|
| 22156 |
switch (name) { |
| 22157 |
case 'all': |
| 22158 |
iconsToShow = _this.handleFullIconList(); |
| 22159 |
break; |
| 22160 |
|
| 22161 |
case 'recommended': |
| 22162 |
iconsToShow = _this.handleRecommendedList(); |
| 22163 |
break; |
| 22164 |
|
| 22165 |
default: |
| 22166 |
iconsToShow = _this.getIconsOfType(name, icons); |
| 22167 |
break; |
| 22168 |
} |
| 22169 |
|
| 22170 |
if (filter) { |
| 22171 |
iconsToShow = (0, _values.default)(iconsToShow).filter(function (icon) { |
| 22172 |
return icon.props.data.name.toLowerCase().indexOf(filter) > -1; |
| 22173 |
}); |
| 22174 |
} |
| 22175 |
|
| 22176 |
return iconsToShow; |
| 22177 |
}); |
| 22178 |
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "render", function () { |
| 22179 |
var icons = _this.getIconsComponentList(); |
| 22180 |
|
| 22181 |
var selectedIndex = -1; |
| 22182 |
|
| 22183 |
var _iterator = (0, _createForOfIteratorHelper2.default)(icons.entries()), |
| 22184 |
_step; |
| 22185 |
|
| 22186 |
try { |
| 22187 |
for (_iterator.s(); !(_step = _iterator.n()).done;) { |
| 22188 |
var _step$value = (0, _slicedToArray2.default)(_step.value, 2), |
| 22189 |
index = _step$value[0], |
| 22190 |
icon = _step$value[1]; |
| 22191 |
|
| 22192 |
if (icon.props.containerClass.includes('elementor-selected')) { |
| 22193 |
selectedIndex = index; |
| 22194 |
break; |
| 22195 |
} |
| 22196 |
} |
| 22197 |
} catch (err) { |
| 22198 |
_iterator.e(err); |
| 22199 |
} finally { |
| 22200 |
_iterator.f(); |
| 22201 |
} |
| 22202 |
|
| 22203 |
return /*#__PURE__*/_react.default.createElement(_iconList.default, { |
| 22204 |
selectedIndex: selectedIndex, |
| 22205 |
items: icons, |
| 22206 |
parentRef: _this.props.parentRef |
| 22207 |
}); |
| 22208 |
}); |
| 22209 |
return _this; |
| 22210 |
} |
| 22211 |
|
| 22212 |
(0, _createClass2.default)(Tab, [{ |
| 22213 |
key: "getIconsOfType", |
| 22214 |
value: function getIconsOfType(type, icons) { |
| 22215 |
var _this2 = this; |
| 22216 |
|
| 22217 |
var _this$props2 = this.props, |
| 22218 |
selected = _this$props2.selected, |
| 22219 |
filter = _this$props2.filter; |
| 22220 |
return (0, _entries.default)(icons).map(function (icon) { |
| 22221 |
var iconData = icon[1], |
| 22222 |
iconName = icon[0], |
| 22223 |
className = iconData.displayPrefix + ' ' + iconData.selector; |
| 22224 |
var containerClass = 'elementor-icons-manager__tab__item'; |
| 22225 |
|
| 22226 |
if (selected.value === className) { |
| 22227 |
containerClass += ' elementor-selected'; |
| 22228 |
} |
| 22229 |
|
| 22230 |
var key = containerClass + type + '-' + iconName + filter; |
| 22231 |
return /*#__PURE__*/_react.default.createElement(_icon.default, { |
| 22232 |
key: key, |
| 22233 |
library: type, |
| 22234 |
keyID: iconName, |
| 22235 |
containerClass: containerClass, |
| 22236 |
className: className, |
| 22237 |
setSelectedHandler: _this2.props.setSelected, |
| 22238 |
data: iconData |
| 22239 |
}); |
| 22240 |
}); |
| 22241 |
} |
| 22242 |
}]); |
| 22243 |
return Tab; |
| 22244 |
}(_react.Component); |
| 22245 |
|
| 22246 |
Tab.propTypes = { |
| 22247 |
data: _propTypes.default.any, |
| 22248 |
filter: _propTypes.default.any, |
| 22249 |
icons: _propTypes.default.object, |
| 22250 |
name: _propTypes.default.string, |
| 22251 |
selected: _propTypes.default.object, |
| 22252 |
setSelected: _propTypes.default.func, |
| 22253 |
parentRef: _propTypes.default.any |
| 22254 |
}; |
| 22255 |
var _default = Tab; |
| 22256 |
exports.default = _default; |
| 22257 |
|
| 22258 |
/***/ }), |
| 22259 |
/* 466 */ |
| 22260 |
/***/ (function(module, exports, __webpack_require__) { |
| 22261 |
|
| 22262 |
var _getIterator = __webpack_require__(236); |
| 22263 |
|
| 22264 |
var _Array$isArray = __webpack_require__(84); |
| 22265 |
|
| 22266 |
var _Symbol$iterator = __webpack_require__(151); |
| 22267 |
|
| 22268 |
var _Symbol = __webpack_require__(111); |
| 22269 |
|
| 22270 |
var unsupportedIterableToArray = __webpack_require__(187); |
| 22271 |
|
| 22272 |
function _createForOfIteratorHelper(o, allowArrayLike) { |
| 22273 |
var it; |
| 22274 |
|
| 22275 |
if (typeof _Symbol === "undefined" || o[_Symbol$iterator] == null) { |
| 22276 |
if (_Array$isArray(o) || (it = unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { |
| 22277 |
if (it) o = it; |
| 22278 |
var i = 0; |
| 22279 |
|
| 22280 |
var F = function F() {}; |
| 22281 |
|
| 22282 |
return { |
| 22283 |
s: F, |
| 22284 |
n: function n() { |
| 22285 |
if (i >= o.length) return { |
| 22286 |
done: true |
| 22287 |
}; |
| 22288 |
return { |
| 22289 |
done: false, |
| 22290 |
value: o[i++] |
| 22291 |
}; |
| 22292 |
}, |
| 22293 |
e: function e(_e) { |
| 22294 |
throw _e; |
| 22295 |
}, |
| 22296 |
f: F |
| 22297 |
}; |
| 22298 |
} |
| 22299 |
|
| 22300 |
throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); |
| 22301 |
} |
| 22302 |
|
| 22303 |
var normalCompletion = true, |
| 22304 |
didErr = false, |
| 22305 |
err; |
| 22306 |
return { |
| 22307 |
s: function s() { |
| 22308 |
it = _getIterator(o); |
| 22309 |
}, |
| 22310 |
n: function n() { |
| 22311 |
var step = it.next(); |
| 22312 |
normalCompletion = step.done; |
| 22313 |
return step; |
| 22314 |
}, |
| 22315 |
e: function e(_e2) { |
| 22316 |
didErr = true; |
| 22317 |
err = _e2; |
| 22318 |
}, |
| 22319 |
f: function f() { |
| 22320 |
try { |
| 22321 |
if (!normalCompletion && it["return"] != null) it["return"](); |
| 22322 |
} finally { |
| 22323 |
if (didErr) throw err; |
| 22324 |
} |
| 22325 |
} |
| 22326 |
}; |
| 22327 |
} |
| 22328 |
|
| 22329 |
module.exports = _createForOfIteratorHelper; |
| 22330 |
|
| 22331 |
/***/ }), |
| 22332 |
/* 467 */ |
| 22333 |
/***/ (function(module, exports, __webpack_require__) { |
| 22334 |
|
| 22335 |
"use strict"; |
| 22336 |
|
| 22337 |
|
| 22338 |
var _interopRequireWildcard = __webpack_require__(36); |
| 22339 |
|
| 22340 |
var _interopRequireDefault = __webpack_require__(0); |
| 22341 |
|
| 22342 |
var _Object$defineProperty = __webpack_require__(1); |
| 22343 |
|
| 22344 |
_Object$defineProperty(exports, "__esModule", { |
| 22345 |
value: true |
| 22346 |
}); |
| 22347 |
|
| 22348 |
exports.default = void 0; |
| 22349 |
|
| 22350 |
var _classCallCheck2 = _interopRequireDefault(__webpack_require__(2)); |
| 22351 |
|
| 22352 |
var _createClass2 = _interopRequireDefault(__webpack_require__(3)); |
| 22353 |
|
| 22354 |
var _assertThisInitialized2 = _interopRequireDefault(__webpack_require__(49)); |
| 22355 |
|
| 22356 |
var _inherits2 = _interopRequireDefault(__webpack_require__(4)); |
| 22357 |
|
| 22358 |
var _createSuper2 = _interopRequireDefault(__webpack_require__(5)); |
| 22359 |
|
| 22360 |
var _defineProperty2 = _interopRequireDefault(__webpack_require__(28)); |
| 22361 |
|
| 22362 |
var _propTypes = _interopRequireDefault(__webpack_require__(41)); |
| 22363 |
|
| 22364 |
var _react = _interopRequireWildcard(__webpack_require__(11)); |
| 22365 |
|
| 22366 |
var LazyIconList = /*#__PURE__*/function (_Component) { |
| 22367 |
(0, _inherits2.default)(LazyIconList, _Component); |
| 22368 |
|
| 22369 |
var _super = (0, _createSuper2.default)(LazyIconList); |
| 22370 |
|
| 22371 |
function LazyIconList() { |
| 22372 |
var _this; |
| 22373 |
|
| 22374 |
(0, _classCallCheck2.default)(this, LazyIconList); |
| 22375 |
|
| 22376 |
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { |
| 22377 |
args[_key] = arguments[_key]; |
| 22378 |
} |
| 22379 |
|
| 22380 |
_this = _super.call.apply(_super, [this].concat(args)); |
| 22381 |
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "state", { |
| 22382 |
itemSize: { |
| 22383 |
width: 0, |
| 22384 |
height: 0 |
| 22385 |
}, |
| 22386 |
wrapperSize: { |
| 22387 |
width: 0, |
| 22388 |
height: 0 |
| 22389 |
}, |
| 22390 |
firstRowInView: 0 |
| 22391 |
}); |
| 22392 |
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "selectors", { |
| 22393 |
item: '.elementor-icons-manager__tab__item', |
| 22394 |
wrapper: 'elementor-icons-manager__tab__wrapper' |
| 22395 |
}); |
| 22396 |
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "attachScrollListener", function () { |
| 22397 |
var element = document.getElementById(_this.selectors.wrapper); |
| 22398 |
|
| 22399 |
if (element) { |
| 22400 |
element.addEventListener('scroll', _this.handleScroll); |
| 22401 |
} |
| 22402 |
}); |
| 22403 |
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "maybeMeasureItem", function () { |
| 22404 |
if (_this.state.itemSize.width) { |
| 22405 |
return; |
| 22406 |
} // CSS Item Padding |
| 22407 |
|
| 22408 |
|
| 22409 |
var itemPadding = 20, |
| 22410 |
wrapper = document.getElementById(_this.selectors.wrapper), |
| 22411 |
testElement = document.querySelector(_this.selectors.item); |
| 22412 |
|
| 22413 |
if (!testElement) { |
| 22414 |
return; |
| 22415 |
} |
| 22416 |
|
| 22417 |
var newState = { |
| 22418 |
itemSize: { |
| 22419 |
width: testElement.offsetWidth + itemPadding, |
| 22420 |
height: testElement.offsetHeight + itemPadding |
| 22421 |
}, |
| 22422 |
wrapperSize: { |
| 22423 |
width: wrapper.offsetWidth, |
| 22424 |
height: wrapper.clientHeight |
| 22425 |
} |
| 22426 |
}; |
| 22427 |
return _this.setState(newState, function () { |
| 22428 |
_this.maybeScrollToSelected(); |
| 22429 |
}); |
| 22430 |
}); |
| 22431 |
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "maybeScrollToSelected", function () { |
| 22432 |
if (!_this.hasSelected()) { |
| 22433 |
return; |
| 22434 |
} |
| 22435 |
|
| 22436 |
var selectedIndex = _this.props.selectedIndex, |
| 22437 |
_this$state = _this.state, |
| 22438 |
wrapperSize = _this$state.wrapperSize, |
| 22439 |
itemSize = _this$state.itemSize, |
| 22440 |
itemsInRow = Math.floor(wrapperSize.width / itemSize.width), |
| 22441 |
selectedItemRow = Math.ceil(selectedIndex / itemsInRow) - 1, |
| 22442 |
scrollTop = selectedItemRow * itemSize.height; |
| 22443 |
setTimeout(function () { |
| 22444 |
_this.props.parentRef.current.scrollTo({ |
| 22445 |
top: scrollTop, |
| 22446 |
left: 0, |
| 22447 |
behavior: 'auto' |
| 22448 |
}); |
| 22449 |
}, 0); |
| 22450 |
}); |
| 22451 |
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "handleScroll", function () { |
| 22452 |
_this.clearDebounceScrollCallback(); |
| 22453 |
|
| 22454 |
_this._debounce = setTimeout(function () { |
| 22455 |
var element = document.getElementById(_this.selectors.wrapper); |
| 22456 |
var itemSize = _this.state.itemSize; |
| 22457 |
|
| 22458 |
_this.setState({ |
| 22459 |
firstRowInView: Math.floor(element.scrollTop / itemSize.height) |
| 22460 |
}); |
| 22461 |
}, 10); |
| 22462 |
}); |
| 22463 |
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "render", function () { |
| 22464 |
var _this$state2 = _this.state, |
| 22465 |
itemSize = _this$state2.itemSize, |
| 22466 |
wrapperSize = _this$state2.wrapperSize; |
| 22467 |
var firstRowInView = _this.state.firstRowInView; |
| 22468 |
|
| 22469 |
if (!itemSize.width) { |
| 22470 |
return _this.renderFirstElementForMeasurement(); |
| 22471 |
} |
| 22472 |
|
| 22473 |
var items = _this.props.items, |
| 22474 |
itemsInRow = Math.floor(wrapperSize.width / itemSize.width), |
| 22475 |
totalRows = Math.ceil(items.length / itemsInRow), |
| 22476 |
spareRows = 4; |
| 22477 |
var rowsInView = Math.ceil(wrapperSize.height / itemSize.height) + spareRows; |
| 22478 |
|
| 22479 |
if (rowsInView > totalRows) { |
| 22480 |
rowsInView = totalRows; |
| 22481 |
} // Prevent scroll overflow |
| 22482 |
|
| 22483 |
|
| 22484 |
if (firstRowInView > totalRows - rowsInView) { |
| 22485 |
firstRowInView = totalRows - rowsInView; |
| 22486 |
} |
| 22487 |
|
| 22488 |
var tailRows = totalRows - firstRowInView - rowsInView, |
| 22489 |
firstItemIndexInWindow = firstRowInView * itemsInRow, |
| 22490 |
lastItemIndexInWindow = (firstRowInView + rowsInView) * itemsInRow - 1, |
| 22491 |
itemsInView = items.slice(firstItemIndexInWindow, lastItemIndexInWindow + 1), |
| 22492 |
offsetStyle = { |
| 22493 |
height: "".concat(firstRowInView * itemSize.height, "px") |
| 22494 |
}, |
| 22495 |
tailStyle = { |
| 22496 |
height: "".concat(tailRows * itemSize.height, "px") |
| 22497 |
}; |
| 22498 |
return /*#__PURE__*/_react.default.createElement(_react.Fragment, null, /*#__PURE__*/_react.default.createElement("div", { |
| 22499 |
className: 'elementor-icons-manager__tab__content__offset', |
| 22500 |
style: offsetStyle |
| 22501 |
}), /*#__PURE__*/_react.default.createElement("div", { |
| 22502 |
id: 'elementor-icons-manager__tab__content' |
| 22503 |
}, itemsInView), /*#__PURE__*/_react.default.createElement("div", { |
| 22504 |
className: 'elementor-icons-manager__tab__content__tail', |
| 22505 |
style: tailStyle |
| 22506 |
})); |
| 22507 |
}); |
| 22508 |
return _this; |
| 22509 |
} |
| 22510 |
|
| 22511 |
(0, _createClass2.default)(LazyIconList, [{ |
| 22512 |
key: "componentDidMount", |
| 22513 |
value: function componentDidMount() { |
| 22514 |
this.attachScrollListener(); |
| 22515 |
this.maybeMeasureItem(); |
| 22516 |
} |
| 22517 |
}, { |
| 22518 |
key: "componentWillUnmount", |
| 22519 |
value: function componentWillUnmount() { |
| 22520 |
this.clearDebounceScrollCallback(); |
| 22521 |
var element = document.getElementById(this.selectors.wrapper); |
| 22522 |
|
| 22523 |
if (element) { |
| 22524 |
element.removeEventListener('scroll', this.handleScroll); |
| 22525 |
} |
| 22526 |
} |
| 22527 |
}, { |
| 22528 |
key: "clearDebounceScrollCallback", |
| 22529 |
value: function clearDebounceScrollCallback() { |
| 22530 |
clearTimeout(this._debounce); |
| 22531 |
} |
| 22532 |
}, { |
| 22533 |
key: "renderFirstElementForMeasurement", |
| 22534 |
value: function renderFirstElementForMeasurement() { |
| 22535 |
return /*#__PURE__*/_react.default.createElement("div", { |
| 22536 |
id: 'elementor-icons-manager__tab__content' |
| 22537 |
}, this.props.items[0]); |
| 22538 |
} |
| 22539 |
}, { |
| 22540 |
key: "hasSelected", |
| 22541 |
value: function hasSelected() { |
| 22542 |
return -1 !== this.props.selectedIndex; |
| 22543 |
} |
| 22544 |
}]); |
| 22545 |
return LazyIconList; |
| 22546 |
}(_react.Component); |
| 22547 |
|
| 22548 |
var _default = LazyIconList; |
| 22549 |
exports.default = _default; |
| 22550 |
LazyIconList.propTypes = { |
| 22551 |
items: _propTypes.default.array, |
| 22552 |
selectedIndex: _propTypes.default.number, |
| 22553 |
parentRef: _propTypes.default.any |
| 22554 |
}; |
| 22555 |
|
| 22556 |
/***/ }), |
| 22557 |
/* 468 */ |
| 22558 |
/***/ (function(module, exports, __webpack_require__) { |
| 22559 |
|
| 22560 |
"use strict"; |
| 22561 |
|
| 22562 |
|
| 22563 |
var _interopRequireDefault = __webpack_require__(0); |
| 22564 |
|
| 22565 |
var _interopRequireWildcard = __webpack_require__(36); |
| 22566 |
|
| 22567 |
var _Object$defineProperty = __webpack_require__(1); |
| 22568 |
|
| 22569 |
_Object$defineProperty(exports, "__esModule", { |
| 22570 |
value: true |
| 22571 |
}); |
| 22572 |
|
| 22573 |
exports.default = void 0; |
| 22574 |
|
| 22575 |
var _react = _interopRequireWildcard(__webpack_require__(11)); |
| 22576 |
|
| 22577 |
__webpack_require__(39); |
| 22578 |
|
| 22579 |
var _classCallCheck2 = _interopRequireDefault(__webpack_require__(2)); |
| 22580 |
|
| 22581 |
var _assertThisInitialized2 = _interopRequireDefault(__webpack_require__(49)); |
| 22582 |
|
| 22583 |
var _inherits2 = _interopRequireDefault(__webpack_require__(4)); |
| 22584 |
|
| 22585 |
var _createSuper2 = _interopRequireDefault(__webpack_require__(5)); |
| 22586 |
|
| 22587 |
var _defineProperty2 = _interopRequireDefault(__webpack_require__(28)); |
| 22588 |
|
| 22589 |
var _propTypes = _interopRequireDefault(__webpack_require__(41)); |
| 22590 |
|
| 22591 |
var Icon = /*#__PURE__*/function (_Component) { |
| 22592 |
(0, _inherits2.default)(Icon, _Component); |
| 22593 |
|
| 22594 |
var _super = (0, _createSuper2.default)(Icon); |
| 22595 |
|
| 22596 |
function Icon() { |
| 22597 |
var _this; |
| 22598 |
|
| 22599 |
(0, _classCallCheck2.default)(this, Icon); |
| 22600 |
|
| 22601 |
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { |
| 22602 |
args[_key] = arguments[_key]; |
| 22603 |
} |
| 22604 |
|
| 22605 |
_this = _super.call.apply(_super, [this].concat(args)); |
| 22606 |
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "setSelected", function () { |
| 22607 |
_this.props.setSelectedHandler({ |
| 22608 |
value: _this.props.data.displayPrefix + ' ' + _this.props.data.selector, |
| 22609 |
library: _this.props.library |
| 22610 |
}); |
| 22611 |
}); |
| 22612 |
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "render", function () { |
| 22613 |
return /*#__PURE__*/_react.default.createElement("div", { |
| 22614 |
className: _this.props.containerClass, |
| 22615 |
key: _this.props.keyID, |
| 22616 |
onClick: _this.setSelected, |
| 22617 |
filter: _this.props.data.filter |
| 22618 |
}, /*#__PURE__*/_react.default.createElement("div", { |
| 22619 |
className: "elementor-icons-manager__tab__item__content" |
| 22620 |
}, /*#__PURE__*/_react.default.createElement("i", { |
| 22621 |
className: 'elementor-icons-manager__tab__item__icon ' + _this.props.className |
| 22622 |
}), /*#__PURE__*/_react.default.createElement("div", { |
| 22623 |
className: 'elementor-icons-manager__tab__item__name', |
| 22624 |
title: _this.props.data.name |
| 22625 |
}, _this.props.data.name))); |
| 22626 |
}); |
| 22627 |
return _this; |
| 22628 |
} |
| 22629 |
|
| 22630 |
return Icon; |
| 22631 |
}(_react.Component); |
| 22632 |
|
| 22633 |
exports.default = Icon; |
| 22634 |
Icon.propTypes = { |
| 22635 |
className: _propTypes.default.string, |
| 22636 |
containerClass: _propTypes.default.string, |
| 22637 |
data: _propTypes.default.object, |
| 22638 |
keyID: _propTypes.default.string, |
| 22639 |
library: _propTypes.default.string, |
| 22640 |
selector: _propTypes.default.string, |
| 22641 |
setSelectedHandler: _propTypes.default.func |
| 22642 |
}; |
| 22643 |
|
| 22644 |
/***/ }), |
| 22645 |
/* 469 */ |
| 22646 |
/***/ (function(module, exports, __webpack_require__) { |
| 22647 |
|
| 22648 |
"use strict"; |
| 22649 |
|
| 22650 |
|
| 22651 |
var _interopRequireDefault = __webpack_require__(0); |
| 22652 |
|
| 22653 |
var _interopRequireWildcard = __webpack_require__(36); |
| 22654 |
|
| 22655 |
var _Object$defineProperty = __webpack_require__(1); |
| 22656 |
|
| 22657 |
_Object$defineProperty(exports, "__esModule", { |
| 22658 |
value: true |
| 22659 |
}); |
| 22660 |
|
| 22661 |
exports.default = void 0; |
| 22662 |
|
| 22663 |
var _react = _interopRequireWildcard(__webpack_require__(11)); |
| 22664 |
|
| 22665 |
var _classCallCheck2 = _interopRequireDefault(__webpack_require__(2)); |
| 22666 |
|
| 22667 |
var _assertThisInitialized2 = _interopRequireDefault(__webpack_require__(49)); |
| 22668 |
|
| 22669 |
var _inherits2 = _interopRequireDefault(__webpack_require__(4)); |
| 22670 |
|
| 22671 |
var _createSuper2 = _interopRequireDefault(__webpack_require__(5)); |
| 22672 |
|
| 22673 |
var _defineProperty2 = _interopRequireDefault(__webpack_require__(28)); |
| 22674 |
|
| 22675 |
var IconsGoPro = /*#__PURE__*/function (_Component) { |
| 22676 |
(0, _inherits2.default)(IconsGoPro, _Component); |
| 22677 |
|
| 22678 |
var _super = (0, _createSuper2.default)(IconsGoPro); |
| 22679 |
|
| 22680 |
function IconsGoPro() { |
| 22681 |
var _this; |
| 22682 |
|
| 22683 |
(0, _classCallCheck2.default)(this, IconsGoPro); |
| 22684 |
|
| 22685 |
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { |
| 22686 |
args[_key] = arguments[_key]; |
| 22687 |
} |
| 22688 |
|
| 22689 |
_this = _super.call.apply(_super, [this].concat(args)); |
| 22690 |
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "render", function () { |
| 22691 |
return /*#__PURE__*/_react.default.createElement("div", { |
| 22692 |
id: "elementor-icons-manager__promotion" |
| 22693 |
}, /*#__PURE__*/_react.default.createElement("i", { |
| 22694 |
id: "elementor-icons-manager__promotion__icon", |
| 22695 |
className: "eicon-nerd" |
| 22696 |
}), /*#__PURE__*/_react.default.createElement("div", { |
| 22697 |
id: "elementor-icons-manager__promotion__text" |
| 22698 |
}, elementor.translate('icons_promotion')), /*#__PURE__*/_react.default.createElement("a", { |
| 22699 |
href: elementor.config.icons.goProURL, |
| 22700 |
id: "elementor-icons-manager__promotion__link", |
| 22701 |
className: "elementor-button elementor-button-default elementor-button-go-pro", |
| 22702 |
target: "_blank", |
| 22703 |
rel: "noopener noreferrer" |
| 22704 |
}, elementor.translate('go_pro'))); |
| 22705 |
}); |
| 22706 |
return _this; |
| 22707 |
} |
| 22708 |
|
| 22709 |
return IconsGoPro; |
| 22710 |
}(_react.Component); |
| 22711 |
|
| 22712 |
var _default = IconsGoPro; |
| 22713 |
exports.default = _default; |
| 22714 |
|
| 22715 |
/***/ }), |
| 22716 |
/* 470 */ |
| 22717 |
/***/ (function(module, exports, __webpack_require__) { |
| 22718 |
|
| 22719 |
"use strict"; |
| 22720 |
|
| 22721 |
|
| 22722 |
var _interopRequireDefault = __webpack_require__(0); |
| 22723 |
|
| 22724 |
var _Object$defineProperty = __webpack_require__(1); |
| 22725 |
|
| 22726 |
_Object$defineProperty(exports, "__esModule", { |
| 22727 |
value: true |
| 22728 |
}); |
| 22729 |
|
| 22730 |
exports.default = void 0; |
| 22731 |
|
| 22732 |
var _keys = _interopRequireDefault(__webpack_require__(23)); |
| 22733 |
|
| 22734 |
__webpack_require__(58); |
| 22735 |
|
| 22736 |
__webpack_require__(80); |
| 22737 |
|
| 22738 |
var _entries = _interopRequireDefault(__webpack_require__(89)); |
| 22739 |
|
| 22740 |
var _typeof2 = _interopRequireDefault(__webpack_require__(48)); |
| 22741 |
|
| 22742 |
__webpack_require__(39); |
| 22743 |
|
| 22744 |
var _classCallCheck2 = _interopRequireDefault(__webpack_require__(2)); |
| 22745 |
|
| 22746 |
var _createClass2 = _interopRequireDefault(__webpack_require__(3)); |
| 22747 |
|
| 22748 |
var _defineProperty2 = _interopRequireDefault(__webpack_require__(28)); |
| 22749 |
|
| 22750 |
var _default = /*#__PURE__*/function () { |
| 22751 |
function _default() { |
| 22752 |
var _this = this; |
| 22753 |
|
| 22754 |
(0, _classCallCheck2.default)(this, _default); |
| 22755 |
(0, _defineProperty2.default)(this, "loaded", {}); |
| 22756 |
(0, _defineProperty2.default)(this, "notifyCallback", null); |
| 22757 |
(0, _defineProperty2.default)(this, "fetchIcons", function (library) { |
| 22758 |
fetch(library.fetchJson, { |
| 22759 |
mode: 'cors' |
| 22760 |
}).then(function (res) { |
| 22761 |
return res.json(); |
| 22762 |
}).then(function (json) { |
| 22763 |
library.icons = json.icons; |
| 22764 |
return _this.normalizeIconList(library); |
| 22765 |
}); |
| 22766 |
}); |
| 22767 |
(0, _defineProperty2.default)(this, "runCallback", function (library) { |
| 22768 |
if ('function' !== typeof _this.notifyCallback) { |
| 22769 |
return library; |
| 22770 |
} |
| 22771 |
|
| 22772 |
return _this.notifyCallback(library); |
| 22773 |
}); |
| 22774 |
(0, _defineProperty2.default)(this, "initIconType", function (libraryConfig, callback) { |
| 22775 |
_this.notifyCallback = callback; |
| 22776 |
var store = elementor.iconManager.store; |
| 22777 |
|
| 22778 |
if (_this.loaded[libraryConfig.name]) { |
| 22779 |
libraryConfig.icons = store.getIcons(libraryConfig); |
| 22780 |
return _this.runCallback(libraryConfig); |
| 22781 |
} // Enqueue CSS |
| 22782 |
|
| 22783 |
|
| 22784 |
if (libraryConfig.enqueue) { |
| 22785 |
libraryConfig.enqueue.forEach(function (assetURL) { |
| 22786 |
elementor.helpers.enqueueEditorStylesheet(assetURL); |
| 22787 |
}); |
| 22788 |
} |
| 22789 |
|
| 22790 |
if (libraryConfig.url) { |
| 22791 |
elementor.helpers.enqueueEditorStylesheet(libraryConfig.url); |
| 22792 |
} //already saved an stored |
| 22793 |
|
| 22794 |
|
| 22795 |
if (store.isValid(libraryConfig)) { |
| 22796 |
var data = store.get(store.getKey(libraryConfig)); |
| 22797 |
return _this.normalizeIconList(data); |
| 22798 |
} // comes with icons |
| 22799 |
|
| 22800 |
|
| 22801 |
if (libraryConfig.icons && libraryConfig.icons.length) { |
| 22802 |
return _this.normalizeIconList(libraryConfig); |
| 22803 |
} // Get icons from via ajax |
| 22804 |
|
| 22805 |
|
| 22806 |
if (libraryConfig.fetchJson) { |
| 22807 |
return _this.fetchIcons(libraryConfig); |
| 22808 |
} // @todo: error handling |
| 22809 |
|
| 22810 |
}); |
| 22811 |
} |
| 22812 |
|
| 22813 |
(0, _createClass2.default)(_default, [{ |
| 22814 |
key: "normalizeIconList", |
| 22815 |
value: function normalizeIconList(library) { |
| 22816 |
var icons = {}; |
| 22817 |
var name; |
| 22818 |
jQuery.each(library.icons, function (index, icon) { |
| 22819 |
name = icon; |
| 22820 |
|
| 22821 |
if ('object' === (0, _typeof2.default)(name)) { |
| 22822 |
name = (0, _entries.default)(name)[0][0]; |
| 22823 |
} |
| 22824 |
|
| 22825 |
if (!name) { |
| 22826 |
return; |
| 22827 |
} |
| 22828 |
|
| 22829 |
icons[name] = { |
| 22830 |
prefix: library.prefix, |
| 22831 |
selector: library.prefix + name.trim(':'), |
| 22832 |
name: elementorCommon.helpers.upperCaseWords(name).trim(':').split('-').join(' '), |
| 22833 |
filter: name.trim(':'), |
| 22834 |
displayPrefix: library.displayPrefix || library.prefix.replace('-', '') |
| 22835 |
}; |
| 22836 |
}); |
| 22837 |
|
| 22838 |
if ((0, _keys.default)(icons).length) { |
| 22839 |
library.icons = icons; |
| 22840 |
this.loaded[library.name] = true; |
| 22841 |
elementor.iconManager.store.save(library); |
| 22842 |
this.runCallback(library); |
| 22843 |
} |
| 22844 |
} |
| 22845 |
}]); |
| 22846 |
return _default; |
| 22847 |
}(); |
| 22848 |
|
| 22849 |
exports.default = _default; |
| 22850 |
|
| 22851 |
/***/ }), |
| 22852 |
/* 471 */ |
| 22853 |
/***/ (function(module, exports, __webpack_require__) { |
| 22854 |
|
| 22855 |
"use strict"; |
| 22856 |
|
| 22857 |
|
| 22858 |
var _interopRequireDefault = __webpack_require__(0); |
| 22859 |
|
| 22860 |
var _Object$defineProperty = __webpack_require__(1); |
| 22861 |
|
| 22862 |
_Object$defineProperty(exports, "__esModule", { |
| 22863 |
value: true |
| 22864 |
}); |
| 22865 |
|
| 22866 |
exports.default = void 0; |
| 22867 |
|
| 22868 |
__webpack_require__(39); |
| 22869 |
|
| 22870 |
var _classCallCheck2 = _interopRequireDefault(__webpack_require__(2)); |
| 22871 |
|
| 22872 |
var _createClass2 = _interopRequireDefault(__webpack_require__(3)); |
| 22873 |
|
| 22874 |
var Store = /*#__PURE__*/function () { |
| 22875 |
function Store() { |
| 22876 |
(0, _classCallCheck2.default)(this, Store); |
| 22877 |
} |
| 22878 |
|
| 22879 |
(0, _createClass2.default)(Store, [{ |
| 22880 |
key: "save", |
| 22881 |
value: function save(library) { |
| 22882 |
elementorCommon.storage.set(Store.getKey(library), library); |
| 22883 |
} |
| 22884 |
}, { |
| 22885 |
key: "getIcons", |
| 22886 |
value: function getIcons(library) { |
| 22887 |
var data = this.get(Store.getKey(library)); |
| 22888 |
|
| 22889 |
if (data && data.icons) { |
| 22890 |
return data.icons; |
| 22891 |
} |
| 22892 |
|
| 22893 |
return false; |
| 22894 |
} |
| 22895 |
}, { |
| 22896 |
key: "get", |
| 22897 |
value: function get(key) { |
| 22898 |
return elementorCommon.storage.get(key); |
| 22899 |
} |
| 22900 |
}, { |
| 22901 |
key: "isValid", |
| 22902 |
value: function isValid(library) { |
| 22903 |
var saved = this.get(Store.getKey(library)); |
| 22904 |
|
| 22905 |
if (!saved) { |
| 22906 |
return false; |
| 22907 |
} |
| 22908 |
|
| 22909 |
if (saved.ver !== library.ver) { |
| 22910 |
// @todo: delete from localStorage if version is invalid |
| 22911 |
return false; |
| 22912 |
} |
| 22913 |
|
| 22914 |
return saved.icons && saved.icons.length; |
| 22915 |
} |
| 22916 |
}], [{ |
| 22917 |
key: "getKey", |
| 22918 |
value: function getKey(library) { |
| 22919 |
var name = library.name ? library.name : library; |
| 22920 |
return "elementor_".concat(name, "_icons"); |
| 22921 |
} |
| 22922 |
}]); |
| 22923 |
return Store; |
| 22924 |
}(); |
| 22925 |
|
| 22926 |
var _default = Store; |
| 22927 |
exports.default = _default; |
| 22928 |
|
| 22929 |
/***/ }), |
| 22930 |
/* 472 */ |
| 22931 |
/***/ (function(module, exports, __webpack_require__) { |
| 22932 |
|
| 22933 |
"use strict"; |
| 22934 |
|
| 22935 |
|
| 22936 |
var _interopRequireDefault = __webpack_require__(0); |
| 22937 |
|
| 22938 |
var _Object$defineProperty = __webpack_require__(1); |
| 22939 |
|
| 22940 |
_Object$defineProperty(exports, "__esModule", { |
| 22941 |
value: true |
| 22942 |
}); |
| 22943 |
|
| 22944 |
exports.default = void 0; |
| 22945 |
|
| 22946 |
var _classCallCheck2 = _interopRequireDefault(__webpack_require__(2)); |
| 22947 |
|
| 22948 |
var _createClass2 = _interopRequireDefault(__webpack_require__(3)); |
| 22949 |
|
| 22950 |
var _inherits2 = _interopRequireDefault(__webpack_require__(4)); |
| 22951 |
|
| 22952 |
var _createSuper2 = _interopRequireDefault(__webpack_require__(5)); |
| 22953 |
|
| 22954 |
var _base = _interopRequireDefault(__webpack_require__(359)); |
| 22955 |
|
| 22956 |
var PanelMenu = /*#__PURE__*/function (_MenuPageView) { |
| 22957 |
(0, _inherits2.default)(PanelMenu, _MenuPageView); |
| 22958 |
|
| 22959 |
var _super = (0, _createSuper2.default)(PanelMenu); |
| 22960 |
|
| 22961 |
function PanelMenu() { |
| 22962 |
(0, _classCallCheck2.default)(this, PanelMenu); |
| 22963 |
return _super.apply(this, arguments); |
| 22964 |
} |
| 22965 |
|
| 22966 |
(0, _createClass2.default)(PanelMenu, [{ |
| 22967 |
key: "initialize", |
| 22968 |
value: function initialize() { |
| 22969 |
this.collection = PanelMenu.getGroups(); |
| 22970 |
} |
| 22971 |
}, { |
| 22972 |
key: "getArrowClass", |
| 22973 |
value: function getArrowClass() { |
| 22974 |
return 'eicon-chevron-' + (elementorCommon.config.isRTL ? 'right' : 'left'); |
| 22975 |
} |
| 22976 |
}, { |
| 22977 |
key: "onRender", |
| 22978 |
value: function onRender() { |
| 22979 |
elementor.getPanelView().getHeaderView().ui.menuIcon.removeClass('eicon-menu-bar').addClass(this.getArrowClass()); |
| 22980 |
} |
| 22981 |
}, { |
| 22982 |
key: "onDestroy", |
| 22983 |
value: function onDestroy() { |
| 22984 |
elementor.getPanelView().getHeaderView().ui.menuIcon.removeClass(this.getArrowClass()).addClass('eicon-menu-bar'); |
| 22985 |
} |
| 22986 |
}]); |
| 22987 |
return PanelMenu; |
| 22988 |
}(_base.default); |
| 22989 |
|
| 22990 |
exports.default = PanelMenu; |
| 22991 |
PanelMenu.groups = null; |
| 22992 |
|
| 22993 |
PanelMenu.initGroups = function () { |
| 22994 |
PanelMenu.groups = new Backbone.Collection([]); // Keep the old `more` for BC, since 3.0.0. |
| 22995 |
|
| 22996 |
PanelMenu.groups.add({ |
| 22997 |
name: 'more', |
| 22998 |
title: elementor.translate('more'), |
| 22999 |
items: [] |
| 23000 |
}); |
| 23001 |
PanelMenu.groups.add({ |
| 23002 |
name: 'navigate_from_page', |
| 23003 |
title: elementor.translate('navigate_from_page'), |
| 23004 |
items: [// Todo: internal command. |
| 23005 |
{ |
| 23006 |
name: 'view-page', |
| 23007 |
icon: 'eicon-preview-thin', |
| 23008 |
title: elementor.translate('view_page'), |
| 23009 |
type: 'link', |
| 23010 |
link: elementor.config.document.urls.permalink |
| 23011 |
}, // Todo: internal command. |
| 23012 |
{ |
| 23013 |
name: 'exit-to-dashboard', |
| 23014 |
icon: 'eicon-wordpress-light', |
| 23015 |
title: elementor.translate('exit_to_dashboard'), |
| 23016 |
type: 'link', |
| 23017 |
link: elementor.config.document.urls.exit_to_dashboard |
| 23018 |
}] |
| 23019 |
}); |
| 23020 |
|
| 23021 |
if (elementor.config.user.is_administrator) { |
| 23022 |
PanelMenu.addAdminMenu(); |
| 23023 |
} |
| 23024 |
}; |
| 23025 |
|
| 23026 |
PanelMenu.addAdminMenu = function () { |
| 23027 |
PanelMenu.groups.add({ |
| 23028 |
name: 'style', |
| 23029 |
title: elementor.translate('settings'), |
| 23030 |
items: [{ |
| 23031 |
name: 'editor-preferences', |
| 23032 |
icon: 'eicon-user-preferences', |
| 23033 |
title: elementor.translate('user_preferences'), |
| 23034 |
type: 'page', |
| 23035 |
callback: function callback() { |
| 23036 |
return $e.route('panel/editor-preferences'); |
| 23037 |
} |
| 23038 |
}] |
| 23039 |
}, { |
| 23040 |
at: 0 |
| 23041 |
}); |
| 23042 |
PanelMenu.addItem({ |
| 23043 |
name: 'finder', |
| 23044 |
icon: 'eicon-search', |
| 23045 |
title: elementorCommon.translate('finder', 'finder'), |
| 23046 |
callback: function callback() { |
| 23047 |
return $e.route('finder'); |
| 23048 |
} |
| 23049 |
}, 'navigate_from_page', 'view-page'); |
| 23050 |
}; |
| 23051 |
|
| 23052 |
PanelMenu.getGroups = function () { |
| 23053 |
if (!PanelMenu.groups) { |
| 23054 |
PanelMenu.initGroups(); |
| 23055 |
} |
| 23056 |
|
| 23057 |
return PanelMenu.groups; |
| 23058 |
}; |
| 23059 |
|
| 23060 |
PanelMenu.addItem = function (itemData, groupName, before) { |
| 23061 |
_base.default.addItem(PanelMenu.getGroups(), itemData, groupName, before); |
| 23062 |
}; |
| 23063 |
|
| 23064 |
/***/ }), |
| 23065 |
/* 473 */ |
| 23066 |
/***/ (function(module, exports, __webpack_require__) { |
| 23067 |
|
| 23068 |
"use strict"; |
| 23069 |
|
| 23070 |
|
| 23071 |
var PanelMenuItemView = __webpack_require__(474); |
| 23072 |
|
| 23073 |
module.exports = Marionette.CompositeView.extend({ |
| 23074 |
template: '#tmpl-elementor-panel-menu-group', |
| 23075 |
className: 'elementor-panel-menu-group', |
| 23076 |
childView: PanelMenuItemView, |
| 23077 |
childViewContainer: '.elementor-panel-menu-items', |
| 23078 |
initialize: function initialize() { |
| 23079 |
this.collection = new Backbone.Collection(this.model.get('items')); |
| 23080 |
}, |
| 23081 |
onChildviewClick: function onChildviewClick(childView) { |
| 23082 |
var callback = childView.model.get('callback'); |
| 23083 |
|
| 23084 |
if (_.isFunction(callback)) { |
| 23085 |
callback.call(childView); |
| 23086 |
} |
| 23087 |
} |
| 23088 |
}); |
| 23089 |
|
| 23090 |
/***/ }), |
| 23091 |
/* 474 */ |
| 23092 |
/***/ (function(module, exports, __webpack_require__) { |
| 23093 |
|
| 23094 |
"use strict"; |
| 23095 |
|
| 23096 |
|
| 23097 |
module.exports = Marionette.ItemView.extend({ |
| 23098 |
template: '#tmpl-elementor-panel-menu-item', |
| 23099 |
className: function className() { |
| 23100 |
return 'elementor-panel-menu-item elementor-panel-menu-item-' + this.model.get('name'); |
| 23101 |
}, |
| 23102 |
triggers: { |
| 23103 |
click: { |
| 23104 |
event: 'click', |
| 23105 |
preventDefault: false |
| 23106 |
} |
| 23107 |
} |
| 23108 |
}); |
| 23109 |
|
| 23110 |
/***/ }), |
| 23111 |
/* 475 */ |
| 23112 |
/***/ (function(module, exports, __webpack_require__) { |
| 23113 |
|
| 23114 |
"use strict"; |
| 23115 |
|
| 23116 |
|
| 23117 |
var _interopRequireDefault = __webpack_require__(0); |
| 23118 |
|
| 23119 |
var _Object$defineProperty = __webpack_require__(1); |
| 23120 |
|
| 23121 |
_Object$defineProperty(exports, "__esModule", { |
| 23122 |
value: true |
| 23123 |
}); |
| 23124 |
|
| 23125 |
exports.default = void 0; |
| 23126 |
|
| 23127 |
var _classCallCheck2 = _interopRequireDefault(__webpack_require__(2)); |
| 23128 |
|
| 23129 |
var _createClass2 = _interopRequireDefault(__webpack_require__(3)); |
| 23130 |
|
| 23131 |
var _inherits2 = _interopRequireDefault(__webpack_require__(4)); |
| 23132 |
|
| 23133 |
var _createSuper2 = _interopRequireDefault(__webpack_require__(5)); |
| 23134 |
|
| 23135 |
var _default = /*#__PURE__*/function (_elementorModules$Mod) { |
| 23136 |
(0, _inherits2.default)(_default, _elementorModules$Mod); |
| 23137 |
|
| 23138 |
var _super = (0, _createSuper2.default)(_default); |
| 23139 |
|
| 23140 |
function _default() { |
| 23141 |
var _this; |
| 23142 |
|
| 23143 |
(0, _classCallCheck2.default)(this, _default); |
| 23144 |
_this = _super.call(this); |
| 23145 |
|
| 23146 |
_this.initDialog(); |
| 23147 |
|
| 23148 |
return _this; |
| 23149 |
} |
| 23150 |
|
| 23151 |
(0, _createClass2.default)(_default, [{ |
| 23152 |
key: "initDialog", |
| 23153 |
value: function initDialog() { |
| 23154 |
var _this2 = this; |
| 23155 |
|
| 23156 |
this.dialog = elementor.dialogsManager.createWidget('buttons', { |
| 23157 |
id: 'elementor-element--promotion__dialog', |
| 23158 |
effects: { |
| 23159 |
show: 'show', |
| 23160 |
hide: 'hide' |
| 23161 |
}, |
| 23162 |
hide: { |
| 23163 |
onOutsideClick: false |
| 23164 |
}, |
| 23165 |
position: { |
| 23166 |
my: (elementorCommon.config.isRTL ? 'right' : 'left') + '+5 top' |
| 23167 |
} |
| 23168 |
}); |
| 23169 |
this.dialog.addButton({ |
| 23170 |
name: 'action', |
| 23171 |
text: elementor.translate('see_it_in_action'), |
| 23172 |
callback: function callback() { |
| 23173 |
open(_this2.actionURL, '_blank'); |
| 23174 |
} |
| 23175 |
}); |
| 23176 |
this.dialog.getElements('action').addClass('elementor-button elementor-button-success'); |
| 23177 |
var $promotionTitle = jQuery('<div>', { |
| 23178 |
id: 'elementor-element--promotion__dialog__title' |
| 23179 |
}), |
| 23180 |
$proIcon = jQuery('<i>', { |
| 23181 |
class: 'eicon-pro-icon' |
| 23182 |
}), |
| 23183 |
$closeButton = jQuery('<i>', { |
| 23184 |
class: 'eicon-close' |
| 23185 |
}); |
| 23186 |
$closeButton.on('click', function () { |
| 23187 |
return _this2.dialog.hide(); |
| 23188 |
}); |
| 23189 |
this.dialog.getElements('header').append($promotionTitle, $proIcon, $closeButton); |
| 23190 |
this.$promotionTitle = $promotionTitle; |
| 23191 |
} |
| 23192 |
}, { |
| 23193 |
key: "showDialog", |
| 23194 |
value: function showDialog(options) { |
| 23195 |
if (!this.dialog) { |
| 23196 |
this.initDialog(); |
| 23197 |
} |
| 23198 |
|
| 23199 |
this.actionURL = options.actionURL; |
| 23200 |
this.$promotionTitle.text(options.headerMessage); |
| 23201 |
this.dialog.setMessage(options.message).setSettings('position', { |
| 23202 |
of: options.element, |
| 23203 |
at: (elementorCommon.config.isRTL ? 'left' : 'right') + ' top' + options.top |
| 23204 |
}); |
| 23205 |
return this.dialog.show(); |
| 23206 |
} |
| 23207 |
}]); |
| 23208 |
return _default; |
| 23209 |
}(elementorModules.Module); |
| 23210 |
|
| 23211 |
exports.default = _default; |
| 23212 |
|
| 23213 |
/***/ }), |
| 23214 |
/* 476 */ |
| 23215 |
/***/ (function(module, exports, __webpack_require__) { |
| 23216 |
|
| 23217 |
"use strict"; |
| 23218 |
|
| 23219 |
|
| 23220 |
var _interopRequireDefault = __webpack_require__(0); |
| 23221 |
|
| 23222 |
var _Object$defineProperty = __webpack_require__(1); |
| 23223 |
|
| 23224 |
_Object$defineProperty(exports, "__esModule", { |
| 23225 |
value: true |
| 23226 |
}); |
| 23227 |
|
| 23228 |
exports.default = void 0; |
| 23229 |
|
| 23230 |
__webpack_require__(39); |
| 23231 |
|
| 23232 |
var _objectSpread2 = _interopRequireDefault(__webpack_require__(214)); |
| 23233 |
|
| 23234 |
var _values = _interopRequireDefault(__webpack_require__(55)); |
| 23235 |
|
| 23236 |
var _classCallCheck2 = _interopRequireDefault(__webpack_require__(2)); |
| 23237 |
|
| 23238 |
var _createClass2 = _interopRequireDefault(__webpack_require__(3)); |
| 23239 |
|
| 23240 |
var _assertThisInitialized2 = _interopRequireDefault(__webpack_require__(49)); |
| 23241 |
|
| 23242 |
var _get2 = _interopRequireDefault(__webpack_require__(26)); |
| 23243 |
|
| 23244 |
var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(16)); |
| 23245 |
|
| 23246 |
var _inherits2 = _interopRequireDefault(__webpack_require__(4)); |
| 23247 |
|
| 23248 |
var _createSuper2 = _interopRequireDefault(__webpack_require__(5)); |
| 23249 |
|
| 23250 |
var _defineProperty2 = _interopRequireDefault(__webpack_require__(28)); |
| 23251 |
|
| 23252 |
var _component = _interopRequireDefault(__webpack_require__(477)); |
| 23253 |
|
| 23254 |
var _panel = _interopRequireDefault(__webpack_require__(506)); |
| 23255 |
|
| 23256 |
var _panelMenu = _interopRequireDefault(__webpack_require__(508)); |
| 23257 |
|
| 23258 |
var _panelHeaderBehavior = _interopRequireDefault(__webpack_require__(509)); |
| 23259 |
|
| 23260 |
var _repeater = _interopRequireDefault(__webpack_require__(511)); |
| 23261 |
|
| 23262 |
var _globalSelectBehavior = _interopRequireDefault(__webpack_require__(513)); |
| 23263 |
|
| 23264 |
var _controlsCssParser = _interopRequireDefault(__webpack_require__(293)); |
| 23265 |
|
| 23266 |
var _default = /*#__PURE__*/function (_elementorModules$edi) { |
| 23267 |
(0, _inherits2.default)(_default, _elementorModules$edi); |
| 23268 |
|
| 23269 |
var _super = (0, _createSuper2.default)(_default); |
| 23270 |
|
| 23271 |
function _default() { |
| 23272 |
var _this; |
| 23273 |
|
| 23274 |
(0, _classCallCheck2.default)(this, _default); |
| 23275 |
|
| 23276 |
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { |
| 23277 |
args[_key] = arguments[_key]; |
| 23278 |
} |
| 23279 |
|
| 23280 |
_this = _super.call.apply(_super, [this].concat(args)); |
| 23281 |
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "loadingTriggers", { |
| 23282 |
preview: false, |
| 23283 |
globals: false |
| 23284 |
}); |
| 23285 |
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "variablesCSS", null); |
| 23286 |
return _this; |
| 23287 |
} |
| 23288 |
|
| 23289 |
(0, _createClass2.default)(_default, [{ |
| 23290 |
key: "addPanelPages", |
| 23291 |
value: function addPanelPages() { |
| 23292 |
elementor.getPanelView().addPage('kit_settings', { |
| 23293 |
view: _panel.default, |
| 23294 |
title: elementor.translate('site_settings') |
| 23295 |
}); |
| 23296 |
elementor.getPanelView().addPage('kit_menu', { |
| 23297 |
view: _panelMenu.default, |
| 23298 |
title: elementor.translate('site_settings') |
| 23299 |
}); |
| 23300 |
} |
| 23301 |
}, { |
| 23302 |
key: "addPanelMenuItem", |
| 23303 |
value: function addPanelMenuItem() { |
| 23304 |
var menu = elementor.modules.layouts.panel.pages.menu.Menu; |
| 23305 |
menu.addItem({ |
| 23306 |
name: 'global-settings', |
| 23307 |
icon: 'eicon-global-settings', |
| 23308 |
title: elementor.translate('site_settings'), |
| 23309 |
type: 'page', |
| 23310 |
callback: function callback() { |
| 23311 |
$e.run('panel/global/open', { |
| 23312 |
route: $e.routes.getHistory('panel').reverse()[0].route |
| 23313 |
}); |
| 23314 |
} |
| 23315 |
}, 'style', 'editor-preferences'); |
| 23316 |
menu.addItem({ |
| 23317 |
name: 'site-editor', |
| 23318 |
icon: 'eicon-theme-builder', |
| 23319 |
title: elementor.translate('theme_builder'), |
| 23320 |
type: 'page', |
| 23321 |
callback: function callback() { |
| 23322 |
return $e.run('app/open'); |
| 23323 |
} |
| 23324 |
}, 'style', 'editor-preferences'); |
| 23325 |
} |
| 23326 |
}, { |
| 23327 |
key: "addHeaderBehavior", |
| 23328 |
value: function addHeaderBehavior(behaviors) { |
| 23329 |
behaviors.kit = { |
| 23330 |
behaviorClass: _panelHeaderBehavior.default |
| 23331 |
}; |
| 23332 |
return behaviors; |
| 23333 |
} |
| 23334 |
}, { |
| 23335 |
key: "addGlobalsBehavior", |
| 23336 |
value: function addGlobalsBehavior(behaviors, view) { |
| 23337 |
// The view can be a UI control which does not have this method. |
| 23338 |
if (!view.isGlobalActive) { |
| 23339 |
return; |
| 23340 |
} |
| 23341 |
|
| 23342 |
var isGlobalActive = view.isGlobalActive(); |
| 23343 |
|
| 23344 |
if ('color' === view.options.model.get('type') && isGlobalActive) { |
| 23345 |
behaviors.globals = { |
| 23346 |
behaviorClass: _globalSelectBehavior.default, |
| 23347 |
popoverTitle: elementor.translate('global_colors_title'), |
| 23348 |
manageButtonText: elementor.translate('manage_global_colors'), |
| 23349 |
tooltipText: elementor.translate('global_colors_info'), |
| 23350 |
newGlobalConfirmTitle: elementor.translate('create_global_color') |
| 23351 |
}; |
| 23352 |
} |
| 23353 |
|
| 23354 |
if ('popover_toggle' === view.options.model.get('type') && 'typography' === view.options.model.get('groupType') && isGlobalActive) { |
| 23355 |
behaviors.globals = { |
| 23356 |
behaviorClass: _globalSelectBehavior.default, |
| 23357 |
popoverTitle: elementor.translate('global_fonts_title'), |
| 23358 |
manageButtonText: elementor.translate('manage_global_fonts'), |
| 23359 |
tooltipText: elementor.translate('global_fonts_info'), |
| 23360 |
newGlobalConfirmTitle: elementor.translate('create_global_font') |
| 23361 |
}; |
| 23362 |
} |
| 23363 |
|
| 23364 |
return behaviors; |
| 23365 |
} |
| 23366 |
/** |
| 23367 |
* In case there is a new global color/typography convert current globals to CSS variables. |
| 23368 |
*/ |
| 23369 |
|
| 23370 |
}, { |
| 23371 |
key: "renderGlobalVariables", |
| 23372 |
value: function renderGlobalVariables() { |
| 23373 |
var _this2 = this; |
| 23374 |
|
| 23375 |
if (!this.variablesCSS) { |
| 23376 |
this.variablesCSS = new _controlsCssParser.default({ |
| 23377 |
id: 'e-kit-variables', |
| 23378 |
settingsModel: new elementorModules.editor.elements.models.BaseSettings({}, {}) |
| 23379 |
}); |
| 23380 |
} // The kit document has its own CSS. |
| 23381 |
|
| 23382 |
|
| 23383 |
if ('kit' === elementor.documents.getCurrent().config.type) { |
| 23384 |
this.variablesCSS.removeStyleFromDocument(); |
| 23385 |
return; |
| 23386 |
} |
| 23387 |
|
| 23388 |
$e.data.get('globals/index').then(function (_ref) { |
| 23389 |
var data = _ref.data; |
| 23390 |
|
| 23391 |
if (data.colors) { |
| 23392 |
(0, _values.default)(data.colors).forEach(function (item) { |
| 23393 |
var controls = elementor.config.kit_config.design_system_controls.colors, |
| 23394 |
values = { |
| 23395 |
_id: item.id, |
| 23396 |
color: item.value |
| 23397 |
}; |
| 23398 |
|
| 23399 |
_this2.variablesCSS.addStyleRules(controls, values, controls, ['{{WRAPPER}}'], ['body']); |
| 23400 |
}); |
| 23401 |
} |
| 23402 |
|
| 23403 |
if (data.typography) { |
| 23404 |
(0, _values.default)(data.typography).forEach(function (item) { |
| 23405 |
var controls = elementor.config.kit_config.design_system_controls.typography, |
| 23406 |
values = (0, _objectSpread2.default)({ |
| 23407 |
_id: item.id |
| 23408 |
}, item.value); // Enqueue fonts. |
| 23409 |
|
| 23410 |
if (item.value.typography_font_family) { |
| 23411 |
elementor.helpers.enqueueFont(item.value.typography_font_family); |
| 23412 |
} |
| 23413 |
|
| 23414 |
_this2.variablesCSS.addStyleRules(controls, values, controls, ['{{WRAPPER}}'], ['body']); |
| 23415 |
}); |
| 23416 |
} |
| 23417 |
|
| 23418 |
_this2.variablesCSS.addStyleToDocument(); |
| 23419 |
}); |
| 23420 |
} // Use the Controls CSS Parser to add the global defaults CSS to the page. |
| 23421 |
|
| 23422 |
}, { |
| 23423 |
key: "renderGlobalsDefaultCSS", |
| 23424 |
value: function renderGlobalsDefaultCSS() { |
| 23425 |
if (!this.loadingTriggers.preview || !this.loadingTriggers.globals) { |
| 23426 |
return; |
| 23427 |
} |
| 23428 |
|
| 23429 |
var cssParser = new _controlsCssParser.default({ |
| 23430 |
id: 'e-global-style' |
| 23431 |
}), |
| 23432 |
defaultColorsEnabled = elementor.config.globals.defaults_enabled.colors, |
| 23433 |
defaultTypographyEnabled = elementor.config.globals.defaults_enabled.typography; // If both default colors and typography are disabled, there is no need to render schemes and default global css. |
| 23434 |
|
| 23435 |
if (!defaultColorsEnabled && !defaultTypographyEnabled) { |
| 23436 |
return; |
| 23437 |
} |
| 23438 |
|
| 23439 |
(0, _values.default)(elementor.widgetsCache).forEach(function (widget) { |
| 23440 |
if (!widget.controls) { |
| 23441 |
return; |
| 23442 |
} |
| 23443 |
|
| 23444 |
var globalControls = [], |
| 23445 |
globalValues = {}; |
| 23446 |
(0, _values.default)(widget.controls).forEach(function (control) { |
| 23447 |
var _control$global, _globalControl$global; |
| 23448 |
|
| 23449 |
var isColorControl = 'color' === control.type, |
| 23450 |
isTypographyControl = 'typography' === control.groupType; |
| 23451 |
|
| 23452 |
if (isColorControl && !defaultColorsEnabled || isTypographyControl && !defaultTypographyEnabled) { |
| 23453 |
return; |
| 23454 |
} |
| 23455 |
|
| 23456 |
var globalControl = control; |
| 23457 |
|
| 23458 |
if (control.groupType) { |
| 23459 |
globalControl = widget.controls[control.groupPrefix + control.groupType]; |
| 23460 |
} |
| 23461 |
|
| 23462 |
if ((_control$global = control.global) === null || _control$global === void 0 ? void 0 : _control$global.default) { |
| 23463 |
globalValues[control.name] = globalControl.global.default; |
| 23464 |
} |
| 23465 |
|
| 23466 |
if ((_globalControl$global = globalControl.global) === null || _globalControl$global === void 0 ? void 0 : _globalControl$global.default) { |
| 23467 |
globalControls.push(control); |
| 23468 |
} |
| 23469 |
}); |
| 23470 |
globalControls.forEach(function (control) { |
| 23471 |
cssParser.addControlStyleRules(control, widget.controls, // values |
| 23472 |
widget.controls, // controls |
| 23473 |
['{{WRAPPER}}'], ['.elementor-widget-' + widget.widget_type], globalValues); |
| 23474 |
}); |
| 23475 |
}); |
| 23476 |
cssParser.addStyleToDocument(); |
| 23477 |
} |
| 23478 |
}, { |
| 23479 |
key: "onInit", |
| 23480 |
value: function onInit() { |
| 23481 |
var _this3 = this; |
| 23482 |
|
| 23483 |
(0, _get2.default)((0, _getPrototypeOf2.default)(_default.prototype), "onInit", this).call(this); |
| 23484 |
elementorCommon.elements.$window.on('elementor:loaded', function () { |
| 23485 |
if (!elementor.config.initial_document.panel.support_kit) { |
| 23486 |
return; |
| 23487 |
} |
| 23488 |
|
| 23489 |
if (!elementor.config.user.can_edit_kit) { |
| 23490 |
return; |
| 23491 |
} |
| 23492 |
|
| 23493 |
$e.components.register(new _component.default({ |
| 23494 |
manager: _this3 |
| 23495 |
})); |
| 23496 |
elementor.addControlView('global-style-repeater', _repeater.default); |
| 23497 |
elementor.hooks.addFilter('panel/header/behaviors', _this3.addHeaderBehavior); |
| 23498 |
elementor.hooks.addFilter('controls/base/behaviors', _this3.addGlobalsBehavior); |
| 23499 |
elementor.on('preview:loaded', function () { |
| 23500 |
_this3.loadingTriggers.preview = true; |
| 23501 |
|
| 23502 |
_this3.renderGlobalsDefaultCSS(); |
| 23503 |
}); |
| 23504 |
elementor.on('document:loaded', function () { |
| 23505 |
_this3.renderGlobalVariables(); |
| 23506 |
}); |
| 23507 |
elementor.on('globals:loaded', function () { |
| 23508 |
_this3.loadingTriggers.globals = true; |
| 23509 |
|
| 23510 |
_this3.renderGlobalsDefaultCSS(); |
| 23511 |
}); |
| 23512 |
elementor.on('panel:init', function () { |
| 23513 |
_this3.addPanelPages(); |
| 23514 |
|
| 23515 |
_this3.addPanelMenuItem(); |
| 23516 |
}); |
| 23517 |
}); |
| 23518 |
} |
| 23519 |
}]); |
| 23520 |
return _default; |
| 23521 |
}(elementorModules.editor.utils.Module); |
| 23522 |
|
| 23523 |
exports.default = _default; |
| 23524 |
|
| 23525 |
/***/ }), |
| 23526 |
/* 477 */ |
| 23527 |
/***/ (function(module, exports, __webpack_require__) { |
| 23528 |
|
| 23529 |
"use strict"; |
| 23530 |
|
| 23531 |
|
| 23532 |
var _interopRequireWildcard = __webpack_require__(36); |
| 23533 |
|
| 23534 |
var _interopRequireDefault = __webpack_require__(0); |
| 23535 |
|
| 23536 |
var _Object$defineProperty = __webpack_require__(1); |
| 23537 |
|
| 23538 |
_Object$defineProperty(exports, "__esModule", { |
| 23539 |
value: true |
| 23540 |
}); |
| 23541 |
|
| 23542 |
exports.default = void 0; |
| 23543 |
|
| 23544 |
var _classCallCheck2 = _interopRequireDefault(__webpack_require__(2)); |
| 23545 |
|
| 23546 |
var _createClass2 = _interopRequireDefault(__webpack_require__(3)); |
| 23547 |
|
| 23548 |
var _assertThisInitialized2 = _interopRequireDefault(__webpack_require__(49)); |
| 23549 |
|
| 23550 |
var _inherits2 = _interopRequireDefault(__webpack_require__(4)); |
| 23551 |
|
| 23552 |
var _createSuper2 = _interopRequireDefault(__webpack_require__(5)); |
| 23553 |
|
| 23554 |
var _defineProperty2 = _interopRequireDefault(__webpack_require__(28)); |
| 23555 |
|
| 23556 |
var hooks = _interopRequireWildcard(__webpack_require__(478)); |
| 23557 |
|
| 23558 |
var commands = _interopRequireWildcard(__webpack_require__(490)); |
| 23559 |
|
| 23560 |
var _default = /*#__PURE__*/function (_$e$modules$Component) { |
| 23561 |
(0, _inherits2.default)(_default, _$e$modules$Component); |
| 23562 |
|
| 23563 |
var _super = (0, _createSuper2.default)(_default); |
| 23564 |
|
| 23565 |
function _default() { |
| 23566 |
var _this; |
| 23567 |
|
| 23568 |
(0, _classCallCheck2.default)(this, _default); |
| 23569 |
|
| 23570 |
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { |
| 23571 |
args[_key] = arguments[_key]; |
| 23572 |
} |
| 23573 |
|
| 23574 |
_this = _super.call.apply(_super, [this].concat(args)); |
| 23575 |
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "pages", {}); |
| 23576 |
return _this; |
| 23577 |
} |
| 23578 |
|
| 23579 |
(0, _createClass2.default)(_default, [{ |
| 23580 |
key: "getNamespace", |
| 23581 |
value: function getNamespace() { |
| 23582 |
return 'panel/global'; |
| 23583 |
} |
| 23584 |
}, { |
| 23585 |
key: "defaultTabs", |
| 23586 |
value: function defaultTabs() { |
| 23587 |
return { |
| 23588 |
'global-colors': { |
| 23589 |
title: elementor.translate('global_colors'), |
| 23590 |
icon: 'eicon-global-colors', |
| 23591 |
helpUrl: 'https://go.elementor.com/global-colors' |
| 23592 |
}, |
| 23593 |
'global-typography': { |
| 23594 |
title: elementor.translate('global_fonts'), |
| 23595 |
icon: 'eicon-t-letter', |
| 23596 |
helpUrl: 'https://go.elementor.com/global-fonts' |
| 23597 |
}, |
| 23598 |
'theme-style-typography': { |
| 23599 |
title: elementor.translate('typography'), |
| 23600 |
icon: 'eicon-typography-1', |
| 23601 |
helpUrl: 'https://go.elementor.com/global-theme-style-typography' |
| 23602 |
}, |
| 23603 |
'theme-style-buttons': { |
| 23604 |
title: elementor.translate('buttons'), |
| 23605 |
icon: 'eicon-button', |
| 23606 |
helpUrl: 'https://go.elementor.com/global-theme-style-buttons' |
| 23607 |
}, |
| 23608 |
'theme-style-images': { |
| 23609 |
title: elementor.translate('images'), |
| 23610 |
icon: 'eicon-image', |
| 23611 |
helpUrl: 'https://go.elementor.com/global-theme-style-images' |
| 23612 |
}, |
| 23613 |
'theme-style-form-fields': { |
| 23614 |
title: elementor.translate('form_fields'), |
| 23615 |
icon: 'eicon-form-horizontal', |
| 23616 |
helpUrl: 'https://go.elementor.com/global-theme-style-form-fields' |
| 23617 |
}, |
| 23618 |
'settings-site-identity': { |
| 23619 |
title: elementor.translate('site_identity'), |
| 23620 |
icon: 'eicon-site-identity', |
| 23621 |
helpUrl: 'https://go.elementor.com/global-site-identity' |
| 23622 |
}, |
| 23623 |
'settings-background': { |
| 23624 |
title: elementor.translate('background'), |
| 23625 |
icon: 'eicon-background', |
| 23626 |
helpUrl: 'https://go.elementor.com/global-background' |
| 23627 |
}, |
| 23628 |
'settings-layout': { |
| 23629 |
title: elementor.translate('layout'), |
| 23630 |
icon: 'eicon-layout-settings', |
| 23631 |
helpUrl: 'https://go.elementor.com/global-layout' |
| 23632 |
}, |
| 23633 |
'settings-lightbox': { |
| 23634 |
title: elementor.translate('lightbox'), |
| 23635 |
icon: 'eicon-lightbox-expand', |
| 23636 |
helpUrl: 'https://go.elementor.com/global-lightbox' |
| 23637 |
}, |
| 23638 |
'settings-custom-css': { |
| 23639 |
title: elementor.translate('custom_css'), |
| 23640 |
icon: 'eicon-custom-css', |
| 23641 |
helpUrl: 'https://go.elementor.com/global-custom-css' |
| 23642 |
} |
| 23643 |
}; |
| 23644 |
} |
| 23645 |
}, { |
| 23646 |
key: "defaultRoutes", |
| 23647 |
value: function defaultRoutes() { |
| 23648 |
return { |
| 23649 |
menu: function menu() { |
| 23650 |
elementor.getPanelView().setPage('kit_menu'); |
| 23651 |
} |
| 23652 |
}; |
| 23653 |
} |
| 23654 |
}, { |
| 23655 |
key: "defaultCommands", |
| 23656 |
value: function defaultCommands() { |
| 23657 |
return this.importCommands(commands); |
| 23658 |
} |
| 23659 |
}, { |
| 23660 |
key: "defaultShortcuts", |
| 23661 |
value: function defaultShortcuts() { |
| 23662 |
return { |
| 23663 |
back: { |
| 23664 |
keys: 'esc', |
| 23665 |
scopes: ['panel'], |
| 23666 |
dependency: function dependency() { |
| 23667 |
return elementor.documents.isCurrent(elementor.config.kit_id) && !jQuery('.dialog-widget:visible').length; |
| 23668 |
} |
| 23669 |
} |
| 23670 |
}; |
| 23671 |
} |
| 23672 |
}, { |
| 23673 |
key: "defaultHooks", |
| 23674 |
value: function defaultHooks() { |
| 23675 |
return this.importHooks(hooks); |
| 23676 |
} |
| 23677 |
}, { |
| 23678 |
key: "renderTab", |
| 23679 |
value: function renderTab(tab) { |
| 23680 |
elementor.getPanelView().setPage('kit_settings').content.currentView.activateTab(tab); |
| 23681 |
} |
| 23682 |
}]); |
| 23683 |
return _default; |
| 23684 |
}($e.modules.ComponentBase); |
| 23685 |
|
| 23686 |
exports.default = _default; |
| 23687 |
|
| 23688 |
/***/ }), |
| 23689 |
/* 478 */ |
| 23690 |
/***/ (function(module, exports, __webpack_require__) { |
| 23691 |
|
| 23692 |
"use strict"; |
| 23693 |
|
| 23694 |
|
| 23695 |
var _Object$defineProperty = __webpack_require__(1); |
| 23696 |
|
| 23697 |
_Object$defineProperty(exports, "__esModule", { |
| 23698 |
value: true |
| 23699 |
}); |
| 23700 |
|
| 23701 |
_Object$defineProperty(exports, "KitGlobalsUpdateColors", { |
| 23702 |
enumerable: true, |
| 23703 |
get: function get() { |
| 23704 |
return _globalsUpdateColors.KitGlobalsUpdateColors; |
| 23705 |
} |
| 23706 |
}); |
| 23707 |
|
| 23708 |
_Object$defineProperty(exports, "KitGlobalsUpdateTypography", { |
| 23709 |
enumerable: true, |
| 23710 |
get: function get() { |
| 23711 |
return _globalsUpdateTypography.KitGlobalsUpdateTypography; |
| 23712 |
} |
| 23713 |
}); |
| 23714 |
|
| 23715 |
_Object$defineProperty(exports, "KitDeleteGlobalsCache", { |
| 23716 |
enumerable: true, |
| 23717 |
get: function get() { |
| 23718 |
return _deleteGlobalsCache.KitDeleteGlobalsCache; |
| 23719 |
} |
| 23720 |
}); |
| 23721 |
|
| 23722 |
_Object$defineProperty(exports, "KitAfterSave", { |
| 23723 |
enumerable: true, |
| 23724 |
get: function get() { |
| 23725 |
return _after.KitAfterSave; |
| 23726 |
} |
| 23727 |
}); |
| 23728 |
|
| 23729 |
_Object$defineProperty(exports, "KitUpdateLightboxPreview", { |
| 23730 |
enumerable: true, |
| 23731 |
get: function get() { |
| 23732 |
return _updateLightboxPreview.KitUpdateLightboxPreview; |
| 23733 |
} |
| 23734 |
}); |
| 23735 |
|
| 23736 |
_Object$defineProperty(exports, "KitUpdateStretchContainer", { |
| 23737 |
enumerable: true, |
| 23738 |
get: function get() { |
| 23739 |
return _updateStretchContainer.KitUpdateStretchContainer; |
| 23740 |
} |
| 23741 |
}); |
| 23742 |
|
| 23743 |
_Object$defineProperty(exports, "KitSaveRouteHistory", { |
| 23744 |
enumerable: true, |
| 23745 |
get: function get() { |
| 23746 |
return _saveRouteHistory.KitSaveRouteHistory; |
| 23747 |
} |
| 23748 |
}); |
| 23749 |
|
| 23750 |
_Object$defineProperty(exports, "KitRemoveEditorActiveCSSDocumentsOpen", { |
| 23751 |
enumerable: true, |
| 23752 |
get: function get() { |
| 23753 |
return _removeEditorActiveCss.KitRemoveEditorActiveCSSDocumentsOpen; |
| 23754 |
} |
| 23755 |
}); |
| 23756 |
|
| 23757 |
_Object$defineProperty(exports, "KitRemoveEditorActiveCSSPanelOpen", { |
| 23758 |
enumerable: true, |
| 23759 |
get: function get() { |
| 23760 |
return _removeEditorActiveCss2.KitRemoveEditorActiveCSSPanelOpen; |
| 23761 |
} |
| 23762 |
}); |
| 23763 |
|
| 23764 |
_Object$defineProperty(exports, "KitBackToRouteHistory", { |
| 23765 |
enumerable: true, |
| 23766 |
get: function get() { |
| 23767 |
return _backToRouteHistory.KitBackToRouteHistory; |
| 23768 |
} |
| 23769 |
}); |
| 23770 |
|
| 23771 |
_Object$defineProperty(exports, "KitRemovePreviewDeletedVariables", { |
| 23772 |
enumerable: true, |
| 23773 |
get: function get() { |
| 23774 |
return _removePreviewDeletedVariables.KitRemovePreviewDeletedVariables; |
| 23775 |
} |
| 23776 |
}); |
| 23777 |
|
| 23778 |
var _globalsUpdateColors = __webpack_require__(479); |
| 23779 |
|
| 23780 |
var _globalsUpdateTypography = __webpack_require__(480); |
| 23781 |
|
| 23782 |
var _deleteGlobalsCache = __webpack_require__(481); |
| 23783 |
|
| 23784 |
var _after = __webpack_require__(482); |
| 23785 |
|
| 23786 |
var _updateLightboxPreview = __webpack_require__(483); |
| 23787 |
|
| 23788 |
var _updateStretchContainer = __webpack_require__(484); |
| 23789 |
|
| 23790 |
var _saveRouteHistory = __webpack_require__(485); |
| 23791 |
|
| 23792 |
var _removeEditorActiveCss = __webpack_require__(486); |
| 23793 |
|
| 23794 |
var _removeEditorActiveCss2 = __webpack_require__(487); |
| 23795 |
|
| 23796 |
var _backToRouteHistory = __webpack_require__(488); |
| 23797 |
|
| 23798 |
var _removePreviewDeletedVariables = __webpack_require__(489); |
| 23799 |
|
| 23800 |
/***/ }), |
| 23801 |
/* 479 */ |
| 23802 |
/***/ (function(module, exports, __webpack_require__) { |
| 23803 |
|
| 23804 |
"use strict"; |
| 23805 |
|
| 23806 |
|
| 23807 |
var _interopRequireDefault = __webpack_require__(0); |
| 23808 |
|
| 23809 |
var _Object$defineProperty = __webpack_require__(1); |
| 23810 |
|
| 23811 |
_Object$defineProperty(exports, "__esModule", { |
| 23812 |
value: true |
| 23813 |
}); |
| 23814 |
|
| 23815 |
exports.default = exports.KitGlobalsUpdateColors = void 0; |
| 23816 |
|
| 23817 |
var _classCallCheck2 = _interopRequireDefault(__webpack_require__(2)); |
| 23818 |
|
| 23819 |
var _createClass2 = _interopRequireDefault(__webpack_require__(3)); |
| 23820 |
|
| 23821 |
var _inherits2 = _interopRequireDefault(__webpack_require__(4)); |
| 23822 |
|
| 23823 |
var _createSuper2 = _interopRequireDefault(__webpack_require__(5)); |
| 23824 |
|
| 23825 |
var _baseGlobalsUpdate = _interopRequireDefault(__webpack_require__(360)); |
| 23826 |
|
| 23827 |
var KitGlobalsUpdateColors = /*#__PURE__*/function (_BaseGlobalsUpdate) { |
| 23828 |
(0, _inherits2.default)(KitGlobalsUpdateColors, _BaseGlobalsUpdate); |
| 23829 |
|
| 23830 |
var _super = (0, _createSuper2.default)(KitGlobalsUpdateColors); |
| 23831 |
|
| 23832 |
function KitGlobalsUpdateColors() { |
| 23833 |
(0, _classCallCheck2.default)(this, KitGlobalsUpdateColors); |
| 23834 |
return _super.apply(this, arguments); |
| 23835 |
} |
| 23836 |
|
| 23837 |
(0, _createClass2.default)(KitGlobalsUpdateColors, [{ |
| 23838 |
key: "getCommand", |
| 23839 |
value: function getCommand() { |
| 23840 |
return 'globals/colors/create'; |
| 23841 |
} |
| 23842 |
}, { |
| 23843 |
key: "getId", |
| 23844 |
value: function getId() { |
| 23845 |
return 'globals-update-colors-/globals/colors/create'; |
| 23846 |
} |
| 23847 |
}, { |
| 23848 |
key: "getRepeaterName", |
| 23849 |
value: function getRepeaterName() { |
| 23850 |
return 'custom_colors'; |
| 23851 |
} |
| 23852 |
}, { |
| 23853 |
key: "applyModel", |
| 23854 |
value: function applyModel(model, value) { |
| 23855 |
model.color = value; |
| 23856 |
} |
| 23857 |
}]); |
| 23858 |
return KitGlobalsUpdateColors; |
| 23859 |
}(_baseGlobalsUpdate.default); |
| 23860 |
|
| 23861 |
exports.KitGlobalsUpdateColors = KitGlobalsUpdateColors; |
| 23862 |
var _default = KitGlobalsUpdateColors; |
| 23863 |
exports.default = _default; |
| 23864 |
|
| 23865 |
/***/ }), |
| 23866 |
/* 480 */ |
| 23867 |
/***/ (function(module, exports, __webpack_require__) { |
| 23868 |
|
| 23869 |
"use strict"; |
| 23870 |
|
| 23871 |
|
| 23872 |
var _interopRequireDefault = __webpack_require__(0); |
| 23873 |
|
| 23874 |
var _Object$defineProperty = __webpack_require__(1); |
| 23875 |
|
| 23876 |
_Object$defineProperty(exports, "__esModule", { |
| 23877 |
value: true |
| 23878 |
}); |
| 23879 |
|
| 23880 |
exports.default = exports.KitGlobalsUpdateTypography = void 0; |
| 23881 |
|
| 23882 |
var _assign = _interopRequireDefault(__webpack_require__(134)); |
| 23883 |
|
| 23884 |
var _classCallCheck2 = _interopRequireDefault(__webpack_require__(2)); |
| 23885 |
|
| 23886 |
var _createClass2 = _interopRequireDefault(__webpack_require__(3)); |
| 23887 |
|
| 23888 |
var _inherits2 = _interopRequireDefault(__webpack_require__(4)); |
| 23889 |
|
| 23890 |
var _createSuper2 = _interopRequireDefault(__webpack_require__(5)); |
| 23891 |
|
| 23892 |
var _baseGlobalsUpdate = _interopRequireDefault(__webpack_require__(360)); |
| 23893 |
|
| 23894 |
var KitGlobalsUpdateTypography = /*#__PURE__*/function (_BaseGlobalsUpdate) { |
| 23895 |
(0, _inherits2.default)(KitGlobalsUpdateTypography, _BaseGlobalsUpdate); |
| 23896 |
|
| 23897 |
var _super = (0, _createSuper2.default)(KitGlobalsUpdateTypography); |
| 23898 |
|
| 23899 |
function KitGlobalsUpdateTypography() { |
| 23900 |
(0, _classCallCheck2.default)(this, KitGlobalsUpdateTypography); |
| 23901 |
return _super.apply(this, arguments); |
| 23902 |
} |
| 23903 |
|
| 23904 |
(0, _createClass2.default)(KitGlobalsUpdateTypography, [{ |
| 23905 |
key: "getCommand", |
| 23906 |
value: function getCommand() { |
| 23907 |
return 'globals/typography/create'; |
| 23908 |
} |
| 23909 |
}, { |
| 23910 |
key: "getId", |
| 23911 |
value: function getId() { |
| 23912 |
return 'globals-update-typography-/globals/typography/create'; |
| 23913 |
} |
| 23914 |
}, { |
| 23915 |
key: "getRepeaterName", |
| 23916 |
value: function getRepeaterName() { |
| 23917 |
return 'custom_typography'; |
| 23918 |
} |
| 23919 |
}, { |
| 23920 |
key: "applyModel", |
| 23921 |
value: function applyModel(model, value) { |
| 23922 |
(0, _assign.default)(model, value); |
| 23923 |
} |
| 23924 |
}]); |
| 23925 |
return KitGlobalsUpdateTypography; |
| 23926 |
}(_baseGlobalsUpdate.default); |
| 23927 |
|
| 23928 |
exports.KitGlobalsUpdateTypography = KitGlobalsUpdateTypography; |
| 23929 |
var _default = KitGlobalsUpdateTypography; |
| 23930 |
exports.default = _default; |
| 23931 |
|
| 23932 |
/***/ }), |
| 23933 |
/* 481 */ |
| 23934 |
/***/ (function(module, exports, __webpack_require__) { |
| 23935 |
|
| 23936 |
"use strict"; |
| 23937 |
|
| 23938 |
|
| 23939 |
var _interopRequireDefault = __webpack_require__(0); |
| 23940 |
|
| 23941 |
var _Object$defineProperty = __webpack_require__(1); |
| 23942 |
|
| 23943 |
_Object$defineProperty(exports, "__esModule", { |
| 23944 |
value: true |
| 23945 |
}); |
| 23946 |
|
| 23947 |
exports.default = exports.KitDeleteGlobalsCache = void 0; |
| 23948 |
|
| 23949 |
var _classCallCheck2 = _interopRequireDefault(__webpack_require__(2)); |
| 23950 |
|
| 23951 |
var _createClass2 = _interopRequireDefault(__webpack_require__(3)); |
| 23952 |
|
| 23953 |
var _inherits2 = _interopRequireDefault(__webpack_require__(4)); |
| 23954 |
|
| 23955 |
var _createSuper2 = _interopRequireDefault(__webpack_require__(5)); |
| 23956 |
|
| 23957 |
var _after = _interopRequireDefault(__webpack_require__(224)); |
| 23958 |
|
| 23959 |
var KitDeleteGlobalsCache = /*#__PURE__*/function (_After) { |
| 23960 |
(0, _inherits2.default)(KitDeleteGlobalsCache, _After); |
| 23961 |
|
| 23962 |
var _super = (0, _createSuper2.default)(KitDeleteGlobalsCache); |
| 23963 |
|
| 23964 |
function KitDeleteGlobalsCache() { |
| 23965 |
(0, _classCallCheck2.default)(this, KitDeleteGlobalsCache); |
| 23966 |
return _super.apply(this, arguments); |
| 23967 |
} |
| 23968 |
|
| 23969 |
(0, _createClass2.default)(KitDeleteGlobalsCache, [{ |
| 23970 |
key: "getCommand", |
| 23971 |
value: function getCommand() { |
| 23972 |
return 'document/save/save'; |
| 23973 |
} |
| 23974 |
}, { |
| 23975 |
key: "getConditions", |
| 23976 |
value: function getConditions(args) { |
| 23977 |
var status = args.status, |
| 23978 |
_args$document = args.document, |
| 23979 |
document = _args$document === void 0 ? elementor.documents.getCurrent() : _args$document; |
| 23980 |
return 'publish' === status && 'kit' === document.config.type; |
| 23981 |
} |
| 23982 |
}, { |
| 23983 |
key: "getId", |
| 23984 |
value: function getId() { |
| 23985 |
return 'document/save/save::update-globals-cache'; |
| 23986 |
} |
| 23987 |
}, { |
| 23988 |
key: "apply", |
| 23989 |
value: function apply() { |
| 23990 |
// After kit updates - remove globals from cache and force re-request from server. |
| 23991 |
$e.components.get('globals').refreshGlobalData(); |
| 23992 |
} |
| 23993 |
}]); |
| 23994 |
return KitDeleteGlobalsCache; |
| 23995 |
}(_after.default); |
| 23996 |
|
| 23997 |
exports.KitDeleteGlobalsCache = KitDeleteGlobalsCache; |
| 23998 |
var _default = KitDeleteGlobalsCache; |
| 23999 |
exports.default = _default; |
| 24000 |
|
| 24001 |
/***/ }), |
| 24002 |
/* 482 */ |
| 24003 |
/***/ (function(module, exports, __webpack_require__) { |
| 24004 |
|
| 24005 |
"use strict"; |
| 24006 |
|
| 24007 |
|
| 24008 |
var _interopRequireDefault = __webpack_require__(0); |
| 24009 |
|
| 24010 |
var _Object$defineProperty = __webpack_require__(1); |
| 24011 |
|
| 24012 |
_Object$defineProperty(exports, "__esModule", { |
| 24013 |
value: true |
| 24014 |
}); |
| 24015 |
|
| 24016 |
exports.default = exports.KitAfterSave = void 0; |
| 24017 |
|
| 24018 |
var _classCallCheck2 = _interopRequireDefault(__webpack_require__(2)); |
| 24019 |
|
| 24020 |
var _createClass2 = _interopRequireDefault(__webpack_require__(3)); |
| 24021 |
|
| 24022 |
var _inherits2 = _interopRequireDefault(__webpack_require__(4)); |
| 24023 |
|
| 24024 |
var _createSuper2 = _interopRequireDefault(__webpack_require__(5)); |
| 24025 |
|
| 24026 |
var _after = _interopRequireDefault(__webpack_require__(224)); |
| 24027 |
|
| 24028 |
var KitAfterSave = /*#__PURE__*/function (_After) { |
| 24029 |
(0, _inherits2.default)(KitAfterSave, _After); |
| 24030 |
|
| 24031 |
var _super = (0, _createSuper2.default)(KitAfterSave); |
| 24032 |
|
| 24033 |
function KitAfterSave() { |
| 24034 |
(0, _classCallCheck2.default)(this, KitAfterSave); |
| 24035 |
return _super.apply(this, arguments); |
| 24036 |
} |
| 24037 |
|
| 24038 |
(0, _createClass2.default)(KitAfterSave, [{ |
| 24039 |
key: "getCommand", |
| 24040 |
value: function getCommand() { |
| 24041 |
return 'document/save/save'; |
| 24042 |
} |
| 24043 |
}, { |
| 24044 |
key: "getConditions", |
| 24045 |
value: function getConditions(args) { |
| 24046 |
var status = args.status, |
| 24047 |
_args$document = args.document, |
| 24048 |
document = _args$document === void 0 ? elementor.documents.getCurrent() : _args$document; |
| 24049 |
return 'publish' === status && 'kit' === document.config.type; |
| 24050 |
} |
| 24051 |
}, { |
| 24052 |
key: "getId", |
| 24053 |
value: function getId() { |
| 24054 |
return 'kit-footer-saver-after-save'; |
| 24055 |
} |
| 24056 |
}, { |
| 24057 |
key: "apply", |
| 24058 |
value: function apply(args) { |
| 24059 |
if ('publish' === args.status) { |
| 24060 |
elementor.notifications.showToast({ |
| 24061 |
message: elementor.translate('kit_changes_updated'), |
| 24062 |
buttons: [{ |
| 24063 |
name: 'back_to_editor', |
| 24064 |
text: elementor.translate('back_to_editor'), |
| 24065 |
callback: function callback() { |
| 24066 |
$e.run('panel/global/close'); |
| 24067 |
} |
| 24068 |
}] |
| 24069 |
}); |
| 24070 |
} |
| 24071 |
} |
| 24072 |
}]); |
| 24073 |
return KitAfterSave; |
| 24074 |
}(_after.default); |
| 24075 |
|
| 24076 |
exports.KitAfterSave = KitAfterSave; |
| 24077 |
var _default = KitAfterSave; |
| 24078 |
exports.default = _default; |
| 24079 |
|
| 24080 |
/***/ }), |
| 24081 |
/* 483 */ |
| 24082 |
/***/ (function(module, exports, __webpack_require__) { |
| 24083 |
|
| 24084 |
"use strict"; |
| 24085 |
|
| 24086 |
|
| 24087 |
var _interopRequireDefault = __webpack_require__(0); |
| 24088 |
|
| 24089 |
var _Object$defineProperty = __webpack_require__(1); |
| 24090 |
|
| 24091 |
_Object$defineProperty(exports, "__esModule", { |
| 24092 |
value: true |
| 24093 |
}); |
| 24094 |
|
| 24095 |
exports.default = exports.KitUpdateLightboxPreview = void 0; |
| 24096 |
|
| 24097 |
var _slicedToArray2 = _interopRequireDefault(__webpack_require__(102)); |
| 24098 |
|
| 24099 |
var _entries = _interopRequireDefault(__webpack_require__(89)); |
| 24100 |
|
| 24101 |
var _classCallCheck2 = _interopRequireDefault(__webpack_require__(2)); |
| 24102 |
|
| 24103 |
var _createClass2 = _interopRequireDefault(__webpack_require__(3)); |
| 24104 |
|
| 24105 |
var _inherits2 = _interopRequireDefault(__webpack_require__(4)); |
| 24106 |
|
| 24107 |
var _createSuper2 = _interopRequireDefault(__webpack_require__(5)); |
| 24108 |
|
| 24109 |
/** |
| 24110 |
* On change kit lightbox settings - update the lightbox preview config. |
| 24111 |
*/ |
| 24112 |
var KitUpdateLightboxPreview = /*#__PURE__*/function (_$e$modules$hookUI$Af) { |
| 24113 |
(0, _inherits2.default)(KitUpdateLightboxPreview, _$e$modules$hookUI$Af); |
| 24114 |
|
| 24115 |
var _super = (0, _createSuper2.default)(KitUpdateLightboxPreview); |
| 24116 |
|
| 24117 |
function KitUpdateLightboxPreview() { |
| 24118 |
(0, _classCallCheck2.default)(this, KitUpdateLightboxPreview); |
| 24119 |
return _super.apply(this, arguments); |
| 24120 |
} |
| 24121 |
|
| 24122 |
(0, _createClass2.default)(KitUpdateLightboxPreview, [{ |
| 24123 |
key: "getCommand", |
| 24124 |
value: function getCommand() { |
| 24125 |
return 'document/elements/settings'; |
| 24126 |
} |
| 24127 |
}, { |
| 24128 |
key: "getId", |
| 24129 |
value: function getId() { |
| 24130 |
return 'kit-update-lightbox-preview'; |
| 24131 |
} |
| 24132 |
}, { |
| 24133 |
key: "getContainerType", |
| 24134 |
value: function getContainerType() { |
| 24135 |
return 'document'; |
| 24136 |
} |
| 24137 |
}, { |
| 24138 |
key: "getConditions", |
| 24139 |
value: function getConditions() { |
| 24140 |
return 'kit' === elementor.documents.getCurrent().config.type; |
| 24141 |
} |
| 24142 |
}, { |
| 24143 |
key: "apply", |
| 24144 |
value: function apply(args) { |
| 24145 |
var settings = args.settings; |
| 24146 |
(0, _entries.default)(settings).forEach(function (_ref) { |
| 24147 |
var _ref2 = (0, _slicedToArray2.default)(_ref, 2), |
| 24148 |
key = _ref2[0], |
| 24149 |
value = _ref2[1]; |
| 24150 |
|
| 24151 |
if (-1 !== key.indexOf('lightbox')) { |
| 24152 |
elementorFrontend.config.kit[key] = value; |
| 24153 |
} |
| 24154 |
}); |
| 24155 |
} |
| 24156 |
}]); |
| 24157 |
return KitUpdateLightboxPreview; |
| 24158 |
}($e.modules.hookUI.After); |
| 24159 |
|
| 24160 |
exports.KitUpdateLightboxPreview = KitUpdateLightboxPreview; |
| 24161 |
var _default = KitUpdateLightboxPreview; |
| 24162 |
exports.default = _default; |
| 24163 |
|
| 24164 |
/***/ }), |
| 24165 |
/* 484 */ |
| 24166 |
/***/ (function(module, exports, __webpack_require__) { |
| 24167 |
|
| 24168 |
"use strict"; |
| 24169 |
|
| 24170 |
|
| 24171 |
var _interopRequireDefault = __webpack_require__(0); |
| 24172 |
|
| 24173 |
var _Object$defineProperty = __webpack_require__(1); |
| 24174 |
|
| 24175 |
_Object$defineProperty(exports, "__esModule", { |
| 24176 |
value: true |
| 24177 |
}); |
| 24178 |
|
| 24179 |
exports.default = exports.KitUpdateStretchContainer = void 0; |
| 24180 |
|
| 24181 |
var _slicedToArray2 = _interopRequireDefault(__webpack_require__(102)); |
| 24182 |
|
| 24183 |
var _entries = _interopRequireDefault(__webpack_require__(89)); |
| 24184 |
|
| 24185 |
var _classCallCheck2 = _interopRequireDefault(__webpack_require__(2)); |
| 24186 |
|
| 24187 |
var _createClass2 = _interopRequireDefault(__webpack_require__(3)); |
| 24188 |
|
| 24189 |
var _inherits2 = _interopRequireDefault(__webpack_require__(4)); |
| 24190 |
|
| 24191 |
var _createSuper2 = _interopRequireDefault(__webpack_require__(5)); |
| 24192 |
|
| 24193 |
/** |
| 24194 |
* On change kit stretch container settings - update the preview stretched sections. |
| 24195 |
*/ |
| 24196 |
var KitUpdateStretchContainer = /*#__PURE__*/function (_$e$modules$hookUI$Af) { |
| 24197 |
(0, _inherits2.default)(KitUpdateStretchContainer, _$e$modules$hookUI$Af); |
| 24198 |
|
| 24199 |
var _super = (0, _createSuper2.default)(KitUpdateStretchContainer); |
| 24200 |
|
| 24201 |
function KitUpdateStretchContainer() { |
| 24202 |
(0, _classCallCheck2.default)(this, KitUpdateStretchContainer); |
| 24203 |
return _super.apply(this, arguments); |
| 24204 |
} |
| 24205 |
|
| 24206 |
(0, _createClass2.default)(KitUpdateStretchContainer, [{ |
| 24207 |
key: "getCommand", |
| 24208 |
value: function getCommand() { |
| 24209 |
return 'document/elements/settings'; |
| 24210 |
} |
| 24211 |
}, { |
| 24212 |
key: "getId", |
| 24213 |
value: function getId() { |
| 24214 |
return 'kit-update-stretch-container'; |
| 24215 |
} |
| 24216 |
}, { |
| 24217 |
key: "getContainerType", |
| 24218 |
value: function getContainerType() { |
| 24219 |
return 'document'; |
| 24220 |
} |
| 24221 |
}, { |
| 24222 |
key: "getConditions", |
| 24223 |
value: function getConditions() { |
| 24224 |
return 'kit' === elementor.documents.getCurrent().config.type; |
| 24225 |
} |
| 24226 |
}, { |
| 24227 |
key: "apply", |
| 24228 |
value: function apply(args) { |
| 24229 |
var settings = args.settings; |
| 24230 |
(0, _entries.default)(settings).forEach(function (_ref) { |
| 24231 |
var _ref2 = (0, _slicedToArray2.default)(_ref, 2), |
| 24232 |
key = _ref2[0], |
| 24233 |
value = _ref2[1]; |
| 24234 |
|
| 24235 |
if ('stretched_section_container' === key) { |
| 24236 |
elementorFrontend.config.kit[key] = value; |
| 24237 |
elementor.channels.editor.trigger('kit:change:stretchContainer'); |
| 24238 |
} |
| 24239 |
}); |
| 24240 |
} |
| 24241 |
}]); |
| 24242 |
return KitUpdateStretchContainer; |
| 24243 |
}($e.modules.hookUI.After); |
| 24244 |
|
| 24245 |
exports.KitUpdateStretchContainer = KitUpdateStretchContainer; |
| 24246 |
var _default = KitUpdateStretchContainer; |
| 24247 |
exports.default = _default; |
| 24248 |
|
| 24249 |
/***/ }), |
| 24250 |
/* 485 */ |
| 24251 |
/***/ (function(module, exports, __webpack_require__) { |
| 24252 |
|
| 24253 |
"use strict"; |
| 24254 |
|
| 24255 |
|
| 24256 |
var _interopRequireDefault = __webpack_require__(0); |
| 24257 |
|
| 24258 |
var _Object$defineProperty = __webpack_require__(1); |
| 24259 |
|
| 24260 |
_Object$defineProperty(exports, "__esModule", { |
| 24261 |
value: true |
| 24262 |
}); |
| 24263 |
|
| 24264 |
exports.default = exports.KitSaveRouteHistory = void 0; |
| 24265 |
|
| 24266 |
var _classCallCheck2 = _interopRequireDefault(__webpack_require__(2)); |
| 24267 |
|
| 24268 |
var _createClass2 = _interopRequireDefault(__webpack_require__(3)); |
| 24269 |
|
| 24270 |
var _inherits2 = _interopRequireDefault(__webpack_require__(4)); |
| 24271 |
|
| 24272 |
var _createSuper2 = _interopRequireDefault(__webpack_require__(5)); |
| 24273 |
|
| 24274 |
var _baseOpenClose = _interopRequireDefault(__webpack_require__(361)); |
| 24275 |
|
| 24276 |
var KitSaveRouteHistory = /*#__PURE__*/function (_BaseOpenClose) { |
| 24277 |
(0, _inherits2.default)(KitSaveRouteHistory, _BaseOpenClose); |
| 24278 |
|
| 24279 |
var _super = (0, _createSuper2.default)(KitSaveRouteHistory); |
| 24280 |
|
| 24281 |
function KitSaveRouteHistory() { |
| 24282 |
(0, _classCallCheck2.default)(this, KitSaveRouteHistory); |
| 24283 |
return _super.apply(this, arguments); |
| 24284 |
} |
| 24285 |
|
| 24286 |
(0, _createClass2.default)(KitSaveRouteHistory, [{ |
| 24287 |
key: "getCommand", |
| 24288 |
value: function getCommand() { |
| 24289 |
return 'panel/global/open'; |
| 24290 |
} |
| 24291 |
}, { |
| 24292 |
key: "getId", |
| 24293 |
value: function getId() { |
| 24294 |
return 'save-route-history--/panel/global/open'; |
| 24295 |
} |
| 24296 |
}, { |
| 24297 |
key: "getConditions", |
| 24298 |
value: function getConditions() { |
| 24299 |
var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; |
| 24300 |
var result = arguments.length > 1 ? arguments[1] : undefined; |
| 24301 |
return args.route; |
| 24302 |
} |
| 24303 |
}, { |
| 24304 |
key: "apply", |
| 24305 |
value: function apply(args) { |
| 24306 |
this.component.routeHistory = args; |
| 24307 |
} |
| 24308 |
}]); |
| 24309 |
return KitSaveRouteHistory; |
| 24310 |
}(_baseOpenClose.default); |
| 24311 |
|
| 24312 |
exports.KitSaveRouteHistory = KitSaveRouteHistory; |
| 24313 |
var _default = KitSaveRouteHistory; |
| 24314 |
exports.default = _default; |
| 24315 |
|
| 24316 |
/***/ }), |
| 24317 |
/* 486 */ |
| 24318 |
/***/ (function(module, exports, __webpack_require__) { |
| 24319 |
|
| 24320 |
"use strict"; |
| 24321 |
|
| 24322 |
|
| 24323 |
var _interopRequireDefault = __webpack_require__(0); |
| 24324 |
|
| 24325 |
var _Object$defineProperty = __webpack_require__(1); |
| 24326 |
|
| 24327 |
_Object$defineProperty(exports, "__esModule", { |
| 24328 |
value: true |
| 24329 |
}); |
| 24330 |
|
| 24331 |
exports.default = exports.KitRemoveEditorActiveCSSDocumentsOpen = void 0; |
| 24332 |
|
| 24333 |
var _classCallCheck2 = _interopRequireDefault(__webpack_require__(2)); |
| 24334 |
|
| 24335 |
var _createClass2 = _interopRequireDefault(__webpack_require__(3)); |
| 24336 |
|
| 24337 |
var _inherits2 = _interopRequireDefault(__webpack_require__(4)); |
| 24338 |
|
| 24339 |
var _createSuper2 = _interopRequireDefault(__webpack_require__(5)); |
| 24340 |
|
| 24341 |
var KitRemoveEditorActiveCSSDocumentsOpen = /*#__PURE__*/function (_$e$modules$hookUI$Af) { |
| 24342 |
(0, _inherits2.default)(KitRemoveEditorActiveCSSDocumentsOpen, _$e$modules$hookUI$Af); |
| 24343 |
|
| 24344 |
var _super = (0, _createSuper2.default)(KitRemoveEditorActiveCSSDocumentsOpen); |
| 24345 |
|
| 24346 |
function KitRemoveEditorActiveCSSDocumentsOpen() { |
| 24347 |
(0, _classCallCheck2.default)(this, KitRemoveEditorActiveCSSDocumentsOpen); |
| 24348 |
return _super.apply(this, arguments); |
| 24349 |
} |
| 24350 |
|
| 24351 |
(0, _createClass2.default)(KitRemoveEditorActiveCSSDocumentsOpen, [{ |
| 24352 |
key: "getCommand", |
| 24353 |
value: function getCommand() { |
| 24354 |
return 'editor/documents/open'; |
| 24355 |
} |
| 24356 |
}, { |
| 24357 |
key: "getId", |
| 24358 |
value: function getId() { |
| 24359 |
return 'kit-remove-editor-active-css--editor/documents/open'; |
| 24360 |
} |
| 24361 |
}, { |
| 24362 |
key: "getConditions", |
| 24363 |
value: function getConditions() { |
| 24364 |
return 'kit' === elementor.documents.getCurrent().config.type; |
| 24365 |
} |
| 24366 |
}, { |
| 24367 |
key: "apply", |
| 24368 |
value: function apply() { |
| 24369 |
// TODO: Remove - Temporary fix to avoid conflict with `elementor.exitPreviewMode()`. |
| 24370 |
setTimeout(function () { |
| 24371 |
elementorFrontend.elements.$body.removeClass('elementor-editor-active'); |
| 24372 |
}); |
| 24373 |
} |
| 24374 |
}]); |
| 24375 |
return KitRemoveEditorActiveCSSDocumentsOpen; |
| 24376 |
}($e.modules.hookUI.After); |
| 24377 |
|
| 24378 |
exports.KitRemoveEditorActiveCSSDocumentsOpen = KitRemoveEditorActiveCSSDocumentsOpen; |
| 24379 |
var _default = KitRemoveEditorActiveCSSDocumentsOpen; |
| 24380 |
exports.default = _default; |
| 24381 |
|
| 24382 |
/***/ }), |
| 24383 |
/* 487 */ |
| 24384 |
/***/ (function(module, exports, __webpack_require__) { |
| 24385 |
|
| 24386 |
"use strict"; |
| 24387 |
|
| 24388 |
|
| 24389 |
var _interopRequireDefault = __webpack_require__(0); |
| 24390 |
|
| 24391 |
var _Object$defineProperty = __webpack_require__(1); |
| 24392 |
|
| 24393 |
_Object$defineProperty(exports, "__esModule", { |
| 24394 |
value: true |
| 24395 |
}); |
| 24396 |
|
| 24397 |
exports.default = exports.KitRemoveEditorActiveCSSPanelOpen = void 0; |
| 24398 |
|
| 24399 |
var _classCallCheck2 = _interopRequireDefault(__webpack_require__(2)); |
| 24400 |
|
| 24401 |
var _createClass2 = _interopRequireDefault(__webpack_require__(3)); |
| 24402 |
|
| 24403 |
var _inherits2 = _interopRequireDefault(__webpack_require__(4)); |
| 24404 |
|
| 24405 |
var _createSuper2 = _interopRequireDefault(__webpack_require__(5)); |
| 24406 |
|
| 24407 |
var KitRemoveEditorActiveCSSPanelOpen = /*#__PURE__*/function (_$e$modules$hookUI$Af) { |
| 24408 |
(0, _inherits2.default)(KitRemoveEditorActiveCSSPanelOpen, _$e$modules$hookUI$Af); |
| 24409 |
|
| 24410 |
var _super = (0, _createSuper2.default)(KitRemoveEditorActiveCSSPanelOpen); |
| 24411 |
|
| 24412 |
function KitRemoveEditorActiveCSSPanelOpen() { |
| 24413 |
(0, _classCallCheck2.default)(this, KitRemoveEditorActiveCSSPanelOpen); |
| 24414 |
return _super.apply(this, arguments); |
| 24415 |
} |
| 24416 |
|
| 24417 |
(0, _createClass2.default)(KitRemoveEditorActiveCSSPanelOpen, [{ |
| 24418 |
key: "getCommand", |
| 24419 |
value: function getCommand() { |
| 24420 |
return 'panel/open'; |
| 24421 |
} |
| 24422 |
}, { |
| 24423 |
key: "getId", |
| 24424 |
value: function getId() { |
| 24425 |
return 'kit-remove-editor-active-css--/panel/open'; |
| 24426 |
} |
| 24427 |
}, { |
| 24428 |
key: "getConditions", |
| 24429 |
value: function getConditions() { |
| 24430 |
return 'kit' === elementor.documents.getCurrent().config.type; |
| 24431 |
} |
| 24432 |
}, { |
| 24433 |
key: "apply", |
| 24434 |
value: function apply() { |
| 24435 |
// TODO: Remove - Temporary fix to avoid conflict with `elementor.exitPreviewMode()`. |
| 24436 |
setTimeout(function () { |
| 24437 |
elementorFrontend.elements.$body.removeClass('elementor-editor-active'); |
| 24438 |
}); |
| 24439 |
} |
| 24440 |
}]); |
| 24441 |
return KitRemoveEditorActiveCSSPanelOpen; |
| 24442 |
}($e.modules.hookUI.After); |
| 24443 |
|
| 24444 |
exports.KitRemoveEditorActiveCSSPanelOpen = KitRemoveEditorActiveCSSPanelOpen; |
| 24445 |
var _default = KitRemoveEditorActiveCSSPanelOpen; |
| 24446 |
exports.default = _default; |
| 24447 |
|
| 24448 |
/***/ }), |
| 24449 |
/* 488 */ |
| 24450 |
/***/ (function(module, exports, __webpack_require__) { |
| 24451 |
|
| 24452 |
"use strict"; |
| 24453 |
|
| 24454 |
|
| 24455 |
var _interopRequireDefault = __webpack_require__(0); |
| 24456 |
|
| 24457 |
var _Object$defineProperty = __webpack_require__(1); |
| 24458 |
|
| 24459 |
_Object$defineProperty(exports, "__esModule", { |
| 24460 |
value: true |
| 24461 |
}); |
| 24462 |
|
| 24463 |
exports.default = exports.KitBackToRouteHistory = void 0; |
| 24464 |
|
| 24465 |
var _classCallCheck2 = _interopRequireDefault(__webpack_require__(2)); |
| 24466 |
|
| 24467 |
var _createClass2 = _interopRequireDefault(__webpack_require__(3)); |
| 24468 |
|
| 24469 |
var _inherits2 = _interopRequireDefault(__webpack_require__(4)); |
| 24470 |
|
| 24471 |
var _createSuper2 = _interopRequireDefault(__webpack_require__(5)); |
| 24472 |
|
| 24473 |
var _baseOpenClose = _interopRequireDefault(__webpack_require__(361)); |
| 24474 |
|
| 24475 |
var KitBackToRouteHistory = /*#__PURE__*/function (_BaseOpenClose) { |
| 24476 |
(0, _inherits2.default)(KitBackToRouteHistory, _BaseOpenClose); |
| 24477 |
|
| 24478 |
var _super = (0, _createSuper2.default)(KitBackToRouteHistory); |
| 24479 |
|
| 24480 |
function KitBackToRouteHistory() { |
| 24481 |
(0, _classCallCheck2.default)(this, KitBackToRouteHistory); |
| 24482 |
return _super.apply(this, arguments); |
| 24483 |
} |
| 24484 |
|
| 24485 |
(0, _createClass2.default)(KitBackToRouteHistory, [{ |
| 24486 |
key: "getCommand", |
| 24487 |
value: function getCommand() { |
| 24488 |
return 'panel/global/close'; |
| 24489 |
} |
| 24490 |
}, { |
| 24491 |
key: "getId", |
| 24492 |
value: function getId() { |
| 24493 |
return 'back-to-route-history-/panel/global/close'; |
| 24494 |
} |
| 24495 |
}, { |
| 24496 |
key: "getConditions", |
| 24497 |
value: function getConditions() { |
| 24498 |
return this.component.routeHistory; |
| 24499 |
} |
| 24500 |
}, { |
| 24501 |
key: "apply", |
| 24502 |
value: function apply() { |
| 24503 |
var historyBeforeOpen = this.component.routeHistory; |
| 24504 |
delete this.component.routeHistory; |
| 24505 |
/** |
| 24506 |
* TODO: Find better solution. |
| 24507 |
* Since cache deleted after leaving globals. |
| 24508 |
* Cover issue: When back to route, it back to style, it causes the UI ask for styles separately and since, |
| 24509 |
* Cache deleted, it asks the remote ( $e.data ) for specific colors/typography endpoints and causes a delay in global select box. |
| 24510 |
* To handle the the issue, request globals manually, then back to route. |
| 24511 |
*/ |
| 24512 |
|
| 24513 |
if (historyBeforeOpen.container) { |
| 24514 |
$e.data.get('globals/index').then(function () { |
| 24515 |
// Since the container comes from history, its not connected element. |
| 24516 |
historyBeforeOpen.container = historyBeforeOpen.container.lookup(); |
| 24517 |
historyBeforeOpen.container.model.trigger('request:edit', { |
| 24518 |
scrollIntoView: true |
| 24519 |
}); |
| 24520 |
$e.route(historyBeforeOpen.route, { |
| 24521 |
model: historyBeforeOpen.container.model, |
| 24522 |
view: historyBeforeOpen.container.view |
| 24523 |
}); |
| 24524 |
}); |
| 24525 |
} |
| 24526 |
} |
| 24527 |
}]); |
| 24528 |
return KitBackToRouteHistory; |
| 24529 |
}(_baseOpenClose.default); |
| 24530 |
|
| 24531 |
exports.KitBackToRouteHistory = KitBackToRouteHistory; |
| 24532 |
var _default = KitBackToRouteHistory; |
| 24533 |
exports.default = _default; |
| 24534 |
|
| 24535 |
/***/ }), |
| 24536 |
/* 489 */ |
| 24537 |
/***/ (function(module, exports, __webpack_require__) { |
| 24538 |
|
| 24539 |
"use strict"; |
| 24540 |
|
| 24541 |
|
| 24542 |
var _interopRequireDefault = __webpack_require__(0); |
| 24543 |
|
| 24544 |
var _Object$defineProperty = __webpack_require__(1); |
| 24545 |
|
| 24546 |
_Object$defineProperty(exports, "__esModule", { |
| 24547 |
value: true |
| 24548 |
}); |
| 24549 |
|
| 24550 |
exports.KitRemovePreviewDeletedVariables = void 0; |
| 24551 |
|
| 24552 |
var _keys = _interopRequireDefault(__webpack_require__(23)); |
| 24553 |
|
| 24554 |
var _values = _interopRequireDefault(__webpack_require__(55)); |
| 24555 |
|
| 24556 |
__webpack_require__(39); |
| 24557 |
|
| 24558 |
__webpack_require__(135); |
| 24559 |
|
| 24560 |
__webpack_require__(155); |
| 24561 |
|
| 24562 |
var _classCallCheck2 = _interopRequireDefault(__webpack_require__(2)); |
| 24563 |
|
| 24564 |
var _createClass2 = _interopRequireDefault(__webpack_require__(3)); |
| 24565 |
|
| 24566 |
var _assertThisInitialized2 = _interopRequireDefault(__webpack_require__(49)); |
| 24567 |
|
| 24568 |
var _inherits2 = _interopRequireDefault(__webpack_require__(4)); |
| 24569 |
|
| 24570 |
var _createSuper2 = _interopRequireDefault(__webpack_require__(5)); |
| 24571 |
|
| 24572 |
var _defineProperty2 = _interopRequireDefault(__webpack_require__(28)); |
| 24573 |
|
| 24574 |
/** |
| 24575 |
* On delete a design system item - the used variables on the preview frame are |
| 24576 |
* invalid and cause the elements to get the user-agent default style instead of |
| 24577 |
* inherit higher CSS rules. |
| 24578 |
* |
| 24579 |
* The hook finds and removes all deleted item variables from the preview inline styles. |
| 24580 |
*/ |
| 24581 |
var KitRemovePreviewDeletedVariables = /*#__PURE__*/function (_$e$modules$hookUI$Be) { |
| 24582 |
(0, _inherits2.default)(KitRemovePreviewDeletedVariables, _$e$modules$hookUI$Be); |
| 24583 |
|
| 24584 |
var _super = (0, _createSuper2.default)(KitRemovePreviewDeletedVariables); |
| 24585 |
|
| 24586 |
function KitRemovePreviewDeletedVariables() { |
| 24587 |
var _this; |
| 24588 |
|
| 24589 |
(0, _classCallCheck2.default)(this, KitRemovePreviewDeletedVariables); |
| 24590 |
|
| 24591 |
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { |
| 24592 |
args[_key] = arguments[_key]; |
| 24593 |
} |
| 24594 |
|
| 24595 |
_this = _super.call.apply(_super, [this].concat(args)); |
| 24596 |
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "controls", ['custom_colors', 'custom_typography']); |
| 24597 |
return _this; |
| 24598 |
} |
| 24599 |
|
| 24600 |
(0, _createClass2.default)(KitRemovePreviewDeletedVariables, [{ |
| 24601 |
key: "getCommand", |
| 24602 |
value: function getCommand() { |
| 24603 |
return 'document/repeater/remove'; |
| 24604 |
} |
| 24605 |
}, { |
| 24606 |
key: "getId", |
| 24607 |
value: function getId() { |
| 24608 |
return 'kit-remove-preview-deleted-variables'; |
| 24609 |
} |
| 24610 |
}, { |
| 24611 |
key: "getContainerType", |
| 24612 |
value: function getContainerType() { |
| 24613 |
return 'document'; |
| 24614 |
} |
| 24615 |
}, { |
| 24616 |
key: "getConditions", |
| 24617 |
value: function getConditions(args) { |
| 24618 |
return this.controls.includes(args.name) && 'kit' === elementor.documents.getCurrent().config.type; |
| 24619 |
} |
| 24620 |
}, { |
| 24621 |
key: "apply", |
| 24622 |
value: function apply(args) { |
| 24623 |
var _this2 = this; |
| 24624 |
|
| 24625 |
// Store on component in order to use it in undo hook. |
| 24626 |
this.component = $e.components.get('panel/global'); |
| 24627 |
this.component.tempStyle = this.component.tempStyle || {}; |
| 24628 |
var _args$containers = args.containers, |
| 24629 |
containers = _args$containers === void 0 ? [args.container] : _args$containers, |
| 24630 |
kitCSSId = "elementor-style-page-".concat(elementor.config.kit_id); |
| 24631 |
containers.forEach(function (container) { |
| 24632 |
var item = container.repeaters[args.name].children[args.index], |
| 24633 |
stylesheets = (0, _values.default)(elementor.$previewContents[0].styleSheets).filter(function (stylesheet) { |
| 24634 |
// Don't touch the kit CSS itself. |
| 24635 |
return kitCSSId !== stylesheet.ownerNode.id && stylesheet.ownerNode.innerHTML.includes(item.id); |
| 24636 |
}); |
| 24637 |
stylesheets.forEach(function (stylesheet) { |
| 24638 |
_this2.component.tempStyle[item.id] = _this2.extractVariables(stylesheet.cssRules, item.id); |
| 24639 |
}); |
| 24640 |
}); |
| 24641 |
} |
| 24642 |
}, { |
| 24643 |
key: "extractVariables", |
| 24644 |
value: function extractVariables(cssRules, id) { |
| 24645 |
var variablesRules = {}; |
| 24646 |
(0, _values.default)(cssRules).forEach(function (rule) { |
| 24647 |
if (!rule.style) { |
| 24648 |
// TODO Handle CSSMediaRule. |
| 24649 |
return; |
| 24650 |
} |
| 24651 |
|
| 24652 |
variablesRules[rule.selectorText] = {}; // Get the original properties for undo. |
| 24653 |
|
| 24654 |
for (var i = 0; i < rule.style.length; i++) { |
| 24655 |
var property = rule.style[i], |
| 24656 |
value = rule.style[property]; |
| 24657 |
|
| 24658 |
if (value.includes(id)) { |
| 24659 |
variablesRules[rule.selectorText][property] = value; |
| 24660 |
} |
| 24661 |
} // Delete in a separated loop, because it changes the `style.length`. |
| 24662 |
|
| 24663 |
|
| 24664 |
(0, _keys.default)(variablesRules[rule.selectorText]).forEach(function (property) { |
| 24665 |
rule.style[property] = ''; |
| 24666 |
}); |
| 24667 |
}); |
| 24668 |
return variablesRules; |
| 24669 |
} |
| 24670 |
}]); |
| 24671 |
return KitRemovePreviewDeletedVariables; |
| 24672 |
}($e.modules.hookUI.Before); |
| 24673 |
|
| 24674 |
exports.KitRemovePreviewDeletedVariables = KitRemovePreviewDeletedVariables; |
| 24675 |
|
| 24676 |
/***/ }), |
| 24677 |
/* 490 */ |
| 24678 |
/***/ (function(module, exports, __webpack_require__) { |
| 24679 |
|
| 24680 |
"use strict"; |
| 24681 |
|
| 24682 |
|
| 24683 |
var _Object$defineProperty = __webpack_require__(1); |
| 24684 |
|
| 24685 |
_Object$defineProperty(exports, "__esModule", { |
| 24686 |
value: true |
| 24687 |
}); |
| 24688 |
|
| 24689 |
_Object$defineProperty(exports, "Back", { |
| 24690 |
enumerable: true, |
| 24691 |
get: function get() { |
| 24692 |
return _back.Back; |
| 24693 |
} |
| 24694 |
}); |
| 24695 |
|
| 24696 |
_Object$defineProperty(exports, "Close", { |
| 24697 |
enumerable: true, |
| 24698 |
get: function get() { |
| 24699 |
return _close.Close; |
| 24700 |
} |
| 24701 |
}); |
| 24702 |
|
| 24703 |
_Object$defineProperty(exports, "Exit", { |
| 24704 |
enumerable: true, |
| 24705 |
get: function get() { |
| 24706 |
return _exit.Exit; |
| 24707 |
} |
| 24708 |
}); |
| 24709 |
|
| 24710 |
_Object$defineProperty(exports, "Open", { |
| 24711 |
enumerable: true, |
| 24712 |
get: function get() { |
| 24713 |
return _open.Open; |
| 24714 |
} |
| 24715 |
}); |
| 24716 |
|
| 24717 |
var _back = __webpack_require__(491); |
| 24718 |
|
| 24719 |
var _close = __webpack_require__(492); |
| 24720 |
|
| 24721 |
var _exit = __webpack_require__(504); |
| 24722 |
|
| 24723 |
var _open = __webpack_require__(505); |
| 24724 |
|
| 24725 |
/***/ }), |
| 24726 |
/* 491 */ |
| 24727 |
/***/ (function(module, exports, __webpack_require__) { |
| 24728 |
|
| 24729 |
"use strict"; |
| 24730 |
|
| 24731 |
|
| 24732 |
var _interopRequireDefault = __webpack_require__(0); |
| 24733 |
|
| 24734 |
var _Object$defineProperty = __webpack_require__(1); |
| 24735 |
|
| 24736 |
_Object$defineProperty(exports, "__esModule", { |
| 24737 |
value: true |
| 24738 |
}); |
| 24739 |
|
| 24740 |
exports.default = exports.Back = void 0; |
| 24741 |
|
| 24742 |
var _classCallCheck2 = _interopRequireDefault(__webpack_require__(2)); |
| 24743 |
|
| 24744 |
var _createClass2 = _interopRequireDefault(__webpack_require__(3)); |
| 24745 |
|
| 24746 |
var _assertThisInitialized2 = _interopRequireDefault(__webpack_require__(49)); |
| 24747 |
|
| 24748 |
var _inherits2 = _interopRequireDefault(__webpack_require__(4)); |
| 24749 |
|
| 24750 |
var _createSuper2 = _interopRequireDefault(__webpack_require__(5)); |
| 24751 |
|
| 24752 |
var _defineProperty2 = _interopRequireDefault(__webpack_require__(28)); |
| 24753 |
|
| 24754 |
var _commandBase = _interopRequireDefault(__webpack_require__(21)); |
| 24755 |
|
| 24756 |
var Back = /*#__PURE__*/function (_CommandBase) { |
| 24757 |
(0, _inherits2.default)(Back, _CommandBase); |
| 24758 |
|
| 24759 |
var _super = (0, _createSuper2.default)(Back); |
| 24760 |
|
| 24761 |
function Back() { |
| 24762 |
var _this; |
| 24763 |
|
| 24764 |
(0, _classCallCheck2.default)(this, Back); |
| 24765 |
|
| 24766 |
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { |
| 24767 |
args[_key] = arguments[_key]; |
| 24768 |
} |
| 24769 |
|
| 24770 |
_this = _super.call.apply(_super, [this].concat(args)); |
| 24771 |
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "confirmDialog", null); |
| 24772 |
return _this; |
| 24773 |
} |
| 24774 |
|
| 24775 |
(0, _createClass2.default)(Back, [{ |
| 24776 |
key: "apply", |
| 24777 |
value: function apply() { |
| 24778 |
var panelHistory = $e.routes.getHistory('panel'); // Don't go back if no where. |
| 24779 |
|
| 24780 |
if (1 === panelHistory.length) { |
| 24781 |
this.getCloseConfirmDialog(event).show(); |
| 24782 |
return; |
| 24783 |
} |
| 24784 |
|
| 24785 |
return $e.routes.back('panel'); |
| 24786 |
} |
| 24787 |
}, { |
| 24788 |
key: "getCloseConfirmDialog", |
| 24789 |
value: function getCloseConfirmDialog(event) { |
| 24790 |
if (!this.confirmDialog) { |
| 24791 |
var modalOptions = { |
| 24792 |
id: 'elementor-kit-warn-on-close', |
| 24793 |
headerMessage: elementor.translate('Exit'), |
| 24794 |
message: elementor.translate('Would you like to exit?'), |
| 24795 |
position: { |
| 24796 |
my: 'center center', |
| 24797 |
at: 'center center' |
| 24798 |
}, |
| 24799 |
strings: { |
| 24800 |
confirm: elementor.translate('Exit'), |
| 24801 |
cancel: elementor.translate('Cancel') |
| 24802 |
}, |
| 24803 |
onConfirm: function onConfirm() { |
| 24804 |
$e.run('panel/global/close'); |
| 24805 |
} |
| 24806 |
}; |
| 24807 |
this.confirmDialog = elementorCommon.dialogsManager.createWidget('confirm', modalOptions); |
| 24808 |
} |
| 24809 |
|
| 24810 |
this.confirmDialog.setSettings('hide', { |
| 24811 |
onEscKeyPress: !event |
| 24812 |
}); |
| 24813 |
return this.confirmDialog; |
| 24814 |
} |
| 24815 |
}]); |
| 24816 |
return Back; |
| 24817 |
}(_commandBase.default); |
| 24818 |
|
| 24819 |
exports.Back = Back; |
| 24820 |
var _default = Back; |
| 24821 |
exports.default = _default; |
| 24822 |
|
| 24823 |
/***/ }), |
| 24824 |
/* 492 */ |
| 24825 |
/***/ (function(module, exports, __webpack_require__) { |
| 24826 |
|
| 24827 |
"use strict"; |
| 24828 |
|
| 24829 |
|
| 24830 |
var _interopRequireDefault = __webpack_require__(0); |
| 24831 |
|
| 24832 |
var _Object$defineProperty = __webpack_require__(1); |
| 24833 |
|
| 24834 |
_Object$defineProperty(exports, "__esModule", { |
| 24835 |
value: true |
| 24836 |
}); |
| 24837 |
|
| 24838 |
exports.default = exports.Close = void 0; |
| 24839 |
|
| 24840 |
__webpack_require__(362); |
| 24841 |
|
| 24842 |
__webpack_require__(72); |
| 24843 |
|
| 24844 |
__webpack_require__(366); |
| 24845 |
|
| 24846 |
var _parseInt2 = _interopRequireDefault(__webpack_require__(213)); |
| 24847 |
|
| 24848 |
var _classCallCheck2 = _interopRequireDefault(__webpack_require__(2)); |
| 24849 |
|
| 24850 |
var _createClass2 = _interopRequireDefault(__webpack_require__(3)); |
| 24851 |
|
| 24852 |
var _inherits2 = _interopRequireDefault(__webpack_require__(4)); |
| 24853 |
|
| 24854 |
var _createSuper2 = _interopRequireDefault(__webpack_require__(5)); |
| 24855 |
|
| 24856 |
var _commandBase = _interopRequireDefault(__webpack_require__(21)); |
| 24857 |
|
| 24858 |
var Close = /*#__PURE__*/function (_CommandBase) { |
| 24859 |
(0, _inherits2.default)(Close, _CommandBase); |
| 24860 |
|
| 24861 |
var _super = (0, _createSuper2.default)(Close); |
| 24862 |
|
| 24863 |
function Close() { |
| 24864 |
(0, _classCallCheck2.default)(this, Close); |
| 24865 |
return _super.apply(this, arguments); |
| 24866 |
} |
| 24867 |
|
| 24868 |
(0, _createClass2.default)(Close, [{ |
| 24869 |
key: "apply", |
| 24870 |
value: function apply(args) { |
| 24871 |
var _this = this; |
| 24872 |
|
| 24873 |
var mode = args.mode; // The kit is opened directly. |
| 24874 |
|
| 24875 |
if (elementor.config.initial_document.id === (0, _parseInt2.default)(elementor.config.kit_id)) { |
| 24876 |
return $e.run('panel/global/exit'); |
| 24877 |
} |
| 24878 |
|
| 24879 |
$e.internal('panel/state-loading'); |
| 24880 |
return $e.run('editor/documents/switch', { |
| 24881 |
mode: mode, |
| 24882 |
id: elementor.config.initial_document.id, |
| 24883 |
onClose: function onClose(document) { |
| 24884 |
if (document.isDraft()) { |
| 24885 |
// Restore published style. |
| 24886 |
elementor.toggleDocumentCssFiles(document, true); |
| 24887 |
elementor.settings.page.destroyControlsCSS(); |
| 24888 |
} |
| 24889 |
|
| 24890 |
$e.components.get('panel/global').close(); |
| 24891 |
$e.routes.clearHistory(_this.component.getRootContainer()); // The kit shouldn't be cached for next open. (it may be changed via create colors/typography). |
| 24892 |
|
| 24893 |
elementor.documents.invalidateCache(elementor.config.kit_id); |
| 24894 |
} |
| 24895 |
}).finally(function () { |
| 24896 |
return $e.internal('panel/state-ready'); |
| 24897 |
}); |
| 24898 |
} |
| 24899 |
}]); |
| 24900 |
return Close; |
| 24901 |
}(_commandBase.default); |
| 24902 |
|
| 24903 |
exports.Close = Close; |
| 24904 |
var _default = Close; |
| 24905 |
exports.default = _default; |
| 24906 |
|
| 24907 |
/***/ }), |
| 24908 |
/* 493 */ |
| 24909 |
/***/ (function(module, exports) { |
| 24910 |
|
| 24911 |
module.exports = function (it, Constructor, name, forbiddenField) { |
| 24912 |
if (!(it instanceof Constructor) || (forbiddenField !== undefined && forbiddenField in it)) { |
| 24913 |
throw TypeError(name + ': incorrect invocation!'); |
| 24914 |
} return it; |
| 24915 |
}; |
| 24916 |
|
| 24917 |
|
| 24918 |
/***/ }), |
| 24919 |
/* 494 */ |
| 24920 |
/***/ (function(module, exports, __webpack_require__) { |
| 24921 |
|
| 24922 |
var ctx = __webpack_require__(73); |
| 24923 |
var call = __webpack_require__(495); |
| 24924 |
var isArrayIter = __webpack_require__(496); |
| 24925 |
var anObject = __webpack_require__(18); |
| 24926 |
var toLength = __webpack_require__(43); |
| 24927 |
var getIterFn = __webpack_require__(497); |
| 24928 |
var BREAK = {}; |
| 24929 |
var RETURN = {}; |
| 24930 |
var exports = module.exports = function (iterable, entries, fn, that, ITERATOR) { |
| 24931 |
var iterFn = ITERATOR ? function () { return iterable; } : getIterFn(iterable); |
| 24932 |
var f = ctx(fn, that, entries ? 2 : 1); |
| 24933 |
var index = 0; |
| 24934 |
var length, step, iterator, result; |
| 24935 |
if (typeof iterFn != 'function') throw TypeError(iterable + ' is not iterable!'); |
| 24936 |
// fast case for arrays with default iterator |
| 24937 |
if (isArrayIter(iterFn)) for (length = toLength(iterable.length); length > index; index++) { |
| 24938 |
result = entries ? f(anObject(step = iterable[index])[0], step[1]) : f(iterable[index]); |
| 24939 |
if (result === BREAK || result === RETURN) return result; |
| 24940 |
} else for (iterator = iterFn.call(iterable); !(step = iterator.next()).done;) { |
| 24941 |
result = call(iterator, f, step.value, entries); |
| 24942 |
if (result === BREAK || result === RETURN) return result; |
| 24943 |
} |
| 24944 |
}; |
| 24945 |
exports.BREAK = BREAK; |
| 24946 |
exports.RETURN = RETURN; |
| 24947 |
|
| 24948 |
|
| 24949 |
/***/ }), |
| 24950 |
/* 495 */ |
| 24951 |
/***/ (function(module, exports, __webpack_require__) { |
| 24952 |
|
| 24953 |
// call something on iterator step with safe closing on error |
| 24954 |
var anObject = __webpack_require__(18); |
| 24955 |
module.exports = function (iterator, fn, value, entries) { |
| 24956 |
try { |
| 24957 |
return entries ? fn(anObject(value)[0], value[1]) : fn(value); |
| 24958 |
// 7.4.6 IteratorClose(iterator, completion) |
| 24959 |
} catch (e) { |
| 24960 |
var ret = iterator['return']; |
| 24961 |
if (ret !== undefined) anObject(ret.call(iterator)); |
| 24962 |
throw e; |
| 24963 |
} |
| 24964 |
}; |
| 24965 |
|
| 24966 |
|
| 24967 |
/***/ }), |
| 24968 |
/* 496 */ |
| 24969 |
/***/ (function(module, exports, __webpack_require__) { |
| 24970 |
|
| 24971 |
// check on default Array iterator |
| 24972 |
var Iterators = __webpack_require__(118); |
| 24973 |
var ITERATOR = __webpack_require__(12)('iterator'); |
| 24974 |
var ArrayProto = Array.prototype; |
| 24975 |
|
| 24976 |
module.exports = function (it) { |
| 24977 |
return it !== undefined && (Iterators.Array === it || ArrayProto[ITERATOR] === it); |
| 24978 |
}; |
| 24979 |
|
| 24980 |
|
| 24981 |
/***/ }), |
| 24982 |
/* 497 */ |
| 24983 |
/***/ (function(module, exports, __webpack_require__) { |
| 24984 |
|
| 24985 |
var classof = __webpack_require__(113); |
| 24986 |
var ITERATOR = __webpack_require__(12)('iterator'); |
| 24987 |
var Iterators = __webpack_require__(118); |
| 24988 |
module.exports = __webpack_require__(54).getIteratorMethod = function (it) { |
| 24989 |
if (it != undefined) return it[ITERATOR] |
| 24990 |
|| it['@@iterator'] |
| 24991 |
|| Iterators[classof(it)]; |
| 24992 |
}; |
| 24993 |
|
| 24994 |
|
| 24995 |
/***/ }), |
| 24996 |
/* 498 */ |
| 24997 |
/***/ (function(module, exports) { |
| 24998 |
|
| 24999 |
// fast apply, http://jsperf.lnkit.com/fast-apply/5 |
| 25000 |
module.exports = function (fn, args, that) { |
| 25001 |
var un = that === undefined; |
| 25002 |
switch (args.length) { |
| 25003 |
case 0: return un ? fn() |
| 25004 |
: fn.call(that); |
| 25005 |
case 1: return un ? fn(args[0]) |
| 25006 |
: fn.call(that, args[0]); |
| 25007 |
case 2: return un ? fn(args[0], args[1]) |
| 25008 |
: fn.call(that, args[0], args[1]); |
| 25009 |
case 3: return un ? fn(args[0], args[1], args[2]) |
| 25010 |
: fn.call(that, args[0], args[1], args[2]); |
| 25011 |
case 4: return un ? fn(args[0], args[1], args[2], args[3]) |
| 25012 |
: fn.call(that, args[0], args[1], args[2], args[3]); |
| 25013 |
} return fn.apply(that, args); |
| 25014 |
}; |
| 25015 |
|
| 25016 |
|
| 25017 |
/***/ }), |
| 25018 |
/* 499 */ |
| 25019 |
/***/ (function(module, exports, __webpack_require__) { |
| 25020 |
|
| 25021 |
var global = __webpack_require__(17); |
| 25022 |
var macrotask = __webpack_require__(363).set; |
| 25023 |
var Observer = global.MutationObserver || global.WebKitMutationObserver; |
| 25024 |
var process = global.process; |
| 25025 |
var Promise = global.Promise; |
| 25026 |
var isNode = __webpack_require__(46)(process) == 'process'; |
| 25027 |
|
| 25028 |
module.exports = function () { |
| 25029 |
var head, last, notify; |
| 25030 |
|
| 25031 |
var flush = function () { |
| 25032 |
var parent, fn; |
| 25033 |
if (isNode && (parent = process.domain)) parent.exit(); |
| 25034 |
while (head) { |
| 25035 |
fn = head.fn; |
| 25036 |
head = head.next; |
| 25037 |
try { |
| 25038 |
fn(); |
| 25039 |
} catch (e) { |
| 25040 |
if (head) notify(); |
| 25041 |
else last = undefined; |
| 25042 |
throw e; |
| 25043 |
} |
| 25044 |
} last = undefined; |
| 25045 |
if (parent) parent.enter(); |
| 25046 |
}; |
| 25047 |
|
| 25048 |
// Node.js |
| 25049 |
if (isNode) { |
| 25050 |
notify = function () { |
| 25051 |
process.nextTick(flush); |
| 25052 |
}; |
| 25053 |
// browsers with MutationObserver, except iOS Safari - https://github.com/zloirock/core-js/issues/339 |
| 25054 |
} else if (Observer && !(global.navigator && global.navigator.standalone)) { |
| 25055 |
var toggle = true; |
| 25056 |
var node = document.createTextNode(''); |
| 25057 |
new Observer(flush).observe(node, { characterData: true }); // eslint-disable-line no-new |
| 25058 |
notify = function () { |
| 25059 |
node.data = toggle = !toggle; |
| 25060 |
}; |
| 25061 |
// environments with maybe non-completely correct, but existent Promise |
| 25062 |
} else if (Promise && Promise.resolve) { |
| 25063 |
// Promise.resolve without an argument throws an error in LG WebOS 2 |
| 25064 |
var promise = Promise.resolve(undefined); |
| 25065 |
notify = function () { |
| 25066 |
promise.then(flush); |
| 25067 |
}; |
| 25068 |
// for other environments - macrotask based on: |
| 25069 |
// - setImmediate |
| 25070 |
// - MessageChannel |
| 25071 |
// - window.postMessag |
| 25072 |
// - onreadystatechange |
| 25073 |
// - setTimeout |
| 25074 |
} else { |
| 25075 |
notify = function () { |
| 25076 |
// strange IE + webpack dev server bug - use .call(global) |
| 25077 |
macrotask.call(global, flush); |
| 25078 |
}; |
| 25079 |
} |
| 25080 |
|
| 25081 |
return function (fn) { |
| 25082 |
var task = { fn: fn, next: undefined }; |
| 25083 |
if (last) last.next = task; |
| 25084 |
if (!head) { |
| 25085 |
head = task; |
| 25086 |
notify(); |
| 25087 |
} last = task; |
| 25088 |
}; |
| 25089 |
}; |
| 25090 |
|
| 25091 |
|
| 25092 |
/***/ }), |
| 25093 |
/* 500 */ |
| 25094 |
/***/ (function(module, exports) { |
| 25095 |
|
| 25096 |
module.exports = function (exec) { |
| 25097 |
try { |
| 25098 |
return { e: false, v: exec() }; |
| 25099 |
} catch (e) { |
| 25100 |
return { e: true, v: e }; |
| 25101 |
} |
| 25102 |
}; |
| 25103 |
|
| 25104 |
|
| 25105 |
/***/ }), |
| 25106 |
/* 501 */ |
| 25107 |
/***/ (function(module, exports, __webpack_require__) { |
| 25108 |
|
| 25109 |
var global = __webpack_require__(17); |
| 25110 |
var navigator = global.navigator; |
| 25111 |
|
| 25112 |
module.exports = navigator && navigator.userAgent || ''; |
| 25113 |
|
| 25114 |
|
| 25115 |
/***/ }), |
| 25116 |
/* 502 */ |
| 25117 |
/***/ (function(module, exports, __webpack_require__) { |
| 25118 |
|
| 25119 |
var redefine = __webpack_require__(37); |
| 25120 |
module.exports = function (target, src, safe) { |
| 25121 |
for (var key in src) redefine(target, key, src[key], safe); |
| 25122 |
return target; |
| 25123 |
}; |
| 25124 |
|
| 25125 |
|
| 25126 |
/***/ }), |
| 25127 |
/* 503 */ |
| 25128 |
/***/ (function(module, exports, __webpack_require__) { |
| 25129 |
|
| 25130 |
var ITERATOR = __webpack_require__(12)('iterator'); |
| 25131 |
var SAFE_CLOSING = false; |
| 25132 |
|
| 25133 |
try { |
| 25134 |
var riter = [7][ITERATOR](); |
| 25135 |
riter['return'] = function () { SAFE_CLOSING = true; }; |
| 25136 |
// eslint-disable-next-line no-throw-literal |
| 25137 |
Array.from(riter, function () { throw 2; }); |
| 25138 |
} catch (e) { /* empty */ } |
| 25139 |
|
| 25140 |
module.exports = function (exec, skipClosing) { |
| 25141 |
if (!skipClosing && !SAFE_CLOSING) return false; |
| 25142 |
var safe = false; |
| 25143 |
try { |
| 25144 |
var arr = [7]; |
| 25145 |
var iter = arr[ITERATOR](); |
| 25146 |
iter.next = function () { return { done: safe = true }; }; |
| 25147 |
arr[ITERATOR] = function () { return iter; }; |
| 25148 |
exec(arr); |
| 25149 |
} catch (e) { /* empty */ } |
| 25150 |
return safe; |
| 25151 |
}; |
| 25152 |
|
| 25153 |
|
| 25154 |
/***/ }), |
| 25155 |
/* 504 */ |
| 25156 |
/***/ (function(module, exports, __webpack_require__) { |
| 25157 |
|
| 25158 |
"use strict"; |
| 25159 |
|
| 25160 |
|
| 25161 |
var _interopRequireDefault = __webpack_require__(0); |
| 25162 |
|
| 25163 |
var _Object$defineProperty = __webpack_require__(1); |
| 25164 |
|
| 25165 |
_Object$defineProperty(exports, "__esModule", { |
| 25166 |
value: true |
| 25167 |
}); |
| 25168 |
|
| 25169 |
exports.default = exports.Exit = void 0; |
| 25170 |
|
| 25171 |
var _classCallCheck2 = _interopRequireDefault(__webpack_require__(2)); |
| 25172 |
|
| 25173 |
var _createClass2 = _interopRequireDefault(__webpack_require__(3)); |
| 25174 |
|
| 25175 |
var _inherits2 = _interopRequireDefault(__webpack_require__(4)); |
| 25176 |
|
| 25177 |
var _createSuper2 = _interopRequireDefault(__webpack_require__(5)); |
| 25178 |
|
| 25179 |
var _commandBase = _interopRequireDefault(__webpack_require__(21)); |
| 25180 |
|
| 25181 |
var Exit = /*#__PURE__*/function (_CommandBase) { |
| 25182 |
(0, _inherits2.default)(Exit, _CommandBase); |
| 25183 |
|
| 25184 |
var _super = (0, _createSuper2.default)(Exit); |
| 25185 |
|
| 25186 |
function Exit() { |
| 25187 |
(0, _classCallCheck2.default)(this, Exit); |
| 25188 |
return _super.apply(this, arguments); |
| 25189 |
} |
| 25190 |
|
| 25191 |
(0, _createClass2.default)(Exit, [{ |
| 25192 |
key: "apply", |
| 25193 |
value: function apply() { |
| 25194 |
return $e.run('editor/documents/close', { |
| 25195 |
id: elementor.config.kit_id, |
| 25196 |
onClose: function onClose(document) { |
| 25197 |
location = document.config.urls.exit_to_dashboard; |
| 25198 |
} |
| 25199 |
}); |
| 25200 |
} |
| 25201 |
}]); |
| 25202 |
return Exit; |
| 25203 |
}(_commandBase.default); |
| 25204 |
|
| 25205 |
exports.Exit = Exit; |
| 25206 |
var _default = Exit; |
| 25207 |
exports.default = _default; |
| 25208 |
|
| 25209 |
/***/ }), |
| 25210 |
/* 505 */ |
| 25211 |
/***/ (function(module, exports, __webpack_require__) { |
| 25212 |
|
| 25213 |
"use strict"; |
| 25214 |
|
| 25215 |
|
| 25216 |
var _interopRequireDefault = __webpack_require__(0); |
| 25217 |
|
| 25218 |
var _Object$defineProperty = __webpack_require__(1); |
| 25219 |
|
| 25220 |
_Object$defineProperty(exports, "__esModule", { |
| 25221 |
value: true |
| 25222 |
}); |
| 25223 |
|
| 25224 |
exports.default = exports.Open = void 0; |
| 25225 |
|
| 25226 |
__webpack_require__(362); |
| 25227 |
|
| 25228 |
__webpack_require__(72); |
| 25229 |
|
| 25230 |
__webpack_require__(366); |
| 25231 |
|
| 25232 |
var _classCallCheck2 = _interopRequireDefault(__webpack_require__(2)); |
| 25233 |
|
| 25234 |
var _createClass2 = _interopRequireDefault(__webpack_require__(3)); |
| 25235 |
|
| 25236 |
var _inherits2 = _interopRequireDefault(__webpack_require__(4)); |
| 25237 |
|
| 25238 |
var _createSuper2 = _interopRequireDefault(__webpack_require__(5)); |
| 25239 |
|
| 25240 |
var _commandBase = _interopRequireDefault(__webpack_require__(21)); |
| 25241 |
|
| 25242 |
var Open = /*#__PURE__*/function (_CommandBase) { |
| 25243 |
(0, _inherits2.default)(Open, _CommandBase); |
| 25244 |
|
| 25245 |
var _super = (0, _createSuper2.default)(Open); |
| 25246 |
|
| 25247 |
function Open() { |
| 25248 |
(0, _classCallCheck2.default)(this, Open); |
| 25249 |
return _super.apply(this, arguments); |
| 25250 |
} |
| 25251 |
|
| 25252 |
(0, _createClass2.default)(Open, [{ |
| 25253 |
key: "apply", |
| 25254 |
value: function apply() { |
| 25255 |
var kit = elementor.documents.get(elementor.config.kit_id); |
| 25256 |
|
| 25257 |
if (kit && 'open' === kit.editor.status) { |
| 25258 |
return jQuery.Deferred().resolve(); |
| 25259 |
} |
| 25260 |
|
| 25261 |
$e.routes.clearHistory(this.component.getRootContainer()); |
| 25262 |
this.component.toggleHistoryClass(); |
| 25263 |
$e.internal('panel/state-loading'); |
| 25264 |
return $e.run('editor/documents/switch', { |
| 25265 |
id: elementor.config.kit_id, |
| 25266 |
mode: 'autosave' |
| 25267 |
}).finally(function () { |
| 25268 |
return $e.internal('panel/state-ready'); |
| 25269 |
}); |
| 25270 |
} |
| 25271 |
}]); |
| 25272 |
return Open; |
| 25273 |
}(_commandBase.default); |
| 25274 |
|
| 25275 |
exports.Open = Open; |
| 25276 |
var _default = Open; |
| 25277 |
exports.default = _default; |
| 25278 |
|
| 25279 |
/***/ }), |
| 25280 |
/* 506 */ |
| 25281 |
/***/ (function(module, exports, __webpack_require__) { |
| 25282 |
|
| 25283 |
"use strict"; |
| 25284 |
|
| 25285 |
|
| 25286 |
var _interopRequireDefault = __webpack_require__(0); |
| 25287 |
|
| 25288 |
var _panelContent = _interopRequireDefault(__webpack_require__(507)); |
| 25289 |
|
| 25290 |
module.exports = Marionette.LayoutView.extend({ |
| 25291 |
id: 'elementor-kit-panel', |
| 25292 |
template: '#tmpl-elementor-kit-panel', |
| 25293 |
regions: { |
| 25294 |
content: '#elementor-kit__panel-content__wrapper' |
| 25295 |
}, |
| 25296 |
onBeforeShow: function onBeforeShow() { |
| 25297 |
var container = elementor.documents.getCurrent().container, |
| 25298 |
options = { |
| 25299 |
container: container, |
| 25300 |
model: container.model, |
| 25301 |
controls: container.settings.controls, |
| 25302 |
name: 'kit' |
| 25303 |
}; |
| 25304 |
this.showChildView('content', new _panelContent.default(options)); |
| 25305 |
} |
| 25306 |
}); |
| 25307 |
|
| 25308 |
/***/ }), |
| 25309 |
/* 507 */ |
| 25310 |
/***/ (function(module, exports, __webpack_require__) { |
| 25311 |
|
| 25312 |
"use strict"; |
| 25313 |
|
| 25314 |
|
| 25315 |
var _interopRequireDefault = __webpack_require__(0); |
| 25316 |
|
| 25317 |
var _Object$defineProperty = __webpack_require__(1); |
| 25318 |
|
| 25319 |
_Object$defineProperty(exports, "__esModule", { |
| 25320 |
value: true |
| 25321 |
}); |
| 25322 |
|
| 25323 |
exports.default = void 0; |
| 25324 |
|
| 25325 |
var _classCallCheck2 = _interopRequireDefault(__webpack_require__(2)); |
| 25326 |
|
| 25327 |
var _createClass2 = _interopRequireDefault(__webpack_require__(3)); |
| 25328 |
|
| 25329 |
var _inherits2 = _interopRequireDefault(__webpack_require__(4)); |
| 25330 |
|
| 25331 |
var _createSuper2 = _interopRequireDefault(__webpack_require__(5)); |
| 25332 |
|
| 25333 |
var _default = /*#__PURE__*/function (_elementorModules$edi) { |
| 25334 |
(0, _inherits2.default)(_default, _elementorModules$edi); |
| 25335 |
|
| 25336 |
var _super = (0, _createSuper2.default)(_default); |
| 25337 |
|
| 25338 |
function _default() { |
| 25339 |
(0, _classCallCheck2.default)(this, _default); |
| 25340 |
return _super.apply(this, arguments); |
| 25341 |
} |
| 25342 |
|
| 25343 |
(0, _createClass2.default)(_default, [{ |
| 25344 |
key: "id", |
| 25345 |
value: function id() { |
| 25346 |
return 'elementor-kit-panel-content'; |
| 25347 |
} |
| 25348 |
}, { |
| 25349 |
key: "getTemplate", |
| 25350 |
value: function getTemplate() { |
| 25351 |
return '#tmpl-elementor-kit-panel-content'; |
| 25352 |
} |
| 25353 |
}, { |
| 25354 |
key: "childViewContainer", |
| 25355 |
value: function childViewContainer() { |
| 25356 |
return '#elementor-kit-panel-content-controls'; |
| 25357 |
} |
| 25358 |
}, { |
| 25359 |
key: "childViewOptions", |
| 25360 |
value: function childViewOptions() { |
| 25361 |
var container = this.getOption('container'); |
| 25362 |
return { |
| 25363 |
elementSettingsModel: container.settings, |
| 25364 |
container: container |
| 25365 |
}; |
| 25366 |
} |
| 25367 |
}]); |
| 25368 |
return _default; |
| 25369 |
}(elementorModules.editor.views.ControlsStack); |
| 25370 |
|
| 25371 |
exports.default = _default; |
| 25372 |
|
| 25373 |
/***/ }), |
| 25374 |
/* 508 */ |
| 25375 |
/***/ (function(module, exports, __webpack_require__) { |
| 25376 |
|
| 25377 |
"use strict"; |
| 25378 |
|
| 25379 |
|
| 25380 |
var _interopRequireDefault = __webpack_require__(0); |
| 25381 |
|
| 25382 |
var _Object$defineProperty = __webpack_require__(1); |
| 25383 |
|
| 25384 |
_Object$defineProperty(exports, "__esModule", { |
| 25385 |
value: true |
| 25386 |
}); |
| 25387 |
|
| 25388 |
exports.default = void 0; |
| 25389 |
|
| 25390 |
var _classCallCheck2 = _interopRequireDefault(__webpack_require__(2)); |
| 25391 |
|
| 25392 |
var _createClass2 = _interopRequireDefault(__webpack_require__(3)); |
| 25393 |
|
| 25394 |
var _inherits2 = _interopRequireDefault(__webpack_require__(4)); |
| 25395 |
|
| 25396 |
var _createSuper2 = _interopRequireDefault(__webpack_require__(5)); |
| 25397 |
|
| 25398 |
var _base = _interopRequireDefault(__webpack_require__(359)); |
| 25399 |
|
| 25400 |
var PanelMenu = /*#__PURE__*/function (_MenuPageView) { |
| 25401 |
(0, _inherits2.default)(PanelMenu, _MenuPageView); |
| 25402 |
|
| 25403 |
var _super = (0, _createSuper2.default)(PanelMenu); |
| 25404 |
|
| 25405 |
function PanelMenu() { |
| 25406 |
(0, _classCallCheck2.default)(this, PanelMenu); |
| 25407 |
return _super.apply(this, arguments); |
| 25408 |
} |
| 25409 |
|
| 25410 |
(0, _createClass2.default)(PanelMenu, [{ |
| 25411 |
key: "initialize", |
| 25412 |
value: function initialize() { |
| 25413 |
this.collection = PanelMenu.getGroups(); |
| 25414 |
} |
| 25415 |
}]); |
| 25416 |
return PanelMenu; |
| 25417 |
}(_base.default); |
| 25418 |
|
| 25419 |
exports.default = PanelMenu; |
| 25420 |
PanelMenu.groups = null; |
| 25421 |
|
| 25422 |
PanelMenu.createGroupItems = function (groupName, keys) { |
| 25423 |
var tabs = $e.components.get('panel/global').getTabs(); |
| 25424 |
return keys.map(function (key) { |
| 25425 |
var fullKey = groupName + '-' + key, |
| 25426 |
tab = tabs[fullKey]; |
| 25427 |
return { |
| 25428 |
name: fullKey, |
| 25429 |
icon: tab.icon, |
| 25430 |
title: tab.title, |
| 25431 |
callback: function callback() { |
| 25432 |
return $e.route('panel/global/' + fullKey); |
| 25433 |
} |
| 25434 |
}; |
| 25435 |
}); |
| 25436 |
}; |
| 25437 |
|
| 25438 |
PanelMenu.initGroups = function () { |
| 25439 |
var settingsItems = PanelMenu.createGroupItems('settings', ['site-identity', 'background', 'layout', 'lightbox', 'custom-css']), |
| 25440 |
additionalSettingsProps = { |
| 25441 |
name: 'settings-additional-settings', |
| 25442 |
icon: 'eicon-tools', |
| 25443 |
title: elementor.translate('additional_settings'), |
| 25444 |
type: 'link', |
| 25445 |
link: elementor.config.admin_settings_url, |
| 25446 |
newTab: true |
| 25447 |
}; |
| 25448 |
settingsItems.push(additionalSettingsProps); |
| 25449 |
PanelMenu.groups = new Backbone.Collection([{ |
| 25450 |
name: 'design_system', |
| 25451 |
title: elementor.translate('design_system'), |
| 25452 |
items: PanelMenu.createGroupItems('global', ['colors', 'typography']) |
| 25453 |
}, { |
| 25454 |
name: 'theme_style', |
| 25455 |
title: elementor.translate('theme_style'), |
| 25456 |
items: PanelMenu.createGroupItems('theme-style', ['typography', 'buttons', 'images', 'form-fields']) |
| 25457 |
}, { |
| 25458 |
name: 'settings', |
| 25459 |
title: elementor.translate('settings'), |
| 25460 |
items: settingsItems |
| 25461 |
}]); |
| 25462 |
}; |
| 25463 |
|
| 25464 |
PanelMenu.getGroups = function () { |
| 25465 |
if (!PanelMenu.groups) { |
| 25466 |
PanelMenu.initGroups(); |
| 25467 |
} |
| 25468 |
|
| 25469 |
return PanelMenu.groups; |
| 25470 |
}; |
| 25471 |
|
| 25472 |
/***/ }), |
| 25473 |
/* 509 */ |
| 25474 |
/***/ (function(module, exports, __webpack_require__) { |
| 25475 |
|
| 25476 |
"use strict"; |
| 25477 |
|
| 25478 |
|
| 25479 |
var _interopRequireDefault = __webpack_require__(0); |
| 25480 |
|
| 25481 |
var _Object$defineProperty = __webpack_require__(1); |
| 25482 |
|
| 25483 |
_Object$defineProperty(exports, "__esModule", { |
| 25484 |
value: true |
| 25485 |
}); |
| 25486 |
|
| 25487 |
exports.default = void 0; |
| 25488 |
|
| 25489 |
var _classCallCheck2 = _interopRequireDefault(__webpack_require__(2)); |
| 25490 |
|
| 25491 |
var _createClass2 = _interopRequireDefault(__webpack_require__(3)); |
| 25492 |
|
| 25493 |
var _inherits2 = _interopRequireDefault(__webpack_require__(4)); |
| 25494 |
|
| 25495 |
var _createSuper2 = _interopRequireDefault(__webpack_require__(5)); |
| 25496 |
|
| 25497 |
var _panelHeaderButtons = __webpack_require__(510); |
| 25498 |
|
| 25499 |
var _default = /*#__PURE__*/function (_Marionette$Behavior) { |
| 25500 |
(0, _inherits2.default)(_default, _Marionette$Behavior); |
| 25501 |
|
| 25502 |
var _super = (0, _createSuper2.default)(_default); |
| 25503 |
|
| 25504 |
function _default() { |
| 25505 |
(0, _classCallCheck2.default)(this, _default); |
| 25506 |
return _super.apply(this, arguments); |
| 25507 |
} |
| 25508 |
|
| 25509 |
(0, _createClass2.default)(_default, [{ |
| 25510 |
key: "ui", |
| 25511 |
value: function ui() { |
| 25512 |
return { |
| 25513 |
buttonClose: '#elementor-panel-header-kit-close', |
| 25514 |
buttonBack: '#elementor-panel-header-kit-back' |
| 25515 |
}; |
| 25516 |
} |
| 25517 |
}, { |
| 25518 |
key: "events", |
| 25519 |
value: function events() { |
| 25520 |
return { |
| 25521 |
'click @ui.buttonClose': 'onClickClose', |
| 25522 |
'click @ui.buttonBack': 'onClickBack' |
| 25523 |
}; |
| 25524 |
} |
| 25525 |
}, { |
| 25526 |
key: "onBeforeShow", |
| 25527 |
value: function onBeforeShow() { |
| 25528 |
this.$el.prepend(elementor.compileTemplate(_panelHeaderButtons.buttonBack, { |
| 25529 |
Back: elementor.translate('back') |
| 25530 |
})); |
| 25531 |
this.$el.append(elementor.compileTemplate(_panelHeaderButtons.buttonClose, { |
| 25532 |
Close: elementor.translate('close') |
| 25533 |
})); |
| 25534 |
} |
| 25535 |
}, { |
| 25536 |
key: "onClickClose", |
| 25537 |
value: function onClickClose() { |
| 25538 |
$e.run('panel/global/close'); |
| 25539 |
} |
| 25540 |
}, { |
| 25541 |
key: "onClickBack", |
| 25542 |
value: function onClickBack() { |
| 25543 |
$e.run('panel/global/back'); |
| 25544 |
} |
| 25545 |
}]); |
| 25546 |
return _default; |
| 25547 |
}(Marionette.Behavior); |
| 25548 |
|
| 25549 |
exports.default = _default; |
| 25550 |
|
| 25551 |
/***/ }), |
| 25552 |
/* 510 */ |
| 25553 |
/***/ (function(module, exports, __webpack_require__) { |
| 25554 |
|
| 25555 |
"use strict"; |
| 25556 |
|
| 25557 |
|
| 25558 |
var _Object$defineProperty = __webpack_require__(1); |
| 25559 |
|
| 25560 |
_Object$defineProperty(exports, "__esModule", { |
| 25561 |
value: true |
| 25562 |
}); |
| 25563 |
|
| 25564 |
exports.buttonClose = exports.buttonBack = void 0; |
| 25565 |
var arrowIconClass = 'eicon-chevron-' + (elementorCommon.config.isRTL ? 'right' : 'left'); |
| 25566 |
var buttonBack = "\n<div id=\"elementor-panel-header-kit-back\" class=\"elementor-header-button\">\n\t<i class=\"elementor-icon ".concat(arrowIconClass, " tooltip-target\" aria-hidden=\"true\" data-tooltip=\"{{ Back }}\"></i>\n\t<span class=\"elementor-screen-only\">{{ Back }}</span>\n</div>\n"); |
| 25567 |
exports.buttonBack = buttonBack; |
| 25568 |
var buttonClose = "\n<div id=\"elementor-panel-header-kit-close\" class=\"elementor-header-button\">\n\t<i class=\"elementor-icon eicon-close tooltip-target\" aria-hidden=\"true\" data-tooltip=\"{{ Close }}\"></i>\n\t<span class=\"elementor-screen-only\">{{ Close }}</span>\n</div>\n"; |
| 25569 |
exports.buttonClose = buttonClose; |
| 25570 |
|
| 25571 |
/***/ }), |
| 25572 |
/* 511 */ |
| 25573 |
/***/ (function(module, exports, __webpack_require__) { |
| 25574 |
|
| 25575 |
"use strict"; |
| 25576 |
|
| 25577 |
|
| 25578 |
var _interopRequireDefault = __webpack_require__(0); |
| 25579 |
|
| 25580 |
var _Object$defineProperty = __webpack_require__(1); |
| 25581 |
|
| 25582 |
_Object$defineProperty(exports, "__esModule", { |
| 25583 |
value: true |
| 25584 |
}); |
| 25585 |
|
| 25586 |
exports.default = void 0; |
| 25587 |
|
| 25588 |
var _classCallCheck2 = _interopRequireDefault(__webpack_require__(2)); |
| 25589 |
|
| 25590 |
var _createClass2 = _interopRequireDefault(__webpack_require__(3)); |
| 25591 |
|
| 25592 |
var _get2 = _interopRequireDefault(__webpack_require__(26)); |
| 25593 |
|
| 25594 |
var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(16)); |
| 25595 |
|
| 25596 |
var _inherits2 = _interopRequireDefault(__webpack_require__(4)); |
| 25597 |
|
| 25598 |
var _createSuper2 = _interopRequireDefault(__webpack_require__(5)); |
| 25599 |
|
| 25600 |
var _repeater = _interopRequireDefault(__webpack_require__(367)); |
| 25601 |
|
| 25602 |
var _repeaterRow = _interopRequireDefault(__webpack_require__(512)); |
| 25603 |
|
| 25604 |
var _default = /*#__PURE__*/function (_Repeater) { |
| 25605 |
(0, _inherits2.default)(_default, _Repeater); |
| 25606 |
|
| 25607 |
var _super = (0, _createSuper2.default)(_default); |
| 25608 |
|
| 25609 |
function _default() { |
| 25610 |
var _this; |
| 25611 |
|
| 25612 |
(0, _classCallCheck2.default)(this, _default); |
| 25613 |
|
| 25614 |
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { |
| 25615 |
args[_key] = arguments[_key]; |
| 25616 |
} |
| 25617 |
|
| 25618 |
_this = _super.call.apply(_super, [this].concat(args)); |
| 25619 |
_this.childView = _repeaterRow.default; |
| 25620 |
return _this; |
| 25621 |
} |
| 25622 |
|
| 25623 |
(0, _createClass2.default)(_default, [{ |
| 25624 |
key: "templateHelpers", |
| 25625 |
value: function templateHelpers() { |
| 25626 |
var templateHelpers = (0, _get2.default)((0, _getPrototypeOf2.default)(_default.prototype), "templateHelpers", this).call(this); |
| 25627 |
templateHelpers.addButtonText = elementor.translate('custom_colors' === this.model.get('name') ? 'add_color' : 'add_style'); |
| 25628 |
return templateHelpers; |
| 25629 |
} |
| 25630 |
}, { |
| 25631 |
key: "getDefaults", |
| 25632 |
value: function getDefaults() { |
| 25633 |
var defaults = (0, _get2.default)((0, _getPrototypeOf2.default)(_default.prototype), "getDefaults", this).call(this); |
| 25634 |
defaults.title = "".concat(elementor.translate('new_item'), " #").concat(this.children.length + 1); |
| 25635 |
return defaults; |
| 25636 |
} |
| 25637 |
}]); |
| 25638 |
return _default; |
| 25639 |
}(_repeater.default); |
| 25640 |
|
| 25641 |
exports.default = _default; |
| 25642 |
|
| 25643 |
/***/ }), |
| 25644 |
/* 512 */ |
| 25645 |
/***/ (function(module, exports, __webpack_require__) { |
| 25646 |
|
| 25647 |
"use strict"; |
| 25648 |
|
| 25649 |
|
| 25650 |
var _interopRequireDefault = __webpack_require__(0); |
| 25651 |
|
| 25652 |
var _Object$defineProperty = __webpack_require__(1); |
| 25653 |
|
| 25654 |
_Object$defineProperty(exports, "__esModule", { |
| 25655 |
value: true |
| 25656 |
}); |
| 25657 |
|
| 25658 |
exports.default = void 0; |
| 25659 |
|
| 25660 |
__webpack_require__(25); |
| 25661 |
|
| 25662 |
var _classCallCheck2 = _interopRequireDefault(__webpack_require__(2)); |
| 25663 |
|
| 25664 |
var _createClass2 = _interopRequireDefault(__webpack_require__(3)); |
| 25665 |
|
| 25666 |
var _inherits2 = _interopRequireDefault(__webpack_require__(4)); |
| 25667 |
|
| 25668 |
var _createSuper2 = _interopRequireDefault(__webpack_require__(5)); |
| 25669 |
|
| 25670 |
var _repeaterRow = _interopRequireDefault(__webpack_require__(328)); |
| 25671 |
|
| 25672 |
var _default = /*#__PURE__*/function (_RepeaterRow) { |
| 25673 |
(0, _inherits2.default)(_default, _RepeaterRow); |
| 25674 |
|
| 25675 |
var _super = (0, _createSuper2.default)(_default); |
| 25676 |
|
| 25677 |
function _default() { |
| 25678 |
(0, _classCallCheck2.default)(this, _default); |
| 25679 |
return _super.apply(this, arguments); |
| 25680 |
} |
| 25681 |
|
| 25682 |
(0, _createClass2.default)(_default, [{ |
| 25683 |
key: "getTemplate", |
| 25684 |
value: function getTemplate() { |
| 25685 |
return '#tmpl-elementor-global-style-repeater-row'; |
| 25686 |
} |
| 25687 |
}, { |
| 25688 |
key: "events", |
| 25689 |
value: function events() { |
| 25690 |
return { |
| 25691 |
'click @ui.removeButton': 'onRemoveButtonClick' |
| 25692 |
}; |
| 25693 |
} |
| 25694 |
}, { |
| 25695 |
key: "updateColorValue", |
| 25696 |
value: function updateColorValue() { |
| 25697 |
this.$colorValue.text(this.model.get('color')); |
| 25698 |
} |
| 25699 |
}, { |
| 25700 |
key: "getDisabledRemoveButtons", |
| 25701 |
value: function getDisabledRemoveButtons() { |
| 25702 |
if (!this.ui.disabledRemoveButtons) { |
| 25703 |
this.ui.disabledRemoveButtons = this.$el.find('.elementor-repeater-tool-remove--disabled'); |
| 25704 |
} |
| 25705 |
|
| 25706 |
return this.ui.disabledRemoveButtons; |
| 25707 |
} |
| 25708 |
}, { |
| 25709 |
key: "getRemoveButton", |
| 25710 |
value: function getRemoveButton() { |
| 25711 |
return this.ui.removeButton.add(this.getDisabledRemoveButtons()); |
| 25712 |
} |
| 25713 |
}, { |
| 25714 |
key: "triggers", |
| 25715 |
value: function triggers() { |
| 25716 |
return {}; |
| 25717 |
} |
| 25718 |
}, { |
| 25719 |
key: "onChildviewRender", |
| 25720 |
value: function onChildviewRender(childView) { |
| 25721 |
var isColor = 'color' === childView.model.get('type'), |
| 25722 |
isPopoverToggle = 'popover_toggle' === childView.model.get('type'); |
| 25723 |
var globalType = ''; |
| 25724 |
|
| 25725 |
if (isColor) { |
| 25726 |
this.$colorValue = jQuery('<div>', { |
| 25727 |
class: 'e-global-colors__color-value' |
| 25728 |
}); |
| 25729 |
childView.$el.find('.elementor-control-input-wrapper').prepend(this.getRemoveButton(), this.$colorValue); |
| 25730 |
globalType = 'color'; |
| 25731 |
this.updateColorValue(); |
| 25732 |
} |
| 25733 |
|
| 25734 |
if (isPopoverToggle) { |
| 25735 |
childView.$el.find('.elementor-control-input-wrapper').append(this.getRemoveButton()); |
| 25736 |
globalType = 'font'; |
| 25737 |
} |
| 25738 |
|
| 25739 |
if (isColor || isPopoverToggle) { |
| 25740 |
var removeButtons = this.getDisabledRemoveButtons(); |
| 25741 |
this.ui.removeButton.data('e-global-type', globalType); |
| 25742 |
this.ui.removeButton.tipsy({ |
| 25743 |
title: function title() { |
| 25744 |
return elementor.translate('delete_global_' + globalType); |
| 25745 |
}, |
| 25746 |
gravity: function gravity() { |
| 25747 |
return 's'; |
| 25748 |
} |
| 25749 |
}); |
| 25750 |
removeButtons.tipsy({ |
| 25751 |
title: function title() { |
| 25752 |
return elementor.translate(globalType + '_cannot_be_deleted'); |
| 25753 |
}, |
| 25754 |
gravity: function gravity() { |
| 25755 |
return 's'; |
| 25756 |
} |
| 25757 |
}); |
| 25758 |
} |
| 25759 |
} |
| 25760 |
}, { |
| 25761 |
key: "onModelChange", |
| 25762 |
value: function onModelChange(model) { |
| 25763 |
if (undefined !== model.changed.color) { |
| 25764 |
this.updateColorValue(); |
| 25765 |
} |
| 25766 |
} |
| 25767 |
}, { |
| 25768 |
key: "onRemoveButtonClick", |
| 25769 |
value: function onRemoveButtonClick() { |
| 25770 |
var _this = this; |
| 25771 |
|
| 25772 |
var globalType = this.ui.removeButton.data('e-global-type'); |
| 25773 |
this.confirmDeleteModal = elementorCommon.dialogsManager.createWidget('confirm', { |
| 25774 |
className: 'e-global__confirm-delete', |
| 25775 |
headerMessage: elementor.translate('delete_global_' + globalType), |
| 25776 |
message: '<i class="eicon-info-circle"></i> ' + elementor.translate('delete_global_' + globalType + '_info'), |
| 25777 |
strings: { |
| 25778 |
confirm: elementor.translate('delete'), |
| 25779 |
cancel: elementor.translate('cancel') |
| 25780 |
}, |
| 25781 |
hide: { |
| 25782 |
onBackgroundClick: false |
| 25783 |
}, |
| 25784 |
onConfirm: function onConfirm() { |
| 25785 |
_this.trigger('click:remove'); |
| 25786 |
} |
| 25787 |
}); |
| 25788 |
this.confirmDeleteModal.show(); |
| 25789 |
} |
| 25790 |
}]); |
| 25791 |
return _default; |
| 25792 |
}(_repeaterRow.default); |
| 25793 |
|
| 25794 |
exports.default = _default; |
| 25795 |
|
| 25796 |
/***/ }), |
| 25797 |
/* 513 */ |
| 25798 |
/***/ (function(module, exports, __webpack_require__) { |
| 25799 |
|
| 25800 |
"use strict"; |
| 25801 |
|
| 25802 |
|
| 25803 |
var _interopRequireDefault = __webpack_require__(0); |
| 25804 |
|
| 25805 |
var _Object$defineProperty = __webpack_require__(1); |
| 25806 |
|
| 25807 |
_Object$defineProperty(exports, "__esModule", { |
| 25808 |
value: true |
| 25809 |
}); |
| 25810 |
|
| 25811 |
exports.default = void 0; |
| 25812 |
|
| 25813 |
var _defineProperty2 = _interopRequireDefault(__webpack_require__(28)); |
| 25814 |
|
| 25815 |
var _values = _interopRequireDefault(__webpack_require__(55)); |
| 25816 |
|
| 25817 |
__webpack_require__(25); |
| 25818 |
|
| 25819 |
var _classCallCheck2 = _interopRequireDefault(__webpack_require__(2)); |
| 25820 |
|
| 25821 |
var _createClass2 = _interopRequireDefault(__webpack_require__(3)); |
| 25822 |
|
| 25823 |
var _inherits2 = _interopRequireDefault(__webpack_require__(4)); |
| 25824 |
|
| 25825 |
var _createSuper2 = _interopRequireDefault(__webpack_require__(5)); |
| 25826 |
|
| 25827 |
var GlobalControlSelect = /*#__PURE__*/function (_Marionette$Behavior) { |
| 25828 |
(0, _inherits2.default)(GlobalControlSelect, _Marionette$Behavior); |
| 25829 |
|
| 25830 |
var _super = (0, _createSuper2.default)(GlobalControlSelect); |
| 25831 |
|
| 25832 |
function GlobalControlSelect() { |
| 25833 |
(0, _classCallCheck2.default)(this, GlobalControlSelect); |
| 25834 |
return _super.apply(this, arguments); |
| 25835 |
} |
| 25836 |
|
| 25837 |
(0, _createClass2.default)(GlobalControlSelect, [{ |
| 25838 |
key: "ui", |
| 25839 |
value: function ui() { |
| 25840 |
return { |
| 25841 |
controlContent: '.elementor-control-content' |
| 25842 |
}; |
| 25843 |
} |
| 25844 |
}, { |
| 25845 |
key: "getClassNames", |
| 25846 |
value: function getClassNames() { |
| 25847 |
return { |
| 25848 |
previewItemsContainer: 'e-global__preview-items-container', |
| 25849 |
previewItem: 'e-global__preview-item', |
| 25850 |
selectedPreviewItem: 'e-global__preview-item--selected', |
| 25851 |
manageButton: 'e-global__manage-button', |
| 25852 |
popover: 'e-global__popover', |
| 25853 |
popoverToggle: 'e-global__popover-toggle', |
| 25854 |
popoverToggleActive: 'e-global__popover-toggle--active', |
| 25855 |
controlGlobal: 'e-control-global', |
| 25856 |
globalPopoverContainer: 'e-global__popover-container', |
| 25857 |
globalPopoverTitle: 'e-global__popover-title', |
| 25858 |
globalPopoverTitleText: 'e-global__popover-title-text', |
| 25859 |
globalPopoverInfo: 'e-global__popover-info', |
| 25860 |
globalPopoverInfoTooltip: 'e-global__popover-info-tooltip', |
| 25861 |
confirmAddNewGlobal: 'e-global__confirm-add', |
| 25862 |
confirmMessageText: '.e-global__confirm-message-text' |
| 25863 |
}; |
| 25864 |
} // This method exists because the UI elements are printed after controls are already rendered. |
| 25865 |
|
| 25866 |
}, { |
| 25867 |
key: "registerUiElements", |
| 25868 |
value: function registerUiElements() { |
| 25869 |
var popoverWidget = this.popover.getElements('widget'), |
| 25870 |
classes = this.getClassNames(); |
| 25871 |
this.ui.globalPreviewsContainer = popoverWidget.find(".".concat(classes.previewItemsContainer)); |
| 25872 |
this.ui.globalPreviewItems = popoverWidget.find(".".concat(classes.previewItem)); |
| 25873 |
this.ui.manageGlobalsButton = popoverWidget.find(".".concat(classes.manageButton)); |
| 25874 |
} // This method exists because the UI elements are printed after controls are already rendered. |
| 25875 |
|
| 25876 |
}, { |
| 25877 |
key: "registerEvents", |
| 25878 |
value: function registerEvents() { |
| 25879 |
var _this = this; |
| 25880 |
|
| 25881 |
var classes = this.getClassNames(); |
| 25882 |
this.ui.globalPreviewsContainer.on('click', ".".concat(classes.previewItem), function (event) { |
| 25883 |
return _this.applySavedGlobalValue(event.currentTarget.dataset.globalId); |
| 25884 |
}); |
| 25885 |
this.ui.globalPopoverToggle.on('click', function (event) { |
| 25886 |
return _this.toggleGlobalPopover(event); |
| 25887 |
}); |
| 25888 |
this.ui.manageGlobalsButton.on('click', function () { |
| 25889 |
var _this$view$getGlobalM = _this.view.getGlobalMeta(), |
| 25890 |
route = _this$view$getGlobalM.route, |
| 25891 |
args = { |
| 25892 |
route: $e.routes.getHistory('panel').reverse()[0].route, |
| 25893 |
container: _this.view.options.container |
| 25894 |
}; |
| 25895 |
|
| 25896 |
$e.run('panel/global/open', args).then(function () { |
| 25897 |
return $e.route(route); |
| 25898 |
}); |
| 25899 |
|
| 25900 |
_this.popover.hide(); |
| 25901 |
}); |
| 25902 |
} |
| 25903 |
}, { |
| 25904 |
key: "fetchGlobalValue", |
| 25905 |
value: function fetchGlobalValue() { |
| 25906 |
var _this2 = this; |
| 25907 |
|
| 25908 |
return $e.data.get(this.view.getGlobalKey()).then(function (globalData) { |
| 25909 |
_this2.view.globalValue = globalData.data.value; |
| 25910 |
|
| 25911 |
_this2.onValueTypeChange(); |
| 25912 |
|
| 25913 |
elementor.kitManager.renderGlobalVariables(); |
| 25914 |
|
| 25915 |
_this2.view.applySavedValue(); |
| 25916 |
|
| 25917 |
return globalData.data; |
| 25918 |
}); |
| 25919 |
} |
| 25920 |
}, { |
| 25921 |
key: "setCurrentActivePreviewItem", |
| 25922 |
value: function setCurrentActivePreviewItem() { |
| 25923 |
var selectedClass = this.getClassNames().selectedPreviewItem, |
| 25924 |
defaultGlobalsAreEnabled = elementor.config.globals.defaults_enabled[this.view.getGlobalMeta().controlType]; |
| 25925 |
|
| 25926 |
if (this.activePreviewItem) { |
| 25927 |
this.resetActivePreviewItem(); |
| 25928 |
} // If there is an active global on the control, get it. |
| 25929 |
|
| 25930 |
|
| 25931 |
var globalKey = this.view.getGlobalKey(); // If the control has no active global and no active custom value, check if there is a default global and use it. |
| 25932 |
|
| 25933 |
if (!globalKey && !this.view.getControlValue() && defaultGlobalsAreEnabled) { |
| 25934 |
var _this$view$model$get; |
| 25935 |
|
| 25936 |
globalKey = (_this$view$model$get = this.view.model.get('global')) === null || _this$view$model$get === void 0 ? void 0 : _this$view$model$get.default; |
| 25937 |
} |
| 25938 |
|
| 25939 |
if (!globalKey) { |
| 25940 |
// If there is no active global or global default, reset the active preview item. |
| 25941 |
this.activePreviewItem = null; |
| 25942 |
return; |
| 25943 |
} // Extract the Global's ID from the Global key |
| 25944 |
|
| 25945 |
|
| 25946 |
var _$e$data$commandExtra = $e.data.commandExtractArgs(globalKey), |
| 25947 |
args = _$e$data$commandExtra.args, |
| 25948 |
globalId = args.query.id; // Get the active global's corresponding preview item in the Global Select Popover |
| 25949 |
|
| 25950 |
|
| 25951 |
var $item = this.ui.globalPreviewItems.filter("[data-global-id=\"".concat(globalId, "\"]")); |
| 25952 |
|
| 25953 |
if (!$item) { |
| 25954 |
return; |
| 25955 |
} |
| 25956 |
|
| 25957 |
this.activePreviewItem = $item; |
| 25958 |
this.activePreviewItem.addClass(selectedClass); |
| 25959 |
} |
| 25960 |
}, { |
| 25961 |
key: "resetActivePreviewItem", |
| 25962 |
value: function resetActivePreviewItem() { |
| 25963 |
if (this.activePreviewItem) { |
| 25964 |
this.activePreviewItem.removeClass(this.getClassNames().selectedPreviewItem); |
| 25965 |
} |
| 25966 |
|
| 25967 |
this.activePreviewItem = null; |
| 25968 |
} |
| 25969 |
}, { |
| 25970 |
key: "applySavedGlobalValue", |
| 25971 |
value: function applySavedGlobalValue(globalId) { |
| 25972 |
this.setGlobalValue(globalId); |
| 25973 |
this.fetchGlobalValue(); |
| 25974 |
this.popover.hide(); |
| 25975 |
} // Update the behavior's components. |
| 25976 |
|
| 25977 |
}, { |
| 25978 |
key: "onValueTypeChange", |
| 25979 |
value: function onValueTypeChange() { |
| 25980 |
this.updateCurrentGlobalName(); |
| 25981 |
} |
| 25982 |
}, { |
| 25983 |
key: "updateCurrentGlobalName", |
| 25984 |
value: function updateCurrentGlobalName(value) { |
| 25985 |
var _this3 = this; |
| 25986 |
|
| 25987 |
var classes = this.getClassNames(); |
| 25988 |
var globalTooltipText = ''; |
| 25989 |
|
| 25990 |
if (value) { |
| 25991 |
globalTooltipText = value; |
| 25992 |
} else { |
| 25993 |
value = this.view.getControlValue(); |
| 25994 |
var globalValue = this.view.getGlobalKey(); |
| 25995 |
|
| 25996 |
if (!globalValue && !value && elementor.config.globals.defaults_enabled[this.view.getGlobalMeta().controlType]) { |
| 25997 |
var _this$view$model$get2; |
| 25998 |
|
| 25999 |
globalValue = (_this$view$model$get2 = this.view.model.get('global')) === null || _this$view$model$get2 === void 0 ? void 0 : _this$view$model$get2.default; |
| 26000 |
} |
| 26001 |
|
| 26002 |
if (globalValue) { |
| 26003 |
// If there is a global value saved, get the global's name and display it. |
| 26004 |
$e.data.get(globalValue).then(function (result) { |
| 26005 |
var text = ''; |
| 26006 |
|
| 26007 |
if (result.data.title) { |
| 26008 |
text = result.data.title; |
| 26009 |
} else { |
| 26010 |
text = elementor.translate('default'); |
| 26011 |
} |
| 26012 |
|
| 26013 |
_this3.updateCurrentGlobalName(text); |
| 26014 |
}); |
| 26015 |
this.ui.globalPopoverToggle.addClass(classes.popoverToggleActive); |
| 26016 |
return; |
| 26017 |
} else if (value) { |
| 26018 |
// If there is a value and it is not a global, set the text to custom. |
| 26019 |
globalTooltipText = elementor.translate('custom'); |
| 26020 |
} else { |
| 26021 |
// If there is no value, set the text as default. |
| 26022 |
globalTooltipText = elementor.translate('default'); |
| 26023 |
} // If there is no value, remove the 'active' class from the Global Toggle button. |
| 26024 |
|
| 26025 |
|
| 26026 |
this.ui.globalPopoverToggle.removeClass(classes.popoverToggleActive); |
| 26027 |
} // This is used in the Global Toggle Button's tooltip. |
| 26028 |
|
| 26029 |
|
| 26030 |
this.globalName = globalTooltipText; |
| 26031 |
} // The Global Control elements are initialized onRender and not with initialize() because their position depends |
| 26032 |
// on elements that are not yet rendered when initialize() is called. |
| 26033 |
|
| 26034 |
}, { |
| 26035 |
key: "onRender", |
| 26036 |
value: function onRender() { |
| 26037 |
var _this4 = this; |
| 26038 |
|
| 26039 |
this.printGlobalToggleButton(); |
| 26040 |
this.initGlobalPopover(); |
| 26041 |
|
| 26042 |
if (this.view.getGlobalKey()) { |
| 26043 |
// This setTimeout is here to overcome an issue with a requestAnimationFrame that runs in the Pickr library. |
| 26044 |
setTimeout(function () { |
| 26045 |
return _this4.fetchGlobalValue(); |
| 26046 |
}, 50); |
| 26047 |
} else { |
| 26048 |
this.onValueTypeChange(); |
| 26049 |
} |
| 26050 |
|
| 26051 |
this.$el.addClass(this.getClassNames().controlGlobal); |
| 26052 |
} |
| 26053 |
}, { |
| 26054 |
key: "toggleGlobalPopover", |
| 26055 |
value: function toggleGlobalPopover() { |
| 26056 |
if (this.popover.isVisible()) { |
| 26057 |
this.popover.hide(); |
| 26058 |
} else { |
| 26059 |
this.popover.show(); |
| 26060 |
this.setCurrentActivePreviewItem(); |
| 26061 |
} |
| 26062 |
} |
| 26063 |
}, { |
| 26064 |
key: "buildGlobalPopover", |
| 26065 |
value: function buildGlobalPopover() { |
| 26066 |
var _this5 = this; |
| 26067 |
|
| 26068 |
var classes = this.getClassNames(), |
| 26069 |
$popover = jQuery('<div>', { |
| 26070 |
class: classes.globalPopoverContainer |
| 26071 |
}), |
| 26072 |
$popoverTitle = jQuery('<div>', { |
| 26073 |
class: classes.globalPopoverTitle |
| 26074 |
}).html('<div class="' + classes.globalPopoverInfo + '"><i class="eicon-info-circle"></i></div><span class="' + classes.globalPopoverTitleText + '">' + this.getOption('popoverTitle') + '</span>'), |
| 26075 |
$manageGlobalsLink = jQuery('<div>', { |
| 26076 |
class: classes.manageButton |
| 26077 |
}).html('<i class="eicon-cog"></i>'); |
| 26078 |
$popoverTitle.append($manageGlobalsLink); |
| 26079 |
$popover.append($popoverTitle); |
| 26080 |
this.manageButtonTooltipText = this.getOption('manageButtonText'); |
| 26081 |
$manageGlobalsLink.tipsy({ |
| 26082 |
title: function title() { |
| 26083 |
return _this5.manageButtonTooltipText; |
| 26084 |
}, |
| 26085 |
offset: 3, |
| 26086 |
gravity: function gravity() { |
| 26087 |
return 's'; |
| 26088 |
} |
| 26089 |
}); |
| 26090 |
return $popover; |
| 26091 |
} |
| 26092 |
}, { |
| 26093 |
key: "printGlobalToggleButton", |
| 26094 |
value: function printGlobalToggleButton() { |
| 26095 |
var _this6 = this; |
| 26096 |
|
| 26097 |
var $globalToggleButton = jQuery('<div>', { |
| 26098 |
class: this.getClassNames().popoverToggle + ' elementor-control-unit-1' |
| 26099 |
}), |
| 26100 |
$globalPopoverToggleIcon = jQuery('<i>', { |
| 26101 |
class: 'eicon-globe' |
| 26102 |
}); |
| 26103 |
$globalToggleButton.append($globalPopoverToggleIcon); |
| 26104 |
this.$el.find('.elementor-control-input-wrapper').prepend($globalToggleButton); |
| 26105 |
this.ui.globalPopoverToggle = $globalToggleButton; |
| 26106 |
this.ui.globalPopoverToggleIcon = $globalPopoverToggleIcon; // Add tooltip to the Global Popover toggle button, displaying the current Global Name / 'Default' / 'Custom'. |
| 26107 |
|
| 26108 |
this.ui.globalPopoverToggleIcon.tipsy({ |
| 26109 |
title: function title() { |
| 26110 |
return _this6.globalName; |
| 26111 |
}, |
| 26112 |
offset: 7, |
| 26113 |
gravity: function gravity() { |
| 26114 |
return 's'; |
| 26115 |
} |
| 26116 |
}); |
| 26117 |
} |
| 26118 |
}, { |
| 26119 |
key: "initGlobalPopover", |
| 26120 |
value: function initGlobalPopover() { |
| 26121 |
var _this7 = this; |
| 26122 |
|
| 26123 |
this.popover = elementorCommon.dialogsManager.createWidget('simple', { |
| 26124 |
className: this.getClassNames().popover, |
| 26125 |
message: this.buildGlobalPopover(), |
| 26126 |
effects: { |
| 26127 |
show: 'show', |
| 26128 |
hide: 'hide' |
| 26129 |
}, |
| 26130 |
hide: { |
| 26131 |
onOutsideClick: false |
| 26132 |
}, |
| 26133 |
position: { |
| 26134 |
my: "center top", |
| 26135 |
at: "center bottom+5", |
| 26136 |
of: this.ui.controlContent, |
| 26137 |
autoRefresh: true |
| 26138 |
} |
| 26139 |
}); // Render the list of globals and append them to the Globals popover. |
| 26140 |
|
| 26141 |
this.view.getGlobalsList().then(function (globalsList) { |
| 26142 |
_this7.addGlobalsListToPopover(globalsList); |
| 26143 |
|
| 26144 |
_this7.registerUiElementsAndEvents(); |
| 26145 |
}); |
| 26146 |
this.createGlobalInfoTooltip(); |
| 26147 |
} |
| 26148 |
}, { |
| 26149 |
key: "addGlobalsListToPopover", |
| 26150 |
value: function addGlobalsListToPopover(globalsList) { |
| 26151 |
var $globalsList = this.view.buildGlobalsList(globalsList); |
| 26152 |
this.popover.getElements('widget').find(".".concat(this.getClassNames().globalPopoverTitle)).after($globalsList); |
| 26153 |
} |
| 26154 |
}, { |
| 26155 |
key: "registerUiElementsAndEvents", |
| 26156 |
value: function registerUiElementsAndEvents() { |
| 26157 |
// Instead of ui() |
| 26158 |
this.registerUiElements(); // Instead of events() |
| 26159 |
|
| 26160 |
this.registerEvents(); |
| 26161 |
} // This method is not called directly, but triggered by Marionette's .triggerMethod(), |
| 26162 |
// in the onAddGlobalButtonClick() method in the color and typography global controls. |
| 26163 |
|
| 26164 |
}, { |
| 26165 |
key: "onAddGlobalToList", |
| 26166 |
value: function onAddGlobalToList($confirmMessage) { |
| 26167 |
var _this8 = this; |
| 26168 |
|
| 26169 |
var classes = this.getClassNames(); |
| 26170 |
this.confirmNewGlobalModal = elementorCommon.dialogsManager.createWidget('confirm', { |
| 26171 |
className: classes.confirmAddNewGlobal, |
| 26172 |
headerMessage: this.getOption('newGlobalConfirmTitle'), |
| 26173 |
message: $confirmMessage, |
| 26174 |
strings: { |
| 26175 |
confirm: elementor.translate('create'), |
| 26176 |
cancel: elementor.translate('cancel') |
| 26177 |
}, |
| 26178 |
hide: { |
| 26179 |
onBackgroundClick: false |
| 26180 |
}, |
| 26181 |
onConfirm: function onConfirm() { |
| 26182 |
return _this8.onConfirmNewGlobal(); |
| 26183 |
}, |
| 26184 |
onShow: function onShow() { |
| 26185 |
// Put focus on the naming input. |
| 26186 |
var modalWidget = _this8.confirmNewGlobalModal.getElements('widget'); |
| 26187 |
|
| 26188 |
_this8.ui.globalNameInput = modalWidget.find('input').focus(); |
| 26189 |
_this8.ui.confirmMessageText = modalWidget.find(classes.confirmMessageText); |
| 26190 |
|
| 26191 |
_this8.ui.globalNameInput.on('input', function () { |
| 26192 |
return _this8.onAddGlobalConfirmInputChange(); |
| 26193 |
}); |
| 26194 |
} |
| 26195 |
}); |
| 26196 |
this.confirmNewGlobalModal.show(); |
| 26197 |
} |
| 26198 |
}, { |
| 26199 |
key: "onAddGlobalConfirmInputChange", |
| 26200 |
value: function onAddGlobalConfirmInputChange() { |
| 26201 |
if (!this.view.globalsList) { |
| 26202 |
return; |
| 26203 |
} |
| 26204 |
|
| 26205 |
var messageContent; |
| 26206 |
|
| 26207 |
for (var _i = 0, _Object$values = (0, _values.default)(this.view.globalsList); _i < _Object$values.length; _i++) { |
| 26208 |
var globalValue = _Object$values[_i]; |
| 26209 |
|
| 26210 |
if (this.ui.globalNameInput.val() === globalValue.title) { |
| 26211 |
messageContent = this.view.getNameAlreadyExistsMessage(); |
| 26212 |
break; |
| 26213 |
} else { |
| 26214 |
messageContent = this.view.getConfirmTextMessage(); |
| 26215 |
} |
| 26216 |
} |
| 26217 |
|
| 26218 |
this.ui.confirmMessageText.html(messageContent); |
| 26219 |
} |
| 26220 |
}, { |
| 26221 |
key: "onConfirmNewGlobal", |
| 26222 |
value: function onConfirmNewGlobal() { |
| 26223 |
var _this9 = this; |
| 26224 |
|
| 26225 |
var globalMeta = this.view.getGlobalMeta(); |
| 26226 |
globalMeta.title = this.ui.globalNameInput.val(); |
| 26227 |
this.createNewGlobal(globalMeta).then(function (result) { |
| 26228 |
var $globalPreview = _this9.view.createGlobalItemMarkup(result.data); |
| 26229 |
|
| 26230 |
_this9.ui.globalPreviewsContainer.append($globalPreview); |
| 26231 |
}); |
| 26232 |
} |
| 26233 |
}, { |
| 26234 |
key: "createNewGlobal", |
| 26235 |
value: function createNewGlobal(globalMeta) { |
| 26236 |
var _this10 = this; |
| 26237 |
|
| 26238 |
return $e.run(globalMeta.commandName + '/create', { |
| 26239 |
container: this.view.container, |
| 26240 |
setting: globalMeta.key, |
| 26241 |
// group control name |
| 26242 |
title: globalMeta.title |
| 26243 |
}).then(function (result) { |
| 26244 |
_this10.applySavedGlobalValue(result.data.id); |
| 26245 |
|
| 26246 |
return result; |
| 26247 |
}); |
| 26248 |
} |
| 26249 |
}, { |
| 26250 |
key: "setGlobalValue", |
| 26251 |
value: function setGlobalValue(globalId) { |
| 26252 |
var command = ''; |
| 26253 |
var settings = {}; |
| 26254 |
|
| 26255 |
if (this.view.getGlobalKey()) { |
| 26256 |
// If a global setting is already active, switch them without disabling globals. |
| 26257 |
command = 'document/globals/settings'; |
| 26258 |
} else { |
| 26259 |
// If the active setting is NOT a global, enable globals and apply the selected global. |
| 26260 |
command = 'document/globals/enable'; |
| 26261 |
} // colors / typography |
| 26262 |
|
| 26263 |
|
| 26264 |
settings[this.view.model.get('name')] = this.view.getGlobalCommand() + '?id=' + globalId; // Trigger async render. |
| 26265 |
|
| 26266 |
$e.run(command, { |
| 26267 |
container: this.view.options.container, |
| 26268 |
settings: settings |
| 26269 |
}); |
| 26270 |
} // The unset method is triggered from the controls via triggerMethod. |
| 26271 |
|
| 26272 |
}, { |
| 26273 |
key: "onUnsetGlobalValue", |
| 26274 |
value: function onUnsetGlobalValue() { |
| 26275 |
var _this11 = this; |
| 26276 |
|
| 26277 |
var globalMeta = this.view.getGlobalMeta(); |
| 26278 |
$e.run('document/globals/disable', { |
| 26279 |
container: this.view.container, |
| 26280 |
settings: (0, _defineProperty2.default)({}, globalMeta.key, ''), |
| 26281 |
options: { |
| 26282 |
restore: true |
| 26283 |
} |
| 26284 |
}).then(function () { |
| 26285 |
_this11.onValueTypeChange(); |
| 26286 |
|
| 26287 |
_this11.view.globalValue = null; |
| 26288 |
|
| 26289 |
_this11.resetActivePreviewItem(); |
| 26290 |
}); |
| 26291 |
} |
| 26292 |
}, { |
| 26293 |
key: "onUnlinkGlobalDefault", |
| 26294 |
value: function onUnlinkGlobalDefault() { |
| 26295 |
var _this12 = this; |
| 26296 |
|
| 26297 |
var globalMeta = this.view.getGlobalMeta(); |
| 26298 |
$e.run('document/globals/unlink', { |
| 26299 |
container: this.view.container, |
| 26300 |
globalValue: this.view.model.get('global').default, |
| 26301 |
setting: globalMeta.key, |
| 26302 |
options: { |
| 26303 |
external: true |
| 26304 |
} |
| 26305 |
}).then(function () { |
| 26306 |
_this12.onValueTypeChange(); |
| 26307 |
|
| 26308 |
_this12.view.globalValue = null; |
| 26309 |
|
| 26310 |
_this12.resetActivePreviewItem(); |
| 26311 |
}); |
| 26312 |
} |
| 26313 |
}, { |
| 26314 |
key: "createGlobalInfoTooltip", |
| 26315 |
value: function createGlobalInfoTooltip() { |
| 26316 |
var _this13 = this; |
| 26317 |
|
| 26318 |
var classes = this.getClassNames(), |
| 26319 |
$infoIcon = this.popover.getElements('widget').find(".".concat(classes.globalPopoverInfo)); |
| 26320 |
this.globalInfoTooltip = elementorCommon.dialogsManager.createWidget('simple', { |
| 26321 |
className: classes.globalPopoverInfoTooltip, |
| 26322 |
message: this.getOption('tooltipText'), |
| 26323 |
effects: { |
| 26324 |
show: 'show', |
| 26325 |
hide: 'hide' |
| 26326 |
}, |
| 26327 |
position: { |
| 26328 |
my: "left bottom", |
| 26329 |
at: "left top+9", |
| 26330 |
of: this.popover.getElements('widget'), |
| 26331 |
autoRefresh: true |
| 26332 |
} |
| 26333 |
}); |
| 26334 |
$infoIcon.on({ |
| 26335 |
mouseenter: function mouseenter() { |
| 26336 |
return _this13.globalInfoTooltip.show(); |
| 26337 |
}, |
| 26338 |
mouseleave: function mouseleave() { |
| 26339 |
return _this13.globalInfoTooltip.hide(); |
| 26340 |
} |
| 26341 |
}); |
| 26342 |
} |
| 26343 |
}]); |
| 26344 |
return GlobalControlSelect; |
| 26345 |
}(Marionette.Behavior); |
| 26346 |
|
| 26347 |
exports.default = GlobalControlSelect; |
| 26348 |
|
| 26349 |
/***/ }), |
| 26350 |
/* 514 */ |
| 26351 |
/***/ (function(module, exports, __webpack_require__) { |
| 26352 |
|
| 26353 |
"use strict"; |
| 26354 |
|
| 26355 |
|
| 26356 |
var _interopRequireDefault = __webpack_require__(0); |
| 26357 |
|
| 26358 |
var _Object$defineProperty = __webpack_require__(1); |
| 26359 |
|
| 26360 |
_Object$defineProperty(exports, "__esModule", { |
| 26361 |
value: true |
| 26362 |
}); |
| 26363 |
|
| 26364 |
exports.default = void 0; |
| 26365 |
|
| 26366 |
var _classCallCheck2 = _interopRequireDefault(__webpack_require__(2)); |
| 26367 |
|
| 26368 |
var _createClass2 = _interopRequireDefault(__webpack_require__(3)); |
| 26369 |
|
| 26370 |
var _assertThisInitialized2 = _interopRequireDefault(__webpack_require__(49)); |
| 26371 |
|
| 26372 |
var _inherits2 = _interopRequireDefault(__webpack_require__(4)); |
| 26373 |
|
| 26374 |
var _createSuper2 = _interopRequireDefault(__webpack_require__(5)); |
| 26375 |
|
| 26376 |
var _component = _interopRequireDefault(__webpack_require__(515)); |
| 26377 |
|
| 26378 |
var _layout = _interopRequireDefault(__webpack_require__(520)); |
| 26379 |
|
| 26380 |
var BaseRegion = __webpack_require__(371); |
| 26381 |
|
| 26382 |
var _default = /*#__PURE__*/function (_BaseRegion) { |
| 26383 |
(0, _inherits2.default)(_default, _BaseRegion); |
| 26384 |
|
| 26385 |
var _super = (0, _createSuper2.default)(_default); |
| 26386 |
|
| 26387 |
function _default(options) { |
| 26388 |
var _this; |
| 26389 |
|
| 26390 |
(0, _classCallCheck2.default)(this, _default); |
| 26391 |
_this = _super.call(this, options); |
| 26392 |
_this.component = $e.components.register(new _component.default({ |
| 26393 |
manager: (0, _assertThisInitialized2.default)(_this) |
| 26394 |
})); |
| 26395 |
_this.isDocked = false; |
| 26396 |
_this.indicators = { |
| 26397 |
customPosition: { |
| 26398 |
title: elementor.translate('custom_positioning'), |
| 26399 |
icon: 'cursor-move', |
| 26400 |
settingKeys: ['_position', '_element_width'], |
| 26401 |
section: '_section_position' |
| 26402 |
} |
| 26403 |
}; |
| 26404 |
_this.ensurePosition = _this.ensurePosition.bind((0, _assertThisInitialized2.default)(_this)); |
| 26405 |
|
| 26406 |
_this.listenTo(elementor.channels.dataEditMode, 'switch', _this.onEditModeSwitched); // TODO: Move to hook on 'editor/documents/load'. |
| 26407 |
|
| 26408 |
|
| 26409 |
elementor.on('document:loaded', _this.onDocumentLoaded.bind((0, _assertThisInitialized2.default)(_this))); |
| 26410 |
elementor.on('document:unloaded', _this.onDocumentUnloaded.bind((0, _assertThisInitialized2.default)(_this))); |
| 26411 |
return _this; |
| 26412 |
} |
| 26413 |
|
| 26414 |
(0, _createClass2.default)(_default, [{ |
| 26415 |
key: "getStorageKey", |
| 26416 |
value: function getStorageKey() { |
| 26417 |
return 'navigator'; |
| 26418 |
} |
| 26419 |
}, { |
| 26420 |
key: "getDefaultStorage", |
| 26421 |
value: function getDefaultStorage() { |
| 26422 |
return { |
| 26423 |
visible: false, |
| 26424 |
size: { |
| 26425 |
width: '', |
| 26426 |
height: '', |
| 26427 |
top: '', |
| 26428 |
bottom: '', |
| 26429 |
right: '', |
| 26430 |
left: '' |
| 26431 |
} |
| 26432 |
}; |
| 26433 |
} |
| 26434 |
}, { |
| 26435 |
key: "getLayout", |
| 26436 |
value: function getLayout() { |
| 26437 |
return this.currentView; |
| 26438 |
} |
| 26439 |
}, { |
| 26440 |
key: "getDraggableOptions", |
| 26441 |
value: function getDraggableOptions() { |
| 26442 |
return { |
| 26443 |
iframeFix: true, |
| 26444 |
handle: '#elementor-navigator__header', |
| 26445 |
drag: this.onDrag.bind(this), |
| 26446 |
stop: this.onDragStop.bind(this) |
| 26447 |
}; |
| 26448 |
} |
| 26449 |
}, { |
| 26450 |
key: "getResizableOptions", |
| 26451 |
value: function getResizableOptions() { |
| 26452 |
var _this2 = this; |
| 26453 |
|
| 26454 |
return { |
| 26455 |
handles: 'all', |
| 26456 |
containment: 'document', |
| 26457 |
minWidth: 150, |
| 26458 |
maxWidth: 500, |
| 26459 |
minHeight: 240, |
| 26460 |
start: function start() { |
| 26461 |
elementor.$previewWrapper.addClass('ui-resizable-resizing'); |
| 26462 |
}, |
| 26463 |
stop: function stop() { |
| 26464 |
elementor.$previewWrapper.removeClass('ui-resizable-resizing'); |
| 26465 |
|
| 26466 |
if (_this2.isDocked) { |
| 26467 |
_this2.storage.size.width = elementor.helpers.getElementInlineStyle(_this2.$el, ['width']).width; |
| 26468 |
elementorCommon.storage.set('navigator', _this2.storage); |
| 26469 |
} else { |
| 26470 |
_this2.saveSize(); |
| 26471 |
} |
| 26472 |
} |
| 26473 |
}; |
| 26474 |
} |
| 26475 |
}, { |
| 26476 |
key: "initLayout", |
| 26477 |
value: function initLayout() { |
| 26478 |
this.show(new _layout.default()); |
| 26479 |
this.$el.draggable(this.getDraggableOptions()); |
| 26480 |
this.$el.resizable(this.getResizableOptions()); |
| 26481 |
} |
| 26482 |
}, { |
| 26483 |
key: "open", |
| 26484 |
value: function open(model) { |
| 26485 |
this.$el.show(); |
| 26486 |
|
| 26487 |
if (this.storage.docked) { |
| 26488 |
this.dock(); |
| 26489 |
this.setDockedSize(); |
| 26490 |
} else { |
| 26491 |
this.setSize(); |
| 26492 |
} |
| 26493 |
|
| 26494 |
if (model) { |
| 26495 |
model.trigger('request:edit'); |
| 26496 |
} |
| 26497 |
|
| 26498 |
this.saveStorage('visible', true); |
| 26499 |
this.ensurePosition(); |
| 26500 |
elementorCommon.elements.$window.on('resize', this.ensurePosition); |
| 26501 |
} |
| 26502 |
}, { |
| 26503 |
key: "close", |
| 26504 |
value: function close(silent) { |
| 26505 |
this.$el.hide(); |
| 26506 |
|
| 26507 |
if (this.isDocked) { |
| 26508 |
this.undock(true); |
| 26509 |
} |
| 26510 |
|
| 26511 |
if (!silent) { |
| 26512 |
this.saveStorage('visible', false); |
| 26513 |
} |
| 26514 |
|
| 26515 |
if (this.$el.resizable('instance')) { |
| 26516 |
this.$el.resizable('destroy'); |
| 26517 |
} |
| 26518 |
|
| 26519 |
elementorCommon.elements.$window.off('resize', this.ensurePosition); |
| 26520 |
} |
| 26521 |
}, { |
| 26522 |
key: "isOpen", |
| 26523 |
value: function isOpen() { |
| 26524 |
return this.$el.is(':visible'); |
| 26525 |
} |
| 26526 |
}, { |
| 26527 |
key: "dock", |
| 26528 |
value: function dock() { |
| 26529 |
elementorCommon.elements.$body.addClass('elementor-navigator-docked'); |
| 26530 |
var side = elementorCommon.config.isRTL ? 'left' : 'right', |
| 26531 |
resizableOptions = this.getResizableOptions(); |
| 26532 |
this.$el.css({ |
| 26533 |
height: '', |
| 26534 |
top: '', |
| 26535 |
bottom: '', |
| 26536 |
left: '', |
| 26537 |
right: '' |
| 26538 |
}); |
| 26539 |
elementor.$previewWrapper.css(side, this.storage.size.width); |
| 26540 |
|
| 26541 |
if (this.$el.resizable('instance')) { |
| 26542 |
this.$el.resizable('destroy'); |
| 26543 |
} |
| 26544 |
|
| 26545 |
resizableOptions.handles = elementorCommon.config.isRTL ? 'e' : 'w'; |
| 26546 |
|
| 26547 |
resizableOptions.resize = function (event, ui) { |
| 26548 |
elementor.$previewWrapper.css(side, ui.size.width); |
| 26549 |
}; |
| 26550 |
|
| 26551 |
this.$el.resizable(resizableOptions); |
| 26552 |
this.isDocked = true; |
| 26553 |
this.saveStorage('docked', true); |
| 26554 |
} |
| 26555 |
}, { |
| 26556 |
key: "undock", |
| 26557 |
value: function undock(silent) { |
| 26558 |
elementorCommon.elements.$body.removeClass('elementor-navigator-docked'); |
| 26559 |
elementor.$previewWrapper.css(elementorCommon.config.isRTL ? 'left' : 'right', ''); |
| 26560 |
this.setSize(); |
| 26561 |
|
| 26562 |
if (this.$el.resizable('instance')) { |
| 26563 |
this.$el.resizable('destroy'); |
| 26564 |
this.$el.resizable(this.getResizableOptions()); |
| 26565 |
} |
| 26566 |
|
| 26567 |
this.isDocked = false; |
| 26568 |
|
| 26569 |
if (!silent) { |
| 26570 |
this.saveStorage('docked', false); |
| 26571 |
} |
| 26572 |
} |
| 26573 |
}, { |
| 26574 |
key: "setSize", |
| 26575 |
value: function setSize() { |
| 26576 |
if (this.storage.size) { |
| 26577 |
this.$el.css(this.storage.size); |
| 26578 |
} |
| 26579 |
} |
| 26580 |
}, { |
| 26581 |
key: "setDockedSize", |
| 26582 |
value: function setDockedSize() { |
| 26583 |
this.$el.css('width', this.storage.size.width); |
| 26584 |
} |
| 26585 |
}, { |
| 26586 |
key: "ensurePosition", |
| 26587 |
value: function ensurePosition() { |
| 26588 |
if (this.isDocked) { |
| 26589 |
return; |
| 26590 |
} |
| 26591 |
|
| 26592 |
var offset = this.$el.offset(); |
| 26593 |
|
| 26594 |
if (offset.left > innerWidth) { |
| 26595 |
this.$el.css({ |
| 26596 |
left: '', |
| 26597 |
right: '' |
| 26598 |
}); |
| 26599 |
} |
| 26600 |
|
| 26601 |
if (offset.top > innerHeight) { |
| 26602 |
this.$el.css({ |
| 26603 |
top: '', |
| 26604 |
bottom: '' |
| 26605 |
}); |
| 26606 |
} |
| 26607 |
} |
| 26608 |
}, { |
| 26609 |
key: "onDrag", |
| 26610 |
value: function onDrag(event, ui) { |
| 26611 |
if (this.isDocked) { |
| 26612 |
if (ui.position.left === ui.originalPosition.left) { |
| 26613 |
if (ui.position.top !== ui.originalPosition.top) { |
| 26614 |
return false; |
| 26615 |
} |
| 26616 |
} else { |
| 26617 |
this.undock(); |
| 26618 |
} |
| 26619 |
|
| 26620 |
return; |
| 26621 |
} |
| 26622 |
|
| 26623 |
if (0 > ui.position.top) { |
| 26624 |
ui.position.top = 0; |
| 26625 |
} |
| 26626 |
|
| 26627 |
var isOutOfLeft = 0 > ui.position.left, |
| 26628 |
isOutOfRight = ui.position.left + this.el.offsetWidth > innerWidth; |
| 26629 |
|
| 26630 |
if (elementorCommon.config.isRTL) { |
| 26631 |
if (isOutOfRight) { |
| 26632 |
ui.position.left = innerWidth - this.el.offsetWidth; |
| 26633 |
} |
| 26634 |
} else if (isOutOfLeft) { |
| 26635 |
ui.position.left = 0; |
| 26636 |
} |
| 26637 |
|
| 26638 |
elementorCommon.elements.$body.toggleClass('elementor-navigator--dock-hint', elementorCommon.config.isRTL ? isOutOfLeft : isOutOfRight); |
| 26639 |
} |
| 26640 |
}, { |
| 26641 |
key: "onDragStop", |
| 26642 |
value: function onDragStop(event, ui) { |
| 26643 |
if (this.isDocked) { |
| 26644 |
return; |
| 26645 |
} |
| 26646 |
|
| 26647 |
this.saveSize(); |
| 26648 |
var elementRight = ui.position.left + this.el.offsetWidth; |
| 26649 |
|
| 26650 |
if (0 > ui.position.left || elementRight > innerWidth) { |
| 26651 |
this.dock(); |
| 26652 |
} |
| 26653 |
|
| 26654 |
elementorCommon.elements.$body.removeClass('elementor-navigator--dock-hint'); |
| 26655 |
} |
| 26656 |
}, { |
| 26657 |
key: "onEditModeSwitched", |
| 26658 |
value: function onEditModeSwitched(activeMode) { |
| 26659 |
if ('edit' === activeMode && this.storage.visible) { |
| 26660 |
this.open(); |
| 26661 |
} else { |
| 26662 |
this.close(true); |
| 26663 |
} |
| 26664 |
} |
| 26665 |
}, { |
| 26666 |
key: "onDocumentLoaded", |
| 26667 |
value: function onDocumentLoaded(document) { |
| 26668 |
if (document.config.panel.has_elements) { |
| 26669 |
this.initLayout(); |
| 26670 |
|
| 26671 |
if (this.storage.visible) { |
| 26672 |
$e.route('navigator'); |
| 26673 |
} |
| 26674 |
} |
| 26675 |
} |
| 26676 |
}, { |
| 26677 |
key: "onDocumentUnloaded", |
| 26678 |
value: function onDocumentUnloaded() { |
| 26679 |
if (this.component.isOpen) { |
| 26680 |
this.component.close(true); |
| 26681 |
} |
| 26682 |
} |
| 26683 |
}]); |
| 26684 |
return _default; |
| 26685 |
}(BaseRegion); |
| 26686 |
|
| 26687 |
exports.default = _default; |
| 26688 |
|
| 26689 |
/***/ }), |
| 26690 |
/* 515 */ |
| 26691 |
/***/ (function(module, exports, __webpack_require__) { |
| 26692 |
|
| 26693 |
"use strict"; |
| 26694 |
|
| 26695 |
|
| 26696 |
var _interopRequireWildcard = __webpack_require__(36); |
| 26697 |
|
| 26698 |
var _interopRequireDefault = __webpack_require__(0); |
| 26699 |
|
| 26700 |
var _Object$defineProperty = __webpack_require__(1); |
| 26701 |
|
| 26702 |
_Object$defineProperty(exports, "__esModule", { |
| 26703 |
value: true |
| 26704 |
}); |
| 26705 |
|
| 26706 |
exports.default = void 0; |
| 26707 |
|
| 26708 |
var _classCallCheck2 = _interopRequireDefault(__webpack_require__(2)); |
| 26709 |
|
| 26710 |
var _createClass2 = _interopRequireDefault(__webpack_require__(3)); |
| 26711 |
|
| 26712 |
var _get2 = _interopRequireDefault(__webpack_require__(26)); |
| 26713 |
|
| 26714 |
var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(16)); |
| 26715 |
|
| 26716 |
var _inherits2 = _interopRequireDefault(__webpack_require__(4)); |
| 26717 |
|
| 26718 |
var _createSuper2 = _interopRequireDefault(__webpack_require__(5)); |
| 26719 |
|
| 26720 |
var _componentBase = _interopRequireDefault(__webpack_require__(85)); |
| 26721 |
|
| 26722 |
var commands = _interopRequireWildcard(__webpack_require__(516)); |
| 26723 |
|
| 26724 |
var Component = /*#__PURE__*/function (_ComponentBase) { |
| 26725 |
(0, _inherits2.default)(Component, _ComponentBase); |
| 26726 |
|
| 26727 |
var _super = (0, _createSuper2.default)(Component); |
| 26728 |
|
| 26729 |
function Component() { |
| 26730 |
(0, _classCallCheck2.default)(this, Component); |
| 26731 |
return _super.apply(this, arguments); |
| 26732 |
} |
| 26733 |
|
| 26734 |
(0, _createClass2.default)(Component, [{ |
| 26735 |
key: "getNamespace", |
| 26736 |
value: function getNamespace() { |
| 26737 |
return 'navigator'; |
| 26738 |
} |
| 26739 |
}, { |
| 26740 |
key: "defaultRoutes", |
| 26741 |
value: function defaultRoutes() { |
| 26742 |
return { |
| 26743 |
'': function _() {} |
| 26744 |
}; |
| 26745 |
} |
| 26746 |
}, { |
| 26747 |
key: "defaultCommands", |
| 26748 |
value: function defaultCommands() { |
| 26749 |
return this.importCommands(commands); |
| 26750 |
} |
| 26751 |
}, { |
| 26752 |
key: "defaultShortcuts", |
| 26753 |
value: function defaultShortcuts() { |
| 26754 |
return { |
| 26755 |
toggle: { |
| 26756 |
keys: 'ctrl+i', |
| 26757 |
dependency: function dependency() { |
| 26758 |
return elementor.getPreviewContainer().isEditable(); |
| 26759 |
} |
| 26760 |
} |
| 26761 |
}; |
| 26762 |
} |
| 26763 |
}, { |
| 26764 |
key: "open", |
| 26765 |
value: function open(args) { |
| 26766 |
var _args$model = args.model, |
| 26767 |
model = _args$model === void 0 ? false : _args$model; |
| 26768 |
this.manager.open(model); |
| 26769 |
return true; |
| 26770 |
} |
| 26771 |
}, { |
| 26772 |
key: "close", |
| 26773 |
value: function close(silent) { |
| 26774 |
if (!(0, _get2.default)((0, _getPrototypeOf2.default)(Component.prototype), "close", this).call(this)) { |
| 26775 |
return false; |
| 26776 |
} |
| 26777 |
|
| 26778 |
this.manager.close(silent); |
| 26779 |
return true; |
| 26780 |
} |
| 26781 |
}]); |
| 26782 |
return Component; |
| 26783 |
}(_componentBase.default); |
| 26784 |
|
| 26785 |
exports.default = Component; |
| 26786 |
|
| 26787 |
/***/ }), |
| 26788 |
/* 516 */ |
| 26789 |
/***/ (function(module, exports, __webpack_require__) { |
| 26790 |
|
| 26791 |
"use strict"; |
| 26792 |
|
| 26793 |
|
| 26794 |
var _Object$defineProperty = __webpack_require__(1); |
| 26795 |
|
| 26796 |
_Object$defineProperty(exports, "__esModule", { |
| 26797 |
value: true |
| 26798 |
}); |
| 26799 |
|
| 26800 |
_Object$defineProperty(exports, "Close", { |
| 26801 |
enumerable: true, |
| 26802 |
get: function get() { |
| 26803 |
return _close.Close; |
| 26804 |
} |
| 26805 |
}); |
| 26806 |
|
| 26807 |
_Object$defineProperty(exports, "Open", { |
| 26808 |
enumerable: true, |
| 26809 |
get: function get() { |
| 26810 |
return _open.Open; |
| 26811 |
} |
| 26812 |
}); |
| 26813 |
|
| 26814 |
_Object$defineProperty(exports, "Toggle", { |
| 26815 |
enumerable: true, |
| 26816 |
get: function get() { |
| 26817 |
return _toggle.Toggle; |
| 26818 |
} |
| 26819 |
}); |
| 26820 |
|
| 26821 |
var _close = __webpack_require__(517); |
| 26822 |
|
| 26823 |
var _open = __webpack_require__(518); |
| 26824 |
|
| 26825 |
var _toggle = __webpack_require__(519); |
| 26826 |
|
| 26827 |
/***/ }), |
| 26828 |
/* 517 */ |
| 26829 |
/***/ (function(module, exports, __webpack_require__) { |
| 26830 |
|
| 26831 |
"use strict"; |
| 26832 |
|
| 26833 |
|
| 26834 |
var _interopRequireDefault = __webpack_require__(0); |
| 26835 |
|
| 26836 |
var _Object$defineProperty = __webpack_require__(1); |
| 26837 |
|
| 26838 |
_Object$defineProperty(exports, "__esModule", { |
| 26839 |
value: true |
| 26840 |
}); |
| 26841 |
|
| 26842 |
exports.default = exports.Close = void 0; |
| 26843 |
|
| 26844 |
var _classCallCheck2 = _interopRequireDefault(__webpack_require__(2)); |
| 26845 |
|
| 26846 |
var _createClass2 = _interopRequireDefault(__webpack_require__(3)); |
| 26847 |
|
| 26848 |
var _inherits2 = _interopRequireDefault(__webpack_require__(4)); |
| 26849 |
|
| 26850 |
var _createSuper2 = _interopRequireDefault(__webpack_require__(5)); |
| 26851 |
|
| 26852 |
var _commandBase = _interopRequireDefault(__webpack_require__(21)); |
| 26853 |
|
| 26854 |
var Close = /*#__PURE__*/function (_CommandBase) { |
| 26855 |
(0, _inherits2.default)(Close, _CommandBase); |
| 26856 |
|
| 26857 |
var _super = (0, _createSuper2.default)(Close); |
| 26858 |
|
| 26859 |
function Close() { |
| 26860 |
(0, _classCallCheck2.default)(this, Close); |
| 26861 |
return _super.apply(this, arguments); |
| 26862 |
} |
| 26863 |
|
| 26864 |
(0, _createClass2.default)(Close, [{ |
| 26865 |
key: "apply", |
| 26866 |
value: function apply() { |
| 26867 |
return this.component.close(); |
| 26868 |
} |
| 26869 |
}]); |
| 26870 |
return Close; |
| 26871 |
}(_commandBase.default); |
| 26872 |
|
| 26873 |
exports.Close = Close; |
| 26874 |
var _default = Close; |
| 26875 |
exports.default = _default; |
| 26876 |
|
| 26877 |
/***/ }), |
| 26878 |
/* 518 */ |
| 26879 |
/***/ (function(module, exports, __webpack_require__) { |
| 26880 |
|
| 26881 |
"use strict"; |
| 26882 |
|
| 26883 |
|
| 26884 |
var _interopRequireDefault = __webpack_require__(0); |
| 26885 |
|
| 26886 |
var _Object$defineProperty = __webpack_require__(1); |
| 26887 |
|
| 26888 |
_Object$defineProperty(exports, "__esModule", { |
| 26889 |
value: true |
| 26890 |
}); |
| 26891 |
|
| 26892 |
exports.default = exports.Open = void 0; |
| 26893 |
|
| 26894 |
var _classCallCheck2 = _interopRequireDefault(__webpack_require__(2)); |
| 26895 |
|
| 26896 |
var _createClass2 = _interopRequireDefault(__webpack_require__(3)); |
| 26897 |
|
| 26898 |
var _inherits2 = _interopRequireDefault(__webpack_require__(4)); |
| 26899 |
|
| 26900 |
var _createSuper2 = _interopRequireDefault(__webpack_require__(5)); |
| 26901 |
|
| 26902 |
var _commandBase = _interopRequireDefault(__webpack_require__(21)); |
| 26903 |
|
| 26904 |
var Open = /*#__PURE__*/function (_CommandBase) { |
| 26905 |
(0, _inherits2.default)(Open, _CommandBase); |
| 26906 |
|
| 26907 |
var _super = (0, _createSuper2.default)(Open); |
| 26908 |
|
| 26909 |
function Open() { |
| 26910 |
(0, _classCallCheck2.default)(this, Open); |
| 26911 |
return _super.apply(this, arguments); |
| 26912 |
} |
| 26913 |
|
| 26914 |
(0, _createClass2.default)(Open, [{ |
| 26915 |
key: "apply", |
| 26916 |
value: function apply() { |
| 26917 |
$e.route(this.component.getNamespace()); |
| 26918 |
} |
| 26919 |
}]); |
| 26920 |
return Open; |
| 26921 |
}(_commandBase.default); |
| 26922 |
|
| 26923 |
exports.Open = Open; |
| 26924 |
var _default = Open; |
| 26925 |
exports.default = _default; |
| 26926 |
|
| 26927 |
/***/ }), |
| 26928 |
/* 519 */ |
| 26929 |
/***/ (function(module, exports, __webpack_require__) { |
| 26930 |
|
| 26931 |
"use strict"; |
| 26932 |
|
| 26933 |
|
| 26934 |
var _interopRequireDefault = __webpack_require__(0); |
| 26935 |
|
| 26936 |
var _Object$defineProperty = __webpack_require__(1); |
| 26937 |
|
| 26938 |
_Object$defineProperty(exports, "__esModule", { |
| 26939 |
value: true |
| 26940 |
}); |
| 26941 |
|
| 26942 |
exports.default = exports.Toggle = void 0; |
| 26943 |
|
| 26944 |
var _classCallCheck2 = _interopRequireDefault(__webpack_require__(2)); |
| 26945 |
|
| 26946 |
var _createClass2 = _interopRequireDefault(__webpack_require__(3)); |
| 26947 |
|
| 26948 |
var _inherits2 = _interopRequireDefault(__webpack_require__(4)); |
| 26949 |
|
| 26950 |
var _createSuper2 = _interopRequireDefault(__webpack_require__(5)); |
| 26951 |
|
| 26952 |
var _commandBase = _interopRequireDefault(__webpack_require__(21)); |
| 26953 |
|
| 26954 |
var Toggle = /*#__PURE__*/function (_CommandBase) { |
| 26955 |
(0, _inherits2.default)(Toggle, _CommandBase); |
| 26956 |
|
| 26957 |
var _super = (0, _createSuper2.default)(Toggle); |
| 26958 |
|
| 26959 |
function Toggle() { |
| 26960 |
(0, _classCallCheck2.default)(this, Toggle); |
| 26961 |
return _super.apply(this, arguments); |
| 26962 |
} |
| 26963 |
|
| 26964 |
(0, _createClass2.default)(Toggle, [{ |
| 26965 |
key: "apply", |
| 26966 |
value: function apply() { |
| 26967 |
if (this.component.isOpen) { |
| 26968 |
$e.run('navigator/close'); |
| 26969 |
} else { |
| 26970 |
$e.run('navigator/open'); |
| 26971 |
} |
| 26972 |
} |
| 26973 |
}]); |
| 26974 |
return Toggle; |
| 26975 |
}(_commandBase.default); |
| 26976 |
|
| 26977 |
exports.Toggle = Toggle; |
| 26978 |
var _default = Toggle; |
| 26979 |
exports.default = _default; |
| 26980 |
|
| 26981 |
/***/ }), |
| 26982 |
/* 520 */ |
| 26983 |
/***/ (function(module, exports, __webpack_require__) { |
| 26984 |
|
| 26985 |
"use strict"; |
| 26986 |
|
| 26987 |
|
| 26988 |
var _interopRequireDefault = __webpack_require__(0); |
| 26989 |
|
| 26990 |
var _Object$defineProperty = __webpack_require__(1); |
| 26991 |
|
| 26992 |
_Object$defineProperty(exports, "__esModule", { |
| 26993 |
value: true |
| 26994 |
}); |
| 26995 |
|
| 26996 |
exports.default = void 0; |
| 26997 |
|
| 26998 |
var _classCallCheck2 = _interopRequireDefault(__webpack_require__(2)); |
| 26999 |
|
| 27000 |
var _createClass2 = _interopRequireDefault(__webpack_require__(3)); |
| 27001 |
|
| 27002 |
var _inherits2 = _interopRequireDefault(__webpack_require__(4)); |
| 27003 |
|
| 27004 |
var _createSuper2 = _interopRequireDefault(__webpack_require__(5)); |
| 27005 |
|
| 27006 |
var _element = _interopRequireDefault(__webpack_require__(521)); |
| 27007 |
|
| 27008 |
var _default = /*#__PURE__*/function (_Marionette$LayoutVie) { |
| 27009 |
(0, _inherits2.default)(_default, _Marionette$LayoutVie); |
| 27010 |
|
| 27011 |
var _super = (0, _createSuper2.default)(_default); |
| 27012 |
|
| 27013 |
function _default() { |
| 27014 |
(0, _classCallCheck2.default)(this, _default); |
| 27015 |
return _super.apply(this, arguments); |
| 27016 |
} |
| 27017 |
|
| 27018 |
(0, _createClass2.default)(_default, [{ |
| 27019 |
key: "getTemplate", |
| 27020 |
value: function getTemplate() { |
| 27021 |
return '#tmpl-elementor-navigator'; |
| 27022 |
} |
| 27023 |
}, { |
| 27024 |
key: "id", |
| 27025 |
value: function id() { |
| 27026 |
return 'elementor-navigator__inner'; |
| 27027 |
} |
| 27028 |
}, { |
| 27029 |
key: "ui", |
| 27030 |
value: function ui() { |
| 27031 |
return { |
| 27032 |
toggleAll: '#elementor-navigator__toggle-all', |
| 27033 |
close: '#elementor-navigator__close' |
| 27034 |
}; |
| 27035 |
} |
| 27036 |
}, { |
| 27037 |
key: "events", |
| 27038 |
value: function events() { |
| 27039 |
return { |
| 27040 |
'click @ui.toggleAll': 'toggleAll', |
| 27041 |
'click @ui.close': 'onCloseClick' |
| 27042 |
}; |
| 27043 |
} |
| 27044 |
}, { |
| 27045 |
key: "regions", |
| 27046 |
value: function regions() { |
| 27047 |
return { |
| 27048 |
elements: '#elementor-navigator__elements' |
| 27049 |
}; |
| 27050 |
} |
| 27051 |
}, { |
| 27052 |
key: "toggleAll", |
| 27053 |
value: function toggleAll() { |
| 27054 |
var state = 'expand' === this.ui.toggleAll.data('elementor-action'), |
| 27055 |
classes = ['eicon-collapse', 'eicon-expand']; |
| 27056 |
this.ui.toggleAll.data('elementor-action', state ? 'collapse' : 'expand').removeClass(classes[+state]).addClass(classes[+!state]); |
| 27057 |
this.elements.currentView.recursiveChildInvoke('toggleList', state); |
| 27058 |
} |
| 27059 |
}, { |
| 27060 |
key: "activateElementsMouseInteraction", |
| 27061 |
value: function activateElementsMouseInteraction() { |
| 27062 |
this.elements.currentView.recursiveChildInvoke('activateMouseInteraction'); |
| 27063 |
} |
| 27064 |
}, { |
| 27065 |
key: "deactivateElementsMouseInteraction", |
| 27066 |
value: function deactivateElementsMouseInteraction() { |
| 27067 |
this.elements.currentView.recursiveChildInvoke('deactivateMouseInteraction'); |
| 27068 |
} |
| 27069 |
}, { |
| 27070 |
key: "onShow", |
| 27071 |
value: function onShow() { |
| 27072 |
this.elements.show(new _element.default({ |
| 27073 |
model: elementor.elementsModel |
| 27074 |
})); |
| 27075 |
} |
| 27076 |
}, { |
| 27077 |
key: "onCloseClick", |
| 27078 |
value: function onCloseClick() { |
| 27079 |
$e.components.get('navigator').close(); |
| 27080 |
} |
| 27081 |
}]); |
| 27082 |
return _default; |
| 27083 |
}(Marionette.LayoutView); |
| 27084 |
|
| 27085 |
exports.default = _default; |
| 27086 |
|
| 27087 |
/***/ }), |
| 27088 |
/* 521 */ |
| 27089 |
/***/ (function(module, exports, __webpack_require__) { |
| 27090 |
|
| 27091 |
"use strict"; |
| 27092 |
|
| 27093 |
|
| 27094 |
var _interopRequireDefault = __webpack_require__(0); |
| 27095 |
|
| 27096 |
var _Object$defineProperty = __webpack_require__(1); |
| 27097 |
|
| 27098 |
_Object$defineProperty(exports, "__esModule", { |
| 27099 |
value: true |
| 27100 |
}); |
| 27101 |
|
| 27102 |
exports.default = void 0; |
| 27103 |
|
| 27104 |
__webpack_require__(135); |
| 27105 |
|
| 27106 |
__webpack_require__(155); |
| 27107 |
|
| 27108 |
var _keys = _interopRequireDefault(__webpack_require__(23)); |
| 27109 |
|
| 27110 |
var _values = _interopRequireDefault(__webpack_require__(55)); |
| 27111 |
|
| 27112 |
var _classCallCheck2 = _interopRequireDefault(__webpack_require__(2)); |
| 27113 |
|
| 27114 |
var _createClass2 = _interopRequireDefault(__webpack_require__(3)); |
| 27115 |
|
| 27116 |
var _inherits2 = _interopRequireDefault(__webpack_require__(4)); |
| 27117 |
|
| 27118 |
var _createSuper2 = _interopRequireDefault(__webpack_require__(5)); |
| 27119 |
|
| 27120 |
var _elementEmpty = _interopRequireDefault(__webpack_require__(522)); |
| 27121 |
|
| 27122 |
var _rootEmpty = _interopRequireDefault(__webpack_require__(523)); |
| 27123 |
|
| 27124 |
var _helper = _interopRequireDefault(__webpack_require__(215)); |
| 27125 |
|
| 27126 |
var _default = /*#__PURE__*/function (_Marionette$Composite) { |
| 27127 |
(0, _inherits2.default)(_default, _Marionette$Composite); |
| 27128 |
|
| 27129 |
var _super = (0, _createSuper2.default)(_default); |
| 27130 |
|
| 27131 |
function _default() { |
| 27132 |
(0, _classCallCheck2.default)(this, _default); |
| 27133 |
return _super.apply(this, arguments); |
| 27134 |
} |
| 27135 |
|
| 27136 |
(0, _createClass2.default)(_default, [{ |
| 27137 |
key: "getTemplate", |
| 27138 |
value: function getTemplate() { |
| 27139 |
return '#tmpl-elementor-navigator__elements'; |
| 27140 |
} |
| 27141 |
}, { |
| 27142 |
key: "ui", |
| 27143 |
value: function ui() { |
| 27144 |
return { |
| 27145 |
item: '> .elementor-navigator__item', |
| 27146 |
title: '> .elementor-navigator__item .elementor-navigator__element__title__text', |
| 27147 |
toggle: '> .elementor-navigator__item > .elementor-navigator__element__toggle', |
| 27148 |
toggleList: '> .elementor-navigator__item > .elementor-navigator__element__list-toggle', |
| 27149 |
indicators: '> .elementor-navigator__item > .elementor-navigator__element__indicators', |
| 27150 |
indicator: '> .elementor-navigator__item > .elementor-navigator__element__indicators > .elementor-navigator__element__indicator', |
| 27151 |
elements: '> .elementor-navigator__elements' |
| 27152 |
}; |
| 27153 |
} |
| 27154 |
}, { |
| 27155 |
key: "events", |
| 27156 |
value: function events() { |
| 27157 |
return { |
| 27158 |
contextmenu: 'onContextMenu', |
| 27159 |
'click @ui.item': 'onItemClick', |
| 27160 |
'click @ui.toggle': 'onToggleClick', |
| 27161 |
'click @ui.toggleList': 'onToggleListClick', |
| 27162 |
'click @ui.indicator': 'onIndicatorClick', |
| 27163 |
'dblclick @ui.title': 'onTitleDoubleClick', |
| 27164 |
'keydown @ui.title': 'onTitleKeyDown', |
| 27165 |
'paste @ui.title': 'onTitlePaste', |
| 27166 |
'sortstart @ui.elements': 'onSortStart', |
| 27167 |
'sortover @ui.elements': 'onSortOver', |
| 27168 |
'sortout @ui.elements': 'onSortOut', |
| 27169 |
'sortstop @ui.elements': 'onSortStop', |
| 27170 |
'sortupdate @ui.elements': 'onSortUpdate', |
| 27171 |
'sortreceive @ui.elements': 'onSortReceive' |
| 27172 |
}; |
| 27173 |
} |
| 27174 |
}, { |
| 27175 |
key: "getEmptyView", |
| 27176 |
value: function getEmptyView() { |
| 27177 |
if (this.isRoot()) { |
| 27178 |
return _rootEmpty.default; |
| 27179 |
} |
| 27180 |
|
| 27181 |
if (this.hasChildren()) { |
| 27182 |
return _elementEmpty.default; |
| 27183 |
} |
| 27184 |
|
| 27185 |
return null; |
| 27186 |
} |
| 27187 |
}, { |
| 27188 |
key: "childViewOptions", |
| 27189 |
value: function childViewOptions() { |
| 27190 |
return { |
| 27191 |
indent: this.getIndent() + 10 |
| 27192 |
}; |
| 27193 |
} |
| 27194 |
}, { |
| 27195 |
key: "className", |
| 27196 |
value: function className() { |
| 27197 |
var elType = this.model.get('elType'); |
| 27198 |
var classes = 'elementor-navigator__element'; |
| 27199 |
|
| 27200 |
if (elType) { |
| 27201 |
classes += ' elementor-navigator__element-' + elType; |
| 27202 |
} |
| 27203 |
|
| 27204 |
if (this.hasChildren()) { |
| 27205 |
classes += ' elementor-navigator__element--has-children'; |
| 27206 |
} |
| 27207 |
|
| 27208 |
return classes; |
| 27209 |
} |
| 27210 |
}, { |
| 27211 |
key: "attributes", |
| 27212 |
value: function attributes() { |
| 27213 |
return { |
| 27214 |
'data-id': this.model.id, |
| 27215 |
'data-model-cid': this.model.cid |
| 27216 |
}; |
| 27217 |
} |
| 27218 |
}, { |
| 27219 |
key: "templateHelpers", |
| 27220 |
value: function templateHelpers() { |
| 27221 |
var helpers = {}; |
| 27222 |
|
| 27223 |
if (!this.isRoot()) { |
| 27224 |
helpers.title = this.model.getTitle(); |
| 27225 |
helpers.icon = 'section' === this.model.get('elType') ? '' : this.model.getIcon(); |
| 27226 |
} |
| 27227 |
|
| 27228 |
return helpers; |
| 27229 |
} |
| 27230 |
}, { |
| 27231 |
key: "initialize", |
| 27232 |
value: function initialize() { |
| 27233 |
this.collection = this.model.get('elements'); |
| 27234 |
this.childViewContainer = '.elementor-navigator__elements'; |
| 27235 |
this.listenTo(this.model, 'request:edit', this.onEditRequest).listenTo(this.model, 'change', this.onModelChange).listenTo(this.model.get('settings'), 'change', this.onModelSettingsChange); |
| 27236 |
} |
| 27237 |
}, { |
| 27238 |
key: "getIndent", |
| 27239 |
value: function getIndent() { |
| 27240 |
return this.getOption('indent') || 0; |
| 27241 |
} |
| 27242 |
}, { |
| 27243 |
key: "isRoot", |
| 27244 |
value: function isRoot() { |
| 27245 |
return !this.model.get('elType'); |
| 27246 |
} |
| 27247 |
}, { |
| 27248 |
key: "hasChildren", |
| 27249 |
value: function hasChildren() { |
| 27250 |
return 'widget' !== this.model.get('elType'); |
| 27251 |
} |
| 27252 |
}, { |
| 27253 |
key: "toggleList", |
| 27254 |
value: function toggleList(state, callback) { |
| 27255 |
if (!this.hasChildren() || this.isRoot()) { |
| 27256 |
return; |
| 27257 |
} |
| 27258 |
|
| 27259 |
var isActive = this.ui.item.hasClass('elementor-active'); |
| 27260 |
|
| 27261 |
if (isActive === state) { |
| 27262 |
return; |
| 27263 |
} |
| 27264 |
|
| 27265 |
this.ui.item.toggleClass('elementor-active', state); |
| 27266 |
var slideMethod = 'slideToggle'; |
| 27267 |
|
| 27268 |
if (undefined !== state) { |
| 27269 |
slideMethod = 'slide' + (state ? 'Down' : 'Up'); |
| 27270 |
} |
| 27271 |
|
| 27272 |
this.ui.elements[slideMethod](300, callback); |
| 27273 |
} |
| 27274 |
}, { |
| 27275 |
key: "toggleHiddenClass", |
| 27276 |
value: function toggleHiddenClass() { |
| 27277 |
this.$el.toggleClass('elementor-navigator__element--hidden', !!this.model.get('hidden')); |
| 27278 |
} |
| 27279 |
}, { |
| 27280 |
key: "recursiveChildInvoke", |
| 27281 |
value: function recursiveChildInvoke(method) { |
| 27282 |
var _arguments = arguments, |
| 27283 |
_this = this; |
| 27284 |
|
| 27285 |
for (var _len = arguments.length, restArgs = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { |
| 27286 |
restArgs[_key - 1] = arguments[_key]; |
| 27287 |
} |
| 27288 |
|
| 27289 |
this[method].apply(this, restArgs); |
| 27290 |
this.children.each(function (child) { |
| 27291 |
if (!(child instanceof _this.constructor)) { |
| 27292 |
return; |
| 27293 |
} |
| 27294 |
|
| 27295 |
child.recursiveChildInvoke.apply(child, _arguments); |
| 27296 |
}); |
| 27297 |
} |
| 27298 |
}, { |
| 27299 |
key: "recursiveParentInvoke", |
| 27300 |
value: function recursiveParentInvoke(method) { |
| 27301 |
for (var _len2 = arguments.length, restArgs = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { |
| 27302 |
restArgs[_key2 - 1] = arguments[_key2]; |
| 27303 |
} |
| 27304 |
|
| 27305 |
if (!(this._parent instanceof this.constructor)) { |
| 27306 |
return; |
| 27307 |
} |
| 27308 |
|
| 27309 |
this._parent[method].apply(this._parent, restArgs); |
| 27310 |
|
| 27311 |
this._parent.recursiveParentInvoke.apply(this._parent, arguments); |
| 27312 |
} |
| 27313 |
}, { |
| 27314 |
key: "recursiveChildAgreement", |
| 27315 |
value: function recursiveChildAgreement(method) { |
| 27316 |
for (var _len3 = arguments.length, restArgs = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) { |
| 27317 |
restArgs[_key3 - 1] = arguments[_key3]; |
| 27318 |
} |
| 27319 |
|
| 27320 |
if (!this[method].apply(this, restArgs)) { |
| 27321 |
return false; |
| 27322 |
} |
| 27323 |
|
| 27324 |
var hasAgreement = true; |
| 27325 |
|
| 27326 |
for (var _i = 0, _Object$values = (0, _values.default)(this.children._views); _i < _Object$values.length; _i++) { |
| 27327 |
var child = _Object$values[_i]; |
| 27328 |
|
| 27329 |
if (!(child instanceof this.constructor)) { |
| 27330 |
continue; |
| 27331 |
} |
| 27332 |
|
| 27333 |
if (!child.recursiveChildAgreement.apply(child, arguments)) { |
| 27334 |
hasAgreement = false; |
| 27335 |
break; |
| 27336 |
} |
| 27337 |
} |
| 27338 |
|
| 27339 |
return hasAgreement; |
| 27340 |
} |
| 27341 |
}, { |
| 27342 |
key: "activateMouseInteraction", |
| 27343 |
value: function activateMouseInteraction() { |
| 27344 |
this.$el.on({ |
| 27345 |
mouseenter: this.onMouseEnter.bind(this), |
| 27346 |
mouseleave: this.onMouseLeave.bind(this) |
| 27347 |
}); |
| 27348 |
} |
| 27349 |
}, { |
| 27350 |
key: "deactivateMouseInteraction", |
| 27351 |
value: function deactivateMouseInteraction() { |
| 27352 |
this.$el.off('mouseenter mouseleave'); |
| 27353 |
} |
| 27354 |
}, { |
| 27355 |
key: "dragShouldBeIgnored", |
| 27356 |
value: function dragShouldBeIgnored(draggedModel) { |
| 27357 |
return !_helper.default.isValidChild(draggedModel, this.model); |
| 27358 |
} |
| 27359 |
}, { |
| 27360 |
key: "addEditingClass", |
| 27361 |
value: function addEditingClass() { |
| 27362 |
this.ui.item.addClass('elementor-editing'); |
| 27363 |
} |
| 27364 |
}, { |
| 27365 |
key: "removeEditingClass", |
| 27366 |
value: function removeEditingClass() { |
| 27367 |
this.ui.item.removeClass('elementor-editing'); |
| 27368 |
} |
| 27369 |
}, { |
| 27370 |
key: "enterTitleEditing", |
| 27371 |
value: function enterTitleEditing() { |
| 27372 |
this.ui.title.attr('contenteditable', true).focus(); |
| 27373 |
document.execCommand('selectAll'); |
| 27374 |
elementor.addBackgroundClickListener('navigator', { |
| 27375 |
ignore: this.ui.title, |
| 27376 |
callback: this.exitTitleEditing.bind(this) |
| 27377 |
}); |
| 27378 |
} |
| 27379 |
}, { |
| 27380 |
key: "exitTitleEditing", |
| 27381 |
value: function exitTitleEditing() { |
| 27382 |
this.ui.title.attr('contenteditable', false); |
| 27383 |
var settingsModel = this.model.get('settings'), |
| 27384 |
oldTitle = settingsModel.get('_title'), |
| 27385 |
newTitle = this.ui.title.text().trim(); // When there isn't an old title and a new title, allow backbone to recognize the `set` as a change |
| 27386 |
|
| 27387 |
if (!oldTitle) { |
| 27388 |
settingsModel.unset('_title', { |
| 27389 |
silent: true |
| 27390 |
}); |
| 27391 |
} |
| 27392 |
|
| 27393 |
settingsModel.set('_title', newTitle); |
| 27394 |
elementor.removeBackgroundClickListener('navigator'); |
| 27395 |
} |
| 27396 |
}, { |
| 27397 |
key: "activateSortable", |
| 27398 |
value: function activateSortable() { |
| 27399 |
if (!elementor.userCan('design')) { |
| 27400 |
return; |
| 27401 |
} |
| 27402 |
|
| 27403 |
this.ui.elements.sortable({ |
| 27404 |
items: '> .elementor-navigator__element', |
| 27405 |
placeholder: 'ui-sortable-placeholder', |
| 27406 |
axis: 'y', |
| 27407 |
forcePlaceholderSize: true, |
| 27408 |
connectWith: '.elementor-navigator__element-' + this.model.get('elType') + ' ' + this.ui.elements.selector, |
| 27409 |
cancel: '[contenteditable="true"]' |
| 27410 |
}); |
| 27411 |
} |
| 27412 |
}, { |
| 27413 |
key: "renderIndicators", |
| 27414 |
value: function renderIndicators() { |
| 27415 |
var _this2 = this; |
| 27416 |
|
| 27417 |
var settings = this.model.get('settings').attributes; |
| 27418 |
this.ui.indicators.empty(); |
| 27419 |
jQuery.each(elementor.navigator.indicators, function (indicatorName, indicatorSettings) { |
| 27420 |
var isShouldBeIndicated = indicatorSettings.settingKeys.some(function (key) { |
| 27421 |
return settings[key]; |
| 27422 |
}); |
| 27423 |
|
| 27424 |
if (!isShouldBeIndicated) { |
| 27425 |
return; |
| 27426 |
} |
| 27427 |
|
| 27428 |
var $indicator = jQuery('<div>', { |
| 27429 |
class: 'elementor-navigator__element__indicator', |
| 27430 |
title: indicatorSettings.title |
| 27431 |
}).attr('data-section', indicatorSettings.section).html("<i class=\"eicon-".concat(indicatorSettings.icon, "\"></i>")); |
| 27432 |
|
| 27433 |
_this2.ui.indicators.append($indicator); // Added delay of 500ms because the indicators bar has a CSS transition attribute of .5s |
| 27434 |
|
| 27435 |
|
| 27436 |
$indicator.tipsy({ |
| 27437 |
delayIn: 300, |
| 27438 |
gravity: 's' |
| 27439 |
}); |
| 27440 |
}); |
| 27441 |
} |
| 27442 |
}, { |
| 27443 |
key: "onRender", |
| 27444 |
value: function onRender() { |
| 27445 |
this.activateSortable(); |
| 27446 |
|
| 27447 |
if (this.isRoot()) { |
| 27448 |
return; |
| 27449 |
} |
| 27450 |
|
| 27451 |
this.ui.item.css('padding-' + (elementorCommon.config.isRTL ? 'right' : 'left'), this.getIndent()); |
| 27452 |
this.toggleHiddenClass(); |
| 27453 |
this.renderIndicators(); |
| 27454 |
} |
| 27455 |
}, { |
| 27456 |
key: "onModelChange", |
| 27457 |
value: function onModelChange() { |
| 27458 |
if (undefined !== this.model.changed.hidden) { |
| 27459 |
this.toggleHiddenClass(); |
| 27460 |
} |
| 27461 |
} |
| 27462 |
}, { |
| 27463 |
key: "onModelSettingsChange", |
| 27464 |
value: function onModelSettingsChange(settingsModel) { |
| 27465 |
var _this3 = this; |
| 27466 |
|
| 27467 |
if (undefined !== settingsModel.changed._title) { |
| 27468 |
this.ui.title.text(this.model.getTitle()); |
| 27469 |
} |
| 27470 |
|
| 27471 |
jQuery.each(elementor.navigator.indicators, function (indicatorName, indicatorSettings) { |
| 27472 |
if ((0, _keys.default)(settingsModel.changed).filter(function (key) { |
| 27473 |
return indicatorSettings.settingKeys.includes(key); |
| 27474 |
}).length) { |
| 27475 |
_this3.renderIndicators(); |
| 27476 |
|
| 27477 |
return false; |
| 27478 |
} |
| 27479 |
}); |
| 27480 |
} |
| 27481 |
}, { |
| 27482 |
key: "onItemClick", |
| 27483 |
value: function onItemClick() { |
| 27484 |
this.model.trigger('request:edit', { |
| 27485 |
scrollIntoView: true |
| 27486 |
}); |
| 27487 |
} |
| 27488 |
}, { |
| 27489 |
key: "onToggleClick", |
| 27490 |
value: function onToggleClick(event) { |
| 27491 |
event.stopPropagation(); |
| 27492 |
this.model.trigger('request:toggleVisibility'); |
| 27493 |
} |
| 27494 |
}, { |
| 27495 |
key: "onTitleDoubleClick", |
| 27496 |
value: function onTitleDoubleClick() { |
| 27497 |
this.enterTitleEditing(); |
| 27498 |
} |
| 27499 |
}, { |
| 27500 |
key: "onTitleKeyDown", |
| 27501 |
value: function onTitleKeyDown(event) { |
| 27502 |
var ENTER_KEY = 13; |
| 27503 |
|
| 27504 |
if (ENTER_KEY === event.which) { |
| 27505 |
event.preventDefault(); |
| 27506 |
this.exitTitleEditing(); |
| 27507 |
} |
| 27508 |
} |
| 27509 |
}, { |
| 27510 |
key: "onTitlePaste", |
| 27511 |
value: function onTitlePaste(event) { |
| 27512 |
event.preventDefault(); |
| 27513 |
document.execCommand('insertHTML', false, event.originalEvent.clipboardData.getData('text/plain')); |
| 27514 |
} |
| 27515 |
}, { |
| 27516 |
key: "onToggleListClick", |
| 27517 |
value: function onToggleListClick(event) { |
| 27518 |
event.stopPropagation(); |
| 27519 |
this.toggleList(); |
| 27520 |
} |
| 27521 |
}, { |
| 27522 |
key: "onSortStart", |
| 27523 |
value: function onSortStart(event, ui) { |
| 27524 |
this.model.trigger('request:sort:start', event, ui); |
| 27525 |
jQuery(ui.item).children('.elementor-navigator__item').trigger('click'); |
| 27526 |
elementor.navigator.getLayout().activateElementsMouseInteraction(); |
| 27527 |
} |
| 27528 |
}, { |
| 27529 |
key: "onSortStop", |
| 27530 |
value: function onSortStop() { |
| 27531 |
elementor.navigator.getLayout().deactivateElementsMouseInteraction(); |
| 27532 |
} |
| 27533 |
}, { |
| 27534 |
key: "onSortOver", |
| 27535 |
value: function onSortOver(event) { |
| 27536 |
event.stopPropagation(); |
| 27537 |
this.$el.addClass('elementor-dragging-on-child'); |
| 27538 |
} |
| 27539 |
}, { |
| 27540 |
key: "onSortOut", |
| 27541 |
value: function onSortOut(event) { |
| 27542 |
event.stopPropagation(); |
| 27543 |
this.$el.removeClass('elementor-dragging-on-child'); |
| 27544 |
} |
| 27545 |
}, { |
| 27546 |
key: "onSortUpdate", |
| 27547 |
value: function onSortUpdate(event, ui) { |
| 27548 |
event.stopPropagation(); |
| 27549 |
|
| 27550 |
if (!this.ui.elements.is(ui.item.parent())) { |
| 27551 |
return; |
| 27552 |
} |
| 27553 |
|
| 27554 |
this.model.trigger('request:sort:update', ui); |
| 27555 |
} |
| 27556 |
}, { |
| 27557 |
key: "onSortReceive", |
| 27558 |
value: function onSortReceive(event, ui) { |
| 27559 |
this.model.trigger('request:sort:receive', event, ui); |
| 27560 |
} |
| 27561 |
}, { |
| 27562 |
key: "onMouseEnter", |
| 27563 |
value: function onMouseEnter(event) { |
| 27564 |
var _this4 = this; |
| 27565 |
|
| 27566 |
event.stopPropagation(); |
| 27567 |
var dragShouldBeIgnored = this.recursiveChildAgreement('dragShouldBeIgnored', elementor.channels.data.request('dragging:model')); |
| 27568 |
|
| 27569 |
if (dragShouldBeIgnored) { |
| 27570 |
return; |
| 27571 |
} |
| 27572 |
|
| 27573 |
this.autoExpandTimeout = setTimeout(function () { |
| 27574 |
_this4.toggleList(true, function () { |
| 27575 |
_this4.ui.elements.sortable('refreshPositions'); |
| 27576 |
}); |
| 27577 |
}, 500); |
| 27578 |
} |
| 27579 |
}, { |
| 27580 |
key: "onMouseLeave", |
| 27581 |
value: function onMouseLeave(event) { |
| 27582 |
event.stopPropagation(); |
| 27583 |
clearTimeout(this.autoExpandTimeout); |
| 27584 |
} |
| 27585 |
}, { |
| 27586 |
key: "onContextMenu", |
| 27587 |
value: function onContextMenu(event) { |
| 27588 |
this.model.trigger('request:contextmenu', event); |
| 27589 |
} |
| 27590 |
}, { |
| 27591 |
key: "onEditRequest", |
| 27592 |
value: function onEditRequest() { |
| 27593 |
this.recursiveParentInvoke('toggleList', true); |
| 27594 |
elementor.navigator.getLayout().elements.currentView.recursiveChildInvoke('removeEditingClass'); |
| 27595 |
this.addEditingClass(); |
| 27596 |
elementor.helpers.scrollToView(this.$el, 400, elementor.navigator.getLayout().elements.$el); |
| 27597 |
} |
| 27598 |
}, { |
| 27599 |
key: "onIndicatorClick", |
| 27600 |
value: function onIndicatorClick(event) { |
| 27601 |
var section = event.currentTarget.dataset.section; |
| 27602 |
setTimeout(function () { |
| 27603 |
var editor = elementor.getPanelView().currentPageView, |
| 27604 |
tab = editor.getControlModel(section).get('tab'); |
| 27605 |
editor.activateSection(section); |
| 27606 |
editor.activateTab(tab); |
| 27607 |
editor.render(); |
| 27608 |
}); |
| 27609 |
} |
| 27610 |
}]); |
| 27611 |
return _default; |
| 27612 |
}(Marionette.CompositeView); |
| 27613 |
|
| 27614 |
exports.default = _default; |
| 27615 |
|
| 27616 |
/***/ }), |
| 27617 |
/* 522 */ |
| 27618 |
/***/ (function(module, exports, __webpack_require__) { |
| 27619 |
|
| 27620 |
"use strict"; |
| 27621 |
|
| 27622 |
|
| 27623 |
var _interopRequireDefault = __webpack_require__(0); |
| 27624 |
|
| 27625 |
var _Object$defineProperty = __webpack_require__(1); |
| 27626 |
|
| 27627 |
_Object$defineProperty(exports, "__esModule", { |
| 27628 |
value: true |
| 27629 |
}); |
| 27630 |
|
| 27631 |
exports.default = void 0; |
| 27632 |
|
| 27633 |
var _classCallCheck2 = _interopRequireDefault(__webpack_require__(2)); |
| 27634 |
|
| 27635 |
var _createClass2 = _interopRequireDefault(__webpack_require__(3)); |
| 27636 |
|
| 27637 |
var _inherits2 = _interopRequireDefault(__webpack_require__(4)); |
| 27638 |
|
| 27639 |
var _createSuper2 = _interopRequireDefault(__webpack_require__(5)); |
| 27640 |
|
| 27641 |
var _default = /*#__PURE__*/function (_Marionette$ItemView) { |
| 27642 |
(0, _inherits2.default)(_default, _Marionette$ItemView); |
| 27643 |
|
| 27644 |
var _super = (0, _createSuper2.default)(_default); |
| 27645 |
|
| 27646 |
function _default() { |
| 27647 |
(0, _classCallCheck2.default)(this, _default); |
| 27648 |
return _super.apply(this, arguments); |
| 27649 |
} |
| 27650 |
|
| 27651 |
(0, _createClass2.default)(_default, [{ |
| 27652 |
key: "getTemplate", |
| 27653 |
value: function getTemplate() { |
| 27654 |
return '#tmpl-elementor-navigator__elements--empty'; |
| 27655 |
} |
| 27656 |
}, { |
| 27657 |
key: "className", |
| 27658 |
value: function className() { |
| 27659 |
return 'elementor-empty-view'; |
| 27660 |
} |
| 27661 |
}, { |
| 27662 |
key: "onRendr", |
| 27663 |
value: function onRendr() { |
| 27664 |
this.$el.css('padding-' + (elementorCommon.config.isRTL ? 'right' : 'left'), this.getOption('indent')); |
| 27665 |
} |
| 27666 |
}]); |
| 27667 |
return _default; |
| 27668 |
}(Marionette.ItemView); |
| 27669 |
|
| 27670 |
exports.default = _default; |
| 27671 |
|
| 27672 |
/***/ }), |
| 27673 |
/* 523 */ |
| 27674 |
/***/ (function(module, exports, __webpack_require__) { |
| 27675 |
|
| 27676 |
"use strict"; |
| 27677 |
|
| 27678 |
|
| 27679 |
var _interopRequireDefault = __webpack_require__(0); |
| 27680 |
|
| 27681 |
var _Object$defineProperty = __webpack_require__(1); |
| 27682 |
|
| 27683 |
_Object$defineProperty(exports, "__esModule", { |
| 27684 |
value: true |
| 27685 |
}); |
| 27686 |
|
| 27687 |
exports.default = void 0; |
| 27688 |
|
| 27689 |
var _classCallCheck2 = _interopRequireDefault(__webpack_require__(2)); |
| 27690 |
|
| 27691 |
var _createClass2 = _interopRequireDefault(__webpack_require__(3)); |
| 27692 |
|
| 27693 |
var _inherits2 = _interopRequireDefault(__webpack_require__(4)); |
| 27694 |
|
| 27695 |
var _createSuper2 = _interopRequireDefault(__webpack_require__(5)); |
| 27696 |
|
| 27697 |
var _default = /*#__PURE__*/function (_Marionette$ItemView) { |
| 27698 |
(0, _inherits2.default)(_default, _Marionette$ItemView); |
| 27699 |
|
| 27700 |
var _super = (0, _createSuper2.default)(_default); |
| 27701 |
|
| 27702 |
function _default() { |
| 27703 |
(0, _classCallCheck2.default)(this, _default); |
| 27704 |
return _super.apply(this, arguments); |
| 27705 |
} |
| 27706 |
|
| 27707 |
(0, _createClass2.default)(_default, [{ |
| 27708 |
key: "getTemplate", |
| 27709 |
value: function getTemplate() { |
| 27710 |
return '#tmpl-elementor-navigator__root--empty'; |
| 27711 |
} |
| 27712 |
}, { |
| 27713 |
key: "className", |
| 27714 |
value: function className() { |
| 27715 |
return 'elementor-nerd-box'; |
| 27716 |
} |
| 27717 |
}]); |
| 27718 |
return _default; |
| 27719 |
}(Marionette.ItemView); |
| 27720 |
|
| 27721 |
exports.default = _default; |
| 27722 |
|
| 27723 |
/***/ }), |
| 27724 |
/* 524 */ |
| 27725 |
/***/ (function(module, exports, __webpack_require__) { |
| 27726 |
|
| 27727 |
"use strict"; |
| 27728 |
|
| 27729 |
|
| 27730 |
var _interopRequireDefault = __webpack_require__(0); |
| 27731 |
|
| 27732 |
var _Object$defineProperty = __webpack_require__(1); |
| 27733 |
|
| 27734 |
_Object$defineProperty(exports, "__esModule", { |
| 27735 |
value: true |
| 27736 |
}); |
| 27737 |
|
| 27738 |
exports.default = void 0; |
| 27739 |
|
| 27740 |
var _classCallCheck2 = _interopRequireDefault(__webpack_require__(2)); |
| 27741 |
|
| 27742 |
var _createClass2 = _interopRequireDefault(__webpack_require__(3)); |
| 27743 |
|
| 27744 |
var _inherits2 = _interopRequireDefault(__webpack_require__(4)); |
| 27745 |
|
| 27746 |
var _createSuper2 = _interopRequireDefault(__webpack_require__(5)); |
| 27747 |
|
| 27748 |
var _default = /*#__PURE__*/function (_elementorModules$Vie) { |
| 27749 |
(0, _inherits2.default)(_default, _elementorModules$Vie); |
| 27750 |
|
| 27751 |
var _super = (0, _createSuper2.default)(_default); |
| 27752 |
|
| 27753 |
function _default() { |
| 27754 |
(0, _classCallCheck2.default)(this, _default); |
| 27755 |
return _super.apply(this, arguments); |
| 27756 |
} |
| 27757 |
|
| 27758 |
(0, _createClass2.default)(_default, [{ |
| 27759 |
key: "getDefaultSettings", |
| 27760 |
value: function getDefaultSettings() { |
| 27761 |
return { |
| 27762 |
selectors: { |
| 27763 |
notice: '#elementor-notice-bar', |
| 27764 |
close: '#elementor-notice-bar__close' |
| 27765 |
} |
| 27766 |
}; |
| 27767 |
} |
| 27768 |
}, { |
| 27769 |
key: "getDefaultElements", |
| 27770 |
value: function getDefaultElements() { |
| 27771 |
var settings = this.getSettings(); |
| 27772 |
return { |
| 27773 |
$notice: jQuery(settings.selectors.notice), |
| 27774 |
$close: jQuery(settings.selectors.close) |
| 27775 |
}; |
| 27776 |
} |
| 27777 |
}, { |
| 27778 |
key: "bindEvents", |
| 27779 |
value: function bindEvents() { |
| 27780 |
this.elements.$close.on('click', this.onCloseClick.bind(this)); |
| 27781 |
} |
| 27782 |
}, { |
| 27783 |
key: "onCloseClick", |
| 27784 |
value: function onCloseClick() { |
| 27785 |
this.elements.$notice.slideUp(); |
| 27786 |
elementorCommon.ajax.addRequest('notice_bar_dismiss'); |
| 27787 |
} |
| 27788 |
}]); |
| 27789 |
return _default; |
| 27790 |
}(elementorModules.ViewModule); |
| 27791 |
|
| 27792 |
exports.default = _default; |
| 27793 |
|
| 27794 |
/***/ }), |
| 27795 |
/* 525 */ |
| 27796 |
/***/ (function(module, exports, __webpack_require__) { |
| 27797 |
|
| 27798 |
"use strict"; |
| 27799 |
|
| 27800 |
|
| 27801 |
var _interopRequireDefault = __webpack_require__(0); |
| 27802 |
|
| 27803 |
var _independent = _interopRequireDefault(__webpack_require__(526)); |
| 27804 |
|
| 27805 |
var _rightClickIntroduction = _interopRequireDefault(__webpack_require__(527)); |
| 27806 |
|
| 27807 |
var _helper = _interopRequireDefault(__webpack_require__(215)); |
| 27808 |
|
| 27809 |
var BaseSectionsContainerView = __webpack_require__(528); |
| 27810 |
|
| 27811 |
var Preview = BaseSectionsContainerView.extend({ |
| 27812 |
getChildViewContainer: function getChildViewContainer() { |
| 27813 |
if (!this.$childViewContainer) { |
| 27814 |
this.$childViewContainer = jQuery('<div>', { |
| 27815 |
class: 'elementor-section-wrap' |
| 27816 |
}); |
| 27817 |
|
| 27818 |
if (elementor.config.legacyMode.elementWrappers) { |
| 27819 |
var inner = jQuery('<div>', { |
| 27820 |
class: 'elementor-inner' |
| 27821 |
}); |
| 27822 |
inner.append(this.$childViewContainer); |
| 27823 |
this.$el.prepend(inner); |
| 27824 |
} else { |
| 27825 |
this.$el.prepend(this.$childViewContainer); |
| 27826 |
} |
| 27827 |
} |
| 27828 |
|
| 27829 |
return this.$childViewContainer; |
| 27830 |
}, |
| 27831 |
behaviors: function behaviors() { |
| 27832 |
var parentBehaviors = BaseSectionsContainerView.prototype.behaviors.apply(this, arguments), |
| 27833 |
behaviors = { |
| 27834 |
contextMenu: { |
| 27835 |
behaviorClass: __webpack_require__(273), |
| 27836 |
groups: this.getContextMenuGroups() |
| 27837 |
} |
| 27838 |
}; // TODO: the `2` check is for BC reasons |
| 27839 |
|
| 27840 |
if (!elementor.config.user.introduction.rightClick && !elementor.config.user.introduction[2]) { |
| 27841 |
behaviors.introduction = { |
| 27842 |
behaviorClass: _rightClickIntroduction.default |
| 27843 |
}; |
| 27844 |
} |
| 27845 |
|
| 27846 |
return jQuery.extend(parentBehaviors, behaviors); |
| 27847 |
}, |
| 27848 |
getContainer: function getContainer() { |
| 27849 |
return elementor.settings.page.getEditedView().getContainer(); |
| 27850 |
}, |
| 27851 |
getContextMenuGroups: function getContextMenuGroups() { |
| 27852 |
var _this = this; |
| 27853 |
|
| 27854 |
var hasContent = function hasContent() { |
| 27855 |
return elementor.elements.length > 0; |
| 27856 |
}; |
| 27857 |
|
| 27858 |
return [{ |
| 27859 |
name: 'paste', |
| 27860 |
actions: [{ |
| 27861 |
name: 'paste', |
| 27862 |
title: elementor.translate('paste'), |
| 27863 |
isEnabled: function isEnabled() { |
| 27864 |
return _helper.default.isPasteEnabled(_this.getContainer()); |
| 27865 |
}, |
| 27866 |
callback: function callback(at) { |
| 27867 |
return $e.run('document/ui/paste', { |
| 27868 |
container: _this.getContainer(), |
| 27869 |
options: { |
| 27870 |
at: at, |
| 27871 |
rebuild: true |
| 27872 |
} |
| 27873 |
}); |
| 27874 |
} |
| 27875 |
}] |
| 27876 |
}, { |
| 27877 |
name: 'content', |
| 27878 |
actions: [{ |
| 27879 |
name: 'copy_all_content', |
| 27880 |
title: elementor.translate('copy_all_content'), |
| 27881 |
isEnabled: hasContent, |
| 27882 |
callback: function callback() { |
| 27883 |
return $e.run('document/elements/copy-all'); |
| 27884 |
} |
| 27885 |
}, { |
| 27886 |
name: 'delete_all_content', |
| 27887 |
title: elementor.translate('delete_all_content'), |
| 27888 |
isEnabled: hasContent, |
| 27889 |
callback: function callback() { |
| 27890 |
return $e.run('document/elements/empty'); |
| 27891 |
} |
| 27892 |
}] |
| 27893 |
}]; |
| 27894 |
}, |
| 27895 |
onRender: function onRender() { |
| 27896 |
if (!elementor.userCan('design')) { |
| 27897 |
return; |
| 27898 |
} |
| 27899 |
|
| 27900 |
var addNewSectionView = new _independent.default(); |
| 27901 |
addNewSectionView.render(); |
| 27902 |
this.$el.append(addNewSectionView.$el); |
| 27903 |
} |
| 27904 |
}); |
| 27905 |
module.exports = Preview; |
| 27906 |
|
| 27907 |
/***/ }), |
| 27908 |
/* 526 */ |
| 27909 |
/***/ (function(module, exports, __webpack_require__) { |
| 27910 |
|
| 27911 |
"use strict"; |
| 27912 |
|
| 27913 |
|
| 27914 |
var _interopRequireDefault = __webpack_require__(0); |
| 27915 |
|
| 27916 |
var _Object$defineProperty = __webpack_require__(1); |
| 27917 |
|
| 27918 |
_Object$defineProperty(exports, "__esModule", { |
| 27919 |
value: true |
| 27920 |
}); |
| 27921 |
|
| 27922 |
exports.default = void 0; |
| 27923 |
|
| 27924 |
var _classCallCheck2 = _interopRequireDefault(__webpack_require__(2)); |
| 27925 |
|
| 27926 |
var _createClass2 = _interopRequireDefault(__webpack_require__(3)); |
| 27927 |
|
| 27928 |
var _inherits2 = _interopRequireDefault(__webpack_require__(4)); |
| 27929 |
|
| 27930 |
var _createSuper2 = _interopRequireDefault(__webpack_require__(5)); |
| 27931 |
|
| 27932 |
var _base = _interopRequireDefault(__webpack_require__(296)); |
| 27933 |
|
| 27934 |
var AddSectionView = /*#__PURE__*/function (_BaseAddSectionView) { |
| 27935 |
(0, _inherits2.default)(AddSectionView, _BaseAddSectionView); |
| 27936 |
|
| 27937 |
var _super = (0, _createSuper2.default)(AddSectionView); |
| 27938 |
|
| 27939 |
function AddSectionView() { |
| 27940 |
(0, _classCallCheck2.default)(this, AddSectionView); |
| 27941 |
return _super.apply(this, arguments); |
| 27942 |
} |
| 27943 |
|
| 27944 |
(0, _createClass2.default)(AddSectionView, [{ |
| 27945 |
key: "onCloseButtonClick", |
| 27946 |
value: function onCloseButtonClick() { |
| 27947 |
this.closeSelectPresets(); |
| 27948 |
} |
| 27949 |
}, { |
| 27950 |
key: "id", |
| 27951 |
get: function get() { |
| 27952 |
return 'elementor-add-new-section'; |
| 27953 |
} |
| 27954 |
}]); |
| 27955 |
return AddSectionView; |
| 27956 |
}(_base.default); |
| 27957 |
|
| 27958 |
exports.default = AddSectionView; |
| 27959 |
|
| 27960 |
/***/ }), |
| 27961 |
/* 527 */ |
| 27962 |
/***/ (function(module, exports, __webpack_require__) { |
| 27963 |
|
| 27964 |
"use strict"; |
| 27965 |
|
| 27966 |
|
| 27967 |
var _interopRequireDefault = __webpack_require__(0); |
| 27968 |
|
| 27969 |
var _Object$defineProperty = __webpack_require__(1); |
| 27970 |
|
| 27971 |
_Object$defineProperty(exports, "__esModule", { |
| 27972 |
value: true |
| 27973 |
}); |
| 27974 |
|
| 27975 |
exports.default = void 0; |
| 27976 |
|
| 27977 |
var _classCallCheck2 = _interopRequireDefault(__webpack_require__(2)); |
| 27978 |
|
| 27979 |
var _createClass2 = _interopRequireDefault(__webpack_require__(3)); |
| 27980 |
|
| 27981 |
var _inherits2 = _interopRequireDefault(__webpack_require__(4)); |
| 27982 |
|
| 27983 |
var _createSuper2 = _interopRequireDefault(__webpack_require__(5)); |
| 27984 |
|
| 27985 |
var _default = /*#__PURE__*/function (_Marionette$Behavior) { |
| 27986 |
(0, _inherits2.default)(_default, _Marionette$Behavior); |
| 27987 |
|
| 27988 |
var _super = (0, _createSuper2.default)(_default); |
| 27989 |
|
| 27990 |
function _default() { |
| 27991 |
(0, _classCallCheck2.default)(this, _default); |
| 27992 |
return _super.apply(this, arguments); |
| 27993 |
} |
| 27994 |
|
| 27995 |
(0, _createClass2.default)(_default, [{ |
| 27996 |
key: "ui", |
| 27997 |
value: function ui() { |
| 27998 |
return { |
| 27999 |
editButton: '.elementor-editor-element-edit' |
| 28000 |
}; |
| 28001 |
} |
| 28002 |
}, { |
| 28003 |
key: "events", |
| 28004 |
value: function events() { |
| 28005 |
return { |
| 28006 |
'click @ui.editButton': 'show' |
| 28007 |
}; |
| 28008 |
} |
| 28009 |
}, { |
| 28010 |
key: "initialize", |
| 28011 |
value: function initialize() { |
| 28012 |
this.initIntroduction(); |
| 28013 |
} |
| 28014 |
}, { |
| 28015 |
key: "initIntroduction", |
| 28016 |
value: function initIntroduction() { |
| 28017 |
var introduction; |
| 28018 |
|
| 28019 |
this.getIntroduction = function () { |
| 28020 |
if (!introduction) { |
| 28021 |
introduction = new elementorModules.editor.utils.Introduction({ |
| 28022 |
introductionKey: 'rightClick', |
| 28023 |
dialogOptions: { |
| 28024 |
className: 'elementor-right-click-introduction', |
| 28025 |
headerMessage: elementor.translate('meet_right_click_header'), |
| 28026 |
message: elementor.translate('meet_right_click_message'), |
| 28027 |
iframe: elementor.$preview, |
| 28028 |
position: { |
| 28029 |
my: 'center top+5', |
| 28030 |
at: 'center bottom', |
| 28031 |
collision: 'fit' |
| 28032 |
} |
| 28033 |
}, |
| 28034 |
onDialogInitCallback: function onDialogInitCallback(dialog) { |
| 28035 |
dialog.addButton({ |
| 28036 |
name: 'learn-more', |
| 28037 |
text: elementor.translate('learn_more'), |
| 28038 |
tag: 'div', |
| 28039 |
callback: function callback() { |
| 28040 |
open(elementor.config.help_right_click_url, '_blank'); |
| 28041 |
} |
| 28042 |
}); |
| 28043 |
dialog.addButton({ |
| 28044 |
name: 'ok', |
| 28045 |
text: elementor.translate('got_it'), |
| 28046 |
callback: function callback() { |
| 28047 |
return introduction.setViewed(); |
| 28048 |
} |
| 28049 |
}); |
| 28050 |
dialog.getElements('ok').addClass('elementor-button elementor-button-success'); |
| 28051 |
} |
| 28052 |
}); |
| 28053 |
} |
| 28054 |
|
| 28055 |
return introduction; |
| 28056 |
}; |
| 28057 |
} |
| 28058 |
}, { |
| 28059 |
key: "show", |
| 28060 |
value: function show(event) { |
| 28061 |
this.getIntroduction().show(event.currentTarget); |
| 28062 |
} |
| 28063 |
}]); |
| 28064 |
return _default; |
| 28065 |
}(Marionette.Behavior); |
| 28066 |
|
| 28067 |
exports.default = _default; |
| 28068 |
|
| 28069 |
/***/ }), |
| 28070 |
/* 528 */ |
| 28071 |
/***/ (function(module, exports, __webpack_require__) { |
| 28072 |
|
| 28073 |
"use strict"; |
| 28074 |
|
| 28075 |
|
| 28076 |
__webpack_require__(25); |
| 28077 |
|
| 28078 |
var SectionView = __webpack_require__(256), |
| 28079 |
BaseContainer = __webpack_require__(333), |
| 28080 |
BaseSectionsContainerView; |
| 28081 |
|
| 28082 |
BaseSectionsContainerView = BaseContainer.extend({ |
| 28083 |
childView: SectionView, |
| 28084 |
behaviors: function behaviors() { |
| 28085 |
var behaviors = { |
| 28086 |
Sortable: { |
| 28087 |
behaviorClass: __webpack_require__(298), |
| 28088 |
elChildType: 'section' |
| 28089 |
} |
| 28090 |
}; |
| 28091 |
return elementor.hooks.applyFilters('elements/base-section-container/behaviors', behaviors, this); |
| 28092 |
}, |
| 28093 |
getSortableOptions: function getSortableOptions() { |
| 28094 |
return { |
| 28095 |
handle: '> .elementor-element-overlay .elementor-editor-element-edit', |
| 28096 |
items: '> .elementor-section' |
| 28097 |
}; |
| 28098 |
}, |
| 28099 |
getChildType: function getChildType() { |
| 28100 |
return ['section']; |
| 28101 |
}, |
| 28102 |
initialize: function initialize() { |
| 28103 |
BaseContainer.prototype.initialize.apply(this, arguments); |
| 28104 |
this.listenTo(elementor.channels.panelElements, 'element:drag:start', this.onPanelElementDragStart).listenTo(elementor.channels.panelElements, 'element:drag:end', this.onPanelElementDragEnd); |
| 28105 |
}, |
| 28106 |
onPanelElementDragStart: function onPanelElementDragStart() { |
| 28107 |
// A temporary workaround in order to fix Chrome's 70+ dragging above nested iframe bug |
| 28108 |
this.$el.find('.elementor-background-video-embed').hide(); |
| 28109 |
elementor.helpers.disableElementEvents(this.$el.find('iframe')); |
| 28110 |
}, |
| 28111 |
onPanelElementDragEnd: function onPanelElementDragEnd() { |
| 28112 |
this.$el.find('.elementor-background-video-embed').show(); |
| 28113 |
elementor.helpers.enableElementEvents(this.$el.find('iframe')); |
| 28114 |
} |
| 28115 |
}); |
| 28116 |
module.exports = BaseSectionsContainerView; |
| 28117 |
|
| 28118 |
/***/ }), |
| 28119 |
/* 529 */ |
| 28120 |
/***/ (function(module, exports, __webpack_require__) { |
| 28121 |
|
| 28122 |
"use strict"; |
| 28123 |
|
| 28124 |
|
| 28125 |
var _interopRequireDefault = __webpack_require__(0); |
| 28126 |
|
| 28127 |
var _Object$defineProperty = __webpack_require__(1); |
| 28128 |
|
| 28129 |
_Object$defineProperty(exports, "__esModule", { |
| 28130 |
value: true |
| 28131 |
}); |
| 28132 |
|
| 28133 |
exports.default = void 0; |
| 28134 |
|
| 28135 |
var _values = _interopRequireDefault(__webpack_require__(55)); |
| 28136 |
|
| 28137 |
var _regenerator = _interopRequireDefault(__webpack_require__(82)); |
| 28138 |
|
| 28139 |
__webpack_require__(66); |
| 28140 |
|
| 28141 |
var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(83)); |
| 28142 |
|
| 28143 |
__webpack_require__(135); |
| 28144 |
|
| 28145 |
__webpack_require__(155); |
| 28146 |
|
| 28147 |
__webpack_require__(58); |
| 28148 |
|
| 28149 |
__webpack_require__(277); |
| 28150 |
|
| 28151 |
var _slicedToArray2 = _interopRequireDefault(__webpack_require__(102)); |
| 28152 |
|
| 28153 |
var _entries = _interopRequireDefault(__webpack_require__(89)); |
| 28154 |
|
| 28155 |
var _classCallCheck2 = _interopRequireDefault(__webpack_require__(2)); |
| 28156 |
|
| 28157 |
var _createClass2 = _interopRequireDefault(__webpack_require__(3)); |
| 28158 |
|
| 28159 |
var _inherits2 = _interopRequireDefault(__webpack_require__(4)); |
| 28160 |
|
| 28161 |
var _createSuper2 = _interopRequireDefault(__webpack_require__(5)); |
| 28162 |
|
| 28163 |
var ControlChooseView = __webpack_require__(377); |
| 28164 |
|
| 28165 |
var ControlPopoverStarterView = /*#__PURE__*/function (_ControlChooseView) { |
| 28166 |
(0, _inherits2.default)(ControlPopoverStarterView, _ControlChooseView); |
| 28167 |
|
| 28168 |
var _super = (0, _createSuper2.default)(ControlPopoverStarterView); |
| 28169 |
|
| 28170 |
function ControlPopoverStarterView() { |
| 28171 |
(0, _classCallCheck2.default)(this, ControlPopoverStarterView); |
| 28172 |
return _super.apply(this, arguments); |
| 28173 |
} |
| 28174 |
|
| 28175 |
(0, _createClass2.default)(ControlPopoverStarterView, [{ |
| 28176 |
key: "ui", |
| 28177 |
value: function ui() { |
| 28178 |
var ui = ControlChooseView.prototype.ui.apply(this, arguments); |
| 28179 |
ui.popoverToggle = '.elementor-control-popover-toggle-toggle'; |
| 28180 |
ui.resetInput = '.elementor-control-popover-toggle-reset'; |
| 28181 |
return ui; |
| 28182 |
} |
| 28183 |
}, { |
| 28184 |
key: "events", |
| 28185 |
value: function events() { |
| 28186 |
return _.extend(ControlChooseView.prototype.events.apply(this, arguments), { |
| 28187 |
'click @ui.popoverToggle': 'onPopoverToggleClick', |
| 28188 |
'click @ui.resetInput': 'onResetInputClick' |
| 28189 |
}); |
| 28190 |
} |
| 28191 |
}, { |
| 28192 |
key: "onResetInputClick", |
| 28193 |
value: function onResetInputClick() { |
| 28194 |
var globalData = this.model.get('global'); |
| 28195 |
|
| 28196 |
if (globalData === null || globalData === void 0 ? void 0 : globalData.active) { |
| 28197 |
this.triggerMethod('value:type:change'); |
| 28198 |
} |
| 28199 |
} |
| 28200 |
}, { |
| 28201 |
key: "onInputChange", |
| 28202 |
value: function onInputChange(event) { |
| 28203 |
if (event.currentTarget !== this.ui.popoverToggle[0]) { |
| 28204 |
return; |
| 28205 |
} // If the control has a global value, unset the global. |
| 28206 |
|
| 28207 |
|
| 28208 |
if (this.getGlobalKey()) { |
| 28209 |
this.triggerMethod('unset:global:value'); |
| 28210 |
} else if (this.isGlobalActive()) { |
| 28211 |
this.triggerMethod('value:type:change'); |
| 28212 |
} |
| 28213 |
} |
| 28214 |
}, { |
| 28215 |
key: "onPopoverToggleClick", |
| 28216 |
value: function onPopoverToggleClick() { |
| 28217 |
if (this.isGlobalActive() && !this.getControlValue() && !this.getGlobalKey() && this.getGlobalDefault()) { |
| 28218 |
this.triggerMethod('unlink:global:default'); |
| 28219 |
} |
| 28220 |
|
| 28221 |
this.$el.next('.elementor-controls-popover').toggle(); |
| 28222 |
} |
| 28223 |
}, { |
| 28224 |
key: "getGlobalCommand", |
| 28225 |
value: function getGlobalCommand() { |
| 28226 |
return 'globals/typography'; |
| 28227 |
} |
| 28228 |
}, { |
| 28229 |
key: "buildPreviewItemCSS", |
| 28230 |
value: function buildPreviewItemCSS(globalValue) { |
| 28231 |
var cssObject = {}; |
| 28232 |
(0, _entries.default)(globalValue).forEach(function (_ref) { |
| 28233 |
var _ref2 = (0, _slicedToArray2.default)(_ref, 2), |
| 28234 |
property = _ref2[0], |
| 28235 |
value = _ref2[1]; |
| 28236 |
|
| 28237 |
// If a control value is empty, ignore it. |
| 28238 |
if (!value || '' === value.size) { |
| 28239 |
return; |
| 28240 |
} // TODO: FIGURE OUT WHAT THE FINAL VALUE KEY FORMAT IS AND ADJUST THIS ACCORDINGLY |
| 28241 |
|
| 28242 |
|
| 28243 |
if (property.startsWith('typography_')) { |
| 28244 |
property = property.replace('typography_', ''); |
| 28245 |
} |
| 28246 |
|
| 28247 |
if ('font_family' === property) { |
| 28248 |
elementor.helpers.enqueueFont(value, 'editor'); |
| 28249 |
} |
| 28250 |
|
| 28251 |
if ('font_size' === property) { |
| 28252 |
// Set max size for Typography previews in the select popover so it isn't too big. |
| 28253 |
if (value.size > 40) { |
| 28254 |
value.size = 40; |
| 28255 |
} |
| 28256 |
|
| 28257 |
cssObject.fontSize = value.size + value.unit; |
| 28258 |
} else { |
| 28259 |
// Convert the snake case property names into camel case to match their corresponding CSS property names. |
| 28260 |
if (property.includes('_')) { |
| 28261 |
property = property.replace(/([_][a-z])/g, function (result) { |
| 28262 |
return result.toUpperCase().replace('_', ''); |
| 28263 |
}); |
| 28264 |
} |
| 28265 |
|
| 28266 |
cssObject[property] = value; |
| 28267 |
} |
| 28268 |
}); |
| 28269 |
return cssObject; |
| 28270 |
} |
| 28271 |
}, { |
| 28272 |
key: "createGlobalItemMarkup", |
| 28273 |
value: function createGlobalItemMarkup(globalData) { |
| 28274 |
var $typographyPreview = jQuery('<div>', { |
| 28275 |
class: 'e-global__preview-item e-global__typography', |
| 28276 |
'data-global-id': globalData.id |
| 28277 |
}); |
| 28278 |
$typographyPreview.html(globalData.title).css(this.buildPreviewItemCSS(globalData.value)); |
| 28279 |
return $typographyPreview; |
| 28280 |
} |
| 28281 |
}, { |
| 28282 |
key: "getGlobalMeta", |
| 28283 |
value: function getGlobalMeta() { |
| 28284 |
return { |
| 28285 |
commandName: this.getGlobalCommand(), |
| 28286 |
key: this.model.get('name'), |
| 28287 |
title: elementor.translate('new_typography_setting'), |
| 28288 |
controlType: 'typography', |
| 28289 |
route: 'panel/global/global-typography' |
| 28290 |
}; |
| 28291 |
} |
| 28292 |
}, { |
| 28293 |
key: "getAddGlobalConfirmMessage", |
| 28294 |
value: function getAddGlobalConfirmMessage() { |
| 28295 |
var globalData = this.getGlobalMeta(), |
| 28296 |
$message = jQuery('<div>', { |
| 28297 |
class: 'e-global__confirm-message' |
| 28298 |
}), |
| 28299 |
$messageText = jQuery('<div>').html(elementor.translate('global_fonts_confirm_text')), |
| 28300 |
$inputWrapper = jQuery('<div>', { |
| 28301 |
class: 'e-global__confirm-input-wrapper' |
| 28302 |
}), |
| 28303 |
$input = jQuery('<input>', { |
| 28304 |
type: 'text', |
| 28305 |
name: 'global-name', |
| 28306 |
placeholder: globalData.title |
| 28307 |
}).val(globalData.title); |
| 28308 |
$inputWrapper.append($input); |
| 28309 |
$message.append($messageText, $inputWrapper); |
| 28310 |
return $message; |
| 28311 |
} |
| 28312 |
}, { |
| 28313 |
key: "getGlobalsList", |
| 28314 |
value: function () { |
| 28315 |
var _getGlobalsList = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() { |
| 28316 |
var result; |
| 28317 |
return _regenerator.default.wrap(function _callee$(_context) { |
| 28318 |
while (1) { |
| 28319 |
switch (_context.prev = _context.next) { |
| 28320 |
case 0: |
| 28321 |
_context.next = 2; |
| 28322 |
return $e.data.get(this.getGlobalCommand()); |
| 28323 |
|
| 28324 |
case 2: |
| 28325 |
result = _context.sent; |
| 28326 |
return _context.abrupt("return", result.data); |
| 28327 |
|
| 28328 |
case 4: |
| 28329 |
case "end": |
| 28330 |
return _context.stop(); |
| 28331 |
} |
| 28332 |
} |
| 28333 |
}, _callee, this); |
| 28334 |
})); |
| 28335 |
|
| 28336 |
function getGlobalsList() { |
| 28337 |
return _getGlobalsList.apply(this, arguments); |
| 28338 |
} |
| 28339 |
|
| 28340 |
return getGlobalsList; |
| 28341 |
}() |
| 28342 |
}, { |
| 28343 |
key: "buildGlobalsList", |
| 28344 |
value: function buildGlobalsList(globalTypographies) { |
| 28345 |
var _this = this; |
| 28346 |
|
| 28347 |
var $globalTypographyContainer = jQuery('<div>', { |
| 28348 |
class: 'e-global__preview-items-container' |
| 28349 |
}); |
| 28350 |
(0, _values.default)(globalTypographies).forEach(function (typography) { |
| 28351 |
// Only build markup if the typography is valid. |
| 28352 |
if (typography) { |
| 28353 |
var $typographyPreview = _this.createGlobalItemMarkup(typography); |
| 28354 |
|
| 28355 |
$globalTypographyContainer.append($typographyPreview); |
| 28356 |
} |
| 28357 |
}); |
| 28358 |
return $globalTypographyContainer; |
| 28359 |
} |
| 28360 |
}, { |
| 28361 |
key: "onAddGlobalButtonClick", |
| 28362 |
value: function onAddGlobalButtonClick() { |
| 28363 |
this.triggerMethod('add:global:to:list', this.getAddGlobalConfirmMessage()); |
| 28364 |
} |
| 28365 |
}]); |
| 28366 |
return ControlPopoverStarterView; |
| 28367 |
}(ControlChooseView); |
| 28368 |
|
| 28369 |
exports.default = ControlPopoverStarterView; |
| 28370 |
|
| 28371 |
ControlPopoverStarterView.onPasteStyle = function (control, clipboardValue) { |
| 28372 |
return !clipboardValue || clipboardValue === control.return_value; |
| 28373 |
}; |
| 28374 |
|
| 28375 |
/***/ }), |
| 28376 |
/* 530 */ |
| 28377 |
/***/ (function(module, exports, __webpack_require__) { |
| 28378 |
|
| 28379 |
"use strict"; |
| 28380 |
|
| 28381 |
|
| 28382 |
var _interopRequireDefault = __webpack_require__(0); |
| 28383 |
|
| 28384 |
__webpack_require__(531); |
| 28385 |
|
| 28386 |
var _typeof2 = _interopRequireDefault(__webpack_require__(48)); |
| 28387 |
|
| 28388 |
__webpack_require__(119); |
| 28389 |
|
| 28390 |
__webpack_require__(295); |
| 28391 |
|
| 28392 |
__webpack_require__(80); |
| 28393 |
|
| 28394 |
var _keys = _interopRequireDefault(__webpack_require__(23)); |
| 28395 |
|
| 28396 |
__webpack_require__(58); |
| 28397 |
|
| 28398 |
__webpack_require__(39); |
| 28399 |
|
| 28400 |
__webpack_require__(25); |
| 28401 |
|
| 28402 |
var _colorPicker = _interopRequireDefault(__webpack_require__(301)); |
| 28403 |
|
| 28404 |
var _helper = _interopRequireDefault(__webpack_require__(215)); |
| 28405 |
|
| 28406 |
module.exports = { |
| 28407 |
document: _helper.default, |
| 28408 |
_enqueuedFonts: { |
| 28409 |
editor: [], |
| 28410 |
preview: [] |
| 28411 |
}, |
| 28412 |
_enqueuedIconFonts: [], |
| 28413 |
_inlineSvg: [], |
| 28414 |
elementsHierarchy: { |
| 28415 |
document: { |
| 28416 |
section: { |
| 28417 |
column: { |
| 28418 |
widget: null, |
| 28419 |
section: null |
| 28420 |
} |
| 28421 |
} |
| 28422 |
} |
| 28423 |
}, |
| 28424 |
enqueueCSS: function enqueueCSS(url, $document) { |
| 28425 |
var selector = 'link[href="' + url + '"]', |
| 28426 |
link = '<link href="' + url + '" rel="stylesheet" type="text/css">'; |
| 28427 |
|
| 28428 |
if (!$document) { |
| 28429 |
return; |
| 28430 |
} |
| 28431 |
|
| 28432 |
if (!$document.find(selector).length) { |
| 28433 |
$document.find('link:last').after(link); |
| 28434 |
} |
| 28435 |
}, |
| 28436 |
enqueuePreviewStylesheet: function enqueuePreviewStylesheet(url) { |
| 28437 |
this.enqueueCSS(url, elementor.$previewContents); |
| 28438 |
}, |
| 28439 |
enqueueEditorStylesheet: function enqueueEditorStylesheet(url) { |
| 28440 |
this.enqueueCSS(url, elementorCommon.elements.$document); |
| 28441 |
}, |
| 28442 |
|
| 28443 |
/** |
| 28444 |
* @deprecated 2.6.0 |
| 28445 |
*/ |
| 28446 |
enqueueStylesheet: function enqueueStylesheet(url) { |
| 28447 |
elementorCommon.helpers.hardDeprecated('elementor.helpers.enqueueStylesheet()', '2.6.0', 'elementor.helpers.enqueuePreviewStylesheet()'); |
| 28448 |
this.enqueuePreviewStylesheet(url); |
| 28449 |
}, |
| 28450 |
fetchInlineSvg: function fetchInlineSvg(svgUrl) { |
| 28451 |
var callback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; |
| 28452 |
fetch(svgUrl).then(function (response) { |
| 28453 |
return response.ok ? response.text() : ''; |
| 28454 |
}).then(function (data) { |
| 28455 |
if (callback) { |
| 28456 |
callback(data); |
| 28457 |
} |
| 28458 |
}); |
| 28459 |
}, |
| 28460 |
getInlineSvg: function getInlineSvg(value, view) { |
| 28461 |
if (!value.id) { |
| 28462 |
return; |
| 28463 |
} |
| 28464 |
|
| 28465 |
if (this._inlineSvg.hasOwnProperty(value.id)) { |
| 28466 |
return this._inlineSvg[value.id]; |
| 28467 |
} |
| 28468 |
|
| 28469 |
var self = this; |
| 28470 |
this.fetchInlineSvg(value.url, function (data) { |
| 28471 |
if (data) { |
| 28472 |
self._inlineSvg[value.id] = data; //$( data ).find( 'svg' )[ 0 ].outerHTML; |
| 28473 |
|
| 28474 |
if (view) { |
| 28475 |
view.render(); |
| 28476 |
} |
| 28477 |
|
| 28478 |
elementor.channels.editor.trigger('svg:insertion', data, value.id); |
| 28479 |
} |
| 28480 |
}); |
| 28481 |
}, |
| 28482 |
enqueueIconFonts: function enqueueIconFonts(iconType) { |
| 28483 |
var _this = this; |
| 28484 |
|
| 28485 |
if (-1 !== this._enqueuedIconFonts.indexOf(iconType) || !!elementor.config['icons_update_needed']) { |
| 28486 |
return; |
| 28487 |
} |
| 28488 |
|
| 28489 |
var iconSetting = this.getIconLibrarySettings(iconType); |
| 28490 |
|
| 28491 |
if (!iconSetting) { |
| 28492 |
return; |
| 28493 |
} |
| 28494 |
|
| 28495 |
if (iconSetting.enqueue) { |
| 28496 |
iconSetting.enqueue.forEach(function (assetURL) { |
| 28497 |
_this.enqueuePreviewStylesheet(assetURL); |
| 28498 |
|
| 28499 |
_this.enqueueEditorStylesheet(assetURL); |
| 28500 |
}); |
| 28501 |
} |
| 28502 |
|
| 28503 |
if (iconSetting.url) { |
| 28504 |
this.enqueuePreviewStylesheet(iconSetting.url); |
| 28505 |
this.enqueueEditorStylesheet(iconSetting.url); |
| 28506 |
} |
| 28507 |
|
| 28508 |
this._enqueuedIconFonts.push(iconType); |
| 28509 |
|
| 28510 |
elementor.channels.editor.trigger('fontIcon:insertion', iconType, iconSetting); |
| 28511 |
}, |
| 28512 |
getIconLibrarySettings: function getIconLibrarySettings(iconType) { |
| 28513 |
var iconSetting = elementor.config.icons.libraries.filter(function (library) { |
| 28514 |
return iconType === library.name; |
| 28515 |
}); |
| 28516 |
|
| 28517 |
if (iconSetting[0] && iconSetting[0].name) { |
| 28518 |
return iconSetting[0]; |
| 28519 |
} |
| 28520 |
|
| 28521 |
return false; |
| 28522 |
}, |
| 28523 |
|
| 28524 |
/** |
| 28525 |
* |
| 28526 |
* @param view - view to refresh if needed |
| 28527 |
* @param icon - icon control data |
| 28528 |
* @param attributes - default {} - attributes to attach to rendered html tag |
| 28529 |
* @param tag - default i - html tag to render |
| 28530 |
* @param returnType - default value - retrun type |
| 28531 |
* @returns {string|boolean|*} |
| 28532 |
*/ |
| 28533 |
renderIcon: function renderIcon(view, icon) { |
| 28534 |
var attributes = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; |
| 28535 |
var tag = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 'i'; |
| 28536 |
var returnType = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 'value'; |
| 28537 |
|
| 28538 |
if (!icon || !icon.library) { |
| 28539 |
if ('object' === returnType) { |
| 28540 |
return { |
| 28541 |
rendered: false |
| 28542 |
}; |
| 28543 |
} |
| 28544 |
|
| 28545 |
return; |
| 28546 |
} |
| 28547 |
|
| 28548 |
var iconType = icon.library, |
| 28549 |
iconValue = icon.value; |
| 28550 |
|
| 28551 |
if ('svg' === iconType) { |
| 28552 |
if ('panel' === returnType) { |
| 28553 |
return '<img src="' + iconValue.url + '">'; |
| 28554 |
} |
| 28555 |
|
| 28556 |
return { |
| 28557 |
rendered: true, |
| 28558 |
value: this.getInlineSvg(iconValue, view) |
| 28559 |
}; |
| 28560 |
} |
| 28561 |
|
| 28562 |
var iconSettings = this.getIconLibrarySettings(iconType); |
| 28563 |
|
| 28564 |
if (iconSettings && !iconSettings.hasOwnProperty('isCustom')) { |
| 28565 |
this.enqueueIconFonts(iconType); |
| 28566 |
|
| 28567 |
if ('panel' === returnType) { |
| 28568 |
return '<' + tag + ' class="' + iconValue + '"></' + tag + '>'; |
| 28569 |
} |
| 28570 |
|
| 28571 |
var tagUniqueID = tag + this.getUniqueID(); |
| 28572 |
view.addRenderAttribute(tagUniqueID, attributes); |
| 28573 |
view.addRenderAttribute(tagUniqueID, 'class', iconValue); |
| 28574 |
var htmlTag = '<' + tag + ' ' + view.getRenderAttributeString(tagUniqueID) + '></' + tag + '>'; |
| 28575 |
|
| 28576 |
if ('object' === returnType) { |
| 28577 |
return { |
| 28578 |
rendered: true, |
| 28579 |
value: htmlTag |
| 28580 |
}; |
| 28581 |
} |
| 28582 |
|
| 28583 |
return htmlTag; |
| 28584 |
} |
| 28585 |
|
| 28586 |
elementor.channels.editor.trigger('Icon:insertion', iconType, iconValue, attributes, tag, view); |
| 28587 |
|
| 28588 |
if ('object' === returnType) { |
| 28589 |
return { |
| 28590 |
rendered: false |
| 28591 |
}; |
| 28592 |
} |
| 28593 |
}, |
| 28594 |
isIconMigrated: function isIconMigrated(settings, controlName) { |
| 28595 |
return settings.__fa4_migrated && settings.__fa4_migrated[controlName]; |
| 28596 |
}, |
| 28597 |
fetchFa4ToFa5Mapping: function fetchFa4ToFa5Mapping() { |
| 28598 |
var storageKey = 'fa4Tofa5Mapping'; |
| 28599 |
var mapping = elementorCommon.storage.get(storageKey); |
| 28600 |
|
| 28601 |
if (!mapping) { |
| 28602 |
jQuery.getJSON(elementor.config.fa4_to_fa5_mapping_url, function (data) { |
| 28603 |
mapping = data; |
| 28604 |
elementorCommon.storage.set(storageKey, data); |
| 28605 |
}); |
| 28606 |
} |
| 28607 |
|
| 28608 |
return mapping; |
| 28609 |
}, |
| 28610 |
mapFa4ToFa5: function mapFa4ToFa5(fa4Value) { |
| 28611 |
var mapping = this.fetchFa4ToFa5Mapping(); |
| 28612 |
|
| 28613 |
if (mapping[fa4Value]) { |
| 28614 |
return mapping[fa4Value]; |
| 28615 |
} // every thing else is converted to solid |
| 28616 |
|
| 28617 |
|
| 28618 |
return { |
| 28619 |
value: 'fas' + fa4Value.replace('fa ', ' '), |
| 28620 |
library: 'fa-solid' |
| 28621 |
}; |
| 28622 |
}, |
| 28623 |
// The target parameter = 'editor'/'preview'. Defaults to 'preview' for backwards compatibility. |
| 28624 |
enqueueFont: function enqueueFont(font) { |
| 28625 |
var target = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'preview'; |
| 28626 |
|
| 28627 |
if ($e.devTools) { |
| 28628 |
$e.devTools.log.info("enqueueFont font: '".concat(font, "', target: '").concat(target, "'")); |
| 28629 |
} |
| 28630 |
|
| 28631 |
if (-1 !== this._enqueuedFonts[target].indexOf(font)) { |
| 28632 |
return; |
| 28633 |
} |
| 28634 |
|
| 28635 |
var fontType = elementor.config.controls.font.options[font], |
| 28636 |
subsets = { |
| 28637 |
ru_RU: 'cyrillic', |
| 28638 |
uk: 'cyrillic', |
| 28639 |
bg_BG: 'cyrillic', |
| 28640 |
vi: 'vietnamese', |
| 28641 |
el: 'greek', |
| 28642 |
he_IL: 'hebrew' |
| 28643 |
}; |
| 28644 |
var fontUrl; |
| 28645 |
|
| 28646 |
switch (fontType) { |
| 28647 |
case 'googlefonts': |
| 28648 |
fontUrl = 'https://fonts.googleapis.com/css?family=' + font + ':100,100italic,200,200italic,300,300italic,400,400italic,500,500italic,600,600italic,700,700italic,800,800italic,900,900italic'; |
| 28649 |
|
| 28650 |
if (subsets[elementor.config.locale]) { |
| 28651 |
fontUrl += '&subset=' + subsets[elementor.config.locale]; |
| 28652 |
} |
| 28653 |
|
| 28654 |
break; |
| 28655 |
|
| 28656 |
case 'earlyaccess': |
| 28657 |
var fontLowerString = font.replace(/\s+/g, '').toLowerCase(); |
| 28658 |
fontUrl = 'https://fonts.googleapis.com/earlyaccess/' + fontLowerString + '.css'; |
| 28659 |
break; |
| 28660 |
} |
| 28661 |
|
| 28662 |
if (!_.isEmpty(fontUrl)) { |
| 28663 |
if ('editor' === target) { |
| 28664 |
// TODO: Find better solution, temporary fix, covering issue: 'fonts does not rendered in global styles'. |
| 28665 |
this.enqueueCSS(fontUrl, elementorCommon.elements.$document); |
| 28666 |
} else { |
| 28667 |
this.enqueueCSS(fontUrl, elementor.$previewContents); |
| 28668 |
} |
| 28669 |
} |
| 28670 |
|
| 28671 |
this._enqueuedFonts[target].push(font); |
| 28672 |
|
| 28673 |
elementor.channels.editor.trigger('font:insertion', fontType, font); |
| 28674 |
}, |
| 28675 |
resetEnqueuedFontsCache: function resetEnqueuedFontsCache() { |
| 28676 |
this._enqueuedFonts = { |
| 28677 |
editor: [], |
| 28678 |
preview: [] |
| 28679 |
}; |
| 28680 |
this._enqueuedIconFonts = []; |
| 28681 |
}, |
| 28682 |
getElementChildType: function getElementChildType(elementType, container) { |
| 28683 |
var _this2 = this; |
| 28684 |
|
| 28685 |
if (!container) { |
| 28686 |
container = this.elementsHierarchy; |
| 28687 |
} |
| 28688 |
|
| 28689 |
if (undefined !== container[elementType]) { |
| 28690 |
if (jQuery.isPlainObject(container[elementType])) { |
| 28691 |
return (0, _keys.default)(container[elementType]); |
| 28692 |
} |
| 28693 |
|
| 28694 |
return null; |
| 28695 |
} |
| 28696 |
|
| 28697 |
var result = null; |
| 28698 |
jQuery.each(container, function (index, type) { |
| 28699 |
if (!jQuery.isPlainObject(type)) { |
| 28700 |
return; |
| 28701 |
} |
| 28702 |
|
| 28703 |
var childType = _this2.getElementChildType(elementType, type); |
| 28704 |
|
| 28705 |
if (childType) { |
| 28706 |
result = childType; |
| 28707 |
return false; |
| 28708 |
} |
| 28709 |
}); |
| 28710 |
return result; |
| 28711 |
}, |
| 28712 |
getUniqueID: function getUniqueID() { |
| 28713 |
elementorCommon.helpers.softDeprecated('elementor.helpers.getUniqueID()', '3.0.0', 'elementorCommon.helpers.getUniqueId()'); |
| 28714 |
return elementorCommon.helpers.getUniqueId(); |
| 28715 |
}, |
| 28716 |
getSocialNetworkNameFromIcon: function getSocialNetworkNameFromIcon(iconsControl, fallbackControl) { |
| 28717 |
var toUpperCase = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; |
| 28718 |
var migrated = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null; |
| 28719 |
var withIcon = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false; |
| 28720 |
var social = '', |
| 28721 |
icon = ''; |
| 28722 |
|
| 28723 |
if (fallbackControl && !migrated) { |
| 28724 |
social = fallbackControl.replace('fa fa-', ''); |
| 28725 |
icon = '<i class="' + fallbackControl + '"></i>'; |
| 28726 |
} else if (iconsControl.value && 'svg' !== iconsControl.library) { |
| 28727 |
social = iconsControl.value.split(' ')[1]; |
| 28728 |
|
| 28729 |
if (!social) { |
| 28730 |
social = ''; |
| 28731 |
} else { |
| 28732 |
social = social.replace('fa-', ''); |
| 28733 |
} |
| 28734 |
|
| 28735 |
icon = this.renderIcon(null, iconsControl, {}, 'i', 'panel'); |
| 28736 |
} else { |
| 28737 |
icon = this.renderIcon(null, iconsControl, {}, 'i', 'panel'); |
| 28738 |
} |
| 28739 |
|
| 28740 |
if ('' !== social && toUpperCase) { |
| 28741 |
social = social.split('-').join(' '); |
| 28742 |
social = social.replace(/\b\w/g, function (letter) { |
| 28743 |
return letter.toUpperCase(); |
| 28744 |
}); |
| 28745 |
} |
| 28746 |
|
| 28747 |
social = elementor.hooks.applyFilters('elementor/social_icons/network_name', social, iconsControl, fallbackControl, toUpperCase, withIcon); |
| 28748 |
|
| 28749 |
if (withIcon) { |
| 28750 |
social = icon + ' ' + social; |
| 28751 |
} |
| 28752 |
|
| 28753 |
return social; |
| 28754 |
}, |
| 28755 |
getSimpleDialog: function getSimpleDialog(id, title, message, confirmString, onConfirm) { |
| 28756 |
return elementorCommon.dialogsManager.createWidget('confirm', { |
| 28757 |
id: id, |
| 28758 |
headerMessage: title, |
| 28759 |
message: message, |
| 28760 |
position: { |
| 28761 |
my: 'center center', |
| 28762 |
at: 'center center' |
| 28763 |
}, |
| 28764 |
strings: { |
| 28765 |
confirm: confirmString, |
| 28766 |
cancel: elementor.translate('cancel') |
| 28767 |
}, |
| 28768 |
onConfirm: onConfirm |
| 28769 |
}); |
| 28770 |
}, |
| 28771 |
maybeDisableWidget: function maybeDisableWidget() { |
| 28772 |
if (!elementor.config['icons_update_needed']) { |
| 28773 |
return false; |
| 28774 |
} |
| 28775 |
|
| 28776 |
var elementView = elementor.channels.panelElements.request('element:selected'), |
| 28777 |
widgetType = elementView.model.get('widgetType'), |
| 28778 |
widgetData = elementor.widgetsCache[widgetType], |
| 28779 |
hasControlOfType = function hasControlOfType(controls, type) { |
| 28780 |
var has = false; |
| 28781 |
jQuery.each(controls, function (controlName, controlData) { |
| 28782 |
if (type === controlData.type) { |
| 28783 |
has = true; |
| 28784 |
return false; |
| 28785 |
} |
| 28786 |
|
| 28787 |
if (controlData.is_repeater) { |
| 28788 |
has = hasControlOfType(controlData.fields, type); |
| 28789 |
|
| 28790 |
if (has) { |
| 28791 |
return false; |
| 28792 |
} |
| 28793 |
} |
| 28794 |
}); |
| 28795 |
return has; |
| 28796 |
}; |
| 28797 |
|
| 28798 |
if (widgetData) { |
| 28799 |
var hasIconsControl = hasControlOfType(widgetData.controls, 'icons'); |
| 28800 |
|
| 28801 |
if (hasIconsControl) { |
| 28802 |
var onConfirm = function onConfirm() { |
| 28803 |
window.location.href = elementor.config.tools_page_link + '&redirect_to=' + encodeURIComponent(document.location.href) + '#tab-fontawesome4_migration'; |
| 28804 |
}; |
| 28805 |
|
| 28806 |
elementor.helpers.getSimpleDialog('elementor-enable-fa5-dialog', elementor.translate('enable_fa5'), elementor.translate('dialog_confirm_enable_fa5'), elementor.translate('update'), onConfirm).show(); |
| 28807 |
return true; |
| 28808 |
} |
| 28809 |
} |
| 28810 |
|
| 28811 |
return false; |
| 28812 |
}, |
| 28813 |
|
| 28814 |
/* |
| 28815 |
* @deprecated 2.0.0 |
| 28816 |
*/ |
| 28817 |
stringReplaceAll: function stringReplaceAll(string, replaces) { |
| 28818 |
var re = new RegExp((0, _keys.default)(replaces).join('|'), 'gi'); |
| 28819 |
return string.replace(re, function (matched) { |
| 28820 |
return replaces[matched]; |
| 28821 |
}); |
| 28822 |
}, |
| 28823 |
isActiveControl: function isActiveControl(controlModel, values) { |
| 28824 |
var condition, conditions; // TODO: Better way to get this? |
| 28825 |
|
| 28826 |
if (_.isFunction(controlModel.get)) { |
| 28827 |
condition = controlModel.get('condition'); |
| 28828 |
conditions = controlModel.get('conditions'); |
| 28829 |
} else { |
| 28830 |
condition = controlModel.condition; |
| 28831 |
conditions = controlModel.conditions; |
| 28832 |
} // Multiple conditions with relations. |
| 28833 |
|
| 28834 |
|
| 28835 |
if (conditions && !elementor.conditions.check(conditions, values)) { |
| 28836 |
return false; |
| 28837 |
} |
| 28838 |
|
| 28839 |
if (_.isEmpty(condition)) { |
| 28840 |
return true; |
| 28841 |
} |
| 28842 |
|
| 28843 |
var hasFields = _.filter(condition, function (conditionValue, conditionName) { |
| 28844 |
var conditionNameParts = conditionName.match(/([a-z_\-0-9]+)(?:\[([a-z_]+)])?(!?)$/i), |
| 28845 |
conditionRealName = conditionNameParts[1], |
| 28846 |
conditionSubKey = conditionNameParts[2], |
| 28847 |
isNegativeCondition = !!conditionNameParts[3], |
| 28848 |
controlValue = values[conditionRealName]; |
| 28849 |
|
| 28850 |
if (values.__dynamic__ && values.__dynamic__[conditionRealName]) { |
| 28851 |
controlValue = values.__dynamic__[conditionRealName]; |
| 28852 |
} |
| 28853 |
|
| 28854 |
if (undefined === controlValue) { |
| 28855 |
return true; |
| 28856 |
} |
| 28857 |
|
| 28858 |
if (conditionSubKey && 'object' === (0, _typeof2.default)(controlValue)) { |
| 28859 |
controlValue = controlValue[conditionSubKey]; |
| 28860 |
} // If it's a non empty array - check if the conditionValue contains the controlValue, |
| 28861 |
// If the controlValue is a non empty array - check if the controlValue contains the conditionValue |
| 28862 |
// otherwise check if they are equal. ( and give the ability to check if the value is an empty array ) |
| 28863 |
|
| 28864 |
|
| 28865 |
var isContains; |
| 28866 |
|
| 28867 |
if (_.isArray(conditionValue) && !_.isEmpty(conditionValue)) { |
| 28868 |
isContains = _.contains(conditionValue, controlValue); |
| 28869 |
} else if (_.isArray(controlValue) && !_.isEmpty(controlValue)) { |
| 28870 |
isContains = _.contains(controlValue, conditionValue); |
| 28871 |
} else { |
| 28872 |
isContains = _.isEqual(conditionValue, controlValue); |
| 28873 |
} |
| 28874 |
|
| 28875 |
return isNegativeCondition ? isContains : !isContains; |
| 28876 |
}); |
| 28877 |
|
| 28878 |
return _.isEmpty(hasFields); |
| 28879 |
}, |
| 28880 |
cloneObject: function cloneObject(object) { |
| 28881 |
elementorCommon.helpers.hardDeprecated('elementor.helpers.cloneObject', '2.3.0', 'elementorCommon.helpers.cloneObject'); |
| 28882 |
return elementorCommon.helpers.cloneObject(object); |
| 28883 |
}, |
| 28884 |
disableElementEvents: function disableElementEvents($element) { |
| 28885 |
$element.each(function () { |
| 28886 |
var currentPointerEvents = this.style.pointerEvents; |
| 28887 |
|
| 28888 |
if ('none' === currentPointerEvents) { |
| 28889 |
return; |
| 28890 |
} |
| 28891 |
|
| 28892 |
jQuery(this).data('backup-pointer-events', currentPointerEvents).css('pointer-events', 'none'); |
| 28893 |
}); |
| 28894 |
}, |
| 28895 |
enableElementEvents: function enableElementEvents($element) { |
| 28896 |
$element.each(function () { |
| 28897 |
var $this = jQuery(this), |
| 28898 |
backupPointerEvents = $this.data('backup-pointer-events'); |
| 28899 |
|
| 28900 |
if (undefined === backupPointerEvents) { |
| 28901 |
return; |
| 28902 |
} |
| 28903 |
|
| 28904 |
$this.removeData('backup-pointer-events').css('pointer-events', backupPointerEvents); |
| 28905 |
}); |
| 28906 |
}, |
| 28907 |
wpColorPicker: function wpColorPicker($element) { |
| 28908 |
elementorCommon.helpers.deprecatedMethod('elementor.helpers.wpColorPicker()', '2.8.0', 'new ColorPicker()'); |
| 28909 |
return new _colorPicker.default({ |
| 28910 |
picker: { |
| 28911 |
el: $element |
| 28912 |
} |
| 28913 |
}); |
| 28914 |
}, |
| 28915 |
isInViewport: function isInViewport(element, html) { |
| 28916 |
var rect = element.getBoundingClientRect(); |
| 28917 |
html = html || document.documentElement; |
| 28918 |
return rect.top >= 0 && rect.left >= 0 && rect.bottom <= (window.innerHeight || html.clientHeight) && rect.right <= (window.innerWidth || html.clientWidth); |
| 28919 |
}, |
| 28920 |
scrollToView: function scrollToView($element, timeout, $parent) { |
| 28921 |
if (undefined === timeout) { |
| 28922 |
timeout = 500; |
| 28923 |
} |
| 28924 |
|
| 28925 |
var $scrolled = $parent; |
| 28926 |
var $elementorFrontendWindow = elementorFrontend.elements.$window; |
| 28927 |
|
| 28928 |
if (!$parent) { |
| 28929 |
$parent = $elementorFrontendWindow; |
| 28930 |
$scrolled = elementor.$previewContents.find('html, body'); |
| 28931 |
} |
| 28932 |
|
| 28933 |
setTimeout(function () { |
| 28934 |
// Sometimes element removed during the timeout. |
| 28935 |
if (!$element[0].isConnected) { |
| 28936 |
return; |
| 28937 |
} |
| 28938 |
|
| 28939 |
var parentHeight = $parent.height(), |
| 28940 |
parentScrollTop = $parent.scrollTop(), |
| 28941 |
elementTop = $parent === $elementorFrontendWindow ? $element.offset().top : $element[0].offsetTop, |
| 28942 |
topToCheck = elementTop - parentScrollTop; |
| 28943 |
|
| 28944 |
if (topToCheck > 0 && topToCheck < parentHeight) { |
| 28945 |
return; |
| 28946 |
} |
| 28947 |
|
| 28948 |
var scrolling = elementTop - parentHeight / 2; |
| 28949 |
$scrolled.stop(true).animate({ |
| 28950 |
scrollTop: scrolling |
| 28951 |
}, 1000); |
| 28952 |
}, timeout); |
| 28953 |
}, |
| 28954 |
getElementInlineStyle: function getElementInlineStyle($element, properties) { |
| 28955 |
var style = {}, |
| 28956 |
elementStyle = $element[0].style; |
| 28957 |
properties.forEach(function (property) { |
| 28958 |
style[property] = undefined !== elementStyle[property] ? elementStyle[property] : ''; |
| 28959 |
}); |
| 28960 |
return style; |
| 28961 |
}, |
| 28962 |
cssWithBackup: function cssWithBackup($element, backupState, rules) { |
| 28963 |
var cssBackup = this.getElementInlineStyle($element, (0, _keys.default)(rules)); |
| 28964 |
$element.data('css-backup-' + backupState, cssBackup).css(rules); |
| 28965 |
}, |
| 28966 |
recoverCSSBackup: function recoverCSSBackup($element, backupState) { |
| 28967 |
var backupKey = 'css-backup-' + backupState; |
| 28968 |
$element.css($element.data(backupKey)); |
| 28969 |
$element.removeData(backupKey); |
| 28970 |
}, |
| 28971 |
elementSizeToUnit: function elementSizeToUnit($element, size, unit) { |
| 28972 |
var window = elementorFrontend.elements.window; |
| 28973 |
|
| 28974 |
switch (unit) { |
| 28975 |
case '%': |
| 28976 |
size = size / ($element.offsetParent().width() / 100); |
| 28977 |
break; |
| 28978 |
|
| 28979 |
case 'vw': |
| 28980 |
size = size / (window.innerWidth / 100); |
| 28981 |
break; |
| 28982 |
|
| 28983 |
case 'vh': |
| 28984 |
size = size / (window.innerHeight / 100); |
| 28985 |
} |
| 28986 |
|
| 28987 |
return Math.round(size * 1000) / 1000; |
| 28988 |
}, |
| 28989 |
compareVersions: function compareVersions(versionA, versionB, operator) { |
| 28990 |
var prepareVersion = function prepareVersion(version) { |
| 28991 |
version = version + ''; |
| 28992 |
return version.replace(/[^\d.]+/, '.-1.'); |
| 28993 |
}; |
| 28994 |
|
| 28995 |
versionA = prepareVersion(versionA); |
| 28996 |
versionB = prepareVersion(versionB); |
| 28997 |
|
| 28998 |
if (versionA === versionB) { |
| 28999 |
return !operator || /^={2,3}$/.test(operator); |
| 29000 |
} |
| 29001 |
|
| 29002 |
var versionAParts = versionA.split('.').map(Number), |
| 29003 |
versionBParts = versionB.split('.').map(Number), |
| 29004 |
longestVersionParts = Math.max(versionAParts.length, versionBParts.length); |
| 29005 |
|
| 29006 |
for (var i = 0; i < longestVersionParts; i++) { |
| 29007 |
var valueA = versionAParts[i] || 0, |
| 29008 |
valueB = versionBParts[i] || 0; |
| 29009 |
|
| 29010 |
if (valueA !== valueB) { |
| 29011 |
return elementor.conditions.compare(valueA, valueB, operator); |
| 29012 |
} |
| 29013 |
} |
| 29014 |
}, |
| 29015 |
getModelLabel: function getModelLabel(model) { |
| 29016 |
var result; |
| 29017 |
|
| 29018 |
if (!(model instanceof Backbone.Model)) { |
| 29019 |
model = new Backbone.Model(model); |
| 29020 |
} |
| 29021 |
|
| 29022 |
if (model.get('labelSuffix')) { |
| 29023 |
result = model.get('title') + ' ' + model.get('labelSuffix'); |
| 29024 |
} else if ('global' === model.get('widgetType')) { |
| 29025 |
if (model.getTitle) { |
| 29026 |
result = model.getTitle(); |
| 29027 |
} |
| 29028 |
} |
| 29029 |
|
| 29030 |
if (!result) { |
| 29031 |
result = elementor.getElementData(model).title; |
| 29032 |
} |
| 29033 |
|
| 29034 |
return result; |
| 29035 |
}, |
| 29036 |
hasPro: function hasPro() { |
| 29037 |
return !!window.elementorPro; |
| 29038 |
} |
| 29039 |
}; |
| 29040 |
|
| 29041 |
/***/ }), |
| 29042 |
/* 531 */ |
| 29043 |
/***/ (function(module, exports, __webpack_require__) { |
| 29044 |
|
| 29045 |
"use strict"; |
| 29046 |
|
| 29047 |
var global = __webpack_require__(17); |
| 29048 |
var has = __webpack_require__(61); |
| 29049 |
var cof = __webpack_require__(46); |
| 29050 |
var inheritIfRequired = __webpack_require__(310); |
| 29051 |
var toPrimitive = __webpack_require__(123); |
| 29052 |
var fails = __webpack_require__(33); |
| 29053 |
var gOPN = __webpack_require__(312).f; |
| 29054 |
var gOPD = __webpack_require__(311).f; |
| 29055 |
var dP = __webpack_require__(45).f; |
| 29056 |
var $trim = __webpack_require__(532).trim; |
| 29057 |
var NUMBER = 'Number'; |
| 29058 |
var $Number = global[NUMBER]; |
| 29059 |
var Base = $Number; |
| 29060 |
var proto = $Number.prototype; |
| 29061 |
// Opera ~12 has broken Object#toString |
| 29062 |
var BROKEN_COF = cof(__webpack_require__(226)(proto)) == NUMBER; |
| 29063 |
var TRIM = 'trim' in String.prototype; |
| 29064 |
|
| 29065 |
// 7.1.3 ToNumber(argument) |
| 29066 |
var toNumber = function (argument) { |
| 29067 |
var it = toPrimitive(argument, false); |
| 29068 |
if (typeof it == 'string' && it.length > 2) { |
| 29069 |
it = TRIM ? it.trim() : $trim(it, 3); |
| 29070 |
var first = it.charCodeAt(0); |
| 29071 |
var third, radix, maxCode; |
| 29072 |
if (first === 43 || first === 45) { |
| 29073 |
third = it.charCodeAt(2); |
| 29074 |
if (third === 88 || third === 120) return NaN; // Number('+0x1') should be NaN, old V8 fix |
| 29075 |
} else if (first === 48) { |
| 29076 |
switch (it.charCodeAt(1)) { |
| 29077 |
case 66: case 98: radix = 2; maxCode = 49; break; // fast equal /^0b[01]+$/i |
| 29078 |
case 79: case 111: radix = 8; maxCode = 55; break; // fast equal /^0o[0-7]+$/i |
| 29079 |
default: return +it; |
| 29080 |
} |
| 29081 |
for (var digits = it.slice(2), i = 0, l = digits.length, code; i < l; i++) { |
| 29082 |
code = digits.charCodeAt(i); |
| 29083 |
// parseInt parses a string to a first unavailable symbol |
| 29084 |
// but ToNumber should return NaN if a string contains unavailable symbols |
| 29085 |
if (code < 48 || code > maxCode) return NaN; |
| 29086 |
} return parseInt(digits, radix); |
| 29087 |
} |
| 29088 |
} return +it; |
| 29089 |
}; |
| 29090 |
|
| 29091 |
if (!$Number(' 0o1') || !$Number('0b1') || $Number('+0x1')) { |
| 29092 |
$Number = function Number(value) { |
| 29093 |
var it = arguments.length < 1 ? 0 : value; |
| 29094 |
var that = this; |
| 29095 |
return that instanceof $Number |
| 29096 |
// check on 1..constructor(foo) case |
| 29097 |
&& (BROKEN_COF ? fails(function () { proto.valueOf.call(that); }) : cof(that) != NUMBER) |
| 29098 |
? inheritIfRequired(new Base(toNumber(it)), that, $Number) : toNumber(it); |
| 29099 |
}; |
| 29100 |
for (var keys = __webpack_require__(27) ? gOPN(Base) : ( |
| 29101 |
// ES3: |
| 29102 |
'MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,' + |
| 29103 |
// ES6 (in case, if modules with ES6 Number statics required before): |
| 29104 |
'EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,' + |
| 29105 |
'MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger' |
| 29106 |
).split(','), j = 0, key; keys.length > j; j++) { |
| 29107 |
if (has(Base, key = keys[j]) && !has($Number, key)) { |
| 29108 |
dP($Number, key, gOPD(Base, key)); |
| 29109 |
} |
| 29110 |
} |
| 29111 |
$Number.prototype = proto; |
| 29112 |
proto.constructor = $Number; |
| 29113 |
__webpack_require__(37)(global, NUMBER, $Number); |
| 29114 |
} |
| 29115 |
|
| 29116 |
|
| 29117 |
/***/ }), |
| 29118 |
/* 532 */ |
| 29119 |
/***/ (function(module, exports, __webpack_require__) { |
| 29120 |
|
| 29121 |
var $export = __webpack_require__(34); |
| 29122 |
var defined = __webpack_require__(42); |
| 29123 |
var fails = __webpack_require__(33); |
| 29124 |
var spaces = __webpack_require__(533); |
| 29125 |
var space = '[' + spaces + ']'; |
| 29126 |
var non = '\u200b\u0085'; |
| 29127 |
var ltrim = RegExp('^' + space + space + '*'); |
| 29128 |
var rtrim = RegExp(space + space + '*$'); |
| 29129 |
|
| 29130 |
var exporter = function (KEY, exec, ALIAS) { |
| 29131 |
var exp = {}; |
| 29132 |
var FORCE = fails(function () { |
| 29133 |
return !!spaces[KEY]() || non[KEY]() != non; |
| 29134 |
}); |
| 29135 |
var fn = exp[KEY] = FORCE ? exec(trim) : spaces[KEY]; |
| 29136 |
if (ALIAS) exp[ALIAS] = fn; |
| 29137 |
$export($export.P + $export.F * FORCE, 'String', exp); |
| 29138 |
}; |
| 29139 |
|
| 29140 |
// 1 -> String#trimLeft |
| 29141 |
// 2 -> String#trimRight |
| 29142 |
// 3 -> String#trim |
| 29143 |
var trim = exporter.trim = function (string, TYPE) { |
| 29144 |
string = String(defined(string)); |
| 29145 |
if (TYPE & 1) string = string.replace(ltrim, ''); |
| 29146 |
if (TYPE & 2) string = string.replace(rtrim, ''); |
| 29147 |
return string; |
| 29148 |
}; |
| 29149 |
|
| 29150 |
module.exports = exporter; |
| 29151 |
|
| 29152 |
|
| 29153 |
/***/ }), |
| 29154 |
/* 533 */ |
| 29155 |
/***/ (function(module, exports) { |
| 29156 |
|
| 29157 |
module.exports = '\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003' + |
| 29158 |
'\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF'; |
| 29159 |
|
| 29160 |
|
| 29161 |
/***/ }), |
| 29162 |
/* 534 */ |
| 29163 |
/***/ (function(module, exports, __webpack_require__) { |
| 29164 |
|
| 29165 |
"use strict"; |
| 29166 |
|
| 29167 |
|
| 29168 |
var _interopRequireDefault = __webpack_require__(0); |
| 29169 |
|
| 29170 |
var _keys = _interopRequireDefault(__webpack_require__(23)); |
| 29171 |
|
| 29172 |
var ImagesManager; |
| 29173 |
|
| 29174 |
ImagesManager = function ImagesManager() { |
| 29175 |
var self = this; |
| 29176 |
var cache = {}; |
| 29177 |
var debounceDelay = 300; |
| 29178 |
var registeredItems = []; |
| 29179 |
|
| 29180 |
var getNormalizedSize = function getNormalizedSize(image) { |
| 29181 |
var size, |
| 29182 |
imageSize = image.size; |
| 29183 |
|
| 29184 |
if ('custom' === imageSize) { |
| 29185 |
var customDimension = image.dimension; |
| 29186 |
|
| 29187 |
if (customDimension.width || customDimension.height) { |
| 29188 |
size = 'custom_' + customDimension.width + 'x' + customDimension.height; |
| 29189 |
} else { |
| 29190 |
return 'full'; |
| 29191 |
} |
| 29192 |
} else { |
| 29193 |
size = imageSize; |
| 29194 |
} |
| 29195 |
|
| 29196 |
return size; |
| 29197 |
}; |
| 29198 |
|
| 29199 |
var viewsToUpdate = {}; |
| 29200 |
|
| 29201 |
self.updateOnReceiveImage = function () { |
| 29202 |
var elementView = elementor.getPanelView().getCurrentPageView().getOption('editedElementView'); |
| 29203 |
elementView.$el.addClass('elementor-loading'); // Add per cid for multiple images in a single view. |
| 29204 |
|
| 29205 |
viewsToUpdate[elementView.cid] = elementView; |
| 29206 |
elementor.channels.editor.once('imagesManager:detailsReceived', function () { |
| 29207 |
if (!_.isEmpty(viewsToUpdate)) { |
| 29208 |
_(viewsToUpdate).each(function (view) { |
| 29209 |
view.render(); |
| 29210 |
view.$el.removeClass('elementor-loading'); |
| 29211 |
}); |
| 29212 |
} |
| 29213 |
|
| 29214 |
viewsToUpdate = {}; |
| 29215 |
}); |
| 29216 |
}; |
| 29217 |
|
| 29218 |
self.getImageUrl = function (image) { |
| 29219 |
// Register for AJAX checking |
| 29220 |
self.registerItem(image); |
| 29221 |
var imageUrl = self.getItem(image); // If it's not in cache, like a new dropped widget or a custom size - get from settings |
| 29222 |
|
| 29223 |
if (!imageUrl) { |
| 29224 |
if ('custom' === image.size) { |
| 29225 |
if ($e.routes.isPartOf('panel/editor') && image.model) { |
| 29226 |
self.updateOnReceiveImage(); |
| 29227 |
} |
| 29228 |
|
| 29229 |
return; |
| 29230 |
} // If it's a new dropped widget |
| 29231 |
|
| 29232 |
|
| 29233 |
imageUrl = image.url; |
| 29234 |
} |
| 29235 |
|
| 29236 |
return imageUrl; |
| 29237 |
}; |
| 29238 |
|
| 29239 |
self.getItem = function (image) { |
| 29240 |
var size = getNormalizedSize(image), |
| 29241 |
id = image.id; |
| 29242 |
|
| 29243 |
if (!size) { |
| 29244 |
return false; |
| 29245 |
} |
| 29246 |
|
| 29247 |
if (cache[id] && cache[id][size]) { |
| 29248 |
return cache[id][size]; |
| 29249 |
} |
| 29250 |
|
| 29251 |
return false; |
| 29252 |
}; |
| 29253 |
|
| 29254 |
self.registerItem = function (image) { |
| 29255 |
if ('' === image.id) { |
| 29256 |
// It's a new dropped widget |
| 29257 |
return; |
| 29258 |
} |
| 29259 |
|
| 29260 |
if (self.getItem(image)) { |
| 29261 |
// It's already in cache |
| 29262 |
return; |
| 29263 |
} |
| 29264 |
|
| 29265 |
registeredItems.push(image); |
| 29266 |
self.debounceGetRemoteItems(); |
| 29267 |
}; |
| 29268 |
|
| 29269 |
self.getRemoteItems = function () { |
| 29270 |
var requestedItems = [], |
| 29271 |
registeredItemsLength = (0, _keys.default)(registeredItems).length, |
| 29272 |
image, |
| 29273 |
index; // It's one item, so we can render it from remote server |
| 29274 |
|
| 29275 |
if (0 === registeredItemsLength) { |
| 29276 |
return; |
| 29277 |
} |
| 29278 |
|
| 29279 |
for (index in registeredItems) { |
| 29280 |
image = registeredItems[index]; |
| 29281 |
var size = getNormalizedSize(image), |
| 29282 |
id = image.id, |
| 29283 |
isFirstTime = !cache[id] || 0 === (0, _keys.default)(cache[id]).length; |
| 29284 |
requestedItems.push({ |
| 29285 |
id: id, |
| 29286 |
size: size, |
| 29287 |
is_first_time: isFirstTime |
| 29288 |
}); |
| 29289 |
} |
| 29290 |
|
| 29291 |
elementorCommon.ajax.send('get_images_details', { |
| 29292 |
data: { |
| 29293 |
items: requestedItems |
| 29294 |
}, |
| 29295 |
success: function success(data) { |
| 29296 |
var imageId, imageSize; |
| 29297 |
|
| 29298 |
for (imageId in data) { |
| 29299 |
if (!cache[imageId]) { |
| 29300 |
cache[imageId] = {}; |
| 29301 |
} |
| 29302 |
|
| 29303 |
for (imageSize in data[imageId]) { |
| 29304 |
cache[imageId][imageSize] = data[imageId][imageSize]; |
| 29305 |
} |
| 29306 |
} |
| 29307 |
|
| 29308 |
registeredItems = []; |
| 29309 |
elementor.channels.editor.trigger('imagesManager:detailsReceived', data); |
| 29310 |
} |
| 29311 |
}); |
| 29312 |
}; |
| 29313 |
|
| 29314 |
self.debounceGetRemoteItems = _.debounce(self.getRemoteItems, debounceDelay); |
| 29315 |
}; |
| 29316 |
|
| 29317 |
module.exports = new ImagesManager(); |
| 29318 |
|
| 29319 |
/***/ }), |
| 29320 |
/* 535 */ |
| 29321 |
/***/ (function(module, exports, __webpack_require__) { |
| 29322 |
|
| 29323 |
"use strict"; |
| 29324 |
|
| 29325 |
|
| 29326 |
var _interopRequireDefault = __webpack_require__(0); |
| 29327 |
|
| 29328 |
var _keys = _interopRequireDefault(__webpack_require__(23)); |
| 29329 |
|
| 29330 |
var _stringify = _interopRequireDefault(__webpack_require__(206)); |
| 29331 |
|
| 29332 |
__webpack_require__(25); |
| 29333 |
|
| 29334 |
var Schemes, |
| 29335 |
Stylesheet = __webpack_require__(332), |
| 29336 |
ControlsCSSParser = __webpack_require__(293); |
| 29337 |
|
| 29338 |
Schemes = function Schemes() { |
| 29339 |
var self = this, |
| 29340 |
stylesheet = new Stylesheet(), |
| 29341 |
schemes = {}, |
| 29342 |
settings = { |
| 29343 |
selectorWrapperPrefix: '.elementor-widget-' |
| 29344 |
}, |
| 29345 |
elements = {}; |
| 29346 |
|
| 29347 |
var buildUI = function buildUI() { |
| 29348 |
elements.$previewHead.append(elements.$style); |
| 29349 |
}; |
| 29350 |
|
| 29351 |
var initElements = function initElements() { |
| 29352 |
var id = 'elementor-style-scheme'; |
| 29353 |
elements.$style = elementor.$previewContents.find("#".concat(id)); |
| 29354 |
|
| 29355 |
if (!elements.$style.length) { |
| 29356 |
elements.$style = jQuery('<style>', { |
| 29357 |
id: id |
| 29358 |
}); |
| 29359 |
} |
| 29360 |
|
| 29361 |
elements.$previewHead = elementor.$previewContents.find('head'); |
| 29362 |
}; |
| 29363 |
|
| 29364 |
var initSchemes = function initSchemes() { |
| 29365 |
schemes = elementorCommon.helpers.cloneObject(elementor.config.schemes.items); |
| 29366 |
}; |
| 29367 |
|
| 29368 |
var fetchControlStyles = function fetchControlStyles(control, controlsStack, widgetType) { |
| 29369 |
ControlsCSSParser.addControlStyleRules(stylesheet, control, controlsStack, function (controlStyles) { |
| 29370 |
return self.getSchemeValue(controlStyles.scheme.type, controlStyles.scheme.value, controlStyles.scheme.key).value; |
| 29371 |
}, ['{{WRAPPER}}'], [settings.selectorWrapperPrefix + widgetType]); |
| 29372 |
}; |
| 29373 |
|
| 29374 |
var fetchWidgetControlsStyles = function fetchWidgetControlsStyles(widget) { |
| 29375 |
var widgetSchemeControls = self.getWidgetSchemeControls(widget); |
| 29376 |
|
| 29377 |
_.each(widgetSchemeControls, function (control) { |
| 29378 |
fetchControlStyles(control, widgetSchemeControls, widget.widget_type); |
| 29379 |
}); |
| 29380 |
}; |
| 29381 |
|
| 29382 |
var fetchAllWidgetsSchemesStyle = function fetchAllWidgetsSchemesStyle() { |
| 29383 |
_.each(elementor.widgetsCache, function (widget) { |
| 29384 |
fetchWidgetControlsStyles(widget); |
| 29385 |
}); |
| 29386 |
}; |
| 29387 |
|
| 29388 |
this.init = function () { |
| 29389 |
initElements(); |
| 29390 |
buildUI(); |
| 29391 |
initSchemes(); |
| 29392 |
return self; |
| 29393 |
}; |
| 29394 |
|
| 29395 |
this.getWidgetSchemeControls = function (widget) { |
| 29396 |
return _.filter(widget.controls, function (control) { |
| 29397 |
return _.isObject(control.scheme); |
| 29398 |
}); |
| 29399 |
}; |
| 29400 |
|
| 29401 |
this.getSchemes = function () { |
| 29402 |
return schemes; |
| 29403 |
}; |
| 29404 |
|
| 29405 |
this.getEnabledSchemesTypes = function () { |
| 29406 |
return elementor.config.schemes.enabled_schemes; |
| 29407 |
}; |
| 29408 |
|
| 29409 |
this.getScheme = function (schemeType) { |
| 29410 |
return schemes[schemeType]; |
| 29411 |
}; |
| 29412 |
|
| 29413 |
this.getSchemeValue = function (schemeType, value, key) { |
| 29414 |
if (this.getEnabledSchemesTypes().indexOf(schemeType) < 0) { |
| 29415 |
return false; |
| 29416 |
} |
| 29417 |
|
| 29418 |
var scheme = self.getScheme(schemeType), |
| 29419 |
schemeValue = scheme.items[value]; |
| 29420 |
|
| 29421 |
if (key && _.isObject(schemeValue)) { |
| 29422 |
var clonedSchemeValue = elementorCommon.helpers.cloneObject(schemeValue); |
| 29423 |
clonedSchemeValue.value = schemeValue.value[key]; |
| 29424 |
return clonedSchemeValue; |
| 29425 |
} |
| 29426 |
|
| 29427 |
return schemeValue; |
| 29428 |
}; |
| 29429 |
|
| 29430 |
this.printSchemesStyle = function () { |
| 29431 |
stylesheet.empty(); |
| 29432 |
fetchAllWidgetsSchemesStyle(); |
| 29433 |
elements.$style.text(stylesheet); |
| 29434 |
}; |
| 29435 |
|
| 29436 |
this.resetSchemes = function (schemeName) { |
| 29437 |
schemes[schemeName] = elementorCommon.helpers.cloneObject(elementor.config.schemes.items[schemeName]); |
| 29438 |
}; |
| 29439 |
|
| 29440 |
this.saveScheme = function (schemeName) { |
| 29441 |
elementor.config.schemes.items[schemeName].items = elementorCommon.helpers.cloneObject(schemes[schemeName].items); |
| 29442 |
var itemsToSave = {}; |
| 29443 |
|
| 29444 |
_.each(schemes[schemeName].items, function (item, key) { |
| 29445 |
itemsToSave[key] = item.value; |
| 29446 |
}); |
| 29447 |
|
| 29448 |
return elementorCommon.ajax.addRequest('apply_scheme', { |
| 29449 |
data: { |
| 29450 |
scheme_name: schemeName, |
| 29451 |
data: (0, _stringify.default)(itemsToSave) |
| 29452 |
} |
| 29453 |
}); |
| 29454 |
}; |
| 29455 |
|
| 29456 |
this.setSchemeValue = function (schemeName, itemKey, value) { |
| 29457 |
schemes[schemeName].items[itemKey].value = value; |
| 29458 |
}; |
| 29459 |
|
| 29460 |
this.addSchemeItem = function (schemeName, item, at) { |
| 29461 |
var scheme = schemes[schemeName], |
| 29462 |
schemeKeys = (0, _keys.default)(scheme.items), |
| 29463 |
hasAt = undefined !== at, |
| 29464 |
targetIndex = hasAt ? at : +schemeKeys.slice(-1)[0] || 0; |
| 29465 |
|
| 29466 |
if (hasAt) { |
| 29467 |
var itemIndex = schemeKeys.length + 1; |
| 29468 |
|
| 29469 |
for (; itemIndex > at; itemIndex--) { |
| 29470 |
scheme.items[itemIndex] = scheme.items[itemIndex - 1]; |
| 29471 |
} |
| 29472 |
} |
| 29473 |
|
| 29474 |
scheme.items[targetIndex + 1] = item; |
| 29475 |
}; |
| 29476 |
|
| 29477 |
this.removeSchemeItem = function (schemeName, itemKey) { |
| 29478 |
var items = schemes[schemeName].items; |
| 29479 |
|
| 29480 |
while (true) { |
| 29481 |
itemKey++; |
| 29482 |
var nextItem = items[itemKey + 1]; |
| 29483 |
|
| 29484 |
if (!nextItem) { |
| 29485 |
delete items[itemKey]; |
| 29486 |
break; |
| 29487 |
} |
| 29488 |
|
| 29489 |
items[itemKey] = nextItem; |
| 29490 |
} |
| 29491 |
}; |
| 29492 |
}; |
| 29493 |
|
| 29494 |
module.exports = new Schemes(); |
| 29495 |
|
| 29496 |
/***/ }), |
| 29497 |
/* 536 */ |
| 29498 |
/***/ (function(module, exports, __webpack_require__) { |
| 29499 |
|
| 29500 |
"use strict"; |
| 29501 |
|
| 29502 |
|
| 29503 |
var presetsFactory; |
| 29504 |
presetsFactory = { |
| 29505 |
getPresetsDictionary: function getPresetsDictionary() { |
| 29506 |
return { |
| 29507 |
11: 100 / 9, |
| 29508 |
12: 100 / 8, |
| 29509 |
14: 100 / 7, |
| 29510 |
16: 100 / 6, |
| 29511 |
33: 100 / 3, |
| 29512 |
66: 2 / 3 * 100, |
| 29513 |
83: 5 / 6 * 100 |
| 29514 |
}; |
| 29515 |
}, |
| 29516 |
getAbsolutePresetValues: function getAbsolutePresetValues(preset) { |
| 29517 |
var clonedPreset = elementorCommon.helpers.cloneObject(preset), |
| 29518 |
presetDictionary = this.getPresetsDictionary(); |
| 29519 |
|
| 29520 |
_.each(clonedPreset, function (unitValue, unitIndex) { |
| 29521 |
if (presetDictionary[unitValue]) { |
| 29522 |
clonedPreset[unitIndex] = presetDictionary[unitValue]; |
| 29523 |
} |
| 29524 |
}); |
| 29525 |
|
| 29526 |
return clonedPreset; |
| 29527 |
}, |
| 29528 |
getPresets: function getPresets(columnsCount, presetIndex) { |
| 29529 |
var presets = elementorCommon.helpers.cloneObject(elementor.config.elements.section.presets); |
| 29530 |
|
| 29531 |
if (columnsCount) { |
| 29532 |
presets = presets[columnsCount]; |
| 29533 |
} |
| 29534 |
|
| 29535 |
if (presetIndex) { |
| 29536 |
presets = presets[presetIndex]; |
| 29537 |
} |
| 29538 |
|
| 29539 |
return presets; |
| 29540 |
}, |
| 29541 |
getPresetByStructure: function getPresetByStructure(structure) { |
| 29542 |
var parsedStructure = this.getParsedStructure(structure); |
| 29543 |
return this.getPresets(parsedStructure.columnsCount, parsedStructure.presetIndex); |
| 29544 |
}, |
| 29545 |
getParsedStructure: function getParsedStructure(structure) { |
| 29546 |
structure += ''; // Make sure this is a string |
| 29547 |
|
| 29548 |
return { |
| 29549 |
columnsCount: structure.slice(0, -1), |
| 29550 |
presetIndex: structure.substr(-1) |
| 29551 |
}; |
| 29552 |
}, |
| 29553 |
getPresetSVG: function getPresetSVG(preset, svgWidth, svgHeight, separatorWidth) { |
| 29554 |
svgWidth = svgWidth || 100; |
| 29555 |
svgHeight = svgHeight || 50; |
| 29556 |
separatorWidth = separatorWidth || 2; |
| 29557 |
|
| 29558 |
var absolutePresetValues = this.getAbsolutePresetValues(preset), |
| 29559 |
presetSVGPath = this._generatePresetSVGPath(absolutePresetValues, svgWidth, svgHeight, separatorWidth); |
| 29560 |
|
| 29561 |
return this._createSVGPreset(presetSVGPath, svgWidth, svgHeight); |
| 29562 |
}, |
| 29563 |
_createSVGPreset: function _createSVGPreset(presetPath, svgWidth, svgHeight) { |
| 29564 |
// this is here to avoid being picked up by https re-write systems |
| 29565 |
var protocol = 'ht' + 'tp'; |
| 29566 |
var svg = document.createElementNS(protocol + '://www.w3.org/2000/svg', 'svg'); |
| 29567 |
svg.setAttributeNS(protocol + '://www.w3.org/2000/xmlns/', 'xmlns:xlink', protocol + '://www.w3.org/1999/xlink'); |
| 29568 |
svg.setAttribute('viewBox', '0 0 ' + svgWidth + ' ' + svgHeight); |
| 29569 |
var path = document.createElementNS(protocol + '://www.w3.org/2000/svg', 'path'); |
| 29570 |
path.setAttribute('d', presetPath); |
| 29571 |
svg.appendChild(path); |
| 29572 |
return svg; |
| 29573 |
}, |
| 29574 |
_generatePresetSVGPath: function _generatePresetSVGPath(preset, svgWidth, svgHeight, separatorWidth) { |
| 29575 |
var DRAW_SIZE = svgWidth - separatorWidth * (preset.length - 1); |
| 29576 |
var xPointer = 0, |
| 29577 |
dOutput = ''; |
| 29578 |
|
| 29579 |
for (var i = 0; i < preset.length; i++) { |
| 29580 |
if (i) { |
| 29581 |
dOutput += ' '; |
| 29582 |
} |
| 29583 |
|
| 29584 |
var increment = preset[i] / 100 * DRAW_SIZE; |
| 29585 |
xPointer += increment; |
| 29586 |
dOutput += 'M' + +xPointer.toFixed(4) + ',0'; |
| 29587 |
dOutput += 'V' + svgHeight; |
| 29588 |
dOutput += 'H' + +(xPointer - increment).toFixed(4); |
| 29589 |
dOutput += 'V0Z'; |
| 29590 |
xPointer += separatorWidth; |
| 29591 |
} |
| 29592 |
|
| 29593 |
return dOutput; |
| 29594 |
} |
| 29595 |
}; |
| 29596 |
module.exports = presetsFactory; |
| 29597 |
|
| 29598 |
/***/ }), |
| 29599 |
/* 537 */ |
| 29600 |
/***/ (function(module, exports, __webpack_require__) { |
| 29601 |
|
| 29602 |
"use strict"; |
| 29603 |
|
| 29604 |
|
| 29605 |
var _interopRequireDefault = __webpack_require__(0); |
| 29606 |
|
| 29607 |
var _typeof2 = _interopRequireDefault(__webpack_require__(48)); |
| 29608 |
|
| 29609 |
var _stringify = _interopRequireDefault(__webpack_require__(206)); |
| 29610 |
|
| 29611 |
var _component = _interopRequireDefault(__webpack_require__(538)); |
| 29612 |
|
| 29613 |
var TemplateLibraryCollection = __webpack_require__(555), |
| 29614 |
TemplateLibraryManager; |
| 29615 |
|
| 29616 |
TemplateLibraryManager = function TemplateLibraryManager() { |
| 29617 |
this.modalConfig = {}; |
| 29618 |
var self = this, |
| 29619 |
templateTypes = {}; |
| 29620 |
var deleteDialog, |
| 29621 |
errorDialog, |
| 29622 |
templatesCollection, |
| 29623 |
config = {}, |
| 29624 |
filterTerms = {}; |
| 29625 |
|
| 29626 |
var registerDefaultTemplateTypes = function registerDefaultTemplateTypes() { |
| 29627 |
var data = { |
| 29628 |
saveDialog: { |
| 29629 |
description: elementor.translate('save_your_template_description') |
| 29630 |
}, |
| 29631 |
ajaxParams: { |
| 29632 |
success: function success(successData) { |
| 29633 |
$e.route('library/templates/my-templates', { |
| 29634 |
onBefore: function onBefore() { |
| 29635 |
if (templatesCollection) { |
| 29636 |
var itemExist = templatesCollection.findWhere({ |
| 29637 |
template_id: successData.template_id |
| 29638 |
}); |
| 29639 |
|
| 29640 |
if (!itemExist) { |
| 29641 |
templatesCollection.add(successData); |
| 29642 |
} |
| 29643 |
} |
| 29644 |
} |
| 29645 |
}); |
| 29646 |
}, |
| 29647 |
error: function error(errorData) { |
| 29648 |
self.showErrorDialog(errorData); |
| 29649 |
} |
| 29650 |
} |
| 29651 |
}; |
| 29652 |
|
| 29653 |
_.each(['page', 'section', elementor.config.document.type], function (type) { |
| 29654 |
var safeData = jQuery.extend(true, {}, data, { |
| 29655 |
saveDialog: { |
| 29656 |
title: elementor.translate('save_your_template', [elementor.translate(type)]) |
| 29657 |
} |
| 29658 |
}); |
| 29659 |
self.registerTemplateType(type, safeData); |
| 29660 |
}); |
| 29661 |
}; |
| 29662 |
|
| 29663 |
var registerDefaultFilterTerms = function registerDefaultFilterTerms() { |
| 29664 |
filterTerms = { |
| 29665 |
text: { |
| 29666 |
callback: function callback(value) { |
| 29667 |
value = value.toLowerCase(); |
| 29668 |
|
| 29669 |
if (this.get('title').toLowerCase().indexOf(value) >= 0) { |
| 29670 |
return true; |
| 29671 |
} |
| 29672 |
|
| 29673 |
return _.any(this.get('tags'), function (tag) { |
| 29674 |
return tag.toLowerCase().indexOf(value) >= 0; |
| 29675 |
}); |
| 29676 |
} |
| 29677 |
}, |
| 29678 |
type: {}, |
| 29679 |
subtype: {}, |
| 29680 |
favorite: {} |
| 29681 |
}; |
| 29682 |
}; |
| 29683 |
|
| 29684 |
this.init = function () { |
| 29685 |
registerDefaultTemplateTypes(); |
| 29686 |
registerDefaultFilterTerms(); |
| 29687 |
this.component = $e.components.register(new _component.default({ |
| 29688 |
manager: this |
| 29689 |
})); |
| 29690 |
elementor.addBackgroundClickListener('libraryToggleMore', { |
| 29691 |
element: '.elementor-template-library-template-more' |
| 29692 |
}); |
| 29693 |
}; |
| 29694 |
|
| 29695 |
this.getTemplateTypes = function (type) { |
| 29696 |
if (type) { |
| 29697 |
return templateTypes[type]; |
| 29698 |
} |
| 29699 |
|
| 29700 |
return templateTypes; |
| 29701 |
}; |
| 29702 |
|
| 29703 |
this.registerTemplateType = function (type, data) { |
| 29704 |
templateTypes[type] = data; |
| 29705 |
}; |
| 29706 |
|
| 29707 |
this.deleteTemplate = function (templateModel, options) { |
| 29708 |
var dialog = self.getDeleteDialog(); |
| 29709 |
|
| 29710 |
dialog.onConfirm = function () { |
| 29711 |
if (options.onConfirm) { |
| 29712 |
options.onConfirm(); |
| 29713 |
} |
| 29714 |
|
| 29715 |
elementorCommon.ajax.addRequest('delete_template', { |
| 29716 |
data: { |
| 29717 |
source: templateModel.get('source'), |
| 29718 |
template_id: templateModel.get('template_id') |
| 29719 |
}, |
| 29720 |
success: function success(response) { |
| 29721 |
templatesCollection.remove(templateModel, { |
| 29722 |
silent: true |
| 29723 |
}); |
| 29724 |
|
| 29725 |
if (options.onSuccess) { |
| 29726 |
options.onSuccess(response); |
| 29727 |
} |
| 29728 |
} |
| 29729 |
}); |
| 29730 |
}; |
| 29731 |
|
| 29732 |
dialog.show(); |
| 29733 |
}; |
| 29734 |
|
| 29735 |
this.importTemplate = function (model) { |
| 29736 |
var args = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; |
| 29737 |
elementorCommon.helpers.softDeprecated('importTemplate', '2.8.0', "$e.run( 'library/insert-template' )"); |
| 29738 |
args.model = model; |
| 29739 |
$e.run('library/insert-template', args); |
| 29740 |
}; |
| 29741 |
|
| 29742 |
this.saveTemplate = function (type, data) { |
| 29743 |
var templateType = templateTypes[type]; |
| 29744 |
|
| 29745 |
_.extend(data, { |
| 29746 |
source: 'local', |
| 29747 |
type: type |
| 29748 |
}); |
| 29749 |
|
| 29750 |
if (templateType.prepareSavedData) { |
| 29751 |
data = templateType.prepareSavedData(data); |
| 29752 |
} |
| 29753 |
|
| 29754 |
data.content = (0, _stringify.default)(data.content); |
| 29755 |
var ajaxParams = { |
| 29756 |
data: data |
| 29757 |
}; |
| 29758 |
|
| 29759 |
if (templateType.ajaxParams) { |
| 29760 |
_.extend(ajaxParams, templateType.ajaxParams); |
| 29761 |
} |
| 29762 |
|
| 29763 |
elementorCommon.ajax.addRequest('save_template', ajaxParams); |
| 29764 |
}; |
| 29765 |
|
| 29766 |
this.requestTemplateContent = function (source, id, ajaxOptions) { |
| 29767 |
var options = { |
| 29768 |
unique_id: id, |
| 29769 |
data: { |
| 29770 |
source: source, |
| 29771 |
edit_mode: true, |
| 29772 |
display: true, |
| 29773 |
template_id: id |
| 29774 |
} |
| 29775 |
}; |
| 29776 |
|
| 29777 |
if (ajaxOptions) { |
| 29778 |
jQuery.extend(true, options, ajaxOptions); |
| 29779 |
} |
| 29780 |
|
| 29781 |
return elementorCommon.ajax.addRequest('get_template_data', options); |
| 29782 |
}; |
| 29783 |
|
| 29784 |
this.markAsFavorite = function (templateModel, favorite) { |
| 29785 |
var options = { |
| 29786 |
data: { |
| 29787 |
source: templateModel.get('source'), |
| 29788 |
template_id: templateModel.get('template_id'), |
| 29789 |
favorite: favorite |
| 29790 |
} |
| 29791 |
}; |
| 29792 |
return elementorCommon.ajax.addRequest('mark_template_as_favorite', options); |
| 29793 |
}; |
| 29794 |
|
| 29795 |
this.getDeleteDialog = function () { |
| 29796 |
if (!deleteDialog) { |
| 29797 |
deleteDialog = elementorCommon.dialogsManager.createWidget('confirm', { |
| 29798 |
id: 'elementor-template-library-delete-dialog', |
| 29799 |
headerMessage: elementor.translate('delete_template'), |
| 29800 |
message: elementor.translate('delete_template_confirm'), |
| 29801 |
strings: { |
| 29802 |
confirm: elementor.translate('delete') |
| 29803 |
} |
| 29804 |
}); |
| 29805 |
} |
| 29806 |
|
| 29807 |
return deleteDialog; |
| 29808 |
}; |
| 29809 |
|
| 29810 |
this.getErrorDialog = function () { |
| 29811 |
if (!errorDialog) { |
| 29812 |
errorDialog = elementorCommon.dialogsManager.createWidget('alert', { |
| 29813 |
id: 'elementor-template-library-error-dialog', |
| 29814 |
headerMessage: elementor.translate('an_error_occurred') |
| 29815 |
}); |
| 29816 |
} |
| 29817 |
|
| 29818 |
return errorDialog; |
| 29819 |
}; |
| 29820 |
|
| 29821 |
this.getTemplatesCollection = function () { |
| 29822 |
return templatesCollection; |
| 29823 |
}; |
| 29824 |
|
| 29825 |
this.getConfig = function (item) { |
| 29826 |
if (item) { |
| 29827 |
return config[item] ? config[item] : {}; |
| 29828 |
} |
| 29829 |
|
| 29830 |
return config; |
| 29831 |
}; |
| 29832 |
|
| 29833 |
this.requestLibraryData = function (options) { |
| 29834 |
if (templatesCollection && !options.forceUpdate) { |
| 29835 |
if (options.onUpdate) { |
| 29836 |
options.onUpdate(); |
| 29837 |
} |
| 29838 |
|
| 29839 |
return; |
| 29840 |
} |
| 29841 |
|
| 29842 |
if (options.onBeforeUpdate) { |
| 29843 |
options.onBeforeUpdate(); |
| 29844 |
} |
| 29845 |
|
| 29846 |
var ajaxOptions = { |
| 29847 |
data: {}, |
| 29848 |
success: function success(data) { |
| 29849 |
templatesCollection = new TemplateLibraryCollection(data.templates); |
| 29850 |
|
| 29851 |
if (data.config) { |
| 29852 |
config = data.config; |
| 29853 |
} |
| 29854 |
|
| 29855 |
if (options.onUpdate) { |
| 29856 |
options.onUpdate(); |
| 29857 |
} |
| 29858 |
} |
| 29859 |
}; |
| 29860 |
|
| 29861 |
if (options.forceSync) { |
| 29862 |
ajaxOptions.data.sync = true; |
| 29863 |
} |
| 29864 |
|
| 29865 |
elementorCommon.ajax.addRequest('get_library_data', ajaxOptions); |
| 29866 |
}; |
| 29867 |
|
| 29868 |
this.getFilter = function (name) { |
| 29869 |
return elementor.channels.templates.request('filter:' + name); |
| 29870 |
}; |
| 29871 |
|
| 29872 |
this.setFilter = function (name, value, silent) { |
| 29873 |
elementor.channels.templates.reply('filter:' + name, value); |
| 29874 |
|
| 29875 |
if (!silent) { |
| 29876 |
elementor.channels.templates.trigger('filter:change'); |
| 29877 |
} |
| 29878 |
}; |
| 29879 |
|
| 29880 |
this.getFilterTerms = function (termName) { |
| 29881 |
if (termName) { |
| 29882 |
return filterTerms[termName]; |
| 29883 |
} |
| 29884 |
|
| 29885 |
return filterTerms; |
| 29886 |
}; |
| 29887 |
|
| 29888 |
this.setScreen = function (args) { |
| 29889 |
elementor.channels.templates.stopReplying(); |
| 29890 |
self.setFilter('source', args.source, true); |
| 29891 |
self.setFilter('type', args.type, true); |
| 29892 |
self.setFilter('subtype', args.subtype, true); |
| 29893 |
self.showTemplates(); |
| 29894 |
}; |
| 29895 |
|
| 29896 |
this.loadTemplates = function (_onUpdate) { |
| 29897 |
self.requestLibraryData({ |
| 29898 |
onBeforeUpdate: self.layout.showLoadingView.bind(self.layout), |
| 29899 |
onUpdate: function onUpdate() { |
| 29900 |
self.layout.hideLoadingView(); |
| 29901 |
|
| 29902 |
if (_onUpdate) { |
| 29903 |
_onUpdate(); |
| 29904 |
} |
| 29905 |
} |
| 29906 |
}); |
| 29907 |
}; |
| 29908 |
|
| 29909 |
this.showTemplates = function () { |
| 29910 |
// The tabs should exist in DOM on loading. |
| 29911 |
self.layout.setHeaderDefaultParts(); |
| 29912 |
self.loadTemplates(function () { |
| 29913 |
var templatesToShow = self.filterTemplates(); |
| 29914 |
self.layout.showTemplatesView(new TemplateLibraryCollection(templatesToShow)); |
| 29915 |
}); |
| 29916 |
}; |
| 29917 |
|
| 29918 |
this.filterTemplates = function () { |
| 29919 |
var activeSource = self.getFilter('source'); |
| 29920 |
return templatesCollection.filter(function (model) { |
| 29921 |
if (activeSource !== model.get('source')) { |
| 29922 |
return false; |
| 29923 |
} |
| 29924 |
|
| 29925 |
var typeInfo = templateTypes[model.get('type')]; |
| 29926 |
return !typeInfo || false !== typeInfo.showInLibrary; |
| 29927 |
}); |
| 29928 |
}; |
| 29929 |
|
| 29930 |
this.showErrorDialog = function (errorMessage) { |
| 29931 |
if ('object' === (0, _typeof2.default)(errorMessage)) { |
| 29932 |
var message = ''; |
| 29933 |
|
| 29934 |
_.each(errorMessage, function (error) { |
| 29935 |
message += '<div>' + error.message + '.</div>'; |
| 29936 |
}); |
| 29937 |
|
| 29938 |
errorMessage = message; |
| 29939 |
} else if (errorMessage) { |
| 29940 |
errorMessage += '.'; |
| 29941 |
} else { |
| 29942 |
errorMessage = '<i><The error message is empty></i>'; |
| 29943 |
} |
| 29944 |
|
| 29945 |
self.getErrorDialog().setMessage(elementor.translate('templates_request_error') + '<div id="elementor-template-library-error-info">' + errorMessage + '</div>').show(); |
| 29946 |
}; |
| 29947 |
}; |
| 29948 |
|
| 29949 |
module.exports = new TemplateLibraryManager(); |
| 29950 |
|
| 29951 |
/***/ }), |
| 29952 |
/* 538 */ |
| 29953 |
/***/ (function(module, exports, __webpack_require__) { |
| 29954 |
|
| 29955 |
"use strict"; |
| 29956 |
|
| 29957 |
|
| 29958 |
var _interopRequireWildcard = __webpack_require__(36); |
| 29959 |
|
| 29960 |
var _interopRequireDefault = __webpack_require__(0); |
| 29961 |
|
| 29962 |
var _Object$defineProperty = __webpack_require__(1); |
| 29963 |
|
| 29964 |
_Object$defineProperty(exports, "__esModule", { |
| 29965 |
value: true |
| 29966 |
}); |
| 29967 |
|
| 29968 |
exports.default = void 0; |
| 29969 |
|
| 29970 |
var _objectSpread2 = _interopRequireDefault(__webpack_require__(214)); |
| 29971 |
|
| 29972 |
var _classCallCheck2 = _interopRequireDefault(__webpack_require__(2)); |
| 29973 |
|
| 29974 |
var _createClass2 = _interopRequireDefault(__webpack_require__(3)); |
| 29975 |
|
| 29976 |
var _get2 = _interopRequireDefault(__webpack_require__(26)); |
| 29977 |
|
| 29978 |
var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(16)); |
| 29979 |
|
| 29980 |
var _inherits2 = _interopRequireDefault(__webpack_require__(4)); |
| 29981 |
|
| 29982 |
var _createSuper2 = _interopRequireDefault(__webpack_require__(5)); |
| 29983 |
|
| 29984 |
var _componentModalBase = _interopRequireDefault(__webpack_require__(287)); |
| 29985 |
|
| 29986 |
var commands = _interopRequireWildcard(__webpack_require__(539)); |
| 29987 |
|
| 29988 |
var TemplateLibraryLayoutView = __webpack_require__(542); |
| 29989 |
|
| 29990 |
var Component = /*#__PURE__*/function (_ComponentModalBase) { |
| 29991 |
(0, _inherits2.default)(Component, _ComponentModalBase); |
| 29992 |
|
| 29993 |
var _super = (0, _createSuper2.default)(Component); |
| 29994 |
|
| 29995 |
function Component() { |
| 29996 |
(0, _classCallCheck2.default)(this, Component); |
| 29997 |
return _super.apply(this, arguments); |
| 29998 |
} |
| 29999 |
|
| 30000 |
(0, _createClass2.default)(Component, [{ |
| 30001 |
key: "__construct", |
| 30002 |
value: function __construct(args) { |
| 30003 |
(0, _get2.default)((0, _getPrototypeOf2.default)(Component.prototype), "__construct", this).call(this, args); // When switching documents update defaultTabs. |
| 30004 |
|
| 30005 |
elementor.on('document:loaded', this.onDocumentLoaded.bind(this)); |
| 30006 |
} |
| 30007 |
}, { |
| 30008 |
key: "getNamespace", |
| 30009 |
value: function getNamespace() { |
| 30010 |
return 'library'; |
| 30011 |
} |
| 30012 |
}, { |
| 30013 |
key: "defaultTabs", |
| 30014 |
value: function defaultTabs() { |
| 30015 |
return { |
| 30016 |
'templates/blocks': { |
| 30017 |
title: elementor.translate('blocks'), |
| 30018 |
getFilter: function getFilter() { |
| 30019 |
return { |
| 30020 |
source: 'remote', |
| 30021 |
type: 'block', |
| 30022 |
subtype: elementor.config.document.remoteLibrary.category |
| 30023 |
}; |
| 30024 |
} |
| 30025 |
}, |
| 30026 |
'templates/pages': { |
| 30027 |
title: elementor.translate('pages'), |
| 30028 |
filter: { |
| 30029 |
source: 'remote', |
| 30030 |
type: 'page' |
| 30031 |
} |
| 30032 |
}, |
| 30033 |
'templates/my-templates': { |
| 30034 |
title: elementor.translate('my_templates'), |
| 30035 |
filter: { |
| 30036 |
source: 'local' |
| 30037 |
} |
| 30038 |
} |
| 30039 |
}; |
| 30040 |
} |
| 30041 |
}, { |
| 30042 |
key: "defaultRoutes", |
| 30043 |
value: function defaultRoutes() { |
| 30044 |
var _this = this; |
| 30045 |
|
| 30046 |
return { |
| 30047 |
import: function _import() { |
| 30048 |
_this.manager.layout.showImportView(); |
| 30049 |
}, |
| 30050 |
'save-template': function saveTemplate(args) { |
| 30051 |
_this.manager.layout.showSaveTemplateView(args.model); |
| 30052 |
}, |
| 30053 |
preview: function preview(args) { |
| 30054 |
_this.manager.layout.showPreviewView(args.model); |
| 30055 |
}, |
| 30056 |
connect: function connect(args) { |
| 30057 |
args.texts = { |
| 30058 |
title: elementor.translate('library/connect:title'), |
| 30059 |
message: elementor.translate('library/connect:message'), |
| 30060 |
button: elementor.translate('library/connect:button') |
| 30061 |
}; |
| 30062 |
|
| 30063 |
_this.manager.layout.showConnectView(args); |
| 30064 |
} |
| 30065 |
}; |
| 30066 |
} |
| 30067 |
}, { |
| 30068 |
key: "defaultCommands", |
| 30069 |
value: function defaultCommands() { |
| 30070 |
var modalCommands = (0, _get2.default)((0, _getPrototypeOf2.default)(Component.prototype), "defaultCommands", this).call(this); |
| 30071 |
return (0, _objectSpread2.default)((0, _objectSpread2.default)({}, modalCommands), this.importCommands(commands)); |
| 30072 |
} |
| 30073 |
}, { |
| 30074 |
key: "defaultShortcuts", |
| 30075 |
value: function defaultShortcuts() { |
| 30076 |
return { |
| 30077 |
open: { |
| 30078 |
keys: 'ctrl+shift+l' |
| 30079 |
} |
| 30080 |
}; |
| 30081 |
} |
| 30082 |
}, { |
| 30083 |
key: "onDocumentLoaded", |
| 30084 |
value: function onDocumentLoaded(document) { |
| 30085 |
this.setDefaultRoute(document.config.remoteLibrary.default_route); |
| 30086 |
this.maybeOpenLibrary(); |
| 30087 |
} |
| 30088 |
}, { |
| 30089 |
key: "renderTab", |
| 30090 |
value: function renderTab(tab) { |
| 30091 |
var currentTab = this.tabs[tab], |
| 30092 |
filter = currentTab.getFilter ? currentTab.getFilter() : currentTab.filter; |
| 30093 |
this.manager.setScreen(filter); |
| 30094 |
} |
| 30095 |
}, { |
| 30096 |
key: "activateTab", |
| 30097 |
value: function activateTab(tab) { |
| 30098 |
$e.routes.saveState('library'); |
| 30099 |
(0, _get2.default)((0, _getPrototypeOf2.default)(Component.prototype), "activateTab", this).call(this, tab); |
| 30100 |
} |
| 30101 |
}, { |
| 30102 |
key: "open", |
| 30103 |
value: function open() { |
| 30104 |
(0, _get2.default)((0, _getPrototypeOf2.default)(Component.prototype), "open", this).call(this); |
| 30105 |
|
| 30106 |
if (!this.manager.layout) { |
| 30107 |
this.manager.layout = this.layout; |
| 30108 |
} |
| 30109 |
|
| 30110 |
this.manager.layout.setHeaderDefaultParts(); |
| 30111 |
return true; |
| 30112 |
} |
| 30113 |
}, { |
| 30114 |
key: "close", |
| 30115 |
value: function close() { |
| 30116 |
if (!(0, _get2.default)((0, _getPrototypeOf2.default)(Component.prototype), "close", this).call(this)) { |
| 30117 |
return false; |
| 30118 |
} |
| 30119 |
|
| 30120 |
this.manager.modalConfig = {}; |
| 30121 |
return true; |
| 30122 |
} |
| 30123 |
}, { |
| 30124 |
key: "show", |
| 30125 |
value: function show(args) { |
| 30126 |
this.manager.modalConfig = args; |
| 30127 |
|
| 30128 |
if (args.toDefault || !$e.routes.restoreState('library')) { |
| 30129 |
$e.route(this.getDefaultRoute()); |
| 30130 |
} |
| 30131 |
} // TODO: Move function to 'insert-template' command. |
| 30132 |
|
| 30133 |
}, { |
| 30134 |
key: "insertTemplate", |
| 30135 |
value: function insertTemplate(args) { |
| 30136 |
var _this2 = this; |
| 30137 |
|
| 30138 |
var autoImportSettings = elementor.config.document.remoteLibrary.autoImportSettings, |
| 30139 |
model = args.model; |
| 30140 |
var _args$withPageSetting = args.withPageSettings, |
| 30141 |
withPageSettings = _args$withPageSetting === void 0 ? null : _args$withPageSetting; |
| 30142 |
|
| 30143 |
if (autoImportSettings) { |
| 30144 |
withPageSettings = true; |
| 30145 |
} |
| 30146 |
|
| 30147 |
if (null === withPageSettings && model.get('hasPageSettings')) { |
| 30148 |
var insertTemplateHandler = this.getImportSettingsDialog(); |
| 30149 |
insertTemplateHandler.showImportDialog(model); |
| 30150 |
return; |
| 30151 |
} |
| 30152 |
|
| 30153 |
this.manager.layout.showLoadingView(); |
| 30154 |
this.manager.requestTemplateContent(model.get('source'), model.get('template_id'), { |
| 30155 |
data: { |
| 30156 |
with_page_settings: withPageSettings |
| 30157 |
}, |
| 30158 |
success: function success(data) { |
| 30159 |
// Clone the `modalConfig.importOptions` because it deleted during the closing. |
| 30160 |
var importOptions = jQuery.extend({}, _this2.manager.modalConfig.importOptions); |
| 30161 |
importOptions.withPageSettings = withPageSettings; // Hide for next open. |
| 30162 |
|
| 30163 |
_this2.manager.layout.hideLoadingView(); |
| 30164 |
|
| 30165 |
_this2.manager.layout.hideModal(); |
| 30166 |
|
| 30167 |
$e.run('document/elements/import', { |
| 30168 |
model: model, |
| 30169 |
data: data, |
| 30170 |
options: importOptions |
| 30171 |
}); |
| 30172 |
}, |
| 30173 |
error: function error(data) { |
| 30174 |
_this2.manager.showErrorDialog(data); |
| 30175 |
}, |
| 30176 |
complete: function complete() { |
| 30177 |
_this2.manager.layout.hideLoadingView(); |
| 30178 |
} |
| 30179 |
}); |
| 30180 |
} |
| 30181 |
}, { |
| 30182 |
key: "getImportSettingsDialog", |
| 30183 |
value: function getImportSettingsDialog() { |
| 30184 |
// Moved from ./behaviors/insert-template.js |
| 30185 |
var InsertTemplateHandler = { |
| 30186 |
dialog: null, |
| 30187 |
showImportDialog: function showImportDialog(model) { |
| 30188 |
var dialog = InsertTemplateHandler.getDialog(); |
| 30189 |
|
| 30190 |
dialog.onConfirm = function () { |
| 30191 |
$e.run('library/insert-template', { |
| 30192 |
model: model, |
| 30193 |
withPageSettings: true |
| 30194 |
}); |
| 30195 |
}; |
| 30196 |
|
| 30197 |
dialog.onCancel = function () { |
| 30198 |
$e.run('library/insert-template', { |
| 30199 |
model: model, |
| 30200 |
withPageSettings: false |
| 30201 |
}); |
| 30202 |
}; |
| 30203 |
|
| 30204 |
dialog.show(); |
| 30205 |
}, |
| 30206 |
initDialog: function initDialog() { |
| 30207 |
InsertTemplateHandler.dialog = elementorCommon.dialogsManager.createWidget('confirm', { |
| 30208 |
id: 'elementor-insert-template-settings-dialog', |
| 30209 |
headerMessage: elementor.translate('import_template_dialog_header'), |
| 30210 |
message: elementor.translate('import_template_dialog_message') + '<br>' + elementor.translate('import_template_dialog_message_attention'), |
| 30211 |
strings: { |
| 30212 |
confirm: elementor.translate('yes'), |
| 30213 |
cancel: elementor.translate('no') |
| 30214 |
} |
| 30215 |
}); |
| 30216 |
}, |
| 30217 |
getDialog: function getDialog() { |
| 30218 |
if (!InsertTemplateHandler.dialog) { |
| 30219 |
InsertTemplateHandler.initDialog(); |
| 30220 |
} |
| 30221 |
|
| 30222 |
return InsertTemplateHandler.dialog; |
| 30223 |
} |
| 30224 |
}; |
| 30225 |
return InsertTemplateHandler; |
| 30226 |
} |
| 30227 |
}, { |
| 30228 |
key: "getTabsWrapperSelector", |
| 30229 |
value: function getTabsWrapperSelector() { |
| 30230 |
return '#elementor-template-library-header-menu'; |
| 30231 |
} |
| 30232 |
}, { |
| 30233 |
key: "getModalLayout", |
| 30234 |
value: function getModalLayout() { |
| 30235 |
return TemplateLibraryLayoutView; |
| 30236 |
} |
| 30237 |
}, { |
| 30238 |
key: "maybeOpenLibrary", |
| 30239 |
value: function maybeOpenLibrary() { |
| 30240 |
if ('#library' === location.hash) { |
| 30241 |
$e.run('library/open'); |
| 30242 |
location.hash = ''; |
| 30243 |
} |
| 30244 |
} |
| 30245 |
}]); |
| 30246 |
return Component; |
| 30247 |
}(_componentModalBase.default); |
| 30248 |
|
| 30249 |
exports.default = Component; |
| 30250 |
|
| 30251 |
/***/ }), |
| 30252 |
/* 539 */ |
| 30253 |
/***/ (function(module, exports, __webpack_require__) { |
| 30254 |
|
| 30255 |
"use strict"; |
| 30256 |
|
| 30257 |
|
| 30258 |
var _Object$defineProperty = __webpack_require__(1); |
| 30259 |
|
| 30260 |
_Object$defineProperty(exports, "__esModule", { |
| 30261 |
value: true |
| 30262 |
}); |
| 30263 |
|
| 30264 |
_Object$defineProperty(exports, "InsertTemplate", { |
| 30265 |
enumerable: true, |
| 30266 |
get: function get() { |
| 30267 |
return _insertTemplate.InsertTemplate; |
| 30268 |
} |
| 30269 |
}); |
| 30270 |
|
| 30271 |
_Object$defineProperty(exports, "Open", { |
| 30272 |
enumerable: true, |
| 30273 |
get: function get() { |
| 30274 |
return _open.Open; |
| 30275 |
} |
| 30276 |
}); |
| 30277 |
|
| 30278 |
var _insertTemplate = __webpack_require__(540); |
| 30279 |
|
| 30280 |
var _open = __webpack_require__(541); |
| 30281 |
|
| 30282 |
/***/ }), |
| 30283 |
/* 540 */ |
| 30284 |
/***/ (function(module, exports, __webpack_require__) { |
| 30285 |
|
| 30286 |
"use strict"; |
| 30287 |
|
| 30288 |
|
| 30289 |
var _interopRequireDefault = __webpack_require__(0); |
| 30290 |
|
| 30291 |
var _Object$defineProperty = __webpack_require__(1); |
| 30292 |
|
| 30293 |
_Object$defineProperty(exports, "__esModule", { |
| 30294 |
value: true |
| 30295 |
}); |
| 30296 |
|
| 30297 |
exports.default = exports.InsertTemplate = void 0; |
| 30298 |
|
| 30299 |
var _classCallCheck2 = _interopRequireDefault(__webpack_require__(2)); |
| 30300 |
|
| 30301 |
var _createClass2 = _interopRequireDefault(__webpack_require__(3)); |
| 30302 |
|
| 30303 |
var _inherits2 = _interopRequireDefault(__webpack_require__(4)); |
| 30304 |
|
| 30305 |
var _createSuper2 = _interopRequireDefault(__webpack_require__(5)); |
| 30306 |
|
| 30307 |
var _commandBase = _interopRequireDefault(__webpack_require__(21)); |
| 30308 |
|
| 30309 |
var InsertTemplate = /*#__PURE__*/function (_CommandBase) { |
| 30310 |
(0, _inherits2.default)(InsertTemplate, _CommandBase); |
| 30311 |
|
| 30312 |
var _super = (0, _createSuper2.default)(InsertTemplate); |
| 30313 |
|
| 30314 |
function InsertTemplate() { |
| 30315 |
(0, _classCallCheck2.default)(this, InsertTemplate); |
| 30316 |
return _super.apply(this, arguments); |
| 30317 |
} |
| 30318 |
|
| 30319 |
(0, _createClass2.default)(InsertTemplate, [{ |
| 30320 |
key: "apply", |
| 30321 |
value: function apply(args) { |
| 30322 |
return this.component.insertTemplate(args); |
| 30323 |
} |
| 30324 |
}]); |
| 30325 |
return InsertTemplate; |
| 30326 |
}(_commandBase.default); |
| 30327 |
|
| 30328 |
exports.InsertTemplate = InsertTemplate; |
| 30329 |
var _default = InsertTemplate; |
| 30330 |
exports.default = _default; |
| 30331 |
|
| 30332 |
/***/ }), |
| 30333 |
/* 541 */ |
| 30334 |
/***/ (function(module, exports, __webpack_require__) { |
| 30335 |
|
| 30336 |
"use strict"; |
| 30337 |
|
| 30338 |
|
| 30339 |
var _interopRequireDefault = __webpack_require__(0); |
| 30340 |
|
| 30341 |
var _Object$defineProperty = __webpack_require__(1); |
| 30342 |
|
| 30343 |
_Object$defineProperty(exports, "__esModule", { |
| 30344 |
value: true |
| 30345 |
}); |
| 30346 |
|
| 30347 |
exports.default = exports.Open = void 0; |
| 30348 |
|
| 30349 |
var _classCallCheck2 = _interopRequireDefault(__webpack_require__(2)); |
| 30350 |
|
| 30351 |
var _createClass2 = _interopRequireDefault(__webpack_require__(3)); |
| 30352 |
|
| 30353 |
var _inherits2 = _interopRequireDefault(__webpack_require__(4)); |
| 30354 |
|
| 30355 |
var _createSuper2 = _interopRequireDefault(__webpack_require__(5)); |
| 30356 |
|
| 30357 |
var _commandBase = _interopRequireDefault(__webpack_require__(21)); |
| 30358 |
|
| 30359 |
var Open = /*#__PURE__*/function (_CommandBase) { |
| 30360 |
(0, _inherits2.default)(Open, _CommandBase); |
| 30361 |
|
| 30362 |
var _super = (0, _createSuper2.default)(Open); |
| 30363 |
|
| 30364 |
function Open() { |
| 30365 |
(0, _classCallCheck2.default)(this, Open); |
| 30366 |
return _super.apply(this, arguments); |
| 30367 |
} |
| 30368 |
|
| 30369 |
(0, _createClass2.default)(Open, [{ |
| 30370 |
key: "apply", |
| 30371 |
value: function apply(args) { |
| 30372 |
return this.component.show(args); |
| 30373 |
} |
| 30374 |
}]); |
| 30375 |
return Open; |
| 30376 |
}(_commandBase.default); |
| 30377 |
|
| 30378 |
exports.Open = Open; |
| 30379 |
var _default = Open; |
| 30380 |
exports.default = _default; |
| 30381 |
|
| 30382 |
/***/ }), |
| 30383 |
/* 542 */ |
| 30384 |
/***/ (function(module, exports, __webpack_require__) { |
| 30385 |
|
| 30386 |
"use strict"; |
| 30387 |
|
| 30388 |
|
| 30389 |
var TemplateLibraryHeaderActionsView = __webpack_require__(543), |
| 30390 |
TemplateLibraryHeaderMenuView = __webpack_require__(544), |
| 30391 |
TemplateLibraryHeaderPreviewView = __webpack_require__(545), |
| 30392 |
TemplateLibraryHeaderBackView = __webpack_require__(546), |
| 30393 |
TemplateLibraryCollectionView = __webpack_require__(547), |
| 30394 |
TemplateLibrarySaveTemplateView = __webpack_require__(551), |
| 30395 |
TemplateLibraryImportView = __webpack_require__(552), |
| 30396 |
TemplateLibraryConnectView = __webpack_require__(553), |
| 30397 |
TemplateLibraryPreviewView = __webpack_require__(554); |
| 30398 |
|
| 30399 |
module.exports = elementorModules.common.views.modal.Layout.extend({ |
| 30400 |
getModalOptions: function getModalOptions() { |
| 30401 |
return { |
| 30402 |
id: 'elementor-template-library-modal' |
| 30403 |
}; |
| 30404 |
}, |
| 30405 |
getLogoOptions: function getLogoOptions() { |
| 30406 |
return { |
| 30407 |
title: elementor.translate('library'), |
| 30408 |
click: function click() { |
| 30409 |
$e.run('library/open', { |
| 30410 |
toDefault: true |
| 30411 |
}); |
| 30412 |
} |
| 30413 |
}; |
| 30414 |
}, |
| 30415 |
getTemplateActionButton: function getTemplateActionButton(templateData) { |
| 30416 |
var viewId = '#tmpl-elementor-template-library-' + (templateData.isPro ? 'get-pro-button' : 'insert-button'); |
| 30417 |
viewId = elementor.hooks.applyFilters('elementor/editor/template-library/template/action-button', viewId, templateData); |
| 30418 |
var template = Marionette.TemplateCache.get(viewId); |
| 30419 |
return Marionette.Renderer.render(template); |
| 30420 |
}, |
| 30421 |
setHeaderDefaultParts: function setHeaderDefaultParts() { |
| 30422 |
var headerView = this.getHeaderView(); |
| 30423 |
headerView.tools.show(new TemplateLibraryHeaderActionsView()); |
| 30424 |
headerView.menuArea.show(new TemplateLibraryHeaderMenuView()); |
| 30425 |
this.showLogo(); |
| 30426 |
}, |
| 30427 |
showTemplatesView: function showTemplatesView(templatesCollection) { |
| 30428 |
this.modalContent.show(new TemplateLibraryCollectionView({ |
| 30429 |
collection: templatesCollection |
| 30430 |
})); |
| 30431 |
}, |
| 30432 |
showImportView: function showImportView() { |
| 30433 |
var headerView = this.getHeaderView(); |
| 30434 |
headerView.menuArea.reset(); |
| 30435 |
this.modalContent.show(new TemplateLibraryImportView()); |
| 30436 |
headerView.logoArea.show(new TemplateLibraryHeaderBackView()); |
| 30437 |
}, |
| 30438 |
showConnectView: function showConnectView(args) { |
| 30439 |
this.getHeaderView().menuArea.reset(); |
| 30440 |
this.modalContent.show(new TemplateLibraryConnectView(args)); |
| 30441 |
}, |
| 30442 |
showSaveTemplateView: function showSaveTemplateView(elementModel) { |
| 30443 |
this.getHeaderView().menuArea.reset(); |
| 30444 |
this.modalContent.show(new TemplateLibrarySaveTemplateView({ |
| 30445 |
model: elementModel |
| 30446 |
})); |
| 30447 |
}, |
| 30448 |
showPreviewView: function showPreviewView(templateModel) { |
| 30449 |
this.modalContent.show(new TemplateLibraryPreviewView({ |
| 30450 |
url: templateModel.get('url') |
| 30451 |
})); |
| 30452 |
var headerView = this.getHeaderView(); |
| 30453 |
headerView.menuArea.reset(); |
| 30454 |
headerView.tools.show(new TemplateLibraryHeaderPreviewView({ |
| 30455 |
model: templateModel |
| 30456 |
})); |
| 30457 |
headerView.logoArea.show(new TemplateLibraryHeaderBackView()); |
| 30458 |
} |
| 30459 |
}); |
| 30460 |
|
| 30461 |
/***/ }), |
| 30462 |
/* 543 */ |
| 30463 |
/***/ (function(module, exports, __webpack_require__) { |
| 30464 |
|
| 30465 |
"use strict"; |
| 30466 |
|
| 30467 |
|
| 30468 |
module.exports = Marionette.ItemView.extend({ |
| 30469 |
template: '#tmpl-elementor-template-library-header-actions', |
| 30470 |
id: 'elementor-template-library-header-actions', |
| 30471 |
ui: { |
| 30472 |
import: '#elementor-template-library-header-import i', |
| 30473 |
sync: '#elementor-template-library-header-sync i', |
| 30474 |
save: '#elementor-template-library-header-save i' |
| 30475 |
}, |
| 30476 |
events: { |
| 30477 |
'click @ui.import': 'onImportClick', |
| 30478 |
'click @ui.sync': 'onSyncClick', |
| 30479 |
'click @ui.save': 'onSaveClick' |
| 30480 |
}, |
| 30481 |
onImportClick: function onImportClick() { |
| 30482 |
$e.route('library/import'); |
| 30483 |
}, |
| 30484 |
onSyncClick: function onSyncClick() { |
| 30485 |
var self = this; |
| 30486 |
self.ui.sync.addClass('eicon-animation-spin'); |
| 30487 |
elementor.templates.requestLibraryData({ |
| 30488 |
onUpdate: function onUpdate() { |
| 30489 |
self.ui.sync.removeClass('eicon-animation-spin'); |
| 30490 |
$e.routes.refreshContainer('library'); |
| 30491 |
}, |
| 30492 |
forceUpdate: true, |
| 30493 |
forceSync: true |
| 30494 |
}); |
| 30495 |
}, |
| 30496 |
onSaveClick: function onSaveClick() { |
| 30497 |
$e.route('library/save-template'); |
| 30498 |
} |
| 30499 |
}); |
| 30500 |
|
| 30501 |
/***/ }), |
| 30502 |
/* 544 */ |
| 30503 |
/***/ (function(module, exports, __webpack_require__) { |
| 30504 |
|
| 30505 |
"use strict"; |
| 30506 |
|
| 30507 |
|
| 30508 |
module.exports = Marionette.ItemView.extend({ |
| 30509 |
template: '#tmpl-elementor-template-library-header-menu', |
| 30510 |
id: 'elementor-template-library-header-menu', |
| 30511 |
templateHelpers: function templateHelpers() { |
| 30512 |
return { |
| 30513 |
tabs: $e.components.get('library').getTabs() |
| 30514 |
}; |
| 30515 |
} |
| 30516 |
}); |
| 30517 |
|
| 30518 |
/***/ }), |
| 30519 |
/* 545 */ |
| 30520 |
/***/ (function(module, exports, __webpack_require__) { |
| 30521 |
|
| 30522 |
"use strict"; |
| 30523 |
|
| 30524 |
|
| 30525 |
var TemplateLibraryInsertTemplateBehavior = __webpack_require__(378); |
| 30526 |
|
| 30527 |
module.exports = Marionette.ItemView.extend({ |
| 30528 |
template: '#tmpl-elementor-template-library-header-preview', |
| 30529 |
id: 'elementor-template-library-header-preview', |
| 30530 |
behaviors: { |
| 30531 |
insertTemplate: { |
| 30532 |
behaviorClass: TemplateLibraryInsertTemplateBehavior |
| 30533 |
} |
| 30534 |
} |
| 30535 |
}); |
| 30536 |
|
| 30537 |
/***/ }), |
| 30538 |
/* 546 */ |
| 30539 |
/***/ (function(module, exports, __webpack_require__) { |
| 30540 |
|
| 30541 |
"use strict"; |
| 30542 |
|
| 30543 |
|
| 30544 |
module.exports = Marionette.ItemView.extend({ |
| 30545 |
template: '#tmpl-elementor-template-library-header-back', |
| 30546 |
id: 'elementor-template-library-header-preview-back', |
| 30547 |
events: { |
| 30548 |
click: 'onClick' |
| 30549 |
}, |
| 30550 |
onClick: function onClick() { |
| 30551 |
$e.routes.restoreState('library'); |
| 30552 |
} |
| 30553 |
}); |
| 30554 |
|
| 30555 |
/***/ }), |
| 30556 |
/* 547 */ |
| 30557 |
/***/ (function(module, exports, __webpack_require__) { |
| 30558 |
|
| 30559 |
"use strict"; |
| 30560 |
|
| 30561 |
|
| 30562 |
var TemplateLibraryTemplateLocalView = __webpack_require__(548), |
| 30563 |
TemplateLibraryTemplateRemoteView = __webpack_require__(549), |
| 30564 |
TemplateLibraryCollectionView; |
| 30565 |
|
| 30566 |
TemplateLibraryCollectionView = Marionette.CompositeView.extend({ |
| 30567 |
template: '#tmpl-elementor-template-library-templates', |
| 30568 |
id: 'elementor-template-library-templates', |
| 30569 |
childViewContainer: '#elementor-template-library-templates-container', |
| 30570 |
reorderOnSort: true, |
| 30571 |
emptyView: function emptyView() { |
| 30572 |
var EmptyView = __webpack_require__(550); |
| 30573 |
|
| 30574 |
return new EmptyView(); |
| 30575 |
}, |
| 30576 |
ui: { |
| 30577 |
textFilter: '#elementor-template-library-filter-text', |
| 30578 |
selectFilter: '.elementor-template-library-filter-select', |
| 30579 |
myFavoritesFilter: '#elementor-template-library-filter-my-favorites', |
| 30580 |
orderInputs: '.elementor-template-library-order-input', |
| 30581 |
orderLabels: 'label.elementor-template-library-order-label' |
| 30582 |
}, |
| 30583 |
events: { |
| 30584 |
'input @ui.textFilter': 'onTextFilterInput', |
| 30585 |
'change @ui.selectFilter': 'onSelectFilterChange', |
| 30586 |
'change @ui.myFavoritesFilter': 'onMyFavoritesFilterChange', |
| 30587 |
'mousedown @ui.orderLabels': 'onOrderLabelsClick' |
| 30588 |
}, |
| 30589 |
comparators: { |
| 30590 |
title: function title(model) { |
| 30591 |
return model.get('title').toLowerCase(); |
| 30592 |
}, |
| 30593 |
popularityIndex: function popularityIndex(model) { |
| 30594 |
var popularityIndex = model.get('popularityIndex'); |
| 30595 |
|
| 30596 |
if (!popularityIndex) { |
| 30597 |
popularityIndex = model.get('date'); |
| 30598 |
} |
| 30599 |
|
| 30600 |
return -popularityIndex; |
| 30601 |
}, |
| 30602 |
trendIndex: function trendIndex(model) { |
| 30603 |
var trendIndex = model.get('trendIndex'); |
| 30604 |
|
| 30605 |
if (!trendIndex) { |
| 30606 |
trendIndex = model.get('date'); |
| 30607 |
} |
| 30608 |
|
| 30609 |
return -trendIndex; |
| 30610 |
} |
| 30611 |
}, |
| 30612 |
getChildView: function getChildView(childModel) { |
| 30613 |
if ('remote' === childModel.get('source')) { |
| 30614 |
return TemplateLibraryTemplateRemoteView; |
| 30615 |
} |
| 30616 |
|
| 30617 |
return TemplateLibraryTemplateLocalView; |
| 30618 |
}, |
| 30619 |
initialize: function initialize() { |
| 30620 |
this.listenTo(elementor.channels.templates, 'filter:change', this._renderChildren); |
| 30621 |
}, |
| 30622 |
filter: function filter(childModel) { |
| 30623 |
var filterTerms = elementor.templates.getFilterTerms(), |
| 30624 |
passingFilter = true; |
| 30625 |
jQuery.each(filterTerms, function (filterTermName) { |
| 30626 |
var filterValue = elementor.templates.getFilter(filterTermName); |
| 30627 |
|
| 30628 |
if (!filterValue) { |
| 30629 |
return; |
| 30630 |
} |
| 30631 |
|
| 30632 |
if (this.callback) { |
| 30633 |
var callbackResult = this.callback.call(childModel, filterValue); |
| 30634 |
|
| 30635 |
if (!callbackResult) { |
| 30636 |
passingFilter = false; |
| 30637 |
} |
| 30638 |
|
| 30639 |
return callbackResult; |
| 30640 |
} |
| 30641 |
|
| 30642 |
var filterResult = filterValue === childModel.get(filterTermName); |
| 30643 |
|
| 30644 |
if (!filterResult) { |
| 30645 |
passingFilter = false; |
| 30646 |
} |
| 30647 |
|
| 30648 |
return filterResult; |
| 30649 |
}); |
| 30650 |
return passingFilter; |
| 30651 |
}, |
| 30652 |
order: function order(by, reverseOrder) { |
| 30653 |
var comparator = this.comparators[by] || by; |
| 30654 |
|
| 30655 |
if (reverseOrder) { |
| 30656 |
comparator = this.reverseOrder(comparator); |
| 30657 |
} |
| 30658 |
|
| 30659 |
this.collection.comparator = comparator; |
| 30660 |
this.collection.sort(); |
| 30661 |
}, |
| 30662 |
reverseOrder: function reverseOrder(comparator) { |
| 30663 |
if ('function' !== typeof comparator) { |
| 30664 |
var comparatorValue = comparator; |
| 30665 |
|
| 30666 |
comparator = function comparator(model) { |
| 30667 |
return model.get(comparatorValue); |
| 30668 |
}; |
| 30669 |
} |
| 30670 |
|
| 30671 |
return function (left, right) { |
| 30672 |
var l = comparator(left), |
| 30673 |
r = comparator(right); |
| 30674 |
|
| 30675 |
if (undefined === l) { |
| 30676 |
return -1; |
| 30677 |
} |
| 30678 |
|
| 30679 |
if (undefined === r) { |
| 30680 |
return 1; |
| 30681 |
} |
| 30682 |
|
| 30683 |
if (l < r) { |
| 30684 |
return 1; |
| 30685 |
} |
| 30686 |
|
| 30687 |
if (l > r) { |
| 30688 |
return -1; |
| 30689 |
} |
| 30690 |
|
| 30691 |
return 0; |
| 30692 |
}; |
| 30693 |
}, |
| 30694 |
addSourceData: function addSourceData() { |
| 30695 |
var isEmpty = this.children.isEmpty(); |
| 30696 |
this.$el.attr('data-template-source', isEmpty ? 'empty' : elementor.templates.getFilter('source')); |
| 30697 |
}, |
| 30698 |
setFiltersUI: function setFiltersUI() { |
| 30699 |
var $filters = this.$(this.ui.selectFilter); |
| 30700 |
$filters.select2({ |
| 30701 |
placeholder: elementor.translate('category'), |
| 30702 |
allowClear: true, |
| 30703 |
width: 150, |
| 30704 |
dropdownParent: this.$el |
| 30705 |
}); |
| 30706 |
}, |
| 30707 |
setMasonrySkin: function setMasonrySkin() { |
| 30708 |
var masonry = new elementorModules.utils.Masonry({ |
| 30709 |
container: this.$childViewContainer, |
| 30710 |
items: this.$childViewContainer.children() |
| 30711 |
}); |
| 30712 |
this.$childViewContainer.imagesLoaded(masonry.run.bind(masonry)); |
| 30713 |
}, |
| 30714 |
toggleFilterClass: function toggleFilterClass() { |
| 30715 |
this.$el.toggleClass('elementor-templates-filter-active', !!(elementor.templates.getFilter('text') || elementor.templates.getFilter('favorite'))); |
| 30716 |
}, |
| 30717 |
onRender: function onRender() { |
| 30718 |
if ('remote' === elementor.templates.getFilter('source') && 'page' !== elementor.templates.getFilter('type')) { |
| 30719 |
this.setFiltersUI(); |
| 30720 |
} |
| 30721 |
}, |
| 30722 |
onRenderCollection: function onRenderCollection() { |
| 30723 |
this.addSourceData(); |
| 30724 |
this.toggleFilterClass(); |
| 30725 |
|
| 30726 |
if ('remote' === elementor.templates.getFilter('source') && 'page' !== elementor.templates.getFilter('type')) { |
| 30727 |
this.setMasonrySkin(); |
| 30728 |
} |
| 30729 |
}, |
| 30730 |
onBeforeRenderEmpty: function onBeforeRenderEmpty() { |
| 30731 |
this.addSourceData(); |
| 30732 |
}, |
| 30733 |
onTextFilterInput: function onTextFilterInput() { |
| 30734 |
elementor.templates.setFilter('text', this.ui.textFilter.val()); |
| 30735 |
}, |
| 30736 |
onSelectFilterChange: function onSelectFilterChange(event) { |
| 30737 |
var $select = jQuery(event.currentTarget), |
| 30738 |
filterName = $select.data('elementor-filter'); |
| 30739 |
elementor.templates.setFilter(filterName, $select.val()); |
| 30740 |
}, |
| 30741 |
onMyFavoritesFilterChange: function onMyFavoritesFilterChange() { |
| 30742 |
elementor.templates.setFilter('favorite', this.ui.myFavoritesFilter[0].checked); |
| 30743 |
}, |
| 30744 |
onOrderLabelsClick: function onOrderLabelsClick(event) { |
| 30745 |
var $clickedInput = jQuery(event.currentTarget.control), |
| 30746 |
toggle; |
| 30747 |
|
| 30748 |
if (!$clickedInput[0].checked) { |
| 30749 |
toggle = 'asc' !== $clickedInput.data('default-ordering-direction'); |
| 30750 |
} |
| 30751 |
|
| 30752 |
$clickedInput.toggleClass('elementor-template-library-order-reverse', toggle); |
| 30753 |
this.order($clickedInput.val(), $clickedInput.hasClass('elementor-template-library-order-reverse')); |
| 30754 |
} |
| 30755 |
}); |
| 30756 |
module.exports = TemplateLibraryCollectionView; |
| 30757 |
|
| 30758 |
/***/ }), |
| 30759 |
/* 548 */ |
| 30760 |
/***/ (function(module, exports, __webpack_require__) { |
| 30761 |
|
| 30762 |
"use strict"; |
| 30763 |
|
| 30764 |
|
| 30765 |
var TemplateLibraryTemplateView = __webpack_require__(379), |
| 30766 |
TemplateLibraryTemplateLocalView; |
| 30767 |
|
| 30768 |
TemplateLibraryTemplateLocalView = TemplateLibraryTemplateView.extend({ |
| 30769 |
template: '#tmpl-elementor-template-library-template-local', |
| 30770 |
ui: function ui() { |
| 30771 |
return _.extend(TemplateLibraryTemplateView.prototype.ui.apply(this, arguments), { |
| 30772 |
deleteButton: '.elementor-template-library-template-delete', |
| 30773 |
morePopup: '.elementor-template-library-template-more', |
| 30774 |
toggleMore: '.elementor-template-library-template-more-toggle', |
| 30775 |
toggleMoreIcon: '.elementor-template-library-template-more-toggle i' |
| 30776 |
}); |
| 30777 |
}, |
| 30778 |
events: function events() { |
| 30779 |
return _.extend(TemplateLibraryTemplateView.prototype.events.apply(this, arguments), { |
| 30780 |
'click @ui.deleteButton': 'onDeleteButtonClick', |
| 30781 |
'click @ui.toggleMore': 'onToggleMoreClick' |
| 30782 |
}); |
| 30783 |
}, |
| 30784 |
onDeleteButtonClick: function onDeleteButtonClick() { |
| 30785 |
var toggleMoreIcon = this.ui.toggleMoreIcon; |
| 30786 |
elementor.templates.deleteTemplate(this.model, { |
| 30787 |
onConfirm: function onConfirm() { |
| 30788 |
toggleMoreIcon.removeClass('eicon-ellipsis-h').addClass('eicon-loading eicon-animation-spin'); |
| 30789 |
}, |
| 30790 |
onSuccess: function onSuccess() { |
| 30791 |
elementor.templates.showTemplates(); |
| 30792 |
} |
| 30793 |
}); |
| 30794 |
}, |
| 30795 |
onToggleMoreClick: function onToggleMoreClick() { |
| 30796 |
this.ui.morePopup.show(); |
| 30797 |
}, |
| 30798 |
onPreviewButtonClick: function onPreviewButtonClick() { |
| 30799 |
open(this.model.get('url'), '_blank'); |
| 30800 |
} |
| 30801 |
}); |
| 30802 |
module.exports = TemplateLibraryTemplateLocalView; |
| 30803 |
|
| 30804 |
/***/ }), |
| 30805 |
/* 549 */ |
| 30806 |
/***/ (function(module, exports, __webpack_require__) { |
| 30807 |
|
| 30808 |
"use strict"; |
| 30809 |
|
| 30810 |
|
| 30811 |
var TemplateLibraryTemplateView = __webpack_require__(379), |
| 30812 |
TemplateLibraryTemplateRemoteView; |
| 30813 |
|
| 30814 |
TemplateLibraryTemplateRemoteView = TemplateLibraryTemplateView.extend({ |
| 30815 |
template: '#tmpl-elementor-template-library-template-remote', |
| 30816 |
ui: function ui() { |
| 30817 |
return jQuery.extend(TemplateLibraryTemplateView.prototype.ui.apply(this, arguments), { |
| 30818 |
favoriteCheckbox: '.elementor-template-library-template-favorite-input' |
| 30819 |
}); |
| 30820 |
}, |
| 30821 |
events: function events() { |
| 30822 |
return jQuery.extend(TemplateLibraryTemplateView.prototype.events.apply(this, arguments), { |
| 30823 |
'change @ui.favoriteCheckbox': 'onFavoriteCheckboxChange' |
| 30824 |
}); |
| 30825 |
}, |
| 30826 |
onPreviewButtonClick: function onPreviewButtonClick() { |
| 30827 |
$e.route('library/preview', { |
| 30828 |
model: this.model |
| 30829 |
}); |
| 30830 |
}, |
| 30831 |
onFavoriteCheckboxChange: function onFavoriteCheckboxChange() { |
| 30832 |
var isFavorite = this.ui.favoriteCheckbox[0].checked; |
| 30833 |
this.model.set('favorite', isFavorite); |
| 30834 |
elementor.templates.markAsFavorite(this.model, isFavorite); |
| 30835 |
|
| 30836 |
if (!isFavorite && elementor.templates.getFilter('favorite')) { |
| 30837 |
elementor.channels.templates.trigger('filter:change'); |
| 30838 |
} |
| 30839 |
} |
| 30840 |
}); |
| 30841 |
module.exports = TemplateLibraryTemplateRemoteView; |
| 30842 |
|
| 30843 |
/***/ }), |
| 30844 |
/* 550 */ |
| 30845 |
/***/ (function(module, exports, __webpack_require__) { |
| 30846 |
|
| 30847 |
"use strict"; |
| 30848 |
|
| 30849 |
|
| 30850 |
var TemplateLibraryTemplatesEmptyView; |
| 30851 |
TemplateLibraryTemplatesEmptyView = Marionette.ItemView.extend({ |
| 30852 |
id: 'elementor-template-library-templates-empty', |
| 30853 |
template: '#tmpl-elementor-template-library-templates-empty', |
| 30854 |
ui: { |
| 30855 |
title: '.elementor-template-library-blank-title', |
| 30856 |
message: '.elementor-template-library-blank-message' |
| 30857 |
}, |
| 30858 |
modesStrings: { |
| 30859 |
empty: { |
| 30860 |
title: elementor.translate('templates_empty_title'), |
| 30861 |
message: elementor.translate('templates_empty_message') |
| 30862 |
}, |
| 30863 |
noResults: { |
| 30864 |
title: elementor.translate('templates_no_results_title'), |
| 30865 |
message: elementor.translate('templates_no_results_message') |
| 30866 |
}, |
| 30867 |
noFavorites: { |
| 30868 |
title: elementor.translate('templates_no_favorites_title'), |
| 30869 |
message: elementor.translate('templates_no_favorites_message') |
| 30870 |
} |
| 30871 |
}, |
| 30872 |
getCurrentMode: function getCurrentMode() { |
| 30873 |
if (elementor.templates.getFilter('text')) { |
| 30874 |
return 'noResults'; |
| 30875 |
} |
| 30876 |
|
| 30877 |
if (elementor.templates.getFilter('favorite')) { |
| 30878 |
return 'noFavorites'; |
| 30879 |
} |
| 30880 |
|
| 30881 |
return 'empty'; |
| 30882 |
}, |
| 30883 |
onRender: function onRender() { |
| 30884 |
var modeStrings = this.modesStrings[this.getCurrentMode()]; |
| 30885 |
this.ui.title.html(modeStrings.title); |
| 30886 |
this.ui.message.html(modeStrings.message); |
| 30887 |
} |
| 30888 |
}); |
| 30889 |
module.exports = TemplateLibraryTemplatesEmptyView; |
| 30890 |
|
| 30891 |
/***/ }), |
| 30892 |
/* 551 */ |
| 30893 |
/***/ (function(module, exports, __webpack_require__) { |
| 30894 |
|
| 30895 |
"use strict"; |
| 30896 |
|
| 30897 |
|
| 30898 |
var TemplateLibrarySaveTemplateView; |
| 30899 |
TemplateLibrarySaveTemplateView = Marionette.ItemView.extend({ |
| 30900 |
id: 'elementor-template-library-save-template', |
| 30901 |
template: '#tmpl-elementor-template-library-save-template', |
| 30902 |
ui: { |
| 30903 |
form: '#elementor-template-library-save-template-form', |
| 30904 |
submitButton: '#elementor-template-library-save-template-submit' |
| 30905 |
}, |
| 30906 |
events: { |
| 30907 |
'submit @ui.form': 'onFormSubmit' |
| 30908 |
}, |
| 30909 |
getSaveType: function getSaveType() { |
| 30910 |
var type; |
| 30911 |
|
| 30912 |
if (this.model) { |
| 30913 |
type = this.model.get('elType'); |
| 30914 |
} else if (elementor.config.document.library && elementor.config.document.library.save_as_same_type) { |
| 30915 |
type = elementor.config.document.type; |
| 30916 |
} else { |
| 30917 |
type = 'page'; |
| 30918 |
} |
| 30919 |
|
| 30920 |
return type; |
| 30921 |
}, |
| 30922 |
templateHelpers: function templateHelpers() { |
| 30923 |
var saveType = this.getSaveType(), |
| 30924 |
templateType = elementor.templates.getTemplateTypes(saveType); |
| 30925 |
return templateType.saveDialog; |
| 30926 |
}, |
| 30927 |
onFormSubmit: function onFormSubmit(event) { |
| 30928 |
event.preventDefault(); |
| 30929 |
var formData = this.ui.form.elementorSerializeObject(), |
| 30930 |
saveType = this.getSaveType(), |
| 30931 |
JSONParams = { |
| 30932 |
remove: ['default'] |
| 30933 |
}; |
| 30934 |
formData.content = this.model ? [this.model.toJSON(JSONParams)] : elementor.elements.toJSON(JSONParams); |
| 30935 |
this.ui.submitButton.addClass('elementor-button-state'); |
| 30936 |
elementor.templates.saveTemplate(saveType, formData); |
| 30937 |
} |
| 30938 |
}); |
| 30939 |
module.exports = TemplateLibrarySaveTemplateView; |
| 30940 |
|
| 30941 |
/***/ }), |
| 30942 |
/* 552 */ |
| 30943 |
/***/ (function(module, exports, __webpack_require__) { |
| 30944 |
|
| 30945 |
"use strict"; |
| 30946 |
|
| 30947 |
|
| 30948 |
__webpack_require__(58); |
| 30949 |
|
| 30950 |
__webpack_require__(39); |
| 30951 |
|
| 30952 |
var TemplateLibraryImportView; |
| 30953 |
TemplateLibraryImportView = Marionette.ItemView.extend({ |
| 30954 |
template: '#tmpl-elementor-template-library-import', |
| 30955 |
id: 'elementor-template-library-import', |
| 30956 |
ui: { |
| 30957 |
uploadForm: '#elementor-template-library-import-form', |
| 30958 |
fileInput: '#elementor-template-library-import-form-input' |
| 30959 |
}, |
| 30960 |
events: { |
| 30961 |
'change @ui.fileInput': 'onFileInputChange' |
| 30962 |
}, |
| 30963 |
droppedFiles: null, |
| 30964 |
submitForm: function submitForm() { |
| 30965 |
var _this = this; |
| 30966 |
|
| 30967 |
var file; |
| 30968 |
|
| 30969 |
if (this.droppedFiles) { |
| 30970 |
file = this.droppedFiles[0]; |
| 30971 |
this.droppedFiles = null; |
| 30972 |
} else { |
| 30973 |
file = this.ui.fileInput[0].files[0]; |
| 30974 |
this.ui.uploadForm[0].reset(); |
| 30975 |
} |
| 30976 |
|
| 30977 |
var fileReader = new FileReader(); |
| 30978 |
|
| 30979 |
fileReader.onload = function (event) { |
| 30980 |
return _this.importTemplate(file.name, event.target.result.replace(/^[^,]+,/, '')); |
| 30981 |
}; |
| 30982 |
|
| 30983 |
fileReader.readAsDataURL(file); |
| 30984 |
}, |
| 30985 |
importTemplate: function importTemplate(fileName, fileData) { |
| 30986 |
var layout = elementor.templates.layout; |
| 30987 |
var options = { |
| 30988 |
data: { |
| 30989 |
fileName: fileName, |
| 30990 |
fileData: fileData |
| 30991 |
}, |
| 30992 |
success: function success(successData) { |
| 30993 |
elementor.templates.getTemplatesCollection().add(successData); |
| 30994 |
$e.route('library/templates/my-templates'); |
| 30995 |
}, |
| 30996 |
error: function error(errorData) { |
| 30997 |
elementor.templates.showErrorDialog(errorData); |
| 30998 |
layout.showImportView(); |
| 30999 |
}, |
| 31000 |
complete: function complete() { |
| 31001 |
layout.hideLoadingView(); |
| 31002 |
} |
| 31003 |
}; |
| 31004 |
elementorCommon.ajax.addRequest('import_template', options); |
| 31005 |
layout.showLoadingView(); |
| 31006 |
}, |
| 31007 |
onRender: function onRender() { |
| 31008 |
this.ui.uploadForm.on({ |
| 31009 |
'drag dragstart dragend dragover dragenter dragleave drop': this.onFormActions.bind(this), |
| 31010 |
dragenter: this.onFormDragEnter.bind(this), |
| 31011 |
'dragleave drop': this.onFormDragLeave.bind(this), |
| 31012 |
drop: this.onFormDrop.bind(this) |
| 31013 |
}); |
| 31014 |
}, |
| 31015 |
onFormActions: function onFormActions(event) { |
| 31016 |
event.preventDefault(); |
| 31017 |
event.stopPropagation(); |
| 31018 |
}, |
| 31019 |
onFormDragEnter: function onFormDragEnter() { |
| 31020 |
this.ui.uploadForm.addClass('elementor-drag-over'); |
| 31021 |
}, |
| 31022 |
onFormDragLeave: function onFormDragLeave(event) { |
| 31023 |
if (jQuery(event.relatedTarget).closest(this.ui.uploadForm).length) { |
| 31024 |
return; |
| 31025 |
} |
| 31026 |
|
| 31027 |
this.ui.uploadForm.removeClass('elementor-drag-over'); |
| 31028 |
}, |
| 31029 |
onFormDrop: function onFormDrop(event) { |
| 31030 |
this.droppedFiles = event.originalEvent.dataTransfer.files; |
| 31031 |
this.submitForm(); |
| 31032 |
}, |
| 31033 |
onFileInputChange: function onFileInputChange() { |
| 31034 |
this.submitForm(); |
| 31035 |
} |
| 31036 |
}); |
| 31037 |
module.exports = TemplateLibraryImportView; |
| 31038 |
|
| 31039 |
/***/ }), |
| 31040 |
/* 553 */ |
| 31041 |
/***/ (function(module, exports, __webpack_require__) { |
| 31042 |
|
| 31043 |
"use strict"; |
| 31044 |
|
| 31045 |
|
| 31046 |
module.exports = Marionette.ItemView.extend({ |
| 31047 |
template: '#tmpl-elementor-template-library-connect', |
| 31048 |
id: 'elementor-template-library-connect', |
| 31049 |
ui: { |
| 31050 |
connect: '#elementor-template-library-connect__button', |
| 31051 |
thumbnails: '#elementor-template-library-connect-thumbnails' |
| 31052 |
}, |
| 31053 |
templateHelpers: function templateHelpers() { |
| 31054 |
return this.getOption('texts'); |
| 31055 |
}, |
| 31056 |
onRender: function onRender() { |
| 31057 |
var _this = this; |
| 31058 |
|
| 31059 |
this.ui.connect.elementorConnect({ |
| 31060 |
success: function success() { |
| 31061 |
elementor.config.library_connect.is_connected = true; // If is connecting during insert template. |
| 31062 |
|
| 31063 |
if (_this.getOption('model')) { |
| 31064 |
$e.run('library/insert-template', { |
| 31065 |
model: _this.getOption('model') |
| 31066 |
}); |
| 31067 |
} else { |
| 31068 |
$e.run('library/close'); |
| 31069 |
elementor.notifications.showToast({ |
| 31070 |
message: elementor.translate('connected_successfully') |
| 31071 |
}); |
| 31072 |
} |
| 31073 |
}, |
| 31074 |
error: function error() { |
| 31075 |
elementor.config.library_connect.is_connected = false; |
| 31076 |
} |
| 31077 |
}); |
| 31078 |
} |
| 31079 |
}); |
| 31080 |
|
| 31081 |
/***/ }), |
| 31082 |
/* 554 */ |
| 31083 |
/***/ (function(module, exports, __webpack_require__) { |
| 31084 |
|
| 31085 |
"use strict"; |
| 31086 |
|
| 31087 |
|
| 31088 |
var TemplateLibraryPreviewView; |
| 31089 |
TemplateLibraryPreviewView = Marionette.ItemView.extend({ |
| 31090 |
template: '#tmpl-elementor-template-library-preview', |
| 31091 |
id: 'elementor-template-library-preview', |
| 31092 |
ui: { |
| 31093 |
iframe: '> iframe' |
| 31094 |
}, |
| 31095 |
onRender: function onRender() { |
| 31096 |
this.ui.iframe.attr('src', this.getOption('url')); |
| 31097 |
} |
| 31098 |
}); |
| 31099 |
module.exports = TemplateLibraryPreviewView; |
| 31100 |
|
| 31101 |
/***/ }), |
| 31102 |
/* 555 */ |
| 31103 |
/***/ (function(module, exports, __webpack_require__) { |
| 31104 |
|
| 31105 |
"use strict"; |
| 31106 |
|
| 31107 |
|
| 31108 |
var TemplateLibraryTemplateModel = __webpack_require__(556), |
| 31109 |
TemplateLibraryCollection; |
| 31110 |
|
| 31111 |
TemplateLibraryCollection = Backbone.Collection.extend({ |
| 31112 |
model: TemplateLibraryTemplateModel |
| 31113 |
}); |
| 31114 |
module.exports = TemplateLibraryCollection; |
| 31115 |
|
| 31116 |
/***/ }), |
| 31117 |
/* 556 */ |
| 31118 |
/***/ (function(module, exports, __webpack_require__) { |
| 31119 |
|
| 31120 |
"use strict"; |
| 31121 |
|
| 31122 |
|
| 31123 |
module.exports = Backbone.Model.extend({ |
| 31124 |
defaults: { |
| 31125 |
template_id: 0, |
| 31126 |
title: '', |
| 31127 |
source: '', |
| 31128 |
type: '', |
| 31129 |
subtype: '', |
| 31130 |
author: '', |
| 31131 |
thumbnail: '', |
| 31132 |
url: '', |
| 31133 |
export_link: '', |
| 31134 |
tags: [] |
| 31135 |
} |
| 31136 |
}); |
| 31137 |
|
| 31138 |
/***/ }), |
| 31139 |
/* 557 */ |
| 31140 |
/***/ (function(module, exports, __webpack_require__) { |
| 31141 |
|
| 31142 |
"use strict"; |
| 31143 |
|
| 31144 |
|
| 31145 |
__webpack_require__(39); |
| 31146 |
|
| 31147 |
__webpack_require__(119); |
| 31148 |
|
| 31149 |
var Conditions; |
| 31150 |
|
| 31151 |
Conditions = function Conditions() { |
| 31152 |
var self = this; |
| 31153 |
|
| 31154 |
this.compare = function (leftValue, rightValue, operator) { |
| 31155 |
switch (operator) { |
| 31156 |
/* eslint-disable eqeqeq */ |
| 31157 |
case '==': |
| 31158 |
return leftValue == rightValue; |
| 31159 |
|
| 31160 |
case '!=': |
| 31161 |
return leftValue != rightValue; |
| 31162 |
|
| 31163 |
/* eslint-enable eqeqeq */ |
| 31164 |
|
| 31165 |
case '!==': |
| 31166 |
return leftValue !== rightValue; |
| 31167 |
|
| 31168 |
case 'in': |
| 31169 |
return -1 !== rightValue.indexOf(leftValue); |
| 31170 |
|
| 31171 |
case '!in': |
| 31172 |
return -1 === rightValue.indexOf(leftValue); |
| 31173 |
|
| 31174 |
case 'contains': |
| 31175 |
return -1 !== leftValue.indexOf(rightValue); |
| 31176 |
|
| 31177 |
case '!contains': |
| 31178 |
return -1 === leftValue.indexOf(rightValue); |
| 31179 |
|
| 31180 |
case '<': |
| 31181 |
return leftValue < rightValue; |
| 31182 |
|
| 31183 |
case '<=': |
| 31184 |
return leftValue <= rightValue; |
| 31185 |
|
| 31186 |
case '>': |
| 31187 |
return leftValue > rightValue; |
| 31188 |
|
| 31189 |
case '>=': |
| 31190 |
return leftValue >= rightValue; |
| 31191 |
|
| 31192 |
default: |
| 31193 |
return leftValue === rightValue; |
| 31194 |
} |
| 31195 |
}; |
| 31196 |
|
| 31197 |
this.check = function (conditions, comparisonObject) { |
| 31198 |
var isOrCondition = 'or' === conditions.relation, |
| 31199 |
conditionSucceed = !isOrCondition; |
| 31200 |
jQuery.each(conditions.terms, function () { |
| 31201 |
var term = this, |
| 31202 |
comparisonResult; |
| 31203 |
|
| 31204 |
if (term.terms) { |
| 31205 |
comparisonResult = self.check(term, comparisonObject); |
| 31206 |
} else { |
| 31207 |
var parsedName = term.name.match(/(\w+)(?:\[(\w+)])?/), |
| 31208 |
value = comparisonObject[parsedName[1]]; |
| 31209 |
|
| 31210 |
if (parsedName[2]) { |
| 31211 |
value = value[parsedName[2]]; |
| 31212 |
} |
| 31213 |
|
| 31214 |
comparisonResult = self.compare(value, term.value, term.operator); |
| 31215 |
} |
| 31216 |
|
| 31217 |
if (isOrCondition) { |
| 31218 |
if (comparisonResult) { |
| 31219 |
conditionSucceed = true; |
| 31220 |
} |
| 31221 |
|
| 31222 |
return !comparisonResult; |
| 31223 |
} |
| 31224 |
|
| 31225 |
if (!comparisonResult) { |
| 31226 |
return conditionSucceed = false; |
| 31227 |
} |
| 31228 |
}); |
| 31229 |
return conditionSucceed; |
| 31230 |
}; |
| 31231 |
}; |
| 31232 |
|
| 31233 |
module.exports = new Conditions(); |
| 31234 |
|
| 31235 |
/***/ }), |
| 31236 |
/* 558 */ |
| 31237 |
/***/ (function(module, exports, __webpack_require__) { |
| 31238 |
|
| 31239 |
"use strict"; |
| 31240 |
|
| 31241 |
|
| 31242 |
var _interopRequireDefault = __webpack_require__(0); |
| 31243 |
|
| 31244 |
__webpack_require__(25); |
| 31245 |
|
| 31246 |
var _classCallCheck2 = _interopRequireDefault(__webpack_require__(2)); |
| 31247 |
|
| 31248 |
var _createClass2 = _interopRequireDefault(__webpack_require__(3)); |
| 31249 |
|
| 31250 |
var _assertThisInitialized2 = _interopRequireDefault(__webpack_require__(49)); |
| 31251 |
|
| 31252 |
var _inherits2 = _interopRequireDefault(__webpack_require__(4)); |
| 31253 |
|
| 31254 |
var _createSuper2 = _interopRequireDefault(__webpack_require__(5)); |
| 31255 |
|
| 31256 |
var _defineProperty2 = _interopRequireDefault(__webpack_require__(28)); |
| 31257 |
|
| 31258 |
var _temp; |
| 31259 |
|
| 31260 |
module.exports = (_temp = /*#__PURE__*/function (_Marionette$Behavior) { |
| 31261 |
(0, _inherits2.default)(FooterSaver, _Marionette$Behavior); |
| 31262 |
|
| 31263 |
var _super = (0, _createSuper2.default)(FooterSaver); |
| 31264 |
|
| 31265 |
function FooterSaver() { |
| 31266 |
var _this; |
| 31267 |
|
| 31268 |
(0, _classCallCheck2.default)(this, FooterSaver); |
| 31269 |
|
| 31270 |
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { |
| 31271 |
args[_key] = arguments[_key]; |
| 31272 |
} |
| 31273 |
|
| 31274 |
_this = _super.call.apply(_super, [this].concat(args)); |
| 31275 |
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "previewWindow", null); |
| 31276 |
return _this; |
| 31277 |
} |
| 31278 |
|
| 31279 |
(0, _createClass2.default)(FooterSaver, [{ |
| 31280 |
key: "ui", |
| 31281 |
value: function ui() { |
| 31282 |
return { |
| 31283 |
buttonPreview: '#elementor-panel-footer-saver-preview', |
| 31284 |
buttonPublish: '#elementor-panel-saver-button-publish', |
| 31285 |
buttonSaveOptions: '#elementor-panel-saver-button-save-options', |
| 31286 |
buttonPublishLabel: '#elementor-panel-saver-button-publish-label', |
| 31287 |
menuSaveDraft: '#elementor-panel-footer-sub-menu-item-save-draft', |
| 31288 |
lastEditedWrapper: '.elementor-last-edited-wrapper' |
| 31289 |
}; |
| 31290 |
} |
| 31291 |
}, { |
| 31292 |
key: "events", |
| 31293 |
value: function events() { |
| 31294 |
return { |
| 31295 |
'click @ui.buttonPreview': 'onClickButtonPreview', |
| 31296 |
'click @ui.buttonPublish': 'onClickButtonPublish', |
| 31297 |
'click @ui.menuSaveDraft': 'onClickMenuSaveDraft' |
| 31298 |
}; |
| 31299 |
} |
| 31300 |
}, { |
| 31301 |
key: "initialize", |
| 31302 |
value: function initialize(options) { |
| 31303 |
var _this2 = this; |
| 31304 |
|
| 31305 |
this.document = options.document || elementor.documents.getCurrent(); |
| 31306 |
elementor.on('document:loaded', function (document) { |
| 31307 |
_this2.setMenuItems(document); |
| 31308 |
|
| 31309 |
_this2.setLastEdited(document.config.last_edited); |
| 31310 |
}); // TODO: Temp, footerSaver should be removed. |
| 31311 |
|
| 31312 |
$e.components.get('document/save').footerSaver = this; |
| 31313 |
} |
| 31314 |
}, { |
| 31315 |
key: "activateSaveButtons", |
| 31316 |
value: function activateSaveButtons(document, status) { |
| 31317 |
var hasChanges = status || 'draft' === document.container.settings.get('post_status'); |
| 31318 |
this.ui.buttonPublish.add(this.ui.menuSaveDraft).toggleClass('elementor-disabled', !hasChanges); |
| 31319 |
this.ui.buttonSaveOptions.toggleClass('elementor-disabled', !hasChanges); |
| 31320 |
} |
| 31321 |
}, { |
| 31322 |
key: "onRender", |
| 31323 |
value: function onRender() { |
| 31324 |
this.addTooltip(); |
| 31325 |
} |
| 31326 |
}, { |
| 31327 |
key: "setLastEdited", |
| 31328 |
value: function setLastEdited(lastEdited) { |
| 31329 |
this.ui.lastEditedWrapper.removeClass('elementor-button-state').find('.elementor-last-edited').html(lastEdited); |
| 31330 |
} |
| 31331 |
}, { |
| 31332 |
key: "onClickButtonPreview", |
| 31333 |
value: function onClickButtonPreview() { |
| 31334 |
$e.run('editor/documents/preview', { |
| 31335 |
id: elementor.documents.getCurrent().id |
| 31336 |
}); |
| 31337 |
} |
| 31338 |
}, { |
| 31339 |
key: "onClickButtonPublish", |
| 31340 |
value: function onClickButtonPublish() { |
| 31341 |
if (this.ui.buttonPublish.hasClass('elementor-disabled')) { |
| 31342 |
return; |
| 31343 |
} |
| 31344 |
|
| 31345 |
$e.run('document/save/default'); |
| 31346 |
} |
| 31347 |
}, { |
| 31348 |
key: "onClickMenuSaveDraft", |
| 31349 |
value: function onClickMenuSaveDraft() { |
| 31350 |
$e.run('document/save/draft'); |
| 31351 |
} |
| 31352 |
}, { |
| 31353 |
key: "setMenuItems", |
| 31354 |
value: function setMenuItems(document) { |
| 31355 |
var postStatus = document.container.settings.get('post_status'); |
| 31356 |
var publishLabel = 'publish'; |
| 31357 |
|
| 31358 |
switch (postStatus) { |
| 31359 |
case 'publish': |
| 31360 |
case 'private': |
| 31361 |
publishLabel = 'update'; |
| 31362 |
|
| 31363 |
if (document.config.revisions.current_id !== document.id) { |
| 31364 |
this.activateSaveButtons(document, true); |
| 31365 |
} |
| 31366 |
|
| 31367 |
break; |
| 31368 |
|
| 31369 |
case 'draft': |
| 31370 |
if (!document.config.user.can_publish) { |
| 31371 |
publishLabel = 'submit'; |
| 31372 |
} |
| 31373 |
|
| 31374 |
this.activateSaveButtons(document, true); |
| 31375 |
break; |
| 31376 |
|
| 31377 |
case 'pending': // User cannot change post status |
| 31378 |
|
| 31379 |
case undefined: |
| 31380 |
// TODO: as a contributor it's undefined instead of 'pending'. |
| 31381 |
if (!document.config.user.can_publish) { |
| 31382 |
publishLabel = 'update'; |
| 31383 |
} |
| 31384 |
|
| 31385 |
break; |
| 31386 |
} |
| 31387 |
|
| 31388 |
this.ui.buttonPublishLabel.html(elementor.translate(publishLabel)); |
| 31389 |
} |
| 31390 |
}, { |
| 31391 |
key: "addTooltip", |
| 31392 |
value: function addTooltip() { |
| 31393 |
// Create tooltip on controls |
| 31394 |
this.$el.find('.tooltip-target').each(function (index, button) { |
| 31395 |
var $button = jQuery(button); |
| 31396 |
$button.tipsy({ |
| 31397 |
// `n` for down, `s` for up |
| 31398 |
gravity: 's', |
| 31399 |
offset: $button.data('tooltip-offset'), |
| 31400 |
title: function title() { |
| 31401 |
return this.getAttribute('data-tooltip'); |
| 31402 |
} |
| 31403 |
}); |
| 31404 |
}); |
| 31405 |
} // TODO: Consider $e.internal( 'editor/documents/preview-refresh' ); ?. |
| 31406 |
|
| 31407 |
}, { |
| 31408 |
key: "refreshWpPreview", |
| 31409 |
value: function refreshWpPreview() { |
| 31410 |
if (this.previewWindow) { |
| 31411 |
// Refresh URL form updated config. |
| 31412 |
try { |
| 31413 |
this.previewWindow.location.href = elementor.config.document.urls.wp_preview; |
| 31414 |
} catch (e) {// If the this.previewWindow is closed or it's domain was changed. |
| 31415 |
// Do nothing. |
| 31416 |
} |
| 31417 |
} |
| 31418 |
} |
| 31419 |
}]); |
| 31420 |
return FooterSaver; |
| 31421 |
}(Marionette.Behavior), _temp); |
| 31422 |
|
| 31423 |
/***/ }), |
| 31424 |
/* 559 */ |
| 31425 |
/***/ (function(module, exports, __webpack_require__) { |
| 31426 |
|
| 31427 |
"use strict"; |
| 31428 |
|
| 31429 |
|
| 31430 |
var ControlBaseView = __webpack_require__(281); |
| 31431 |
|
| 31432 |
module.exports = ControlBaseView.extend({ |
| 31433 |
ui: function ui() { |
| 31434 |
var ui = ControlBaseView.prototype.ui.apply(this, arguments); |
| 31435 |
ui.button = 'button'; |
| 31436 |
return ui; |
| 31437 |
}, |
| 31438 |
events: { |
| 31439 |
'click @ui.button': 'onButtonClick' |
| 31440 |
}, |
| 31441 |
onButtonClick: function onButtonClick() { |
| 31442 |
var eventName = this.model.get('event'); |
| 31443 |
elementor.channels.editor.trigger(eventName, this); |
| 31444 |
} |
| 31445 |
}); |
| 31446 |
|
| 31447 |
/***/ }), |
| 31448 |
/* 560 */ |
| 31449 |
/***/ (function(module, exports, __webpack_require__) { |
| 31450 |
|
| 31451 |
"use strict"; |
| 31452 |
|
| 31453 |
|
| 31454 |
__webpack_require__(119); |
| 31455 |
|
| 31456 |
var ControlBaseDataView = __webpack_require__(127), |
| 31457 |
ControlCodeEditorItemView; |
| 31458 |
|
| 31459 |
ControlCodeEditorItemView = ControlBaseDataView.extend({ |
| 31460 |
ui: function ui() { |
| 31461 |
var ui = ControlBaseDataView.prototype.ui.apply(this, arguments); |
| 31462 |
ui.editor = '.elementor-code-editor'; |
| 31463 |
return ui; |
| 31464 |
}, |
| 31465 |
onReady: function onReady() { |
| 31466 |
var self = this; |
| 31467 |
|
| 31468 |
if ('undefined' === typeof ace) { |
| 31469 |
return; |
| 31470 |
} |
| 31471 |
|
| 31472 |
var langTools = ace.require('ace/ext/language_tools'), |
| 31473 |
uiTheme = elementor.settings.editorPreferences.model.get('ui_theme'), |
| 31474 |
userPrefersDark = matchMedia('(prefers-color-scheme: dark)').matches; |
| 31475 |
|
| 31476 |
self.editor = ace.edit(this.ui.editor[0]); |
| 31477 |
jQuery(self.editor.container).addClass('elementor-input-style elementor-code-editor'); |
| 31478 |
self.editor.setOptions({ |
| 31479 |
mode: 'ace/mode/' + self.model.attributes.language, |
| 31480 |
minLines: 10, |
| 31481 |
maxLines: Infinity, |
| 31482 |
showGutter: true, |
| 31483 |
useWorker: true, |
| 31484 |
enableBasicAutocompletion: true, |
| 31485 |
enableLiveAutocompletion: true |
| 31486 |
}); |
| 31487 |
|
| 31488 |
if ('dark' === uiTheme || 'auto' === uiTheme && userPrefersDark) { |
| 31489 |
self.editor.setTheme('ace/theme/merbivore_soft'); |
| 31490 |
} |
| 31491 |
|
| 31492 |
self.editor.getSession().setUseWrapMode(true); |
| 31493 |
elementor.panel.$el.on('resize.aceEditor', self.onResize.bind(this)); |
| 31494 |
|
| 31495 |
if ('css' === self.model.attributes.language) { |
| 31496 |
var selectorCompleter = { |
| 31497 |
getCompletions: function getCompletions(editor, session, pos, prefix, callback) { |
| 31498 |
var list = [], |
| 31499 |
token = session.getTokenAt(pos.row, pos.column); |
| 31500 |
|
| 31501 |
if (0 < prefix.length && 'selector'.match(prefix) && 'constant' === token.type) { |
| 31502 |
list = [{ |
| 31503 |
name: 'selector', |
| 31504 |
value: 'selector', |
| 31505 |
score: 1, |
| 31506 |
meta: 'Elementor' |
| 31507 |
}]; |
| 31508 |
} |
| 31509 |
|
| 31510 |
callback(null, list); |
| 31511 |
} |
| 31512 |
}; |
| 31513 |
langTools.addCompleter(selectorCompleter); |
| 31514 |
} |
| 31515 |
|
| 31516 |
self.editor.setValue(self.getControlValue(), -1); // -1 = move cursor to the start |
| 31517 |
|
| 31518 |
self.editor.on('change', function () { |
| 31519 |
self.setValue(self.editor.getValue()); |
| 31520 |
}); |
| 31521 |
|
| 31522 |
if ('html' === self.model.attributes.language) { |
| 31523 |
// Remove the `doctype` annotation |
| 31524 |
var session = self.editor.getSession(); |
| 31525 |
session.on('changeAnnotation', function () { |
| 31526 |
var annotations = session.getAnnotations() || [], |
| 31527 |
annotationsLength = annotations.length, |
| 31528 |
index = annotations.length; |
| 31529 |
|
| 31530 |
while (index--) { |
| 31531 |
if (/doctype first\. Expected/.test(annotations[index].text)) { |
| 31532 |
annotations.splice(index, 1); |
| 31533 |
} |
| 31534 |
} |
| 31535 |
|
| 31536 |
if (annotationsLength > annotations.length) { |
| 31537 |
session.setAnnotations(annotations); |
| 31538 |
} |
| 31539 |
}); |
| 31540 |
} |
| 31541 |
}, |
| 31542 |
onResize: function onResize() { |
| 31543 |
this.editor.resize(); |
| 31544 |
}, |
| 31545 |
onDestroy: function onDestroy() { |
| 31546 |
elementor.panel.$el.off('resize.aceEditor'); |
| 31547 |
} |
| 31548 |
}); |
| 31549 |
module.exports = ControlCodeEditorItemView; |
| 31550 |
|
| 31551 |
/***/ }), |
| 31552 |
/* 561 */ |
| 31553 |
/***/ (function(module, exports, __webpack_require__) { |
| 31554 |
|
| 31555 |
"use strict"; |
| 31556 |
|
| 31557 |
|
| 31558 |
__webpack_require__(562); |
| 31559 |
|
| 31560 |
var ControlBaseUnitsItemView = __webpack_require__(381), |
| 31561 |
ControlDimensionsItemView; |
| 31562 |
|
| 31563 |
ControlDimensionsItemView = ControlBaseUnitsItemView.extend({ |
| 31564 |
ui: function ui() { |
| 31565 |
var ui = ControlBaseUnitsItemView.prototype.ui.apply(this, arguments); |
| 31566 |
ui.controls = '.elementor-control-dimension > input:enabled'; |
| 31567 |
ui.link = 'button.elementor-link-dimensions'; |
| 31568 |
return ui; |
| 31569 |
}, |
| 31570 |
events: function events() { |
| 31571 |
return _.extend(ControlBaseUnitsItemView.prototype.events.apply(this, arguments), { |
| 31572 |
'click @ui.link': 'onLinkDimensionsClicked' |
| 31573 |
}); |
| 31574 |
}, |
| 31575 |
defaultDimensionValue: 0, |
| 31576 |
initialize: function initialize() { |
| 31577 |
ControlBaseUnitsItemView.prototype.initialize.apply(this, arguments); // TODO: Need to be in helpers, and not in variable |
| 31578 |
|
| 31579 |
this.model.set('allowed_dimensions', this.filterDimensions(this.model.get('allowed_dimensions'))); |
| 31580 |
}, |
| 31581 |
getPossibleDimensions: function getPossibleDimensions() { |
| 31582 |
return ['top', 'right', 'bottom', 'left']; |
| 31583 |
}, |
| 31584 |
filterDimensions: function filterDimensions(filter) { |
| 31585 |
filter = filter || 'all'; |
| 31586 |
var dimensions = this.getPossibleDimensions(); |
| 31587 |
|
| 31588 |
if ('all' === filter) { |
| 31589 |
return dimensions; |
| 31590 |
} |
| 31591 |
|
| 31592 |
if (!_.isArray(filter)) { |
| 31593 |
if ('horizontal' === filter) { |
| 31594 |
filter = ['right', 'left']; |
| 31595 |
} else if ('vertical' === filter) { |
| 31596 |
filter = ['top', 'bottom']; |
| 31597 |
} |
| 31598 |
} |
| 31599 |
|
| 31600 |
return filter; |
| 31601 |
}, |
| 31602 |
onReady: function onReady() { |
| 31603 |
var self = this, |
| 31604 |
currentValue = self.getControlValue(); |
| 31605 |
|
| 31606 |
if (!self.isLinkedDimensions()) { |
| 31607 |
self.ui.link.addClass('unlinked'); |
| 31608 |
self.ui.controls.each(function (index, element) { |
| 31609 |
var value = currentValue[element.dataset.setting]; |
| 31610 |
|
| 31611 |
if (_.isEmpty(value)) { |
| 31612 |
value = self.defaultDimensionValue; |
| 31613 |
} |
| 31614 |
|
| 31615 |
self.$(element).val(value); |
| 31616 |
}); |
| 31617 |
} |
| 31618 |
|
| 31619 |
self.fillEmptyDimensions(); |
| 31620 |
}, |
| 31621 |
updateDimensionsValue: function updateDimensionsValue() { |
| 31622 |
var currentValue = {}, |
| 31623 |
dimensions = this.getPossibleDimensions(), |
| 31624 |
$controls = this.ui.controls, |
| 31625 |
defaultDimensionValue = this.defaultDimensionValue; |
| 31626 |
dimensions.forEach(function (dimension) { |
| 31627 |
var $element = $controls.filter('[data-setting="' + dimension + '"]'); |
| 31628 |
currentValue[dimension] = $element.length ? $element.val() : defaultDimensionValue; |
| 31629 |
}); |
| 31630 |
this.setValue(currentValue); |
| 31631 |
}, |
| 31632 |
fillEmptyDimensions: function fillEmptyDimensions() { |
| 31633 |
var dimensions = this.getPossibleDimensions(), |
| 31634 |
allowedDimensions = this.model.get('allowed_dimensions'), |
| 31635 |
$controls = this.ui.controls, |
| 31636 |
defaultDimensionValue = this.defaultDimensionValue; |
| 31637 |
|
| 31638 |
if (this.isLinkedDimensions()) { |
| 31639 |
return; |
| 31640 |
} |
| 31641 |
|
| 31642 |
dimensions.forEach(function (dimension) { |
| 31643 |
var $element = $controls.filter('[data-setting="' + dimension + '"]'), |
| 31644 |
isAllowedDimension = -1 !== _.indexOf(allowedDimensions, dimension); |
| 31645 |
|
| 31646 |
if (isAllowedDimension && $element.length && _.isEmpty($element.val())) { |
| 31647 |
$element.val(defaultDimensionValue); |
| 31648 |
} |
| 31649 |
}); |
| 31650 |
}, |
| 31651 |
updateDimensions: function updateDimensions() { |
| 31652 |
this.fillEmptyDimensions(); |
| 31653 |
this.updateDimensionsValue(); |
| 31654 |
}, |
| 31655 |
resetDimensions: function resetDimensions() { |
| 31656 |
this.ui.controls.val(''); |
| 31657 |
this.updateDimensionsValue(); |
| 31658 |
}, |
| 31659 |
onInputChange: function onInputChange(event) { |
| 31660 |
var inputSetting = event.target.dataset.setting; |
| 31661 |
|
| 31662 |
if ('unit' === inputSetting) { |
| 31663 |
this.resetDimensions(); |
| 31664 |
} |
| 31665 |
|
| 31666 |
if (!_.contains(this.getPossibleDimensions(), inputSetting)) { |
| 31667 |
return; |
| 31668 |
} |
| 31669 |
|
| 31670 |
if (this.isLinkedDimensions()) { |
| 31671 |
var $thisControl = this.$(event.target); |
| 31672 |
this.ui.controls.val($thisControl.val()); |
| 31673 |
} |
| 31674 |
|
| 31675 |
this.updateDimensions(); |
| 31676 |
}, |
| 31677 |
onLinkDimensionsClicked: function onLinkDimensionsClicked(event) { |
| 31678 |
event.preventDefault(); |
| 31679 |
event.stopPropagation(); |
| 31680 |
this.ui.link.toggleClass('unlinked'); |
| 31681 |
this.setValue('isLinked', !this.ui.link.hasClass('unlinked')); |
| 31682 |
|
| 31683 |
if (this.isLinkedDimensions()) { |
| 31684 |
// Set all controls value from the first control. |
| 31685 |
this.ui.controls.val(this.ui.controls.eq(0).val()); |
| 31686 |
} |
| 31687 |
|
| 31688 |
this.updateDimensions(); |
| 31689 |
}, |
| 31690 |
isLinkedDimensions: function isLinkedDimensions() { |
| 31691 |
return this.getControlValue('isLinked'); |
| 31692 |
} |
| 31693 |
}); |
| 31694 |
module.exports = ControlDimensionsItemView; |
| 31695 |
|
| 31696 |
/***/ }), |
| 31697 |
/* 562 */ |
| 31698 |
/***/ (function(module, exports, __webpack_require__) { |
| 31699 |
|
| 31700 |
"use strict"; |
| 31701 |
|
| 31702 |
// B.2.3.10 String.prototype.link(url) |
| 31703 |
__webpack_require__(563)('link', function (createHTML) { |
| 31704 |
return function link(url) { |
| 31705 |
return createHTML(this, 'a', 'href', url); |
| 31706 |
}; |
| 31707 |
}); |
| 31708 |
|
| 31709 |
|
| 31710 |
/***/ }), |
| 31711 |
/* 563 */ |
| 31712 |
/***/ (function(module, exports, __webpack_require__) { |
| 31713 |
|
| 31714 |
var $export = __webpack_require__(34); |
| 31715 |
var fails = __webpack_require__(33); |
| 31716 |
var defined = __webpack_require__(42); |
| 31717 |
var quot = /"/g; |
| 31718 |
// B.2.3.2.1 CreateHTML(string, tag, attribute, value) |
| 31719 |
var createHTML = function (string, tag, attribute, value) { |
| 31720 |
var S = String(defined(string)); |
| 31721 |
var p1 = '<' + tag; |
| 31722 |
if (attribute !== '') p1 += ' ' + attribute + '="' + String(value).replace(quot, '"') + '"'; |
| 31723 |
return p1 + '>' + S + '</' + tag + '>'; |
| 31724 |
}; |
| 31725 |
module.exports = function (NAME, exec) { |
| 31726 |
var O = {}; |
| 31727 |
O[NAME] = exec(createHTML); |
| 31728 |
$export($export.P + $export.F * fails(function () { |
| 31729 |
var test = ''[NAME]('"'); |
| 31730 |
return test !== test.toLowerCase() || test.split('"').length > 3; |
| 31731 |
}), 'String', O); |
| 31732 |
}; |
| 31733 |
|
| 31734 |
|
| 31735 |
/***/ }), |
| 31736 |
/* 564 */ |
| 31737 |
/***/ (function(module, exports, __webpack_require__) { |
| 31738 |
|
| 31739 |
"use strict"; |
| 31740 |
|
| 31741 |
|
| 31742 |
__webpack_require__(183); |
| 31743 |
|
| 31744 |
__webpack_require__(72); |
| 31745 |
|
| 31746 |
__webpack_require__(25); |
| 31747 |
|
| 31748 |
var ControlSelect2View = __webpack_require__(274); |
| 31749 |
|
| 31750 |
module.exports = ControlSelect2View.extend({ |
| 31751 |
$previewContainer: null, |
| 31752 |
getSelect2Options: function getSelect2Options() { |
| 31753 |
return { |
| 31754 |
dir: elementorCommon.config.isRTL ? 'rtl' : 'ltr', |
| 31755 |
templateSelection: this.fontPreviewTemplate, |
| 31756 |
templateResult: this.fontPreviewTemplate |
| 31757 |
}; |
| 31758 |
}, |
| 31759 |
onReady: function onReady() { |
| 31760 |
var self = this; |
| 31761 |
this.ui.select.select2(this.getSelect2Options()); |
| 31762 |
this.ui.select.on('select2:open', function () { |
| 31763 |
self.$previewContainer = jQuery('.select2-results__options[role="tree"]:visible'); // load initial? |
| 31764 |
|
| 31765 |
setTimeout(function () { |
| 31766 |
self.enqueueFontsInView(); |
| 31767 |
}, 100); // On search |
| 31768 |
|
| 31769 |
jQuery('input.select2-search__field:visible').on('keyup', function () { |
| 31770 |
self.typeStopDetection.action.apply(self); |
| 31771 |
}); // On scroll |
| 31772 |
|
| 31773 |
self.$previewContainer.on('scroll', function () { |
| 31774 |
self.scrollStopDetection.onScroll.apply(self); |
| 31775 |
}); |
| 31776 |
}); |
| 31777 |
}, |
| 31778 |
typeStopDetection: { |
| 31779 |
idle: 350, |
| 31780 |
timeOut: null, |
| 31781 |
action: function action() { |
| 31782 |
var parent = this, |
| 31783 |
self = this.typeStopDetection; |
| 31784 |
clearTimeout(self.timeOut); |
| 31785 |
self.timeOut = setTimeout(function () { |
| 31786 |
parent.enqueueFontsInView(); |
| 31787 |
}, self.idle); |
| 31788 |
} |
| 31789 |
}, |
| 31790 |
scrollStopDetection: { |
| 31791 |
idle: 350, |
| 31792 |
timeOut: null, |
| 31793 |
onScroll: function onScroll() { |
| 31794 |
var parent = this, |
| 31795 |
self = this.scrollStopDetection; |
| 31796 |
clearTimeout(self.timeOut); |
| 31797 |
self.timeOut = setTimeout(function () { |
| 31798 |
parent.enqueueFontsInView(); |
| 31799 |
}, self.idle); |
| 31800 |
} |
| 31801 |
}, |
| 31802 |
enqueueFontsInView: function enqueueFontsInView() { |
| 31803 |
var self = this, |
| 31804 |
containerOffset = this.$previewContainer.offset(), |
| 31805 |
top = containerOffset.top, |
| 31806 |
bottom = top + this.$previewContainer.innerHeight(), |
| 31807 |
fontsInView = []; |
| 31808 |
this.$previewContainer.children().find('li:visible').each(function (index, font) { |
| 31809 |
var $font = jQuery(font), |
| 31810 |
offset = $font.offset(); |
| 31811 |
|
| 31812 |
if (offset && offset.top > top && offset.top < bottom) { |
| 31813 |
fontsInView.push($font); |
| 31814 |
} |
| 31815 |
}); |
| 31816 |
fontsInView.forEach(function (font) { |
| 31817 |
var fontFamily = jQuery(font).find('span').html(); |
| 31818 |
elementor.helpers.enqueueFont(fontFamily, 'editor'); |
| 31819 |
}); |
| 31820 |
}, |
| 31821 |
fontPreviewTemplate: function fontPreviewTemplate(state) { |
| 31822 |
if (!state.id) { |
| 31823 |
return state.text; |
| 31824 |
} |
| 31825 |
|
| 31826 |
return jQuery('<span>', { |
| 31827 |
text: state.text, |
| 31828 |
css: { |
| 31829 |
'font-family': state.element.value.toString() |
| 31830 |
} |
| 31831 |
}); |
| 31832 |
}, |
| 31833 |
templateHelpers: function templateHelpers() { |
| 31834 |
var helpers = ControlSelect2View.prototype.templateHelpers.apply(this, arguments), |
| 31835 |
fonts = this.model.get('options'); |
| 31836 |
|
| 31837 |
helpers.getFontsByGroups = function (groups) { |
| 31838 |
var filteredFonts = {}; |
| 31839 |
|
| 31840 |
_.each(fonts, function (fontType, fontName) { |
| 31841 |
if (_.isArray(groups) && _.contains(groups, fontType) || fontType === groups) { |
| 31842 |
filteredFonts[fontName] = fontName; |
| 31843 |
} |
| 31844 |
}); |
| 31845 |
|
| 31846 |
return filteredFonts; |
| 31847 |
}; |
| 31848 |
|
| 31849 |
return helpers; |
| 31850 |
} |
| 31851 |
}); |
| 31852 |
|
| 31853 |
/***/ }), |
| 31854 |
/* 565 */ |
| 31855 |
/***/ (function(module, exports, __webpack_require__) { |
| 31856 |
|
| 31857 |
"use strict"; |
| 31858 |
|
| 31859 |
|
| 31860 |
var ControlBaseDataView = __webpack_require__(127), |
| 31861 |
ControlMediaItemView; |
| 31862 |
|
| 31863 |
ControlMediaItemView = ControlBaseDataView.extend({ |
| 31864 |
ui: function ui() { |
| 31865 |
var ui = ControlBaseDataView.prototype.ui.apply(this, arguments); |
| 31866 |
ui.addImages = '.elementor-control-gallery-add'; |
| 31867 |
ui.clearGallery = '.elementor-control-gallery-clear'; |
| 31868 |
ui.galleryThumbnails = '.elementor-control-gallery-thumbnails'; |
| 31869 |
ui.status = '.elementor-control-gallery-status-title'; |
| 31870 |
return ui; |
| 31871 |
}, |
| 31872 |
events: function events() { |
| 31873 |
return _.extend(ControlBaseDataView.prototype.events.apply(this, arguments), { |
| 31874 |
'click @ui.addImages': 'onAddImagesClick', |
| 31875 |
'click @ui.clearGallery': 'onClearGalleryClick', |
| 31876 |
'click @ui.galleryThumbnails': 'onGalleryThumbnailsClick' |
| 31877 |
}); |
| 31878 |
}, |
| 31879 |
onReady: function onReady() { |
| 31880 |
this.initRemoveDialog(); |
| 31881 |
}, |
| 31882 |
applySavedValue: function applySavedValue() { |
| 31883 |
var images = this.getControlValue(), |
| 31884 |
imagesCount = images.length, |
| 31885 |
hasImages = !!imagesCount; |
| 31886 |
this.$el.toggleClass('elementor-gallery-has-images', hasImages).toggleClass('elementor-gallery-empty', !hasImages); |
| 31887 |
var $galleryThumbnails = this.ui.galleryThumbnails; |
| 31888 |
$galleryThumbnails.empty(); |
| 31889 |
this.ui.status.text(elementor.translate(hasImages ? 'gallery_images_selected' : 'gallery_no_images_selected', [imagesCount])); |
| 31890 |
|
| 31891 |
if (!hasImages) { |
| 31892 |
return; |
| 31893 |
} |
| 31894 |
|
| 31895 |
this.getControlValue().forEach(function (image) { |
| 31896 |
var $thumbnail = jQuery('<div>', { |
| 31897 |
class: 'elementor-control-gallery-thumbnail' |
| 31898 |
}); |
| 31899 |
$thumbnail.css('background-image', 'url(' + image.url + ')'); |
| 31900 |
$galleryThumbnails.append($thumbnail); |
| 31901 |
}); |
| 31902 |
}, |
| 31903 |
hasImages: function hasImages() { |
| 31904 |
return !!this.getControlValue().length; |
| 31905 |
}, |
| 31906 |
openFrame: function openFrame(action) { |
| 31907 |
this.initFrame(action); |
| 31908 |
this.frame.open(); |
| 31909 |
}, |
| 31910 |
initFrame: function initFrame(action) { |
| 31911 |
var frameStates = { |
| 31912 |
create: 'gallery', |
| 31913 |
add: 'gallery-library', |
| 31914 |
edit: 'gallery-edit' |
| 31915 |
}; |
| 31916 |
var options = { |
| 31917 |
frame: 'post', |
| 31918 |
multiple: true, |
| 31919 |
state: frameStates[action], |
| 31920 |
button: { |
| 31921 |
text: elementor.translate('insert_media') |
| 31922 |
} |
| 31923 |
}; |
| 31924 |
|
| 31925 |
if (this.hasImages()) { |
| 31926 |
options.selection = this.fetchSelection(); |
| 31927 |
} |
| 31928 |
|
| 31929 |
this.frame = wp.media(options); // When a file is selected, run a callback. |
| 31930 |
|
| 31931 |
this.frame.on({ |
| 31932 |
update: this.select, |
| 31933 |
'menu:render:default': this.menuRender, |
| 31934 |
'content:render:browse': this.gallerySettings |
| 31935 |
}, this); |
| 31936 |
}, |
| 31937 |
menuRender: function menuRender(view) { |
| 31938 |
view.unset('insert'); |
| 31939 |
view.unset('featured-image'); |
| 31940 |
}, |
| 31941 |
gallerySettings: function gallerySettings(browser) { |
| 31942 |
browser.sidebar.on('ready', function () { |
| 31943 |
browser.sidebar.unset('gallery'); |
| 31944 |
}); |
| 31945 |
}, |
| 31946 |
fetchSelection: function fetchSelection() { |
| 31947 |
var attachments = wp.media.query({ |
| 31948 |
orderby: 'post__in', |
| 31949 |
order: 'ASC', |
| 31950 |
type: 'image', |
| 31951 |
perPage: -1, |
| 31952 |
post__in: _.pluck(this.getControlValue(), 'id') |
| 31953 |
}); |
| 31954 |
return new wp.media.model.Selection(attachments.models, { |
| 31955 |
props: attachments.props.toJSON(), |
| 31956 |
multiple: true |
| 31957 |
}); |
| 31958 |
}, |
| 31959 |
|
| 31960 |
/** |
| 31961 |
* Callback handler for when an attachment is selected in the media modal. |
| 31962 |
* Gets the selected image information, and sets it within the control. |
| 31963 |
*/ |
| 31964 |
select: function select(selection) { |
| 31965 |
var images = []; |
| 31966 |
selection.each(function (image) { |
| 31967 |
images.push({ |
| 31968 |
id: image.get('id'), |
| 31969 |
url: image.get('url') |
| 31970 |
}); |
| 31971 |
}); |
| 31972 |
this.setValue(images); |
| 31973 |
this.applySavedValue(); |
| 31974 |
}, |
| 31975 |
onBeforeDestroy: function onBeforeDestroy() { |
| 31976 |
if (this.frame) { |
| 31977 |
this.frame.off(); |
| 31978 |
} |
| 31979 |
|
| 31980 |
this.$el.remove(); |
| 31981 |
}, |
| 31982 |
resetGallery: function resetGallery() { |
| 31983 |
this.setValue([]); |
| 31984 |
this.applySavedValue(); |
| 31985 |
}, |
| 31986 |
initRemoveDialog: function initRemoveDialog() { |
| 31987 |
var removeDialog; |
| 31988 |
|
| 31989 |
this.getRemoveDialog = function () { |
| 31990 |
if (!removeDialog) { |
| 31991 |
removeDialog = elementorCommon.dialogsManager.createWidget('confirm', { |
| 31992 |
message: elementor.translate('dialog_confirm_gallery_delete'), |
| 31993 |
headerMessage: elementor.translate('delete_gallery'), |
| 31994 |
strings: { |
| 31995 |
confirm: elementor.translate('delete'), |
| 31996 |
cancel: elementor.translate('cancel') |
| 31997 |
}, |
| 31998 |
defaultOption: 'confirm', |
| 31999 |
onConfirm: this.resetGallery.bind(this) |
| 32000 |
}); |
| 32001 |
} |
| 32002 |
|
| 32003 |
return removeDialog; |
| 32004 |
}; |
| 32005 |
}, |
| 32006 |
onAddImagesClick: function onAddImagesClick() { |
| 32007 |
this.openFrame(this.hasImages() ? 'add' : 'create'); |
| 32008 |
}, |
| 32009 |
onClearGalleryClick: function onClearGalleryClick() { |
| 32010 |
this.getRemoveDialog().show(); |
| 32011 |
}, |
| 32012 |
onGalleryThumbnailsClick: function onGalleryThumbnailsClick() { |
| 32013 |
this.openFrame('edit'); |
| 32014 |
} |
| 32015 |
}); |
| 32016 |
module.exports = ControlMediaItemView; |
| 32017 |
|
| 32018 |
/***/ }), |
| 32019 |
/* 566 */ |
| 32020 |
/***/ (function(module, exports, __webpack_require__) { |
| 32021 |
|
| 32022 |
"use strict"; |
| 32023 |
|
| 32024 |
|
| 32025 |
var _interopRequireDefault = __webpack_require__(0); |
| 32026 |
|
| 32027 |
var _baseData = _interopRequireDefault(__webpack_require__(127)); |
| 32028 |
|
| 32029 |
module.exports = _baseData.default.extend({}, { |
| 32030 |
onPasteStyle: function onPasteStyle() { |
| 32031 |
return false; |
| 32032 |
} |
| 32033 |
}); |
| 32034 |
|
| 32035 |
/***/ }), |
| 32036 |
/* 567 */ |
| 32037 |
/***/ (function(module, exports, __webpack_require__) { |
| 32038 |
|
| 32039 |
"use strict"; |
| 32040 |
|
| 32041 |
|
| 32042 |
var ControlSelect2View = __webpack_require__(274), |
| 32043 |
ControlIconView; |
| 32044 |
|
| 32045 |
ControlIconView = ControlSelect2View.extend({ |
| 32046 |
initialize: function initialize() { |
| 32047 |
ControlSelect2View.prototype.initialize.apply(this, arguments); |
| 32048 |
this.filterIcons(); |
| 32049 |
}, |
| 32050 |
filterIcons: function filterIcons() { |
| 32051 |
var icons = this.model.get('options'), |
| 32052 |
include = this.model.get('include'), |
| 32053 |
exclude = this.model.get('exclude'); |
| 32054 |
|
| 32055 |
if (include) { |
| 32056 |
var filteredIcons = {}; |
| 32057 |
|
| 32058 |
_.each(include, function (iconKey) { |
| 32059 |
filteredIcons[iconKey] = icons[iconKey]; |
| 32060 |
}); |
| 32061 |
|
| 32062 |
this.model.set('options', filteredIcons); |
| 32063 |
return; |
| 32064 |
} |
| 32065 |
|
| 32066 |
if (exclude) { |
| 32067 |
_.each(exclude, function (iconKey) { |
| 32068 |
delete icons[iconKey]; |
| 32069 |
}); |
| 32070 |
} |
| 32071 |
}, |
| 32072 |
iconsList: function iconsList(icon) { |
| 32073 |
if (!icon.id) { |
| 32074 |
return icon.text; |
| 32075 |
} |
| 32076 |
|
| 32077 |
return jQuery('<span><i class="' + icon.id + '"></i> ' + icon.text + '</span>'); |
| 32078 |
}, |
| 32079 |
getSelect2Options: function getSelect2Options() { |
| 32080 |
return { |
| 32081 |
allowClear: true, |
| 32082 |
templateResult: this.iconsList.bind(this), |
| 32083 |
templateSelection: this.iconsList.bind(this) |
| 32084 |
}; |
| 32085 |
} |
| 32086 |
}); |
| 32087 |
module.exports = ControlIconView; |
| 32088 |
|
| 32089 |
/***/ }), |
| 32090 |
/* 568 */ |
| 32091 |
/***/ (function(module, exports, __webpack_require__) { |
| 32092 |
|
| 32093 |
"use strict"; |
| 32094 |
|
| 32095 |
|
| 32096 |
var _interopRequireDefault = __webpack_require__(0); |
| 32097 |
|
| 32098 |
var _classCallCheck2 = _interopRequireDefault(__webpack_require__(2)); |
| 32099 |
|
| 32100 |
var _createClass2 = _interopRequireDefault(__webpack_require__(3)); |
| 32101 |
|
| 32102 |
var _get2 = _interopRequireDefault(__webpack_require__(26)); |
| 32103 |
|
| 32104 |
var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(16)); |
| 32105 |
|
| 32106 |
var _inherits2 = _interopRequireDefault(__webpack_require__(4)); |
| 32107 |
|
| 32108 |
var _createSuper2 = _interopRequireDefault(__webpack_require__(5)); |
| 32109 |
|
| 32110 |
var _filesUploadHandler = _interopRequireDefault(__webpack_require__(382)); |
| 32111 |
|
| 32112 |
var ControlMultipleBaseItemView = __webpack_require__(237); |
| 32113 |
|
| 32114 |
var ControlIconsView = /*#__PURE__*/function (_ControlMultipleBaseI) { |
| 32115 |
(0, _inherits2.default)(ControlIconsView, _ControlMultipleBaseI); |
| 32116 |
|
| 32117 |
var _super = (0, _createSuper2.default)(ControlIconsView); |
| 32118 |
|
| 32119 |
function ControlIconsView() { |
| 32120 |
var _this; |
| 32121 |
|
| 32122 |
(0, _classCallCheck2.default)(this, ControlIconsView); |
| 32123 |
|
| 32124 |
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { |
| 32125 |
args[_key] = arguments[_key]; |
| 32126 |
} |
| 32127 |
|
| 32128 |
_this = _super.call.apply(_super, [this].concat(args)); |
| 32129 |
_this.cache = { |
| 32130 |
loaded: false, |
| 32131 |
dialog: false, |
| 32132 |
enableClicked: false, |
| 32133 |
fa4Mapping: false, |
| 32134 |
migratedFlag: {} |
| 32135 |
}; |
| 32136 |
_this.dataKeys = { |
| 32137 |
migratedKey: '__fa4_migrated', |
| 32138 |
fa4MigrationFlag: 'fa4compatibility' |
| 32139 |
}; |
| 32140 |
return _this; |
| 32141 |
} |
| 32142 |
|
| 32143 |
(0, _createClass2.default)(ControlIconsView, [{ |
| 32144 |
key: "enqueueIconFonts", |
| 32145 |
value: function enqueueIconFonts(iconType) { |
| 32146 |
var iconSetting = elementor.helpers.getIconLibrarySettings(iconType); |
| 32147 |
|
| 32148 |
if (false === iconSetting || !this.isMigrationAllowed()) { |
| 32149 |
return; |
| 32150 |
} |
| 32151 |
|
| 32152 |
if (iconSetting.enqueue) { |
| 32153 |
iconSetting.enqueue.forEach(function (assetURL) { |
| 32154 |
elementor.helpers.enqueueEditorStylesheet(assetURL); |
| 32155 |
elementor.helpers.enqueuePreviewStylesheet(assetURL); |
| 32156 |
}); |
| 32157 |
} |
| 32158 |
|
| 32159 |
if (iconSetting.url) { |
| 32160 |
elementor.helpers.enqueueEditorStylesheet(iconSetting.url); |
| 32161 |
elementor.helpers.enqueuePreviewStylesheet(iconSetting.url); |
| 32162 |
} |
| 32163 |
} |
| 32164 |
}, { |
| 32165 |
key: "ui", |
| 32166 |
value: function ui() { |
| 32167 |
var ui = (0, _get2.default)((0, _getPrototypeOf2.default)(ControlIconsView.prototype), "ui", this).call(this), |
| 32168 |
skin = this.model.get('skin'); |
| 32169 |
ui.controlMedia = '.elementor-control-media'; |
| 32170 |
ui.svgUploader = 'media' === skin ? '.elementor-control-svg-uploader' : '.elementor-control-icons--inline__svg'; |
| 32171 |
ui.iconPickers = 'media' === skin ? '.elementor-control-icon-picker, .elementor-control-media__preview, .elementor-control-media-upload-button' : '.elementor-control-icons--inline__icon'; |
| 32172 |
ui.deleteButton = 'media' === skin ? '.elementor-control-media__remove' : '.elementor-control-icons--inline__none'; |
| 32173 |
ui.previewPlaceholder = '.elementor-control-media__preview'; |
| 32174 |
ui.previewContainer = '.elementor-control-preview-area'; |
| 32175 |
ui.inlineIconContainer = '.elementor-control-inline-icon'; |
| 32176 |
ui.inlineDisplayedIcon = '.elementor-control-icons--inline__displayed-icon'; |
| 32177 |
ui.radioInputs = '[type="radio"]'; |
| 32178 |
return ui; |
| 32179 |
} |
| 32180 |
}, { |
| 32181 |
key: "events", |
| 32182 |
value: function events() { |
| 32183 |
return jQuery.extend(ControlMultipleBaseItemView.prototype.events.apply(this, arguments), { |
| 32184 |
'click @ui.iconPickers': 'openPicker', |
| 32185 |
'click @ui.svgUploader': 'openFrame', |
| 32186 |
'click @ui.radioInputs': 'onClickInput', |
| 32187 |
'click @ui.deleteButton': 'deleteIcon' |
| 32188 |
}); |
| 32189 |
} |
| 32190 |
}, { |
| 32191 |
key: "getControlValue", |
| 32192 |
value: function getControlValue() { |
| 32193 |
var value = (0, _get2.default)((0, _getPrototypeOf2.default)(ControlIconsView.prototype), "getControlValue", this).call(this), |
| 32194 |
model = this.model, |
| 32195 |
valueToMigrate = this.getValueToMigrate(); |
| 32196 |
|
| 32197 |
if (!this.isMigrationAllowed()) { |
| 32198 |
return valueToMigrate; |
| 32199 |
} // Bail if no migration flag or no value to migrate |
| 32200 |
|
| 32201 |
|
| 32202 |
if (!valueToMigrate) { |
| 32203 |
return value; |
| 32204 |
} |
| 32205 |
|
| 32206 |
var didMigration = this.elementSettingsModel.get(this.dataKeys.migratedKey), |
| 32207 |
controlName = model.get('name'); // Check if migration had been done and is stored locally |
| 32208 |
|
| 32209 |
if (this.cache.migratedFlag[controlName]) { |
| 32210 |
return this.cache.migratedFlag[controlName]; |
| 32211 |
} // Check if already migrated |
| 32212 |
|
| 32213 |
|
| 32214 |
if (didMigration && didMigration[controlName]) { |
| 32215 |
return value; |
| 32216 |
} // Do migration |
| 32217 |
|
| 32218 |
|
| 32219 |
return this.migrateFa4toFa5(valueToMigrate); |
| 32220 |
} |
| 32221 |
}, { |
| 32222 |
key: "migrateFa4toFa5", |
| 32223 |
value: function migrateFa4toFa5(fa4Value) { |
| 32224 |
var fa5Value = elementor.helpers.mapFa4ToFa5(fa4Value); |
| 32225 |
this.cache.migratedFlag[this.model.get('name')] = fa5Value; |
| 32226 |
this.enqueueIconFonts(fa5Value.library); |
| 32227 |
return fa5Value; |
| 32228 |
} |
| 32229 |
}, { |
| 32230 |
key: "setControlAsMigrated", |
| 32231 |
value: function setControlAsMigrated(controlName) { |
| 32232 |
var didMigration = this.elementSettingsModel.get(this.dataKeys.migratedKey) || {}; |
| 32233 |
didMigration[controlName] = true; |
| 32234 |
this.elementSettingsModel.set(this.dataKeys.migratedKey, didMigration, { |
| 32235 |
silent: true |
| 32236 |
}); |
| 32237 |
} |
| 32238 |
}, { |
| 32239 |
key: "isMigrationAllowed", |
| 32240 |
value: function isMigrationAllowed() { |
| 32241 |
return !elementor.config['icons_update_needed']; |
| 32242 |
} |
| 32243 |
}, { |
| 32244 |
key: "getValueToMigrate", |
| 32245 |
value: function getValueToMigrate() { |
| 32246 |
var controlToMigrate = this.model.get(this.dataKeys.fa4MigrationFlag); |
| 32247 |
|
| 32248 |
if (!controlToMigrate) { |
| 32249 |
return false; |
| 32250 |
} // Check if there is a value to migrate |
| 32251 |
|
| 32252 |
|
| 32253 |
var valueToMigrate = this.container.settings.get(controlToMigrate); |
| 32254 |
|
| 32255 |
if (valueToMigrate) { |
| 32256 |
return valueToMigrate; |
| 32257 |
} |
| 32258 |
|
| 32259 |
return false; |
| 32260 |
} |
| 32261 |
}, { |
| 32262 |
key: "onReady", |
| 32263 |
value: function onReady() { |
| 32264 |
var _this2 = this; |
| 32265 |
|
| 32266 |
// is migration allowed from fa4 |
| 32267 |
if (!this.isMigrationAllowed()) { |
| 32268 |
var migrationPopupTrigger = 'media' === this.model.get('skin') ? this.ui.previewContainer[0] : this.ui.inlineIconContainer[0]; |
| 32269 |
migrationPopupTrigger.addEventListener('click', function (event) { |
| 32270 |
// Prevent default to prevent marking the inline icons as selected on click when migration is not allowed |
| 32271 |
event.preventDefault(); |
| 32272 |
event.stopPropagation(); |
| 32273 |
|
| 32274 |
var onConfirm = function onConfirm() { |
| 32275 |
window.location.href = elementor.config.tools_page_link + '&redirect_to=' + encodeURIComponent(document.location.href) + '#tab-fontawesome4_migration'; |
| 32276 |
}; |
| 32277 |
|
| 32278 |
var enableMigrationDialog = elementor.helpers.getSimpleDialog('elementor-enable-fa5-dialog', elementor.translate('enable_fa5'), elementor.translate('dialog_confirm_enable_fa5'), elementor.translate('update'), onConfirm); |
| 32279 |
enableMigrationDialog.show(); |
| 32280 |
return false; |
| 32281 |
}, true); |
| 32282 |
} |
| 32283 |
|
| 32284 |
var controlName = this.model.get('name'); |
| 32285 |
|
| 32286 |
if (this.cache.migratedFlag[controlName]) { |
| 32287 |
this.setControlAsMigrated(controlName); |
| 32288 |
setTimeout(function () { |
| 32289 |
_this2.setValue(_this2.cache.migratedFlag[controlName]); |
| 32290 |
}, 10); |
| 32291 |
} |
| 32292 |
} |
| 32293 |
}, { |
| 32294 |
key: "onRender", |
| 32295 |
value: function onRender() { |
| 32296 |
(0, _get2.default)((0, _getPrototypeOf2.default)(ControlIconsView.prototype), "onRender", this).call(this); |
| 32297 |
|
| 32298 |
if (this.isMigrationAllowed()) { |
| 32299 |
elementor.iconManager.loadIconLibraries(); |
| 32300 |
} |
| 32301 |
} |
| 32302 |
}, { |
| 32303 |
key: "initFrame", |
| 32304 |
value: function initFrame() { |
| 32305 |
var _this3 = this; |
| 32306 |
|
| 32307 |
// Set current doc id to attach uploaded images. |
| 32308 |
wp.media.view.settings.post.id = elementor.config.document.id; |
| 32309 |
this.frame = wp.media({ |
| 32310 |
button: { |
| 32311 |
text: elementor.translate('insert_media') |
| 32312 |
}, |
| 32313 |
library: { |
| 32314 |
type: ['image/svg+xml'] |
| 32315 |
}, |
| 32316 |
states: [new wp.media.controller.Library({ |
| 32317 |
title: elementor.translate('insert_media'), |
| 32318 |
library: wp.media.query({ |
| 32319 |
type: ['image/svg+xml'] |
| 32320 |
}), |
| 32321 |
multiple: false, |
| 32322 |
date: false |
| 32323 |
})] |
| 32324 |
}); |
| 32325 |
|
| 32326 |
var handleSelect = function handleSelect() { |
| 32327 |
return _this3.selectSvg(); |
| 32328 |
}; // When a file is selected, run a callback. |
| 32329 |
|
| 32330 |
|
| 32331 |
this.frame.on('insert select', handleSelect); |
| 32332 |
this.setUploadMimeType(this.frame, 'svg'); |
| 32333 |
} |
| 32334 |
}, { |
| 32335 |
key: "setUploadMimeType", |
| 32336 |
value: function setUploadMimeType(frame, ext) { |
| 32337 |
// Set svg as only allowed upload extensions |
| 32338 |
var oldExtensions = _wpPluploadSettings.defaults.filters.mime_types[0].extensions; |
| 32339 |
frame.on('ready', function () { |
| 32340 |
_wpPluploadSettings.defaults.filters.mime_types[0].extensions = ext; |
| 32341 |
}); |
| 32342 |
this.frame.on('close', function () { |
| 32343 |
// restore allowed upload extensions |
| 32344 |
_wpPluploadSettings.defaults.filters.mime_types[0].extensions = oldExtensions; |
| 32345 |
}); |
| 32346 |
} |
| 32347 |
/** |
| 32348 |
* Callback handler for when an attachment is selected in the media modal. |
| 32349 |
* Gets the selected image information, and sets it within the control. |
| 32350 |
*/ |
| 32351 |
|
| 32352 |
}, { |
| 32353 |
key: "selectSvg", |
| 32354 |
value: function selectSvg() { |
| 32355 |
this.trigger('before:select'); // Get the attachment from the modal frame. |
| 32356 |
|
| 32357 |
var attachment = this.frame.state().get('selection').first().toJSON(); |
| 32358 |
|
| 32359 |
if (attachment.url) { |
| 32360 |
this.setValue({ |
| 32361 |
value: { |
| 32362 |
url: attachment.url, |
| 32363 |
id: attachment.id |
| 32364 |
}, |
| 32365 |
library: 'svg' |
| 32366 |
}); |
| 32367 |
this.applySavedValue(); |
| 32368 |
} |
| 32369 |
|
| 32370 |
this.trigger('after:select'); |
| 32371 |
} |
| 32372 |
}, { |
| 32373 |
key: "openFrame", |
| 32374 |
value: function openFrame() { |
| 32375 |
var _this4 = this; |
| 32376 |
|
| 32377 |
if (!_filesUploadHandler.default.isUploadEnabled('svg')) { |
| 32378 |
_filesUploadHandler.default.getUnfilteredFilesNotEnabledDialog(function () { |
| 32379 |
return _this4.openFrame(); |
| 32380 |
}).show(); |
| 32381 |
|
| 32382 |
return false; |
| 32383 |
} |
| 32384 |
|
| 32385 |
if (!this.frame) { |
| 32386 |
this.initFrame(); |
| 32387 |
} |
| 32388 |
|
| 32389 |
this.frame.open(); // Set params to trigger sanitizer |
| 32390 |
|
| 32391 |
_filesUploadHandler.default.setUploadTypeCaller(this.frame); |
| 32392 |
|
| 32393 |
var selectedId = this.getControlValue('id'); |
| 32394 |
|
| 32395 |
if (!selectedId) { |
| 32396 |
return; |
| 32397 |
} |
| 32398 |
|
| 32399 |
var selection = this.frame.state().get('selection'); |
| 32400 |
selection.add(wp.media.attachment(selectedId)); |
| 32401 |
} |
| 32402 |
}, { |
| 32403 |
key: "openPicker", |
| 32404 |
value: function openPicker() { |
| 32405 |
elementor.iconManager.show({ |
| 32406 |
view: this |
| 32407 |
}); |
| 32408 |
} |
| 32409 |
}, { |
| 32410 |
key: "applySavedValue", |
| 32411 |
value: function applySavedValue() { |
| 32412 |
var _this5 = this; |
| 32413 |
|
| 32414 |
var controlValue = this.getControlValue(), |
| 32415 |
skin = this.model.get('skin'), |
| 32416 |
iconContainer = 'inline' === skin ? this.ui.inlineDisplayedIcon : this.ui.previewPlaceholder, |
| 32417 |
defaultIcon = this.model.get('default'); |
| 32418 |
var iconValue = controlValue.value, |
| 32419 |
iconType = controlValue.library; |
| 32420 |
|
| 32421 |
if (!this.isMigrationAllowed() && !iconValue && this.getValueToMigrate()) { |
| 32422 |
iconValue = this.getControlValue(); |
| 32423 |
iconType = ''; |
| 32424 |
} |
| 32425 |
|
| 32426 |
if ('media' === skin) { |
| 32427 |
this.ui.controlMedia.toggleClass('elementor-media-empty', !iconValue); |
| 32428 |
} else { |
| 32429 |
this.markChecked(iconType); |
| 32430 |
} |
| 32431 |
|
| 32432 |
if (!iconValue) { |
| 32433 |
if ('inline' === skin) { |
| 32434 |
this.setDefaultIconLibraryLabel(defaultIcon, iconContainer); |
| 32435 |
return; |
| 32436 |
} |
| 32437 |
|
| 32438 |
this.ui.previewPlaceholder.html(''); |
| 32439 |
return; |
| 32440 |
} |
| 32441 |
|
| 32442 |
if ('svg' === iconType && 'inline' !== skin) { |
| 32443 |
return elementor.helpers.fetchInlineSvg(iconValue.url, function (data) { |
| 32444 |
_this5.ui.previewPlaceholder.html(data); |
| 32445 |
}); |
| 32446 |
} |
| 32447 |
|
| 32448 |
if ('media' === skin || 'svg' !== iconType) { |
| 32449 |
var previewHTML = '<i class="' + iconValue + '"></i>'; |
| 32450 |
iconContainer.html(previewHTML); |
| 32451 |
} |
| 32452 |
|
| 32453 |
this.enqueueIconFonts(iconType); |
| 32454 |
} |
| 32455 |
}, { |
| 32456 |
key: "setDefaultIconLibraryLabel", |
| 32457 |
value: function setDefaultIconLibraryLabel(defaultIcon, iconContainer) { |
| 32458 |
// Check if the control has a default icon |
| 32459 |
if ('' !== defaultIcon.value && 'svg' !== defaultIcon.library) { |
| 32460 |
// If the default icon is not an SVG, set the icon-library label's icon to the default icon |
| 32461 |
iconContainer.html('<i class="' + defaultIcon.value + '"></i>'); |
| 32462 |
} else { |
| 32463 |
// If (1) the control does NOT have a default icon, |
| 32464 |
// OR (2) the control DOES have a default icon BUT the default icon is an SVG, |
| 32465 |
// set the default icon-library label's icon to a simple circle |
| 32466 |
iconContainer.html('<i class="eicon-circle"></i>'); |
| 32467 |
} |
| 32468 |
} |
| 32469 |
}, { |
| 32470 |
key: "markChecked", |
| 32471 |
value: function markChecked(iconType) { |
| 32472 |
this.ui.radioInputs.filter(':checked').prop('checked', false); |
| 32473 |
|
| 32474 |
if (!iconType) { |
| 32475 |
return this.ui.radioInputs.filter('[value="none"]').prop('checked', true); |
| 32476 |
} |
| 32477 |
|
| 32478 |
if ('svg' !== iconType) { |
| 32479 |
iconType = 'icon'; |
| 32480 |
} |
| 32481 |
|
| 32482 |
this.ui.radioInputs.filter('[value="' + iconType + '"]').prop('checked', true); |
| 32483 |
} |
| 32484 |
}, { |
| 32485 |
key: "onClickInput", |
| 32486 |
value: function onClickInput() { |
| 32487 |
this.markChecked(this.getControlValue().library); |
| 32488 |
} |
| 32489 |
}, { |
| 32490 |
key: "deleteIcon", |
| 32491 |
value: function deleteIcon(event) { |
| 32492 |
event.stopPropagation(); |
| 32493 |
this.setValue({ |
| 32494 |
value: '', |
| 32495 |
library: '' |
| 32496 |
}); |
| 32497 |
this.applySavedValue(); |
| 32498 |
} |
| 32499 |
}, { |
| 32500 |
key: "onBeforeDestroy", |
| 32501 |
value: function onBeforeDestroy() { |
| 32502 |
this.$el.remove(); |
| 32503 |
} |
| 32504 |
}]); |
| 32505 |
return ControlIconsView; |
| 32506 |
}(ControlMultipleBaseItemView); |
| 32507 |
|
| 32508 |
module.exports = ControlIconsView; |
| 32509 |
|
| 32510 |
/***/ }), |
| 32511 |
/* 569 */ |
| 32512 |
/***/ (function(module, exports, __webpack_require__) { |
| 32513 |
|
| 32514 |
"use strict"; |
| 32515 |
|
| 32516 |
|
| 32517 |
var ControlMultipleBaseItemView = __webpack_require__(237), |
| 32518 |
ControlImageDimensionsItemView; |
| 32519 |
|
| 32520 |
ControlImageDimensionsItemView = ControlMultipleBaseItemView.extend({ |
| 32521 |
ui: function ui() { |
| 32522 |
return { |
| 32523 |
inputWidth: 'input[data-setting="width"]', |
| 32524 |
inputHeight: 'input[data-setting="height"]', |
| 32525 |
btnApply: 'button.elementor-image-dimensions-apply-button' |
| 32526 |
}; |
| 32527 |
}, |
| 32528 |
// Override the base events |
| 32529 |
events: function events() { |
| 32530 |
return { |
| 32531 |
'click @ui.btnApply': 'onApplyClicked', |
| 32532 |
'keyup @ui.inputWidth': 'onDimensionKeyUp', |
| 32533 |
'keyup @ui.inputHeight': 'onDimensionKeyUp' |
| 32534 |
}; |
| 32535 |
}, |
| 32536 |
onDimensionKeyUp: function onDimensionKeyUp(event) { |
| 32537 |
var ENTER_KEY = 13; |
| 32538 |
|
| 32539 |
if (ENTER_KEY === event.keyCode) { |
| 32540 |
this.onApplyClicked(event); |
| 32541 |
} |
| 32542 |
}, |
| 32543 |
onApplyClicked: function onApplyClicked(event) { |
| 32544 |
event.preventDefault(); |
| 32545 |
this.setValue({ |
| 32546 |
width: this.ui.inputWidth.val(), |
| 32547 |
height: this.ui.inputHeight.val() |
| 32548 |
}); |
| 32549 |
} |
| 32550 |
}); |
| 32551 |
module.exports = ControlImageDimensionsItemView; |
| 32552 |
|
| 32553 |
/***/ }), |
| 32554 |
/* 570 */ |
| 32555 |
/***/ (function(module, exports, __webpack_require__) { |
| 32556 |
|
| 32557 |
"use strict"; |
| 32558 |
|
| 32559 |
|
| 32560 |
var _interopRequireDefault = __webpack_require__(0); |
| 32561 |
|
| 32562 |
__webpack_require__(80); |
| 32563 |
|
| 32564 |
var _filesUploadHandler = _interopRequireDefault(__webpack_require__(382)); |
| 32565 |
|
| 32566 |
var ControlMultipleBaseItemView = __webpack_require__(237), |
| 32567 |
ControlMediaItemView; |
| 32568 |
|
| 32569 |
ControlMediaItemView = ControlMultipleBaseItemView.extend({ |
| 32570 |
ui: function ui() { |
| 32571 |
var ui = ControlMultipleBaseItemView.prototype.ui.apply(this, arguments); |
| 32572 |
ui.controlMedia = '.elementor-control-media'; |
| 32573 |
ui.mediaImage = '.elementor-control-media__preview'; |
| 32574 |
ui.mediaVideo = '.elementor-control-media-video'; |
| 32575 |
ui.frameOpeners = '.elementor-control-preview-area'; |
| 32576 |
ui.removeButton = '.elementor-control-media__remove'; |
| 32577 |
ui.fileName = '.elementor-control-media__file__content__info__name'; |
| 32578 |
return ui; |
| 32579 |
}, |
| 32580 |
events: function events() { |
| 32581 |
return _.extend(ControlMultipleBaseItemView.prototype.events.apply(this, arguments), { |
| 32582 |
'click @ui.frameOpeners': 'openFrame', |
| 32583 |
'click @ui.removeButton': 'deleteImage' |
| 32584 |
}); |
| 32585 |
}, |
| 32586 |
getMediaType: function getMediaType() { |
| 32587 |
return this.model.get('media_type'); |
| 32588 |
}, |
| 32589 |
applySavedValue: function applySavedValue() { |
| 32590 |
var url = this.getControlValue('url'), |
| 32591 |
mediaType = this.getMediaType(); |
| 32592 |
|
| 32593 |
if ('image' === mediaType) { |
| 32594 |
this.ui.mediaImage.css('background-image', url ? 'url(' + url + ')' : ''); |
| 32595 |
} else if ('video' === mediaType) { |
| 32596 |
this.ui.mediaVideo.attr('src', url); |
| 32597 |
} else { |
| 32598 |
var fileName = url ? url.split('/').pop() : ''; |
| 32599 |
this.ui.fileName.text(fileName); |
| 32600 |
} |
| 32601 |
|
| 32602 |
this.ui.controlMedia.toggleClass('elementor-media-empty', !url); |
| 32603 |
}, |
| 32604 |
openFrame: function openFrame() { |
| 32605 |
var _this = this; |
| 32606 |
|
| 32607 |
if (!_filesUploadHandler.default.isUploadEnabled(this.getMediaType())) { |
| 32608 |
_filesUploadHandler.default.getUnfilteredFilesNotEnabledDialog(function () { |
| 32609 |
return _this.openFrame(); |
| 32610 |
}).show(); |
| 32611 |
|
| 32612 |
return false; |
| 32613 |
} |
| 32614 |
|
| 32615 |
if (!this.frame) { |
| 32616 |
this.initFrame(); |
| 32617 |
} |
| 32618 |
|
| 32619 |
this.frame.open(); // Set params to trigger sanitizer |
| 32620 |
|
| 32621 |
_filesUploadHandler.default.setUploadTypeCaller(this.frame); |
| 32622 |
|
| 32623 |
var selectedId = this.getControlValue('id'); |
| 32624 |
|
| 32625 |
if (!selectedId) { |
| 32626 |
return; |
| 32627 |
} |
| 32628 |
|
| 32629 |
this.frame.state().get('selection').add(wp.media.attachment(selectedId)); |
| 32630 |
}, |
| 32631 |
deleteImage: function deleteImage(event) { |
| 32632 |
event.stopPropagation(); |
| 32633 |
this.setValue({ |
| 32634 |
url: '', |
| 32635 |
id: '' |
| 32636 |
}); |
| 32637 |
this.applySavedValue(); |
| 32638 |
}, |
| 32639 |
|
| 32640 |
/** |
| 32641 |
* Create a media modal select frame, and store it so the instance can be reused when needed. |
| 32642 |
*/ |
| 32643 |
initFrame: function initFrame() { |
| 32644 |
// Set current doc id to attach uploaded images. |
| 32645 |
wp.media.view.settings.post.id = elementor.config.document.id; |
| 32646 |
this.frame = wp.media({ |
| 32647 |
button: { |
| 32648 |
text: elementor.translate('insert_media') |
| 32649 |
}, |
| 32650 |
states: [new wp.media.controller.Library({ |
| 32651 |
title: elementor.translate('insert_media'), |
| 32652 |
library: wp.media.query({ |
| 32653 |
type: this.getMediaType() |
| 32654 |
}), |
| 32655 |
multiple: false, |
| 32656 |
date: false |
| 32657 |
})] |
| 32658 |
}); // When a file is selected, run a callback. |
| 32659 |
|
| 32660 |
this.frame.on('insert select', this.select.bind(this)); |
| 32661 |
}, |
| 32662 |
|
| 32663 |
/** |
| 32664 |
* Callback handler for when an attachment is selected in the media modal. |
| 32665 |
* Gets the selected image information, and sets it within the control. |
| 32666 |
*/ |
| 32667 |
select: function select() { |
| 32668 |
this.trigger('before:select'); // Get the attachment from the modal frame. |
| 32669 |
|
| 32670 |
var attachment = this.frame.state().get('selection').first().toJSON(); |
| 32671 |
|
| 32672 |
if (attachment.url) { |
| 32673 |
this.setValue({ |
| 32674 |
url: attachment.url, |
| 32675 |
id: attachment.id |
| 32676 |
}); |
| 32677 |
this.applySavedValue(); |
| 32678 |
} |
| 32679 |
|
| 32680 |
this.trigger('after:select'); |
| 32681 |
}, |
| 32682 |
onBeforeDestroy: function onBeforeDestroy() { |
| 32683 |
this.$el.remove(); |
| 32684 |
} |
| 32685 |
}); |
| 32686 |
module.exports = ControlMediaItemView; |
| 32687 |
|
| 32688 |
/***/ }), |
| 32689 |
/* 571 */ |
| 32690 |
/***/ (function(module, exports, __webpack_require__) { |
| 32691 |
|
| 32692 |
"use strict"; |
| 32693 |
|
| 32694 |
|
| 32695 |
var ControlBaseDataView = __webpack_require__(127), |
| 32696 |
NumberValidator = __webpack_require__(572), |
| 32697 |
ControlNumberItemView; |
| 32698 |
|
| 32699 |
ControlNumberItemView = ControlBaseDataView.extend({ |
| 32700 |
registerValidators: function registerValidators() { |
| 32701 |
ControlBaseDataView.prototype.registerValidators.apply(this, arguments); |
| 32702 |
var validationTerms = {}, |
| 32703 |
model = this.model; |
| 32704 |
['min', 'max'].forEach(function (term) { |
| 32705 |
var termValue = model.get(term); |
| 32706 |
|
| 32707 |
if (_.isFinite(termValue)) { |
| 32708 |
validationTerms[term] = termValue; |
| 32709 |
} |
| 32710 |
}); |
| 32711 |
|
| 32712 |
if (!jQuery.isEmptyObject(validationTerms)) { |
| 32713 |
this.addValidator(new NumberValidator({ |
| 32714 |
validationTerms: validationTerms |
| 32715 |
})); |
| 32716 |
} |
| 32717 |
} |
| 32718 |
}); |
| 32719 |
module.exports = ControlNumberItemView; |
| 32720 |
|
| 32721 |
/***/ }), |
| 32722 |
/* 572 */ |
| 32723 |
/***/ (function(module, exports, __webpack_require__) { |
| 32724 |
|
| 32725 |
"use strict"; |
| 32726 |
|
| 32727 |
|
| 32728 |
var Validator = __webpack_require__(300); |
| 32729 |
|
| 32730 |
module.exports = Validator.extend({ |
| 32731 |
validationMethod: function validationMethod(newValue) { |
| 32732 |
var validationTerms = this.getSettings('validationTerms'), |
| 32733 |
errors = []; |
| 32734 |
|
| 32735 |
if (_.isFinite(newValue)) { |
| 32736 |
if (undefined !== validationTerms.min && newValue < validationTerms.min) { |
| 32737 |
errors.push('Value is less than minimum'); |
| 32738 |
} |
| 32739 |
|
| 32740 |
if (undefined !== validationTerms.max && newValue > validationTerms.max) { |
| 32741 |
errors.push('Value is greater than maximum'); |
| 32742 |
} |
| 32743 |
} |
| 32744 |
|
| 32745 |
return errors; |
| 32746 |
} |
| 32747 |
}); |
| 32748 |
|
| 32749 |
/***/ }), |
| 32750 |
/* 573 */ |
| 32751 |
/***/ (function(module, exports, __webpack_require__) { |
| 32752 |
|
| 32753 |
"use strict"; |
| 32754 |
|
| 32755 |
|
| 32756 |
var ControlMultipleBaseItemView = __webpack_require__(237), |
| 32757 |
ControlOrderItemView; |
| 32758 |
|
| 32759 |
ControlOrderItemView = ControlMultipleBaseItemView.extend({ |
| 32760 |
ui: function ui() { |
| 32761 |
var ui = ControlMultipleBaseItemView.prototype.ui.apply(this, arguments); |
| 32762 |
ui.reverseOrderLabel = '.elementor-control-order-label'; |
| 32763 |
return ui; |
| 32764 |
}, |
| 32765 |
changeLabelTitle: function changeLabelTitle() { |
| 32766 |
var reverseOrder = this.getControlValue('reverse_order'); |
| 32767 |
this.ui.reverseOrderLabel.attr('title', elementor.translate(reverseOrder ? 'asc' : 'desc')); |
| 32768 |
}, |
| 32769 |
onRender: function onRender() { |
| 32770 |
ControlMultipleBaseItemView.prototype.onRender.apply(this, arguments); |
| 32771 |
this.changeLabelTitle(); |
| 32772 |
}, |
| 32773 |
onInputChange: function onInputChange() { |
| 32774 |
this.changeLabelTitle(); |
| 32775 |
} |
| 32776 |
}); |
| 32777 |
module.exports = ControlOrderItemView; |
| 32778 |
|
| 32779 |
/***/ }), |
| 32780 |
/* 574 */ |
| 32781 |
/***/ (function(module, exports, __webpack_require__) { |
| 32782 |
|
| 32783 |
"use strict"; |
| 32784 |
|
| 32785 |
|
| 32786 |
var ControlBaseView = __webpack_require__(281), |
| 32787 |
ControlSectionItemView; |
| 32788 |
|
| 32789 |
ControlSectionItemView = ControlBaseView.extend({ |
| 32790 |
ui: function ui() { |
| 32791 |
var ui = ControlBaseView.prototype.ui.apply(this, arguments); |
| 32792 |
ui.heading = '.elementor-panel-heading'; |
| 32793 |
return ui; |
| 32794 |
}, |
| 32795 |
triggers: { |
| 32796 |
click: 'control:section:clicked' |
| 32797 |
} |
| 32798 |
}); |
| 32799 |
module.exports = ControlSectionItemView; |
| 32800 |
|
| 32801 |
/***/ }), |
| 32802 |
/* 575 */ |
| 32803 |
/***/ (function(module, exports, __webpack_require__) { |
| 32804 |
|
| 32805 |
"use strict"; |
| 32806 |
|
| 32807 |
|
| 32808 |
var ControlBaseDataView = __webpack_require__(127), |
| 32809 |
ControlSelectItemView; |
| 32810 |
|
| 32811 |
ControlSelectItemView = ControlBaseDataView.extend({}, { |
| 32812 |
onPasteStyle: function onPasteStyle(control, clipboardValue) { |
| 32813 |
if (control.groups) { |
| 32814 |
return control.groups.some(function (group) { |
| 32815 |
return ControlSelectItemView.onPasteStyle(group, clipboardValue); |
| 32816 |
}); |
| 32817 |
} |
| 32818 |
|
| 32819 |
return undefined !== control.options[clipboardValue]; |
| 32820 |
} |
| 32821 |
}); |
| 32822 |
module.exports = ControlSelectItemView; |
| 32823 |
|
| 32824 |
/***/ }), |
| 32825 |
/* 576 */ |
| 32826 |
/***/ (function(module, exports, __webpack_require__) { |
| 32827 |
|
| 32828 |
"use strict"; |
| 32829 |
|
| 32830 |
|
| 32831 |
var _interopRequireDefault = __webpack_require__(0); |
| 32832 |
|
| 32833 |
var _keys = _interopRequireDefault(__webpack_require__(23)); |
| 32834 |
|
| 32835 |
var _values = _interopRequireDefault(__webpack_require__(55)); |
| 32836 |
|
| 32837 |
var ControlBaseUnitsItemView = __webpack_require__(381), |
| 32838 |
ControlSliderItemView; |
| 32839 |
|
| 32840 |
ControlSliderItemView = ControlBaseUnitsItemView.extend({ |
| 32841 |
ui: function ui() { |
| 32842 |
var ui = ControlBaseUnitsItemView.prototype.ui.apply(this, arguments); |
| 32843 |
ui.slider = '.elementor-slider'; |
| 32844 |
return ui; |
| 32845 |
}, |
| 32846 |
templateHelpers: function templateHelpers() { |
| 32847 |
var templateHelpers = ControlBaseUnitsItemView.prototype.templateHelpers.apply(this, arguments); |
| 32848 |
templateHelpers.isMultiple = this.isMultiple(); |
| 32849 |
return templateHelpers; |
| 32850 |
}, |
| 32851 |
isMultiple: function isMultiple() { |
| 32852 |
var sizes = this.getControlValue('sizes'); |
| 32853 |
return !jQuery.isEmptyObject(sizes); |
| 32854 |
}, |
| 32855 |
initSlider: function initSlider() { |
| 32856 |
// Slider does not exist in tests. |
| 32857 |
if (!this.ui.slider[0]) { |
| 32858 |
return; |
| 32859 |
} |
| 32860 |
|
| 32861 |
this.destroySlider(); |
| 32862 |
var isMultiple = this.isMultiple(), |
| 32863 |
unitRange = elementorCommon.helpers.cloneObject(this.getCurrentRange()), |
| 32864 |
step = unitRange.step; |
| 32865 |
var sizes = this.getSize(); |
| 32866 |
|
| 32867 |
if (isMultiple) { |
| 32868 |
sizes = (0, _values.default)(sizes); |
| 32869 |
} else { |
| 32870 |
sizes = [sizes]; |
| 32871 |
this.ui.input.attr(unitRange); |
| 32872 |
} |
| 32873 |
|
| 32874 |
delete unitRange.step; |
| 32875 |
var tooltips; |
| 32876 |
var self = this; |
| 32877 |
|
| 32878 |
if (isMultiple) { |
| 32879 |
tooltips = []; |
| 32880 |
sizes.forEach(function () { |
| 32881 |
return tooltips.push({ |
| 32882 |
to: function to(value) { |
| 32883 |
return value + self.getControlValue('unit'); |
| 32884 |
} |
| 32885 |
}); |
| 32886 |
}); |
| 32887 |
} |
| 32888 |
|
| 32889 |
var sliderInstance = noUiSlider.create(this.ui.slider[0], { |
| 32890 |
start: sizes, |
| 32891 |
range: unitRange, |
| 32892 |
step: step, |
| 32893 |
tooltips: tooltips, |
| 32894 |
connect: isMultiple, |
| 32895 |
format: { |
| 32896 |
to: function to(value) { |
| 32897 |
return Math.round(value * 1000) / 1000; |
| 32898 |
}, |
| 32899 |
from: function from(value) { |
| 32900 |
return +value; |
| 32901 |
} |
| 32902 |
} |
| 32903 |
}); |
| 32904 |
sliderInstance.on('slide', this.onSlideChange.bind(this)); |
| 32905 |
}, |
| 32906 |
applySavedValue: function applySavedValue() { |
| 32907 |
ControlBaseUnitsItemView.prototype.applySavedValue.apply(this, arguments); // Slider does not exist in tests. |
| 32908 |
|
| 32909 |
if (this.ui.slider[0] && this.ui.slider[0].noUiSlider) { |
| 32910 |
this.ui.slider[0].noUiSlider.set(this.getSize()); |
| 32911 |
} |
| 32912 |
}, |
| 32913 |
getSize: function getSize() { |
| 32914 |
return this.getControlValue(this.isMultiple() ? 'sizes' : 'size'); |
| 32915 |
}, |
| 32916 |
resetSize: function resetSize() { |
| 32917 |
if (this.isMultiple()) { |
| 32918 |
this.setValue('sizes', {}); |
| 32919 |
} else { |
| 32920 |
this.setValue('size', ''); |
| 32921 |
} |
| 32922 |
|
| 32923 |
this.initSlider(); |
| 32924 |
}, |
| 32925 |
destroySlider: function destroySlider() { |
| 32926 |
// Slider does not exist in tests. |
| 32927 |
if (this.ui.slider[0] && this.ui.slider[0].noUiSlider) { |
| 32928 |
this.ui.slider[0].noUiSlider.destroy(); |
| 32929 |
} |
| 32930 |
}, |
| 32931 |
onReady: function onReady() { |
| 32932 |
if (this.isMultiple()) { |
| 32933 |
this.$el.addClass('elementor-control-type-slider--multiple elementor-control-type-slider--handles-' + this.model.get('handles')); |
| 32934 |
} |
| 32935 |
|
| 32936 |
this.initSlider(); |
| 32937 |
}, |
| 32938 |
onSlideChange: function onSlideChange(values, index) { |
| 32939 |
if (this.isMultiple()) { |
| 32940 |
var sizes = elementorCommon.helpers.cloneObject(this.getSize()), |
| 32941 |
key = (0, _keys.default)(sizes)[index]; |
| 32942 |
sizes[key] = values[index]; |
| 32943 |
this.setValue('sizes', sizes); |
| 32944 |
} else { |
| 32945 |
this.setValue('size', values[0]); |
| 32946 |
this.ui.input.val(values[0]); |
| 32947 |
} |
| 32948 |
}, |
| 32949 |
onInputChange: function onInputChange(event) { |
| 32950 |
var dataChanged = event.currentTarget.dataset.setting; |
| 32951 |
|
| 32952 |
if ('size' === dataChanged) { |
| 32953 |
this.ui.slider[0].noUiSlider.set(this.getSize()); |
| 32954 |
} else if ('unit' === dataChanged) { |
| 32955 |
this.resetSize(); |
| 32956 |
} |
| 32957 |
}, |
| 32958 |
onBeforeDestroy: function onBeforeDestroy() { |
| 32959 |
this.destroySlider(); |
| 32960 |
this.$el.remove(); |
| 32961 |
} |
| 32962 |
}); |
| 32963 |
module.exports = ControlSliderItemView; |
| 32964 |
|
| 32965 |
/***/ }), |
| 32966 |
/* 577 */ |
| 32967 |
/***/ (function(module, exports, __webpack_require__) { |
| 32968 |
|
| 32969 |
"use strict"; |
| 32970 |
|
| 32971 |
|
| 32972 |
var ControlBaseDataView = __webpack_require__(127), |
| 32973 |
ControlStructureItemView; |
| 32974 |
|
| 32975 |
ControlStructureItemView = ControlBaseDataView.extend({ |
| 32976 |
ui: function ui() { |
| 32977 |
var ui = ControlBaseDataView.prototype.ui.apply(this, arguments); |
| 32978 |
ui.resetStructure = '.elementor-control-structure-reset'; |
| 32979 |
return ui; |
| 32980 |
}, |
| 32981 |
events: function events() { |
| 32982 |
return _.extend(ControlBaseDataView.prototype.events.apply(this, arguments), { |
| 32983 |
'click @ui.resetStructure': 'onResetStructureClick' |
| 32984 |
}); |
| 32985 |
}, |
| 32986 |
templateHelpers: function templateHelpers() { |
| 32987 |
var helpers = ControlBaseDataView.prototype.templateHelpers.apply(this, arguments); |
| 32988 |
helpers.getMorePresets = this.getMorePresets.bind(this); |
| 32989 |
return helpers; |
| 32990 |
}, |
| 32991 |
getCurrentEditedSection: function getCurrentEditedSection() { |
| 32992 |
var editor = elementor.getPanelView().getCurrentPageView(); |
| 32993 |
return editor.getOption('editedElementView'); |
| 32994 |
}, |
| 32995 |
getMorePresets: function getMorePresets() { |
| 32996 |
var parsedStructure = elementor.presetsFactory.getParsedStructure(this.getControlValue()); |
| 32997 |
return elementor.presetsFactory.getPresets(parsedStructure.columnsCount); |
| 32998 |
}, |
| 32999 |
onResetStructureClick: function onResetStructureClick() { |
| 33000 |
this.getCurrentEditedSection().resetColumnsCustomSize(); |
| 33001 |
} |
| 33002 |
}); |
| 33003 |
module.exports = ControlStructureItemView; |
| 33004 |
|
| 33005 |
/***/ }), |
| 33006 |
/* 578 */ |
| 33007 |
/***/ (function(module, exports, __webpack_require__) { |
| 33008 |
|
| 33009 |
"use strict"; |
| 33010 |
|
| 33011 |
|
| 33012 |
var ControlBaseDataView = __webpack_require__(127); |
| 33013 |
|
| 33014 |
module.exports = ControlBaseDataView.extend({ |
| 33015 |
setInputValue: function setInputValue(input, value) { |
| 33016 |
this.$(input).prop('checked', this.model.get('return_value') === value); |
| 33017 |
} |
| 33018 |
}, { |
| 33019 |
onPasteStyle: function onPasteStyle(control, clipboardValue) { |
| 33020 |
return !clipboardValue || clipboardValue === control.return_value; |
| 33021 |
} |
| 33022 |
}); |
| 33023 |
|
| 33024 |
/***/ }), |
| 33025 |
/* 579 */ |
| 33026 |
/***/ (function(module, exports, __webpack_require__) { |
| 33027 |
|
| 33028 |
"use strict"; |
| 33029 |
|
| 33030 |
|
| 33031 |
var ControlBaseView = __webpack_require__(281), |
| 33032 |
ControlTabItemView; |
| 33033 |
|
| 33034 |
ControlTabItemView = ControlBaseView.extend({ |
| 33035 |
triggers: { |
| 33036 |
click: { |
| 33037 |
event: 'control:tab:clicked', |
| 33038 |
stopPropagation: false |
| 33039 |
} |
| 33040 |
} |
| 33041 |
}); |
| 33042 |
module.exports = ControlTabItemView; |
| 33043 |
|
| 33044 |
/***/ }), |
| 33045 |
/* 580 */ |
| 33046 |
/***/ (function(module, exports, __webpack_require__) { |
| 33047 |
|
| 33048 |
"use strict"; |
| 33049 |
|
| 33050 |
|
| 33051 |
var _interopRequireDefault = __webpack_require__(0); |
| 33052 |
|
| 33053 |
var _classCallCheck2 = _interopRequireDefault(__webpack_require__(2)); |
| 33054 |
|
| 33055 |
var _createClass2 = _interopRequireDefault(__webpack_require__(3)); |
| 33056 |
|
| 33057 |
var _get2 = _interopRequireDefault(__webpack_require__(26)); |
| 33058 |
|
| 33059 |
var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(16)); |
| 33060 |
|
| 33061 |
var _inherits2 = _interopRequireDefault(__webpack_require__(4)); |
| 33062 |
|
| 33063 |
var _createSuper2 = _interopRequireDefault(__webpack_require__(5)); |
| 33064 |
|
| 33065 |
var BaseMultiple = __webpack_require__(237); |
| 33066 |
|
| 33067 |
var URL = /*#__PURE__*/function (_BaseMultiple) { |
| 33068 |
(0, _inherits2.default)(URL, _BaseMultiple); |
| 33069 |
|
| 33070 |
var _super = (0, _createSuper2.default)(URL); |
| 33071 |
|
| 33072 |
function URL() { |
| 33073 |
(0, _classCallCheck2.default)(this, URL); |
| 33074 |
return _super.apply(this, arguments); |
| 33075 |
} |
| 33076 |
|
| 33077 |
(0, _createClass2.default)(URL, [{ |
| 33078 |
key: "ui", |
| 33079 |
value: function ui() { |
| 33080 |
var ui = (0, _get2.default)((0, _getPrototypeOf2.default)(URL.prototype), "ui", this).call(this); |
| 33081 |
ui.mainInput = '.elementor-input'; |
| 33082 |
ui.moreOptionsToggle = '.elementor-control-url-more'; |
| 33083 |
ui.moreOptions = '.elementor-control-url-more-options'; |
| 33084 |
return ui; |
| 33085 |
} |
| 33086 |
}, { |
| 33087 |
key: "events", |
| 33088 |
value: function events() { |
| 33089 |
var events = (0, _get2.default)((0, _getPrototypeOf2.default)(URL.prototype), "events", this).call(this); |
| 33090 |
events['click @ui.moreOptionsToggle'] = 'onMoreOptionsToggleClick'; |
| 33091 |
return events; |
| 33092 |
} |
| 33093 |
}, { |
| 33094 |
key: "autoComplete", |
| 33095 |
value: function autoComplete() { |
| 33096 |
var _this = this; |
| 33097 |
|
| 33098 |
var $mainInput = this.ui.mainInput, |
| 33099 |
positionBase = elementorCommon.config.isRTL ? 'right' : 'left'; |
| 33100 |
var last, cache; // Based on /wp-includes/js/tinymce/plugins/wplink/plugin.js. |
| 33101 |
|
| 33102 |
$mainInput.autocomplete({ |
| 33103 |
source: function source(request, response) { |
| 33104 |
if (!_this.options.model.attributes.autocomplete) { |
| 33105 |
return; |
| 33106 |
} |
| 33107 |
|
| 33108 |
if (last === request.term) { |
| 33109 |
response(cache); |
| 33110 |
return; |
| 33111 |
} |
| 33112 |
|
| 33113 |
if (/^https?:/.test(request.term) || request.term.indexOf('.') !== -1) { |
| 33114 |
return response(); |
| 33115 |
} // Show Spinner. |
| 33116 |
|
| 33117 |
|
| 33118 |
$mainInput.prev().show(); |
| 33119 |
jQuery.post(window.ajaxurl, { |
| 33120 |
editor: 'elementor', |
| 33121 |
action: 'wp-link-ajax', |
| 33122 |
page: 1, |
| 33123 |
search: request.term, |
| 33124 |
_ajax_linking_nonce: jQuery('#_ajax_linking_nonce').val() |
| 33125 |
}, function (data) { |
| 33126 |
cache = data; |
| 33127 |
response(data); |
| 33128 |
}, 'json').always(function () { |
| 33129 |
return $mainInput.prev().hide(); |
| 33130 |
}); |
| 33131 |
last = request.term; |
| 33132 |
}, |
| 33133 |
focus: function focus(event) { |
| 33134 |
/* |
| 33135 |
* Don't empty the URL input field, when using the arrow keys to |
| 33136 |
* highlight items. See api.jqueryui.com/autocomplete/#event-focus |
| 33137 |
*/ |
| 33138 |
event.preventDefault(); |
| 33139 |
}, |
| 33140 |
select: function select(event, ui) { |
| 33141 |
$mainInput.val(ui.item.permalink); |
| 33142 |
|
| 33143 |
_this.setValue('url', ui.item.permalink); |
| 33144 |
|
| 33145 |
return false; |
| 33146 |
}, |
| 33147 |
open: function open(event) { |
| 33148 |
jQuery(event.target).data('uiAutocomplete').menu.activeMenu.addClass('elementor-autocomplete-menu'); |
| 33149 |
}, |
| 33150 |
minLength: 2, |
| 33151 |
position: { |
| 33152 |
my: positionBase + ' top+2', |
| 33153 |
at: positionBase + ' bottom' |
| 33154 |
} |
| 33155 |
}); // The `_renderItem` cannot be override via the arguments. |
| 33156 |
|
| 33157 |
$mainInput.autocomplete('instance')._renderItem = function (ul, item) { |
| 33158 |
var fallbackTitle = window.wpLinkL10n ? window.wpLinkL10n.noTitle : '', |
| 33159 |
title = item.title ? item.title : fallbackTitle; |
| 33160 |
return jQuery('<li role="option" id="mce-wp-autocomplete-' + item.ID + '">').append('<span>' + title + '</span> <span class="elementor-autocomplete-item-info">' + item.info + '</span>').appendTo(ul); |
| 33161 |
}; |
| 33162 |
} |
| 33163 |
}, { |
| 33164 |
key: "onReady", |
| 33165 |
value: function onReady() { |
| 33166 |
this.autoComplete(); |
| 33167 |
} |
| 33168 |
}, { |
| 33169 |
key: "onMoreOptionsToggleClick", |
| 33170 |
value: function onMoreOptionsToggleClick() { |
| 33171 |
this.ui.moreOptions.slideToggle(); |
| 33172 |
} |
| 33173 |
}, { |
| 33174 |
key: "onBeforeDestroy", |
| 33175 |
value: function onBeforeDestroy() { |
| 33176 |
if (this.ui.mainInput.data('autocomplete')) { |
| 33177 |
this.ui.mainInput.autocomplete('destroy'); |
| 33178 |
} |
| 33179 |
|
| 33180 |
this.$el.remove(); |
| 33181 |
} |
| 33182 |
}]); |
| 33183 |
return URL; |
| 33184 |
}(BaseMultiple); |
| 33185 |
|
| 33186 |
module.exports = URL; |
| 33187 |
|
| 33188 |
/***/ }), |
| 33189 |
/* 581 */ |
| 33190 |
/***/ (function(module, exports, __webpack_require__) { |
| 33191 |
|
| 33192 |
"use strict"; |
| 33193 |
|
| 33194 |
|
| 33195 |
var ControlBaseDataView = __webpack_require__(127), |
| 33196 |
ControlWPWidgetItemView; |
| 33197 |
|
| 33198 |
ControlWPWidgetItemView = ControlBaseDataView.extend({ |
| 33199 |
ui: function ui() { |
| 33200 |
var ui = ControlBaseDataView.prototype.ui.apply(this, arguments); |
| 33201 |
ui.form = 'form'; |
| 33202 |
ui.loading = '.wp-widget-form-loading'; |
| 33203 |
return ui; |
| 33204 |
}, |
| 33205 |
events: function events() { |
| 33206 |
return { |
| 33207 |
'keyup @ui.form :input': 'onFormChanged', |
| 33208 |
'change @ui.form :input': 'onFormChanged' |
| 33209 |
}; |
| 33210 |
}, |
| 33211 |
onFormChanged: function onFormChanged() { |
| 33212 |
var idBase = 'widget-' + this.model.get('id_base'), |
| 33213 |
settings = this.ui.form.elementorSerializeObject()[idBase].REPLACE_TO_ID; |
| 33214 |
this.setValue(settings); |
| 33215 |
}, |
| 33216 |
onReady: function onReady() { |
| 33217 |
var self = this; |
| 33218 |
elementorCommon.ajax.addRequest('editor_get_wp_widget_form', { |
| 33219 |
data: { |
| 33220 |
// Fake Widget ID |
| 33221 |
id: self.model.cid, |
| 33222 |
widget_type: self.model.get('widget'), |
| 33223 |
data: self.container.settings.toJSON() |
| 33224 |
}, |
| 33225 |
success: function success(data) { |
| 33226 |
self.ui.form.html(data); // WP >= 4.8 |
| 33227 |
|
| 33228 |
if (wp.textWidgets) { |
| 33229 |
self.ui.form.addClass('open'); |
| 33230 |
var event = new jQuery.Event('widget-added'); |
| 33231 |
wp.textWidgets.handleWidgetAdded(event, self.ui.form); |
| 33232 |
wp.mediaWidgets.handleWidgetAdded(event, self.ui.form); // WP >= 4.9 |
| 33233 |
|
| 33234 |
if (wp.customHtmlWidgets) { |
| 33235 |
wp.customHtmlWidgets.handleWidgetAdded(event, self.ui.form); |
| 33236 |
} |
| 33237 |
} |
| 33238 |
|
| 33239 |
elementor.hooks.doAction('panel/widgets/' + self.model.get('widget') + '/controls/wp_widget/loaded', self); |
| 33240 |
} |
| 33241 |
}); |
| 33242 |
} |
| 33243 |
}); |
| 33244 |
module.exports = ControlWPWidgetItemView; |
| 33245 |
|
| 33246 |
/***/ }), |
| 33247 |
/* 582 */ |
| 33248 |
/***/ (function(module, exports, __webpack_require__) { |
| 33249 |
|
| 33250 |
"use strict"; |
| 33251 |
|
| 33252 |
|
| 33253 |
__webpack_require__(25); |
| 33254 |
|
| 33255 |
__webpack_require__(58); |
| 33256 |
|
| 33257 |
__webpack_require__(80); |
| 33258 |
|
| 33259 |
var ControlBaseDataView = __webpack_require__(127), |
| 33260 |
ControlWysiwygItemView; |
| 33261 |
|
| 33262 |
ControlWysiwygItemView = ControlBaseDataView.extend({ |
| 33263 |
editor: null, |
| 33264 |
ui: function ui() { |
| 33265 |
var ui = ControlBaseDataView.prototype.ui.apply(this, arguments); |
| 33266 |
jQuery.extend(ui, { |
| 33267 |
inputWrapper: '.elementor-control-input-wrapper' |
| 33268 |
}); |
| 33269 |
return ui; |
| 33270 |
}, |
| 33271 |
events: function events() { |
| 33272 |
return _.extend(ControlBaseDataView.prototype.events.apply(this, arguments), { |
| 33273 |
'keyup textarea.elementor-wp-editor': 'onBaseInputChange' |
| 33274 |
}); |
| 33275 |
}, |
| 33276 |
// List of buttons to move {buttonToMove: afterButton} |
| 33277 |
buttons: { |
| 33278 |
addToBasic: { |
| 33279 |
underline: 'italic' |
| 33280 |
}, |
| 33281 |
addToAdvanced: {}, |
| 33282 |
moveToAdvanced: { |
| 33283 |
blockquote: 'removeformat', |
| 33284 |
alignleft: 'blockquote', |
| 33285 |
aligncenter: 'alignleft', |
| 33286 |
alignright: 'aligncenter' |
| 33287 |
}, |
| 33288 |
moveToBasic: {}, |
| 33289 |
removeFromBasic: ['unlink', 'wp_more'], |
| 33290 |
removeFromAdvanced: [] |
| 33291 |
}, |
| 33292 |
initialize: function initialize() { |
| 33293 |
ControlBaseDataView.prototype.initialize.apply(this, arguments); |
| 33294 |
var self = this; |
| 33295 |
self.editorID = 'elementorwpeditor' + self.cid; // Wait a cycle before initializing the editors. |
| 33296 |
|
| 33297 |
_.defer(function () { |
| 33298 |
if (self.isDestroyed) { |
| 33299 |
return; |
| 33300 |
} // Initialize QuickTags, and set as the default mode. |
| 33301 |
|
| 33302 |
|
| 33303 |
quicktags({ |
| 33304 |
buttons: 'strong,em,del,link,img,close', |
| 33305 |
id: self.editorID |
| 33306 |
}); |
| 33307 |
|
| 33308 |
if (elementor.config.rich_editing_enabled) { |
| 33309 |
switchEditors.go(self.editorID, 'tmce'); |
| 33310 |
} |
| 33311 |
|
| 33312 |
delete QTags.instances[0]; |
| 33313 |
}); |
| 33314 |
|
| 33315 |
if (!elementor.config.rich_editing_enabled) { |
| 33316 |
self.$el.addClass('elementor-rich-editing-disabled'); |
| 33317 |
return; |
| 33318 |
} |
| 33319 |
|
| 33320 |
var editorConfig = { |
| 33321 |
id: self.editorID, |
| 33322 |
selector: '#' + self.editorID, |
| 33323 |
setup: function setup(editor) { |
| 33324 |
self.editor = editor; |
| 33325 |
} |
| 33326 |
}; |
| 33327 |
tinyMCEPreInit.mceInit[self.editorID] = _.extend(_.clone(tinyMCEPreInit.mceInit.elementorwpeditor), editorConfig); |
| 33328 |
|
| 33329 |
if (!elementor.config.tinymceHasCustomConfig) { |
| 33330 |
self.rearrangeButtons(); |
| 33331 |
} |
| 33332 |
}, |
| 33333 |
applySavedValue: function applySavedValue() { |
| 33334 |
if (!this.editor) { |
| 33335 |
return; |
| 33336 |
} |
| 33337 |
|
| 33338 |
var controlValue = this.getControlValue(); |
| 33339 |
this.editor.setContent(controlValue); // Update also the plain textarea |
| 33340 |
|
| 33341 |
jQuery('#' + this.editorID).val(controlValue); |
| 33342 |
}, |
| 33343 |
saveEditor: function saveEditor() { |
| 33344 |
this.setValue(this.editor.getContent()); |
| 33345 |
}, |
| 33346 |
moveButtons: function moveButtons(buttonsToMove, from, to) { |
| 33347 |
if (!to) { |
| 33348 |
to = from; |
| 33349 |
from = null; |
| 33350 |
} |
| 33351 |
|
| 33352 |
_.each(buttonsToMove, function (afterButton, button) { |
| 33353 |
var afterButtonIndex = to.indexOf(afterButton); |
| 33354 |
|
| 33355 |
if (from) { |
| 33356 |
var buttonIndex = from.indexOf(button); |
| 33357 |
|
| 33358 |
if (-1 === buttonIndex) { |
| 33359 |
throw new ReferenceError('Trying to move non-existing button `' + button + '`'); |
| 33360 |
} |
| 33361 |
|
| 33362 |
from.splice(buttonIndex, 1); |
| 33363 |
} |
| 33364 |
|
| 33365 |
if (-1 === afterButtonIndex) { |
| 33366 |
throw new ReferenceError('Trying to move button after non-existing button `' + afterButton + '`'); |
| 33367 |
} |
| 33368 |
|
| 33369 |
to.splice(afterButtonIndex + 1, 0, button); |
| 33370 |
}); |
| 33371 |
}, |
| 33372 |
rearrangeButtons: function rearrangeButtons() { |
| 33373 |
var editorProps = tinyMCEPreInit.mceInit[this.editorID], |
| 33374 |
editorBasicToolbarButtons = editorProps.toolbar1.split(','), |
| 33375 |
editorAdvancedToolbarButtons = editorProps.toolbar2.split(','); |
| 33376 |
editorBasicToolbarButtons = _.difference(editorBasicToolbarButtons, this.buttons.removeFromBasic); |
| 33377 |
editorAdvancedToolbarButtons = _.difference(editorAdvancedToolbarButtons, this.buttons.removeFromAdvanced); |
| 33378 |
this.moveButtons(this.buttons.moveToBasic, editorAdvancedToolbarButtons, editorBasicToolbarButtons); |
| 33379 |
this.moveButtons(this.buttons.moveToAdvanced, editorBasicToolbarButtons, editorAdvancedToolbarButtons); |
| 33380 |
this.moveButtons(this.buttons.addToBasic, editorBasicToolbarButtons); |
| 33381 |
this.moveButtons(this.buttons.addToAdvanced, editorAdvancedToolbarButtons); |
| 33382 |
editorProps.toolbar1 = editorBasicToolbarButtons.join(','); |
| 33383 |
editorProps.toolbar2 = editorAdvancedToolbarButtons.join(','); |
| 33384 |
}, |
| 33385 |
onReady: function onReady() { |
| 33386 |
var _this = this; |
| 33387 |
|
| 33388 |
var $editor = jQuery(elementor.config.wp_editor.replace(/elementorwpeditor/g, this.editorID).replace('%%EDITORCONTENT%%', this.getControlValue())); |
| 33389 |
$editor.find(".wp-editor-tabs").addClass('elementor-control-dynamic-switcher-wrapper'); |
| 33390 |
this.ui.inputWrapper.html($editor); |
| 33391 |
setTimeout(function () { |
| 33392 |
if (!_this.isDestroyed && _this.editor) { |
| 33393 |
_this.editor.on('keyup change undo redo', _this.saveEditor.bind(_this)); |
| 33394 |
} |
| 33395 |
}, 100); |
| 33396 |
}, |
| 33397 |
onBeforeDestroy: function onBeforeDestroy() { |
| 33398 |
// Remove TinyMCE and QuickTags instances |
| 33399 |
delete QTags.instances[this.editorID]; |
| 33400 |
|
| 33401 |
if (!elementor.config.rich_editing_enabled) { |
| 33402 |
return; |
| 33403 |
} |
| 33404 |
|
| 33405 |
tinymce.EditorManager.execCommand('mceRemoveEditor', true, this.editorID); // Cleanup PreInit data |
| 33406 |
|
| 33407 |
delete tinyMCEPreInit.mceInit[this.editorID]; |
| 33408 |
delete tinyMCEPreInit.qtInit[this.editorID]; |
| 33409 |
} |
| 33410 |
}); |
| 33411 |
module.exports = ControlWysiwygItemView; |
| 33412 |
|
| 33413 |
/***/ }), |
| 33414 |
/* 583 */ |
| 33415 |
/***/ (function(module, exports, __webpack_require__) { |
| 33416 |
|
| 33417 |
"use strict"; |
| 33418 |
|
| 33419 |
|
| 33420 |
module.exports = elementorModules.editor.elements.models.BaseSettings.extend({ |
| 33421 |
defaults: { |
| 33422 |
_column_size: 100 |
| 33423 |
} |
| 33424 |
}); |
| 33425 |
|
| 33426 |
/***/ }), |
| 33427 |
/* 584 */ |
| 33428 |
/***/ (function(module, exports, __webpack_require__) { |
| 33429 |
|
| 33430 |
"use strict"; |
| 33431 |
|
| 33432 |
|
| 33433 |
var _interopRequireDefault = __webpack_require__(0); |
| 33434 |
|
| 33435 |
__webpack_require__(25); |
| 33436 |
|
| 33437 |
var _widgetDraggable = _interopRequireDefault(__webpack_require__(585)); |
| 33438 |
|
| 33439 |
var _widgetResizeable = _interopRequireDefault(__webpack_require__(586)); |
| 33440 |
|
| 33441 |
var BaseElementView = __webpack_require__(297), |
| 33442 |
WidgetView; |
| 33443 |
|
| 33444 |
WidgetView = BaseElementView.extend({ |
| 33445 |
_templateType: null, |
| 33446 |
toggleEditTools: true, |
| 33447 |
getTemplate: function getTemplate() { |
| 33448 |
var editModel = this.getEditModel(); |
| 33449 |
|
| 33450 |
if ('remote' !== this.getTemplateType()) { |
| 33451 |
return Marionette.TemplateCache.get('#tmpl-elementor-' + editModel.get('widgetType') + '-content'); |
| 33452 |
} |
| 33453 |
|
| 33454 |
return _.template(''); |
| 33455 |
}, |
| 33456 |
className: function className() { |
| 33457 |
var baseClasses = BaseElementView.prototype.className.apply(this, arguments); |
| 33458 |
return baseClasses + ' elementor-widget ' + elementor.getElementData(this.getEditModel()).html_wrapper_class; |
| 33459 |
}, |
| 33460 |
events: function events() { |
| 33461 |
var events = BaseElementView.prototype.events.apply(this, arguments); |
| 33462 |
events.click = 'onClickEdit'; |
| 33463 |
return events; |
| 33464 |
}, |
| 33465 |
behaviors: function behaviors() { |
| 33466 |
var behaviors = BaseElementView.prototype.behaviors.apply(this, arguments); |
| 33467 |
|
| 33468 |
_.extend(behaviors, { |
| 33469 |
InlineEditing: { |
| 33470 |
behaviorClass: __webpack_require__(587), |
| 33471 |
inlineEditingClass: 'elementor-inline-editing' |
| 33472 |
}, |
| 33473 |
Draggable: { |
| 33474 |
behaviorClass: _widgetDraggable.default |
| 33475 |
}, |
| 33476 |
Resizable: { |
| 33477 |
behaviorClass: _widgetResizeable.default |
| 33478 |
} |
| 33479 |
}); |
| 33480 |
|
| 33481 |
return elementor.hooks.applyFilters('elements/widget/behaviors', behaviors, this); |
| 33482 |
}, |
| 33483 |
getEditButtons: function getEditButtons() { |
| 33484 |
var elementData = elementor.getElementData(this.model), |
| 33485 |
editTools = {}; |
| 33486 |
editTools.edit = { |
| 33487 |
title: elementor.translate('edit_element', [elementData.title]), |
| 33488 |
icon: 'edit' |
| 33489 |
}; |
| 33490 |
|
| 33491 |
if (elementor.getPreferences('edit_buttons')) { |
| 33492 |
editTools.duplicate = { |
| 33493 |
title: elementor.translate('duplicate_element', [elementData.title]), |
| 33494 |
icon: 'clone' |
| 33495 |
}; |
| 33496 |
editTools.remove = { |
| 33497 |
title: elementor.translate('delete_element', [elementData.title]), |
| 33498 |
icon: 'close' |
| 33499 |
}; |
| 33500 |
} |
| 33501 |
|
| 33502 |
return editTools; |
| 33503 |
}, |
| 33504 |
initialize: function initialize() { |
| 33505 |
var _this = this; |
| 33506 |
|
| 33507 |
BaseElementView.prototype.initialize.apply(this, arguments); |
| 33508 |
var editModel = this.getEditModel(); |
| 33509 |
editModel.on({ |
| 33510 |
'before:remote:render': this.onModelBeforeRemoteRender.bind(this), |
| 33511 |
'remote:render': this.onModelRemoteRender.bind(this), |
| 33512 |
'settings:loaded': function settingsLoaded() { |
| 33513 |
return setTimeout(_this.render.bind(_this)); |
| 33514 |
} |
| 33515 |
}); |
| 33516 |
|
| 33517 |
if ('remote' === this.getTemplateType() && !this.getEditModel().getHtmlCache()) { |
| 33518 |
editModel.renderRemoteServer(); |
| 33519 |
} |
| 33520 |
|
| 33521 |
var onRenderMethod = this.onRender; |
| 33522 |
this.render = _.throttle(this.render, 300); |
| 33523 |
|
| 33524 |
this.onRender = function () { |
| 33525 |
_.defer(onRenderMethod.bind(this)); |
| 33526 |
}; |
| 33527 |
}, |
| 33528 |
getContextMenuGroups: function getContextMenuGroups() { |
| 33529 |
var _this2 = this; |
| 33530 |
|
| 33531 |
var groups = BaseElementView.prototype.getContextMenuGroups.apply(this, arguments), |
| 33532 |
transferGroupIndex = groups.indexOf(_.findWhere(groups, { |
| 33533 |
name: 'clipboard' |
| 33534 |
})); |
| 33535 |
groups.splice(transferGroupIndex + 1, 0, { |
| 33536 |
name: 'save', |
| 33537 |
actions: [{ |
| 33538 |
name: 'save', |
| 33539 |
title: elementor.translate('save_as_global'), |
| 33540 |
shortcut: jQuery('<i>', { |
| 33541 |
class: 'eicon-pro-icon' |
| 33542 |
}), |
| 33543 |
isEnabled: function isEnabled() { |
| 33544 |
return 'global' !== _this2.options.model.get('widgetType'); |
| 33545 |
} |
| 33546 |
}] |
| 33547 |
}); |
| 33548 |
return groups; |
| 33549 |
}, |
| 33550 |
render: function render() { |
| 33551 |
if (this.model.isRemoteRequestActive()) { |
| 33552 |
this.handleEmptyWidget(); |
| 33553 |
this.$el.addClass('elementor-element'); |
| 33554 |
return; |
| 33555 |
} |
| 33556 |
|
| 33557 |
if (elementorCommonConfig.isTesting && this.isDestroyed) { |
| 33558 |
return; |
| 33559 |
} |
| 33560 |
|
| 33561 |
Marionette.CompositeView.prototype.render.apply(this, arguments); |
| 33562 |
}, |
| 33563 |
handleEmptyWidget: function handleEmptyWidget() { |
| 33564 |
// TODO: REMOVE THIS !! |
| 33565 |
// TEMP CODING !! |
| 33566 |
this.$el.addClass('elementor-widget-empty').append('<i class="elementor-widget-empty-icon ' + this.getEditModel().getIcon() + '"></i>'); |
| 33567 |
}, |
| 33568 |
getTemplateType: function getTemplateType() { |
| 33569 |
if (null === this._templateType) { |
| 33570 |
var editModel = this.getEditModel(), |
| 33571 |
$template = jQuery('#tmpl-elementor-' + editModel.get('widgetType') + '-content'); |
| 33572 |
this._templateType = $template.length ? 'js' : 'remote'; |
| 33573 |
} |
| 33574 |
|
| 33575 |
return this._templateType; |
| 33576 |
}, |
| 33577 |
getHTMLContent: function getHTMLContent(html) { |
| 33578 |
var htmlCache = this.getEditModel().getHtmlCache(); |
| 33579 |
return htmlCache || html; |
| 33580 |
}, |
| 33581 |
attachElContent: function attachElContent(html) { |
| 33582 |
var _this3 = this; |
| 33583 |
|
| 33584 |
_.defer(function () { |
| 33585 |
elementorFrontend.elements.window.jQuery(_this3.el).empty().append(_this3.getHandlesOverlay(), _this3.getHTMLContent(html)); |
| 33586 |
|
| 33587 |
_this3.bindUIElements(); // Build again the UI elements since the content attached just now |
| 33588 |
|
| 33589 |
}); |
| 33590 |
|
| 33591 |
return this; |
| 33592 |
}, |
| 33593 |
addInlineEditingAttributes: function addInlineEditingAttributes(key, toolbar) { |
| 33594 |
this.addRenderAttribute(key, { |
| 33595 |
class: 'elementor-inline-editing', |
| 33596 |
'data-elementor-setting-key': key |
| 33597 |
}); |
| 33598 |
|
| 33599 |
if (toolbar) { |
| 33600 |
this.addRenderAttribute(key, { |
| 33601 |
'data-elementor-inline-editing-toolbar': toolbar |
| 33602 |
}); |
| 33603 |
} |
| 33604 |
}, |
| 33605 |
getRepeaterSettingKey: function getRepeaterSettingKey(settingKey, repeaterKey, repeaterItemIndex) { |
| 33606 |
return [repeaterKey, repeaterItemIndex, settingKey].join('.'); |
| 33607 |
}, |
| 33608 |
onModelBeforeRemoteRender: function onModelBeforeRemoteRender() { |
| 33609 |
this.$el.addClass('elementor-loading'); |
| 33610 |
}, |
| 33611 |
onBeforeDestroy: function onBeforeDestroy() { |
| 33612 |
// Remove old style from the DOM. |
| 33613 |
elementor.$previewContents.find('#elementor-style-' + this.model.get('id')).remove(); |
| 33614 |
}, |
| 33615 |
onModelRemoteRender: function onModelRemoteRender() { |
| 33616 |
if (this.isDestroyed) { |
| 33617 |
return; |
| 33618 |
} |
| 33619 |
|
| 33620 |
this.$el.removeClass('elementor-loading'); // If container document has been changed during the remote request, don't render. |
| 33621 |
|
| 33622 |
if (this.container.document.id !== elementor.documents.getCurrent().id) { |
| 33623 |
return; |
| 33624 |
} |
| 33625 |
|
| 33626 |
this.render(); |
| 33627 |
}, |
| 33628 |
onRender: function onRender() { |
| 33629 |
var self = this; |
| 33630 |
BaseElementView.prototype.onRender.apply(self, arguments); |
| 33631 |
var editModel = self.getEditModel(), |
| 33632 |
skinType = editModel.getSetting('_skin') || 'default'; |
| 33633 |
self.$el.attr('data-widget_type', editModel.get('widgetType') + '.' + skinType).removeClass('elementor-widget-empty').children('.elementor-widget-empty-icon').remove(); // TODO: Find a better way to detect if all the images have been loaded |
| 33634 |
|
| 33635 |
self.$el.imagesLoaded().always(function () { |
| 33636 |
setTimeout(function () { |
| 33637 |
if (1 > self.$el.children('.elementor-widget-container').outerHeight()) { |
| 33638 |
self.handleEmptyWidget(); |
| 33639 |
} |
| 33640 |
}, 200); // Is element empty? |
| 33641 |
}); |
| 33642 |
}, |
| 33643 |
onClickEdit: function onClickEdit() { |
| 33644 |
if (this.container.isEditable()) { |
| 33645 |
this.model.trigger('request:edit'); |
| 33646 |
} |
| 33647 |
} |
| 33648 |
}); |
| 33649 |
module.exports = WidgetView; |
| 33650 |
|
| 33651 |
/***/ }), |
| 33652 |
/* 585 */ |
| 33653 |
/***/ (function(module, exports, __webpack_require__) { |
| 33654 |
|
| 33655 |
"use strict"; |
| 33656 |
|
| 33657 |
|
| 33658 |
var _interopRequireDefault = __webpack_require__(0); |
| 33659 |
|
| 33660 |
var _Object$defineProperty = __webpack_require__(1); |
| 33661 |
|
| 33662 |
_Object$defineProperty(exports, "__esModule", { |
| 33663 |
value: true |
| 33664 |
}); |
| 33665 |
|
| 33666 |
exports.default = void 0; |
| 33667 |
|
| 33668 |
var _classCallCheck2 = _interopRequireDefault(__webpack_require__(2)); |
| 33669 |
|
| 33670 |
var _createClass2 = _interopRequireDefault(__webpack_require__(3)); |
| 33671 |
|
| 33672 |
var _get2 = _interopRequireDefault(__webpack_require__(26)); |
| 33673 |
|
| 33674 |
var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(16)); |
| 33675 |
|
| 33676 |
var _inherits2 = _interopRequireDefault(__webpack_require__(4)); |
| 33677 |
|
| 33678 |
var _createSuper2 = _interopRequireDefault(__webpack_require__(5)); |
| 33679 |
|
| 33680 |
var _default = /*#__PURE__*/function (_Marionette$Behavior) { |
| 33681 |
(0, _inherits2.default)(_default, _Marionette$Behavior); |
| 33682 |
|
| 33683 |
var _super = (0, _createSuper2.default)(_default); |
| 33684 |
|
| 33685 |
function _default() { |
| 33686 |
(0, _classCallCheck2.default)(this, _default); |
| 33687 |
return _super.apply(this, arguments); |
| 33688 |
} |
| 33689 |
|
| 33690 |
(0, _createClass2.default)(_default, [{ |
| 33691 |
key: "events", |
| 33692 |
value: function events() { |
| 33693 |
return { |
| 33694 |
dragstart: 'onDragStart', |
| 33695 |
dragstop: 'onDragStop' |
| 33696 |
}; |
| 33697 |
} |
| 33698 |
}, { |
| 33699 |
key: "initialize", |
| 33700 |
value: function initialize() { |
| 33701 |
(0, _get2.default)((0, _getPrototypeOf2.default)(_default.prototype), "initialize", this).call(this); |
| 33702 |
this.listenTo(elementor.channels.dataEditMode, 'switch', this.toggle); // Save this instance for external use eg: ( hooks ). |
| 33703 |
|
| 33704 |
this.view.options.draggable = this; |
| 33705 |
} |
| 33706 |
}, { |
| 33707 |
key: "activate", |
| 33708 |
value: function activate() { |
| 33709 |
this.$el.draggable({ |
| 33710 |
addClasses: false |
| 33711 |
}); |
| 33712 |
} |
| 33713 |
}, { |
| 33714 |
key: "deactivate", |
| 33715 |
value: function deactivate() { |
| 33716 |
if (!this.$el.draggable('instance')) { |
| 33717 |
return; |
| 33718 |
} |
| 33719 |
|
| 33720 |
this.$el.draggable('destroy'); |
| 33721 |
} |
| 33722 |
}, { |
| 33723 |
key: "toggle", |
| 33724 |
value: function toggle() { |
| 33725 |
var isAbsolute = this.view.getEditModel().getSetting('_position'); |
| 33726 |
this.deactivate(); |
| 33727 |
|
| 33728 |
if (isAbsolute && this.view.getContainer().isDesignable()) { |
| 33729 |
this.activate(); |
| 33730 |
} |
| 33731 |
} |
| 33732 |
}, { |
| 33733 |
key: "onRender", |
| 33734 |
value: function onRender() { |
| 33735 |
var _this = this; |
| 33736 |
|
| 33737 |
_.defer(function () { |
| 33738 |
return _this.toggle(); |
| 33739 |
}); |
| 33740 |
} |
| 33741 |
}, { |
| 33742 |
key: "onDestroy", |
| 33743 |
value: function onDestroy() { |
| 33744 |
this.deactivate(); |
| 33745 |
} |
| 33746 |
}, { |
| 33747 |
key: "onDragStart", |
| 33748 |
value: function onDragStart(event) { |
| 33749 |
event.stopPropagation(); |
| 33750 |
this.view.model.trigger('request:edit'); |
| 33751 |
} |
| 33752 |
}, { |
| 33753 |
key: "onDragStop", |
| 33754 |
value: function onDragStop(event, ui) { |
| 33755 |
var _this2 = this; |
| 33756 |
|
| 33757 |
event.stopPropagation(); |
| 33758 |
var currentDeviceMode = elementorFrontend.getCurrentDeviceMode(), |
| 33759 |
deviceSuffix = 'desktop' === currentDeviceMode ? '' : '_' + currentDeviceMode, |
| 33760 |
editModel = this.view.getEditModel(), |
| 33761 |
hOrientation = editModel.getSetting('_offset_orientation_h'), |
| 33762 |
vOrientation = editModel.getSetting('_offset_orientation_v'), |
| 33763 |
settingToChange = {}, |
| 33764 |
isRTL = elementorFrontend.config.is_rtl; |
| 33765 |
var parentWidth = this.$el.offsetParent().width(), |
| 33766 |
elementWidth = this.$el.outerWidth(true), |
| 33767 |
left = ui.position.left, |
| 33768 |
right = parentWidth - left - elementWidth; |
| 33769 |
var xPos = isRTL ? right : left, |
| 33770 |
yPos = ui.position.top, |
| 33771 |
offsetX = '_offset_x', |
| 33772 |
offsetY = '_offset_y'; |
| 33773 |
|
| 33774 |
if ('end' === hOrientation) { |
| 33775 |
xPos = parentWidth - xPos - elementWidth; |
| 33776 |
offsetX = '_offset_x_end'; |
| 33777 |
} |
| 33778 |
|
| 33779 |
var offsetXUnit = editModel.getSetting(offsetX + deviceSuffix).unit; |
| 33780 |
xPos = elementor.helpers.elementSizeToUnit(this.$el, xPos, offsetXUnit); |
| 33781 |
var parentHeight = this.$el.offsetParent().height(), |
| 33782 |
elementHeight = this.$el.outerHeight(true); |
| 33783 |
|
| 33784 |
if ('end' === vOrientation) { |
| 33785 |
yPos = parentHeight - yPos - elementHeight; |
| 33786 |
offsetY = '_offset_y_end'; |
| 33787 |
} |
| 33788 |
|
| 33789 |
var offsetYUnit = editModel.getSetting(offsetY + deviceSuffix).unit; |
| 33790 |
yPos = elementor.helpers.elementSizeToUnit(this.$el, yPos, offsetYUnit); |
| 33791 |
settingToChange[offsetX + deviceSuffix] = { |
| 33792 |
size: xPos, |
| 33793 |
unit: offsetXUnit |
| 33794 |
}; |
| 33795 |
settingToChange[offsetY + deviceSuffix] = { |
| 33796 |
size: yPos, |
| 33797 |
unit: offsetYUnit |
| 33798 |
}; |
| 33799 |
$e.run('document/elements/settings', { |
| 33800 |
container: this.view.container, |
| 33801 |
settings: settingToChange, |
| 33802 |
options: { |
| 33803 |
external: true |
| 33804 |
} |
| 33805 |
}); |
| 33806 |
setTimeout(function () { |
| 33807 |
_this2.$el.css({ |
| 33808 |
top: '', |
| 33809 |
left: '', |
| 33810 |
right: '', |
| 33811 |
bottom: '', |
| 33812 |
width: '', |
| 33813 |
height: '' |
| 33814 |
}); |
| 33815 |
}, 250); |
| 33816 |
} |
| 33817 |
}]); |
| 33818 |
return _default; |
| 33819 |
}(Marionette.Behavior); |
| 33820 |
|
| 33821 |
exports.default = _default; |
| 33822 |
|
| 33823 |
/***/ }), |
| 33824 |
/* 586 */ |
| 33825 |
/***/ (function(module, exports, __webpack_require__) { |
| 33826 |
|
| 33827 |
"use strict"; |
| 33828 |
|
| 33829 |
|
| 33830 |
var _interopRequireDefault = __webpack_require__(0); |
| 33831 |
|
| 33832 |
var _Object$defineProperty = __webpack_require__(1); |
| 33833 |
|
| 33834 |
_Object$defineProperty(exports, "__esModule", { |
| 33835 |
value: true |
| 33836 |
}); |
| 33837 |
|
| 33838 |
exports.default = void 0; |
| 33839 |
|
| 33840 |
var _classCallCheck2 = _interopRequireDefault(__webpack_require__(2)); |
| 33841 |
|
| 33842 |
var _createClass2 = _interopRequireDefault(__webpack_require__(3)); |
| 33843 |
|
| 33844 |
var _get2 = _interopRequireDefault(__webpack_require__(26)); |
| 33845 |
|
| 33846 |
var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(16)); |
| 33847 |
|
| 33848 |
var _inherits2 = _interopRequireDefault(__webpack_require__(4)); |
| 33849 |
|
| 33850 |
var _createSuper2 = _interopRequireDefault(__webpack_require__(5)); |
| 33851 |
|
| 33852 |
var _default = /*#__PURE__*/function (_Marionette$Behavior) { |
| 33853 |
(0, _inherits2.default)(_default, _Marionette$Behavior); |
| 33854 |
|
| 33855 |
var _super = (0, _createSuper2.default)(_default); |
| 33856 |
|
| 33857 |
function _default() { |
| 33858 |
(0, _classCallCheck2.default)(this, _default); |
| 33859 |
return _super.apply(this, arguments); |
| 33860 |
} |
| 33861 |
|
| 33862 |
(0, _createClass2.default)(_default, [{ |
| 33863 |
key: "events", |
| 33864 |
value: function events() { |
| 33865 |
return { |
| 33866 |
resizestart: 'onResizeStart', |
| 33867 |
resizestop: 'onResizeStop', |
| 33868 |
resize: 'onResize' |
| 33869 |
}; |
| 33870 |
} |
| 33871 |
}, { |
| 33872 |
key: "initialize", |
| 33873 |
value: function initialize() { |
| 33874 |
(0, _get2.default)((0, _getPrototypeOf2.default)(_default.prototype), "initialize", this).call(this); |
| 33875 |
this.listenTo(elementor.channels.dataEditMode, 'switch', this.toggle); // Save this instance for external use eg: ( hooks ). |
| 33876 |
|
| 33877 |
this.view.options.resizeable = this; |
| 33878 |
} |
| 33879 |
}, { |
| 33880 |
key: "activate", |
| 33881 |
value: function activate() { |
| 33882 |
this.$el.resizable({ |
| 33883 |
handles: 'e, w' |
| 33884 |
}); |
| 33885 |
} |
| 33886 |
}, { |
| 33887 |
key: "deactivate", |
| 33888 |
value: function deactivate() { |
| 33889 |
if (!this.$el.resizable('instance')) { |
| 33890 |
return; |
| 33891 |
} |
| 33892 |
|
| 33893 |
this.$el.resizable('destroy'); |
| 33894 |
} |
| 33895 |
}, { |
| 33896 |
key: "toggle", |
| 33897 |
value: function toggle() { |
| 33898 |
var editModel = this.view.getEditModel(), |
| 33899 |
isAbsolute = editModel.getSetting('_position'), |
| 33900 |
isInline = 'initial' === editModel.getSetting('_element_width'); |
| 33901 |
this.deactivate(); |
| 33902 |
|
| 33903 |
if ((isAbsolute || isInline) && this.view.container.isDesignable()) { |
| 33904 |
this.activate(); |
| 33905 |
} |
| 33906 |
} |
| 33907 |
}, { |
| 33908 |
key: "onRender", |
| 33909 |
value: function onRender() { |
| 33910 |
var _this = this; |
| 33911 |
|
| 33912 |
_.defer(function () { |
| 33913 |
return _this.toggle(); |
| 33914 |
}); |
| 33915 |
} |
| 33916 |
}, { |
| 33917 |
key: "onDestroy", |
| 33918 |
value: function onDestroy() { |
| 33919 |
this.deactivate(); |
| 33920 |
} |
| 33921 |
}, { |
| 33922 |
key: "onResizeStart", |
| 33923 |
value: function onResizeStart(event) { |
| 33924 |
event.stopPropagation(); |
| 33925 |
this.view.model.trigger('request:edit'); |
| 33926 |
} |
| 33927 |
}, { |
| 33928 |
key: "onResizeStop", |
| 33929 |
value: function onResizeStop(event, ui) { |
| 33930 |
event.stopPropagation(); |
| 33931 |
var currentDeviceMode = elementorFrontend.getCurrentDeviceMode(), |
| 33932 |
deviceSuffix = 'desktop' === currentDeviceMode ? '' : '_' + currentDeviceMode, |
| 33933 |
editModel = this.view.getEditModel(), |
| 33934 |
unit = editModel.getSetting('_element_custom_width' + deviceSuffix).unit, |
| 33935 |
width = elementor.helpers.elementSizeToUnit(this.$el, ui.size.width, unit), |
| 33936 |
settingToChange = {}; |
| 33937 |
settingToChange['_element_width' + deviceSuffix] = 'initial'; |
| 33938 |
settingToChange['_element_custom_width' + deviceSuffix] = { |
| 33939 |
unit: unit, |
| 33940 |
size: width |
| 33941 |
}; |
| 33942 |
$e.run('document/elements/settings', { |
| 33943 |
container: this.view.container, |
| 33944 |
settings: settingToChange, |
| 33945 |
options: { |
| 33946 |
external: true |
| 33947 |
} |
| 33948 |
}); |
| 33949 |
this.$el.css({ |
| 33950 |
width: '', |
| 33951 |
height: '', |
| 33952 |
left: '' |
| 33953 |
}); |
| 33954 |
} |
| 33955 |
}, { |
| 33956 |
key: "onResize", |
| 33957 |
value: function onResize(event) { |
| 33958 |
event.stopPropagation(); |
| 33959 |
} |
| 33960 |
}]); |
| 33961 |
return _default; |
| 33962 |
}(Marionette.Behavior); |
| 33963 |
|
| 33964 |
exports.default = _default; |
| 33965 |
|
| 33966 |
/***/ }), |
| 33967 |
/* 587 */ |
| 33968 |
/***/ (function(module, exports, __webpack_require__) { |
| 33969 |
|
| 33970 |
"use strict"; |
| 33971 |
|
| 33972 |
|
| 33973 |
var _interopRequireDefault = __webpack_require__(0); |
| 33974 |
|
| 33975 |
var _defineProperty2 = _interopRequireDefault(__webpack_require__(28)); |
| 33976 |
|
| 33977 |
__webpack_require__(80); |
| 33978 |
|
| 33979 |
var InlineEditingBehavior; |
| 33980 |
InlineEditingBehavior = Marionette.Behavior.extend({ |
| 33981 |
editing: false, |
| 33982 |
$currentEditingArea: null, |
| 33983 |
ui: function ui() { |
| 33984 |
return { |
| 33985 |
inlineEditingArea: '.' + this.getOption('inlineEditingClass') |
| 33986 |
}; |
| 33987 |
}, |
| 33988 |
events: function events() { |
| 33989 |
return { |
| 33990 |
'click @ui.inlineEditingArea': 'onInlineEditingClick', |
| 33991 |
'input @ui.inlineEditingArea': 'onInlineEditingUpdate' |
| 33992 |
}; |
| 33993 |
}, |
| 33994 |
initialize: function initialize() { |
| 33995 |
this.onInlineEditingBlur = this.onInlineEditingBlur.bind(this); |
| 33996 |
}, |
| 33997 |
getEditingSettingKey: function getEditingSettingKey() { |
| 33998 |
return this.$currentEditingArea.data().elementorSettingKey; |
| 33999 |
}, |
| 34000 |
startEditing: function startEditing($element) { |
| 34001 |
if (this.editing || !this.view.container.isEditable() || this.view.model.isRemoteRequestActive()) { |
| 34002 |
return; |
| 34003 |
} |
| 34004 |
|
| 34005 |
var elementorSettingKey = $element.data().elementorSettingKey, |
| 34006 |
settingKey = elementorSettingKey, |
| 34007 |
keyParts = elementorSettingKey.split('.'), |
| 34008 |
isRepeaterKey = 3 === keyParts.length, |
| 34009 |
settingsModel = this.view.getEditModel().get('settings'); |
| 34010 |
|
| 34011 |
if (isRepeaterKey) { |
| 34012 |
settingsModel = settingsModel.get(keyParts[0]).models[keyParts[1]]; |
| 34013 |
settingKey = keyParts[2]; |
| 34014 |
} |
| 34015 |
|
| 34016 |
var dynamicSettings = settingsModel.get('__dynamic__'), |
| 34017 |
isDynamic = dynamicSettings && dynamicSettings[settingKey]; |
| 34018 |
|
| 34019 |
if (isDynamic) { |
| 34020 |
return; |
| 34021 |
} |
| 34022 |
|
| 34023 |
this.$currentEditingArea = $element; |
| 34024 |
var elementData = this.$currentEditingArea.data(), |
| 34025 |
elementDataToolbar = elementData.elementorInlineEditingToolbar, |
| 34026 |
mode = 'advanced' === elementDataToolbar ? 'advanced' : 'basic', |
| 34027 |
editModel = this.view.getEditModel(), |
| 34028 |
inlineEditingConfig = elementor.config.inlineEditing, |
| 34029 |
contentHTML = editModel.getSetting(this.getEditingSettingKey()); |
| 34030 |
|
| 34031 |
if ('advanced' === mode) { |
| 34032 |
contentHTML = wp.editor.autop(contentHTML); |
| 34033 |
} |
| 34034 |
/** |
| 34035 |
* Replace rendered content with unrendered content. |
| 34036 |
* This way the user can edit the original content, before shortcodes and oEmbeds are fired. |
| 34037 |
*/ |
| 34038 |
|
| 34039 |
|
| 34040 |
this.$currentEditingArea.html(contentHTML); |
| 34041 |
var ElementorInlineEditor = elementorFrontend.elements.window.ElementorInlineEditor; |
| 34042 |
this.editing = true; |
| 34043 |
this.view.allowRender = false; // Avoid retrieving of old content (e.g. in case of sorting) |
| 34044 |
|
| 34045 |
this.view.model.setHtmlCache(''); |
| 34046 |
this.editor = new ElementorInlineEditor({ |
| 34047 |
linksInNewWindow: true, |
| 34048 |
stay: false, |
| 34049 |
editor: this.$currentEditingArea[0], |
| 34050 |
mode: mode, |
| 34051 |
list: 'none' === elementDataToolbar ? [] : inlineEditingConfig.toolbar[elementDataToolbar || 'basic'], |
| 34052 |
cleanAttrs: ['id', 'class', 'name'], |
| 34053 |
placeholder: elementor.translate('type_here') + '...', |
| 34054 |
toolbarIconsPrefix: 'eicon-editor-', |
| 34055 |
toolbarIconsDictionary: { |
| 34056 |
externalLink: { |
| 34057 |
className: 'eicon-editor-external-link' |
| 34058 |
}, |
| 34059 |
list: { |
| 34060 |
className: 'eicon-editor-list-ul' |
| 34061 |
}, |
| 34062 |
insertOrderedList: { |
| 34063 |
className: 'eicon-editor-list-ol' |
| 34064 |
}, |
| 34065 |
insertUnorderedList: { |
| 34066 |
className: 'eicon-editor-list-ul' |
| 34067 |
}, |
| 34068 |
createlink: { |
| 34069 |
className: 'eicon-editor-link' |
| 34070 |
}, |
| 34071 |
unlink: { |
| 34072 |
className: 'eicon-editor-unlink' |
| 34073 |
}, |
| 34074 |
blockquote: { |
| 34075 |
className: 'eicon-editor-quote' |
| 34076 |
}, |
| 34077 |
p: { |
| 34078 |
className: 'eicon-editor-paragraph' |
| 34079 |
}, |
| 34080 |
pre: { |
| 34081 |
className: 'eicon-editor-code' |
| 34082 |
} |
| 34083 |
} |
| 34084 |
}); |
| 34085 |
var $menuItems = jQuery(this.editor._menu).children(); |
| 34086 |
/** |
| 34087 |
* When the edit area is not focused (on blur) the inline editing is stopped. |
| 34088 |
* In order to prevent blur event when the user clicks on toolbar buttons while editing the |
| 34089 |
* content, we need the prevent their mousedown event. This also prevents the blur event. |
| 34090 |
*/ |
| 34091 |
|
| 34092 |
$menuItems.on('mousedown', function (event) { |
| 34093 |
event.preventDefault(); |
| 34094 |
}); |
| 34095 |
this.$currentEditingArea.on('blur', this.onInlineEditingBlur); |
| 34096 |
elementorCommon.elements.$body.on('mousedown', this.onInlineEditingBlur); |
| 34097 |
}, |
| 34098 |
stopEditing: function stopEditing() { |
| 34099 |
this.editing = false; |
| 34100 |
this.$currentEditingArea.off('blur', this.onInlineEditingBlur); |
| 34101 |
elementorCommon.elements.$body.off('mousedown', this.onInlineEditingBlur); |
| 34102 |
this.editor.destroy(); |
| 34103 |
this.view.allowRender = true; |
| 34104 |
/** |
| 34105 |
* Inline editing has several toolbar types (advanced, basic and none). When editing is stopped, |
| 34106 |
* we need to rerender the area. To prevent multiple renderings, we will render only areas that |
| 34107 |
* use advanced toolbars. |
| 34108 |
*/ |
| 34109 |
|
| 34110 |
if ('advanced' === this.$currentEditingArea.data().elementorInlineEditingToolbar) { |
| 34111 |
this.view.getEditModel().renderRemoteServer(); |
| 34112 |
} |
| 34113 |
}, |
| 34114 |
onInlineEditingClick: function onInlineEditingClick(event) { |
| 34115 |
var self = this, |
| 34116 |
$targetElement = jQuery(event.currentTarget); |
| 34117 |
/** |
| 34118 |
* When starting inline editing we need to set timeout, this allows other inline items to finish |
| 34119 |
* their operations before focusing new editing area. |
| 34120 |
*/ |
| 34121 |
|
| 34122 |
setTimeout(function () { |
| 34123 |
self.startEditing($targetElement); |
| 34124 |
}, 30); |
| 34125 |
}, |
| 34126 |
onInlineEditingBlur: function onInlineEditingBlur(event) { |
| 34127 |
var _this = this; |
| 34128 |
|
| 34129 |
if ('mousedown' === event.type) { |
| 34130 |
this.stopEditing(); |
| 34131 |
return; |
| 34132 |
} |
| 34133 |
/** |
| 34134 |
* When exiting inline editing we need to set timeout, to make sure there is no focus on internal |
| 34135 |
* toolbar action. This prevent the blur and allows the user to continue the inline editing. |
| 34136 |
*/ |
| 34137 |
|
| 34138 |
|
| 34139 |
setTimeout(function () { |
| 34140 |
var selection = elementorFrontend.elements.window.getSelection(), |
| 34141 |
$focusNode = jQuery(selection.focusNode); |
| 34142 |
|
| 34143 |
if ($focusNode.closest('.pen-input-wrapper').length) { |
| 34144 |
return; |
| 34145 |
} |
| 34146 |
|
| 34147 |
_this.stopEditing(); |
| 34148 |
}, 20); |
| 34149 |
}, |
| 34150 |
onInlineEditingUpdate: function onInlineEditingUpdate() { |
| 34151 |
var key = this.getEditingSettingKey(), |
| 34152 |
container = this.view.getContainer(); |
| 34153 |
var parts = key.split('.'); // Is it repeater? |
| 34154 |
|
| 34155 |
if (3 === parts.length) { |
| 34156 |
container = container.children[parts[1]]; |
| 34157 |
key = parts[2]; |
| 34158 |
} |
| 34159 |
|
| 34160 |
$e.run('document/elements/settings', { |
| 34161 |
container: container, |
| 34162 |
settings: (0, _defineProperty2.default)({}, key, this.editor.getContent()), |
| 34163 |
options: { |
| 34164 |
external: true |
| 34165 |
} |
| 34166 |
}); |
| 34167 |
} |
| 34168 |
}); |
| 34169 |
module.exports = InlineEditingBehavior; |
| 34170 |
|
| 34171 |
/***/ }), |
| 34172 |
/* 588 */ |
| 34173 |
/***/ (function(module, exports, __webpack_require__) { |
| 34174 |
|
| 34175 |
"use strict"; |
| 34176 |
|
| 34177 |
|
| 34178 |
var PanelElementsElementsView; |
| 34179 |
PanelElementsElementsView = Marionette.CollectionView.extend({ |
| 34180 |
childView: __webpack_require__(387), |
| 34181 |
id: 'elementor-panel-elements', |
| 34182 |
initialize: function initialize() { |
| 34183 |
this.listenTo(elementor.channels.panelElements, 'filter:change', this.onFilterChanged); |
| 34184 |
}, |
| 34185 |
filter: function filter(childModel) { |
| 34186 |
var filterValue = elementor.channels.panelElements.request('filter:value'); |
| 34187 |
|
| 34188 |
if (!filterValue) { |
| 34189 |
return true; |
| 34190 |
} |
| 34191 |
|
| 34192 |
if (-1 !== childModel.get('title').toLowerCase().indexOf(filterValue.toLowerCase())) { |
| 34193 |
return true; |
| 34194 |
} |
| 34195 |
|
| 34196 |
return _.any(childModel.get('keywords'), function (keyword) { |
| 34197 |
return -1 !== keyword.toLowerCase().indexOf(filterValue.toLowerCase()); |
| 34198 |
}); |
| 34199 |
}, |
| 34200 |
onFilterChanged: function onFilterChanged() { |
| 34201 |
var filterValue = elementor.channels.panelElements.request('filter:value'); |
| 34202 |
|
| 34203 |
if (!filterValue) { |
| 34204 |
this.onFilterEmpty(); |
| 34205 |
} |
| 34206 |
|
| 34207 |
this._renderChildren(); |
| 34208 |
|
| 34209 |
this.triggerMethod('children:render'); |
| 34210 |
}, |
| 34211 |
onFilterEmpty: function onFilterEmpty() { |
| 34212 |
$e.routes.refreshContainer('panel'); |
| 34213 |
} |
| 34214 |
}); |
| 34215 |
module.exports = PanelElementsElementsView; |
| 34216 |
|
| 34217 |
/***/ }), |
| 34218 |
/* 589 */ |
| 34219 |
/***/ (function(module, exports, __webpack_require__) { |
| 34220 |
|
| 34221 |
"use strict"; |
| 34222 |
|
| 34223 |
|
| 34224 |
var _interopRequireDefault = __webpack_require__(0); |
| 34225 |
|
| 34226 |
__webpack_require__(119); |
| 34227 |
|
| 34228 |
__webpack_require__(39); |
| 34229 |
|
| 34230 |
__webpack_require__(58); |
| 34231 |
|
| 34232 |
var _keys = _interopRequireDefault(__webpack_require__(23)); |
| 34233 |
|
| 34234 |
var _stringify = _interopRequireDefault(__webpack_require__(206)); |
| 34235 |
|
| 34236 |
module.exports = elementorModules.Module.extend({ |
| 34237 |
CACHE_KEY_NOT_FOUND_ERROR: 'Cache key not found', |
| 34238 |
tags: { |
| 34239 |
Base: __webpack_require__(590) |
| 34240 |
}, |
| 34241 |
cache: {}, |
| 34242 |
cacheRequests: {}, |
| 34243 |
cacheCallbacks: [], |
| 34244 |
addCacheRequest: function addCacheRequest(tag) { |
| 34245 |
this.cacheRequests[this.createCacheKey(tag)] = true; |
| 34246 |
}, |
| 34247 |
createCacheKey: function createCacheKey(tag) { |
| 34248 |
return btoa(tag.getOption('name')) + '-' + btoa(encodeURIComponent((0, _stringify.default)(tag.model))); |
| 34249 |
}, |
| 34250 |
loadTagDataFromCache: function loadTagDataFromCache(tag) { |
| 34251 |
var cacheKey = this.createCacheKey(tag); |
| 34252 |
|
| 34253 |
if (undefined !== this.cache[cacheKey]) { |
| 34254 |
return this.cache[cacheKey]; |
| 34255 |
} |
| 34256 |
|
| 34257 |
if (!this.cacheRequests[cacheKey]) { |
| 34258 |
this.addCacheRequest(tag); |
| 34259 |
} |
| 34260 |
}, |
| 34261 |
loadCacheRequests: function loadCacheRequests() { |
| 34262 |
var cache = this.cache, |
| 34263 |
cacheRequests = this.cacheRequests, |
| 34264 |
cacheCallbacks = this.cacheCallbacks; |
| 34265 |
this.cacheRequests = {}; |
| 34266 |
this.cacheCallbacks = []; |
| 34267 |
elementorCommon.ajax.addRequest('render_tags', { |
| 34268 |
data: { |
| 34269 |
post_id: elementor.config.document.id, |
| 34270 |
tags: (0, _keys.default)(cacheRequests) |
| 34271 |
}, |
| 34272 |
success: function success(data) { |
| 34273 |
jQuery.extend(cache, data); |
| 34274 |
cacheCallbacks.forEach(function (callback) { |
| 34275 |
callback(); |
| 34276 |
}); |
| 34277 |
} |
| 34278 |
}); |
| 34279 |
}, |
| 34280 |
refreshCacheFromServer: function refreshCacheFromServer(callback) { |
| 34281 |
this.cacheCallbacks.push(callback); |
| 34282 |
this.loadCacheRequests(); |
| 34283 |
}, |
| 34284 |
getConfig: function getConfig(key) { |
| 34285 |
return this.getItems(elementor.config.dynamicTags, key); |
| 34286 |
}, |
| 34287 |
parseTagsText: function parseTagsText(text, settings, parseCallback) { |
| 34288 |
var self = this; |
| 34289 |
|
| 34290 |
if ('object' === settings.returnType) { |
| 34291 |
return self.parseTagText(text, settings, parseCallback); |
| 34292 |
} |
| 34293 |
|
| 34294 |
return text.replace(/\[elementor-tag[^\]]+]/g, function (tagText) { |
| 34295 |
return self.parseTagText(tagText, settings, parseCallback); |
| 34296 |
}); |
| 34297 |
}, |
| 34298 |
parseTagText: function parseTagText(tagText, settings, parseCallback) { |
| 34299 |
var tagData = this.tagTextToTagData(tagText); |
| 34300 |
|
| 34301 |
if (!tagData) { |
| 34302 |
if ('object' === settings.returnType) { |
| 34303 |
return {}; |
| 34304 |
} |
| 34305 |
|
| 34306 |
return ''; |
| 34307 |
} |
| 34308 |
|
| 34309 |
return parseCallback(tagData.id, tagData.name, tagData.settings); |
| 34310 |
}, |
| 34311 |
tagTextToTagData: function tagTextToTagData(tagText) { |
| 34312 |
var tagIDMatch = tagText.match(/id="(.*?(?="))"/), |
| 34313 |
tagNameMatch = tagText.match(/name="(.*?(?="))"/), |
| 34314 |
tagSettingsMatch = tagText.match(/settings="(.*?(?="]))/); |
| 34315 |
|
| 34316 |
if (!tagIDMatch || !tagNameMatch || !tagSettingsMatch) { |
| 34317 |
return false; |
| 34318 |
} |
| 34319 |
|
| 34320 |
return { |
| 34321 |
id: tagIDMatch[1], |
| 34322 |
name: tagNameMatch[1], |
| 34323 |
settings: JSON.parse(decodeURIComponent(tagSettingsMatch[1])) |
| 34324 |
}; |
| 34325 |
}, |
| 34326 |
createTag: function createTag(tagID, tagName, tagSettings) { |
| 34327 |
var tagConfig = this.getConfig('tags.' + tagName); |
| 34328 |
|
| 34329 |
if (!tagConfig) { |
| 34330 |
return; |
| 34331 |
} |
| 34332 |
|
| 34333 |
var TagClass = this.tags[tagName] || this.tags.Base, |
| 34334 |
model = new elementorModules.editor.elements.models.BaseSettings(tagSettings, { |
| 34335 |
controls: tagConfig.controls |
| 34336 |
}); |
| 34337 |
return new TagClass({ |
| 34338 |
id: tagID, |
| 34339 |
name: tagName, |
| 34340 |
model: model |
| 34341 |
}); |
| 34342 |
}, |
| 34343 |
getTagDataContent: function getTagDataContent(tagID, tagName, tagSettings) { |
| 34344 |
var tag = this.createTag(tagID, tagName, tagSettings); |
| 34345 |
|
| 34346 |
if (!tag) { |
| 34347 |
return; |
| 34348 |
} |
| 34349 |
|
| 34350 |
return tag.getContent(); |
| 34351 |
}, |
| 34352 |
tagDataToTagText: function tagDataToTagText(tagID, tagName, tagSettings) { |
| 34353 |
tagSettings = encodeURIComponent((0, _stringify.default)(tagSettings && tagSettings.toJSON({ |
| 34354 |
remove: ['default'] |
| 34355 |
}) || {})); |
| 34356 |
return '[elementor-tag id="' + tagID + '" name="' + tagName + '" settings="' + tagSettings + '"]'; |
| 34357 |
}, |
| 34358 |
tagContainerToTagText: function tagContainerToTagText( |
| 34359 |
/**Container*/ |
| 34360 |
container) { |
| 34361 |
return elementor.dynamicTags.tagDataToTagText(container.view.getOption('id'), container.view.getOption('name'), container.view.model); |
| 34362 |
}, |
| 34363 |
cleanCache: function cleanCache() { |
| 34364 |
this.cache = {}; |
| 34365 |
}, |
| 34366 |
onInit: function onInit() { |
| 34367 |
this.loadCacheRequests = _.debounce(this.loadCacheRequests, 300); |
| 34368 |
} |
| 34369 |
}); |
| 34370 |
|
| 34371 |
/***/ }), |
| 34372 |
/* 590 */ |
| 34373 |
/***/ (function(module, exports, __webpack_require__) { |
| 34374 |
|
| 34375 |
"use strict"; |
| 34376 |
|
| 34377 |
|
| 34378 |
module.exports = Marionette.ItemView.extend({ |
| 34379 |
hasTemplate: true, |
| 34380 |
tagName: 'span', |
| 34381 |
className: function className() { |
| 34382 |
return 'elementor-tag'; |
| 34383 |
}, |
| 34384 |
getTemplate: function getTemplate() { |
| 34385 |
if (!this.hasTemplate) { |
| 34386 |
return false; |
| 34387 |
} |
| 34388 |
|
| 34389 |
return Marionette.TemplateCache.get('#tmpl-elementor-tag-' + this.getOption('name') + '-content'); |
| 34390 |
}, |
| 34391 |
initialize: function initialize() { |
| 34392 |
try { |
| 34393 |
this.getTemplate(); |
| 34394 |
} catch (e) { |
| 34395 |
this.hasTemplate = false; |
| 34396 |
} |
| 34397 |
}, |
| 34398 |
getConfig: function getConfig(key) { |
| 34399 |
var config = elementor.dynamicTags.getConfig('tags.' + this.getOption('name')); |
| 34400 |
|
| 34401 |
if (key) { |
| 34402 |
return config[key]; |
| 34403 |
} |
| 34404 |
|
| 34405 |
return config; |
| 34406 |
}, |
| 34407 |
getContent: function getContent() { |
| 34408 |
var contentType = this.getConfig('content_type'), |
| 34409 |
data; |
| 34410 |
|
| 34411 |
if (!this.hasTemplate) { |
| 34412 |
data = elementor.dynamicTags.loadTagDataFromCache(this); |
| 34413 |
|
| 34414 |
if (undefined === data) { |
| 34415 |
throw new Error(elementor.dynamicTags.CACHE_KEY_NOT_FOUND_ERROR); |
| 34416 |
} |
| 34417 |
} |
| 34418 |
|
| 34419 |
if ('ui' === contentType) { |
| 34420 |
this.render(); |
| 34421 |
|
| 34422 |
if (this.hasTemplate) { |
| 34423 |
return this.el.outerHTML; |
| 34424 |
} |
| 34425 |
|
| 34426 |
if (this.getConfig('wrapped_tag')) { |
| 34427 |
data = jQuery(data).html(); |
| 34428 |
} |
| 34429 |
|
| 34430 |
this.$el.html(data); |
| 34431 |
} |
| 34432 |
|
| 34433 |
return data; |
| 34434 |
}, |
| 34435 |
onRender: function onRender() { |
| 34436 |
this.el.id = 'elementor-tag-' + this.getOption('id'); |
| 34437 |
} |
| 34438 |
}); |
| 34439 |
|
| 34440 |
/***/ }), |
| 34441 |
/* 591 */ |
| 34442 |
/***/ (function(module, exports, __webpack_require__) { |
| 34443 |
|
| 34444 |
"use strict"; |
| 34445 |
|
| 34446 |
|
| 34447 |
var _interopRequireDefault = __webpack_require__(0); |
| 34448 |
|
| 34449 |
var _manager = _interopRequireDefault(__webpack_require__(592)); |
| 34450 |
|
| 34451 |
module.exports = elementorModules.Module.extend({ |
| 34452 |
modules: { |
| 34453 |
base: __webpack_require__(335), |
| 34454 |
page: __webpack_require__(593), |
| 34455 |
editorPreferences: _manager.default |
| 34456 |
}, |
| 34457 |
panelPages: { |
| 34458 |
base: __webpack_require__(595) |
| 34459 |
}, |
| 34460 |
onInit: function onInit() { |
| 34461 |
this.initSettings(); |
| 34462 |
}, |
| 34463 |
initSettings: function initSettings() { |
| 34464 |
var self = this; |
| 34465 |
|
| 34466 |
_.each(elementor.config.settings, function (config, name) { |
| 34467 |
var Manager = self.modules[name] || self.modules.base; |
| 34468 |
self[name] = new Manager(config); |
| 34469 |
}); |
| 34470 |
} |
| 34471 |
}); |
| 34472 |
|
| 34473 |
/***/ }), |
| 34474 |
/* 592 */ |
| 34475 |
/***/ (function(module, exports, __webpack_require__) { |
| 34476 |
|
| 34477 |
"use strict"; |
| 34478 |
|
| 34479 |
|
| 34480 |
var _interopRequireDefault = __webpack_require__(0); |
| 34481 |
|
| 34482 |
var _Object$defineProperty = __webpack_require__(1); |
| 34483 |
|
| 34484 |
_Object$defineProperty(exports, "__esModule", { |
| 34485 |
value: true |
| 34486 |
}); |
| 34487 |
|
| 34488 |
exports.default = void 0; |
| 34489 |
|
| 34490 |
var _classCallCheck2 = _interopRequireDefault(__webpack_require__(2)); |
| 34491 |
|
| 34492 |
var _createClass2 = _interopRequireDefault(__webpack_require__(3)); |
| 34493 |
|
| 34494 |
var _inherits2 = _interopRequireDefault(__webpack_require__(4)); |
| 34495 |
|
| 34496 |
var _createSuper2 = _interopRequireDefault(__webpack_require__(5)); |
| 34497 |
|
| 34498 |
var _manager = _interopRequireDefault(__webpack_require__(335)); |
| 34499 |
|
| 34500 |
var _default = /*#__PURE__*/function (_BaseManager) { |
| 34501 |
(0, _inherits2.default)(_default, _BaseManager); |
| 34502 |
|
| 34503 |
var _super = (0, _createSuper2.default)(_default); |
| 34504 |
|
| 34505 |
(0, _createClass2.default)(_default, [{ |
| 34506 |
key: "getDefaultSettings", |
| 34507 |
value: function getDefaultSettings() { |
| 34508 |
return { |
| 34509 |
darkModeLinkID: 'elementor-editor-dark-mode-css' |
| 34510 |
}; |
| 34511 |
} |
| 34512 |
}]); |
| 34513 |
|
| 34514 |
function _default() { |
| 34515 |
var _this; |
| 34516 |
|
| 34517 |
(0, _classCallCheck2.default)(this, _default); |
| 34518 |
|
| 34519 |
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { |
| 34520 |
args[_key] = arguments[_key]; |
| 34521 |
} |
| 34522 |
|
| 34523 |
_this = _super.call.apply(_super, [this].concat(args)); |
| 34524 |
_this.changeCallbacks = { |
| 34525 |
ui_theme: _this.onUIThemeChanged, |
| 34526 |
panel_width: _this.onPanelWidthChanged, |
| 34527 |
edit_buttons: _this.onEditButtonsChanged |
| 34528 |
}; |
| 34529 |
return _this; |
| 34530 |
} |
| 34531 |
|
| 34532 |
(0, _createClass2.default)(_default, [{ |
| 34533 |
key: "createDarkModeStylesheetLink", |
| 34534 |
value: function createDarkModeStylesheetLink() { |
| 34535 |
var darkModeLinkID = this.getSettings('darkModeLinkID'); |
| 34536 |
var $darkModeLink = jQuery('#' + darkModeLinkID); |
| 34537 |
|
| 34538 |
if (!$darkModeLink.length) { |
| 34539 |
$darkModeLink = jQuery('<link>', { |
| 34540 |
id: darkModeLinkID, |
| 34541 |
rel: 'stylesheet', |
| 34542 |
href: elementor.config.ui.darkModeStylesheetURL |
| 34543 |
}); |
| 34544 |
} |
| 34545 |
|
| 34546 |
this.$link = $darkModeLink; |
| 34547 |
} |
| 34548 |
}, { |
| 34549 |
key: "getDarkModeStylesheetLink", |
| 34550 |
value: function getDarkModeStylesheetLink() { |
| 34551 |
if (!this.$link) { |
| 34552 |
this.createDarkModeStylesheetLink(); |
| 34553 |
} |
| 34554 |
|
| 34555 |
return this.$link; |
| 34556 |
} |
| 34557 |
}, { |
| 34558 |
key: "onUIThemeChanged", |
| 34559 |
value: function onUIThemeChanged(newValue) { |
| 34560 |
var $link = this.getDarkModeStylesheetLink(); |
| 34561 |
|
| 34562 |
if ('light' === newValue) { |
| 34563 |
$link.remove(); |
| 34564 |
return; |
| 34565 |
} |
| 34566 |
|
| 34567 |
$link.attr('media', 'auto' === newValue ? '(prefers-color-scheme: dark)' : '').appendTo(elementorCommon.elements.$body); |
| 34568 |
} |
| 34569 |
}, { |
| 34570 |
key: "onPanelWidthChanged", |
| 34571 |
value: function onPanelWidthChanged(newValue) { |
| 34572 |
elementor.panel.saveSize({ |
| 34573 |
width: newValue.size + newValue.unit |
| 34574 |
}); |
| 34575 |
elementor.panel.setSize(); |
| 34576 |
} |
| 34577 |
}, { |
| 34578 |
key: "onEditButtonsChanged", |
| 34579 |
value: function onEditButtonsChanged() { |
| 34580 |
// Let the button change before the high-performance action of rendering the entire page |
| 34581 |
setTimeout(function () { |
| 34582 |
return elementor.getPreviewView()._renderChildren(); |
| 34583 |
}, 300); |
| 34584 |
} |
| 34585 |
}]); |
| 34586 |
return _default; |
| 34587 |
}(_manager.default); |
| 34588 |
|
| 34589 |
exports.default = _default; |
| 34590 |
|
| 34591 |
/***/ }), |
| 34592 |
/* 593 */ |
| 34593 |
/***/ (function(module, exports, __webpack_require__) { |
| 34594 |
|
| 34595 |
"use strict"; |
| 34596 |
|
| 34597 |
|
| 34598 |
var _interopRequireDefault = __webpack_require__(0); |
| 34599 |
|
| 34600 |
__webpack_require__(25); |
| 34601 |
|
| 34602 |
var _component = _interopRequireDefault(__webpack_require__(594)); |
| 34603 |
|
| 34604 |
var BaseSettings = __webpack_require__(335); |
| 34605 |
|
| 34606 |
module.exports = BaseSettings.extend({ |
| 34607 |
getStyleId: function getStyleId() { |
| 34608 |
return this.getSettings('name') + '-' + elementor.documents.getCurrent().id; |
| 34609 |
}, |
| 34610 |
onInit: function onInit() { |
| 34611 |
BaseSettings.prototype.onInit.apply(this); |
| 34612 |
$e.components.register(new _component.default({ |
| 34613 |
manager: this |
| 34614 |
})); |
| 34615 |
}, |
| 34616 |
save: function save() {}, |
| 34617 |
changeCallbacks: { |
| 34618 |
post_title: function post_title(newValue) { |
| 34619 |
var $title = elementorFrontend.elements.$document.find(elementor.config.page_title_selector); |
| 34620 |
$title.text(newValue); |
| 34621 |
}, |
| 34622 |
template: function template() { |
| 34623 |
$e.run('document/save/auto', { |
| 34624 |
force: true, |
| 34625 |
onSuccess: function onSuccess() { |
| 34626 |
elementor.reloadPreview(); |
| 34627 |
elementor.once('preview:loaded', function () { |
| 34628 |
$e.route('panel/page-settings/settings'); |
| 34629 |
}); |
| 34630 |
} |
| 34631 |
}); |
| 34632 |
} |
| 34633 |
}, |
| 34634 |
getDataToSave: function getDataToSave(data) { |
| 34635 |
data.id = elementor.config.document.id; |
| 34636 |
return data; |
| 34637 |
}, |
| 34638 |
// Emulate an element view/model structure with the parts needed for a container. |
| 34639 |
getEditedView: function getEditedView() { |
| 34640 |
var _this = this; |
| 34641 |
|
| 34642 |
if (this.editedView) { |
| 34643 |
return this.editedView; |
| 34644 |
} |
| 34645 |
|
| 34646 |
var id = this.getContainerId(), |
| 34647 |
editModel = new Backbone.Model({ |
| 34648 |
id: id, |
| 34649 |
elType: id, |
| 34650 |
settings: this.model, |
| 34651 |
elements: elementor.elements |
| 34652 |
}); |
| 34653 |
var container = new elementorModules.editor.Container({ |
| 34654 |
type: id, |
| 34655 |
id: editModel.id, |
| 34656 |
model: editModel, |
| 34657 |
settings: editModel.get('settings'), |
| 34658 |
label: elementor.config.document.panel.title, |
| 34659 |
controls: this.model.controls, |
| 34660 |
children: elementor.elements, |
| 34661 |
// Emulate a view that can render the style. |
| 34662 |
renderer: { |
| 34663 |
view: { |
| 34664 |
lookup: function lookup() { |
| 34665 |
return container; |
| 34666 |
}, |
| 34667 |
renderOnChange: function renderOnChange() { |
| 34668 |
return _this.updateStylesheet(); |
| 34669 |
}, |
| 34670 |
renderUI: function renderUI() { |
| 34671 |
return _this.updateStylesheet(); |
| 34672 |
} |
| 34673 |
} |
| 34674 |
} |
| 34675 |
}); |
| 34676 |
this.editedView = { |
| 34677 |
getContainer: function getContainer() { |
| 34678 |
return container; |
| 34679 |
}, |
| 34680 |
getEditModel: function getEditModel() { |
| 34681 |
return editModel; |
| 34682 |
}, |
| 34683 |
model: editModel |
| 34684 |
}; |
| 34685 |
return this.editedView; |
| 34686 |
}, |
| 34687 |
getContainerId: function getContainerId() { |
| 34688 |
return 'document'; |
| 34689 |
} |
| 34690 |
}); |
| 34691 |
|
| 34692 |
/***/ }), |
| 34693 |
/* 594 */ |
| 34694 |
/***/ (function(module, exports, __webpack_require__) { |
| 34695 |
|
| 34696 |
"use strict"; |
| 34697 |
|
| 34698 |
|
| 34699 |
var _interopRequireDefault = __webpack_require__(0); |
| 34700 |
|
| 34701 |
var _Object$defineProperty = __webpack_require__(1); |
| 34702 |
|
| 34703 |
_Object$defineProperty(exports, "__esModule", { |
| 34704 |
value: true |
| 34705 |
}); |
| 34706 |
|
| 34707 |
exports.default = void 0; |
| 34708 |
|
| 34709 |
var _classCallCheck2 = _interopRequireDefault(__webpack_require__(2)); |
| 34710 |
|
| 34711 |
var _createClass2 = _interopRequireDefault(__webpack_require__(3)); |
| 34712 |
|
| 34713 |
var _inherits2 = _interopRequireDefault(__webpack_require__(4)); |
| 34714 |
|
| 34715 |
var _createSuper2 = _interopRequireDefault(__webpack_require__(5)); |
| 34716 |
|
| 34717 |
var _componentBase = _interopRequireDefault(__webpack_require__(85)); |
| 34718 |
|
| 34719 |
var Component = /*#__PURE__*/function (_ComponentBase) { |
| 34720 |
(0, _inherits2.default)(Component, _ComponentBase); |
| 34721 |
|
| 34722 |
var _super = (0, _createSuper2.default)(Component); |
| 34723 |
|
| 34724 |
function Component() { |
| 34725 |
(0, _classCallCheck2.default)(this, Component); |
| 34726 |
return _super.apply(this, arguments); |
| 34727 |
} |
| 34728 |
|
| 34729 |
(0, _createClass2.default)(Component, [{ |
| 34730 |
key: "getNamespace", |
| 34731 |
value: function getNamespace() { |
| 34732 |
return 'panel/page-settings'; |
| 34733 |
} |
| 34734 |
}, { |
| 34735 |
key: "defaultTabs", |
| 34736 |
value: function defaultTabs() { |
| 34737 |
return { |
| 34738 |
settings: { |
| 34739 |
title: elementor.translate('settings') |
| 34740 |
}, |
| 34741 |
style: { |
| 34742 |
title: elementor.translate('style') |
| 34743 |
}, |
| 34744 |
advanced: { |
| 34745 |
title: elementor.translate('advanced') |
| 34746 |
} |
| 34747 |
}; |
| 34748 |
} |
| 34749 |
}, { |
| 34750 |
key: "renderTab", |
| 34751 |
value: function renderTab(tab) { |
| 34752 |
elementor.getPanelView().setPage('page_settings').activateTab(tab); |
| 34753 |
} |
| 34754 |
}, { |
| 34755 |
key: "getTabsWrapperSelector", |
| 34756 |
value: function getTabsWrapperSelector() { |
| 34757 |
return '.elementor-panel-navigation'; |
| 34758 |
} |
| 34759 |
}]); |
| 34760 |
return Component; |
| 34761 |
}(_componentBase.default); |
| 34762 |
|
| 34763 |
exports.default = Component; |
| 34764 |
|
| 34765 |
/***/ }), |
| 34766 |
/* 595 */ |
| 34767 |
/***/ (function(module, exports, __webpack_require__) { |
| 34768 |
|
| 34769 |
"use strict"; |
| 34770 |
|
| 34771 |
|
| 34772 |
module.exports = elementorModules.editor.views.ControlsStack.extend({ |
| 34773 |
id: function id() { |
| 34774 |
return 'elementor-panel-' + this.getOption('name') + '-settings'; |
| 34775 |
}, |
| 34776 |
getTemplate: function getTemplate() { |
| 34777 |
return '#tmpl-elementor-panel-' + this.getOption('name') + '-settings'; |
| 34778 |
}, |
| 34779 |
childViewContainer: function childViewContainer() { |
| 34780 |
return '#elementor-panel-' + this.getOption('name') + '-settings-controls'; |
| 34781 |
}, |
| 34782 |
childViewOptions: function childViewOptions() { |
| 34783 |
return { |
| 34784 |
container: this.getOption('editedView').getContainer() |
| 34785 |
}; |
| 34786 |
} |
| 34787 |
}); |
| 34788 |
|
| 34789 |
/***/ }), |
| 34790 |
/* 596 */ |
| 34791 |
/***/ (function(module, exports, __webpack_require__) { |
| 34792 |
|
| 34793 |
"use strict"; |
| 34794 |
|
| 34795 |
|
| 34796 |
var _interopRequireDefault = __webpack_require__(0); |
| 34797 |
|
| 34798 |
var _parseInt2 = _interopRequireDefault(__webpack_require__(213)); |
| 34799 |
|
| 34800 |
module.exports = elementorModules.Module.extend({ |
| 34801 |
initToast: function initToast() { |
| 34802 |
var toast = elementorCommon.dialogsManager.createWidget('buttons', { |
| 34803 |
id: 'elementor-toast', |
| 34804 |
position: { |
| 34805 |
my: 'center bottom', |
| 34806 |
at: 'center bottom-10', |
| 34807 |
of: '#elementor-panel-content-wrapper', |
| 34808 |
autoRefresh: true |
| 34809 |
}, |
| 34810 |
hide: { |
| 34811 |
onClick: true, |
| 34812 |
auto: true, |
| 34813 |
autoDelay: 10000 |
| 34814 |
}, |
| 34815 |
effects: { |
| 34816 |
show: function show() { |
| 34817 |
var $widget = toast.getElements('widget'); |
| 34818 |
$widget.show(); |
| 34819 |
toast.refreshPosition(); |
| 34820 |
var top = (0, _parseInt2.default)($widget.css('top'), 10); |
| 34821 |
$widget.hide().css('top', top + 100); |
| 34822 |
$widget.animate({ |
| 34823 |
opacity: 'show', |
| 34824 |
height: 'show', |
| 34825 |
paddingBottom: 'show', |
| 34826 |
paddingTop: 'show', |
| 34827 |
top: top |
| 34828 |
}, { |
| 34829 |
easing: 'linear', |
| 34830 |
duration: 300 |
| 34831 |
}); |
| 34832 |
}, |
| 34833 |
hide: function hide() { |
| 34834 |
var $widget = toast.getElements('widget'), |
| 34835 |
top = (0, _parseInt2.default)($widget.css('top'), 10); |
| 34836 |
$widget.animate({ |
| 34837 |
opacity: 'hide', |
| 34838 |
height: 'hide', |
| 34839 |
paddingBottom: 'hide', |
| 34840 |
paddingTop: 'hide', |
| 34841 |
top: top + 100 |
| 34842 |
}, { |
| 34843 |
easing: 'linear', |
| 34844 |
duration: 300 |
| 34845 |
}); |
| 34846 |
} |
| 34847 |
}, |
| 34848 |
button: { |
| 34849 |
tag: 'div' |
| 34850 |
} |
| 34851 |
}); |
| 34852 |
|
| 34853 |
this.getToast = function () { |
| 34854 |
return toast; |
| 34855 |
}; |
| 34856 |
}, |
| 34857 |
showToast: function showToast(options) { |
| 34858 |
var toast = this.getToast(); |
| 34859 |
toast.setMessage(options.message); |
| 34860 |
toast.getElements('buttonsWrapper').empty(); |
| 34861 |
|
| 34862 |
if (options.buttons) { |
| 34863 |
options.buttons.forEach(function (button) { |
| 34864 |
toast.addButton(button); |
| 34865 |
}); |
| 34866 |
} else { |
| 34867 |
toast.getElements('buttonsWrapper').remove(); |
| 34868 |
} |
| 34869 |
|
| 34870 |
if (options.classes) { |
| 34871 |
toast.getElements('widget').addClass(options.classes); |
| 34872 |
} |
| 34873 |
|
| 34874 |
toast.show(); |
| 34875 |
}, |
| 34876 |
onInit: function onInit() { |
| 34877 |
this.initToast(); |
| 34878 |
} |
| 34879 |
}); |
| 34880 |
|
| 34881 |
/***/ }), |
| 34882 |
/* 597 */ |
| 34883 |
/***/ (function(module, exports, __webpack_require__) { |
| 34884 |
|
| 34885 |
"use strict"; |
| 34886 |
|
| 34887 |
|
| 34888 |
var BaseRegion = __webpack_require__(371); |
| 34889 |
|
| 34890 |
module.exports = BaseRegion.extend({ |
| 34891 |
el: '#elementor-panel', |
| 34892 |
getStorageKey: function getStorageKey() { |
| 34893 |
return 'panel'; |
| 34894 |
}, |
| 34895 |
getDefaultStorage: function getDefaultStorage() { |
| 34896 |
return { |
| 34897 |
size: { |
| 34898 |
width: '' |
| 34899 |
} |
| 34900 |
}; |
| 34901 |
}, |
| 34902 |
constructor: function constructor() { |
| 34903 |
BaseRegion.prototype.constructor.apply(this, arguments); |
| 34904 |
|
| 34905 |
var PanelLayoutView = __webpack_require__(598); |
| 34906 |
|
| 34907 |
this.show(new PanelLayoutView()); |
| 34908 |
this.resizable(); |
| 34909 |
this.setSize(); |
| 34910 |
this.listenTo(elementor.channels.dataEditMode, 'switch', this.onEditModeSwitched); |
| 34911 |
}, |
| 34912 |
setSize: function setSize() { |
| 34913 |
var width = this.storage.size.width, |
| 34914 |
side = elementorCommon.config.isRTL ? 'right' : 'left'; |
| 34915 |
this.$el.css('width', width); |
| 34916 |
elementor.$previewWrapper.css(side, width); |
| 34917 |
}, |
| 34918 |
resizable: function resizable() { |
| 34919 |
var self = this, |
| 34920 |
side = elementorCommon.config.isRTL ? 'right' : 'left'; |
| 34921 |
self.$el.resizable({ |
| 34922 |
handles: elementorCommon.config.isRTL ? 'w' : 'e', |
| 34923 |
minWidth: 200, |
| 34924 |
maxWidth: 680, |
| 34925 |
start: function start() { |
| 34926 |
elementor.$previewWrapper.addClass('ui-resizable-resizing'); |
| 34927 |
}, |
| 34928 |
stop: function stop() { |
| 34929 |
elementor.$previewWrapper.removeClass('ui-resizable-resizing'); |
| 34930 |
elementor.getPanelView().updateScrollbar(); |
| 34931 |
self.saveSize(); |
| 34932 |
}, |
| 34933 |
resize: function resize(event, ui) { |
| 34934 |
elementor.$previewWrapper.css(side, ui.size.width); |
| 34935 |
} |
| 34936 |
}); |
| 34937 |
}, |
| 34938 |
onEditModeSwitched: function onEditModeSwitched(activeMode) { |
| 34939 |
if ('edit' !== activeMode) { |
| 34940 |
return; |
| 34941 |
} |
| 34942 |
|
| 34943 |
this.setSize(); |
| 34944 |
} |
| 34945 |
}); |
| 34946 |
|
| 34947 |
/***/ }), |
| 34948 |
/* 598 */ |
| 34949 |
/***/ (function(module, exports, __webpack_require__) { |
| 34950 |
|
| 34951 |
"use strict"; |
| 34952 |
|
| 34953 |
|
| 34954 |
var _interopRequireDefault = __webpack_require__(0); |
| 34955 |
|
| 34956 |
var _keys = _interopRequireDefault(__webpack_require__(23)); |
| 34957 |
|
| 34958 |
var _component = _interopRequireDefault(__webpack_require__(599)); |
| 34959 |
|
| 34960 |
var _component2 = _interopRequireDefault(__webpack_require__(612)); |
| 34961 |
|
| 34962 |
var _component3 = _interopRequireDefault(__webpack_require__(613)); |
| 34963 |
|
| 34964 |
var EditModeItemView = __webpack_require__(616), |
| 34965 |
PanelLayoutView; |
| 34966 |
|
| 34967 |
PanelLayoutView = Marionette.LayoutView.extend({ |
| 34968 |
template: '#tmpl-elementor-panel', |
| 34969 |
id: 'elementor-panel-inner', |
| 34970 |
regions: { |
| 34971 |
content: '#elementor-panel-content-wrapper', |
| 34972 |
header: '#elementor-panel-header-wrapper', |
| 34973 |
footer: '#elementor-panel-footer', |
| 34974 |
modeSwitcher: '#elementor-mode-switcher' |
| 34975 |
}, |
| 34976 |
pages: {}, |
| 34977 |
childEvents: { |
| 34978 |
'click:add': function clickAdd() { |
| 34979 |
$e.route('panel/elements/categories'); |
| 34980 |
}, |
| 34981 |
'editor:destroy': function editorDestroy() { |
| 34982 |
$e.route('panel/elements/categories', { |
| 34983 |
autoFocusSearch: false |
| 34984 |
}); |
| 34985 |
} |
| 34986 |
}, |
| 34987 |
currentPageName: null, |
| 34988 |
currentPageView: null, |
| 34989 |
perfectScrollbar: null, |
| 34990 |
initialize: function initialize() { |
| 34991 |
$e.components.register(new _component.default({ |
| 34992 |
manager: this |
| 34993 |
})); |
| 34994 |
$e.internal('panel/state-loading'); |
| 34995 |
$e.components.register(new _component2.default({ |
| 34996 |
manager: this |
| 34997 |
})); |
| 34998 |
$e.components.register(new _component3.default({ |
| 34999 |
manager: this |
| 35000 |
})); |
| 35001 |
this.initPages(); |
| 35002 |
}, |
| 35003 |
buildPages: function buildPages() { |
| 35004 |
var pages = { |
| 35005 |
elements: { |
| 35006 |
view: __webpack_require__(617), |
| 35007 |
title: '<img src="' + elementorCommon.config.urls.assets + 'images/logo-panel.svg">' |
| 35008 |
}, |
| 35009 |
editor: { |
| 35010 |
view: __webpack_require__(622) |
| 35011 |
}, |
| 35012 |
menu: { |
| 35013 |
view: elementor.modules.layouts.panel.pages.menu.Menu, |
| 35014 |
title: '<img src="' + elementorCommon.config.urls.assets + 'images/logo-panel.svg">' |
| 35015 |
}, |
| 35016 |
colorScheme: { |
| 35017 |
view: __webpack_require__(623) |
| 35018 |
}, |
| 35019 |
typographyScheme: { |
| 35020 |
view: __webpack_require__(626) |
| 35021 |
} |
| 35022 |
}; |
| 35023 |
|
| 35024 |
var schemesTypes = (0, _keys.default)(elementor.schemes.getSchemes()), |
| 35025 |
disabledSchemes = _.difference(schemesTypes, elementor.schemes.getEnabledSchemesTypes()); |
| 35026 |
|
| 35027 |
_.each(disabledSchemes, function (schemeType) { |
| 35028 |
var scheme = elementor.schemes.getScheme(schemeType); |
| 35029 |
pages[schemeType + 'Scheme'].view = __webpack_require__(627).extend({ |
| 35030 |
disabledTitle: scheme.disabled_title |
| 35031 |
}); |
| 35032 |
}); |
| 35033 |
|
| 35034 |
return pages; |
| 35035 |
}, |
| 35036 |
initPages: function initPages() { |
| 35037 |
var pages; |
| 35038 |
|
| 35039 |
this.getPages = function (page) { |
| 35040 |
if (!pages) { |
| 35041 |
pages = this.buildPages(); |
| 35042 |
} |
| 35043 |
|
| 35044 |
return page ? pages[page] : pages; |
| 35045 |
}; |
| 35046 |
|
| 35047 |
this.addPage = function (pageName, pageData) { |
| 35048 |
if (!pages) { |
| 35049 |
pages = this.buildPages(); |
| 35050 |
} |
| 35051 |
|
| 35052 |
pages[pageName] = pageData; |
| 35053 |
}; |
| 35054 |
}, |
| 35055 |
getHeaderView: function getHeaderView() { |
| 35056 |
return this.getChildView('header'); |
| 35057 |
}, |
| 35058 |
getFooterView: function getFooterView() { |
| 35059 |
return this.getChildView('footer'); |
| 35060 |
}, |
| 35061 |
getCurrentPageName: function getCurrentPageName() { |
| 35062 |
return this.currentPageName; |
| 35063 |
}, |
| 35064 |
getCurrentPageView: function getCurrentPageView() { |
| 35065 |
return this.currentPageView; |
| 35066 |
}, |
| 35067 |
setPage: function setPage(page, title, viewOptions) { |
| 35068 |
var pages = this.getPages(); |
| 35069 |
|
| 35070 |
if ('elements' === page && !elementor.userCan('design')) { |
| 35071 |
if (pages.page_settings) { |
| 35072 |
page = 'page_settings'; |
| 35073 |
} |
| 35074 |
} |
| 35075 |
|
| 35076 |
var pageData = pages[page]; |
| 35077 |
|
| 35078 |
if (!pageData) { |
| 35079 |
throw new ReferenceError('Elementor panel doesn\'t have page named \'' + page + '\''); |
| 35080 |
} |
| 35081 |
|
| 35082 |
if (pageData.options) { |
| 35083 |
viewOptions = _.extend(pageData.options, viewOptions); |
| 35084 |
} |
| 35085 |
|
| 35086 |
var View = pageData.view; |
| 35087 |
|
| 35088 |
if (pageData.getView) { |
| 35089 |
View = pageData.getView(); |
| 35090 |
} |
| 35091 |
|
| 35092 |
this.currentPageName = page; |
| 35093 |
this.currentPageView = new View(viewOptions); |
| 35094 |
this.showChildView('content', this.currentPageView); |
| 35095 |
this.getHeaderView().setTitle(title || pageData.title); |
| 35096 |
this.trigger('set:page', this.currentPageView).trigger('set:page:' + page, this.currentPageView); |
| 35097 |
|
| 35098 |
if (elementor.promotion.dialog) { |
| 35099 |
elementor.promotion.dialog.hide(); |
| 35100 |
} |
| 35101 |
|
| 35102 |
return this.currentPageView; |
| 35103 |
}, |
| 35104 |
onBeforeShow: function onBeforeShow() { |
| 35105 |
var PanelFooterItemView = __webpack_require__(628), |
| 35106 |
PanelHeaderItemView = __webpack_require__(629); // Edit Mode |
| 35107 |
|
| 35108 |
|
| 35109 |
this.showChildView('modeSwitcher', new EditModeItemView()); // Header |
| 35110 |
|
| 35111 |
this.showChildView('header', new PanelHeaderItemView()); // Footer |
| 35112 |
|
| 35113 |
this.showChildView('footer', new PanelFooterItemView()); // Added Editor events |
| 35114 |
|
| 35115 |
this.updateScrollbar = _.throttle(this.updateScrollbar, 100); |
| 35116 |
this.getRegion('content').on('before:show', this.onEditorBeforeShow.bind(this)).on('empty', this.onEditorEmpty.bind(this)).on('show', this.updateScrollbar.bind(this)); |
| 35117 |
}, |
| 35118 |
onEditorBeforeShow: function onEditorBeforeShow() { |
| 35119 |
_.defer(this.updateScrollbar.bind(this)); |
| 35120 |
}, |
| 35121 |
onEditorEmpty: function onEditorEmpty() { |
| 35122 |
this.updateScrollbar(); |
| 35123 |
}, |
| 35124 |
updateScrollbar: function updateScrollbar() { |
| 35125 |
if (!this.perfectScrollbar) { |
| 35126 |
this.perfectScrollbar = new PerfectScrollbar(this.content.el, { |
| 35127 |
suppressScrollX: true |
| 35128 |
}); // The RTL is buggy, so always keep it LTR. |
| 35129 |
|
| 35130 |
this.perfectScrollbar.isRtl = false; |
| 35131 |
return; |
| 35132 |
} |
| 35133 |
|
| 35134 |
this.perfectScrollbar.update(); |
| 35135 |
} |
| 35136 |
}); |
| 35137 |
module.exports = PanelLayoutView; |
| 35138 |
|
| 35139 |
/***/ }), |
| 35140 |
/* 599 */ |
| 35141 |
/***/ (function(module, exports, __webpack_require__) { |
| 35142 |
|
| 35143 |
"use strict"; |
| 35144 |
|
| 35145 |
|
| 35146 |
var _interopRequireWildcard = __webpack_require__(36); |
| 35147 |
|
| 35148 |
var _interopRequireDefault = __webpack_require__(0); |
| 35149 |
|
| 35150 |
var _Object$defineProperty = __webpack_require__(1); |
| 35151 |
|
| 35152 |
_Object$defineProperty(exports, "__esModule", { |
| 35153 |
value: true |
| 35154 |
}); |
| 35155 |
|
| 35156 |
exports.default = void 0; |
| 35157 |
|
| 35158 |
var _classCallCheck2 = _interopRequireDefault(__webpack_require__(2)); |
| 35159 |
|
| 35160 |
var _createClass2 = _interopRequireDefault(__webpack_require__(3)); |
| 35161 |
|
| 35162 |
var _inherits2 = _interopRequireDefault(__webpack_require__(4)); |
| 35163 |
|
| 35164 |
var _createSuper2 = _interopRequireDefault(__webpack_require__(5)); |
| 35165 |
|
| 35166 |
var _componentBase = _interopRequireDefault(__webpack_require__(85)); |
| 35167 |
|
| 35168 |
var commands = _interopRequireWildcard(__webpack_require__(600)); |
| 35169 |
|
| 35170 |
var commandsInternal = _interopRequireWildcard(__webpack_require__(608)); |
| 35171 |
|
| 35172 |
var Component = /*#__PURE__*/function (_ComponentBase) { |
| 35173 |
(0, _inherits2.default)(Component, _ComponentBase); |
| 35174 |
|
| 35175 |
var _super = (0, _createSuper2.default)(Component); |
| 35176 |
|
| 35177 |
function Component() { |
| 35178 |
(0, _classCallCheck2.default)(this, Component); |
| 35179 |
return _super.apply(this, arguments); |
| 35180 |
} |
| 35181 |
|
| 35182 |
(0, _createClass2.default)(Component, [{ |
| 35183 |
key: "getNamespace", |
| 35184 |
value: function getNamespace() { |
| 35185 |
return 'panel'; |
| 35186 |
} |
| 35187 |
}, { |
| 35188 |
key: "defaultRoutes", |
| 35189 |
value: function defaultRoutes() { |
| 35190 |
var _this = this; |
| 35191 |
|
| 35192 |
return { |
| 35193 |
menu: function menu() { |
| 35194 |
return _this.manager.setPage('menu'); |
| 35195 |
}, |
| 35196 |
'global-colors': function globalColors() { |
| 35197 |
return _this.manager.setPage('colorScheme'); |
| 35198 |
}, |
| 35199 |
'global-fonts': function globalFonts() { |
| 35200 |
return _this.manager.setPage('typographyScheme'); |
| 35201 |
}, |
| 35202 |
'editor-preferences': function editorPreferences() { |
| 35203 |
return _this.manager.setPage('editorPreferences_settings').activateTab('settings'); |
| 35204 |
} |
| 35205 |
}; |
| 35206 |
} |
| 35207 |
}, { |
| 35208 |
key: "defaultCommandsInternal", |
| 35209 |
value: function defaultCommandsInternal() { |
| 35210 |
return this.importCommands(commandsInternal); |
| 35211 |
} |
| 35212 |
}, { |
| 35213 |
key: "defaultCommands", |
| 35214 |
value: function defaultCommands() { |
| 35215 |
return this.importCommands(commands); |
| 35216 |
} |
| 35217 |
}, { |
| 35218 |
key: "defaultShortcuts", |
| 35219 |
value: function defaultShortcuts() { |
| 35220 |
return { |
| 35221 |
toggle: { |
| 35222 |
keys: 'ctrl+p' |
| 35223 |
}, |
| 35224 |
save: { |
| 35225 |
keys: 'ctrl+s' |
| 35226 |
}, |
| 35227 |
exit: { |
| 35228 |
keys: 'esc', |
| 35229 |
// TODO: replace dependency with scopes. |
| 35230 |
dependency: function dependency() { |
| 35231 |
return !jQuery('.dialog-widget:visible').length; |
| 35232 |
}, |
| 35233 |
scopes: ['panel', 'preview'] |
| 35234 |
}, |
| 35235 |
'change-device-mode': { |
| 35236 |
keys: 'ctrl+shift+m' |
| 35237 |
} |
| 35238 |
}; |
| 35239 |
} |
| 35240 |
}]); |
| 35241 |
return Component; |
| 35242 |
}(_componentBase.default); |
| 35243 |
|
| 35244 |
exports.default = Component; |
| 35245 |
|
| 35246 |
/***/ }), |
| 35247 |
/* 600 */ |
| 35248 |
/***/ (function(module, exports, __webpack_require__) { |
| 35249 |
|
| 35250 |
"use strict"; |
| 35251 |
|
| 35252 |
|
| 35253 |
var _Object$defineProperty = __webpack_require__(1); |
| 35254 |
|
| 35255 |
_Object$defineProperty(exports, "__esModule", { |
| 35256 |
value: true |
| 35257 |
}); |
| 35258 |
|
| 35259 |
_Object$defineProperty(exports, "ChangeDeviceMode", { |
| 35260 |
enumerable: true, |
| 35261 |
get: function get() { |
| 35262 |
return _changeDeviceMode.ChangeDeviceMode; |
| 35263 |
} |
| 35264 |
}); |
| 35265 |
|
| 35266 |
_Object$defineProperty(exports, "Close", { |
| 35267 |
enumerable: true, |
| 35268 |
get: function get() { |
| 35269 |
return _close.Close; |
| 35270 |
} |
| 35271 |
}); |
| 35272 |
|
| 35273 |
_Object$defineProperty(exports, "Exit", { |
| 35274 |
enumerable: true, |
| 35275 |
get: function get() { |
| 35276 |
return _exit.Exit; |
| 35277 |
} |
| 35278 |
}); |
| 35279 |
|
| 35280 |
_Object$defineProperty(exports, "Open", { |
| 35281 |
enumerable: true, |
| 35282 |
get: function get() { |
| 35283 |
return _open.Open; |
| 35284 |
} |
| 35285 |
}); |
| 35286 |
|
| 35287 |
_Object$defineProperty(exports, "Publish", { |
| 35288 |
enumerable: true, |
| 35289 |
get: function get() { |
| 35290 |
return _publish.Publish; |
| 35291 |
} |
| 35292 |
}); |
| 35293 |
|
| 35294 |
_Object$defineProperty(exports, "Save", { |
| 35295 |
enumerable: true, |
| 35296 |
get: function get() { |
| 35297 |
return _save.Save; |
| 35298 |
} |
| 35299 |
}); |
| 35300 |
|
| 35301 |
_Object$defineProperty(exports, "Toggle", { |
| 35302 |
enumerable: true, |
| 35303 |
get: function get() { |
| 35304 |
return _toggle.Toggle; |
| 35305 |
} |
| 35306 |
}); |
| 35307 |
|
| 35308 |
var _changeDeviceMode = __webpack_require__(601); |
| 35309 |
|
| 35310 |
var _close = __webpack_require__(602); |
| 35311 |
|
| 35312 |
var _exit = __webpack_require__(603); |
| 35313 |
|
| 35314 |
var _open = __webpack_require__(604); |
| 35315 |
|
| 35316 |
var _publish = __webpack_require__(605); |
| 35317 |
|
| 35318 |
var _save = __webpack_require__(606); |
| 35319 |
|
| 35320 |
var _toggle = __webpack_require__(607); |
| 35321 |
|
| 35322 |
/***/ }), |
| 35323 |
/* 601 */ |
| 35324 |
/***/ (function(module, exports, __webpack_require__) { |
| 35325 |
|
| 35326 |
"use strict"; |
| 35327 |
|
| 35328 |
|
| 35329 |
var _interopRequireDefault = __webpack_require__(0); |
| 35330 |
|
| 35331 |
var _Object$defineProperty = __webpack_require__(1); |
| 35332 |
|
| 35333 |
_Object$defineProperty(exports, "__esModule", { |
| 35334 |
value: true |
| 35335 |
}); |
| 35336 |
|
| 35337 |
exports.default = exports.ChangeDeviceMode = void 0; |
| 35338 |
|
| 35339 |
var _classCallCheck2 = _interopRequireDefault(__webpack_require__(2)); |
| 35340 |
|
| 35341 |
var _createClass2 = _interopRequireDefault(__webpack_require__(3)); |
| 35342 |
|
| 35343 |
var _inherits2 = _interopRequireDefault(__webpack_require__(4)); |
| 35344 |
|
| 35345 |
var _createSuper2 = _interopRequireDefault(__webpack_require__(5)); |
| 35346 |
|
| 35347 |
var _commandBase = _interopRequireDefault(__webpack_require__(21)); |
| 35348 |
|
| 35349 |
var ChangeDeviceMode = /*#__PURE__*/function (_CommandBase) { |
| 35350 |
(0, _inherits2.default)(ChangeDeviceMode, _CommandBase); |
| 35351 |
|
| 35352 |
var _super = (0, _createSuper2.default)(ChangeDeviceMode); |
| 35353 |
|
| 35354 |
function ChangeDeviceMode() { |
| 35355 |
(0, _classCallCheck2.default)(this, ChangeDeviceMode); |
| 35356 |
return _super.apply(this, arguments); |
| 35357 |
} |
| 35358 |
|
| 35359 |
(0, _createClass2.default)(ChangeDeviceMode, [{ |
| 35360 |
key: "apply", |
| 35361 |
value: function apply() { |
| 35362 |
var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; |
| 35363 |
var devices = ['desktop', 'tablet', 'mobile']; |
| 35364 |
var device = args.device; |
| 35365 |
|
| 35366 |
if (!device) { |
| 35367 |
var currentDeviceMode = elementor.channels.deviceMode.request('currentMode'); |
| 35368 |
var modeIndex = devices.indexOf(currentDeviceMode); |
| 35369 |
modeIndex++; |
| 35370 |
|
| 35371 |
if (modeIndex >= devices.length) { |
| 35372 |
modeIndex = 0; |
| 35373 |
} |
| 35374 |
|
| 35375 |
device = devices[modeIndex]; |
| 35376 |
} |
| 35377 |
|
| 35378 |
elementor.changeDeviceMode(device); |
| 35379 |
} |
| 35380 |
}]); |
| 35381 |
return ChangeDeviceMode; |
| 35382 |
}(_commandBase.default); |
| 35383 |
|
| 35384 |
exports.ChangeDeviceMode = ChangeDeviceMode; |
| 35385 |
var _default = ChangeDeviceMode; |
| 35386 |
exports.default = _default; |
| 35387 |
|
| 35388 |
/***/ }), |
| 35389 |
/* 602 */ |
| 35390 |
/***/ (function(module, exports, __webpack_require__) { |
| 35391 |
|
| 35392 |
"use strict"; |
| 35393 |
|
| 35394 |
|
| 35395 |
var _interopRequireDefault = __webpack_require__(0); |
| 35396 |
|
| 35397 |
var _Object$defineProperty = __webpack_require__(1); |
| 35398 |
|
| 35399 |
_Object$defineProperty(exports, "__esModule", { |
| 35400 |
value: true |
| 35401 |
}); |
| 35402 |
|
| 35403 |
exports.default = exports.Close = void 0; |
| 35404 |
|
| 35405 |
var _classCallCheck2 = _interopRequireDefault(__webpack_require__(2)); |
| 35406 |
|
| 35407 |
var _createClass2 = _interopRequireDefault(__webpack_require__(3)); |
| 35408 |
|
| 35409 |
var _inherits2 = _interopRequireDefault(__webpack_require__(4)); |
| 35410 |
|
| 35411 |
var _createSuper2 = _interopRequireDefault(__webpack_require__(5)); |
| 35412 |
|
| 35413 |
var _commandBase = _interopRequireDefault(__webpack_require__(21)); |
| 35414 |
|
| 35415 |
var Close = /*#__PURE__*/function (_CommandBase) { |
| 35416 |
(0, _inherits2.default)(Close, _CommandBase); |
| 35417 |
|
| 35418 |
var _super = (0, _createSuper2.default)(Close); |
| 35419 |
|
| 35420 |
function Close() { |
| 35421 |
(0, _classCallCheck2.default)(this, Close); |
| 35422 |
return _super.apply(this, arguments); |
| 35423 |
} |
| 35424 |
|
| 35425 |
(0, _createClass2.default)(Close, [{ |
| 35426 |
key: "apply", |
| 35427 |
value: function apply() { |
| 35428 |
elementor.changeEditMode('preview'); |
| 35429 |
} |
| 35430 |
}]); |
| 35431 |
return Close; |
| 35432 |
}(_commandBase.default); |
| 35433 |
|
| 35434 |
exports.Close = Close; |
| 35435 |
var _default = Close; |
| 35436 |
exports.default = _default; |
| 35437 |
|
| 35438 |
/***/ }), |
| 35439 |
/* 603 */ |
| 35440 |
/***/ (function(module, exports, __webpack_require__) { |
| 35441 |
|
| 35442 |
"use strict"; |
| 35443 |
|
| 35444 |
|
| 35445 |
var _interopRequireDefault = __webpack_require__(0); |
| 35446 |
|
| 35447 |
var _Object$defineProperty = __webpack_require__(1); |
| 35448 |
|
| 35449 |
_Object$defineProperty(exports, "__esModule", { |
| 35450 |
value: true |
| 35451 |
}); |
| 35452 |
|
| 35453 |
exports.default = exports.Exit = void 0; |
| 35454 |
|
| 35455 |
var _classCallCheck2 = _interopRequireDefault(__webpack_require__(2)); |
| 35456 |
|
| 35457 |
var _createClass2 = _interopRequireDefault(__webpack_require__(3)); |
| 35458 |
|
| 35459 |
var _inherits2 = _interopRequireDefault(__webpack_require__(4)); |
| 35460 |
|
| 35461 |
var _createSuper2 = _interopRequireDefault(__webpack_require__(5)); |
| 35462 |
|
| 35463 |
var _commandBase = _interopRequireDefault(__webpack_require__(21)); |
| 35464 |
|
| 35465 |
var Exit = /*#__PURE__*/function (_CommandBase) { |
| 35466 |
(0, _inherits2.default)(Exit, _CommandBase); |
| 35467 |
|
| 35468 |
var _super = (0, _createSuper2.default)(Exit); |
| 35469 |
|
| 35470 |
function Exit() { |
| 35471 |
(0, _classCallCheck2.default)(this, Exit); |
| 35472 |
return _super.apply(this, arguments); |
| 35473 |
} |
| 35474 |
|
| 35475 |
(0, _createClass2.default)(Exit, [{ |
| 35476 |
key: "apply", |
| 35477 |
value: function apply() { |
| 35478 |
$e.route('panel/menu'); |
| 35479 |
} |
| 35480 |
}]); |
| 35481 |
return Exit; |
| 35482 |
}(_commandBase.default); |
| 35483 |
|
| 35484 |
exports.Exit = Exit; |
| 35485 |
var _default = Exit; |
| 35486 |
exports.default = _default; |
| 35487 |
|
| 35488 |
/***/ }), |
| 35489 |
/* 604 */ |
| 35490 |
/***/ (function(module, exports, __webpack_require__) { |
| 35491 |
|
| 35492 |
"use strict"; |
| 35493 |
|
| 35494 |
|
| 35495 |
var _interopRequireDefault = __webpack_require__(0); |
| 35496 |
|
| 35497 |
var _Object$defineProperty = __webpack_require__(1); |
| 35498 |
|
| 35499 |
_Object$defineProperty(exports, "__esModule", { |
| 35500 |
value: true |
| 35501 |
}); |
| 35502 |
|
| 35503 |
exports.default = exports.Open = void 0; |
| 35504 |
|
| 35505 |
var _classCallCheck2 = _interopRequireDefault(__webpack_require__(2)); |
| 35506 |
|
| 35507 |
var _createClass2 = _interopRequireDefault(__webpack_require__(3)); |
| 35508 |
|
| 35509 |
var _inherits2 = _interopRequireDefault(__webpack_require__(4)); |
| 35510 |
|
| 35511 |
var _createSuper2 = _interopRequireDefault(__webpack_require__(5)); |
| 35512 |
|
| 35513 |
var _commandBase = _interopRequireDefault(__webpack_require__(21)); |
| 35514 |
|
| 35515 |
var Open = /*#__PURE__*/function (_CommandBase) { |
| 35516 |
(0, _inherits2.default)(Open, _CommandBase); |
| 35517 |
|
| 35518 |
var _super = (0, _createSuper2.default)(Open); |
| 35519 |
|
| 35520 |
function Open() { |
| 35521 |
(0, _classCallCheck2.default)(this, Open); |
| 35522 |
return _super.apply(this, arguments); |
| 35523 |
} |
| 35524 |
|
| 35525 |
(0, _createClass2.default)(Open, [{ |
| 35526 |
key: "apply", |
| 35527 |
value: function apply() { |
| 35528 |
elementor.changeEditMode('edit'); |
| 35529 |
} |
| 35530 |
}]); |
| 35531 |
return Open; |
| 35532 |
}(_commandBase.default); |
| 35533 |
|
| 35534 |
exports.Open = Open; |
| 35535 |
var _default = Open; |
| 35536 |
exports.default = _default; |
| 35537 |
|
| 35538 |
/***/ }), |
| 35539 |
/* 605 */ |
| 35540 |
/***/ (function(module, exports, __webpack_require__) { |
| 35541 |
|
| 35542 |
"use strict"; |
| 35543 |
|
| 35544 |
|
| 35545 |
var _interopRequireDefault = __webpack_require__(0); |
| 35546 |
|
| 35547 |
var _Object$defineProperty = __webpack_require__(1); |
| 35548 |
|
| 35549 |
_Object$defineProperty(exports, "__esModule", { |
| 35550 |
value: true |
| 35551 |
}); |
| 35552 |
|
| 35553 |
exports.default = exports.Publish = void 0; |
| 35554 |
|
| 35555 |
var _classCallCheck2 = _interopRequireDefault(__webpack_require__(2)); |
| 35556 |
|
| 35557 |
var _createClass2 = _interopRequireDefault(__webpack_require__(3)); |
| 35558 |
|
| 35559 |
var _inherits2 = _interopRequireDefault(__webpack_require__(4)); |
| 35560 |
|
| 35561 |
var _createSuper2 = _interopRequireDefault(__webpack_require__(5)); |
| 35562 |
|
| 35563 |
var _commandBase = _interopRequireDefault(__webpack_require__(21)); |
| 35564 |
|
| 35565 |
var Publish = /*#__PURE__*/function (_CommandBase) { |
| 35566 |
(0, _inherits2.default)(Publish, _CommandBase); |
| 35567 |
|
| 35568 |
var _super = (0, _createSuper2.default)(Publish); |
| 35569 |
|
| 35570 |
function Publish() { |
| 35571 |
(0, _classCallCheck2.default)(this, Publish); |
| 35572 |
return _super.apply(this, arguments); |
| 35573 |
} |
| 35574 |
|
| 35575 |
(0, _createClass2.default)(Publish, [{ |
| 35576 |
key: "apply", |
| 35577 |
value: function apply() { |
| 35578 |
$e.run('document/save/publish'); |
| 35579 |
} |
| 35580 |
}]); |
| 35581 |
return Publish; |
| 35582 |
}(_commandBase.default); |
| 35583 |
|
| 35584 |
exports.Publish = Publish; |
| 35585 |
var _default = Publish; |
| 35586 |
exports.default = _default; |
| 35587 |
|
| 35588 |
/***/ }), |
| 35589 |
/* 606 */ |
| 35590 |
/***/ (function(module, exports, __webpack_require__) { |
| 35591 |
|
| 35592 |
"use strict"; |
| 35593 |
|
| 35594 |
|
| 35595 |
var _interopRequireDefault = __webpack_require__(0); |
| 35596 |
|
| 35597 |
var _Object$defineProperty = __webpack_require__(1); |
| 35598 |
|
| 35599 |
_Object$defineProperty(exports, "__esModule", { |
| 35600 |
value: true |
| 35601 |
}); |
| 35602 |
|
| 35603 |
exports.default = exports.Save = void 0; |
| 35604 |
|
| 35605 |
var _classCallCheck2 = _interopRequireDefault(__webpack_require__(2)); |
| 35606 |
|
| 35607 |
var _createClass2 = _interopRequireDefault(__webpack_require__(3)); |
| 35608 |
|
| 35609 |
var _inherits2 = _interopRequireDefault(__webpack_require__(4)); |
| 35610 |
|
| 35611 |
var _createSuper2 = _interopRequireDefault(__webpack_require__(5)); |
| 35612 |
|
| 35613 |
var _commandBase = _interopRequireDefault(__webpack_require__(21)); |
| 35614 |
|
| 35615 |
var Save = /*#__PURE__*/function (_CommandBase) { |
| 35616 |
(0, _inherits2.default)(Save, _CommandBase); |
| 35617 |
|
| 35618 |
var _super = (0, _createSuper2.default)(Save); |
| 35619 |
|
| 35620 |
function Save() { |
| 35621 |
(0, _classCallCheck2.default)(this, Save); |
| 35622 |
return _super.apply(this, arguments); |
| 35623 |
} |
| 35624 |
|
| 35625 |
(0, _createClass2.default)(Save, [{ |
| 35626 |
key: "apply", |
| 35627 |
value: function apply() { |
| 35628 |
$e.run('document/save/draft'); |
| 35629 |
} |
| 35630 |
}]); |
| 35631 |
return Save; |
| 35632 |
}(_commandBase.default); |
| 35633 |
|
| 35634 |
exports.Save = Save; |
| 35635 |
var _default = Save; |
| 35636 |
exports.default = _default; |
| 35637 |
|
| 35638 |
/***/ }), |
| 35639 |
/* 607 */ |
| 35640 |
/***/ (function(module, exports, __webpack_require__) { |
| 35641 |
|
| 35642 |
"use strict"; |
| 35643 |
|
| 35644 |
|
| 35645 |
var _interopRequireDefault = __webpack_require__(0); |
| 35646 |
|
| 35647 |
var _Object$defineProperty = __webpack_require__(1); |
| 35648 |
|
| 35649 |
_Object$defineProperty(exports, "__esModule", { |
| 35650 |
value: true |
| 35651 |
}); |
| 35652 |
|
| 35653 |
exports.default = exports.Toggle = void 0; |
| 35654 |
|
| 35655 |
var _classCallCheck2 = _interopRequireDefault(__webpack_require__(2)); |
| 35656 |
|
| 35657 |
var _createClass2 = _interopRequireDefault(__webpack_require__(3)); |
| 35658 |
|
| 35659 |
var _inherits2 = _interopRequireDefault(__webpack_require__(4)); |
| 35660 |
|
| 35661 |
var _createSuper2 = _interopRequireDefault(__webpack_require__(5)); |
| 35662 |
|
| 35663 |
var _commandBase = _interopRequireDefault(__webpack_require__(21)); |
| 35664 |
|
| 35665 |
var Toggle = /*#__PURE__*/function (_CommandBase) { |
| 35666 |
(0, _inherits2.default)(Toggle, _CommandBase); |
| 35667 |
|
| 35668 |
var _super = (0, _createSuper2.default)(Toggle); |
| 35669 |
|
| 35670 |
function Toggle() { |
| 35671 |
(0, _classCallCheck2.default)(this, Toggle); |
| 35672 |
return _super.apply(this, arguments); |
| 35673 |
} |
| 35674 |
|
| 35675 |
(0, _createClass2.default)(Toggle, [{ |
| 35676 |
key: "apply", |
| 35677 |
value: function apply() { |
| 35678 |
elementor.getPanelView().modeSwitcher.currentView.toggleMode(); |
| 35679 |
} |
| 35680 |
}]); |
| 35681 |
return Toggle; |
| 35682 |
}(_commandBase.default); |
| 35683 |
|
| 35684 |
exports.Toggle = Toggle; |
| 35685 |
var _default = Toggle; |
| 35686 |
exports.default = _default; |
| 35687 |
|
| 35688 |
/***/ }), |
| 35689 |
/* 608 */ |
| 35690 |
/***/ (function(module, exports, __webpack_require__) { |
| 35691 |
|
| 35692 |
"use strict"; |
| 35693 |
|
| 35694 |
|
| 35695 |
var _Object$defineProperty = __webpack_require__(1); |
| 35696 |
|
| 35697 |
_Object$defineProperty(exports, "__esModule", { |
| 35698 |
value: true |
| 35699 |
}); |
| 35700 |
|
| 35701 |
_Object$defineProperty(exports, "OpenDefault", { |
| 35702 |
enumerable: true, |
| 35703 |
get: function get() { |
| 35704 |
return _openDefault.OpenDefault; |
| 35705 |
} |
| 35706 |
}); |
| 35707 |
|
| 35708 |
_Object$defineProperty(exports, "StateLoading", { |
| 35709 |
enumerable: true, |
| 35710 |
get: function get() { |
| 35711 |
return _stateLoading.StateLoading; |
| 35712 |
} |
| 35713 |
}); |
| 35714 |
|
| 35715 |
_Object$defineProperty(exports, "StateReady", { |
| 35716 |
enumerable: true, |
| 35717 |
get: function get() { |
| 35718 |
return _stateReady.StateReady; |
| 35719 |
} |
| 35720 |
}); |
| 35721 |
|
| 35722 |
var _openDefault = __webpack_require__(609); |
| 35723 |
|
| 35724 |
var _stateLoading = __webpack_require__(610); |
| 35725 |
|
| 35726 |
var _stateReady = __webpack_require__(611); |
| 35727 |
|
| 35728 |
/***/ }), |
| 35729 |
/* 609 */ |
| 35730 |
/***/ (function(module, exports, __webpack_require__) { |
| 35731 |
|
| 35732 |
"use strict"; |
| 35733 |
|
| 35734 |
|
| 35735 |
var _interopRequireDefault = __webpack_require__(0); |
| 35736 |
|
| 35737 |
var _Object$defineProperty = __webpack_require__(1); |
| 35738 |
|
| 35739 |
_Object$defineProperty(exports, "__esModule", { |
| 35740 |
value: true |
| 35741 |
}); |
| 35742 |
|
| 35743 |
exports.default = exports.OpenDefault = void 0; |
| 35744 |
|
| 35745 |
var _classCallCheck2 = _interopRequireDefault(__webpack_require__(2)); |
| 35746 |
|
| 35747 |
var _createClass2 = _interopRequireDefault(__webpack_require__(3)); |
| 35748 |
|
| 35749 |
var _inherits2 = _interopRequireDefault(__webpack_require__(4)); |
| 35750 |
|
| 35751 |
var _createSuper2 = _interopRequireDefault(__webpack_require__(5)); |
| 35752 |
|
| 35753 |
var _commandInternalBase = _interopRequireDefault(__webpack_require__(203)); |
| 35754 |
|
| 35755 |
var OpenDefault = /*#__PURE__*/function (_CommandInternalBase) { |
| 35756 |
(0, _inherits2.default)(OpenDefault, _CommandInternalBase); |
| 35757 |
|
| 35758 |
var _super = (0, _createSuper2.default)(OpenDefault); |
| 35759 |
|
| 35760 |
function OpenDefault() { |
| 35761 |
(0, _classCallCheck2.default)(this, OpenDefault); |
| 35762 |
return _super.apply(this, arguments); |
| 35763 |
} |
| 35764 |
|
| 35765 |
(0, _createClass2.default)(OpenDefault, [{ |
| 35766 |
key: "apply", |
| 35767 |
value: function apply() { |
| 35768 |
$e.route(elementor.documents.getCurrent().config.panel.default_route); |
| 35769 |
} |
| 35770 |
}]); |
| 35771 |
return OpenDefault; |
| 35772 |
}(_commandInternalBase.default); |
| 35773 |
|
| 35774 |
exports.OpenDefault = OpenDefault; |
| 35775 |
var _default = OpenDefault; |
| 35776 |
exports.default = _default; |
| 35777 |
|
| 35778 |
/***/ }), |
| 35779 |
/* 610 */ |
| 35780 |
/***/ (function(module, exports, __webpack_require__) { |
| 35781 |
|
| 35782 |
"use strict"; |
| 35783 |
|
| 35784 |
|
| 35785 |
var _interopRequireDefault = __webpack_require__(0); |
| 35786 |
|
| 35787 |
var _Object$defineProperty = __webpack_require__(1); |
| 35788 |
|
| 35789 |
_Object$defineProperty(exports, "__esModule", { |
| 35790 |
value: true |
| 35791 |
}); |
| 35792 |
|
| 35793 |
exports.default = exports.StateLoading = void 0; |
| 35794 |
|
| 35795 |
var _classCallCheck2 = _interopRequireDefault(__webpack_require__(2)); |
| 35796 |
|
| 35797 |
var _createClass2 = _interopRequireDefault(__webpack_require__(3)); |
| 35798 |
|
| 35799 |
var _inherits2 = _interopRequireDefault(__webpack_require__(4)); |
| 35800 |
|
| 35801 |
var _createSuper2 = _interopRequireDefault(__webpack_require__(5)); |
| 35802 |
|
| 35803 |
var _commandInternalBase = _interopRequireDefault(__webpack_require__(203)); |
| 35804 |
|
| 35805 |
var StateLoading = /*#__PURE__*/function (_CommandInternalBase) { |
| 35806 |
(0, _inherits2.default)(StateLoading, _CommandInternalBase); |
| 35807 |
|
| 35808 |
var _super = (0, _createSuper2.default)(StateLoading); |
| 35809 |
|
| 35810 |
function StateLoading() { |
| 35811 |
(0, _classCallCheck2.default)(this, StateLoading); |
| 35812 |
return _super.apply(this, arguments); |
| 35813 |
} |
| 35814 |
|
| 35815 |
(0, _createClass2.default)(StateLoading, [{ |
| 35816 |
key: "apply", |
| 35817 |
value: function apply() { |
| 35818 |
elementorCommon.elements.$body.addClass('elementor-panel-loading'); |
| 35819 |
} |
| 35820 |
}]); |
| 35821 |
return StateLoading; |
| 35822 |
}(_commandInternalBase.default); |
| 35823 |
|
| 35824 |
exports.StateLoading = StateLoading; |
| 35825 |
var _default = StateLoading; |
| 35826 |
exports.default = _default; |
| 35827 |
|
| 35828 |
/***/ }), |
| 35829 |
/* 611 */ |
| 35830 |
/***/ (function(module, exports, __webpack_require__) { |
| 35831 |
|
| 35832 |
"use strict"; |
| 35833 |
|
| 35834 |
|
| 35835 |
var _interopRequireDefault = __webpack_require__(0); |
| 35836 |
|
| 35837 |
var _Object$defineProperty = __webpack_require__(1); |
| 35838 |
|
| 35839 |
_Object$defineProperty(exports, "__esModule", { |
| 35840 |
value: true |
| 35841 |
}); |
| 35842 |
|
| 35843 |
exports.default = exports.StateReady = void 0; |
| 35844 |
|
| 35845 |
var _classCallCheck2 = _interopRequireDefault(__webpack_require__(2)); |
| 35846 |
|
| 35847 |
var _createClass2 = _interopRequireDefault(__webpack_require__(3)); |
| 35848 |
|
| 35849 |
var _inherits2 = _interopRequireDefault(__webpack_require__(4)); |
| 35850 |
|
| 35851 |
var _createSuper2 = _interopRequireDefault(__webpack_require__(5)); |
| 35852 |
|
| 35853 |
var _commandInternalBase = _interopRequireDefault(__webpack_require__(203)); |
| 35854 |
|
| 35855 |
var StateReady = /*#__PURE__*/function (_CommandInternalBase) { |
| 35856 |
(0, _inherits2.default)(StateReady, _CommandInternalBase); |
| 35857 |
|
| 35858 |
var _super = (0, _createSuper2.default)(StateReady); |
| 35859 |
|
| 35860 |
function StateReady() { |
| 35861 |
(0, _classCallCheck2.default)(this, StateReady); |
| 35862 |
return _super.apply(this, arguments); |
| 35863 |
} |
| 35864 |
|
| 35865 |
(0, _createClass2.default)(StateReady, [{ |
| 35866 |
key: "apply", |
| 35867 |
value: function apply() { |
| 35868 |
elementorCommon.elements.$body.removeClass('elementor-panel-loading'); |
| 35869 |
} |
| 35870 |
}]); |
| 35871 |
return StateReady; |
| 35872 |
}(_commandInternalBase.default); |
| 35873 |
|
| 35874 |
exports.StateReady = StateReady; |
| 35875 |
var _default = StateReady; |
| 35876 |
exports.default = _default; |
| 35877 |
|
| 35878 |
/***/ }), |
| 35879 |
/* 612 */ |
| 35880 |
/***/ (function(module, exports, __webpack_require__) { |
| 35881 |
|
| 35882 |
"use strict"; |
| 35883 |
|
| 35884 |
|
| 35885 |
var _interopRequireDefault = __webpack_require__(0); |
| 35886 |
|
| 35887 |
var _Object$defineProperty = __webpack_require__(1); |
| 35888 |
|
| 35889 |
_Object$defineProperty(exports, "__esModule", { |
| 35890 |
value: true |
| 35891 |
}); |
| 35892 |
|
| 35893 |
exports.default = void 0; |
| 35894 |
|
| 35895 |
var _classCallCheck2 = _interopRequireDefault(__webpack_require__(2)); |
| 35896 |
|
| 35897 |
var _createClass2 = _interopRequireDefault(__webpack_require__(3)); |
| 35898 |
|
| 35899 |
var _inherits2 = _interopRequireDefault(__webpack_require__(4)); |
| 35900 |
|
| 35901 |
var _createSuper2 = _interopRequireDefault(__webpack_require__(5)); |
| 35902 |
|
| 35903 |
var _componentBase = _interopRequireDefault(__webpack_require__(85)); |
| 35904 |
|
| 35905 |
var Component = /*#__PURE__*/function (_ComponentBase) { |
| 35906 |
(0, _inherits2.default)(Component, _ComponentBase); |
| 35907 |
|
| 35908 |
var _super = (0, _createSuper2.default)(Component); |
| 35909 |
|
| 35910 |
function Component() { |
| 35911 |
(0, _classCallCheck2.default)(this, Component); |
| 35912 |
return _super.apply(this, arguments); |
| 35913 |
} |
| 35914 |
|
| 35915 |
(0, _createClass2.default)(Component, [{ |
| 35916 |
key: "getNamespace", |
| 35917 |
value: function getNamespace() { |
| 35918 |
return 'panel/elements'; |
| 35919 |
} |
| 35920 |
}, { |
| 35921 |
key: "defaultTabs", |
| 35922 |
value: function defaultTabs() { |
| 35923 |
return { |
| 35924 |
categories: { |
| 35925 |
title: elementor.translate('elements') |
| 35926 |
}, |
| 35927 |
global: { |
| 35928 |
title: elementor.translate('global') |
| 35929 |
} |
| 35930 |
}; |
| 35931 |
} |
| 35932 |
}, { |
| 35933 |
key: "getTabsWrapperSelector", |
| 35934 |
value: function getTabsWrapperSelector() { |
| 35935 |
return '#elementor-panel-elements-navigation'; |
| 35936 |
} |
| 35937 |
}, { |
| 35938 |
key: "renderTab", |
| 35939 |
value: function renderTab(tab) { |
| 35940 |
this.manager.setPage('elements').showView(tab); |
| 35941 |
} |
| 35942 |
}]); |
| 35943 |
return Component; |
| 35944 |
}(_componentBase.default); |
| 35945 |
|
| 35946 |
exports.default = Component; |
| 35947 |
|
| 35948 |
/***/ }), |
| 35949 |
/* 613 */ |
| 35950 |
/***/ (function(module, exports, __webpack_require__) { |
| 35951 |
|
| 35952 |
"use strict"; |
| 35953 |
|
| 35954 |
|
| 35955 |
var _interopRequireWildcard = __webpack_require__(36); |
| 35956 |
|
| 35957 |
var _interopRequireDefault = __webpack_require__(0); |
| 35958 |
|
| 35959 |
var _Object$defineProperty = __webpack_require__(1); |
| 35960 |
|
| 35961 |
_Object$defineProperty(exports, "__esModule", { |
| 35962 |
value: true |
| 35963 |
}); |
| 35964 |
|
| 35965 |
exports.default = void 0; |
| 35966 |
|
| 35967 |
var _keys = _interopRequireDefault(__webpack_require__(23)); |
| 35968 |
|
| 35969 |
var _classCallCheck2 = _interopRequireDefault(__webpack_require__(2)); |
| 35970 |
|
| 35971 |
var _createClass2 = _interopRequireDefault(__webpack_require__(3)); |
| 35972 |
|
| 35973 |
var _get2 = _interopRequireDefault(__webpack_require__(26)); |
| 35974 |
|
| 35975 |
var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(16)); |
| 35976 |
|
| 35977 |
var _inherits2 = _interopRequireDefault(__webpack_require__(4)); |
| 35978 |
|
| 35979 |
var _createSuper2 = _interopRequireDefault(__webpack_require__(5)); |
| 35980 |
|
| 35981 |
var _componentBase = _interopRequireDefault(__webpack_require__(85)); |
| 35982 |
|
| 35983 |
var commands = _interopRequireWildcard(__webpack_require__(614)); |
| 35984 |
|
| 35985 |
var Component = /*#__PURE__*/function (_ComponentBase) { |
| 35986 |
(0, _inherits2.default)(Component, _ComponentBase); |
| 35987 |
|
| 35988 |
var _super = (0, _createSuper2.default)(Component); |
| 35989 |
|
| 35990 |
function Component() { |
| 35991 |
(0, _classCallCheck2.default)(this, Component); |
| 35992 |
return _super.apply(this, arguments); |
| 35993 |
} |
| 35994 |
|
| 35995 |
(0, _createClass2.default)(Component, [{ |
| 35996 |
key: "__construct", |
| 35997 |
value: function __construct(args) { |
| 35998 |
(0, _get2.default)((0, _getPrototypeOf2.default)(Component.prototype), "__construct", this).call(this, args); // Remember last used tab. |
| 35999 |
|
| 36000 |
this.activeTabs = {}; |
| 36001 |
} |
| 36002 |
}, { |
| 36003 |
key: "getNamespace", |
| 36004 |
value: function getNamespace() { |
| 36005 |
return 'panel/editor'; |
| 36006 |
} |
| 36007 |
}, { |
| 36008 |
key: "defaultTabs", |
| 36009 |
value: function defaultTabs() { |
| 36010 |
return { |
| 36011 |
content: { |
| 36012 |
title: elementor.translate('content') |
| 36013 |
}, |
| 36014 |
style: { |
| 36015 |
title: elementor.translate('style') |
| 36016 |
}, |
| 36017 |
advanced: { |
| 36018 |
title: elementor.translate('advanced') |
| 36019 |
}, |
| 36020 |
layout: { |
| 36021 |
title: elementor.translate('layout') |
| 36022 |
} |
| 36023 |
}; |
| 36024 |
} |
| 36025 |
}, { |
| 36026 |
key: "defaultCommands", |
| 36027 |
value: function defaultCommands() { |
| 36028 |
return this.importCommands(commands); |
| 36029 |
} |
| 36030 |
}, { |
| 36031 |
key: "getTabsWrapperSelector", |
| 36032 |
value: function getTabsWrapperSelector() { |
| 36033 |
return '.elementor-panel-navigation'; |
| 36034 |
} |
| 36035 |
}, { |
| 36036 |
key: "renderTab", |
| 36037 |
value: function renderTab(tab, args) { |
| 36038 |
var model = args.model, |
| 36039 |
view = args.view, |
| 36040 |
title = elementor.translate('edit_element', [elementor.getElementData(model).title]); |
| 36041 |
elementor.getPanelView().setPage('editor', title, { |
| 36042 |
tab: tab, |
| 36043 |
model: model, |
| 36044 |
controls: elementor.getElementControls(model), |
| 36045 |
editedElementView: view |
| 36046 |
}); |
| 36047 |
} |
| 36048 |
}, { |
| 36049 |
key: "activateTab", |
| 36050 |
value: function activateTab(tab, args) { |
| 36051 |
this.activeTabs[args.model.id] = tab; |
| 36052 |
(0, _get2.default)((0, _getPrototypeOf2.default)(Component.prototype), "activateTab", this).call(this, tab, args); |
| 36053 |
} |
| 36054 |
}, { |
| 36055 |
key: "setDefaultTab", |
| 36056 |
value: function setDefaultTab(args) { |
| 36057 |
var defaultTab; |
| 36058 |
var editSettings = args.model.get('editSettings'); |
| 36059 |
|
| 36060 |
if (this.activeTabs[args.model.id]) { |
| 36061 |
defaultTab = this.activeTabs[args.model.id]; |
| 36062 |
} else if (editSettings && editSettings.get('defaultEditRoute')) { |
| 36063 |
defaultTab = editSettings.get('defaultEditRoute'); |
| 36064 |
} |
| 36065 |
|
| 36066 |
if (defaultTab) { |
| 36067 |
// Ensure tab is exist. |
| 36068 |
var controlsTabs = elementor.getElementData(args.model).tabs_controls; // Fallback to first tab. |
| 36069 |
|
| 36070 |
if (!controlsTabs[defaultTab]) { |
| 36071 |
defaultTab = (0, _keys.default)(controlsTabs)[0]; |
| 36072 |
} |
| 36073 |
|
| 36074 |
this.setDefaultRoute(defaultTab); |
| 36075 |
return true; |
| 36076 |
} |
| 36077 |
|
| 36078 |
return false; |
| 36079 |
} |
| 36080 |
}]); |
| 36081 |
return Component; |
| 36082 |
}(_componentBase.default); |
| 36083 |
|
| 36084 |
exports.default = Component; |
| 36085 |
|
| 36086 |
/***/ }), |
| 36087 |
/* 614 */ |
| 36088 |
/***/ (function(module, exports, __webpack_require__) { |
| 36089 |
|
| 36090 |
"use strict"; |
| 36091 |
|
| 36092 |
|
| 36093 |
var _Object$defineProperty = __webpack_require__(1); |
| 36094 |
|
| 36095 |
_Object$defineProperty(exports, "__esModule", { |
| 36096 |
value: true |
| 36097 |
}); |
| 36098 |
|
| 36099 |
_Object$defineProperty(exports, "Open", { |
| 36100 |
enumerable: true, |
| 36101 |
get: function get() { |
| 36102 |
return _open.Open; |
| 36103 |
} |
| 36104 |
}); |
| 36105 |
|
| 36106 |
var _open = __webpack_require__(615); |
| 36107 |
|
| 36108 |
/***/ }), |
| 36109 |
/* 615 */ |
| 36110 |
/***/ (function(module, exports, __webpack_require__) { |
| 36111 |
|
| 36112 |
"use strict"; |
| 36113 |
|
| 36114 |
|
| 36115 |
var _interopRequireDefault = __webpack_require__(0); |
| 36116 |
|
| 36117 |
var _Object$defineProperty = __webpack_require__(1); |
| 36118 |
|
| 36119 |
_Object$defineProperty(exports, "__esModule", { |
| 36120 |
value: true |
| 36121 |
}); |
| 36122 |
|
| 36123 |
exports.default = exports.Open = void 0; |
| 36124 |
|
| 36125 |
var _classCallCheck2 = _interopRequireDefault(__webpack_require__(2)); |
| 36126 |
|
| 36127 |
var _createClass2 = _interopRequireDefault(__webpack_require__(3)); |
| 36128 |
|
| 36129 |
var _inherits2 = _interopRequireDefault(__webpack_require__(4)); |
| 36130 |
|
| 36131 |
var _createSuper2 = _interopRequireDefault(__webpack_require__(5)); |
| 36132 |
|
| 36133 |
var _commandBase = _interopRequireDefault(__webpack_require__(21)); |
| 36134 |
|
| 36135 |
var Open = /*#__PURE__*/function (_CommandBase) { |
| 36136 |
(0, _inherits2.default)(Open, _CommandBase); |
| 36137 |
|
| 36138 |
var _super = (0, _createSuper2.default)(Open); |
| 36139 |
|
| 36140 |
function Open() { |
| 36141 |
(0, _classCallCheck2.default)(this, Open); |
| 36142 |
return _super.apply(this, arguments); |
| 36143 |
} |
| 36144 |
|
| 36145 |
(0, _createClass2.default)(Open, [{ |
| 36146 |
key: "apply", |
| 36147 |
value: function apply(args) { |
| 36148 |
if (!this.component.setDefaultTab(args)) { |
| 36149 |
elementorCommon.helpers.softDeprecated("model.trigger( 'request:edit' )", '2.9.0', 'editSettings.defaultEditRoute'); |
| 36150 |
args.model.trigger('request:edit'); |
| 36151 |
} else { |
| 36152 |
$e.route(this.component.getDefaultRoute(), args); |
| 36153 |
} // BC: Run hooks after the route render's the view. |
| 36154 |
|
| 36155 |
|
| 36156 |
var action = 'panel/open_editor/' + args.model.get('elType'); // Example: panel/open_editor/widget |
| 36157 |
|
| 36158 |
elementor.hooks.doAction(action, this.component.manager, args.model, args.view); // Example: panel/open_editor/widget/heading |
| 36159 |
|
| 36160 |
elementor.hooks.doAction(action + '/' + args.model.get('widgetType'), this.component.manager, args.model, args.view); |
| 36161 |
} |
| 36162 |
}]); |
| 36163 |
return Open; |
| 36164 |
}(_commandBase.default); |
| 36165 |
|
| 36166 |
exports.Open = Open; |
| 36167 |
var _default = Open; |
| 36168 |
exports.default = _default; |
| 36169 |
|
| 36170 |
/***/ }), |
| 36171 |
/* 616 */ |
| 36172 |
/***/ (function(module, exports, __webpack_require__) { |
| 36173 |
|
| 36174 |
"use strict"; |
| 36175 |
|
| 36176 |
|
| 36177 |
var EditModeItemView; |
| 36178 |
EditModeItemView = Marionette.ItemView.extend({ |
| 36179 |
template: '#tmpl-elementor-mode-switcher-content', |
| 36180 |
id: 'elementor-mode-switcher-inner', |
| 36181 |
ui: { |
| 36182 |
previewButton: '#elementor-mode-switcher-preview-input', |
| 36183 |
previewLabel: '#elementor-mode-switcher-preview', |
| 36184 |
previewLabelA11y: '#elementor-mode-switcher-preview .elementor-screen-only' |
| 36185 |
}, |
| 36186 |
events: { |
| 36187 |
'change @ui.previewButton': 'onPreviewButtonChange' |
| 36188 |
}, |
| 36189 |
initialize: function initialize() { |
| 36190 |
this.listenTo(elementor.channels.dataEditMode, 'switch', this.onEditModeChanged); |
| 36191 |
}, |
| 36192 |
getCurrentMode: function getCurrentMode() { |
| 36193 |
return this.ui.previewButton.is(':checked') ? 'preview' : 'edit'; |
| 36194 |
}, |
| 36195 |
setMode: function setMode(mode) { |
| 36196 |
this.ui.previewButton.prop('checked', 'preview' === mode).trigger('change'); |
| 36197 |
}, |
| 36198 |
toggleMode: function toggleMode() { |
| 36199 |
this.setMode(this.ui.previewButton.prop('checked') ? 'edit' : 'preview'); |
| 36200 |
}, |
| 36201 |
onRender: function onRender() { |
| 36202 |
this.onEditModeChanged(); |
| 36203 |
}, |
| 36204 |
onPreviewButtonChange: function onPreviewButtonChange() { |
| 36205 |
var mode = this.getCurrentMode(); |
| 36206 |
|
| 36207 |
if ('edit' === mode) { |
| 36208 |
$e.run('panel/open'); |
| 36209 |
} else if ('preview' === mode) { |
| 36210 |
$e.run('panel/close'); |
| 36211 |
} else { |
| 36212 |
throw Error("Invalid mode: '".concat(mode, "'")); |
| 36213 |
} |
| 36214 |
}, |
| 36215 |
onEditModeChanged: function onEditModeChanged(activeMode) { |
| 36216 |
var title = elementor.translate('preview' === activeMode ? 'back_to_editor' : 'preview'); |
| 36217 |
this.ui.previewLabel.attr('title', title); |
| 36218 |
this.ui.previewLabelA11y.text(title); |
| 36219 |
} |
| 36220 |
}); |
| 36221 |
module.exports = EditModeItemView; |
| 36222 |
|
| 36223 |
/***/ }), |
| 36224 |
/* 617 */ |
| 36225 |
/***/ (function(module, exports, __webpack_require__) { |
| 36226 |
|
| 36227 |
"use strict"; |
| 36228 |
|
| 36229 |
|
| 36230 |
__webpack_require__(39); |
| 36231 |
|
| 36232 |
__webpack_require__(334); |
| 36233 |
|
| 36234 |
var PanelElementsCategoriesCollection = __webpack_require__(618), |
| 36235 |
PanelElementsElementsCollection = __webpack_require__(390), |
| 36236 |
PanelElementsCategoriesView = __webpack_require__(619), |
| 36237 |
PanelElementsElementsView = elementor.modules.layouts.panel.pages.elements.views.Elements, |
| 36238 |
PanelElementsSearchView = __webpack_require__(621), |
| 36239 |
PanelElementsGlobalView = __webpack_require__(385), |
| 36240 |
PanelElementsLayoutView; |
| 36241 |
|
| 36242 |
PanelElementsLayoutView = Marionette.LayoutView.extend({ |
| 36243 |
template: '#tmpl-elementor-panel-elements', |
| 36244 |
id: 'elementor-panel-page-elements', |
| 36245 |
options: { |
| 36246 |
autoFocusSearch: true |
| 36247 |
}, |
| 36248 |
regions: { |
| 36249 |
elements: '#elementor-panel-elements-wrapper', |
| 36250 |
search: '#elementor-panel-elements-search-area' |
| 36251 |
}, |
| 36252 |
regionViews: {}, |
| 36253 |
elementsCollection: null, |
| 36254 |
categoriesCollection: null, |
| 36255 |
initialize: function initialize() { |
| 36256 |
this.listenTo(elementor.channels.panelElements, 'element:selected', this.destroy); |
| 36257 |
this.initElementsCollection(); |
| 36258 |
this.initCategoriesCollection(); |
| 36259 |
this.initRegionViews(); |
| 36260 |
}, |
| 36261 |
initRegionViews: function initRegionViews() { |
| 36262 |
var regionViews = { |
| 36263 |
elements: { |
| 36264 |
region: this.elements, |
| 36265 |
view: PanelElementsElementsView, |
| 36266 |
options: { |
| 36267 |
collection: this.elementsCollection |
| 36268 |
} |
| 36269 |
}, |
| 36270 |
categories: { |
| 36271 |
region: this.elements, |
| 36272 |
view: PanelElementsCategoriesView, |
| 36273 |
options: { |
| 36274 |
collection: this.categoriesCollection |
| 36275 |
} |
| 36276 |
}, |
| 36277 |
search: { |
| 36278 |
region: this.search, |
| 36279 |
view: PanelElementsSearchView |
| 36280 |
}, |
| 36281 |
global: { |
| 36282 |
region: this.elements, |
| 36283 |
view: PanelElementsGlobalView |
| 36284 |
} |
| 36285 |
}; |
| 36286 |
this.regionViews = elementor.hooks.applyFilters('panel/elements/regionViews', regionViews); |
| 36287 |
}, |
| 36288 |
initElementsCollection: function initElementsCollection() { |
| 36289 |
var elementsCollection = new PanelElementsElementsCollection(), |
| 36290 |
sectionConfig = elementor.config.elements.section; |
| 36291 |
elementsCollection.add({ |
| 36292 |
title: elementor.translate('inner_section'), |
| 36293 |
elType: 'section', |
| 36294 |
categories: ['basic'], |
| 36295 |
keywords: ['row', 'columns', 'nested'], |
| 36296 |
icon: sectionConfig.icon |
| 36297 |
}); // TODO: Change the array from server syntax, and no need each loop for initialize |
| 36298 |
|
| 36299 |
_.each(elementor.widgetsCache, function (widget) { |
| 36300 |
if (elementor.config.document.panel.widgets_settings[widget.widget_type]) { |
| 36301 |
widget = _.extend(widget, elementor.config.document.panel.widgets_settings[widget.widget_type]); |
| 36302 |
} |
| 36303 |
|
| 36304 |
if (!widget.show_in_panel) { |
| 36305 |
return; |
| 36306 |
} |
| 36307 |
|
| 36308 |
elementsCollection.add({ |
| 36309 |
title: widget.title, |
| 36310 |
elType: widget.elType, |
| 36311 |
categories: widget.categories, |
| 36312 |
keywords: widget.keywords, |
| 36313 |
icon: widget.icon, |
| 36314 |
widgetType: widget.widget_type, |
| 36315 |
custom: widget.custom, |
| 36316 |
editable: widget.editable |
| 36317 |
}); |
| 36318 |
}); |
| 36319 |
|
| 36320 |
jQuery.each(elementor.config.promotionWidgets, function (index, widget) { |
| 36321 |
elementsCollection.add({ |
| 36322 |
name: widget.name, |
| 36323 |
title: widget.title, |
| 36324 |
icon: widget.icon, |
| 36325 |
categories: JSON.parse(widget.categories), |
| 36326 |
editable: false |
| 36327 |
}); |
| 36328 |
}); |
| 36329 |
this.elementsCollection = elementsCollection; |
| 36330 |
}, |
| 36331 |
initCategoriesCollection: function initCategoriesCollection() { |
| 36332 |
var categories = {}; |
| 36333 |
this.elementsCollection.each(function (element) { |
| 36334 |
_.each(element.get('categories'), function (category) { |
| 36335 |
if (!categories[category]) { |
| 36336 |
categories[category] = []; |
| 36337 |
} |
| 36338 |
|
| 36339 |
categories[category].push(element); |
| 36340 |
}); |
| 36341 |
}); |
| 36342 |
var categoriesCollection = new PanelElementsCategoriesCollection(); |
| 36343 |
|
| 36344 |
_.each(elementor.config.document.panel.elements_categories, function (categoryConfig, categoryName) { |
| 36345 |
if (!categories[categoryName]) { |
| 36346 |
return; |
| 36347 |
} // Set defaults. |
| 36348 |
|
| 36349 |
|
| 36350 |
if ('undefined' === typeof categoryConfig.active) { |
| 36351 |
categoryConfig.active = true; |
| 36352 |
} |
| 36353 |
|
| 36354 |
if ('undefined' === typeof categoryConfig.icon) { |
| 36355 |
categoryConfig.icon = 'font'; |
| 36356 |
} |
| 36357 |
|
| 36358 |
categoriesCollection.add({ |
| 36359 |
name: categoryName, |
| 36360 |
title: categoryConfig.title, |
| 36361 |
icon: categoryConfig.icon, |
| 36362 |
defaultActive: categoryConfig.active, |
| 36363 |
items: categories[categoryName] |
| 36364 |
}); |
| 36365 |
}); |
| 36366 |
|
| 36367 |
this.categoriesCollection = categoriesCollection; |
| 36368 |
}, |
| 36369 |
showView: function showView(viewName) { |
| 36370 |
var viewDetails = this.regionViews[viewName], |
| 36371 |
options = viewDetails.options || {}; |
| 36372 |
viewDetails.region.show(new viewDetails.view(options)); |
| 36373 |
}, |
| 36374 |
clearSearchInput: function clearSearchInput() { |
| 36375 |
this.getChildView('search').clearInput(); |
| 36376 |
}, |
| 36377 |
changeFilter: function changeFilter(filterValue) { |
| 36378 |
elementor.channels.panelElements.reply('filter:value', filterValue).trigger('filter:change'); |
| 36379 |
}, |
| 36380 |
clearFilters: function clearFilters() { |
| 36381 |
this.changeFilter(null); |
| 36382 |
this.clearSearchInput(); |
| 36383 |
}, |
| 36384 |
focusSearch: function focusSearch() { |
| 36385 |
if (!elementor.userCan('design') || !this.search |
| 36386 |
/* default panel is not elements */ |
| 36387 |
|| !this.search.currentView |
| 36388 |
/* on global elements empty */ |
| 36389 |
) { |
| 36390 |
return; |
| 36391 |
} |
| 36392 |
|
| 36393 |
this.search.currentView.ui.input.focus(); |
| 36394 |
}, |
| 36395 |
onChildviewChildrenRender: function onChildviewChildrenRender() { |
| 36396 |
elementor.getPanelView().updateScrollbar(); |
| 36397 |
}, |
| 36398 |
onChildviewSearchChangeInput: function onChildviewSearchChangeInput(child) { |
| 36399 |
this.changeFilter(child.ui.input.val(), 'search'); |
| 36400 |
}, |
| 36401 |
onDestroy: function onDestroy() { |
| 36402 |
elementor.channels.panelElements.reply('filter:value', null); |
| 36403 |
}, |
| 36404 |
onShow: function onShow() { |
| 36405 |
this.showView('search'); |
| 36406 |
|
| 36407 |
if (this.options.autoFocusSearch) { |
| 36408 |
setTimeout(this.focusSearch.bind(this)); |
| 36409 |
} |
| 36410 |
} |
| 36411 |
}); |
| 36412 |
module.exports = PanelElementsLayoutView; |
| 36413 |
|
| 36414 |
/***/ }), |
| 36415 |
/* 618 */ |
| 36416 |
/***/ (function(module, exports, __webpack_require__) { |
| 36417 |
|
| 36418 |
"use strict"; |
| 36419 |
|
| 36420 |
|
| 36421 |
var PanelElementsCategory = __webpack_require__(389), |
| 36422 |
PanelElementsCategoriesCollection; |
| 36423 |
|
| 36424 |
PanelElementsCategoriesCollection = Backbone.Collection.extend({ |
| 36425 |
model: PanelElementsCategory |
| 36426 |
}); |
| 36427 |
module.exports = PanelElementsCategoriesCollection; |
| 36428 |
|
| 36429 |
/***/ }), |
| 36430 |
/* 619 */ |
| 36431 |
/***/ (function(module, exports, __webpack_require__) { |
| 36432 |
|
| 36433 |
"use strict"; |
| 36434 |
|
| 36435 |
|
| 36436 |
var PanelElementsCategoryView = __webpack_require__(620), |
| 36437 |
PanelElementsCategoriesView; |
| 36438 |
|
| 36439 |
PanelElementsCategoriesView = Marionette.CompositeView.extend({ |
| 36440 |
template: '#tmpl-elementor-panel-categories', |
| 36441 |
childView: PanelElementsCategoryView, |
| 36442 |
childViewContainer: '#elementor-panel-categories', |
| 36443 |
id: 'elementor-panel-elements-categories', |
| 36444 |
initialize: function initialize() { |
| 36445 |
this.listenTo(elementor.channels.panelElements, 'filter:change', this.onPanelElementsFilterChange); |
| 36446 |
}, |
| 36447 |
onPanelElementsFilterChange: function onPanelElementsFilterChange() { |
| 36448 |
if (elementor.channels.panelElements.request('filter:value')) { |
| 36449 |
elementor.getPanelView().getCurrentPageView().showView('elements'); |
| 36450 |
} |
| 36451 |
} |
| 36452 |
}); |
| 36453 |
module.exports = PanelElementsCategoriesView; |
| 36454 |
|
| 36455 |
/***/ }), |
| 36456 |
/* 620 */ |
| 36457 |
/***/ (function(module, exports, __webpack_require__) { |
| 36458 |
|
| 36459 |
"use strict"; |
| 36460 |
|
| 36461 |
|
| 36462 |
var PanelElementsElementsCollection = __webpack_require__(390), |
| 36463 |
PanelElementsCategoryView; |
| 36464 |
|
| 36465 |
PanelElementsCategoryView = Marionette.CompositeView.extend({ |
| 36466 |
template: '#tmpl-elementor-panel-elements-category', |
| 36467 |
className: 'elementor-panel-category', |
| 36468 |
ui: { |
| 36469 |
title: '.elementor-panel-category-title', |
| 36470 |
items: '.elementor-panel-category-items' |
| 36471 |
}, |
| 36472 |
events: { |
| 36473 |
'click @ui.title': 'onTitleClick' |
| 36474 |
}, |
| 36475 |
id: function id() { |
| 36476 |
return 'elementor-panel-category-' + this.model.get('name'); |
| 36477 |
}, |
| 36478 |
childView: __webpack_require__(387), |
| 36479 |
childViewContainer: '.elementor-panel-category-items', |
| 36480 |
initialize: function initialize() { |
| 36481 |
this.collection = new PanelElementsElementsCollection(this.model.get('items')); |
| 36482 |
}, |
| 36483 |
onRender: function onRender() { |
| 36484 |
var isActive = elementor.channels.panelElements.request('category:' + this.model.get('name') + ':active'); |
| 36485 |
|
| 36486 |
if (undefined === isActive) { |
| 36487 |
isActive = this.model.get('defaultActive'); |
| 36488 |
} |
| 36489 |
|
| 36490 |
if (isActive) { |
| 36491 |
this.$el.addClass('elementor-active'); |
| 36492 |
this.ui.items.show(); |
| 36493 |
} |
| 36494 |
}, |
| 36495 |
onTitleClick: function onTitleClick() { |
| 36496 |
var $items = this.ui.items, |
| 36497 |
activeClass = 'elementor-active', |
| 36498 |
isActive = this.$el.hasClass(activeClass), |
| 36499 |
slideFn = isActive ? 'slideUp' : 'slideDown'; |
| 36500 |
elementor.channels.panelElements.reply('category:' + this.model.get('name') + ':active', !isActive); |
| 36501 |
this.$el.toggleClass(activeClass, !isActive); |
| 36502 |
$items[slideFn](300, function () { |
| 36503 |
elementor.getPanelView().updateScrollbar(); |
| 36504 |
}); |
| 36505 |
} |
| 36506 |
}); |
| 36507 |
module.exports = PanelElementsCategoryView; |
| 36508 |
|
| 36509 |
/***/ }), |
| 36510 |
/* 621 */ |
| 36511 |
/***/ (function(module, exports, __webpack_require__) { |
| 36512 |
|
| 36513 |
"use strict"; |
| 36514 |
|
| 36515 |
|
| 36516 |
var PanelElementsSearchView; |
| 36517 |
PanelElementsSearchView = Marionette.ItemView.extend({ |
| 36518 |
template: '#tmpl-elementor-panel-element-search', |
| 36519 |
id: 'elementor-panel-elements-search-wrapper', |
| 36520 |
ui: { |
| 36521 |
input: 'input' |
| 36522 |
}, |
| 36523 |
events: { |
| 36524 |
'input @ui.input': 'onInputChanged' |
| 36525 |
}, |
| 36526 |
clearInput: function clearInput() { |
| 36527 |
this.ui.input.val(''); |
| 36528 |
}, |
| 36529 |
onInputChanged: function onInputChanged(event) { |
| 36530 |
var ESC_KEY = 27; |
| 36531 |
|
| 36532 |
if (ESC_KEY === event.keyCode) { |
| 36533 |
this.clearInput(); |
| 36534 |
} |
| 36535 |
|
| 36536 |
this.triggerMethod('search:change:input'); |
| 36537 |
} |
| 36538 |
}); |
| 36539 |
module.exports = PanelElementsSearchView; |
| 36540 |
|
| 36541 |
/***/ }), |
| 36542 |
/* 622 */ |
| 36543 |
/***/ (function(module, exports, __webpack_require__) { |
| 36544 |
|
| 36545 |
"use strict"; |
| 36546 |
|
| 36547 |
|
| 36548 |
var ControlsStack = elementorModules.editor.views.ControlsStack, |
| 36549 |
EditorView; |
| 36550 |
EditorView = ControlsStack.extend({ |
| 36551 |
template: Marionette.TemplateCache.get('#tmpl-editor-content'), |
| 36552 |
id: 'elementor-panel-page-editor', |
| 36553 |
childViewContainer: '#elementor-controls', |
| 36554 |
childViewOptions: function childViewOptions() { |
| 36555 |
return { |
| 36556 |
element: this.getOption('editedElementView'), |
| 36557 |
container: this.getOption('editedElementView').getContainer(), |
| 36558 |
// TODO: elementSettingsModel is deprecated since 2.8.0. |
| 36559 |
elementSettingsModel: this.model.get('settings'), |
| 36560 |
elementEditSettings: this.model.get('editSettings') |
| 36561 |
}; |
| 36562 |
}, |
| 36563 |
getNamespaceArray: function getNamespaceArray() { |
| 36564 |
var eventNamespace = elementorModules.editor.views.ControlsStack.prototype.getNamespaceArray(); |
| 36565 |
var model = this.getOption('editedElementView').getEditModel(), |
| 36566 |
currentElementType = model.get('elType'); // Element Type: section / column / widget. |
| 36567 |
|
| 36568 |
eventNamespace.push(currentElementType); |
| 36569 |
|
| 36570 |
if ('widget' === currentElementType) { |
| 36571 |
// Widget Type: heading / button and etc. |
| 36572 |
eventNamespace.push(model.get('widgetType')); |
| 36573 |
} |
| 36574 |
|
| 36575 |
return eventNamespace; |
| 36576 |
}, |
| 36577 |
initialize: function initialize() { |
| 36578 |
ControlsStack.prototype.initialize.apply(this, arguments); |
| 36579 |
var editSettings = this.model.get('editSettings'); |
| 36580 |
|
| 36581 |
if (editSettings) { |
| 36582 |
var panelSettings = editSettings.get('panel'); |
| 36583 |
|
| 36584 |
if (panelSettings) { |
| 36585 |
this.activeTab = panelSettings.activeTab; |
| 36586 |
this.activeSection = panelSettings.activeSection; |
| 36587 |
} |
| 36588 |
} |
| 36589 |
}, |
| 36590 |
activateSection: function activateSection() { |
| 36591 |
ControlsStack.prototype.activateSection.apply(this, arguments); |
| 36592 |
this.model.get('editSettings').set('panel', { |
| 36593 |
activeTab: this.activeTab, |
| 36594 |
activeSection: this.activeSection |
| 36595 |
}); |
| 36596 |
return this; |
| 36597 |
}, |
| 36598 |
openActiveSection: function openActiveSection() { |
| 36599 |
ControlsStack.prototype.openActiveSection.apply(this, arguments); |
| 36600 |
elementor.channels.editor.trigger('section:activated', this.activeSection, this); |
| 36601 |
}, |
| 36602 |
isVisibleSectionControl: function isVisibleSectionControl(sectionControlModel) { |
| 36603 |
return ControlsStack.prototype.isVisibleSectionControl.apply(this, arguments) && elementor.helpers.isActiveControl(sectionControlModel, this.model.get('settings').attributes); |
| 36604 |
}, |
| 36605 |
scrollToEditedElement: function scrollToEditedElement() { |
| 36606 |
elementor.helpers.scrollToView(this.getOption('editedElementView').$el); |
| 36607 |
}, |
| 36608 |
onDestroy: function onDestroy() { |
| 36609 |
var editedElementView = this.getOption('editedElementView'); |
| 36610 |
|
| 36611 |
if (editedElementView) { |
| 36612 |
editedElementView.$el.removeClass('elementor-element-editable'); |
| 36613 |
} |
| 36614 |
|
| 36615 |
this.model.trigger('editor:close'); |
| 36616 |
this.triggerMethod('editor:destroy'); |
| 36617 |
}, |
| 36618 |
onRender: function onRender() { |
| 36619 |
var editedElementView = this.getOption('editedElementView'); |
| 36620 |
|
| 36621 |
if (editedElementView) { |
| 36622 |
editedElementView.$el.addClass('elementor-element-editable'); |
| 36623 |
} |
| 36624 |
}, |
| 36625 |
onDeviceModeChange: function onDeviceModeChange() { |
| 36626 |
ControlsStack.prototype.onDeviceModeChange.apply(this, arguments); |
| 36627 |
this.scrollToEditedElement(); |
| 36628 |
}, |
| 36629 |
onChildviewSettingsChange: function onChildviewSettingsChange(childView) { |
| 36630 |
var editedElementView = this.getOption('editedElementView'), |
| 36631 |
editedElementType = editedElementView.model.get('elType'); |
| 36632 |
|
| 36633 |
if ('widget' === editedElementType) { |
| 36634 |
editedElementType = editedElementView.model.get('widgetType'); |
| 36635 |
} |
| 36636 |
|
| 36637 |
elementor.channels.editor.trigger('change', childView, editedElementView).trigger('change:' + editedElementType, childView, editedElementView).trigger('change:' + editedElementType + ':' + childView.model.get('name'), childView, editedElementView); |
| 36638 |
} |
| 36639 |
}); |
| 36640 |
module.exports = EditorView; |
| 36641 |
|
| 36642 |
/***/ }), |
| 36643 |
/* 623 */ |
| 36644 |
/***/ (function(module, exports, __webpack_require__) { |
| 36645 |
|
| 36646 |
"use strict"; |
| 36647 |
|
| 36648 |
|
| 36649 |
var PanelSchemeBaseView = __webpack_require__(391), |
| 36650 |
PanelSchemeColorsView; |
| 36651 |
|
| 36652 |
PanelSchemeColorsView = PanelSchemeBaseView.extend({ |
| 36653 |
ui: function ui() { |
| 36654 |
var ui = PanelSchemeBaseView.prototype.ui.apply(this, arguments); |
| 36655 |
ui.systemSchemes = '.elementor-panel-scheme-color-system-scheme'; |
| 36656 |
return ui; |
| 36657 |
}, |
| 36658 |
events: function events() { |
| 36659 |
var events = PanelSchemeBaseView.prototype.events.apply(this, arguments); |
| 36660 |
events['click @ui.systemSchemes'] = 'onSystemSchemeClick'; |
| 36661 |
return events; |
| 36662 |
}, |
| 36663 |
getType: function getType() { |
| 36664 |
return 'color'; |
| 36665 |
}, |
| 36666 |
onSystemSchemeClick: function onSystemSchemeClick(event) { |
| 36667 |
var $schemeClicked = jQuery(event.currentTarget), |
| 36668 |
schemeName = $schemeClicked.data('schemeName'), |
| 36669 |
scheme = elementor.config.system_schemes[this.getType()][schemeName].items; |
| 36670 |
this.changeChildrenUIValues(scheme); |
| 36671 |
} |
| 36672 |
}); |
| 36673 |
module.exports = PanelSchemeColorsView; |
| 36674 |
|
| 36675 |
/***/ }), |
| 36676 |
/* 624 */ |
| 36677 |
/***/ (function(module, exports, __webpack_require__) { |
| 36678 |
|
| 36679 |
"use strict"; |
| 36680 |
|
| 36681 |
|
| 36682 |
var _interopRequireDefault = __webpack_require__(0); |
| 36683 |
|
| 36684 |
var _colorPicker = _interopRequireDefault(__webpack_require__(301)); |
| 36685 |
|
| 36686 |
var PanelSchemeItemView = __webpack_require__(392); |
| 36687 |
|
| 36688 |
module.exports = PanelSchemeItemView.extend({ |
| 36689 |
getUIType: function getUIType() { |
| 36690 |
return 'color'; |
| 36691 |
}, |
| 36692 |
ui: { |
| 36693 |
pickerPlaceholder: '.elementor-panel-scheme-color-picker-placeholder' |
| 36694 |
}, |
| 36695 |
changeUIValue: function changeUIValue(newValue) { |
| 36696 |
this.colorPicker.picker.setColor(newValue); |
| 36697 |
}, |
| 36698 |
onRender: function onRender() { |
| 36699 |
var _this = this; |
| 36700 |
|
| 36701 |
this.colorPicker = new _colorPicker.default({ |
| 36702 |
picker: { |
| 36703 |
el: this.ui.pickerPlaceholder[0], |
| 36704 |
default: this.model.get('value') |
| 36705 |
}, |
| 36706 |
onChange: function onChange() { |
| 36707 |
_this.triggerMethod('value:change', _this.colorPicker.getColor()); |
| 36708 |
}, |
| 36709 |
onClear: function onClear() { |
| 36710 |
_this.triggerMethod('value:change', ''); |
| 36711 |
} |
| 36712 |
}); |
| 36713 |
}, |
| 36714 |
onBeforeDestroy: function onBeforeDestroy() { |
| 36715 |
this.colorPicker.destroy(); |
| 36716 |
} |
| 36717 |
}); |
| 36718 |
|
| 36719 |
/***/ }), |
| 36720 |
/* 625 */ |
| 36721 |
/***/ (function(module, exports, __webpack_require__) { |
| 36722 |
|
| 36723 |
"use strict"; |
| 36724 |
|
| 36725 |
|
| 36726 |
var PanelSchemeItemView = __webpack_require__(392), |
| 36727 |
PanelSchemeTypographyView; |
| 36728 |
|
| 36729 |
PanelSchemeTypographyView = PanelSchemeItemView.extend({ |
| 36730 |
getUIType: function getUIType() { |
| 36731 |
return 'typography'; |
| 36732 |
}, |
| 36733 |
className: function className() { |
| 36734 |
var classes = PanelSchemeItemView.prototype.className.apply(this, arguments); |
| 36735 |
return classes + ' elementor-panel-box'; |
| 36736 |
}, |
| 36737 |
ui: { |
| 36738 |
heading: '.elementor-panel-heading', |
| 36739 |
allFields: '.elementor-panel-scheme-typography-item-field', |
| 36740 |
inputFields: 'input.elementor-panel-scheme-typography-item-field', |
| 36741 |
selectFields: 'select.elementor-panel-scheme-typography-item-field', |
| 36742 |
selectFamilyFields: 'select.elementor-panel-scheme-typography-item-field[name="font_family"]' |
| 36743 |
}, |
| 36744 |
events: { |
| 36745 |
'input @ui.inputFields': 'onFieldChange', |
| 36746 |
'change @ui.selectFields': 'onFieldChange', |
| 36747 |
'click @ui.heading': 'toggleVisibility' |
| 36748 |
}, |
| 36749 |
onRender: function onRender() { |
| 36750 |
var self = this; |
| 36751 |
this.ui.inputFields.add(this.ui.selectFields).each(function () { |
| 36752 |
var $this = jQuery(this), |
| 36753 |
name = $this.attr('name'), |
| 36754 |
value = self.model.get('value')[name]; |
| 36755 |
$this.val(value); |
| 36756 |
}); |
| 36757 |
this.ui.selectFamilyFields.select2({ |
| 36758 |
dir: elementorCommon.config.isRTL ? 'rtl' : 'ltr' |
| 36759 |
}); |
| 36760 |
}, |
| 36761 |
toggleVisibility: function toggleVisibility() { |
| 36762 |
this.$el.toggleClass('elementor-open'); |
| 36763 |
}, |
| 36764 |
changeUIValue: function changeUIValue(newValue) { |
| 36765 |
this.ui.allFields.each(function () { |
| 36766 |
var $this = jQuery(this), |
| 36767 |
thisName = $this.attr('name'), |
| 36768 |
newFieldValue = newValue[thisName]; |
| 36769 |
$this.val(newFieldValue).trigger('change'); |
| 36770 |
}); |
| 36771 |
}, |
| 36772 |
onFieldChange: function onFieldChange() { |
| 36773 |
var currentValue = elementor.schemes.getSchemeValue('typography', this.model.get('key')).value; |
| 36774 |
this.triggerMethod('value:change', currentValue); |
| 36775 |
} |
| 36776 |
}); |
| 36777 |
module.exports = PanelSchemeTypographyView; |
| 36778 |
|
| 36779 |
/***/ }), |
| 36780 |
/* 626 */ |
| 36781 |
/***/ (function(module, exports, __webpack_require__) { |
| 36782 |
|
| 36783 |
"use strict"; |
| 36784 |
|
| 36785 |
|
| 36786 |
var PanelSchemeBaseView = __webpack_require__(391), |
| 36787 |
PanelSchemeTypographyView; |
| 36788 |
|
| 36789 |
PanelSchemeTypographyView = PanelSchemeBaseView.extend({ |
| 36790 |
getType: function getType() { |
| 36791 |
return 'typography'; |
| 36792 |
} |
| 36793 |
}); |
| 36794 |
module.exports = PanelSchemeTypographyView; |
| 36795 |
|
| 36796 |
/***/ }), |
| 36797 |
/* 627 */ |
| 36798 |
/***/ (function(module, exports, __webpack_require__) { |
| 36799 |
|
| 36800 |
"use strict"; |
| 36801 |
|
| 36802 |
|
| 36803 |
var PanelSchemeDisabledView; |
| 36804 |
PanelSchemeDisabledView = Marionette.ItemView.extend({ |
| 36805 |
template: '#tmpl-elementor-panel-schemes-disabled', |
| 36806 |
id: 'elementor-panel-schemes-disabled', |
| 36807 |
className: 'elementor-nerd-box', |
| 36808 |
disabledTitle: '', |
| 36809 |
templateHelpers: function templateHelpers() { |
| 36810 |
return { |
| 36811 |
disabledTitle: this.disabledTitle |
| 36812 |
}; |
| 36813 |
} |
| 36814 |
}); |
| 36815 |
module.exports = PanelSchemeDisabledView; |
| 36816 |
|
| 36817 |
/***/ }), |
| 36818 |
/* 628 */ |
| 36819 |
/***/ (function(module, exports, __webpack_require__) { |
| 36820 |
|
| 36821 |
"use strict"; |
| 36822 |
|
| 36823 |
|
| 36824 |
__webpack_require__(25); |
| 36825 |
|
| 36826 |
__webpack_require__(39); |
| 36827 |
|
| 36828 |
module.exports = Marionette.ItemView.extend({ |
| 36829 |
template: '#tmpl-elementor-panel-footer-content', |
| 36830 |
tagName: 'nav', |
| 36831 |
id: 'elementor-panel-footer-tools', |
| 36832 |
possibleRotateModes: ['portrait', 'landscape'], |
| 36833 |
ui: { |
| 36834 |
menuButtons: '.elementor-panel-footer-tool', |
| 36835 |
settings: '#elementor-panel-footer-settings', |
| 36836 |
deviceModeIcon: '#elementor-panel-footer-responsive > i', |
| 36837 |
deviceModeButtons: '#elementor-panel-footer-responsive .elementor-panel-footer-sub-menu-item', |
| 36838 |
saveTemplate: '#elementor-panel-footer-sub-menu-item-save-template', |
| 36839 |
history: '#elementor-panel-footer-history', |
| 36840 |
navigator: '#elementor-panel-footer-navigator' |
| 36841 |
}, |
| 36842 |
events: { |
| 36843 |
'click @ui.menuButtons': 'onMenuButtonsClick', |
| 36844 |
'click @ui.settings': 'onSettingsClick', |
| 36845 |
'click @ui.deviceModeButtons': 'onResponsiveButtonsClick', |
| 36846 |
'click @ui.saveTemplate': 'onSaveTemplateClick', |
| 36847 |
'click @ui.history': 'onHistoryClick', |
| 36848 |
'click @ui.navigator': 'onNavigatorClick' |
| 36849 |
}, |
| 36850 |
behaviors: function behaviors() { |
| 36851 |
var behaviors = { |
| 36852 |
saver: { |
| 36853 |
behaviorClass: elementor.modules.components.saver.behaviors.FooterSaver |
| 36854 |
} |
| 36855 |
}; |
| 36856 |
return elementor.hooks.applyFilters('panel/footer/behaviors', behaviors, this); |
| 36857 |
}, |
| 36858 |
initialize: function initialize() { |
| 36859 |
this.listenTo(elementor.channels.deviceMode, 'change', this.onDeviceModeChange); |
| 36860 |
}, |
| 36861 |
getDeviceModeButton: function getDeviceModeButton(deviceMode) { |
| 36862 |
return this.ui.deviceModeButtons.filter('[data-device-mode="' + deviceMode + '"]'); |
| 36863 |
}, |
| 36864 |
addSubMenuItem: function addSubMenuItem(subMenuName, itemData) { |
| 36865 |
var $newItem = jQuery('<div>', { |
| 36866 |
id: 'elementor-panel-footer-sub-menu-item-' + itemData.name, |
| 36867 |
class: 'elementor-panel-footer-sub-menu-item' |
| 36868 |
}), |
| 36869 |
$itemIcon = jQuery('<i>', { |
| 36870 |
class: 'elementor-icon ' + itemData.icon, |
| 36871 |
'aria-hidden': true |
| 36872 |
}), |
| 36873 |
$itemTitle = jQuery('<div>', { |
| 36874 |
class: 'elementor-title' |
| 36875 |
}).text(itemData.title); |
| 36876 |
$newItem.append($itemIcon, $itemTitle); |
| 36877 |
|
| 36878 |
if (itemData.description) { |
| 36879 |
var $itemDescription = jQuery('<div>', { |
| 36880 |
class: 'elementor-description' |
| 36881 |
}).text(itemData.description); |
| 36882 |
$newItem.append($itemDescription); |
| 36883 |
} |
| 36884 |
|
| 36885 |
if (itemData.callback) { |
| 36886 |
$newItem.on('click', itemData.callback); |
| 36887 |
} |
| 36888 |
|
| 36889 |
var $menuTool = this.ui.menuButtons.filter('#elementor-panel-footer-' + subMenuName); |
| 36890 |
|
| 36891 |
if (itemData.before) { |
| 36892 |
var $beforeItem = $menuTool.find('#elementor-panel-footer-sub-menu-item-' + itemData.before); |
| 36893 |
|
| 36894 |
if ($beforeItem.length) { |
| 36895 |
return $newItem.insertBefore($beforeItem); |
| 36896 |
} |
| 36897 |
} |
| 36898 |
|
| 36899 |
var $subMenu = $menuTool.find('.elementor-panel-footer-sub-menu'); |
| 36900 |
return $newItem.appendTo($subMenu); |
| 36901 |
}, |
| 36902 |
removeSubMenuItem: function removeSubMenuItem(subMenuName, itemData) { |
| 36903 |
var $item = jQuery('#elementor-panel-footer-sub-menu-item-' + itemData.name); |
| 36904 |
return $item.remove(); |
| 36905 |
}, |
| 36906 |
showSettingsPage: function showSettingsPage() { |
| 36907 |
$e.route('panel/page-settings/settings'); |
| 36908 |
}, |
| 36909 |
onMenuButtonsClick: function onMenuButtonsClick(event) { |
| 36910 |
var $tool = jQuery(event.currentTarget); // If the tool is not toggleable or the click is inside of a tool |
| 36911 |
|
| 36912 |
if (!$tool.hasClass('elementor-toggle-state') || jQuery(event.target).closest('.elementor-panel-footer-sub-menu-item').length) { |
| 36913 |
return; |
| 36914 |
} |
| 36915 |
|
| 36916 |
var isOpen = $tool.hasClass('elementor-open'); |
| 36917 |
this.ui.menuButtons.not('.elementor-leave-open').removeClass('elementor-open'); |
| 36918 |
|
| 36919 |
if (!isOpen) { |
| 36920 |
$tool.addClass('elementor-open'); |
| 36921 |
} |
| 36922 |
}, |
| 36923 |
onSettingsClick: function onSettingsClick() { |
| 36924 |
$e.route('panel/page-settings/settings'); |
| 36925 |
}, |
| 36926 |
onDeviceModeChange: function onDeviceModeChange() { |
| 36927 |
var previousDeviceMode = elementor.channels.deviceMode.request('previousMode'), |
| 36928 |
currentDeviceMode = elementor.channels.deviceMode.request('currentMode'); |
| 36929 |
this.getDeviceModeButton(previousDeviceMode).removeClass('active'); |
| 36930 |
this.getDeviceModeButton(currentDeviceMode).addClass('active'); // Change the footer icon |
| 36931 |
|
| 36932 |
this.ui.deviceModeIcon.removeClass('eicon-device-' + previousDeviceMode).addClass('eicon-device-' + currentDeviceMode); |
| 36933 |
}, |
| 36934 |
onResponsiveButtonsClick: function onResponsiveButtonsClick(event) { |
| 36935 |
var $clickedButton = this.$(event.currentTarget), |
| 36936 |
newDeviceMode = $clickedButton.data('device-mode'); |
| 36937 |
elementor.changeDeviceMode(newDeviceMode); |
| 36938 |
}, |
| 36939 |
onSaveTemplateClick: function onSaveTemplateClick() { |
| 36940 |
$e.route('library/save-template'); |
| 36941 |
}, |
| 36942 |
onHistoryClick: function onHistoryClick() { |
| 36943 |
$e.route('panel/history/actions'); |
| 36944 |
}, |
| 36945 |
onNavigatorClick: function onNavigatorClick() { |
| 36946 |
$e.run('navigator/toggle'); |
| 36947 |
} |
| 36948 |
}); |
| 36949 |
|
| 36950 |
/***/ }), |
| 36951 |
/* 629 */ |
| 36952 |
/***/ (function(module, exports, __webpack_require__) { |
| 36953 |
|
| 36954 |
"use strict"; |
| 36955 |
|
| 36956 |
|
| 36957 |
var PanelHeaderItemView; |
| 36958 |
PanelHeaderItemView = Marionette.ItemView.extend({ |
| 36959 |
template: '#tmpl-elementor-panel-header', |
| 36960 |
id: 'elementor-panel-header', |
| 36961 |
ui: { |
| 36962 |
menuButton: '#elementor-panel-header-menu-button', |
| 36963 |
menuIcon: '#elementor-panel-header-menu-button i', |
| 36964 |
title: '#elementor-panel-header-title', |
| 36965 |
addButton: '#elementor-panel-header-add-button' |
| 36966 |
}, |
| 36967 |
events: { |
| 36968 |
'click @ui.addButton': 'onClickAdd', |
| 36969 |
'click @ui.menuButton': 'onClickMenu' |
| 36970 |
}, |
| 36971 |
behaviors: function behaviors() { |
| 36972 |
return elementor.hooks.applyFilters('panel/header/behaviors', {}, this); |
| 36973 |
}, |
| 36974 |
setTitle: function setTitle(title) { |
| 36975 |
this.ui.title.html(title); |
| 36976 |
}, |
| 36977 |
onClickAdd: function onClickAdd() { |
| 36978 |
$e.route('panel/elements/categories'); |
| 36979 |
}, |
| 36980 |
onClickMenu: function onClickMenu() { |
| 36981 |
if ($e.routes.is('panel/menu')) { |
| 36982 |
$e.route('panel/elements/categories'); |
| 36983 |
} else { |
| 36984 |
$e.route('panel/menu'); |
| 36985 |
} |
| 36986 |
} |
| 36987 |
}); |
| 36988 |
module.exports = PanelHeaderItemView; |
| 36989 |
|
| 36990 |
/***/ }), |
| 36991 |
/* 630 */, |
| 36992 |
/* 631 */, |
| 36993 |
/* 632 */, |
| 36994 |
/* 633 */, |
| 36995 |
/* 634 */, |
| 36996 |
/* 635 */, |
| 36997 |
/* 636 */, |
| 36998 |
/* 637 */, |
| 36999 |
/* 638 */, |
| 37000 |
/* 639 */, |
| 37001 |
/* 640 */, |
| 37002 |
/* 641 */, |
| 37003 |
/* 642 */, |
| 37004 |
/* 643 */, |
| 37005 |
/* 644 */, |
| 37006 |
/* 645 */, |
| 37007 |
/* 646 */, |
| 37008 |
/* 647 */, |
| 37009 |
/* 648 */, |
| 37010 |
/* 649 */, |
| 37011 |
/* 650 */, |
| 37012 |
/* 651 */, |
| 37013 |
/* 652 */, |
| 37014 |
/* 653 */, |
| 37015 |
/* 654 */, |
| 37016 |
/* 655 */, |
| 37017 |
/* 656 */, |
| 37018 |
/* 657 */, |
| 37019 |
/* 658 */, |
| 37020 |
/* 659 */, |
| 37021 |
/* 660 */, |
| 37022 |
/* 661 */, |
| 37023 |
/* 662 */, |
| 37024 |
/* 663 */, |
| 37025 |
/* 664 */, |
| 37026 |
/* 665 */, |
| 37027 |
/* 666 */, |
| 37028 |
/* 667 */, |
| 37029 |
/* 668 */, |
| 37030 |
/* 669 */, |
| 37031 |
/* 670 */, |
| 37032 |
/* 671 */, |
| 37033 |
/* 672 */, |
| 37034 |
/* 673 */, |
| 37035 |
/* 674 */, |
| 37036 |
/* 675 */, |
| 37037 |
/* 676 */, |
| 37038 |
/* 677 */, |
| 37039 |
/* 678 */, |
| 37040 |
/* 679 */, |
| 37041 |
/* 680 */, |
| 37042 |
/* 681 */, |
| 37043 |
/* 682 */, |
| 37044 |
/* 683 */, |
| 37045 |
/* 684 */, |
| 37046 |
/* 685 */, |
| 37047 |
/* 686 */, |
| 37048 |
/* 687 */, |
| 37049 |
/* 688 */, |
| 37050 |
/* 689 */, |
| 37051 |
/* 690 */, |
| 37052 |
/* 691 */, |
| 37053 |
/* 692 */, |
| 37054 |
/* 693 */, |
| 37055 |
/* 694 */, |
| 37056 |
/* 695 */, |
| 37057 |
/* 696 */, |
| 37058 |
/* 697 */, |
| 37059 |
/* 698 */, |
| 37060 |
/* 699 */, |
| 37061 |
/* 700 */, |
| 37062 |
/* 701 */, |
| 37063 |
/* 702 */, |
| 37064 |
/* 703 */, |
| 37065 |
/* 704 */, |
| 37066 |
/* 705 */, |
| 37067 |
/* 706 */, |
| 37068 |
/* 707 */, |
| 37069 |
/* 708 */ |
| 37070 |
/***/ (function(module, exports, __webpack_require__) { |
| 37071 |
|
| 37072 |
__webpack_require__(709); |
| 37073 |
__webpack_require__(710); |
| 37074 |
module.exports = __webpack_require__(711); |
| 37075 |
|
| 37076 |
|
| 37077 |
/***/ }), |
| 37078 |
/* 709 */ |
| 37079 |
/***/ (function(module, exports, __webpack_require__) { |
| 37080 |
|
| 37081 |
"use strict"; |
| 37082 |
|
| 37083 |
|
| 37084 |
__webpack_require__(39); |
| 37085 |
|
| 37086 |
__webpack_require__(119); |
| 37087 |
|
| 37088 |
__webpack_require__(58); |
| 37089 |
|
| 37090 |
/* |
| 37091 |
* jQuery Serialize Object v1.0.1 |
| 37092 |
*/ |
| 37093 |
(function ($) { |
| 37094 |
$.fn.elementorSerializeObject = function () { |
| 37095 |
var serializedArray = this.serializeArray(), |
| 37096 |
data = {}; |
| 37097 |
|
| 37098 |
var parseObject = function parseObject(dataContainer, key, value) { |
| 37099 |
var isArrayKey = /^[^\[\]]+\[]/.test(key), |
| 37100 |
isObjectKey = /^[^\[\]]+\[[^\[\]]+]/.test(key), |
| 37101 |
keyName = key.replace(/\[.*/, ''); |
| 37102 |
|
| 37103 |
if (isArrayKey) { |
| 37104 |
if (!dataContainer[keyName]) { |
| 37105 |
dataContainer[keyName] = []; |
| 37106 |
} |
| 37107 |
} else { |
| 37108 |
if (!isObjectKey) { |
| 37109 |
if (dataContainer.push) { |
| 37110 |
dataContainer.push(value); |
| 37111 |
} else { |
| 37112 |
dataContainer[keyName] = value; |
| 37113 |
} |
| 37114 |
|
| 37115 |
return; |
| 37116 |
} |
| 37117 |
|
| 37118 |
if (!dataContainer[keyName]) { |
| 37119 |
dataContainer[keyName] = {}; |
| 37120 |
} |
| 37121 |
} |
| 37122 |
|
| 37123 |
var nextKeys = key.match(/\[[^\[\]]*]/g); |
| 37124 |
nextKeys[0] = nextKeys[0].replace(/\[|]/g, ''); |
| 37125 |
return parseObject(dataContainer[keyName], nextKeys.join(''), value); |
| 37126 |
}; |
| 37127 |
|
| 37128 |
$.each(serializedArray, function () { |
| 37129 |
parseObject(data, this.name, this.value); |
| 37130 |
}); |
| 37131 |
return data; |
| 37132 |
}; |
| 37133 |
})(jQuery); |
| 37134 |
|
| 37135 |
/***/ }), |
| 37136 |
/* 710 */ |
| 37137 |
/***/ (function(module, exports, __webpack_require__) { |
| 37138 |
|
| 37139 |
"use strict"; |
| 37140 |
|
| 37141 |
|
| 37142 |
var _interopRequireDefault = __webpack_require__(0); |
| 37143 |
|
| 37144 |
__webpack_require__(119); |
| 37145 |
|
| 37146 |
var _stringify = _interopRequireDefault(__webpack_require__(206)); |
| 37147 |
|
| 37148 |
/** |
| 37149 |
* HTML5 - Drag and Drop |
| 37150 |
*/ |
| 37151 |
(function ($) { |
| 37152 |
var hasFullDataTransferSupport = function hasFullDataTransferSupport(event) { |
| 37153 |
try { |
| 37154 |
event.originalEvent.dataTransfer.setData('test', 'test'); |
| 37155 |
event.originalEvent.dataTransfer.clearData('test'); |
| 37156 |
return true; |
| 37157 |
} catch (e) { |
| 37158 |
return false; |
| 37159 |
} |
| 37160 |
}; |
| 37161 |
|
| 37162 |
var Draggable = function Draggable(userSettings) { |
| 37163 |
var self = this, |
| 37164 |
settings = {}, |
| 37165 |
elementsCache = {}, |
| 37166 |
defaultSettings = { |
| 37167 |
element: '', |
| 37168 |
groups: null, |
| 37169 |
onDragStart: null, |
| 37170 |
onDragEnd: null |
| 37171 |
}; |
| 37172 |
|
| 37173 |
var initSettings = function initSettings() { |
| 37174 |
$.extend(true, settings, defaultSettings, userSettings); |
| 37175 |
}; |
| 37176 |
|
| 37177 |
var initElementsCache = function initElementsCache() { |
| 37178 |
elementsCache.$element = $(settings.element); |
| 37179 |
}; |
| 37180 |
|
| 37181 |
var buildElements = function buildElements() { |
| 37182 |
elementsCache.$element.attr('draggable', true); |
| 37183 |
}; |
| 37184 |
|
| 37185 |
var onDragEnd = function onDragEnd(event) { |
| 37186 |
if ($.isFunction(settings.onDragEnd)) { |
| 37187 |
settings.onDragEnd.call(elementsCache.$element, event, self); |
| 37188 |
} |
| 37189 |
}; |
| 37190 |
|
| 37191 |
var onDragStart = function onDragStart(event) { |
| 37192 |
var groups = settings.groups || [], |
| 37193 |
dataContainer = { |
| 37194 |
groups: groups |
| 37195 |
}; |
| 37196 |
|
| 37197 |
if (hasFullDataTransferSupport(event)) { |
| 37198 |
event.originalEvent.dataTransfer.setData((0, _stringify.default)(dataContainer), true); |
| 37199 |
} |
| 37200 |
|
| 37201 |
if ($.isFunction(settings.onDragStart)) { |
| 37202 |
settings.onDragStart.call(elementsCache.$element, event, self); |
| 37203 |
} |
| 37204 |
}; |
| 37205 |
|
| 37206 |
var attachEvents = function attachEvents() { |
| 37207 |
elementsCache.$element.on('dragstart', onDragStart).on('dragend', onDragEnd); |
| 37208 |
}; |
| 37209 |
|
| 37210 |
var init = function init() { |
| 37211 |
initSettings(); |
| 37212 |
initElementsCache(); |
| 37213 |
buildElements(); |
| 37214 |
attachEvents(); |
| 37215 |
}; |
| 37216 |
|
| 37217 |
this.destroy = function () { |
| 37218 |
elementsCache.$element.off('dragstart', onDragStart); |
| 37219 |
elementsCache.$element.removeAttr('draggable'); |
| 37220 |
}; |
| 37221 |
|
| 37222 |
init(); |
| 37223 |
}; |
| 37224 |
|
| 37225 |
var Droppable = function Droppable(userSettings) { |
| 37226 |
var self = this, |
| 37227 |
settings = {}, |
| 37228 |
elementsCache = {}, |
| 37229 |
currentElement, |
| 37230 |
currentSide, |
| 37231 |
defaultSettings = { |
| 37232 |
element: '', |
| 37233 |
items: '>', |
| 37234 |
horizontalSensitivity: '10%', |
| 37235 |
axis: ['vertical', 'horizontal'], |
| 37236 |
placeholder: true, |
| 37237 |
currentElementClass: 'html5dnd-current-element', |
| 37238 |
placeholderClass: 'html5dnd-placeholder', |
| 37239 |
hasDraggingOnChildClass: 'html5dnd-has-dragging-on-child', |
| 37240 |
groups: null, |
| 37241 |
isDroppingAllowed: null, |
| 37242 |
onDragEnter: null, |
| 37243 |
onDragging: null, |
| 37244 |
onDropping: null, |
| 37245 |
onDragLeave: null |
| 37246 |
}; |
| 37247 |
|
| 37248 |
var initSettings = function initSettings() { |
| 37249 |
$.extend(settings, defaultSettings, userSettings); |
| 37250 |
}; |
| 37251 |
|
| 37252 |
var initElementsCache = function initElementsCache() { |
| 37253 |
elementsCache.$element = $(settings.element); |
| 37254 |
elementsCache.$placeholder = $('<div>', { |
| 37255 |
class: settings.placeholderClass |
| 37256 |
}); |
| 37257 |
}; |
| 37258 |
|
| 37259 |
var hasHorizontalDetection = function hasHorizontalDetection() { |
| 37260 |
return -1 !== settings.axis.indexOf('horizontal'); |
| 37261 |
}; |
| 37262 |
|
| 37263 |
var hasVerticalDetection = function hasVerticalDetection() { |
| 37264 |
return -1 !== settings.axis.indexOf('vertical'); |
| 37265 |
}; |
| 37266 |
|
| 37267 |
var checkHorizontal = function checkHorizontal(offsetX, elementWidth) { |
| 37268 |
var isPercentValue, sensitivity; |
| 37269 |
|
| 37270 |
if (!hasHorizontalDetection()) { |
| 37271 |
return false; |
| 37272 |
} |
| 37273 |
|
| 37274 |
if (!hasVerticalDetection()) { |
| 37275 |
return offsetX > elementWidth / 2 ? 'right' : 'left'; |
| 37276 |
} |
| 37277 |
|
| 37278 |
sensitivity = settings.horizontalSensitivity.match(/\d+/); |
| 37279 |
|
| 37280 |
if (!sensitivity) { |
| 37281 |
return false; |
| 37282 |
} |
| 37283 |
|
| 37284 |
sensitivity = sensitivity[0]; |
| 37285 |
isPercentValue = /%$/.test(settings.horizontalSensitivity); |
| 37286 |
|
| 37287 |
if (isPercentValue) { |
| 37288 |
sensitivity = elementWidth / sensitivity; |
| 37289 |
} |
| 37290 |
|
| 37291 |
if (offsetX > elementWidth - sensitivity) { |
| 37292 |
return 'right'; |
| 37293 |
} else if (offsetX < sensitivity) { |
| 37294 |
return 'left'; |
| 37295 |
} |
| 37296 |
|
| 37297 |
return false; |
| 37298 |
}; |
| 37299 |
|
| 37300 |
var setSide = function setSide(event) { |
| 37301 |
var $element = $(currentElement), |
| 37302 |
elementHeight = $element.outerHeight() - elementsCache.$placeholder.outerHeight(), |
| 37303 |
elementWidth = $element.outerWidth(); |
| 37304 |
event = event.originalEvent; |
| 37305 |
currentSide = checkHorizontal(event.offsetX, elementWidth); |
| 37306 |
|
| 37307 |
if (currentSide) { |
| 37308 |
return; |
| 37309 |
} |
| 37310 |
|
| 37311 |
if (!hasVerticalDetection()) { |
| 37312 |
currentSide = null; |
| 37313 |
return; |
| 37314 |
} |
| 37315 |
|
| 37316 |
var elementPosition = currentElement.getBoundingClientRect(); |
| 37317 |
currentSide = event.clientY > elementPosition.top + elementHeight / 2 ? 'bottom' : 'top'; |
| 37318 |
}; |
| 37319 |
|
| 37320 |
var insertPlaceholder = function insertPlaceholder() { |
| 37321 |
if (!settings.placeholder) { |
| 37322 |
return; |
| 37323 |
} |
| 37324 |
|
| 37325 |
var insertMethod = 'top' === currentSide ? 'prependTo' : 'appendTo'; |
| 37326 |
elementsCache.$placeholder[insertMethod](currentElement); |
| 37327 |
}; |
| 37328 |
|
| 37329 |
var isDroppingAllowed = function isDroppingAllowed(event) { |
| 37330 |
var dataTransferTypes, draggableGroups, isGroupMatch, droppingAllowed; |
| 37331 |
|
| 37332 |
if (settings.groups && hasFullDataTransferSupport(event)) { |
| 37333 |
dataTransferTypes = event.originalEvent.dataTransfer.types; |
| 37334 |
isGroupMatch = false; |
| 37335 |
dataTransferTypes = Array.prototype.slice.apply(dataTransferTypes); // Convert to array, since Firefox hold it as DOMStringList |
| 37336 |
|
| 37337 |
dataTransferTypes.forEach(function (type) { |
| 37338 |
try { |
| 37339 |
draggableGroups = JSON.parse(type); |
| 37340 |
|
| 37341 |
if (!draggableGroups.groups.slice) { |
| 37342 |
return; |
| 37343 |
} |
| 37344 |
|
| 37345 |
settings.groups.forEach(function (groupName) { |
| 37346 |
if (-1 !== draggableGroups.groups.indexOf(groupName)) { |
| 37347 |
isGroupMatch = true; |
| 37348 |
return false; // stops the forEach from extra loops |
| 37349 |
} |
| 37350 |
}); |
| 37351 |
} catch (e) {} |
| 37352 |
}); |
| 37353 |
|
| 37354 |
if (!isGroupMatch) { |
| 37355 |
return false; |
| 37356 |
} |
| 37357 |
} |
| 37358 |
|
| 37359 |
if ($.isFunction(settings.isDroppingAllowed)) { |
| 37360 |
droppingAllowed = settings.isDroppingAllowed.call(currentElement, currentSide, event, self); |
| 37361 |
|
| 37362 |
if (!droppingAllowed) { |
| 37363 |
return false; |
| 37364 |
} |
| 37365 |
} |
| 37366 |
|
| 37367 |
return true; |
| 37368 |
}; |
| 37369 |
|
| 37370 |
var onDragEnter = function onDragEnter(event) { |
| 37371 |
event.stopPropagation(); |
| 37372 |
|
| 37373 |
if (currentElement) { |
| 37374 |
return; |
| 37375 |
} |
| 37376 |
|
| 37377 |
currentElement = this; |
| 37378 |
elementsCache.$element.parents().each(function () { |
| 37379 |
var droppableInstance = $(this).data('html5Droppable'); |
| 37380 |
|
| 37381 |
if (!droppableInstance) { |
| 37382 |
return; |
| 37383 |
} |
| 37384 |
|
| 37385 |
droppableInstance.doDragLeave(); |
| 37386 |
}); |
| 37387 |
setSide(event); |
| 37388 |
|
| 37389 |
if (!isDroppingAllowed(event)) { |
| 37390 |
return; |
| 37391 |
} |
| 37392 |
|
| 37393 |
insertPlaceholder(); |
| 37394 |
elementsCache.$element.addClass(settings.hasDraggingOnChildClass); |
| 37395 |
$(currentElement).addClass(settings.currentElementClass); |
| 37396 |
|
| 37397 |
if ($.isFunction(settings.onDragEnter)) { |
| 37398 |
settings.onDragEnter.call(currentElement, currentSide, event, self); |
| 37399 |
} |
| 37400 |
}; |
| 37401 |
|
| 37402 |
var onDragOver = function onDragOver(event) { |
| 37403 |
event.stopPropagation(); |
| 37404 |
|
| 37405 |
if (!currentElement) { |
| 37406 |
onDragEnter.call(this, event); |
| 37407 |
} |
| 37408 |
|
| 37409 |
var oldSide = currentSide; |
| 37410 |
setSide(event); |
| 37411 |
|
| 37412 |
if (!isDroppingAllowed(event)) { |
| 37413 |
return; |
| 37414 |
} |
| 37415 |
|
| 37416 |
event.preventDefault(); |
| 37417 |
|
| 37418 |
if (oldSide !== currentSide) { |
| 37419 |
insertPlaceholder(); |
| 37420 |
} |
| 37421 |
|
| 37422 |
if ($.isFunction(settings.onDragging)) { |
| 37423 |
settings.onDragging.call(this, currentSide, event, self); |
| 37424 |
} |
| 37425 |
}; |
| 37426 |
|
| 37427 |
var onDragLeave = function onDragLeave(event) { |
| 37428 |
var elementPosition = this.getBoundingClientRect(); |
| 37429 |
|
| 37430 |
if ('dragleave' === event.type && !(event.clientX < elementPosition.left || event.clientX >= elementPosition.right || event.clientY < elementPosition.top || event.clientY >= elementPosition.bottom)) { |
| 37431 |
return; |
| 37432 |
} |
| 37433 |
|
| 37434 |
$(currentElement).removeClass(settings.currentElementClass); |
| 37435 |
self.doDragLeave(); |
| 37436 |
}; |
| 37437 |
|
| 37438 |
var onDrop = function onDrop(event) { |
| 37439 |
setSide(event); |
| 37440 |
|
| 37441 |
if (!isDroppingAllowed(event)) { |
| 37442 |
return; |
| 37443 |
} |
| 37444 |
|
| 37445 |
event.preventDefault(); |
| 37446 |
|
| 37447 |
if ($.isFunction(settings.onDropping)) { |
| 37448 |
settings.onDropping.call(this, currentSide, event, self); |
| 37449 |
} |
| 37450 |
}; |
| 37451 |
|
| 37452 |
var attachEvents = function attachEvents() { |
| 37453 |
elementsCache.$element.on('dragenter', settings.items, onDragEnter).on('dragover', settings.items, onDragOver).on('drop', settings.items, onDrop).on('dragleave drop', settings.items, onDragLeave); |
| 37454 |
}; |
| 37455 |
|
| 37456 |
var init = function init() { |
| 37457 |
initSettings(); |
| 37458 |
initElementsCache(); |
| 37459 |
attachEvents(); |
| 37460 |
}; |
| 37461 |
|
| 37462 |
this.doDragLeave = function () { |
| 37463 |
if (settings.placeholder) { |
| 37464 |
elementsCache.$placeholder.remove(); |
| 37465 |
} |
| 37466 |
|
| 37467 |
elementsCache.$element.removeClass(settings.hasDraggingOnChildClass); |
| 37468 |
|
| 37469 |
if ($.isFunction(settings.onDragLeave)) { |
| 37470 |
settings.onDragLeave.call(currentElement, event, self); |
| 37471 |
} |
| 37472 |
|
| 37473 |
currentElement = currentSide = null; |
| 37474 |
}; |
| 37475 |
|
| 37476 |
this.destroy = function () { |
| 37477 |
elementsCache.$element.off('dragenter', settings.items, onDragEnter).off('dragover', settings.items, onDragOver).off('drop', settings.items, onDrop).off('dragleave drop', settings.items, onDragLeave); |
| 37478 |
}; |
| 37479 |
|
| 37480 |
init(); |
| 37481 |
}; |
| 37482 |
|
| 37483 |
var plugins = { |
| 37484 |
html5Draggable: Draggable, |
| 37485 |
html5Droppable: Droppable |
| 37486 |
}; |
| 37487 |
$.each(plugins, function (pluginName, Plugin) { |
| 37488 |
$.fn[pluginName] = function (options) { |
| 37489 |
options = options || {}; |
| 37490 |
this.each(function () { |
| 37491 |
var instance = $.data(this, pluginName), |
| 37492 |
hasInstance = instance instanceof Plugin; |
| 37493 |
|
| 37494 |
if (hasInstance) { |
| 37495 |
if ('destroy' === options) { |
| 37496 |
instance.destroy(); |
| 37497 |
$.removeData(this, pluginName); |
| 37498 |
} |
| 37499 |
|
| 37500 |
return; |
| 37501 |
} |
| 37502 |
|
| 37503 |
options.element = this; |
| 37504 |
$.data(this, pluginName, new Plugin(options)); |
| 37505 |
}); |
| 37506 |
return this; |
| 37507 |
}; |
| 37508 |
}); |
| 37509 |
})(jQuery); |
| 37510 |
|
| 37511 |
/***/ }), |
| 37512 |
/* 711 */ |
| 37513 |
/***/ (function(module, exports, __webpack_require__) { |
| 37514 |
|
| 37515 |
"use strict"; |
| 37516 |
|
| 37517 |
|
| 37518 |
var _interopRequireDefault = __webpack_require__(0); |
| 37519 |
|
| 37520 |
var _Object$defineProperty = __webpack_require__(1); |
| 37521 |
|
| 37522 |
_Object$defineProperty(exports, "__esModule", { |
| 37523 |
value: true |
| 37524 |
}); |
| 37525 |
|
| 37526 |
exports.Editor = void 0; |
| 37527 |
|
| 37528 |
var _classCallCheck2 = _interopRequireDefault(__webpack_require__(2)); |
| 37529 |
|
| 37530 |
var _createClass2 = _interopRequireDefault(__webpack_require__(3)); |
| 37531 |
|
| 37532 |
var _get2 = _interopRequireDefault(__webpack_require__(26)); |
| 37533 |
|
| 37534 |
var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(16)); |
| 37535 |
|
| 37536 |
var _inherits2 = _interopRequireDefault(__webpack_require__(4)); |
| 37537 |
|
| 37538 |
var _createSuper2 = _interopRequireDefault(__webpack_require__(5)); |
| 37539 |
|
| 37540 |
var _editorBase = _interopRequireDefault(__webpack_require__(419)); |
| 37541 |
|
| 37542 |
var Editor = /*#__PURE__*/function (_EditorBase) { |
| 37543 |
(0, _inherits2.default)(Editor, _EditorBase); |
| 37544 |
|
| 37545 |
var _super = (0, _createSuper2.default)(Editor); |
| 37546 |
|
| 37547 |
function Editor() { |
| 37548 |
(0, _classCallCheck2.default)(this, Editor); |
| 37549 |
return _super.apply(this, arguments); |
| 37550 |
} |
| 37551 |
|
| 37552 |
(0, _createClass2.default)(Editor, [{ |
| 37553 |
key: "onStart", |
| 37554 |
value: function onStart(options) { |
| 37555 |
NProgress.start(); |
| 37556 |
NProgress.inc(0.2); |
| 37557 |
(0, _get2.default)((0, _getPrototypeOf2.default)(Editor.prototype), "onStart", this).call(this, options); |
| 37558 |
} |
| 37559 |
}, { |
| 37560 |
key: "onPreviewLoaded", |
| 37561 |
value: function onPreviewLoaded() { |
| 37562 |
NProgress.done(); |
| 37563 |
(0, _get2.default)((0, _getPrototypeOf2.default)(Editor.prototype), "onPreviewLoaded", this).call(this); |
| 37564 |
} |
| 37565 |
}]); |
| 37566 |
return Editor; |
| 37567 |
}(_editorBase.default); |
| 37568 |
|
| 37569 |
exports.Editor = Editor; |
| 37570 |
window.elementor = new Editor(); |
| 37571 |
elementor.start(); |
| 37572 |
|
| 37573 |
/***/ }) |
| 37574 |
/******/ ]); |
| 37575 |
//# sourceMappingURL=editor.js.map |