| @@ -1,1643 +1,2161 @@ | ||
| 1 | -(function() { | |
| 1 | +/******/ (() => { // webpackBootstrap | |
| 2 | +/******/ var __webpack_modules__ = ({ | |
| 2 | 3 | |
| 3 | -//#region \0rolldown/runtime.js | |
| 4 | - var __create = Object.create; | |
| 5 | - var __defProp = Object.defineProperty; | |
| 6 | - var __name = (target, value) => __defProp(target, "name", { | |
| 7 | - value, | |
| 8 | - configurable: true | |
| 9 | - }); | |
| 10 | - var __getOwnPropDesc = Object.getOwnPropertyDescriptor; | |
| 11 | - var __getOwnPropNames = Object.getOwnPropertyNames; | |
| 12 | - var __getProtoOf = Object.getPrototypeOf; | |
| 13 | - var __hasOwnProp = Object.prototype.hasOwnProperty; | |
| 14 | - var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports); | |
| 15 | - var __copyProps = (to, from, except, desc) => { | |
| 16 | - if (from && typeof from === "object" || typeof from === "function") { | |
| 17 | - for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) { | |
| 18 | - key = keys[i]; | |
| 19 | - if (!__hasOwnProp.call(to, key) && key !== except) { | |
| 20 | - __defProp(to, key, { | |
| 21 | - get: ((k) => from[k]).bind(null, key), | |
| 22 | - enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable | |
| 23 | - }); | |
| 24 | - } | |
| 25 | - } | |
| 26 | - } | |
| 27 | - return to; | |
| 28 | - }; | |
| 29 | - var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { | |
| 30 | - value: mod, | |
| 31 | - enumerable: true | |
| 32 | - }) : target, mod)); | |
| 4 | +/***/ "../node_modules/@babel/runtime/helpers/OverloadYield.js": | |
| 5 | +/*!***************************************************************!*\ | |
| 6 | + !*** ../node_modules/@babel/runtime/helpers/OverloadYield.js ***! | |
| 7 | + \***************************************************************/ | |
| 8 | +/***/ ((module) => { | |
| 33 | 9 | |
| 34 | -//#endregion | |
| 10 | +function _OverloadYield(e, d) { | |
| 11 | + this.v = e, this.k = d; | |
| 12 | +} | |
| 13 | +module.exports = _OverloadYield, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 35 | 14 | |
| 36 | -//#region node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js | |
| 37 | - function asyncGeneratorStep$1(n, t, e, r, o, a, c) { | |
| 38 | - try { | |
| 39 | - var i = n[a](c); | |
| 40 | - var u = i.value; | |
| 41 | - } catch (n) { | |
| 42 | - e(n); | |
| 43 | - return; | |
| 44 | - } | |
| 45 | - i.done ? t(u) : Promise.resolve(u).then(r, o); | |
| 46 | - } | |
| 47 | - __name(asyncGeneratorStep$1, "asyncGeneratorStep"); | |
| 48 | - function _asyncToGenerator$1(n) { | |
| 49 | - return function() { | |
| 50 | - var t = this; | |
| 51 | - var e = arguments; | |
| 52 | - return new Promise(function(r, o) { | |
| 53 | - var a = n.apply(t, e); | |
| 54 | - function _next(n) { | |
| 55 | - asyncGeneratorStep$1(a, r, o, _next, _throw, "next", n); | |
| 56 | - } | |
| 57 | - function _throw(n) { | |
| 58 | - asyncGeneratorStep$1(a, r, o, _next, _throw, "throw", n); | |
| 59 | - } | |
| 60 | - _next(void 0); | |
| 61 | - }); | |
| 62 | - }; | |
| 63 | - } | |
| 64 | - __name(_asyncToGenerator$1, "_asyncToGenerator"); | |
| 15 | +/***/ }), | |
| 65 | 16 | |
| 66 | -//#endregion | |
| 67 | -//#region node_modules/@babel/runtime/helpers/esm/typeof.js | |
| 68 | - function _typeof(o) { | |
| 69 | - "@babel/helpers - typeof"; | |
| 70 | - return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) { | |
| 71 | - return typeof o; | |
| 72 | - } : function(o) { | |
| 73 | - return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; | |
| 74 | - }, _typeof(o); | |
| 75 | - } | |
| 17 | +/***/ "../node_modules/@babel/runtime/helpers/assertThisInitialized.js": | |
| 18 | +/*!***********************************************************************!*\ | |
| 19 | + !*** ../node_modules/@babel/runtime/helpers/assertThisInitialized.js ***! | |
| 20 | + \***********************************************************************/ | |
| 21 | +/***/ ((module) => { | |
| 76 | 22 | |
| 77 | -//#endregion | |
| 78 | -//#region node_modules/@babel/runtime/helpers/esm/toPrimitive.js | |
| 79 | - function toPrimitive(t, r) { | |
| 80 | - if ("object" != _typeof(t) || !t) return t; | |
| 81 | - var e = t[Symbol.toPrimitive]; | |
| 82 | - if (void 0 !== e) { | |
| 83 | - var i = e.call(t, r || "default"); | |
| 84 | - if ("object" != _typeof(i)) return i; | |
| 85 | - throw new TypeError("@@toPrimitive must return a primitive value."); | |
| 86 | - } | |
| 87 | - return ("string" === r ? String : Number)(t); | |
| 88 | - } | |
| 23 | +function _assertThisInitialized(e) { | |
| 24 | + if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); | |
| 25 | + return e; | |
| 26 | +} | |
| 27 | +module.exports = _assertThisInitialized, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 89 | 28 | |
| 90 | -//#endregion | |
| 91 | -//#region node_modules/@babel/runtime/helpers/esm/toPropertyKey.js | |
| 92 | - function toPropertyKey(t) { | |
| 93 | - var i = toPrimitive(t, "string"); | |
| 94 | - return "symbol" == _typeof(i) ? i : i + ""; | |
| 95 | - } | |
| 29 | +/***/ }), | |
| 96 | 30 | |
| 97 | -//#endregion | |
| 98 | -//#region node_modules/@babel/runtime/helpers/esm/defineProperty.js | |
| 99 | - function _defineProperty(e, r, t) { | |
| 100 | - return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, { | |
| 101 | - value: t, | |
| 102 | - enumerable: !0, | |
| 103 | - configurable: !0, | |
| 104 | - writable: !0 | |
| 105 | - }) : e[r] = t, e; | |
| 106 | - } | |
| 31 | +/***/ "../node_modules/@babel/runtime/helpers/asyncToGenerator.js": | |
| 32 | +/*!******************************************************************!*\ | |
| 33 | + !*** ../node_modules/@babel/runtime/helpers/asyncToGenerator.js ***! | |
| 34 | + \******************************************************************/ | |
| 35 | +/***/ ((module) => { | |
| 107 | 36 | |
| 108 | -//#endregion | |
| 109 | -//#region node_modules/@babel/runtime/helpers/esm/classCallCheck.js | |
| 110 | - function _classCallCheck(a, n) { | |
| 111 | - if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); | |
| 112 | - } | |
| 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; | |
| 113 | 63 | |
| 114 | -//#endregion | |
| 115 | -//#region node_modules/@babel/runtime/helpers/esm/createClass.js | |
| 116 | - function _defineProperties(e, r) { | |
| 117 | - for (var t = 0; t < r.length; t++) { | |
| 118 | - var o = r[t]; | |
| 119 | - o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, toPropertyKey(o.key), o); | |
| 120 | - } | |
| 121 | - } | |
| 122 | - function _createClass(e, r, t) { | |
| 123 | - return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; | |
| 124 | - } | |
| 64 | +/***/ }), | |
| 125 | 65 | |
| 126 | -//#endregion | |
| 127 | -//#region node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js | |
| 128 | - function _assertThisInitialized(e) { | |
| 129 | - if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); | |
| 130 | - return e; | |
| 131 | - } | |
| 66 | +/***/ "../node_modules/@babel/runtime/helpers/classCallCheck.js": | |
| 67 | +/*!****************************************************************!*\ | |
| 68 | + !*** ../node_modules/@babel/runtime/helpers/classCallCheck.js ***! | |
| 69 | + \****************************************************************/ | |
| 70 | +/***/ ((module) => { | |
| 132 | 71 | |
| 133 | -//#endregion | |
| 134 | -//#region node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js | |
| 135 | - function _possibleConstructorReturn(t, e) { | |
| 136 | - if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; | |
| 137 | - if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); | |
| 138 | - return _assertThisInitialized(t); | |
| 139 | - } | |
| 72 | +function _classCallCheck(a, n) { | |
| 73 | + if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); | |
| 74 | +} | |
| 75 | +module.exports = _classCallCheck, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 140 | 76 | |
| 141 | -//#endregion | |
| 142 | -//#region node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js | |
| 143 | - function _getPrototypeOf(t) { | |
| 144 | - return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(t) { | |
| 145 | - return t.__proto__ || Object.getPrototypeOf(t); | |
| 146 | - }, _getPrototypeOf(t); | |
| 147 | - } | |
| 77 | +/***/ }), | |
| 148 | 78 | |
| 149 | -//#endregion | |
| 150 | -//#region node_modules/@babel/runtime/helpers/esm/superPropBase.js | |
| 151 | - function _superPropBase(t, o) { | |
| 152 | - for (; !{}.hasOwnProperty.call(t, o) && null !== (t = _getPrototypeOf(t));); | |
| 153 | - return t; | |
| 154 | - } | |
| 79 | +/***/ "../node_modules/@babel/runtime/helpers/createClass.js": | |
| 80 | +/*!*************************************************************!*\ | |
| 81 | + !*** ../node_modules/@babel/runtime/helpers/createClass.js ***! | |
| 82 | + \*************************************************************/ | |
| 83 | +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { | |
| 155 | 84 | |
| 156 | -//#endregion | |
| 157 | -//#region node_modules/@babel/runtime/helpers/esm/get.js | |
| 158 | - function _get() { | |
| 159 | - return _get = "undefined" != typeof Reflect && Reflect.get ? Reflect.get.bind() : function(e, t, r) { | |
| 160 | - var p = _superPropBase(e, t); | |
| 161 | - if (p) { | |
| 162 | - var n = Object.getOwnPropertyDescriptor(p, t); | |
| 163 | - return n.get ? n.get.call(arguments.length < 3 ? e : r) : n.value; | |
| 164 | - } | |
| 165 | - }, _get.apply(null, arguments); | |
| 166 | - } | |
| 85 | +var toPropertyKey = __webpack_require__(/*! ./toPropertyKey.js */ "../node_modules/@babel/runtime/helpers/toPropertyKey.js"); | |
| 86 | +function _defineProperties(e, r) { | |
| 87 | + for (var t = 0; t < r.length; t++) { | |
| 88 | + var o = r[t]; | |
| 89 | + o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, toPropertyKey(o.key), o); | |
| 90 | + } | |
| 91 | +} | |
| 92 | +function _createClass(e, r, t) { | |
| 93 | + return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { | |
| 94 | + writable: !1 | |
| 95 | + }), e; | |
| 96 | +} | |
| 97 | +module.exports = _createClass, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 167 | 98 | |
| 168 | -//#endregion | |
| 169 | -//#region node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js | |
| 170 | - function _setPrototypeOf(t, e) { | |
| 171 | - return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(t, e) { | |
| 172 | - return t.__proto__ = e, t; | |
| 173 | - }, _setPrototypeOf(t, e); | |
| 174 | - } | |
| 99 | +/***/ }), | |
| 175 | 100 | |
| 176 | -//#endregion | |
| 177 | -//#region node_modules/@babel/runtime/helpers/esm/inherits.js | |
| 178 | - function _inherits(t, e) { | |
| 179 | - if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); | |
| 180 | - t.prototype = Object.create(e && e.prototype, { constructor: { | |
| 181 | - value: t, | |
| 182 | - writable: !0, | |
| 183 | - configurable: !0 | |
| 184 | - } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); | |
| 185 | - } | |
| 101 | +/***/ "../node_modules/@babel/runtime/helpers/defineProperty.js": | |
| 102 | +/*!****************************************************************!*\ | |
| 103 | + !*** ../node_modules/@babel/runtime/helpers/defineProperty.js ***! | |
| 104 | + \****************************************************************/ | |
| 105 | +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { | |
| 186 | 106 | |
| 187 | -//#endregion | |
| 188 | -//#region node_modules/@babel/runtime/helpers/OverloadYield.js | |
| 189 | - var require_OverloadYield = /* @__PURE__ */ __commonJSMin(((exports, module) => { | |
| 190 | - function _OverloadYield(e, d) { | |
| 191 | - this.v = e, this.k = d; | |
| 192 | - } | |
| 193 | - module.exports = _OverloadYield, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 194 | - })); | |
| 107 | +var toPropertyKey = __webpack_require__(/*! ./toPropertyKey.js */ "../node_modules/@babel/runtime/helpers/toPropertyKey.js"); | |
| 108 | +function _defineProperty(e, r, t) { | |
| 109 | + return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, { | |
| 110 | + value: t, | |
| 111 | + enumerable: !0, | |
| 112 | + configurable: !0, | |
| 113 | + writable: !0 | |
| 114 | + }) : e[r] = t, e; | |
| 115 | +} | |
| 116 | +module.exports = _defineProperty, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 195 | 117 | |
| 196 | -//#endregion | |
| 197 | -//#region node_modules/@babel/runtime/helpers/regeneratorDefine.js | |
| 198 | - var require_regeneratorDefine = /* @__PURE__ */ __commonJSMin(((exports, module) => { | |
| 199 | - function _regeneratorDefine(e, r, n, t) { | |
| 200 | - var i = Object.defineProperty; | |
| 201 | - try { | |
| 202 | - i({}, "", {}); | |
| 203 | - } catch (e) { | |
| 204 | - i = 0; | |
| 205 | - } | |
| 206 | - module.exports = _regeneratorDefine = function regeneratorDefine(e, r, n, t) { | |
| 207 | - function o(r, n) { | |
| 208 | - _regeneratorDefine(e, r, function(e) { | |
| 209 | - return this._invoke(r, n, e); | |
| 210 | - }); | |
| 211 | - } | |
| 212 | - r ? i ? i(e, r, { | |
| 213 | - value: n, | |
| 214 | - enumerable: !t, | |
| 215 | - configurable: !t, | |
| 216 | - writable: !t | |
| 217 | - }) : e[r] = n : (o("next", 0), o("throw", 1), o("return", 2)); | |
| 218 | - }, module.exports.__esModule = true, module.exports["default"] = module.exports, _regeneratorDefine(e, r, n, t); | |
| 219 | - } | |
| 220 | - module.exports = _regeneratorDefine, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 221 | - })); | |
| 118 | +/***/ }), | |
| 222 | 119 | |
| 223 | -//#endregion | |
| 224 | -//#region node_modules/@babel/runtime/helpers/regenerator.js | |
| 225 | - var require_regenerator$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => { | |
| 226 | - var regeneratorDefine = require_regeneratorDefine(); | |
| 227 | - function _regenerator() { | |
| 228 | - /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ | |
| 229 | - var e; | |
| 230 | - var t; | |
| 231 | - var r = "function" == typeof Symbol ? Symbol : {}; | |
| 232 | - var n = r.iterator || "@@iterator"; | |
| 233 | - var o = r.toStringTag || "@@toStringTag"; | |
| 234 | - function i(r, n, o, i) { | |
| 235 | - var c = n && n.prototype instanceof Generator ? n : Generator; | |
| 236 | - var u = Object.create(c.prototype); | |
| 237 | - return regeneratorDefine(u, "_invoke", function(r, n, o) { | |
| 238 | - var i; | |
| 239 | - var c; | |
| 240 | - var u; | |
| 241 | - var f = 0; | |
| 242 | - var p = o || []; | |
| 243 | - var y = !1; | |
| 244 | - var G = { | |
| 245 | - p: 0, | |
| 246 | - n: 0, | |
| 247 | - v: e, | |
| 248 | - a: d, | |
| 249 | - f: d.bind(e, 4), | |
| 250 | - d: function d(t, r) { | |
| 251 | - return i = t, c = 0, u = e, G.n = r, a; | |
| 252 | - } | |
| 253 | - }; | |
| 254 | - function d(r, n) { | |
| 255 | - for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { | |
| 256 | - var o; | |
| 257 | - var i = p[t]; | |
| 258 | - var d = G.p; | |
| 259 | - var l = i[2]; | |
| 260 | - 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)); | |
| 261 | - } | |
| 262 | - if (o || r > 1) return a; | |
| 263 | - throw y = !0, n; | |
| 264 | - } | |
| 265 | - return function(o, p, l) { | |
| 266 | - if (f > 1) throw TypeError("Generator is already running"); | |
| 267 | - for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { | |
| 268 | - i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); | |
| 269 | - try { | |
| 270 | - if (f = 2, i) { | |
| 271 | - if (c || (o = "next"), t = i[o]) { | |
| 272 | - if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object"); | |
| 273 | - if (!t.done) return t; | |
| 274 | - u = t.value, c < 2 && (c = 0); | |
| 275 | - } else 1 === c && (t = i["return"]) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1); | |
| 276 | - i = e; | |
| 277 | - } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; | |
| 278 | - } catch (t) { | |
| 279 | - i = e, c = 1, u = t; | |
| 280 | - } finally { | |
| 281 | - f = 1; | |
| 282 | - } | |
| 283 | - } | |
| 284 | - return { | |
| 285 | - value: t, | |
| 286 | - done: y | |
| 287 | - }; | |
| 288 | - }; | |
| 289 | - }(r, o, i), !0), u; | |
| 290 | - } | |
| 291 | - var a = {}; | |
| 292 | - function Generator() {} | |
| 293 | - function GeneratorFunction() {} | |
| 294 | - function GeneratorFunctionPrototype() {} | |
| 295 | - t = Object.getPrototypeOf; | |
| 296 | - var c = [][n] ? t(t([][n]())) : (regeneratorDefine(t = {}, n, function() { | |
| 297 | - return this; | |
| 298 | - }), t); | |
| 299 | - var u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); | |
| 300 | - function f(e) { | |
| 301 | - return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, regeneratorDefine(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e; | |
| 302 | - } | |
| 303 | - 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() { | |
| 304 | - return this; | |
| 305 | - }), regeneratorDefine(u, "toString", function() { | |
| 306 | - return "[object Generator]"; | |
| 307 | - }), (module.exports = _regenerator = function _regenerator() { | |
| 308 | - return { | |
| 309 | - w: i, | |
| 310 | - m: f | |
| 311 | - }; | |
| 312 | - }, module.exports.__esModule = true, module.exports["default"] = module.exports)(); | |
| 313 | - } | |
| 314 | - module.exports = _regenerator, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 315 | - })); | |
| 120 | +/***/ "../node_modules/@babel/runtime/helpers/get.js": | |
| 121 | +/*!*****************************************************!*\ | |
| 122 | + !*** ../node_modules/@babel/runtime/helpers/get.js ***! | |
| 123 | + \*****************************************************/ | |
| 124 | +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { | |
| 316 | 125 | |
| 317 | -//#endregion | |
| 318 | -//#region node_modules/@babel/runtime/helpers/regeneratorAsyncIterator.js | |
| 319 | - var require_regeneratorAsyncIterator = /* @__PURE__ */ __commonJSMin(((exports, module) => { | |
| 320 | - var OverloadYield = require_OverloadYield(); | |
| 321 | - var regeneratorDefine = require_regeneratorDefine(); | |
| 322 | - function AsyncIterator(t, e) { | |
| 323 | - function n(r, o, i, f) { | |
| 324 | - try { | |
| 325 | - var c = t[r](o); | |
| 326 | - var u = c.value; | |
| 327 | - return u instanceof OverloadYield ? e.resolve(u.v).then(function(t) { | |
| 328 | - n("next", t, i, f); | |
| 329 | - }, function(t) { | |
| 330 | - n("throw", t, i, f); | |
| 331 | - }) : e.resolve(u).then(function(t) { | |
| 332 | - c.value = t, i(c); | |
| 333 | - }, function(t) { | |
| 334 | - return n("throw", t, i, f); | |
| 335 | - }); | |
| 336 | - } catch (t) { | |
| 337 | - f(t); | |
| 338 | - } | |
| 339 | - } | |
| 340 | - var r; | |
| 341 | - this.next || (regeneratorDefine(AsyncIterator.prototype), regeneratorDefine(AsyncIterator.prototype, "function" == typeof Symbol && Symbol.asyncIterator || "@asyncIterator", function() { | |
| 342 | - return this; | |
| 343 | - })), regeneratorDefine(this, "_invoke", function(t, o, i) { | |
| 344 | - function f() { | |
| 345 | - return new e(function(e, r) { | |
| 346 | - n(t, i, e, r); | |
| 347 | - }); | |
| 348 | - } | |
| 349 | - return r = r ? r.then(f, f) : f(); | |
| 350 | - }, !0); | |
| 351 | - } | |
| 352 | - module.exports = AsyncIterator, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 353 | - })); | |
| 126 | +var superPropBase = __webpack_require__(/*! ./superPropBase.js */ "../node_modules/@babel/runtime/helpers/superPropBase.js"); | |
| 127 | +function _get() { | |
| 128 | + return module.exports = _get = "undefined" != typeof Reflect && Reflect.get ? Reflect.get.bind() : function (e, t, r) { | |
| 129 | + var p = superPropBase(e, t); | |
| 130 | + if (p) { | |
| 131 | + var n = Object.getOwnPropertyDescriptor(p, t); | |
| 132 | + return n.get ? n.get.call(arguments.length < 3 ? e : r) : n.value; | |
| 133 | + } | |
| 134 | + }, module.exports.__esModule = true, module.exports["default"] = module.exports, _get.apply(null, arguments); | |
| 135 | +} | |
| 136 | +module.exports = _get, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 354 | 137 | |
| 355 | -//#endregion | |
| 356 | -//#region node_modules/@babel/runtime/helpers/regeneratorAsyncGen.js | |
| 357 | - var require_regeneratorAsyncGen = /* @__PURE__ */ __commonJSMin(((exports, module) => { | |
| 358 | - var regenerator = require_regenerator$1(); | |
| 359 | - var regeneratorAsyncIterator = require_regeneratorAsyncIterator(); | |
| 360 | - function _regeneratorAsyncGen(r, e, t, o, n) { | |
| 361 | - return new regeneratorAsyncIterator(regenerator().w(r, e, t, o), n || Promise); | |
| 362 | - } | |
| 363 | - module.exports = _regeneratorAsyncGen, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 364 | - })); | |
| 138 | +/***/ }), | |
| 365 | 139 | |
| 366 | -//#endregion | |
| 367 | -//#region node_modules/@babel/runtime/helpers/regeneratorAsync.js | |
| 368 | - var require_regeneratorAsync = /* @__PURE__ */ __commonJSMin(((exports, module) => { | |
| 369 | - var regeneratorAsyncGen = require_regeneratorAsyncGen(); | |
| 370 | - function _regeneratorAsync(n, e, r, t, o) { | |
| 371 | - var a = regeneratorAsyncGen(n, e, r, t, o); | |
| 372 | - return a.next().then(function(n) { | |
| 373 | - return n.done ? n.value : a.next(); | |
| 374 | - }); | |
| 375 | - } | |
| 376 | - module.exports = _regeneratorAsync, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 377 | - })); | |
| 140 | +/***/ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js": | |
| 141 | +/*!****************************************************************!*\ | |
| 142 | + !*** ../node_modules/@babel/runtime/helpers/getPrototypeOf.js ***! | |
| 143 | + \****************************************************************/ | |
| 144 | +/***/ ((module) => { | |
| 378 | 145 | |
| 379 | -//#endregion | |
| 380 | -//#region node_modules/@babel/runtime/helpers/regeneratorKeys.js | |
| 381 | - var require_regeneratorKeys = /* @__PURE__ */ __commonJSMin(((exports, module) => { | |
| 382 | - function _regeneratorKeys(e) { | |
| 383 | - var n = Object(e); | |
| 384 | - var r = []; | |
| 385 | - for (var t in n) r.unshift(t); | |
| 386 | - return function e() { | |
| 387 | - for (; r.length;) if ((t = r.pop()) in n) return e.value = t, e.done = !1, e; | |
| 388 | - return e.done = !0, e; | |
| 389 | - }; | |
| 390 | - } | |
| 391 | - module.exports = _regeneratorKeys, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 392 | - })); | |
| 146 | +function _getPrototypeOf(t) { | |
| 147 | + return module.exports = _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { | |
| 148 | + return t.__proto__ || Object.getPrototypeOf(t); | |
| 149 | + }, module.exports.__esModule = true, module.exports["default"] = module.exports, _getPrototypeOf(t); | |
| 150 | +} | |
| 151 | +module.exports = _getPrototypeOf, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 393 | 152 | |
| 394 | -//#endregion | |
| 395 | -//#region node_modules/@babel/runtime/helpers/typeof.js | |
| 396 | - var require_typeof = /* @__PURE__ */ __commonJSMin(((exports, module) => { | |
| 397 | - function _typeof(o) { | |
| 398 | - "@babel/helpers - typeof"; | |
| 399 | - return module.exports = _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) { | |
| 400 | - return typeof o; | |
| 401 | - } : function(o) { | |
| 402 | - return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; | |
| 403 | - }, module.exports.__esModule = true, module.exports["default"] = module.exports, _typeof(o); | |
| 404 | - } | |
| 405 | - module.exports = _typeof, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 406 | - })); | |
| 153 | +/***/ }), | |
| 407 | 154 | |
| 408 | -//#endregion | |
| 409 | -//#region node_modules/@babel/runtime/helpers/regeneratorValues.js | |
| 410 | - var require_regeneratorValues = /* @__PURE__ */ __commonJSMin(((exports, module) => { | |
| 411 | - var _typeof = require_typeof()["default"]; | |
| 412 | - function _regeneratorValues(e) { | |
| 413 | - if (null != e) { | |
| 414 | - var t = e["function" == typeof Symbol && Symbol.iterator || "@@iterator"]; | |
| 415 | - var r = 0; | |
| 416 | - if (t) return t.call(e); | |
| 417 | - if ("function" == typeof e.next) return e; | |
| 418 | - if (!isNaN(e.length)) return { next: function next() { | |
| 419 | - return e && r >= e.length && (e = void 0), { | |
| 420 | - value: e && e[r++], | |
| 421 | - done: !e | |
| 422 | - }; | |
| 423 | - } }; | |
| 424 | - } | |
| 425 | - throw new TypeError(_typeof(e) + " is not iterable"); | |
| 426 | - } | |
| 427 | - module.exports = _regeneratorValues, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 428 | - })); | |
| 155 | +/***/ "../node_modules/@babel/runtime/helpers/inherits.js": | |
| 156 | +/*!**********************************************************!*\ | |
| 157 | + !*** ../node_modules/@babel/runtime/helpers/inherits.js ***! | |
| 158 | + \**********************************************************/ | |
| 159 | +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { | |
| 429 | 160 | |
| 430 | -//#endregion | |
| 431 | -//#region node_modules/@babel/runtime/helpers/regeneratorRuntime.js | |
| 432 | - var require_regeneratorRuntime = /* @__PURE__ */ __commonJSMin(((exports, module) => { | |
| 433 | - var OverloadYield = require_OverloadYield(); | |
| 434 | - var regenerator = require_regenerator$1(); | |
| 435 | - var regeneratorAsync = require_regeneratorAsync(); | |
| 436 | - var regeneratorAsyncGen = require_regeneratorAsyncGen(); | |
| 437 | - var regeneratorAsyncIterator = require_regeneratorAsyncIterator(); | |
| 438 | - var regeneratorKeys = require_regeneratorKeys(); | |
| 439 | - var regeneratorValues = require_regeneratorValues(); | |
| 440 | - function _regeneratorRuntime() { | |
| 441 | - "use strict"; | |
| 442 | - var r = regenerator(); | |
| 443 | - var e = r.m(_regeneratorRuntime); | |
| 444 | - var t = (Object.getPrototypeOf ? Object.getPrototypeOf(e) : e.__proto__).constructor; | |
| 445 | - function n(r) { | |
| 446 | - var e = "function" == typeof r && r.constructor; | |
| 447 | - return !!e && (e === t || "GeneratorFunction" === (e.displayName || e.name)); | |
| 448 | - } | |
| 449 | - var o = { | |
| 450 | - "throw": 1, | |
| 451 | - "return": 2, | |
| 452 | - "break": 3, | |
| 453 | - "continue": 3 | |
| 454 | - }; | |
| 455 | - function a(r) { | |
| 456 | - var e; | |
| 457 | - var t; | |
| 458 | - return function(n) { | |
| 459 | - e || (e = { | |
| 460 | - stop: function stop() { | |
| 461 | - return t(n.a, 2); | |
| 462 | - }, | |
| 463 | - "catch": function _catch() { | |
| 464 | - return n.v; | |
| 465 | - }, | |
| 466 | - abrupt: function abrupt(r, e) { | |
| 467 | - return t(n.a, o[r], e); | |
| 468 | - }, | |
| 469 | - delegateYield: function delegateYield(r, o, a) { | |
| 470 | - return e.resultName = o, t(n.d, regeneratorValues(r), a); | |
| 471 | - }, | |
| 472 | - finish: function finish(r) { | |
| 473 | - return t(n.f, r); | |
| 474 | - } | |
| 475 | - }, t = function t(r, _t, o) { | |
| 476 | - n.p = e.prev, n.n = e.next; | |
| 477 | - try { | |
| 478 | - return r(_t, o); | |
| 479 | - } finally { | |
| 480 | - e.next = n.n; | |
| 481 | - } | |
| 482 | - }), e.resultName && (e[e.resultName] = n.v, e.resultName = void 0), e.sent = n.v, e.next = n.n; | |
| 483 | - try { | |
| 484 | - return r.call(this, e); | |
| 485 | - } finally { | |
| 486 | - n.p = e.prev, n.n = e.next; | |
| 487 | - } | |
| 488 | - }; | |
| 489 | - } | |
| 490 | - return (module.exports = _regeneratorRuntime = function _regeneratorRuntime() { | |
| 491 | - return { | |
| 492 | - wrap: function wrap(e, t, n, o) { | |
| 493 | - return r.w(a(e), t, n, o && o.reverse()); | |
| 494 | - }, | |
| 495 | - isGeneratorFunction: n, | |
| 496 | - mark: r.m, | |
| 497 | - awrap: function awrap(r, e) { | |
| 498 | - return new OverloadYield(r, e); | |
| 499 | - }, | |
| 500 | - AsyncIterator: regeneratorAsyncIterator, | |
| 501 | - async: function async(r, e, t, o, u) { | |
| 502 | - return (n(e) ? regeneratorAsyncGen : regeneratorAsync)(a(r), e, t, o, u); | |
| 503 | - }, | |
| 504 | - keys: regeneratorKeys, | |
| 505 | - values: regeneratorValues | |
| 506 | - }; | |
| 507 | - }, module.exports.__esModule = true, module.exports["default"] = module.exports)(); | |
| 508 | - } | |
| 509 | - module.exports = _regeneratorRuntime, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 510 | - })); | |
| 161 | +var setPrototypeOf = __webpack_require__(/*! ./setPrototypeOf.js */ "../node_modules/@babel/runtime/helpers/setPrototypeOf.js"); | |
| 162 | +function _inherits(t, e) { | |
| 163 | + if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); | |
| 164 | + t.prototype = Object.create(e && e.prototype, { | |
| 165 | + constructor: { | |
| 166 | + value: t, | |
| 167 | + writable: !0, | |
| 168 | + configurable: !0 | |
| 169 | + } | |
| 170 | + }), Object.defineProperty(t, "prototype", { | |
| 171 | + writable: !1 | |
| 172 | + }), e && setPrototypeOf(t, e); | |
| 173 | +} | |
| 174 | +module.exports = _inherits, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 511 | 175 | |
| 512 | -//#endregion | |
| 513 | -//#region node_modules/@babel/runtime/regenerator/index.js | |
| 514 | - var require_regenerator = /* @__PURE__ */ __commonJSMin(((exports, module) => { | |
| 515 | - var runtime = require_regeneratorRuntime()(); | |
| 516 | - module.exports = runtime; | |
| 517 | - try { | |
| 518 | - regeneratorRuntime = runtime; | |
| 519 | - } catch (accidentalStrictMode) { | |
| 520 | - if (typeof globalThis === "object") globalThis.regeneratorRuntime = runtime; | |
| 521 | - else Function("r", "regeneratorRuntime = r")(runtime); | |
| 522 | - } | |
| 523 | - })); | |
| 176 | +/***/ }), | |
| 524 | 177 | |
| 525 | -//#endregion | |
| 526 | -//#region \0@[email protected]/helpers/esm/asyncToGenerator.js | |
| 527 | -var import_regenerator = /* @__PURE__ */ __toESM(require_regenerator()); | |
| 528 | - function asyncGeneratorStep(n, t, e, r, o, a, c) { | |
| 529 | - try { | |
| 530 | - var i = n[a](c); | |
| 531 | - var u = i.value; | |
| 532 | - } catch (n) { | |
| 533 | - e(n); | |
| 534 | - return; | |
| 535 | - } | |
| 536 | - i.done ? t(u) : Promise.resolve(u).then(r, o); | |
| 537 | - } | |
| 538 | - function _asyncToGenerator(n) { | |
| 539 | - return function() { | |
| 540 | - var t = this; | |
| 541 | - var e = arguments; | |
| 542 | - return new Promise(function(r, o) { | |
| 543 | - var a = n.apply(t, e); | |
| 544 | - function _next(n) { | |
| 545 | - asyncGeneratorStep(a, r, o, _next, _throw, "next", n); | |
| 546 | - } | |
| 547 | - function _throw(n) { | |
| 548 | - asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); | |
| 549 | - } | |
| 550 | - _next(void 0); | |
| 551 | - }); | |
| 552 | - }; | |
| 553 | - } | |
| 178 | +/***/ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js": | |
| 179 | +/*!***********************************************************************!*\ | |
| 180 | + !*** ../node_modules/@babel/runtime/helpers/interopRequireDefault.js ***! | |
| 181 | + \***********************************************************************/ | |
| 182 | +/***/ ((module) => { | |
| 554 | 183 | |
| 555 | -//#endregion | |
| 556 | -//#region node_modules/html-to-image/es/util.js | |
| 557 | - function resolveUrl(url, baseUrl) { | |
| 558 | - if (url.match(/^[a-z]+:\/\//i)) return url; | |
| 559 | - if (url.match(/^\/\//)) return window.location.protocol + url; | |
| 560 | - if (url.match(/^[a-z]+:/i)) return url; | |
| 561 | - const doc = document.implementation.createHTMLDocument(); | |
| 562 | - const base = doc.createElement("base"); | |
| 563 | - const a = doc.createElement("a"); | |
| 564 | - doc.head.appendChild(base); | |
| 565 | - doc.body.appendChild(a); | |
| 566 | - if (baseUrl) base.href = baseUrl; | |
| 567 | - a.href = url; | |
| 568 | - return a.href; | |
| 569 | - } | |
| 570 | - var uuid = (() => { | |
| 571 | - let counter = 0; | |
| 572 | - const random = () => `0000${(Math.random() * Math.pow(36, 4) << 0).toString(36)}`.slice(-4); | |
| 573 | - return () => { | |
| 574 | - counter += 1; | |
| 575 | - return `u${random()}${counter}`; | |
| 576 | - }; | |
| 577 | - })(); | |
| 578 | - function toArray(arrayLike) { | |
| 579 | - const arr = []; | |
| 580 | - for (let i = 0, l = arrayLike.length; i < l; i++) arr.push(arrayLike[i]); | |
| 581 | - return arr; | |
| 582 | - } | |
| 583 | - var styleProps = null; | |
| 584 | - function getStyleProperties(options = {}) { | |
| 585 | - if (styleProps) return styleProps; | |
| 586 | - if (options.includeStyleProperties) { | |
| 587 | - styleProps = options.includeStyleProperties; | |
| 588 | - return styleProps; | |
| 589 | - } | |
| 590 | - styleProps = toArray(window.getComputedStyle(document.documentElement)); | |
| 591 | - return styleProps; | |
| 592 | - } | |
| 593 | - function px(node, styleProperty) { | |
| 594 | - const val = (node.ownerDocument.defaultView || window).getComputedStyle(node).getPropertyValue(styleProperty); | |
| 595 | - return val ? parseFloat(val.replace("px", "")) : 0; | |
| 596 | - } | |
| 597 | - function getNodeWidth(node) { | |
| 598 | - const leftBorder = px(node, "border-left-width"); | |
| 599 | - const rightBorder = px(node, "border-right-width"); | |
| 600 | - return node.clientWidth + leftBorder + rightBorder; | |
| 601 | - } | |
| 602 | - function getNodeHeight(node) { | |
| 603 | - const topBorder = px(node, "border-top-width"); | |
| 604 | - const bottomBorder = px(node, "border-bottom-width"); | |
| 605 | - return node.clientHeight + topBorder + bottomBorder; | |
| 606 | - } | |
| 607 | - function getImageSize(targetNode, options = {}) { | |
| 608 | - return { | |
| 609 | - width: options.width || getNodeWidth(targetNode), | |
| 610 | - height: options.height || getNodeHeight(targetNode) | |
| 611 | - }; | |
| 612 | - } | |
| 613 | - function getPixelRatio() { | |
| 614 | - let ratio; | |
| 615 | - let FINAL_PROCESS; | |
| 616 | - try { | |
| 617 | - FINAL_PROCESS = process; | |
| 618 | - } catch (e) {} | |
| 619 | - const val = FINAL_PROCESS && FINAL_PROCESS.env ? FINAL_PROCESS.env.devicePixelRatio : null; | |
| 620 | - if (val) { | |
| 621 | - ratio = parseInt(val, 10); | |
| 622 | - if (Number.isNaN(ratio)) ratio = 1; | |
| 623 | - } | |
| 624 | - return ratio || window.devicePixelRatio || 1; | |
| 625 | - } | |
| 626 | - var canvasDimensionLimit = 16384; | |
| 627 | - function checkCanvasDimensions(canvas) { | |
| 628 | - if (canvas.width > canvasDimensionLimit || canvas.height > canvasDimensionLimit) if (canvas.width > canvasDimensionLimit && canvas.height > canvasDimensionLimit) if (canvas.width > canvas.height) { | |
| 629 | - canvas.height *= canvasDimensionLimit / canvas.width; | |
| 630 | - canvas.width = canvasDimensionLimit; | |
| 631 | - } else { | |
| 632 | - canvas.width *= canvasDimensionLimit / canvas.height; | |
| 633 | - canvas.height = canvasDimensionLimit; | |
| 634 | - } | |
| 635 | - else if (canvas.width > canvasDimensionLimit) { | |
| 636 | - canvas.height *= canvasDimensionLimit / canvas.width; | |
| 637 | - canvas.width = canvasDimensionLimit; | |
| 638 | - } else { | |
| 639 | - canvas.width *= canvasDimensionLimit / canvas.height; | |
| 640 | - canvas.height = canvasDimensionLimit; | |
| 641 | - } | |
| 642 | - } | |
| 643 | - function createImage(url) { | |
| 644 | - return new Promise((resolve, reject) => { | |
| 645 | - const img = new Image(); | |
| 646 | - img.onload = () => { | |
| 647 | - img.decode().then(() => { | |
| 648 | - requestAnimationFrame(() => resolve(img)); | |
| 649 | - }); | |
| 650 | - }; | |
| 651 | - img.onerror = reject; | |
| 652 | - img.crossOrigin = "anonymous"; | |
| 653 | - img.decoding = "async"; | |
| 654 | - img.src = url; | |
| 655 | - }); | |
| 656 | - } | |
| 657 | - function svgToDataURL(_x) { | |
| 658 | - return _svgToDataURL.apply(this, arguments); | |
| 659 | - } | |
| 660 | - function _svgToDataURL() { | |
| 661 | - _svgToDataURL = _asyncToGenerator(function* (svg) { | |
| 662 | - return Promise.resolve().then(() => new XMLSerializer().serializeToString(svg)).then(encodeURIComponent).then((html) => `data:image/svg+xml;charset=utf-8,${html}`); | |
| 663 | - }); | |
| 664 | - return _svgToDataURL.apply(this, arguments); | |
| 665 | - } | |
| 666 | - function nodeToDataURL(_x2, _x3, _x4) { | |
| 667 | - return _nodeToDataURL.apply(this, arguments); | |
| 668 | - } | |
| 669 | - function _nodeToDataURL() { | |
| 670 | - _nodeToDataURL = _asyncToGenerator(function* (node, width, height) { | |
| 671 | - const xmlns = "http://www.w3.org/2000/svg"; | |
| 672 | - const svg = document.createElementNS(xmlns, "svg"); | |
| 673 | - const foreignObject = document.createElementNS(xmlns, "foreignObject"); | |
| 674 | - svg.setAttribute("width", `${width}`); | |
| 675 | - svg.setAttribute("height", `${height}`); | |
| 676 | - svg.setAttribute("viewBox", `0 0 ${width} ${height}`); | |
| 677 | - foreignObject.setAttribute("width", "100%"); | |
| 678 | - foreignObject.setAttribute("height", "100%"); | |
| 679 | - foreignObject.setAttribute("x", "0"); | |
| 680 | - foreignObject.setAttribute("y", "0"); | |
| 681 | - foreignObject.setAttribute("externalResourcesRequired", "true"); | |
| 682 | - svg.appendChild(foreignObject); | |
| 683 | - foreignObject.appendChild(node); | |
| 684 | - return svgToDataURL(svg); | |
| 685 | - }); | |
| 686 | - return _nodeToDataURL.apply(this, arguments); | |
| 687 | - } | |
| 688 | - var isInstanceOfElement = (node, instance) => { | |
| 689 | - if (node instanceof instance) return true; | |
| 690 | - const nodePrototype = Object.getPrototypeOf(node); | |
| 691 | - if (nodePrototype === null) return false; | |
| 692 | - return nodePrototype.constructor.name === instance.name || isInstanceOfElement(nodePrototype, instance); | |
| 693 | - }; | |
| 184 | +function _interopRequireDefault(e) { | |
| 185 | + return e && e.__esModule ? e : { | |
| 186 | + "default": e | |
| 187 | + }; | |
| 188 | +} | |
| 189 | +module.exports = _interopRequireDefault, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 694 | 190 | |
| 695 | -//#endregion | |
| 696 | -//#region node_modules/html-to-image/es/clone-pseudos.js | |
| 697 | - function formatCSSText(style) { | |
| 698 | - const content = style.getPropertyValue("content"); | |
| 699 | - return `${style.cssText} content: '${content.replace(/'|"/g, "")}';`; | |
| 700 | - } | |
| 701 | - function formatCSSProperties(style, options) { | |
| 702 | - return getStyleProperties(options).map((name) => { | |
| 703 | - return `${name}: ${style.getPropertyValue(name)}${style.getPropertyPriority(name) ? " !important" : ""};`; | |
| 704 | - }).join(" "); | |
| 705 | - } | |
| 706 | - function getPseudoElementStyle(className, pseudo, style, options) { | |
| 707 | - const selector = `.${className}:${pseudo}`; | |
| 708 | - const cssText = style.cssText ? formatCSSText(style) : formatCSSProperties(style, options); | |
| 709 | - return document.createTextNode(`${selector}{${cssText}}`); | |
| 710 | - } | |
| 711 | - function clonePseudoElement(nativeNode, clonedNode, pseudo, options) { | |
| 712 | - const style = window.getComputedStyle(nativeNode, pseudo); | |
| 713 | - const content = style.getPropertyValue("content"); | |
| 714 | - if (content === "" || content === "none") return; | |
| 715 | - const className = uuid(); | |
| 716 | - try { | |
| 717 | - clonedNode.className = `${clonedNode.className} ${className}`; | |
| 718 | - } catch (err) { | |
| 719 | - return; | |
| 720 | - } | |
| 721 | - const styleElement = document.createElement("style"); | |
| 722 | - styleElement.appendChild(getPseudoElementStyle(className, pseudo, style, options)); | |
| 723 | - clonedNode.appendChild(styleElement); | |
| 724 | - } | |
| 725 | - function clonePseudoElements(nativeNode, clonedNode, options) { | |
| 726 | - clonePseudoElement(nativeNode, clonedNode, ":before", options); | |
| 727 | - clonePseudoElement(nativeNode, clonedNode, ":after", options); | |
| 728 | - } | |
| 191 | +/***/ }), | |
| 729 | 192 | |
| 730 | -//#endregion | |
| 731 | -//#region node_modules/html-to-image/es/mimes.js | |
| 732 | - var WOFF = "application/font-woff"; | |
| 733 | - var JPEG = "image/jpeg"; | |
| 734 | - var mimes = { | |
| 735 | - woff: WOFF, | |
| 736 | - woff2: WOFF, | |
| 737 | - ttf: "application/font-truetype", | |
| 738 | - eot: "application/vnd.ms-fontobject", | |
| 739 | - png: "image/png", | |
| 740 | - jpg: JPEG, | |
| 741 | - jpeg: JPEG, | |
| 742 | - gif: "image/gif", | |
| 743 | - tiff: "image/tiff", | |
| 744 | - svg: "image/svg+xml", | |
| 745 | - webp: "image/webp" | |
| 746 | - }; | |
| 747 | - function getExtension(url) { | |
| 748 | - const match = /\.([^./]*?)$/g.exec(url); | |
| 749 | - return match ? match[1] : ""; | |
| 750 | - } | |
| 751 | - function getMimeType(url) { | |
| 752 | - const extension = getExtension(url).toLowerCase(); | |
| 753 | - return mimes[extension] || ""; | |
| 754 | - } | |
| 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__) => { | |
| 755 | 198 | |
| 756 | -//#endregion | |
| 757 | -//#region node_modules/html-to-image/es/dataurl.js | |
| 758 | - function getContentFromDataUrl(dataURL) { | |
| 759 | - return dataURL.split(/,/)[1]; | |
| 760 | - } | |
| 761 | - function isDataUrl(url) { | |
| 762 | - return url.search(/^(data:)/) !== -1; | |
| 763 | - } | |
| 764 | - function makeDataUrl(content, mimeType) { | |
| 765 | - return `data:${mimeType};base64,${content}`; | |
| 766 | - } | |
| 767 | - function fetchAsDataURL(_x, _x2, _x3) { | |
| 768 | - return _fetchAsDataURL.apply(this, arguments); | |
| 769 | - } | |
| 770 | - function _fetchAsDataURL() { | |
| 771 | - _fetchAsDataURL = _asyncToGenerator(function* (url, init, process) { | |
| 772 | - const res = yield fetch(url, init); | |
| 773 | - if (res.status === 404) throw new Error(`Resource "${res.url}" not found`); | |
| 774 | - const blob = yield res.blob(); | |
| 775 | - return new Promise((resolve, reject) => { | |
| 776 | - const reader = new FileReader(); | |
| 777 | - reader.onerror = reject; | |
| 778 | - reader.onloadend = () => { | |
| 779 | - try { | |
| 780 | - resolve(process({ | |
| 781 | - res, | |
| 782 | - result: reader.result | |
| 783 | - })); | |
| 784 | - } catch (error) { | |
| 785 | - reject(error); | |
| 786 | - } | |
| 787 | - }; | |
| 788 | - reader.readAsDataURL(blob); | |
| 789 | - }); | |
| 790 | - }); | |
| 791 | - return _fetchAsDataURL.apply(this, arguments); | |
| 792 | - } | |
| 793 | - var cache = {}; | |
| 794 | - function getCacheKey(url, contentType, includeQueryParams) { | |
| 795 | - let key = url.replace(/\?.*/, ""); | |
| 796 | - if (includeQueryParams) key = url; | |
| 797 | - if (/ttf|otf|eot|woff2?/i.test(key)) key = key.replace(/.*\//, ""); | |
| 798 | - return contentType ? `[${contentType}]${key}` : key; | |
| 799 | - } | |
| 800 | - function resourceToDataURL(_x4, _x5, _x6) { | |
| 801 | - return _resourceToDataURL.apply(this, arguments); | |
| 802 | - } | |
| 803 | - function _resourceToDataURL() { | |
| 804 | - _resourceToDataURL = _asyncToGenerator(function* (resourceUrl, contentType, options) { | |
| 805 | - const cacheKey = getCacheKey(resourceUrl, contentType, options.includeQueryParams); | |
| 806 | - if (cache[cacheKey] != null) return cache[cacheKey]; | |
| 807 | - if (options.cacheBust) resourceUrl += (/\?/.test(resourceUrl) ? "&" : "?") + (/* @__PURE__ */ new Date()).getTime(); | |
| 808 | - let dataURL; | |
| 809 | - try { | |
| 810 | - dataURL = makeDataUrl(yield fetchAsDataURL(resourceUrl, options.fetchRequestInit, ({ res, result }) => { | |
| 811 | - if (!contentType) contentType = res.headers.get("Content-Type") || ""; | |
| 812 | - return getContentFromDataUrl(result); | |
| 813 | - }), contentType); | |
| 814 | - } catch (error) { | |
| 815 | - dataURL = options.imagePlaceholder || ""; | |
| 816 | - let msg = `Failed to fetch resource: ${resourceUrl}`; | |
| 817 | - if (error) msg = typeof error === "string" ? error : error.message; | |
| 818 | - if (msg) console.warn(msg); | |
| 819 | - } | |
| 820 | - cache[cacheKey] = dataURL; | |
| 821 | - return dataURL; | |
| 822 | - }); | |
| 823 | - return _resourceToDataURL.apply(this, arguments); | |
| 824 | - } | |
| 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); | |
| 205 | +} | |
| 206 | +module.exports = _possibleConstructorReturn, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 825 | 207 | |
| 826 | -//#endregion | |
| 827 | -//#region node_modules/html-to-image/es/clone-node.js | |
| 828 | - function cloneCanvasElement(_x) { | |
| 829 | - return _cloneCanvasElement.apply(this, arguments); | |
| 830 | - } | |
| 831 | - function _cloneCanvasElement() { | |
| 832 | - _cloneCanvasElement = _asyncToGenerator(function* (canvas) { | |
| 833 | - const dataURL = canvas.toDataURL(); | |
| 834 | - if (dataURL === "data:,") return canvas.cloneNode(false); | |
| 835 | - return createImage(dataURL); | |
| 836 | - }); | |
| 837 | - return _cloneCanvasElement.apply(this, arguments); | |
| 838 | - } | |
| 839 | - function cloneVideoElement(_x2, _x3) { | |
| 840 | - return _cloneVideoElement.apply(this, arguments); | |
| 841 | - } | |
| 842 | - function _cloneVideoElement() { | |
| 843 | - _cloneVideoElement = _asyncToGenerator(function* (video, options) { | |
| 844 | - if (video.currentSrc) { | |
| 845 | - const canvas = document.createElement("canvas"); | |
| 846 | - const ctx = canvas.getContext("2d"); | |
| 847 | - canvas.width = video.clientWidth; | |
| 848 | - canvas.height = video.clientHeight; | |
| 849 | - ctx === null || ctx === void 0 || ctx.drawImage(video, 0, 0, canvas.width, canvas.height); | |
| 850 | - return createImage(canvas.toDataURL()); | |
| 851 | - } | |
| 852 | - const poster = video.poster; | |
| 853 | - return createImage(yield resourceToDataURL(poster, getMimeType(poster), options)); | |
| 854 | - }); | |
| 855 | - return _cloneVideoElement.apply(this, arguments); | |
| 856 | - } | |
| 857 | - function cloneIFrameElement(_x4, _x5) { | |
| 858 | - return _cloneIFrameElement.apply(this, arguments); | |
| 859 | - } | |
| 860 | - function _cloneIFrameElement() { | |
| 861 | - _cloneIFrameElement = _asyncToGenerator(function* (iframe, options) { | |
| 862 | - var _a; | |
| 863 | - try { | |
| 864 | - if ((_a = iframe === null || iframe === void 0 ? void 0 : iframe.contentDocument) === null || _a === void 0 ? void 0 : _a.body) return yield cloneNode(iframe.contentDocument.body, options, true); | |
| 865 | - } catch (_b) {} | |
| 866 | - return iframe.cloneNode(false); | |
| 867 | - }); | |
| 868 | - return _cloneIFrameElement.apply(this, arguments); | |
| 869 | - } | |
| 870 | - function cloneSingleNode(_x6, _x7) { | |
| 871 | - return _cloneSingleNode.apply(this, arguments); | |
| 872 | - } | |
| 873 | - function _cloneSingleNode() { | |
| 874 | - _cloneSingleNode = _asyncToGenerator(function* (node, options) { | |
| 875 | - if (isInstanceOfElement(node, HTMLCanvasElement)) return cloneCanvasElement(node); | |
| 876 | - if (isInstanceOfElement(node, HTMLVideoElement)) return cloneVideoElement(node, options); | |
| 877 | - if (isInstanceOfElement(node, HTMLIFrameElement)) return cloneIFrameElement(node, options); | |
| 878 | - return node.cloneNode(isSVGElement(node)); | |
| 879 | - }); | |
| 880 | - return _cloneSingleNode.apply(this, arguments); | |
| 881 | - } | |
| 882 | - var isSlotElement = (node) => node.tagName != null && node.tagName.toUpperCase() === "SLOT"; | |
| 883 | - var isSVGElement = (node) => node.tagName != null && node.tagName.toUpperCase() === "SVG"; | |
| 884 | - function cloneChildren(_x8, _x9, _x10) { | |
| 885 | - return _cloneChildren.apply(this, arguments); | |
| 886 | - } | |
| 887 | - function _cloneChildren() { | |
| 888 | - _cloneChildren = _asyncToGenerator(function* (nativeNode, clonedNode, options) { | |
| 889 | - var _a; | |
| 890 | - var _b; | |
| 891 | - if (isSVGElement(clonedNode)) return clonedNode; | |
| 892 | - let children = []; | |
| 893 | - if (isSlotElement(nativeNode) && nativeNode.assignedNodes) children = toArray(nativeNode.assignedNodes()); | |
| 894 | - else if (isInstanceOfElement(nativeNode, HTMLIFrameElement) && ((_a = nativeNode.contentDocument) === null || _a === void 0 ? void 0 : _a.body)) children = toArray(nativeNode.contentDocument.body.childNodes); | |
| 895 | - else children = toArray(((_b = nativeNode.shadowRoot) !== null && _b !== void 0 ? _b : nativeNode).childNodes); | |
| 896 | - if (children.length === 0 || isInstanceOfElement(nativeNode, HTMLVideoElement)) return clonedNode; | |
| 897 | - yield children.reduce((deferred, child) => deferred.then(() => cloneNode(child, options)).then((clonedChild) => { | |
| 898 | - if (clonedChild) clonedNode.appendChild(clonedChild); | |
| 899 | - }), Promise.resolve()); | |
| 900 | - return clonedNode; | |
| 901 | - }); | |
| 902 | - return _cloneChildren.apply(this, arguments); | |
| 903 | - } | |
| 904 | - function cloneCSSStyle(nativeNode, clonedNode, options) { | |
| 905 | - const targetStyle = clonedNode.style; | |
| 906 | - if (!targetStyle) return; | |
| 907 | - const sourceStyle = window.getComputedStyle(nativeNode); | |
| 908 | - if (sourceStyle.cssText) { | |
| 909 | - targetStyle.cssText = sourceStyle.cssText; | |
| 910 | - targetStyle.transformOrigin = sourceStyle.transformOrigin; | |
| 911 | - } else getStyleProperties(options).forEach((name) => { | |
| 912 | - let value = sourceStyle.getPropertyValue(name); | |
| 913 | - if (name === "font-size" && value.endsWith("px")) value = `${Math.floor(parseFloat(value.substring(0, value.length - 2))) - .1}px`; | |
| 914 | - if (isInstanceOfElement(nativeNode, HTMLIFrameElement) && name === "display" && value === "inline") value = "block"; | |
| 915 | - if (name === "d" && clonedNode.getAttribute("d")) value = `path(${clonedNode.getAttribute("d")})`; | |
| 916 | - targetStyle.setProperty(name, value, sourceStyle.getPropertyPriority(name)); | |
| 917 | - }); | |
| 918 | - } | |
| 919 | - function cloneInputValue(nativeNode, clonedNode) { | |
| 920 | - if (isInstanceOfElement(nativeNode, HTMLTextAreaElement)) clonedNode.innerHTML = nativeNode.value; | |
| 921 | - if (isInstanceOfElement(nativeNode, HTMLInputElement)) clonedNode.setAttribute("value", nativeNode.value); | |
| 922 | - } | |
| 923 | - function cloneSelectValue(nativeNode, clonedNode) { | |
| 924 | - if (isInstanceOfElement(nativeNode, HTMLSelectElement)) { | |
| 925 | - const clonedSelect = clonedNode; | |
| 926 | - const selectedOption = Array.from(clonedSelect.children).find((child) => nativeNode.value === child.getAttribute("value")); | |
| 927 | - if (selectedOption) selectedOption.setAttribute("selected", ""); | |
| 928 | - } | |
| 929 | - } | |
| 930 | - function decorate(nativeNode, clonedNode, options) { | |
| 931 | - if (isInstanceOfElement(clonedNode, Element)) { | |
| 932 | - cloneCSSStyle(nativeNode, clonedNode, options); | |
| 933 | - clonePseudoElements(nativeNode, clonedNode, options); | |
| 934 | - cloneInputValue(nativeNode, clonedNode); | |
| 935 | - cloneSelectValue(nativeNode, clonedNode); | |
| 936 | - } | |
| 937 | - return clonedNode; | |
| 938 | - } | |
| 939 | - function ensureSVGSymbols(_x11, _x12) { | |
| 940 | - return _ensureSVGSymbols.apply(this, arguments); | |
| 941 | - } | |
| 942 | - function _ensureSVGSymbols() { | |
| 943 | - _ensureSVGSymbols = _asyncToGenerator(function* (clone, options) { | |
| 944 | - const uses = clone.querySelectorAll ? clone.querySelectorAll("use") : []; | |
| 945 | - if (uses.length === 0) return clone; | |
| 946 | - const processedDefs = {}; | |
| 947 | - for (let i = 0; i < uses.length; i++) { | |
| 948 | - const id = uses[i].getAttribute("xlink:href"); | |
| 949 | - if (id) { | |
| 950 | - const exist = clone.querySelector(id); | |
| 951 | - const definition = document.querySelector(id); | |
| 952 | - if (!exist && definition && !processedDefs[id]) processedDefs[id] = yield cloneNode(definition, options, true); | |
| 953 | - } | |
| 954 | - } | |
| 955 | - const nodes = Object.values(processedDefs); | |
| 956 | - if (nodes.length) { | |
| 957 | - const ns = "http://www.w3.org/1999/xhtml"; | |
| 958 | - const svg = document.createElementNS(ns, "svg"); | |
| 959 | - svg.setAttribute("xmlns", ns); | |
| 960 | - svg.style.position = "absolute"; | |
| 961 | - svg.style.width = "0"; | |
| 962 | - svg.style.height = "0"; | |
| 963 | - svg.style.overflow = "hidden"; | |
| 964 | - svg.style.display = "none"; | |
| 965 | - const defs = document.createElementNS(ns, "defs"); | |
| 966 | - svg.appendChild(defs); | |
| 967 | - for (let i = 0; i < nodes.length; i++) defs.appendChild(nodes[i]); | |
| 968 | - clone.appendChild(svg); | |
| 969 | - } | |
| 970 | - return clone; | |
| 971 | - }); | |
| 972 | - return _ensureSVGSymbols.apply(this, arguments); | |
| 973 | - } | |
| 974 | - function cloneNode(_x13, _x14, _x15) { | |
| 975 | - return _cloneNode.apply(this, arguments); | |
| 976 | - } | |
| 977 | - function _cloneNode() { | |
| 978 | - _cloneNode = _asyncToGenerator(function* (node, options, isRoot) { | |
| 979 | - if (!isRoot && options.filter && !options.filter(node)) return null; | |
| 980 | - return Promise.resolve(node).then((clonedNode) => cloneSingleNode(clonedNode, options)).then((clonedNode) => cloneChildren(node, clonedNode, options)).then((clonedNode) => decorate(node, clonedNode, options)).then((clonedNode) => ensureSVGSymbols(clonedNode, options)); | |
| 981 | - }); | |
| 982 | - return _cloneNode.apply(this, arguments); | |
| 983 | - } | |
| 208 | +/***/ }), | |
| 984 | 209 | |
| 985 | -//#endregion | |
| 986 | -//#region node_modules/html-to-image/es/embed-resources.js | |
| 987 | - var URL_REGEX = /url\((['"]?)([^'"]+?)\1\)/g; | |
| 988 | - var URL_WITH_FORMAT_REGEX = /url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g; | |
| 989 | - var FONT_SRC_REGEX = /src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g; | |
| 990 | - function toRegex(url) { | |
| 991 | - const escaped = url.replace(/([.*+?^${}()|\[\]\/\\])/g, "\\$1"); | |
| 992 | - return new RegExp(`(url\\(['"]?)(${escaped})(['"]?\\))`, "g"); | |
| 993 | - } | |
| 994 | - function parseURLs(cssText) { | |
| 995 | - const urls = []; | |
| 996 | - cssText.replace(URL_REGEX, (raw, quotation, url) => { | |
| 997 | - urls.push(url); | |
| 998 | - return raw; | |
| 999 | - }); | |
| 1000 | - return urls.filter((url) => !isDataUrl(url)); | |
| 1001 | - } | |
| 1002 | - function embed(_x, _x2, _x3, _x4, _x5) { | |
| 1003 | - return _embed.apply(this, arguments); | |
| 1004 | - } | |
| 1005 | - function _embed() { | |
| 1006 | - _embed = _asyncToGenerator(function* (cssText, resourceURL, baseURL, options, getContentFromUrl) { | |
| 1007 | - try { | |
| 1008 | - const resolvedURL = baseURL ? resolveUrl(resourceURL, baseURL) : resourceURL; | |
| 1009 | - const contentType = getMimeType(resourceURL); | |
| 1010 | - let dataURL; | |
| 1011 | - if (getContentFromUrl) dataURL = makeDataUrl(yield getContentFromUrl(resolvedURL), contentType); | |
| 1012 | - else dataURL = yield resourceToDataURL(resolvedURL, contentType, options); | |
| 1013 | - return cssText.replace(toRegex(resourceURL), `$1${dataURL}$3`); | |
| 1014 | - } catch (error) {} | |
| 1015 | - return cssText; | |
| 1016 | - }); | |
| 1017 | - return _embed.apply(this, arguments); | |
| 1018 | - } | |
| 1019 | - function filterPreferredFontFormat(str, { preferredFontFormat }) { | |
| 1020 | - return !preferredFontFormat ? str : str.replace(FONT_SRC_REGEX, (match) => { | |
| 1021 | - while (true) { | |
| 1022 | - const [src, , format] = URL_WITH_FORMAT_REGEX.exec(match) || []; | |
| 1023 | - if (!format) return ""; | |
| 1024 | - if (format === preferredFontFormat) return `src: ${src};`; | |
| 1025 | - } | |
| 1026 | - }); | |
| 1027 | - } | |
| 1028 | - function shouldEmbed(url) { | |
| 1029 | - return url.search(URL_REGEX) !== -1; | |
| 1030 | - } | |
| 1031 | - function embedResources(_x6, _x7, _x8) { | |
| 1032 | - return _embedResources.apply(this, arguments); | |
| 1033 | - } | |
| 1034 | - function _embedResources() { | |
| 1035 | - _embedResources = _asyncToGenerator(function* (cssText, baseUrl, options) { | |
| 1036 | - if (!shouldEmbed(cssText)) return cssText; | |
| 1037 | - const filteredCSSText = filterPreferredFontFormat(cssText, options); | |
| 1038 | - return parseURLs(filteredCSSText).reduce((deferred, url) => deferred.then((css) => embed(css, url, baseUrl, options)), Promise.resolve(filteredCSSText)); | |
| 1039 | - }); | |
| 1040 | - return _embedResources.apply(this, arguments); | |
| 1041 | - } | |
| 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__) => { | |
| 1042 | 215 | |
| 1043 | -//#endregion | |
| 1044 | -//#region node_modules/html-to-image/es/embed-images.js | |
| 1045 | - function embedProp(_x, _x2, _x3) { | |
| 1046 | - return _embedProp.apply(this, arguments); | |
| 1047 | - } | |
| 1048 | - function _embedProp() { | |
| 1049 | - _embedProp = _asyncToGenerator(function* (propName, node, options) { | |
| 1050 | - var _a; | |
| 1051 | - const propValue = (_a = node.style) === null || _a === void 0 ? void 0 : _a.getPropertyValue(propName); | |
| 1052 | - if (propValue) { | |
| 1053 | - const cssString = yield embedResources(propValue, null, options); | |
| 1054 | - node.style.setProperty(propName, cssString, node.style.getPropertyPriority(propName)); | |
| 1055 | - return true; | |
| 1056 | - } | |
| 1057 | - return false; | |
| 1058 | - }); | |
| 1059 | - return _embedProp.apply(this, arguments); | |
| 1060 | - } | |
| 1061 | - function embedBackground(_x4, _x5) { | |
| 1062 | - return _embedBackground.apply(this, arguments); | |
| 1063 | - } | |
| 1064 | - function _embedBackground() { | |
| 1065 | - _embedBackground = _asyncToGenerator(function* (clonedNode, options) { | |
| 1066 | - (yield embedProp("background", clonedNode, options)) || (yield embedProp("background-image", clonedNode, options)); | |
| 1067 | - (yield embedProp("mask", clonedNode, options)) || (yield embedProp("-webkit-mask", clonedNode, options)) || (yield embedProp("mask-image", clonedNode, options)) || (yield embedProp("-webkit-mask-image", clonedNode, options)); | |
| 1068 | - }); | |
| 1069 | - return _embedBackground.apply(this, arguments); | |
| 1070 | - } | |
| 1071 | - function embedImageNode(_x6, _x7) { | |
| 1072 | - return _embedImageNode.apply(this, arguments); | |
| 1073 | - } | |
| 1074 | - function _embedImageNode() { | |
| 1075 | - _embedImageNode = _asyncToGenerator(function* (clonedNode, options) { | |
| 1076 | - const isImageElement = isInstanceOfElement(clonedNode, HTMLImageElement); | |
| 1077 | - if (!(isImageElement && !isDataUrl(clonedNode.src)) && !(isInstanceOfElement(clonedNode, SVGImageElement) && !isDataUrl(clonedNode.href.baseVal))) return; | |
| 1078 | - const url = isImageElement ? clonedNode.src : clonedNode.href.baseVal; | |
| 1079 | - const dataURL = yield resourceToDataURL(url, getMimeType(url), options); | |
| 1080 | - yield new Promise((resolve, reject) => { | |
| 1081 | - clonedNode.onload = resolve; | |
| 1082 | - clonedNode.onerror = options.onImageErrorHandler ? (...attributes) => { | |
| 1083 | - try { | |
| 1084 | - resolve(options.onImageErrorHandler(...attributes)); | |
| 1085 | - } catch (error) { | |
| 1086 | - reject(error); | |
| 1087 | - } | |
| 1088 | - } : reject; | |
| 1089 | - const image = clonedNode; | |
| 1090 | - if (image.decode) image.decode = resolve; | |
| 1091 | - if (image.loading === "lazy") image.loading = "eager"; | |
| 1092 | - if (isImageElement) { | |
| 1093 | - clonedNode.srcset = ""; | |
| 1094 | - clonedNode.src = dataURL; | |
| 1095 | - } else clonedNode.href.baseVal = dataURL; | |
| 1096 | - }); | |
| 1097 | - }); | |
| 1098 | - return _embedImageNode.apply(this, arguments); | |
| 1099 | - } | |
| 1100 | - function embedChildren(_x8, _x9) { | |
| 1101 | - return _embedChildren.apply(this, arguments); | |
| 1102 | - } | |
| 1103 | - function _embedChildren() { | |
| 1104 | - _embedChildren = _asyncToGenerator(function* (clonedNode, options) { | |
| 1105 | - const deferreds = toArray(clonedNode.childNodes).map((child) => embedImages(child, options)); | |
| 1106 | - yield Promise.all(deferreds).then(() => clonedNode); | |
| 1107 | - }); | |
| 1108 | - return _embedChildren.apply(this, arguments); | |
| 1109 | - } | |
| 1110 | - function embedImages(_x10, _x11) { | |
| 1111 | - return _embedImages.apply(this, arguments); | |
| 1112 | - } | |
| 1113 | - function _embedImages() { | |
| 1114 | - _embedImages = _asyncToGenerator(function* (clonedNode, options) { | |
| 1115 | - if (isInstanceOfElement(clonedNode, Element)) { | |
| 1116 | - yield embedBackground(clonedNode, options); | |
| 1117 | - yield embedImageNode(clonedNode, options); | |
| 1118 | - yield embedChildren(clonedNode, options); | |
| 1119 | - } | |
| 1120 | - }); | |
| 1121 | - return _embedImages.apply(this, arguments); | |
| 1122 | - } | |
| 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; | |
| 1123 | 305 | |
| 1124 | -//#endregion | |
| 1125 | -//#region node_modules/html-to-image/es/apply-style.js | |
| 1126 | - function applyStyle(node, options) { | |
| 1127 | - const { style } = node; | |
| 1128 | - if (options.backgroundColor) style.backgroundColor = options.backgroundColor; | |
| 1129 | - if (options.width) style.width = `${options.width}px`; | |
| 1130 | - if (options.height) style.height = `${options.height}px`; | |
| 1131 | - const manual = options.style; | |
| 1132 | - if (manual != null) Object.keys(manual).forEach((key) => { | |
| 1133 | - style[key] = manual[key]; | |
| 1134 | - }); | |
| 1135 | - return node; | |
| 1136 | - } | |
| 306 | +/***/ }), | |
| 1137 | 307 | |
| 1138 | -//#endregion | |
| 1139 | -//#region node_modules/html-to-image/es/embed-webfonts.js | |
| 1140 | - var cssFetchCache = {}; | |
| 1141 | - function fetchCSS(_x) { | |
| 1142 | - return _fetchCSS.apply(this, arguments); | |
| 1143 | - } | |
| 1144 | - function _fetchCSS() { | |
| 1145 | - _fetchCSS = _asyncToGenerator(function* (url) { | |
| 1146 | - let cache = cssFetchCache[url]; | |
| 1147 | - if (cache != null) return cache; | |
| 1148 | - cache = { | |
| 1149 | - url, | |
| 1150 | - cssText: yield (yield fetch(url)).text() | |
| 1151 | - }; | |
| 1152 | - cssFetchCache[url] = cache; | |
| 1153 | - return cache; | |
| 1154 | - }); | |
| 1155 | - return _fetchCSS.apply(this, arguments); | |
| 1156 | - } | |
| 1157 | - function embedFonts(_x3, _x4) { | |
| 1158 | - return _embedFonts.apply(this, arguments); | |
| 1159 | - } | |
| 1160 | - function _embedFonts() { | |
| 1161 | - _embedFonts = _asyncToGenerator(function* (data, options) { | |
| 1162 | - let cssText = data.cssText; | |
| 1163 | - const regexUrl = /url\(["']?([^"')]+)["']?\)/g; | |
| 1164 | - const loadFonts = (cssText.match(/url\([^)]+\)/g) || []).map(function() { | |
| 1165 | - var _ref = _asyncToGenerator(function* (loc) { | |
| 1166 | - let url = loc.replace(regexUrl, "$1"); | |
| 1167 | - if (!url.startsWith("https://")) url = new URL(url, data.url).href; | |
| 1168 | - return fetchAsDataURL(url, options.fetchRequestInit, ({ result }) => { | |
| 1169 | - cssText = cssText.replace(loc, `url(${result})`); | |
| 1170 | - return [loc, result]; | |
| 1171 | - }); | |
| 1172 | - }); | |
| 1173 | - return function(_x2) { | |
| 1174 | - return _ref.apply(this, arguments); | |
| 1175 | - }; | |
| 1176 | - }()); | |
| 1177 | - return Promise.all(loadFonts).then(() => cssText); | |
| 1178 | - }); | |
| 1179 | - return _embedFonts.apply(this, arguments); | |
| 1180 | - } | |
| 1181 | - function parseCSS(source) { | |
| 1182 | - if (source == null) return []; | |
| 1183 | - const result = []; | |
| 1184 | - let cssText = source.replace(/(\/\*[\s\S]*?\*\/)/gi, ""); | |
| 1185 | - const keyframesRegex = /* @__PURE__ */ new RegExp("((@.*?keyframes [\\s\\S]*?){([\\s\\S]*?}\\s*?)})", "gi"); | |
| 1186 | - while (true) { | |
| 1187 | - const matches = keyframesRegex.exec(cssText); | |
| 1188 | - if (matches === null) break; | |
| 1189 | - result.push(matches[0]); | |
| 1190 | - } | |
| 1191 | - cssText = cssText.replace(keyframesRegex, ""); | |
| 1192 | - const importRegex = /@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi; | |
| 1193 | - const unifiedRegex = /* @__PURE__ */ new RegExp("((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})", "gi"); | |
| 1194 | - while (true) { | |
| 1195 | - let matches = importRegex.exec(cssText); | |
| 1196 | - if (matches === null) { | |
| 1197 | - matches = unifiedRegex.exec(cssText); | |
| 1198 | - if (matches === null) break; | |
| 1199 | - else importRegex.lastIndex = unifiedRegex.lastIndex; | |
| 1200 | - } else unifiedRegex.lastIndex = importRegex.lastIndex; | |
| 1201 | - result.push(matches[0]); | |
| 1202 | - } | |
| 1203 | - return result; | |
| 1204 | - } | |
| 1205 | - function getCSSRules(_x5, _x6) { | |
| 1206 | - return _getCSSRules.apply(this, arguments); | |
| 1207 | - } | |
| 1208 | - function _getCSSRules() { | |
| 1209 | - _getCSSRules = _asyncToGenerator(function* (styleSheets, options) { | |
| 1210 | - const ret = []; | |
| 1211 | - const deferreds = []; | |
| 1212 | - styleSheets.forEach((sheet) => { | |
| 1213 | - if ("cssRules" in sheet) try { | |
| 1214 | - toArray(sheet.cssRules || []).forEach((item, index) => { | |
| 1215 | - if (item.type === CSSRule.IMPORT_RULE) { | |
| 1216 | - let importIndex = index + 1; | |
| 1217 | - const url = item.href; | |
| 1218 | - const deferred = fetchCSS(url).then((metadata) => embedFonts(metadata, options)).then((cssText) => parseCSS(cssText).forEach((rule) => { | |
| 1219 | - try { | |
| 1220 | - sheet.insertRule(rule, rule.startsWith("@import") ? importIndex += 1 : sheet.cssRules.length); | |
| 1221 | - } catch (error) { | |
| 1222 | - console.error("Error inserting rule from remote css", { | |
| 1223 | - rule, | |
| 1224 | - error | |
| 1225 | - }); | |
| 1226 | - } | |
| 1227 | - })).catch((e) => { | |
| 1228 | - console.error("Error loading remote css", e.toString()); | |
| 1229 | - }); | |
| 1230 | - deferreds.push(deferred); | |
| 1231 | - } | |
| 1232 | - }); | |
| 1233 | - } catch (e) { | |
| 1234 | - const inline = styleSheets.find((a) => a.href == null) || document.styleSheets[0]; | |
| 1235 | - if (sheet.href != null) deferreds.push(fetchCSS(sheet.href).then((metadata) => embedFonts(metadata, options)).then((cssText) => parseCSS(cssText).forEach((rule) => { | |
| 1236 | - inline.insertRule(rule, inline.cssRules.length); | |
| 1237 | - })).catch((err) => { | |
| 1238 | - console.error("Error loading remote stylesheet", err); | |
| 1239 | - })); | |
| 1240 | - console.error("Error inlining remote css file", e); | |
| 1241 | - } | |
| 1242 | - }); | |
| 1243 | - return Promise.all(deferreds).then(() => { | |
| 1244 | - styleSheets.forEach((sheet) => { | |
| 1245 | - if ("cssRules" in sheet) try { | |
| 1246 | - toArray(sheet.cssRules || []).forEach((item) => { | |
| 1247 | - ret.push(item); | |
| 1248 | - }); | |
| 1249 | - } catch (e) { | |
| 1250 | - console.error(`Error while reading CSS rules from ${sheet.href}`, e); | |
| 1251 | - } | |
| 1252 | - }); | |
| 1253 | - return ret; | |
| 1254 | - }); | |
| 1255 | - }); | |
| 1256 | - return _getCSSRules.apply(this, arguments); | |
| 1257 | - } | |
| 1258 | - function getWebFontRules(cssRules) { | |
| 1259 | - return cssRules.filter((rule) => rule.type === CSSRule.FONT_FACE_RULE).filter((rule) => shouldEmbed(rule.style.getPropertyValue("src"))); | |
| 1260 | - } | |
| 1261 | - function parseWebFontRules(_x7, _x8) { | |
| 1262 | - return _parseWebFontRules.apply(this, arguments); | |
| 1263 | - } | |
| 1264 | - function _parseWebFontRules() { | |
| 1265 | - _parseWebFontRules = _asyncToGenerator(function* (node, options) { | |
| 1266 | - if (node.ownerDocument == null) throw new Error("Provided element is not within a Document"); | |
| 1267 | - return getWebFontRules(yield getCSSRules(toArray(node.ownerDocument.styleSheets), options)); | |
| 1268 | - }); | |
| 1269 | - return _parseWebFontRules.apply(this, arguments); | |
| 1270 | - } | |
| 1271 | - function normalizeFontFamily(font) { | |
| 1272 | - return font.trim().replace(/["']/g, ""); | |
| 1273 | - } | |
| 1274 | - function getUsedFonts(node) { | |
| 1275 | - const fonts = /* @__PURE__ */ new Set(); | |
| 1276 | - function traverse(node) { | |
| 1277 | - (node.style.fontFamily || getComputedStyle(node).fontFamily).split(",").forEach((font) => { | |
| 1278 | - fonts.add(normalizeFontFamily(font)); | |
| 1279 | - }); | |
| 1280 | - Array.from(node.children).forEach((child) => { | |
| 1281 | - if (child instanceof HTMLElement) traverse(child); | |
| 1282 | - }); | |
| 1283 | - } | |
| 1284 | - traverse(node); | |
| 1285 | - return fonts; | |
| 1286 | - } | |
| 1287 | - function getWebFontCSS(_x9, _x10) { | |
| 1288 | - return _getWebFontCSS.apply(this, arguments); | |
| 1289 | - } | |
| 1290 | - function _getWebFontCSS() { | |
| 1291 | - _getWebFontCSS = _asyncToGenerator(function* (node, options) { | |
| 1292 | - const rules = yield parseWebFontRules(node, options); | |
| 1293 | - const usedFonts = getUsedFonts(node); | |
| 1294 | - return (yield Promise.all(rules.filter((rule) => usedFonts.has(normalizeFontFamily(rule.style.fontFamily))).map((rule) => { | |
| 1295 | - const baseUrl = rule.parentStyleSheet ? rule.parentStyleSheet.href : null; | |
| 1296 | - return embedResources(rule.cssText, baseUrl, options); | |
| 1297 | - }))).join("\n"); | |
| 1298 | - }); | |
| 1299 | - return _getWebFontCSS.apply(this, arguments); | |
| 1300 | - } | |
| 1301 | - function embedWebFonts(_x11, _x12) { | |
| 1302 | - return _embedWebFonts.apply(this, arguments); | |
| 1303 | - } | |
| 1304 | - function _embedWebFonts() { | |
| 1305 | - _embedWebFonts = _asyncToGenerator(function* (clonedNode, options) { | |
| 1306 | - const cssText = options.fontEmbedCSS != null ? options.fontEmbedCSS : options.skipFonts ? null : yield getWebFontCSS(clonedNode, options); | |
| 1307 | - if (cssText) { | |
| 1308 | - const styleNode = document.createElement("style"); | |
| 1309 | - const sytleContent = document.createTextNode(cssText); | |
| 1310 | - styleNode.appendChild(sytleContent); | |
| 1311 | - if (clonedNode.firstChild) clonedNode.insertBefore(styleNode, clonedNode.firstChild); | |
| 1312 | - else clonedNode.appendChild(styleNode); | |
| 1313 | - } | |
| 1314 | - }); | |
| 1315 | - return _embedWebFonts.apply(this, arguments); | |
| 1316 | - } | |
| 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__) => { | |
| 1317 | 313 | |
| 1318 | -//#endregion | |
| 1319 | -//#region node_modules/html-to-image/es/index.js | |
| 1320 | - function toSvg(_x) { | |
| 1321 | - return _toSvg.apply(this, arguments); | |
| 1322 | - } | |
| 1323 | - function _toSvg() { | |
| 1324 | - _toSvg = _asyncToGenerator(function* (node, options = {}) { | |
| 1325 | - const { width, height } = getImageSize(node, options); | |
| 1326 | - const clonedNode = yield cloneNode(node, options, true); | |
| 1327 | - yield embedWebFonts(clonedNode, options); | |
| 1328 | - yield embedImages(clonedNode, options); | |
| 1329 | - applyStyle(clonedNode, options); | |
| 1330 | - return yield nodeToDataURL(clonedNode, width, height); | |
| 1331 | - }); | |
| 1332 | - return _toSvg.apply(this, arguments); | |
| 1333 | - } | |
| 1334 | - function toCanvas(_x2) { | |
| 1335 | - return _toCanvas.apply(this, arguments); | |
| 1336 | - } | |
| 1337 | - function _toCanvas() { | |
| 1338 | - _toCanvas = _asyncToGenerator(function* (node, options = {}) { | |
| 1339 | - const { width, height } = getImageSize(node, options); | |
| 1340 | - const img = yield createImage(yield toSvg(node, options)); | |
| 1341 | - const canvas = document.createElement("canvas"); | |
| 1342 | - const context = canvas.getContext("2d"); | |
| 1343 | - const ratio = options.pixelRatio || getPixelRatio(); | |
| 1344 | - const canvasWidth = options.canvasWidth || width; | |
| 1345 | - const canvasHeight = options.canvasHeight || height; | |
| 1346 | - canvas.width = canvasWidth * ratio; | |
| 1347 | - canvas.height = canvasHeight * ratio; | |
| 1348 | - if (!options.skipAutoScale) checkCanvasDimensions(canvas); | |
| 1349 | - canvas.style.width = `${canvasWidth}`; | |
| 1350 | - canvas.style.height = `${canvasHeight}`; | |
| 1351 | - if (options.backgroundColor) { | |
| 1352 | - context.fillStyle = options.backgroundColor; | |
| 1353 | - context.fillRect(0, 0, canvas.width, canvas.height); | |
| 1354 | - } | |
| 1355 | - context.drawImage(img, 0, 0, canvas.width, canvas.height); | |
| 1356 | - return canvas; | |
| 1357 | - }); | |
| 1358 | - return _toCanvas.apply(this, arguments); | |
| 1359 | - } | |
| 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; | |
| 1360 | 322 | |
| 1361 | -//#endregion | |
| 1362 | -//#region modules/cloud-library/assets/js/preview/screenshot.js | |
| 1363 | - function ownKeys(e, r) { | |
| 1364 | - var t = Object.keys(e); | |
| 1365 | - if (Object.getOwnPropertySymbols) { | |
| 1366 | - var o = Object.getOwnPropertySymbols(e); | |
| 1367 | - r && (o = o.filter(function(r) { | |
| 1368 | - return Object.getOwnPropertyDescriptor(e, r).enumerable; | |
| 1369 | - })), t.push.apply(t, o); | |
| 1370 | - } | |
| 1371 | - return t; | |
| 1372 | - } | |
| 1373 | - function _objectSpread(e) { | |
| 1374 | - for (var r = 1; r < arguments.length; r++) { | |
| 1375 | - var t = null != arguments[r] ? arguments[r] : {}; | |
| 1376 | - r % 2 ? ownKeys(Object(t), !0).forEach(function(r) { | |
| 1377 | - _defineProperty(e, r, t[r]); | |
| 1378 | - }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function(r) { | |
| 1379 | - Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); | |
| 1380 | - }); | |
| 1381 | - } | |
| 1382 | - return e; | |
| 1383 | - } | |
| 1384 | - function _callSuper(t, o, e) { | |
| 1385 | - return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); | |
| 1386 | - } | |
| 1387 | - function _isNativeReflectConstruct() { | |
| 1388 | - try { | |
| 1389 | - var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); | |
| 1390 | - } catch (t) {} | |
| 1391 | - return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { | |
| 1392 | - return !!t; | |
| 1393 | - })(); | |
| 1394 | - } | |
| 1395 | - function _superPropGet(t, o, e, r) { | |
| 1396 | - var p = _get(_getPrototypeOf(1 & r ? t.prototype : t), o, e); | |
| 1397 | - return 2 & r && "function" == typeof p ? function(t) { | |
| 1398 | - return p.apply(e, t); | |
| 1399 | - } : p; | |
| 1400 | - } | |
| 1401 | - var Screenshot = /*#__PURE__*/ function(_elementorModules$Vie) { | |
| 1402 | - function Screenshot() { | |
| 1403 | - _classCallCheck(this, Screenshot); | |
| 1404 | - return _callSuper(this, Screenshot, arguments); | |
| 1405 | - } | |
| 1406 | - _inherits(Screenshot, _elementorModules$Vie); | |
| 1407 | - return _createClass(Screenshot, [ | |
| 1408 | - { | |
| 1409 | - key: "getDefaultSettings", | |
| 1410 | - value: function getDefaultSettings() { | |
| 1411 | - return _objectSpread({ | |
| 1412 | - timeout: 15e3, | |
| 1413 | - render_timeout: 5e3, | |
| 1414 | - image_quality: .15, | |
| 1415 | - image_placeholder: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII=" | |
| 1416 | - }, ElementorScreenshotConfig); | |
| 1417 | - } | |
| 1418 | - }, | |
| 1419 | - { | |
| 1420 | - key: "getDefaultElements", | |
| 1421 | - value: function getDefaultElements() { | |
| 1422 | - return { $elementor: jQuery(ElementorScreenshotConfig.selector) }; | |
| 1423 | - } | |
| 1424 | - }, | |
| 1425 | - { | |
| 1426 | - key: "onInit", | |
| 1427 | - value: function onInit() { | |
| 1428 | - var _this = this; | |
| 1429 | - _superPropGet(Screenshot, "onInit", this, 3)([]); | |
| 1430 | - /** | |
| 1431 | - * Hold the timeout timer | |
| 1432 | - * | |
| 1433 | - * @type {number|null} | |
| 1434 | - */ | |
| 1435 | - this.timeoutTimer = setTimeout(function() { | |
| 1436 | - _this.screenshotFailed(/* @__PURE__ */ new Error("Screenshot timeout reached")); | |
| 1437 | - }, this.getSettings("timeout")); | |
| 1438 | - return this.captureScreenshot(); | |
| 1439 | - } | |
| 1440 | - }, | |
| 1441 | - { | |
| 1442 | - key: "captureScreenshot", | |
| 1443 | - value: function captureScreenshot() { | |
| 1444 | - var _this2 = this; | |
| 1445 | - return Promise.resolve().then(function() { | |
| 1446 | - return _this2.createImage(); | |
| 1447 | - }).then(function(imageData) { | |
| 1448 | - return _this2.save(imageData); | |
| 1449 | - }).then(function(url) { | |
| 1450 | - return _this2.screenshotSucceed(url); | |
| 1451 | - }).catch(function(error) { | |
| 1452 | - return _this2.screenshotFailed(error); | |
| 1453 | - }); | |
| 1454 | - } | |
| 1455 | - }, | |
| 1456 | - { | |
| 1457 | - key: "createImage", | |
| 1458 | - value: function() { | |
| 1459 | - var _createImage = _asyncToGenerator$1(/*#__PURE__*/ import_regenerator.default.mark(function _callee() { | |
| 1460 | - var _this3 = this; | |
| 1461 | - var pageLoadedPromise; | |
| 1462 | - var timeOutPromise; | |
| 1463 | - var $elementorElement; | |
| 1464 | - var bodyStyle; | |
| 1465 | - var bodyBackgroundColor; | |
| 1466 | - var canvas; | |
| 1467 | - return import_regenerator.default.wrap(function(_context) { | |
| 1468 | - while (1) switch (_context.prev = _context.next) { | |
| 1469 | - case 0: | |
| 1470 | - pageLoadedPromise = new Promise(function(resolve) { | |
| 1471 | - window.addEventListener("load", function() { | |
| 1472 | - return resolve(); | |
| 1473 | - }); | |
| 1474 | - }); | |
| 1475 | - timeOutPromise = new Promise(function(resolve) { | |
| 1476 | - setTimeout(function() { | |
| 1477 | - return resolve(); | |
| 1478 | - }, _this3.getSettings("render_timeout")); | |
| 1479 | - }); | |
| 1480 | - _context.next = 1; | |
| 1481 | - return Promise.race([pageLoadedPromise, timeOutPromise]); | |
| 1482 | - case 1: | |
| 1483 | - $elementorElement = this.elements.$elementor; | |
| 1484 | - if (!$elementorElement.length) $elementorElement = jQuery(ElementorScreenshotConfig.selector); | |
| 1485 | - if (!$elementorElement.length) $elementorElement = jQuery("body > div.elementor:not(.elementor-location-header):not(.elementor-location-footer)"); | |
| 1486 | - if ($elementorElement.length) { | |
| 1487 | - _context.next = 2; | |
| 1488 | - break; | |
| 1489 | - } | |
| 1490 | - throw new Error("Elementor container not found. Selector: " + ElementorScreenshotConfig.selector); | |
| 1491 | - case 2: | |
| 1492 | - this.preprocessLazyImages($elementorElement); | |
| 1493 | - bodyStyle = window.getComputedStyle(document.body); | |
| 1494 | - bodyBackgroundColor = bodyStyle.backgroundColor; | |
| 1495 | - _context.next = 3; | |
| 1496 | - return toCanvas($elementorElement[0], { | |
| 1497 | - quality: this.getSettings("image_quality"), | |
| 1498 | - imagePlaceholder: this.getSettings("image_placeholder"), | |
| 1499 | - backgroundColor: bodyBackgroundColor || null, | |
| 1500 | - style: { | |
| 1501 | - transform: "scale(1)", | |
| 1502 | - transformOrigin: "top left" | |
| 1503 | - } | |
| 1504 | - }); | |
| 1505 | - case 3: | |
| 1506 | - canvas = _context.sent; | |
| 1507 | - return _context.abrupt("return", canvas.toDataURL("image/webp", this.getSettings("image_quality"))); | |
| 1508 | - case 4: | |
| 1509 | - case "end": return _context.stop(); | |
| 1510 | - } | |
| 1511 | - }, _callee, this); | |
| 1512 | - })); | |
| 1513 | - function createImage() { | |
| 1514 | - return _createImage.apply(this, arguments); | |
| 1515 | - } | |
| 1516 | - return createImage; | |
| 1517 | - }() | |
| 1518 | - }, | |
| 1519 | - { | |
| 1520 | - key: "preprocessLazyImages", | |
| 1521 | - value: function preprocessLazyImages($element) { | |
| 1522 | - $element.find("img[data-src], img.swiper-lazy, img.lazy").each(function(index, img) { | |
| 1523 | - var $img = jQuery(img); | |
| 1524 | - if ($img.attr("data-src")) { | |
| 1525 | - $img.attr("src", $img.attr("data-src")); | |
| 1526 | - $img.removeAttr("data-src"); | |
| 1527 | - } | |
| 1528 | - $img.removeClass("swiper-lazy lazy swiper-slide-image"); | |
| 1529 | - $img.removeAttr("loading"); | |
| 1530 | - $img.removeAttr("data-srcset"); | |
| 1531 | - }); | |
| 1532 | - } | |
| 1533 | - }, | |
| 1534 | - { | |
| 1535 | - key: "save", | |
| 1536 | - value: function save(dataUrl) { | |
| 1537 | - var _this$getSaveAction = this.getSaveAction(); | |
| 1538 | - var key = _this$getSaveAction.key; | |
| 1539 | - var action = _this$getSaveAction.action; | |
| 1540 | - var data = _defineProperty(_defineProperty({}, key, this.getSettings(key)), "screenshot", dataUrl); | |
| 1541 | - return new Promise(function(resolve, reject) { | |
| 1542 | - if ("kit_id" === key) return resolve(data.screenshot); | |
| 1543 | - elementorCommon.ajax.addRequest(action, { | |
| 1544 | - data, | |
| 1545 | - success: function success(url) { | |
| 1546 | - return resolve(url); | |
| 1547 | - }, | |
| 1548 | - error: function error() { | |
| 1549 | - return reject(); | |
| 1550 | - } | |
| 1551 | - }); | |
| 1552 | - }); | |
| 1553 | - } | |
| 1554 | - }, | |
| 1555 | - { | |
| 1556 | - key: "markAsFailed", | |
| 1557 | - value: function markAsFailed(e) { | |
| 1558 | - var _this4 = this; | |
| 1559 | - return new Promise(function(resolve, reject) { | |
| 1560 | - var templateId = _this4.getSettings("template_id"); | |
| 1561 | - var postId = _this4.getSettings("post_id"); | |
| 1562 | - if (_this4.getSettings("kit_id")) resolve(); | |
| 1563 | - else { | |
| 1564 | - var route = templateId ? "template_screenshot_failed" : "screenshot_failed"; | |
| 1565 | - var data = templateId ? { | |
| 1566 | - template_id: templateId, | |
| 1567 | - error: e.message || e.toString() | |
| 1568 | - } : { post_id: postId }; | |
| 1569 | - elementorCommon.ajax.addRequest(route, { | |
| 1570 | - data, | |
| 1571 | - success: function success() { | |
| 1572 | - return resolve(); | |
| 1573 | - }, | |
| 1574 | - error: function error() { | |
| 1575 | - return reject(); | |
| 1576 | - } | |
| 1577 | - }); | |
| 1578 | - } | |
| 1579 | - }); | |
| 1580 | - } | |
| 1581 | - }, | |
| 1582 | - { | |
| 1583 | - key: "screenshotSucceed", | |
| 1584 | - value: function screenshotSucceed(imageUrl) { | |
| 1585 | - this.screenshotDone(true, imageUrl); | |
| 1586 | - } | |
| 1587 | - }, | |
| 1588 | - { | |
| 1589 | - key: "screenshotFailed", | |
| 1590 | - value: function screenshotFailed(e) { | |
| 1591 | - var _this5 = this; | |
| 1592 | - this.markAsFailed(e).then(function() { | |
| 1593 | - return _this5.screenshotDone(false); | |
| 1594 | - }); | |
| 1595 | - } | |
| 1596 | - }, | |
| 1597 | - { | |
| 1598 | - key: "screenshotDone", | |
| 1599 | - value: function screenshotDone(success) { | |
| 1600 | - var imageUrl = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : null; | |
| 1601 | - clearTimeout(this.timeoutTimer); | |
| 1602 | - this.timeoutTimer = null; | |
| 1603 | - var _this$getSaveAction2 = this.getSaveAction(); | |
| 1604 | - var message = _this$getSaveAction2.message; | |
| 1605 | - var key = _this$getSaveAction2.key; | |
| 1606 | - window.parent.postMessage({ | |
| 1607 | - name: message, | |
| 1608 | - success, | |
| 1609 | - id: this.getSettings(key), | |
| 1610 | - imageUrl | |
| 1611 | - }, "*"); | |
| 1612 | - } | |
| 1613 | - }, | |
| 1614 | - { | |
| 1615 | - key: "getSaveAction", | |
| 1616 | - value: function getSaveAction() { | |
| 1617 | - var config = this.getSettings(); | |
| 1618 | - if (config.kit_id) return { | |
| 1619 | - message: "kit-screenshot-done", | |
| 1620 | - action: "update_kit_preview", | |
| 1621 | - key: "kit_id" | |
| 1622 | - }; | |
| 1623 | - if (config.template_id) return { | |
| 1624 | - message: "library/capture-screenshot-done", | |
| 1625 | - action: "save_template_screenshot", | |
| 1626 | - key: "template_id" | |
| 1627 | - }; | |
| 1628 | - return { | |
| 1629 | - message: "capture-screenshot-done", | |
| 1630 | - action: "screenshot_save", | |
| 1631 | - key: "post_id" | |
| 1632 | - }; | |
| 1633 | - } | |
| 1634 | - } | |
| 1635 | - ]); | |
| 1636 | - }(elementorModules.ViewModule); | |
| 1637 | - jQuery(function() { | |
| 1638 | - new Screenshot(); | |
| 1639 | - }); | |
| 323 | +/***/ }), | |
| 1640 | 324 | |
| 1641 | -//#endregion | |
| 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": | |
| 383 | +/*!*******************************************************************!*\ | |
| 384 | + !*** ../node_modules/@babel/runtime/helpers/regeneratorDefine.js ***! | |
| 385 | + \*******************************************************************/ | |
| 386 | +/***/ ((module) => { | |
| 387 | + | |
| 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); | |
| 408 | +} | |
| 409 | +module.exports = _regeneratorDefine, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 410 | + | |
| 411 | +/***/ }), | |
| 412 | + | |
| 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 | + \********************************************************************/ | |
| 436 | +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { | |
| 437 | + | |
| 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)(); | |
| 513 | +} | |
| 514 | +module.exports = _regeneratorRuntime, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 515 | + | |
| 516 | +/***/ }), | |
| 517 | + | |
| 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__) => { | |
| 523 | + | |
| 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"); | |
| 541 | +} | |
| 542 | +module.exports = _regeneratorValues, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 543 | + | |
| 544 | +/***/ }), | |
| 545 | + | |
| 546 | +/***/ "../node_modules/@babel/runtime/helpers/setPrototypeOf.js": | |
| 547 | +/*!****************************************************************!*\ | |
| 548 | + !*** ../node_modules/@babel/runtime/helpers/setPrototypeOf.js ***! | |
| 549 | + \****************************************************************/ | |
| 550 | +/***/ ((module) => { | |
| 551 | + | |
| 552 | +function _setPrototypeOf(t, e) { | |
| 553 | + return module.exports = _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { | |
| 554 | + return t.__proto__ = e, t; | |
| 555 | + }, module.exports.__esModule = true, module.exports["default"] = module.exports, _setPrototypeOf(t, e); | |
| 556 | +} | |
| 557 | +module.exports = _setPrototypeOf, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 558 | + | |
| 559 | +/***/ }), | |
| 560 | + | |
| 561 | +/***/ "../node_modules/@babel/runtime/helpers/superPropBase.js": | |
| 562 | +/*!***************************************************************!*\ | |
| 563 | + !*** ../node_modules/@babel/runtime/helpers/superPropBase.js ***! | |
| 564 | + \***************************************************************/ | |
| 565 | +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { | |
| 566 | + | |
| 567 | +var getPrototypeOf = __webpack_require__(/*! ./getPrototypeOf.js */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"); | |
| 568 | +function _superPropBase(t, o) { | |
| 569 | + for (; !{}.hasOwnProperty.call(t, o) && null !== (t = getPrototypeOf(t));); | |
| 570 | + return t; | |
| 571 | +} | |
| 572 | +module.exports = _superPropBase, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 573 | + | |
| 574 | +/***/ }), | |
| 575 | + | |
| 576 | +/***/ "../node_modules/@babel/runtime/helpers/toPrimitive.js": | |
| 577 | +/*!*************************************************************!*\ | |
| 578 | + !*** ../node_modules/@babel/runtime/helpers/toPrimitive.js ***! | |
| 579 | + \*************************************************************/ | |
| 580 | +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { | |
| 581 | + | |
| 582 | +var _typeof = (__webpack_require__(/*! ./typeof.js */ "../node_modules/@babel/runtime/helpers/typeof.js")["default"]); | |
| 583 | +function toPrimitive(t, r) { | |
| 584 | + if ("object" != _typeof(t) || !t) return t; | |
| 585 | + var e = t[Symbol.toPrimitive]; | |
| 586 | + if (void 0 !== e) { | |
| 587 | + var i = e.call(t, r || "default"); | |
| 588 | + if ("object" != _typeof(i)) return i; | |
| 589 | + throw new TypeError("@@toPrimitive must return a primitive value."); | |
| 590 | + } | |
| 591 | + return ("string" === r ? String : Number)(t); | |
| 592 | +} | |
| 593 | +module.exports = toPrimitive, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 594 | + | |
| 595 | +/***/ }), | |
| 596 | + | |
| 597 | +/***/ "../node_modules/@babel/runtime/helpers/toPropertyKey.js": | |
| 598 | +/*!***************************************************************!*\ | |
| 599 | + !*** ../node_modules/@babel/runtime/helpers/toPropertyKey.js ***! | |
| 600 | + \***************************************************************/ | |
| 601 | +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { | |
| 602 | + | |
| 603 | +var _typeof = (__webpack_require__(/*! ./typeof.js */ "../node_modules/@babel/runtime/helpers/typeof.js")["default"]); | |
| 604 | +var toPrimitive = __webpack_require__(/*! ./toPrimitive.js */ "../node_modules/@babel/runtime/helpers/toPrimitive.js"); | |
| 605 | +function toPropertyKey(t) { | |
| 606 | + var i = toPrimitive(t, "string"); | |
| 607 | + return "symbol" == _typeof(i) ? i : i + ""; | |
| 608 | +} | |
| 609 | +module.exports = toPropertyKey, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 610 | + | |
| 611 | +/***/ }), | |
| 612 | + | |
| 613 | +/***/ "../node_modules/@babel/runtime/helpers/typeof.js": | |
| 614 | +/*!********************************************************!*\ | |
| 615 | + !*** ../node_modules/@babel/runtime/helpers/typeof.js ***! | |
| 616 | + \********************************************************/ | |
| 617 | +/***/ ((module) => { | |
| 618 | + | |
| 619 | +function _typeof(o) { | |
| 620 | + "@babel/helpers - typeof"; | |
| 621 | + | |
| 622 | + return module.exports = _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { | |
| 623 | + return typeof o; | |
| 624 | + } : function (o) { | |
| 625 | + return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; | |
| 626 | + }, module.exports.__esModule = true, module.exports["default"] = module.exports, _typeof(o); | |
| 627 | +} | |
| 628 | +module.exports = _typeof, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 629 | + | |
| 630 | +/***/ }), | |
| 631 | + | |
| 632 | +/***/ "../node_modules/@babel/runtime/regenerator/index.js": | |
| 633 | +/*!***********************************************************!*\ | |
| 634 | + !*** ../node_modules/@babel/runtime/regenerator/index.js ***! | |
| 635 | + \***********************************************************/ | |
| 636 | +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { | |
| 637 | + | |
| 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); | |
| 651 | + } | |
| 652 | +} | |
| 653 | + | |
| 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 | + }; | |
| 1642 | 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 | +/***/ }) | |
| 1785 | + | |
| 1786 | +/******/ }); | |
| 1787 | +/************************************************************************/ | |
| 1788 | +/******/ // The module cache | |
| 1789 | +/******/ var __webpack_module_cache__ = {}; | |
| 1790 | +/******/ | |
| 1791 | +/******/ // The require function | |
| 1792 | +/******/ function __webpack_require__(moduleId) { | |
| 1793 | +/******/ // Check if module is in cache | |
| 1794 | +/******/ var cachedModule = __webpack_module_cache__[moduleId]; | |
| 1795 | +/******/ if (cachedModule !== undefined) { | |
| 1796 | +/******/ return cachedModule.exports; | |
| 1797 | +/******/ } | |
| 1798 | +/******/ // Create a new module (and put it into the cache) | |
| 1799 | +/******/ var module = __webpack_module_cache__[moduleId] = { | |
| 1800 | +/******/ // no module.id needed | |
| 1801 | +/******/ // no module.loaded needed | |
| 1802 | +/******/ exports: {} | |
| 1803 | +/******/ }; | |
| 1804 | +/******/ | |
| 1805 | +/******/ // Execute the module function | |
| 1806 | +/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); | |
| 1807 | +/******/ | |
| 1808 | +/******/ // Return the exports of the module | |
| 1809 | +/******/ return module.exports; | |
| 1810 | +/******/ } | |
| 1811 | +/******/ | |
| 1812 | +/************************************************************************/ | |
| 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 | +// This entry needs to be wrapped in an IIFE because it needs to be in strict mode. | |
| 1844 | +(() => { | |
| 1845 | +"use strict"; | |
| 1846 | +/*!****************************************************************!*\ | |
| 1847 | + !*** ../modules/cloud-library/assets/js/preview/screenshot.js ***! | |
| 1848 | + \****************************************************************/ | |
| 1849 | + | |
| 1850 | + | |
| 1851 | +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")); | |
| 1854 | +var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js")); | |
| 1855 | +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 1856 | +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 1857 | +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); | |
| 1858 | +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 1859 | +var _get2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/get */ "../node_modules/@babel/runtime/helpers/get.js")); | |
| 1860 | +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 | +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 | +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 | +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 | +function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } | |
| 1866 | +function _superPropGet(t, o, e, r) { var p = (0, _get2.default)((0, _getPrototypeOf2.default)(1 & r ? t.prototype : t), o, e); return 2 & r && "function" == typeof p ? function (t) { return p.apply(e, t); } : p; } | |
| 1867 | +/* global ElementorScreenshotConfig */ | |
| 1868 | +var Screenshot = /*#__PURE__*/function (_elementorModules$Vie) { | |
| 1869 | + function Screenshot() { | |
| 1870 | + (0, _classCallCheck2.default)(this, Screenshot); | |
| 1871 | + return _callSuper(this, Screenshot, arguments); | |
| 1872 | + } | |
| 1873 | + (0, _inherits2.default)(Screenshot, _elementorModules$Vie); | |
| 1874 | + return (0, _createClass2.default)(Screenshot, [{ | |
| 1875 | + key: "getDefaultSettings", | |
| 1876 | + value: function getDefaultSettings() { | |
| 1877 | + return _objectSpread({ | |
| 1878 | + timeout: 15000, | |
| 1879 | + // Wait until screenshot taken or fail in 15 secs. | |
| 1880 | + render_timeout: 5000, | |
| 1881 | + // 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=' | |
| 1885 | + }, ElementorScreenshotConfig); | |
| 1886 | + } | |
| 1887 | + }, { | |
| 1888 | + key: "getDefaultElements", | |
| 1889 | + value: function getDefaultElements() { | |
| 1890 | + var $elementor = jQuery(ElementorScreenshotConfig.selector); | |
| 1891 | + return { | |
| 1892 | + $elementor: $elementor | |
| 1893 | + }; | |
| 1894 | + } | |
| 1895 | + }, { | |
| 1896 | + key: "onInit", | |
| 1897 | + value: function onInit() { | |
| 1898 | + var _this = this; | |
| 1899 | + _superPropGet(Screenshot, "onInit", this, 3)([]); | |
| 1900 | + | |
| 1901 | + /** | |
| 1902 | + * Hold the timeout timer | |
| 1903 | + * | |
| 1904 | + * @type {number|null} | |
| 1905 | + */ | |
| 1906 | + this.timeoutTimer = setTimeout(function () { | |
| 1907 | + _this.screenshotFailed(new Error('Screenshot timeout reached')); | |
| 1908 | + }, this.getSettings('timeout')); | |
| 1909 | + return this.captureScreenshot(); | |
| 1910 | + } | |
| 1911 | + | |
| 1912 | + /** | |
| 1913 | + * The main method for this class. | |
| 1914 | + */ | |
| 1915 | + }, { | |
| 1916 | + key: "captureScreenshot", | |
| 1917 | + value: function captureScreenshot() { | |
| 1918 | + 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); | |
| 1927 | + }); | |
| 1928 | + } | |
| 1929 | + | |
| 1930 | + /** | |
| 1931 | + * Creates a WebP image using html-to-image library. | |
| 1932 | + * | |
| 1933 | + * @return {Promise<string>} URI containing image data | |
| 1934 | + */ | |
| 1935 | + }, { | |
| 1936 | + 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 | + }()) | |
| 1997 | + }, { | |
| 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'); | |
| 2010 | + }); | |
| 2011 | + } | |
| 2012 | + | |
| 2013 | + /** | |
| 2014 | + * Send the image to the server. | |
| 2015 | + * | |
| 2016 | + * @param {string} dataUrl | |
| 2017 | + * @return {Promise<string>} Screenshot URL | |
| 2018 | + */ | |
| 2019 | + }, { | |
| 2020 | + key: "save", | |
| 2021 | + value: function save(dataUrl) { | |
| 2022 | + var _this$getSaveAction = this.getSaveAction(), | |
| 2023 | + key = _this$getSaveAction.key, | |
| 2024 | + action = _this$getSaveAction.action; | |
| 2025 | + var data = (0, _defineProperty2.default)((0, _defineProperty2.default)({}, key, this.getSettings(key)), "screenshot", dataUrl); | |
| 2026 | + return new Promise(function (resolve, reject) { | |
| 2027 | + if ('kit_id' === key) { | |
| 2028 | + return resolve(data.screenshot); | |
| 2029 | + } | |
| 2030 | + elementorCommon.ajax.addRequest(action, { | |
| 2031 | + data: data, | |
| 2032 | + success: function success(url) { | |
| 2033 | + return resolve(url); | |
| 2034 | + }, | |
| 2035 | + error: function error() { | |
| 2036 | + return reject(); | |
| 2037 | + } | |
| 2038 | + }); | |
| 2039 | + }); | |
| 2040 | + } | |
| 2041 | + | |
| 2042 | + /** | |
| 2043 | + * Mark this post screenshot as failed. | |
| 2044 | + * @param {Error} e | |
| 2045 | + */ | |
| 2046 | + }, { | |
| 2047 | + key: "markAsFailed", | |
| 2048 | + value: function markAsFailed(e) { | |
| 2049 | + var _this4 = this; | |
| 2050 | + 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'); | |
| 2054 | + if (kitId) { | |
| 2055 | + resolve(); | |
| 2056 | + } else { | |
| 2057 | + var route = templateId ? 'template_screenshot_failed' : 'screenshot_failed'; | |
| 2058 | + var data = templateId ? { | |
| 2059 | + template_id: templateId, | |
| 2060 | + error: e.message || e.toString() | |
| 2061 | + } : { | |
| 2062 | + post_id: postId | |
| 2063 | + }; | |
| 2064 | + elementorCommon.ajax.addRequest(route, { | |
| 2065 | + data: data, | |
| 2066 | + success: function success() { | |
| 2067 | + return resolve(); | |
| 2068 | + }, | |
| 2069 | + error: function error() { | |
| 2070 | + return reject(); | |
| 2071 | + } | |
| 2072 | + }); | |
| 2073 | + } | |
| 2074 | + }); | |
| 2075 | + } | |
| 2076 | + | |
| 2077 | + /** | |
| 2078 | + * Notify that the screenshot has been succeed. | |
| 2079 | + * | |
| 2080 | + * @param {string} imageUrl | |
| 2081 | + */ | |
| 2082 | + }, { | |
| 2083 | + key: "screenshotSucceed", | |
| 2084 | + value: function screenshotSucceed(imageUrl) { | |
| 2085 | + this.screenshotDone(true, imageUrl); | |
| 2086 | + } | |
| 2087 | + | |
| 2088 | + /** | |
| 2089 | + * Notify that the screenshot has been failed. | |
| 2090 | + * | |
| 2091 | + * @param {Error} e | |
| 2092 | + */ | |
| 2093 | + }, { | |
| 2094 | + key: "screenshotFailed", | |
| 2095 | + value: function screenshotFailed(e) { | |
| 2096 | + var _this5 = this; | |
| 2097 | + this.markAsFailed(e).then(function () { | |
| 2098 | + return _this5.screenshotDone(false); | |
| 2099 | + }); | |
| 2100 | + } | |
| 2101 | + | |
| 2102 | + /** | |
| 2103 | + * Final method of the screenshot. | |
| 2104 | + * | |
| 2105 | + * @param {boolean} success | |
| 2106 | + * @param {string} imageUrl | |
| 2107 | + */ | |
| 2108 | + }, { | |
| 2109 | + key: "screenshotDone", | |
| 2110 | + value: function screenshotDone(success) { | |
| 2111 | + var imageUrl = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; | |
| 2112 | + clearTimeout(this.timeoutTimer); | |
| 2113 | + this.timeoutTimer = null; | |
| 2114 | + var _this$getSaveAction2 = this.getSaveAction(), | |
| 2115 | + message = _this$getSaveAction2.message, | |
| 2116 | + key = _this$getSaveAction2.key; | |
| 2117 | + | |
| 2118 | + // Send the message to the parent window and not to the top. | |
| 2119 | + // e.g: The `Theme builder` is loaded into an iFrame so the message of the screenshot | |
| 2120 | + // should be sent to the `Theme builder` window and not to the top window. | |
| 2121 | + window.parent.postMessage({ | |
| 2122 | + name: message, | |
| 2123 | + success: success, | |
| 2124 | + id: this.getSettings(key), | |
| 2125 | + imageUrl: imageUrl | |
| 2126 | + }, '*'); | |
| 2127 | + } | |
| 2128 | + }, { | |
| 2129 | + key: "getSaveAction", | |
| 2130 | + value: function getSaveAction() { | |
| 2131 | + var config = this.getSettings(); | |
| 2132 | + if (config.kit_id) { | |
| 2133 | + return { | |
| 2134 | + message: 'kit-screenshot-done', | |
| 2135 | + action: 'update_kit_preview', | |
| 2136 | + key: 'kit_id' | |
| 2137 | + }; | |
| 2138 | + } | |
| 2139 | + if (config.template_id) { | |
| 2140 | + return { | |
| 2141 | + message: 'library/capture-screenshot-done', | |
| 2142 | + action: 'save_template_screenshot', | |
| 2143 | + key: 'template_id' | |
| 2144 | + }; | |
| 2145 | + } | |
| 2146 | + return { | |
| 2147 | + message: 'capture-screenshot-done', | |
| 2148 | + action: 'screenshot_save', | |
| 2149 | + key: 'post_id' | |
| 2150 | + }; | |
| 2151 | + } | |
| 2152 | + }]); | |
| 2153 | +}(elementorModules.ViewModule); | |
| 2154 | +jQuery(function () { | |
| 2155 | + new Screenshot(); | |
| 2156 | +}); | |
| 2157 | +})(); | |
| 2158 | + | |
| 2159 | +/******/ })() | |
| 2160 | +; | |
| 1643 | 2161 | //# sourceMappingURL=cloud-library-screenshot.js.map |