@mcistudio/unoui-vue 1.0.0

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.
Files changed (187) hide show
  1. package/README.md +95 -0
  2. package/dist/alert/Alert.vue.d.ts +67 -0
  3. package/dist/alert/index.d.ts +40 -0
  4. package/dist/alert/index.js +2 -0
  5. package/dist/attrs.d.ts +11 -0
  6. package/dist/attrs.js +16 -0
  7. package/dist/attrs.js.map +1 -0
  8. package/dist/badge/Badge.vue.d.ts +57 -0
  9. package/dist/badge/BadgeRibbon.vue.d.ts +34 -0
  10. package/dist/badge/index.d.ts +42 -0
  11. package/dist/badge/index.js +2 -0
  12. package/dist/build.d.ts +2 -0
  13. package/dist/button/Button.vue.d.ts +46 -0
  14. package/dist/button/ButtonGroup.vue.d.ts +13 -0
  15. package/dist/button/index.d.ts +13 -0
  16. package/dist/button/index.js +2 -0
  17. package/dist/checkbox/Checkbox.vue.d.ts +47 -0
  18. package/dist/checkbox/CheckboxGroup.vue.d.ts +38 -0
  19. package/dist/checkbox/index.d.ts +30 -0
  20. package/dist/checkbox/index.js +2 -0
  21. package/dist/chunks/Progress-BL4KZ3HE.js +271 -0
  22. package/dist/chunks/Progress-BL4KZ3HE.js.map +1 -0
  23. package/dist/chunks/Skeleton-ohStUD4M.js +153 -0
  24. package/dist/chunks/Skeleton-ohStUD4M.js.map +1 -0
  25. package/dist/chunks/Table-DhXmuKQd.js +330 -0
  26. package/dist/chunks/Table-DhXmuKQd.js.map +1 -0
  27. package/dist/chunks/_plugin-vue_export-helper-B3ysoDQm.js +8 -0
  28. package/dist/chunks/alert-CczW_DKs.js +190 -0
  29. package/dist/chunks/alert-CczW_DKs.js.map +1 -0
  30. package/dist/chunks/badge-BHOZeImh.js +287 -0
  31. package/dist/chunks/badge-BHOZeImh.js.map +1 -0
  32. package/dist/chunks/button-pDObrN_X.js +168 -0
  33. package/dist/chunks/button-pDObrN_X.js.map +1 -0
  34. package/dist/chunks/checkbox-9_0oR4kg.js +260 -0
  35. package/dist/chunks/checkbox-9_0oR4kg.js.map +1 -0
  36. package/dist/chunks/colorpicker-CcizUCQv.js +594 -0
  37. package/dist/chunks/colorpicker-CcizUCQv.js.map +1 -0
  38. package/dist/chunks/datepicker-Cy808x7X.js +1414 -0
  39. package/dist/chunks/datepicker-Cy808x7X.js.map +1 -0
  40. package/dist/chunks/drawer-C3JZ28Xo.js +193 -0
  41. package/dist/chunks/drawer-C3JZ28Xo.js.map +1 -0
  42. package/dist/chunks/dropdown-0l967g7D.js +329 -0
  43. package/dist/chunks/dropdown-0l967g7D.js.map +1 -0
  44. package/dist/chunks/form-Qeqkd-HH.js +642 -0
  45. package/dist/chunks/form-Qeqkd-HH.js.map +1 -0
  46. package/dist/chunks/input-BDOXVCrK.js +1281 -0
  47. package/dist/chunks/input-BDOXVCrK.js.map +1 -0
  48. package/dist/chunks/inputOtp-Dyxj9lNj.js +261 -0
  49. package/dist/chunks/inputOtp-Dyxj9lNj.js.map +1 -0
  50. package/dist/chunks/message-xPfuG0EX.js +107 -0
  51. package/dist/chunks/message-xPfuG0EX.js.map +1 -0
  52. package/dist/chunks/millercolumns-Dp3fBrq6.js +426 -0
  53. package/dist/chunks/millercolumns-Dp3fBrq6.js.map +1 -0
  54. package/dist/chunks/modal-D6l1iIvE.js +81 -0
  55. package/dist/chunks/modal-D6l1iIvE.js.map +1 -0
  56. package/dist/chunks/pagination-Bc583AQX.js +265 -0
  57. package/dist/chunks/pagination-Bc583AQX.js.map +1 -0
  58. package/dist/chunks/popconfirm-D6lUfSxG.js +343 -0
  59. package/dist/chunks/popconfirm-D6lUfSxG.js.map +1 -0
  60. package/dist/chunks/qrcode-B0t_pZna.js +1099 -0
  61. package/dist/chunks/qrcode-B0t_pZna.js.map +1 -0
  62. package/dist/chunks/radio-DnYm59xH.js +477 -0
  63. package/dist/chunks/radio-DnYm59xH.js.map +1 -0
  64. package/dist/chunks/rate-0sme__Kb.js +309 -0
  65. package/dist/chunks/rate-0sme__Kb.js.map +1 -0
  66. package/dist/chunks/select-ChTfQM5u.js +417 -0
  67. package/dist/chunks/select-ChTfQM5u.js.map +1 -0
  68. package/dist/chunks/slider-C-W5GzTP.js +724 -0
  69. package/dist/chunks/slider-C-W5GzTP.js.map +1 -0
  70. package/dist/chunks/splitter-CgfiXY65.js +524 -0
  71. package/dist/chunks/splitter-CgfiXY65.js.map +1 -0
  72. package/dist/chunks/switch-BULGbODP.js +327 -0
  73. package/dist/chunks/switch-BULGbODP.js.map +1 -0
  74. package/dist/chunks/tab-Dxfg1_To.js +663 -0
  75. package/dist/chunks/tab-Dxfg1_To.js.map +1 -0
  76. package/dist/chunks/tag-BYmNsrZC.js +167 -0
  77. package/dist/chunks/tag-BYmNsrZC.js.map +1 -0
  78. package/dist/chunks/timepicker-DsGIdcf8.js +1059 -0
  79. package/dist/chunks/timepicker-DsGIdcf8.js.map +1 -0
  80. package/dist/chunks/tooltip-DMhiAqto.js +242 -0
  81. package/dist/chunks/tooltip-DMhiAqto.js.map +1 -0
  82. package/dist/colorpicker/ColorPicker.vue.d.ts +30 -0
  83. package/dist/colorpicker/color.d.ts +56 -0
  84. package/dist/colorpicker/color.js +99 -0
  85. package/dist/colorpicker/color.js.map +1 -0
  86. package/dist/colorpicker/index.d.ts +12 -0
  87. package/dist/colorpicker/index.js +2 -0
  88. package/dist/config.d.ts +55 -0
  89. package/dist/config.js +260 -0
  90. package/dist/config.js.map +1 -0
  91. package/dist/datepicker/DatePicker.vue.d.ts +82 -0
  92. package/dist/datepicker/RangePicker.vue.d.ts +87 -0
  93. package/dist/datepicker/index.d.ts +59 -0
  94. package/dist/datepicker/index.js +2 -0
  95. package/dist/drawer/Drawer.vue.d.ts +86 -0
  96. package/dist/drawer/index.d.ts +23 -0
  97. package/dist/drawer/index.js +2 -0
  98. package/dist/dropdown/Dropdown.vue.d.ts +118 -0
  99. package/dist/dropdown/index.d.ts +2 -0
  100. package/dist/dropdown/index.js +2 -0
  101. package/dist/form/Form.vue.d.ts +170 -0
  102. package/dist/form/FormItem.vue.d.ts +83 -0
  103. package/dist/form/index.d.ts +176 -0
  104. package/dist/form/index.js +2 -0
  105. package/dist/index.d.ts +31 -0
  106. package/dist/index.js +32 -0
  107. package/dist/input/Autocomplete.vue.d.ts +121 -0
  108. package/dist/input/Input.vue.d.ts +142 -0
  109. package/dist/input/InputI18n.vue.d.ts +80 -0
  110. package/dist/input/InputTag.vue.d.ts +114 -0
  111. package/dist/input/index.d.ts +41 -0
  112. package/dist/input/index.js +2 -0
  113. package/dist/inputOtp/InputOtp.vue.d.ts +60 -0
  114. package/dist/inputOtp/index.d.ts +21 -0
  115. package/dist/inputOtp/index.js +2 -0
  116. package/dist/message/MessageContainer.vue.d.ts +11 -0
  117. package/dist/message/index.d.ts +20 -0
  118. package/dist/message/index.js +2 -0
  119. package/dist/message/types.d.ts +25 -0
  120. package/dist/millercolumns/MillerColumns.vue.d.ts +88 -0
  121. package/dist/millercolumns/index.d.ts +39 -0
  122. package/dist/millercolumns/index.js +2 -0
  123. package/dist/modal/Modal.vue.d.ts +54 -0
  124. package/dist/modal/index.d.ts +2 -0
  125. package/dist/modal/index.js +2 -0
  126. package/dist/pagination/Pagination.vue.d.ts +70 -0
  127. package/dist/pagination/index.d.ts +12 -0
  128. package/dist/pagination/index.js +2 -0
  129. package/dist/popconfirm/Popconfirm.vue.d.ts +104 -0
  130. package/dist/popconfirm/index.d.ts +36 -0
  131. package/dist/popconfirm/index.js +2 -0
  132. package/dist/progress/Progress.vue.d.ts +64 -0
  133. package/dist/progress/index.d.ts +26 -0
  134. package/dist/progress/index.js +2 -0
  135. package/dist/qrcode/QRCode.vue.d.ts +87 -0
  136. package/dist/qrcode/index.d.ts +43 -0
  137. package/dist/qrcode/index.js +2 -0
  138. package/dist/qrcode/qr.d.ts +51 -0
  139. package/dist/qrcode/qrcodegen.d.ts +94 -0
  140. package/dist/radio/Radio.vue.d.ts +52 -0
  141. package/dist/radio/RadioGroup.vue.d.ts +44 -0
  142. package/dist/radio/index.d.ts +55 -0
  143. package/dist/radio/index.js +2 -0
  144. package/dist/rate/Rate.vue.d.ts +100 -0
  145. package/dist/rate/index.d.ts +38 -0
  146. package/dist/rate/index.js +2 -0
  147. package/dist/select/Select.vue.d.ts +129 -0
  148. package/dist/select/index.d.ts +33 -0
  149. package/dist/select/index.js +2 -0
  150. package/dist/skeleton/Skeleton.vue.d.ts +31 -0
  151. package/dist/skeleton/index.d.ts +2 -0
  152. package/dist/skeleton/index.js +2 -0
  153. package/dist/slider/Slider.vue.d.ts +81 -0
  154. package/dist/slider/index.d.ts +61 -0
  155. package/dist/slider/index.js +2 -0
  156. package/dist/splitter/Splitter.vue.d.ts +63 -0
  157. package/dist/splitter/SplitterPanel.vue.d.ts +53 -0
  158. package/dist/splitter/index.d.ts +39 -0
  159. package/dist/splitter/index.js +2 -0
  160. package/dist/style.css +2 -0
  161. package/dist/switch/Switch.vue.d.ts +97 -0
  162. package/dist/switch/index.d.ts +31 -0
  163. package/dist/switch/index.js +2 -0
  164. package/dist/tab/TabPane.vue.d.ts +32 -0
  165. package/dist/tab/Tabs.vue.d.ts +87 -0
  166. package/dist/tab/index.d.ts +78 -0
  167. package/dist/tab/index.js +2 -0
  168. package/dist/table/Table.vue.d.ts +96 -0
  169. package/dist/table/index.d.ts +3 -0
  170. package/dist/table/index.js +2 -0
  171. package/dist/table/types.d.ts +35 -0
  172. package/dist/table/types.js +0 -0
  173. package/dist/tag/Tag.vue.d.ts +46 -0
  174. package/dist/tag/index.d.ts +11 -0
  175. package/dist/tag/index.js +2 -0
  176. package/dist/timepicker/TimePicker.vue.d.ts +92 -0
  177. package/dist/timepicker/TimeRangePicker.vue.d.ts +90 -0
  178. package/dist/timepicker/index.d.ts +39 -0
  179. package/dist/timepicker/index.js +2 -0
  180. package/dist/tooltip/Tooltip.vue.d.ts +79 -0
  181. package/dist/tooltip/index.d.ts +14 -0
  182. package/dist/tooltip/index.js +2 -0
  183. package/dist/uno.d.ts +32 -0
  184. package/dist/uno.js +83 -0
  185. package/dist/uno.js.map +1 -0
  186. package/dist/utils/DnD.d.ts +38 -0
  187. package/package.json +115 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"qrcode-B0t_pZna.js","names":["$slots"],"sources":["../../src/qrcode/qrcodegen.ts","../../src/qrcode/qr.ts","../../src/qrcode/QRCode.vue","../../src/qrcode/QRCode.vue","../../src/qrcode/index.ts"],"sourcesContent":["/* \n * QR Code generator library (TypeScript)\n * \n * Copyright (c) Project Nayuki. (MIT License)\n * https://www.nayuki.io/page/qr-code-generator-library\n * \n * Permission is hereby granted, free of charge, to any person obtaining a copy of\n * this software and associated documentation files (the \"Software\"), to deal in\n * the Software without restriction, including without limitation the rights to\n * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\n * the Software, and to permit persons to whom the Software is furnished to do so,\n * subject to the following conditions:\n * - The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n * - The Software is provided \"as is\", without warranty of any kind, express or\n * implied, including but not limited to the warranties of merchantability,\n * fitness for a particular purpose and noninfringement. In no event shall the\n * authors or copyright holders be liable for any claim, damages or other\n * liability, whether in an action of contract, tort or otherwise, arising from,\n * out of or in connection with the Software or the use or other dealings in the\n * Software.\n */\n\n\"use strict\";\n\n\nnamespace qrcodegen {\n\t\n\ttype bit = number;\n\ttype byte = number;\n\ttype int = number;\n\t\n\t\n\t/*---- QR Code symbol class ----*/\n\t\n\t/* \n\t * A QR Code symbol, which is a type of two-dimension barcode.\n\t * Invented by Denso Wave and described in the ISO/IEC 18004 standard.\n\t * Instances of this class represent an immutable square grid of dark and light cells.\n\t * The class provides static factory functions to create a QR Code from text or binary data.\n\t * The class covers the QR Code Model 2 specification, supporting all versions (sizes)\n\t * from 1 to 40, all 4 error correction levels, and 4 character encoding modes.\n\t * \n\t * Ways to create a QR Code object:\n\t * - High level: Take the payload data and call QrCode.encodeText() or QrCode.encodeBinary().\n\t * - Mid level: Custom-make the list of segments and call QrCode.encodeSegments().\n\t * - Low level: Custom-make the array of data codeword bytes (including\n\t * segment headers and final padding, excluding error correction codewords),\n\t * supply the appropriate version number, and call the QrCode() constructor.\n\t * (Note that all ways require supplying the desired error correction level.)\n\t */\n\texport class QrCode {\n\t\t\n\t\t/*-- Static factory functions (high level) --*/\n\t\t\n\t\t// Returns a QR Code representing the given Unicode text string at the given error correction level.\n\t\t// As a conservative upper bound, this function is guaranteed to succeed for strings that have 738 or fewer\n\t\t// Unicode code points (not UTF-16 code units) if the low error correction level is used. The smallest possible\n\t\t// QR Code version is automatically chosen for the output. The ECC level of the result may be higher than the\n\t\t// ecl argument if it can be done without increasing the version.\n\t\tpublic static encodeText(text: string, ecl: QrCode.Ecc): QrCode {\n\t\t\tconst segs: Array<QrSegment> = qrcodegen.QrSegment.makeSegments(text);\n\t\t\treturn QrCode.encodeSegments(segs, ecl);\n\t\t}\n\t\t\n\t\t\n\t\t// Returns a QR Code representing the given binary data at the given error correction level.\n\t\t// This function always encodes using the binary segment mode, not any text mode. The maximum number of\n\t\t// bytes allowed is 2953. The smallest possible QR Code version is automatically chosen for the output.\n\t\t// The ECC level of the result may be higher than the ecl argument if it can be done without increasing the version.\n\t\tpublic static encodeBinary(data: Readonly<Array<byte>>, ecl: QrCode.Ecc): QrCode {\n\t\t\tconst seg: QrSegment = qrcodegen.QrSegment.makeBytes(data);\n\t\t\treturn QrCode.encodeSegments([seg], ecl);\n\t\t}\n\t\t\n\t\t\n\t\t/*-- Static factory functions (mid level) --*/\n\t\t\n\t\t// Returns a QR Code representing the given segments with the given encoding parameters.\n\t\t// The smallest possible QR Code version within the given range is automatically\n\t\t// chosen for the output. Iff boostEcl is true, then the ECC level of the result\n\t\t// may be higher than the ecl argument if it can be done without increasing the\n\t\t// version. The mask number is either between 0 to 7 (inclusive) to force that\n\t\t// mask, or -1 to automatically choose an appropriate mask (which may be slow).\n\t\t// This function allows the user to create a custom sequence of segments that switches\n\t\t// between modes (such as alphanumeric and byte) to encode text in less space.\n\t\t// This is a mid-level API; the high-level API is encodeText() and encodeBinary().\n\t\tpublic static encodeSegments(segs: Readonly<Array<QrSegment>>, ecl: QrCode.Ecc,\n\t\t\t\tminVersion: int = 1, maxVersion: int = 40,\n\t\t\t\tmask: int = -1, boostEcl: boolean = true): QrCode {\n\t\t\t\n\t\t\tif (!(QrCode.MIN_VERSION <= minVersion && minVersion <= maxVersion && maxVersion <= QrCode.MAX_VERSION)\n\t\t\t\t\t|| mask < -1 || mask > 7)\n\t\t\t\tthrow new RangeError(\"Invalid value\");\n\t\t\t\n\t\t\t// Find the minimal version number to use\n\t\t\tlet version: int;\n\t\t\tlet dataUsedBits: int;\n\t\t\tfor (version = minVersion; ; version++) {\n\t\t\t\tconst dataCapacityBits: int = QrCode.getNumDataCodewords(version, ecl) * 8; // Number of data bits available\n\t\t\t\tconst usedBits: number = QrSegment.getTotalBits(segs, version);\n\t\t\t\tif (usedBits <= dataCapacityBits) {\n\t\t\t\t\tdataUsedBits = usedBits;\n\t\t\t\t\tbreak; // This version number is found to be suitable\n\t\t\t\t}\n\t\t\t\tif (version >= maxVersion) // All versions in the range could not fit the given data\n\t\t\t\t\tthrow new RangeError(\"Data too long\");\n\t\t\t}\n\t\t\t\n\t\t\t// Increase the error correction level while the data still fits in the current version number\n\t\t\tfor (const newEcl of [QrCode.Ecc.MEDIUM, QrCode.Ecc.QUARTILE, QrCode.Ecc.HIGH]) { // From low to high\n\t\t\t\tif (boostEcl && dataUsedBits <= QrCode.getNumDataCodewords(version, newEcl) * 8)\n\t\t\t\t\tecl = newEcl;\n\t\t\t}\n\t\t\t\n\t\t\t// Concatenate all segments to create the data bit string\n\t\t\tlet bb: Array<bit> = []\n\t\t\tfor (const seg of segs) {\n\t\t\t\tappendBits(seg.mode.modeBits, 4, bb);\n\t\t\t\tappendBits(seg.numChars, seg.mode.numCharCountBits(version), bb);\n\t\t\t\tfor (const b of seg.getData())\n\t\t\t\t\tbb.push(b);\n\t\t\t}\n\t\t\tassert(bb.length == dataUsedBits);\n\t\t\t\n\t\t\t// Add terminator and pad up to a byte if applicable\n\t\t\tconst dataCapacityBits: int = QrCode.getNumDataCodewords(version, ecl) * 8;\n\t\t\tassert(bb.length <= dataCapacityBits);\n\t\t\tappendBits(0, Math.min(4, dataCapacityBits - bb.length), bb);\n\t\t\tappendBits(0, (8 - bb.length % 8) % 8, bb);\n\t\t\tassert(bb.length % 8 == 0);\n\t\t\t\n\t\t\t// Pad with alternating bytes until data capacity is reached\n\t\t\tfor (let padByte = 0xEC; bb.length < dataCapacityBits; padByte ^= 0xEC ^ 0x11)\n\t\t\t\tappendBits(padByte, 8, bb);\n\t\t\t\n\t\t\t// Pack bits into bytes in big endian\n\t\t\tlet dataCodewords: Array<byte> = [];\n\t\t\twhile (dataCodewords.length * 8 < bb.length)\n\t\t\t\tdataCodewords.push(0);\n\t\t\tbb.forEach((b: bit, i: int) =>\n\t\t\t\tdataCodewords[i >>> 3] |= b << (7 - (i & 7)));\n\t\t\t\n\t\t\t// Create the QR Code object\n\t\t\treturn new QrCode(version, ecl, dataCodewords, mask);\n\t\t}\n\t\t\n\t\t\n\t\t/*-- Fields --*/\n\t\t\n\t\t// The width and height of this QR Code, measured in modules, between\n\t\t// 21 and 177 (inclusive). This is equal to version * 4 + 17.\n\t\tpublic readonly size: int;\n\t\t\n\t\t// The index of the mask pattern used in this QR Code, which is between 0 and 7 (inclusive).\n\t\t// Even if a QR Code is created with automatic masking requested (mask = -1),\n\t\t// the resulting object still has a mask value between 0 and 7.\n\t\tpublic readonly mask: int;\n\t\t\n\t\t// The modules of this QR Code (false = light, true = dark).\n\t\t// Immutable after constructor finishes. Accessed through getModule().\n\t\tprivate readonly modules : Array<Array<boolean>> = [];\n\t\t\n\t\t// Indicates function modules that are not subjected to masking. Discarded when constructor finishes.\n\t\tprivate readonly isFunction: Array<Array<boolean>> = [];\n\t\t\n\t\t\n\t\t/*-- Constructor (low level) and fields --*/\n\t\t\n\t\t// Creates a new QR Code with the given version number,\n\t\t// error correction level, data codeword bytes, and mask number.\n\t\t// This is a low-level API that most users should not use directly.\n\t\t// A mid-level API is the encodeSegments() function.\n\t\tpublic constructor(\n\t\t\t\t// The version number of this QR Code, which is between 1 and 40 (inclusive).\n\t\t\t\t// This determines the size of this barcode.\n\t\t\t\tpublic readonly version: int,\n\t\t\t\t\n\t\t\t\t// The error correction level used in this QR Code.\n\t\t\t\tpublic readonly errorCorrectionLevel: QrCode.Ecc,\n\t\t\t\t\n\t\t\t\tdataCodewords: Readonly<Array<byte>>,\n\t\t\t\t\n\t\t\t\tmsk: int) {\n\t\t\t\n\t\t\t// Check scalar arguments\n\t\t\tif (version < QrCode.MIN_VERSION || version > QrCode.MAX_VERSION)\n\t\t\t\tthrow new RangeError(\"Version value out of range\");\n\t\t\tif (msk < -1 || msk > 7)\n\t\t\t\tthrow new RangeError(\"Mask value out of range\");\n\t\t\tthis.size = version * 4 + 17;\n\t\t\t\n\t\t\t// Initialize both grids to be size*size arrays of Boolean false\n\t\t\tlet row: Array<boolean> = [];\n\t\t\tfor (let i = 0; i < this.size; i++)\n\t\t\t\trow.push(false);\n\t\t\tfor (let i = 0; i < this.size; i++) {\n\t\t\t\tthis.modules .push(row.slice()); // Initially all light\n\t\t\t\tthis.isFunction.push(row.slice());\n\t\t\t}\n\t\t\t\n\t\t\t// Compute ECC, draw modules\n\t\t\tthis.drawFunctionPatterns();\n\t\t\tconst allCodewords: Array<byte> = this.addEccAndInterleave(dataCodewords);\n\t\t\tthis.drawCodewords(allCodewords);\n\t\t\t\n\t\t\t// Do masking\n\t\t\tif (msk == -1) { // Automatically choose best mask\n\t\t\t\tlet minPenalty: int = 1000000000;\n\t\t\t\tfor (let i = 0; i < 8; i++) {\n\t\t\t\t\tthis.applyMask(i);\n\t\t\t\t\tthis.drawFormatBits(i);\n\t\t\t\t\tconst penalty: int = this.getPenaltyScore();\n\t\t\t\t\tif (penalty < minPenalty) {\n\t\t\t\t\t\tmsk = i;\n\t\t\t\t\t\tminPenalty = penalty;\n\t\t\t\t\t}\n\t\t\t\t\tthis.applyMask(i); // Undoes the mask due to XOR\n\t\t\t\t}\n\t\t\t}\n\t\t\tassert(0 <= msk && msk <= 7);\n\t\t\tthis.mask = msk;\n\t\t\tthis.applyMask(msk); // Apply the final choice of mask\n\t\t\tthis.drawFormatBits(msk); // Overwrite old format bits\n\t\t\t\n\t\t\tthis.isFunction = [];\n\t\t}\n\t\t\n\t\t\n\t\t/*-- Accessor methods --*/\n\t\t\n\t\t// Returns the color of the module (pixel) at the given coordinates, which is false\n\t\t// for light or true for dark. The top left corner has the coordinates (x=0, y=0).\n\t\t// If the given coordinates are out of bounds, then false (light) is returned.\n\t\tpublic getModule(x: int, y: int): boolean {\n\t\t\treturn 0 <= x && x < this.size && 0 <= y && y < this.size && this.modules[y][x];\n\t\t}\n\t\t\n\t\t\n\t\t/*-- Private helper methods for constructor: Drawing function modules --*/\n\t\t\n\t\t// Reads this object's version field, and draws and marks all function modules.\n\t\tprivate drawFunctionPatterns(): void {\n\t\t\t// Draw horizontal and vertical timing patterns\n\t\t\tfor (let i = 0; i < this.size; i++) {\n\t\t\t\tthis.setFunctionModule(6, i, i % 2 == 0);\n\t\t\t\tthis.setFunctionModule(i, 6, i % 2 == 0);\n\t\t\t}\n\t\t\t\n\t\t\t// Draw 3 finder patterns (all corners except bottom right; overwrites some timing modules)\n\t\t\tthis.drawFinderPattern(3, 3);\n\t\t\tthis.drawFinderPattern(this.size - 4, 3);\n\t\t\tthis.drawFinderPattern(3, this.size - 4);\n\t\t\t\n\t\t\t// Draw numerous alignment patterns\n\t\t\tconst alignPatPos: Array<int> = this.getAlignmentPatternPositions();\n\t\t\tconst numAlign: int = alignPatPos.length;\n\t\t\tfor (let i = 0; i < numAlign; i++) {\n\t\t\t\tfor (let j = 0; j < numAlign; j++) {\n\t\t\t\t\t// Don't draw on the three finder corners\n\t\t\t\t\tif (!(i == 0 && j == 0 || i == 0 && j == numAlign - 1 || i == numAlign - 1 && j == 0))\n\t\t\t\t\t\tthis.drawAlignmentPattern(alignPatPos[i], alignPatPos[j]);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t// Draw configuration data\n\t\t\tthis.drawFormatBits(0); // Dummy mask value; overwritten later in the constructor\n\t\t\tthis.drawVersion();\n\t\t}\n\t\t\n\t\t\n\t\t// Draws two copies of the format bits (with its own error correction code)\n\t\t// based on the given mask and this object's error correction level field.\n\t\tprivate drawFormatBits(mask: int): void {\n\t\t\t// Calculate error correction code and pack bits\n\t\t\tconst data: int = this.errorCorrectionLevel.formatBits << 3 | mask; // errCorrLvl is uint2, mask is uint3\n\t\t\tlet rem: int = data;\n\t\t\tfor (let i = 0; i < 10; i++)\n\t\t\t\trem = (rem << 1) ^ ((rem >>> 9) * 0x537);\n\t\t\tconst bits = (data << 10 | rem) ^ 0x5412; // uint15\n\t\t\tassert(bits >>> 15 == 0);\n\t\t\t\n\t\t\t// Draw first copy\n\t\t\tfor (let i = 0; i <= 5; i++)\n\t\t\t\tthis.setFunctionModule(8, i, getBit(bits, i));\n\t\t\tthis.setFunctionModule(8, 7, getBit(bits, 6));\n\t\t\tthis.setFunctionModule(8, 8, getBit(bits, 7));\n\t\t\tthis.setFunctionModule(7, 8, getBit(bits, 8));\n\t\t\tfor (let i = 9; i < 15; i++)\n\t\t\t\tthis.setFunctionModule(14 - i, 8, getBit(bits, i));\n\t\t\t\n\t\t\t// Draw second copy\n\t\t\tfor (let i = 0; i < 8; i++)\n\t\t\t\tthis.setFunctionModule(this.size - 1 - i, 8, getBit(bits, i));\n\t\t\tfor (let i = 8; i < 15; i++)\n\t\t\t\tthis.setFunctionModule(8, this.size - 15 + i, getBit(bits, i));\n\t\t\tthis.setFunctionModule(8, this.size - 8, true); // Always dark\n\t\t}\n\t\t\n\t\t\n\t\t// Draws two copies of the version bits (with its own error correction code),\n\t\t// based on this object's version field, iff 7 <= version <= 40.\n\t\tprivate drawVersion(): void {\n\t\t\tif (this.version < 7)\n\t\t\t\treturn;\n\t\t\t\n\t\t\t// Calculate error correction code and pack bits\n\t\t\tlet rem: int = this.version; // version is uint6, in the range [7, 40]\n\t\t\tfor (let i = 0; i < 12; i++)\n\t\t\t\trem = (rem << 1) ^ ((rem >>> 11) * 0x1F25);\n\t\t\tconst bits: int = this.version << 12 | rem; // uint18\n\t\t\tassert(bits >>> 18 == 0);\n\t\t\t\n\t\t\t// Draw two copies\n\t\t\tfor (let i = 0; i < 18; i++) {\n\t\t\t\tconst color: boolean = getBit(bits, i);\n\t\t\t\tconst a: int = this.size - 11 + i % 3;\n\t\t\t\tconst b: int = Math.floor(i / 3);\n\t\t\t\tthis.setFunctionModule(a, b, color);\n\t\t\t\tthis.setFunctionModule(b, a, color);\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t\t// Draws a 9*9 finder pattern including the border separator,\n\t\t// with the center module at (x, y). Modules can be out of bounds.\n\t\tprivate drawFinderPattern(x: int, y: int): void {\n\t\t\tfor (let dy = -4; dy <= 4; dy++) {\n\t\t\t\tfor (let dx = -4; dx <= 4; dx++) {\n\t\t\t\t\tconst dist: int = Math.max(Math.abs(dx), Math.abs(dy)); // Chebyshev/infinity norm\n\t\t\t\t\tconst xx: int = x + dx;\n\t\t\t\t\tconst yy: int = y + dy;\n\t\t\t\t\tif (0 <= xx && xx < this.size && 0 <= yy && yy < this.size)\n\t\t\t\t\t\tthis.setFunctionModule(xx, yy, dist != 2 && dist != 4);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t\t// Draws a 5*5 alignment pattern, with the center module\n\t\t// at (x, y). All modules must be in bounds.\n\t\tprivate drawAlignmentPattern(x: int, y: int): void {\n\t\t\tfor (let dy = -2; dy <= 2; dy++) {\n\t\t\t\tfor (let dx = -2; dx <= 2; dx++)\n\t\t\t\t\tthis.setFunctionModule(x + dx, y + dy, Math.max(Math.abs(dx), Math.abs(dy)) != 1);\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t\t// Sets the color of a module and marks it as a function module.\n\t\t// Only used by the constructor. Coordinates must be in bounds.\n\t\tprivate setFunctionModule(x: int, y: int, isDark: boolean): void {\n\t\t\tthis.modules[y][x] = isDark;\n\t\t\tthis.isFunction[y][x] = true;\n\t\t}\n\t\t\n\t\t\n\t\t/*-- Private helper methods for constructor: Codewords and masking --*/\n\t\t\n\t\t// Returns a new byte string representing the given data with the appropriate error correction\n\t\t// codewords appended to it, based on this object's version and error correction level.\n\t\tprivate addEccAndInterleave(data: Readonly<Array<byte>>): Array<byte> {\n\t\t\tconst ver: int = this.version;\n\t\t\tconst ecl: QrCode.Ecc = this.errorCorrectionLevel;\n\t\t\tif (data.length != QrCode.getNumDataCodewords(ver, ecl))\n\t\t\t\tthrow new RangeError(\"Invalid argument\");\n\t\t\t\n\t\t\t// Calculate parameter numbers\n\t\t\tconst numBlocks: int = QrCode.NUM_ERROR_CORRECTION_BLOCKS[ecl.ordinal][ver];\n\t\t\tconst blockEccLen: int = QrCode.ECC_CODEWORDS_PER_BLOCK [ecl.ordinal][ver];\n\t\t\tconst rawCodewords: int = Math.floor(QrCode.getNumRawDataModules(ver) / 8);\n\t\t\tconst numShortBlocks: int = numBlocks - rawCodewords % numBlocks;\n\t\t\tconst shortBlockLen: int = Math.floor(rawCodewords / numBlocks);\n\t\t\t\n\t\t\t// Split data into blocks and append ECC to each block\n\t\t\tlet blocks: Array<Array<byte>> = [];\n\t\t\tconst rsDiv: Array<byte> = QrCode.reedSolomonComputeDivisor(blockEccLen);\n\t\t\tfor (let i = 0, k = 0; i < numBlocks; i++) {\n\t\t\t\tlet dat: Array<byte> = data.slice(k, k + shortBlockLen - blockEccLen + (i < numShortBlocks ? 0 : 1));\n\t\t\t\tk += dat.length;\n\t\t\t\tconst ecc: Array<byte> = QrCode.reedSolomonComputeRemainder(dat, rsDiv);\n\t\t\t\tif (i < numShortBlocks)\n\t\t\t\t\tdat.push(0);\n\t\t\t\tblocks.push(dat.concat(ecc));\n\t\t\t}\n\t\t\t\n\t\t\t// Interleave (not concatenate) the bytes from every block into a single sequence\n\t\t\tlet result: Array<byte> = [];\n\t\t\tfor (let i = 0; i < blocks[0].length; i++) {\n\t\t\t\tblocks.forEach((block, j) => {\n\t\t\t\t\t// Skip the padding byte in short blocks\n\t\t\t\t\tif (i != shortBlockLen - blockEccLen || j >= numShortBlocks)\n\t\t\t\t\t\tresult.push(block[i]);\n\t\t\t\t});\n\t\t\t}\n\t\t\tassert(result.length == rawCodewords);\n\t\t\treturn result;\n\t\t}\n\t\t\n\t\t\n\t\t// Draws the given sequence of 8-bit codewords (data and error correction) onto the entire\n\t\t// data area of this QR Code. Function modules need to be marked off before this is called.\n\t\tprivate drawCodewords(data: Readonly<Array<byte>>): void {\n\t\t\tif (data.length != Math.floor(QrCode.getNumRawDataModules(this.version) / 8))\n\t\t\t\tthrow new RangeError(\"Invalid argument\");\n\t\t\tlet i: int = 0; // Bit index into the data\n\t\t\t// Do the funny zigzag scan\n\t\t\tfor (let right = this.size - 1; right >= 1; right -= 2) { // Index of right column in each column pair\n\t\t\t\tif (right == 6)\n\t\t\t\t\tright = 5;\n\t\t\t\tfor (let vert = 0; vert < this.size; vert++) { // Vertical counter\n\t\t\t\t\tfor (let j = 0; j < 2; j++) {\n\t\t\t\t\t\tconst x: int = right - j; // Actual x coordinate\n\t\t\t\t\t\tconst upward: boolean = ((right + 1) & 2) == 0;\n\t\t\t\t\t\tconst y: int = upward ? this.size - 1 - vert : vert; // Actual y coordinate\n\t\t\t\t\t\tif (!this.isFunction[y][x] && i < data.length * 8) {\n\t\t\t\t\t\t\tthis.modules[y][x] = getBit(data[i >>> 3], 7 - (i & 7));\n\t\t\t\t\t\t\ti++;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// If this QR Code has any remainder bits (0 to 7), they were assigned as\n\t\t\t\t\t\t// 0/false/light by the constructor and are left unchanged by this method\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tassert(i == data.length * 8);\n\t\t}\n\t\t\n\t\t\n\t\t// XORs the codeword modules in this QR Code with the given mask pattern.\n\t\t// The function modules must be marked and the codeword bits must be drawn\n\t\t// before masking. Due to the arithmetic of XOR, calling applyMask() with\n\t\t// the same mask value a second time will undo the mask. A final well-formed\n\t\t// QR Code needs exactly one (not zero, two, etc.) mask applied.\n\t\tprivate applyMask(mask: int): void {\n\t\t\tif (mask < 0 || mask > 7)\n\t\t\t\tthrow new RangeError(\"Mask value out of range\");\n\t\t\tfor (let y = 0; y < this.size; y++) {\n\t\t\t\tfor (let x = 0; x < this.size; x++) {\n\t\t\t\t\tlet invert: boolean;\n\t\t\t\t\tswitch (mask) {\n\t\t\t\t\t\tcase 0: invert = (x + y) % 2 == 0; break;\n\t\t\t\t\t\tcase 1: invert = y % 2 == 0; break;\n\t\t\t\t\t\tcase 2: invert = x % 3 == 0; break;\n\t\t\t\t\t\tcase 3: invert = (x + y) % 3 == 0; break;\n\t\t\t\t\t\tcase 4: invert = (Math.floor(x / 3) + Math.floor(y / 2)) % 2 == 0; break;\n\t\t\t\t\t\tcase 5: invert = x * y % 2 + x * y % 3 == 0; break;\n\t\t\t\t\t\tcase 6: invert = (x * y % 2 + x * y % 3) % 2 == 0; break;\n\t\t\t\t\t\tcase 7: invert = ((x + y) % 2 + x * y % 3) % 2 == 0; break;\n\t\t\t\t\t\tdefault: throw new Error(\"Unreachable\");\n\t\t\t\t\t}\n\t\t\t\t\tif (!this.isFunction[y][x] && invert)\n\t\t\t\t\t\tthis.modules[y][x] = !this.modules[y][x];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t\t// Calculates and returns the penalty score based on state of this QR Code's current modules.\n\t\t// This is used by the automatic mask choice algorithm to find the mask pattern that yields the lowest score.\n\t\tprivate getPenaltyScore(): int {\n\t\t\tlet result: int = 0;\n\t\t\t\n\t\t\t// Adjacent modules in row having same color, and finder-like patterns\n\t\t\tfor (let y = 0; y < this.size; y++) {\n\t\t\t\tlet runColor = false;\n\t\t\t\tlet runX = 0;\n\t\t\t\tlet runHistory = [0,0,0,0,0,0,0];\n\t\t\t\tfor (let x = 0; x < this.size; x++) {\n\t\t\t\t\tif (this.modules[y][x] == runColor) {\n\t\t\t\t\t\trunX++;\n\t\t\t\t\t\tif (runX == 5)\n\t\t\t\t\t\t\tresult += QrCode.PENALTY_N1;\n\t\t\t\t\t\telse if (runX > 5)\n\t\t\t\t\t\t\tresult++;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthis.finderPenaltyAddHistory(runX, runHistory);\n\t\t\t\t\t\tif (!runColor)\n\t\t\t\t\t\t\tresult += this.finderPenaltyCountPatterns(runHistory) * QrCode.PENALTY_N3;\n\t\t\t\t\t\trunColor = this.modules[y][x];\n\t\t\t\t\t\trunX = 1;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tresult += this.finderPenaltyTerminateAndCount(runColor, runX, runHistory) * QrCode.PENALTY_N3;\n\t\t\t}\n\t\t\t// Adjacent modules in column having same color, and finder-like patterns\n\t\t\tfor (let x = 0; x < this.size; x++) {\n\t\t\t\tlet runColor = false;\n\t\t\t\tlet runY = 0;\n\t\t\t\tlet runHistory = [0,0,0,0,0,0,0];\n\t\t\t\tfor (let y = 0; y < this.size; y++) {\n\t\t\t\t\tif (this.modules[y][x] == runColor) {\n\t\t\t\t\t\trunY++;\n\t\t\t\t\t\tif (runY == 5)\n\t\t\t\t\t\t\tresult += QrCode.PENALTY_N1;\n\t\t\t\t\t\telse if (runY > 5)\n\t\t\t\t\t\t\tresult++;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthis.finderPenaltyAddHistory(runY, runHistory);\n\t\t\t\t\t\tif (!runColor)\n\t\t\t\t\t\t\tresult += this.finderPenaltyCountPatterns(runHistory) * QrCode.PENALTY_N3;\n\t\t\t\t\t\trunColor = this.modules[y][x];\n\t\t\t\t\t\trunY = 1;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tresult += this.finderPenaltyTerminateAndCount(runColor, runY, runHistory) * QrCode.PENALTY_N3;\n\t\t\t}\n\t\t\t\n\t\t\t// 2*2 blocks of modules having same color\n\t\t\tfor (let y = 0; y < this.size - 1; y++) {\n\t\t\t\tfor (let x = 0; x < this.size - 1; x++) {\n\t\t\t\t\tconst color: boolean = this.modules[y][x];\n\t\t\t\t\tif ( color == this.modules[y][x + 1] &&\n\t\t\t\t\t color == this.modules[y + 1][x] &&\n\t\t\t\t\t color == this.modules[y + 1][x + 1])\n\t\t\t\t\t\tresult += QrCode.PENALTY_N2;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t// Balance of dark and light modules\n\t\t\tlet dark: int = 0;\n\t\t\tfor (const row of this.modules)\n\t\t\t\tdark = row.reduce((sum, color) => sum + (color ? 1 : 0), dark);\n\t\t\tconst total: int = this.size * this.size; // Note that size is odd, so dark/total != 1/2\n\t\t\t// Compute the smallest integer k >= 0 such that (45-5k)% <= dark/total <= (55+5k)%\n\t\t\tconst k: int = Math.ceil(Math.abs(dark * 20 - total * 10) / total) - 1;\n\t\t\tassert(0 <= k && k <= 9);\n\t\t\tresult += k * QrCode.PENALTY_N4;\n\t\t\tassert(0 <= result && result <= 2568888); // Non-tight upper bound based on default values of PENALTY_N1, ..., N4\n\t\t\treturn result;\n\t\t}\n\t\t\n\t\t\n\t\t/*-- Private helper functions --*/\n\t\t\n\t\t// Returns an ascending list of positions of alignment patterns for this version number.\n\t\t// Each position is in the range [0,177), and are used on both the x and y axes.\n\t\t// This could be implemented as lookup table of 40 variable-length lists of integers.\n\t\tprivate getAlignmentPatternPositions(): Array<int> {\n\t\t\tif (this.version == 1)\n\t\t\t\treturn [];\n\t\t\telse {\n\t\t\t\tconst numAlign: int = Math.floor(this.version / 7) + 2;\n\t\t\t\tconst step: int = Math.floor((this.version * 8 + numAlign * 3 + 5) / (numAlign * 4 - 4)) * 2;\n\t\t\t\tlet result: Array<int> = [6];\n\t\t\t\tfor (let pos = this.size - 7; result.length < numAlign; pos -= step)\n\t\t\t\t\tresult.splice(1, 0, pos);\n\t\t\t\treturn result;\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t\t// Returns the number of data bits that can be stored in a QR Code of the given version number, after\n\t\t// all function modules are excluded. This includes remainder bits, so it might not be a multiple of 8.\n\t\t// The result is in the range [208, 29648]. This could be implemented as a 40-entry lookup table.\n\t\tprivate static getNumRawDataModules(ver: int): int {\n\t\t\tif (ver < QrCode.MIN_VERSION || ver > QrCode.MAX_VERSION)\n\t\t\t\tthrow new RangeError(\"Version number out of range\");\n\t\t\tlet result: int = (16 * ver + 128) * ver + 64;\n\t\t\tif (ver >= 2) {\n\t\t\t\tconst numAlign: int = Math.floor(ver / 7) + 2;\n\t\t\t\tresult -= (25 * numAlign - 10) * numAlign - 55;\n\t\t\t\tif (ver >= 7)\n\t\t\t\t\tresult -= 36;\n\t\t\t}\n\t\t\tassert(208 <= result && result <= 29648);\n\t\t\treturn result;\n\t\t}\n\t\t\n\t\t\n\t\t// Returns the number of 8-bit data (i.e. not error correction) codewords contained in any\n\t\t// QR Code of the given version number and error correction level, with remainder bits discarded.\n\t\t// This stateless pure function could be implemented as a (40*4)-cell lookup table.\n\t\tprivate static getNumDataCodewords(ver: int, ecl: QrCode.Ecc): int {\n\t\t\treturn Math.floor(QrCode.getNumRawDataModules(ver) / 8) -\n\t\t\t\tQrCode.ECC_CODEWORDS_PER_BLOCK [ecl.ordinal][ver] *\n\t\t\t\tQrCode.NUM_ERROR_CORRECTION_BLOCKS[ecl.ordinal][ver];\n\t\t}\n\t\t\n\t\t\n\t\t// Returns a Reed-Solomon ECC generator polynomial for the given degree. This could be\n\t\t// implemented as a lookup table over all possible parameter values, instead of as an algorithm.\n\t\tprivate static reedSolomonComputeDivisor(degree: int): Array<byte> {\n\t\t\tif (degree < 1 || degree > 255)\n\t\t\t\tthrow new RangeError(\"Degree out of range\");\n\t\t\t// Polynomial coefficients are stored from highest to lowest power, excluding the leading term which is always 1.\n\t\t\t// For example the polynomial x^3 + 255x^2 + 8x + 93 is stored as the uint8 array [255, 8, 93].\n\t\t\tlet result: Array<byte> = [];\n\t\t\tfor (let i = 0; i < degree - 1; i++)\n\t\t\t\tresult.push(0);\n\t\t\tresult.push(1); // Start off with the monomial x^0\n\t\t\t\n\t\t\t// Compute the product polynomial (x - r^0) * (x - r^1) * (x - r^2) * ... * (x - r^{degree-1}),\n\t\t\t// and drop the highest monomial term which is always 1x^degree.\n\t\t\t// Note that r = 0x02, which is a generator element of this field GF(2^8/0x11D).\n\t\t\tlet root = 1;\n\t\t\tfor (let i = 0; i < degree; i++) {\n\t\t\t\t// Multiply the current product by (x - r^i)\n\t\t\t\tfor (let j = 0; j < result.length; j++) {\n\t\t\t\t\tresult[j] = QrCode.reedSolomonMultiply(result[j], root);\n\t\t\t\t\tif (j + 1 < result.length)\n\t\t\t\t\t\tresult[j] ^= result[j + 1];\n\t\t\t\t}\n\t\t\t\troot = QrCode.reedSolomonMultiply(root, 0x02);\n\t\t\t}\n\t\t\treturn result;\n\t\t}\n\t\t\n\t\t\n\t\t// Returns the Reed-Solomon error correction codeword for the given data and divisor polynomials.\n\t\tprivate static reedSolomonComputeRemainder(data: Readonly<Array<byte>>, divisor: Readonly<Array<byte>>): Array<byte> {\n\t\t\tlet result: Array<byte> = divisor.map(_ => 0);\n\t\t\tfor (const b of data) { // Polynomial division\n\t\t\t\tconst factor: byte = b ^ (result.shift() as byte);\n\t\t\t\tresult.push(0);\n\t\t\t\tdivisor.forEach((coef, i) =>\n\t\t\t\t\tresult[i] ^= QrCode.reedSolomonMultiply(coef, factor));\n\t\t\t}\n\t\t\treturn result;\n\t\t}\n\t\t\n\t\t\n\t\t// Returns the product of the two given field elements modulo GF(2^8/0x11D). The arguments and result\n\t\t// are unsigned 8-bit integers. This could be implemented as a lookup table of 256*256 entries of uint8.\n\t\tprivate static reedSolomonMultiply(x: byte, y: byte): byte {\n\t\t\tif (x >>> 8 != 0 || y >>> 8 != 0)\n\t\t\t\tthrow new RangeError(\"Byte out of range\");\n\t\t\t// Russian peasant multiplication\n\t\t\tlet z: int = 0;\n\t\t\tfor (let i = 7; i >= 0; i--) {\n\t\t\t\tz = (z << 1) ^ ((z >>> 7) * 0x11D);\n\t\t\t\tz ^= ((y >>> i) & 1) * x;\n\t\t\t}\n\t\t\tassert(z >>> 8 == 0);\n\t\t\treturn z as byte;\n\t\t}\n\t\t\n\t\t\n\t\t// Can only be called immediately after a light run is added, and\n\t\t// returns either 0, 1, or 2. A helper function for getPenaltyScore().\n\t\tprivate finderPenaltyCountPatterns(runHistory: Readonly<Array<int>>): int {\n\t\t\tconst n: int = runHistory[1];\n\t\t\tassert(n <= this.size * 3);\n\t\t\tconst core: boolean = n > 0 && runHistory[2] == n && runHistory[3] == n * 3 && runHistory[4] == n && runHistory[5] == n;\n\t\t\treturn (core && runHistory[0] >= n * 4 && runHistory[6] >= n ? 1 : 0)\n\t\t\t + (core && runHistory[6] >= n * 4 && runHistory[0] >= n ? 1 : 0);\n\t\t}\n\t\t\n\t\t\n\t\t// Must be called at the end of a line (row or column) of modules. A helper function for getPenaltyScore().\n\t\tprivate finderPenaltyTerminateAndCount(currentRunColor: boolean, currentRunLength: int, runHistory: Array<int>): int {\n\t\t\tif (currentRunColor) { // Terminate dark run\n\t\t\t\tthis.finderPenaltyAddHistory(currentRunLength, runHistory);\n\t\t\t\tcurrentRunLength = 0;\n\t\t\t}\n\t\t\tcurrentRunLength += this.size; // Add light border to final run\n\t\t\tthis.finderPenaltyAddHistory(currentRunLength, runHistory);\n\t\t\treturn this.finderPenaltyCountPatterns(runHistory);\n\t\t}\n\t\t\n\t\t\n\t\t// Pushes the given value to the front and drops the last value. A helper function for getPenaltyScore().\n\t\tprivate finderPenaltyAddHistory(currentRunLength: int, runHistory: Array<int>): void {\n\t\t\tif (runHistory[0] == 0)\n\t\t\t\tcurrentRunLength += this.size; // Add light border to initial run\n\t\t\trunHistory.pop();\n\t\t\trunHistory.unshift(currentRunLength);\n\t\t}\n\t\t\n\t\t\n\t\t/*-- Constants and tables --*/\n\t\t\n\t\t// The minimum version number supported in the QR Code Model 2 standard.\n\t\tpublic static readonly MIN_VERSION: int = 1;\n\t\t// The maximum version number supported in the QR Code Model 2 standard.\n\t\tpublic static readonly MAX_VERSION: int = 40;\n\t\t\n\t\t// For use in getPenaltyScore(), when evaluating which mask is best.\n\t\tprivate static readonly PENALTY_N1: int = 3;\n\t\tprivate static readonly PENALTY_N2: int = 3;\n\t\tprivate static readonly PENALTY_N3: int = 40;\n\t\tprivate static readonly PENALTY_N4: int = 10;\n\t\t\n\t\tprivate static readonly ECC_CODEWORDS_PER_BLOCK: Array<Array<int>> = [\n\t\t\t// Version: (note that index 0 is for padding, and is set to an illegal value)\n\t\t\t//0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40 Error correction level\n\t\t\t[-1, 7, 10, 15, 20, 26, 18, 20, 24, 30, 18, 20, 24, 26, 30, 22, 24, 28, 30, 28, 28, 28, 28, 30, 30, 26, 28, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30], // Low\n\t\t\t[-1, 10, 16, 26, 18, 24, 16, 18, 22, 22, 26, 30, 22, 22, 24, 24, 28, 28, 26, 26, 26, 26, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28], // Medium\n\t\t\t[-1, 13, 22, 18, 26, 18, 24, 18, 22, 20, 24, 28, 26, 24, 20, 30, 24, 28, 28, 26, 30, 28, 30, 30, 30, 30, 28, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30], // Quartile\n\t\t\t[-1, 17, 28, 22, 16, 22, 28, 26, 26, 24, 28, 24, 28, 22, 24, 24, 30, 28, 28, 26, 28, 30, 24, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30], // High\n\t\t];\n\t\t\n\t\tprivate static readonly NUM_ERROR_CORRECTION_BLOCKS: Array<Array<int>> = [\n\t\t\t// Version: (note that index 0 is for padding, and is set to an illegal value)\n\t\t\t//0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40 Error correction level\n\t\t\t[-1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 4, 4, 4, 4, 4, 6, 6, 6, 6, 7, 8, 8, 9, 9, 10, 12, 12, 12, 13, 14, 15, 16, 17, 18, 19, 19, 20, 21, 22, 24, 25], // Low\n\t\t\t[-1, 1, 1, 1, 2, 2, 4, 4, 4, 5, 5, 5, 8, 9, 9, 10, 10, 11, 13, 14, 16, 17, 17, 18, 20, 21, 23, 25, 26, 28, 29, 31, 33, 35, 37, 38, 40, 43, 45, 47, 49], // Medium\n\t\t\t[-1, 1, 1, 2, 2, 4, 4, 6, 6, 8, 8, 8, 10, 12, 16, 12, 17, 16, 18, 21, 20, 23, 23, 25, 27, 29, 34, 34, 35, 38, 40, 43, 45, 48, 51, 53, 56, 59, 62, 65, 68], // Quartile\n\t\t\t[-1, 1, 1, 2, 4, 4, 4, 5, 6, 8, 8, 11, 11, 16, 16, 18, 16, 19, 21, 25, 25, 25, 34, 30, 32, 35, 37, 40, 42, 45, 48, 51, 54, 57, 60, 63, 66, 70, 74, 77, 81], // High\n\t\t];\n\t\t\n\t}\n\t\n\t\n\t// Appends the given number of low-order bits of the given value\n\t// to the given buffer. Requires 0 <= len <= 31 and 0 <= val < 2^len.\n\tfunction appendBits(val: int, len: int, bb: Array<bit>): void {\n\t\tif (len < 0 || len > 31 || val >>> len != 0)\n\t\t\tthrow new RangeError(\"Value out of range\");\n\t\tfor (let i = len - 1; i >= 0; i--) // Append bit by bit\n\t\t\tbb.push((val >>> i) & 1);\n\t}\n\t\n\t\n\t// Returns true iff the i'th bit of x is set to 1.\n\tfunction getBit(x: int, i: int): boolean {\n\t\treturn ((x >>> i) & 1) != 0;\n\t}\n\t\n\t\n\t// Throws an exception if the given condition is false.\n\tfunction assert(cond: boolean): void {\n\t\tif (!cond)\n\t\t\tthrow new Error(\"Assertion error\");\n\t}\n\t\n\t\n\t\n\t/*---- Data segment class ----*/\n\t\n\t/* \n\t * A segment of character/binary/control data in a QR Code symbol.\n\t * Instances of this class are immutable.\n\t * The mid-level way to create a segment is to take the payload data\n\t * and call a static factory function such as QrSegment.makeNumeric().\n\t * The low-level way to create a segment is to custom-make the bit buffer\n\t * and call the QrSegment() constructor with appropriate values.\n\t * This segment class imposes no length restrictions, but QR Codes have restrictions.\n\t * Even in the most favorable conditions, a QR Code can only hold 7089 characters of data.\n\t * Any segment longer than this is meaningless for the purpose of generating QR Codes.\n\t */\n\texport class QrSegment {\n\t\t\n\t\t/*-- Static factory functions (mid level) --*/\n\t\t\n\t\t// Returns a segment representing the given binary data encoded in\n\t\t// byte mode. All input byte arrays are acceptable. Any text string\n\t\t// can be converted to UTF-8 bytes and encoded as a byte mode segment.\n\t\tpublic static makeBytes(data: Readonly<Array<byte>>): QrSegment {\n\t\t\tlet bb: Array<bit> = []\n\t\t\tfor (const b of data)\n\t\t\t\tappendBits(b, 8, bb);\n\t\t\treturn new QrSegment(QrSegment.Mode.BYTE, data.length, bb);\n\t\t}\n\t\t\n\t\t\n\t\t// Returns a segment representing the given string of decimal digits encoded in numeric mode.\n\t\tpublic static makeNumeric(digits: string): QrSegment {\n\t\t\tif (!QrSegment.isNumeric(digits))\n\t\t\t\tthrow new RangeError(\"String contains non-numeric characters\");\n\t\t\tlet bb: Array<bit> = []\n\t\t\tfor (let i = 0; i < digits.length; ) { // Consume up to 3 digits per iteration\n\t\t\t\tconst n: int = Math.min(digits.length - i, 3);\n\t\t\t\tappendBits(parseInt(digits.substring(i, i + n), 10), n * 3 + 1, bb);\n\t\t\t\ti += n;\n\t\t\t}\n\t\t\treturn new QrSegment(QrSegment.Mode.NUMERIC, digits.length, bb);\n\t\t}\n\t\t\n\t\t\n\t\t// Returns a segment representing the given text string encoded in alphanumeric mode.\n\t\t// The characters allowed are: 0 to 9, A to Z (uppercase only), space,\n\t\t// dollar, percent, asterisk, plus, hyphen, period, slash, colon.\n\t\tpublic static makeAlphanumeric(text: string): QrSegment {\n\t\t\tif (!QrSegment.isAlphanumeric(text))\n\t\t\t\tthrow new RangeError(\"String contains unencodable characters in alphanumeric mode\");\n\t\t\tlet bb: Array<bit> = []\n\t\t\tlet i: int;\n\t\t\tfor (i = 0; i + 2 <= text.length; i += 2) { // Process groups of 2\n\t\t\t\tlet temp: int = QrSegment.ALPHANUMERIC_CHARSET.indexOf(text.charAt(i)) * 45;\n\t\t\t\ttemp += QrSegment.ALPHANUMERIC_CHARSET.indexOf(text.charAt(i + 1));\n\t\t\t\tappendBits(temp, 11, bb);\n\t\t\t}\n\t\t\tif (i < text.length) // 1 character remaining\n\t\t\t\tappendBits(QrSegment.ALPHANUMERIC_CHARSET.indexOf(text.charAt(i)), 6, bb);\n\t\t\treturn new QrSegment(QrSegment.Mode.ALPHANUMERIC, text.length, bb);\n\t\t}\n\t\t\n\t\t\n\t\t// Returns a new mutable list of zero or more segments to represent the given Unicode text string.\n\t\t// The result may use various segment modes and switch modes to optimize the length of the bit stream.\n\t\tpublic static makeSegments(text: string): Array<QrSegment> {\n\t\t\t// Select the most efficient segment encoding automatically\n\t\t\tif (text == \"\")\n\t\t\t\treturn [];\n\t\t\telse if (QrSegment.isNumeric(text))\n\t\t\t\treturn [QrSegment.makeNumeric(text)];\n\t\t\telse if (QrSegment.isAlphanumeric(text))\n\t\t\t\treturn [QrSegment.makeAlphanumeric(text)];\n\t\t\telse\n\t\t\t\treturn [QrSegment.makeBytes(QrSegment.toUtf8ByteArray(text))];\n\t\t}\n\t\t\n\t\t\n\t\t// Returns a segment representing an Extended Channel Interpretation\n\t\t// (ECI) designator with the given assignment value.\n\t\tpublic static makeEci(assignVal: int): QrSegment {\n\t\t\tlet bb: Array<bit> = []\n\t\t\tif (assignVal < 0)\n\t\t\t\tthrow new RangeError(\"ECI assignment value out of range\");\n\t\t\telse if (assignVal < (1 << 7))\n\t\t\t\tappendBits(assignVal, 8, bb);\n\t\t\telse if (assignVal < (1 << 14)) {\n\t\t\t\tappendBits(0b10, 2, bb);\n\t\t\t\tappendBits(assignVal, 14, bb);\n\t\t\t} else if (assignVal < 1000000) {\n\t\t\t\tappendBits(0b110, 3, bb);\n\t\t\t\tappendBits(assignVal, 21, bb);\n\t\t\t} else\n\t\t\t\tthrow new RangeError(\"ECI assignment value out of range\");\n\t\t\treturn new QrSegment(QrSegment.Mode.ECI, 0, bb);\n\t\t}\n\t\t\n\t\t\n\t\t// Tests whether the given string can be encoded as a segment in numeric mode.\n\t\t// A string is encodable iff each character is in the range 0 to 9.\n\t\tpublic static isNumeric(text: string): boolean {\n\t\t\treturn QrSegment.NUMERIC_REGEX.test(text);\n\t\t}\n\t\t\n\t\t\n\t\t// Tests whether the given string can be encoded as a segment in alphanumeric mode.\n\t\t// A string is encodable iff each character is in the following set: 0 to 9, A to Z\n\t\t// (uppercase only), space, dollar, percent, asterisk, plus, hyphen, period, slash, colon.\n\t\tpublic static isAlphanumeric(text: string): boolean {\n\t\t\treturn QrSegment.ALPHANUMERIC_REGEX.test(text);\n\t\t}\n\t\t\n\t\t\n\t\t/*-- Constructor (low level) and fields --*/\n\t\t\n\t\t// Creates a new QR Code segment with the given attributes and data.\n\t\t// The character count (numChars) must agree with the mode and the bit buffer length,\n\t\t// but the constraint isn't checked. The given bit buffer is cloned and stored.\n\t\tpublic constructor(\n\t\t\t\t// The mode indicator of this segment.\n\t\t\t\tpublic readonly mode: QrSegment.Mode,\n\t\t\t\t\n\t\t\t\t// The length of this segment's unencoded data. Measured in characters for\n\t\t\t\t// numeric/alphanumeric/kanji mode, bytes for byte mode, and 0 for ECI mode.\n\t\t\t\t// Always zero or positive. Not the same as the data's bit length.\n\t\t\t\tpublic readonly numChars: int,\n\t\t\t\t\n\t\t\t\t// The data bits of this segment. Accessed through getData().\n\t\t\t\tprivate readonly bitData: Array<bit>) {\n\t\t\t\n\t\t\tif (numChars < 0)\n\t\t\t\tthrow new RangeError(\"Invalid argument\");\n\t\t\tthis.bitData = bitData.slice(); // Make defensive copy\n\t\t}\n\t\t\n\t\t\n\t\t/*-- Methods --*/\n\t\t\n\t\t// Returns a new copy of the data bits of this segment.\n\t\tpublic getData(): Array<bit> {\n\t\t\treturn this.bitData.slice(); // Make defensive copy\n\t\t}\n\t\t\n\t\t\n\t\t// (Package-private) Calculates and returns the number of bits needed to encode the given segments at\n\t\t// the given version. The result is infinity if a segment has too many characters to fit its length field.\n\t\tpublic static getTotalBits(segs: Readonly<Array<QrSegment>>, version: int): number {\n\t\t\tlet result: number = 0;\n\t\t\tfor (const seg of segs) {\n\t\t\t\tconst ccbits: int = seg.mode.numCharCountBits(version);\n\t\t\t\tif (seg.numChars >= (1 << ccbits))\n\t\t\t\t\treturn Infinity; // The segment's length doesn't fit the field's bit width\n\t\t\t\tresult += 4 + ccbits + seg.bitData.length;\n\t\t\t}\n\t\t\treturn result;\n\t\t}\n\t\t\n\t\t\n\t\t// Returns a new array of bytes representing the given string encoded in UTF-8.\n\t\tprivate static toUtf8ByteArray(str: string): Array<byte> {\n\t\t\tstr = encodeURI(str);\n\t\t\tlet result: Array<byte> = [];\n\t\t\tfor (let i = 0; i < str.length; i++) {\n\t\t\t\tif (str.charAt(i) != \"%\")\n\t\t\t\t\tresult.push(str.charCodeAt(i));\n\t\t\t\telse {\n\t\t\t\t\tresult.push(parseInt(str.substring(i + 1, i + 3), 16));\n\t\t\t\t\ti += 2;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn result;\n\t\t}\n\t\t\n\t\t\n\t\t/*-- Constants --*/\n\t\t\n\t\t// Describes precisely all strings that are encodable in numeric mode.\n\t\tprivate static readonly NUMERIC_REGEX: RegExp = /^[0-9]*$/;\n\t\t\n\t\t// Describes precisely all strings that are encodable in alphanumeric mode.\n\t\tprivate static readonly ALPHANUMERIC_REGEX: RegExp = /^[A-Z0-9 $%*+./:-]*$/;\n\t\t\n\t\t// The set of all legal characters in alphanumeric mode,\n\t\t// where each character value maps to the index in the string.\n\t\tprivate static readonly ALPHANUMERIC_CHARSET: string = \"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:\";\n\t\t\n\t}\n\t\n}\n\n\n\n/*---- Public helper enumeration ----*/\n\nnamespace qrcodegen.QrCode {\n\t\n\ttype int = number;\n\t\n\t\n\t/* \n\t * The error correction level in a QR Code symbol. Immutable.\n\t */\n\texport class Ecc {\n\t\t\n\t\t/*-- Constants --*/\n\t\t\n\t\tpublic static readonly LOW = new Ecc(0, 1); // The QR Code can tolerate about 7% erroneous codewords\n\t\tpublic static readonly MEDIUM = new Ecc(1, 0); // The QR Code can tolerate about 15% erroneous codewords\n\t\tpublic static readonly QUARTILE = new Ecc(2, 3); // The QR Code can tolerate about 25% erroneous codewords\n\t\tpublic static readonly HIGH = new Ecc(3, 2); // The QR Code can tolerate about 30% erroneous codewords\n\t\t\n\t\t\n\t\t/*-- Constructor and fields --*/\n\t\t\n\t\tprivate constructor(\n\t\t\t// In the range 0 to 3 (unsigned 2-bit integer).\n\t\t\tpublic readonly ordinal: int,\n\t\t\t// (Package-private) In the range 0 to 3 (unsigned 2-bit integer).\n\t\t\tpublic readonly formatBits: int) {}\n\t\t\n\t}\n}\n\n\n\n/*---- Public helper enumeration ----*/\n\nnamespace qrcodegen.QrSegment {\n\t\n\ttype int = number;\n\t\n\t\n\t/* \n\t * Describes how a segment's data bits are interpreted. Immutable.\n\t */\n\texport class Mode {\n\t\t\n\t\t/*-- Constants --*/\n\t\t\n\t\tpublic static readonly NUMERIC = new Mode(0x1, [10, 12, 14]);\n\t\tpublic static readonly ALPHANUMERIC = new Mode(0x2, [ 9, 11, 13]);\n\t\tpublic static readonly BYTE = new Mode(0x4, [ 8, 16, 16]);\n\t\tpublic static readonly KANJI = new Mode(0x8, [ 8, 10, 12]);\n\t\tpublic static readonly ECI = new Mode(0x7, [ 0, 0, 0]);\n\t\t\n\t\t\n\t\t/*-- Constructor and fields --*/\n\t\t\n\t\tprivate constructor(\n\t\t\t// The mode indicator bits, which is a uint4 value (range 0 to 15).\n\t\t\tpublic readonly modeBits: int,\n\t\t\t// Number of character count bits for three different version ranges.\n\t\t\tprivate readonly numBitsCharCount: [int,int,int]) {}\n\t\t\n\t\t\n\t\t/*-- Method --*/\n\t\t\n\t\t// (Package-private) Returns the bit width of the character count field for a segment in\n\t\t// this mode in a QR Code at the given version number. The result is in the range [0, 16].\n\t\tpublic numCharCountBits(ver: int): int {\n\t\t\treturn this.numBitsCharCount[Math.floor((ver + 7) / 17)];\n\t\t}\n\t\t\n\t}\n}\n\nexport default qrcodegen;\n","import rawQrcodegen from './qrcodegen'\n\nimport type { QRCodeErrorLevel, QRCodeIconSize } from '.'\n\nconst qrcodegen = rawQrcodegen\n\nexport interface QRCodeIconLayout {\n x: number\n y: number\n width: number\n height: number\n excavation: {\n x: number\n y: number\n width: number\n height: number\n }\n}\n\nexport interface QRCodeRenderData {\n modules: boolean[][]\n margin: number\n numCells: number\n path: string\n iconLayout?: QRCodeIconLayout\n}\n\nconst ERROR_LEVEL_MAP = {\n L: qrcodegen.QrCode.Ecc.LOW,\n M: qrcodegen.QrCode.Ecc.MEDIUM,\n Q: qrcodegen.QrCode.Ecc.QUARTILE,\n H: qrcodegen.QrCode.Ecc.HIGH\n}\n\n/** createQRCodeModules 使用本地 Nayuki QR 编码器生成模块矩阵。 */\nexport function createQRCodeModules(value: string, errorLevel: QRCodeErrorLevel, boostLevel: boolean) {\n const segments = qrcodegen.QrSegment.makeSegments(value)\n const code = qrcodegen.QrCode.encodeSegments(segments, ERROR_LEVEL_MAP[errorLevel], 1, 40, -1, boostLevel)\n return Array.from({ length: code.size }, (_, y) => Array.from({ length: code.size }, (_, x) => code.getModule(x, y)))\n}\n\n/** resolveQRCodeMargin 将 marginSize 归一成二维码模块单位留白。 */\nexport function resolveQRCodeMargin(marginSize?: number) {\n if (Number.isFinite(marginSize)) return Math.max(0, Math.floor(Number(marginSize)))\n return 0\n}\n\n/** generateQRCodePath 把连续黑色模块合并成 SVG/Path2D 路径,减少节点和绘制次数。 */\nexport function generateQRCodePath(modules: boolean[][], margin = 0) {\n const commands: string[] = []\n\n modules.forEach((row, y) => {\n let x = 0\n while (x < row.length) {\n if (!row[x]) {\n x += 1\n continue\n }\n\n const start = x\n while (x < row.length && row[x]) x += 1\n commands.push(`M${start + margin} ${y + margin}h${x - start}v1H${start + margin}z`)\n }\n })\n\n return commands.join('')\n}\n\n/** resolveIconSize 根据组件尺寸推导默认 logo 尺寸,并兼容数字和对象配置。 */\nexport function resolveIconSize(iconSize: QRCodeIconSize | undefined, size: number) {\n if (typeof iconSize === 'object') {\n return {\n width: Math.max(0, iconSize.width),\n height: Math.max(0, iconSize.height)\n }\n }\n\n if (Number.isFinite(iconSize)) {\n const value = Math.max(0, Number(iconSize))\n return { width: value, height: value }\n }\n\n const fallback = Math.max(16, Math.round(size * 0.25))\n return { width: fallback, height: fallback }\n}\n\n/** getIconLayout 将像素尺寸换算为 QR 模块坐标,并给 logo 预留白底区域。 */\nexport function getIconLayout(modules: boolean[][], size: number, margin: number, iconSize: QRCodeIconSize | undefined): QRCodeIconLayout {\n const resolvedSize = resolveIconSize(iconSize, size)\n const scale = (modules.length + margin * 2) / size\n const width = resolvedSize.width * scale\n const height = resolvedSize.height * scale\n const x = modules.length / 2 - width / 2\n const y = modules.length / 2 - height / 2\n const floorX = Math.floor(x)\n const floorY = Math.floor(y)\n\n return {\n x,\n y,\n width,\n height,\n excavation: {\n x: floorX,\n y: floorY,\n width: Math.ceil(width + x - floorX),\n height: Math.ceil(height + y - floorY)\n }\n }\n}\n\n/** excavateQRCodeModules 清空 logo 覆盖区域,避免二维码黑块压住中心图标。 */\nexport function excavateQRCodeModules(modules: boolean[][], layout: QRCodeIconLayout) {\n const { excavation } = layout\n return modules.map((row, y) => {\n if (y < excavation.y || y >= excavation.y + excavation.height) return row\n return row.map((cell, x) => {\n if (x < excavation.x || x >= excavation.x + excavation.width) return cell\n return false\n })\n })\n}\n\n/** createQRCodeRenderData 汇总二维码矩阵、留白、路径和可选 logo 布局。 */\nexport function createQRCodeRenderData(options: {\n value: string\n errorLevel: QRCodeErrorLevel\n boostLevel: boolean\n marginSize?: number\n size: number\n icon?: string\n iconSize?: QRCodeIconSize\n}) {\n const rawModules = createQRCodeModules(options.value, options.errorLevel, options.boostLevel)\n const margin = resolveQRCodeMargin(options.marginSize)\n const iconLayout = options.icon ? getIconLayout(rawModules, options.size, margin, options.iconSize) : undefined\n const modules = iconLayout ? excavateQRCodeModules(rawModules, iconLayout) : rawModules\n\n return {\n modules,\n margin,\n numCells: modules.length + margin * 2,\n path: generateQRCodePath(modules, margin),\n iconLayout\n }\n}\n","<script setup lang=\"ts\">\nimport { clsx } from 'clsx'\nimport { computed, defineComponent, nextTick, onMounted, ref, watch } from 'vue'\nimport type { CSSProperties, PropType } from 'vue'\n\nimport {\n qrcodeCode,\n qrcodeMask,\n qrcodeRefreshButton,\n qrcodeRoot,\n qrcodeStatus,\n qrcodeStatusIcon,\n type QRCodeErrorLevel,\n type QRCodeIconSize,\n type QRCodeMaskStatus,\n type QRCodeSemanticClassNames,\n type QRCodeSemanticStyles,\n type QRCodeStatus,\n type QRCodeStatusLocale,\n type QRCodeStatusRender,\n type QRCodeStatusRenderInfo,\n type QRCodeType\n} from '.'\nimport { createQRCodeRenderData } from './qr'\n\nconst QRCodeStatusRenderBridge = defineComponent({\n name: 'QRCodeStatusRenderBridge',\n props: {\n render: {\n type: Function as PropType<QRCodeStatusRender>,\n required: true\n },\n info: {\n type: Object as PropType<QRCodeStatusRenderInfo>,\n required: true\n }\n },\n setup(props) {\n return () => props.render(props.info)\n }\n})\n\nconst props = withDefaults(\n defineProps<{\n /** value 是二维码编码内容。 */\n value: string\n /** type 指定渲染为 canvas 或 svg。 */\n type?: QRCodeType\n /** size 是二维码外框尺寸,单位 px。 */\n size?: number\n /** color 是二维码前景色。 */\n color?: string\n /** bgColor 是二维码背景色。 */\n bgColor?: string\n /** icon 是二维码中间的 logo 图片地址。 */\n icon?: string\n /** iconSize 是 logo 尺寸,可传数字或宽高对象。 */\n iconSize?: QRCodeIconSize\n /** status 控制二维码状态蒙层。 */\n status?: QRCodeStatus\n /** bordered 控制是否展示边框和内边距。 */\n bordered?: boolean\n /** errorLevel 是二维码纠错等级。 */\n errorLevel?: QRCodeErrorLevel\n /** marginSize 是二维码安静区宽度,单位为模块格。 */\n marginSize?: number\n /** boostLevel 控制编码器是否在不增加版本的情况下提升纠错等级。 */\n boostLevel?: boolean\n /** title 是 svg title 或 canvas 无障碍名称。 */\n title?: string\n /** expiredText 是过期状态文案。 */\n expiredText?: string\n /** refreshText 是过期状态刷新按钮文案。 */\n refreshText?: string\n /** scannedText 是已扫描状态文案。 */\n scannedText?: string\n /** loadingText 是加载状态文案。 */\n loadingText?: string\n /** statusRender 自定义状态蒙层内容。 */\n statusRender?: QRCodeStatusRender\n /** classNames 定义 root/code/mask/status/refresh 语义结构类名。 */\n classNames?: QRCodeSemanticClassNames\n /** styles 定义 root/code/mask/status/refresh 语义结构样式。 */\n styles?: QRCodeSemanticStyles\n }>(),\n {\n type: 'canvas',\n size: 160,\n color: '#111827',\n bgColor: '#ffffff',\n icon: '',\n iconSize: undefined,\n status: 'active',\n bordered: true,\n errorLevel: 'M',\n marginSize: undefined,\n boostLevel: true,\n title: undefined,\n expiredText: '二维码已过期',\n refreshText: '刷新',\n scannedText: '已扫描',\n loadingText: '加载中',\n statusRender: undefined,\n classNames: undefined,\n styles: undefined\n }\n)\n\nconst emit = defineEmits<{\n (e: 'refresh', event?: MouseEvent): void\n}>()\n\nconst canvasRef = ref<HTMLCanvasElement | null>(null)\nconst svgRef = ref<SVGSVGElement | null>(null)\nconst imageRef = ref<HTMLImageElement | null>(null)\nconst imageLoaded = ref(false)\n\nconst rootSize = computed(() => Math.max(32, Math.floor(props.size)))\nconst codeSize = computed(() => Math.max(24, rootSize.value - (props.bordered ? 18 : 0)))\nconst rootClass = computed(() => clsx(qrcodeRoot({ bordered: props.bordered }), props.classNames?.root))\nconst codeClass = computed(() => clsx(qrcodeCode(), props.classNames?.code))\nconst maskClass = computed(() => clsx(qrcodeMask(), props.classNames?.mask))\nconst statusClass = computed(() => clsx(qrcodeStatus(), props.classNames?.status))\nconst refreshClass = computed(() => clsx(qrcodeRefreshButton(), props.classNames?.refresh))\nconst maskStatus = computed<QRCodeMaskStatus | undefined>(() => (props.status === 'active' ? undefined : props.status))\nconst shouldUseIcon = computed(() => !!props.icon && (props.type === 'svg' || imageLoaded.value))\nconst renderData = computed(() =>\n createQRCodeRenderData({\n value: props.value,\n errorLevel: props.errorLevel,\n boostLevel: props.boostLevel,\n marginSize: props.marginSize,\n size: codeSize.value,\n icon: shouldUseIcon.value ? props.icon : '',\n iconSize: props.iconSize\n })\n)\n\nconst locale = computed<QRCodeStatusLocale>(() => ({\n expired: props.expiredText,\n refresh: props.refreshText,\n scanned: props.scannedText,\n loading: props.loadingText\n}))\nconst statusInfo = computed<QRCodeStatusRenderInfo>(() => ({\n status: maskStatus.value ?? 'loading',\n locale: locale.value,\n onRefresh: handleRefresh\n}))\nconst rootStyle = computed<CSSProperties>(() => ({\n width: `${rootSize.value}px`,\n height: `${rootSize.value}px`,\n backgroundColor: props.bordered ? props.bgColor : undefined\n}))\nconst codeStyle = computed<CSSProperties>(() => ({\n width: `${codeSize.value}px`,\n height: `${codeSize.value}px`\n}))\nconst ariaLabel = computed(() => props.title || (props.value ? `二维码:${props.value}` : '二维码'))\nconst iconHref = computed(() => props.icon || undefined)\n\nconst normalizeStyle = (value: CSSProperties | string | undefined) => value\n\nfunction handleRefresh(event?: MouseEvent) {\n emit('refresh', event)\n}\n\nfunction handleIconLoad() {\n imageLoaded.value = true\n}\n\nfunction handleIconError() {\n imageLoaded.value = false\n}\n\n/** drawCanvas 根据当前矩阵和设备像素比绘制高清 canvas 二维码。 */\nfunction drawCanvas() {\n if (props.type !== 'canvas') return\n const canvas = canvasRef.value\n if (!canvas) return\n\n let context: CanvasRenderingContext2D | null = null\n try {\n context = canvas.getContext('2d')\n } catch {\n return\n }\n if (!context) return\n\n const data = renderData.value\n const pixelRatio = window.devicePixelRatio || 1\n const size = codeSize.value\n const scale = size / data.numCells\n\n canvas.width = Math.floor(size * pixelRatio)\n canvas.height = Math.floor(size * pixelRatio)\n context.setTransform(pixelRatio * scale, 0, 0, pixelRatio * scale, 0, 0)\n context.fillStyle = props.bgColor\n context.fillRect(0, 0, data.numCells, data.numCells)\n context.fillStyle = props.color\n\n if (typeof Path2D !== 'undefined') {\n context.fill(new Path2D(data.path))\n } else {\n data.modules.forEach((row: boolean[], y: number) => {\n row.forEach((cell: boolean, x: number) => {\n if (cell) context?.fillRect(x + data.margin, y + data.margin, 1, 1)\n })\n })\n }\n\n if (data.iconLayout && imageRef.value?.complete && imageRef.value.naturalWidth > 0 && imageRef.value.naturalHeight > 0) {\n context.drawImage(imageRef.value, data.iconLayout.x + data.margin, data.iconLayout.y + data.margin, data.iconLayout.width, data.iconLayout.height)\n }\n}\n\nfunction toDataURL(type = 'image/png', quality?: number) {\n if (props.type === 'canvas') return canvasRef.value?.toDataURL(type, quality)\n if (!svgRef.value) return undefined\n const source = new XMLSerializer().serializeToString(svgRef.value)\n return `data:image/svg+xml;charset=utf-8,${encodeURIComponent(source)}`\n}\n\nwatch(\n () => [props.type, props.value, props.color, props.bgColor, props.errorLevel, props.marginSize, props.boostLevel, props.icon, props.iconSize, codeSize.value, imageLoaded.value],\n () => nextTick(drawCanvas),\n { immediate: true, deep: true }\n)\n\nonMounted(drawCanvas)\n\ndefineExpose({\n toDataURL\n})\n</script>\n\n<template>\n <div data-ui-qrcode=\"true\" :data-status=\"status\" :class=\"rootClass\" :style=\"[rootStyle, normalizeStyle(styles?.root)]\">\n <canvas v-if=\"type === 'canvas'\" ref=\"canvasRef\" data-ui-qrcode-code=\"true\" role=\"img\" :aria-label=\"ariaLabel\" :class=\"codeClass\" :style=\"[codeStyle, normalizeStyle(styles?.code)]\"></canvas>\n\n <svg v-else ref=\"svgRef\" data-ui-qrcode-code=\"true\" role=\"img\" :aria-label=\"ariaLabel\" :width=\"codeSize\" :height=\"codeSize\" :viewBox=\"`0 0 ${renderData.numCells} ${renderData.numCells}`\" :class=\"codeClass\" :style=\"[codeStyle, normalizeStyle(styles?.code)]\">\n <title v-if=\"title\">{{ title }}</title>\n <path :fill=\"bgColor\" :d=\"`M0 0h${renderData.numCells}v${renderData.numCells}H0z`\" shape-rendering=\"crispEdges\"></path>\n <path :fill=\"color\" :d=\"renderData.path\" shape-rendering=\"crispEdges\"></path>\n <image v-if=\"renderData.iconLayout && iconHref\" :href=\"iconHref\" :x=\"renderData.iconLayout.x + renderData.margin\" :y=\"renderData.iconLayout.y + renderData.margin\" :width=\"renderData.iconLayout.width\" :height=\"renderData.iconLayout.height\" preserveAspectRatio=\"xMidYMid meet\"></image>\n </svg>\n\n <img v-if=\"type === 'canvas' && icon\" ref=\"imageRef\" :src=\"icon\" alt=\"\" class=\"hidden\" @load=\"handleIconLoad\" @error=\"handleIconError\" />\n\n <div v-if=\"maskStatus\" data-ui-qrcode-mask=\"true\" :class=\"maskClass\" :style=\"normalizeStyle(styles?.mask)\">\n <slot v-if=\"$slots.status\" name=\"status\" v-bind=\"statusInfo\"></slot>\n <QRCodeStatusRenderBridge v-else-if=\"statusRender\" :render=\"statusRender\" :info=\"statusInfo\" />\n <div v-else data-ui-qrcode-status=\"true\" :class=\"statusClass\" :style=\"normalizeStyle(styles?.status)\">\n <span v-if=\"maskStatus === 'loading'\" :class=\"qrcodeStatusIcon({ status: 'loading' })\" aria-hidden=\"true\">\n <span class=\"i-lucide:loader-2 animate-spin\"></span>\n </span>\n <span v-else-if=\"maskStatus === 'expired'\" :class=\"qrcodeStatusIcon({ status: 'expired' })\" aria-hidden=\"true\">\n <span class=\"i-lucide:circle-alert\"></span>\n </span>\n <span v-else :class=\"qrcodeStatusIcon({ status: 'scanned' })\" aria-hidden=\"true\">\n <span class=\"i-lucide:circle-check\"></span>\n </span>\n\n <span>{{ maskStatus === 'loading' ? locale.loading : maskStatus === 'expired' ? locale.expired : locale.scanned }}</span>\n\n <button v-if=\"maskStatus === 'expired'\" type=\"button\" data-ui-qrcode-refresh=\"true\" :class=\"refreshClass\" :style=\"normalizeStyle(styles?.refresh)\" @click=\"handleRefresh\">\n <span class=\"i-lucide:rotate-cw size-3.5\" aria-hidden=\"true\"></span>\n <span>{{ locale.refresh }}</span>\n </button>\n </div>\n </div>\n </div>\n</template>\n","<script setup lang=\"ts\">\nimport { clsx } from 'clsx'\nimport { computed, defineComponent, nextTick, onMounted, ref, watch } from 'vue'\nimport type { CSSProperties, PropType } from 'vue'\n\nimport {\n qrcodeCode,\n qrcodeMask,\n qrcodeRefreshButton,\n qrcodeRoot,\n qrcodeStatus,\n qrcodeStatusIcon,\n type QRCodeErrorLevel,\n type QRCodeIconSize,\n type QRCodeMaskStatus,\n type QRCodeSemanticClassNames,\n type QRCodeSemanticStyles,\n type QRCodeStatus,\n type QRCodeStatusLocale,\n type QRCodeStatusRender,\n type QRCodeStatusRenderInfo,\n type QRCodeType\n} from '.'\nimport { createQRCodeRenderData } from './qr'\n\nconst QRCodeStatusRenderBridge = defineComponent({\n name: 'QRCodeStatusRenderBridge',\n props: {\n render: {\n type: Function as PropType<QRCodeStatusRender>,\n required: true\n },\n info: {\n type: Object as PropType<QRCodeStatusRenderInfo>,\n required: true\n }\n },\n setup(props) {\n return () => props.render(props.info)\n }\n})\n\nconst props = withDefaults(\n defineProps<{\n /** value 是二维码编码内容。 */\n value: string\n /** type 指定渲染为 canvas 或 svg。 */\n type?: QRCodeType\n /** size 是二维码外框尺寸,单位 px。 */\n size?: number\n /** color 是二维码前景色。 */\n color?: string\n /** bgColor 是二维码背景色。 */\n bgColor?: string\n /** icon 是二维码中间的 logo 图片地址。 */\n icon?: string\n /** iconSize 是 logo 尺寸,可传数字或宽高对象。 */\n iconSize?: QRCodeIconSize\n /** status 控制二维码状态蒙层。 */\n status?: QRCodeStatus\n /** bordered 控制是否展示边框和内边距。 */\n bordered?: boolean\n /** errorLevel 是二维码纠错等级。 */\n errorLevel?: QRCodeErrorLevel\n /** marginSize 是二维码安静区宽度,单位为模块格。 */\n marginSize?: number\n /** boostLevel 控制编码器是否在不增加版本的情况下提升纠错等级。 */\n boostLevel?: boolean\n /** title 是 svg title 或 canvas 无障碍名称。 */\n title?: string\n /** expiredText 是过期状态文案。 */\n expiredText?: string\n /** refreshText 是过期状态刷新按钮文案。 */\n refreshText?: string\n /** scannedText 是已扫描状态文案。 */\n scannedText?: string\n /** loadingText 是加载状态文案。 */\n loadingText?: string\n /** statusRender 自定义状态蒙层内容。 */\n statusRender?: QRCodeStatusRender\n /** classNames 定义 root/code/mask/status/refresh 语义结构类名。 */\n classNames?: QRCodeSemanticClassNames\n /** styles 定义 root/code/mask/status/refresh 语义结构样式。 */\n styles?: QRCodeSemanticStyles\n }>(),\n {\n type: 'canvas',\n size: 160,\n color: '#111827',\n bgColor: '#ffffff',\n icon: '',\n iconSize: undefined,\n status: 'active',\n bordered: true,\n errorLevel: 'M',\n marginSize: undefined,\n boostLevel: true,\n title: undefined,\n expiredText: '二维码已过期',\n refreshText: '刷新',\n scannedText: '已扫描',\n loadingText: '加载中',\n statusRender: undefined,\n classNames: undefined,\n styles: undefined\n }\n)\n\nconst emit = defineEmits<{\n (e: 'refresh', event?: MouseEvent): void\n}>()\n\nconst canvasRef = ref<HTMLCanvasElement | null>(null)\nconst svgRef = ref<SVGSVGElement | null>(null)\nconst imageRef = ref<HTMLImageElement | null>(null)\nconst imageLoaded = ref(false)\n\nconst rootSize = computed(() => Math.max(32, Math.floor(props.size)))\nconst codeSize = computed(() => Math.max(24, rootSize.value - (props.bordered ? 18 : 0)))\nconst rootClass = computed(() => clsx(qrcodeRoot({ bordered: props.bordered }), props.classNames?.root))\nconst codeClass = computed(() => clsx(qrcodeCode(), props.classNames?.code))\nconst maskClass = computed(() => clsx(qrcodeMask(), props.classNames?.mask))\nconst statusClass = computed(() => clsx(qrcodeStatus(), props.classNames?.status))\nconst refreshClass = computed(() => clsx(qrcodeRefreshButton(), props.classNames?.refresh))\nconst maskStatus = computed<QRCodeMaskStatus | undefined>(() => (props.status === 'active' ? undefined : props.status))\nconst shouldUseIcon = computed(() => !!props.icon && (props.type === 'svg' || imageLoaded.value))\nconst renderData = computed(() =>\n createQRCodeRenderData({\n value: props.value,\n errorLevel: props.errorLevel,\n boostLevel: props.boostLevel,\n marginSize: props.marginSize,\n size: codeSize.value,\n icon: shouldUseIcon.value ? props.icon : '',\n iconSize: props.iconSize\n })\n)\n\nconst locale = computed<QRCodeStatusLocale>(() => ({\n expired: props.expiredText,\n refresh: props.refreshText,\n scanned: props.scannedText,\n loading: props.loadingText\n}))\nconst statusInfo = computed<QRCodeStatusRenderInfo>(() => ({\n status: maskStatus.value ?? 'loading',\n locale: locale.value,\n onRefresh: handleRefresh\n}))\nconst rootStyle = computed<CSSProperties>(() => ({\n width: `${rootSize.value}px`,\n height: `${rootSize.value}px`,\n backgroundColor: props.bordered ? props.bgColor : undefined\n}))\nconst codeStyle = computed<CSSProperties>(() => ({\n width: `${codeSize.value}px`,\n height: `${codeSize.value}px`\n}))\nconst ariaLabel = computed(() => props.title || (props.value ? `二维码:${props.value}` : '二维码'))\nconst iconHref = computed(() => props.icon || undefined)\n\nconst normalizeStyle = (value: CSSProperties | string | undefined) => value\n\nfunction handleRefresh(event?: MouseEvent) {\n emit('refresh', event)\n}\n\nfunction handleIconLoad() {\n imageLoaded.value = true\n}\n\nfunction handleIconError() {\n imageLoaded.value = false\n}\n\n/** drawCanvas 根据当前矩阵和设备像素比绘制高清 canvas 二维码。 */\nfunction drawCanvas() {\n if (props.type !== 'canvas') return\n const canvas = canvasRef.value\n if (!canvas) return\n\n let context: CanvasRenderingContext2D | null = null\n try {\n context = canvas.getContext('2d')\n } catch {\n return\n }\n if (!context) return\n\n const data = renderData.value\n const pixelRatio = window.devicePixelRatio || 1\n const size = codeSize.value\n const scale = size / data.numCells\n\n canvas.width = Math.floor(size * pixelRatio)\n canvas.height = Math.floor(size * pixelRatio)\n context.setTransform(pixelRatio * scale, 0, 0, pixelRatio * scale, 0, 0)\n context.fillStyle = props.bgColor\n context.fillRect(0, 0, data.numCells, data.numCells)\n context.fillStyle = props.color\n\n if (typeof Path2D !== 'undefined') {\n context.fill(new Path2D(data.path))\n } else {\n data.modules.forEach((row: boolean[], y: number) => {\n row.forEach((cell: boolean, x: number) => {\n if (cell) context?.fillRect(x + data.margin, y + data.margin, 1, 1)\n })\n })\n }\n\n if (data.iconLayout && imageRef.value?.complete && imageRef.value.naturalWidth > 0 && imageRef.value.naturalHeight > 0) {\n context.drawImage(imageRef.value, data.iconLayout.x + data.margin, data.iconLayout.y + data.margin, data.iconLayout.width, data.iconLayout.height)\n }\n}\n\nfunction toDataURL(type = 'image/png', quality?: number) {\n if (props.type === 'canvas') return canvasRef.value?.toDataURL(type, quality)\n if (!svgRef.value) return undefined\n const source = new XMLSerializer().serializeToString(svgRef.value)\n return `data:image/svg+xml;charset=utf-8,${encodeURIComponent(source)}`\n}\n\nwatch(\n () => [props.type, props.value, props.color, props.bgColor, props.errorLevel, props.marginSize, props.boostLevel, props.icon, props.iconSize, codeSize.value, imageLoaded.value],\n () => nextTick(drawCanvas),\n { immediate: true, deep: true }\n)\n\nonMounted(drawCanvas)\n\ndefineExpose({\n toDataURL\n})\n</script>\n\n<template>\n <div data-ui-qrcode=\"true\" :data-status=\"status\" :class=\"rootClass\" :style=\"[rootStyle, normalizeStyle(styles?.root)]\">\n <canvas v-if=\"type === 'canvas'\" ref=\"canvasRef\" data-ui-qrcode-code=\"true\" role=\"img\" :aria-label=\"ariaLabel\" :class=\"codeClass\" :style=\"[codeStyle, normalizeStyle(styles?.code)]\"></canvas>\n\n <svg v-else ref=\"svgRef\" data-ui-qrcode-code=\"true\" role=\"img\" :aria-label=\"ariaLabel\" :width=\"codeSize\" :height=\"codeSize\" :viewBox=\"`0 0 ${renderData.numCells} ${renderData.numCells}`\" :class=\"codeClass\" :style=\"[codeStyle, normalizeStyle(styles?.code)]\">\n <title v-if=\"title\">{{ title }}</title>\n <path :fill=\"bgColor\" :d=\"`M0 0h${renderData.numCells}v${renderData.numCells}H0z`\" shape-rendering=\"crispEdges\"></path>\n <path :fill=\"color\" :d=\"renderData.path\" shape-rendering=\"crispEdges\"></path>\n <image v-if=\"renderData.iconLayout && iconHref\" :href=\"iconHref\" :x=\"renderData.iconLayout.x + renderData.margin\" :y=\"renderData.iconLayout.y + renderData.margin\" :width=\"renderData.iconLayout.width\" :height=\"renderData.iconLayout.height\" preserveAspectRatio=\"xMidYMid meet\"></image>\n </svg>\n\n <img v-if=\"type === 'canvas' && icon\" ref=\"imageRef\" :src=\"icon\" alt=\"\" class=\"hidden\" @load=\"handleIconLoad\" @error=\"handleIconError\" />\n\n <div v-if=\"maskStatus\" data-ui-qrcode-mask=\"true\" :class=\"maskClass\" :style=\"normalizeStyle(styles?.mask)\">\n <slot v-if=\"$slots.status\" name=\"status\" v-bind=\"statusInfo\"></slot>\n <QRCodeStatusRenderBridge v-else-if=\"statusRender\" :render=\"statusRender\" :info=\"statusInfo\" />\n <div v-else data-ui-qrcode-status=\"true\" :class=\"statusClass\" :style=\"normalizeStyle(styles?.status)\">\n <span v-if=\"maskStatus === 'loading'\" :class=\"qrcodeStatusIcon({ status: 'loading' })\" aria-hidden=\"true\">\n <span class=\"i-lucide:loader-2 animate-spin\"></span>\n </span>\n <span v-else-if=\"maskStatus === 'expired'\" :class=\"qrcodeStatusIcon({ status: 'expired' })\" aria-hidden=\"true\">\n <span class=\"i-lucide:circle-alert\"></span>\n </span>\n <span v-else :class=\"qrcodeStatusIcon({ status: 'scanned' })\" aria-hidden=\"true\">\n <span class=\"i-lucide:circle-check\"></span>\n </span>\n\n <span>{{ maskStatus === 'loading' ? locale.loading : maskStatus === 'expired' ? locale.expired : locale.scanned }}</span>\n\n <button v-if=\"maskStatus === 'expired'\" type=\"button\" data-ui-qrcode-refresh=\"true\" :class=\"refreshClass\" :style=\"normalizeStyle(styles?.refresh)\" @click=\"handleRefresh\">\n <span class=\"i-lucide:rotate-cw size-3.5\" aria-hidden=\"true\"></span>\n <span>{{ locale.refresh }}</span>\n </button>\n </div>\n </div>\n </div>\n</template>\n","import { cva } from 'class-variance-authority'\nimport type { VariantProps } from 'class-variance-authority'\nimport type { CSSProperties, VNodeChild } from 'vue'\n\nexport { default as QRCode } from './QRCode.vue'\n\nexport type QRCodeType = 'canvas' | 'svg'\nexport type QRCodeStatus = 'active' | 'expired' | 'loading' | 'scanned'\nexport type QRCodeMaskStatus = Exclude<QRCodeStatus, 'active'>\nexport type QRCodeErrorLevel = 'L' | 'M' | 'Q' | 'H'\nexport type QRCodeIconSize = number | { width: number; height: number }\nexport type QRCodeSemanticName = 'root' | 'code' | 'mask' | 'status' | 'refresh'\nexport type QRCodeSemanticClassNames = Partial<Record<QRCodeSemanticName, string>>\nexport type QRCodeSemanticStyles = Partial<Record<QRCodeSemanticName, CSSProperties | string>>\n\nexport interface QRCodeStatusLocale {\n expired: string\n refresh: string\n scanned: string\n loading: string\n}\n\nexport interface QRCodeStatusRenderInfo {\n status: QRCodeMaskStatus\n locale: QRCodeStatusLocale\n onRefresh: (event?: MouseEvent) => void\n}\n\nexport type QRCodeStatusRender = (info: QRCodeStatusRenderInfo) => VNodeChild\n\n/** qrcodeRoot 定义二维码外框、边框和固定尺寸容器。 */\nexport const qrcodeRoot = cva('relative inline-flex shrink-0 items-center justify-center overflow-hidden transition-colors duration-150', {\n variants: {\n bordered: {\n true: 'rounded-md border border-medium bg-white p-2 shadow-sm dark:bg-white',\n false: 'bg-transparent'\n }\n },\n defaultVariants: {\n bordered: true\n }\n})\n\n/** qrcodeCode 定义 canvas/svg 二维码主体尺寸与渲染质量。 */\nexport const qrcodeCode = cva('block shrink-0 [image-rendering:pixelated]')\n\n/** qrcodeMask 定义非 active 状态下覆盖二维码的蒙层。 */\nexport const qrcodeMask = cva('absolute inset-0 z-1 flex flex-col items-center justify-center gap-2 bg-white/95 px-3 text-center backdrop-blur-[1px]')\n\n/** qrcodeStatus 定义状态图标和说明文本的垂直布局。 */\nexport const qrcodeStatus = cva('flex flex-col items-center justify-center gap-2 text-xs/5 font-medium text-zinc-700')\n\n/** qrcodeStatusIcon 定义二维码状态图标的语义色。 */\nexport const qrcodeStatusIcon = cva('inline-flex size-6 items-center justify-center text-xl', {\n variants: {\n status: {\n loading: 'text-brand-500',\n expired: 'text-amber-500',\n scanned: 'text-green-500'\n }\n },\n defaultVariants: {\n status: 'loading'\n }\n})\n\n/** qrcodeRefreshButton 定义过期状态下的刷新操作。 */\nexport const qrcodeRefreshButton = cva('inline-flex h-7 items-center gap-1 rounded px-2 text-xs/5 font-medium text-brand-600 transition-colors hover:bg-brand-500/10 hover:text-brand-500 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand-500/30')\n\nexport type QRCodeRootProps = VariantProps<typeof qrcodeRoot>\n"],"mappings":";;;;AA0BA,IAAA;;CAyBQ,MAAM,EAAO;EA6HD;EAGA;EAvHlB,OAAc,WAAW,GAAc,GAAyB;GAC/D,IAAM,IAAyB,EAAU,UAAU,aAAa,CAAI;GACpE,OAAO,EAAO,eAAe,GAAM,CAAG;EACvC;EAOA,OAAc,aAAa,GAA6B,GAAyB;GAChF,IAAM,IAAiB,EAAU,UAAU,UAAU,CAAI;GACzD,OAAO,EAAO,eAAe,CAAC,CAAG,GAAG,CAAG;EACxC;EAcA,OAAc,eAAe,GAAkC,GAC7D,IAAkB,GAAG,IAAkB,IACvC,IAAY,IAAI,IAAoB,IAAc;GAEnD,IAAI,EAAE,EAAO,eAAe,KAAc,KAAc,KAAc,KAAc,EAAO,gBACtF,IAAO,MAAM,IAAO,GACxB,MAAU,WAAW,eAAe;GAGrC,IAAI,GACA;GACJ,KAAK,IAAU,IAAc,KAAW;IACvC,IAAM,IAAwB,EAAO,oBAAoB,GAAS,CAAG,I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