PluginProbe
Elementor Website Builder – more than just a page builder / 3.32.3
Elementor Website Builder – more than just a page builder v3.32.3
4.3.2 4.3.1 4.3.0 4.3.0-beta3 4.3.0-beta2 4.3.0-beta1 4.2.4 4.2.3 4.2.2 4.2.1 4.2.0 4.1.5 4.2.0-beta2 4.2.0-dev2 4.2.0-beta1 4.1.4 4.1.3 4.1.2 4.1.1 4.1.0 4.1.0-beta3 4.1.0-dev3 4.0.9 4.1.0-beta2 4.1.0-dev2 All 455 releases
← All changes | assets/js/cloud-library-screenshot.js +396 -1655 4.2.0-beta2 → 3.32.3 View file →
@@ -1,20 +1,37 @@
1 +/*! elementor - v3.32.0 - 29-09-2025 */
1 2 /******/ (() => { // webpackBootstrap
2 3 /******/ var __webpack_modules__ = ({
3 4
4 -/***/ "../node_modules/@babel/runtime/helpers/OverloadYield.js":
5 -/*!***************************************************************!*\
6 - !*** ../node_modules/@babel/runtime/helpers/OverloadYield.js ***!
7 - \***************************************************************/
5 +/***/ "../node_modules/@babel/runtime/helpers/arrayLikeToArray.js":
6 +/*!******************************************************************!*\
7 + !*** ../node_modules/@babel/runtime/helpers/arrayLikeToArray.js ***!
8 + \******************************************************************/
8 9 /***/ ((module) => {
9 10
10 -function _OverloadYield(e, d) {
11 - this.v = e, this.k = d;
11 +function _arrayLikeToArray(r, a) {
12 + (null == a || a > r.length) && (a = r.length);
13 + for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
14 + return n;
12 15 }
13 -module.exports = _OverloadYield, module.exports.__esModule = true, module.exports["default"] = module.exports;
16 +module.exports = _arrayLikeToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
14 17
15 18 /***/ }),
16 19
20 +/***/ "../node_modules/@babel/runtime/helpers/arrayWithoutHoles.js":
21 +/*!*******************************************************************!*\
22 + !*** ../node_modules/@babel/runtime/helpers/arrayWithoutHoles.js ***!
23 + \*******************************************************************/
24 +/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
25 +
26 +var arrayLikeToArray = __webpack_require__(/*! ./arrayLikeToArray.js */ "../node_modules/@babel/runtime/helpers/arrayLikeToArray.js");
27 +function _arrayWithoutHoles(r) {
28 + if (Array.isArray(r)) return arrayLikeToArray(r);
29 +}
30 +module.exports = _arrayWithoutHoles, module.exports.__esModule = true, module.exports["default"] = module.exports;
31 +
32 +/***/ }),
33 +
17 34 /***/ "../node_modules/@babel/runtime/helpers/assertThisInitialized.js":
18 35 /*!***********************************************************************!*\
19 36 !*** ../node_modules/@babel/runtime/helpers/assertThisInitialized.js ***!
20 37 \***********************************************************************/
@@ -27,43 +44,8 @@
27 44 module.exports = _assertThisInitialized, module.exports.__esModule = true, module.exports["default"] = module.exports;
28 45
29 46 /***/ }),
30 47
31 -/***/ "../node_modules/@babel/runtime/helpers/asyncToGenerator.js":
32 -/*!******************************************************************!*\
33 - !*** ../node_modules/@babel/runtime/helpers/asyncToGenerator.js ***!
34 - \******************************************************************/
35 -/***/ ((module) => {
36 -
37 -function asyncGeneratorStep(n, t, e, r, o, a, c) {
38 - try {
39 - var i = n[a](c),
40 - u = i.value;
41 - } catch (n) {
42 - return void e(n);
43 - }
44 - i.done ? t(u) : Promise.resolve(u).then(r, o);
45 -}
46 -function _asyncToGenerator(n) {
47 - return function () {
48 - var t = this,
49 - e = arguments;
50 - return new Promise(function (r, o) {
51 - var a = n.apply(t, e);
52 - function _next(n) {
53 - asyncGeneratorStep(a, r, o, _next, _throw, "next", n);
54 - }
55 - function _throw(n) {
56 - asyncGeneratorStep(a, r, o, _next, _throw, "throw", n);
57 - }
58 - _next(void 0);
59 - });
60 - };
61 -}
62 -module.exports = _asyncToGenerator, module.exports.__esModule = true, module.exports["default"] = module.exports;
63 -
64 -/***/ }),
65 -
66 48 /***/ "../node_modules/@babel/runtime/helpers/classCallCheck.js":
67 49 /*!****************************************************************!*\
68 50 !*** ../node_modules/@babel/runtime/helpers/classCallCheck.js ***!
69 51 \****************************************************************/
@@ -189,358 +171,61 @@
189 171 module.exports = _interopRequireDefault, module.exports.__esModule = true, module.exports["default"] = module.exports;
190 172
191 173 /***/ }),
192 174
193 -/***/ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js":
194 -/*!***************************************************************************!*\
195 - !*** ../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js ***!
196 - \***************************************************************************/
197 -/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
175 +/***/ "../node_modules/@babel/runtime/helpers/iterableToArray.js":
176 +/*!*****************************************************************!*\
177 + !*** ../node_modules/@babel/runtime/helpers/iterableToArray.js ***!
178 + \*****************************************************************/
179 +/***/ ((module) => {
198 180
199 -var _typeof = (__webpack_require__(/*! ./typeof.js */ "../node_modules/@babel/runtime/helpers/typeof.js")["default"]);
200 -var assertThisInitialized = __webpack_require__(/*! ./assertThisInitialized.js */ "../node_modules/@babel/runtime/helpers/assertThisInitialized.js");
201 -function _possibleConstructorReturn(t, e) {
202 - if (e && ("object" == _typeof(e) || "function" == typeof e)) return e;
203 - if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined");
204 - return assertThisInitialized(t);
181 +function _iterableToArray(r) {
182 + if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r);
205 183 }
206 -module.exports = _possibleConstructorReturn, module.exports.__esModule = true, module.exports["default"] = module.exports;
184 +module.exports = _iterableToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
207 185
208 186 /***/ }),
209 187
210 -/***/ "../node_modules/@babel/runtime/helpers/regenerator.js":
211 -/*!*************************************************************!*\
212 - !*** ../node_modules/@babel/runtime/helpers/regenerator.js ***!
213 - \*************************************************************/
214 -/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
215 -
216 -var regeneratorDefine = __webpack_require__(/*! ./regeneratorDefine.js */ "../node_modules/@babel/runtime/helpers/regeneratorDefine.js");
217 -function _regenerator() {
218 - /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */
219 - var e,
220 - t,
221 - r = "function" == typeof Symbol ? Symbol : {},
222 - n = r.iterator || "@@iterator",
223 - o = r.toStringTag || "@@toStringTag";
224 - function i(r, n, o, i) {
225 - var c = n && n.prototype instanceof Generator ? n : Generator,
226 - u = Object.create(c.prototype);
227 - return regeneratorDefine(u, "_invoke", function (r, n, o) {
228 - var i,
229 - c,
230 - u,
231 - f = 0,
232 - p = o || [],
233 - y = !1,
234 - G = {
235 - p: 0,
236 - n: 0,
237 - v: e,
238 - a: d,
239 - f: d.bind(e, 4),
240 - d: function d(t, r) {
241 - return i = t, c = 0, u = e, G.n = r, a;
242 - }
243 - };
244 - function d(r, n) {
245 - for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) {
246 - var o,
247 - i = p[t],
248 - d = G.p,
249 - l = i[2];
250 - r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0));
251 - }
252 - if (o || r > 1) return a;
253 - throw y = !0, n;
254 - }
255 - return function (o, p, l) {
256 - if (f > 1) throw TypeError("Generator is already running");
257 - for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) {
258 - i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u);
259 - try {
260 - if (f = 2, i) {
261 - if (c || (o = "next"), t = i[o]) {
262 - if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object");
263 - if (!t.done) return t;
264 - u = t.value, c < 2 && (c = 0);
265 - } else 1 === c && (t = i["return"]) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1);
266 - i = e;
267 - } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break;
268 - } catch (t) {
269 - i = e, c = 1, u = t;
270 - } finally {
271 - f = 1;
272 - }
273 - }
274 - return {
275 - value: t,
276 - done: y
277 - };
278 - };
279 - }(r, o, i), !0), u;
280 - }
281 - var a = {};
282 - function Generator() {}
283 - function GeneratorFunction() {}
284 - function GeneratorFunctionPrototype() {}
285 - t = Object.getPrototypeOf;
286 - var c = [][n] ? t(t([][n]())) : (regeneratorDefine(t = {}, n, function () {
287 - return this;
288 - }), t),
289 - u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c);
290 - function f(e) {
291 - return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, regeneratorDefine(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e;
292 - }
293 - return GeneratorFunction.prototype = GeneratorFunctionPrototype, regeneratorDefine(u, "constructor", GeneratorFunctionPrototype), regeneratorDefine(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", regeneratorDefine(GeneratorFunctionPrototype, o, "GeneratorFunction"), regeneratorDefine(u), regeneratorDefine(u, o, "Generator"), regeneratorDefine(u, n, function () {
294 - return this;
295 - }), regeneratorDefine(u, "toString", function () {
296 - return "[object Generator]";
297 - }), (module.exports = _regenerator = function _regenerator() {
298 - return {
299 - w: i,
300 - m: f
301 - };
302 - }, module.exports.__esModule = true, module.exports["default"] = module.exports)();
303 -}
304 -module.exports = _regenerator, module.exports.__esModule = true, module.exports["default"] = module.exports;
305 -
306 -/***/ }),
307 -
308 -/***/ "../node_modules/@babel/runtime/helpers/regeneratorAsync.js":
309 -/*!******************************************************************!*\
310 - !*** ../node_modules/@babel/runtime/helpers/regeneratorAsync.js ***!
311 - \******************************************************************/
312 -/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
313 -
314 -var regeneratorAsyncGen = __webpack_require__(/*! ./regeneratorAsyncGen.js */ "../node_modules/@babel/runtime/helpers/regeneratorAsyncGen.js");
315 -function _regeneratorAsync(n, e, r, t, o) {
316 - var a = regeneratorAsyncGen(n, e, r, t, o);
317 - return a.next().then(function (n) {
318 - return n.done ? n.value : a.next();
319 - });
320 -}
321 -module.exports = _regeneratorAsync, module.exports.__esModule = true, module.exports["default"] = module.exports;
322 -
323 -/***/ }),
324 -
325 -/***/ "../node_modules/@babel/runtime/helpers/regeneratorAsyncGen.js":
326 -/*!*********************************************************************!*\
327 - !*** ../node_modules/@babel/runtime/helpers/regeneratorAsyncGen.js ***!
328 - \*********************************************************************/
329 -/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
330 -
331 -var regenerator = __webpack_require__(/*! ./regenerator.js */ "../node_modules/@babel/runtime/helpers/regenerator.js");
332 -var regeneratorAsyncIterator = __webpack_require__(/*! ./regeneratorAsyncIterator.js */ "../node_modules/@babel/runtime/helpers/regeneratorAsyncIterator.js");
333 -function _regeneratorAsyncGen(r, e, t, o, n) {
334 - return new regeneratorAsyncIterator(regenerator().w(r, e, t, o), n || Promise);
335 -}
336 -module.exports = _regeneratorAsyncGen, module.exports.__esModule = true, module.exports["default"] = module.exports;
337 -
338 -/***/ }),
339 -
340 -/***/ "../node_modules/@babel/runtime/helpers/regeneratorAsyncIterator.js":
341 -/*!**************************************************************************!*\
342 - !*** ../node_modules/@babel/runtime/helpers/regeneratorAsyncIterator.js ***!
343 - \**************************************************************************/
344 -/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
345 -
346 -var OverloadYield = __webpack_require__(/*! ./OverloadYield.js */ "../node_modules/@babel/runtime/helpers/OverloadYield.js");
347 -var regeneratorDefine = __webpack_require__(/*! ./regeneratorDefine.js */ "../node_modules/@babel/runtime/helpers/regeneratorDefine.js");
348 -function AsyncIterator(t, e) {
349 - function n(r, o, i, f) {
350 - try {
351 - var c = t[r](o),
352 - u = c.value;
353 - return u instanceof OverloadYield ? e.resolve(u.v).then(function (t) {
354 - n("next", t, i, f);
355 - }, function (t) {
356 - n("throw", t, i, f);
357 - }) : e.resolve(u).then(function (t) {
358 - c.value = t, i(c);
359 - }, function (t) {
360 - return n("throw", t, i, f);
361 - });
362 - } catch (t) {
363 - f(t);
364 - }
365 - }
366 - var r;
367 - this.next || (regeneratorDefine(AsyncIterator.prototype), regeneratorDefine(AsyncIterator.prototype, "function" == typeof Symbol && Symbol.asyncIterator || "@asyncIterator", function () {
368 - return this;
369 - })), regeneratorDefine(this, "_invoke", function (t, o, i) {
370 - function f() {
371 - return new e(function (e, r) {
372 - n(t, i, e, r);
373 - });
374 - }
375 - return r = r ? r.then(f, f) : f();
376 - }, !0);
377 -}
378 -module.exports = AsyncIterator, module.exports.__esModule = true, module.exports["default"] = module.exports;
379 -
380 -/***/ }),
381 -
382 -/***/ "../node_modules/@babel/runtime/helpers/regeneratorDefine.js":
188 +/***/ "../node_modules/@babel/runtime/helpers/nonIterableSpread.js":
383 189 /*!*******************************************************************!*\
384 - !*** ../node_modules/@babel/runtime/helpers/regeneratorDefine.js ***!
190 + !*** ../node_modules/@babel/runtime/helpers/nonIterableSpread.js ***!
385 191 \*******************************************************************/
386 192 /***/ ((module) => {
387 193
388 -function _regeneratorDefine(e, r, n, t) {
389 - var i = Object.defineProperty;
390 - try {
391 - i({}, "", {});
392 - } catch (e) {
393 - i = 0;
394 - }
395 - module.exports = _regeneratorDefine = function regeneratorDefine(e, r, n, t) {
396 - function o(r, n) {
397 - _regeneratorDefine(e, r, function (e) {
398 - return this._invoke(r, n, e);
399 - });
400 - }
401 - r ? i ? i(e, r, {
402 - value: n,
403 - enumerable: !t,
404 - configurable: !t,
405 - writable: !t
406 - }) : e[r] = n : (o("next", 0), o("throw", 1), o("return", 2));
407 - }, module.exports.__esModule = true, module.exports["default"] = module.exports, _regeneratorDefine(e, r, n, t);
194 +function _nonIterableSpread() {
195 + throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
408 196 }
409 -module.exports = _regeneratorDefine, module.exports.__esModule = true, module.exports["default"] = module.exports;
197 +module.exports = _nonIterableSpread, module.exports.__esModule = true, module.exports["default"] = module.exports;
410 198
411 199 /***/ }),
412 200
413 -/***/ "../node_modules/@babel/runtime/helpers/regeneratorKeys.js":
414 -/*!*****************************************************************!*\
415 - !*** ../node_modules/@babel/runtime/helpers/regeneratorKeys.js ***!
416 - \*****************************************************************/
417 -/***/ ((module) => {
418 -
419 -function _regeneratorKeys(e) {
420 - var n = Object(e),
421 - r = [];
422 - for (var t in n) r.unshift(t);
423 - return function e() {
424 - for (; r.length;) if ((t = r.pop()) in n) return e.value = t, e.done = !1, e;
425 - return e.done = !0, e;
426 - };
427 -}
428 -module.exports = _regeneratorKeys, module.exports.__esModule = true, module.exports["default"] = module.exports;
429 -
430 -/***/ }),
431 -
432 -/***/ "../node_modules/@babel/runtime/helpers/regeneratorRuntime.js":
433 -/*!********************************************************************!*\
434 - !*** ../node_modules/@babel/runtime/helpers/regeneratorRuntime.js ***!
435 - \********************************************************************/
201 +/***/ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js":
202 +/*!***************************************************************************!*\
203 + !*** ../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js ***!
204 + \***************************************************************************/
436 205 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
437 206
438 -var OverloadYield = __webpack_require__(/*! ./OverloadYield.js */ "../node_modules/@babel/runtime/helpers/OverloadYield.js");
439 -var regenerator = __webpack_require__(/*! ./regenerator.js */ "../node_modules/@babel/runtime/helpers/regenerator.js");
440 -var regeneratorAsync = __webpack_require__(/*! ./regeneratorAsync.js */ "../node_modules/@babel/runtime/helpers/regeneratorAsync.js");
441 -var regeneratorAsyncGen = __webpack_require__(/*! ./regeneratorAsyncGen.js */ "../node_modules/@babel/runtime/helpers/regeneratorAsyncGen.js");
442 -var regeneratorAsyncIterator = __webpack_require__(/*! ./regeneratorAsyncIterator.js */ "../node_modules/@babel/runtime/helpers/regeneratorAsyncIterator.js");
443 -var regeneratorKeys = __webpack_require__(/*! ./regeneratorKeys.js */ "../node_modules/@babel/runtime/helpers/regeneratorKeys.js");
444 -var regeneratorValues = __webpack_require__(/*! ./regeneratorValues.js */ "../node_modules/@babel/runtime/helpers/regeneratorValues.js");
445 -function _regeneratorRuntime() {
446 - "use strict";
447 -
448 - var r = regenerator(),
449 - e = r.m(_regeneratorRuntime),
450 - t = (Object.getPrototypeOf ? Object.getPrototypeOf(e) : e.__proto__).constructor;
451 - function n(r) {
452 - var e = "function" == typeof r && r.constructor;
453 - return !!e && (e === t || "GeneratorFunction" === (e.displayName || e.name));
454 - }
455 - var o = {
456 - "throw": 1,
457 - "return": 2,
458 - "break": 3,
459 - "continue": 3
460 - };
461 - function a(r) {
462 - var e, t;
463 - return function (n) {
464 - e || (e = {
465 - stop: function stop() {
466 - return t(n.a, 2);
467 - },
468 - "catch": function _catch() {
469 - return n.v;
470 - },
471 - abrupt: function abrupt(r, e) {
472 - return t(n.a, o[r], e);
473 - },
474 - delegateYield: function delegateYield(r, o, a) {
475 - return e.resultName = o, t(n.d, regeneratorValues(r), a);
476 - },
477 - finish: function finish(r) {
478 - return t(n.f, r);
479 - }
480 - }, t = function t(r, _t, o) {
481 - n.p = e.prev, n.n = e.next;
482 - try {
483 - return r(_t, o);
484 - } finally {
485 - e.next = n.n;
486 - }
487 - }), e.resultName && (e[e.resultName] = n.v, e.resultName = void 0), e.sent = n.v, e.next = n.n;
488 - try {
489 - return r.call(this, e);
490 - } finally {
491 - n.p = e.prev, n.n = e.next;
492 - }
493 - };
494 - }
495 - return (module.exports = _regeneratorRuntime = function _regeneratorRuntime() {
496 - return {
497 - wrap: function wrap(e, t, n, o) {
498 - return r.w(a(e), t, n, o && o.reverse());
499 - },
500 - isGeneratorFunction: n,
501 - mark: r.m,
502 - awrap: function awrap(r, e) {
503 - return new OverloadYield(r, e);
504 - },
505 - AsyncIterator: regeneratorAsyncIterator,
506 - async: function async(r, e, t, o, u) {
507 - return (n(e) ? regeneratorAsyncGen : regeneratorAsync)(a(r), e, t, o, u);
508 - },
509 - keys: regeneratorKeys,
510 - values: regeneratorValues
511 - };
512 - }, module.exports.__esModule = true, module.exports["default"] = module.exports)();
207 +var _typeof = (__webpack_require__(/*! ./typeof.js */ "../node_modules/@babel/runtime/helpers/typeof.js")["default"]);
208 +var assertThisInitialized = __webpack_require__(/*! ./assertThisInitialized.js */ "../node_modules/@babel/runtime/helpers/assertThisInitialized.js");
209 +function _possibleConstructorReturn(t, e) {
210 + if (e && ("object" == _typeof(e) || "function" == typeof e)) return e;
211 + if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined");
212 + return assertThisInitialized(t);
513 213 }
514 -module.exports = _regeneratorRuntime, module.exports.__esModule = true, module.exports["default"] = module.exports;
214 +module.exports = _possibleConstructorReturn, module.exports.__esModule = true, module.exports["default"] = module.exports;
515 215
516 216 /***/ }),
517 217
518 -/***/ "../node_modules/@babel/runtime/helpers/regeneratorValues.js":
519 -/*!*******************************************************************!*\
520 - !*** ../node_modules/@babel/runtime/helpers/regeneratorValues.js ***!
521 - \*******************************************************************/
522 -/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
218 +/***/ "../node_modules/@babel/runtime/helpers/readOnlyError.js":
219 +/*!***************************************************************!*\
220 + !*** ../node_modules/@babel/runtime/helpers/readOnlyError.js ***!
221 + \***************************************************************/
222 +/***/ ((module) => {
523 223
524 -var _typeof = (__webpack_require__(/*! ./typeof.js */ "../node_modules/@babel/runtime/helpers/typeof.js")["default"]);
525 -function _regeneratorValues(e) {
526 - if (null != e) {
527 - var t = e["function" == typeof Symbol && Symbol.iterator || "@@iterator"],
528 - r = 0;
529 - if (t) return t.call(e);
530 - if ("function" == typeof e.next) return e;
531 - if (!isNaN(e.length)) return {
532 - next: function next() {
533 - return e && r >= e.length && (e = void 0), {
534 - value: e && e[r++],
535 - done: !e
536 - };
537 - }
538 - };
539 - }
540 - throw new TypeError(_typeof(e) + " is not iterable");
224 +function _readOnlyError(r) {
225 + throw new TypeError('"' + r + '" is read-only');
541 226 }
542 -module.exports = _regeneratorValues, module.exports.__esModule = true, module.exports["default"] = module.exports;
227 +module.exports = _readOnlyError, module.exports.__esModule = true, module.exports["default"] = module.exports;
543 228
544 229 /***/ }),
545 230
546 231 /***/ "../node_modules/@babel/runtime/helpers/setPrototypeOf.js":
@@ -572,8 +257,25 @@
572 257 module.exports = _superPropBase, module.exports.__esModule = true, module.exports["default"] = module.exports;
573 258
574 259 /***/ }),
575 260
261 +/***/ "../node_modules/@babel/runtime/helpers/toConsumableArray.js":
262 +/*!*******************************************************************!*\
263 + !*** ../node_modules/@babel/runtime/helpers/toConsumableArray.js ***!
264 + \*******************************************************************/
265 +/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
266 +
267 +var arrayWithoutHoles = __webpack_require__(/*! ./arrayWithoutHoles.js */ "../node_modules/@babel/runtime/helpers/arrayWithoutHoles.js");
268 +var iterableToArray = __webpack_require__(/*! ./iterableToArray.js */ "../node_modules/@babel/runtime/helpers/iterableToArray.js");
269 +var unsupportedIterableToArray = __webpack_require__(/*! ./unsupportedIterableToArray.js */ "../node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js");
270 +var nonIterableSpread = __webpack_require__(/*! ./nonIterableSpread.js */ "../node_modules/@babel/runtime/helpers/nonIterableSpread.js");
271 +function _toConsumableArray(r) {
272 + return arrayWithoutHoles(r) || iterableToArray(r) || unsupportedIterableToArray(r) || nonIterableSpread();
273 +}
274 +module.exports = _toConsumableArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
275 +
276 +/***/ }),
277 +
576 278 /***/ "../node_modules/@babel/runtime/helpers/toPrimitive.js":
577 279 /*!*************************************************************!*\
578 280 !*** ../node_modules/@babel/runtime/helpers/toPrimitive.js ***!
579 281 \*************************************************************/
@@ -628,1160 +330,24 @@
628 330 module.exports = _typeof, module.exports.__esModule = true, module.exports["default"] = module.exports;
629 331
630 332 /***/ }),
631 333
632 -/***/ "../node_modules/@babel/runtime/regenerator/index.js":
633 -/*!***********************************************************!*\
634 - !*** ../node_modules/@babel/runtime/regenerator/index.js ***!
635 - \***********************************************************/
334 +/***/ "../node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js":
335 +/*!****************************************************************************!*\
336 + !*** ../node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js ***!
337 + \****************************************************************************/
636 338 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
637 339
638 -// TODO(Babel 8): Remove this file.
639 -
640 -var runtime = __webpack_require__(/*! ../helpers/regeneratorRuntime */ "../node_modules/@babel/runtime/helpers/regeneratorRuntime.js")();
641 -module.exports = runtime;
642 -
643 -// Copied from https://github.com/facebook/regenerator/blob/main/packages/runtime/runtime.js#L736=
644 -try {
645 - regeneratorRuntime = runtime;
646 -} catch (accidentalStrictMode) {
647 - if (typeof globalThis === "object") {
648 - globalThis.regeneratorRuntime = runtime;
649 - } else {
650 - Function("r", "regeneratorRuntime = r")(runtime);
340 +var arrayLikeToArray = __webpack_require__(/*! ./arrayLikeToArray.js */ "../node_modules/@babel/runtime/helpers/arrayLikeToArray.js");
341 +function _unsupportedIterableToArray(r, a) {
342 + if (r) {
343 + if ("string" == typeof r) return arrayLikeToArray(r, a);
344 + var t = {}.toString.call(r).slice(8, -1);
345 + return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? arrayLikeToArray(r, a) : void 0;
651 346 }
652 347 }
348 +module.exports = _unsupportedIterableToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
653 349
654 -
655 -/***/ }),
656 -
657 -/***/ "../node_modules/html-to-image/es/apply-style.js":
658 -/*!*******************************************************!*\
659 - !*** ../node_modules/html-to-image/es/apply-style.js ***!
660 - \*******************************************************/
661 -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
662 -
663 -"use strict";
664 -__webpack_require__.r(__webpack_exports__);
665 -/* harmony export */ __webpack_require__.d(__webpack_exports__, {
666 -/* harmony export */ applyStyle: () => (/* binding */ applyStyle)
667 -/* harmony export */ });
668 -function applyStyle(node, options) {
669 - const { style } = node;
670 - if (options.backgroundColor) {
671 - style.backgroundColor = options.backgroundColor;
672 - }
673 - if (options.width) {
674 - style.width = `${options.width}px`;
675 - }
676 - if (options.height) {
677 - style.height = `${options.height}px`;
678 - }
679 - const manual = options.style;
680 - if (manual != null) {
681 - Object.keys(manual).forEach((key) => {
682 - style[key] = manual[key];
683 - });
684 - }
685 - return node;
686 -}
687 -//# sourceMappingURL=apply-style.js.map
688 -
689 -/***/ }),
690 -
691 -/***/ "../node_modules/html-to-image/es/clone-node.js":
692 -/*!******************************************************!*\
693 - !*** ../node_modules/html-to-image/es/clone-node.js ***!
694 - \******************************************************/
695 -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
696 -
697 -"use strict";
698 -__webpack_require__.r(__webpack_exports__);
699 -/* harmony export */ __webpack_require__.d(__webpack_exports__, {
700 -/* harmony export */ cloneNode: () => (/* binding */ cloneNode)
701 -/* harmony export */ });
702 -/* harmony import */ var _clone_pseudos__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./clone-pseudos */ "../node_modules/html-to-image/es/clone-pseudos.js");
703 -/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./util */ "../node_modules/html-to-image/es/util.js");
704 -/* harmony import */ var _mimes__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./mimes */ "../node_modules/html-to-image/es/mimes.js");
705 -/* harmony import */ var _dataurl__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./dataurl */ "../node_modules/html-to-image/es/dataurl.js");
706 -
707 -
708 -
709 -
710 -async function cloneCanvasElement(canvas) {
711 - const dataURL = canvas.toDataURL();
712 - if (dataURL === 'data:,') {
713 - return canvas.cloneNode(false);
714 - }
715 - return (0,_util__WEBPACK_IMPORTED_MODULE_1__.createImage)(dataURL);
716 -}
717 -async function cloneVideoElement(video, options) {
718 - if (video.currentSrc) {
719 - const canvas = document.createElement('canvas');
720 - const ctx = canvas.getContext('2d');
721 - canvas.width = video.clientWidth;
722 - canvas.height = video.clientHeight;
723 - ctx === null || ctx === void 0 ? void 0 : ctx.drawImage(video, 0, 0, canvas.width, canvas.height);
724 - const dataURL = canvas.toDataURL();
725 - return (0,_util__WEBPACK_IMPORTED_MODULE_1__.createImage)(dataURL);
726 - }
727 - const poster = video.poster;
728 - const contentType = (0,_mimes__WEBPACK_IMPORTED_MODULE_2__.getMimeType)(poster);
729 - const dataURL = await (0,_dataurl__WEBPACK_IMPORTED_MODULE_3__.resourceToDataURL)(poster, contentType, options);
730 - return (0,_util__WEBPACK_IMPORTED_MODULE_1__.createImage)(dataURL);
731 -}
732 -async function cloneIFrameElement(iframe, options) {
733 - var _a;
734 - try {
735 - if ((_a = iframe === null || iframe === void 0 ? void 0 : iframe.contentDocument) === null || _a === void 0 ? void 0 : _a.body) {
736 - return (await cloneNode(iframe.contentDocument.body, options, true));
737 - }
738 - }
739 - catch (_b) {
740 - // Failed to clone iframe
741 - }
742 - return iframe.cloneNode(false);
743 -}
744 -async function cloneSingleNode(node, options) {
745 - if ((0,_util__WEBPACK_IMPORTED_MODULE_1__.isInstanceOfElement)(node, HTMLCanvasElement)) {
746 - return cloneCanvasElement(node);
747 - }
748 - if ((0,_util__WEBPACK_IMPORTED_MODULE_1__.isInstanceOfElement)(node, HTMLVideoElement)) {
749 - return cloneVideoElement(node, options);
750 - }
751 - if ((0,_util__WEBPACK_IMPORTED_MODULE_1__.isInstanceOfElement)(node, HTMLIFrameElement)) {
752 - return cloneIFrameElement(node, options);
753 - }
754 - return node.cloneNode(isSVGElement(node));
755 -}
756 -const isSlotElement = (node) => node.tagName != null && node.tagName.toUpperCase() === 'SLOT';
757 -const isSVGElement = (node) => node.tagName != null && node.tagName.toUpperCase() === 'SVG';
758 -async function cloneChildren(nativeNode, clonedNode, options) {
759 - var _a, _b;
760 - if (isSVGElement(clonedNode)) {
761 - return clonedNode;
762 - }
763 - let children = [];
764 - if (isSlotElement(nativeNode) && nativeNode.assignedNodes) {
765 - children = (0,_util__WEBPACK_IMPORTED_MODULE_1__.toArray)(nativeNode.assignedNodes());
766 - }
767 - else if ((0,_util__WEBPACK_IMPORTED_MODULE_1__.isInstanceOfElement)(nativeNode, HTMLIFrameElement) &&
768 - ((_a = nativeNode.contentDocument) === null || _a === void 0 ? void 0 : _a.body)) {
769 - children = (0,_util__WEBPACK_IMPORTED_MODULE_1__.toArray)(nativeNode.contentDocument.body.childNodes);
770 - }
771 - else {
772 - children = (0,_util__WEBPACK_IMPORTED_MODULE_1__.toArray)(((_b = nativeNode.shadowRoot) !== null && _b !== void 0 ? _b : nativeNode).childNodes);
773 - }
774 - if (children.length === 0 ||
775 - (0,_util__WEBPACK_IMPORTED_MODULE_1__.isInstanceOfElement)(nativeNode, HTMLVideoElement)) {
776 - return clonedNode;
777 - }
778 - await children.reduce((deferred, child) => deferred
779 - .then(() => cloneNode(child, options))
780 - .then((clonedChild) => {
781 - if (clonedChild) {
782 - clonedNode.appendChild(clonedChild);
783 - }
784 - }), Promise.resolve());
785 - return clonedNode;
786 -}
787 -function cloneCSSStyle(nativeNode, clonedNode, options) {
788 - const targetStyle = clonedNode.style;
789 - if (!targetStyle) {
790 - return;
791 - }
792 - const sourceStyle = window.getComputedStyle(nativeNode);
793 - if (sourceStyle.cssText) {
794 - targetStyle.cssText = sourceStyle.cssText;
795 - targetStyle.transformOrigin = sourceStyle.transformOrigin;
796 - }
797 - else {
798 - (0,_util__WEBPACK_IMPORTED_MODULE_1__.getStyleProperties)(options).forEach((name) => {
799 - let value = sourceStyle.getPropertyValue(name);
800 - if (name === 'font-size' && value.endsWith('px')) {
801 - const reducedFont = Math.floor(parseFloat(value.substring(0, value.length - 2))) - 0.1;
802 - value = `${reducedFont}px`;
803 - }
804 - if ((0,_util__WEBPACK_IMPORTED_MODULE_1__.isInstanceOfElement)(nativeNode, HTMLIFrameElement) &&
805 - name === 'display' &&
806 - value === 'inline') {
807 - value = 'block';
808 - }
809 - if (name === 'd' && clonedNode.getAttribute('d')) {
810 - value = `path(${clonedNode.getAttribute('d')})`;
811 - }
812 - targetStyle.setProperty(name, value, sourceStyle.getPropertyPriority(name));
813 - });
814 - }
815 -}
816 -function cloneInputValue(nativeNode, clonedNode) {
817 - if ((0,_util__WEBPACK_IMPORTED_MODULE_1__.isInstanceOfElement)(nativeNode, HTMLTextAreaElement)) {
818 - clonedNode.innerHTML = nativeNode.value;
819 - }
820 - if ((0,_util__WEBPACK_IMPORTED_MODULE_1__.isInstanceOfElement)(nativeNode, HTMLInputElement)) {
821 - clonedNode.setAttribute('value', nativeNode.value);
822 - }
823 -}
824 -function cloneSelectValue(nativeNode, clonedNode) {
825 - if ((0,_util__WEBPACK_IMPORTED_MODULE_1__.isInstanceOfElement)(nativeNode, HTMLSelectElement)) {
826 - const clonedSelect = clonedNode;
827 - const selectedOption = Array.from(clonedSelect.children).find((child) => nativeNode.value === child.getAttribute('value'));
828 - if (selectedOption) {
829 - selectedOption.setAttribute('selected', '');
830 - }
831 - }
832 -}
833 -function decorate(nativeNode, clonedNode, options) {
834 - if ((0,_util__WEBPACK_IMPORTED_MODULE_1__.isInstanceOfElement)(clonedNode, Element)) {
835 - cloneCSSStyle(nativeNode, clonedNode, options);
836 - (0,_clone_pseudos__WEBPACK_IMPORTED_MODULE_0__.clonePseudoElements)(nativeNode, clonedNode, options);
837 - cloneInputValue(nativeNode, clonedNode);
838 - cloneSelectValue(nativeNode, clonedNode);
839 - }
840 - return clonedNode;
841 -}
842 -async function ensureSVGSymbols(clone, options) {
843 - const uses = clone.querySelectorAll ? clone.querySelectorAll('use') : [];
844 - if (uses.length === 0) {
845 - return clone;
846 - }
847 - const processedDefs = {};
848 - for (let i = 0; i < uses.length; i++) {
849 - const use = uses[i];
850 - const id = use.getAttribute('xlink:href');
851 - if (id) {
852 - const exist = clone.querySelector(id);
853 - const definition = document.querySelector(id);
854 - if (!exist && definition && !processedDefs[id]) {
855 - // eslint-disable-next-line no-await-in-loop
856 - processedDefs[id] = (await cloneNode(definition, options, true));
857 - }
858 - }
859 - }
860 - const nodes = Object.values(processedDefs);
861 - if (nodes.length) {
862 - const ns = 'http://www.w3.org/1999/xhtml';
863 - const svg = document.createElementNS(ns, 'svg');
864 - svg.setAttribute('xmlns', ns);
865 - svg.style.position = 'absolute';
866 - svg.style.width = '0';
867 - svg.style.height = '0';
868 - svg.style.overflow = 'hidden';
869 - svg.style.display = 'none';
870 - const defs = document.createElementNS(ns, 'defs');
871 - svg.appendChild(defs);
872 - for (let i = 0; i < nodes.length; i++) {
873 - defs.appendChild(nodes[i]);
874 - }
875 - clone.appendChild(svg);
876 - }
877 - return clone;
878 -}
879 -async function cloneNode(node, options, isRoot) {
880 - if (!isRoot && options.filter && !options.filter(node)) {
881 - return null;
882 - }
883 - return Promise.resolve(node)
884 - .then((clonedNode) => cloneSingleNode(clonedNode, options))
885 - .then((clonedNode) => cloneChildren(node, clonedNode, options))
886 - .then((clonedNode) => decorate(node, clonedNode, options))
887 - .then((clonedNode) => ensureSVGSymbols(clonedNode, options));
888 -}
889 -//# sourceMappingURL=clone-node.js.map
890 -
891 -/***/ }),
892 -
893 -/***/ "../node_modules/html-to-image/es/clone-pseudos.js":
894 -/*!*********************************************************!*\
895 - !*** ../node_modules/html-to-image/es/clone-pseudos.js ***!
896 - \*********************************************************/
897 -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
898 -
899 -"use strict";
900 -__webpack_require__.r(__webpack_exports__);
901 -/* harmony export */ __webpack_require__.d(__webpack_exports__, {
902 -/* harmony export */ clonePseudoElements: () => (/* binding */ clonePseudoElements)
903 -/* harmony export */ });
904 -/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./util */ "../node_modules/html-to-image/es/util.js");
905 -
906 -function formatCSSText(style) {
907 - const content = style.getPropertyValue('content');
908 - return `${style.cssText} content: '${content.replace(/'|"/g, '')}';`;
909 -}
910 -function formatCSSProperties(style, options) {
911 - return (0,_util__WEBPACK_IMPORTED_MODULE_0__.getStyleProperties)(options)
912 - .map((name) => {
913 - const value = style.getPropertyValue(name);
914 - const priority = style.getPropertyPriority(name);
915 - return `${name}: ${value}${priority ? ' !important' : ''};`;
916 - })
917 - .join(' ');
918 -}
919 -function getPseudoElementStyle(className, pseudo, style, options) {
920 - const selector = `.${className}:${pseudo}`;
921 - const cssText = style.cssText
922 - ? formatCSSText(style)
923 - : formatCSSProperties(style, options);
924 - return document.createTextNode(`${selector}{${cssText}}`);
925 -}
926 -function clonePseudoElement(nativeNode, clonedNode, pseudo, options) {
927 - const style = window.getComputedStyle(nativeNode, pseudo);
928 - const content = style.getPropertyValue('content');
929 - if (content === '' || content === 'none') {
930 - return;
931 - }
932 - const className = (0,_util__WEBPACK_IMPORTED_MODULE_0__.uuid)();
933 - try {
934 - clonedNode.className = `${clonedNode.className} ${className}`;
935 - }
936 - catch (err) {
937 - return;
938 - }
939 - const styleElement = document.createElement('style');
940 - styleElement.appendChild(getPseudoElementStyle(className, pseudo, style, options));
941 - clonedNode.appendChild(styleElement);
942 -}
943 -function clonePseudoElements(nativeNode, clonedNode, options) {
944 - clonePseudoElement(nativeNode, clonedNode, ':before', options);
945 - clonePseudoElement(nativeNode, clonedNode, ':after', options);
946 -}
947 -//# sourceMappingURL=clone-pseudos.js.map
948 -
949 -/***/ }),
950 -
951 -/***/ "../node_modules/html-to-image/es/dataurl.js":
952 -/*!***************************************************!*\
953 - !*** ../node_modules/html-to-image/es/dataurl.js ***!
954 - \***************************************************/
955 -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
956 -
957 -"use strict";
958 -__webpack_require__.r(__webpack_exports__);
959 -/* harmony export */ __webpack_require__.d(__webpack_exports__, {
960 -/* harmony export */ fetchAsDataURL: () => (/* binding */ fetchAsDataURL),
961 -/* harmony export */ isDataUrl: () => (/* binding */ isDataUrl),
962 -/* harmony export */ makeDataUrl: () => (/* binding */ makeDataUrl),
963 -/* harmony export */ resourceToDataURL: () => (/* binding */ resourceToDataURL)
964 -/* harmony export */ });
965 -function getContentFromDataUrl(dataURL) {
966 - return dataURL.split(/,/)[1];
967 -}
968 -function isDataUrl(url) {
969 - return url.search(/^(data:)/) !== -1;
970 -}
971 -function makeDataUrl(content, mimeType) {
972 - return `data:${mimeType};base64,${content}`;
973 -}
974 -async function fetchAsDataURL(url, init, process) {
975 - const res = await fetch(url, init);
976 - if (res.status === 404) {
977 - throw new Error(`Resource "${res.url}" not found`);
978 - }
979 - const blob = await res.blob();
980 - return new Promise((resolve, reject) => {
981 - const reader = new FileReader();
982 - reader.onerror = reject;
983 - reader.onloadend = () => {
984 - try {
985 - resolve(process({ res, result: reader.result }));
986 - }
987 - catch (error) {
988 - reject(error);
989 - }
990 - };
991 - reader.readAsDataURL(blob);
992 - });
993 -}
994 -const cache = {};
995 -function getCacheKey(url, contentType, includeQueryParams) {
996 - let key = url.replace(/\?.*/, '');
997 - if (includeQueryParams) {
998 - key = url;
999 - }
1000 - // font resource
1001 - if (/ttf|otf|eot|woff2?/i.test(key)) {
1002 - key = key.replace(/.*\//, '');
1003 - }
1004 - return contentType ? `[${contentType}]${key}` : key;
1005 -}
1006 -async function resourceToDataURL(resourceUrl, contentType, options) {
1007 - const cacheKey = getCacheKey(resourceUrl, contentType, options.includeQueryParams);
1008 - if (cache[cacheKey] != null) {
1009 - return cache[cacheKey];
1010 - }
1011 - // ref: https://developer.mozilla.org/en/docs/Web/API/XMLHttpRequest/Using_XMLHttpRequest#Bypassing_the_cache
1012 - if (options.cacheBust) {
1013 - // eslint-disable-next-line no-param-reassign
1014 - resourceUrl += (/\?/.test(resourceUrl) ? '&' : '?') + new Date().getTime();
1015 - }
1016 - let dataURL;
1017 - try {
1018 - const content = await fetchAsDataURL(resourceUrl, options.fetchRequestInit, ({ res, result }) => {
1019 - if (!contentType) {
1020 - // eslint-disable-next-line no-param-reassign
1021 - contentType = res.headers.get('Content-Type') || '';
1022 - }
1023 - return getContentFromDataUrl(result);
1024 - });
1025 - dataURL = makeDataUrl(content, contentType);
1026 - }
1027 - catch (error) {
1028 - dataURL = options.imagePlaceholder || '';
1029 - let msg = `Failed to fetch resource: ${resourceUrl}`;
1030 - if (error) {
1031 - msg = typeof error === 'string' ? error : error.message;
1032 - }
1033 - if (msg) {
1034 - console.warn(msg);
1035 - }
1036 - }
1037 - cache[cacheKey] = dataURL;
1038 - return dataURL;
1039 -}
1040 -//# sourceMappingURL=dataurl.js.map
1041 -
1042 -/***/ }),
1043 -
1044 -/***/ "../node_modules/html-to-image/es/embed-images.js":
1045 -/*!********************************************************!*\
1046 - !*** ../node_modules/html-to-image/es/embed-images.js ***!
1047 - \********************************************************/
1048 -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1049 -
1050 -"use strict";
1051 -__webpack_require__.r(__webpack_exports__);
1052 -/* harmony export */ __webpack_require__.d(__webpack_exports__, {
1053 -/* harmony export */ embedImages: () => (/* binding */ embedImages)
1054 -/* harmony export */ });
1055 -/* harmony import */ var _embed_resources__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./embed-resources */ "../node_modules/html-to-image/es/embed-resources.js");
1056 -/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./util */ "../node_modules/html-to-image/es/util.js");
1057 -/* harmony import */ var _dataurl__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./dataurl */ "../node_modules/html-to-image/es/dataurl.js");
1058 -/* harmony import */ var _mimes__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./mimes */ "../node_modules/html-to-image/es/mimes.js");
1059 -
1060 -
1061 -
1062 -
1063 -async function embedProp(propName, node, options) {
1064 - var _a;
1065 - const propValue = (_a = node.style) === null || _a === void 0 ? void 0 : _a.getPropertyValue(propName);
1066 - if (propValue) {
1067 - const cssString = await (0,_embed_resources__WEBPACK_IMPORTED_MODULE_0__.embedResources)(propValue, null, options);
1068 - node.style.setProperty(propName, cssString, node.style.getPropertyPriority(propName));
1069 - return true;
1070 - }
1071 - return false;
1072 -}
1073 -async function embedBackground(clonedNode, options) {
1074 - ;
1075 - (await embedProp('background', clonedNode, options)) ||
1076 - (await embedProp('background-image', clonedNode, options));
1077 - (await embedProp('mask', clonedNode, options)) ||
1078 - (await embedProp('-webkit-mask', clonedNode, options)) ||
1079 - (await embedProp('mask-image', clonedNode, options)) ||
1080 - (await embedProp('-webkit-mask-image', clonedNode, options));
1081 -}
1082 -async function embedImageNode(clonedNode, options) {
1083 - const isImageElement = (0,_util__WEBPACK_IMPORTED_MODULE_1__.isInstanceOfElement)(clonedNode, HTMLImageElement);
1084 - if (!(isImageElement && !(0,_dataurl__WEBPACK_IMPORTED_MODULE_2__.isDataUrl)(clonedNode.src)) &&
1085 - !((0,_util__WEBPACK_IMPORTED_MODULE_1__.isInstanceOfElement)(clonedNode, SVGImageElement) &&
1086 - !(0,_dataurl__WEBPACK_IMPORTED_MODULE_2__.isDataUrl)(clonedNode.href.baseVal))) {
1087 - return;
1088 - }
1089 - const url = isImageElement ? clonedNode.src : clonedNode.href.baseVal;
1090 - const dataURL = await (0,_dataurl__WEBPACK_IMPORTED_MODULE_2__.resourceToDataURL)(url, (0,_mimes__WEBPACK_IMPORTED_MODULE_3__.getMimeType)(url), options);
1091 - await new Promise((resolve, reject) => {
1092 - clonedNode.onload = resolve;
1093 - clonedNode.onerror = options.onImageErrorHandler
1094 - ? (...attributes) => {
1095 - try {
1096 - resolve(options.onImageErrorHandler(...attributes));
1097 - }
1098 - catch (error) {
1099 - reject(error);
1100 - }
1101 - }
1102 - : reject;
1103 - const image = clonedNode;
1104 - if (image.decode) {
1105 - image.decode = resolve;
1106 - }
1107 - if (image.loading === 'lazy') {
1108 - image.loading = 'eager';
1109 - }
1110 - if (isImageElement) {
1111 - clonedNode.srcset = '';
1112 - clonedNode.src = dataURL;
1113 - }
1114 - else {
1115 - clonedNode.href.baseVal = dataURL;
1116 - }
1117 - });
1118 -}
1119 -async function embedChildren(clonedNode, options) {
1120 - const children = (0,_util__WEBPACK_IMPORTED_MODULE_1__.toArray)(clonedNode.childNodes);
1121 - const deferreds = children.map((child) => embedImages(child, options));
1122 - await Promise.all(deferreds).then(() => clonedNode);
1123 -}
1124 -async function embedImages(clonedNode, options) {
1125 - if ((0,_util__WEBPACK_IMPORTED_MODULE_1__.isInstanceOfElement)(clonedNode, Element)) {
1126 - await embedBackground(clonedNode, options);
1127 - await embedImageNode(clonedNode, options);
1128 - await embedChildren(clonedNode, options);
1129 - }
1130 -}
1131 -//# sourceMappingURL=embed-images.js.map
1132 -
1133 -/***/ }),
1134 -
1135 -/***/ "../node_modules/html-to-image/es/embed-resources.js":
1136 -/*!***********************************************************!*\
1137 - !*** ../node_modules/html-to-image/es/embed-resources.js ***!
1138 - \***********************************************************/
1139 -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1140 -
1141 -"use strict";
1142 -__webpack_require__.r(__webpack_exports__);
1143 -/* harmony export */ __webpack_require__.d(__webpack_exports__, {
1144 -/* harmony export */ embed: () => (/* binding */ embed),
1145 -/* harmony export */ embedResources: () => (/* binding */ embedResources),
1146 -/* harmony export */ parseURLs: () => (/* binding */ parseURLs),
1147 -/* harmony export */ shouldEmbed: () => (/* binding */ shouldEmbed)
1148 -/* harmony export */ });
1149 -/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./util */ "../node_modules/html-to-image/es/util.js");
1150 -/* harmony import */ var _mimes__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./mimes */ "../node_modules/html-to-image/es/mimes.js");
1151 -/* harmony import */ var _dataurl__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./dataurl */ "../node_modules/html-to-image/es/dataurl.js");
1152 -
1153 -
1154 -
1155 -const URL_REGEX = /url\((['"]?)([^'"]+?)\1\)/g;
1156 -const URL_WITH_FORMAT_REGEX = /url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g;
1157 -const FONT_SRC_REGEX = /src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;
1158 -function toRegex(url) {
1159 - // eslint-disable-next-line no-useless-escape
1160 - const escaped = url.replace(/([.*+?^${}()|\[\]\/\\])/g, '\\$1');
1161 - return new RegExp(`(url\\(['"]?)(${escaped})(['"]?\\))`, 'g');
1162 -}
1163 -function parseURLs(cssText) {
1164 - const urls = [];
1165 - cssText.replace(URL_REGEX, (raw, quotation, url) => {
1166 - urls.push(url);
1167 - return raw;
1168 - });
1169 - return urls.filter((url) => !(0,_dataurl__WEBPACK_IMPORTED_MODULE_2__.isDataUrl)(url));
1170 -}
1171 -async function embed(cssText, resourceURL, baseURL, options, getContentFromUrl) {
1172 - try {
1173 - const resolvedURL = baseURL ? (0,_util__WEBPACK_IMPORTED_MODULE_0__.resolveUrl)(resourceURL, baseURL) : resourceURL;
1174 - const contentType = (0,_mimes__WEBPACK_IMPORTED_MODULE_1__.getMimeType)(resourceURL);
1175 - let dataURL;
1176 - if (getContentFromUrl) {
1177 - const content = await getContentFromUrl(resolvedURL);
1178 - dataURL = (0,_dataurl__WEBPACK_IMPORTED_MODULE_2__.makeDataUrl)(content, contentType);
1179 - }
1180 - else {
1181 - dataURL = await (0,_dataurl__WEBPACK_IMPORTED_MODULE_2__.resourceToDataURL)(resolvedURL, contentType, options);
1182 - }
1183 - return cssText.replace(toRegex(resourceURL), `$1${dataURL}$3`);
1184 - }
1185 - catch (error) {
1186 - // pass
1187 - }
1188 - return cssText;
1189 -}
1190 -function filterPreferredFontFormat(str, { preferredFontFormat }) {
1191 - return !preferredFontFormat
1192 - ? str
1193 - : str.replace(FONT_SRC_REGEX, (match) => {
1194 - // eslint-disable-next-line no-constant-condition
1195 - while (true) {
1196 - const [src, , format] = URL_WITH_FORMAT_REGEX.exec(match) || [];
1197 - if (!format) {
1198 - return '';
1199 - }
1200 - if (format === preferredFontFormat) {
1201 - return `src: ${src};`;
1202 - }
1203 - }
1204 - });
1205 -}
1206 -function shouldEmbed(url) {
1207 - return url.search(URL_REGEX) !== -1;
1208 -}
1209 -async function embedResources(cssText, baseUrl, options) {
1210 - if (!shouldEmbed(cssText)) {
1211 - return cssText;
1212 - }
1213 - const filteredCSSText = filterPreferredFontFormat(cssText, options);
1214 - const urls = parseURLs(filteredCSSText);
1215 - return urls.reduce((deferred, url) => deferred.then((css) => embed(css, url, baseUrl, options)), Promise.resolve(filteredCSSText));
1216 -}
1217 -//# sourceMappingURL=embed-resources.js.map
1218 -
1219 -/***/ }),
1220 -
1221 -/***/ "../node_modules/html-to-image/es/embed-webfonts.js":
1222 -/*!**********************************************************!*\
1223 - !*** ../node_modules/html-to-image/es/embed-webfonts.js ***!
1224 - \**********************************************************/
1225 -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1226 -
1227 -"use strict";
1228 -__webpack_require__.r(__webpack_exports__);
1229 -/* harmony export */ __webpack_require__.d(__webpack_exports__, {
1230 -/* harmony export */ embedWebFonts: () => (/* binding */ embedWebFonts),
1231 -/* harmony export */ getWebFontCSS: () => (/* binding */ getWebFontCSS)
1232 -/* harmony export */ });
1233 -/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./util */ "../node_modules/html-to-image/es/util.js");
1234 -/* harmony import */ var _dataurl__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./dataurl */ "../node_modules/html-to-image/es/dataurl.js");
1235 -/* harmony import */ var _embed_resources__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./embed-resources */ "../node_modules/html-to-image/es/embed-resources.js");
1236 -
1237 -
1238 -
1239 -const cssFetchCache = {};
1240 -async function fetchCSS(url) {
1241 - let cache = cssFetchCache[url];
1242 - if (cache != null) {
1243 - return cache;
1244 - }
1245 - const res = await fetch(url);
1246 - const cssText = await res.text();
1247 - cache = { url, cssText };
1248 - cssFetchCache[url] = cache;
1249 - return cache;
1250 -}
1251 -async function embedFonts(data, options) {
1252 - let cssText = data.cssText;
1253 - const regexUrl = /url\(["']?([^"')]+)["']?\)/g;
1254 - const fontLocs = cssText.match(/url\([^)]+\)/g) || [];
1255 - const loadFonts = fontLocs.map(async (loc) => {
1256 - let url = loc.replace(regexUrl, '$1');
1257 - if (!url.startsWith('https://')) {
1258 - url = new URL(url, data.url).href;
1259 - }
1260 - return (0,_dataurl__WEBPACK_IMPORTED_MODULE_1__.fetchAsDataURL)(url, options.fetchRequestInit, ({ result }) => {
1261 - cssText = cssText.replace(loc, `url(${result})`);
1262 - return [loc, result];
1263 - });
1264 - });
1265 - return Promise.all(loadFonts).then(() => cssText);
1266 -}
1267 -function parseCSS(source) {
1268 - if (source == null) {
1269 - return [];
1270 - }
1271 - const result = [];
1272 - const commentsRegex = /(\/\*[\s\S]*?\*\/)/gi;
1273 - // strip out comments
1274 - let cssText = source.replace(commentsRegex, '');
1275 - // eslint-disable-next-line prefer-regex-literals
1276 - const keyframesRegex = new RegExp('((@.*?keyframes [\\s\\S]*?){([\\s\\S]*?}\\s*?)})', 'gi');
1277 - // eslint-disable-next-line no-constant-condition
1278 - while (true) {
1279 - const matches = keyframesRegex.exec(cssText);
1280 - if (matches === null) {
1281 - break;
1282 - }
1283 - result.push(matches[0]);
1284 - }
1285 - cssText = cssText.replace(keyframesRegex, '');
1286 - const importRegex = /@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi;
1287 - // to match css & media queries together
1288 - const combinedCSSRegex = '((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]' +
1289 - '*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})';
1290 - // unified regex
1291 - const unifiedRegex = new RegExp(combinedCSSRegex, 'gi');
1292 - // eslint-disable-next-line no-constant-condition
1293 - while (true) {
1294 - let matches = importRegex.exec(cssText);
1295 - if (matches === null) {
1296 - matches = unifiedRegex.exec(cssText);
1297 - if (matches === null) {
1298 - break;
1299 - }
1300 - else {
1301 - importRegex.lastIndex = unifiedRegex.lastIndex;
1302 - }
1303 - }
1304 - else {
1305 - unifiedRegex.lastIndex = importRegex.lastIndex;
1306 - }
1307 - result.push(matches[0]);
1308 - }
1309 - return result;
1310 -}
1311 -async function getCSSRules(styleSheets, options) {
1312 - const ret = [];
1313 - const deferreds = [];
1314 - // First loop inlines imports
1315 - styleSheets.forEach((sheet) => {
1316 - if ('cssRules' in sheet) {
1317 - try {
1318 - (0,_util__WEBPACK_IMPORTED_MODULE_0__.toArray)(sheet.cssRules || []).forEach((item, index) => {
1319 - if (item.type === CSSRule.IMPORT_RULE) {
1320 - let importIndex = index + 1;
1321 - const url = item.href;
1322 - const deferred = fetchCSS(url)
1323 - .then((metadata) => embedFonts(metadata, options))
1324 - .then((cssText) => parseCSS(cssText).forEach((rule) => {
1325 - try {
1326 - sheet.insertRule(rule, rule.startsWith('@import')
1327 - ? (importIndex += 1)
1328 - : sheet.cssRules.length);
1329 - }
1330 - catch (error) {
1331 - console.error('Error inserting rule from remote css', {
1332 - rule,
1333 - error,
1334 - });
1335 - }
1336 - }))
1337 - .catch((e) => {
1338 - console.error('Error loading remote css', e.toString());
1339 - });
1340 - deferreds.push(deferred);
1341 - }
1342 - });
1343 - }
1344 - catch (e) {
1345 - const inline = styleSheets.find((a) => a.href == null) || document.styleSheets[0];
1346 - if (sheet.href != null) {
1347 - deferreds.push(fetchCSS(sheet.href)
1348 - .then((metadata) => embedFonts(metadata, options))
1349 - .then((cssText) => parseCSS(cssText).forEach((rule) => {
1350 - inline.insertRule(rule, inline.cssRules.length);
1351 - }))
1352 - .catch((err) => {
1353 - console.error('Error loading remote stylesheet', err);
1354 - }));
1355 - }
1356 - console.error('Error inlining remote css file', e);
1357 - }
1358 - }
1359 - });
1360 - return Promise.all(deferreds).then(() => {
1361 - // Second loop parses rules
1362 - styleSheets.forEach((sheet) => {
1363 - if ('cssRules' in sheet) {
1364 - try {
1365 - (0,_util__WEBPACK_IMPORTED_MODULE_0__.toArray)(sheet.cssRules || []).forEach((item) => {
1366 - ret.push(item);
1367 - });
1368 - }
1369 - catch (e) {
1370 - console.error(`Error while reading CSS rules from ${sheet.href}`, e);
1371 - }
1372 - }
1373 - });
1374 - return ret;
1375 - });
1376 -}
1377 -function getWebFontRules(cssRules) {
1378 - return cssRules
1379 - .filter((rule) => rule.type === CSSRule.FONT_FACE_RULE)
1380 - .filter((rule) => (0,_embed_resources__WEBPACK_IMPORTED_MODULE_2__.shouldEmbed)(rule.style.getPropertyValue('src')));
1381 -}
1382 -async function parseWebFontRules(node, options) {
1383 - if (node.ownerDocument == null) {
1384 - throw new Error('Provided element is not within a Document');
1385 - }
1386 - const styleSheets = (0,_util__WEBPACK_IMPORTED_MODULE_0__.toArray)(node.ownerDocument.styleSheets);
1387 - const cssRules = await getCSSRules(styleSheets, options);
1388 - return getWebFontRules(cssRules);
1389 -}
1390 -function normalizeFontFamily(font) {
1391 - return font.trim().replace(/["']/g, '');
1392 -}
1393 -function getUsedFonts(node) {
1394 - const fonts = new Set();
1395 - function traverse(node) {
1396 - const fontFamily = node.style.fontFamily || getComputedStyle(node).fontFamily;
1397 - fontFamily.split(',').forEach((font) => {
1398 - fonts.add(normalizeFontFamily(font));
1399 - });
1400 - Array.from(node.children).forEach((child) => {
1401 - if (child instanceof HTMLElement) {
1402 - traverse(child);
1403 - }
1404 - });
1405 - }
1406 - traverse(node);
1407 - return fonts;
1408 -}
1409 -async function getWebFontCSS(node, options) {
1410 - const rules = await parseWebFontRules(node, options);
1411 - const usedFonts = getUsedFonts(node);
1412 - const cssTexts = await Promise.all(rules
1413 - .filter((rule) => usedFonts.has(normalizeFontFamily(rule.style.fontFamily)))
1414 - .map((rule) => {
1415 - const baseUrl = rule.parentStyleSheet
1416 - ? rule.parentStyleSheet.href
1417 - : null;
1418 - return (0,_embed_resources__WEBPACK_IMPORTED_MODULE_2__.embedResources)(rule.cssText, baseUrl, options);
1419 - }));
1420 - return cssTexts.join('\n');
1421 -}
1422 -async function embedWebFonts(clonedNode, options) {
1423 - const cssText = options.fontEmbedCSS != null
1424 - ? options.fontEmbedCSS
1425 - : options.skipFonts
1426 - ? null
1427 - : await getWebFontCSS(clonedNode, options);
1428 - if (cssText) {
1429 - const styleNode = document.createElement('style');
1430 - const sytleContent = document.createTextNode(cssText);
1431 - styleNode.appendChild(sytleContent);
1432 - if (clonedNode.firstChild) {
1433 - clonedNode.insertBefore(styleNode, clonedNode.firstChild);
1434 - }
1435 - else {
1436 - clonedNode.appendChild(styleNode);
1437 - }
1438 - }
1439 -}
1440 -//# sourceMappingURL=embed-webfonts.js.map
1441 -
1442 -/***/ }),
1443 -
1444 -/***/ "../node_modules/html-to-image/es/index.js":
1445 -/*!*************************************************!*\
1446 - !*** ../node_modules/html-to-image/es/index.js ***!
1447 - \*************************************************/
1448 -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1449 -
1450 -"use strict";
1451 -__webpack_require__.r(__webpack_exports__);
1452 -/* harmony export */ __webpack_require__.d(__webpack_exports__, {
1453 -/* harmony export */ getFontEmbedCSS: () => (/* binding */ getFontEmbedCSS),
1454 -/* harmony export */ toBlob: () => (/* binding */ toBlob),
1455 -/* harmony export */ toCanvas: () => (/* binding */ toCanvas),
1456 -/* harmony export */ toJpeg: () => (/* binding */ toJpeg),
1457 -/* harmony export */ toPixelData: () => (/* binding */ toPixelData),
1458 -/* harmony export */ toPng: () => (/* binding */ toPng),
1459 -/* harmony export */ toSvg: () => (/* binding */ toSvg)
1460 -/* harmony export */ });
1461 -/* harmony import */ var _clone_node__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./clone-node */ "../node_modules/html-to-image/es/clone-node.js");
1462 -/* harmony import */ var _embed_images__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./embed-images */ "../node_modules/html-to-image/es/embed-images.js");
1463 -/* harmony import */ var _apply_style__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./apply-style */ "../node_modules/html-to-image/es/apply-style.js");
1464 -/* harmony import */ var _embed_webfonts__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./embed-webfonts */ "../node_modules/html-to-image/es/embed-webfonts.js");
1465 -/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./util */ "../node_modules/html-to-image/es/util.js");
1466 -
1467 -
1468 -
1469 -
1470 -
1471 -async function toSvg(node, options = {}) {
1472 - const { width, height } = (0,_util__WEBPACK_IMPORTED_MODULE_4__.getImageSize)(node, options);
1473 - const clonedNode = (await (0,_clone_node__WEBPACK_IMPORTED_MODULE_0__.cloneNode)(node, options, true));
1474 - await (0,_embed_webfonts__WEBPACK_IMPORTED_MODULE_3__.embedWebFonts)(clonedNode, options);
1475 - await (0,_embed_images__WEBPACK_IMPORTED_MODULE_1__.embedImages)(clonedNode, options);
1476 - (0,_apply_style__WEBPACK_IMPORTED_MODULE_2__.applyStyle)(clonedNode, options);
1477 - const datauri = await (0,_util__WEBPACK_IMPORTED_MODULE_4__.nodeToDataURL)(clonedNode, width, height);
1478 - return datauri;
1479 -}
1480 -async function toCanvas(node, options = {}) {
1481 - const { width, height } = (0,_util__WEBPACK_IMPORTED_MODULE_4__.getImageSize)(node, options);
1482 - const svg = await toSvg(node, options);
1483 - const img = await (0,_util__WEBPACK_IMPORTED_MODULE_4__.createImage)(svg);
1484 - const canvas = document.createElement('canvas');
1485 - const context = canvas.getContext('2d');
1486 - const ratio = options.pixelRatio || (0,_util__WEBPACK_IMPORTED_MODULE_4__.getPixelRatio)();
1487 - const canvasWidth = options.canvasWidth || width;
1488 - const canvasHeight = options.canvasHeight || height;
1489 - canvas.width = canvasWidth * ratio;
1490 - canvas.height = canvasHeight * ratio;
1491 - if (!options.skipAutoScale) {
1492 - (0,_util__WEBPACK_IMPORTED_MODULE_4__.checkCanvasDimensions)(canvas);
1493 - }
1494 - canvas.style.width = `${canvasWidth}`;
1495 - canvas.style.height = `${canvasHeight}`;
1496 - if (options.backgroundColor) {
1497 - context.fillStyle = options.backgroundColor;
1498 - context.fillRect(0, 0, canvas.width, canvas.height);
1499 - }
1500 - context.drawImage(img, 0, 0, canvas.width, canvas.height);
1501 - return canvas;
1502 -}
1503 -async function toPixelData(node, options = {}) {
1504 - const { width, height } = (0,_util__WEBPACK_IMPORTED_MODULE_4__.getImageSize)(node, options);
1505 - const canvas = await toCanvas(node, options);
1506 - const ctx = canvas.getContext('2d');
1507 - return ctx.getImageData(0, 0, width, height).data;
1508 -}
1509 -async function toPng(node, options = {}) {
1510 - const canvas = await toCanvas(node, options);
1511 - return canvas.toDataURL();
1512 -}
1513 -async function toJpeg(node, options = {}) {
1514 - const canvas = await toCanvas(node, options);
1515 - return canvas.toDataURL('image/jpeg', options.quality || 1);
1516 -}
1517 -async function toBlob(node, options = {}) {
1518 - const canvas = await toCanvas(node, options);
1519 - const blob = await (0,_util__WEBPACK_IMPORTED_MODULE_4__.canvasToBlob)(canvas);
1520 - return blob;
1521 -}
1522 -async function getFontEmbedCSS(node, options = {}) {
1523 - return (0,_embed_webfonts__WEBPACK_IMPORTED_MODULE_3__.getWebFontCSS)(node, options);
1524 -}
1525 -//# sourceMappingURL=index.js.map
1526 -
1527 -/***/ }),
1528 -
1529 -/***/ "../node_modules/html-to-image/es/mimes.js":
1530 -/*!*************************************************!*\
1531 - !*** ../node_modules/html-to-image/es/mimes.js ***!
1532 - \*************************************************/
1533 -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1534 -
1535 -"use strict";
1536 -__webpack_require__.r(__webpack_exports__);
1537 -/* harmony export */ __webpack_require__.d(__webpack_exports__, {
1538 -/* harmony export */ getMimeType: () => (/* binding */ getMimeType)
1539 -/* harmony export */ });
1540 -const WOFF = 'application/font-woff';
1541 -const JPEG = 'image/jpeg';
1542 -const mimes = {
1543 - woff: WOFF,
1544 - woff2: WOFF,
1545 - ttf: 'application/font-truetype',
1546 - eot: 'application/vnd.ms-fontobject',
1547 - png: 'image/png',
1548 - jpg: JPEG,
1549 - jpeg: JPEG,
1550 - gif: 'image/gif',
1551 - tiff: 'image/tiff',
1552 - svg: 'image/svg+xml',
1553 - webp: 'image/webp',
1554 -};
1555 -function getExtension(url) {
1556 - const match = /\.([^./]*?)$/g.exec(url);
1557 - return match ? match[1] : '';
1558 -}
1559 -function getMimeType(url) {
1560 - const extension = getExtension(url).toLowerCase();
1561 - return mimes[extension] || '';
1562 -}
1563 -//# sourceMappingURL=mimes.js.map
1564 -
1565 -/***/ }),
1566 -
1567 -/***/ "../node_modules/html-to-image/es/util.js":
1568 -/*!************************************************!*\
1569 - !*** ../node_modules/html-to-image/es/util.js ***!
1570 - \************************************************/
1571 -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1572 -
1573 -"use strict";
1574 -__webpack_require__.r(__webpack_exports__);
1575 -/* harmony export */ __webpack_require__.d(__webpack_exports__, {
1576 -/* harmony export */ canvasToBlob: () => (/* binding */ canvasToBlob),
1577 -/* harmony export */ checkCanvasDimensions: () => (/* binding */ checkCanvasDimensions),
1578 -/* harmony export */ createImage: () => (/* binding */ createImage),
1579 -/* harmony export */ delay: () => (/* binding */ delay),
1580 -/* harmony export */ getImageSize: () => (/* binding */ getImageSize),
1581 -/* harmony export */ getPixelRatio: () => (/* binding */ getPixelRatio),
1582 -/* harmony export */ getStyleProperties: () => (/* binding */ getStyleProperties),
1583 -/* harmony export */ isInstanceOfElement: () => (/* binding */ isInstanceOfElement),
1584 -/* harmony export */ nodeToDataURL: () => (/* binding */ nodeToDataURL),
1585 -/* harmony export */ resolveUrl: () => (/* binding */ resolveUrl),
1586 -/* harmony export */ svgToDataURL: () => (/* binding */ svgToDataURL),
1587 -/* harmony export */ toArray: () => (/* binding */ toArray),
1588 -/* harmony export */ uuid: () => (/* binding */ uuid)
1589 -/* harmony export */ });
1590 -function resolveUrl(url, baseUrl) {
1591 - // url is absolute already
1592 - if (url.match(/^[a-z]+:\/\//i)) {
1593 - return url;
1594 - }
1595 - // url is absolute already, without protocol
1596 - if (url.match(/^\/\//)) {
1597 - return window.location.protocol + url;
1598 - }
1599 - // dataURI, mailto:, tel:, etc.
1600 - if (url.match(/^[a-z]+:/i)) {
1601 - return url;
1602 - }
1603 - const doc = document.implementation.createHTMLDocument();
1604 - const base = doc.createElement('base');
1605 - const a = doc.createElement('a');
1606 - doc.head.appendChild(base);
1607 - doc.body.appendChild(a);
1608 - if (baseUrl) {
1609 - base.href = baseUrl;
1610 - }
1611 - a.href = url;
1612 - return a.href;
1613 -}
1614 -const uuid = (() => {
1615 - // generate uuid for className of pseudo elements.
1616 - // We should not use GUIDs, otherwise pseudo elements sometimes cannot be captured.
1617 - let counter = 0;
1618 - // ref: http://stackoverflow.com/a/6248722/2519373
1619 - const random = () =>
1620 - // eslint-disable-next-line no-bitwise
1621 - `0000${((Math.random() * 36 ** 4) << 0).toString(36)}`.slice(-4);
1622 - return () => {
1623 - counter += 1;
1624 - return `u${random()}${counter}`;
1625 - };
1626 -})();
1627 -function delay(ms) {
1628 - return (args) => new Promise((resolve) => {
1629 - setTimeout(() => resolve(args), ms);
1630 - });
1631 -}
1632 -function toArray(arrayLike) {
1633 - const arr = [];
1634 - for (let i = 0, l = arrayLike.length; i < l; i++) {
1635 - arr.push(arrayLike[i]);
1636 - }
1637 - return arr;
1638 -}
1639 -let styleProps = null;
1640 -function getStyleProperties(options = {}) {
1641 - if (styleProps) {
1642 - return styleProps;
1643 - }
1644 - if (options.includeStyleProperties) {
1645 - styleProps = options.includeStyleProperties;
1646 - return styleProps;
1647 - }
1648 - styleProps = toArray(window.getComputedStyle(document.documentElement));
1649 - return styleProps;
1650 -}
1651 -function px(node, styleProperty) {
1652 - const win = node.ownerDocument.defaultView || window;
1653 - const val = win.getComputedStyle(node).getPropertyValue(styleProperty);
1654 - return val ? parseFloat(val.replace('px', '')) : 0;
1655 -}
1656 -function getNodeWidth(node) {
1657 - const leftBorder = px(node, 'border-left-width');
1658 - const rightBorder = px(node, 'border-right-width');
1659 - return node.clientWidth + leftBorder + rightBorder;
1660 -}
1661 -function getNodeHeight(node) {
1662 - const topBorder = px(node, 'border-top-width');
1663 - const bottomBorder = px(node, 'border-bottom-width');
1664 - return node.clientHeight + topBorder + bottomBorder;
1665 -}
1666 -function getImageSize(targetNode, options = {}) {
1667 - const width = options.width || getNodeWidth(targetNode);
1668 - const height = options.height || getNodeHeight(targetNode);
1669 - return { width, height };
1670 -}
1671 -function getPixelRatio() {
1672 - let ratio;
1673 - let FINAL_PROCESS;
1674 - try {
1675 - FINAL_PROCESS = process;
1676 - }
1677 - catch (e) {
1678 - // pass
1679 - }
1680 - const val = FINAL_PROCESS && FINAL_PROCESS.env
1681 - ? FINAL_PROCESS.env.devicePixelRatio
1682 - : null;
1683 - if (val) {
1684 - ratio = parseInt(val, 10);
1685 - if (Number.isNaN(ratio)) {
1686 - ratio = 1;
1687 - }
1688 - }
1689 - return ratio || window.devicePixelRatio || 1;
1690 -}
1691 -// @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/canvas#maximum_canvas_size
1692 -const canvasDimensionLimit = 16384;
1693 -function checkCanvasDimensions(canvas) {
1694 - if (canvas.width > canvasDimensionLimit ||
1695 - canvas.height > canvasDimensionLimit) {
1696 - if (canvas.width > canvasDimensionLimit &&
1697 - canvas.height > canvasDimensionLimit) {
1698 - if (canvas.width > canvas.height) {
1699 - canvas.height *= canvasDimensionLimit / canvas.width;
1700 - canvas.width = canvasDimensionLimit;
1701 - }
1702 - else {
1703 - canvas.width *= canvasDimensionLimit / canvas.height;
1704 - canvas.height = canvasDimensionLimit;
1705 - }
1706 - }
1707 - else if (canvas.width > canvasDimensionLimit) {
1708 - canvas.height *= canvasDimensionLimit / canvas.width;
1709 - canvas.width = canvasDimensionLimit;
1710 - }
1711 - else {
1712 - canvas.width *= canvasDimensionLimit / canvas.height;
1713 - canvas.height = canvasDimensionLimit;
1714 - }
1715 - }
1716 -}
1717 -function canvasToBlob(canvas, options = {}) {
1718 - if (canvas.toBlob) {
1719 - return new Promise((resolve) => {
1720 - canvas.toBlob(resolve, options.type ? options.type : 'image/png', options.quality ? options.quality : 1);
1721 - });
1722 - }
1723 - return new Promise((resolve) => {
1724 - const binaryString = window.atob(canvas
1725 - .toDataURL(options.type ? options.type : undefined, options.quality ? options.quality : undefined)
1726 - .split(',')[1]);
1727 - const len = binaryString.length;
1728 - const binaryArray = new Uint8Array(len);
1729 - for (let i = 0; i < len; i += 1) {
1730 - binaryArray[i] = binaryString.charCodeAt(i);
1731 - }
1732 - resolve(new Blob([binaryArray], {
1733 - type: options.type ? options.type : 'image/png',
1734 - }));
1735 - });
1736 -}
1737 -function createImage(url) {
1738 - return new Promise((resolve, reject) => {
1739 - const img = new Image();
1740 - img.onload = () => {
1741 - img.decode().then(() => {
1742 - requestAnimationFrame(() => resolve(img));
1743 - });
1744 - };
1745 - img.onerror = reject;
1746 - img.crossOrigin = 'anonymous';
1747 - img.decoding = 'async';
1748 - img.src = url;
1749 - });
1750 -}
1751 -async function svgToDataURL(svg) {
1752 - return Promise.resolve()
1753 - .then(() => new XMLSerializer().serializeToString(svg))
1754 - .then(encodeURIComponent)
1755 - .then((html) => `data:image/svg+xml;charset=utf-8,${html}`);
1756 -}
1757 -async function nodeToDataURL(node, width, height) {
1758 - const xmlns = 'http://www.w3.org/2000/svg';
1759 - const svg = document.createElementNS(xmlns, 'svg');
1760 - const foreignObject = document.createElementNS(xmlns, 'foreignObject');
1761 - svg.setAttribute('width', `${width}`);
1762 - svg.setAttribute('height', `${height}`);
1763 - svg.setAttribute('viewBox', `0 0 ${width} ${height}`);
1764 - foreignObject.setAttribute('width', '100%');
1765 - foreignObject.setAttribute('height', '100%');
1766 - foreignObject.setAttribute('x', '0');
1767 - foreignObject.setAttribute('y', '0');
1768 - foreignObject.setAttribute('externalResourcesRequired', 'true');
1769 - svg.appendChild(foreignObject);
1770 - foreignObject.appendChild(node);
1771 - return svgToDataURL(svg);
1772 -}
1773 -const isInstanceOfElement = (node, instance) => {
1774 - if (node instanceof instance)
1775 - return true;
1776 - const nodePrototype = Object.getPrototypeOf(node);
1777 - if (nodePrototype === null)
1778 - return false;
1779 - return (nodePrototype.constructor.name === instance.name ||
1780 - isInstanceOfElement(nodePrototype, instance));
1781 -};
1782 -//# sourceMappingURL=util.js.map
1783 -
1784 350 /***/ })
1785 351
1786 352 /******/ });
1787 353 /************************************************************************/
@@ -1809,38 +375,8 @@
1809 375 /******/ return module.exports;
1810 376 /******/ }
1811 377 /******/
1812 378 /************************************************************************/
1813 -/******/ /* webpack/runtime/define property getters */
1814 -/******/ (() => {
1815 -/******/ // define getter functions for harmony exports
1816 -/******/ __webpack_require__.d = (exports, definition) => {
1817 -/******/ for(var key in definition) {
1818 -/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
1819 -/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
1820 -/******/ }
1821 -/******/ }
1822 -/******/ };
1823 -/******/ })();
1824 -/******/
1825 -/******/ /* webpack/runtime/hasOwnProperty shorthand */
1826 -/******/ (() => {
1827 -/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
1828 -/******/ })();
1829 -/******/
1830 -/******/ /* webpack/runtime/make namespace object */
1831 -/******/ (() => {
1832 -/******/ // define __esModule on exports
1833 -/******/ __webpack_require__.r = (exports) => {
1834 -/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
1835 -/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
1836 -/******/ }
1837 -/******/ Object.defineProperty(exports, '__esModule', { value: true });
1838 -/******/ };
1839 -/******/ })();
1840 -/******/
1841 -/************************************************************************/
1842 -var __webpack_exports__ = {};
1843 379 // This entry needs to be wrapped in an IIFE because it needs to be in strict mode.
1844 380 (() => {
1845 381 "use strict";
1846 382 /*!****************************************************************!*\
@@ -1848,10 +384,10 @@
1848 384 \****************************************************************/
1849 385
1850 386
1851 387 var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
1852 -var _regenerator = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/regenerator */ "../node_modules/@babel/runtime/regenerator/index.js"));
1853 -var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ "../node_modules/@babel/runtime/helpers/asyncToGenerator.js"));
388 +var _readOnlyError2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/readOnlyError */ "../node_modules/@babel/runtime/helpers/readOnlyError.js"));
389 +var _toConsumableArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/toConsumableArray */ "../node_modules/@babel/runtime/helpers/toConsumableArray.js"));
1854 390 var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js"));
1855 391 var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
1856 392 var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
1857 393 var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
@@ -1857,9 +393,8 @@
1857 393 var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
1858 394 var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
1859 395 var _get2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/get */ "../node_modules/@babel/runtime/helpers/get.js"));
1860 396 var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
1861 -var _htmlToImage = __webpack_require__(/*! html-to-image */ "../node_modules/html-to-image/es/index.js");
1862 397 function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
1863 398 function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
1864 399 function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); }
1865 400 function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
@@ -1873,16 +408,27 @@
1873 408 (0, _inherits2.default)(Screenshot, _elementorModules$Vie);
1874 409 return (0, _createClass2.default)(Screenshot, [{
1875 410 key: "getDefaultSettings",
1876 411 value: function getDefaultSettings() {
412 + var _ElementorScreenshotC, _ElementorScreenshotC2;
1877 413 return _objectSpread({
414 + empty_content_headline: 'Empty Content.',
415 + crop: {
416 + width: ((_ElementorScreenshotC = ElementorScreenshotConfig) === null || _ElementorScreenshotC === void 0 || (_ElementorScreenshotC = _ElementorScreenshotC.crop) === null || _ElementorScreenshotC === void 0 ? void 0 : _ElementorScreenshotC.width) || 1200,
417 + height: ((_ElementorScreenshotC2 = ElementorScreenshotConfig) === null || _ElementorScreenshotC2 === void 0 || (_ElementorScreenshotC2 = _ElementorScreenshotC2.crop) === null || _ElementorScreenshotC2 === void 0 ? void 0 : _ElementorScreenshotC2.height) || 1500
418 + },
419 + excluded_external_css_urls: ['https://kit-pro.fontawesome.com'],
420 + external_images_urls: ['https://i.ytimg.com' // Youtube images domain.
421 + ],
1878 422 timeout: 15000,
1879 423 // Wait until screenshot taken or fail in 15 secs.
1880 424 render_timeout: 5000,
1881 425 // Wait until all the element will be loaded or 5 sec and then take screenshot.
1882 - image_quality: 0.15,
1883 - // Image quality for WebP compression
1884 - image_placeholder: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII='
426 + timerLabel: null,
427 + timer_label: "".concat(ElementorScreenshotConfig.post_id, " - timer"),
428 + image_placeholder: 'data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=',
429 + isDebug: elementorCommonConfig.isElementorDebug,
430 + isDebugSvg: false
1885 431 }, ElementorScreenshotConfig);
1886 432 }
1887 433 }, {
1888 434 key: "getDefaultElements",
@@ -1887,17 +433,22 @@
1887 433 }, {
1888 434 key: "getDefaultElements",
1889 435 value: function getDefaultElements() {
1890 436 var $elementor = jQuery(ElementorScreenshotConfig.selector);
437 + var $sections = $elementor.find('.elementor-section-wrap > .elementor-section, .elementor > .elementor-section');
1891 438 return {
1892 - $elementor: $elementor
439 + $elementor: $elementor,
440 + $sections: $sections,
441 + $firstSection: $sections.first(),
442 + $notElementorElements: elementorCommon.elements.$body.find('> *:not(style, link)').not($elementor),
443 + $head: jQuery('head')
1893 444 };
1894 445 }
1895 446 }, {
1896 447 key: "onInit",
1897 448 value: function onInit() {
1898 - var _this = this;
1899 449 _superPropGet(Screenshot, "onInit", this, 3)([]);
450 + this.log('Screenshot init', 'time');
1900 451
1901 452 /**
1902 453 * Hold the timeout timer
1903 454 *
@@ -1902,11 +453,9 @@
1902 453 * Hold the timeout timer
1903 454 *
1904 455 * @type {number|null}
1905 456 */
1906 - this.timeoutTimer = setTimeout(function () {
1907 - _this.screenshotFailed(new Error('Screenshot timeout reached'));
1908 - }, this.getSettings('timeout'));
457 + this.timeoutTimer = setTimeout(this.screenshotFailed.bind(this), this.getSettings('timeout'));
1909 458 return this.captureScreenshot();
1910 459 }
1911 460
1912 461 /**
@@ -1914,116 +463,270 @@
1914 463 */
1915 464 }, {
1916 465 key: "captureScreenshot",
1917 466 value: function captureScreenshot() {
467 + if (!this.elements.$elementor.length && !this.getSettings('kit_id')) {
468 + elementorCommon.helpers.consoleWarn('Screenshots: The content of this page is empty, the module will create a fake conent just for this screenshot.');
469 + this.createFakeContent();
470 + }
471 + this.removeUnnecessaryElements();
472 + this.handleIFrames();
473 + this.removeFirstSectionMargin();
474 + this.handleLinks();
475 + this.loadExternalCss();
476 + this.loadExternalImages();
477 + return Promise.resolve().then(this.createImage.bind(this)).then(this.createImageElement.bind(this)).then(this.cropCanvas.bind(this)).then(this.save.bind(this)).then(this.screenshotSucceed.bind(this)).catch(this.screenshotFailed.bind(this));
478 + }
479 +
480 + /**
481 + * Fake content for documents that dont have any content.
482 + */
483 + }, {
484 + key: "createFakeContent",
485 + value: function createFakeContent() {
486 + this.elements.$elementor = jQuery('<div>').css({
487 + height: this.getSettings('crop.height'),
488 + width: this.getSettings('crop.width'),
489 + display: 'flex',
490 + alignItems: 'center',
491 + justifyContent: 'center'
492 + });
493 + this.elements.$elementor.append(jQuery('<h1>').css({
494 + fontSize: '85px'
495 + }).html(this.getSettings('empty_content_headline')));
496 + document.body.prepend(this.elements.$elementor);
497 + }
498 +
499 + /**
500 + * CSS from another server cannot be loaded with the current dom to image library.
501 + * this method take all the links from another domain and proxy them.
502 + */
503 + }, {
504 + key: "loadExternalCss",
505 + value: function loadExternalCss() {
506 + var _this = this;
507 + var excludedUrls = [this.getSettings('home_url')].concat((0, _toConsumableArray2.default)(this.getSettings('excluded_external_css_urls')));
508 + var notSelector = excludedUrls.map(function (url) {
509 + return "[href^=\"".concat(url, "\"]");
510 + }).join(', ');
511 + jQuery('link').not(notSelector).each(function (index, el) {
512 + var $link = jQuery(el),
513 + $newLink = $link.clone();
514 + $newLink.attr('href', _this.getScreenshotProxyUrl($link.attr('href')));
515 + _this.elements.$head.append($newLink);
516 + $link.remove();
517 + });
518 + }
519 +
520 + /**
521 + * Make a proxy to images urls that has some problems with cross origin (like youtube).
522 + */
523 + }, {
524 + key: "loadExternalImages",
525 + value: function loadExternalImages() {
1918 526 var _this2 = this;
1919 - return Promise.resolve().then(function () {
1920 - return _this2.createImage();
1921 - }).then(function (imageData) {
1922 - return _this2.save(imageData);
1923 - }).then(function (url) {
1924 - return _this2.screenshotSucceed(url);
1925 - }).catch(function (error) {
1926 - return _this2.screenshotFailed(error);
527 + var selector = this.getSettings('external_images_urls').map(function (url) {
528 + return "img[src^=\"".concat(url, "\"]");
529 + }).join(', ');
530 + jQuery(selector).each(function (index, el) {
531 + var $img = jQuery(el);
532 + $img.attr('src', _this2.getScreenshotProxyUrl($img.attr('src')));
1927 533 });
1928 534 }
1929 535
1930 536 /**
1931 - * Creates a WebP image using html-to-image library.
537 + * Html to images libraries can not snapshot IFrames
538 + * this method convert all the IFrames to some other elements.
539 + */
540 + }, {
541 + key: "handleIFrames",
542 + value: function handleIFrames() {
543 + this.elements.$elementor.find('iframe').each(function (index, el) {
544 + var $iframe = jQuery(el),
545 + $iframeMask = jQuery('<div />', {
546 + css: {
547 + background: 'gray',
548 + width: $iframe.width(),
549 + height: $iframe.height()
550 + }
551 + });
552 + $iframe.before($iframeMask);
553 + $iframe.remove();
554 + });
555 + }
556 +
557 + /**
558 + * Remove all the sections that should not be in the screenshot.
559 + */
560 + }, {
561 + key: "removeUnnecessaryElements",
562 + value: function removeUnnecessaryElements() {
563 + var _this3 = this;
564 + var currentHeight = 0;
565 +
566 + // We need to keep all elements as for Kit we render the entire homepage
567 + if (this.getSettings('kit_id')) {
568 + return;
569 + }
570 + this.elements.$sections.filter(function (index, el) {
571 + var shouldBeRemoved = false;
572 + if (currentHeight >= _this3.getSettings('crop.height')) {
573 + shouldBeRemoved = true;
574 + }
575 + currentHeight += jQuery(el).outerHeight();
576 + return shouldBeRemoved;
577 + }).each(function (index, el) {
578 + el.remove();
579 + });
580 +
581 + // Some 3rd party plugins inject elements into the dom, so this method removes all
582 + // the elements that was injected, to make sure that it capture a screenshot only of the post itself.
583 + this.elements.$notElementorElements.remove();
584 + }
585 +
586 + /**
587 + * Some urls make some problems to the svg parser.
588 + * this method convert all the urls to just '/'.
589 + */
590 + }, {
591 + key: "handleLinks",
592 + value: function handleLinks() {
593 + elementorCommon.elements.$body.find('a').attr('href', '/');
594 + }
595 +
596 + /**
597 + * Remove unnecessary margin from the first element of the post (singles and footers).
598 + */
599 + }, {
600 + key: "removeFirstSectionMargin",
601 + value: function removeFirstSectionMargin() {
602 + this.elements.$firstSection.css({
603 + marginTop: 0
604 + });
605 + }
606 +
607 + /**
608 + * Creates a png image.
1932 609 *
1933 - * @return {Promise<string>} URI containing image data
610 + * @return {Promise<unknown>} URI containing image data
1934 611 */
1935 612 }, {
1936 613 key: "createImage",
1937 - value: (function () {
1938 - var _createImage = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee() {
1939 - var _this3 = this;
1940 - var pageLoadedPromise, timeOutPromise, $elementorElement, bodyStyle, bodyBackgroundColor, canvas;
1941 - return _regenerator.default.wrap(function (_context) {
1942 - while (1) switch (_context.prev = _context.next) {
1943 - case 0:
1944 - pageLoadedPromise = new Promise(function (resolve) {
1945 - window.addEventListener('load', function () {
1946 - return resolve();
1947 - });
1948 - });
1949 - timeOutPromise = new Promise(function (resolve) {
1950 - setTimeout(function () {
1951 - return resolve();
1952 - }, _this3.getSettings('render_timeout'));
1953 - });
1954 - _context.next = 1;
1955 - return Promise.race([pageLoadedPromise, timeOutPromise]);
1956 - case 1:
1957 - $elementorElement = this.elements.$elementor;
1958 - if (!$elementorElement.length) {
1959 - $elementorElement = jQuery(ElementorScreenshotConfig.selector);
1960 - }
1961 - if (!$elementorElement.length) {
1962 - $elementorElement = jQuery('body > div.elementor:not(.elementor-location-header):not(.elementor-location-footer)');
1963 - }
1964 - if ($elementorElement.length) {
1965 - _context.next = 2;
1966 - break;
1967 - }
1968 - throw new Error('Elementor container not found. Selector: ' + ElementorScreenshotConfig.selector);
1969 - case 2:
1970 - this.preprocessLazyImages($elementorElement);
1971 - bodyStyle = window.getComputedStyle(document.body);
1972 - bodyBackgroundColor = bodyStyle.backgroundColor;
1973 - _context.next = 3;
1974 - return (0, _htmlToImage.toCanvas)($elementorElement[0], {
1975 - quality: this.getSettings('image_quality'),
1976 - imagePlaceholder: this.getSettings('image_placeholder'),
1977 - backgroundColor: bodyBackgroundColor || null,
1978 - style: {
1979 - transform: 'scale(1)',
1980 - transformOrigin: 'top left'
1981 - }
1982 - });
1983 - case 3:
1984 - canvas = _context.sent;
1985 - return _context.abrupt("return", canvas.toDataURL('image/webp', this.getSettings('image_quality')));
1986 - case 4:
1987 - case "end":
1988 - return _context.stop();
1989 - }
1990 - }, _callee, this);
1991 - }));
1992 - function createImage() {
1993 - return _createImage.apply(this, arguments);
1994 - }
1995 - return createImage;
1996 - }())
614 + value: function createImage() {
615 + var _this4 = this;
616 + var pageLoadedPromise = new Promise(function (resolve) {
617 + window.addEventListener('load', function () {
618 + resolve();
619 + });
620 + });
621 + var timeOutPromise = new Promise(function (resolve) {
622 + setTimeout(function () {
623 + resolve();
624 + }, _this4.getSettings('render_timeout'));
625 + });
626 + return Promise.race([pageLoadedPromise, timeOutPromise]).then(function () {
627 + _this4.log('Start creating screenshot.');
628 + if (_this4.getSettings('isDebugSvg')) {
629 + domtoimage.toSvg(document.body, {
630 + imagePlaceholder: _this4.getSettings('image_placeholder')
631 + }).then(function (svg) {
632 + return _this4.download(svg);
633 + });
634 + return Promise.reject('Debug SVG.');
635 + }
636 +
637 + // TODO: Extract to util function.
638 + var isSafari = /^((?!chrome|android).)*safari/i.test(window.userAgent);
639 +
640 + // Safari browser has some problems with the images that dom-to-images
641 + // library creates, so in this specific case the screenshot uses html2canvas.
642 + // Note that dom-to-image creates more accurate screenshot in "not safari" browsers.
643 + if (isSafari) {
644 + _this4.log('Creating screenshot with "html2canvas"');
645 + return html2canvas(document.body).then(function (canvas) {
646 + return canvas.toDataURL('image/png');
647 + });
648 + }
649 + _this4.log('Creating screenshot with "dom-to-image"');
650 + return domtoimage.toPng(document.body, {
651 + imagePlaceholder: _this4.getSettings('image_placeholder')
652 + }).catch(function () {
653 + return html2canvas(document.body).then(function (canvas) {
654 + return canvas.toDataURL('image/png');
655 + });
656 + });
657 + });
658 + }
659 +
660 + /**
661 + * Download a uri, use for debugging the svg that created from dom to image libraries.
662 + *
663 + * @param {string} uri
664 + */
1997 665 }, {
1998 - key: "preprocessLazyImages",
1999 - value: function preprocessLazyImages($element) {
2000 - var lazyImages = $element.find('img[data-src], img.swiper-lazy, img.lazy');
2001 - lazyImages.each(function (index, img) {
2002 - var $img = jQuery(img);
2003 - if ($img.attr('data-src')) {
2004 - $img.attr('src', $img.attr('data-src'));
2005 - $img.removeAttr('data-src');
2006 - }
2007 - $img.removeClass('swiper-lazy lazy swiper-slide-image');
2008 - $img.removeAttr('loading');
2009 - $img.removeAttr('data-srcset');
666 + key: "download",
667 + value: function download(uri) {
668 + var $link = jQuery('<a/>', {
669 + href: uri,
670 + download: 'debugSvg.svg',
671 + html: 'Download SVG'
2010 672 });
673 + elementorCommon.elements.$body.append($link);
674 + $link.trigger('click');
2011 675 }
2012 676
2013 677 /**
678 + * Creates fake image element to get the size of the image later on.
679 + *
680 + * @param {string} dataUrl
681 + * @return {Promise<HTMLImageElement>} Image Element
682 + */
683 + }, {
684 + key: "createImageElement",
685 + value: function createImageElement(dataUrl) {
686 + var image = new Image();
687 + image.src = dataUrl;
688 + return new Promise(function (resolve) {
689 + image.onload = function () {
690 + return resolve(image);
691 + };
692 + });
693 + }
694 +
695 + /**
696 + * Crop the image to requested sizes.
697 + *
698 + * @param {HTMLImageElement} image
699 + * @return {Promise<unknown>} Canvas
700 + */
701 + }, {
702 + key: "cropCanvas",
703 + value: function cropCanvas(image) {
704 + var width = this.getSettings('crop.width');
705 + var height = this.getSettings('crop.height');
706 + var cropCanvas = document.createElement('canvas'),
707 + cropContext = cropCanvas.getContext('2d'),
708 + ratio = width / image.width;
709 + cropCanvas.width = width;
710 + cropCanvas.height = height > image.height ? image.height : height;
711 + cropContext.drawImage(image, 0, 0, image.width, image.height, 0, 0, image.width * ratio, image.height * ratio);
712 + return Promise.resolve(cropCanvas);
713 + }
714 +
715 + /**
2014 716 * Send the image to the server.
2015 717 *
2016 - * @param {string} dataUrl
2017 - * @return {Promise<string>} Screenshot URL
718 + * @param {HTMLCanvasElement} canvas
719 + * @return {Promise<unknown>} Screenshot URL
2018 720 */
2019 721 }, {
2020 722 key: "save",
2021 - value: function save(dataUrl) {
723 + value: function save(canvas) {
724 + var _this5 = this;
2022 725 var _this$getSaveAction = this.getSaveAction(),
2023 726 key = _this$getSaveAction.key,
2024 727 action = _this$getSaveAction.action;
2025 - var data = (0, _defineProperty2.default)((0, _defineProperty2.default)({}, key, this.getSettings(key)), "screenshot", dataUrl);
728 + var data = (0, _defineProperty2.default)((0, _defineProperty2.default)({}, key, this.getSettings(key)), "screenshot", canvas.toDataURL('image/png'));
2026 729 return new Promise(function (resolve, reject) {
2027 730 if ('kit_id' === key) {
2028 731 return resolve(data.screenshot);
2029 732 }
@@ -2029,12 +732,14 @@
2029 732 }
2030 733 elementorCommon.ajax.addRequest(action, {
2031 734 data: data,
2032 735 success: function success(url) {
2033 - return resolve(url);
736 + _this5.log("Screenshot created: ".concat(encodeURI(url)));
737 + resolve(url);
2034 738 },
2035 739 error: function error() {
2036 - return reject();
740 + _this5.log('Failed to create screenshot.');
741 + reject();
2037 742 }
2038 743 });
2039 744 });
2040 745 }
@@ -2045,13 +750,13 @@
2045 750 */
2046 751 }, {
2047 752 key: "markAsFailed",
2048 753 value: function markAsFailed(e) {
2049 - var _this4 = this;
754 + var _this6 = this;
2050 755 return new Promise(function (resolve, reject) {
2051 - var templateId = _this4.getSettings('template_id');
2052 - var postId = _this4.getSettings('post_id');
2053 - var kitId = _this4.getSettings('kit_id');
756 + var templateId = _this6.getSettings('template_id');
757 + var postId = _this6.getSettings('post_id');
758 + var kitId = _this6.getSettings('kit_id');
2054 759 if (kitId) {
2055 760 resolve();
2056 761 } else {
2057 762 var route = templateId ? 'template_screenshot_failed' : 'screenshot_failed';
@@ -2063,12 +768,14 @@
2063 768 };
2064 769 elementorCommon.ajax.addRequest(route, {
2065 770 data: data,
2066 771 success: function success() {
2067 - return resolve();
772 + _this6.log("Marked as failed.");
773 + resolve();
2068 774 },
2069 775 error: function error() {
2070 - return reject();
776 + _this6.log('Failed to mark this screenshot as failed.');
777 + reject();
2071 778 }
2072 779 });
2073 780 }
2074 781 });
@@ -2074,8 +781,18 @@
2074 781 });
2075 782 }
2076 783
2077 784 /**
785 + * @param {string} url
786 + * @return {string} Screenshot Proxy URL
787 + */
788 + }, {
789 + key: "getScreenshotProxyUrl",
790 + value: function getScreenshotProxyUrl(url) {
791 + return "".concat(this.getSettings('home_url'), "?screenshot_proxy&nonce=").concat(this.getSettings('nonce'), "&href=").concat(url);
792 + }
793 +
794 + /**
2078 795 * Notify that the screenshot has been succeed.
2079 796 *
2080 797 * @param {string} imageUrl
2081 798 */
@@ -2092,11 +809,12 @@
2092 809 */
2093 810 }, {
2094 811 key: "screenshotFailed",
2095 812 value: function screenshotFailed(e) {
2096 - var _this5 = this;
813 + var _this7 = this;
814 + this.log(e, null);
2097 815 this.markAsFailed(e).then(function () {
2098 - return _this5.screenshotDone(false);
816 + return _this7.screenshotDone(false);
2099 817 });
2100 818 }
2101 819
2102 820 /**
@@ -2123,8 +841,31 @@
2123 841 success: success,
2124 842 id: this.getSettings(key),
2125 843 imageUrl: imageUrl
2126 844 }, '*');
845 + this.log("Screenshot ".concat(success ? 'Succeed' : 'Failed', "."), 'timeEnd');
846 + }
847 +
848 + /**
849 + * Log messages for debugging.
850 + *
851 + * @param {any} message
852 + * @param {string?} timerMethod
853 + */
854 + }, {
855 + key: "log",
856 + value: function log(message) {
857 + var timerMethod = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'timeLog';
858 + if (!this.getSettings('isDebug')) {
859 + return;
860 + }
861 +
862 + // eslint-disable-next-line no-console
863 + console.log('string' === typeof message ? "".concat(this.getSettings('post_id'), " - ").concat(message) : message);
864 + if (timerMethod) {
865 + // eslint-disable-next-line no-console
866 + console[timerMethod](this.getSettings('timer_label'));
867 + }
2127 868 }
2128 869 }, {
2129 870 key: "getSaveAction",
2130 871 value: function getSaveAction() {