@plattar/plattar-qrcode 1.118.1 → 1.120.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -100,9 +100,24 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
100
100
  _createClass(BaseElement, [{
101
101
  key: "connectedCallback",
102
102
  value: function connectedCallback() {
103
+ var _this = this;
104
+
103
105
  if (this.hasAttribute("url")) {
104
106
  this.renderQRCode();
105
107
  }
108
+
109
+ var observer = new MutationObserver(function (mutations) {
110
+ mutations.forEach(function (mutation) {
111
+ if (mutation.type === "attributes") {
112
+ if (_this.hasAttribute("url")) {
113
+ _this.renderQRCode();
114
+ }
115
+ }
116
+ });
117
+ });
118
+ observer.observe(this, {
119
+ attributes: true
120
+ });
106
121
  }
107
122
  }, {
108
123
  key: "download",
@@ -200,10 +215,11 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
200
215
  color2: "#ffffff",
201
216
  rotation: "0"
202
217
  }
203
- }
218
+ },
219
+ width: 1024,
220
+ height: 1024,
221
+ type: "canvas"
204
222
  };
205
- this._options.width = width || 512;
206
- this._options.height = height || 512;
207
223
  this._options.data = url;
208
224
  this._options.margin = margin;
209
225
  this._options.image = image; // set the colors
@@ -228,14 +244,41 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
228
244
  var qrCode = this._qrCode;
229
245
 
230
246
  if (!qrCode) {
247
+ var div = document.createElement("div");
248
+ shadow.appendChild(div);
249
+ this._divContainer = div;
231
250
  this._qrCode = new QRCodeStyling(this._options);
232
251
 
233
- this._qrCode.append(shadow);
252
+ this._qrCode.append(div);
253
+
254
+ this._UpdateCanvas(width, height);
234
255
 
235
256
  return;
236
257
  }
237
258
 
238
259
  this._qrCode.update(this._options);
260
+
261
+ this._UpdateCanvas(width, height);
262
+ }
263
+ }, {
264
+ key: "_UpdateCanvas",
265
+ value: function _UpdateCanvas(width, height) {
266
+ if (!this._qrCode) {
267
+ return;
268
+ }
269
+
270
+ var canvas = this._qrCode._canvas;
271
+
272
+ if (canvas) {
273
+ canvas.style.width = "100%";
274
+ canvas.style.height = "100%";
275
+ }
276
+
277
+ if (this._divContainer) {
278
+ var div = this._divContainer;
279
+ div.style.width = width + "px";
280
+ div.style.height = height + "px";
281
+ }
239
282
  }
240
283
  }]);
241
284
 
@@ -300,8 +343,8 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
300
343
  i = 0,
301
344
  u = null,
302
345
  v = [],
303
- y = {},
304
- _ = function _(t, e) {
346
+ w = {},
347
+ m = function m(t, e) {
305
348
  o = function (t) {
306
349
  for (var e = new Array(t), r = 0; r < t; r += 1) {
307
350
  e[r] = new Array(t);
@@ -312,16 +355,16 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
312
355
  }
313
356
 
314
357
  return e;
315
- }(i = 4 * r + 17), m(0, 0), m(i - 7, 0), m(0, i - 7), x(), b(), S(t, e), r >= 7 && M(t), null == u && (u = P(r, n, v)), C(u, e);
358
+ }(i = 4 * r + 17), b(0, 0), b(i - 7, 0), b(0, i - 7), x(), _(), M(t, e), r >= 7 && S(t), null == u && (u = A(r, n, v)), C(u, e);
316
359
  },
317
- m = function m(t, e) {
360
+ b = function b(t, e) {
318
361
  for (var r = -1; r <= 7; r += 1) {
319
362
  if (!(t + r <= -1 || i <= t + r)) for (var n = -1; n <= 7; n += 1) {
320
363
  e + n <= -1 || i <= e + n || (o[t + r][e + n] = 0 <= r && r <= 6 && (0 == n || 6 == n) || 0 <= n && n <= 6 && (0 == r || 6 == r) || 2 <= r && r <= 4 && 2 <= n && n <= 4);
321
364
  }
322
365
  }
323
366
  },
324
- b = function b() {
367
+ _ = function _() {
325
368
  for (var t = 8; t < i - 8; t += 1) {
326
369
  null == o[t][6] && (o[t][6] = t % 2 == 0);
327
370
  }
@@ -336,14 +379,14 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
336
379
  var i = t[e],
337
380
  a = t[n];
338
381
  if (null == o[i][a]) for (var u = -2; u <= 2; u += 1) {
339
- for (var c = -2; c <= 2; c += 1) {
340
- o[i + u][a + c] = -2 == u || 2 == u || -2 == c || 2 == c || 0 == u && 0 == c;
382
+ for (var h = -2; h <= 2; h += 1) {
383
+ o[i + u][a + h] = -2 == u || 2 == u || -2 == h || 2 == h || 0 == u && 0 == h;
341
384
  }
342
385
  }
343
386
  }
344
387
  }
345
388
  },
346
- M = function M(t) {
389
+ S = function S(t) {
347
390
  for (var e = s.getBCHTypeNumber(r), n = 0; n < 18; n += 1) {
348
391
  var a = !t && 1 == (e >> n & 1);
349
392
  o[Math.floor(n / 3)][n % 3 + i - 8 - 3] = a;
@@ -353,25 +396,25 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
353
396
  a = !t && 1 == (e >> n & 1), o[n % 3 + i - 8 - 3][Math.floor(n / 3)] = a;
354
397
  }
355
398
  },
356
- S = function S(t, e) {
399
+ M = function M(t, e) {
357
400
  for (var r = n << 3 | e, a = s.getBCHTypeInfo(r), u = 0; u < 15; u += 1) {
358
- var c = !t && 1 == (a >> u & 1);
359
- u < 6 ? o[u][8] = c : u < 8 ? o[u + 1][8] = c : o[i - 15 + u][8] = c;
401
+ var h = !t && 1 == (a >> u & 1);
402
+ u < 6 ? o[u][8] = h : u < 8 ? o[u + 1][8] = h : o[i - 15 + u][8] = h;
360
403
  }
361
404
 
362
405
  for (u = 0; u < 15; u += 1) {
363
- c = !t && 1 == (a >> u & 1), u < 8 ? o[8][i - u - 1] = c : u < 9 ? o[8][15 - u - 1 + 1] = c : o[8][15 - u - 1] = c;
406
+ h = !t && 1 == (a >> u & 1), u < 8 ? o[8][i - u - 1] = h : u < 9 ? o[8][15 - u - 1 + 1] = h : o[8][15 - u - 1] = h;
364
407
  }
365
408
 
366
409
  o[i - 8][8] = !t;
367
410
  },
368
411
  C = function C(t, e) {
369
- for (var r = -1, n = i - 1, a = 7, u = 0, c = s.getMaskFunction(e), h = i - 1; h > 0; h -= 2) {
370
- for (6 == h && (h -= 1);;) {
371
- for (var d = 0; d < 2; d += 1) {
372
- if (null == o[n][h - d]) {
373
- var l = !1;
374
- u < t.length && (l = 1 == (t[u] >>> a & 1)), c(n, h - d) && (l = !l), o[n][h - d] = l, -1 == (a -= 1) && (u += 1, a = 7);
412
+ for (var r = -1, n = i - 1, a = 7, u = 0, h = s.getMaskFunction(e), c = i - 1; c > 0; c -= 2) {
413
+ for (6 == c && (c -= 1);;) {
414
+ for (var l = 0; l < 2; l += 1) {
415
+ if (null == o[n][c - l]) {
416
+ var d = !1;
417
+ u < t.length && (d = 1 == (t[u] >>> a & 1)), h(n, c - l) && (d = !d), o[n][c - l] = d, -1 == (a -= 1) && (u += 1, a = 7);
375
418
  }
376
419
  }
377
420
 
@@ -382,8 +425,8 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
382
425
  }
383
426
  }
384
427
  },
385
- P = function P(t, e, r) {
386
- for (var n = h.getRSBlocks(t, e), o = d(), i = 0; i < r.length; i += 1) {
428
+ A = function A(t, e, r) {
429
+ for (var n = c.getRSBlocks(t, e), o = l(), i = 0; i < r.length; i += 1) {
387
430
  var a = r[i];
388
431
  o.put(a.getMode(), 4), o.put(a.getLength(), s.getLengthInBits(a.getMode(), t)), a.write(o);
389
432
  }
@@ -406,55 +449,55 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
406
449
 
407
450
  return function (t, e) {
408
451
  for (var r = 0, n = 0, o = 0, i = new Array(e.length), a = new Array(e.length), u = 0; u < e.length; u += 1) {
409
- var h = e[u].dataCount,
410
- d = e[u].totalCount - h;
411
- n = Math.max(n, h), o = Math.max(o, d), i[u] = new Array(h);
452
+ var c = e[u].dataCount,
453
+ l = e[u].totalCount - c;
454
+ n = Math.max(n, c), o = Math.max(o, l), i[u] = new Array(c);
412
455
 
413
- for (var l = 0; l < i[u].length; l += 1) {
414
- i[u][l] = 255 & t.getBuffer()[l + r];
456
+ for (var d = 0; d < i[u].length; d += 1) {
457
+ i[u][d] = 255 & t.getBuffer()[d + r];
415
458
  }
416
459
 
417
- r += h;
418
- var f = s.getErrorCorrectPolynomial(d),
419
- p = c(i[u], f.getLength() - 1).mod(f);
460
+ r += c;
461
+ var f = s.getErrorCorrectPolynomial(l),
462
+ g = h(i[u], f.getLength() - 1).mod(f);
420
463
 
421
- for (a[u] = new Array(f.getLength() - 1), l = 0; l < a[u].length; l += 1) {
422
- var g = l + p.getLength() - a[u].length;
423
- a[u][l] = g >= 0 ? p.getAt(g) : 0;
464
+ for (a[u] = new Array(f.getLength() - 1), d = 0; d < a[u].length; d += 1) {
465
+ var p = d + g.getLength() - a[u].length;
466
+ a[u][d] = p >= 0 ? g.getAt(p) : 0;
424
467
  }
425
468
  }
426
469
 
427
470
  var v = 0;
428
471
 
429
- for (l = 0; l < e.length; l += 1) {
430
- v += e[l].totalCount;
472
+ for (d = 0; d < e.length; d += 1) {
473
+ v += e[d].totalCount;
431
474
  }
432
475
 
433
- var y = new Array(v),
434
- w = 0;
476
+ var w = new Array(v),
477
+ y = 0;
435
478
 
436
- for (l = 0; l < n; l += 1) {
479
+ for (d = 0; d < n; d += 1) {
437
480
  for (u = 0; u < e.length; u += 1) {
438
- l < i[u].length && (y[w] = i[u][l], w += 1);
481
+ d < i[u].length && (w[y] = i[u][d], y += 1);
439
482
  }
440
483
  }
441
484
 
442
- for (l = 0; l < o; l += 1) {
485
+ for (d = 0; d < o; d += 1) {
443
486
  for (u = 0; u < e.length; u += 1) {
444
- l < a[u].length && (y[w] = a[u][l], w += 1);
487
+ d < a[u].length && (w[y] = a[u][d], y += 1);
445
488
  }
446
489
  }
447
490
 
448
- return y;
491
+ return w;
449
492
  }(o, n);
450
493
  };
451
494
 
452
- y.addData = function (t, e) {
495
+ w.addData = function (t, e) {
453
496
  var r = null;
454
497
 
455
498
  switch (e = e || "Byte") {
456
499
  case "Numeric":
457
- r = l(t);
500
+ r = d(t);
458
501
  break;
459
502
 
460
503
  case "Alphanumeric":
@@ -462,11 +505,11 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
462
505
  break;
463
506
 
464
507
  case "Byte":
465
- r = p(t);
508
+ r = g(t);
466
509
  break;
467
510
 
468
511
  case "Kanji":
469
- r = g(t);
512
+ r = p(t);
470
513
  break;
471
514
 
472
515
  default:
@@ -474,15 +517,15 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
474
517
  }
475
518
 
476
519
  v.push(r), u = null;
477
- }, y.isDark = function (t, e) {
520
+ }, w.isDark = function (t, e) {
478
521
  if (t < 0 || i <= t || e < 0 || i <= e) throw t + "," + e;
479
522
  return o[t][e];
480
- }, y.getModuleCount = function () {
523
+ }, w.getModuleCount = function () {
481
524
  return i;
482
- }, y.make = function () {
525
+ }, w.make = function () {
483
526
  if (r < 1) {
484
527
  for (var t = 1; t < 40; t++) {
485
- for (var e = h.getRSBlocks(t, n), o = d(), i = 0; i < v.length; i++) {
528
+ for (var e = c.getRSBlocks(t, n), o = l(), i = 0; i < v.length; i++) {
486
529
  var a = v[i];
487
530
  o.put(a.getMode(), 4), o.put(a.getLength(), s.getLengthInBits(a.getMode(), t)), a.write(o);
488
531
  }
@@ -499,33 +542,32 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
499
542
  r = t;
500
543
  }
501
544
 
502
- _(!1, function () {
545
+ m(!1, function () {
503
546
  for (var t = 0, e = 0, r = 0; r < 8; r += 1) {
504
- _(!0, r);
505
-
506
- var n = s.getLostPoint(y);
547
+ m(!0, r);
548
+ var n = s.getLostPoint(w);
507
549
  (0 == r || t > n) && (t = n, e = r);
508
550
  }
509
551
 
510
552
  return e;
511
553
  }());
512
- }, y.createTableTag = function (t, e) {
554
+ }, w.createTableTag = function (t, e) {
513
555
  t = t || 2;
514
556
  var r = "";
515
557
  r += '<table style="', r += " border-width: 0px; border-style: none;", r += " border-collapse: collapse;", r += " padding: 0px; margin: " + (e = void 0 === e ? 4 * t : e) + "px;", r += '">', r += "<tbody>";
516
558
 
517
- for (var n = 0; n < y.getModuleCount(); n += 1) {
559
+ for (var n = 0; n < w.getModuleCount(); n += 1) {
518
560
  r += "<tr>";
519
561
 
520
- for (var o = 0; o < y.getModuleCount(); o += 1) {
521
- r += '<td style="', r += " border-width: 0px; border-style: none;", r += " border-collapse: collapse;", r += " padding: 0px; margin: 0px;", r += " width: " + t + "px;", r += " height: " + t + "px;", r += " background-color: ", r += y.isDark(n, o) ? "#000000" : "#ffffff", r += ";", r += '"/>';
562
+ for (var o = 0; o < w.getModuleCount(); o += 1) {
563
+ r += '<td style="', r += " border-width: 0px; border-style: none;", r += " border-collapse: collapse;", r += " padding: 0px; margin: 0px;", r += " width: " + t + "px;", r += " height: " + t + "px;", r += " background-color: ", r += w.isDark(n, o) ? "#000000" : "#ffffff", r += ";", r += '"/>';
522
564
  }
523
565
 
524
566
  r += "</tr>";
525
567
  }
526
568
 
527
569
  return (r += "</tbody>") + "</table>";
528
- }, y.createSvgTag = function (t, e, r, n) {
570
+ }, w.createSvgTag = function (t, e, r, n) {
529
571
  var o = {};
530
572
  "object" == _typeof(arguments[0]) && (t = (o = arguments[0]).cellSize, e = o.margin, r = o.alt, n = o.title), t = t || 2, e = void 0 === e ? 4 * t : e, (r = "string" == typeof r ? {
531
573
  text: r
@@ -536,38 +578,38 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
536
578
  a,
537
579
  s,
538
580
  u,
539
- c = y.getModuleCount() * t + 2 * e,
540
- h = "";
581
+ h = w.getModuleCount() * t + 2 * e,
582
+ c = "";
541
583
 
542
- for (u = "l" + t + ",0 0," + t + " -" + t + ",0 0,-" + t + "z ", h += '<svg version="1.1" xmlns="http://www.w3.org/2000/svg"', h += o.scalable ? "" : ' width="' + c + 'px" height="' + c + 'px"', h += ' viewBox="0 0 ' + c + " " + c + '" ', h += ' preserveAspectRatio="xMinYMin meet"', h += n.text || r.text ? ' role="img" aria-labelledby="' + O([n.id, r.id].join(" ").trim()) + '"' : "", h += ">", h += n.text ? '<title id="' + O(n.id) + '">' + O(n.text) + "</title>" : "", h += r.text ? '<description id="' + O(r.id) + '">' + O(r.text) + "</description>" : "", h += '<rect width="100%" height="100%" fill="white" cx="0" cy="0"/>', h += '<path d="', a = 0; a < y.getModuleCount(); a += 1) {
543
- for (s = a * t + e, i = 0; i < y.getModuleCount(); i += 1) {
544
- y.isDark(a, i) && (h += "M" + (i * t + e) + "," + s + u);
584
+ for (u = "l" + t + ",0 0," + t + " -" + t + ",0 0,-" + t + "z ", c += '<svg version="1.1" xmlns="http://www.w3.org/2000/svg"', c += o.scalable ? "" : ' width="' + h + 'px" height="' + h + 'px"', c += ' viewBox="0 0 ' + h + " " + h + '" ', c += ' preserveAspectRatio="xMinYMin meet"', c += n.text || r.text ? ' role="img" aria-labelledby="' + k([n.id, r.id].join(" ").trim()) + '"' : "", c += ">", c += n.text ? '<title id="' + k(n.id) + '">' + k(n.text) + "</title>" : "", c += r.text ? '<description id="' + k(r.id) + '">' + k(r.text) + "</description>" : "", c += '<rect width="100%" height="100%" fill="white" cx="0" cy="0"/>', c += '<path d="', a = 0; a < w.getModuleCount(); a += 1) {
585
+ for (s = a * t + e, i = 0; i < w.getModuleCount(); i += 1) {
586
+ w.isDark(a, i) && (c += "M" + (i * t + e) + "," + s + u);
545
587
  }
546
588
  }
547
589
 
548
- return (h += '" stroke="transparent" fill="black"/>') + "</svg>";
549
- }, y.createDataURL = function (t, e) {
590
+ return (c += '" stroke="transparent" fill="black"/>') + "</svg>";
591
+ }, w.createDataURL = function (t, e) {
550
592
  t = t || 2, e = void 0 === e ? 4 * t : e;
551
- var r = y.getModuleCount() * t + 2 * e,
593
+ var r = w.getModuleCount() * t + 2 * e,
552
594
  n = e,
553
595
  o = r - e;
554
- return w(r, r, function (e, r) {
596
+ return y(r, r, function (e, r) {
555
597
  if (n <= e && e < o && n <= r && r < o) {
556
598
  var i = Math.floor((e - n) / t),
557
599
  a = Math.floor((r - n) / t);
558
- return y.isDark(a, i) ? 0 : 1;
600
+ return w.isDark(a, i) ? 0 : 1;
559
601
  }
560
602
 
561
603
  return 1;
562
604
  });
563
- }, y.createImgTag = function (t, e, r) {
605
+ }, w.createImgTag = function (t, e, r) {
564
606
  t = t || 2, e = void 0 === e ? 4 * t : e;
565
- var n = y.getModuleCount() * t + 2 * e,
607
+ var n = w.getModuleCount() * t + 2 * e,
566
608
  o = "";
567
- return o += "<img", o += ' src="', o += y.createDataURL(t, e), o += '"', o += ' width="', o += n, o += '"', o += ' height="', o += n, o += '"', r && (o += ' alt="', o += O(r), o += '"'), o + "/>";
609
+ return o += "<img", o += ' src="', o += w.createDataURL(t, e), o += '"', o += ' width="', o += n, o += '"', o += ' height="', o += n, o += '"', r && (o += ' alt="', o += k(r), o += '"'), o + "/>";
568
610
  };
569
611
 
570
- var O = function O(t) {
612
+ var k = function k(t) {
571
613
  for (var e = "", r = 0; r < t.length; r += 1) {
572
614
  var n = t.charAt(r);
573
615
 
@@ -596,7 +638,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
596
638
  return e;
597
639
  };
598
640
 
599
- return y.createASCII = function (t, e) {
641
+ return w.createASCII = function (t, e) {
600
642
  if ((t = t || 1) < 2) return function (t) {
601
643
  t = void 0 === t ? 2 : t;
602
644
  var e,
@@ -604,66 +646,66 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
604
646
  n,
605
647
  o,
606
648
  i,
607
- a = 1 * y.getModuleCount() + 2 * t,
649
+ a = 1 * w.getModuleCount() + 2 * t,
608
650
  s = t,
609
651
  u = a - t,
610
- c = {
652
+ h = {
611
653
  "██": "█",
612
654
  "█ ": "▀",
613
655
  " █": "▄",
614
656
  " ": " "
615
657
  },
616
- h = {
658
+ c = {
617
659
  "██": "▀",
618
660
  "█ ": "▀",
619
661
  " █": " ",
620
662
  " ": " "
621
663
  },
622
- d = "";
664
+ l = "";
623
665
 
624
666
  for (e = 0; e < a; e += 2) {
625
667
  for (n = Math.floor((e - s) / 1), o = Math.floor((e + 1 - s) / 1), r = 0; r < a; r += 1) {
626
- i = "█", s <= r && r < u && s <= e && e < u && y.isDark(n, Math.floor((r - s) / 1)) && (i = " "), s <= r && r < u && s <= e + 1 && e + 1 < u && y.isDark(o, Math.floor((r - s) / 1)) ? i += " " : i += "█", d += t < 1 && e + 1 >= u ? h[i] : c[i];
668
+ i = "█", s <= r && r < u && s <= e && e < u && w.isDark(n, Math.floor((r - s) / 1)) && (i = " "), s <= r && r < u && s <= e + 1 && e + 1 < u && w.isDark(o, Math.floor((r - s) / 1)) ? i += " " : i += "█", l += t < 1 && e + 1 >= u ? c[i] : h[i];
627
669
  }
628
670
 
629
- d += "\n";
671
+ l += "\n";
630
672
  }
631
673
 
632
- return a % 2 && t > 0 ? d.substring(0, d.length - a - 1) + Array(a + 1).join("▀") : d.substring(0, d.length - 1);
674
+ return a % 2 && t > 0 ? l.substring(0, l.length - a - 1) + Array(a + 1).join("▀") : l.substring(0, l.length - 1);
633
675
  }(e);
634
676
  t -= 1, e = void 0 === e ? 2 * t : e;
635
677
  var r,
636
678
  n,
637
679
  o,
638
680
  i,
639
- a = y.getModuleCount() * t + 2 * e,
681
+ a = w.getModuleCount() * t + 2 * e,
640
682
  s = e,
641
683
  u = a - e,
642
- c = Array(t + 1).join("██"),
643
- h = Array(t + 1).join(" "),
644
- d = "",
645
- l = "";
684
+ h = Array(t + 1).join("██"),
685
+ c = Array(t + 1).join(" "),
686
+ l = "",
687
+ d = "";
646
688
 
647
689
  for (r = 0; r < a; r += 1) {
648
- for (o = Math.floor((r - s) / t), l = "", n = 0; n < a; n += 1) {
649
- i = 1, s <= n && n < u && s <= r && r < u && y.isDark(o, Math.floor((n - s) / t)) && (i = 0), l += i ? c : h;
690
+ for (o = Math.floor((r - s) / t), d = "", n = 0; n < a; n += 1) {
691
+ i = 1, s <= n && n < u && s <= r && r < u && w.isDark(o, Math.floor((n - s) / t)) && (i = 0), d += i ? h : c;
650
692
  }
651
693
 
652
694
  for (o = 0; o < t; o += 1) {
653
- d += l + "\n";
695
+ l += d + "\n";
654
696
  }
655
697
  }
656
698
 
657
- return d.substring(0, d.length - 1);
658
- }, y.renderTo2dContext = function (t, e) {
699
+ return l.substring(0, l.length - 1);
700
+ }, w.renderTo2dContext = function (t, e) {
659
701
  e = e || 2;
660
702
 
661
- for (var r = y.getModuleCount(), n = 0; n < r; n++) {
703
+ for (var r = w.getModuleCount(), n = 0; n < r; n++) {
662
704
  for (var o = 0; o < r; o++) {
663
- t.fillStyle = y.isDark(n, o) ? "black" : "white", t.fillRect(n * e, o * e, e, e);
705
+ t.fillStyle = w.isDark(n, o) ? "black" : "white", t.fillRect(n * e, o * e, e, e);
664
706
  }
665
707
  }
666
- }, y;
708
+ }, w;
667
709
  };
668
710
 
669
711
  t.stringToBytes = (t.stringToBytesFuncs = {
@@ -677,7 +719,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
677
719
  }
678
720
  })["default"], t.createStringToBytes = function (t, e) {
679
721
  var r = function () {
680
- for (var r = y(t), n = function n() {
722
+ for (var r = w(t), n = function n() {
681
723
  var t = r.read();
682
724
  if (-1 == t) throw "eof";
683
725
  return t;
@@ -784,8 +826,8 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
784
826
  throw "bad maskPattern:" + t;
785
827
  }
786
828
  }, o.getErrorCorrectPolynomial = function (t) {
787
- for (var e = c([1], 0), r = 0; r < t; r += 1) {
788
- e = e.multiply(c([1, u.gexp(r)], 0));
829
+ for (var e = h([1], 0), r = 0; r < t; r += 1) {
830
+ e = e.multiply(h([1, u.gexp(r)], 0));
789
831
  }
790
832
 
791
833
  return e;
@@ -853,8 +895,8 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
853
895
 
854
896
  for (n = 0; n < e - 1; n += 1) {
855
897
  for (o = 0; o < e - 1; o += 1) {
856
- var c = 0;
857
- t.isDark(n, o) && (c += 1), t.isDark(n + 1, o) && (c += 1), t.isDark(n, o + 1) && (c += 1), t.isDark(n + 1, o + 1) && (c += 1), 0 != c && 4 != c || (r += 3);
898
+ var h = 0;
899
+ t.isDark(n, o) && (h += 1), t.isDark(n + 1, o) && (h += 1), t.isDark(n, o + 1) && (h += 1), t.isDark(n + 1, o + 1) && (h += 1), 0 != h && 4 != h || (r += 3);
858
900
  }
859
901
  }
860
902
 
@@ -870,15 +912,15 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
870
912
  }
871
913
  }
872
914
 
873
- var h = 0;
915
+ var c = 0;
874
916
 
875
917
  for (o = 0; o < e; o += 1) {
876
918
  for (n = 0; n < e; n += 1) {
877
- t.isDark(n, o) && (h += 1);
919
+ t.isDark(n, o) && (c += 1);
878
920
  }
879
921
  }
880
922
 
881
- return r + Math.abs(100 * h / e / e - 50) / 5 * 10;
923
+ return r + Math.abs(100 * c / e / e - 50) / 5 * 10;
882
924
  }, o),
883
925
  u = function () {
884
926
  for (var t = new Array(256), e = new Array(256), r = 0; r < 8; r += 1) {
@@ -912,7 +954,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
912
954
  };
913
955
  }();
914
956
 
915
- function c(t, e) {
957
+ function h(t, e) {
916
958
  if (void 0 === t.length) throw t.length + "/" + e;
917
959
 
918
960
  var r = function () {
@@ -940,7 +982,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
940
982
  }
941
983
  }
942
984
 
943
- return c(e, 0);
985
+ return h(e, 0);
944
986
  },
945
987
  mod: function mod(t) {
946
988
  if (n.getLength() - t.getLength() < 0) return n;
@@ -953,14 +995,14 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
953
995
  r[o] ^= u.gexp(u.glog(t.getAt(o)) + e);
954
996
  }
955
997
 
956
- return c(r, 0).mod(t);
998
+ return h(r, 0).mod(t);
957
999
  }
958
1000
  };
959
1001
 
960
1002
  return n;
961
1003
  }
962
1004
 
963
- var h = function () {
1005
+ var c = function () {
964
1006
  var t = [[1, 26, 19], [1, 26, 16], [1, 26, 13], [1, 26, 9], [1, 44, 34], [1, 44, 28], [1, 44, 22], [1, 44, 16], [1, 70, 55], [1, 70, 44], [2, 35, 17], [2, 35, 13], [1, 100, 80], [2, 50, 32], [2, 50, 24], [4, 25, 9], [1, 134, 108], [2, 67, 43], [2, 33, 15, 2, 34, 16], [2, 33, 11, 2, 34, 12], [2, 86, 68], [4, 43, 27], [4, 43, 19], [4, 43, 15], [2, 98, 78], [4, 49, 31], [2, 32, 14, 4, 33, 15], [4, 39, 13, 1, 40, 14], [2, 121, 97], [2, 60, 38, 2, 61, 39], [4, 40, 18, 2, 41, 19], [4, 40, 14, 2, 41, 15], [2, 146, 116], [3, 58, 36, 2, 59, 37], [4, 36, 16, 4, 37, 17], [4, 36, 12, 4, 37, 13], [2, 86, 68, 2, 87, 69], [4, 69, 43, 1, 70, 44], [6, 43, 19, 2, 44, 20], [6, 43, 15, 2, 44, 16], [4, 101, 81], [1, 80, 50, 4, 81, 51], [4, 50, 22, 4, 51, 23], [3, 36, 12, 8, 37, 13], [2, 116, 92, 2, 117, 93], [6, 58, 36, 2, 59, 37], [4, 46, 20, 6, 47, 21], [7, 42, 14, 4, 43, 15], [4, 133, 107], [8, 59, 37, 1, 60, 38], [8, 44, 20, 4, 45, 21], [12, 33, 11, 4, 34, 12], [3, 145, 115, 1, 146, 116], [4, 64, 40, 5, 65, 41], [11, 36, 16, 5, 37, 17], [11, 36, 12, 5, 37, 13], [5, 109, 87, 1, 110, 88], [5, 65, 41, 5, 66, 42], [5, 54, 24, 7, 55, 25], [11, 36, 12, 7, 37, 13], [5, 122, 98, 1, 123, 99], [7, 73, 45, 3, 74, 46], [15, 43, 19, 2, 44, 20], [3, 45, 15, 13, 46, 16], [1, 135, 107, 5, 136, 108], [10, 74, 46, 1, 75, 47], [1, 50, 22, 15, 51, 23], [2, 42, 14, 17, 43, 15], [5, 150, 120, 1, 151, 121], [9, 69, 43, 4, 70, 44], [17, 50, 22, 1, 51, 23], [2, 42, 14, 19, 43, 15], [3, 141, 113, 4, 142, 114], [3, 70, 44, 11, 71, 45], [17, 47, 21, 4, 48, 22], [9, 39, 13, 16, 40, 14], [3, 135, 107, 5, 136, 108], [3, 67, 41, 13, 68, 42], [15, 54, 24, 5, 55, 25], [15, 43, 15, 10, 44, 16], [4, 144, 116, 4, 145, 117], [17, 68, 42], [17, 50, 22, 6, 51, 23], [19, 46, 16, 6, 47, 17], [2, 139, 111, 7, 140, 112], [17, 74, 46], [7, 54, 24, 16, 55, 25], [34, 37, 13], [4, 151, 121, 5, 152, 122], [4, 75, 47, 14, 76, 48], [11, 54, 24, 14, 55, 25], [16, 45, 15, 14, 46, 16], [6, 147, 117, 4, 148, 118], [6, 73, 45, 14, 74, 46], [11, 54, 24, 16, 55, 25], [30, 46, 16, 2, 47, 17], [8, 132, 106, 4, 133, 107], [8, 75, 47, 13, 76, 48], [7, 54, 24, 22, 55, 25], [22, 45, 15, 13, 46, 16], [10, 142, 114, 2, 143, 115], [19, 74, 46, 4, 75, 47], [28, 50, 22, 6, 51, 23], [33, 46, 16, 4, 47, 17], [8, 152, 122, 4, 153, 123], [22, 73, 45, 3, 74, 46], [8, 53, 23, 26, 54, 24], [12, 45, 15, 28, 46, 16], [3, 147, 117, 10, 148, 118], [3, 73, 45, 23, 74, 46], [4, 54, 24, 31, 55, 25], [11, 45, 15, 31, 46, 16], [7, 146, 116, 7, 147, 117], [21, 73, 45, 7, 74, 46], [1, 53, 23, 37, 54, 24], [19, 45, 15, 26, 46, 16], [5, 145, 115, 10, 146, 116], [19, 75, 47, 10, 76, 48], [15, 54, 24, 25, 55, 25], [23, 45, 15, 25, 46, 16], [13, 145, 115, 3, 146, 116], [2, 74, 46, 29, 75, 47], [42, 54, 24, 1, 55, 25], [23, 45, 15, 28, 46, 16], [17, 145, 115], [10, 74, 46, 23, 75, 47], [10, 54, 24, 35, 55, 25], [19, 45, 15, 35, 46, 16], [17, 145, 115, 1, 146, 116], [14, 74, 46, 21, 75, 47], [29, 54, 24, 19, 55, 25], [11, 45, 15, 46, 46, 16], [13, 145, 115, 6, 146, 116], [14, 74, 46, 23, 75, 47], [44, 54, 24, 7, 55, 25], [59, 46, 16, 1, 47, 17], [12, 151, 121, 7, 152, 122], [12, 75, 47, 26, 76, 48], [39, 54, 24, 14, 55, 25], [22, 45, 15, 41, 46, 16], [6, 151, 121, 14, 152, 122], [6, 75, 47, 34, 76, 48], [46, 54, 24, 10, 55, 25], [2, 45, 15, 64, 46, 16], [17, 152, 122, 4, 153, 123], [29, 74, 46, 14, 75, 47], [49, 54, 24, 10, 55, 25], [24, 45, 15, 46, 46, 16], [4, 152, 122, 18, 153, 123], [13, 74, 46, 32, 75, 47], [48, 54, 24, 14, 55, 25], [42, 45, 15, 32, 46, 16], [20, 147, 117, 4, 148, 118], [40, 75, 47, 7, 76, 48], [43, 54, 24, 22, 55, 25], [10, 45, 15, 67, 46, 16], [19, 148, 118, 6, 149, 119], [18, 75, 47, 31, 76, 48], [34, 54, 24, 34, 55, 25], [20, 45, 15, 61, 46, 16]],
965
1007
  e = function e(t, _e) {
966
1008
  var r = {};
@@ -990,8 +1032,8 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
990
1032
  if (void 0 === o) throw "bad rs block @ typeNumber:" + r + "/errorCorrectionLevel:" + n;
991
1033
 
992
1034
  for (var i = o.length / 3, s = [], u = 0; u < i; u += 1) {
993
- for (var c = o[3 * u + 0], h = o[3 * u + 1], d = o[3 * u + 2], l = 0; l < c; l += 1) {
994
- s.push(e(h, d));
1035
+ for (var h = o[3 * u + 0], c = o[3 * u + 1], l = o[3 * u + 2], d = 0; d < h; d += 1) {
1036
+ s.push(e(c, l));
995
1037
  }
996
1038
  }
997
1039
 
@@ -1001,7 +1043,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
1001
1043
 
1002
1044
  return r;
1003
1045
  }(),
1004
- d = function d() {
1046
+ l = function l() {
1005
1047
  var t = [],
1006
1048
  e = 0,
1007
1049
  r = {
@@ -1027,7 +1069,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
1027
1069
  };
1028
1070
  return r;
1029
1071
  },
1030
- l = function l(t) {
1072
+ d = function d(t) {
1031
1073
  var e = t,
1032
1074
  r = {
1033
1075
  getMode: function getMode() {
@@ -1114,7 +1156,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
1114
1156
 
1115
1157
  return r;
1116
1158
  },
1117
- p = function p(e) {
1159
+ g = function g(e) {
1118
1160
  var r = t.stringToBytes(e);
1119
1161
  return {
1120
1162
  getMode: function getMode() {
@@ -1130,7 +1172,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
1130
1172
  }
1131
1173
  };
1132
1174
  },
1133
- g = function g(e) {
1175
+ p = function p(e) {
1134
1176
  var r = t.stringToBytesFuncs.SJIS;
1135
1177
  if (!r) throw "sjis not supported.";
1136
1178
  !function (t, e) {
@@ -1196,7 +1238,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
1196
1238
  };
1197
1239
  return e;
1198
1240
  },
1199
- y = function y(t) {
1241
+ w = function w(t) {
1200
1242
  var e = t,
1201
1243
  r = 0,
1202
1244
  n = 0,
@@ -1229,7 +1271,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
1229
1271
 
1230
1272
  return i;
1231
1273
  },
1232
- w = function w(t, e, r) {
1274
+ y = function y(t, e, r) {
1233
1275
  for (var n = function (t, e) {
1234
1276
  var r = t,
1235
1277
  n = e,
@@ -1257,33 +1299,33 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
1257
1299
 
1258
1300
  i.add(String.fromCharCode(e)), i.add(String.fromCharCode(r));
1259
1301
  var u,
1260
- c,
1261
1302
  h,
1262
- d = v(),
1263
- l = (u = d, c = 0, h = 0, {
1303
+ c,
1304
+ l = v(),
1305
+ d = (u = l, h = 0, c = 0, {
1264
1306
  write: function write(t, e) {
1265
1307
  if (t >>> e != 0) throw "length over";
1266
1308
 
1267
- for (; c + e >= 8;) {
1268
- u.writeByte(255 & (t << c | h)), e -= 8 - c, t >>>= 8 - c, h = 0, c = 0;
1309
+ for (; h + e >= 8;) {
1310
+ u.writeByte(255 & (t << h | c)), e -= 8 - h, t >>>= 8 - h, c = 0, h = 0;
1269
1311
  }
1270
1312
 
1271
- h |= t << c, c += e;
1313
+ c |= t << h, h += e;
1272
1314
  },
1273
1315
  flush: function flush() {
1274
- c > 0 && u.writeByte(h);
1316
+ h > 0 && u.writeByte(c);
1275
1317
  }
1276
1318
  });
1277
- l.write(e, n);
1319
+ d.write(e, n);
1278
1320
  var f = 0,
1279
- p = String.fromCharCode(o[f]);
1321
+ g = String.fromCharCode(o[f]);
1280
1322
 
1281
1323
  for (f += 1; f < o.length;) {
1282
- var g = String.fromCharCode(o[f]);
1283
- f += 1, i.contains(p + g) ? p += g : (l.write(i.indexOf(p), n), i.size() < 4095 && (i.size() == 1 << n && (n += 1), i.add(p + g)), p = g);
1324
+ var p = String.fromCharCode(o[f]);
1325
+ f += 1, i.contains(g + p) ? g += p : (d.write(i.indexOf(g), n), i.size() < 4095 && (i.size() == 1 << n && (n += 1), i.add(g + p)), g = p);
1284
1326
  }
1285
1327
 
1286
- return l.write(i.indexOf(p), n), l.write(r, n), l.flush(), d.toByteArray();
1328
+ return d.write(i.indexOf(g), n), d.write(r, n), d.flush(), l.toByteArray();
1287
1329
  },
1288
1330
  s = function s() {
1289
1331
  var t = {},
@@ -1347,8 +1389,8 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
1347
1389
  }, o.toString = function () {
1348
1390
  return n;
1349
1391
  }, o;
1350
- }(), u = a.toByteArray(), c = 0; c < u.length; c += 1) {
1351
- s.writeByte(u[c]);
1392
+ }(), u = a.toByteArray(), h = 0; h < u.length; h += 1) {
1393
+ s.writeByte(u[h]);
1352
1394
  }
1353
1395
 
1354
1396
  return s.flush(), "data:image/gif;base64," + s;
@@ -1370,12 +1412,12 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
1370
1412
  return o;
1371
1413
  }) ? r.apply(e, []) : r) || (t.exports = n);
1372
1414
  },
1373
- 796: function _(t, e, r) {
1415
+ 676: function _(t, e, r) {
1374
1416
  "use strict";
1375
1417
 
1376
1418
  r.d(e, {
1377
1419
  "default": function _default() {
1378
- return W;
1420
+ return q;
1379
1421
  }
1380
1422
  });
1381
1423
 
@@ -1430,49 +1472,148 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
1430
1472
  }
1431
1473
 
1432
1474
  function u(t) {
1433
- var e = t.originalHeight,
1434
- r = t.originalWidth,
1435
- n = t.maxHiddenDots,
1436
- o = t.maxHiddenAxisDots,
1437
- i = t.dotSize,
1438
- a = {
1439
- x: 0,
1440
- y: 0
1441
- },
1442
- s = {
1443
- x: 0,
1444
- y: 0
1445
- };
1446
- if (e <= 0 || r <= 0 || n <= 0 || i <= 0) return {
1447
- height: 0,
1448
- width: 0,
1449
- hideYDots: 0,
1450
- hideXDots: 0
1451
- };
1452
- var u = e / r;
1453
- return a.x = Math.floor(Math.sqrt(n / u)), a.x <= 0 && (a.x = 1), o && o < a.x && (a.x = o), a.x % 2 == 0 && a.x--, s.x = a.x * i, a.y = 1 + 2 * Math.ceil((a.x * u - 1) / 2), s.y = Math.round(s.x * u), (a.y * a.x > n || o && o < a.y) && (o && o < a.y ? (a.y = o, a.y % 2 == 0 && a.x--) : a.y -= 2, s.y = a.y * i, a.x = 1 + 2 * Math.ceil((a.y / u - 1) / 2), s.x = Math.round(s.y / u)), {
1454
- height: s.y,
1455
- width: s.x,
1456
- hideYDots: a.y,
1457
- hideXDots: a.x
1458
- };
1475
+ return e = this, r = void 0, o = function o() {
1476
+ return function (t, e) {
1477
+ var r,
1478
+ n,
1479
+ o,
1480
+ i,
1481
+ a = {
1482
+ label: 0,
1483
+ sent: function sent() {
1484
+ if (1 & o[0]) throw o[1];
1485
+ return o[1];
1486
+ },
1487
+ trys: [],
1488
+ ops: []
1489
+ };
1490
+ return i = {
1491
+ next: s(0),
1492
+ "throw": s(1),
1493
+ "return": s(2)
1494
+ }, "function" == typeof Symbol && (i[Symbol.iterator] = function () {
1495
+ return this;
1496
+ }), i;
1497
+
1498
+ function s(i) {
1499
+ return function (s) {
1500
+ return function (i) {
1501
+ if (r) throw new TypeError("Generator is already executing.");
1502
+
1503
+ for (; a;) {
1504
+ try {
1505
+ if (r = 1, n && (o = 2 & i[0] ? n["return"] : i[0] ? n["throw"] || ((o = n["return"]) && o.call(n), 0) : n.next) && !(o = o.call(n, i[1])).done) return o;
1506
+
1507
+ switch (n = 0, o && (i = [2 & i[0], o.value]), i[0]) {
1508
+ case 0:
1509
+ case 1:
1510
+ o = i;
1511
+ break;
1512
+
1513
+ case 4:
1514
+ return a.label++, {
1515
+ value: i[1],
1516
+ done: !1
1517
+ };
1518
+
1519
+ case 5:
1520
+ a.label++, n = i[1], i = [0];
1521
+ continue;
1522
+
1523
+ case 7:
1524
+ i = a.ops.pop(), a.trys.pop();
1525
+ continue;
1526
+
1527
+ default:
1528
+ if (!((o = (o = a.trys).length > 0 && o[o.length - 1]) || 6 !== i[0] && 2 !== i[0])) {
1529
+ a = 0;
1530
+ continue;
1531
+ }
1532
+
1533
+ if (3 === i[0] && (!o || i[1] > o[0] && i[1] < o[3])) {
1534
+ a.label = i[1];
1535
+ break;
1536
+ }
1537
+
1538
+ if (6 === i[0] && a.label < o[1]) {
1539
+ a.label = o[1], o = i;
1540
+ break;
1541
+ }
1542
+
1543
+ if (o && a.label < o[2]) {
1544
+ a.label = o[2], a.ops.push(i);
1545
+ break;
1546
+ }
1547
+
1548
+ o[2] && a.ops.pop(), a.trys.pop();
1549
+ continue;
1550
+ }
1551
+
1552
+ i = e.call(t, a);
1553
+ } catch (t) {
1554
+ i = [6, t], n = 0;
1555
+ } finally {
1556
+ r = o = 0;
1557
+ }
1558
+ }
1559
+
1560
+ if (5 & i[0]) throw i[1];
1561
+ return {
1562
+ value: i[0] ? i[1] : void 0,
1563
+ done: !0
1564
+ };
1565
+ }([i, s]);
1566
+ };
1567
+ }
1568
+ }(this, function (e) {
1569
+ return [2, new Promise(function (e) {
1570
+ var r = new XMLHttpRequest();
1571
+ r.onload = function () {
1572
+ var t = new FileReader();
1573
+ t.onloadend = function () {
1574
+ e(t.result);
1575
+ }, t.readAsDataURL(r.response);
1576
+ }, r.open("GET", t), r.responseType = "blob", r.send();
1577
+ })];
1578
+ });
1579
+ }, new ((n = void 0) || (n = Promise))(function (t, i) {
1580
+ function a(t) {
1581
+ try {
1582
+ u(o.next(t));
1583
+ } catch (t) {
1584
+ i(t);
1585
+ }
1586
+ }
1587
+
1588
+ function s(t) {
1589
+ try {
1590
+ u(o["throw"](t));
1591
+ } catch (t) {
1592
+ i(t);
1593
+ }
1594
+ }
1595
+
1596
+ function u(e) {
1597
+ var r;
1598
+ e.done ? t(e.value) : (r = e.value, r instanceof n ? r : new n(function (t) {
1599
+ t(r);
1600
+ })).then(a, s);
1601
+ }
1602
+
1603
+ u((o = o.apply(e, r || [])).next());
1604
+ });
1605
+ var e, r, n, o;
1459
1606
  }
1460
1607
 
1461
- var c = {
1608
+ var h = {
1462
1609
  L: .07,
1463
1610
  M: .15,
1464
1611
  Q: .25,
1465
1612
  H: .3
1466
- },
1467
- h = "dots",
1468
- d = "rounded",
1469
- l = "classy",
1470
- f = "classy-rounded",
1471
- p = "square",
1472
- g = "extra-rounded";
1473
-
1474
- var _v = function v() {
1475
- return (_v = Object.assign || function (t) {
1613
+ };
1614
+
1615
+ var _c = function c() {
1616
+ return (_c = Object.assign || function (t) {
1476
1617
  for (var e, r = 1, n = arguments.length; r < n; r++) {
1477
1618
  for (var o in e = arguments[r]) {
1478
1619
  Object.prototype.hasOwnProperty.call(e, o) && (t[o] = e[o]);
@@ -1483,39 +1624,38 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
1483
1624
  }).apply(this, arguments);
1484
1625
  };
1485
1626
 
1486
- var y = function () {
1627
+ var l = function () {
1487
1628
  function t(t) {
1488
- var e = t.context,
1629
+ var e = t.svg,
1489
1630
  r = t.type;
1490
- this._context = e, this._type = r;
1631
+ this._svg = e, this._type = r;
1491
1632
  }
1492
1633
 
1493
1634
  return t.prototype.draw = function (t, e, r, n) {
1494
- var o,
1495
- i = this._context;
1635
+ var o;
1496
1636
 
1497
1637
  switch (this._type) {
1498
- case h:
1638
+ case "dots":
1499
1639
  o = this._drawDot;
1500
1640
  break;
1501
1641
 
1502
- case l:
1642
+ case "classy":
1503
1643
  o = this._drawClassy;
1504
1644
  break;
1505
1645
 
1506
- case f:
1646
+ case "classy-rounded":
1507
1647
  o = this._drawClassyRounded;
1508
1648
  break;
1509
1649
 
1510
- case d:
1650
+ case "rounded":
1511
1651
  o = this._drawRounded;
1512
1652
  break;
1513
1653
 
1514
- case g:
1654
+ case "extra-rounded":
1515
1655
  o = this._drawExtraRounded;
1516
1656
  break;
1517
1657
 
1518
- case p:
1658
+ case "square":
1519
1659
  default:
1520
1660
  o = this._drawSquare;
1521
1661
  }
@@ -1524,276 +1664,251 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
1524
1664
  x: t,
1525
1665
  y: e,
1526
1666
  size: r,
1527
- context: i,
1528
1667
  getNeighbor: n
1529
1668
  });
1530
1669
  }, t.prototype._rotateFigure = function (t) {
1531
- var e = t.x,
1532
- r = t.y,
1533
- n = t.size,
1534
- o = t.context,
1670
+ var e,
1671
+ r = t.x,
1672
+ n = t.y,
1673
+ o = t.size,
1535
1674
  i = t.rotation,
1536
1675
  a = void 0 === i ? 0 : i,
1537
- s = t.draw,
1538
- u = e + n / 2,
1539
- c = r + n / 2;
1540
- o.translate(u, c), a && o.rotate(a), s(), o.closePath(), a && o.rotate(-a), o.translate(-u, -c);
1676
+ s = r + o / 2,
1677
+ u = n + o / 2;
1678
+ (0, t.draw)(), null === (e = this._element) || void 0 === e || e.setAttribute("transform", "rotate(" + 180 * a / Math.PI + "," + s + "," + u + ")");
1541
1679
  }, t.prototype._basicDot = function (t) {
1542
- var e = t.size,
1543
- r = t.context;
1680
+ var e = this,
1681
+ r = t.size,
1682
+ n = t.x,
1683
+ o = t.y;
1544
1684
 
1545
- this._rotateFigure(_v(_v({}, t), {
1685
+ this._rotateFigure(_c(_c({}, t), {
1546
1686
  draw: function draw() {
1547
- r.arc(0, 0, e / 2, 0, 2 * Math.PI);
1687
+ e._element = document.createElementNS("http://www.w3.org/2000/svg", "circle"), e._element.setAttribute("cx", String(n + r / 2)), e._element.setAttribute("cy", String(o + r / 2)), e._element.setAttribute("r", String(r / 2));
1548
1688
  }
1549
1689
  }));
1550
1690
  }, t.prototype._basicSquare = function (t) {
1551
- var e = t.size,
1552
- r = t.context;
1691
+ var e = this,
1692
+ r = t.size,
1693
+ n = t.x,
1694
+ o = t.y;
1553
1695
 
1554
- this._rotateFigure(_v(_v({}, t), {
1696
+ this._rotateFigure(_c(_c({}, t), {
1555
1697
  draw: function draw() {
1556
- r.rect(-e / 2, -e / 2, e, e);
1698
+ e._element = document.createElementNS("http://www.w3.org/2000/svg", "rect"), e._element.setAttribute("x", String(n)), e._element.setAttribute("y", String(o)), e._element.setAttribute("width", String(r)), e._element.setAttribute("height", String(r));
1557
1699
  }
1558
1700
  }));
1559
1701
  }, t.prototype._basicSideRounded = function (t) {
1560
- var e = t.size,
1561
- r = t.context;
1702
+ var e = this,
1703
+ r = t.size,
1704
+ n = t.x,
1705
+ o = t.y;
1562
1706
 
1563
- this._rotateFigure(_v(_v({}, t), {
1707
+ this._rotateFigure(_c(_c({}, t), {
1564
1708
  draw: function draw() {
1565
- r.arc(0, 0, e / 2, -Math.PI / 2, Math.PI / 2), r.lineTo(-e / 2, e / 2), r.lineTo(-e / 2, -e / 2), r.lineTo(0, -e / 2);
1709
+ e._element = document.createElementNS("http://www.w3.org/2000/svg", "path"), e._element.setAttribute("d", "M " + n + " " + o + "v " + r + "h " + r / 2 + "a " + r / 2 + " " + r / 2 + ", 0, 0, 0, 0 " + -r);
1566
1710
  }
1567
1711
  }));
1568
1712
  }, t.prototype._basicCornerRounded = function (t) {
1569
- var e = t.size,
1570
- r = t.context;
1713
+ var e = this,
1714
+ r = t.size,
1715
+ n = t.x,
1716
+ o = t.y;
1571
1717
 
1572
- this._rotateFigure(_v(_v({}, t), {
1718
+ this._rotateFigure(_c(_c({}, t), {
1573
1719
  draw: function draw() {
1574
- r.arc(0, 0, e / 2, -Math.PI / 2, 0), r.lineTo(e / 2, e / 2), r.lineTo(-e / 2, e / 2), r.lineTo(-e / 2, -e / 2), r.lineTo(0, -e / 2);
1720
+ e._element = document.createElementNS("http://www.w3.org/2000/svg", "path"), e._element.setAttribute("d", "M " + n + " " + o + "v " + r + "h " + r + "v " + -r / 2 + "a " + r / 2 + " " + r / 2 + ", 0, 0, 0, " + -r / 2 + " " + -r / 2);
1575
1721
  }
1576
1722
  }));
1577
1723
  }, t.prototype._basicCornerExtraRounded = function (t) {
1578
- var e = t.size,
1579
- r = t.context;
1724
+ var e = this,
1725
+ r = t.size,
1726
+ n = t.x,
1727
+ o = t.y;
1580
1728
 
1581
- this._rotateFigure(_v(_v({}, t), {
1729
+ this._rotateFigure(_c(_c({}, t), {
1582
1730
  draw: function draw() {
1583
- r.arc(-e / 2, e / 2, e, -Math.PI / 2, 0), r.lineTo(-e / 2, e / 2), r.lineTo(-e / 2, -e / 2);
1731
+ e._element = document.createElementNS("http://www.w3.org/2000/svg", "path"), e._element.setAttribute("d", "M " + n + " " + o + "v " + r + "h " + r + "a " + r + " " + r + ", 0, 0, 0, " + -r + " " + -r);
1584
1732
  }
1585
1733
  }));
1586
1734
  }, t.prototype._basicCornersRounded = function (t) {
1587
- var e = t.size,
1588
- r = t.context;
1589
-
1590
- this._rotateFigure(_v(_v({}, t), {
1591
- draw: function draw() {
1592
- r.arc(0, 0, e / 2, -Math.PI / 2, 0), r.lineTo(e / 2, e / 2), r.lineTo(0, e / 2), r.arc(0, 0, e / 2, Math.PI / 2, Math.PI), r.lineTo(-e / 2, -e / 2), r.lineTo(0, -e / 2);
1593
- }
1594
- }));
1595
- }, t.prototype._basicCornersExtraRounded = function (t) {
1596
- var e = t.size,
1597
- r = t.context;
1735
+ var e = this,
1736
+ r = t.size,
1737
+ n = t.x,
1738
+ o = t.y;
1598
1739
 
1599
- this._rotateFigure(_v(_v({}, t), {
1740
+ this._rotateFigure(_c(_c({}, t), {
1600
1741
  draw: function draw() {
1601
- r.arc(-e / 2, e / 2, e, -Math.PI / 2, 0), r.arc(e / 2, -e / 2, e, Math.PI / 2, Math.PI);
1742
+ e._element = document.createElementNS("http://www.w3.org/2000/svg", "path"), e._element.setAttribute("d", "M " + n + " " + o + "v " + r / 2 + "a " + r / 2 + " " + r / 2 + ", 0, 0, 0, " + r / 2 + " " + r / 2 + "h " + r / 2 + "v " + -r / 2 + "a " + r / 2 + " " + r / 2 + ", 0, 0, 0, " + -r / 2 + " " + -r / 2);
1602
1743
  }
1603
1744
  }));
1604
1745
  }, t.prototype._drawDot = function (t) {
1605
1746
  var e = t.x,
1606
1747
  r = t.y,
1607
- n = t.size,
1608
- o = t.context;
1748
+ n = t.size;
1609
1749
 
1610
1750
  this._basicDot({
1611
1751
  x: e,
1612
1752
  y: r,
1613
1753
  size: n,
1614
- context: o,
1615
1754
  rotation: 0
1616
1755
  });
1617
1756
  }, t.prototype._drawSquare = function (t) {
1618
1757
  var e = t.x,
1619
1758
  r = t.y,
1620
- n = t.size,
1621
- o = t.context;
1759
+ n = t.size;
1622
1760
 
1623
1761
  this._basicSquare({
1624
1762
  x: e,
1625
1763
  y: r,
1626
1764
  size: n,
1627
- context: o,
1628
1765
  rotation: 0
1629
1766
  });
1630
1767
  }, t.prototype._drawRounded = function (t) {
1631
1768
  var e = t.x,
1632
1769
  r = t.y,
1633
1770
  n = t.size,
1634
- o = t.context,
1635
- i = t.getNeighbor,
1636
- a = i ? +i(-1, 0) : 0,
1637
- s = i ? +i(1, 0) : 0,
1638
- u = i ? +i(0, -1) : 0,
1639
- c = i ? +i(0, 1) : 0,
1640
- h = a + s + u + c;
1771
+ o = t.getNeighbor,
1772
+ i = o ? +o(-1, 0) : 0,
1773
+ a = o ? +o(1, 0) : 0,
1774
+ s = o ? +o(0, -1) : 0,
1775
+ u = o ? +o(0, 1) : 0,
1776
+ h = i + a + s + u;
1641
1777
  if (0 !== h) {
1642
- if (h > 2 || a && s || u && c) this._basicSquare({
1778
+ if (h > 2 || i && a || s && u) this._basicSquare({
1643
1779
  x: e,
1644
1780
  y: r,
1645
1781
  size: n,
1646
- context: o,
1647
1782
  rotation: 0
1648
1783
  });else {
1649
1784
  if (2 === h) {
1650
- var d = 0;
1651
- return a && u ? d = Math.PI / 2 : u && s ? d = Math.PI : s && c && (d = -Math.PI / 2), void this._basicCornerRounded({
1785
+ var c = 0;
1786
+ return i && s ? c = Math.PI / 2 : s && a ? c = Math.PI : a && u && (c = -Math.PI / 2), void this._basicCornerRounded({
1652
1787
  x: e,
1653
1788
  y: r,
1654
1789
  size: n,
1655
- context: o,
1656
- rotation: d
1790
+ rotation: c
1657
1791
  });
1658
1792
  }
1659
1793
 
1660
- if (1 === h) return d = 0, u ? d = Math.PI / 2 : s ? d = Math.PI : c && (d = -Math.PI / 2), void this._basicSideRounded({
1794
+ if (1 === h) return c = 0, s ? c = Math.PI / 2 : a ? c = Math.PI : u && (c = -Math.PI / 2), void this._basicSideRounded({
1661
1795
  x: e,
1662
1796
  y: r,
1663
1797
  size: n,
1664
- context: o,
1665
- rotation: d
1798
+ rotation: c
1666
1799
  });
1667
1800
  }
1668
1801
  } else this._basicDot({
1669
1802
  x: e,
1670
1803
  y: r,
1671
1804
  size: n,
1672
- context: o,
1673
1805
  rotation: 0
1674
1806
  });
1675
1807
  }, t.prototype._drawExtraRounded = function (t) {
1676
1808
  var e = t.x,
1677
1809
  r = t.y,
1678
1810
  n = t.size,
1679
- o = t.context,
1680
- i = t.getNeighbor,
1681
- a = i ? +i(-1, 0) : 0,
1682
- s = i ? +i(1, 0) : 0,
1683
- u = i ? +i(0, -1) : 0,
1684
- c = i ? +i(0, 1) : 0,
1685
- h = a + s + u + c;
1811
+ o = t.getNeighbor,
1812
+ i = o ? +o(-1, 0) : 0,
1813
+ a = o ? +o(1, 0) : 0,
1814
+ s = o ? +o(0, -1) : 0,
1815
+ u = o ? +o(0, 1) : 0,
1816
+ h = i + a + s + u;
1686
1817
  if (0 !== h) {
1687
- if (h > 2 || a && s || u && c) this._basicSquare({
1818
+ if (h > 2 || i && a || s && u) this._basicSquare({
1688
1819
  x: e,
1689
1820
  y: r,
1690
1821
  size: n,
1691
- context: o,
1692
1822
  rotation: 0
1693
1823
  });else {
1694
1824
  if (2 === h) {
1695
- var d = 0;
1696
- return a && u ? d = Math.PI / 2 : u && s ? d = Math.PI : s && c && (d = -Math.PI / 2), void this._basicCornerExtraRounded({
1825
+ var c = 0;
1826
+ return i && s ? c = Math.PI / 2 : s && a ? c = Math.PI : a && u && (c = -Math.PI / 2), void this._basicCornerExtraRounded({
1697
1827
  x: e,
1698
1828
  y: r,
1699
1829
  size: n,
1700
- context: o,
1701
- rotation: d
1830
+ rotation: c
1702
1831
  });
1703
1832
  }
1704
1833
 
1705
- if (1 === h) return d = 0, u ? d = Math.PI / 2 : s ? d = Math.PI : c && (d = -Math.PI / 2), void this._basicSideRounded({
1834
+ if (1 === h) return c = 0, s ? c = Math.PI / 2 : a ? c = Math.PI : u && (c = -Math.PI / 2), void this._basicSideRounded({
1706
1835
  x: e,
1707
1836
  y: r,
1708
1837
  size: n,
1709
- context: o,
1710
- rotation: d
1838
+ rotation: c
1711
1839
  });
1712
1840
  }
1713
1841
  } else this._basicDot({
1714
1842
  x: e,
1715
1843
  y: r,
1716
1844
  size: n,
1717
- context: o,
1718
1845
  rotation: 0
1719
1846
  });
1720
1847
  }, t.prototype._drawClassy = function (t) {
1721
1848
  var e = t.x,
1722
1849
  r = t.y,
1723
1850
  n = t.size,
1724
- o = t.context,
1725
- i = t.getNeighbor,
1726
- a = i ? +i(-1, 0) : 0,
1727
- s = i ? +i(1, 0) : 0,
1728
- u = i ? +i(0, -1) : 0,
1729
- c = i ? +i(0, 1) : 0;
1730
- 0 !== a + s + u + c ? a || u ? s || c ? this._basicSquare({
1851
+ o = t.getNeighbor,
1852
+ i = o ? +o(-1, 0) : 0,
1853
+ a = o ? +o(1, 0) : 0,
1854
+ s = o ? +o(0, -1) : 0,
1855
+ u = o ? +o(0, 1) : 0;
1856
+ 0 !== i + a + s + u ? i || s ? a || u ? this._basicSquare({
1731
1857
  x: e,
1732
1858
  y: r,
1733
1859
  size: n,
1734
- context: o,
1735
1860
  rotation: 0
1736
1861
  }) : this._basicCornerRounded({
1737
1862
  x: e,
1738
1863
  y: r,
1739
1864
  size: n,
1740
- context: o,
1741
1865
  rotation: Math.PI / 2
1742
1866
  }) : this._basicCornerRounded({
1743
1867
  x: e,
1744
1868
  y: r,
1745
1869
  size: n,
1746
- context: o,
1747
1870
  rotation: -Math.PI / 2
1748
1871
  }) : this._basicCornersRounded({
1749
1872
  x: e,
1750
1873
  y: r,
1751
1874
  size: n,
1752
- context: o,
1753
1875
  rotation: Math.PI / 2
1754
1876
  });
1755
1877
  }, t.prototype._drawClassyRounded = function (t) {
1756
1878
  var e = t.x,
1757
1879
  r = t.y,
1758
1880
  n = t.size,
1759
- o = t.context,
1760
- i = t.getNeighbor,
1761
- a = i ? +i(-1, 0) : 0,
1762
- s = i ? +i(1, 0) : 0,
1763
- u = i ? +i(0, -1) : 0,
1764
- c = i ? +i(0, 1) : 0;
1765
- 0 !== a + s + u + c ? a || u ? s || c ? this._basicSquare({
1881
+ o = t.getNeighbor,
1882
+ i = o ? +o(-1, 0) : 0,
1883
+ a = o ? +o(1, 0) : 0,
1884
+ s = o ? +o(0, -1) : 0,
1885
+ u = o ? +o(0, 1) : 0;
1886
+ 0 !== i + a + s + u ? i || s ? a || u ? this._basicSquare({
1766
1887
  x: e,
1767
1888
  y: r,
1768
1889
  size: n,
1769
- context: o,
1770
1890
  rotation: 0
1771
1891
  }) : this._basicCornerExtraRounded({
1772
1892
  x: e,
1773
1893
  y: r,
1774
1894
  size: n,
1775
- context: o,
1776
1895
  rotation: Math.PI / 2
1777
1896
  }) : this._basicCornerExtraRounded({
1778
1897
  x: e,
1779
1898
  y: r,
1780
1899
  size: n,
1781
- context: o,
1782
1900
  rotation: -Math.PI / 2
1783
1901
  }) : this._basicCornersRounded({
1784
1902
  x: e,
1785
1903
  y: r,
1786
1904
  size: n,
1787
- context: o,
1788
1905
  rotation: Math.PI / 2
1789
1906
  });
1790
1907
  }, t;
1791
- }(),
1792
- w = "square",
1793
- _ = "extra-rounded";
1908
+ }();
1794
1909
 
1795
- var _m = function m() {
1796
- return (_m = Object.assign || function (t) {
1910
+ var _d = function d() {
1911
+ return (_d = Object.assign || function (t) {
1797
1912
  for (var e, r = 1, n = arguments.length; r < n; r++) {
1798
1913
  for (var o in e = arguments[r]) {
1799
1914
  Object.prototype.hasOwnProperty.call(e, o) && (t[o] = e[o]);
@@ -1804,23 +1919,22 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
1804
1919
  }).apply(this, arguments);
1805
1920
  };
1806
1921
 
1807
- var b = function () {
1922
+ var f = function () {
1808
1923
  function t(t) {
1809
- var e = t.context,
1924
+ var e = t.svg,
1810
1925
  r = t.type;
1811
- this._context = e, this._type = r;
1926
+ this._svg = e, this._type = r;
1812
1927
  }
1813
1928
 
1814
1929
  return t.prototype.draw = function (t, e, r, n) {
1815
- var o,
1816
- i = this._context;
1930
+ var o;
1817
1931
 
1818
1932
  switch (this._type) {
1819
- case w:
1933
+ case "square":
1820
1934
  o = this._drawSquare;
1821
1935
  break;
1822
1936
 
1823
- case _:
1937
+ case "extra-rounded":
1824
1938
  o = this._drawExtraRounded;
1825
1939
  break;
1826
1940
 
@@ -1833,98 +1947,95 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
1833
1947
  x: t,
1834
1948
  y: e,
1835
1949
  size: r,
1836
- context: i,
1837
1950
  rotation: n
1838
1951
  });
1839
1952
  }, t.prototype._rotateFigure = function (t) {
1840
- var e = t.x,
1841
- r = t.y,
1842
- n = t.size,
1843
- o = t.context,
1953
+ var e,
1954
+ r = t.x,
1955
+ n = t.y,
1956
+ o = t.size,
1844
1957
  i = t.rotation,
1845
1958
  a = void 0 === i ? 0 : i,
1846
- s = t.draw,
1847
- u = e + n / 2,
1848
- c = r + n / 2;
1849
- o.translate(u, c), a && o.rotate(a), s(), o.closePath(), a && o.rotate(-a), o.translate(-u, -c);
1959
+ s = r + o / 2,
1960
+ u = n + o / 2;
1961
+ (0, t.draw)(), null === (e = this._element) || void 0 === e || e.setAttribute("transform", "rotate(" + 180 * a / Math.PI + "," + s + "," + u + ")");
1850
1962
  }, t.prototype._basicDot = function (t) {
1851
- var e = t.size,
1852
- r = t.context,
1853
- n = e / 7;
1963
+ var e = this,
1964
+ r = t.size,
1965
+ n = t.x,
1966
+ o = t.y,
1967
+ i = r / 7;
1854
1968
 
1855
- this._rotateFigure(_m(_m({}, t), {
1969
+ this._rotateFigure(_d(_d({}, t), {
1856
1970
  draw: function draw() {
1857
- r.arc(0, 0, e / 2, 0, 2 * Math.PI), r.arc(0, 0, e / 2 - n, 0, 2 * Math.PI);
1971
+ e._element = document.createElementNS("http://www.w3.org/2000/svg", "path"), e._element.setAttribute("clip-rule", "evenodd"), e._element.setAttribute("d", "M " + (n + r / 2) + " " + o + "a " + r / 2 + " " + r / 2 + " 0 1 0 0.1 0zm 0 " + i + "a " + (r / 2 - i) + " " + (r / 2 - i) + " 0 1 1 -0.1 0Z");
1858
1972
  }
1859
1973
  }));
1860
1974
  }, t.prototype._basicSquare = function (t) {
1861
- var e = t.size,
1862
- r = t.context,
1863
- n = e / 7;
1975
+ var e = this,
1976
+ r = t.size,
1977
+ n = t.x,
1978
+ o = t.y,
1979
+ i = r / 7;
1864
1980
 
1865
- this._rotateFigure(_m(_m({}, t), {
1981
+ this._rotateFigure(_d(_d({}, t), {
1866
1982
  draw: function draw() {
1867
- r.rect(-e / 2, -e / 2, e, e), r.rect(-e / 2 + n, -e / 2 + n, e - 2 * n, e - 2 * n);
1983
+ e._element = document.createElementNS("http://www.w3.org/2000/svg", "path"), e._element.setAttribute("clip-rule", "evenodd"), e._element.setAttribute("d", "M " + n + " " + o + "v " + r + "h " + r + "v " + -r + "zM " + (n + i) + " " + (o + i) + "h " + (r - 2 * i) + "v " + (r - 2 * i) + "h " + (2 * i - r) + "z");
1868
1984
  }
1869
1985
  }));
1870
1986
  }, t.prototype._basicExtraRounded = function (t) {
1871
- var e = t.size,
1872
- r = t.context,
1873
- n = e / 7;
1987
+ var e = this,
1988
+ r = t.size,
1989
+ n = t.x,
1990
+ o = t.y,
1991
+ i = r / 7;
1874
1992
 
1875
- this._rotateFigure(_m(_m({}, t), {
1993
+ this._rotateFigure(_d(_d({}, t), {
1876
1994
  draw: function draw() {
1877
- r.arc(-n, -n, 2.5 * n, Math.PI, -Math.PI / 2), r.lineTo(n, -3.5 * n), r.arc(n, -n, 2.5 * n, -Math.PI / 2, 0), r.lineTo(3.5 * n, -n), r.arc(n, n, 2.5 * n, 0, Math.PI / 2), r.lineTo(-n, 3.5 * n), r.arc(-n, n, 2.5 * n, Math.PI / 2, Math.PI), r.lineTo(-3.5 * n, -n), r.arc(-n, -n, 1.5 * n, Math.PI, -Math.PI / 2), r.lineTo(n, -2.5 * n), r.arc(n, -n, 1.5 * n, -Math.PI / 2, 0), r.lineTo(2.5 * n, -n), r.arc(n, n, 1.5 * n, 0, Math.PI / 2), r.lineTo(-n, 2.5 * n), r.arc(-n, n, 1.5 * n, Math.PI / 2, Math.PI), r.lineTo(-2.5 * n, -n);
1995
+ e._element = document.createElementNS("http://www.w3.org/2000/svg", "path"), e._element.setAttribute("clip-rule", "evenodd"), e._element.setAttribute("d", "M " + n + " " + (o + 2.5 * i) + "v " + 2 * i + "a " + 2.5 * i + " " + 2.5 * i + ", 0, 0, 0, " + 2.5 * i + " " + 2.5 * i + "h " + 2 * i + "a " + 2.5 * i + " " + 2.5 * i + ", 0, 0, 0, " + 2.5 * i + " " + 2.5 * -i + "v " + -2 * i + "a " + 2.5 * i + " " + 2.5 * i + ", 0, 0, 0, " + 2.5 * -i + " " + 2.5 * -i + "h " + -2 * i + "a " + 2.5 * i + " " + 2.5 * i + ", 0, 0, 0, " + 2.5 * -i + " " + 2.5 * i + "M " + (n + 2.5 * i) + " " + (o + i) + "h " + 2 * i + "a " + 1.5 * i + " " + 1.5 * i + ", 0, 0, 1, " + 1.5 * i + " " + 1.5 * i + "v " + 2 * i + "a " + 1.5 * i + " " + 1.5 * i + ", 0, 0, 1, " + 1.5 * -i + " " + 1.5 * i + "h " + -2 * i + "a " + 1.5 * i + " " + 1.5 * i + ", 0, 0, 1, " + 1.5 * -i + " " + 1.5 * -i + "v " + -2 * i + "a " + 1.5 * i + " " + 1.5 * i + ", 0, 0, 1, " + 1.5 * i + " " + 1.5 * -i);
1878
1996
  }
1879
1997
  }));
1880
1998
  }, t.prototype._drawDot = function (t) {
1881
1999
  var e = t.x,
1882
2000
  r = t.y,
1883
2001
  n = t.size,
1884
- o = t.context,
1885
- i = t.rotation;
2002
+ o = t.rotation;
1886
2003
 
1887
2004
  this._basicDot({
1888
2005
  x: e,
1889
2006
  y: r,
1890
2007
  size: n,
1891
- context: o,
1892
- rotation: i
2008
+ rotation: o
1893
2009
  });
1894
2010
  }, t.prototype._drawSquare = function (t) {
1895
2011
  var e = t.x,
1896
2012
  r = t.y,
1897
2013
  n = t.size,
1898
- o = t.context,
1899
- i = t.rotation;
2014
+ o = t.rotation;
1900
2015
 
1901
2016
  this._basicSquare({
1902
2017
  x: e,
1903
2018
  y: r,
1904
2019
  size: n,
1905
- context: o,
1906
- rotation: i
2020
+ rotation: o
1907
2021
  });
1908
2022
  }, t.prototype._drawExtraRounded = function (t) {
1909
2023
  var e = t.x,
1910
2024
  r = t.y,
1911
2025
  n = t.size,
1912
- o = t.context,
1913
- i = t.rotation;
2026
+ o = t.rotation;
1914
2027
 
1915
2028
  this._basicExtraRounded({
1916
2029
  x: e,
1917
2030
  y: r,
1918
2031
  size: n,
1919
- context: o,
1920
- rotation: i
2032
+ rotation: o
1921
2033
  });
1922
2034
  }, t;
1923
- }(),
1924
- x = "square";
2035
+ }();
1925
2036
 
1926
- var _M = function M() {
1927
- return (_M = Object.assign || function (t) {
2037
+ var _g = function g() {
2038
+ return (_g = Object.assign || function (t) {
1928
2039
  for (var e, r = 1, n = arguments.length; r < n; r++) {
1929
2040
  for (var o in e = arguments[r]) {
1930
2041
  Object.prototype.hasOwnProperty.call(e, o) && (t[o] = e[o]);
@@ -1935,19 +2046,18 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
1935
2046
  }).apply(this, arguments);
1936
2047
  };
1937
2048
 
1938
- var S = function () {
2049
+ var p = function () {
1939
2050
  function t(t) {
1940
- var e = t.context,
2051
+ var e = t.svg,
1941
2052
  r = t.type;
1942
- this._context = e, this._type = r;
2053
+ this._svg = e, this._type = r;
1943
2054
  }
1944
2055
 
1945
2056
  return t.prototype.draw = function (t, e, r, n) {
1946
- var o,
1947
- i = this._context;
2057
+ var o;
1948
2058
 
1949
2059
  switch (this._type) {
1950
- case x:
2060
+ case "square":
1951
2061
  o = this._drawSquare;
1952
2062
  break;
1953
2063
 
@@ -1960,1041 +2070,193 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
1960
2070
  x: t,
1961
2071
  y: e,
1962
2072
  size: r,
1963
- context: i,
1964
2073
  rotation: n
1965
2074
  });
1966
2075
  }, t.prototype._rotateFigure = function (t) {
1967
- var e = t.x,
1968
- r = t.y,
1969
- n = t.size,
1970
- o = t.context,
2076
+ var e,
2077
+ r = t.x,
2078
+ n = t.y,
2079
+ o = t.size,
1971
2080
  i = t.rotation,
1972
2081
  a = void 0 === i ? 0 : i,
1973
- s = t.draw,
1974
- u = e + n / 2,
1975
- c = r + n / 2;
1976
- o.translate(u, c), a && o.rotate(a), s(), o.closePath(), a && o.rotate(-a), o.translate(-u, -c);
2082
+ s = r + o / 2,
2083
+ u = n + o / 2;
2084
+ (0, t.draw)(), null === (e = this._element) || void 0 === e || e.setAttribute("transform", "rotate(" + 180 * a / Math.PI + "," + s + "," + u + ")");
1977
2085
  }, t.prototype._basicDot = function (t) {
1978
- var e = t.size,
1979
- r = t.context;
2086
+ var e = this,
2087
+ r = t.size,
2088
+ n = t.x,
2089
+ o = t.y;
1980
2090
 
1981
- this._rotateFigure(_M(_M({}, t), {
2091
+ this._rotateFigure(_g(_g({}, t), {
1982
2092
  draw: function draw() {
1983
- r.arc(0, 0, e / 2, 0, 2 * Math.PI);
2093
+ e._element = document.createElementNS("http://www.w3.org/2000/svg", "circle"), e._element.setAttribute("cx", String(n + r / 2)), e._element.setAttribute("cy", String(o + r / 2)), e._element.setAttribute("r", String(r / 2));
1984
2094
  }
1985
2095
  }));
1986
2096
  }, t.prototype._basicSquare = function (t) {
1987
- var e = t.size,
1988
- r = t.context;
2097
+ var e = this,
2098
+ r = t.size,
2099
+ n = t.x,
2100
+ o = t.y;
1989
2101
 
1990
- this._rotateFigure(_M(_M({}, t), {
2102
+ this._rotateFigure(_g(_g({}, t), {
1991
2103
  draw: function draw() {
1992
- r.rect(-e / 2, -e / 2, e, e);
2104
+ e._element = document.createElementNS("http://www.w3.org/2000/svg", "rect"), e._element.setAttribute("x", String(n)), e._element.setAttribute("y", String(o)), e._element.setAttribute("width", String(r)), e._element.setAttribute("height", String(r));
1993
2105
  }
1994
2106
  }));
1995
2107
  }, t.prototype._drawDot = function (t) {
1996
2108
  var e = t.x,
1997
2109
  r = t.y,
1998
2110
  n = t.size,
1999
- o = t.context,
2000
- i = t.rotation;
2111
+ o = t.rotation;
2001
2112
 
2002
2113
  this._basicDot({
2003
2114
  x: e,
2004
2115
  y: r,
2005
2116
  size: n,
2006
- context: o,
2007
- rotation: i
2117
+ rotation: o
2008
2118
  });
2009
2119
  }, t.prototype._drawSquare = function (t) {
2010
2120
  var e = t.x,
2011
2121
  r = t.y,
2012
2122
  n = t.size,
2013
- o = t.context,
2014
- i = t.rotation;
2123
+ o = t.rotation;
2015
2124
 
2016
2125
  this._basicSquare({
2017
2126
  x: e,
2018
2127
  y: r,
2019
2128
  size: n,
2020
- context: o,
2021
- rotation: i
2129
+ rotation: o
2022
2130
  });
2023
2131
  }, t;
2024
2132
  }(),
2025
- C = "radial";
2133
+ v = "circle";
2026
2134
 
2027
- var P = [[1, 1, 1, 1, 1, 1, 1], [1, 0, 0, 0, 0, 0, 1], [1, 0, 0, 0, 0, 0, 1], [1, 0, 0, 0, 0, 0, 1], [1, 0, 0, 0, 0, 0, 1], [1, 0, 0, 0, 0, 0, 1], [1, 1, 1, 1, 1, 1, 1]],
2028
- O = [[0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0], [0, 0, 1, 1, 1, 0, 0], [0, 0, 1, 1, 1, 0, 0], [0, 0, 1, 1, 1, 0, 0], [0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0]];
2135
+ var w = function w(t, e, r, n) {
2136
+ return new (r || (r = Promise))(function (o, i) {
2137
+ function a(t) {
2138
+ try {
2139
+ u(n.next(t));
2140
+ } catch (t) {
2141
+ i(t);
2142
+ }
2143
+ }
2029
2144
 
2030
- var z = function () {
2031
- function t(t) {
2032
- this._canvas = document.createElement("canvas"), this._canvas.width = t.width, this._canvas.height = t.height, this._options = t;
2033
- }
2145
+ function s(t) {
2146
+ try {
2147
+ u(n["throw"](t));
2148
+ } catch (t) {
2149
+ i(t);
2150
+ }
2151
+ }
2034
2152
 
2035
- return Object.defineProperty(t.prototype, "context", {
2036
- get: function get() {
2037
- return this._canvas.getContext("2d");
2038
- },
2039
- enumerable: !1,
2040
- configurable: !0
2041
- }), Object.defineProperty(t.prototype, "width", {
2042
- get: function get() {
2043
- return this._canvas.width;
2044
- },
2045
- enumerable: !1,
2046
- configurable: !0
2047
- }), Object.defineProperty(t.prototype, "height", {
2048
- get: function get() {
2049
- return this._canvas.height;
2050
- },
2051
- enumerable: !1,
2052
- configurable: !0
2053
- }), t.prototype.getCanvas = function () {
2054
- return this._canvas;
2055
- }, t.prototype.clear = function () {
2056
- var t = this.context;
2057
- t && t.clearRect(0, 0, this._canvas.width, this._canvas.height);
2058
- }, t.prototype.drawQR = function (t) {
2059
- return e = this, r = void 0, o = function o() {
2060
- var e,
2061
- r,
2062
- n,
2063
- o,
2064
- i,
2065
- a,
2066
- s,
2067
- h,
2068
- d,
2069
- l = this;
2070
- return function (t, e) {
2071
- var r,
2072
- n,
2073
- o,
2074
- i,
2075
- a = {
2076
- label: 0,
2077
- sent: function sent() {
2078
- if (1 & o[0]) throw o[1];
2079
- return o[1];
2080
- },
2081
- trys: [],
2082
- ops: []
2083
- };
2084
- return i = {
2085
- next: s(0),
2086
- "throw": s(1),
2087
- "return": s(2)
2088
- }, "function" == typeof Symbol && (i[Symbol.iterator] = function () {
2089
- return this;
2090
- }), i;
2091
-
2092
- function s(i) {
2093
- return function (s) {
2094
- return function (i) {
2095
- if (r) throw new TypeError("Generator is already executing.");
2096
-
2097
- for (; a;) {
2098
- try {
2099
- if (r = 1, n && (o = 2 & i[0] ? n["return"] : i[0] ? n["throw"] || ((o = n["return"]) && o.call(n), 0) : n.next) && !(o = o.call(n, i[1])).done) return o;
2100
-
2101
- switch (n = 0, o && (i = [2 & i[0], o.value]), i[0]) {
2102
- case 0:
2103
- case 1:
2104
- o = i;
2105
- break;
2106
-
2107
- case 4:
2108
- return a.label++, {
2109
- value: i[1],
2110
- done: !1
2111
- };
2112
-
2113
- case 5:
2114
- a.label++, n = i[1], i = [0];
2115
- continue;
2116
-
2117
- case 7:
2118
- i = a.ops.pop(), a.trys.pop();
2119
- continue;
2120
-
2121
- default:
2122
- if (!((o = (o = a.trys).length > 0 && o[o.length - 1]) || 6 !== i[0] && 2 !== i[0])) {
2123
- a = 0;
2124
- continue;
2125
- }
2126
-
2127
- if (3 === i[0] && (!o || i[1] > o[0] && i[1] < o[3])) {
2128
- a.label = i[1];
2129
- break;
2130
- }
2131
-
2132
- if (6 === i[0] && a.label < o[1]) {
2133
- a.label = o[1], o = i;
2134
- break;
2135
- }
2136
-
2137
- if (o && a.label < o[2]) {
2138
- a.label = o[2], a.ops.push(i);
2139
- break;
2140
- }
2141
-
2142
- o[2] && a.ops.pop(), a.trys.pop();
2143
- continue;
2144
- }
2145
-
2146
- i = e.call(t, a);
2147
- } catch (t) {
2148
- i = [6, t], n = 0;
2149
- } finally {
2150
- r = o = 0;
2151
- }
2152
- }
2153
-
2154
- if (5 & i[0]) throw i[1];
2155
- return {
2156
- value: i[0] ? i[1] : void 0,
2157
- done: !0
2158
- };
2159
- }([i, s]);
2160
- };
2161
- }
2162
- }(this, function (f) {
2163
- switch (f.label) {
2164
- case 0:
2165
- return e = t.getModuleCount(), r = Math.min(this._options.width, this._options.height) - 2 * this._options.margin, n = Math.floor(r / e), o = {
2166
- hideXDots: 0,
2167
- hideYDots: 0,
2168
- width: 0,
2169
- height: 0
2170
- }, this._qr = t, this._options.image ? [4, this.loadImage()] : [3, 2];
2171
-
2172
- case 1:
2173
- if (f.sent(), !this._image) return [2];
2174
- i = this._options, a = i.imageOptions, s = i.qrOptions, h = a.imageSize * c[s.errorCorrectionLevel], d = Math.floor(h * e * e), o = u({
2175
- originalWidth: this._image.width,
2176
- originalHeight: this._image.height,
2177
- maxHiddenDots: d,
2178
- maxHiddenAxisDots: e - 14,
2179
- dotSize: n
2180
- }), f.label = 2;
2181
-
2182
- case 2:
2183
- return this.clear(), this.drawBackground(), this.drawDots(function (t, r) {
2184
- var n, i, a, s, u, c;
2185
- return !(l._options.imageOptions.hideBackgroundDots && t >= (e - o.hideXDots) / 2 && t < (e + o.hideXDots) / 2 && r >= (e - o.hideYDots) / 2 && r < (e + o.hideYDots) / 2 || (null === (n = P[t]) || void 0 === n ? void 0 : n[r]) || (null === (i = P[t - e + 7]) || void 0 === i ? void 0 : i[r]) || (null === (a = P[t]) || void 0 === a ? void 0 : a[r - e + 7]) || (null === (s = O[t]) || void 0 === s ? void 0 : s[r]) || (null === (u = O[t - e + 7]) || void 0 === u ? void 0 : u[r]) || (null === (c = O[t]) || void 0 === c ? void 0 : c[r - e + 7]));
2186
- }), this.drawCorners(), this._options.image && this.drawImage({
2187
- width: o.width,
2188
- height: o.height,
2189
- count: e,
2190
- dotSize: n
2191
- }), [2];
2192
- }
2193
- });
2194
- }, new ((n = void 0) || (n = Promise))(function (t, i) {
2195
- function a(t) {
2196
- try {
2197
- u(o.next(t));
2198
- } catch (t) {
2199
- i(t);
2200
- }
2201
- }
2202
-
2203
- function s(t) {
2204
- try {
2205
- u(o["throw"](t));
2206
- } catch (t) {
2207
- i(t);
2208
- }
2209
- }
2210
-
2211
- function u(e) {
2212
- var r;
2213
- e.done ? t(e.value) : (r = e.value, r instanceof n ? r : new n(function (t) {
2214
- t(r);
2215
- })).then(a, s);
2216
- }
2217
-
2218
- u((o = o.apply(e, r || [])).next());
2219
- });
2220
- var e, r, n, o;
2221
- }, t.prototype.drawBackground = function () {
2222
- var t = this.context,
2223
- e = this._options;
2224
-
2225
- if (t) {
2226
- if (e.backgroundOptions.gradient) {
2227
- var r = e.backgroundOptions.gradient,
2228
- n = this._createGradient({
2229
- context: t,
2230
- options: r,
2231
- additionalRotation: 0,
2232
- x: 0,
2233
- y: 0,
2234
- size: this._canvas.width > this._canvas.height ? this._canvas.width : this._canvas.height
2235
- });
2236
-
2237
- r.colorStops.forEach(function (t) {
2238
- var e = t.offset,
2239
- r = t.color;
2240
- n.addColorStop(e, r);
2241
- }), t.fillStyle = n;
2242
- } else e.backgroundOptions.color && (t.fillStyle = e.backgroundOptions.color);
2243
-
2244
- t.fillRect(0, 0, this._canvas.width, this._canvas.height);
2245
- }
2246
- }, t.prototype.drawDots = function (t) {
2247
- var e = this;
2248
- if (!this._qr) throw "QR code is not defined";
2249
- var r = this.context;
2250
- if (!r) throw "QR code is not defined";
2251
-
2252
- var n = this._options,
2253
- o = this._qr.getModuleCount();
2254
-
2255
- if (o > n.width || o > n.height) throw "The canvas is too small.";
2256
- var i = Math.min(n.width, n.height) - 2 * n.margin,
2257
- a = Math.floor(i / o),
2258
- s = Math.floor((n.width - o * a) / 2),
2259
- u = Math.floor((n.height - o * a) / 2),
2260
- c = new y({
2261
- context: r,
2262
- type: n.dotsOptions.type
2263
- });
2264
- r.beginPath();
2265
-
2266
- for (var h = function h(r) {
2267
- for (var n = function n(_n2) {
2268
- return t && !t(r, _n2) ? "continue" : d._qr.isDark(r, _n2) ? void c.draw(s + r * a, u + _n2 * a, a, function (i, a) {
2269
- return !(r + i < 0 || _n2 + a < 0 || r + i >= o || _n2 + a >= o) && !(t && !t(r + i, _n2 + a)) && !!e._qr && e._qr.isDark(r + i, _n2 + a);
2270
- }) : "continue";
2271
- }, i = 0; i < o; i++) {
2272
- n(i);
2273
- }
2274
- }, d = this, l = 0; l < o; l++) {
2275
- h(l);
2276
- }
2277
-
2278
- if (n.dotsOptions.gradient) {
2279
- var f = n.dotsOptions.gradient,
2280
- p = this._createGradient({
2281
- context: r,
2282
- options: f,
2283
- additionalRotation: 0,
2284
- x: s,
2285
- y: u,
2286
- size: o * a
2287
- });
2288
-
2289
- f.colorStops.forEach(function (t) {
2290
- var e = t.offset,
2291
- r = t.color;
2292
- p.addColorStop(e, r);
2293
- }), r.fillStyle = r.strokeStyle = p;
2294
- } else n.dotsOptions.color && (r.fillStyle = r.strokeStyle = n.dotsOptions.color);
2295
-
2296
- r.fill("evenodd");
2297
- }, t.prototype.drawCorners = function (t) {
2298
- var e = this;
2299
- if (!this._qr) throw "QR code is not defined";
2300
- var r = this.context;
2301
- if (!r) throw "QR code is not defined";
2302
-
2303
- var n = this._options,
2304
- o = this._qr.getModuleCount(),
2305
- i = Math.min(n.width, n.height) - 2 * n.margin,
2306
- a = Math.floor(i / o),
2307
- s = 7 * a,
2308
- u = 3 * a,
2309
- c = Math.floor((n.width - o * a) / 2),
2310
- h = Math.floor((n.height - o * a) / 2);
2311
-
2312
- [[0, 0, 0], [1, 0, Math.PI / 2], [0, 1, -Math.PI / 2]].forEach(function (i) {
2313
- var d,
2314
- l,
2315
- f,
2316
- p,
2317
- g,
2318
- v,
2319
- w,
2320
- _,
2321
- m,
2322
- x,
2323
- M = i[0],
2324
- C = i[1],
2325
- z = i[2];
2326
-
2327
- if (!t || t(M, C)) {
2328
- var D = c + M * a * (o - 7),
2329
- I = h + C * a * (o - 7);
2330
-
2331
- if (null === (d = n.cornersSquareOptions) || void 0 === d ? void 0 : d.type) {
2332
- var A = new b({
2333
- context: r,
2334
- type: null === (l = n.cornersSquareOptions) || void 0 === l ? void 0 : l.type
2335
- });
2336
- r.beginPath(), A.draw(D, I, s, z);
2337
- } else {
2338
- var k = new y({
2339
- context: r,
2340
- type: n.dotsOptions.type
2341
- });
2342
- r.beginPath();
2343
-
2344
- for (var q = function q(t) {
2345
- for (var e = function e(_e2) {
2346
- if (!(null === (f = P[t]) || void 0 === f ? void 0 : f[_e2])) return "continue";
2347
- k.draw(D + t * a, I + _e2 * a, a, function (r, n) {
2348
- var o;
2349
- return !!(null === (o = P[t + r]) || void 0 === o ? void 0 : o[_e2 + n]);
2350
- });
2351
- }, r = 0; r < P[t].length; r++) {
2352
- e(r);
2353
- }
2354
- }, R = 0; R < P.length; R++) {
2355
- q(R);
2356
- }
2357
- }
2358
-
2359
- if (null === (p = n.cornersSquareOptions) || void 0 === p ? void 0 : p.gradient) {
2360
- var B = n.cornersSquareOptions.gradient,
2361
- E = e._createGradient({
2362
- context: r,
2363
- options: B,
2364
- additionalRotation: z,
2365
- x: D,
2366
- y: I,
2367
- size: s
2368
- });
2369
-
2370
- B.colorStops.forEach(function (t) {
2371
- var e = t.offset,
2372
- r = t.color;
2373
- E.addColorStop(e, r);
2374
- }), r.fillStyle = r.strokeStyle = E;
2375
- } else (null === (g = n.cornersSquareOptions) || void 0 === g ? void 0 : g.color) && (r.fillStyle = r.strokeStyle = n.cornersSquareOptions.color);
2376
-
2377
- if (r.fill("evenodd"), null === (v = n.cornersDotOptions) || void 0 === v ? void 0 : v.type) {
2378
- var L = new S({
2379
- context: r,
2380
- type: null === (w = n.cornersDotOptions) || void 0 === w ? void 0 : w.type
2381
- });
2382
- r.beginPath(), L.draw(D + 2 * a, I + 2 * a, u, z);
2383
- } else {
2384
- k = new y({
2385
- context: r,
2386
- type: n.dotsOptions.type
2387
- }), r.beginPath();
2388
-
2389
- var N = function N(t) {
2390
- for (var e = function e(_e3) {
2391
- if (!(null === (_ = O[t]) || void 0 === _ ? void 0 : _[_e3])) return "continue";
2392
- k.draw(D + t * a, I + _e3 * a, a, function (r, n) {
2393
- var o;
2394
- return !!(null === (o = O[t + r]) || void 0 === o ? void 0 : o[_e3 + n]);
2395
- });
2396
- }, r = 0; r < O[t].length; r++) {
2397
- e(r);
2398
- }
2399
- };
2400
-
2401
- for (R = 0; R < O.length; R++) {
2402
- N(R);
2403
- }
2404
- }
2405
-
2406
- if (null === (m = n.cornersDotOptions) || void 0 === m ? void 0 : m.gradient) {
2407
- B = n.cornersDotOptions.gradient;
2408
-
2409
- var T = e._createGradient({
2410
- context: r,
2411
- options: B,
2412
- additionalRotation: z,
2413
- x: D + 2 * a,
2414
- y: I + 2 * a,
2415
- size: u
2416
- });
2417
-
2418
- B.colorStops.forEach(function (t) {
2419
- var e = t.offset,
2420
- r = t.color;
2421
- T.addColorStop(e, r);
2422
- }), r.fillStyle = r.strokeStyle = T;
2423
- } else (null === (x = n.cornersDotOptions) || void 0 === x ? void 0 : x.color) && (r.fillStyle = r.strokeStyle = n.cornersDotOptions.color);
2424
-
2425
- r.fill("evenodd");
2426
- }
2427
- });
2428
- }, t.prototype.loadImage = function () {
2429
- var t = this;
2430
- return new Promise(function (e, r) {
2431
- var n = t._options,
2432
- o = new Image();
2433
- if (!n.image) return r("Image is not defined");
2434
- "string" == typeof n.imageOptions.crossOrigin && (o.crossOrigin = n.imageOptions.crossOrigin), t._image = o, o.onload = function () {
2435
- e();
2436
- }, o.src = n.image;
2437
- });
2438
- }, t.prototype.drawImage = function (t) {
2439
- var e = t.width,
2440
- r = t.height,
2441
- n = t.count,
2442
- o = t.dotSize,
2443
- i = this.context;
2444
- if (!i) throw "canvasContext is not defined";
2445
- if (!this._image) throw "image is not defined";
2446
- var a = this._options,
2447
- s = Math.floor((a.width - n * o) / 2),
2448
- u = Math.floor((a.height - n * o) / 2),
2449
- c = s + a.imageOptions.margin + (n * o - e) / 2,
2450
- h = u + a.imageOptions.margin + (n * o - r) / 2,
2451
- d = e - 2 * a.imageOptions.margin,
2452
- l = r - 2 * a.imageOptions.margin;
2453
- i.drawImage(this._image, c, h, d < 0 ? 0 : d, l < 0 ? 0 : l);
2454
- }, t.prototype._createGradient = function (t) {
2455
- var e,
2456
- r = t.context,
2457
- n = t.options,
2458
- o = t.additionalRotation,
2459
- i = t.x,
2460
- a = t.y,
2461
- s = t.size;
2462
- if (n.type === C) e = r.createRadialGradient(i + s / 2, a + s / 2, 0, i + s / 2, a + s / 2, s / 2);else {
2463
- var u = ((n.rotation || 0) + o) % (2 * Math.PI),
2464
- c = (u + 2 * Math.PI) % (2 * Math.PI),
2465
- h = i + s / 2,
2466
- d = a + s / 2,
2467
- l = i + s / 2,
2468
- f = a + s / 2;
2469
- c >= 0 && c <= .25 * Math.PI || c > 1.75 * Math.PI && c <= 2 * Math.PI ? (h -= s / 2, d -= s / 2 * Math.tan(u), l += s / 2, f += s / 2 * Math.tan(u)) : c > .25 * Math.PI && c <= .75 * Math.PI ? (d -= s / 2, h -= s / 2 / Math.tan(u), f += s / 2, l += s / 2 / Math.tan(u)) : c > .75 * Math.PI && c <= 1.25 * Math.PI ? (h += s / 2, d += s / 2 * Math.tan(u), l -= s / 2, f -= s / 2 * Math.tan(u)) : c > 1.25 * Math.PI && c <= 1.75 * Math.PI && (d += s / 2, h += s / 2 / Math.tan(u), f -= s / 2, l -= s / 2 / Math.tan(u)), e = r.createLinearGradient(Math.round(h), Math.round(d), Math.round(l), Math.round(f));
2470
- }
2471
- return e;
2472
- }, t;
2473
- }();
2474
-
2475
- var _D = function D() {
2476
- return (_D = Object.assign || function (t) {
2477
- for (var e, r = 1, n = arguments.length; r < n; r++) {
2478
- for (var o in e = arguments[r]) {
2479
- Object.prototype.hasOwnProperty.call(e, o) && (t[o] = e[o]);
2480
- }
2481
- }
2482
-
2483
- return t;
2484
- }).apply(this, arguments);
2485
- };
2486
-
2487
- var I = function () {
2488
- function t(t) {
2489
- var e = t.svg,
2490
- r = t.type;
2491
- this._svg = e, this._type = r;
2492
- }
2493
-
2494
- return t.prototype.draw = function (t, e, r, n) {
2495
- var o;
2496
-
2497
- switch (this._type) {
2498
- case h:
2499
- o = this._drawDot;
2500
- break;
2501
-
2502
- case l:
2503
- o = this._drawClassy;
2504
- break;
2505
-
2506
- case f:
2507
- o = this._drawClassyRounded;
2508
- break;
2509
-
2510
- case d:
2511
- o = this._drawRounded;
2512
- break;
2513
-
2514
- case g:
2515
- o = this._drawExtraRounded;
2516
- break;
2517
-
2518
- case p:
2519
- default:
2520
- o = this._drawSquare;
2521
- }
2522
-
2523
- o.call(this, {
2524
- x: t,
2525
- y: e,
2526
- size: r,
2527
- getNeighbor: n
2528
- });
2529
- }, t.prototype._rotateFigure = function (t) {
2530
- var e,
2531
- r = t.x,
2532
- n = t.y,
2533
- o = t.size,
2534
- i = t.rotation,
2535
- a = void 0 === i ? 0 : i,
2536
- s = r + o / 2,
2537
- u = n + o / 2;
2538
- (0, t.draw)(), null === (e = this._element) || void 0 === e || e.setAttribute("transform", "rotate(" + 180 * a / Math.PI + "," + s + "," + u + ")");
2539
- }, t.prototype._basicDot = function (t) {
2540
- var e = this,
2541
- r = t.size,
2542
- n = t.x,
2543
- o = t.y;
2544
-
2545
- this._rotateFigure(_D(_D({}, t), {
2546
- draw: function draw() {
2547
- e._element = document.createElementNS("http://www.w3.org/2000/svg", "circle"), e._element.setAttribute("cx", String(n + r / 2)), e._element.setAttribute("cy", String(o + r / 2)), e._element.setAttribute("r", String(r / 2));
2548
- }
2549
- }));
2550
- }, t.prototype._basicSquare = function (t) {
2551
- var e = this,
2552
- r = t.size,
2553
- n = t.x,
2554
- o = t.y;
2555
-
2556
- this._rotateFigure(_D(_D({}, t), {
2557
- draw: function draw() {
2558
- e._element = document.createElementNS("http://www.w3.org/2000/svg", "rect"), e._element.setAttribute("x", String(n)), e._element.setAttribute("y", String(o)), e._element.setAttribute("width", String(r)), e._element.setAttribute("height", String(r));
2559
- }
2560
- }));
2561
- }, t.prototype._basicSideRounded = function (t) {
2562
- var e = this,
2563
- r = t.size,
2564
- n = t.x,
2565
- o = t.y;
2566
-
2567
- this._rotateFigure(_D(_D({}, t), {
2568
- draw: function draw() {
2569
- e._element = document.createElementNS("http://www.w3.org/2000/svg", "path"), e._element.setAttribute("d", "M " + n + " " + o + "v " + r + "h " + r / 2 + "a " + r / 2 + " " + r / 2 + ", 0, 0, 0, 0 " + -r);
2570
- }
2571
- }));
2572
- }, t.prototype._basicCornerRounded = function (t) {
2573
- var e = this,
2574
- r = t.size,
2575
- n = t.x,
2576
- o = t.y;
2577
-
2578
- this._rotateFigure(_D(_D({}, t), {
2579
- draw: function draw() {
2580
- e._element = document.createElementNS("http://www.w3.org/2000/svg", "path"), e._element.setAttribute("d", "M " + n + " " + o + "v " + r + "h " + r + "v " + -r / 2 + "a " + r / 2 + " " + r / 2 + ", 0, 0, 0, " + -r / 2 + " " + -r / 2);
2581
- }
2582
- }));
2583
- }, t.prototype._basicCornerExtraRounded = function (t) {
2584
- var e = this,
2585
- r = t.size,
2586
- n = t.x,
2587
- o = t.y;
2588
-
2589
- this._rotateFigure(_D(_D({}, t), {
2590
- draw: function draw() {
2591
- e._element = document.createElementNS("http://www.w3.org/2000/svg", "path"), e._element.setAttribute("d", "M " + n + " " + o + "v " + r + "h " + r + "a " + r + " " + r + ", 0, 0, 0, " + -r + " " + -r);
2592
- }
2593
- }));
2594
- }, t.prototype._basicCornersRounded = function (t) {
2595
- var e = this,
2596
- r = t.size,
2597
- n = t.x,
2598
- o = t.y;
2599
-
2600
- this._rotateFigure(_D(_D({}, t), {
2601
- draw: function draw() {
2602
- e._element = document.createElementNS("http://www.w3.org/2000/svg", "path"), e._element.setAttribute("d", "M " + n + " " + o + "v " + r / 2 + "a " + r / 2 + " " + r / 2 + ", 0, 0, 0, " + r / 2 + " " + r / 2 + "h " + r / 2 + "v " + -r / 2 + "a " + r / 2 + " " + r / 2 + ", 0, 0, 0, " + -r / 2 + " " + -r / 2);
2603
- }
2604
- }));
2605
- }, t.prototype._drawDot = function (t) {
2606
- var e = t.x,
2607
- r = t.y,
2608
- n = t.size;
2609
-
2610
- this._basicDot({
2611
- x: e,
2612
- y: r,
2613
- size: n,
2614
- rotation: 0
2615
- });
2616
- }, t.prototype._drawSquare = function (t) {
2617
- var e = t.x,
2618
- r = t.y,
2619
- n = t.size;
2620
-
2621
- this._basicSquare({
2622
- x: e,
2623
- y: r,
2624
- size: n,
2625
- rotation: 0
2626
- });
2627
- }, t.prototype._drawRounded = function (t) {
2628
- var e = t.x,
2629
- r = t.y,
2630
- n = t.size,
2631
- o = t.getNeighbor,
2632
- i = o ? +o(-1, 0) : 0,
2633
- a = o ? +o(1, 0) : 0,
2634
- s = o ? +o(0, -1) : 0,
2635
- u = o ? +o(0, 1) : 0,
2636
- c = i + a + s + u;
2637
- if (0 !== c) {
2638
- if (c > 2 || i && a || s && u) this._basicSquare({
2639
- x: e,
2640
- y: r,
2641
- size: n,
2642
- rotation: 0
2643
- });else {
2644
- if (2 === c) {
2645
- var h = 0;
2646
- return i && s ? h = Math.PI / 2 : s && a ? h = Math.PI : a && u && (h = -Math.PI / 2), void this._basicCornerRounded({
2647
- x: e,
2648
- y: r,
2649
- size: n,
2650
- rotation: h
2651
- });
2652
- }
2653
-
2654
- if (1 === c) return h = 0, s ? h = Math.PI / 2 : a ? h = Math.PI : u && (h = -Math.PI / 2), void this._basicSideRounded({
2655
- x: e,
2656
- y: r,
2657
- size: n,
2658
- rotation: h
2659
- });
2660
- }
2661
- } else this._basicDot({
2662
- x: e,
2663
- y: r,
2664
- size: n,
2665
- rotation: 0
2666
- });
2667
- }, t.prototype._drawExtraRounded = function (t) {
2668
- var e = t.x,
2669
- r = t.y,
2670
- n = t.size,
2671
- o = t.getNeighbor,
2672
- i = o ? +o(-1, 0) : 0,
2673
- a = o ? +o(1, 0) : 0,
2674
- s = o ? +o(0, -1) : 0,
2675
- u = o ? +o(0, 1) : 0,
2676
- c = i + a + s + u;
2677
- if (0 !== c) {
2678
- if (c > 2 || i && a || s && u) this._basicSquare({
2679
- x: e,
2680
- y: r,
2681
- size: n,
2682
- rotation: 0
2683
- });else {
2684
- if (2 === c) {
2685
- var h = 0;
2686
- return i && s ? h = Math.PI / 2 : s && a ? h = Math.PI : a && u && (h = -Math.PI / 2), void this._basicCornerExtraRounded({
2687
- x: e,
2688
- y: r,
2689
- size: n,
2690
- rotation: h
2691
- });
2692
- }
2693
-
2694
- if (1 === c) return h = 0, s ? h = Math.PI / 2 : a ? h = Math.PI : u && (h = -Math.PI / 2), void this._basicSideRounded({
2695
- x: e,
2696
- y: r,
2697
- size: n,
2698
- rotation: h
2699
- });
2700
- }
2701
- } else this._basicDot({
2702
- x: e,
2703
- y: r,
2704
- size: n,
2705
- rotation: 0
2706
- });
2707
- }, t.prototype._drawClassy = function (t) {
2708
- var e = t.x,
2709
- r = t.y,
2710
- n = t.size,
2711
- o = t.getNeighbor,
2712
- i = o ? +o(-1, 0) : 0,
2713
- a = o ? +o(1, 0) : 0,
2714
- s = o ? +o(0, -1) : 0,
2715
- u = o ? +o(0, 1) : 0;
2716
- 0 !== i + a + s + u ? i || s ? a || u ? this._basicSquare({
2717
- x: e,
2718
- y: r,
2719
- size: n,
2720
- rotation: 0
2721
- }) : this._basicCornerRounded({
2722
- x: e,
2723
- y: r,
2724
- size: n,
2725
- rotation: Math.PI / 2
2726
- }) : this._basicCornerRounded({
2727
- x: e,
2728
- y: r,
2729
- size: n,
2730
- rotation: -Math.PI / 2
2731
- }) : this._basicCornersRounded({
2732
- x: e,
2733
- y: r,
2734
- size: n,
2735
- rotation: Math.PI / 2
2736
- });
2737
- }, t.prototype._drawClassyRounded = function (t) {
2738
- var e = t.x,
2739
- r = t.y,
2740
- n = t.size,
2741
- o = t.getNeighbor,
2742
- i = o ? +o(-1, 0) : 0,
2743
- a = o ? +o(1, 0) : 0,
2744
- s = o ? +o(0, -1) : 0,
2745
- u = o ? +o(0, 1) : 0;
2746
- 0 !== i + a + s + u ? i || s ? a || u ? this._basicSquare({
2747
- x: e,
2748
- y: r,
2749
- size: n,
2750
- rotation: 0
2751
- }) : this._basicCornerExtraRounded({
2752
- x: e,
2753
- y: r,
2754
- size: n,
2755
- rotation: Math.PI / 2
2756
- }) : this._basicCornerExtraRounded({
2757
- x: e,
2758
- y: r,
2759
- size: n,
2760
- rotation: -Math.PI / 2
2761
- }) : this._basicCornersRounded({
2762
- x: e,
2763
- y: r,
2764
- size: n,
2765
- rotation: Math.PI / 2
2766
- });
2767
- }, t;
2768
- }();
2769
-
2770
- var _A = function A() {
2771
- return (_A = Object.assign || function (t) {
2772
- for (var e, r = 1, n = arguments.length; r < n; r++) {
2773
- for (var o in e = arguments[r]) {
2774
- Object.prototype.hasOwnProperty.call(e, o) && (t[o] = e[o]);
2775
- }
2776
- }
2777
-
2778
- return t;
2779
- }).apply(this, arguments);
2780
- };
2781
-
2782
- var k = function () {
2783
- function t(t) {
2784
- var e = t.svg,
2785
- r = t.type;
2786
- this._svg = e, this._type = r;
2787
- }
2788
-
2789
- return t.prototype.draw = function (t, e, r, n) {
2790
- var o;
2791
-
2792
- switch (this._type) {
2793
- case w:
2794
- o = this._drawSquare;
2795
- break;
2796
-
2797
- case _:
2798
- o = this._drawExtraRounded;
2799
- break;
2800
-
2801
- case "dot":
2802
- default:
2803
- o = this._drawDot;
2153
+ function u(t) {
2154
+ var e;
2155
+ t.done ? o(t.value) : (e = t.value, e instanceof r ? e : new r(function (t) {
2156
+ t(e);
2157
+ })).then(a, s);
2804
2158
  }
2805
2159
 
2806
- o.call(this, {
2807
- x: t,
2808
- y: e,
2809
- size: r,
2810
- rotation: n
2811
- });
2812
- }, t.prototype._rotateFigure = function (t) {
2813
- var e,
2814
- r = t.x,
2815
- n = t.y,
2816
- o = t.size,
2817
- i = t.rotation,
2818
- a = void 0 === i ? 0 : i,
2819
- s = r + o / 2,
2820
- u = n + o / 2;
2821
- (0, t.draw)(), null === (e = this._element) || void 0 === e || e.setAttribute("transform", "rotate(" + 180 * a / Math.PI + "," + s + "," + u + ")");
2822
- }, t.prototype._basicDot = function (t) {
2823
- var e = this,
2824
- r = t.size,
2825
- n = t.x,
2826
- o = t.y,
2827
- i = r / 7;
2828
-
2829
- this._rotateFigure(_A(_A({}, t), {
2830
- draw: function draw() {
2831
- e._element = document.createElementNS("http://www.w3.org/2000/svg", "path"), e._element.setAttribute("clip-rule", "evenodd"), e._element.setAttribute("d", "M " + (n + r / 2) + " " + o + "a " + r / 2 + " " + r / 2 + " 0 1 0 0.1 0zm 0 " + i + "a " + (r / 2 - i) + " " + (r / 2 - i) + " 0 1 1 -0.1 0Z");
2832
- }
2833
- }));
2834
- }, t.prototype._basicSquare = function (t) {
2835
- var e = this,
2836
- r = t.size,
2837
- n = t.x,
2838
- o = t.y,
2839
- i = r / 7;
2840
-
2841
- this._rotateFigure(_A(_A({}, t), {
2842
- draw: function draw() {
2843
- e._element = document.createElementNS("http://www.w3.org/2000/svg", "path"), e._element.setAttribute("clip-rule", "evenodd"), e._element.setAttribute("d", "M " + n + " " + o + "v " + r + "h " + r + "v " + -r + "zM " + (n + i) + " " + (o + i) + "h " + (r - 2 * i) + "v " + (r - 2 * i) + "h " + (2 * i - r) + "z");
2844
- }
2845
- }));
2846
- }, t.prototype._basicExtraRounded = function (t) {
2847
- var e = this,
2848
- r = t.size,
2849
- n = t.x,
2850
- o = t.y,
2851
- i = r / 7;
2852
-
2853
- this._rotateFigure(_A(_A({}, t), {
2854
- draw: function draw() {
2855
- e._element = document.createElementNS("http://www.w3.org/2000/svg", "path"), e._element.setAttribute("clip-rule", "evenodd"), e._element.setAttribute("d", "M " + n + " " + (o + 2.5 * i) + "v " + 2 * i + "a " + 2.5 * i + " " + 2.5 * i + ", 0, 0, 0, " + 2.5 * i + " " + 2.5 * i + "h " + 2 * i + "a " + 2.5 * i + " " + 2.5 * i + ", 0, 0, 0, " + 2.5 * i + " " + 2.5 * -i + "v " + -2 * i + "a " + 2.5 * i + " " + 2.5 * i + ", 0, 0, 0, " + 2.5 * -i + " " + 2.5 * -i + "h " + -2 * i + "a " + 2.5 * i + " " + 2.5 * i + ", 0, 0, 0, " + 2.5 * -i + " " + 2.5 * i + "M " + (n + 2.5 * i) + " " + (o + i) + "h " + 2 * i + "a " + 1.5 * i + " " + 1.5 * i + ", 0, 0, 1, " + 1.5 * i + " " + 1.5 * i + "v " + 2 * i + "a " + 1.5 * i + " " + 1.5 * i + ", 0, 0, 1, " + 1.5 * -i + " " + 1.5 * i + "h " + -2 * i + "a " + 1.5 * i + " " + 1.5 * i + ", 0, 0, 1, " + 1.5 * -i + " " + 1.5 * -i + "v " + -2 * i + "a " + 1.5 * i + " " + 1.5 * i + ", 0, 0, 1, " + 1.5 * i + " " + 1.5 * -i);
2856
- }
2857
- }));
2858
- }, t.prototype._drawDot = function (t) {
2859
- var e = t.x,
2860
- r = t.y,
2861
- n = t.size,
2862
- o = t.rotation;
2863
-
2864
- this._basicDot({
2865
- x: e,
2866
- y: r,
2867
- size: n,
2868
- rotation: o
2869
- });
2870
- }, t.prototype._drawSquare = function (t) {
2871
- var e = t.x,
2872
- r = t.y,
2873
- n = t.size,
2874
- o = t.rotation;
2875
-
2876
- this._basicSquare({
2877
- x: e,
2878
- y: r,
2879
- size: n,
2880
- rotation: o
2881
- });
2882
- }, t.prototype._drawExtraRounded = function (t) {
2883
- var e = t.x,
2884
- r = t.y,
2885
- n = t.size,
2886
- o = t.rotation;
2160
+ u((n = n.apply(t, e || [])).next());
2161
+ });
2162
+ },
2163
+ y = function y(t, e) {
2164
+ var r,
2165
+ n,
2166
+ o,
2167
+ i,
2168
+ a = {
2169
+ label: 0,
2170
+ sent: function sent() {
2171
+ if (1 & o[0]) throw o[1];
2172
+ return o[1];
2173
+ },
2174
+ trys: [],
2175
+ ops: []
2176
+ };
2177
+ return i = {
2178
+ next: s(0),
2179
+ "throw": s(1),
2180
+ "return": s(2)
2181
+ }, "function" == typeof Symbol && (i[Symbol.iterator] = function () {
2182
+ return this;
2183
+ }), i;
2887
2184
 
2888
- this._basicExtraRounded({
2889
- x: e,
2890
- y: r,
2891
- size: n,
2892
- rotation: o
2893
- });
2894
- }, t;
2895
- }();
2185
+ function s(i) {
2186
+ return function (s) {
2187
+ return function (i) {
2188
+ if (r) throw new TypeError("Generator is already executing.");
2896
2189
 
2897
- var _q = function q() {
2898
- return (_q = Object.assign || function (t) {
2899
- for (var e, r = 1, n = arguments.length; r < n; r++) {
2900
- for (var o in e = arguments[r]) {
2901
- Object.prototype.hasOwnProperty.call(e, o) && (t[o] = e[o]);
2902
- }
2903
- }
2190
+ for (; a;) {
2191
+ try {
2192
+ if (r = 1, n && (o = 2 & i[0] ? n["return"] : i[0] ? n["throw"] || ((o = n["return"]) && o.call(n), 0) : n.next) && !(o = o.call(n, i[1])).done) return o;
2904
2193
 
2905
- return t;
2906
- }).apply(this, arguments);
2907
- };
2194
+ switch (n = 0, o && (i = [2 & i[0], o.value]), i[0]) {
2195
+ case 0:
2196
+ case 1:
2197
+ o = i;
2198
+ break;
2908
2199
 
2909
- var R = function () {
2910
- function t(t) {
2911
- var e = t.svg,
2912
- r = t.type;
2913
- this._svg = e, this._type = r;
2914
- }
2200
+ case 4:
2201
+ return a.label++, {
2202
+ value: i[1],
2203
+ done: !1
2204
+ };
2915
2205
 
2916
- return t.prototype.draw = function (t, e, r, n) {
2917
- var o;
2206
+ case 5:
2207
+ a.label++, n = i[1], i = [0];
2208
+ continue;
2918
2209
 
2919
- switch (this._type) {
2920
- case x:
2921
- o = this._drawSquare;
2922
- break;
2210
+ case 7:
2211
+ i = a.ops.pop(), a.trys.pop();
2212
+ continue;
2923
2213
 
2924
- case "dot":
2925
- default:
2926
- o = this._drawDot;
2927
- }
2214
+ default:
2215
+ if (!((o = (o = a.trys).length > 0 && o[o.length - 1]) || 6 !== i[0] && 2 !== i[0])) {
2216
+ a = 0;
2217
+ continue;
2218
+ }
2928
2219
 
2929
- o.call(this, {
2930
- x: t,
2931
- y: e,
2932
- size: r,
2933
- rotation: n
2934
- });
2935
- }, t.prototype._rotateFigure = function (t) {
2936
- var e,
2937
- r = t.x,
2938
- n = t.y,
2939
- o = t.size,
2940
- i = t.rotation,
2941
- a = void 0 === i ? 0 : i,
2942
- s = r + o / 2,
2943
- u = n + o / 2;
2944
- (0, t.draw)(), null === (e = this._element) || void 0 === e || e.setAttribute("transform", "rotate(" + 180 * a / Math.PI + "," + s + "," + u + ")");
2945
- }, t.prototype._basicDot = function (t) {
2946
- var e = this,
2947
- r = t.size,
2948
- n = t.x,
2949
- o = t.y;
2220
+ if (3 === i[0] && (!o || i[1] > o[0] && i[1] < o[3])) {
2221
+ a.label = i[1];
2222
+ break;
2223
+ }
2950
2224
 
2951
- this._rotateFigure(_q(_q({}, t), {
2952
- draw: function draw() {
2953
- e._element = document.createElementNS("http://www.w3.org/2000/svg", "circle"), e._element.setAttribute("cx", String(n + r / 2)), e._element.setAttribute("cy", String(o + r / 2)), e._element.setAttribute("r", String(r / 2));
2954
- }
2955
- }));
2956
- }, t.prototype._basicSquare = function (t) {
2957
- var e = this,
2958
- r = t.size,
2959
- n = t.x,
2960
- o = t.y;
2225
+ if (6 === i[0] && a.label < o[1]) {
2226
+ a.label = o[1], o = i;
2227
+ break;
2228
+ }
2961
2229
 
2962
- this._rotateFigure(_q(_q({}, t), {
2963
- draw: function draw() {
2964
- e._element = document.createElementNS("http://www.w3.org/2000/svg", "rect"), e._element.setAttribute("x", String(n)), e._element.setAttribute("y", String(o)), e._element.setAttribute("width", String(r)), e._element.setAttribute("height", String(r));
2965
- }
2966
- }));
2967
- }, t.prototype._drawDot = function (t) {
2968
- var e = t.x,
2969
- r = t.y,
2970
- n = t.size,
2971
- o = t.rotation;
2230
+ if (o && a.label < o[2]) {
2231
+ a.label = o[2], a.ops.push(i);
2232
+ break;
2233
+ }
2972
2234
 
2973
- this._basicDot({
2974
- x: e,
2975
- y: r,
2976
- size: n,
2977
- rotation: o
2978
- });
2979
- }, t.prototype._drawSquare = function (t) {
2980
- var e = t.x,
2981
- r = t.y,
2982
- n = t.size,
2983
- o = t.rotation;
2235
+ o[2] && a.ops.pop(), a.trys.pop();
2236
+ continue;
2237
+ }
2984
2238
 
2985
- this._basicSquare({
2986
- x: e,
2987
- y: r,
2988
- size: n,
2989
- rotation: o
2990
- });
2991
- }, t;
2992
- }();
2239
+ i = e.call(t, a);
2240
+ } catch (t) {
2241
+ i = [6, t], n = 0;
2242
+ } finally {
2243
+ r = o = 0;
2244
+ }
2245
+ }
2993
2246
 
2994
- var B = [[1, 1, 1, 1, 1, 1, 1], [1, 0, 0, 0, 0, 0, 1], [1, 0, 0, 0, 0, 0, 1], [1, 0, 0, 0, 0, 0, 1], [1, 0, 0, 0, 0, 0, 1], [1, 0, 0, 0, 0, 0, 1], [1, 1, 1, 1, 1, 1, 1]],
2995
- E = [[0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0], [0, 0, 1, 1, 1, 0, 0], [0, 0, 1, 1, 1, 0, 0], [0, 0, 1, 1, 1, 0, 0], [0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0]];
2247
+ if (5 & i[0]) throw i[1];
2248
+ return {
2249
+ value: i[0] ? i[1] : void 0,
2250
+ done: !0
2251
+ };
2252
+ }([i, s]);
2253
+ };
2254
+ }
2255
+ },
2256
+ m = [[1, 1, 1, 1, 1, 1, 1], [1, 0, 0, 0, 0, 0, 1], [1, 0, 0, 0, 0, 0, 1], [1, 0, 0, 0, 0, 0, 1], [1, 0, 0, 0, 0, 0, 1], [1, 0, 0, 0, 0, 0, 1], [1, 1, 1, 1, 1, 1, 1]],
2257
+ b = [[0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0], [0, 0, 1, 1, 1, 0, 0], [0, 0, 1, 1, 1, 0, 0], [0, 0, 1, 1, 1, 0, 0], [0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0]];
2996
2258
 
2997
- var L = function () {
2259
+ var _ = function () {
2998
2260
  function t(t) {
2999
2261
  this._element = document.createElementNS("http://www.w3.org/2000/svg", "svg"), this._element.setAttribute("width", String(t.width)), this._element.setAttribute("height", String(t.height)), this._defs = document.createElementNS("http://www.w3.org/2000/svg", "defs"), this._element.appendChild(this._defs), this._options = t;
3000
2262
  }
@@ -3013,12 +2275,8 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
3013
2275
  configurable: !0
3014
2276
  }), t.prototype.getElement = function () {
3015
2277
  return this._element;
3016
- }, t.prototype.clear = function () {
3017
- var t,
3018
- e = this._element;
3019
- this._element = e.cloneNode(!1), null === (t = null == e ? void 0 : e.parentNode) || void 0 === t || t.replaceChild(this._element, e), this._defs = document.createElementNS("http://www.w3.org/2000/svg", "defs"), this._element.appendChild(this._defs);
3020
2278
  }, t.prototype.drawQR = function (t) {
3021
- return e = this, r = void 0, o = function o() {
2279
+ return w(this, void 0, void 0, function () {
3022
2280
  var e,
3023
2281
  r,
3024
2282
  n,
@@ -3026,105 +2284,14 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
3026
2284
  i,
3027
2285
  a,
3028
2286
  s,
3029
- h,
3030
- d,
3031
- l = this;
3032
- return function (t, e) {
3033
- var r,
3034
- n,
3035
- o,
3036
- i,
3037
- a = {
3038
- label: 0,
3039
- sent: function sent() {
3040
- if (1 & o[0]) throw o[1];
3041
- return o[1];
3042
- },
3043
- trys: [],
3044
- ops: []
3045
- };
3046
- return i = {
3047
- next: s(0),
3048
- "throw": s(1),
3049
- "return": s(2)
3050
- }, "function" == typeof Symbol && (i[Symbol.iterator] = function () {
3051
- return this;
3052
- }), i;
3053
-
3054
- function s(i) {
3055
- return function (s) {
3056
- return function (i) {
3057
- if (r) throw new TypeError("Generator is already executing.");
3058
-
3059
- for (; a;) {
3060
- try {
3061
- if (r = 1, n && (o = 2 & i[0] ? n["return"] : i[0] ? n["throw"] || ((o = n["return"]) && o.call(n), 0) : n.next) && !(o = o.call(n, i[1])).done) return o;
3062
-
3063
- switch (n = 0, o && (i = [2 & i[0], o.value]), i[0]) {
3064
- case 0:
3065
- case 1:
3066
- o = i;
3067
- break;
3068
-
3069
- case 4:
3070
- return a.label++, {
3071
- value: i[1],
3072
- done: !1
3073
- };
3074
-
3075
- case 5:
3076
- a.label++, n = i[1], i = [0];
3077
- continue;
3078
-
3079
- case 7:
3080
- i = a.ops.pop(), a.trys.pop();
3081
- continue;
3082
-
3083
- default:
3084
- if (!((o = (o = a.trys).length > 0 && o[o.length - 1]) || 6 !== i[0] && 2 !== i[0])) {
3085
- a = 0;
3086
- continue;
3087
- }
3088
-
3089
- if (3 === i[0] && (!o || i[1] > o[0] && i[1] < o[3])) {
3090
- a.label = i[1];
3091
- break;
3092
- }
3093
-
3094
- if (6 === i[0] && a.label < o[1]) {
3095
- a.label = o[1], o = i;
3096
- break;
3097
- }
3098
-
3099
- if (o && a.label < o[2]) {
3100
- a.label = o[2], a.ops.push(i);
3101
- break;
3102
- }
3103
-
3104
- o[2] && a.ops.pop(), a.trys.pop();
3105
- continue;
3106
- }
3107
-
3108
- i = e.call(t, a);
3109
- } catch (t) {
3110
- i = [6, t], n = 0;
3111
- } finally {
3112
- r = o = 0;
3113
- }
3114
- }
3115
-
3116
- if (5 & i[0]) throw i[1];
3117
- return {
3118
- value: i[0] ? i[1] : void 0,
3119
- done: !0
3120
- };
3121
- }([i, s]);
3122
- };
3123
- }
3124
- }(this, function (f) {
2287
+ u,
2288
+ c,
2289
+ l,
2290
+ d = this;
2291
+ return y(this, function (f) {
3125
2292
  switch (f.label) {
3126
2293
  case 0:
3127
- return e = t.getModuleCount(), r = Math.min(this._options.width, this._options.height) - 2 * this._options.margin, n = Math.floor(r / e), o = {
2294
+ return e = t.getModuleCount(), r = Math.min(this._options.width, this._options.height) - 2 * this._options.margin, n = this._options.shape === v ? r / Math.sqrt(2) : r, o = Math.floor(n / e), i = {
3128
2295
  hideXDots: 0,
3129
2296
  hideYDots: 0,
3130
2297
  width: 0,
@@ -3133,72 +2300,85 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
3133
2300
 
3134
2301
  case 1:
3135
2302
  if (f.sent(), !this._image) return [2];
3136
- i = this._options, a = i.imageOptions, s = i.qrOptions, h = a.imageSize * c[s.errorCorrectionLevel], d = Math.floor(h * e * e), o = u({
2303
+ a = this._options, s = a.imageOptions, u = a.qrOptions, c = s.imageSize * h[u.errorCorrectionLevel], l = Math.floor(c * e * e), i = function (t) {
2304
+ var e = t.originalHeight,
2305
+ r = t.originalWidth,
2306
+ n = t.maxHiddenDots,
2307
+ o = t.maxHiddenAxisDots,
2308
+ i = t.dotSize,
2309
+ a = {
2310
+ x: 0,
2311
+ y: 0
2312
+ },
2313
+ s = {
2314
+ x: 0,
2315
+ y: 0
2316
+ };
2317
+ if (e <= 0 || r <= 0 || n <= 0 || i <= 0) return {
2318
+ height: 0,
2319
+ width: 0,
2320
+ hideYDots: 0,
2321
+ hideXDots: 0
2322
+ };
2323
+ var u = e / r;
2324
+ return a.x = Math.floor(Math.sqrt(n / u)), a.x <= 0 && (a.x = 1), o && o < a.x && (a.x = o), a.x % 2 == 0 && a.x--, s.x = a.x * i, a.y = 1 + 2 * Math.ceil((a.x * u - 1) / 2), s.y = Math.round(s.x * u), (a.y * a.x > n || o && o < a.y) && (o && o < a.y ? (a.y = o, a.y % 2 == 0 && a.x--) : a.y -= 2, s.y = a.y * i, a.x = 1 + 2 * Math.ceil((a.y / u - 1) / 2), s.x = Math.round(s.y / u)), {
2325
+ height: s.y,
2326
+ width: s.x,
2327
+ hideYDots: a.y,
2328
+ hideXDots: a.x
2329
+ };
2330
+ }({
3137
2331
  originalWidth: this._image.width,
3138
2332
  originalHeight: this._image.height,
3139
- maxHiddenDots: d,
2333
+ maxHiddenDots: l,
3140
2334
  maxHiddenAxisDots: e - 14,
3141
- dotSize: n
2335
+ dotSize: o
3142
2336
  }), f.label = 2;
3143
2337
 
3144
2338
  case 2:
3145
- return this.clear(), this.drawBackground(), this.drawDots(function (t, r) {
3146
- var n, i, a, s, u, c;
3147
- return !(l._options.imageOptions.hideBackgroundDots && t >= (e - o.hideXDots) / 2 && t < (e + o.hideXDots) / 2 && r >= (e - o.hideYDots) / 2 && r < (e + o.hideYDots) / 2 || (null === (n = B[t]) || void 0 === n ? void 0 : n[r]) || (null === (i = B[t - e + 7]) || void 0 === i ? void 0 : i[r]) || (null === (a = B[t]) || void 0 === a ? void 0 : a[r - e + 7]) || (null === (s = E[t]) || void 0 === s ? void 0 : s[r]) || (null === (u = E[t - e + 7]) || void 0 === u ? void 0 : u[r]) || (null === (c = E[t]) || void 0 === c ? void 0 : c[r - e + 7]));
3148
- }), this.drawCorners(), this._options.image && this.drawImage({
3149
- width: o.width,
3150
- height: o.height,
2339
+ return this.drawBackground(), this.drawDots(function (t, r) {
2340
+ var n, o, a, s, u, h;
2341
+ return !(d._options.imageOptions.hideBackgroundDots && t >= (e - i.hideXDots) / 2 && t < (e + i.hideXDots) / 2 && r >= (e - i.hideYDots) / 2 && r < (e + i.hideYDots) / 2 || (null === (n = m[t]) || void 0 === n ? void 0 : n[r]) || (null === (o = m[t - e + 7]) || void 0 === o ? void 0 : o[r]) || (null === (a = m[t]) || void 0 === a ? void 0 : a[r - e + 7]) || (null === (s = b[t]) || void 0 === s ? void 0 : s[r]) || (null === (u = b[t - e + 7]) || void 0 === u ? void 0 : u[r]) || (null === (h = b[t]) || void 0 === h ? void 0 : h[r - e + 7]));
2342
+ }), this.drawCorners(), this._options.image ? [4, this.drawImage({
2343
+ width: i.width,
2344
+ height: i.height,
3151
2345
  count: e,
3152
- dotSize: n
3153
- }), [2];
3154
- }
3155
- });
3156
- }, new ((n = void 0) || (n = Promise))(function (t, i) {
3157
- function a(t) {
3158
- try {
3159
- u(o.next(t));
3160
- } catch (t) {
3161
- i(t);
3162
- }
3163
- }
3164
-
3165
- function s(t) {
3166
- try {
3167
- u(o["throw"](t));
3168
- } catch (t) {
3169
- i(t);
3170
- }
3171
- }
2346
+ dotSize: o
2347
+ })] : [3, 4];
3172
2348
 
3173
- function u(e) {
3174
- var r;
3175
- e.done ? t(e.value) : (r = e.value, r instanceof n ? r : new n(function (t) {
3176
- t(r);
3177
- })).then(a, s);
3178
- }
2349
+ case 3:
2350
+ f.sent(), f.label = 4;
3179
2351
 
3180
- u((o = o.apply(e, r || [])).next());
2352
+ case 4:
2353
+ return [2];
2354
+ }
2355
+ });
3181
2356
  });
3182
- var e, r, n, o;
3183
2357
  }, t.prototype.drawBackground = function () {
3184
2358
  var t,
3185
2359
  e,
3186
- r = this._element,
3187
- n = this._options;
3188
-
3189
- if (r) {
3190
- var o = null === (t = n.backgroundOptions) || void 0 === t ? void 0 : t.gradient,
3191
- i = null === (e = n.backgroundOptions) || void 0 === e ? void 0 : e.color;
3192
- (o || i) && this._createColor({
3193
- options: o,
3194
- color: i,
2360
+ r,
2361
+ n = this._element,
2362
+ o = this._options;
2363
+
2364
+ if (n) {
2365
+ var i = null === (t = o.backgroundOptions) || void 0 === t ? void 0 : t.gradient,
2366
+ a = null === (e = o.backgroundOptions) || void 0 === e ? void 0 : e.color;
2367
+
2368
+ if ((i || a) && this._createColor({
2369
+ options: i,
2370
+ color: a,
3195
2371
  additionalRotation: 0,
3196
2372
  x: 0,
3197
2373
  y: 0,
3198
- height: n.height,
3199
- width: n.width,
2374
+ height: o.height,
2375
+ width: o.width,
3200
2376
  name: "background-color"
3201
- });
2377
+ }), null === (r = o.backgroundOptions) || void 0 === r ? void 0 : r.round) {
2378
+ var s = Math.min(o.width, o.height),
2379
+ u = document.createElementNS("http://www.w3.org/2000/svg", "rect");
2380
+ this._backgroundClipPath = document.createElementNS("http://www.w3.org/2000/svg", "clipPath"), this._backgroundClipPath.setAttribute("id", "clip-path-background-color"), this._defs.appendChild(this._backgroundClipPath), u.setAttribute("x", String((o.width - s) / 2)), u.setAttribute("y", String((o.height - s) / 2)), u.setAttribute("width", String(s)), u.setAttribute("height", String(s)), u.setAttribute("rx", String(s / 2 * o.backgroundOptions.round)), this._backgroundClipPath.appendChild(u);
2381
+ }
3202
2382
  }
3203
2383
  }, t.prototype.drawDots = function (t) {
3204
2384
  var e,
@@ -3211,10 +2391,11 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
3211
2391
 
3212
2392
  if (i > o.width || i > o.height) throw "The canvas is too small.";
3213
2393
  var a = Math.min(o.width, o.height) - 2 * o.margin,
3214
- s = Math.floor(a / i),
3215
- u = Math.floor((o.width - i * s) / 2),
3216
- c = Math.floor((o.height - i * s) / 2),
3217
- h = new I({
2394
+ s = o.shape === v ? a / Math.sqrt(2) : a,
2395
+ u = Math.floor(s / i),
2396
+ h = Math.floor((o.width - i * u) / 2),
2397
+ c = Math.floor((o.height - i * u) / 2),
2398
+ d = new l({
3218
2399
  svg: this._element,
3219
2400
  type: o.dotsOptions.type
3220
2401
  });
@@ -3222,23 +2403,57 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
3222
2403
  options: null === (e = o.dotsOptions) || void 0 === e ? void 0 : e.gradient,
3223
2404
  color: o.dotsOptions.color,
3224
2405
  additionalRotation: 0,
3225
- x: u,
3226
- y: c,
3227
- height: i * s,
3228
- width: i * s,
2406
+ x: 0,
2407
+ y: 0,
2408
+ height: o.height,
2409
+ width: o.width,
3229
2410
  name: "dot-color"
3230
2411
  });
3231
2412
 
3232
- for (var d = function d(e) {
2413
+ for (var f = function f(e) {
3233
2414
  for (var o = function o(_o) {
3234
- return t && !t(e, _o) ? "continue" : (null === (r = l._qr) || void 0 === r ? void 0 : r.isDark(e, _o)) ? (h.draw(u + e * s, c + _o * s, s, function (r, a) {
2415
+ return t && !t(e, _o) ? "continue" : (null === (r = g._qr) || void 0 === r ? void 0 : r.isDark(e, _o)) ? (d.draw(h + e * u, c + _o * u, u, function (r, a) {
3235
2416
  return !(e + r < 0 || _o + a < 0 || e + r >= i || _o + a >= i) && !(t && !t(e + r, _o + a)) && !!n._qr && n._qr.isDark(e + r, _o + a);
3236
- }), void (h._element && l._dotsClipPath && l._dotsClipPath.appendChild(h._element))) : "continue";
2417
+ }), void (d._element && g._dotsClipPath && g._dotsClipPath.appendChild(d._element))) : "continue";
3237
2418
  }, a = 0; a < i; a++) {
3238
2419
  o(a);
3239
2420
  }
3240
- }, l = this, f = 0; f < i; f++) {
3241
- d(f);
2421
+ }, g = this, p = 0; p < i; p++) {
2422
+ f(p);
2423
+ }
2424
+
2425
+ if (o.shape === v) {
2426
+ var w = Math.floor((a / u - i) / 2),
2427
+ y = i + 2 * w,
2428
+ m = h - w * u,
2429
+ b = c - w * u,
2430
+ _ = [],
2431
+ x = Math.floor(y / 2);
2432
+
2433
+ for (p = 0; p < y; p++) {
2434
+ _[p] = [];
2435
+
2436
+ for (var S = 0; S < y; S++) {
2437
+ p >= w - 1 && p <= y - w && S >= w - 1 && S <= y - w || Math.sqrt((p - x) * (p - x) + (S - x) * (S - x)) > x ? _[p][S] = 0 : _[p][S] = this._qr.isDark(S - 2 * w < 0 ? S : S >= i ? S - 2 * w : S - w, p - 2 * w < 0 ? p : p >= i ? p - 2 * w : p - w) ? 1 : 0;
2438
+ }
2439
+ }
2440
+
2441
+ var M = function M(t) {
2442
+ for (var e = function e(_e2) {
2443
+ if (!_[t][_e2]) return "continue";
2444
+ d.draw(m + t * u, b + _e2 * u, u, function (r, n) {
2445
+ var o;
2446
+ return !!(null === (o = _[t + r]) || void 0 === o ? void 0 : o[_e2 + n]);
2447
+ }), d._element && C._dotsClipPath && C._dotsClipPath.appendChild(d._element);
2448
+ }, r = 0; r < y; r++) {
2449
+ e(r);
2450
+ }
2451
+ },
2452
+ C = this;
2453
+
2454
+ for (p = 0; p < y; p++) {
2455
+ M(p);
2456
+ }
3242
2457
  }
3243
2458
  }, t.prototype.drawCorners = function () {
3244
2459
  var t = this;
@@ -3249,100 +2464,101 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
3249
2464
 
3250
2465
  var n = this._qr.getModuleCount(),
3251
2466
  o = Math.min(r.width, r.height) - 2 * r.margin,
3252
- i = Math.floor(o / n),
3253
- a = 7 * i,
3254
- s = 3 * i,
3255
- u = Math.floor((r.width - n * i) / 2),
3256
- c = Math.floor((r.height - n * i) / 2);
2467
+ i = r.shape === v ? o / Math.sqrt(2) : o,
2468
+ a = Math.floor(i / n),
2469
+ s = 7 * a,
2470
+ u = 3 * a,
2471
+ h = Math.floor((r.width - n * a) / 2),
2472
+ c = Math.floor((r.height - n * a) / 2);
3257
2473
 
3258
2474
  [[0, 0, 0], [1, 0, Math.PI / 2], [0, 1, -Math.PI / 2]].forEach(function (e) {
3259
2475
  var o,
3260
- h,
2476
+ i,
3261
2477
  d,
3262
- l,
3263
- f,
3264
- p,
3265
2478
  g,
3266
2479
  v,
3267
- y,
3268
2480
  w,
2481
+ y,
3269
2482
  _,
3270
- m,
3271
- b = e[0],
3272
- x = e[1],
3273
- M = e[2],
3274
- S = u + b * i * (n - 7),
3275
- C = c + x * i * (n - 7),
3276
- P = t._dotsClipPath,
3277
- O = t._dotsClipPath;
3278
-
3279
- if (((null === (o = r.cornersSquareOptions) || void 0 === o ? void 0 : o.gradient) || (null === (h = r.cornersSquareOptions) || void 0 === h ? void 0 : h.color)) && ((P = document.createElementNS("http://www.w3.org/2000/svg", "clipPath")).setAttribute("id", "clip-path-corners-square-color-" + b + "-" + x), t._defs.appendChild(P), t._cornersSquareClipPath = t._cornersDotClipPath = O = P, t._createColor({
2483
+ x,
2484
+ S,
2485
+ M,
2486
+ C,
2487
+ A = e[0],
2488
+ k = e[1],
2489
+ O = e[2],
2490
+ D = h + A * a * (n - 7),
2491
+ P = c + k * a * (n - 7),
2492
+ z = t._dotsClipPath,
2493
+ B = t._dotsClipPath;
2494
+
2495
+ if (((null === (o = r.cornersSquareOptions) || void 0 === o ? void 0 : o.gradient) || (null === (i = r.cornersSquareOptions) || void 0 === i ? void 0 : i.color)) && ((z = document.createElementNS("http://www.w3.org/2000/svg", "clipPath")).setAttribute("id", "clip-path-corners-square-color-" + A + "-" + k), t._defs.appendChild(z), t._cornersSquareClipPath = t._cornersDotClipPath = B = z, t._createColor({
3280
2496
  options: null === (d = r.cornersSquareOptions) || void 0 === d ? void 0 : d.gradient,
3281
- color: null === (l = r.cornersSquareOptions) || void 0 === l ? void 0 : l.color,
3282
- additionalRotation: M,
3283
- x: S,
3284
- y: C,
3285
- height: a,
3286
- width: a,
3287
- name: "corners-square-color-" + b + "-" + x
3288
- })), null === (f = r.cornersSquareOptions) || void 0 === f ? void 0 : f.type) {
3289
- var z = new k({
2497
+ color: null === (g = r.cornersSquareOptions) || void 0 === g ? void 0 : g.color,
2498
+ additionalRotation: O,
2499
+ x: D,
2500
+ y: P,
2501
+ height: s,
2502
+ width: s,
2503
+ name: "corners-square-color-" + A + "-" + k
2504
+ })), null === (v = r.cornersSquareOptions) || void 0 === v ? void 0 : v.type) {
2505
+ var q = new f({
3290
2506
  svg: t._element,
3291
2507
  type: r.cornersSquareOptions.type
3292
2508
  });
3293
- z.draw(S, C, a, M), z._element && P && P.appendChild(z._element);
3294
- } else for (var D = new I({
2509
+ q.draw(D, P, s, O), q._element && z && z.appendChild(q._element);
2510
+ } else for (var I = new l({
3295
2511
  svg: t._element,
3296
2512
  type: r.dotsOptions.type
3297
- }), A = function A(t) {
3298
- for (var e = function e(_e4) {
3299
- if (!(null === (p = B[t]) || void 0 === p ? void 0 : p[_e4])) return "continue";
3300
- D.draw(S + t * i, C + _e4 * i, i, function (r, n) {
2513
+ }), E = function E(t) {
2514
+ for (var e = function e(_e3) {
2515
+ if (!(null === (w = m[t]) || void 0 === w ? void 0 : w[_e3])) return "continue";
2516
+ I.draw(D + t * a, P + _e3 * a, a, function (r, n) {
3301
2517
  var o;
3302
- return !!(null === (o = B[t + r]) || void 0 === o ? void 0 : o[_e4 + n]);
3303
- }), D._element && P && P.appendChild(D._element);
3304
- }, r = 0; r < B[t].length; r++) {
2518
+ return !!(null === (o = m[t + r]) || void 0 === o ? void 0 : o[_e3 + n]);
2519
+ }), I._element && z && z.appendChild(I._element);
2520
+ }, r = 0; r < m[t].length; r++) {
3305
2521
  e(r);
3306
2522
  }
3307
- }, q = 0; q < B.length; q++) {
3308
- A(q);
3309
- }
3310
-
3311
- if (((null === (g = r.cornersDotOptions) || void 0 === g ? void 0 : g.gradient) || (null === (v = r.cornersDotOptions) || void 0 === v ? void 0 : v.color)) && ((O = document.createElementNS("http://www.w3.org/2000/svg", "clipPath")).setAttribute("id", "clip-path-corners-dot-color-" + b + "-" + x), t._defs.appendChild(O), t._cornersDotClipPath = O, t._createColor({
3312
- options: null === (y = r.cornersDotOptions) || void 0 === y ? void 0 : y.gradient,
3313
- color: null === (w = r.cornersDotOptions) || void 0 === w ? void 0 : w.color,
3314
- additionalRotation: M,
3315
- x: S + 2 * i,
3316
- y: C + 2 * i,
3317
- height: s,
3318
- width: s,
3319
- name: "corners-dot-color-" + b + "-" + x
3320
- })), null === (_ = r.cornersDotOptions) || void 0 === _ ? void 0 : _.type) {
3321
- var L = new R({
2523
+ }, L = 0; L < m.length; L++) {
2524
+ E(L);
2525
+ }
2526
+
2527
+ if (((null === (y = r.cornersDotOptions) || void 0 === y ? void 0 : y.gradient) || (null === (_ = r.cornersDotOptions) || void 0 === _ ? void 0 : _.color)) && ((B = document.createElementNS("http://www.w3.org/2000/svg", "clipPath")).setAttribute("id", "clip-path-corners-dot-color-" + A + "-" + k), t._defs.appendChild(B), t._cornersDotClipPath = B, t._createColor({
2528
+ options: null === (x = r.cornersDotOptions) || void 0 === x ? void 0 : x.gradient,
2529
+ color: null === (S = r.cornersDotOptions) || void 0 === S ? void 0 : S.color,
2530
+ additionalRotation: O,
2531
+ x: D + 2 * a,
2532
+ y: P + 2 * a,
2533
+ height: u,
2534
+ width: u,
2535
+ name: "corners-dot-color-" + A + "-" + k
2536
+ })), null === (M = r.cornersDotOptions) || void 0 === M ? void 0 : M.type) {
2537
+ var R = new p({
3322
2538
  svg: t._element,
3323
2539
  type: r.cornersDotOptions.type
3324
2540
  });
3325
- L.draw(S + 2 * i, C + 2 * i, s, M), L._element && O && O.appendChild(L._element);
2541
+ R.draw(D + 2 * a, P + 2 * a, u, O), R._element && B && B.appendChild(R._element);
3326
2542
  } else {
3327
- D = new I({
2543
+ I = new l({
3328
2544
  svg: t._element,
3329
2545
  type: r.dotsOptions.type
3330
2546
  });
3331
2547
 
3332
2548
  var N = function N(t) {
3333
- for (var e = function e(_e5) {
3334
- if (!(null === (m = E[t]) || void 0 === m ? void 0 : m[_e5])) return "continue";
3335
- D.draw(S + t * i, C + _e5 * i, i, function (r, n) {
2549
+ for (var e = function e(_e4) {
2550
+ if (!(null === (C = b[t]) || void 0 === C ? void 0 : C[_e4])) return "continue";
2551
+ I.draw(D + t * a, P + _e4 * a, a, function (r, n) {
3336
2552
  var o;
3337
- return !!(null === (o = E[t + r]) || void 0 === o ? void 0 : o[_e5 + n]);
3338
- }), D._element && O && O.appendChild(D._element);
3339
- }, r = 0; r < E[t].length; r++) {
2553
+ return !!(null === (o = b[t + r]) || void 0 === o ? void 0 : o[_e4 + n]);
2554
+ }), I._element && B && B.appendChild(I._element);
2555
+ }, r = 0; r < b[t].length; r++) {
3340
2556
  e(r);
3341
2557
  }
3342
2558
  };
3343
2559
 
3344
- for (q = 0; q < E.length; q++) {
3345
- N(q);
2560
+ for (L = 0; L < b.length; L++) {
2561
+ N(L);
3346
2562
  }
3347
2563
  }
3348
2564
  });
@@ -3360,16 +2576,19 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
3360
2576
  var e = t.width,
3361
2577
  r = t.height,
3362
2578
  n = t.count,
3363
- o = t.dotSize,
3364
- i = this._options,
3365
- a = Math.floor((i.width - n * o) / 2),
3366
- s = Math.floor((i.height - n * o) / 2),
3367
- u = a + i.imageOptions.margin + (n * o - e) / 2,
3368
- c = s + i.imageOptions.margin + (n * o - r) / 2,
3369
- h = e - 2 * i.imageOptions.margin,
3370
- d = r - 2 * i.imageOptions.margin,
3371
- l = document.createElementNS("http://www.w3.org/2000/svg", "image");
3372
- l.setAttribute("href", i.image || ""), l.setAttribute("x", String(u)), l.setAttribute("y", String(c)), l.setAttribute("width", h + "px"), l.setAttribute("height", d + "px"), this._element.appendChild(l);
2579
+ o = t.dotSize;
2580
+ return w(this, void 0, void 0, function () {
2581
+ var t, i, a, s, h, c, l, d, f;
2582
+ return y(this, function (g) {
2583
+ switch (g.label) {
2584
+ case 0:
2585
+ return t = this._options, i = Math.floor((t.width - n * o) / 2), a = Math.floor((t.height - n * o) / 2), s = i + t.imageOptions.margin + (n * o - e) / 2, h = a + t.imageOptions.margin + (n * o - r) / 2, c = e - 2 * t.imageOptions.margin, l = r - 2 * t.imageOptions.margin, (d = document.createElementNS("http://www.w3.org/2000/svg", "image")).setAttribute("x", String(s)), d.setAttribute("y", String(h)), d.setAttribute("width", c + "px"), d.setAttribute("height", l + "px"), [4, u(t.image || "")];
2586
+
2587
+ case 1:
2588
+ return f = g.sent(), d.setAttribute("href", f || ""), this._element.appendChild(d), [2];
2589
+ }
2590
+ });
2591
+ });
3373
2592
  }, t.prototype._createColor = function (t) {
3374
2593
  var e = t.options,
3375
2594
  r = t.color,
@@ -3379,45 +2598,46 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
3379
2598
  a = t.height,
3380
2599
  s = t.width,
3381
2600
  u = t.name,
3382
- c = s > a ? s : a,
3383
- h = document.createElementNS("http://www.w3.org/2000/svg", "rect");
3384
-
3385
- if (h.setAttribute("x", String(o)), h.setAttribute("y", String(i)), h.setAttribute("height", String(a)), h.setAttribute("width", String(s)), h.setAttribute("clip-path", "url('#clip-path-" + u + "')"), e) {
3386
- var d;
3387
- if (e.type === C) (d = document.createElementNS("http://www.w3.org/2000/svg", "radialGradient")).setAttribute("id", u), d.setAttribute("gradientUnits", "userSpaceOnUse"), d.setAttribute("fx", String(o + s / 2)), d.setAttribute("fy", String(i + a / 2)), d.setAttribute("cx", String(o + s / 2)), d.setAttribute("cy", String(i + a / 2)), d.setAttribute("r", String(c / 2));else {
3388
- var l = ((e.rotation || 0) + n) % (2 * Math.PI),
3389
- f = (l + 2 * Math.PI) % (2 * Math.PI),
3390
- p = o + s / 2,
3391
- g = i + a / 2,
2601
+ h = s > a ? s : a,
2602
+ c = document.createElementNS("http://www.w3.org/2000/svg", "rect");
2603
+
2604
+ if (c.setAttribute("x", String(o)), c.setAttribute("y", String(i)), c.setAttribute("height", String(a)), c.setAttribute("width", String(s)), c.setAttribute("clip-path", "url('#clip-path-" + u + "')"), e) {
2605
+ var l;
2606
+ if ("radial" === e.type) (l = document.createElementNS("http://www.w3.org/2000/svg", "radialGradient")).setAttribute("id", u), l.setAttribute("gradientUnits", "userSpaceOnUse"), l.setAttribute("fx", String(o + s / 2)), l.setAttribute("fy", String(i + a / 2)), l.setAttribute("cx", String(o + s / 2)), l.setAttribute("cy", String(i + a / 2)), l.setAttribute("r", String(h / 2));else {
2607
+ var d = ((e.rotation || 0) + n) % (2 * Math.PI),
2608
+ f = (d + 2 * Math.PI) % (2 * Math.PI),
2609
+ g = o + s / 2,
2610
+ p = i + a / 2,
3392
2611
  v = o + s / 2,
3393
- y = i + a / 2;
3394
- f >= 0 && f <= .25 * Math.PI || f > 1.75 * Math.PI && f <= 2 * Math.PI ? (p -= s / 2, g -= a / 2 * Math.tan(l), v += s / 2, y += a / 2 * Math.tan(l)) : f > .25 * Math.PI && f <= .75 * Math.PI ? (g -= a / 2, p -= s / 2 / Math.tan(l), y += a / 2, v += s / 2 / Math.tan(l)) : f > .75 * Math.PI && f <= 1.25 * Math.PI ? (p += s / 2, g += a / 2 * Math.tan(l), v -= s / 2, y -= a / 2 * Math.tan(l)) : f > 1.25 * Math.PI && f <= 1.75 * Math.PI && (g += a / 2, p += s / 2 / Math.tan(l), y -= a / 2, v -= s / 2 / Math.tan(l)), (d = document.createElementNS("http://www.w3.org/2000/svg", "linearGradient")).setAttribute("id", u), d.setAttribute("gradientUnits", "userSpaceOnUse"), d.setAttribute("x1", String(Math.round(p))), d.setAttribute("y1", String(Math.round(g))), d.setAttribute("x2", String(Math.round(v))), d.setAttribute("y2", String(Math.round(y)));
2612
+ w = i + a / 2;
2613
+ f >= 0 && f <= .25 * Math.PI || f > 1.75 * Math.PI && f <= 2 * Math.PI ? (g -= s / 2, p -= a / 2 * Math.tan(d), v += s / 2, w += a / 2 * Math.tan(d)) : f > .25 * Math.PI && f <= .75 * Math.PI ? (p -= a / 2, g -= s / 2 / Math.tan(d), w += a / 2, v += s / 2 / Math.tan(d)) : f > .75 * Math.PI && f <= 1.25 * Math.PI ? (g += s / 2, p += a / 2 * Math.tan(d), v -= s / 2, w -= a / 2 * Math.tan(d)) : f > 1.25 * Math.PI && f <= 1.75 * Math.PI && (p += a / 2, g += s / 2 / Math.tan(d), w -= a / 2, v -= s / 2 / Math.tan(d)), (l = document.createElementNS("http://www.w3.org/2000/svg", "linearGradient")).setAttribute("id", u), l.setAttribute("gradientUnits", "userSpaceOnUse"), l.setAttribute("x1", String(Math.round(g))), l.setAttribute("y1", String(Math.round(p))), l.setAttribute("x2", String(Math.round(v))), l.setAttribute("y2", String(Math.round(w)));
3395
2614
  }
3396
2615
  e.colorStops.forEach(function (t) {
3397
2616
  var e = t.offset,
3398
2617
  r = t.color,
3399
2618
  n = document.createElementNS("http://www.w3.org/2000/svg", "stop");
3400
- n.setAttribute("offset", 100 * e + "%"), n.setAttribute("stop-color", r), d.appendChild(n);
3401
- }), h.setAttribute("fill", "url('#" + u + "')"), this._defs.appendChild(d);
3402
- } else r && h.setAttribute("fill", r);
2619
+ n.setAttribute("offset", 100 * e + "%"), n.setAttribute("stop-color", r), l.appendChild(n);
2620
+ }), c.setAttribute("fill", "url('#" + u + "')"), this._defs.appendChild(l);
2621
+ } else r && c.setAttribute("fill", r);
3403
2622
 
3404
- this._element.appendChild(h);
2623
+ this._element.appendChild(c);
3405
2624
  }, t;
3406
2625
  }(),
3407
- N = "canvas";
2626
+ x = "canvas";
3408
2627
 
3409
- for (var T = {}, j = 0; j <= 40; j++) {
3410
- T[j] = j;
2628
+ for (var S = {}, M = 0; M <= 40; M++) {
2629
+ S[M] = M;
3411
2630
  }
3412
2631
 
3413
- var F = {
3414
- type: N,
2632
+ var C = {
2633
+ type: x,
2634
+ shape: "square",
3415
2635
  width: 300,
3416
2636
  height: 300,
3417
2637
  data: "",
3418
2638
  margin: 0,
3419
2639
  qrOptions: {
3420
- typeNumber: T[0],
2640
+ typeNumber: S[0],
3421
2641
  mode: void 0,
3422
2642
  errorCorrectionLevel: "Q"
3423
2643
  },
@@ -3432,12 +2652,13 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
3432
2652
  color: "#000"
3433
2653
  },
3434
2654
  backgroundOptions: {
2655
+ round: 0,
3435
2656
  color: "#fff"
3436
2657
  }
3437
2658
  };
3438
2659
 
3439
- var _Q = function Q() {
3440
- return (_Q = Object.assign || function (t) {
2660
+ var _A = function A() {
2661
+ return (_A = Object.assign || function (t) {
3441
2662
  for (var e, r = 1, n = arguments.length; r < n; r++) {
3442
2663
  for (var o in e = arguments[r]) {
3443
2664
  Object.prototype.hasOwnProperty.call(e, o) && (t[o] = e[o]);
@@ -3448,30 +2669,30 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
3448
2669
  }).apply(this, arguments);
3449
2670
  };
3450
2671
 
3451
- function H(t) {
3452
- var e = _Q({}, t);
2672
+ function k(t) {
2673
+ var e = _A({}, t);
3453
2674
 
3454
2675
  if (!e.colorStops || !e.colorStops.length) throw "Field 'colorStops' is required in gradient";
3455
2676
  return e.rotation ? e.rotation = Number(e.rotation) : e.rotation = 0, e.colorStops = e.colorStops.map(function (t) {
3456
- return _Q(_Q({}, t), {
2677
+ return _A(_A({}, t), {
3457
2678
  offset: Number(t.offset)
3458
2679
  });
3459
2680
  }), e;
3460
2681
  }
3461
2682
 
3462
- function G(t) {
3463
- var e = _Q({}, t);
2683
+ function O(t) {
2684
+ var e = _A({}, t);
3464
2685
 
3465
- return e.width = Number(e.width), e.height = Number(e.height), e.margin = Number(e.margin), e.imageOptions = _Q(_Q({}, e.imageOptions), {
2686
+ return e.width = Number(e.width), e.height = Number(e.height), e.margin = Number(e.margin), e.imageOptions = _A(_A({}, e.imageOptions), {
3466
2687
  hideBackgroundDots: Boolean(e.imageOptions.hideBackgroundDots),
3467
2688
  imageSize: Number(e.imageOptions.imageSize),
3468
2689
  margin: Number(e.imageOptions.margin)
3469
- }), e.margin > Math.min(e.width, e.height) && (e.margin = Math.min(e.width, e.height)), e.dotsOptions = _Q({}, e.dotsOptions), e.dotsOptions.gradient && (e.dotsOptions.gradient = H(e.dotsOptions.gradient)), e.cornersSquareOptions && (e.cornersSquareOptions = _Q({}, e.cornersSquareOptions), e.cornersSquareOptions.gradient && (e.cornersSquareOptions.gradient = H(e.cornersSquareOptions.gradient))), e.cornersDotOptions && (e.cornersDotOptions = _Q({}, e.cornersDotOptions), e.cornersDotOptions.gradient && (e.cornersDotOptions.gradient = H(e.cornersDotOptions.gradient))), e.backgroundOptions && (e.backgroundOptions = _Q({}, e.backgroundOptions), e.backgroundOptions.gradient && (e.backgroundOptions.gradient = H(e.backgroundOptions.gradient))), e;
2690
+ }), e.margin > Math.min(e.width, e.height) && (e.margin = Math.min(e.width, e.height)), e.dotsOptions = _A({}, e.dotsOptions), e.dotsOptions.gradient && (e.dotsOptions.gradient = k(e.dotsOptions.gradient)), e.cornersSquareOptions && (e.cornersSquareOptions = _A({}, e.cornersSquareOptions), e.cornersSquareOptions.gradient && (e.cornersSquareOptions.gradient = k(e.cornersSquareOptions.gradient))), e.cornersDotOptions && (e.cornersDotOptions = _A({}, e.cornersDotOptions), e.cornersDotOptions.gradient && (e.cornersDotOptions.gradient = k(e.cornersDotOptions.gradient))), e.backgroundOptions && (e.backgroundOptions = _A({}, e.backgroundOptions), e.backgroundOptions.gradient && (e.backgroundOptions.gradient = k(e.backgroundOptions.gradient))), e;
3470
2691
  }
3471
2692
 
3472
- var X = r(192),
3473
- U = r.n(X),
3474
- Y = function Y(t, e, r, n) {
2693
+ var D = r(192),
2694
+ P = r.n(D),
2695
+ z = function z(t, e, r, n) {
3475
2696
  return new (r || (r = Promise))(function (o, i) {
3476
2697
  function a(t) {
3477
2698
  try {
@@ -3499,7 +2720,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
3499
2720
  u((n = n.apply(t, e || [])).next());
3500
2721
  });
3501
2722
  },
3502
- $ = function $(t, e) {
2723
+ B = function B(t, e) {
3503
2724
  var r,
3504
2725
  n,
3505
2726
  o,
@@ -3593,35 +2814,61 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
3593
2814
  }
3594
2815
  };
3595
2816
 
3596
- var W = function () {
2817
+ var q = function () {
3597
2818
  function t(t) {
3598
- this._options = t ? G(a(F, t)) : F, this.update();
2819
+ this._options = t ? O(a(C, t)) : C, this.update();
3599
2820
  }
3600
2821
 
3601
2822
  return t._clearContainer = function (t) {
3602
2823
  t && (t.innerHTML = "");
3603
- }, t.prototype._getQRStylingElement = function (t) {
3604
- return void 0 === t && (t = "png"), Y(this, void 0, void 0, function () {
3605
- var e, r, n;
3606
- return $(this, function (o) {
3607
- switch (o.label) {
2824
+ }, t.prototype._setupSvg = function () {
2825
+ var t = this;
2826
+
2827
+ if (this._qr) {
2828
+ var e = new _(this._options);
2829
+ this._svg = e.getElement(), this._svgDrawingPromise = e.drawQR(this._qr).then(function () {
2830
+ var r;
2831
+ t._svg && (null === (r = t._extension) || void 0 === r || r.call(t, e.getElement(), t._options));
2832
+ });
2833
+ }
2834
+ }, t.prototype._setupCanvas = function () {
2835
+ var t,
2836
+ e = this;
2837
+ this._qr && (this._canvas = document.createElement("canvas"), this._canvas.width = this._options.width, this._canvas.height = this._options.height, this._setupSvg(), this._canvasDrawingPromise = null === (t = this._svgDrawingPromise) || void 0 === t ? void 0 : t.then(function () {
2838
+ if (e._svg) {
2839
+ var t = e._svg,
2840
+ r = new XMLSerializer().serializeToString(t),
2841
+ n = "data:image/svg+xml;base64," + btoa(r),
2842
+ o = new Image();
2843
+ return new Promise(function (t) {
2844
+ o.onload = function () {
2845
+ var r, n;
2846
+ null === (n = null === (r = e._canvas) || void 0 === r ? void 0 : r.getContext("2d")) || void 0 === n || n.drawImage(o, 0, 0), t();
2847
+ }, o.src = n;
2848
+ });
2849
+ }
2850
+ }));
2851
+ }, t.prototype._getElement = function (t) {
2852
+ return void 0 === t && (t = "png"), z(this, void 0, void 0, function () {
2853
+ return B(this, function (e) {
2854
+ switch (e.label) {
3608
2855
  case 0:
3609
2856
  if (!this._qr) throw "QR code is empty";
3610
- return "svg" !== t.toLowerCase() ? [3, 2] : (r = void 0, e = void 0, this._svg && this._svgDrawingPromise ? (e = this._svg, r = this._svgDrawingPromise) : (e = new L(this._options), r = e.drawQR(this._qr)), [4, r]);
2857
+ return "svg" !== t.toLowerCase() ? [3, 2] : (this._svg && this._svgDrawingPromise || this._setupSvg(), [4, this._svgDrawingPromise]);
3611
2858
 
3612
2859
  case 1:
3613
- return o.sent(), [2, e];
2860
+ return e.sent(), [2, this._svg];
3614
2861
 
3615
2862
  case 2:
3616
- return r = void 0, n = void 0, this._canvas && this._canvasDrawingPromise ? (n = this._canvas, r = this._canvasDrawingPromise) : (n = new z(this._options), r = n.drawQR(this._qr)), [4, r];
2863
+ return this._canvas && this._canvasDrawingPromise || this._setupCanvas(), [4, this._canvasDrawingPromise];
3617
2864
 
3618
2865
  case 3:
3619
- return o.sent(), [2, n];
2866
+ return e.sent(), [2, this._canvas];
3620
2867
  }
3621
2868
  });
3622
2869
  });
3623
2870
  }, t.prototype.update = function (e) {
3624
- t._clearContainer(this._container), this._options = e ? G(a(this._options, e)) : this._options, this._options.data && (this._qr = U()(this._options.qrOptions.typeNumber, this._options.qrOptions.errorCorrectionLevel), this._qr.addData(this._options.data, this._options.qrOptions.mode || function (t) {
2871
+ t._clearContainer(this._container), this._options = e ? O(a(this._options, e)) : this._options, this._options.data && (this._qr = P()(this._options.qrOptions.typeNumber, this._options.qrOptions.errorCorrectionLevel), this._qr.addData(this._options.data, this._options.qrOptions.mode || function (t) {
3625
2872
  switch (!0) {
3626
2873
  case /^[0-9]*$/.test(t):
3627
2874
  return "Numeric";
@@ -3632,41 +2879,46 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
3632
2879
  default:
3633
2880
  return "Byte";
3634
2881
  }
3635
- }(this._options.data)), this._qr.make(), this._options.type === N ? (this._canvas = new z(this._options), this._canvasDrawingPromise = this._canvas.drawQR(this._qr), this._svgDrawingPromise = void 0, this._svg = void 0) : (this._svg = new L(this._options), this._svgDrawingPromise = this._svg.drawQR(this._qr), this._canvasDrawingPromise = void 0, this._canvas = void 0), this.append(this._container));
2882
+ }(this._options.data)), this._qr.make(), this._options.type === x ? this._setupCanvas() : this._setupSvg(), this.append(this._container));
3636
2883
  }, t.prototype.append = function (t) {
3637
2884
  if (t) {
3638
2885
  if ("function" != typeof t.appendChild) throw "Container should be a single DOM node";
3639
- this._options.type === N ? this._canvas && t.appendChild(this._canvas.getCanvas()) : this._svg && t.appendChild(this._svg.getElement()), this._container = t;
2886
+ this._options.type === x ? this._canvas && t.appendChild(this._canvas) : this._svg && t.appendChild(this._svg), this._container = t;
3640
2887
  }
2888
+ }, t.prototype.applyExtension = function (t) {
2889
+ if (!t) throw "Extension function should be defined.";
2890
+ this._extension = t, this.update();
2891
+ }, t.prototype.deleteExtension = function () {
2892
+ this._extension = void 0, this.update();
3641
2893
  }, t.prototype.getRawData = function (t) {
3642
- return void 0 === t && (t = "png"), Y(this, void 0, void 0, function () {
2894
+ return void 0 === t && (t = "png"), z(this, void 0, void 0, function () {
3643
2895
  var e, r, n;
3644
- return $(this, function (o) {
2896
+ return B(this, function (o) {
3645
2897
  switch (o.label) {
3646
2898
  case 0:
3647
2899
  if (!this._qr) throw "QR code is empty";
3648
- return [4, this._getQRStylingElement(t)];
2900
+ return [4, this._getElement(t)];
3649
2901
 
3650
2902
  case 1:
3651
- return e = o.sent(), "svg" === t.toLowerCase() ? (r = new XMLSerializer(), n = r.serializeToString(e.getElement()), [2, new Blob(['<?xml version="1.0" standalone="no"?>\r\n' + n], {
2903
+ return (e = o.sent()) ? "svg" === t.toLowerCase() ? (r = new XMLSerializer(), n = r.serializeToString(e), [2, new Blob(['<?xml version="1.0" standalone="no"?>\r\n' + n], {
3652
2904
  type: "image/svg+xml"
3653
2905
  })]) : [2, new Promise(function (r) {
3654
- return e.getCanvas().toBlob(r, "image/" + t, 1);
3655
- })];
2906
+ return e.toBlob(r, "image/" + t, 1);
2907
+ })] : [2, null];
3656
2908
  }
3657
2909
  });
3658
2910
  });
3659
2911
  }, t.prototype.download = function (t) {
3660
- return Y(this, void 0, void 0, function () {
2912
+ return z(this, void 0, void 0, function () {
3661
2913
  var e, r, n, o, i;
3662
- return $(this, function (a) {
2914
+ return B(this, function (a) {
3663
2915
  switch (a.label) {
3664
2916
  case 0:
3665
2917
  if (!this._qr) throw "QR code is empty";
3666
- return e = "png", r = "qr", "string" == typeof t ? (e = t, console.warn("Extension is deprecated as argument for 'download' method, please pass object { name: '...', extension: '...' } as argument")) : "object" == _typeof(t) && null !== t && (t.name && (r = t.name), t.extension && (e = t.extension)), [4, this._getQRStylingElement(e)];
2918
+ return e = "png", r = "qr", "string" == typeof t ? (e = t, console.warn("Extension is deprecated as argument for 'download' method, please pass object { name: '...', extension: '...' } as argument")) : "object" == _typeof(t) && null !== t && (t.name && (r = t.name), t.extension && (e = t.extension)), [4, this._getElement(e)];
3667
2919
 
3668
2920
  case 1:
3669
- return n = a.sent(), "svg" === e.toLowerCase() ? (o = new XMLSerializer(), i = '<?xml version="1.0" standalone="no"?>\r\n' + (i = o.serializeToString(n.getElement())), s("data:image/svg+xml;charset=utf-8," + encodeURIComponent(i), r + ".svg")) : s(n.getCanvas().toDataURL("image/" + e), r + "." + e), [2];
2921
+ return (n = a.sent()) ? ("svg" === e.toLowerCase() ? (o = new XMLSerializer(), i = '<?xml version="1.0" standalone="no"?>\r\n' + (i = o.serializeToString(n)), s("data:image/svg+xml;charset=utf-8," + encodeURIComponent(i), r + ".svg")) : s(n.toDataURL("image/" + e), r + "." + e), [2]) : [2];
3670
2922
  }
3671
2923
  });
3672
2924
  });
@@ -3702,12 +2954,12 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
3702
2954
  }
3703
2955
  }, r.o = function (t, e) {
3704
2956
  return Object.prototype.hasOwnProperty.call(t, e);
3705
- }, r(796);
2957
+ }, r(676);
3706
2958
  }()["default"];
3707
2959
  });
3708
2960
  }, {}],
3709
2961
  5: [function (require, module, exports) {
3710
- module.exports = "1.118.1";
2962
+ module.exports = "1.120.2";
3711
2963
  }, {}]
3712
2964
  }, {}, [3])(3);
3713
2965
  });