@plattar/plattar-qrcode 1.122.1 → 1.147.1

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.
@@ -1,33 +1,21 @@
1
1
  "use strict";
2
2
 
3
3
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
4
-
5
- function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
6
-
4
+ function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
7
5
  function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
8
-
6
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
7
+ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
9
8
  function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
10
-
11
9
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
12
-
13
10
  function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
14
-
15
11
  function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
16
-
17
12
  function _wrapNativeSuper(Class) { var _cache = typeof Map === "function" ? new Map() : undefined; _wrapNativeSuper = function _wrapNativeSuper(Class) { if (Class === null || !_isNativeFunction(Class)) return Class; if (typeof Class !== "function") { throw new TypeError("Super expression must either be null or a function"); } if (typeof _cache !== "undefined") { if (_cache.has(Class)) return _cache.get(Class); _cache.set(Class, Wrapper); } function Wrapper() { return _construct(Class, arguments, _getPrototypeOf(this).constructor); } Wrapper.prototype = Object.create(Class.prototype, { constructor: { value: Wrapper, enumerable: false, writable: true, configurable: true } }); return _setPrototypeOf(Wrapper, Class); }; return _wrapNativeSuper(Class); }
18
-
19
- function _construct(Parent, args, Class) { if (_isNativeReflectConstruct()) { _construct = Reflect.construct; } else { _construct = function _construct(Parent, args, Class) { var a = [null]; a.push.apply(a, args); var Constructor = Function.bind.apply(Parent, a); var instance = new Constructor(); if (Class) _setPrototypeOf(instance, Class.prototype); return instance; }; } return _construct.apply(null, arguments); }
20
-
13
+ function _construct(Parent, args, Class) { if (_isNativeReflectConstruct()) { _construct = Reflect.construct.bind(); } else { _construct = function _construct(Parent, args, Class) { var a = [null]; a.push.apply(a, args); var Constructor = Function.bind.apply(Parent, a); var instance = new Constructor(); if (Class) _setPrototypeOf(instance, Class.prototype); return instance; }; } return _construct.apply(null, arguments); }
21
14
  function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
22
-
23
15
  function _isNativeFunction(fn) { return Function.toString.call(fn).indexOf("[native code]") !== -1; }
24
-
25
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
26
-
27
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
28
-
16
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
17
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
29
18
  function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
30
-
31
19
  (function (f) {
32
20
  if ((typeof exports === "undefined" ? "undefined" : _typeof(exports)) === "object" && typeof module !== "undefined") {
33
21
  module.exports = f();
@@ -35,7 +23,6 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
35
23
  define([], f);
36
24
  } else {
37
25
  var g;
38
-
39
26
  if (typeof window !== "undefined") {
40
27
  g = window;
41
28
  } else if (typeof global !== "undefined") {
@@ -45,7 +32,6 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
45
32
  } else {
46
33
  g = this;
47
34
  }
48
-
49
35
  g.PlattarQRCode = f();
50
36
  }
51
37
  })(function () {
@@ -61,7 +47,6 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
61
47
  var a = new Error("Cannot find module '" + i + "'");
62
48
  throw a.code = "MODULE_NOT_FOUND", a;
63
49
  }
64
-
65
50
  var p = n[i] = {
66
51
  exports: {}
67
52
  };
@@ -70,42 +55,29 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
70
55
  return o(n || r);
71
56
  }, p, p.exports, r, e, n, t);
72
57
  }
73
-
74
58
  return n[i].exports;
75
59
  }
76
-
77
- for (var u = "function" == typeof require && require, i = 0; i < t.length; i++) {
78
- o(t[i]);
79
- }
80
-
60
+ for (var u = "function" == typeof require && require, i = 0; i < t.length; i++) o(t[i]);
81
61
  return o;
82
62
  }
83
-
84
63
  return r;
85
64
  }()({
86
65
  1: [function (require, module, exports) {
87
66
  var QRCodeStyling = require("qr-code-styling");
88
-
89
67
  var BaseElement = /*#__PURE__*/function (_HTMLElement) {
90
68
  _inherits(BaseElement, _HTMLElement);
91
-
92
69
  var _super = _createSuper(BaseElement);
93
-
94
70
  function BaseElement() {
95
71
  _classCallCheck(this, BaseElement);
96
-
97
72
  return _super.call(this);
98
73
  }
99
-
100
74
  _createClass(BaseElement, [{
101
75
  key: "connectedCallback",
102
76
  value: function connectedCallback() {
103
77
  var _this = this;
104
-
105
78
  if (this.hasAttribute("url")) {
106
79
  this.renderQRCode();
107
80
  }
108
-
109
81
  var observer = new MutationObserver(function (mutations) {
110
82
  mutations.forEach(function (mutation) {
111
83
  if (mutation.type === "attributes") {
@@ -126,7 +98,6 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
126
98
  name: "plattar-qrcode",
127
99
  extension: "png"
128
100
  };
129
-
130
101
  if (this._qrCode) {
131
102
  this._qrCode.download(opt);
132
103
  }
@@ -135,16 +106,13 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
135
106
  key: "renderQRCode",
136
107
  value: function renderQRCode() {
137
108
  var _this2 = this;
138
-
139
109
  var url = this.hasAttribute("url") ? this.getAttribute("url") : undefined;
140
-
141
110
  if (!url) {
142
111
  console.warn("PlattarQR.renderQRCode() - required attribute \"url\" is missing or invalid, QR Code will not render");
143
112
  return;
144
113
  }
145
-
146
- var width = this.hasAttribute("width") ? parseInt(this.getAttribute("width")) : 512;
147
- var height = this.hasAttribute("height") ? parseInt(this.getAttribute("height")) : 512;
114
+ var width = this.hasAttribute("width") ? this.getAttribute("width") : "100%";
115
+ var height = this.hasAttribute("height") ? this.getAttribute("height") : "100%";
148
116
  var margin = this.hasAttribute("margin") ? this.getAttribute("margin") : 0;
149
117
  var image = this.hasAttribute("image") ? this.getAttribute("image") : undefined;
150
118
  var color = this.hasAttribute("color") ? this.getAttribute("color") : "#000000";
@@ -224,30 +192,27 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
224
192
  type: "canvas"
225
193
  };
226
194
  this._options.margin = margin;
227
- this._options.image = image; // set the colors
195
+ this._options.image = image;
228
196
 
197
+ // set the colors
229
198
  this._options.dotsOptions.color = color;
230
199
  this._options.cornersDotOptions.color = color;
231
200
  this._options.cornersSquareOptions.color = color;
232
-
233
201
  switch (style) {
234
202
  case "dots":
235
203
  this._options.dotsOptions.type = "dots";
236
204
  break;
237
-
238
205
  case "default":
239
206
  default:
240
207
  this._options.dotsOptions.type = "rounded";
241
208
  }
242
-
243
209
  var shortenURL = this.hasAttribute("shorten") ? this.getAttribute("shorten") : "false";
244
-
245
210
  if (shortenURL && shortenURL.toLowerCase() === "true") {
246
211
  this._ShortenURL(url).then(function (newURL) {
247
212
  _this2._GenerateQRCode(newURL, width, height);
248
213
  })["catch"](function (_err) {
249
- console.warn(_err); // ignore error and just generate normal QR Code
250
-
214
+ console.warn(_err);
215
+ // ignore error and just generate normal QR Code
251
216
  _this2._GenerateQRCode(url, width, height);
252
217
  });
253
218
  } else {
@@ -260,18 +225,15 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
260
225
  if (!this._qrCode) {
261
226
  return;
262
227
  }
263
-
264
228
  var canvas = this._qrCode._canvas;
265
-
266
229
  if (canvas) {
267
230
  canvas.style.width = "100%";
268
231
  canvas.style.height = "100%";
269
232
  }
270
-
271
233
  if (this._divContainer) {
272
234
  var div = this._divContainer;
273
- div.style.width = width + "px";
274
- div.style.height = height + "px";
235
+ div.style.width = width;
236
+ div.style.height = height;
275
237
  }
276
238
  }
277
239
  }, {
@@ -282,22 +244,16 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
282
244
  mode: 'open'
283
245
  });
284
246
  var qrCode = this._qrCode;
285
-
286
247
  if (!qrCode) {
287
248
  var div = document.createElement("div");
288
249
  shadow.appendChild(div);
289
250
  this._divContainer = div;
290
251
  this._qrCode = new QRCodeStyling(this._options);
291
-
292
252
  this._qrCode.append(div);
293
-
294
253
  this._UpdateCanvas(width, height);
295
-
296
254
  return;
297
255
  }
298
-
299
256
  this._qrCode.update(this._options);
300
-
301
257
  this._UpdateCanvas(width, height);
302
258
  }
303
259
  }, {
@@ -309,20 +265,17 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
309
265
  key: "_ShortenURL",
310
266
  value: function _ShortenURL(url) {
311
267
  var _this3 = this;
312
-
313
268
  return new Promise(function (accept, reject) {
314
269
  if (!_this3._IsFetchAPISupported()) {
315
270
  return reject(new Error("PlattarQR._ShortenURL() - fetch api not supported, cannot proceed"));
316
271
  }
317
-
318
272
  try {
319
273
  var b64 = btoa(url);
320
- var endpoint = "https://c.plattar.space/api/v2/shorten?base64=" + b64;
274
+ var endpoint = "https://c2.plattar.space/api/v2/shorten?base64=" + b64;
321
275
  fetch(endpoint).then(function (response) {
322
276
  if (!response.ok) {
323
277
  throw new Error("PlattarQR._ShortenURL() - response was invalid");
324
278
  }
325
-
326
279
  return response.text();
327
280
  }).then(function (text) {
328
281
  return accept(text);
@@ -335,31 +288,23 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
335
288
  });
336
289
  }
337
290
  }]);
338
-
339
291
  return BaseElement;
340
292
  }( /*#__PURE__*/_wrapNativeSuper(HTMLElement));
341
-
342
293
  module.exports = BaseElement;
343
294
  }, {
344
295
  "qr-code-styling": 4
345
296
  }],
346
297
  2: [function (require, module, exports) {
347
298
  var BaseElement = require("./base/base-element.js");
348
-
349
299
  var QRCodeElement = /*#__PURE__*/function (_BaseElement) {
350
300
  _inherits(QRCodeElement, _BaseElement);
351
-
352
301
  var _super2 = _createSuper(QRCodeElement);
353
-
354
302
  function QRCodeElement() {
355
303
  _classCallCheck(this, QRCodeElement);
356
-
357
304
  return _super2.call(this);
358
305
  }
359
-
360
306
  return _createClass(QRCodeElement);
361
307
  }(BaseElement);
362
-
363
308
  module.exports = QRCodeElement;
364
309
  }, {
365
310
  "./base/base-element.js": 1
@@ -368,15 +313,12 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
368
313
  "use strict";
369
314
 
370
315
  var QRCodeElement = require("./elements/qrcode-element.js");
371
-
372
316
  var Version = require("./version");
373
-
374
317
  if (customElements) {
375
318
  if (customElements.get("plattar-qrcode") === undefined) {
376
319
  customElements.define("plattar-qrcode", QRCodeElement);
377
320
  }
378
321
  }
379
-
380
322
  console.log("using @plattar/plattar-qrcode v" + Version);
381
323
  module.exports = {
382
324
  version: Version
@@ -391,1342 +333,987 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
391
333
  }(self, function () {
392
334
  return function () {
393
335
  var t = {
394
- 192: function _(t, e) {
395
- var r,
336
+ 192: function _(t, e) {
337
+ var r,
396
338
  n,
397
339
  o = function () {
398
- var t = function t(_t, e) {
399
- var r = _t,
400
- n = a[e],
401
- o = null,
402
- i = 0,
403
- u = null,
404
- v = [],
405
- w = {},
406
- m = function m(t, e) {
407
- o = function (t) {
408
- for (var e = new Array(t), r = 0; r < t; r += 1) {
409
- e[r] = new Array(t);
410
-
411
- for (var n = 0; n < t; n += 1) {
412
- e[r][n] = null;
340
+ var t = function t(_t, e) {
341
+ var r = _t,
342
+ n = a[e],
343
+ o = null,
344
+ i = 0,
345
+ u = null,
346
+ v = [],
347
+ w = {},
348
+ m = function m(t, e) {
349
+ o = function (t) {
350
+ for (var e = new Array(t), r = 0; r < t; r += 1) {
351
+ e[r] = new Array(t);
352
+ for (var n = 0; n < t; n += 1) e[r][n] = null;
353
+ }
354
+ return e;
355
+ }(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);
356
+ },
357
+ b = function b(t, e) {
358
+ for (var r = -1; r <= 7; r += 1) if (!(t + r <= -1 || i <= t + r)) for (var n = -1; n <= 7; n += 1) 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);
359
+ },
360
+ _ = function _() {
361
+ for (var t = 8; t < i - 8; t += 1) null == o[t][6] && (o[t][6] = t % 2 == 0);
362
+ for (var e = 8; e < i - 8; e += 1) null == o[6][e] && (o[6][e] = e % 2 == 0);
363
+ },
364
+ x = function x() {
365
+ for (var t = s.getPatternPosition(r), e = 0; e < t.length; e += 1) for (var n = 0; n < t.length; n += 1) {
366
+ var i = t[e],
367
+ a = t[n];
368
+ if (null == o[i][a]) for (var u = -2; u <= 2; u += 1) for (var h = -2; h <= 2; h += 1) o[i + u][a + h] = -2 == u || 2 == u || -2 == h || 2 == h || 0 == u && 0 == h;
369
+ }
370
+ },
371
+ S = function S(t) {
372
+ for (var e = s.getBCHTypeNumber(r), n = 0; n < 18; n += 1) {
373
+ var a = !t && 1 == (e >> n & 1);
374
+ o[Math.floor(n / 3)][n % 3 + i - 8 - 3] = a;
375
+ }
376
+ for (n = 0; n < 18; n += 1) a = !t && 1 == (e >> n & 1), o[n % 3 + i - 8 - 3][Math.floor(n / 3)] = a;
377
+ },
378
+ M = function M(t, e) {
379
+ for (var r = n << 3 | e, a = s.getBCHTypeInfo(r), u = 0; u < 15; u += 1) {
380
+ var h = !t && 1 == (a >> u & 1);
381
+ u < 6 ? o[u][8] = h : u < 8 ? o[u + 1][8] = h : o[i - 15 + u][8] = h;
382
+ }
383
+ for (u = 0; u < 15; u += 1) 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;
384
+ o[i - 8][8] = !t;
385
+ },
386
+ C = function C(t, e) {
387
+ for (var r = -1, n = i - 1, a = 7, u = 0, h = s.getMaskFunction(e), c = i - 1; c > 0; c -= 2) for (6 == c && (c -= 1);;) {
388
+ for (var l = 0; l < 2; l += 1) if (null == o[n][c - l]) {
389
+ var d = !1;
390
+ 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);
391
+ }
392
+ if ((n += r) < 0 || i <= n) {
393
+ n -= r, r = -r;
394
+ break;
395
+ }
396
+ }
397
+ },
398
+ A = function A(t, e, r) {
399
+ for (var n = c.getRSBlocks(t, e), o = l(), i = 0; i < r.length; i += 1) {
400
+ var a = r[i];
401
+ o.put(a.getMode(), 4), o.put(a.getLength(), s.getLengthInBits(a.getMode(), t)), a.write(o);
402
+ }
403
+ var u = 0;
404
+ for (i = 0; i < n.length; i += 1) u += n[i].dataCount;
405
+ if (o.getLengthInBits() > 8 * u) throw "code length overflow. (" + o.getLengthInBits() + ">" + 8 * u + ")";
406
+ for (o.getLengthInBits() + 4 <= 8 * u && o.put(0, 4); o.getLengthInBits() % 8 != 0;) o.putBit(!1);
407
+ for (; !(o.getLengthInBits() >= 8 * u || (o.put(236, 8), o.getLengthInBits() >= 8 * u));) o.put(17, 8);
408
+ return function (t, e) {
409
+ 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) {
410
+ var c = e[u].dataCount,
411
+ l = e[u].totalCount - c;
412
+ n = Math.max(n, c), o = Math.max(o, l), i[u] = new Array(c);
413
+ for (var d = 0; d < i[u].length; d += 1) i[u][d] = 255 & t.getBuffer()[d + r];
414
+ r += c;
415
+ var f = s.getErrorCorrectPolynomial(l),
416
+ g = h(i[u], f.getLength() - 1).mod(f);
417
+ for (a[u] = new Array(f.getLength() - 1), d = 0; d < a[u].length; d += 1) {
418
+ var p = d + g.getLength() - a[u].length;
419
+ a[u][d] = p >= 0 ? g.getAt(p) : 0;
420
+ }
421
+ }
422
+ var v = 0;
423
+ for (d = 0; d < e.length; d += 1) v += e[d].totalCount;
424
+ var w = new Array(v),
425
+ y = 0;
426
+ for (d = 0; d < n; d += 1) for (u = 0; u < e.length; u += 1) d < i[u].length && (w[y] = i[u][d], y += 1);
427
+ for (d = 0; d < o; d += 1) for (u = 0; u < e.length; u += 1) d < a[u].length && (w[y] = a[u][d], y += 1);
428
+ return w;
429
+ }(o, n);
430
+ };
431
+ w.addData = function (t, e) {
432
+ var r = null;
433
+ switch (e = e || "Byte") {
434
+ case "Numeric":
435
+ r = d(t);
436
+ break;
437
+ case "Alphanumeric":
438
+ r = f(t);
439
+ break;
440
+ case "Byte":
441
+ r = g(t);
442
+ break;
443
+ case "Kanji":
444
+ r = p(t);
445
+ break;
446
+ default:
447
+ throw "mode:" + e;
413
448
  }
414
- }
415
-
416
- return e;
417
- }(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);
418
- },
419
- b = function b(t, e) {
420
- for (var r = -1; r <= 7; r += 1) {
421
- if (!(t + r <= -1 || i <= t + r)) for (var n = -1; n <= 7; n += 1) {
422
- 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);
423
- }
424
- }
425
- },
426
- _ = function _() {
427
- for (var t = 8; t < i - 8; t += 1) {
428
- null == o[t][6] && (o[t][6] = t % 2 == 0);
429
- }
430
-
431
- for (var e = 8; e < i - 8; e += 1) {
432
- null == o[6][e] && (o[6][e] = e % 2 == 0);
433
- }
434
- },
435
- x = function x() {
436
- for (var t = s.getPatternPosition(r), e = 0; e < t.length; e += 1) {
437
- for (var n = 0; n < t.length; n += 1) {
438
- var i = t[e],
439
- a = t[n];
440
- if (null == o[i][a]) for (var u = -2; u <= 2; u += 1) {
441
- for (var h = -2; h <= 2; h += 1) {
442
- o[i + u][a + h] = -2 == u || 2 == u || -2 == h || 2 == h || 0 == u && 0 == h;
449
+ v.push(r), u = null;
450
+ }, w.isDark = function (t, e) {
451
+ if (t < 0 || i <= t || e < 0 || i <= e) throw t + "," + e;
452
+ return o[t][e];
453
+ }, w.getModuleCount = function () {
454
+ return i;
455
+ }, w.make = function () {
456
+ if (r < 1) {
457
+ for (var t = 1; t < 40; t++) {
458
+ for (var e = c.getRSBlocks(t, n), o = l(), i = 0; i < v.length; i++) {
459
+ var a = v[i];
460
+ o.put(a.getMode(), 4), o.put(a.getLength(), s.getLengthInBits(a.getMode(), t)), a.write(o);
461
+ }
462
+ var u = 0;
463
+ for (i = 0; i < e.length; i++) u += e[i].dataCount;
464
+ if (o.getLengthInBits() <= 8 * u) break;
443
465
  }
466
+ r = t;
444
467
  }
445
- }
446
- }
447
- },
448
- S = function S(t) {
449
- for (var e = s.getBCHTypeNumber(r), n = 0; n < 18; n += 1) {
450
- var a = !t && 1 == (e >> n & 1);
451
- o[Math.floor(n / 3)][n % 3 + i - 8 - 3] = a;
452
- }
453
-
454
- for (n = 0; n < 18; n += 1) {
455
- a = !t && 1 == (e >> n & 1), o[n % 3 + i - 8 - 3][Math.floor(n / 3)] = a;
456
- }
457
- },
458
- M = function M(t, e) {
459
- for (var r = n << 3 | e, a = s.getBCHTypeInfo(r), u = 0; u < 15; u += 1) {
460
- var h = !t && 1 == (a >> u & 1);
461
- u < 6 ? o[u][8] = h : u < 8 ? o[u + 1][8] = h : o[i - 15 + u][8] = h;
462
- }
463
-
464
- for (u = 0; u < 15; u += 1) {
465
- 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;
466
- }
467
-
468
- o[i - 8][8] = !t;
469
- },
470
- C = function C(t, e) {
471
- for (var r = -1, n = i - 1, a = 7, u = 0, h = s.getMaskFunction(e), c = i - 1; c > 0; c -= 2) {
472
- for (6 == c && (c -= 1);;) {
473
- for (var l = 0; l < 2; l += 1) {
474
- if (null == o[n][c - l]) {
475
- var d = !1;
476
- 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);
468
+ m(!1, function () {
469
+ for (var t = 0, e = 0, r = 0; r < 8; r += 1) {
470
+ m(!0, r);
471
+ var n = s.getLostPoint(w);
472
+ (0 == r || t > n) && (t = n, e = r);
477
473
  }
474
+ return e;
475
+ }());
476
+ }, w.createTableTag = function (t, e) {
477
+ t = t || 2;
478
+ var r = "";
479
+ 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>";
480
+ for (var n = 0; n < w.getModuleCount(); n += 1) {
481
+ r += "<tr>";
482
+ for (var o = 0; o < w.getModuleCount(); o += 1) 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 += '"/>';
483
+ r += "</tr>";
478
484
  }
479
-
480
- if ((n += r) < 0 || i <= n) {
481
- n -= r, r = -r;
482
- break;
485
+ return (r += "</tbody>") + "</table>";
486
+ }, w.createSvgTag = function (t, e, r, n) {
487
+ var o = {};
488
+ "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 ? {
489
+ text: r
490
+ } : r || {}).text = r.text || null, r.id = r.text ? r.id || "qrcode-description" : null, (n = "string" == typeof n ? {
491
+ text: n
492
+ } : n || {}).text = n.text || null, n.id = n.text ? n.id || "qrcode-title" : null;
493
+ var i,
494
+ a,
495
+ s,
496
+ u,
497
+ h = w.getModuleCount() * t + 2 * e,
498
+ c = "";
499
+ 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) for (s = a * t + e, i = 0; i < w.getModuleCount(); i += 1) w.isDark(a, i) && (c += "M" + (i * t + e) + "," + s + u);
500
+ return (c += '" stroke="transparent" fill="black"/>') + "</svg>";
501
+ }, w.createDataURL = function (t, e) {
502
+ t = t || 2, e = void 0 === e ? 4 * t : e;
503
+ var r = w.getModuleCount() * t + 2 * e,
504
+ n = e,
505
+ o = r - e;
506
+ return y(r, r, function (e, r) {
507
+ if (n <= e && e < o && n <= r && r < o) {
508
+ var i = Math.floor((e - n) / t),
509
+ a = Math.floor((r - n) / t);
510
+ return w.isDark(a, i) ? 0 : 1;
511
+ }
512
+ return 1;
513
+ });
514
+ }, w.createImgTag = function (t, e, r) {
515
+ t = t || 2, e = void 0 === e ? 4 * t : e;
516
+ var n = w.getModuleCount() * t + 2 * e,
517
+ o = "";
518
+ 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 + "/>";
519
+ };
520
+ var k = function k(t) {
521
+ for (var e = "", r = 0; r < t.length; r += 1) {
522
+ var n = t.charAt(r);
523
+ switch (n) {
524
+ case "<":
525
+ e += "&lt;";
526
+ break;
527
+ case ">":
528
+ e += "&gt;";
529
+ break;
530
+ case "&":
531
+ e += "&amp;";
532
+ break;
533
+ case '"':
534
+ e += "&quot;";
535
+ break;
536
+ default:
537
+ e += n;
538
+ }
483
539
  }
484
- }
485
- }
486
- },
487
- A = function A(t, e, r) {
488
- for (var n = c.getRSBlocks(t, e), o = l(), i = 0; i < r.length; i += 1) {
489
- var a = r[i];
490
- o.put(a.getMode(), 4), o.put(a.getLength(), s.getLengthInBits(a.getMode(), t)), a.write(o);
491
- }
492
-
493
- var u = 0;
494
-
495
- for (i = 0; i < n.length; i += 1) {
496
- u += n[i].dataCount;
497
- }
498
-
499
- if (o.getLengthInBits() > 8 * u) throw "code length overflow. (" + o.getLengthInBits() + ">" + 8 * u + ")";
500
-
501
- for (o.getLengthInBits() + 4 <= 8 * u && o.put(0, 4); o.getLengthInBits() % 8 != 0;) {
502
- o.putBit(!1);
503
- }
504
-
505
- for (; !(o.getLengthInBits() >= 8 * u || (o.put(236, 8), o.getLengthInBits() >= 8 * u));) {
506
- o.put(17, 8);
507
- }
508
-
509
- return function (t, e) {
510
- 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) {
511
- var c = e[u].dataCount,
512
- l = e[u].totalCount - c;
513
- n = Math.max(n, c), o = Math.max(o, l), i[u] = new Array(c);
514
-
515
- for (var d = 0; d < i[u].length; d += 1) {
516
- i[u][d] = 255 & t.getBuffer()[d + r];
540
+ return e;
541
+ };
542
+ return w.createASCII = function (t, e) {
543
+ if ((t = t || 1) < 2) return function (t) {
544
+ t = void 0 === t ? 2 : t;
545
+ var e,
546
+ r,
547
+ n,
548
+ o,
549
+ i,
550
+ a = 1 * w.getModuleCount() + 2 * t,
551
+ s = t,
552
+ u = a - t,
553
+ h = {
554
+ "██": "█",
555
+ " ": "",
556
+ " █": "▄",
557
+ " ": " "
558
+ },
559
+ c = {
560
+ "██": "▀",
561
+ "█ ": "▀",
562
+ " █": " ",
563
+ " ": " "
564
+ },
565
+ l = "";
566
+ for (e = 0; e < a; e += 2) {
567
+ for (n = Math.floor((e - s) / 1), o = Math.floor((e + 1 - s) / 1), r = 0; r < a; r += 1) 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];
568
+ l += "\n";
569
+ }
570
+ return a % 2 && t > 0 ? l.substring(0, l.length - a - 1) + Array(a + 1).join("▀") : l.substring(0, l.length - 1);
571
+ }(e);
572
+ t -= 1, e = void 0 === e ? 2 * t : e;
573
+ var r,
574
+ n,
575
+ o,
576
+ i,
577
+ a = w.getModuleCount() * t + 2 * e,
578
+ s = e,
579
+ u = a - e,
580
+ h = Array(t + 1).join("██"),
581
+ c = Array(t + 1).join(" "),
582
+ l = "",
583
+ d = "";
584
+ for (r = 0; r < a; r += 1) {
585
+ for (o = Math.floor((r - s) / t), d = "", n = 0; n < a; n += 1) i = 1, s <= n && n < u && s <= r && r < u && w.isDark(o, Math.floor((n - s) / t)) && (i = 0), d += i ? h : c;
586
+ for (o = 0; o < t; o += 1) l += d + "\n";
517
587
  }
518
-
519
- r += c;
520
- var f = s.getErrorCorrectPolynomial(l),
521
- g = h(i[u], f.getLength() - 1).mod(f);
522
-
523
- for (a[u] = new Array(f.getLength() - 1), d = 0; d < a[u].length; d += 1) {
524
- var p = d + g.getLength() - a[u].length;
525
- a[u][d] = p >= 0 ? g.getAt(p) : 0;
588
+ return l.substring(0, l.length - 1);
589
+ }, w.renderTo2dContext = function (t, e) {
590
+ e = e || 2;
591
+ for (var r = w.getModuleCount(), n = 0; n < r; n++) for (var o = 0; o < r; o++) t.fillStyle = w.isDark(n, o) ? "black" : "white", t.fillRect(n * e, o * e, e, e);
592
+ }, w;
593
+ };
594
+ t.stringToBytes = (t.stringToBytesFuncs = {
595
+ "default": function _default(t) {
596
+ for (var e = [], r = 0; r < t.length; r += 1) {
597
+ var n = t.charCodeAt(r);
598
+ e.push(255 & n);
526
599
  }
600
+ return e;
527
601
  }
528
-
529
- var v = 0;
530
-
531
- for (d = 0; d < e.length; d += 1) {
532
- v += e[d].totalCount;
533
- }
534
-
535
- var w = new Array(v),
536
- y = 0;
537
-
538
- for (d = 0; d < n; d += 1) {
539
- for (u = 0; u < e.length; u += 1) {
540
- d < i[u].length && (w[y] = i[u][d], y += 1);
602
+ })["default"], t.createStringToBytes = function (t, e) {
603
+ var r = function () {
604
+ for (var r = w(t), n = function n() {
605
+ var t = r.read();
606
+ if (-1 == t) throw "eof";
607
+ return t;
608
+ }, o = 0, i = {};;) {
609
+ var a = r.read();
610
+ if (-1 == a) break;
611
+ var s = n(),
612
+ u = n() << 8 | n();
613
+ i[String.fromCharCode(a << 8 | s)] = u, o += 1;
614
+ }
615
+ if (o != e) throw o + " != " + e;
616
+ return i;
617
+ }(),
618
+ n = "?".charCodeAt(0);
619
+ return function (t) {
620
+ for (var e = [], o = 0; o < t.length; o += 1) {
621
+ var i = t.charCodeAt(o);
622
+ if (i < 128) e.push(i);else {
623
+ var a = r[t.charAt(o)];
624
+ "number" == typeof a ? (255 & a) == a ? e.push(a) : (e.push(a >>> 8), e.push(255 & a)) : e.push(n);
625
+ }
541
626
  }
542
- }
543
-
544
- for (d = 0; d < o; d += 1) {
545
- for (u = 0; u < e.length; u += 1) {
546
- d < a[u].length && (w[y] = a[u][d], y += 1);
627
+ return e;
628
+ };
629
+ };
630
+ var e,
631
+ r,
632
+ n,
633
+ o,
634
+ i,
635
+ a = {
636
+ L: 1,
637
+ M: 0,
638
+ Q: 3,
639
+ H: 2
640
+ },
641
+ s = (e = [[], [6, 18], [6, 22], [6, 26], [6, 30], [6, 34], [6, 22, 38], [6, 24, 42], [6, 26, 46], [6, 28, 50], [6, 30, 54], [6, 32, 58], [6, 34, 62], [6, 26, 46, 66], [6, 26, 48, 70], [6, 26, 50, 74], [6, 30, 54, 78], [6, 30, 56, 82], [6, 30, 58, 86], [6, 34, 62, 90], [6, 28, 50, 72, 94], [6, 26, 50, 74, 98], [6, 30, 54, 78, 102], [6, 28, 54, 80, 106], [6, 32, 58, 84, 110], [6, 30, 58, 86, 114], [6, 34, 62, 90, 118], [6, 26, 50, 74, 98, 122], [6, 30, 54, 78, 102, 126], [6, 26, 52, 78, 104, 130], [6, 30, 56, 82, 108, 134], [6, 34, 60, 86, 112, 138], [6, 30, 58, 86, 114, 142], [6, 34, 62, 90, 118, 146], [6, 30, 54, 78, 102, 126, 150], [6, 24, 50, 76, 102, 128, 154], [6, 28, 54, 80, 106, 132, 158], [6, 32, 58, 84, 110, 136, 162], [6, 26, 54, 82, 110, 138, 166], [6, 30, 58, 86, 114, 142, 170]], r = 1335, n = 7973, i = function i(t) {
642
+ for (var e = 0; 0 != t;) e += 1, t >>>= 1;
643
+ return e;
644
+ }, (o = {}).getBCHTypeInfo = function (t) {
645
+ for (var e = t << 10; i(e) - i(r) >= 0;) e ^= r << i(e) - i(r);
646
+ return 21522 ^ (t << 10 | e);
647
+ }, o.getBCHTypeNumber = function (t) {
648
+ for (var e = t << 12; i(e) - i(n) >= 0;) e ^= n << i(e) - i(n);
649
+ return t << 12 | e;
650
+ }, o.getPatternPosition = function (t) {
651
+ return e[t - 1];
652
+ }, o.getMaskFunction = function (t) {
653
+ switch (t) {
654
+ case 0:
655
+ return function (t, e) {
656
+ return (t + e) % 2 == 0;
657
+ };
658
+ case 1:
659
+ return function (t, e) {
660
+ return t % 2 == 0;
661
+ };
662
+ case 2:
663
+ return function (t, e) {
664
+ return e % 3 == 0;
665
+ };
666
+ case 3:
667
+ return function (t, e) {
668
+ return (t + e) % 3 == 0;
669
+ };
670
+ case 4:
671
+ return function (t, e) {
672
+ return (Math.floor(t / 2) + Math.floor(e / 3)) % 2 == 0;
673
+ };
674
+ case 5:
675
+ return function (t, e) {
676
+ return t * e % 2 + t * e % 3 == 0;
677
+ };
678
+ case 6:
679
+ return function (t, e) {
680
+ return (t * e % 2 + t * e % 3) % 2 == 0;
681
+ };
682
+ case 7:
683
+ return function (t, e) {
684
+ return (t * e % 3 + (t + e) % 2) % 2 == 0;
685
+ };
686
+ default:
687
+ throw "bad maskPattern:" + t;
547
688
  }
548
- }
549
-
550
- return w;
551
- }(o, n);
552
- };
553
-
554
- w.addData = function (t, e) {
555
- var r = null;
556
-
557
- switch (e = e || "Byte") {
558
- case "Numeric":
559
- r = d(t);
560
- break;
561
-
562
- case "Alphanumeric":
563
- r = f(t);
564
- break;
565
-
566
- case "Byte":
567
- r = g(t);
568
- break;
569
-
570
- case "Kanji":
571
- r = p(t);
572
- break;
573
-
574
- default:
575
- throw "mode:" + e;
576
- }
577
-
578
- v.push(r), u = null;
579
- }, w.isDark = function (t, e) {
580
- if (t < 0 || i <= t || e < 0 || i <= e) throw t + "," + e;
581
- return o[t][e];
582
- }, w.getModuleCount = function () {
583
- return i;
584
- }, w.make = function () {
585
- if (r < 1) {
586
- for (var t = 1; t < 40; t++) {
587
- for (var e = c.getRSBlocks(t, n), o = l(), i = 0; i < v.length; i++) {
588
- var a = v[i];
589
- o.put(a.getMode(), 4), o.put(a.getLength(), s.getLengthInBits(a.getMode(), t)), a.write(o);
689
+ }, o.getErrorCorrectPolynomial = function (t) {
690
+ for (var e = h([1], 0), r = 0; r < t; r += 1) e = e.multiply(h([1, u.gexp(r)], 0));
691
+ return e;
692
+ }, o.getLengthInBits = function (t, e) {
693
+ if (1 <= e && e < 10) switch (t) {
694
+ case 1:
695
+ return 10;
696
+ case 2:
697
+ return 9;
698
+ case 4:
699
+ case 8:
700
+ return 8;
701
+ default:
702
+ throw "mode:" + t;
703
+ } else if (e < 27) switch (t) {
704
+ case 1:
705
+ return 12;
706
+ case 2:
707
+ return 11;
708
+ case 4:
709
+ return 16;
710
+ case 8:
711
+ return 10;
712
+ default:
713
+ throw "mode:" + t;
714
+ } else {
715
+ if (!(e < 41)) throw "type:" + e;
716
+ switch (t) {
717
+ case 1:
718
+ return 14;
719
+ case 2:
720
+ return 13;
721
+ case 4:
722
+ return 16;
723
+ case 8:
724
+ return 12;
725
+ default:
726
+ throw "mode:" + t;
727
+ }
590
728
  }
591
-
592
- var u = 0;
593
-
594
- for (i = 0; i < e.length; i++) {
595
- u += e[i].dataCount;
729
+ }, o.getLostPoint = function (t) {
730
+ for (var e = t.getModuleCount(), r = 0, n = 0; n < e; n += 1) for (var o = 0; o < e; o += 1) {
731
+ for (var i = 0, a = t.isDark(n, o), s = -1; s <= 1; s += 1) if (!(n + s < 0 || e <= n + s)) for (var u = -1; u <= 1; u += 1) o + u < 0 || e <= o + u || 0 == s && 0 == u || a == t.isDark(n + s, o + u) && (i += 1);
732
+ i > 5 && (r += 3 + i - 5);
596
733
  }
597
-
598
- if (o.getLengthInBits() <= 8 * u) break;
599
- }
600
-
601
- r = t;
602
- }
603
-
604
- m(!1, function () {
605
- for (var t = 0, e = 0, r = 0; r < 8; r += 1) {
606
- m(!0, r);
607
- var n = s.getLostPoint(w);
608
- (0 == r || t > n) && (t = n, e = r);
609
- }
610
-
611
- return e;
612
- }());
613
- }, w.createTableTag = function (t, e) {
614
- t = t || 2;
615
- var r = "";
616
- 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>";
617
-
618
- for (var n = 0; n < w.getModuleCount(); n += 1) {
619
- r += "<tr>";
620
-
621
- for (var o = 0; o < w.getModuleCount(); o += 1) {
622
- 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 += '"/>';
623
- }
624
-
625
- r += "</tr>";
626
- }
627
-
628
- return (r += "</tbody>") + "</table>";
629
- }, w.createSvgTag = function (t, e, r, n) {
630
- var o = {};
631
- "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 ? {
632
- text: r
633
- } : r || {}).text = r.text || null, r.id = r.text ? r.id || "qrcode-description" : null, (n = "string" == typeof n ? {
634
- text: n
635
- } : n || {}).text = n.text || null, n.id = n.text ? n.id || "qrcode-title" : null;
636
- var i,
637
- a,
638
- s,
639
- u,
640
- h = w.getModuleCount() * t + 2 * e,
641
- c = "";
642
-
643
- 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) {
644
- for (s = a * t + e, i = 0; i < w.getModuleCount(); i += 1) {
645
- w.isDark(a, i) && (c += "M" + (i * t + e) + "," + s + u);
646
- }
647
- }
648
-
649
- return (c += '" stroke="transparent" fill="black"/>') + "</svg>";
650
- }, w.createDataURL = function (t, e) {
651
- t = t || 2, e = void 0 === e ? 4 * t : e;
652
- var r = w.getModuleCount() * t + 2 * e,
653
- n = e,
654
- o = r - e;
655
- return y(r, r, function (e, r) {
656
- if (n <= e && e < o && n <= r && r < o) {
657
- var i = Math.floor((e - n) / t),
658
- a = Math.floor((r - n) / t);
659
- return w.isDark(a, i) ? 0 : 1;
660
- }
661
-
662
- return 1;
663
- });
664
- }, w.createImgTag = function (t, e, r) {
665
- t = t || 2, e = void 0 === e ? 4 * t : e;
666
- var n = w.getModuleCount() * t + 2 * e,
667
- o = "";
668
- 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 + "/>";
669
- };
670
-
671
- var k = function k(t) {
672
- for (var e = "", r = 0; r < t.length; r += 1) {
673
- var n = t.charAt(r);
674
-
675
- switch (n) {
676
- case "<":
677
- e += "&lt;";
678
- break;
679
-
680
- case ">":
681
- e += "&gt;";
682
- break;
683
-
684
- case "&":
685
- e += "&amp;";
686
- break;
687
-
688
- case '"':
689
- e += "&quot;";
690
- break;
691
-
692
- default:
693
- e += n;
694
- }
734
+ for (n = 0; n < e - 1; n += 1) for (o = 0; o < e - 1; o += 1) {
735
+ var h = 0;
736
+ 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);
737
+ }
738
+ for (n = 0; n < e; n += 1) for (o = 0; o < e - 6; o += 1) t.isDark(n, o) && !t.isDark(n, o + 1) && t.isDark(n, o + 2) && t.isDark(n, o + 3) && t.isDark(n, o + 4) && !t.isDark(n, o + 5) && t.isDark(n, o + 6) && (r += 40);
739
+ for (o = 0; o < e; o += 1) for (n = 0; n < e - 6; n += 1) t.isDark(n, o) && !t.isDark(n + 1, o) && t.isDark(n + 2, o) && t.isDark(n + 3, o) && t.isDark(n + 4, o) && !t.isDark(n + 5, o) && t.isDark(n + 6, o) && (r += 40);
740
+ var c = 0;
741
+ for (o = 0; o < e; o += 1) for (n = 0; n < e; n += 1) t.isDark(n, o) && (c += 1);
742
+ return r + Math.abs(100 * c / e / e - 50) / 5 * 10;
743
+ }, o),
744
+ u = function () {
745
+ for (var t = new Array(256), e = new Array(256), r = 0; r < 8; r += 1) t[r] = 1 << r;
746
+ for (r = 8; r < 256; r += 1) t[r] = t[r - 4] ^ t[r - 5] ^ t[r - 6] ^ t[r - 8];
747
+ for (r = 0; r < 255; r += 1) e[t[r]] = r;
748
+ return {
749
+ glog: function glog(t) {
750
+ if (t < 1) throw "glog(" + t + ")";
751
+ return e[t];
752
+ },
753
+ gexp: function gexp(e) {
754
+ for (; e < 0;) e += 255;
755
+ for (; e >= 256;) e -= 255;
756
+ return t[e];
757
+ }
758
+ };
759
+ }();
760
+ function h(t, e) {
761
+ if (void 0 === t.length) throw t.length + "/" + e;
762
+ var r = function () {
763
+ for (var r = 0; r < t.length && 0 == t[r];) r += 1;
764
+ for (var n = new Array(t.length - r + e), o = 0; o < t.length - r; o += 1) n[o] = t[o + r];
765
+ return n;
766
+ }(),
767
+ n = {
768
+ getAt: function getAt(t) {
769
+ return r[t];
770
+ },
771
+ getLength: function getLength() {
772
+ return r.length;
773
+ },
774
+ multiply: function multiply(t) {
775
+ for (var e = new Array(n.getLength() + t.getLength() - 1), r = 0; r < n.getLength(); r += 1) for (var o = 0; o < t.getLength(); o += 1) e[r + o] ^= u.gexp(u.glog(n.getAt(r)) + u.glog(t.getAt(o)));
776
+ return h(e, 0);
777
+ },
778
+ mod: function mod(t) {
779
+ if (n.getLength() - t.getLength() < 0) return n;
780
+ for (var e = u.glog(n.getAt(0)) - u.glog(t.getAt(0)), r = new Array(n.getLength()), o = 0; o < n.getLength(); o += 1) r[o] = n.getAt(o);
781
+ for (o = 0; o < t.getLength(); o += 1) r[o] ^= u.gexp(u.glog(t.getAt(o)) + e);
782
+ return h(r, 0).mod(t);
783
+ }
784
+ };
785
+ return n;
695
786
  }
696
-
697
- return e;
698
- };
699
-
700
- return w.createASCII = function (t, e) {
701
- if ((t = t || 1) < 2) return function (t) {
702
- t = void 0 === t ? 2 : t;
703
- var e,
704
- r,
705
- n,
706
- o,
707
- i,
708
- a = 1 * w.getModuleCount() + 2 * t,
709
- s = t,
710
- u = a - t,
711
- h = {
712
- "██": "█",
713
- "█ ": "▀",
714
- " █": "▄",
715
- " ": " "
787
+ var c = function () {
788
+ 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]],
789
+ e = function e(t, _e) {
790
+ var r = {};
791
+ return r.totalCount = t, r.dataCount = _e, r;
792
+ },
793
+ r = {
794
+ getRSBlocks: function getRSBlocks(r, n) {
795
+ var o = function (e, r) {
796
+ switch (r) {
797
+ case a.L:
798
+ return t[4 * (e - 1) + 0];
799
+ case a.M:
800
+ return t[4 * (e - 1) + 1];
801
+ case a.Q:
802
+ return t[4 * (e - 1) + 2];
803
+ case a.H:
804
+ return t[4 * (e - 1) + 3];
805
+ default:
806
+ return;
807
+ }
808
+ }(r, n);
809
+ if (void 0 === o) throw "bad rs block @ typeNumber:" + r + "/errorCorrectionLevel:" + n;
810
+ for (var i = o.length / 3, s = [], u = 0; u < i; u += 1) for (var h = o[3 * u + 0], c = o[3 * u + 1], l = o[3 * u + 2], d = 0; d < h; d += 1) s.push(e(c, l));
811
+ return s;
812
+ }
813
+ };
814
+ return r;
815
+ }(),
816
+ l = function l() {
817
+ var t = [],
818
+ e = 0,
819
+ r = {
820
+ getBuffer: function getBuffer() {
821
+ return t;
822
+ },
823
+ getAt: function getAt(e) {
824
+ var r = Math.floor(e / 8);
825
+ return 1 == (t[r] >>> 7 - e % 8 & 1);
826
+ },
827
+ put: function put(t, e) {
828
+ for (var n = 0; n < e; n += 1) r.putBit(1 == (t >>> e - n - 1 & 1));
829
+ },
830
+ getLengthInBits: function getLengthInBits() {
831
+ return e;
832
+ },
833
+ putBit: function putBit(r) {
834
+ var n = Math.floor(e / 8);
835
+ t.length <= n && t.push(0), r && (t[n] |= 128 >>> e % 8), e += 1;
836
+ }
837
+ };
838
+ return r;
716
839
  },
717
- c = {
718
- "██": "▀",
719
- "█ ": "▀",
720
- " █": " ",
721
- " ": " "
840
+ d = function d(t) {
841
+ var e = t,
842
+ r = {
843
+ getMode: function getMode() {
844
+ return 1;
845
+ },
846
+ getLength: function getLength(t) {
847
+ return e.length;
848
+ },
849
+ write: function write(t) {
850
+ for (var r = e, o = 0; o + 2 < r.length;) t.put(n(r.substring(o, o + 3)), 10), o += 3;
851
+ o < r.length && (r.length - o == 1 ? t.put(n(r.substring(o, o + 1)), 4) : r.length - o == 2 && t.put(n(r.substring(o, o + 2)), 7));
852
+ }
853
+ },
854
+ n = function n(t) {
855
+ for (var e = 0, r = 0; r < t.length; r += 1) e = 10 * e + o(t.charAt(r));
856
+ return e;
857
+ },
858
+ o = function o(t) {
859
+ if ("0" <= t && t <= "9") return t.charCodeAt(0) - "0".charCodeAt(0);
860
+ throw "illegal char :" + t;
861
+ };
862
+ return r;
722
863
  },
723
- l = "";
724
-
725
- for (e = 0; e < a; e += 2) {
726
- for (n = Math.floor((e - s) / 1), o = Math.floor((e + 1 - s) / 1), r = 0; r < a; r += 1) {
727
- 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];
728
- }
729
-
730
- l += "\n";
731
- }
732
-
733
- return a % 2 && t > 0 ? l.substring(0, l.length - a - 1) + Array(a + 1).join("▀") : l.substring(0, l.length - 1);
734
- }(e);
735
- t -= 1, e = void 0 === e ? 2 * t : e;
736
- var r,
737
- n,
738
- o,
739
- i,
740
- a = w.getModuleCount() * t + 2 * e,
741
- s = e,
742
- u = a - e,
743
- h = Array(t + 1).join("██"),
744
- c = Array(t + 1).join(" "),
745
- l = "",
746
- d = "";
747
-
748
- for (r = 0; r < a; r += 1) {
749
- for (o = Math.floor((r - s) / t), d = "", n = 0; n < a; n += 1) {
750
- i = 1, s <= n && n < u && s <= r && r < u && w.isDark(o, Math.floor((n - s) / t)) && (i = 0), d += i ? h : c;
751
- }
752
-
753
- for (o = 0; o < t; o += 1) {
754
- l += d + "\n";
755
- }
756
- }
757
-
758
- return l.substring(0, l.length - 1);
759
- }, w.renderTo2dContext = function (t, e) {
760
- e = e || 2;
761
-
762
- for (var r = w.getModuleCount(), n = 0; n < r; n++) {
763
- for (var o = 0; o < r; o++) {
764
- t.fillStyle = w.isDark(n, o) ? "black" : "white", t.fillRect(n * e, o * e, e, e);
765
- }
766
- }
767
- }, w;
768
- };
769
-
770
- t.stringToBytes = (t.stringToBytesFuncs = {
771
- "default": function _default(t) {
772
- for (var e = [], r = 0; r < t.length; r += 1) {
773
- var n = t.charCodeAt(r);
774
- e.push(255 & n);
775
- }
776
-
777
- return e;
778
- }
779
- })["default"], t.createStringToBytes = function (t, e) {
780
- var r = function () {
781
- for (var r = w(t), n = function n() {
782
- var t = r.read();
783
- if (-1 == t) throw "eof";
784
- return t;
785
- }, o = 0, i = {};;) {
786
- var a = r.read();
787
- if (-1 == a) break;
788
- var s = n(),
789
- u = n() << 8 | n();
790
- i[String.fromCharCode(a << 8 | s)] = u, o += 1;
791
- }
792
-
793
- if (o != e) throw o + " != " + e;
794
- return i;
795
- }(),
796
- n = "?".charCodeAt(0);
797
-
864
+ f = function f(t) {
865
+ var e = t,
866
+ r = {
867
+ getMode: function getMode() {
868
+ return 2;
869
+ },
870
+ getLength: function getLength(t) {
871
+ return e.length;
872
+ },
873
+ write: function write(t) {
874
+ for (var r = e, o = 0; o + 1 < r.length;) t.put(45 * n(r.charAt(o)) + n(r.charAt(o + 1)), 11), o += 2;
875
+ o < r.length && t.put(n(r.charAt(o)), 6);
876
+ }
877
+ },
878
+ n = function n(t) {
879
+ if ("0" <= t && t <= "9") return t.charCodeAt(0) - "0".charCodeAt(0);
880
+ if ("A" <= t && t <= "Z") return t.charCodeAt(0) - "A".charCodeAt(0) + 10;
881
+ switch (t) {
882
+ case " ":
883
+ return 36;
884
+ case "$":
885
+ return 37;
886
+ case "%":
887
+ return 38;
888
+ case "*":
889
+ return 39;
890
+ case "+":
891
+ return 40;
892
+ case "-":
893
+ return 41;
894
+ case ".":
895
+ return 42;
896
+ case "/":
897
+ return 43;
898
+ case ":":
899
+ return 44;
900
+ default:
901
+ throw "illegal char :" + t;
902
+ }
903
+ };
904
+ return r;
905
+ },
906
+ g = function g(e) {
907
+ var r = t.stringToBytes(e);
908
+ return {
909
+ getMode: function getMode() {
910
+ return 4;
911
+ },
912
+ getLength: function getLength(t) {
913
+ return r.length;
914
+ },
915
+ write: function write(t) {
916
+ for (var e = 0; e < r.length; e += 1) t.put(r[e], 8);
917
+ }
918
+ };
919
+ },
920
+ p = function p(e) {
921
+ var r = t.stringToBytesFuncs.SJIS;
922
+ if (!r) throw "sjis not supported.";
923
+ !function (t, e) {
924
+ var n = r("");
925
+ if (2 != n.length || 38726 != (n[0] << 8 | n[1])) throw "sjis not supported.";
926
+ }();
927
+ var n = r(e);
928
+ return {
929
+ getMode: function getMode() {
930
+ return 8;
931
+ },
932
+ getLength: function getLength(t) {
933
+ return ~~(n.length / 2);
934
+ },
935
+ write: function write(t) {
936
+ for (var e = n, r = 0; r + 1 < e.length;) {
937
+ var o = (255 & e[r]) << 8 | 255 & e[r + 1];
938
+ if (33088 <= o && o <= 40956) o -= 33088;else {
939
+ if (!(57408 <= o && o <= 60351)) throw "illegal char at " + (r + 1) + "/" + o;
940
+ o -= 49472;
941
+ }
942
+ o = 192 * (o >>> 8 & 255) + (255 & o), t.put(o, 13), r += 2;
943
+ }
944
+ if (r < e.length) throw "illegal char at " + (r + 1);
945
+ }
946
+ };
947
+ },
948
+ v = function v() {
949
+ var t = [],
950
+ e = {
951
+ writeByte: function writeByte(e) {
952
+ t.push(255 & e);
953
+ },
954
+ writeShort: function writeShort(t) {
955
+ e.writeByte(t), e.writeByte(t >>> 8);
956
+ },
957
+ writeBytes: function writeBytes(t, r, n) {
958
+ r = r || 0, n = n || t.length;
959
+ for (var o = 0; o < n; o += 1) e.writeByte(t[o + r]);
960
+ },
961
+ writeString: function writeString(t) {
962
+ for (var r = 0; r < t.length; r += 1) e.writeByte(t.charCodeAt(r));
963
+ },
964
+ toByteArray: function toByteArray() {
965
+ return t;
966
+ },
967
+ toString: function toString() {
968
+ var e = "";
969
+ e += "[";
970
+ for (var r = 0; r < t.length; r += 1) r > 0 && (e += ","), e += t[r];
971
+ return e + "]";
972
+ }
973
+ };
974
+ return e;
975
+ },
976
+ w = function w(t) {
977
+ var e = t,
978
+ r = 0,
979
+ n = 0,
980
+ o = 0,
981
+ i = {
982
+ read: function read() {
983
+ for (; o < 8;) {
984
+ if (r >= e.length) {
985
+ if (0 == o) return -1;
986
+ throw "unexpected end of file./" + o;
987
+ }
988
+ var t = e.charAt(r);
989
+ if (r += 1, "=" == t) return o = 0, -1;
990
+ t.match(/^\s$/) || (n = n << 6 | a(t.charCodeAt(0)), o += 6);
991
+ }
992
+ var i = n >>> o - 8 & 255;
993
+ return o -= 8, i;
994
+ }
995
+ },
996
+ a = function a(t) {
997
+ if (65 <= t && t <= 90) return t - 65;
998
+ if (97 <= t && t <= 122) return t - 97 + 26;
999
+ if (48 <= t && t <= 57) return t - 48 + 52;
1000
+ if (43 == t) return 62;
1001
+ if (47 == t) return 63;
1002
+ throw "c:" + t;
1003
+ };
1004
+ return i;
1005
+ },
1006
+ y = function y(t, e, r) {
1007
+ for (var n = function (t, e) {
1008
+ var r = t,
1009
+ n = e,
1010
+ o = new Array(t * e),
1011
+ i = {
1012
+ setPixel: function setPixel(t, e, n) {
1013
+ o[e * r + t] = n;
1014
+ },
1015
+ write: function write(t) {
1016
+ t.writeString("GIF87a"), t.writeShort(r), t.writeShort(n), t.writeByte(128), t.writeByte(0), t.writeByte(0), t.writeByte(0), t.writeByte(0), t.writeByte(0), t.writeByte(255), t.writeByte(255), t.writeByte(255), t.writeString(","), t.writeShort(0), t.writeShort(0), t.writeShort(r), t.writeShort(n), t.writeByte(0);
1017
+ var e = a(2);
1018
+ t.writeByte(2);
1019
+ for (var o = 0; e.length - o > 255;) t.writeByte(255), t.writeBytes(e, o, 255), o += 255;
1020
+ t.writeByte(e.length - o), t.writeBytes(e, o, e.length - o), t.writeByte(0), t.writeString(";");
1021
+ }
1022
+ },
1023
+ a = function a(t) {
1024
+ for (var e = 1 << t, r = 1 + (1 << t), n = t + 1, i = s(), a = 0; a < e; a += 1) i.add(String.fromCharCode(a));
1025
+ i.add(String.fromCharCode(e)), i.add(String.fromCharCode(r));
1026
+ var u,
1027
+ h,
1028
+ c,
1029
+ l = v(),
1030
+ d = (u = l, h = 0, c = 0, {
1031
+ write: function write(t, e) {
1032
+ if (t >>> e != 0) throw "length over";
1033
+ for (; h + e >= 8;) u.writeByte(255 & (t << h | c)), e -= 8 - h, t >>>= 8 - h, c = 0, h = 0;
1034
+ c |= t << h, h += e;
1035
+ },
1036
+ flush: function flush() {
1037
+ h > 0 && u.writeByte(c);
1038
+ }
1039
+ });
1040
+ d.write(e, n);
1041
+ var f = 0,
1042
+ g = String.fromCharCode(o[f]);
1043
+ for (f += 1; f < o.length;) {
1044
+ var p = String.fromCharCode(o[f]);
1045
+ 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);
1046
+ }
1047
+ return d.write(i.indexOf(g), n), d.write(r, n), d.flush(), l.toByteArray();
1048
+ },
1049
+ s = function s() {
1050
+ var t = {},
1051
+ e = 0,
1052
+ r = {
1053
+ add: function add(n) {
1054
+ if (r.contains(n)) throw "dup key:" + n;
1055
+ t[n] = e, e += 1;
1056
+ },
1057
+ size: function size() {
1058
+ return e;
1059
+ },
1060
+ indexOf: function indexOf(e) {
1061
+ return t[e];
1062
+ },
1063
+ contains: function contains(e) {
1064
+ return void 0 !== t[e];
1065
+ }
1066
+ };
1067
+ return r;
1068
+ };
1069
+ return i;
1070
+ }(t, e), o = 0; o < e; o += 1) for (var i = 0; i < t; i += 1) n.setPixel(i, o, r(i, o));
1071
+ var a = v();
1072
+ n.write(a);
1073
+ for (var s = function () {
1074
+ var t = 0,
1075
+ e = 0,
1076
+ r = 0,
1077
+ n = "",
1078
+ o = {},
1079
+ i = function i(t) {
1080
+ n += String.fromCharCode(a(63 & t));
1081
+ },
1082
+ a = function a(t) {
1083
+ if (t < 0) ;else {
1084
+ if (t < 26) return 65 + t;
1085
+ if (t < 52) return t - 26 + 97;
1086
+ if (t < 62) return t - 52 + 48;
1087
+ if (62 == t) return 43;
1088
+ if (63 == t) return 47;
1089
+ }
1090
+ throw "n:" + t;
1091
+ };
1092
+ return o.writeByte = function (n) {
1093
+ for (t = t << 8 | 255 & n, e += 8, r += 1; e >= 6;) i(t >>> e - 6), e -= 6;
1094
+ }, o.flush = function () {
1095
+ if (e > 0 && (i(t << 6 - e), t = 0, e = 0), r % 3 != 0) for (var o = 3 - r % 3, a = 0; a < o; a += 1) n += "=";
1096
+ }, o.toString = function () {
1097
+ return n;
1098
+ }, o;
1099
+ }(), u = a.toByteArray(), h = 0; h < u.length; h += 1) s.writeByte(u[h]);
1100
+ return s.flush(), "data:image/gif;base64," + s;
1101
+ };
1102
+ return t;
1103
+ }();
1104
+ o.stringToBytesFuncs["UTF-8"] = function (t) {
798
1105
  return function (t) {
799
- for (var e = [], o = 0; o < t.length; o += 1) {
800
- var i = t.charCodeAt(o);
801
- if (i < 128) e.push(i);else {
802
- var a = r[t.charAt(o)];
803
- "number" == typeof a ? (255 & a) == a ? e.push(a) : (e.push(a >>> 8), e.push(255 & a)) : e.push(n);
804
- }
1106
+ for (var e = [], r = 0; r < t.length; r++) {
1107
+ var n = t.charCodeAt(r);
1108
+ n < 128 ? e.push(n) : n < 2048 ? e.push(192 | n >> 6, 128 | 63 & n) : n < 55296 || n >= 57344 ? e.push(224 | n >> 12, 128 | n >> 6 & 63, 128 | 63 & n) : (r++, n = 65536 + ((1023 & n) << 10 | 1023 & t.charCodeAt(r)), e.push(240 | n >> 18, 128 | n >> 12 & 63, 128 | n >> 6 & 63, 128 | 63 & n));
805
1109
  }
806
-
807
1110
  return e;
808
- };
809
- };
810
-
811
- var e,
812
- r,
813
- n,
814
- o,
815
- i,
816
- a = {
817
- L: 1,
818
- M: 0,
819
- Q: 3,
820
- H: 2
821
- },
822
- s = (e = [[], [6, 18], [6, 22], [6, 26], [6, 30], [6, 34], [6, 22, 38], [6, 24, 42], [6, 26, 46], [6, 28, 50], [6, 30, 54], [6, 32, 58], [6, 34, 62], [6, 26, 46, 66], [6, 26, 48, 70], [6, 26, 50, 74], [6, 30, 54, 78], [6, 30, 56, 82], [6, 30, 58, 86], [6, 34, 62, 90], [6, 28, 50, 72, 94], [6, 26, 50, 74, 98], [6, 30, 54, 78, 102], [6, 28, 54, 80, 106], [6, 32, 58, 84, 110], [6, 30, 58, 86, 114], [6, 34, 62, 90, 118], [6, 26, 50, 74, 98, 122], [6, 30, 54, 78, 102, 126], [6, 26, 52, 78, 104, 130], [6, 30, 56, 82, 108, 134], [6, 34, 60, 86, 112, 138], [6, 30, 58, 86, 114, 142], [6, 34, 62, 90, 118, 146], [6, 30, 54, 78, 102, 126, 150], [6, 24, 50, 76, 102, 128, 154], [6, 28, 54, 80, 106, 132, 158], [6, 32, 58, 84, 110, 136, 162], [6, 26, 54, 82, 110, 138, 166], [6, 30, 58, 86, 114, 142, 170]], r = 1335, n = 7973, i = function i(t) {
823
- for (var e = 0; 0 != t;) {
824
- e += 1, t >>>= 1;
825
- }
826
-
827
- return e;
828
- }, (o = {}).getBCHTypeInfo = function (t) {
829
- for (var e = t << 10; i(e) - i(r) >= 0;) {
830
- e ^= r << i(e) - i(r);
831
- }
832
-
833
- return 21522 ^ (t << 10 | e);
834
- }, o.getBCHTypeNumber = function (t) {
835
- for (var e = t << 12; i(e) - i(n) >= 0;) {
836
- e ^= n << i(e) - i(n);
837
- }
838
-
839
- return t << 12 | e;
840
- }, o.getPatternPosition = function (t) {
841
- return e[t - 1];
842
- }, o.getMaskFunction = function (t) {
843
- switch (t) {
844
- case 0:
845
- return function (t, e) {
846
- return (t + e) % 2 == 0;
847
- };
848
-
849
- case 1:
850
- return function (t, e) {
851
- return t % 2 == 0;
852
- };
853
-
854
- case 2:
855
- return function (t, e) {
856
- return e % 3 == 0;
857
- };
858
-
859
- case 3:
860
- return function (t, e) {
861
- return (t + e) % 3 == 0;
862
- };
863
-
864
- case 4:
865
- return function (t, e) {
866
- return (Math.floor(t / 2) + Math.floor(e / 3)) % 2 == 0;
867
- };
868
-
869
- case 5:
870
- return function (t, e) {
871
- return t * e % 2 + t * e % 3 == 0;
872
- };
873
-
874
- case 6:
875
- return function (t, e) {
876
- return (t * e % 2 + t * e % 3) % 2 == 0;
877
- };
878
-
879
- case 7:
880
- return function (t, e) {
881
- return (t * e % 3 + (t + e) % 2) % 2 == 0;
882
- };
883
-
884
- default:
885
- throw "bad maskPattern:" + t;
886
- }
887
- }, o.getErrorCorrectPolynomial = function (t) {
888
- for (var e = h([1], 0), r = 0; r < t; r += 1) {
889
- e = e.multiply(h([1, u.gexp(r)], 0));
890
- }
891
-
892
- return e;
893
- }, o.getLengthInBits = function (t, e) {
894
- if (1 <= e && e < 10) switch (t) {
895
- case 1:
896
- return 10;
897
-
898
- case 2:
899
- return 9;
900
-
901
- case 4:
902
- case 8:
903
- return 8;
904
-
905
- default:
906
- throw "mode:" + t;
907
- } else if (e < 27) switch (t) {
908
- case 1:
909
- return 12;
910
-
911
- case 2:
912
- return 11;
913
-
914
- case 4:
915
- return 16;
916
-
917
- case 8:
918
- return 10;
919
-
920
- default:
921
- throw "mode:" + t;
922
- } else {
923
- if (!(e < 41)) throw "type:" + e;
924
-
925
- switch (t) {
926
- case 1:
927
- return 14;
928
-
929
- case 2:
930
- return 13;
931
-
932
- case 4:
933
- return 16;
934
-
935
- case 8:
936
- return 12;
937
-
938
- default:
939
- throw "mode:" + t;
940
- }
941
- }
942
- }, o.getLostPoint = function (t) {
943
- for (var e = t.getModuleCount(), r = 0, n = 0; n < e; n += 1) {
944
- for (var o = 0; o < e; o += 1) {
945
- for (var i = 0, a = t.isDark(n, o), s = -1; s <= 1; s += 1) {
946
- if (!(n + s < 0 || e <= n + s)) for (var u = -1; u <= 1; u += 1) {
947
- o + u < 0 || e <= o + u || 0 == s && 0 == u || a == t.isDark(n + s, o + u) && (i += 1);
948
- }
949
- }
950
-
951
- i > 5 && (r += 3 + i - 5);
952
- }
953
- }
954
-
955
- for (n = 0; n < e - 1; n += 1) {
956
- for (o = 0; o < e - 1; o += 1) {
957
- var h = 0;
958
- 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);
959
- }
960
- }
961
-
962
- for (n = 0; n < e; n += 1) {
963
- for (o = 0; o < e - 6; o += 1) {
964
- t.isDark(n, o) && !t.isDark(n, o + 1) && t.isDark(n, o + 2) && t.isDark(n, o + 3) && t.isDark(n, o + 4) && !t.isDark(n, o + 5) && t.isDark(n, o + 6) && (r += 40);
965
- }
966
- }
967
-
968
- for (o = 0; o < e; o += 1) {
969
- for (n = 0; n < e - 6; n += 1) {
970
- t.isDark(n, o) && !t.isDark(n + 1, o) && t.isDark(n + 2, o) && t.isDark(n + 3, o) && t.isDark(n + 4, o) && !t.isDark(n + 5, o) && t.isDark(n + 6, o) && (r += 40);
971
- }
972
- }
973
-
974
- var c = 0;
975
-
976
- for (o = 0; o < e; o += 1) {
977
- for (n = 0; n < e; n += 1) {
978
- t.isDark(n, o) && (c += 1);
979
- }
980
- }
981
-
982
- return r + Math.abs(100 * c / e / e - 50) / 5 * 10;
983
- }, o),
984
- u = function () {
985
- for (var t = new Array(256), e = new Array(256), r = 0; r < 8; r += 1) {
986
- t[r] = 1 << r;
987
- }
988
-
989
- for (r = 8; r < 256; r += 1) {
990
- t[r] = t[r - 4] ^ t[r - 5] ^ t[r - 6] ^ t[r - 8];
991
- }
1111
+ }(t);
1112
+ }, void 0 === (n = "function" == typeof (r = function r() {
1113
+ return o;
1114
+ }) ? r.apply(e, []) : r) || (t.exports = n);
1115
+ },
1116
+ 676: function _(t, e, r) {
1117
+ "use strict";
992
1118
 
993
- for (r = 0; r < 255; r += 1) {
994
- e[t[r]] = r;
1119
+ r.d(e, {
1120
+ "default": function _default() {
1121
+ return q;
995
1122
  }
996
-
997
- return {
998
- glog: function glog(t) {
999
- if (t < 1) throw "glog(" + t + ")";
1000
- return e[t];
1001
- },
1002
- gexp: function gexp(e) {
1003
- for (; e < 0;) {
1004
- e += 255;
1005
- }
1006
-
1007
- for (; e >= 256;) {
1008
- e -= 255;
1009
- }
1010
-
1011
- return t[e];
1012
- }
1013
- };
1014
- }();
1015
-
1016
- function h(t, e) {
1017
- if (void 0 === t.length) throw t.length + "/" + e;
1018
-
1019
- var r = function () {
1020
- for (var r = 0; r < t.length && 0 == t[r];) {
1021
- r += 1;
1022
- }
1023
-
1024
- for (var n = new Array(t.length - r + e), o = 0; o < t.length - r; o += 1) {
1025
- n[o] = t[o + r];
1026
- }
1027
-
1028
- return n;
1029
- }(),
1030
- n = {
1031
- getAt: function getAt(t) {
1032
- return r[t];
1033
- },
1034
- getLength: function getLength() {
1035
- return r.length;
1036
- },
1037
- multiply: function multiply(t) {
1038
- for (var e = new Array(n.getLength() + t.getLength() - 1), r = 0; r < n.getLength(); r += 1) {
1039
- for (var o = 0; o < t.getLength(); o += 1) {
1040
- e[r + o] ^= u.gexp(u.glog(n.getAt(r)) + u.glog(t.getAt(o)));
1041
- }
1042
- }
1043
-
1044
- return h(e, 0);
1045
- },
1046
- mod: function mod(t) {
1047
- if (n.getLength() - t.getLength() < 0) return n;
1048
-
1049
- for (var e = u.glog(n.getAt(0)) - u.glog(t.getAt(0)), r = new Array(n.getLength()), o = 0; o < n.getLength(); o += 1) {
1050
- r[o] = n.getAt(o);
1051
- }
1052
-
1053
- for (o = 0; o < t.getLength(); o += 1) {
1054
- r[o] ^= u.gexp(u.glog(t.getAt(o)) + e);
1055
- }
1056
-
1057
- return h(r, 0).mod(t);
1058
- }
1059
- };
1060
-
1061
- return n;
1062
- }
1063
-
1064
- var c = function () {
1065
- 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]],
1066
- e = function e(t, _e) {
1067
- var r = {};
1068
- return r.totalCount = t, r.dataCount = _e, r;
1069
- },
1070
- r = {
1071
- getRSBlocks: function getRSBlocks(r, n) {
1072
- var o = function (e, r) {
1073
- switch (r) {
1074
- case a.L:
1075
- return t[4 * (e - 1) + 0];
1076
-
1077
- case a.M:
1078
- return t[4 * (e - 1) + 1];
1079
-
1080
- case a.Q:
1081
- return t[4 * (e - 1) + 2];
1082
-
1083
- case a.H:
1084
- return t[4 * (e - 1) + 3];
1085
-
1086
- default:
1087
- return;
1088
- }
1089
- }(r, n);
1090
-
1091
- if (void 0 === o) throw "bad rs block @ typeNumber:" + r + "/errorCorrectionLevel:" + n;
1092
-
1093
- for (var i = o.length / 3, s = [], u = 0; u < i; u += 1) {
1094
- for (var h = o[3 * u + 0], c = o[3 * u + 1], l = o[3 * u + 2], d = 0; d < h; d += 1) {
1095
- s.push(e(c, l));
1096
- }
1097
- }
1098
-
1099
- return s;
1100
- }
1101
- };
1102
-
1103
- return r;
1104
- }(),
1105
- l = function l() {
1106
- var t = [],
1107
- e = 0,
1108
- r = {
1109
- getBuffer: function getBuffer() {
1123
+ });
1124
+ var _n = function n() {
1125
+ return (_n = Object.assign || function (t) {
1126
+ for (var e, r = 1, n = arguments.length; r < n; r++) for (var o in e = arguments[r]) Object.prototype.hasOwnProperty.call(e, o) && (t[o] = e[o]);
1110
1127
  return t;
1111
- },
1112
- getAt: function getAt(e) {
1113
- var r = Math.floor(e / 8);
1114
- return 1 == (t[r] >>> 7 - e % 8 & 1);
1115
- },
1116
- put: function put(t, e) {
1117
- for (var n = 0; n < e; n += 1) {
1118
- r.putBit(1 == (t >>> e - n - 1 & 1));
1119
- }
1120
- },
1121
- getLengthInBits: function getLengthInBits() {
1122
- return e;
1123
- },
1124
- putBit: function putBit(r) {
1125
- var n = Math.floor(e / 8);
1126
- t.length <= n && t.push(0), r && (t[n] |= 128 >>> e % 8), e += 1;
1127
- }
1128
- };
1129
- return r;
1130
- },
1131
- d = function d(t) {
1132
- var e = t,
1133
- r = {
1134
- getMode: function getMode() {
1135
- return 1;
1136
- },
1137
- getLength: function getLength(t) {
1138
- return e.length;
1139
- },
1140
- write: function write(t) {
1141
- for (var r = e, o = 0; o + 2 < r.length;) {
1142
- t.put(n(r.substring(o, o + 3)), 10), o += 3;
1143
- }
1144
-
1145
- o < r.length && (r.length - o == 1 ? t.put(n(r.substring(o, o + 1)), 4) : r.length - o == 2 && t.put(n(r.substring(o, o + 2)), 7));
1146
- }
1128
+ }).apply(this, arguments);
1147
1129
  },
1148
- n = function n(t) {
1149
- for (var e = 0, r = 0; r < t.length; r += 1) {
1150
- e = 10 * e + o(t.charAt(r));
1151
- }
1152
-
1153
- return e;
1154
- },
1155
- o = function o(t) {
1156
- if ("0" <= t && t <= "9") return t.charCodeAt(0) - "0".charCodeAt(0);
1157
- throw "illegal char :" + t;
1158
- };
1159
-
1160
- return r;
1161
- },
1162
- f = function f(t) {
1163
- var e = t,
1164
- r = {
1165
- getMode: function getMode() {
1166
- return 2;
1167
- },
1168
- getLength: function getLength(t) {
1169
- return e.length;
1170
- },
1171
- write: function write(t) {
1172
- for (var r = e, o = 0; o + 1 < r.length;) {
1173
- t.put(45 * n(r.charAt(o)) + n(r.charAt(o + 1)), 11), o += 2;
1174
- }
1175
-
1176
- o < r.length && t.put(n(r.charAt(o)), 6);
1177
- }
1178
- },
1179
- n = function n(t) {
1180
- if ("0" <= t && t <= "9") return t.charCodeAt(0) - "0".charCodeAt(0);
1181
- if ("A" <= t && t <= "Z") return t.charCodeAt(0) - "A".charCodeAt(0) + 10;
1182
-
1183
- switch (t) {
1184
- case " ":
1185
- return 36;
1186
-
1187
- case "$":
1188
- return 37;
1189
-
1190
- case "%":
1191
- return 38;
1192
-
1193
- case "*":
1194
- return 39;
1195
-
1196
- case "+":
1197
- return 40;
1198
-
1199
- case "-":
1200
- return 41;
1201
-
1202
- case ".":
1203
- return 42;
1204
-
1205
- case "/":
1206
- return 43;
1207
-
1208
- case ":":
1209
- return 44;
1210
-
1211
- default:
1212
- throw "illegal char :" + t;
1213
- }
1214
- };
1215
-
1216
- return r;
1217
- },
1218
- g = function g(e) {
1219
- var r = t.stringToBytes(e);
1220
- return {
1221
- getMode: function getMode() {
1222
- return 4;
1223
- },
1224
- getLength: function getLength(t) {
1225
- return r.length;
1226
- },
1227
- write: function write(t) {
1228
- for (var e = 0; e < r.length; e += 1) {
1229
- t.put(r[e], 8);
1230
- }
1231
- }
1232
- };
1233
- },
1234
- p = function p(e) {
1235
- var r = t.stringToBytesFuncs.SJIS;
1236
- if (!r) throw "sjis not supported.";
1237
- !function (t, e) {
1238
- var n = r("友");
1239
- if (2 != n.length || 38726 != (n[0] << 8 | n[1])) throw "sjis not supported.";
1240
- }();
1241
- var n = r(e);
1242
- return {
1243
- getMode: function getMode() {
1244
- return 8;
1245
- },
1246
- getLength: function getLength(t) {
1247
- return ~~(n.length / 2);
1248
- },
1249
- write: function write(t) {
1250
- for (var e = n, r = 0; r + 1 < e.length;) {
1251
- var o = (255 & e[r]) << 8 | 255 & e[r + 1];
1252
- if (33088 <= o && o <= 40956) o -= 33088;else {
1253
- if (!(57408 <= o && o <= 60351)) throw "illegal char at " + (r + 1) + "/" + o;
1254
- o -= 49472;
1255
- }
1256
- o = 192 * (o >>> 8 & 255) + (255 & o), t.put(o, 13), r += 2;
1257
- }
1258
-
1259
- if (r < e.length) throw "illegal char at " + (r + 1);
1260
- }
1261
- };
1262
- },
1263
- v = function v() {
1264
- var t = [],
1265
- e = {
1266
- writeByte: function writeByte(e) {
1267
- t.push(255 & e);
1268
- },
1269
- writeShort: function writeShort(t) {
1270
- e.writeByte(t), e.writeByte(t >>> 8);
1271
- },
1272
- writeBytes: function writeBytes(t, r, n) {
1273
- r = r || 0, n = n || t.length;
1274
-
1275
- for (var o = 0; o < n; o += 1) {
1276
- e.writeByte(t[o + r]);
1277
- }
1278
- },
1279
- writeString: function writeString(t) {
1280
- for (var r = 0; r < t.length; r += 1) {
1281
- e.writeByte(t.charCodeAt(r));
1282
- }
1283
- },
1284
- toByteArray: function toByteArray() {
1285
- return t;
1286
- },
1287
- toString: function toString() {
1288
- var e = "";
1289
- e += "[";
1290
-
1291
- for (var r = 0; r < t.length; r += 1) {
1292
- r > 0 && (e += ","), e += t[r];
1293
- }
1294
-
1295
- return e + "]";
1296
- }
1297
- };
1298
- return e;
1299
- },
1300
- w = function w(t) {
1301
- var e = t,
1302
- r = 0,
1303
- n = 0,
1304
- o = 0,
1305
- i = {
1306
- read: function read() {
1307
- for (; o < 8;) {
1308
- if (r >= e.length) {
1309
- if (0 == o) return -1;
1310
- throw "unexpected end of file./" + o;
1311
- }
1312
-
1313
- var t = e.charAt(r);
1314
- if (r += 1, "=" == t) return o = 0, -1;
1315
- t.match(/^\s$/) || (n = n << 6 | a(t.charCodeAt(0)), o += 6);
1316
- }
1317
-
1318
- var i = n >>> o - 8 & 255;
1319
- return o -= 8, i;
1320
- }
1130
+ o = function o() {
1131
+ for (var t = 0, e = 0, r = arguments.length; e < r; e++) t += arguments[e].length;
1132
+ var n = Array(t),
1133
+ o = 0;
1134
+ for (e = 0; e < r; e++) for (var i = arguments[e], a = 0, s = i.length; a < s; a++, o++) n[o] = i[a];
1135
+ return n;
1321
1136
  },
1322
- a = function a(t) {
1323
- if (65 <= t && t <= 90) return t - 65;
1324
- if (97 <= t && t <= 122) return t - 97 + 26;
1325
- if (48 <= t && t <= 57) return t - 48 + 52;
1326
- if (43 == t) return 62;
1327
- if (47 == t) return 63;
1328
- throw "c:" + t;
1137
+ i = function i(t) {
1138
+ return !!t && "object" == _typeof(t) && !Array.isArray(t);
1329
1139
  };
1330
-
1331
- return i;
1332
- },
1333
- y = function y(t, e, r) {
1334
- for (var n = function (t, e) {
1335
- var r = t,
1336
- n = e,
1337
- o = new Array(t * e),
1338
- i = {
1339
- setPixel: function setPixel(t, e, n) {
1340
- o[e * r + t] = n;
1341
- },
1342
- write: function write(t) {
1343
- t.writeString("GIF87a"), t.writeShort(r), t.writeShort(n), t.writeByte(128), t.writeByte(0), t.writeByte(0), t.writeByte(0), t.writeByte(0), t.writeByte(0), t.writeByte(255), t.writeByte(255), t.writeByte(255), t.writeString(","), t.writeShort(0), t.writeShort(0), t.writeShort(r), t.writeShort(n), t.writeByte(0);
1344
- var e = a(2);
1345
- t.writeByte(2);
1346
-
1347
- for (var o = 0; e.length - o > 255;) {
1348
- t.writeByte(255), t.writeBytes(e, o, 255), o += 255;
1349
- }
1350
-
1351
- t.writeByte(e.length - o), t.writeBytes(e, o, e.length - o), t.writeByte(0), t.writeString(";");
1352
- }
1353
- },
1354
- a = function a(t) {
1355
- for (var e = 1 << t, r = 1 + (1 << t), n = t + 1, i = s(), a = 0; a < e; a += 1) {
1356
- i.add(String.fromCharCode(a));
1357
- }
1358
-
1359
- i.add(String.fromCharCode(e)), i.add(String.fromCharCode(r));
1360
- var u,
1361
- h,
1362
- c,
1363
- l = v(),
1364
- d = (u = l, h = 0, c = 0, {
1365
- write: function write(t, e) {
1366
- if (t >>> e != 0) throw "length over";
1367
-
1368
- for (; h + e >= 8;) {
1369
- u.writeByte(255 & (t << h | c)), e -= 8 - h, t >>>= 8 - h, c = 0, h = 0;
1370
- }
1371
-
1372
- c |= t << h, h += e;
1373
- },
1374
- flush: function flush() {
1375
- h > 0 && u.writeByte(c);
1376
- }
1377
- });
1378
- d.write(e, n);
1379
- var f = 0,
1380
- g = String.fromCharCode(o[f]);
1381
-
1382
- for (f += 1; f < o.length;) {
1383
- var p = String.fromCharCode(o[f]);
1384
- 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);
1385
- }
1386
-
1387
- return d.write(i.indexOf(g), n), d.write(r, n), d.flush(), l.toByteArray();
1388
- },
1389
- s = function s() {
1390
- var t = {},
1391
- e = 0,
1392
- r = {
1393
- add: function add(n) {
1394
- if (r.contains(n)) throw "dup key:" + n;
1395
- t[n] = e, e += 1;
1396
- },
1397
- size: function size() {
1398
- return e;
1399
- },
1400
- indexOf: function indexOf(e) {
1401
- return t[e];
1402
- },
1403
- contains: function contains(e) {
1404
- return void 0 !== t[e];
1405
- }
1406
- };
1407
- return r;
1408
- };
1409
-
1410
- return i;
1411
- }(t, e), o = 0; o < e; o += 1) {
1412
- for (var i = 0; i < t; i += 1) {
1413
- n.setPixel(i, o, r(i, o));
1414
- }
1415
- }
1416
-
1417
- var a = v();
1418
- n.write(a);
1419
-
1420
- for (var s = function () {
1421
- var t = 0,
1422
- e = 0,
1423
- r = 0,
1424
- n = "",
1425
- o = {},
1426
- i = function i(t) {
1427
- n += String.fromCharCode(a(63 & t));
1428
- },
1429
- a = function a(t) {
1430
- if (t < 0) ;else {
1431
- if (t < 26) return 65 + t;
1432
- if (t < 52) return t - 26 + 97;
1433
- if (t < 62) return t - 52 + 48;
1434
- if (62 == t) return 43;
1435
- if (63 == t) return 47;
1436
- }
1437
- throw "n:" + t;
1438
- };
1439
-
1440
- return o.writeByte = function (n) {
1441
- for (t = t << 8 | 255 & n, e += 8, r += 1; e >= 6;) {
1442
- i(t >>> e - 6), e -= 6;
1443
- }
1444
- }, o.flush = function () {
1445
- if (e > 0 && (i(t << 6 - e), t = 0, e = 0), r % 3 != 0) for (var o = 3 - r % 3, a = 0; a < o; a += 1) {
1446
- n += "=";
1447
- }
1448
- }, o.toString = function () {
1449
- return n;
1450
- }, o;
1451
- }(), u = a.toByteArray(), h = 0; h < u.length; h += 1) {
1452
- s.writeByte(u[h]);
1453
- }
1454
-
1455
- return s.flush(), "data:image/gif;base64," + s;
1456
- };
1457
-
1458
- return t;
1459
- }();
1460
-
1461
- o.stringToBytesFuncs["UTF-8"] = function (t) {
1462
- return function (t) {
1463
- for (var e = [], r = 0; r < t.length; r++) {
1464
- var n = t.charCodeAt(r);
1465
- n < 128 ? e.push(n) : n < 2048 ? e.push(192 | n >> 6, 128 | 63 & n) : n < 55296 || n >= 57344 ? e.push(224 | n >> 12, 128 | n >> 6 & 63, 128 | 63 & n) : (r++, n = 65536 + ((1023 & n) << 10 | 1023 & t.charCodeAt(r)), e.push(240 | n >> 18, 128 | n >> 12 & 63, 128 | n >> 6 & 63, 128 | 63 & n));
1466
- }
1467
-
1468
- return e;
1469
- }(t);
1470
- }, void 0 === (n = "function" == typeof (r = function r() {
1471
- return o;
1472
- }) ? r.apply(e, []) : r) || (t.exports = n);
1473
- },
1474
- 676: function _(t, e, r) {
1475
- "use strict";
1476
-
1477
- r.d(e, {
1478
- "default": function _default() {
1479
- return q;
1480
- }
1481
- });
1482
-
1483
- var _n = function n() {
1484
- return (_n = Object.assign || function (t) {
1485
- for (var e, r = 1, n = arguments.length; r < n; r++) {
1486
- for (var o in e = arguments[r]) {
1487
- Object.prototype.hasOwnProperty.call(e, o) && (t[o] = e[o]);
1488
- }
1489
- }
1490
-
1491
- return t;
1492
- }).apply(this, arguments);
1493
- },
1494
- o = function o() {
1495
- for (var t = 0, e = 0, r = arguments.length; e < r; e++) {
1496
- t += arguments[e].length;
1140
+ function a(t) {
1141
+ for (var e = [], r = 1; r < arguments.length; r++) e[r - 1] = arguments[r];
1142
+ if (!e.length) return t;
1143
+ var s = e.shift();
1144
+ return void 0 !== s && i(t) && i(s) ? (t = _n({}, t), Object.keys(s).forEach(function (e) {
1145
+ var r = t[e],
1146
+ n = s[e];
1147
+ Array.isArray(r) && Array.isArray(n) ? t[e] = n : i(r) && i(n) ? t[e] = a(Object.assign({}, r), n) : t[e] = n;
1148
+ }), a.apply(void 0, o([t], e))) : t;
1497
1149
  }
1498
-
1499
- var n = Array(t),
1500
- o = 0;
1501
-
1502
- for (e = 0; e < r; e++) {
1503
- for (var i = arguments[e], a = 0, s = i.length; a < s; a++, o++) {
1504
- n[o] = i[a];
1505
- }
1150
+ function s(t, e) {
1151
+ var r = document.createElement("a");
1152
+ r.download = e, r.href = t, document.body.appendChild(r), r.click(), document.body.removeChild(r);
1506
1153
  }
1507
-
1508
- return n;
1509
- },
1510
- i = function i(t) {
1511
- return !!t && "object" == _typeof(t) && !Array.isArray(t);
1512
- };
1513
-
1514
- function a(t) {
1515
- for (var e = [], r = 1; r < arguments.length; r++) {
1516
- e[r - 1] = arguments[r];
1517
- }
1518
-
1519
- if (!e.length) return t;
1520
- var s = e.shift();
1521
- return void 0 !== s && i(t) && i(s) ? (t = _n({}, t), Object.keys(s).forEach(function (e) {
1522
- var r = t[e],
1523
- n = s[e];
1524
- Array.isArray(r) && Array.isArray(n) ? t[e] = n : i(r) && i(n) ? t[e] = a(Object.assign({}, r), n) : t[e] = n;
1525
- }), a.apply(void 0, o([t], e))) : t;
1526
- }
1527
-
1528
- function s(t, e) {
1529
- var r = document.createElement("a");
1530
- r.download = e, r.href = t, document.body.appendChild(r), r.click(), document.body.removeChild(r);
1531
- }
1532
-
1533
- function u(t) {
1534
- return e = this, r = void 0, o = function o() {
1535
- return function (t, e) {
1536
- var r,
1154
+ function u(t) {
1155
+ return e = this, r = void 0, o = function o() {
1156
+ return function (t, e) {
1157
+ var r,
1537
1158
  n,
1538
1159
  o,
1539
1160
  i,
1540
1161
  a = {
1541
- label: 0,
1542
- sent: function sent() {
1543
- if (1 & o[0]) throw o[1];
1544
- return o[1];
1545
- },
1546
- trys: [],
1547
- ops: []
1548
- };
1549
- return i = {
1550
- next: s(0),
1551
- "throw": s(1),
1552
- "return": s(2)
1553
- }, "function" == typeof Symbol && (i[Symbol.iterator] = function () {
1554
- return this;
1555
- }), i;
1556
-
1557
- function s(i) {
1558
- return function (s) {
1559
- return function (i) {
1560
- if (r) throw new TypeError("Generator is already executing.");
1561
-
1562
- for (; a;) {
1563
- try {
1162
+ label: 0,
1163
+ sent: function sent() {
1164
+ if (1 & o[0]) throw o[1];
1165
+ return o[1];
1166
+ },
1167
+ trys: [],
1168
+ ops: []
1169
+ };
1170
+ return i = {
1171
+ next: s(0),
1172
+ "throw": s(1),
1173
+ "return": s(2)
1174
+ }, "function" == typeof Symbol && (i[Symbol.iterator] = function () {
1175
+ return this;
1176
+ }), i;
1177
+ function s(i) {
1178
+ return function (s) {
1179
+ return function (i) {
1180
+ if (r) throw new TypeError("Generator is already executing.");
1181
+ for (; a;) try {
1564
1182
  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;
1565
-
1566
1183
  switch (n = 0, o && (i = [2 & i[0], o.value]), i[0]) {
1567
1184
  case 0:
1568
1185
  case 1:
1569
1186
  o = i;
1570
1187
  break;
1571
-
1572
1188
  case 4:
1573
1189
  return a.label++, {
1574
1190
  value: i[1],
1575
1191
  done: !1
1576
1192
  };
1577
-
1578
1193
  case 5:
1579
1194
  a.label++, n = i[1], i = [0];
1580
1195
  continue;
1581
-
1582
1196
  case 7:
1583
1197
  i = a.ops.pop(), a.trys.pop();
1584
1198
  continue;
1585
-
1586
1199
  default:
1587
1200
  if (!((o = (o = a.trys).length > 0 && o[o.length - 1]) || 6 !== i[0] && 2 !== i[0])) {
1588
1201
  a = 0;
1589
1202
  continue;
1590
1203
  }
1591
-
1592
1204
  if (3 === i[0] && (!o || i[1] > o[0] && i[1] < o[3])) {
1593
1205
  a.label = i[1];
1594
1206
  break;
1595
1207
  }
1596
-
1597
1208
  if (6 === i[0] && a.label < o[1]) {
1598
1209
  a.label = o[1], o = i;
1599
1210
  break;
1600
1211
  }
1601
-
1602
1212
  if (o && a.label < o[2]) {
1603
1213
  a.label = o[2], a.ops.push(i);
1604
1214
  break;
1605
1215
  }
1606
-
1607
1216
  o[2] && a.ops.pop(), a.trys.pop();
1608
1217
  continue;
1609
1218
  }
1610
-
1611
1219
  i = e.call(t, a);
1612
1220
  } catch (t) {
1613
1221
  i = [6, t], n = 0;
1614
1222
  } finally {
1615
1223
  r = o = 0;
1616
1224
  }
1617
- }
1618
-
1619
- if (5 & i[0]) throw i[1];
1620
- return {
1621
- value: i[0] ? i[1] : void 0,
1622
- done: !0
1623
- };
1624
- }([i, s]);
1625
- };
1626
- }
1627
- }(this, function (e) {
1628
- return [2, new Promise(function (e) {
1629
- var r = new XMLHttpRequest();
1630
- r.onload = function () {
1631
- var t = new FileReader();
1632
- t.onloadend = function () {
1633
- e(t.result);
1634
- }, t.readAsDataURL(r.response);
1635
- }, r.open("GET", t), r.responseType = "blob", r.send();
1636
- })];
1637
- });
1638
- }, new ((n = void 0) || (n = Promise))(function (t, i) {
1639
- function a(t) {
1640
- try {
1641
- u(o.next(t));
1642
- } catch (t) {
1643
- i(t);
1225
+ if (5 & i[0]) throw i[1];
1226
+ return {
1227
+ value: i[0] ? i[1] : void 0,
1228
+ done: !0
1229
+ };
1230
+ }([i, s]);
1231
+ };
1232
+ }
1233
+ }(this, function (e) {
1234
+ return [2, new Promise(function (e) {
1235
+ var r = new XMLHttpRequest();
1236
+ r.onload = function () {
1237
+ var t = new FileReader();
1238
+ t.onloadend = function () {
1239
+ e(t.result);
1240
+ }, t.readAsDataURL(r.response);
1241
+ }, r.open("GET", t), r.responseType = "blob", r.send();
1242
+ })];
1243
+ });
1244
+ }, new ((n = void 0) || (n = Promise))(function (t, i) {
1245
+ function a(t) {
1246
+ try {
1247
+ u(o.next(t));
1248
+ } catch (t) {
1249
+ i(t);
1250
+ }
1644
1251
  }
1645
- }
1646
-
1647
- function s(t) {
1648
- try {
1649
- u(o["throw"](t));
1650
- } catch (t) {
1651
- i(t);
1252
+ function s(t) {
1253
+ try {
1254
+ u(o["throw"](t));
1255
+ } catch (t) {
1256
+ i(t);
1257
+ }
1652
1258
  }
1653
- }
1654
-
1655
- function u(e) {
1656
- var r;
1657
- e.done ? t(e.value) : (r = e.value, r instanceof n ? r : new n(function (t) {
1658
- t(r);
1659
- })).then(a, s);
1660
- }
1661
-
1662
- u((o = o.apply(e, r || [])).next());
1663
- });
1664
- var e, r, n, o;
1665
- }
1666
-
1667
- var h = {
1668
- L: .07,
1669
- M: .15,
1670
- Q: .25,
1671
- H: .3
1672
- };
1673
-
1674
- var _c = function c() {
1675
- return (_c = Object.assign || function (t) {
1676
- for (var e, r = 1, n = arguments.length; r < n; r++) {
1677
- for (var o in e = arguments[r]) {
1678
- Object.prototype.hasOwnProperty.call(e, o) && (t[o] = e[o]);
1259
+ function u(e) {
1260
+ var r;
1261
+ e.done ? t(e.value) : (r = e.value, r instanceof n ? r : new n(function (t) {
1262
+ t(r);
1263
+ })).then(a, s);
1679
1264
  }
1680
- }
1681
-
1682
- return t;
1683
- }).apply(this, arguments);
1684
- };
1685
-
1686
- var l = function () {
1687
- function t(t) {
1688
- var e = t.svg,
1689
- r = t.type;
1690
- this._svg = e, this._type = r;
1265
+ u((o = o.apply(e, r || [])).next());
1266
+ });
1267
+ var e, r, n, o;
1691
1268
  }
1692
-
1693
- return t.prototype.draw = function (t, e, r, n) {
1694
- var o;
1695
-
1696
- switch (this._type) {
1697
- case "dots":
1698
- o = this._drawDot;
1699
- break;
1700
-
1701
- case "classy":
1702
- o = this._drawClassy;
1703
- break;
1704
-
1705
- case "classy-rounded":
1706
- o = this._drawClassyRounded;
1707
- break;
1708
-
1709
- case "rounded":
1710
- o = this._drawRounded;
1711
- break;
1712
-
1713
- case "extra-rounded":
1714
- o = this._drawExtraRounded;
1715
- break;
1716
-
1717
- case "square":
1718
- default:
1719
- o = this._drawSquare;
1269
+ var h = {
1270
+ L: .07,
1271
+ M: .15,
1272
+ Q: .25,
1273
+ H: .3
1274
+ };
1275
+ var _c = function c() {
1276
+ return (_c = Object.assign || function (t) {
1277
+ for (var e, r = 1, n = arguments.length; r < n; r++) for (var o in e = arguments[r]) Object.prototype.hasOwnProperty.call(e, o) && (t[o] = e[o]);
1278
+ return t;
1279
+ }).apply(this, arguments);
1280
+ };
1281
+ var l = function () {
1282
+ function t(t) {
1283
+ var e = t.svg,
1284
+ r = t.type;
1285
+ this._svg = e, this._type = r;
1720
1286
  }
1721
-
1722
- o.call(this, {
1723
- x: t,
1724
- y: e,
1725
- size: r,
1726
- getNeighbor: n
1727
- });
1728
- }, t.prototype._rotateFigure = function (t) {
1729
- var e,
1287
+ return t.prototype.draw = function (t, e, r, n) {
1288
+ var o;
1289
+ switch (this._type) {
1290
+ case "dots":
1291
+ o = this._drawDot;
1292
+ break;
1293
+ case "classy":
1294
+ o = this._drawClassy;
1295
+ break;
1296
+ case "classy-rounded":
1297
+ o = this._drawClassyRounded;
1298
+ break;
1299
+ case "rounded":
1300
+ o = this._drawRounded;
1301
+ break;
1302
+ case "extra-rounded":
1303
+ o = this._drawExtraRounded;
1304
+ break;
1305
+ case "square":
1306
+ default:
1307
+ o = this._drawSquare;
1308
+ }
1309
+ o.call(this, {
1310
+ x: t,
1311
+ y: e,
1312
+ size: r,
1313
+ getNeighbor: n
1314
+ });
1315
+ }, t.prototype._rotateFigure = function (t) {
1316
+ var e,
1730
1317
  r = t.x,
1731
1318
  n = t.y,
1732
1319
  o = t.size,
@@ -1734,97 +1321,89 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
1734
1321
  a = void 0 === i ? 0 : i,
1735
1322
  s = r + o / 2,
1736
1323
  u = n + o / 2;
1737
- (0, t.draw)(), null === (e = this._element) || void 0 === e || e.setAttribute("transform", "rotate(" + 180 * a / Math.PI + "," + s + "," + u + ")");
1738
- }, t.prototype._basicDot = function (t) {
1739
- var e = this,
1324
+ (0, t.draw)(), null === (e = this._element) || void 0 === e || e.setAttribute("transform", "rotate(" + 180 * a / Math.PI + "," + s + "," + u + ")");
1325
+ }, t.prototype._basicDot = function (t) {
1326
+ var e = this,
1740
1327
  r = t.size,
1741
1328
  n = t.x,
1742
1329
  o = t.y;
1743
-
1744
- this._rotateFigure(_c(_c({}, t), {
1745
- draw: function draw() {
1746
- 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));
1747
- }
1748
- }));
1749
- }, t.prototype._basicSquare = function (t) {
1750
- var e = this,
1330
+ this._rotateFigure(_c(_c({}, t), {
1331
+ draw: function draw() {
1332
+ 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));
1333
+ }
1334
+ }));
1335
+ }, t.prototype._basicSquare = function (t) {
1336
+ var e = this,
1751
1337
  r = t.size,
1752
1338
  n = t.x,
1753
1339
  o = t.y;
1754
-
1755
- this._rotateFigure(_c(_c({}, t), {
1756
- draw: function draw() {
1757
- 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));
1758
- }
1759
- }));
1760
- }, t.prototype._basicSideRounded = function (t) {
1761
- var e = this,
1340
+ this._rotateFigure(_c(_c({}, t), {
1341
+ draw: function draw() {
1342
+ 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));
1343
+ }
1344
+ }));
1345
+ }, t.prototype._basicSideRounded = function (t) {
1346
+ var e = this,
1762
1347
  r = t.size,
1763
1348
  n = t.x,
1764
1349
  o = t.y;
1765
-
1766
- this._rotateFigure(_c(_c({}, t), {
1767
- draw: function draw() {
1768
- 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);
1769
- }
1770
- }));
1771
- }, t.prototype._basicCornerRounded = function (t) {
1772
- var e = this,
1350
+ this._rotateFigure(_c(_c({}, t), {
1351
+ draw: function draw() {
1352
+ 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);
1353
+ }
1354
+ }));
1355
+ }, t.prototype._basicCornerRounded = function (t) {
1356
+ var e = this,
1773
1357
  r = t.size,
1774
1358
  n = t.x,
1775
1359
  o = t.y;
1776
-
1777
- this._rotateFigure(_c(_c({}, t), {
1778
- draw: function draw() {
1779
- 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);
1780
- }
1781
- }));
1782
- }, t.prototype._basicCornerExtraRounded = function (t) {
1783
- var e = this,
1360
+ this._rotateFigure(_c(_c({}, t), {
1361
+ draw: function draw() {
1362
+ 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);
1363
+ }
1364
+ }));
1365
+ }, t.prototype._basicCornerExtraRounded = function (t) {
1366
+ var e = this,
1784
1367
  r = t.size,
1785
1368
  n = t.x,
1786
1369
  o = t.y;
1787
-
1788
- this._rotateFigure(_c(_c({}, t), {
1789
- draw: function draw() {
1790
- 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);
1791
- }
1792
- }));
1793
- }, t.prototype._basicCornersRounded = function (t) {
1794
- var e = this,
1370
+ this._rotateFigure(_c(_c({}, t), {
1371
+ draw: function draw() {
1372
+ 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);
1373
+ }
1374
+ }));
1375
+ }, t.prototype._basicCornersRounded = function (t) {
1376
+ var e = this,
1795
1377
  r = t.size,
1796
1378
  n = t.x,
1797
1379
  o = t.y;
1798
-
1799
- this._rotateFigure(_c(_c({}, t), {
1800
- draw: function draw() {
1801
- 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);
1802
- }
1803
- }));
1804
- }, t.prototype._drawDot = function (t) {
1805
- var e = t.x,
1380
+ this._rotateFigure(_c(_c({}, t), {
1381
+ draw: function draw() {
1382
+ 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);
1383
+ }
1384
+ }));
1385
+ }, t.prototype._drawDot = function (t) {
1386
+ var e = t.x,
1806
1387
  r = t.y,
1807
1388
  n = t.size;
1808
-
1809
- this._basicDot({
1810
- x: e,
1811
- y: r,
1812
- size: n,
1813
- rotation: 0
1814
- });
1815
- }, t.prototype._drawSquare = function (t) {
1816
- var e = t.x,
1389
+ this._basicDot({
1390
+ x: e,
1391
+ y: r,
1392
+ size: n,
1393
+ rotation: 0
1394
+ });
1395
+ }, t.prototype._drawSquare = function (t) {
1396
+ var e = t.x,
1817
1397
  r = t.y,
1818
1398
  n = t.size;
1819
-
1820
- this._basicSquare({
1821
- x: e,
1822
- y: r,
1823
- size: n,
1824
- rotation: 0
1825
- });
1826
- }, t.prototype._drawRounded = function (t) {
1827
- var e = t.x,
1399
+ this._basicSquare({
1400
+ x: e,
1401
+ y: r,
1402
+ size: n,
1403
+ rotation: 0
1404
+ });
1405
+ }, t.prototype._drawRounded = function (t) {
1406
+ var e = t.x,
1828
1407
  r = t.y,
1829
1408
  n = t.size,
1830
1409
  o = t.getNeighbor,
@@ -1833,38 +1412,37 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
1833
1412
  s = o ? +o(0, -1) : 0,
1834
1413
  u = o ? +o(0, 1) : 0,
1835
1414
  h = i + a + s + u;
1836
- if (0 !== h) {
1837
- if (h > 2 || i && a || s && u) this._basicSquare({
1838
- x: e,
1839
- y: r,
1840
- size: n,
1841
- rotation: 0
1842
- });else {
1843
- if (2 === h) {
1844
- var c = 0;
1845
- return i && s ? c = Math.PI / 2 : s && a ? c = Math.PI : a && u && (c = -Math.PI / 2), void this._basicCornerRounded({
1415
+ if (0 !== h) {
1416
+ if (h > 2 || i && a || s && u) this._basicSquare({
1417
+ x: e,
1418
+ y: r,
1419
+ size: n,
1420
+ rotation: 0
1421
+ });else {
1422
+ if (2 === h) {
1423
+ var c = 0;
1424
+ return i && s ? c = Math.PI / 2 : s && a ? c = Math.PI : a && u && (c = -Math.PI / 2), void this._basicCornerRounded({
1425
+ x: e,
1426
+ y: r,
1427
+ size: n,
1428
+ rotation: c
1429
+ });
1430
+ }
1431
+ if (1 === h) return c = 0, s ? c = Math.PI / 2 : a ? c = Math.PI : u && (c = -Math.PI / 2), void this._basicSideRounded({
1846
1432
  x: e,
1847
1433
  y: r,
1848
1434
  size: n,
1849
1435
  rotation: c
1850
1436
  });
1851
1437
  }
1852
-
1853
- if (1 === h) return c = 0, s ? c = Math.PI / 2 : a ? c = Math.PI : u && (c = -Math.PI / 2), void this._basicSideRounded({
1854
- x: e,
1855
- y: r,
1856
- size: n,
1857
- rotation: c
1858
- });
1859
- }
1860
- } else this._basicDot({
1861
- x: e,
1862
- y: r,
1863
- size: n,
1864
- rotation: 0
1865
- });
1866
- }, t.prototype._drawExtraRounded = function (t) {
1867
- var e = t.x,
1438
+ } else this._basicDot({
1439
+ x: e,
1440
+ y: r,
1441
+ size: n,
1442
+ rotation: 0
1443
+ });
1444
+ }, t.prototype._drawExtraRounded = function (t) {
1445
+ var e = t.x,
1868
1446
  r = t.y,
1869
1447
  n = t.size,
1870
1448
  o = t.getNeighbor,
@@ -1873,38 +1451,37 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
1873
1451
  s = o ? +o(0, -1) : 0,
1874
1452
  u = o ? +o(0, 1) : 0,
1875
1453
  h = i + a + s + u;
1876
- if (0 !== h) {
1877
- if (h > 2 || i && a || s && u) this._basicSquare({
1878
- x: e,
1879
- y: r,
1880
- size: n,
1881
- rotation: 0
1882
- });else {
1883
- if (2 === h) {
1884
- var c = 0;
1885
- return i && s ? c = Math.PI / 2 : s && a ? c = Math.PI : a && u && (c = -Math.PI / 2), void this._basicCornerExtraRounded({
1454
+ if (0 !== h) {
1455
+ if (h > 2 || i && a || s && u) this._basicSquare({
1456
+ x: e,
1457
+ y: r,
1458
+ size: n,
1459
+ rotation: 0
1460
+ });else {
1461
+ if (2 === h) {
1462
+ var c = 0;
1463
+ return i && s ? c = Math.PI / 2 : s && a ? c = Math.PI : a && u && (c = -Math.PI / 2), void this._basicCornerExtraRounded({
1464
+ x: e,
1465
+ y: r,
1466
+ size: n,
1467
+ rotation: c
1468
+ });
1469
+ }
1470
+ if (1 === h) return c = 0, s ? c = Math.PI / 2 : a ? c = Math.PI : u && (c = -Math.PI / 2), void this._basicSideRounded({
1886
1471
  x: e,
1887
1472
  y: r,
1888
1473
  size: n,
1889
1474
  rotation: c
1890
1475
  });
1891
1476
  }
1892
-
1893
- if (1 === h) return c = 0, s ? c = Math.PI / 2 : a ? c = Math.PI : u && (c = -Math.PI / 2), void this._basicSideRounded({
1894
- x: e,
1895
- y: r,
1896
- size: n,
1897
- rotation: c
1898
- });
1899
- }
1900
- } else this._basicDot({
1901
- x: e,
1902
- y: r,
1903
- size: n,
1904
- rotation: 0
1905
- });
1906
- }, t.prototype._drawClassy = function (t) {
1907
- var e = t.x,
1477
+ } else this._basicDot({
1478
+ x: e,
1479
+ y: r,
1480
+ size: n,
1481
+ rotation: 0
1482
+ });
1483
+ }, t.prototype._drawClassy = function (t) {
1484
+ var e = t.x,
1908
1485
  r = t.y,
1909
1486
  n = t.size,
1910
1487
  o = t.getNeighbor,
@@ -1912,29 +1489,29 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
1912
1489
  a = o ? +o(1, 0) : 0,
1913
1490
  s = o ? +o(0, -1) : 0,
1914
1491
  u = o ? +o(0, 1) : 0;
1915
- 0 !== i + a + s + u ? i || s ? a || u ? this._basicSquare({
1916
- x: e,
1917
- y: r,
1918
- size: n,
1919
- rotation: 0
1920
- }) : this._basicCornerRounded({
1921
- x: e,
1922
- y: r,
1923
- size: n,
1924
- rotation: Math.PI / 2
1925
- }) : this._basicCornerRounded({
1926
- x: e,
1927
- y: r,
1928
- size: n,
1929
- rotation: -Math.PI / 2
1930
- }) : this._basicCornersRounded({
1931
- x: e,
1932
- y: r,
1933
- size: n,
1934
- rotation: Math.PI / 2
1935
- });
1936
- }, t.prototype._drawClassyRounded = function (t) {
1937
- var e = t.x,
1492
+ 0 !== i + a + s + u ? i || s ? a || u ? this._basicSquare({
1493
+ x: e,
1494
+ y: r,
1495
+ size: n,
1496
+ rotation: 0
1497
+ }) : this._basicCornerRounded({
1498
+ x: e,
1499
+ y: r,
1500
+ size: n,
1501
+ rotation: Math.PI / 2
1502
+ }) : this._basicCornerRounded({
1503
+ x: e,
1504
+ y: r,
1505
+ size: n,
1506
+ rotation: -Math.PI / 2
1507
+ }) : this._basicCornersRounded({
1508
+ x: e,
1509
+ y: r,
1510
+ size: n,
1511
+ rotation: Math.PI / 2
1512
+ });
1513
+ }, t.prototype._drawClassyRounded = function (t) {
1514
+ var e = t.x,
1938
1515
  r = t.y,
1939
1516
  n = t.size,
1940
1517
  o = t.getNeighbor,
@@ -1942,74 +1519,62 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
1942
1519
  a = o ? +o(1, 0) : 0,
1943
1520
  s = o ? +o(0, -1) : 0,
1944
1521
  u = o ? +o(0, 1) : 0;
1945
- 0 !== i + a + s + u ? i || s ? a || u ? this._basicSquare({
1946
- x: e,
1947
- y: r,
1948
- size: n,
1949
- rotation: 0
1950
- }) : this._basicCornerExtraRounded({
1951
- x: e,
1952
- y: r,
1953
- size: n,
1954
- rotation: Math.PI / 2
1955
- }) : this._basicCornerExtraRounded({
1956
- x: e,
1957
- y: r,
1958
- size: n,
1959
- rotation: -Math.PI / 2
1960
- }) : this._basicCornersRounded({
1961
- x: e,
1962
- y: r,
1963
- size: n,
1964
- rotation: Math.PI / 2
1965
- });
1966
- }, t;
1967
- }();
1968
-
1969
- var _d = function d() {
1970
- return (_d = Object.assign || function (t) {
1971
- for (var e, r = 1, n = arguments.length; r < n; r++) {
1972
- for (var o in e = arguments[r]) {
1973
- Object.prototype.hasOwnProperty.call(e, o) && (t[o] = e[o]);
1974
- }
1975
- }
1976
-
1977
- return t;
1978
- }).apply(this, arguments);
1979
- };
1980
-
1981
- var f = function () {
1982
- function t(t) {
1983
- var e = t.svg,
1522
+ 0 !== i + a + s + u ? i || s ? a || u ? this._basicSquare({
1523
+ x: e,
1524
+ y: r,
1525
+ size: n,
1526
+ rotation: 0
1527
+ }) : this._basicCornerExtraRounded({
1528
+ x: e,
1529
+ y: r,
1530
+ size: n,
1531
+ rotation: Math.PI / 2
1532
+ }) : this._basicCornerExtraRounded({
1533
+ x: e,
1534
+ y: r,
1535
+ size: n,
1536
+ rotation: -Math.PI / 2
1537
+ }) : this._basicCornersRounded({
1538
+ x: e,
1539
+ y: r,
1540
+ size: n,
1541
+ rotation: Math.PI / 2
1542
+ });
1543
+ }, t;
1544
+ }();
1545
+ var _d = function d() {
1546
+ return (_d = Object.assign || function (t) {
1547
+ for (var e, r = 1, n = arguments.length; r < n; r++) for (var o in e = arguments[r]) Object.prototype.hasOwnProperty.call(e, o) && (t[o] = e[o]);
1548
+ return t;
1549
+ }).apply(this, arguments);
1550
+ };
1551
+ var f = function () {
1552
+ function t(t) {
1553
+ var e = t.svg,
1984
1554
  r = t.type;
1985
- this._svg = e, this._type = r;
1986
- }
1987
-
1988
- return t.prototype.draw = function (t, e, r, n) {
1989
- var o;
1990
-
1991
- switch (this._type) {
1992
- case "square":
1993
- o = this._drawSquare;
1994
- break;
1995
-
1996
- case "extra-rounded":
1997
- o = this._drawExtraRounded;
1998
- break;
1999
-
2000
- case "dot":
2001
- default:
2002
- o = this._drawDot;
1555
+ this._svg = e, this._type = r;
2003
1556
  }
2004
-
2005
- o.call(this, {
2006
- x: t,
2007
- y: e,
2008
- size: r,
2009
- rotation: n
2010
- });
2011
- }, t.prototype._rotateFigure = function (t) {
2012
- var e,
1557
+ return t.prototype.draw = function (t, e, r, n) {
1558
+ var o;
1559
+ switch (this._type) {
1560
+ case "square":
1561
+ o = this._drawSquare;
1562
+ break;
1563
+ case "extra-rounded":
1564
+ o = this._drawExtraRounded;
1565
+ break;
1566
+ case "dot":
1567
+ default:
1568
+ o = this._drawDot;
1569
+ }
1570
+ o.call(this, {
1571
+ x: t,
1572
+ y: e,
1573
+ size: r,
1574
+ rotation: n
1575
+ });
1576
+ }, t.prototype._rotateFigure = function (t) {
1577
+ var e,
2013
1578
  r = t.x,
2014
1579
  n = t.y,
2015
1580
  o = t.size,
@@ -2017,976 +1582,849 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
2017
1582
  a = void 0 === i ? 0 : i,
2018
1583
  s = r + o / 2,
2019
1584
  u = n + o / 2;
2020
- (0, t.draw)(), null === (e = this._element) || void 0 === e || e.setAttribute("transform", "rotate(" + 180 * a / Math.PI + "," + s + "," + u + ")");
2021
- }, t.prototype._basicDot = function (t) {
2022
- var e = this,
1585
+ (0, t.draw)(), null === (e = this._element) || void 0 === e || e.setAttribute("transform", "rotate(" + 180 * a / Math.PI + "," + s + "," + u + ")");
1586
+ }, t.prototype._basicDot = function (t) {
1587
+ var e = this,
2023
1588
  r = t.size,
2024
1589
  n = t.x,
2025
1590
  o = t.y,
2026
1591
  i = r / 7;
2027
-
2028
- this._rotateFigure(_d(_d({}, t), {
2029
- draw: function draw() {
2030
- 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");
2031
- }
2032
- }));
2033
- }, t.prototype._basicSquare = function (t) {
2034
- var e = this,
1592
+ this._rotateFigure(_d(_d({}, t), {
1593
+ draw: function draw() {
1594
+ 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");
1595
+ }
1596
+ }));
1597
+ }, t.prototype._basicSquare = function (t) {
1598
+ var e = this,
2035
1599
  r = t.size,
2036
1600
  n = t.x,
2037
1601
  o = t.y,
2038
1602
  i = r / 7;
2039
-
2040
- this._rotateFigure(_d(_d({}, t), {
2041
- draw: function draw() {
2042
- 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");
2043
- }
2044
- }));
2045
- }, t.prototype._basicExtraRounded = function (t) {
2046
- var e = this,
1603
+ this._rotateFigure(_d(_d({}, t), {
1604
+ draw: function draw() {
1605
+ 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");
1606
+ }
1607
+ }));
1608
+ }, t.prototype._basicExtraRounded = function (t) {
1609
+ var e = this,
2047
1610
  r = t.size,
2048
1611
  n = t.x,
2049
1612
  o = t.y,
2050
1613
  i = r / 7;
2051
-
2052
- this._rotateFigure(_d(_d({}, t), {
2053
- draw: function draw() {
2054
- 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);
2055
- }
2056
- }));
2057
- }, t.prototype._drawDot = function (t) {
2058
- var e = t.x,
2059
- r = t.y,
2060
- n = t.size,
2061
- o = t.rotation;
2062
-
2063
- this._basicDot({
2064
- x: e,
2065
- y: r,
2066
- size: n,
2067
- rotation: o
2068
- });
2069
- }, t.prototype._drawSquare = function (t) {
2070
- var e = t.x,
2071
- r = t.y,
2072
- n = t.size,
2073
- o = t.rotation;
2074
-
2075
- this._basicSquare({
2076
- x: e,
2077
- y: r,
2078
- size: n,
2079
- rotation: o
2080
- });
2081
- }, t.prototype._drawExtraRounded = function (t) {
2082
- var e = t.x,
1614
+ this._rotateFigure(_d(_d({}, t), {
1615
+ draw: function draw() {
1616
+ 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);
1617
+ }
1618
+ }));
1619
+ }, t.prototype._drawDot = function (t) {
1620
+ var e = t.x,
2083
1621
  r = t.y,
2084
1622
  n = t.size,
2085
1623
  o = t.rotation;
2086
-
2087
- this._basicExtraRounded({
2088
- x: e,
2089
- y: r,
2090
- size: n,
2091
- rotation: o
2092
- });
2093
- }, t;
2094
- }();
2095
-
2096
- var _g = function g() {
2097
- return (_g = Object.assign || function (t) {
2098
- for (var e, r = 1, n = arguments.length; r < n; r++) {
2099
- for (var o in e = arguments[r]) {
2100
- Object.prototype.hasOwnProperty.call(e, o) && (t[o] = e[o]);
2101
- }
2102
- }
2103
-
2104
- return t;
2105
- }).apply(this, arguments);
2106
- };
2107
-
2108
- var p = function () {
2109
- function t(t) {
2110
- var e = t.svg,
2111
- r = t.type;
2112
- this._svg = e, this._type = r;
2113
- }
2114
-
2115
- return t.prototype.draw = function (t, e, r, n) {
2116
- var o;
2117
-
2118
- switch (this._type) {
2119
- case "square":
2120
- o = this._drawSquare;
2121
- break;
2122
-
2123
- case "dot":
2124
- default:
2125
- o = this._drawDot;
2126
- }
2127
-
2128
- o.call(this, {
2129
- x: t,
2130
- y: e,
2131
- size: r,
2132
- rotation: n
2133
- });
2134
- }, t.prototype._rotateFigure = function (t) {
2135
- var e,
2136
- r = t.x,
2137
- n = t.y,
2138
- o = t.size,
2139
- i = t.rotation,
2140
- a = void 0 === i ? 0 : i,
2141
- s = r + o / 2,
2142
- u = n + o / 2;
2143
- (0, t.draw)(), null === (e = this._element) || void 0 === e || e.setAttribute("transform", "rotate(" + 180 * a / Math.PI + "," + s + "," + u + ")");
2144
- }, t.prototype._basicDot = function (t) {
2145
- var e = this,
2146
- r = t.size,
2147
- n = t.x,
2148
- o = t.y;
2149
-
2150
- this._rotateFigure(_g(_g({}, t), {
2151
- draw: function draw() {
2152
- 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));
2153
- }
2154
- }));
2155
- }, t.prototype._basicSquare = function (t) {
2156
- var e = this,
2157
- r = t.size,
2158
- n = t.x,
2159
- o = t.y;
2160
-
2161
- this._rotateFigure(_g(_g({}, t), {
2162
- draw: function draw() {
2163
- 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));
2164
- }
2165
- }));
2166
- }, t.prototype._drawDot = function (t) {
2167
- var e = t.x,
1624
+ this._basicDot({
1625
+ x: e,
1626
+ y: r,
1627
+ size: n,
1628
+ rotation: o
1629
+ });
1630
+ }, t.prototype._drawSquare = function (t) {
1631
+ var e = t.x,
2168
1632
  r = t.y,
2169
1633
  n = t.size,
2170
1634
  o = t.rotation;
2171
-
2172
- this._basicDot({
2173
- x: e,
2174
- y: r,
2175
- size: n,
2176
- rotation: o
2177
- });
2178
- }, t.prototype._drawSquare = function (t) {
2179
- var e = t.x,
1635
+ this._basicSquare({
1636
+ x: e,
1637
+ y: r,
1638
+ size: n,
1639
+ rotation: o
1640
+ });
1641
+ }, t.prototype._drawExtraRounded = function (t) {
1642
+ var e = t.x,
2180
1643
  r = t.y,
2181
1644
  n = t.size,
2182
1645
  o = t.rotation;
2183
-
2184
- this._basicSquare({
2185
- x: e,
2186
- y: r,
2187
- size: n,
2188
- rotation: o
2189
- });
2190
- }, t;
2191
- }(),
2192
- v = "circle";
2193
-
2194
- var w = function w(t, e, r, n) {
2195
- return new (r || (r = Promise))(function (o, i) {
2196
- function a(t) {
2197
- try {
2198
- u(n.next(t));
2199
- } catch (t) {
2200
- i(t);
2201
- }
2202
- }
2203
-
2204
- function s(t) {
2205
- try {
2206
- u(n["throw"](t));
2207
- } catch (t) {
2208
- i(t);
2209
- }
2210
- }
2211
-
2212
- function u(t) {
2213
- var e;
2214
- t.done ? o(t.value) : (e = t.value, e instanceof r ? e : new r(function (t) {
2215
- t(e);
2216
- })).then(a, s);
2217
- }
2218
-
2219
- u((n = n.apply(t, e || [])).next());
2220
- });
2221
- },
2222
- y = function y(t, e) {
2223
- var r,
2224
- n,
2225
- o,
2226
- i,
2227
- a = {
2228
- label: 0,
2229
- sent: function sent() {
2230
- if (1 & o[0]) throw o[1];
2231
- return o[1];
2232
- },
2233
- trys: [],
2234
- ops: []
1646
+ this._basicExtraRounded({
1647
+ x: e,
1648
+ y: r,
1649
+ size: n,
1650
+ rotation: o
1651
+ });
1652
+ }, t;
1653
+ }();
1654
+ var _g = function g() {
1655
+ return (_g = Object.assign || function (t) {
1656
+ for (var e, r = 1, n = arguments.length; r < n; r++) for (var o in e = arguments[r]) Object.prototype.hasOwnProperty.call(e, o) && (t[o] = e[o]);
1657
+ return t;
1658
+ }).apply(this, arguments);
2235
1659
  };
2236
- return i = {
2237
- next: s(0),
2238
- "throw": s(1),
2239
- "return": s(2)
2240
- }, "function" == typeof Symbol && (i[Symbol.iterator] = function () {
2241
- return this;
2242
- }), i;
2243
-
2244
- function s(i) {
2245
- return function (s) {
2246
- return function (i) {
2247
- if (r) throw new TypeError("Generator is already executing.");
2248
-
2249
- for (; a;) {
1660
+ var p = function () {
1661
+ function t(t) {
1662
+ var e = t.svg,
1663
+ r = t.type;
1664
+ this._svg = e, this._type = r;
1665
+ }
1666
+ return t.prototype.draw = function (t, e, r, n) {
1667
+ var o;
1668
+ switch (this._type) {
1669
+ case "square":
1670
+ o = this._drawSquare;
1671
+ break;
1672
+ case "dot":
1673
+ default:
1674
+ o = this._drawDot;
1675
+ }
1676
+ o.call(this, {
1677
+ x: t,
1678
+ y: e,
1679
+ size: r,
1680
+ rotation: n
1681
+ });
1682
+ }, t.prototype._rotateFigure = function (t) {
1683
+ var e,
1684
+ r = t.x,
1685
+ n = t.y,
1686
+ o = t.size,
1687
+ i = t.rotation,
1688
+ a = void 0 === i ? 0 : i,
1689
+ s = r + o / 2,
1690
+ u = n + o / 2;
1691
+ (0, t.draw)(), null === (e = this._element) || void 0 === e || e.setAttribute("transform", "rotate(" + 180 * a / Math.PI + "," + s + "," + u + ")");
1692
+ }, t.prototype._basicDot = function (t) {
1693
+ var e = this,
1694
+ r = t.size,
1695
+ n = t.x,
1696
+ o = t.y;
1697
+ this._rotateFigure(_g(_g({}, t), {
1698
+ draw: function draw() {
1699
+ 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));
1700
+ }
1701
+ }));
1702
+ }, t.prototype._basicSquare = function (t) {
1703
+ var e = this,
1704
+ r = t.size,
1705
+ n = t.x,
1706
+ o = t.y;
1707
+ this._rotateFigure(_g(_g({}, t), {
1708
+ draw: function draw() {
1709
+ 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));
1710
+ }
1711
+ }));
1712
+ }, t.prototype._drawDot = function (t) {
1713
+ var e = t.x,
1714
+ r = t.y,
1715
+ n = t.size,
1716
+ o = t.rotation;
1717
+ this._basicDot({
1718
+ x: e,
1719
+ y: r,
1720
+ size: n,
1721
+ rotation: o
1722
+ });
1723
+ }, t.prototype._drawSquare = function (t) {
1724
+ var e = t.x,
1725
+ r = t.y,
1726
+ n = t.size,
1727
+ o = t.rotation;
1728
+ this._basicSquare({
1729
+ x: e,
1730
+ y: r,
1731
+ size: n,
1732
+ rotation: o
1733
+ });
1734
+ }, t;
1735
+ }(),
1736
+ v = "circle";
1737
+ var w = function w(t, e, r, n) {
1738
+ return new (r || (r = Promise))(function (o, i) {
1739
+ function a(t) {
2250
1740
  try {
2251
- 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;
2252
-
2253
- switch (n = 0, o && (i = [2 & i[0], o.value]), i[0]) {
2254
- case 0:
2255
- case 1:
2256
- o = i;
2257
- break;
2258
-
2259
- case 4:
2260
- return a.label++, {
2261
- value: i[1],
2262
- done: !1
2263
- };
2264
-
2265
- case 5:
2266
- a.label++, n = i[1], i = [0];
2267
- continue;
2268
-
2269
- case 7:
2270
- i = a.ops.pop(), a.trys.pop();
2271
- continue;
2272
-
2273
- default:
2274
- if (!((o = (o = a.trys).length > 0 && o[o.length - 1]) || 6 !== i[0] && 2 !== i[0])) {
2275
- a = 0;
2276
- continue;
2277
- }
2278
-
2279
- if (3 === i[0] && (!o || i[1] > o[0] && i[1] < o[3])) {
2280
- a.label = i[1];
2281
- break;
2282
- }
2283
-
2284
- if (6 === i[0] && a.label < o[1]) {
2285
- a.label = o[1], o = i;
2286
- break;
2287
- }
2288
-
2289
- if (o && a.label < o[2]) {
2290
- a.label = o[2], a.ops.push(i);
2291
- break;
2292
- }
2293
-
2294
- o[2] && a.ops.pop(), a.trys.pop();
2295
- continue;
2296
- }
2297
-
2298
- i = e.call(t, a);
1741
+ u(n.next(t));
2299
1742
  } catch (t) {
2300
- i = [6, t], n = 0;
2301
- } finally {
2302
- r = o = 0;
1743
+ i(t);
2303
1744
  }
2304
1745
  }
2305
-
2306
- if (5 & i[0]) throw i[1];
2307
- return {
2308
- value: i[0] ? i[1] : void 0,
2309
- done: !0
2310
- };
2311
- }([i, s]);
2312
- };
2313
- }
2314
- },
2315
- 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]],
2316
- 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]];
2317
-
2318
- var _ = function () {
2319
- function t(t) {
2320
- 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;
2321
- }
2322
-
2323
- return Object.defineProperty(t.prototype, "width", {
2324
- get: function get() {
2325
- return this._options.width;
2326
- },
2327
- enumerable: !1,
2328
- configurable: !0
2329
- }), Object.defineProperty(t.prototype, "height", {
2330
- get: function get() {
2331
- return this._options.height;
2332
- },
2333
- enumerable: !1,
2334
- configurable: !0
2335
- }), t.prototype.getElement = function () {
2336
- return this._element;
2337
- }, t.prototype.drawQR = function (t) {
2338
- return w(this, void 0, void 0, function () {
2339
- var e,
2340
- r,
2341
- n,
2342
- o,
2343
- i,
2344
- a,
2345
- s,
2346
- u,
2347
- c,
2348
- l,
2349
- d = this;
2350
- return y(this, function (f) {
2351
- switch (f.label) {
2352
- case 0:
2353
- 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 = {
2354
- hideXDots: 0,
2355
- hideYDots: 0,
2356
- width: 0,
2357
- height: 0
2358
- }, this._qr = t, this._options.image ? [4, this.loadImage()] : [3, 2];
2359
-
2360
- case 1:
2361
- if (f.sent(), !this._image) return [2];
2362
- a = this._options, s = a.imageOptions, u = a.qrOptions, c = s.imageSize * h[u.errorCorrectionLevel], l = Math.floor(c * e * e), i = function (t) {
2363
- var e = t.originalHeight,
2364
- r = t.originalWidth,
2365
- n = t.maxHiddenDots,
2366
- o = t.maxHiddenAxisDots,
2367
- i = t.dotSize,
2368
- a = {
2369
- x: 0,
2370
- y: 0
2371
- },
2372
- s = {
2373
- x: 0,
2374
- y: 0
2375
- };
2376
- if (e <= 0 || r <= 0 || n <= 0 || i <= 0) return {
2377
- height: 0,
2378
- width: 0,
2379
- hideYDots: 0,
2380
- hideXDots: 0
2381
- };
2382
- var u = e / r;
2383
- 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)), {
2384
- height: s.y,
2385
- width: s.x,
2386
- hideYDots: a.y,
2387
- hideXDots: a.x
2388
- };
2389
- }({
2390
- originalWidth: this._image.width,
2391
- originalHeight: this._image.height,
2392
- maxHiddenDots: l,
2393
- maxHiddenAxisDots: e - 14,
2394
- dotSize: o
2395
- }), f.label = 2;
2396
-
2397
- case 2:
2398
- return this.drawBackground(), this.drawDots(function (t, r) {
2399
- var n, o, a, s, u, h;
2400
- 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]));
2401
- }), this.drawCorners(), this._options.image ? [4, this.drawImage({
2402
- width: i.width,
2403
- height: i.height,
2404
- count: e,
2405
- dotSize: o
2406
- })] : [3, 4];
2407
-
2408
- case 3:
2409
- f.sent(), f.label = 4;
2410
-
2411
- case 4:
2412
- return [2];
1746
+ function s(t) {
1747
+ try {
1748
+ u(n["throw"](t));
1749
+ } catch (t) {
1750
+ i(t);
1751
+ }
1752
+ }
1753
+ function u(t) {
1754
+ var e;
1755
+ t.done ? o(t.value) : (e = t.value, e instanceof r ? e : new r(function (t) {
1756
+ t(e);
1757
+ })).then(a, s);
2413
1758
  }
1759
+ u((n = n.apply(t, e || [])).next());
2414
1760
  });
2415
- });
2416
- }, t.prototype.drawBackground = function () {
2417
- var t,
2418
- e,
2419
- r,
2420
- n = this._element,
2421
- o = this._options;
2422
-
2423
- if (n) {
2424
- var i = null === (t = o.backgroundOptions) || void 0 === t ? void 0 : t.gradient,
2425
- a = null === (e = o.backgroundOptions) || void 0 === e ? void 0 : e.color;
2426
-
2427
- if ((i || a) && this._createColor({
2428
- options: i,
2429
- color: a,
2430
- additionalRotation: 0,
2431
- x: 0,
2432
- y: 0,
2433
- height: o.height,
2434
- width: o.width,
2435
- name: "background-color"
2436
- }), null === (r = o.backgroundOptions) || void 0 === r ? void 0 : r.round) {
2437
- var s = Math.min(o.width, o.height),
2438
- u = document.createElementNS("http://www.w3.org/2000/svg", "rect");
2439
- 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);
2440
- }
2441
- }
2442
- }, t.prototype.drawDots = function (t) {
2443
- var e,
2444
- r,
2445
- n = this;
2446
- if (!this._qr) throw "QR code is not defined";
2447
-
2448
- var o = this._options,
2449
- i = this._qr.getModuleCount();
2450
-
2451
- if (i > o.width || i > o.height) throw "The canvas is too small.";
2452
- var a = Math.min(o.width, o.height) - 2 * o.margin,
2453
- s = o.shape === v ? a / Math.sqrt(2) : a,
2454
- u = Math.floor(s / i),
2455
- h = Math.floor((o.width - i * u) / 2),
2456
- c = Math.floor((o.height - i * u) / 2),
2457
- d = new l({
2458
- svg: this._element,
2459
- type: o.dotsOptions.type
2460
- });
2461
- this._dotsClipPath = document.createElementNS("http://www.w3.org/2000/svg", "clipPath"), this._dotsClipPath.setAttribute("id", "clip-path-dot-color"), this._defs.appendChild(this._dotsClipPath), this._createColor({
2462
- options: null === (e = o.dotsOptions) || void 0 === e ? void 0 : e.gradient,
2463
- color: o.dotsOptions.color,
2464
- additionalRotation: 0,
2465
- x: 0,
2466
- y: 0,
2467
- height: o.height,
2468
- width: o.width,
2469
- name: "dot-color"
2470
- });
2471
-
2472
- for (var f = function f(e) {
2473
- for (var o = function o(_o) {
2474
- 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) {
2475
- 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);
2476
- }), void (d._element && g._dotsClipPath && g._dotsClipPath.appendChild(d._element))) : "continue";
2477
- }, a = 0; a < i; a++) {
2478
- o(a);
1761
+ },
1762
+ y = function y(t, e) {
1763
+ var r,
1764
+ n,
1765
+ o,
1766
+ i,
1767
+ a = {
1768
+ label: 0,
1769
+ sent: function sent() {
1770
+ if (1 & o[0]) throw o[1];
1771
+ return o[1];
1772
+ },
1773
+ trys: [],
1774
+ ops: []
1775
+ };
1776
+ return i = {
1777
+ next: s(0),
1778
+ "throw": s(1),
1779
+ "return": s(2)
1780
+ }, "function" == typeof Symbol && (i[Symbol.iterator] = function () {
1781
+ return this;
1782
+ }), i;
1783
+ function s(i) {
1784
+ return function (s) {
1785
+ return function (i) {
1786
+ if (r) throw new TypeError("Generator is already executing.");
1787
+ for (; a;) try {
1788
+ 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;
1789
+ switch (n = 0, o && (i = [2 & i[0], o.value]), i[0]) {
1790
+ case 0:
1791
+ case 1:
1792
+ o = i;
1793
+ break;
1794
+ case 4:
1795
+ return a.label++, {
1796
+ value: i[1],
1797
+ done: !1
1798
+ };
1799
+ case 5:
1800
+ a.label++, n = i[1], i = [0];
1801
+ continue;
1802
+ case 7:
1803
+ i = a.ops.pop(), a.trys.pop();
1804
+ continue;
1805
+ default:
1806
+ if (!((o = (o = a.trys).length > 0 && o[o.length - 1]) || 6 !== i[0] && 2 !== i[0])) {
1807
+ a = 0;
1808
+ continue;
1809
+ }
1810
+ if (3 === i[0] && (!o || i[1] > o[0] && i[1] < o[3])) {
1811
+ a.label = i[1];
1812
+ break;
1813
+ }
1814
+ if (6 === i[0] && a.label < o[1]) {
1815
+ a.label = o[1], o = i;
1816
+ break;
1817
+ }
1818
+ if (o && a.label < o[2]) {
1819
+ a.label = o[2], a.ops.push(i);
1820
+ break;
1821
+ }
1822
+ o[2] && a.ops.pop(), a.trys.pop();
1823
+ continue;
1824
+ }
1825
+ i = e.call(t, a);
1826
+ } catch (t) {
1827
+ i = [6, t], n = 0;
1828
+ } finally {
1829
+ r = o = 0;
1830
+ }
1831
+ if (5 & i[0]) throw i[1];
1832
+ return {
1833
+ value: i[0] ? i[1] : void 0,
1834
+ done: !0
1835
+ };
1836
+ }([i, s]);
1837
+ };
2479
1838
  }
2480
- }, g = this, p = 0; p < i; p++) {
2481
- f(p);
2482
- }
2483
-
2484
- if (o.shape === v) {
2485
- var w = Math.floor((a / u - i) / 2),
2486
- y = i + 2 * w,
2487
- m = h - w * u,
2488
- b = c - w * u,
2489
- _ = [],
2490
- x = Math.floor(y / 2);
2491
-
2492
- for (p = 0; p < y; p++) {
2493
- _[p] = [];
2494
-
2495
- for (var S = 0; S < y; S++) {
2496
- 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;
2497
- }
1839
+ },
1840
+ 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]],
1841
+ 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]];
1842
+ var _ = function () {
1843
+ function t(t) {
1844
+ 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;
2498
1845
  }
2499
-
2500
- var M = function M(t) {
2501
- for (var e = function e(_e2) {
2502
- if (!_[t][_e2]) return "continue";
2503
- d.draw(m + t * u, b + _e2 * u, u, function (r, n) {
2504
- var o;
2505
- return !!(null === (o = _[t + r]) || void 0 === o ? void 0 : o[_e2 + n]);
2506
- }), d._element && C._dotsClipPath && C._dotsClipPath.appendChild(d._element);
2507
- }, r = 0; r < y; r++) {
2508
- e(r);
1846
+ return Object.defineProperty(t.prototype, "width", {
1847
+ get: function get() {
1848
+ return this._options.width;
1849
+ },
1850
+ enumerable: !1,
1851
+ configurable: !0
1852
+ }), Object.defineProperty(t.prototype, "height", {
1853
+ get: function get() {
1854
+ return this._options.height;
1855
+ },
1856
+ enumerable: !1,
1857
+ configurable: !0
1858
+ }), t.prototype.getElement = function () {
1859
+ return this._element;
1860
+ }, t.prototype.drawQR = function (t) {
1861
+ return w(this, void 0, void 0, function () {
1862
+ var e,
1863
+ r,
1864
+ n,
1865
+ o,
1866
+ i,
1867
+ a,
1868
+ s,
1869
+ u,
1870
+ c,
1871
+ l,
1872
+ d = this;
1873
+ return y(this, function (f) {
1874
+ switch (f.label) {
1875
+ case 0:
1876
+ 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 = {
1877
+ hideXDots: 0,
1878
+ hideYDots: 0,
1879
+ width: 0,
1880
+ height: 0
1881
+ }, this._qr = t, this._options.image ? [4, this.loadImage()] : [3, 2];
1882
+ case 1:
1883
+ if (f.sent(), !this._image) return [2];
1884
+ a = this._options, s = a.imageOptions, u = a.qrOptions, c = s.imageSize * h[u.errorCorrectionLevel], l = Math.floor(c * e * e), i = function (t) {
1885
+ var e = t.originalHeight,
1886
+ r = t.originalWidth,
1887
+ n = t.maxHiddenDots,
1888
+ o = t.maxHiddenAxisDots,
1889
+ i = t.dotSize,
1890
+ a = {
1891
+ x: 0,
1892
+ y: 0
1893
+ },
1894
+ s = {
1895
+ x: 0,
1896
+ y: 0
1897
+ };
1898
+ if (e <= 0 || r <= 0 || n <= 0 || i <= 0) return {
1899
+ height: 0,
1900
+ width: 0,
1901
+ hideYDots: 0,
1902
+ hideXDots: 0
1903
+ };
1904
+ var u = e / r;
1905
+ 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)), {
1906
+ height: s.y,
1907
+ width: s.x,
1908
+ hideYDots: a.y,
1909
+ hideXDots: a.x
1910
+ };
1911
+ }({
1912
+ originalWidth: this._image.width,
1913
+ originalHeight: this._image.height,
1914
+ maxHiddenDots: l,
1915
+ maxHiddenAxisDots: e - 14,
1916
+ dotSize: o
1917
+ }), f.label = 2;
1918
+ case 2:
1919
+ return this.drawBackground(), this.drawDots(function (t, r) {
1920
+ var n, o, a, s, u, h;
1921
+ 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]));
1922
+ }), this.drawCorners(), this._options.image ? [4, this.drawImage({
1923
+ width: i.width,
1924
+ height: i.height,
1925
+ count: e,
1926
+ dotSize: o
1927
+ })] : [3, 4];
1928
+ case 3:
1929
+ f.sent(), f.label = 4;
1930
+ case 4:
1931
+ return [2];
1932
+ }
1933
+ });
1934
+ });
1935
+ }, t.prototype.drawBackground = function () {
1936
+ var t,
1937
+ e,
1938
+ r,
1939
+ n = this._element,
1940
+ o = this._options;
1941
+ if (n) {
1942
+ var i = null === (t = o.backgroundOptions) || void 0 === t ? void 0 : t.gradient,
1943
+ a = null === (e = o.backgroundOptions) || void 0 === e ? void 0 : e.color;
1944
+ if ((i || a) && this._createColor({
1945
+ options: i,
1946
+ color: a,
1947
+ additionalRotation: 0,
1948
+ x: 0,
1949
+ y: 0,
1950
+ height: o.height,
1951
+ width: o.width,
1952
+ name: "background-color"
1953
+ }), null === (r = o.backgroundOptions) || void 0 === r ? void 0 : r.round) {
1954
+ var s = Math.min(o.width, o.height),
1955
+ u = document.createElementNS("http://www.w3.org/2000/svg", "rect");
1956
+ 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);
1957
+ }
2509
1958
  }
2510
- },
2511
- C = this;
2512
-
2513
- for (p = 0; p < y; p++) {
2514
- M(p);
2515
- }
2516
- }
2517
- }, t.prototype.drawCorners = function () {
2518
- var t = this;
2519
- if (!this._qr) throw "QR code is not defined";
2520
- var e = this._element,
2521
- r = this._options;
2522
- if (!e) throw "Element code is not defined";
2523
-
2524
- var n = this._qr.getModuleCount(),
2525
- o = Math.min(r.width, r.height) - 2 * r.margin,
2526
- i = r.shape === v ? o / Math.sqrt(2) : o,
2527
- a = Math.floor(i / n),
2528
- s = 7 * a,
2529
- u = 3 * a,
2530
- h = Math.floor((r.width - n * a) / 2),
2531
- c = Math.floor((r.height - n * a) / 2);
2532
-
2533
- [[0, 0, 0], [1, 0, Math.PI / 2], [0, 1, -Math.PI / 2]].forEach(function (e) {
2534
- var o,
2535
- i,
2536
- d,
2537
- g,
2538
- v,
2539
- w,
2540
- y,
2541
- _,
2542
- x,
2543
- S,
2544
- M,
2545
- C,
2546
- A = e[0],
2547
- k = e[1],
2548
- O = e[2],
2549
- D = h + A * a * (n - 7),
2550
- P = c + k * a * (n - 7),
2551
- z = t._dotsClipPath,
2552
- B = t._dotsClipPath;
2553
-
2554
- 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({
2555
- options: null === (d = r.cornersSquareOptions) || void 0 === d ? void 0 : d.gradient,
2556
- color: null === (g = r.cornersSquareOptions) || void 0 === g ? void 0 : g.color,
2557
- additionalRotation: O,
2558
- x: D,
2559
- y: P,
2560
- height: s,
2561
- width: s,
2562
- name: "corners-square-color-" + A + "-" + k
2563
- })), null === (v = r.cornersSquareOptions) || void 0 === v ? void 0 : v.type) {
2564
- var q = new f({
2565
- svg: t._element,
2566
- type: r.cornersSquareOptions.type
1959
+ }, t.prototype.drawDots = function (t) {
1960
+ var e,
1961
+ r,
1962
+ n = this;
1963
+ if (!this._qr) throw "QR code is not defined";
1964
+ var o = this._options,
1965
+ i = this._qr.getModuleCount();
1966
+ if (i > o.width || i > o.height) throw "The canvas is too small.";
1967
+ var a = Math.min(o.width, o.height) - 2 * o.margin,
1968
+ s = o.shape === v ? a / Math.sqrt(2) : a,
1969
+ u = Math.floor(s / i),
1970
+ h = Math.floor((o.width - i * u) / 2),
1971
+ c = Math.floor((o.height - i * u) / 2),
1972
+ d = new l({
1973
+ svg: this._element,
1974
+ type: o.dotsOptions.type
1975
+ });
1976
+ this._dotsClipPath = document.createElementNS("http://www.w3.org/2000/svg", "clipPath"), this._dotsClipPath.setAttribute("id", "clip-path-dot-color"), this._defs.appendChild(this._dotsClipPath), this._createColor({
1977
+ options: null === (e = o.dotsOptions) || void 0 === e ? void 0 : e.gradient,
1978
+ color: o.dotsOptions.color,
1979
+ additionalRotation: 0,
1980
+ x: 0,
1981
+ y: 0,
1982
+ height: o.height,
1983
+ width: o.width,
1984
+ name: "dot-color"
2567
1985
  });
2568
- q.draw(D, P, s, O), q._element && z && z.appendChild(q._element);
2569
- } else for (var I = new l({
2570
- svg: t._element,
2571
- type: r.dotsOptions.type
2572
- }), E = function E(t) {
2573
- for (var e = function e(_e3) {
2574
- if (!(null === (w = m[t]) || void 0 === w ? void 0 : w[_e3])) return "continue";
2575
- I.draw(D + t * a, P + _e3 * a, a, function (r, n) {
2576
- var o;
2577
- return !!(null === (o = m[t + r]) || void 0 === o ? void 0 : o[_e3 + n]);
2578
- }), I._element && z && z.appendChild(I._element);
2579
- }, r = 0; r < m[t].length; r++) {
2580
- e(r);
1986
+ for (var f = function f(e) {
1987
+ for (var o = function o(_o) {
1988
+ 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) {
1989
+ 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);
1990
+ }), void (d._element && g._dotsClipPath && g._dotsClipPath.appendChild(d._element))) : "continue";
1991
+ }, a = 0; a < i; a++) o(a);
1992
+ }, g = this, p = 0; p < i; p++) f(p);
1993
+ if (o.shape === v) {
1994
+ var w = Math.floor((a / u - i) / 2),
1995
+ y = i + 2 * w,
1996
+ m = h - w * u,
1997
+ b = c - w * u,
1998
+ _ = [],
1999
+ x = Math.floor(y / 2);
2000
+ for (p = 0; p < y; p++) {
2001
+ _[p] = [];
2002
+ for (var S = 0; S < y; S++) 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;
2003
+ }
2004
+ var M = function M(t) {
2005
+ for (var e = function e(_e2) {
2006
+ if (!_[t][_e2]) return "continue";
2007
+ d.draw(m + t * u, b + _e2 * u, u, function (r, n) {
2008
+ var o;
2009
+ return !!(null === (o = _[t + r]) || void 0 === o ? void 0 : o[_e2 + n]);
2010
+ }), d._element && C._dotsClipPath && C._dotsClipPath.appendChild(d._element);
2011
+ }, r = 0; r < y; r++) e(r);
2012
+ },
2013
+ C = this;
2014
+ for (p = 0; p < y; p++) M(p);
2581
2015
  }
2582
- }, L = 0; L < m.length; L++) {
2583
- E(L);
2584
- }
2585
-
2586
- 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({
2587
- options: null === (x = r.cornersDotOptions) || void 0 === x ? void 0 : x.gradient,
2588
- color: null === (S = r.cornersDotOptions) || void 0 === S ? void 0 : S.color,
2589
- additionalRotation: O,
2590
- x: D + 2 * a,
2591
- y: P + 2 * a,
2592
- height: u,
2593
- width: u,
2594
- name: "corners-dot-color-" + A + "-" + k
2595
- })), null === (M = r.cornersDotOptions) || void 0 === M ? void 0 : M.type) {
2596
- var R = new p({
2597
- svg: t._element,
2598
- type: r.cornersDotOptions.type
2016
+ }, t.prototype.drawCorners = function () {
2017
+ var t = this;
2018
+ if (!this._qr) throw "QR code is not defined";
2019
+ var e = this._element,
2020
+ r = this._options;
2021
+ if (!e) throw "Element code is not defined";
2022
+ var n = this._qr.getModuleCount(),
2023
+ o = Math.min(r.width, r.height) - 2 * r.margin,
2024
+ i = r.shape === v ? o / Math.sqrt(2) : o,
2025
+ a = Math.floor(i / n),
2026
+ s = 7 * a,
2027
+ u = 3 * a,
2028
+ h = Math.floor((r.width - n * a) / 2),
2029
+ c = Math.floor((r.height - n * a) / 2);
2030
+ [[0, 0, 0], [1, 0, Math.PI / 2], [0, 1, -Math.PI / 2]].forEach(function (e) {
2031
+ var o,
2032
+ i,
2033
+ d,
2034
+ g,
2035
+ v,
2036
+ w,
2037
+ y,
2038
+ _,
2039
+ x,
2040
+ S,
2041
+ M,
2042
+ C,
2043
+ A = e[0],
2044
+ k = e[1],
2045
+ O = e[2],
2046
+ D = h + A * a * (n - 7),
2047
+ P = c + k * a * (n - 7),
2048
+ z = t._dotsClipPath,
2049
+ B = t._dotsClipPath;
2050
+ 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({
2051
+ options: null === (d = r.cornersSquareOptions) || void 0 === d ? void 0 : d.gradient,
2052
+ color: null === (g = r.cornersSquareOptions) || void 0 === g ? void 0 : g.color,
2053
+ additionalRotation: O,
2054
+ x: D,
2055
+ y: P,
2056
+ height: s,
2057
+ width: s,
2058
+ name: "corners-square-color-" + A + "-" + k
2059
+ })), null === (v = r.cornersSquareOptions) || void 0 === v ? void 0 : v.type) {
2060
+ var q = new f({
2061
+ svg: t._element,
2062
+ type: r.cornersSquareOptions.type
2063
+ });
2064
+ q.draw(D, P, s, O), q._element && z && z.appendChild(q._element);
2065
+ } else for (var I = new l({
2066
+ svg: t._element,
2067
+ type: r.dotsOptions.type
2068
+ }), E = function E(t) {
2069
+ for (var e = function e(_e3) {
2070
+ if (!(null === (w = m[t]) || void 0 === w ? void 0 : w[_e3])) return "continue";
2071
+ I.draw(D + t * a, P + _e3 * a, a, function (r, n) {
2072
+ var o;
2073
+ return !!(null === (o = m[t + r]) || void 0 === o ? void 0 : o[_e3 + n]);
2074
+ }), I._element && z && z.appendChild(I._element);
2075
+ }, r = 0; r < m[t].length; r++) e(r);
2076
+ }, L = 0; L < m.length; L++) E(L);
2077
+ 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({
2078
+ options: null === (x = r.cornersDotOptions) || void 0 === x ? void 0 : x.gradient,
2079
+ color: null === (S = r.cornersDotOptions) || void 0 === S ? void 0 : S.color,
2080
+ additionalRotation: O,
2081
+ x: D + 2 * a,
2082
+ y: P + 2 * a,
2083
+ height: u,
2084
+ width: u,
2085
+ name: "corners-dot-color-" + A + "-" + k
2086
+ })), null === (M = r.cornersDotOptions) || void 0 === M ? void 0 : M.type) {
2087
+ var R = new p({
2088
+ svg: t._element,
2089
+ type: r.cornersDotOptions.type
2090
+ });
2091
+ R.draw(D + 2 * a, P + 2 * a, u, O), R._element && B && B.appendChild(R._element);
2092
+ } else {
2093
+ I = new l({
2094
+ svg: t._element,
2095
+ type: r.dotsOptions.type
2096
+ });
2097
+ var N = function N(t) {
2098
+ for (var e = function e(_e4) {
2099
+ if (!(null === (C = b[t]) || void 0 === C ? void 0 : C[_e4])) return "continue";
2100
+ I.draw(D + t * a, P + _e4 * a, a, function (r, n) {
2101
+ var o;
2102
+ return !!(null === (o = b[t + r]) || void 0 === o ? void 0 : o[_e4 + n]);
2103
+ }), I._element && B && B.appendChild(I._element);
2104
+ }, r = 0; r < b[t].length; r++) e(r);
2105
+ };
2106
+ for (L = 0; L < b.length; L++) N(L);
2107
+ }
2599
2108
  });
2600
- R.draw(D + 2 * a, P + 2 * a, u, O), R._element && B && B.appendChild(R._element);
2601
- } else {
2602
- I = new l({
2603
- svg: t._element,
2604
- type: r.dotsOptions.type
2109
+ }, t.prototype.loadImage = function () {
2110
+ var t = this;
2111
+ return new Promise(function (e, r) {
2112
+ var n = t._options,
2113
+ o = new Image();
2114
+ if (!n.image) return r("Image is not defined");
2115
+ "string" == typeof n.imageOptions.crossOrigin && (o.crossOrigin = n.imageOptions.crossOrigin), t._image = o, o.onload = function () {
2116
+ e();
2117
+ }, o.src = n.image;
2605
2118
  });
2606
-
2607
- var N = function N(t) {
2608
- for (var e = function e(_e4) {
2609
- if (!(null === (C = b[t]) || void 0 === C ? void 0 : C[_e4])) return "continue";
2610
- I.draw(D + t * a, P + _e4 * a, a, function (r, n) {
2611
- var o;
2612
- return !!(null === (o = b[t + r]) || void 0 === o ? void 0 : o[_e4 + n]);
2613
- }), I._element && B && B.appendChild(I._element);
2614
- }, r = 0; r < b[t].length; r++) {
2615
- e(r);
2119
+ }, t.prototype.drawImage = function (t) {
2120
+ var e = t.width,
2121
+ r = t.height,
2122
+ n = t.count,
2123
+ o = t.dotSize;
2124
+ return w(this, void 0, void 0, function () {
2125
+ var t, i, a, s, h, c, l, d, f;
2126
+ return y(this, function (g) {
2127
+ switch (g.label) {
2128
+ case 0:
2129
+ 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 || "")];
2130
+ case 1:
2131
+ return f = g.sent(), d.setAttribute("href", f || ""), this._element.appendChild(d), [2];
2132
+ }
2133
+ });
2134
+ });
2135
+ }, t.prototype._createColor = function (t) {
2136
+ var e = t.options,
2137
+ r = t.color,
2138
+ n = t.additionalRotation,
2139
+ o = t.x,
2140
+ i = t.y,
2141
+ a = t.height,
2142
+ s = t.width,
2143
+ u = t.name,
2144
+ h = s > a ? s : a,
2145
+ c = document.createElementNS("http://www.w3.org/2000/svg", "rect");
2146
+ 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) {
2147
+ var l;
2148
+ 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 {
2149
+ var d = ((e.rotation || 0) + n) % (2 * Math.PI),
2150
+ f = (d + 2 * Math.PI) % (2 * Math.PI),
2151
+ g = o + s / 2,
2152
+ p = i + a / 2,
2153
+ v = o + s / 2,
2154
+ w = i + a / 2;
2155
+ 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)));
2616
2156
  }
2617
- };
2618
-
2619
- for (L = 0; L < b.length; L++) {
2620
- N(L);
2621
- }
2622
- }
2623
- });
2624
- }, t.prototype.loadImage = function () {
2625
- var t = this;
2626
- return new Promise(function (e, r) {
2627
- var n = t._options,
2628
- o = new Image();
2629
- if (!n.image) return r("Image is not defined");
2630
- "string" == typeof n.imageOptions.crossOrigin && (o.crossOrigin = n.imageOptions.crossOrigin), t._image = o, o.onload = function () {
2631
- e();
2632
- }, o.src = n.image;
2633
- });
2634
- }, t.prototype.drawImage = function (t) {
2635
- var e = t.width,
2636
- r = t.height,
2637
- n = t.count,
2638
- o = t.dotSize;
2639
- return w(this, void 0, void 0, function () {
2640
- var t, i, a, s, h, c, l, d, f;
2641
- return y(this, function (g) {
2642
- switch (g.label) {
2643
- case 0:
2644
- 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 || "")];
2645
-
2646
- case 1:
2647
- return f = g.sent(), d.setAttribute("href", f || ""), this._element.appendChild(d), [2];
2648
- }
2649
- });
2650
- });
2651
- }, t.prototype._createColor = function (t) {
2652
- var e = t.options,
2653
- r = t.color,
2654
- n = t.additionalRotation,
2655
- o = t.x,
2656
- i = t.y,
2657
- a = t.height,
2658
- s = t.width,
2659
- u = t.name,
2660
- h = s > a ? s : a,
2661
- c = document.createElementNS("http://www.w3.org/2000/svg", "rect");
2662
-
2663
- 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) {
2664
- var l;
2665
- 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 {
2666
- var d = ((e.rotation || 0) + n) % (2 * Math.PI),
2667
- f = (d + 2 * Math.PI) % (2 * Math.PI),
2668
- g = o + s / 2,
2669
- p = i + a / 2,
2670
- v = o + s / 2,
2671
- w = i + a / 2;
2672
- 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)));
2673
- }
2674
- e.colorStops.forEach(function (t) {
2675
- var e = t.offset,
2676
- r = t.color,
2677
- n = document.createElementNS("http://www.w3.org/2000/svg", "stop");
2678
- n.setAttribute("offset", 100 * e + "%"), n.setAttribute("stop-color", r), l.appendChild(n);
2679
- }), c.setAttribute("fill", "url('#" + u + "')"), this._defs.appendChild(l);
2680
- } else r && c.setAttribute("fill", r);
2681
-
2682
- this._element.appendChild(c);
2683
- }, t;
2684
- }(),
2157
+ e.colorStops.forEach(function (t) {
2158
+ var e = t.offset,
2159
+ r = t.color,
2160
+ n = document.createElementNS("http://www.w3.org/2000/svg", "stop");
2161
+ n.setAttribute("offset", 100 * e + "%"), n.setAttribute("stop-color", r), l.appendChild(n);
2162
+ }), c.setAttribute("fill", "url('#" + u + "')"), this._defs.appendChild(l);
2163
+ } else r && c.setAttribute("fill", r);
2164
+ this._element.appendChild(c);
2165
+ }, t;
2166
+ }(),
2685
2167
  x = "canvas";
2686
-
2687
- for (var S = {}, M = 0; M <= 40; M++) {
2688
- S[M] = M;
2689
- }
2690
-
2691
- var C = {
2692
- type: x,
2693
- shape: "square",
2694
- width: 300,
2695
- height: 300,
2696
- data: "",
2697
- margin: 0,
2698
- qrOptions: {
2699
- typeNumber: S[0],
2700
- mode: void 0,
2701
- errorCorrectionLevel: "Q"
2702
- },
2703
- imageOptions: {
2704
- hideBackgroundDots: !0,
2705
- imageSize: .4,
2706
- crossOrigin: void 0,
2707
- margin: 0
2708
- },
2709
- dotsOptions: {
2710
- type: "square",
2711
- color: "#000"
2712
- },
2713
- backgroundOptions: {
2714
- round: 0,
2715
- color: "#fff"
2716
- }
2717
- };
2718
-
2719
- var _A = function A() {
2720
- return (_A = Object.assign || function (t) {
2721
- for (var e, r = 1, n = arguments.length; r < n; r++) {
2722
- for (var o in e = arguments[r]) {
2723
- Object.prototype.hasOwnProperty.call(e, o) && (t[o] = e[o]);
2724
- }
2168
+ for (var S = {}, M = 0; M <= 40; M++) S[M] = M;
2169
+ var C = {
2170
+ type: x,
2171
+ shape: "square",
2172
+ width: 300,
2173
+ height: 300,
2174
+ data: "",
2175
+ margin: 0,
2176
+ qrOptions: {
2177
+ typeNumber: S[0],
2178
+ mode: void 0,
2179
+ errorCorrectionLevel: "Q"
2180
+ },
2181
+ imageOptions: {
2182
+ hideBackgroundDots: !0,
2183
+ imageSize: .4,
2184
+ crossOrigin: void 0,
2185
+ margin: 0
2186
+ },
2187
+ dotsOptions: {
2188
+ type: "square",
2189
+ color: "#000"
2190
+ },
2191
+ backgroundOptions: {
2192
+ round: 0,
2193
+ color: "#fff"
2725
2194
  }
2726
-
2727
- return t;
2728
- }).apply(this, arguments);
2729
- };
2730
-
2731
- function k(t) {
2732
- var e = _A({}, t);
2733
-
2734
- if (!e.colorStops || !e.colorStops.length) throw "Field 'colorStops' is required in gradient";
2735
- return e.rotation ? e.rotation = Number(e.rotation) : e.rotation = 0, e.colorStops = e.colorStops.map(function (t) {
2736
- return _A(_A({}, t), {
2737
- offset: Number(t.offset)
2738
- });
2739
- }), e;
2740
- }
2741
-
2742
- function O(t) {
2743
- var e = _A({}, t);
2744
-
2745
- return e.width = Number(e.width), e.height = Number(e.height), e.margin = Number(e.margin), e.imageOptions = _A(_A({}, e.imageOptions), {
2746
- hideBackgroundDots: Boolean(e.imageOptions.hideBackgroundDots),
2747
- imageSize: Number(e.imageOptions.imageSize),
2748
- margin: Number(e.imageOptions.margin)
2749
- }), 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;
2750
- }
2751
-
2752
- var D = r(192),
2195
+ };
2196
+ var _A = function A() {
2197
+ return (_A = Object.assign || function (t) {
2198
+ for (var e, r = 1, n = arguments.length; r < n; r++) for (var o in e = arguments[r]) Object.prototype.hasOwnProperty.call(e, o) && (t[o] = e[o]);
2199
+ return t;
2200
+ }).apply(this, arguments);
2201
+ };
2202
+ function k(t) {
2203
+ var e = _A({}, t);
2204
+ if (!e.colorStops || !e.colorStops.length) throw "Field 'colorStops' is required in gradient";
2205
+ return e.rotation ? e.rotation = Number(e.rotation) : e.rotation = 0, e.colorStops = e.colorStops.map(function (t) {
2206
+ return _A(_A({}, t), {
2207
+ offset: Number(t.offset)
2208
+ });
2209
+ }), e;
2210
+ }
2211
+ function O(t) {
2212
+ var e = _A({}, t);
2213
+ return e.width = Number(e.width), e.height = Number(e.height), e.margin = Number(e.margin), e.imageOptions = _A(_A({}, e.imageOptions), {
2214
+ hideBackgroundDots: Boolean(e.imageOptions.hideBackgroundDots),
2215
+ imageSize: Number(e.imageOptions.imageSize),
2216
+ margin: Number(e.imageOptions.margin)
2217
+ }), 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;
2218
+ }
2219
+ var D = r(192),
2753
2220
  P = r.n(D),
2754
2221
  z = function z(t, e, r, n) {
2755
- return new (r || (r = Promise))(function (o, i) {
2756
- function a(t) {
2757
- try {
2758
- u(n.next(t));
2759
- } catch (t) {
2760
- i(t);
2761
- }
2762
- }
2763
-
2764
- function s(t) {
2765
- try {
2766
- u(n["throw"](t));
2767
- } catch (t) {
2768
- i(t);
2769
- }
2770
- }
2771
-
2772
- function u(t) {
2773
- var e;
2774
- t.done ? o(t.value) : (e = t.value, e instanceof r ? e : new r(function (t) {
2775
- t(e);
2776
- })).then(a, s);
2777
- }
2778
-
2779
- u((n = n.apply(t, e || [])).next());
2780
- });
2781
- },
2782
- B = function B(t, e) {
2783
- var r,
2784
- n,
2785
- o,
2786
- i,
2787
- a = {
2788
- label: 0,
2789
- sent: function sent() {
2790
- if (1 & o[0]) throw o[1];
2791
- return o[1];
2792
- },
2793
- trys: [],
2794
- ops: []
2795
- };
2796
- return i = {
2797
- next: s(0),
2798
- "throw": s(1),
2799
- "return": s(2)
2800
- }, "function" == typeof Symbol && (i[Symbol.iterator] = function () {
2801
- return this;
2802
- }), i;
2803
-
2804
- function s(i) {
2805
- return function (s) {
2806
- return function (i) {
2807
- if (r) throw new TypeError("Generator is already executing.");
2808
-
2809
- for (; a;) {
2222
+ return new (r || (r = Promise))(function (o, i) {
2223
+ function a(t) {
2810
2224
  try {
2811
- 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;
2812
-
2813
- switch (n = 0, o && (i = [2 & i[0], o.value]), i[0]) {
2814
- case 0:
2815
- case 1:
2816
- o = i;
2817
- break;
2818
-
2819
- case 4:
2820
- return a.label++, {
2821
- value: i[1],
2822
- done: !1
2823
- };
2824
-
2825
- case 5:
2826
- a.label++, n = i[1], i = [0];
2827
- continue;
2828
-
2829
- case 7:
2830
- i = a.ops.pop(), a.trys.pop();
2831
- continue;
2832
-
2833
- default:
2834
- if (!((o = (o = a.trys).length > 0 && o[o.length - 1]) || 6 !== i[0] && 2 !== i[0])) {
2835
- a = 0;
2836
- continue;
2837
- }
2838
-
2839
- if (3 === i[0] && (!o || i[1] > o[0] && i[1] < o[3])) {
2840
- a.label = i[1];
2841
- break;
2842
- }
2843
-
2844
- if (6 === i[0] && a.label < o[1]) {
2845
- a.label = o[1], o = i;
2846
- break;
2847
- }
2848
-
2849
- if (o && a.label < o[2]) {
2850
- a.label = o[2], a.ops.push(i);
2851
- break;
2852
- }
2853
-
2854
- o[2] && a.ops.pop(), a.trys.pop();
2855
- continue;
2856
- }
2857
-
2858
- i = e.call(t, a);
2225
+ u(n.next(t));
2859
2226
  } catch (t) {
2860
- i = [6, t], n = 0;
2861
- } finally {
2862
- r = o = 0;
2227
+ i(t);
2863
2228
  }
2864
2229
  }
2865
-
2866
- if (5 & i[0]) throw i[1];
2867
- return {
2868
- value: i[0] ? i[1] : void 0,
2869
- done: !0
2230
+ function s(t) {
2231
+ try {
2232
+ u(n["throw"](t));
2233
+ } catch (t) {
2234
+ i(t);
2235
+ }
2236
+ }
2237
+ function u(t) {
2238
+ var e;
2239
+ t.done ? o(t.value) : (e = t.value, e instanceof r ? e : new r(function (t) {
2240
+ t(e);
2241
+ })).then(a, s);
2242
+ }
2243
+ u((n = n.apply(t, e || [])).next());
2244
+ });
2245
+ },
2246
+ B = function B(t, e) {
2247
+ var r,
2248
+ n,
2249
+ o,
2250
+ i,
2251
+ a = {
2252
+ label: 0,
2253
+ sent: function sent() {
2254
+ if (1 & o[0]) throw o[1];
2255
+ return o[1];
2256
+ },
2257
+ trys: [],
2258
+ ops: []
2259
+ };
2260
+ return i = {
2261
+ next: s(0),
2262
+ "throw": s(1),
2263
+ "return": s(2)
2264
+ }, "function" == typeof Symbol && (i[Symbol.iterator] = function () {
2265
+ return this;
2266
+ }), i;
2267
+ function s(i) {
2268
+ return function (s) {
2269
+ return function (i) {
2270
+ if (r) throw new TypeError("Generator is already executing.");
2271
+ for (; a;) try {
2272
+ 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;
2273
+ switch (n = 0, o && (i = [2 & i[0], o.value]), i[0]) {
2274
+ case 0:
2275
+ case 1:
2276
+ o = i;
2277
+ break;
2278
+ case 4:
2279
+ return a.label++, {
2280
+ value: i[1],
2281
+ done: !1
2282
+ };
2283
+ case 5:
2284
+ a.label++, n = i[1], i = [0];
2285
+ continue;
2286
+ case 7:
2287
+ i = a.ops.pop(), a.trys.pop();
2288
+ continue;
2289
+ default:
2290
+ if (!((o = (o = a.trys).length > 0 && o[o.length - 1]) || 6 !== i[0] && 2 !== i[0])) {
2291
+ a = 0;
2292
+ continue;
2293
+ }
2294
+ if (3 === i[0] && (!o || i[1] > o[0] && i[1] < o[3])) {
2295
+ a.label = i[1];
2296
+ break;
2297
+ }
2298
+ if (6 === i[0] && a.label < o[1]) {
2299
+ a.label = o[1], o = i;
2300
+ break;
2301
+ }
2302
+ if (o && a.label < o[2]) {
2303
+ a.label = o[2], a.ops.push(i);
2304
+ break;
2305
+ }
2306
+ o[2] && a.ops.pop(), a.trys.pop();
2307
+ continue;
2308
+ }
2309
+ i = e.call(t, a);
2310
+ } catch (t) {
2311
+ i = [6, t], n = 0;
2312
+ } finally {
2313
+ r = o = 0;
2314
+ }
2315
+ if (5 & i[0]) throw i[1];
2316
+ return {
2317
+ value: i[0] ? i[1] : void 0,
2318
+ done: !0
2319
+ };
2320
+ }([i, s]);
2870
2321
  };
2871
- }([i, s]);
2322
+ }
2872
2323
  };
2873
- }
2874
- };
2875
-
2876
- var q = function () {
2877
- function t(t) {
2878
- this._options = t ? O(a(C, t)) : C, this.update();
2879
- }
2880
-
2881
- return t._clearContainer = function (t) {
2882
- t && (t.innerHTML = "");
2883
- }, t.prototype._setupSvg = function () {
2884
- var t = this;
2885
-
2886
- if (this._qr) {
2887
- var e = new _(this._options);
2888
- this._svg = e.getElement(), this._svgDrawingPromise = e.drawQR(this._qr).then(function () {
2889
- var r;
2890
- t._svg && (null === (r = t._extension) || void 0 === r || r.call(t, e.getElement(), t._options));
2891
- });
2324
+ var q = function () {
2325
+ function t(t) {
2326
+ this._options = t ? O(a(C, t)) : C, this.update();
2892
2327
  }
2893
- }, t.prototype._setupCanvas = function () {
2894
- var t,
2328
+ return t._clearContainer = function (t) {
2329
+ t && (t.innerHTML = "");
2330
+ }, t.prototype._setupSvg = function () {
2331
+ var t = this;
2332
+ if (this._qr) {
2333
+ var e = new _(this._options);
2334
+ this._svg = e.getElement(), this._svgDrawingPromise = e.drawQR(this._qr).then(function () {
2335
+ var r;
2336
+ t._svg && (null === (r = t._extension) || void 0 === r || r.call(t, e.getElement(), t._options));
2337
+ });
2338
+ }
2339
+ }, t.prototype._setupCanvas = function () {
2340
+ var t,
2895
2341
  e = this;
2896
- 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 () {
2897
- if (e._svg) {
2898
- var t = e._svg,
2342
+ 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 () {
2343
+ if (e._svg) {
2344
+ var t = e._svg,
2899
2345
  r = new XMLSerializer().serializeToString(t),
2900
2346
  n = "data:image/svg+xml;base64," + btoa(r),
2901
2347
  o = new Image();
2902
- return new Promise(function (t) {
2903
- o.onload = function () {
2904
- var r, n;
2905
- null === (n = null === (r = e._canvas) || void 0 === r ? void 0 : r.getContext("2d")) || void 0 === n || n.drawImage(o, 0, 0), t();
2906
- }, o.src = n;
2907
- });
2908
- }
2909
- }));
2910
- }, t.prototype._getElement = function (t) {
2911
- return void 0 === t && (t = "png"), z(this, void 0, void 0, function () {
2912
- return B(this, function (e) {
2913
- switch (e.label) {
2914
- case 0:
2915
- if (!this._qr) throw "QR code is empty";
2916
- return "svg" !== t.toLowerCase() ? [3, 2] : (this._svg && this._svgDrawingPromise || this._setupSvg(), [4, this._svgDrawingPromise]);
2917
-
2918
- case 1:
2919
- return e.sent(), [2, this._svg];
2920
-
2921
- case 2:
2922
- return this._canvas && this._canvasDrawingPromise || this._setupCanvas(), [4, this._canvasDrawingPromise];
2923
-
2924
- case 3:
2925
- return e.sent(), [2, this._canvas];
2348
+ return new Promise(function (t) {
2349
+ o.onload = function () {
2350
+ var r, n;
2351
+ null === (n = null === (r = e._canvas) || void 0 === r ? void 0 : r.getContext("2d")) || void 0 === n || n.drawImage(o, 0, 0), t();
2352
+ }, o.src = n;
2353
+ });
2926
2354
  }
2355
+ }));
2356
+ }, t.prototype._getElement = function (t) {
2357
+ return void 0 === t && (t = "png"), z(this, void 0, void 0, function () {
2358
+ return B(this, function (e) {
2359
+ switch (e.label) {
2360
+ case 0:
2361
+ if (!this._qr) throw "QR code is empty";
2362
+ return "svg" !== t.toLowerCase() ? [3, 2] : (this._svg && this._svgDrawingPromise || this._setupSvg(), [4, this._svgDrawingPromise]);
2363
+ case 1:
2364
+ return e.sent(), [2, this._svg];
2365
+ case 2:
2366
+ return this._canvas && this._canvasDrawingPromise || this._setupCanvas(), [4, this._canvasDrawingPromise];
2367
+ case 3:
2368
+ return e.sent(), [2, this._canvas];
2369
+ }
2370
+ });
2927
2371
  });
2928
- });
2929
- }, t.prototype.update = function (e) {
2930
- 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) {
2931
- switch (!0) {
2932
- case /^[0-9]*$/.test(t):
2933
- return "Numeric";
2934
-
2935
- case /^[0-9A-Z $%*+\-./:]*$/.test(t):
2936
- return "Alphanumeric";
2937
-
2938
- default:
2939
- return "Byte";
2940
- }
2941
- }(this._options.data)), this._qr.make(), this._options.type === x ? this._setupCanvas() : this._setupSvg(), this.append(this._container));
2942
- }, t.prototype.append = function (t) {
2943
- if (t) {
2944
- if ("function" != typeof t.appendChild) throw "Container should be a single DOM node";
2945
- this._options.type === x ? this._canvas && t.appendChild(this._canvas) : this._svg && t.appendChild(this._svg), this._container = t;
2946
- }
2947
- }, t.prototype.applyExtension = function (t) {
2948
- if (!t) throw "Extension function should be defined.";
2949
- this._extension = t, this.update();
2950
- }, t.prototype.deleteExtension = function () {
2951
- this._extension = void 0, this.update();
2952
- }, t.prototype.getRawData = function (t) {
2953
- return void 0 === t && (t = "png"), z(this, void 0, void 0, function () {
2954
- var e, r, n;
2955
- return B(this, function (o) {
2956
- switch (o.label) {
2957
- case 0:
2958
- if (!this._qr) throw "QR code is empty";
2959
- return [4, this._getElement(t)];
2960
-
2961
- case 1:
2962
- 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], {
2963
- type: "image/svg+xml"
2964
- })]) : [2, new Promise(function (r) {
2965
- return e.toBlob(r, "image/" + t, 1);
2966
- })] : [2, null];
2372
+ }, t.prototype.update = function (e) {
2373
+ 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) {
2374
+ switch (!0) {
2375
+ case /^[0-9]*$/.test(t):
2376
+ return "Numeric";
2377
+ case /^[0-9A-Z $%*+\-./:]*$/.test(t):
2378
+ return "Alphanumeric";
2379
+ default:
2380
+ return "Byte";
2967
2381
  }
2382
+ }(this._options.data)), this._qr.make(), this._options.type === x ? this._setupCanvas() : this._setupSvg(), this.append(this._container));
2383
+ }, t.prototype.append = function (t) {
2384
+ if (t) {
2385
+ if ("function" != typeof t.appendChild) throw "Container should be a single DOM node";
2386
+ this._options.type === x ? this._canvas && t.appendChild(this._canvas) : this._svg && t.appendChild(this._svg), this._container = t;
2387
+ }
2388
+ }, t.prototype.applyExtension = function (t) {
2389
+ if (!t) throw "Extension function should be defined.";
2390
+ this._extension = t, this.update();
2391
+ }, t.prototype.deleteExtension = function () {
2392
+ this._extension = void 0, this.update();
2393
+ }, t.prototype.getRawData = function (t) {
2394
+ return void 0 === t && (t = "png"), z(this, void 0, void 0, function () {
2395
+ var e, r, n;
2396
+ return B(this, function (o) {
2397
+ switch (o.label) {
2398
+ case 0:
2399
+ if (!this._qr) throw "QR code is empty";
2400
+ return [4, this._getElement(t)];
2401
+ case 1:
2402
+ 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], {
2403
+ type: "image/svg+xml"
2404
+ })]) : [2, new Promise(function (r) {
2405
+ return e.toBlob(r, "image/" + t, 1);
2406
+ })] : [2, null];
2407
+ }
2408
+ });
2968
2409
  });
2969
- });
2970
- }, t.prototype.download = function (t) {
2971
- return z(this, void 0, void 0, function () {
2972
- var e, r, n, o, i;
2973
- return B(this, function (a) {
2974
- switch (a.label) {
2975
- case 0:
2976
- if (!this._qr) throw "QR code is empty";
2977
- 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)];
2978
-
2979
- case 1:
2980
- 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];
2981
- }
2410
+ }, t.prototype.download = function (t) {
2411
+ return z(this, void 0, void 0, function () {
2412
+ var e, r, n, o, i;
2413
+ return B(this, function (a) {
2414
+ switch (a.label) {
2415
+ case 0:
2416
+ if (!this._qr) throw "QR code is empty";
2417
+ 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)];
2418
+ case 1:
2419
+ 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];
2420
+ }
2421
+ });
2982
2422
  });
2983
- });
2984
- }, t;
2985
- }();
2986
- }
2987
- },
2988
- e = {};
2989
-
2423
+ }, t;
2424
+ }();
2425
+ }
2426
+ },
2427
+ e = {};
2990
2428
  function r(n) {
2991
2429
  if (e[n]) return e[n].exports;
2992
2430
  var o = e[n] = {
@@ -2994,7 +2432,6 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
2994
2432
  };
2995
2433
  return t[n](o, o.exports, r), o.exports;
2996
2434
  }
2997
-
2998
2435
  return r.n = function (t) {
2999
2436
  var e = t && t.__esModule ? function () {
3000
2437
  return t["default"];
@@ -3005,12 +2442,10 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
3005
2442
  a: e
3006
2443
  }), e;
3007
2444
  }, r.d = function (t, e) {
3008
- for (var n in e) {
3009
- r.o(e, n) && !r.o(t, n) && Object.defineProperty(t, n, {
3010
- enumerable: !0,
3011
- get: e[n]
3012
- });
3013
- }
2445
+ for (var n in e) r.o(e, n) && !r.o(t, n) && Object.defineProperty(t, n, {
2446
+ enumerable: !0,
2447
+ get: e[n]
2448
+ });
3014
2449
  }, r.o = function (t, e) {
3015
2450
  return Object.prototype.hasOwnProperty.call(t, e);
3016
2451
  }, r(676);
@@ -3018,7 +2453,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
3018
2453
  });
3019
2454
  }, {}],
3020
2455
  5: [function (require, module, exports) {
3021
- module.exports = "1.122.1";
2456
+ module.exports = "1.147.1";
3022
2457
  }, {}]
3023
2458
  }, {}, [3])(3);
3024
2459
  });