suioutkit 1.0.2 → 1.0.3

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/index.js CHANGED
@@ -21581,6 +21581,2084 @@ var require_lib = __commonJS({
21581
21581
  }
21582
21582
  });
21583
21583
 
21584
+ // node_modules/qrcode/lib/can-promise.js
21585
+ var require_can_promise = __commonJS({
21586
+ "node_modules/qrcode/lib/can-promise.js"(exports, module) {
21587
+ module.exports = function() {
21588
+ return typeof Promise === "function" && Promise.prototype && Promise.prototype.then;
21589
+ };
21590
+ }
21591
+ });
21592
+
21593
+ // node_modules/qrcode/lib/core/utils.js
21594
+ var require_utils = __commonJS({
21595
+ "node_modules/qrcode/lib/core/utils.js"(exports) {
21596
+ var toSJISFunction;
21597
+ var CODEWORDS_COUNT = [
21598
+ 0,
21599
+ // Not used
21600
+ 26,
21601
+ 44,
21602
+ 70,
21603
+ 100,
21604
+ 134,
21605
+ 172,
21606
+ 196,
21607
+ 242,
21608
+ 292,
21609
+ 346,
21610
+ 404,
21611
+ 466,
21612
+ 532,
21613
+ 581,
21614
+ 655,
21615
+ 733,
21616
+ 815,
21617
+ 901,
21618
+ 991,
21619
+ 1085,
21620
+ 1156,
21621
+ 1258,
21622
+ 1364,
21623
+ 1474,
21624
+ 1588,
21625
+ 1706,
21626
+ 1828,
21627
+ 1921,
21628
+ 2051,
21629
+ 2185,
21630
+ 2323,
21631
+ 2465,
21632
+ 2611,
21633
+ 2761,
21634
+ 2876,
21635
+ 3034,
21636
+ 3196,
21637
+ 3362,
21638
+ 3532,
21639
+ 3706
21640
+ ];
21641
+ exports.getSymbolSize = function getSymbolSize(version) {
21642
+ if (!version) throw new Error('"version" cannot be null or undefined');
21643
+ if (version < 1 || version > 40) throw new Error('"version" should be in range from 1 to 40');
21644
+ return version * 4 + 17;
21645
+ };
21646
+ exports.getSymbolTotalCodewords = function getSymbolTotalCodewords(version) {
21647
+ return CODEWORDS_COUNT[version];
21648
+ };
21649
+ exports.getBCHDigit = function(data) {
21650
+ let digit = 0;
21651
+ while (data !== 0) {
21652
+ digit++;
21653
+ data >>>= 1;
21654
+ }
21655
+ return digit;
21656
+ };
21657
+ exports.setToSJISFunction = function setToSJISFunction(f3) {
21658
+ if (typeof f3 !== "function") {
21659
+ throw new Error('"toSJISFunc" is not a valid function.');
21660
+ }
21661
+ toSJISFunction = f3;
21662
+ };
21663
+ exports.isKanjiModeEnabled = function() {
21664
+ return typeof toSJISFunction !== "undefined";
21665
+ };
21666
+ exports.toSJIS = function toSJIS(kanji) {
21667
+ return toSJISFunction(kanji);
21668
+ };
21669
+ }
21670
+ });
21671
+
21672
+ // node_modules/qrcode/lib/core/error-correction-level.js
21673
+ var require_error_correction_level = __commonJS({
21674
+ "node_modules/qrcode/lib/core/error-correction-level.js"(exports) {
21675
+ exports.L = { bit: 1 };
21676
+ exports.M = { bit: 0 };
21677
+ exports.Q = { bit: 3 };
21678
+ exports.H = { bit: 2 };
21679
+ function fromString(string2) {
21680
+ if (typeof string2 !== "string") {
21681
+ throw new Error("Param is not a string");
21682
+ }
21683
+ const lcStr = string2.toLowerCase();
21684
+ switch (lcStr) {
21685
+ case "l":
21686
+ case "low":
21687
+ return exports.L;
21688
+ case "m":
21689
+ case "medium":
21690
+ return exports.M;
21691
+ case "q":
21692
+ case "quartile":
21693
+ return exports.Q;
21694
+ case "h":
21695
+ case "high":
21696
+ return exports.H;
21697
+ default:
21698
+ throw new Error("Unknown EC Level: " + string2);
21699
+ }
21700
+ }
21701
+ exports.isValid = function isValid(level) {
21702
+ return level && typeof level.bit !== "undefined" && level.bit >= 0 && level.bit < 4;
21703
+ };
21704
+ exports.from = function from(value, defaultValue) {
21705
+ if (exports.isValid(value)) {
21706
+ return value;
21707
+ }
21708
+ try {
21709
+ return fromString(value);
21710
+ } catch (e9) {
21711
+ return defaultValue;
21712
+ }
21713
+ };
21714
+ }
21715
+ });
21716
+
21717
+ // node_modules/qrcode/lib/core/bit-buffer.js
21718
+ var require_bit_buffer = __commonJS({
21719
+ "node_modules/qrcode/lib/core/bit-buffer.js"(exports, module) {
21720
+ function BitBuffer() {
21721
+ this.buffer = [];
21722
+ this.length = 0;
21723
+ }
21724
+ BitBuffer.prototype = {
21725
+ get: function(index) {
21726
+ const bufIndex = Math.floor(index / 8);
21727
+ return (this.buffer[bufIndex] >>> 7 - index % 8 & 1) === 1;
21728
+ },
21729
+ put: function(num, length) {
21730
+ for (let i7 = 0; i7 < length; i7++) {
21731
+ this.putBit((num >>> length - i7 - 1 & 1) === 1);
21732
+ }
21733
+ },
21734
+ getLengthInBits: function() {
21735
+ return this.length;
21736
+ },
21737
+ putBit: function(bit) {
21738
+ const bufIndex = Math.floor(this.length / 8);
21739
+ if (this.buffer.length <= bufIndex) {
21740
+ this.buffer.push(0);
21741
+ }
21742
+ if (bit) {
21743
+ this.buffer[bufIndex] |= 128 >>> this.length % 8;
21744
+ }
21745
+ this.length++;
21746
+ }
21747
+ };
21748
+ module.exports = BitBuffer;
21749
+ }
21750
+ });
21751
+
21752
+ // node_modules/qrcode/lib/core/bit-matrix.js
21753
+ var require_bit_matrix = __commonJS({
21754
+ "node_modules/qrcode/lib/core/bit-matrix.js"(exports, module) {
21755
+ function BitMatrix(size2) {
21756
+ if (!size2 || size2 < 1) {
21757
+ throw new Error("BitMatrix size must be defined and greater than 0");
21758
+ }
21759
+ this.size = size2;
21760
+ this.data = new Uint8Array(size2 * size2);
21761
+ this.reservedBit = new Uint8Array(size2 * size2);
21762
+ }
21763
+ BitMatrix.prototype.set = function(row, col, value, reserved) {
21764
+ const index = row * this.size + col;
21765
+ this.data[index] = value;
21766
+ if (reserved) this.reservedBit[index] = true;
21767
+ };
21768
+ BitMatrix.prototype.get = function(row, col) {
21769
+ return this.data[row * this.size + col];
21770
+ };
21771
+ BitMatrix.prototype.xor = function(row, col, value) {
21772
+ this.data[row * this.size + col] ^= value;
21773
+ };
21774
+ BitMatrix.prototype.isReserved = function(row, col) {
21775
+ return this.reservedBit[row * this.size + col];
21776
+ };
21777
+ module.exports = BitMatrix;
21778
+ }
21779
+ });
21780
+
21781
+ // node_modules/qrcode/lib/core/alignment-pattern.js
21782
+ var require_alignment_pattern = __commonJS({
21783
+ "node_modules/qrcode/lib/core/alignment-pattern.js"(exports) {
21784
+ var getSymbolSize = require_utils().getSymbolSize;
21785
+ exports.getRowColCoords = function getRowColCoords(version) {
21786
+ if (version === 1) return [];
21787
+ const posCount = Math.floor(version / 7) + 2;
21788
+ const size2 = getSymbolSize(version);
21789
+ const intervals = size2 === 145 ? 26 : Math.ceil((size2 - 13) / (2 * posCount - 2)) * 2;
21790
+ const positions = [size2 - 7];
21791
+ for (let i7 = 1; i7 < posCount - 1; i7++) {
21792
+ positions[i7] = positions[i7 - 1] - intervals;
21793
+ }
21794
+ positions.push(6);
21795
+ return positions.reverse();
21796
+ };
21797
+ exports.getPositions = function getPositions(version) {
21798
+ const coords = [];
21799
+ const pos = exports.getRowColCoords(version);
21800
+ const posLength = pos.length;
21801
+ for (let i7 = 0; i7 < posLength; i7++) {
21802
+ for (let j = 0; j < posLength; j++) {
21803
+ if (i7 === 0 && j === 0 || // top-left
21804
+ i7 === 0 && j === posLength - 1 || // bottom-left
21805
+ i7 === posLength - 1 && j === 0) {
21806
+ continue;
21807
+ }
21808
+ coords.push([pos[i7], pos[j]]);
21809
+ }
21810
+ }
21811
+ return coords;
21812
+ };
21813
+ }
21814
+ });
21815
+
21816
+ // node_modules/qrcode/lib/core/finder-pattern.js
21817
+ var require_finder_pattern = __commonJS({
21818
+ "node_modules/qrcode/lib/core/finder-pattern.js"(exports) {
21819
+ var getSymbolSize = require_utils().getSymbolSize;
21820
+ var FINDER_PATTERN_SIZE = 7;
21821
+ exports.getPositions = function getPositions(version) {
21822
+ const size2 = getSymbolSize(version);
21823
+ return [
21824
+ // top-left
21825
+ [0, 0],
21826
+ // top-right
21827
+ [size2 - FINDER_PATTERN_SIZE, 0],
21828
+ // bottom-left
21829
+ [0, size2 - FINDER_PATTERN_SIZE]
21830
+ ];
21831
+ };
21832
+ }
21833
+ });
21834
+
21835
+ // node_modules/qrcode/lib/core/mask-pattern.js
21836
+ var require_mask_pattern = __commonJS({
21837
+ "node_modules/qrcode/lib/core/mask-pattern.js"(exports) {
21838
+ exports.Patterns = {
21839
+ PATTERN000: 0,
21840
+ PATTERN001: 1,
21841
+ PATTERN010: 2,
21842
+ PATTERN011: 3,
21843
+ PATTERN100: 4,
21844
+ PATTERN101: 5,
21845
+ PATTERN110: 6,
21846
+ PATTERN111: 7
21847
+ };
21848
+ var PenaltyScores = {
21849
+ N1: 3,
21850
+ N2: 3,
21851
+ N3: 40,
21852
+ N4: 10
21853
+ };
21854
+ exports.isValid = function isValid(mask) {
21855
+ return mask != null && mask !== "" && !isNaN(mask) && mask >= 0 && mask <= 7;
21856
+ };
21857
+ exports.from = function from(value) {
21858
+ return exports.isValid(value) ? parseInt(value, 10) : void 0;
21859
+ };
21860
+ exports.getPenaltyN1 = function getPenaltyN1(data) {
21861
+ const size2 = data.size;
21862
+ let points = 0;
21863
+ let sameCountCol = 0;
21864
+ let sameCountRow = 0;
21865
+ let lastCol = null;
21866
+ let lastRow = null;
21867
+ for (let row = 0; row < size2; row++) {
21868
+ sameCountCol = sameCountRow = 0;
21869
+ lastCol = lastRow = null;
21870
+ for (let col = 0; col < size2; col++) {
21871
+ let module2 = data.get(row, col);
21872
+ if (module2 === lastCol) {
21873
+ sameCountCol++;
21874
+ } else {
21875
+ if (sameCountCol >= 5) points += PenaltyScores.N1 + (sameCountCol - 5);
21876
+ lastCol = module2;
21877
+ sameCountCol = 1;
21878
+ }
21879
+ module2 = data.get(col, row);
21880
+ if (module2 === lastRow) {
21881
+ sameCountRow++;
21882
+ } else {
21883
+ if (sameCountRow >= 5) points += PenaltyScores.N1 + (sameCountRow - 5);
21884
+ lastRow = module2;
21885
+ sameCountRow = 1;
21886
+ }
21887
+ }
21888
+ if (sameCountCol >= 5) points += PenaltyScores.N1 + (sameCountCol - 5);
21889
+ if (sameCountRow >= 5) points += PenaltyScores.N1 + (sameCountRow - 5);
21890
+ }
21891
+ return points;
21892
+ };
21893
+ exports.getPenaltyN2 = function getPenaltyN2(data) {
21894
+ const size2 = data.size;
21895
+ let points = 0;
21896
+ for (let row = 0; row < size2 - 1; row++) {
21897
+ for (let col = 0; col < size2 - 1; col++) {
21898
+ const last = data.get(row, col) + data.get(row, col + 1) + data.get(row + 1, col) + data.get(row + 1, col + 1);
21899
+ if (last === 4 || last === 0) points++;
21900
+ }
21901
+ }
21902
+ return points * PenaltyScores.N2;
21903
+ };
21904
+ exports.getPenaltyN3 = function getPenaltyN3(data) {
21905
+ const size2 = data.size;
21906
+ let points = 0;
21907
+ let bitsCol = 0;
21908
+ let bitsRow = 0;
21909
+ for (let row = 0; row < size2; row++) {
21910
+ bitsCol = bitsRow = 0;
21911
+ for (let col = 0; col < size2; col++) {
21912
+ bitsCol = bitsCol << 1 & 2047 | data.get(row, col);
21913
+ if (col >= 10 && (bitsCol === 1488 || bitsCol === 93)) points++;
21914
+ bitsRow = bitsRow << 1 & 2047 | data.get(col, row);
21915
+ if (col >= 10 && (bitsRow === 1488 || bitsRow === 93)) points++;
21916
+ }
21917
+ }
21918
+ return points * PenaltyScores.N3;
21919
+ };
21920
+ exports.getPenaltyN4 = function getPenaltyN4(data) {
21921
+ let darkCount = 0;
21922
+ const modulesCount = data.data.length;
21923
+ for (let i7 = 0; i7 < modulesCount; i7++) darkCount += data.data[i7];
21924
+ const k2 = Math.abs(Math.ceil(darkCount * 100 / modulesCount / 5) - 10);
21925
+ return k2 * PenaltyScores.N4;
21926
+ };
21927
+ function getMaskAt(maskPattern, i7, j) {
21928
+ switch (maskPattern) {
21929
+ case exports.Patterns.PATTERN000:
21930
+ return (i7 + j) % 2 === 0;
21931
+ case exports.Patterns.PATTERN001:
21932
+ return i7 % 2 === 0;
21933
+ case exports.Patterns.PATTERN010:
21934
+ return j % 3 === 0;
21935
+ case exports.Patterns.PATTERN011:
21936
+ return (i7 + j) % 3 === 0;
21937
+ case exports.Patterns.PATTERN100:
21938
+ return (Math.floor(i7 / 2) + Math.floor(j / 3)) % 2 === 0;
21939
+ case exports.Patterns.PATTERN101:
21940
+ return i7 * j % 2 + i7 * j % 3 === 0;
21941
+ case exports.Patterns.PATTERN110:
21942
+ return (i7 * j % 2 + i7 * j % 3) % 2 === 0;
21943
+ case exports.Patterns.PATTERN111:
21944
+ return (i7 * j % 3 + (i7 + j) % 2) % 2 === 0;
21945
+ default:
21946
+ throw new Error("bad maskPattern:" + maskPattern);
21947
+ }
21948
+ }
21949
+ exports.applyMask = function applyMask(pattern, data) {
21950
+ const size2 = data.size;
21951
+ for (let col = 0; col < size2; col++) {
21952
+ for (let row = 0; row < size2; row++) {
21953
+ if (data.isReserved(row, col)) continue;
21954
+ data.xor(row, col, getMaskAt(pattern, row, col));
21955
+ }
21956
+ }
21957
+ };
21958
+ exports.getBestMask = function getBestMask(data, setupFormatFunc) {
21959
+ const numPatterns = Object.keys(exports.Patterns).length;
21960
+ let bestPattern = 0;
21961
+ let lowerPenalty = Infinity;
21962
+ for (let p3 = 0; p3 < numPatterns; p3++) {
21963
+ setupFormatFunc(p3);
21964
+ exports.applyMask(p3, data);
21965
+ const penalty = exports.getPenaltyN1(data) + exports.getPenaltyN2(data) + exports.getPenaltyN3(data) + exports.getPenaltyN4(data);
21966
+ exports.applyMask(p3, data);
21967
+ if (penalty < lowerPenalty) {
21968
+ lowerPenalty = penalty;
21969
+ bestPattern = p3;
21970
+ }
21971
+ }
21972
+ return bestPattern;
21973
+ };
21974
+ }
21975
+ });
21976
+
21977
+ // node_modules/qrcode/lib/core/error-correction-code.js
21978
+ var require_error_correction_code = __commonJS({
21979
+ "node_modules/qrcode/lib/core/error-correction-code.js"(exports) {
21980
+ var ECLevel = require_error_correction_level();
21981
+ var EC_BLOCKS_TABLE = [
21982
+ // L M Q H
21983
+ 1,
21984
+ 1,
21985
+ 1,
21986
+ 1,
21987
+ 1,
21988
+ 1,
21989
+ 1,
21990
+ 1,
21991
+ 1,
21992
+ 1,
21993
+ 2,
21994
+ 2,
21995
+ 1,
21996
+ 2,
21997
+ 2,
21998
+ 4,
21999
+ 1,
22000
+ 2,
22001
+ 4,
22002
+ 4,
22003
+ 2,
22004
+ 4,
22005
+ 4,
22006
+ 4,
22007
+ 2,
22008
+ 4,
22009
+ 6,
22010
+ 5,
22011
+ 2,
22012
+ 4,
22013
+ 6,
22014
+ 6,
22015
+ 2,
22016
+ 5,
22017
+ 8,
22018
+ 8,
22019
+ 4,
22020
+ 5,
22021
+ 8,
22022
+ 8,
22023
+ 4,
22024
+ 5,
22025
+ 8,
22026
+ 11,
22027
+ 4,
22028
+ 8,
22029
+ 10,
22030
+ 11,
22031
+ 4,
22032
+ 9,
22033
+ 12,
22034
+ 16,
22035
+ 4,
22036
+ 9,
22037
+ 16,
22038
+ 16,
22039
+ 6,
22040
+ 10,
22041
+ 12,
22042
+ 18,
22043
+ 6,
22044
+ 10,
22045
+ 17,
22046
+ 16,
22047
+ 6,
22048
+ 11,
22049
+ 16,
22050
+ 19,
22051
+ 6,
22052
+ 13,
22053
+ 18,
22054
+ 21,
22055
+ 7,
22056
+ 14,
22057
+ 21,
22058
+ 25,
22059
+ 8,
22060
+ 16,
22061
+ 20,
22062
+ 25,
22063
+ 8,
22064
+ 17,
22065
+ 23,
22066
+ 25,
22067
+ 9,
22068
+ 17,
22069
+ 23,
22070
+ 34,
22071
+ 9,
22072
+ 18,
22073
+ 25,
22074
+ 30,
22075
+ 10,
22076
+ 20,
22077
+ 27,
22078
+ 32,
22079
+ 12,
22080
+ 21,
22081
+ 29,
22082
+ 35,
22083
+ 12,
22084
+ 23,
22085
+ 34,
22086
+ 37,
22087
+ 12,
22088
+ 25,
22089
+ 34,
22090
+ 40,
22091
+ 13,
22092
+ 26,
22093
+ 35,
22094
+ 42,
22095
+ 14,
22096
+ 28,
22097
+ 38,
22098
+ 45,
22099
+ 15,
22100
+ 29,
22101
+ 40,
22102
+ 48,
22103
+ 16,
22104
+ 31,
22105
+ 43,
22106
+ 51,
22107
+ 17,
22108
+ 33,
22109
+ 45,
22110
+ 54,
22111
+ 18,
22112
+ 35,
22113
+ 48,
22114
+ 57,
22115
+ 19,
22116
+ 37,
22117
+ 51,
22118
+ 60,
22119
+ 19,
22120
+ 38,
22121
+ 53,
22122
+ 63,
22123
+ 20,
22124
+ 40,
22125
+ 56,
22126
+ 66,
22127
+ 21,
22128
+ 43,
22129
+ 59,
22130
+ 70,
22131
+ 22,
22132
+ 45,
22133
+ 62,
22134
+ 74,
22135
+ 24,
22136
+ 47,
22137
+ 65,
22138
+ 77,
22139
+ 25,
22140
+ 49,
22141
+ 68,
22142
+ 81
22143
+ ];
22144
+ var EC_CODEWORDS_TABLE = [
22145
+ // L M Q H
22146
+ 7,
22147
+ 10,
22148
+ 13,
22149
+ 17,
22150
+ 10,
22151
+ 16,
22152
+ 22,
22153
+ 28,
22154
+ 15,
22155
+ 26,
22156
+ 36,
22157
+ 44,
22158
+ 20,
22159
+ 36,
22160
+ 52,
22161
+ 64,
22162
+ 26,
22163
+ 48,
22164
+ 72,
22165
+ 88,
22166
+ 36,
22167
+ 64,
22168
+ 96,
22169
+ 112,
22170
+ 40,
22171
+ 72,
22172
+ 108,
22173
+ 130,
22174
+ 48,
22175
+ 88,
22176
+ 132,
22177
+ 156,
22178
+ 60,
22179
+ 110,
22180
+ 160,
22181
+ 192,
22182
+ 72,
22183
+ 130,
22184
+ 192,
22185
+ 224,
22186
+ 80,
22187
+ 150,
22188
+ 224,
22189
+ 264,
22190
+ 96,
22191
+ 176,
22192
+ 260,
22193
+ 308,
22194
+ 104,
22195
+ 198,
22196
+ 288,
22197
+ 352,
22198
+ 120,
22199
+ 216,
22200
+ 320,
22201
+ 384,
22202
+ 132,
22203
+ 240,
22204
+ 360,
22205
+ 432,
22206
+ 144,
22207
+ 280,
22208
+ 408,
22209
+ 480,
22210
+ 168,
22211
+ 308,
22212
+ 448,
22213
+ 532,
22214
+ 180,
22215
+ 338,
22216
+ 504,
22217
+ 588,
22218
+ 196,
22219
+ 364,
22220
+ 546,
22221
+ 650,
22222
+ 224,
22223
+ 416,
22224
+ 600,
22225
+ 700,
22226
+ 224,
22227
+ 442,
22228
+ 644,
22229
+ 750,
22230
+ 252,
22231
+ 476,
22232
+ 690,
22233
+ 816,
22234
+ 270,
22235
+ 504,
22236
+ 750,
22237
+ 900,
22238
+ 300,
22239
+ 560,
22240
+ 810,
22241
+ 960,
22242
+ 312,
22243
+ 588,
22244
+ 870,
22245
+ 1050,
22246
+ 336,
22247
+ 644,
22248
+ 952,
22249
+ 1110,
22250
+ 360,
22251
+ 700,
22252
+ 1020,
22253
+ 1200,
22254
+ 390,
22255
+ 728,
22256
+ 1050,
22257
+ 1260,
22258
+ 420,
22259
+ 784,
22260
+ 1140,
22261
+ 1350,
22262
+ 450,
22263
+ 812,
22264
+ 1200,
22265
+ 1440,
22266
+ 480,
22267
+ 868,
22268
+ 1290,
22269
+ 1530,
22270
+ 510,
22271
+ 924,
22272
+ 1350,
22273
+ 1620,
22274
+ 540,
22275
+ 980,
22276
+ 1440,
22277
+ 1710,
22278
+ 570,
22279
+ 1036,
22280
+ 1530,
22281
+ 1800,
22282
+ 570,
22283
+ 1064,
22284
+ 1590,
22285
+ 1890,
22286
+ 600,
22287
+ 1120,
22288
+ 1680,
22289
+ 1980,
22290
+ 630,
22291
+ 1204,
22292
+ 1770,
22293
+ 2100,
22294
+ 660,
22295
+ 1260,
22296
+ 1860,
22297
+ 2220,
22298
+ 720,
22299
+ 1316,
22300
+ 1950,
22301
+ 2310,
22302
+ 750,
22303
+ 1372,
22304
+ 2040,
22305
+ 2430
22306
+ ];
22307
+ exports.getBlocksCount = function getBlocksCount(version, errorCorrectionLevel) {
22308
+ switch (errorCorrectionLevel) {
22309
+ case ECLevel.L:
22310
+ return EC_BLOCKS_TABLE[(version - 1) * 4 + 0];
22311
+ case ECLevel.M:
22312
+ return EC_BLOCKS_TABLE[(version - 1) * 4 + 1];
22313
+ case ECLevel.Q:
22314
+ return EC_BLOCKS_TABLE[(version - 1) * 4 + 2];
22315
+ case ECLevel.H:
22316
+ return EC_BLOCKS_TABLE[(version - 1) * 4 + 3];
22317
+ default:
22318
+ return void 0;
22319
+ }
22320
+ };
22321
+ exports.getTotalCodewordsCount = function getTotalCodewordsCount(version, errorCorrectionLevel) {
22322
+ switch (errorCorrectionLevel) {
22323
+ case ECLevel.L:
22324
+ return EC_CODEWORDS_TABLE[(version - 1) * 4 + 0];
22325
+ case ECLevel.M:
22326
+ return EC_CODEWORDS_TABLE[(version - 1) * 4 + 1];
22327
+ case ECLevel.Q:
22328
+ return EC_CODEWORDS_TABLE[(version - 1) * 4 + 2];
22329
+ case ECLevel.H:
22330
+ return EC_CODEWORDS_TABLE[(version - 1) * 4 + 3];
22331
+ default:
22332
+ return void 0;
22333
+ }
22334
+ };
22335
+ }
22336
+ });
22337
+
22338
+ // node_modules/qrcode/lib/core/galois-field.js
22339
+ var require_galois_field = __commonJS({
22340
+ "node_modules/qrcode/lib/core/galois-field.js"(exports) {
22341
+ var EXP_TABLE = new Uint8Array(512);
22342
+ var LOG_TABLE = new Uint8Array(256);
22343
+ (function initTables() {
22344
+ let x2 = 1;
22345
+ for (let i7 = 0; i7 < 255; i7++) {
22346
+ EXP_TABLE[i7] = x2;
22347
+ LOG_TABLE[x2] = i7;
22348
+ x2 <<= 1;
22349
+ if (x2 & 256) {
22350
+ x2 ^= 285;
22351
+ }
22352
+ }
22353
+ for (let i7 = 255; i7 < 512; i7++) {
22354
+ EXP_TABLE[i7] = EXP_TABLE[i7 - 255];
22355
+ }
22356
+ })();
22357
+ exports.log = function log(n6) {
22358
+ if (n6 < 1) throw new Error("log(" + n6 + ")");
22359
+ return LOG_TABLE[n6];
22360
+ };
22361
+ exports.exp = function exp(n6) {
22362
+ return EXP_TABLE[n6];
22363
+ };
22364
+ exports.mul = function mul(x2, y3) {
22365
+ if (x2 === 0 || y3 === 0) return 0;
22366
+ return EXP_TABLE[LOG_TABLE[x2] + LOG_TABLE[y3]];
22367
+ };
22368
+ }
22369
+ });
22370
+
22371
+ // node_modules/qrcode/lib/core/polynomial.js
22372
+ var require_polynomial = __commonJS({
22373
+ "node_modules/qrcode/lib/core/polynomial.js"(exports) {
22374
+ var GF = require_galois_field();
22375
+ exports.mul = function mul(p1, p22) {
22376
+ const coeff = new Uint8Array(p1.length + p22.length - 1);
22377
+ for (let i7 = 0; i7 < p1.length; i7++) {
22378
+ for (let j = 0; j < p22.length; j++) {
22379
+ coeff[i7 + j] ^= GF.mul(p1[i7], p22[j]);
22380
+ }
22381
+ }
22382
+ return coeff;
22383
+ };
22384
+ exports.mod = function mod2(divident, divisor) {
22385
+ let result = new Uint8Array(divident);
22386
+ while (result.length - divisor.length >= 0) {
22387
+ const coeff = result[0];
22388
+ for (let i7 = 0; i7 < divisor.length; i7++) {
22389
+ result[i7] ^= GF.mul(divisor[i7], coeff);
22390
+ }
22391
+ let offset3 = 0;
22392
+ while (offset3 < result.length && result[offset3] === 0) offset3++;
22393
+ result = result.slice(offset3);
22394
+ }
22395
+ return result;
22396
+ };
22397
+ exports.generateECPolynomial = function generateECPolynomial(degree) {
22398
+ let poly = new Uint8Array([1]);
22399
+ for (let i7 = 0; i7 < degree; i7++) {
22400
+ poly = exports.mul(poly, new Uint8Array([1, GF.exp(i7)]));
22401
+ }
22402
+ return poly;
22403
+ };
22404
+ }
22405
+ });
22406
+
22407
+ // node_modules/qrcode/lib/core/reed-solomon-encoder.js
22408
+ var require_reed_solomon_encoder = __commonJS({
22409
+ "node_modules/qrcode/lib/core/reed-solomon-encoder.js"(exports, module) {
22410
+ var Polynomial = require_polynomial();
22411
+ function ReedSolomonEncoder(degree) {
22412
+ this.genPoly = void 0;
22413
+ this.degree = degree;
22414
+ if (this.degree) this.initialize(this.degree);
22415
+ }
22416
+ ReedSolomonEncoder.prototype.initialize = function initialize(degree) {
22417
+ this.degree = degree;
22418
+ this.genPoly = Polynomial.generateECPolynomial(this.degree);
22419
+ };
22420
+ ReedSolomonEncoder.prototype.encode = function encode(data) {
22421
+ if (!this.genPoly) {
22422
+ throw new Error("Encoder not initialized");
22423
+ }
22424
+ const paddedData = new Uint8Array(data.length + this.degree);
22425
+ paddedData.set(data);
22426
+ const remainder = Polynomial.mod(paddedData, this.genPoly);
22427
+ const start = this.degree - remainder.length;
22428
+ if (start > 0) {
22429
+ const buff = new Uint8Array(this.degree);
22430
+ buff.set(remainder, start);
22431
+ return buff;
22432
+ }
22433
+ return remainder;
22434
+ };
22435
+ module.exports = ReedSolomonEncoder;
22436
+ }
22437
+ });
22438
+
22439
+ // node_modules/qrcode/lib/core/version-check.js
22440
+ var require_version_check = __commonJS({
22441
+ "node_modules/qrcode/lib/core/version-check.js"(exports) {
22442
+ exports.isValid = function isValid(version) {
22443
+ return !isNaN(version) && version >= 1 && version <= 40;
22444
+ };
22445
+ }
22446
+ });
22447
+
22448
+ // node_modules/qrcode/lib/core/regex.js
22449
+ var require_regex = __commonJS({
22450
+ "node_modules/qrcode/lib/core/regex.js"(exports) {
22451
+ var numeric = "[0-9]+";
22452
+ var alphanumeric = "[A-Z $%*+\\-./:]+";
22453
+ var kanji = "(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";
22454
+ kanji = kanji.replace(/u/g, "\\u");
22455
+ var byte = "(?:(?![A-Z0-9 $%*+\\-./:]|" + kanji + ")(?:.|[\r\n]))+";
22456
+ exports.KANJI = new RegExp(kanji, "g");
22457
+ exports.BYTE_KANJI = new RegExp("[^A-Z0-9 $%*+\\-./:]+", "g");
22458
+ exports.BYTE = new RegExp(byte, "g");
22459
+ exports.NUMERIC = new RegExp(numeric, "g");
22460
+ exports.ALPHANUMERIC = new RegExp(alphanumeric, "g");
22461
+ var TEST_KANJI = new RegExp("^" + kanji + "$");
22462
+ var TEST_NUMERIC = new RegExp("^" + numeric + "$");
22463
+ var TEST_ALPHANUMERIC = new RegExp("^[A-Z0-9 $%*+\\-./:]+$");
22464
+ exports.testKanji = function testKanji(str) {
22465
+ return TEST_KANJI.test(str);
22466
+ };
22467
+ exports.testNumeric = function testNumeric(str) {
22468
+ return TEST_NUMERIC.test(str);
22469
+ };
22470
+ exports.testAlphanumeric = function testAlphanumeric(str) {
22471
+ return TEST_ALPHANUMERIC.test(str);
22472
+ };
22473
+ }
22474
+ });
22475
+
22476
+ // node_modules/qrcode/lib/core/mode.js
22477
+ var require_mode = __commonJS({
22478
+ "node_modules/qrcode/lib/core/mode.js"(exports) {
22479
+ var VersionCheck = require_version_check();
22480
+ var Regex = require_regex();
22481
+ exports.NUMERIC = {
22482
+ id: "Numeric",
22483
+ bit: 1 << 0,
22484
+ ccBits: [10, 12, 14]
22485
+ };
22486
+ exports.ALPHANUMERIC = {
22487
+ id: "Alphanumeric",
22488
+ bit: 1 << 1,
22489
+ ccBits: [9, 11, 13]
22490
+ };
22491
+ exports.BYTE = {
22492
+ id: "Byte",
22493
+ bit: 1 << 2,
22494
+ ccBits: [8, 16, 16]
22495
+ };
22496
+ exports.KANJI = {
22497
+ id: "Kanji",
22498
+ bit: 1 << 3,
22499
+ ccBits: [8, 10, 12]
22500
+ };
22501
+ exports.MIXED = {
22502
+ bit: -1
22503
+ };
22504
+ exports.getCharCountIndicator = function getCharCountIndicator(mode, version) {
22505
+ if (!mode.ccBits) throw new Error("Invalid mode: " + mode);
22506
+ if (!VersionCheck.isValid(version)) {
22507
+ throw new Error("Invalid version: " + version);
22508
+ }
22509
+ if (version >= 1 && version < 10) return mode.ccBits[0];
22510
+ else if (version < 27) return mode.ccBits[1];
22511
+ return mode.ccBits[2];
22512
+ };
22513
+ exports.getBestModeForData = function getBestModeForData(dataStr) {
22514
+ if (Regex.testNumeric(dataStr)) return exports.NUMERIC;
22515
+ else if (Regex.testAlphanumeric(dataStr)) return exports.ALPHANUMERIC;
22516
+ else if (Regex.testKanji(dataStr)) return exports.KANJI;
22517
+ else return exports.BYTE;
22518
+ };
22519
+ exports.toString = function toString(mode) {
22520
+ if (mode && mode.id) return mode.id;
22521
+ throw new Error("Invalid mode");
22522
+ };
22523
+ exports.isValid = function isValid(mode) {
22524
+ return mode && mode.bit && mode.ccBits;
22525
+ };
22526
+ function fromString(string2) {
22527
+ if (typeof string2 !== "string") {
22528
+ throw new Error("Param is not a string");
22529
+ }
22530
+ const lcStr = string2.toLowerCase();
22531
+ switch (lcStr) {
22532
+ case "numeric":
22533
+ return exports.NUMERIC;
22534
+ case "alphanumeric":
22535
+ return exports.ALPHANUMERIC;
22536
+ case "kanji":
22537
+ return exports.KANJI;
22538
+ case "byte":
22539
+ return exports.BYTE;
22540
+ default:
22541
+ throw new Error("Unknown mode: " + string2);
22542
+ }
22543
+ }
22544
+ exports.from = function from(value, defaultValue) {
22545
+ if (exports.isValid(value)) {
22546
+ return value;
22547
+ }
22548
+ try {
22549
+ return fromString(value);
22550
+ } catch (e9) {
22551
+ return defaultValue;
22552
+ }
22553
+ };
22554
+ }
22555
+ });
22556
+
22557
+ // node_modules/qrcode/lib/core/version.js
22558
+ var require_version = __commonJS({
22559
+ "node_modules/qrcode/lib/core/version.js"(exports) {
22560
+ var Utils = require_utils();
22561
+ var ECCode = require_error_correction_code();
22562
+ var ECLevel = require_error_correction_level();
22563
+ var Mode = require_mode();
22564
+ var VersionCheck = require_version_check();
22565
+ var G18 = 1 << 12 | 1 << 11 | 1 << 10 | 1 << 9 | 1 << 8 | 1 << 5 | 1 << 2 | 1 << 0;
22566
+ var G18_BCH = Utils.getBCHDigit(G18);
22567
+ function getBestVersionForDataLength(mode, length, errorCorrectionLevel) {
22568
+ for (let currentVersion = 1; currentVersion <= 40; currentVersion++) {
22569
+ if (length <= exports.getCapacity(currentVersion, errorCorrectionLevel, mode)) {
22570
+ return currentVersion;
22571
+ }
22572
+ }
22573
+ return void 0;
22574
+ }
22575
+ function getReservedBitsCount(mode, version) {
22576
+ return Mode.getCharCountIndicator(mode, version) + 4;
22577
+ }
22578
+ function getTotalBitsFromDataArray(segments, version) {
22579
+ let totalBits = 0;
22580
+ segments.forEach(function(data) {
22581
+ const reservedBits = getReservedBitsCount(data.mode, version);
22582
+ totalBits += reservedBits + data.getBitsLength();
22583
+ });
22584
+ return totalBits;
22585
+ }
22586
+ function getBestVersionForMixedData(segments, errorCorrectionLevel) {
22587
+ for (let currentVersion = 1; currentVersion <= 40; currentVersion++) {
22588
+ const length = getTotalBitsFromDataArray(segments, currentVersion);
22589
+ if (length <= exports.getCapacity(currentVersion, errorCorrectionLevel, Mode.MIXED)) {
22590
+ return currentVersion;
22591
+ }
22592
+ }
22593
+ return void 0;
22594
+ }
22595
+ exports.from = function from(value, defaultValue) {
22596
+ if (VersionCheck.isValid(value)) {
22597
+ return parseInt(value, 10);
22598
+ }
22599
+ return defaultValue;
22600
+ };
22601
+ exports.getCapacity = function getCapacity(version, errorCorrectionLevel, mode) {
22602
+ if (!VersionCheck.isValid(version)) {
22603
+ throw new Error("Invalid QR Code version");
22604
+ }
22605
+ if (typeof mode === "undefined") mode = Mode.BYTE;
22606
+ const totalCodewords = Utils.getSymbolTotalCodewords(version);
22607
+ const ecTotalCodewords = ECCode.getTotalCodewordsCount(version, errorCorrectionLevel);
22608
+ const dataTotalCodewordsBits = (totalCodewords - ecTotalCodewords) * 8;
22609
+ if (mode === Mode.MIXED) return dataTotalCodewordsBits;
22610
+ const usableBits = dataTotalCodewordsBits - getReservedBitsCount(mode, version);
22611
+ switch (mode) {
22612
+ case Mode.NUMERIC:
22613
+ return Math.floor(usableBits / 10 * 3);
22614
+ case Mode.ALPHANUMERIC:
22615
+ return Math.floor(usableBits / 11 * 2);
22616
+ case Mode.KANJI:
22617
+ return Math.floor(usableBits / 13);
22618
+ case Mode.BYTE:
22619
+ default:
22620
+ return Math.floor(usableBits / 8);
22621
+ }
22622
+ };
22623
+ exports.getBestVersionForData = function getBestVersionForData(data, errorCorrectionLevel) {
22624
+ let seg;
22625
+ const ecl = ECLevel.from(errorCorrectionLevel, ECLevel.M);
22626
+ if (Array.isArray(data)) {
22627
+ if (data.length > 1) {
22628
+ return getBestVersionForMixedData(data, ecl);
22629
+ }
22630
+ if (data.length === 0) {
22631
+ return 1;
22632
+ }
22633
+ seg = data[0];
22634
+ } else {
22635
+ seg = data;
22636
+ }
22637
+ return getBestVersionForDataLength(seg.mode, seg.getLength(), ecl);
22638
+ };
22639
+ exports.getEncodedBits = function getEncodedBits(version) {
22640
+ if (!VersionCheck.isValid(version) || version < 7) {
22641
+ throw new Error("Invalid QR Code version");
22642
+ }
22643
+ let d3 = version << 12;
22644
+ while (Utils.getBCHDigit(d3) - G18_BCH >= 0) {
22645
+ d3 ^= G18 << Utils.getBCHDigit(d3) - G18_BCH;
22646
+ }
22647
+ return version << 12 | d3;
22648
+ };
22649
+ }
22650
+ });
22651
+
22652
+ // node_modules/qrcode/lib/core/format-info.js
22653
+ var require_format_info = __commonJS({
22654
+ "node_modules/qrcode/lib/core/format-info.js"(exports) {
22655
+ var Utils = require_utils();
22656
+ var G15 = 1 << 10 | 1 << 8 | 1 << 5 | 1 << 4 | 1 << 2 | 1 << 1 | 1 << 0;
22657
+ var G15_MASK = 1 << 14 | 1 << 12 | 1 << 10 | 1 << 4 | 1 << 1;
22658
+ var G15_BCH = Utils.getBCHDigit(G15);
22659
+ exports.getEncodedBits = function getEncodedBits(errorCorrectionLevel, mask) {
22660
+ const data = errorCorrectionLevel.bit << 3 | mask;
22661
+ let d3 = data << 10;
22662
+ while (Utils.getBCHDigit(d3) - G15_BCH >= 0) {
22663
+ d3 ^= G15 << Utils.getBCHDigit(d3) - G15_BCH;
22664
+ }
22665
+ return (data << 10 | d3) ^ G15_MASK;
22666
+ };
22667
+ }
22668
+ });
22669
+
22670
+ // node_modules/qrcode/lib/core/numeric-data.js
22671
+ var require_numeric_data = __commonJS({
22672
+ "node_modules/qrcode/lib/core/numeric-data.js"(exports, module) {
22673
+ var Mode = require_mode();
22674
+ function NumericData(data) {
22675
+ this.mode = Mode.NUMERIC;
22676
+ this.data = data.toString();
22677
+ }
22678
+ NumericData.getBitsLength = function getBitsLength(length) {
22679
+ return 10 * Math.floor(length / 3) + (length % 3 ? length % 3 * 3 + 1 : 0);
22680
+ };
22681
+ NumericData.prototype.getLength = function getLength() {
22682
+ return this.data.length;
22683
+ };
22684
+ NumericData.prototype.getBitsLength = function getBitsLength() {
22685
+ return NumericData.getBitsLength(this.data.length);
22686
+ };
22687
+ NumericData.prototype.write = function write(bitBuffer) {
22688
+ let i7, group, value;
22689
+ for (i7 = 0; i7 + 3 <= this.data.length; i7 += 3) {
22690
+ group = this.data.substr(i7, 3);
22691
+ value = parseInt(group, 10);
22692
+ bitBuffer.put(value, 10);
22693
+ }
22694
+ const remainingNum = this.data.length - i7;
22695
+ if (remainingNum > 0) {
22696
+ group = this.data.substr(i7);
22697
+ value = parseInt(group, 10);
22698
+ bitBuffer.put(value, remainingNum * 3 + 1);
22699
+ }
22700
+ };
22701
+ module.exports = NumericData;
22702
+ }
22703
+ });
22704
+
22705
+ // node_modules/qrcode/lib/core/alphanumeric-data.js
22706
+ var require_alphanumeric_data = __commonJS({
22707
+ "node_modules/qrcode/lib/core/alphanumeric-data.js"(exports, module) {
22708
+ var Mode = require_mode();
22709
+ var ALPHA_NUM_CHARS = [
22710
+ "0",
22711
+ "1",
22712
+ "2",
22713
+ "3",
22714
+ "4",
22715
+ "5",
22716
+ "6",
22717
+ "7",
22718
+ "8",
22719
+ "9",
22720
+ "A",
22721
+ "B",
22722
+ "C",
22723
+ "D",
22724
+ "E",
22725
+ "F",
22726
+ "G",
22727
+ "H",
22728
+ "I",
22729
+ "J",
22730
+ "K",
22731
+ "L",
22732
+ "M",
22733
+ "N",
22734
+ "O",
22735
+ "P",
22736
+ "Q",
22737
+ "R",
22738
+ "S",
22739
+ "T",
22740
+ "U",
22741
+ "V",
22742
+ "W",
22743
+ "X",
22744
+ "Y",
22745
+ "Z",
22746
+ " ",
22747
+ "$",
22748
+ "%",
22749
+ "*",
22750
+ "+",
22751
+ "-",
22752
+ ".",
22753
+ "/",
22754
+ ":"
22755
+ ];
22756
+ function AlphanumericData(data) {
22757
+ this.mode = Mode.ALPHANUMERIC;
22758
+ this.data = data;
22759
+ }
22760
+ AlphanumericData.getBitsLength = function getBitsLength(length) {
22761
+ return 11 * Math.floor(length / 2) + 6 * (length % 2);
22762
+ };
22763
+ AlphanumericData.prototype.getLength = function getLength() {
22764
+ return this.data.length;
22765
+ };
22766
+ AlphanumericData.prototype.getBitsLength = function getBitsLength() {
22767
+ return AlphanumericData.getBitsLength(this.data.length);
22768
+ };
22769
+ AlphanumericData.prototype.write = function write(bitBuffer) {
22770
+ let i7;
22771
+ for (i7 = 0; i7 + 2 <= this.data.length; i7 += 2) {
22772
+ let value = ALPHA_NUM_CHARS.indexOf(this.data[i7]) * 45;
22773
+ value += ALPHA_NUM_CHARS.indexOf(this.data[i7 + 1]);
22774
+ bitBuffer.put(value, 11);
22775
+ }
22776
+ if (this.data.length % 2) {
22777
+ bitBuffer.put(ALPHA_NUM_CHARS.indexOf(this.data[i7]), 6);
22778
+ }
22779
+ };
22780
+ module.exports = AlphanumericData;
22781
+ }
22782
+ });
22783
+
22784
+ // node_modules/qrcode/lib/core/byte-data.js
22785
+ var require_byte_data = __commonJS({
22786
+ "node_modules/qrcode/lib/core/byte-data.js"(exports, module) {
22787
+ var Mode = require_mode();
22788
+ function ByteData(data) {
22789
+ this.mode = Mode.BYTE;
22790
+ if (typeof data === "string") {
22791
+ this.data = new TextEncoder().encode(data);
22792
+ } else {
22793
+ this.data = new Uint8Array(data);
22794
+ }
22795
+ }
22796
+ ByteData.getBitsLength = function getBitsLength(length) {
22797
+ return length * 8;
22798
+ };
22799
+ ByteData.prototype.getLength = function getLength() {
22800
+ return this.data.length;
22801
+ };
22802
+ ByteData.prototype.getBitsLength = function getBitsLength() {
22803
+ return ByteData.getBitsLength(this.data.length);
22804
+ };
22805
+ ByteData.prototype.write = function(bitBuffer) {
22806
+ for (let i7 = 0, l3 = this.data.length; i7 < l3; i7++) {
22807
+ bitBuffer.put(this.data[i7], 8);
22808
+ }
22809
+ };
22810
+ module.exports = ByteData;
22811
+ }
22812
+ });
22813
+
22814
+ // node_modules/qrcode/lib/core/kanji-data.js
22815
+ var require_kanji_data = __commonJS({
22816
+ "node_modules/qrcode/lib/core/kanji-data.js"(exports, module) {
22817
+ var Mode = require_mode();
22818
+ var Utils = require_utils();
22819
+ function KanjiData(data) {
22820
+ this.mode = Mode.KANJI;
22821
+ this.data = data;
22822
+ }
22823
+ KanjiData.getBitsLength = function getBitsLength(length) {
22824
+ return length * 13;
22825
+ };
22826
+ KanjiData.prototype.getLength = function getLength() {
22827
+ return this.data.length;
22828
+ };
22829
+ KanjiData.prototype.getBitsLength = function getBitsLength() {
22830
+ return KanjiData.getBitsLength(this.data.length);
22831
+ };
22832
+ KanjiData.prototype.write = function(bitBuffer) {
22833
+ let i7;
22834
+ for (i7 = 0; i7 < this.data.length; i7++) {
22835
+ let value = Utils.toSJIS(this.data[i7]);
22836
+ if (value >= 33088 && value <= 40956) {
22837
+ value -= 33088;
22838
+ } else if (value >= 57408 && value <= 60351) {
22839
+ value -= 49472;
22840
+ } else {
22841
+ throw new Error(
22842
+ "Invalid SJIS character: " + this.data[i7] + "\nMake sure your charset is UTF-8"
22843
+ );
22844
+ }
22845
+ value = (value >>> 8 & 255) * 192 + (value & 255);
22846
+ bitBuffer.put(value, 13);
22847
+ }
22848
+ };
22849
+ module.exports = KanjiData;
22850
+ }
22851
+ });
22852
+
22853
+ // node_modules/dijkstrajs/dijkstra.js
22854
+ var require_dijkstra = __commonJS({
22855
+ "node_modules/dijkstrajs/dijkstra.js"(exports, module) {
22856
+ "use strict";
22857
+ var dijkstra = {
22858
+ single_source_shortest_paths: function(graph, s5, d3) {
22859
+ var predecessors = {};
22860
+ var costs = {};
22861
+ costs[s5] = 0;
22862
+ var open = dijkstra.PriorityQueue.make();
22863
+ open.push(s5, 0);
22864
+ var closest, u3, v2, cost_of_s_to_u, adjacent_nodes, cost_of_e, cost_of_s_to_u_plus_cost_of_e, cost_of_s_to_v, first_visit;
22865
+ while (!open.empty()) {
22866
+ closest = open.pop();
22867
+ u3 = closest.value;
22868
+ cost_of_s_to_u = closest.cost;
22869
+ adjacent_nodes = graph[u3] || {};
22870
+ for (v2 in adjacent_nodes) {
22871
+ if (adjacent_nodes.hasOwnProperty(v2)) {
22872
+ cost_of_e = adjacent_nodes[v2];
22873
+ cost_of_s_to_u_plus_cost_of_e = cost_of_s_to_u + cost_of_e;
22874
+ cost_of_s_to_v = costs[v2];
22875
+ first_visit = typeof costs[v2] === "undefined";
22876
+ if (first_visit || cost_of_s_to_v > cost_of_s_to_u_plus_cost_of_e) {
22877
+ costs[v2] = cost_of_s_to_u_plus_cost_of_e;
22878
+ open.push(v2, cost_of_s_to_u_plus_cost_of_e);
22879
+ predecessors[v2] = u3;
22880
+ }
22881
+ }
22882
+ }
22883
+ }
22884
+ if (typeof d3 !== "undefined" && typeof costs[d3] === "undefined") {
22885
+ var msg = ["Could not find a path from ", s5, " to ", d3, "."].join("");
22886
+ throw new Error(msg);
22887
+ }
22888
+ return predecessors;
22889
+ },
22890
+ extract_shortest_path_from_predecessor_list: function(predecessors, d3) {
22891
+ var nodes = [];
22892
+ var u3 = d3;
22893
+ var predecessor;
22894
+ while (u3) {
22895
+ nodes.push(u3);
22896
+ predecessor = predecessors[u3];
22897
+ u3 = predecessors[u3];
22898
+ }
22899
+ nodes.reverse();
22900
+ return nodes;
22901
+ },
22902
+ find_path: function(graph, s5, d3) {
22903
+ var predecessors = dijkstra.single_source_shortest_paths(graph, s5, d3);
22904
+ return dijkstra.extract_shortest_path_from_predecessor_list(
22905
+ predecessors,
22906
+ d3
22907
+ );
22908
+ },
22909
+ /**
22910
+ * A very naive priority queue implementation.
22911
+ */
22912
+ PriorityQueue: {
22913
+ make: function(opts) {
22914
+ var T2 = dijkstra.PriorityQueue, t5 = {}, key;
22915
+ opts = opts || {};
22916
+ for (key in T2) {
22917
+ if (T2.hasOwnProperty(key)) {
22918
+ t5[key] = T2[key];
22919
+ }
22920
+ }
22921
+ t5.queue = [];
22922
+ t5.sorter = opts.sorter || T2.default_sorter;
22923
+ return t5;
22924
+ },
22925
+ default_sorter: function(a3, b3) {
22926
+ return a3.cost - b3.cost;
22927
+ },
22928
+ /**
22929
+ * Add a new item to the queue and ensure the highest priority element
22930
+ * is at the front of the queue.
22931
+ */
22932
+ push: function(value, cost) {
22933
+ var item = { value, cost };
22934
+ this.queue.push(item);
22935
+ this.queue.sort(this.sorter);
22936
+ },
22937
+ /**
22938
+ * Return the highest priority element in the queue.
22939
+ */
22940
+ pop: function() {
22941
+ return this.queue.shift();
22942
+ },
22943
+ empty: function() {
22944
+ return this.queue.length === 0;
22945
+ }
22946
+ }
22947
+ };
22948
+ if (typeof module !== "undefined") {
22949
+ module.exports = dijkstra;
22950
+ }
22951
+ }
22952
+ });
22953
+
22954
+ // node_modules/qrcode/lib/core/segments.js
22955
+ var require_segments = __commonJS({
22956
+ "node_modules/qrcode/lib/core/segments.js"(exports) {
22957
+ var Mode = require_mode();
22958
+ var NumericData = require_numeric_data();
22959
+ var AlphanumericData = require_alphanumeric_data();
22960
+ var ByteData = require_byte_data();
22961
+ var KanjiData = require_kanji_data();
22962
+ var Regex = require_regex();
22963
+ var Utils = require_utils();
22964
+ var dijkstra = require_dijkstra();
22965
+ function getStringByteLength(str) {
22966
+ return unescape(encodeURIComponent(str)).length;
22967
+ }
22968
+ function getSegments(regex, mode, str) {
22969
+ const segments = [];
22970
+ let result;
22971
+ while ((result = regex.exec(str)) !== null) {
22972
+ segments.push({
22973
+ data: result[0],
22974
+ index: result.index,
22975
+ mode,
22976
+ length: result[0].length
22977
+ });
22978
+ }
22979
+ return segments;
22980
+ }
22981
+ function getSegmentsFromString(dataStr) {
22982
+ const numSegs = getSegments(Regex.NUMERIC, Mode.NUMERIC, dataStr);
22983
+ const alphaNumSegs = getSegments(Regex.ALPHANUMERIC, Mode.ALPHANUMERIC, dataStr);
22984
+ let byteSegs;
22985
+ let kanjiSegs;
22986
+ if (Utils.isKanjiModeEnabled()) {
22987
+ byteSegs = getSegments(Regex.BYTE, Mode.BYTE, dataStr);
22988
+ kanjiSegs = getSegments(Regex.KANJI, Mode.KANJI, dataStr);
22989
+ } else {
22990
+ byteSegs = getSegments(Regex.BYTE_KANJI, Mode.BYTE, dataStr);
22991
+ kanjiSegs = [];
22992
+ }
22993
+ const segs = numSegs.concat(alphaNumSegs, byteSegs, kanjiSegs);
22994
+ return segs.sort(function(s1, s22) {
22995
+ return s1.index - s22.index;
22996
+ }).map(function(obj) {
22997
+ return {
22998
+ data: obj.data,
22999
+ mode: obj.mode,
23000
+ length: obj.length
23001
+ };
23002
+ });
23003
+ }
23004
+ function getSegmentBitsLength(length, mode) {
23005
+ switch (mode) {
23006
+ case Mode.NUMERIC:
23007
+ return NumericData.getBitsLength(length);
23008
+ case Mode.ALPHANUMERIC:
23009
+ return AlphanumericData.getBitsLength(length);
23010
+ case Mode.KANJI:
23011
+ return KanjiData.getBitsLength(length);
23012
+ case Mode.BYTE:
23013
+ return ByteData.getBitsLength(length);
23014
+ }
23015
+ }
23016
+ function mergeSegments(segs) {
23017
+ return segs.reduce(function(acc, curr) {
23018
+ const prevSeg = acc.length - 1 >= 0 ? acc[acc.length - 1] : null;
23019
+ if (prevSeg && prevSeg.mode === curr.mode) {
23020
+ acc[acc.length - 1].data += curr.data;
23021
+ return acc;
23022
+ }
23023
+ acc.push(curr);
23024
+ return acc;
23025
+ }, []);
23026
+ }
23027
+ function buildNodes(segs) {
23028
+ const nodes = [];
23029
+ for (let i7 = 0; i7 < segs.length; i7++) {
23030
+ const seg = segs[i7];
23031
+ switch (seg.mode) {
23032
+ case Mode.NUMERIC:
23033
+ nodes.push([
23034
+ seg,
23035
+ { data: seg.data, mode: Mode.ALPHANUMERIC, length: seg.length },
23036
+ { data: seg.data, mode: Mode.BYTE, length: seg.length }
23037
+ ]);
23038
+ break;
23039
+ case Mode.ALPHANUMERIC:
23040
+ nodes.push([
23041
+ seg,
23042
+ { data: seg.data, mode: Mode.BYTE, length: seg.length }
23043
+ ]);
23044
+ break;
23045
+ case Mode.KANJI:
23046
+ nodes.push([
23047
+ seg,
23048
+ { data: seg.data, mode: Mode.BYTE, length: getStringByteLength(seg.data) }
23049
+ ]);
23050
+ break;
23051
+ case Mode.BYTE:
23052
+ nodes.push([
23053
+ { data: seg.data, mode: Mode.BYTE, length: getStringByteLength(seg.data) }
23054
+ ]);
23055
+ }
23056
+ }
23057
+ return nodes;
23058
+ }
23059
+ function buildGraph(nodes, version) {
23060
+ const table = {};
23061
+ const graph = { start: {} };
23062
+ let prevNodeIds = ["start"];
23063
+ for (let i7 = 0; i7 < nodes.length; i7++) {
23064
+ const nodeGroup = nodes[i7];
23065
+ const currentNodeIds = [];
23066
+ for (let j = 0; j < nodeGroup.length; j++) {
23067
+ const node = nodeGroup[j];
23068
+ const key = "" + i7 + j;
23069
+ currentNodeIds.push(key);
23070
+ table[key] = { node, lastCount: 0 };
23071
+ graph[key] = {};
23072
+ for (let n6 = 0; n6 < prevNodeIds.length; n6++) {
23073
+ const prevNodeId = prevNodeIds[n6];
23074
+ if (table[prevNodeId] && table[prevNodeId].node.mode === node.mode) {
23075
+ graph[prevNodeId][key] = getSegmentBitsLength(table[prevNodeId].lastCount + node.length, node.mode) - getSegmentBitsLength(table[prevNodeId].lastCount, node.mode);
23076
+ table[prevNodeId].lastCount += node.length;
23077
+ } else {
23078
+ if (table[prevNodeId]) table[prevNodeId].lastCount = node.length;
23079
+ graph[prevNodeId][key] = getSegmentBitsLength(node.length, node.mode) + 4 + Mode.getCharCountIndicator(node.mode, version);
23080
+ }
23081
+ }
23082
+ }
23083
+ prevNodeIds = currentNodeIds;
23084
+ }
23085
+ for (let n6 = 0; n6 < prevNodeIds.length; n6++) {
23086
+ graph[prevNodeIds[n6]].end = 0;
23087
+ }
23088
+ return { map: graph, table };
23089
+ }
23090
+ function buildSingleSegment(data, modesHint) {
23091
+ let mode;
23092
+ const bestMode = Mode.getBestModeForData(data);
23093
+ mode = Mode.from(modesHint, bestMode);
23094
+ if (mode !== Mode.BYTE && mode.bit < bestMode.bit) {
23095
+ throw new Error('"' + data + '" cannot be encoded with mode ' + Mode.toString(mode) + ".\n Suggested mode is: " + Mode.toString(bestMode));
23096
+ }
23097
+ if (mode === Mode.KANJI && !Utils.isKanjiModeEnabled()) {
23098
+ mode = Mode.BYTE;
23099
+ }
23100
+ switch (mode) {
23101
+ case Mode.NUMERIC:
23102
+ return new NumericData(data);
23103
+ case Mode.ALPHANUMERIC:
23104
+ return new AlphanumericData(data);
23105
+ case Mode.KANJI:
23106
+ return new KanjiData(data);
23107
+ case Mode.BYTE:
23108
+ return new ByteData(data);
23109
+ }
23110
+ }
23111
+ exports.fromArray = function fromArray(array2) {
23112
+ return array2.reduce(function(acc, seg) {
23113
+ if (typeof seg === "string") {
23114
+ acc.push(buildSingleSegment(seg, null));
23115
+ } else if (seg.data) {
23116
+ acc.push(buildSingleSegment(seg.data, seg.mode));
23117
+ }
23118
+ return acc;
23119
+ }, []);
23120
+ };
23121
+ exports.fromString = function fromString(data, version) {
23122
+ const segs = getSegmentsFromString(data, Utils.isKanjiModeEnabled());
23123
+ const nodes = buildNodes(segs);
23124
+ const graph = buildGraph(nodes, version);
23125
+ const path = dijkstra.find_path(graph.map, "start", "end");
23126
+ const optimizedSegs = [];
23127
+ for (let i7 = 1; i7 < path.length - 1; i7++) {
23128
+ optimizedSegs.push(graph.table[path[i7]].node);
23129
+ }
23130
+ return exports.fromArray(mergeSegments(optimizedSegs));
23131
+ };
23132
+ exports.rawSplit = function rawSplit(data) {
23133
+ return exports.fromArray(
23134
+ getSegmentsFromString(data, Utils.isKanjiModeEnabled())
23135
+ );
23136
+ };
23137
+ }
23138
+ });
23139
+
23140
+ // node_modules/qrcode/lib/core/qrcode.js
23141
+ var require_qrcode = __commonJS({
23142
+ "node_modules/qrcode/lib/core/qrcode.js"(exports) {
23143
+ var Utils = require_utils();
23144
+ var ECLevel = require_error_correction_level();
23145
+ var BitBuffer = require_bit_buffer();
23146
+ var BitMatrix = require_bit_matrix();
23147
+ var AlignmentPattern = require_alignment_pattern();
23148
+ var FinderPattern = require_finder_pattern();
23149
+ var MaskPattern = require_mask_pattern();
23150
+ var ECCode = require_error_correction_code();
23151
+ var ReedSolomonEncoder = require_reed_solomon_encoder();
23152
+ var Version = require_version();
23153
+ var FormatInfo = require_format_info();
23154
+ var Mode = require_mode();
23155
+ var Segments = require_segments();
23156
+ function setupFinderPattern(matrix, version) {
23157
+ const size2 = matrix.size;
23158
+ const pos = FinderPattern.getPositions(version);
23159
+ for (let i7 = 0; i7 < pos.length; i7++) {
23160
+ const row = pos[i7][0];
23161
+ const col = pos[i7][1];
23162
+ for (let r7 = -1; r7 <= 7; r7++) {
23163
+ if (row + r7 <= -1 || size2 <= row + r7) continue;
23164
+ for (let c4 = -1; c4 <= 7; c4++) {
23165
+ if (col + c4 <= -1 || size2 <= col + c4) continue;
23166
+ if (r7 >= 0 && r7 <= 6 && (c4 === 0 || c4 === 6) || c4 >= 0 && c4 <= 6 && (r7 === 0 || r7 === 6) || r7 >= 2 && r7 <= 4 && c4 >= 2 && c4 <= 4) {
23167
+ matrix.set(row + r7, col + c4, true, true);
23168
+ } else {
23169
+ matrix.set(row + r7, col + c4, false, true);
23170
+ }
23171
+ }
23172
+ }
23173
+ }
23174
+ }
23175
+ function setupTimingPattern(matrix) {
23176
+ const size2 = matrix.size;
23177
+ for (let r7 = 8; r7 < size2 - 8; r7++) {
23178
+ const value = r7 % 2 === 0;
23179
+ matrix.set(r7, 6, value, true);
23180
+ matrix.set(6, r7, value, true);
23181
+ }
23182
+ }
23183
+ function setupAlignmentPattern(matrix, version) {
23184
+ const pos = AlignmentPattern.getPositions(version);
23185
+ for (let i7 = 0; i7 < pos.length; i7++) {
23186
+ const row = pos[i7][0];
23187
+ const col = pos[i7][1];
23188
+ for (let r7 = -2; r7 <= 2; r7++) {
23189
+ for (let c4 = -2; c4 <= 2; c4++) {
23190
+ if (r7 === -2 || r7 === 2 || c4 === -2 || c4 === 2 || r7 === 0 && c4 === 0) {
23191
+ matrix.set(row + r7, col + c4, true, true);
23192
+ } else {
23193
+ matrix.set(row + r7, col + c4, false, true);
23194
+ }
23195
+ }
23196
+ }
23197
+ }
23198
+ }
23199
+ function setupVersionInfo(matrix, version) {
23200
+ const size2 = matrix.size;
23201
+ const bits = Version.getEncodedBits(version);
23202
+ let row, col, mod2;
23203
+ for (let i7 = 0; i7 < 18; i7++) {
23204
+ row = Math.floor(i7 / 3);
23205
+ col = i7 % 3 + size2 - 8 - 3;
23206
+ mod2 = (bits >> i7 & 1) === 1;
23207
+ matrix.set(row, col, mod2, true);
23208
+ matrix.set(col, row, mod2, true);
23209
+ }
23210
+ }
23211
+ function setupFormatInfo(matrix, errorCorrectionLevel, maskPattern) {
23212
+ const size2 = matrix.size;
23213
+ const bits = FormatInfo.getEncodedBits(errorCorrectionLevel, maskPattern);
23214
+ let i7, mod2;
23215
+ for (i7 = 0; i7 < 15; i7++) {
23216
+ mod2 = (bits >> i7 & 1) === 1;
23217
+ if (i7 < 6) {
23218
+ matrix.set(i7, 8, mod2, true);
23219
+ } else if (i7 < 8) {
23220
+ matrix.set(i7 + 1, 8, mod2, true);
23221
+ } else {
23222
+ matrix.set(size2 - 15 + i7, 8, mod2, true);
23223
+ }
23224
+ if (i7 < 8) {
23225
+ matrix.set(8, size2 - i7 - 1, mod2, true);
23226
+ } else if (i7 < 9) {
23227
+ matrix.set(8, 15 - i7 - 1 + 1, mod2, true);
23228
+ } else {
23229
+ matrix.set(8, 15 - i7 - 1, mod2, true);
23230
+ }
23231
+ }
23232
+ matrix.set(size2 - 8, 8, 1, true);
23233
+ }
23234
+ function setupData(matrix, data) {
23235
+ const size2 = matrix.size;
23236
+ let inc = -1;
23237
+ let row = size2 - 1;
23238
+ let bitIndex = 7;
23239
+ let byteIndex = 0;
23240
+ for (let col = size2 - 1; col > 0; col -= 2) {
23241
+ if (col === 6) col--;
23242
+ while (true) {
23243
+ for (let c4 = 0; c4 < 2; c4++) {
23244
+ if (!matrix.isReserved(row, col - c4)) {
23245
+ let dark = false;
23246
+ if (byteIndex < data.length) {
23247
+ dark = (data[byteIndex] >>> bitIndex & 1) === 1;
23248
+ }
23249
+ matrix.set(row, col - c4, dark);
23250
+ bitIndex--;
23251
+ if (bitIndex === -1) {
23252
+ byteIndex++;
23253
+ bitIndex = 7;
23254
+ }
23255
+ }
23256
+ }
23257
+ row += inc;
23258
+ if (row < 0 || size2 <= row) {
23259
+ row -= inc;
23260
+ inc = -inc;
23261
+ break;
23262
+ }
23263
+ }
23264
+ }
23265
+ }
23266
+ function createData(version, errorCorrectionLevel, segments) {
23267
+ const buffer = new BitBuffer();
23268
+ segments.forEach(function(data) {
23269
+ buffer.put(data.mode.bit, 4);
23270
+ buffer.put(data.getLength(), Mode.getCharCountIndicator(data.mode, version));
23271
+ data.write(buffer);
23272
+ });
23273
+ const totalCodewords = Utils.getSymbolTotalCodewords(version);
23274
+ const ecTotalCodewords = ECCode.getTotalCodewordsCount(version, errorCorrectionLevel);
23275
+ const dataTotalCodewordsBits = (totalCodewords - ecTotalCodewords) * 8;
23276
+ if (buffer.getLengthInBits() + 4 <= dataTotalCodewordsBits) {
23277
+ buffer.put(0, 4);
23278
+ }
23279
+ while (buffer.getLengthInBits() % 8 !== 0) {
23280
+ buffer.putBit(0);
23281
+ }
23282
+ const remainingByte = (dataTotalCodewordsBits - buffer.getLengthInBits()) / 8;
23283
+ for (let i7 = 0; i7 < remainingByte; i7++) {
23284
+ buffer.put(i7 % 2 ? 17 : 236, 8);
23285
+ }
23286
+ return createCodewords(buffer, version, errorCorrectionLevel);
23287
+ }
23288
+ function createCodewords(bitBuffer, version, errorCorrectionLevel) {
23289
+ const totalCodewords = Utils.getSymbolTotalCodewords(version);
23290
+ const ecTotalCodewords = ECCode.getTotalCodewordsCount(version, errorCorrectionLevel);
23291
+ const dataTotalCodewords = totalCodewords - ecTotalCodewords;
23292
+ const ecTotalBlocks = ECCode.getBlocksCount(version, errorCorrectionLevel);
23293
+ const blocksInGroup2 = totalCodewords % ecTotalBlocks;
23294
+ const blocksInGroup1 = ecTotalBlocks - blocksInGroup2;
23295
+ const totalCodewordsInGroup1 = Math.floor(totalCodewords / ecTotalBlocks);
23296
+ const dataCodewordsInGroup1 = Math.floor(dataTotalCodewords / ecTotalBlocks);
23297
+ const dataCodewordsInGroup2 = dataCodewordsInGroup1 + 1;
23298
+ const ecCount = totalCodewordsInGroup1 - dataCodewordsInGroup1;
23299
+ const rs = new ReedSolomonEncoder(ecCount);
23300
+ let offset3 = 0;
23301
+ const dcData = new Array(ecTotalBlocks);
23302
+ const ecData = new Array(ecTotalBlocks);
23303
+ let maxDataSize = 0;
23304
+ const buffer = new Uint8Array(bitBuffer.buffer);
23305
+ for (let b3 = 0; b3 < ecTotalBlocks; b3++) {
23306
+ const dataSize = b3 < blocksInGroup1 ? dataCodewordsInGroup1 : dataCodewordsInGroup2;
23307
+ dcData[b3] = buffer.slice(offset3, offset3 + dataSize);
23308
+ ecData[b3] = rs.encode(dcData[b3]);
23309
+ offset3 += dataSize;
23310
+ maxDataSize = Math.max(maxDataSize, dataSize);
23311
+ }
23312
+ const data = new Uint8Array(totalCodewords);
23313
+ let index = 0;
23314
+ let i7, r7;
23315
+ for (i7 = 0; i7 < maxDataSize; i7++) {
23316
+ for (r7 = 0; r7 < ecTotalBlocks; r7++) {
23317
+ if (i7 < dcData[r7].length) {
23318
+ data[index++] = dcData[r7][i7];
23319
+ }
23320
+ }
23321
+ }
23322
+ for (i7 = 0; i7 < ecCount; i7++) {
23323
+ for (r7 = 0; r7 < ecTotalBlocks; r7++) {
23324
+ data[index++] = ecData[r7][i7];
23325
+ }
23326
+ }
23327
+ return data;
23328
+ }
23329
+ function createSymbol(data, version, errorCorrectionLevel, maskPattern) {
23330
+ let segments;
23331
+ if (Array.isArray(data)) {
23332
+ segments = Segments.fromArray(data);
23333
+ } else if (typeof data === "string") {
23334
+ let estimatedVersion = version;
23335
+ if (!estimatedVersion) {
23336
+ const rawSegments = Segments.rawSplit(data);
23337
+ estimatedVersion = Version.getBestVersionForData(rawSegments, errorCorrectionLevel);
23338
+ }
23339
+ segments = Segments.fromString(data, estimatedVersion || 40);
23340
+ } else {
23341
+ throw new Error("Invalid data");
23342
+ }
23343
+ const bestVersion = Version.getBestVersionForData(segments, errorCorrectionLevel);
23344
+ if (!bestVersion) {
23345
+ throw new Error("The amount of data is too big to be stored in a QR Code");
23346
+ }
23347
+ if (!version) {
23348
+ version = bestVersion;
23349
+ } else if (version < bestVersion) {
23350
+ throw new Error(
23351
+ "\nThe chosen QR Code version cannot contain this amount of data.\nMinimum version required to store current data is: " + bestVersion + ".\n"
23352
+ );
23353
+ }
23354
+ const dataBits = createData(version, errorCorrectionLevel, segments);
23355
+ const moduleCount = Utils.getSymbolSize(version);
23356
+ const modules = new BitMatrix(moduleCount);
23357
+ setupFinderPattern(modules, version);
23358
+ setupTimingPattern(modules);
23359
+ setupAlignmentPattern(modules, version);
23360
+ setupFormatInfo(modules, errorCorrectionLevel, 0);
23361
+ if (version >= 7) {
23362
+ setupVersionInfo(modules, version);
23363
+ }
23364
+ setupData(modules, dataBits);
23365
+ if (isNaN(maskPattern)) {
23366
+ maskPattern = MaskPattern.getBestMask(
23367
+ modules,
23368
+ setupFormatInfo.bind(null, modules, errorCorrectionLevel)
23369
+ );
23370
+ }
23371
+ MaskPattern.applyMask(maskPattern, modules);
23372
+ setupFormatInfo(modules, errorCorrectionLevel, maskPattern);
23373
+ return {
23374
+ modules,
23375
+ version,
23376
+ errorCorrectionLevel,
23377
+ maskPattern,
23378
+ segments
23379
+ };
23380
+ }
23381
+ exports.create = function create(data, options) {
23382
+ if (typeof data === "undefined" || data === "") {
23383
+ throw new Error("No input text");
23384
+ }
23385
+ let errorCorrectionLevel = ECLevel.M;
23386
+ let version;
23387
+ let mask;
23388
+ if (typeof options !== "undefined") {
23389
+ errorCorrectionLevel = ECLevel.from(options.errorCorrectionLevel, ECLevel.M);
23390
+ version = Version.from(options.version);
23391
+ mask = MaskPattern.from(options.maskPattern);
23392
+ if (options.toSJISFunc) {
23393
+ Utils.setToSJISFunction(options.toSJISFunc);
23394
+ }
23395
+ }
23396
+ return createSymbol(data, version, errorCorrectionLevel, mask);
23397
+ };
23398
+ }
23399
+ });
23400
+
23401
+ // node_modules/qrcode/lib/renderer/utils.js
23402
+ var require_utils2 = __commonJS({
23403
+ "node_modules/qrcode/lib/renderer/utils.js"(exports) {
23404
+ function hex2rgba(hex) {
23405
+ if (typeof hex === "number") {
23406
+ hex = hex.toString();
23407
+ }
23408
+ if (typeof hex !== "string") {
23409
+ throw new Error("Color should be defined as hex string");
23410
+ }
23411
+ let hexCode = hex.slice().replace("#", "").split("");
23412
+ if (hexCode.length < 3 || hexCode.length === 5 || hexCode.length > 8) {
23413
+ throw new Error("Invalid hex color: " + hex);
23414
+ }
23415
+ if (hexCode.length === 3 || hexCode.length === 4) {
23416
+ hexCode = Array.prototype.concat.apply([], hexCode.map(function(c4) {
23417
+ return [c4, c4];
23418
+ }));
23419
+ }
23420
+ if (hexCode.length === 6) hexCode.push("F", "F");
23421
+ const hexValue = parseInt(hexCode.join(""), 16);
23422
+ return {
23423
+ r: hexValue >> 24 & 255,
23424
+ g: hexValue >> 16 & 255,
23425
+ b: hexValue >> 8 & 255,
23426
+ a: hexValue & 255,
23427
+ hex: "#" + hexCode.slice(0, 6).join("")
23428
+ };
23429
+ }
23430
+ exports.getOptions = function getOptions(options) {
23431
+ if (!options) options = {};
23432
+ if (!options.color) options.color = {};
23433
+ const margin = typeof options.margin === "undefined" || options.margin === null || options.margin < 0 ? 4 : options.margin;
23434
+ const width = options.width && options.width >= 21 ? options.width : void 0;
23435
+ const scale = options.scale || 4;
23436
+ return {
23437
+ width,
23438
+ scale: width ? 4 : scale,
23439
+ margin,
23440
+ color: {
23441
+ dark: hex2rgba(options.color.dark || "#000000ff"),
23442
+ light: hex2rgba(options.color.light || "#ffffffff")
23443
+ },
23444
+ type: options.type,
23445
+ rendererOpts: options.rendererOpts || {}
23446
+ };
23447
+ };
23448
+ exports.getScale = function getScale2(qrSize, opts) {
23449
+ return opts.width && opts.width >= qrSize + opts.margin * 2 ? opts.width / (qrSize + opts.margin * 2) : opts.scale;
23450
+ };
23451
+ exports.getImageWidth = function getImageWidth(qrSize, opts) {
23452
+ const scale = exports.getScale(qrSize, opts);
23453
+ return Math.floor((qrSize + opts.margin * 2) * scale);
23454
+ };
23455
+ exports.qrToImageData = function qrToImageData(imgData, qr, opts) {
23456
+ const size2 = qr.modules.size;
23457
+ const data = qr.modules.data;
23458
+ const scale = exports.getScale(size2, opts);
23459
+ const symbolSize = Math.floor((size2 + opts.margin * 2) * scale);
23460
+ const scaledMargin = opts.margin * scale;
23461
+ const palette = [opts.color.light, opts.color.dark];
23462
+ for (let i7 = 0; i7 < symbolSize; i7++) {
23463
+ for (let j = 0; j < symbolSize; j++) {
23464
+ let posDst = (i7 * symbolSize + j) * 4;
23465
+ let pxColor = opts.color.light;
23466
+ if (i7 >= scaledMargin && j >= scaledMargin && i7 < symbolSize - scaledMargin && j < symbolSize - scaledMargin) {
23467
+ const iSrc = Math.floor((i7 - scaledMargin) / scale);
23468
+ const jSrc = Math.floor((j - scaledMargin) / scale);
23469
+ pxColor = palette[data[iSrc * size2 + jSrc] ? 1 : 0];
23470
+ }
23471
+ imgData[posDst++] = pxColor.r;
23472
+ imgData[posDst++] = pxColor.g;
23473
+ imgData[posDst++] = pxColor.b;
23474
+ imgData[posDst] = pxColor.a;
23475
+ }
23476
+ }
23477
+ };
23478
+ }
23479
+ });
23480
+
23481
+ // node_modules/qrcode/lib/renderer/canvas.js
23482
+ var require_canvas = __commonJS({
23483
+ "node_modules/qrcode/lib/renderer/canvas.js"(exports) {
23484
+ var Utils = require_utils2();
23485
+ function clearCanvas(ctx, canvas, size2) {
23486
+ ctx.clearRect(0, 0, canvas.width, canvas.height);
23487
+ if (!canvas.style) canvas.style = {};
23488
+ canvas.height = size2;
23489
+ canvas.width = size2;
23490
+ canvas.style.height = size2 + "px";
23491
+ canvas.style.width = size2 + "px";
23492
+ }
23493
+ function getCanvasElement() {
23494
+ try {
23495
+ return document.createElement("canvas");
23496
+ } catch (e9) {
23497
+ throw new Error("You need to specify a canvas element");
23498
+ }
23499
+ }
23500
+ exports.render = function render(qrData, canvas, options) {
23501
+ let opts = options;
23502
+ let canvasEl = canvas;
23503
+ if (typeof opts === "undefined" && (!canvas || !canvas.getContext)) {
23504
+ opts = canvas;
23505
+ canvas = void 0;
23506
+ }
23507
+ if (!canvas) {
23508
+ canvasEl = getCanvasElement();
23509
+ }
23510
+ opts = Utils.getOptions(opts);
23511
+ const size2 = Utils.getImageWidth(qrData.modules.size, opts);
23512
+ const ctx = canvasEl.getContext("2d");
23513
+ const image = ctx.createImageData(size2, size2);
23514
+ Utils.qrToImageData(image.data, qrData, opts);
23515
+ clearCanvas(ctx, canvasEl, size2);
23516
+ ctx.putImageData(image, 0, 0);
23517
+ return canvasEl;
23518
+ };
23519
+ exports.renderToDataURL = function renderToDataURL(qrData, canvas, options) {
23520
+ let opts = options;
23521
+ if (typeof opts === "undefined" && (!canvas || !canvas.getContext)) {
23522
+ opts = canvas;
23523
+ canvas = void 0;
23524
+ }
23525
+ if (!opts) opts = {};
23526
+ const canvasEl = exports.render(qrData, canvas, opts);
23527
+ const type = opts.type || "image/png";
23528
+ const rendererOpts = opts.rendererOpts || {};
23529
+ return canvasEl.toDataURL(type, rendererOpts.quality);
23530
+ };
23531
+ }
23532
+ });
23533
+
23534
+ // node_modules/qrcode/lib/renderer/svg-tag.js
23535
+ var require_svg_tag = __commonJS({
23536
+ "node_modules/qrcode/lib/renderer/svg-tag.js"(exports) {
23537
+ var Utils = require_utils2();
23538
+ function getColorAttrib(color, attrib) {
23539
+ const alpha = color.a / 255;
23540
+ const str = attrib + '="' + color.hex + '"';
23541
+ return alpha < 1 ? str + " " + attrib + '-opacity="' + alpha.toFixed(2).slice(1) + '"' : str;
23542
+ }
23543
+ function svgCmd(cmd, x2, y3) {
23544
+ let str = cmd + x2;
23545
+ if (typeof y3 !== "undefined") str += " " + y3;
23546
+ return str;
23547
+ }
23548
+ function qrToPath(data, size2, margin) {
23549
+ let path = "";
23550
+ let moveBy = 0;
23551
+ let newRow = false;
23552
+ let lineLength = 0;
23553
+ for (let i7 = 0; i7 < data.length; i7++) {
23554
+ const col = Math.floor(i7 % size2);
23555
+ const row = Math.floor(i7 / size2);
23556
+ if (!col && !newRow) newRow = true;
23557
+ if (data[i7]) {
23558
+ lineLength++;
23559
+ if (!(i7 > 0 && col > 0 && data[i7 - 1])) {
23560
+ path += newRow ? svgCmd("M", col + margin, 0.5 + row + margin) : svgCmd("m", moveBy, 0);
23561
+ moveBy = 0;
23562
+ newRow = false;
23563
+ }
23564
+ if (!(col + 1 < size2 && data[i7 + 1])) {
23565
+ path += svgCmd("h", lineLength);
23566
+ lineLength = 0;
23567
+ }
23568
+ } else {
23569
+ moveBy++;
23570
+ }
23571
+ }
23572
+ return path;
23573
+ }
23574
+ exports.render = function render(qrData, options, cb) {
23575
+ const opts = Utils.getOptions(options);
23576
+ const size2 = qrData.modules.size;
23577
+ const data = qrData.modules.data;
23578
+ const qrcodesize = size2 + opts.margin * 2;
23579
+ const bg = !opts.color.light.a ? "" : "<path " + getColorAttrib(opts.color.light, "fill") + ' d="M0 0h' + qrcodesize + "v" + qrcodesize + 'H0z"/>';
23580
+ const path = "<path " + getColorAttrib(opts.color.dark, "stroke") + ' d="' + qrToPath(data, size2, opts.margin) + '"/>';
23581
+ const viewBox = 'viewBox="0 0 ' + qrcodesize + " " + qrcodesize + '"';
23582
+ const width = !opts.width ? "" : 'width="' + opts.width + '" height="' + opts.width + '" ';
23583
+ const svgTag = '<svg xmlns="http://www.w3.org/2000/svg" ' + width + viewBox + ' shape-rendering="crispEdges">' + bg + path + "</svg>\n";
23584
+ if (typeof cb === "function") {
23585
+ cb(null, svgTag);
23586
+ }
23587
+ return svgTag;
23588
+ };
23589
+ }
23590
+ });
23591
+
23592
+ // node_modules/qrcode/lib/browser.js
23593
+ var require_browser = __commonJS({
23594
+ "node_modules/qrcode/lib/browser.js"(exports) {
23595
+ var canPromise = require_can_promise();
23596
+ var QRCode2 = require_qrcode();
23597
+ var CanvasRenderer = require_canvas();
23598
+ var SvgRenderer = require_svg_tag();
23599
+ function renderCanvas(renderFunc, canvas, text, opts, cb) {
23600
+ const args = [].slice.call(arguments, 1);
23601
+ const argsNum = args.length;
23602
+ const isLastArgCb = typeof args[argsNum - 1] === "function";
23603
+ if (!isLastArgCb && !canPromise()) {
23604
+ throw new Error("Callback required as last argument");
23605
+ }
23606
+ if (isLastArgCb) {
23607
+ if (argsNum < 2) {
23608
+ throw new Error("Too few arguments provided");
23609
+ }
23610
+ if (argsNum === 2) {
23611
+ cb = text;
23612
+ text = canvas;
23613
+ canvas = opts = void 0;
23614
+ } else if (argsNum === 3) {
23615
+ if (canvas.getContext && typeof cb === "undefined") {
23616
+ cb = opts;
23617
+ opts = void 0;
23618
+ } else {
23619
+ cb = opts;
23620
+ opts = text;
23621
+ text = canvas;
23622
+ canvas = void 0;
23623
+ }
23624
+ }
23625
+ } else {
23626
+ if (argsNum < 1) {
23627
+ throw new Error("Too few arguments provided");
23628
+ }
23629
+ if (argsNum === 1) {
23630
+ text = canvas;
23631
+ canvas = opts = void 0;
23632
+ } else if (argsNum === 2 && !canvas.getContext) {
23633
+ opts = text;
23634
+ text = canvas;
23635
+ canvas = void 0;
23636
+ }
23637
+ return new Promise(function(resolve, reject) {
23638
+ try {
23639
+ const data = QRCode2.create(text, opts);
23640
+ resolve(renderFunc(data, canvas, opts));
23641
+ } catch (e9) {
23642
+ reject(e9);
23643
+ }
23644
+ });
23645
+ }
23646
+ try {
23647
+ const data = QRCode2.create(text, opts);
23648
+ cb(null, renderFunc(data, canvas, opts));
23649
+ } catch (e9) {
23650
+ cb(e9);
23651
+ }
23652
+ }
23653
+ exports.create = QRCode2.create;
23654
+ exports.toCanvas = renderCanvas.bind(null, CanvasRenderer.render);
23655
+ exports.toDataURL = renderCanvas.bind(null, CanvasRenderer.renderToDataURL);
23656
+ exports.toString = renderCanvas.bind(null, function(data, _2, opts) {
23657
+ return SvgRenderer.render(data, opts);
23658
+ });
23659
+ }
23660
+ });
23661
+
21584
23662
  // node_modules/react/cjs/react-jsx-runtime.development.js
21585
23663
  var require_react_jsx_runtime_development = __commonJS({
21586
23664
  "node_modules/react/cjs/react-jsx-runtime.development.js"(exports) {
@@ -49728,6 +51806,9 @@ __decorate([storeProperty()], DAppKitConnectButton.prototype, "instance", void 0
49728
51806
  __decorate([e5("mysten-dapp-kit-connect-modal")], DAppKitConnectButton.prototype, "_modal", void 0);
49729
51807
  DAppKitConnectButton = __decorate([t3("mysten-dapp-kit-connect-button")], DAppKitConnectButton);
49730
51808
 
51809
+ // src/components/modal.ts
51810
+ var import_qrcode = __toESM(require_browser());
51811
+
49731
51812
  // node_modules/@stripe/stripe-js/dist/index.mjs
49732
51813
  function _typeof(obj) {
49733
51814
  "@babel/helpers - typeof";
@@ -49983,7 +52064,7 @@ function getExplorerNetworkPath() {
49983
52064
  return requestedNetwork === "mainnet" ? "mainnet" : "testnet";
49984
52065
  }
49985
52066
  var SuiOutKitModal = class {
49986
- constructor(session, backendUrl, onClose) {
52067
+ constructor(session, backendUrl, options) {
49987
52068
  this.overlay = null;
49988
52069
  this.pollInterval = null;
49989
52070
  this.walletConnectionUnsubscribe = null;
@@ -49994,7 +52075,10 @@ var SuiOutKitModal = class {
49994
52075
  this.stripeElements = null;
49995
52076
  this.session = session;
49996
52077
  this.backendUrl = backendUrl;
49997
- this.onCloseCallback = onClose;
52078
+ this.onCloseCallback = options?.onClose;
52079
+ this.onPaymentCompleteCallback = options?.onPaymentComplete;
52080
+ this.redirectUrl = options?.redirectUrl;
52081
+ this.autoCloseOnSuccess = options?.autoCloseOnSuccess;
49998
52082
  this.ensureDAppKit();
49999
52083
  this.injectStyles();
50000
52084
  this.createModal();
@@ -50193,8 +52277,8 @@ var SuiOutKitModal = class {
50193
52277
  <h2 class="suioutkit-title">OPay Direct</h2>
50194
52278
  <p class="suioutkit-subtitle">Enter your OPay registered phone number</p>
50195
52279
  </div>
50196
- <div class="sok-panel">
50197
- <form class="sok-form" id="sok-opay-form">
52280
+ <div class="suioutkit-panel">
52281
+ <form class="sok-form" id="sok-opay-form" style="width: 100%;">
50198
52282
  <input type="tel" class="sok-input" placeholder="e.g. 08012345678" id="sok-phone-input" required />
50199
52283
  <button type="submit" class="sok-btn">Send Prompt</button>
50200
52284
  </form>
@@ -50260,12 +52344,12 @@ var SuiOutKitModal = class {
50260
52344
  <h2 class="suioutkit-title">Global Checkout</h2>
50261
52345
  <p class="suioutkit-subtitle">Secured by Stripe</p>
50262
52346
  </div>
50263
- <div class="suioutkit-panel" style="gap: 16px; display: flex; flex-direction: column; width: 100%;">
52347
+ <div class="suioutkit-panel">
50264
52348
  <form id="payment-form" style="width: 100%;">
50265
52349
  <div id="payment-element" style="min-height: 200px; margin-bottom: 16px;">
50266
52350
  <div class="sok-spinner" style="margin: 0 auto;"></div>
50267
52351
  </div>
50268
- <button class="sok-btn" id="submit-stripe-btn" style="background: linear-gradient(135deg, #6366f1 0%, #4338ca 100%); width: 100%;">
52352
+ <button class="sok-btn sok-btn-indigo" id="submit-stripe-btn">
50269
52353
  Pay Now
50270
52354
  </button>
50271
52355
  <div id="payment-message" style="color: #ef4444; font-size: 13px; margin-top: 8px; text-align: center; display: none;"></div>
@@ -50317,35 +52401,31 @@ var SuiOutKitModal = class {
50317
52401
  async handleCryptoPaymentPanel() {
50318
52402
  const container = this.overlay?.querySelector("#sok-content-panel");
50319
52403
  if (!container) return;
50320
- this.renderLoadingPanel("Preparing crypto payment...");
50321
- try {
50322
- this.cryptoIntent = await this.loadCryptoIntent("sui_wallet");
50323
- } catch (err) {
50324
- this.renderErrorPanel(err.message || "Failed to prepare crypto payment.");
50325
- return;
50326
- }
50327
52404
  container.innerHTML = `
50328
52405
  <button class="suioutkit-back" id="sok-back-btn">\u2190 Back to methods</button>
50329
52406
  <div class="suioutkit-header">
50330
52407
  <h2 class="suioutkit-title">Pay with Sui Wallet</h2>
50331
52408
  <p class="suioutkit-subtitle">Choose SUI payment channel</p>
50332
52409
  </div>
50333
- <div class="suioutkit-panel" style="gap: 12px; display: flex; flex-direction: column; width: 100%;">
52410
+ <div class="suioutkit-panel">
50334
52411
  <p class="sok-status-text" style="margin-bottom: 12px;">
50335
52412
  Choose whether to pay via a desktop extension wallet or scan a dynamic QR Code with your mobile wallet.
50336
52413
  </p>
50337
- <button class="sok-btn" id="sok-connect-extension-btn" style="background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%); margin-bottom: 4px;">
52414
+ <button class="sok-btn sok-btn-blue" id="sok-connect-extension-btn" style="margin-bottom: 4px;">
50338
52415
  Standard Connect Wallet
50339
52416
  </button>
50340
- <button class="sok-btn" id="sok-outpay-qr-btn" style="background: linear-gradient(135deg, #10b981 0%, #047857 100%);">
52417
+ <button class="sok-btn sok-btn-green" id="sok-outpay-qr-btn">
50341
52418
  outPay (Scan QR Code)
50342
52419
  </button>
50343
52420
  </div>
50344
52421
  `;
50345
52422
  container.querySelector("#sok-back-btn")?.addEventListener("click", () => this.renderSelectionPanel());
50346
- container.querySelector("#sok-connect-extension-btn")?.addEventListener("click", () => {
50347
- if (!this.cryptoIntent) {
50348
- this.renderErrorPanel("Crypto intent not ready.");
52423
+ container.querySelector("#sok-connect-extension-btn")?.addEventListener("click", async () => {
52424
+ this.renderLoadingPanel("Preparing crypto payment...");
52425
+ try {
52426
+ this.cryptoIntent = await this.loadCryptoIntent("sui_wallet");
52427
+ } catch (err) {
52428
+ this.renderErrorPanel(err.message || "Failed to prepare crypto payment.");
50349
52429
  return;
50350
52430
  }
50351
52431
  void this.openStandardConnectWallet();
@@ -50399,10 +52479,10 @@ var SuiOutKitModal = class {
50399
52479
  <h2 class="suioutkit-title">Connect Wallet</h2>
50400
52480
  <p class="suioutkit-subtitle">Choose the extension you want to use</p>
50401
52481
  </div>
50402
- <div style="display: grid; grid-template-columns: 1fr; gap: 12px; width: 100%;">
52482
+ <div class="suioutkit-wallet-list">
50403
52483
  ${walletCardsHtml}
50404
52484
  </div>
50405
- <p class="sok-status-text" style="font-size: 12px; opacity: 0.75; margin-top: 14px; text-align: center;">
52485
+ <p class="sok-status-text sok-text-sm sok-op-75" style="margin-top: 14px; text-align: center;">
50406
52486
  Wallets are filtered from the browser extensions detected by dApp Kit.
50407
52487
  </p>
50408
52488
  `;
@@ -50465,15 +52545,15 @@ var SuiOutKitModal = class {
50465
52545
  if (!container) return;
50466
52546
  container.innerHTML = `
50467
52547
  <button class="suioutkit-back" id="sok-back-btn">\u2190 Back to Sui options</button>
50468
- <div class="suioutkit-panel" style="gap: 12px; display: flex; flex-direction: column; align-items: center; text-align: center;">
50469
- <div class="sok-success-icon" style="color: #f59e0b; display: flex; align-items: center; justify-content: center; margin-bottom: 8px;">
52548
+ <div class="suioutkit-panel">
52549
+ <div class="sok-icon-wrap sok-text-amber">
50470
52550
  <i data-lucide="alert-circle" style="width: 48px; height: 48px;"></i>
50471
52551
  </div>
50472
52552
  <h2 class="sok-success-title">Open this demo from localhost</h2>
50473
52553
  <p class="sok-status-text" style="max-width: 320px;">
50474
52554
  This page is running from a local file URL. Browser extension wallets like Slush and Phantom do not reliably inject into file:// pages, so dApp Kit cannot list them here.
50475
52555
  </p>
50476
- <p class="sok-status-text" style="max-width: 320px; font-size: 12px; opacity: 0.78;">
52556
+ <p class="sok-status-text sok-text-sm sok-op-75" style="max-width: 320px;">
50477
52557
  Open the demo over http://localhost or another web server, then reload. That is the supported origin for wallet detection and connection.
50478
52558
  </p>
50479
52559
  </div>
@@ -50488,14 +52568,13 @@ var SuiOutKitModal = class {
50488
52568
  <button
50489
52569
  class="sok-wallet-card"
50490
52570
  data-wallet-index="${index}"
50491
- style="display: flex; align-items: center; gap: 14px; width: 100%; padding: 14px 16px; border-radius: 18px; border: 1px solid rgba(255,255,255,0.08); background: linear-gradient(135deg, rgba(17,24,39,0.88), rgba(15,23,42,0.96)); color: #fff; text-align: left; box-shadow: 0 18px 40px rgba(0,0,0,0.22);"
50492
52571
  >
50493
- <img src="${icon}" alt="${walletName}" class="sok-wallet-icon" style="width: 44px; height: 44px; border-radius: 14px; flex: none; background: rgba(255,255,255,0.08); padding: 4px;" />
50494
- <span style="display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0;">
50495
- <span class="sok-wallet-name" style="font-weight: 700; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;">${walletName}</span>
50496
- <span style="font-size: 12px; opacity: 0.74;">Detected browser wallet</span>
52572
+ <img src="${icon}" alt="${walletName}" class="sok-wallet-icon" />
52573
+ <span class="sok-wallet-info">
52574
+ <span class="sok-wallet-name">${walletName}</span>
52575
+ <span class="sok-wallet-desc">Detected browser wallet</span>
50497
52576
  </span>
50498
- <span style="font-size: 12px; font-weight: 700; color: #93c5fd;">Connect</span>
52577
+ <span class="sok-wallet-connect">Connect</span>
50499
52578
  </button>
50500
52579
  `;
50501
52580
  }
@@ -50505,14 +52584,14 @@ var SuiOutKitModal = class {
50505
52584
  container.innerHTML = `
50506
52585
  <button class="suioutkit-back" id="sok-back-btn">\u2190 Back to Sui options</button>
50507
52586
  <div class="suioutkit-panel">
50508
- <div class="sok-success-icon" style="color: #f59e0b; display: flex; align-items: center; justify-content: center; margin-bottom: 16px;">
52587
+ <div class="sok-icon-wrap sok-text-amber">
50509
52588
  <i data-lucide="alert-circle" style="width: 48px; height: 48px;"></i>
50510
52589
  </div>
50511
52590
  <h2 class="sok-success-title">No Wallets Detected</h2>
50512
- <p class="sok-status-text" style="margin-top: 16px;">
52591
+ <p class="sok-status-text sok-mt-16">
50513
52592
  We couldn't find any installed Sui wallets. Please install a wallet extension like Phantom, Slush, or others from the app store and refresh the page.
50514
52593
  </p>
50515
- <p class="sok-status-text" style="font-size: 12px; opacity: 0.7; margin-top: 12px;">
52594
+ <p class="sok-status-text sok-text-sm sok-op-75 sok-mt-12">
50516
52595
  Alternatively, you can use the outPay QR option to pay from a mobile wallet.
50517
52596
  </p>
50518
52597
  </div>
@@ -50534,7 +52613,7 @@ var SuiOutKitModal = class {
50534
52613
  <h2 class="suioutkit-title">Confirm Payment</h2>
50535
52614
  <p class="suioutkit-subtitle">Review and approve this transaction</p>
50536
52615
  </div>
50537
- <div class="suioutkit-panel" style="gap: 12px; display: flex; flex-direction: column; width: 100%;">
52616
+ <div class="suioutkit-panel">
50538
52617
  <div class="sok-va-card">
50539
52618
  <div class="sok-va-row">
50540
52619
  <div class="sok-va-lbl">Amount</div>
@@ -50549,7 +52628,7 @@ var SuiOutKitModal = class {
50549
52628
  <div class="sok-va-val">${network}</div>
50550
52629
  </div>
50551
52630
  </div>
50552
- <button class="sok-btn" id="sok-confirm-pay-btn" style="background: linear-gradient(135deg, #10b981 0%, #047857 100%);">
52631
+ <button class="sok-btn sok-btn-green" id="sok-confirm-pay-btn">
50553
52632
  Confirm & Pay
50554
52633
  </button>
50555
52634
  </div>
@@ -50644,7 +52723,7 @@ var SuiOutKitModal = class {
50644
52723
  return;
50645
52724
  }
50646
52725
  const paymentUri = this.buildPaymentUri(this.cryptoIntent);
50647
- const qrCodeUrl = `https://api.qrserver.com/v1/create-qr-code/?size=180x180&data=${encodeURIComponent(paymentUri)}`;
52726
+ const qrCodeUrl = await import_qrcode.default.toDataURL(paymentUri, { width: 180, margin: 1 });
50648
52727
  container.innerHTML = `
50649
52728
  <button class="suioutkit-back" id="sok-back-btn">\u2190 Back to Sui options</button>
50650
52729
  <div class="suioutkit-panel">
@@ -50657,7 +52736,7 @@ var SuiOutKitModal = class {
50657
52736
  <div class="sok-qr-frame">
50658
52737
  <img src="${qrCodeUrl}" alt="outPay QR Code" class="sok-qr-img" />
50659
52738
  <div class="sok-qr-logo-badge">
50660
- <i data-lucide="droplet" style="width: 16px; height: 16px; color: white;"></i>
52739
+ <img src="${this.backendUrl}/assets/slush.jpeg" alt="Slush" style="width: 35px; height: 35px; border-radius: 16px;" />
50661
52740
  </div>
50662
52741
  <div class="sok-qr-scan-pulse"></div>
50663
52742
  </div>
@@ -50719,8 +52798,9 @@ var SuiOutKitModal = class {
50719
52798
  this.stopPolling();
50720
52799
  const walrusNetworkPath = getExplorerNetworkPath();
50721
52800
  container.innerHTML = `
52801
+ <button class="suioutkit-back" id="sok-back-btn">\u2190 Back to methods</button>
50722
52802
  <div class="suioutkit-panel">
50723
- <div class="sok-success-icon" style="color: #10b981; display: flex; align-items: center; justify-content: center; margin-bottom: 16px;">
52803
+ <div class="sok-icon-wrap sok-text-green">
50724
52804
  <i data-lucide="check-circle" style="width: 48px; height: 48px;"></i>
50725
52805
  </div>
50726
52806
  <h2 class="sok-success-title">Payment Successful!</h2>
@@ -50729,7 +52809,7 @@ var SuiOutKitModal = class {
50729
52809
  <div class="sok-success-details">
50730
52810
  <div class="sok-receipt-row">
50731
52811
  <span class="sok-receipt-lbl">Amount Paid</span>
50732
- <span class="sok-receipt-val" style="color: #10b981; font-weight:700;">
52812
+ <span class="sok-receipt-val sok-text-green" style="font-weight:700;">
50733
52813
  ${this.session.currency === "NGN" ? "\u20A6" : ""}${this.session.amount.toLocaleString()}
50734
52814
  </span>
50735
52815
  </div>
@@ -50751,6 +52831,14 @@ var SuiOutKitModal = class {
50751
52831
  </div>
50752
52832
  `;
50753
52833
  this.renderIcons();
52834
+ container.querySelector("#sok-back-btn")?.addEventListener("click", () => this.renderSelectionPanel());
52835
+ const result = { nonce: this.session.nonce, txDigest, walrusBlobId };
52836
+ this.onPaymentCompleteCallback?.(result);
52837
+ if (this.redirectUrl) {
52838
+ window.location.href = this.redirectUrl;
52839
+ } else if (this.autoCloseOnSuccess) {
52840
+ this.destroy();
52841
+ }
50754
52842
  }
50755
52843
  renderErrorPanel(message) {
50756
52844
  const container = this.overlay?.querySelector("#sok-content-panel");
@@ -50758,11 +52846,11 @@ var SuiOutKitModal = class {
50758
52846
  container.innerHTML = `
50759
52847
  <button class="suioutkit-back" id="sok-back-btn">\u2190 Back to methods</button>
50760
52848
  <div class="suioutkit-panel">
50761
- <div class="sok-success-icon" style="color: #ef4444; display: flex; align-items: center; justify-content: center; margin-bottom: 16px;">
52849
+ <div class="sok-icon-wrap sok-text-red">
50762
52850
  <i data-lucide="x-circle" style="width: 48px; height: 48px;"></i>
50763
52851
  </div>
50764
52852
  <h2 class="sok-success-title">Payment Failed</h2>
50765
- <p class="sok-status-text" style="color: #ef4444; margin-bottom: 20px;">${message}</p>
52853
+ <p class="sok-status-text sok-mb-20 sok-text-red">${message}</p>
50766
52854
  </div>
50767
52855
  `;
50768
52856
  this.renderIcons();
@@ -50797,7 +52885,7 @@ var SuiOutKitModal = class {
50797
52885
  this.overlay?.classList.remove("active");
50798
52886
  setTimeout(() => {
50799
52887
  this.overlay?.remove();
50800
- this.onCloseCallback();
52888
+ this.onCloseCallback?.();
50801
52889
  }, 300);
50802
52890
  }
50803
52891
  };
@@ -50932,10 +53020,8 @@ var SuiOutKit = class {
50932
53020
  /**
50933
53021
  * Spawns the interactive RainbowKit-style checkout modal.
50934
53022
  */
50935
- openModal(session, onClose) {
50936
- return new SuiOutKitModal(session, this.backendUrl, () => {
50937
- if (onClose) onClose();
50938
- });
53023
+ openModal(session, options) {
53024
+ return new SuiOutKitModal(session, this.backendUrl, options);
50939
53025
  }
50940
53026
  /**
50941
53027
  * Confirms a crypto payment after wallet execution by submitting the tx digest.
@@ -50978,10 +53064,12 @@ var SuiOutKit = class {
50978
53064
  btn.style.opacity = "0.7";
50979
53065
  try {
50980
53066
  const session = await this.initCheckout(options);
50981
- this.openModal(session, () => {
50982
- btn.disabled = false;
50983
- btn.textContent = `Pay ${formattedAmount}`;
50984
- btn.style.opacity = "1";
53067
+ this.openModal(session, {
53068
+ onClose: () => {
53069
+ btn.disabled = false;
53070
+ btn.textContent = `Pay ${formattedAmount}`;
53071
+ btn.style.opacity = "1";
53072
+ }
50985
53073
  });
50986
53074
  } catch (err) {
50987
53075
  alert("SuiOutKit Error: Unable to open secure payment session.");