@wecom/wecom-openclaw-cli 1.0.15 → 1.0.16
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.
- package/dist/_virtual/_commonjsHelpers.js +8 -0
- package/dist/_virtual/_commonjsHelpers.js.map +1 -0
- package/dist/_virtual/alignment-pattern.js +6 -0
- package/dist/_virtual/alignment-pattern.js.map +1 -0
- package/dist/_virtual/bitmapper.js +6 -0
- package/dist/_virtual/bitmapper.js.map +1 -0
- package/dist/_virtual/browser.js +6 -0
- package/dist/_virtual/browser.js.map +1 -0
- package/dist/_virtual/canvas.js +6 -0
- package/dist/_virtual/canvas.js.map +1 -0
- package/dist/_virtual/chunkstream.js +6 -0
- package/dist/_virtual/chunkstream.js.map +1 -0
- package/dist/_virtual/crc.js +6 -0
- package/dist/_virtual/crc.js.map +1 -0
- package/dist/_virtual/dijkstra.js +6 -0
- package/dist/_virtual/dijkstra.js.map +1 -0
- package/dist/_virtual/error-correction-code.js +6 -0
- package/dist/_virtual/error-correction-code.js.map +1 -0
- package/dist/_virtual/error-correction-level.js +6 -0
- package/dist/_virtual/error-correction-level.js.map +1 -0
- package/dist/_virtual/filter-parse-async.js +6 -0
- package/dist/_virtual/filter-parse-async.js.map +1 -0
- package/dist/_virtual/filter-parse-sync.js +6 -0
- package/dist/_virtual/filter-parse-sync.js.map +1 -0
- package/dist/_virtual/filter-parse.js +6 -0
- package/dist/_virtual/filter-parse.js.map +1 -0
- package/dist/_virtual/finder-pattern.js +6 -0
- package/dist/_virtual/finder-pattern.js.map +1 -0
- package/dist/_virtual/format-info.js +6 -0
- package/dist/_virtual/format-info.js.map +1 -0
- package/dist/_virtual/galois-field.js +6 -0
- package/dist/_virtual/galois-field.js.map +1 -0
- package/dist/_virtual/index.js +10 -0
- package/dist/_virtual/index.js.map +1 -0
- package/dist/_virtual/interlace.js +6 -0
- package/dist/_virtual/interlace.js.map +1 -0
- package/dist/_virtual/mask-pattern.js +6 -0
- package/dist/_virtual/mask-pattern.js.map +1 -0
- package/dist/_virtual/mode.js +6 -0
- package/dist/_virtual/mode.js.map +1 -0
- package/dist/_virtual/packer-async.js +6 -0
- package/dist/_virtual/packer-async.js.map +1 -0
- package/dist/_virtual/packer.js +6 -0
- package/dist/_virtual/packer.js.map +1 -0
- package/dist/_virtual/parser-async.js +6 -0
- package/dist/_virtual/parser-async.js.map +1 -0
- package/dist/_virtual/parser.js +6 -0
- package/dist/_virtual/parser.js.map +1 -0
- package/dist/_virtual/png-sync.js +6 -0
- package/dist/_virtual/png-sync.js.map +1 -0
- package/dist/_virtual/png.js +6 -0
- package/dist/_virtual/png.js.map +1 -0
- package/dist/_virtual/png2.js +6 -0
- package/dist/_virtual/png2.js.map +1 -0
- package/dist/_virtual/polynomial.js +6 -0
- package/dist/_virtual/polynomial.js.map +1 -0
- package/dist/_virtual/qrcode.js +6 -0
- package/dist/_virtual/qrcode.js.map +1 -0
- package/dist/_virtual/regex.js +6 -0
- package/dist/_virtual/regex.js.map +1 -0
- package/dist/_virtual/segments.js +6 -0
- package/dist/_virtual/segments.js.map +1 -0
- package/dist/_virtual/server.js +6 -0
- package/dist/_virtual/server.js.map +1 -0
- package/dist/_virtual/svg-tag.js +6 -0
- package/dist/_virtual/svg-tag.js.map +1 -0
- package/dist/_virtual/svg.js +6 -0
- package/dist/_virtual/svg.js.map +1 -0
- package/dist/_virtual/sync-inflate.js +6 -0
- package/dist/_virtual/sync-inflate.js.map +1 -0
- package/dist/_virtual/sync-reader.js +6 -0
- package/dist/_virtual/sync-reader.js.map +1 -0
- package/dist/_virtual/terminal-small.js +6 -0
- package/dist/_virtual/terminal-small.js.map +1 -0
- package/dist/_virtual/terminal.js +6 -0
- package/dist/_virtual/terminal.js.map +1 -0
- package/dist/_virtual/terminal2.js +6 -0
- package/dist/_virtual/terminal2.js.map +1 -0
- package/dist/_virtual/utf8.js +6 -0
- package/dist/_virtual/utf8.js.map +1 -0
- package/dist/_virtual/utils.js +6 -0
- package/dist/_virtual/utils.js.map +1 -0
- package/dist/_virtual/utils2.js +6 -0
- package/dist/_virtual/utils2.js.map +1 -0
- package/dist/_virtual/version-check.js +6 -0
- package/dist/_virtual/version-check.js.map +1 -0
- package/dist/_virtual/version.js +6 -0
- package/dist/_virtual/version.js.map +1 -0
- package/dist/node_modules/dijkstrajs/dijkstra.js +179 -0
- package/dist/node_modules/dijkstrajs/dijkstra.js.map +1 -0
- package/dist/node_modules/pngjs/lib/bitmapper.js +281 -0
- package/dist/node_modules/pngjs/lib/bitmapper.js.map +1 -0
- package/dist/node_modules/pngjs/lib/bitpacker.js +172 -0
- package/dist/node_modules/pngjs/lib/bitpacker.js.map +1 -0
- package/dist/node_modules/pngjs/lib/chunkstream.js +204 -0
- package/dist/node_modules/pngjs/lib/chunkstream.js.map +1 -0
- package/dist/node_modules/pngjs/lib/constants.js +44 -0
- package/dist/node_modules/pngjs/lib/constants.js.map +1 -0
- package/dist/node_modules/pngjs/lib/crc.js +53 -0
- package/dist/node_modules/pngjs/lib/crc.js.map +1 -0
- package/dist/node_modules/pngjs/lib/filter-pack.js +185 -0
- package/dist/node_modules/pngjs/lib/filter-pack.js.map +1 -0
- package/dist/node_modules/pngjs/lib/filter-parse-async.js +40 -0
- package/dist/node_modules/pngjs/lib/filter-parse-async.js.map +1 -0
- package/dist/node_modules/pngjs/lib/filter-parse-sync.js +36 -0
- package/dist/node_modules/pngjs/lib/filter-parse-sync.js.map +1 -0
- package/dist/node_modules/pngjs/lib/filter-parse.js +192 -0
- package/dist/node_modules/pngjs/lib/filter-parse.js.map +1 -0
- package/dist/node_modules/pngjs/lib/format-normaliser.js +105 -0
- package/dist/node_modules/pngjs/lib/format-normaliser.js.map +1 -0
- package/dist/node_modules/pngjs/lib/interlace.js +108 -0
- package/dist/node_modules/pngjs/lib/interlace.js.map +1 -0
- package/dist/node_modules/pngjs/lib/packer-async.js +67 -0
- package/dist/node_modules/pngjs/lib/packer-async.js.map +1 -0
- package/dist/node_modules/pngjs/lib/packer-sync.js +72 -0
- package/dist/node_modules/pngjs/lib/packer-sync.js.map +1 -0
- package/dist/node_modules/pngjs/lib/packer.js +147 -0
- package/dist/node_modules/pngjs/lib/packer.js.map +1 -0
- package/dist/node_modules/pngjs/lib/paeth-predictor.js +28 -0
- package/dist/node_modules/pngjs/lib/paeth-predictor.js.map +1 -0
- package/dist/node_modules/pngjs/lib/parser-async.js +185 -0
- package/dist/node_modules/pngjs/lib/parser-async.js.map +1 -0
- package/dist/node_modules/pngjs/lib/parser-sync.js +128 -0
- package/dist/node_modules/pngjs/lib/parser-sync.js.map +1 -0
- package/dist/node_modules/pngjs/lib/parser.js +305 -0
- package/dist/node_modules/pngjs/lib/parser.js.map +1 -0
- package/dist/node_modules/pngjs/lib/png-sync.js +27 -0
- package/dist/node_modules/pngjs/lib/png-sync.js.map +1 -0
- package/dist/node_modules/pngjs/lib/png.js +212 -0
- package/dist/node_modules/pngjs/lib/png.js.map +1 -0
- package/dist/node_modules/pngjs/lib/sync-inflate.js +184 -0
- package/dist/node_modules/pngjs/lib/sync-inflate.js.map +1 -0
- package/dist/node_modules/pngjs/lib/sync-reader.js +58 -0
- package/dist/node_modules/pngjs/lib/sync-reader.js.map +1 -0
- package/dist/node_modules/qrcode/lib/browser.js +93 -0
- package/dist/node_modules/qrcode/lib/browser.js.map +1 -0
- package/dist/node_modules/qrcode/lib/can-promise.js +20 -0
- package/dist/node_modules/qrcode/lib/can-promise.js.map +1 -0
- package/dist/node_modules/qrcode/lib/core/alignment-pattern.js +100 -0
- package/dist/node_modules/qrcode/lib/core/alignment-pattern.js.map +1 -0
- package/dist/node_modules/qrcode/lib/core/alphanumeric-data.js +74 -0
- package/dist/node_modules/qrcode/lib/core/alphanumeric-data.js.map +1 -0
- package/dist/node_modules/qrcode/lib/core/bit-buffer.js +50 -0
- package/dist/node_modules/qrcode/lib/core/bit-buffer.js.map +1 -0
- package/dist/node_modules/qrcode/lib/core/bit-matrix.js +79 -0
- package/dist/node_modules/qrcode/lib/core/bit-matrix.js.map +1 -0
- package/dist/node_modules/qrcode/lib/core/byte-data.js +45 -0
- package/dist/node_modules/qrcode/lib/core/byte-data.js.map +1 -0
- package/dist/node_modules/qrcode/lib/core/error-correction-code.js +150 -0
- package/dist/node_modules/qrcode/lib/core/error-correction-code.js.map +1 -0
- package/dist/node_modules/qrcode/lib/core/error-correction-level.js +66 -0
- package/dist/node_modules/qrcode/lib/core/error-correction-level.js.map +1 -0
- package/dist/node_modules/qrcode/lib/core/finder-pattern.js +37 -0
- package/dist/node_modules/qrcode/lib/core/finder-pattern.js.map +1 -0
- package/dist/node_modules/qrcode/lib/core/format-info.js +44 -0
- package/dist/node_modules/qrcode/lib/core/format-info.js.map +1 -0
- package/dist/node_modules/qrcode/lib/core/galois-field.js +83 -0
- package/dist/node_modules/qrcode/lib/core/galois-field.js.map +1 -0
- package/dist/node_modules/qrcode/lib/core/kanji-data.js +70 -0
- package/dist/node_modules/qrcode/lib/core/kanji-data.js.map +1 -0
- package/dist/node_modules/qrcode/lib/core/mask-pattern.js +251 -0
- package/dist/node_modules/qrcode/lib/core/mask-pattern.js.map +1 -0
- package/dist/node_modules/qrcode/lib/core/mode.js +185 -0
- package/dist/node_modules/qrcode/lib/core/mode.js.map +1 -0
- package/dist/node_modules/qrcode/lib/core/numeric-data.js +58 -0
- package/dist/node_modules/qrcode/lib/core/numeric-data.js.map +1 -0
- package/dist/node_modules/qrcode/lib/core/polynomial.js +79 -0
- package/dist/node_modules/qrcode/lib/core/polynomial.js.map +1 -0
- package/dist/node_modules/qrcode/lib/core/qrcode.js +522 -0
- package/dist/node_modules/qrcode/lib/core/qrcode.js.map +1 -0
- package/dist/node_modules/qrcode/lib/core/reed-solomon-encoder.js +71 -0
- package/dist/node_modules/qrcode/lib/core/reed-solomon-encoder.js.map +1 -0
- package/dist/node_modules/qrcode/lib/core/regex.js +45 -0
- package/dist/node_modules/qrcode/lib/core/regex.js.map +1 -0
- package/dist/node_modules/qrcode/lib/core/segments.js +354 -0
- package/dist/node_modules/qrcode/lib/core/segments.js.map +1 -0
- package/dist/node_modules/qrcode/lib/core/utils.js +77 -0
- package/dist/node_modules/qrcode/lib/core/utils.js.map +1 -0
- package/dist/node_modules/qrcode/lib/core/version-check.js +24 -0
- package/dist/node_modules/qrcode/lib/core/version-check.js.map +1 -0
- package/dist/node_modules/qrcode/lib/core/version.js +184 -0
- package/dist/node_modules/qrcode/lib/core/version.js.map +1 -0
- package/dist/node_modules/qrcode/lib/index.js +27 -0
- package/dist/node_modules/qrcode/lib/index.js.map +1 -0
- package/dist/node_modules/qrcode/lib/renderer/canvas.js +80 -0
- package/dist/node_modules/qrcode/lib/renderer/canvas.js.map +1 -0
- package/dist/node_modules/qrcode/lib/renderer/png.js +97 -0
- package/dist/node_modules/qrcode/lib/renderer/png.js.map +1 -0
- package/dist/node_modules/qrcode/lib/renderer/svg-tag.js +96 -0
- package/dist/node_modules/qrcode/lib/renderer/svg-tag.js.map +1 -0
- package/dist/node_modules/qrcode/lib/renderer/svg.js +37 -0
- package/dist/node_modules/qrcode/lib/renderer/svg.js.map +1 -0
- package/dist/node_modules/qrcode/lib/renderer/terminal/terminal-small.js +99 -0
- package/dist/node_modules/qrcode/lib/renderer/terminal/terminal-small.js.map +1 -0
- package/dist/node_modules/qrcode/lib/renderer/terminal/terminal.js +63 -0
- package/dist/node_modules/qrcode/lib/renderer/terminal/terminal.js.map +1 -0
- package/dist/node_modules/qrcode/lib/renderer/terminal.js +25 -0
- package/dist/node_modules/qrcode/lib/renderer/terminal.js.map +1 -0
- package/dist/node_modules/qrcode/lib/renderer/utf8.js +89 -0
- package/dist/node_modules/qrcode/lib/renderer/utf8.js.map +1 -0
- package/dist/node_modules/qrcode/lib/renderer/utils.js +115 -0
- package/dist/node_modules/qrcode/lib/renderer/utils.js.map +1 -0
- package/dist/node_modules/qrcode/lib/server.js +159 -0
- package/dist/node_modules/qrcode/lib/server.js.map +1 -0
- package/dist/package.json.js +3 -2
- package/dist/package.json.js.map +1 -1
- package/dist/utils/qrcode.d.ts.map +1 -1
- package/dist/utils/qrcode.js +5 -9
- package/dist/utils/qrcode.js.map +1 -1
- package/package.json +3 -2
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var version = require('../../../../_virtual/version.js');
|
|
4
|
+
var utils = require('./utils.js');
|
|
5
|
+
var errorCorrectionCode = require('./error-correction-code.js');
|
|
6
|
+
var errorCorrectionLevel = require('./error-correction-level.js');
|
|
7
|
+
var mode = require('./mode.js');
|
|
8
|
+
var versionCheck = require('./version-check.js');
|
|
9
|
+
|
|
10
|
+
var hasRequiredVersion;
|
|
11
|
+
|
|
12
|
+
function requireVersion () {
|
|
13
|
+
if (hasRequiredVersion) return version.__exports;
|
|
14
|
+
hasRequiredVersion = 1;
|
|
15
|
+
(function (exports$1) {
|
|
16
|
+
const Utils = utils.__require();
|
|
17
|
+
const ECCode = errorCorrectionCode.__require();
|
|
18
|
+
const ECLevel = errorCorrectionLevel.__require();
|
|
19
|
+
const Mode = mode.__require();
|
|
20
|
+
const VersionCheck = versionCheck.__require();
|
|
21
|
+
|
|
22
|
+
// Generator polynomial used to encode version information
|
|
23
|
+
const G18 = (1 << 12) | (1 << 11) | (1 << 10) | (1 << 9) | (1 << 8) | (1 << 5) | (1 << 2) | (1 << 0);
|
|
24
|
+
const G18_BCH = Utils.getBCHDigit(G18);
|
|
25
|
+
|
|
26
|
+
function getBestVersionForDataLength (mode, length, errorCorrectionLevel) {
|
|
27
|
+
for (let currentVersion = 1; currentVersion <= 40; currentVersion++) {
|
|
28
|
+
if (length <= exports$1.getCapacity(currentVersion, errorCorrectionLevel, mode)) {
|
|
29
|
+
return currentVersion
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
return undefined
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
function getReservedBitsCount (mode, version) {
|
|
37
|
+
// Character count indicator + mode indicator bits
|
|
38
|
+
return Mode.getCharCountIndicator(mode, version) + 4
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
function getTotalBitsFromDataArray (segments, version) {
|
|
42
|
+
let totalBits = 0;
|
|
43
|
+
|
|
44
|
+
segments.forEach(function (data) {
|
|
45
|
+
const reservedBits = getReservedBitsCount(data.mode, version);
|
|
46
|
+
totalBits += reservedBits + data.getBitsLength();
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
return totalBits
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
function getBestVersionForMixedData (segments, errorCorrectionLevel) {
|
|
53
|
+
for (let currentVersion = 1; currentVersion <= 40; currentVersion++) {
|
|
54
|
+
const length = getTotalBitsFromDataArray(segments, currentVersion);
|
|
55
|
+
if (length <= exports$1.getCapacity(currentVersion, errorCorrectionLevel, Mode.MIXED)) {
|
|
56
|
+
return currentVersion
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
return undefined
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Returns version number from a value.
|
|
65
|
+
* If value is not a valid version, returns defaultValue
|
|
66
|
+
*
|
|
67
|
+
* @param {Number|String} value QR Code version
|
|
68
|
+
* @param {Number} defaultValue Fallback value
|
|
69
|
+
* @return {Number} QR Code version number
|
|
70
|
+
*/
|
|
71
|
+
exports$1.from = function from (value, defaultValue) {
|
|
72
|
+
if (VersionCheck.isValid(value)) {
|
|
73
|
+
return parseInt(value, 10)
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
return defaultValue
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* Returns how much data can be stored with the specified QR code version
|
|
81
|
+
* and error correction level
|
|
82
|
+
*
|
|
83
|
+
* @param {Number} version QR Code version (1-40)
|
|
84
|
+
* @param {Number} errorCorrectionLevel Error correction level
|
|
85
|
+
* @param {Mode} mode Data mode
|
|
86
|
+
* @return {Number} Quantity of storable data
|
|
87
|
+
*/
|
|
88
|
+
exports$1.getCapacity = function getCapacity (version, errorCorrectionLevel, mode) {
|
|
89
|
+
if (!VersionCheck.isValid(version)) {
|
|
90
|
+
throw new Error('Invalid QR Code version')
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
// Use Byte mode as default
|
|
94
|
+
if (typeof mode === 'undefined') mode = Mode.BYTE;
|
|
95
|
+
|
|
96
|
+
// Total codewords for this QR code version (Data + Error correction)
|
|
97
|
+
const totalCodewords = Utils.getSymbolTotalCodewords(version);
|
|
98
|
+
|
|
99
|
+
// Total number of error correction codewords
|
|
100
|
+
const ecTotalCodewords = ECCode.getTotalCodewordsCount(version, errorCorrectionLevel);
|
|
101
|
+
|
|
102
|
+
// Total number of data codewords
|
|
103
|
+
const dataTotalCodewordsBits = (totalCodewords - ecTotalCodewords) * 8;
|
|
104
|
+
|
|
105
|
+
if (mode === Mode.MIXED) return dataTotalCodewordsBits
|
|
106
|
+
|
|
107
|
+
const usableBits = dataTotalCodewordsBits - getReservedBitsCount(mode, version);
|
|
108
|
+
|
|
109
|
+
// Return max number of storable codewords
|
|
110
|
+
switch (mode) {
|
|
111
|
+
case Mode.NUMERIC:
|
|
112
|
+
return Math.floor((usableBits / 10) * 3)
|
|
113
|
+
|
|
114
|
+
case Mode.ALPHANUMERIC:
|
|
115
|
+
return Math.floor((usableBits / 11) * 2)
|
|
116
|
+
|
|
117
|
+
case Mode.KANJI:
|
|
118
|
+
return Math.floor(usableBits / 13)
|
|
119
|
+
|
|
120
|
+
case Mode.BYTE:
|
|
121
|
+
default:
|
|
122
|
+
return Math.floor(usableBits / 8)
|
|
123
|
+
}
|
|
124
|
+
};
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* Returns the minimum version needed to contain the amount of data
|
|
128
|
+
*
|
|
129
|
+
* @param {Segment} data Segment of data
|
|
130
|
+
* @param {Number} [errorCorrectionLevel=H] Error correction level
|
|
131
|
+
* @param {Mode} mode Data mode
|
|
132
|
+
* @return {Number} QR Code version
|
|
133
|
+
*/
|
|
134
|
+
exports$1.getBestVersionForData = function getBestVersionForData (data, errorCorrectionLevel) {
|
|
135
|
+
let seg;
|
|
136
|
+
|
|
137
|
+
const ecl = ECLevel.from(errorCorrectionLevel, ECLevel.M);
|
|
138
|
+
|
|
139
|
+
if (Array.isArray(data)) {
|
|
140
|
+
if (data.length > 1) {
|
|
141
|
+
return getBestVersionForMixedData(data, ecl)
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
if (data.length === 0) {
|
|
145
|
+
return 1
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
seg = data[0];
|
|
149
|
+
} else {
|
|
150
|
+
seg = data;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
return getBestVersionForDataLength(seg.mode, seg.getLength(), ecl)
|
|
154
|
+
};
|
|
155
|
+
|
|
156
|
+
/**
|
|
157
|
+
* Returns version information with relative error correction bits
|
|
158
|
+
*
|
|
159
|
+
* The version information is included in QR Code symbols of version 7 or larger.
|
|
160
|
+
* It consists of an 18-bit sequence containing 6 data bits,
|
|
161
|
+
* with 12 error correction bits calculated using the (18, 6) Golay code.
|
|
162
|
+
*
|
|
163
|
+
* @param {Number} version QR Code version
|
|
164
|
+
* @return {Number} Encoded version info bits
|
|
165
|
+
*/
|
|
166
|
+
exports$1.getEncodedBits = function getEncodedBits (version) {
|
|
167
|
+
if (!VersionCheck.isValid(version) || version < 7) {
|
|
168
|
+
throw new Error('Invalid QR Code version')
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
let d = version << 12;
|
|
172
|
+
|
|
173
|
+
while (Utils.getBCHDigit(d) - G18_BCH >= 0) {
|
|
174
|
+
d ^= (G18 << (Utils.getBCHDigit(d) - G18_BCH));
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
return (version << 12) | d
|
|
178
|
+
};
|
|
179
|
+
} (version.__exports));
|
|
180
|
+
return version.__exports;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
exports.__require = requireVersion;
|
|
184
|
+
//# sourceMappingURL=version.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"version.js","sources":["../../../../../node_modules/qrcode/lib/core/version.js"],"sourcesContent":["const Utils = require('./utils')\nconst ECCode = require('./error-correction-code')\nconst ECLevel = require('./error-correction-level')\nconst Mode = require('./mode')\nconst VersionCheck = require('./version-check')\n\n// Generator polynomial used to encode version information\nconst G18 = (1 << 12) | (1 << 11) | (1 << 10) | (1 << 9) | (1 << 8) | (1 << 5) | (1 << 2) | (1 << 0)\nconst G18_BCH = Utils.getBCHDigit(G18)\n\nfunction getBestVersionForDataLength (mode, length, errorCorrectionLevel) {\n for (let currentVersion = 1; currentVersion <= 40; currentVersion++) {\n if (length <= exports.getCapacity(currentVersion, errorCorrectionLevel, mode)) {\n return currentVersion\n }\n }\n\n return undefined\n}\n\nfunction getReservedBitsCount (mode, version) {\n // Character count indicator + mode indicator bits\n return Mode.getCharCountIndicator(mode, version) + 4\n}\n\nfunction getTotalBitsFromDataArray (segments, version) {\n let totalBits = 0\n\n segments.forEach(function (data) {\n const reservedBits = getReservedBitsCount(data.mode, version)\n totalBits += reservedBits + data.getBitsLength()\n })\n\n return totalBits\n}\n\nfunction getBestVersionForMixedData (segments, errorCorrectionLevel) {\n for (let currentVersion = 1; currentVersion <= 40; currentVersion++) {\n const length = getTotalBitsFromDataArray(segments, currentVersion)\n if (length <= exports.getCapacity(currentVersion, errorCorrectionLevel, Mode.MIXED)) {\n return currentVersion\n }\n }\n\n return undefined\n}\n\n/**\n * Returns version number from a value.\n * If value is not a valid version, returns defaultValue\n *\n * @param {Number|String} value QR Code version\n * @param {Number} defaultValue Fallback value\n * @return {Number} QR Code version number\n */\nexports.from = function from (value, defaultValue) {\n if (VersionCheck.isValid(value)) {\n return parseInt(value, 10)\n }\n\n return defaultValue\n}\n\n/**\n * Returns how much data can be stored with the specified QR code version\n * and error correction level\n *\n * @param {Number} version QR Code version (1-40)\n * @param {Number} errorCorrectionLevel Error correction level\n * @param {Mode} mode Data mode\n * @return {Number} Quantity of storable data\n */\nexports.getCapacity = function getCapacity (version, errorCorrectionLevel, mode) {\n if (!VersionCheck.isValid(version)) {\n throw new Error('Invalid QR Code version')\n }\n\n // Use Byte mode as default\n if (typeof mode === 'undefined') mode = Mode.BYTE\n\n // Total codewords for this QR code version (Data + Error correction)\n const totalCodewords = Utils.getSymbolTotalCodewords(version)\n\n // Total number of error correction codewords\n const ecTotalCodewords = ECCode.getTotalCodewordsCount(version, errorCorrectionLevel)\n\n // Total number of data codewords\n const dataTotalCodewordsBits = (totalCodewords - ecTotalCodewords) * 8\n\n if (mode === Mode.MIXED) return dataTotalCodewordsBits\n\n const usableBits = dataTotalCodewordsBits - getReservedBitsCount(mode, version)\n\n // Return max number of storable codewords\n switch (mode) {\n case Mode.NUMERIC:\n return Math.floor((usableBits / 10) * 3)\n\n case Mode.ALPHANUMERIC:\n return Math.floor((usableBits / 11) * 2)\n\n case Mode.KANJI:\n return Math.floor(usableBits / 13)\n\n case Mode.BYTE:\n default:\n return Math.floor(usableBits / 8)\n }\n}\n\n/**\n * Returns the minimum version needed to contain the amount of data\n *\n * @param {Segment} data Segment of data\n * @param {Number} [errorCorrectionLevel=H] Error correction level\n * @param {Mode} mode Data mode\n * @return {Number} QR Code version\n */\nexports.getBestVersionForData = function getBestVersionForData (data, errorCorrectionLevel) {\n let seg\n\n const ecl = ECLevel.from(errorCorrectionLevel, ECLevel.M)\n\n if (Array.isArray(data)) {\n if (data.length > 1) {\n return getBestVersionForMixedData(data, ecl)\n }\n\n if (data.length === 0) {\n return 1\n }\n\n seg = data[0]\n } else {\n seg = data\n }\n\n return getBestVersionForDataLength(seg.mode, seg.getLength(), ecl)\n}\n\n/**\n * Returns version information with relative error correction bits\n *\n * The version information is included in QR Code symbols of version 7 or larger.\n * It consists of an 18-bit sequence containing 6 data bits,\n * with 12 error correction bits calculated using the (18, 6) Golay code.\n *\n * @param {Number} version QR Code version\n * @return {Number} Encoded version info bits\n */\nexports.getEncodedBits = function getEncodedBits (version) {\n if (!VersionCheck.isValid(version) || version < 7) {\n throw new Error('Invalid QR Code version')\n }\n\n let d = version << 12\n\n while (Utils.getBCHDigit(d) - G18_BCH >= 0) {\n d ^= (G18 << (Utils.getBCHDigit(d) - G18_BCH))\n }\n\n return (version << 12) | d\n}\n"],"names":["require$$0","require$$1","require$$2","require$$3","require$$4","exports"],"mappings":";;;;;;;;;;;;;;;AAAA,EAAA,MAAM,KAAK,GAAGA,eAAA;AACd,EAAA,MAAM,MAAM,GAAGC,6BAAA;AACf,EAAA,MAAM,OAAO,GAAGC,8BAAA;AAChB,EAAA,MAAM,IAAI,GAAGC,cAAA;AACb,EAAA,MAAM,YAAY,GAAGC,sBAAA;;AAErB;AACA,EAAA,MAAM,GAAG,GAAG,CAAC,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;AACnG,EAAA,MAAM,OAAO,GAAG,KAAK,CAAC,WAAW,CAAC,GAAG;;AAErC,EAAA,SAAS,2BAA2B,EAAE,IAAI,EAAE,MAAM,EAAE,oBAAoB,EAAE;AAC1E,IAAE,KAAK,IAAI,cAAc,GAAG,CAAC,EAAE,cAAc,IAAI,EAAE,EAAE,cAAc,EAAE,EAAE;AACvE,MAAI,IAAI,MAAM,IAAIC,SAAO,CAAC,WAAW,CAAC,cAAc,EAAE,oBAAoB,EAAE,IAAI,CAAC,EAAE;AACnF,QAAM,OAAO;AACb,MAAA;AACA,IAAA;;AAEA,IAAE,OAAO;AACT,EAAA;;AAEA,EAAA,SAAS,oBAAoB,EAAE,IAAI,EAAE,OAAO,EAAE;AAC9C;IACE,OAAO,IAAI,CAAC,qBAAqB,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG;AACrD,EAAA;;A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0BAA0B,CAAC,IAAI,EAAE,GAAG;AACjD,MAAA;;AAEA,MAAI,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE;AAC3B,QAAM,OAAO;AACb,MAAA;;AAEA,MAAI,GAAG,GAAG,IAAI,CAAC,CAAC;AAChB,IAAA,CAAG,MAAM;AACT,MAAI,GAAG,GAAG;AACV,IAAA;;AAEA,IAAE,OAAO,2BAA2B,CAAC,GAAG,CAAC,IAAI,EAAE,GAAG,CAAC,SAAS,EAAE,EAAE,GAAG;AACnE,EAAA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAAA,SAAA,CAAA,cAAA,GAAyB,SAAS,cAAc,EAAE,OAAO,EAAE;AAC3D,IAAE,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,OAAO,GAAG,CAAC,EAAE;AACrD,MAAI,MAAM,IAAI,KAAK,CAAC,yBAAyB;AAC7C,IAAA;;AAEA,IAAE,IAAI,CAAC,GAAG,OAAO,IAAI;;IAEnB,OAAO,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC,GAAG,OAAO,IAAI,CAAC,EAAE;AAC9C,MAAI,CAAC,KAAK,GAAG,KAAK,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC;AACjD,IAAA;;AAEA,IAAE,OAAO,CAAC,OAAO,IAAI,EAAE,IAAI;AAC3B,EAAA,EAAA;;;;;;;","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var server = require('./server.js');
|
|
4
|
+
|
|
5
|
+
/*
|
|
6
|
+
*copyright Ryan Day 2012
|
|
7
|
+
*
|
|
8
|
+
* Licensed under the MIT license:
|
|
9
|
+
* http://www.opensource.org/licenses/mit-license.php
|
|
10
|
+
*
|
|
11
|
+
* this is the main server side application file for node-qrcode.
|
|
12
|
+
* these exports use serverside canvas api methods for file IO and buffers
|
|
13
|
+
*
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
var lib;
|
|
17
|
+
var hasRequiredLib;
|
|
18
|
+
|
|
19
|
+
function requireLib () {
|
|
20
|
+
if (hasRequiredLib) return lib;
|
|
21
|
+
hasRequiredLib = 1;
|
|
22
|
+
lib = server.__require();
|
|
23
|
+
return lib;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
exports.__require = requireLib;
|
|
27
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../node_modules/qrcode/lib/index.js"],"sourcesContent":["/*\n*copyright Ryan Day 2012\n*\n* Licensed under the MIT license:\n* http://www.opensource.org/licenses/mit-license.php\n*\n* this is the main server side application file for node-qrcode.\n* these exports use serverside canvas api methods for file IO and buffers\n*\n*/\n\nmodule.exports = require('./server')\n"],"names":["require$$0"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAWA,CAAA,GAAc,GAAGA,gBAAA;;;;;;","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var canvas = require('../../../../_virtual/canvas.js');
|
|
4
|
+
var utils = require('./utils.js');
|
|
5
|
+
|
|
6
|
+
var hasRequiredCanvas;
|
|
7
|
+
|
|
8
|
+
function requireCanvas () {
|
|
9
|
+
if (hasRequiredCanvas) return canvas.__exports;
|
|
10
|
+
hasRequiredCanvas = 1;
|
|
11
|
+
(function (exports$1) {
|
|
12
|
+
const Utils = utils.__require();
|
|
13
|
+
|
|
14
|
+
function clearCanvas (ctx, canvas, size) {
|
|
15
|
+
ctx.clearRect(0, 0, canvas.width, canvas.height);
|
|
16
|
+
|
|
17
|
+
if (!canvas.style) canvas.style = {};
|
|
18
|
+
canvas.height = size;
|
|
19
|
+
canvas.width = size;
|
|
20
|
+
canvas.style.height = size + 'px';
|
|
21
|
+
canvas.style.width = size + 'px';
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
function getCanvasElement () {
|
|
25
|
+
try {
|
|
26
|
+
return document.createElement('canvas')
|
|
27
|
+
} catch (e) {
|
|
28
|
+
throw new Error('You need to specify a canvas element')
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
exports$1.render = function render (qrData, canvas, options) {
|
|
33
|
+
let opts = options;
|
|
34
|
+
let canvasEl = canvas;
|
|
35
|
+
|
|
36
|
+
if (typeof opts === 'undefined' && (!canvas || !canvas.getContext)) {
|
|
37
|
+
opts = canvas;
|
|
38
|
+
canvas = undefined;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
if (!canvas) {
|
|
42
|
+
canvasEl = getCanvasElement();
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
opts = Utils.getOptions(opts);
|
|
46
|
+
const size = Utils.getImageWidth(qrData.modules.size, opts);
|
|
47
|
+
|
|
48
|
+
const ctx = canvasEl.getContext('2d');
|
|
49
|
+
const image = ctx.createImageData(size, size);
|
|
50
|
+
Utils.qrToImageData(image.data, qrData, opts);
|
|
51
|
+
|
|
52
|
+
clearCanvas(ctx, canvasEl, size);
|
|
53
|
+
ctx.putImageData(image, 0, 0);
|
|
54
|
+
|
|
55
|
+
return canvasEl
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
exports$1.renderToDataURL = function renderToDataURL (qrData, canvas, options) {
|
|
59
|
+
let opts = options;
|
|
60
|
+
|
|
61
|
+
if (typeof opts === 'undefined' && (!canvas || !canvas.getContext)) {
|
|
62
|
+
opts = canvas;
|
|
63
|
+
canvas = undefined;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
if (!opts) opts = {};
|
|
67
|
+
|
|
68
|
+
const canvasEl = exports$1.render(qrData, canvas, opts);
|
|
69
|
+
|
|
70
|
+
const type = opts.type || 'image/png';
|
|
71
|
+
const rendererOpts = opts.rendererOpts || {};
|
|
72
|
+
|
|
73
|
+
return canvasEl.toDataURL(type, rendererOpts.quality)
|
|
74
|
+
};
|
|
75
|
+
} (canvas.__exports));
|
|
76
|
+
return canvas.__exports;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
exports.__require = requireCanvas;
|
|
80
|
+
//# sourceMappingURL=canvas.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"canvas.js","sources":["../../../../../node_modules/qrcode/lib/renderer/canvas.js"],"sourcesContent":["const Utils = require('./utils')\n\nfunction clearCanvas (ctx, canvas, size) {\n ctx.clearRect(0, 0, canvas.width, canvas.height)\n\n if (!canvas.style) canvas.style = {}\n canvas.height = size\n canvas.width = size\n canvas.style.height = size + 'px'\n canvas.style.width = size + 'px'\n}\n\nfunction getCanvasElement () {\n try {\n return document.createElement('canvas')\n } catch (e) {\n throw new Error('You need to specify a canvas element')\n }\n}\n\nexports.render = function render (qrData, canvas, options) {\n let opts = options\n let canvasEl = canvas\n\n if (typeof opts === 'undefined' && (!canvas || !canvas.getContext)) {\n opts = canvas\n canvas = undefined\n }\n\n if (!canvas) {\n canvasEl = getCanvasElement()\n }\n\n opts = Utils.getOptions(opts)\n const size = Utils.getImageWidth(qrData.modules.size, opts)\n\n const ctx = canvasEl.getContext('2d')\n const image = ctx.createImageData(size, size)\n Utils.qrToImageData(image.data, qrData, opts)\n\n clearCanvas(ctx, canvasEl, size)\n ctx.putImageData(image, 0, 0)\n\n return canvasEl\n}\n\nexports.renderToDataURL = function renderToDataURL (qrData, canvas, options) {\n let opts = options\n\n if (typeof opts === 'undefined' && (!canvas || !canvas.getContext)) {\n opts = canvas\n canvas = undefined\n }\n\n if (!opts) opts = {}\n\n const canvasEl = exports.render(qrData, canvas, opts)\n\n const type = opts.type || 'image/png'\n const rendererOpts = opts.rendererOpts || {}\n\n return canvasEl.toDataURL(type, rendererOpts.quality)\n}\n"],"names":["require$$0","exports"],"mappings":";;;;;;;;;;;AAAA,EAAA,MAAM,KAAK,GAAGA,eAAA;;AAEd,EAAA,SAAS,WAAW,EA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C,eAAe,CAAC,IAAI,EAAE,IAAI;IAC5C,KAAK,CAAC,aAAa,CAAC,KAAK,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI;;AAE9C,IAAE,WAAW,CAAC,GAAG,EAAE,QAAQ,EAAE,IAAI;IAC/B,GAAG,CAAC,YAAY,CAAC,KAAK,EAAE,CAAC,EAAE,CAAC;;AAE9B,IAAE,OAAO;AACT,EAAA;;EAEAA,SAAA,CAAA,eAAA,GAA0B,SAAS,eAAe,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE;IAC3E,IAAI,IAAI,GAAG;;AAEb,IAAE,IAAI,OAAO,IAAI,KAAK,WAAW,KAAK,CAAC,MAAM,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,EAAE;AACtE,MAAI,IAAI,GAAG;AACX,MAAI,MAAM,GAAG;AACb,IAAA;;AAEA,IAAE,IAAI,CAAC,IAAI,EAAE,IAAI,GAAG;;IAElB,MAAM,QAAQ,GAAGA,SAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI;;AAEtD,IAAE,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,IAAI;AAC5B,IAAE,MAAM,YAAY,GAAG,IAAI,CAAC,YAAY,IAAI;;IAE1C,OAAO,QAAQ,CAAC,SAAS,CAAC,IAAI,EAAE,YAAY,CAAC,OAAO;AACtD,EAAA,EAAA;;;;;;;","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var png = require('../../../../_virtual/png.js');
|
|
4
|
+
var require$$1 = require('fs');
|
|
5
|
+
var png$1 = require('../../../pngjs/lib/png.js');
|
|
6
|
+
var utils = require('./utils.js');
|
|
7
|
+
|
|
8
|
+
var hasRequiredPng;
|
|
9
|
+
|
|
10
|
+
function requirePng () {
|
|
11
|
+
if (hasRequiredPng) return png.__exports;
|
|
12
|
+
hasRequiredPng = 1;
|
|
13
|
+
(function (exports$1) {
|
|
14
|
+
const fs = require$$1;
|
|
15
|
+
const PNG = png$1.__require().PNG;
|
|
16
|
+
const Utils = utils.__require();
|
|
17
|
+
|
|
18
|
+
exports$1.render = function render (qrData, options) {
|
|
19
|
+
const opts = Utils.getOptions(options);
|
|
20
|
+
const pngOpts = opts.rendererOpts;
|
|
21
|
+
const size = Utils.getImageWidth(qrData.modules.size, opts);
|
|
22
|
+
|
|
23
|
+
pngOpts.width = size;
|
|
24
|
+
pngOpts.height = size;
|
|
25
|
+
|
|
26
|
+
const pngImage = new PNG(pngOpts);
|
|
27
|
+
Utils.qrToImageData(pngImage.data, qrData, opts);
|
|
28
|
+
|
|
29
|
+
return pngImage
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
exports$1.renderToDataURL = function renderToDataURL (qrData, options, cb) {
|
|
33
|
+
if (typeof cb === 'undefined') {
|
|
34
|
+
cb = options;
|
|
35
|
+
options = undefined;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
exports$1.renderToBuffer(qrData, options, function (err, output) {
|
|
39
|
+
if (err) cb(err);
|
|
40
|
+
let url = 'data:image/png;base64,';
|
|
41
|
+
url += output.toString('base64');
|
|
42
|
+
cb(null, url);
|
|
43
|
+
});
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
exports$1.renderToBuffer = function renderToBuffer (qrData, options, cb) {
|
|
47
|
+
if (typeof cb === 'undefined') {
|
|
48
|
+
cb = options;
|
|
49
|
+
options = undefined;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
const png = exports$1.render(qrData, options);
|
|
53
|
+
const buffer = [];
|
|
54
|
+
|
|
55
|
+
png.on('error', cb);
|
|
56
|
+
|
|
57
|
+
png.on('data', function (data) {
|
|
58
|
+
buffer.push(data);
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
png.on('end', function () {
|
|
62
|
+
cb(null, Buffer.concat(buffer));
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
png.pack();
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
exports$1.renderToFile = function renderToFile (path, qrData, options, cb) {
|
|
69
|
+
if (typeof cb === 'undefined') {
|
|
70
|
+
cb = options;
|
|
71
|
+
options = undefined;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
let called = false;
|
|
75
|
+
const done = (...args) => {
|
|
76
|
+
if (called) return
|
|
77
|
+
called = true;
|
|
78
|
+
cb.apply(null, args);
|
|
79
|
+
};
|
|
80
|
+
const stream = fs.createWriteStream(path);
|
|
81
|
+
|
|
82
|
+
stream.on('error', done);
|
|
83
|
+
stream.on('close', done);
|
|
84
|
+
|
|
85
|
+
exports$1.renderToFileStream(stream, qrData, options);
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
exports$1.renderToFileStream = function renderToFileStream (stream, qrData, options) {
|
|
89
|
+
const png = exports$1.render(qrData, options);
|
|
90
|
+
png.pack().pipe(stream);
|
|
91
|
+
};
|
|
92
|
+
} (png.__exports));
|
|
93
|
+
return png.__exports;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
exports.__require = requirePng;
|
|
97
|
+
//# sourceMappingURL=png.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"png.js","sources":["../../../../../node_modules/qrcode/lib/renderer/png.js"],"sourcesContent":["const fs = require('fs')\nconst PNG = require('pngjs').PNG\nconst Utils = require('./utils')\n\nexports.render = function render (qrData, options) {\n const opts = Utils.getOptions(options)\n const pngOpts = opts.rendererOpts\n const size = Utils.getImageWidth(qrData.modules.size, opts)\n\n pngOpts.width = size\n pngOpts.height = size\n\n const pngImage = new PNG(pngOpts)\n Utils.qrToImageData(pngImage.data, qrData, opts)\n\n return pngImage\n}\n\nexports.renderToDataURL = function renderToDataURL (qrData, options, cb) {\n if (typeof cb === 'undefined') {\n cb = options\n options = undefined\n }\n\n exports.renderToBuffer(qrData, options, function (err, output) {\n if (err) cb(err)\n let url = 'data:image/png;base64,'\n url += output.toString('base64')\n cb(null, url)\n })\n}\n\nexports.renderToBuffer = function renderToBuffer (qrData, options, cb) {\n if (typeof cb === 'undefined') {\n cb = options\n options = undefined\n }\n\n const png = exports.render(qrData, options)\n const buffer = []\n\n png.on('error', cb)\n\n png.on('data', function (data) {\n buffer.push(data)\n })\n\n png.on('end', function () {\n cb(null, Buffer.concat(buffer))\n })\n\n png.pack()\n}\n\nexports.renderToFile = function renderToFile (path, qrData, options, cb) {\n if (typeof cb === 'undefined') {\n cb = options\n options = undefined\n }\n\n let called = false\n const done = (...args) => {\n if (called) return\n called = true\n cb.apply(null, args)\n }\n const stream = fs.createWriteStream(path)\n\n stream.on('error', done)\n stream.on('close', done)\n\n exports.renderToFileStream(stream, qrData, options)\n}\n\nexports.renderToFileStream = function renderToFileStream (stream, qrData, options) {\n const png = exports.render(qrData, options)\n png.pack().pipe(stream)\n}\n"],"names":["require$$0","require$$1","require$$2","exports"],"mappings":";;;;;;;;;;;;;AAAA,EAAA,MAAM,EAAE,GAAGA;EACX,MAAM,GAAG,GAAGC,eAAA,EAAgB,CAAC;AAC7B,EAAA,MAAM,KAAK,GAAGC,eAAA;;AAEd,EAAAC,SAAA,CAAA,MAAA,GAAiB,SAAS,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE;AACnD,IAAE,MAAM,IAAI,GAAG,KAAK,CAAC,UAAU,CAAC,OAAO;AACvC,IAAE,MAAM,OAAO,GAAG,IAAI,CAAC;AACvB,IAAE,MAAM,IAAI,GAAG,KAAK,CAAC,aAAa,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,EAAE,IAAI;;IAE1D,OAAO,CAAC,KAAK,GAAG;IAChB,OAAO,CAAC,MAAM,GAAG;;AAEnB,IAAE,MAAM,QAAQ,GAAG,IAAI,GAAG,CAAC,OAAO;IAChC,KAAK,CAAC,aAAa,CAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI;;AAEjD,IAAE,OAAO;AACT,EAAA;;EAEAA,SAAA,CAAA,eAAA,GAA0B,SAAS,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GAAG;AACT,MAAI,OAAO,GAAG;AACd,IAAA;;IAEE,IAAI,MAAM,GAAG;AACf,IAAE,MAAM,IAAI,GAAG,CAAC,GAAG,IAAI,KAAK;MACxB,IAAI,MAAM,EAAE;AAChB,MAAI,MAAM,GAAG;AACb,MAAI,EAAE,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI;AACvB,IAAA;AACA,IAAE,MAAM,MAAM,GAAG,EAAE,CAAC,iBAAiB,CAAC,IAAI;;AAE1C,IAAE,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,IAAI;AACzB,IAAE,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,IAAI;;IAEvBA,SAAO,CAAC,kBAAkB,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO;AACpD,EAAA;;EAEAA,SAAA,CAAA,kBAAA,GAA6B,SAAS,kBAAkB,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE;IACjF,MAAM,GAAG,GAAGA,SAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO;AAC5C,IAAE,GAAG,CAAC,IAAI,EAAE,CAAC,IAAI,CAAC,MAAM;AACxB,EAAA,EAAA;;;;;;;","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var svgTag = require('../../../../_virtual/svg-tag.js');
|
|
4
|
+
var utils = require('./utils.js');
|
|
5
|
+
|
|
6
|
+
var hasRequiredSvgTag;
|
|
7
|
+
|
|
8
|
+
function requireSvgTag () {
|
|
9
|
+
if (hasRequiredSvgTag) return svgTag.__exports;
|
|
10
|
+
hasRequiredSvgTag = 1;
|
|
11
|
+
const Utils = utils.__require();
|
|
12
|
+
|
|
13
|
+
function getColorAttrib (color, attrib) {
|
|
14
|
+
const alpha = color.a / 255;
|
|
15
|
+
const str = attrib + '="' + color.hex + '"';
|
|
16
|
+
|
|
17
|
+
return alpha < 1
|
|
18
|
+
? str + ' ' + attrib + '-opacity="' + alpha.toFixed(2).slice(1) + '"'
|
|
19
|
+
: str
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
function svgCmd (cmd, x, y) {
|
|
23
|
+
let str = cmd + x;
|
|
24
|
+
if (typeof y !== 'undefined') str += ' ' + y;
|
|
25
|
+
|
|
26
|
+
return str
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
function qrToPath (data, size, margin) {
|
|
30
|
+
let path = '';
|
|
31
|
+
let moveBy = 0;
|
|
32
|
+
let newRow = false;
|
|
33
|
+
let lineLength = 0;
|
|
34
|
+
|
|
35
|
+
for (let i = 0; i < data.length; i++) {
|
|
36
|
+
const col = Math.floor(i % size);
|
|
37
|
+
const row = Math.floor(i / size);
|
|
38
|
+
|
|
39
|
+
if (!col && !newRow) newRow = true;
|
|
40
|
+
|
|
41
|
+
if (data[i]) {
|
|
42
|
+
lineLength++;
|
|
43
|
+
|
|
44
|
+
if (!(i > 0 && col > 0 && data[i - 1])) {
|
|
45
|
+
path += newRow
|
|
46
|
+
? svgCmd('M', col + margin, 0.5 + row + margin)
|
|
47
|
+
: svgCmd('m', moveBy, 0);
|
|
48
|
+
|
|
49
|
+
moveBy = 0;
|
|
50
|
+
newRow = false;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
if (!(col + 1 < size && data[i + 1])) {
|
|
54
|
+
path += svgCmd('h', lineLength);
|
|
55
|
+
lineLength = 0;
|
|
56
|
+
}
|
|
57
|
+
} else {
|
|
58
|
+
moveBy++;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
return path
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
svgTag.__exports.render = function render (qrData, options, cb) {
|
|
66
|
+
const opts = Utils.getOptions(options);
|
|
67
|
+
const size = qrData.modules.size;
|
|
68
|
+
const data = qrData.modules.data;
|
|
69
|
+
const qrcodesize = size + opts.margin * 2;
|
|
70
|
+
|
|
71
|
+
const bg = !opts.color.light.a
|
|
72
|
+
? ''
|
|
73
|
+
: '<path ' + getColorAttrib(opts.color.light, 'fill') +
|
|
74
|
+
' d="M0 0h' + qrcodesize + 'v' + qrcodesize + 'H0z"/>';
|
|
75
|
+
|
|
76
|
+
const path =
|
|
77
|
+
'<path ' + getColorAttrib(opts.color.dark, 'stroke') +
|
|
78
|
+
' d="' + qrToPath(data, size, opts.margin) + '"/>';
|
|
79
|
+
|
|
80
|
+
const viewBox = 'viewBox="' + '0 0 ' + qrcodesize + ' ' + qrcodesize + '"';
|
|
81
|
+
|
|
82
|
+
const width = !opts.width ? '' : 'width="' + opts.width + '" height="' + opts.width + '" ';
|
|
83
|
+
|
|
84
|
+
const svgTag = '<svg xmlns="http://www.w3.org/2000/svg" ' + width + viewBox + ' shape-rendering="crispEdges">' + bg + path + '</svg>\n';
|
|
85
|
+
|
|
86
|
+
if (typeof cb === 'function') {
|
|
87
|
+
cb(null, svgTag);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
return svgTag
|
|
91
|
+
};
|
|
92
|
+
return svgTag.__exports;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
exports.__require = requireSvgTag;
|
|
96
|
+
//# sourceMappingURL=svg-tag.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"svg-tag.js","sources":["../../../../../node_modules/qrcode/lib/renderer/svg-tag.js"],"sourcesContent":["const Utils = require('./utils')\n\nfunction getColorAttrib (color, attrib) {\n const alpha = color.a / 255\n const str = attrib + '=\"' + color.hex + '\"'\n\n return alpha < 1\n ? str + ' ' + attrib + '-opacity=\"' + alpha.toFixed(2).slice(1) + '\"'\n : str\n}\n\nfunction svgCmd (cmd, x, y) {\n let str = cmd + x\n if (typeof y !== 'undefined') str += ' ' + y\n\n return str\n}\n\nfunction qrToPath (data, size, margin) {\n let path = ''\n let moveBy = 0\n let newRow = false\n let lineLength = 0\n\n for (let i = 0; i < data.length; i++) {\n const col = Math.floor(i % size)\n const row = Math.floor(i / size)\n\n if (!col && !newRow) newRow = true\n\n if (data[i]) {\n lineLength++\n\n if (!(i > 0 && col > 0 && data[i - 1])) {\n path += newRow\n ? svgCmd('M', col + margin, 0.5 + row + margin)\n : svgCmd('m', moveBy, 0)\n\n moveBy = 0\n newRow = false\n }\n\n if (!(col + 1 < size && data[i + 1])) {\n path += svgCmd('h', lineLength)\n lineLength = 0\n }\n } else {\n moveBy++\n }\n }\n\n return path\n}\n\nexports.render = function render (qrData, options, cb) {\n const opts = Utils.getOptions(options)\n const size = qrData.modules.size\n const data = qrData.modules.data\n const qrcodesize = size + opts.margin * 2\n\n const bg = !opts.color.light.a\n ? ''\n : '<path ' + getColorAttrib(opts.color.light, 'fill') +\n ' d=\"M0 0h' + qrcodesize + 'v' + qrcodesize + 'H0z\"/>'\n\n const path =\n '<path ' + getColorAttrib(opts.color.dark, 'stroke') +\n ' d=\"' + qrToPath(data, size, opts.margin) + '\"/>'\n\n const viewBox = 'viewBox=\"' + '0 0 ' + qrcodesize + ' ' + qrcodesize + '\"'\n\n const width = !opts.width ? '' : 'width=\"' + opts.width + '\" height=\"' + opts.width + '\" '\n\n const svgTag = '<svg xmlns=\"http://www.w3.org/2000/svg\" ' + width + viewBox + ' shape-rendering=\"crispEdges\">' + bg + path + '</svg>\\n'\n\n if (typeof cb === 'function') {\n cb(null, svgTag)\n }\n\n return svgTag\n}\n"],"names":["require$$0","svgTag"],"mappings":";;;;;;;;;;AAAA,CAAA,MAAM,KAAK,GAAGA,eAAA;;AAEd,CAAA,SAAS,cAAc,EAAE,KAAK,EAAE,MAAM,EAAE;AACxC,GAAE,MAAM,KAAK,GAAG,KAAK,CAAC,CAAC,GAAG;GACxB,MAAM,GAAG,GAAG,MAAM,GAAG,IAAI,GAAG,KAAK,CAAC,GAAG,GAAG;;GAExC,OAAO,KAAK,GAAG;AACjB,OAAM,GAAG,GAAG,GAAG,GAAG,MAAM,GAAG,YAAY,GAAG,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,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G,EAAE,GAAG,IAAI,GAAG;;AAE/H,GAAE,IAAI,OAAO,EAAE,KAAK,UAAU,EAAE;AAChC,KAAI,EAAE,CAAC,IAAI,EAAE,MAAM;AACnB,GAAA;;AAEA,GAAE,OAAO;AACT,CAAA;;;;;;","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var svg = require('../../../../_virtual/svg.js');
|
|
4
|
+
var svgTag = require('./svg-tag.js');
|
|
5
|
+
var require$$1 = require('fs');
|
|
6
|
+
|
|
7
|
+
var hasRequiredSvg;
|
|
8
|
+
|
|
9
|
+
function requireSvg () {
|
|
10
|
+
if (hasRequiredSvg) return svg.__exports;
|
|
11
|
+
hasRequiredSvg = 1;
|
|
12
|
+
(function (exports$1) {
|
|
13
|
+
const svgTagRenderer = svgTag.__require();
|
|
14
|
+
|
|
15
|
+
exports$1.render = svgTagRenderer.render;
|
|
16
|
+
|
|
17
|
+
exports$1.renderToFile = function renderToFile (path, qrData, options, cb) {
|
|
18
|
+
if (typeof cb === 'undefined') {
|
|
19
|
+
cb = options;
|
|
20
|
+
options = undefined;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const fs = require$$1;
|
|
24
|
+
const svgTag = exports$1.render(qrData, options);
|
|
25
|
+
|
|
26
|
+
const xmlStr = '<?xml version="1.0" encoding="utf-8"?>' +
|
|
27
|
+
'<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">' +
|
|
28
|
+
svgTag;
|
|
29
|
+
|
|
30
|
+
fs.writeFile(path, xmlStr, cb);
|
|
31
|
+
};
|
|
32
|
+
} (svg.__exports));
|
|
33
|
+
return svg.__exports;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
exports.__require = requireSvg;
|
|
37
|
+
//# sourceMappingURL=svg.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"svg.js","sources":["../../../../../node_modules/qrcode/lib/renderer/svg.js"],"sourcesContent":["const svgTagRenderer = require('./svg-tag')\n\nexports.render = svgTagRenderer.render\n\nexports.renderToFile = function renderToFile (path, qrData, options, cb) {\n if (typeof cb === 'undefined') {\n cb = options\n options = undefined\n }\n\n const fs = require('fs')\n const svgTag = exports.render(qrData, options)\n\n const xmlStr = '<?xml version=\"1.0\" encoding=\"utf-8\"?>' +\n '<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\" \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">' +\n svgTag\n\n fs.writeFile(path, xmlStr, cb)\n}\n"],"names":["require$$0","exports"],"mappings":";;;;;;;;;;;;AAAA,EAAA,MAAM,cAAc,GAAGA,gBAAA;;AAEvB,EAAAC,SAAA,CAAA,MAAA,GAAiB,cAAc,CAAC;;EAEhCA,SAAA,CAAA,YAAA,GAAuB,SAAS,YAAY,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,EAAE,EAAE;AACzE,IAAE,IAAI,OAAO,EAAE,KAAK,WAAW,EAAE;AACjC,MAAI,EAAE,GAAG;AACT,MAAI,OAAO,GAAG;AACd,IAAA;;IAEE,MAAM,EAAE,GAAG;IACX,MAAM,MAAM,GAAGA,SAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO;;IAE7C,MAAM,MAAM,GAAG,wCAAwC;AACzD,MAAI,oGAAoG;MACpG;;IAEF,EAAE,CAAC,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE;AAC/B,EAAA,EAAA;;;;;;;","x_google_ignoreList":[0]}
|