UNPKG

vue2-qr

Version:

**English** | [中文](./README.zh-CN.md) ## Introduction A plugin suitable for vue2.x with a QR code in the center with a logo. ## Example <img src="./img/npmjs.com.png" width="300">

10 lines 86.2 kB
(function(t,r){"object"===typeof exports&&"object"===typeof module?module.exports=r():"function"===typeof define&&define.amd?define([],r):"object"===typeof exports?exports["vue2qrcode"]=r():t["vue2qrcode"]=r()})("undefined"!==typeof self?self:this,(function(){return function(){var t={3780:function(t,r,e){e(4114),e(6573),e(8100),e(7936),e(7467),e(4732),e(9577),function(r,e){t.exports=e()}(window,(function(){return r=[function(t,r){var e,n=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];r.getSymbolSize=function(t){if(!t)throw new Error('"version" cannot be null or undefined');if(t<1||40<t)throw new Error('"version" should be in range from 1 to 40');return 4*t+17},r.getSymbolTotalCodewords=function(t){return n[t]},r.getBCHDigit=function(t){for(var r=0;0!==t;)r++,t>>>=1;return r},r.setToSJISFunction=function(t){if("function"!=typeof t)throw new Error('"toSJISFunc" is not a valid function.');e=t},r.isKanjiModeEnabled=function(){return void 0!==e},r.toSJIS=function(t){return e(t)}},function(t,r,e){var n=e(8),o=e(9);r.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},r.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},r.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},r.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},r.MIXED={bit:-1},r.getCharCountIndicator=function(t,r){if(!t.ccBits)throw new Error("Invalid mode: "+t);if(!n.isValid(r))throw new Error("Invalid version: "+r);return 1<=r&&r<10?t.ccBits[0]:r<27?t.ccBits[1]:t.ccBits[2]},r.getBestModeForData=function(t){return o.testNumeric(t)?r.NUMERIC:o.testAlphanumeric(t)?r.ALPHANUMERIC:o.testKanji(t)?r.KANJI:r.BYTE},r.toString=function(t){if(t&&t.id)return t.id;throw new Error("Invalid mode")},r.isValid=function(t){return t&&t.bit&&t.ccBits},r.from=function(t,e){if(r.isValid(t))return t;try{return function(t){if("string"!=typeof t)throw new Error("Param is not a string");switch(t.toLowerCase()){case"numeric":return r.NUMERIC;case"alphanumeric":return r.ALPHANUMERIC;case"kanji":return r.KANJI;case"byte":return r.BYTE;default:throw new Error("Unknown mode: "+t)}}(t)}catch(t){return e}}},function(t,r,e){"use strict";var n=e(4),o=(i.TYPED_ARRAY_SUPPORT=function(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()}catch(t){return!1}}())?2147483647:1073741823;function i(t,r,e){return i.TYPED_ARRAY_SUPPORT||this instanceof i?"number"==typeof t?s(this,t):function(t,r,e,n){if("number"==typeof r)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&r instanceof ArrayBuffer?function(t,r,e,n){if(e<0||r.byteLength<e)throw new RangeError("'offset' is out of bounds");if(r.byteLength<e+(n||0))throw new RangeError("'length' is out of bounds");return n=void 0===e&&void 0===n?new Uint8Array(r):void 0===n?new Uint8Array(r,e):new Uint8Array(r,e,n),i.TYPED_ARRAY_SUPPORT?n.__proto__=i.prototype:n=f(t,n),n}(t,r,e,n):("string"!=typeof r?function(t,r){if(i.isBuffer(r)){var e=0|u(r.length),n=a(t,e);return 0===n.length||r.copy(n,0,0,e),n}if(r){if("undefined"!=typeof ArrayBuffer&&r.buffer instanceof ArrayBuffer||"length"in r)return"number"!=typeof r.length||function(t){return t!=t}(r.length)?a(t,0):f(t,r);if("Buffer"===r.type&&Array.isArray(r.data))return f(t,r.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}:function(t,r){var e=0|h(r);t=a(t,e),r=t.write(r);return r!==e&&(t=t.slice(0,r)),t})(t,r)}(this,t,r,e):new i(t,r,e)}function u(t){if(o<=t)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o.toString(16)+" bytes");return 0|t}function a(t,r){var e;return i.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(r)).__proto__=i.prototype:(e=null===(e=t)?new i(r):e).length=r,e}function s(t,r){var e=a(t,r<0?0:0|u(r));if(!i.TYPED_ARRAY_SUPPORT)for(var n=0;n<r;++n)e[n]=0;return e}function f(t,r){for(var e=r.length<0?0:0|u(r.length),n=a(t,e),o=0;o<e;o+=1)n[o]=255&r[o];return n}function c(t,r){var e;r=r||1/0;for(var n=t.length,o=null,i=[],u=0;u<n;++u){if(55295<(e=t.charCodeAt(u))&&e<57344){if(!o){if(56319<e){-1<(r-=3)&&i.push(239,191,189);continue}if(u+1===n){-1<(r-=3)&&i.push(239,191,189);continue}o=e;continue}if(e<56320){-1<(r-=3)&&i.push(239,191,189),o=e;continue}e=65536+(o-55296<<10|e-56320)}else o&&-1<(r-=3)&&i.push(239,191,189);if(o=null,e<128){if(--r<0)break;i.push(e)}else if(e<2048){if((r-=2)<0)break;i.push(e>>6|192,63&e|128)}else if(e<65536){if((r-=3)<0)break;i.push(e>>12|224,e>>6&63|128,63&e|128)}else{if(!(e<1114112))throw new Error("Invalid code point");if((r-=4)<0)break;i.push(e>>18|240,e>>12&63|128,e>>6&63|128,63&e|128)}}return i}function h(t){return i.isBuffer(t)?t.length:"undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer)?t.byteLength:0===(t="string"!=typeof t?""+t:t).length?0:c(t).length}function l(t,r,e,n){return function(t,r,e,n){for(var o=0;o<n&&!(o+e>=r.length||o>=t.length);++o)r[o+e]=t[o];return o}(c(r,t.length-e),t,e,n)}i.TYPED_ARRAY_SUPPORT&&(i.prototype.__proto__=Uint8Array.prototype,i.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&i[Symbol.species]===i&&Object.defineProperty(i,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1})),i.prototype.write=function(t,r,e){void 0===r||void 0===e&&"string"==typeof r?(e=this.length,r=0):isFinite(r)&&(r|=0,isFinite(e)?e|=0:e=void 0);var n=this.length-r;if((void 0===e||n<e)&&(e=n),0<t.length&&(e<0||r<0)||r>this.length)throw new RangeError("Attempt to write outside buffer bounds");return l(this,t,r,e)},i.prototype.slice=function(t,r){var e=this.length;if((t=~~t)<0?(t+=e)<0&&(t=0):e<t&&(t=e),(r=void 0===r?e:~~r)<0?(r+=e)<0&&(r=0):e<r&&(r=e),r<t&&(r=t),i.TYPED_ARRAY_SUPPORT)(o=this.subarray(t,r)).__proto__=i.prototype;else for(var n=r-t,o=new i(n,void 0),u=0;u<n;++u)o[u]=this[u+t];return o},i.prototype.copy=function(t,r,e,n){if(e=e||0,n||0===n||(n=this.length),r>=t.length&&(r=t.length),(n=0<n&&n<e?e:n)===e)return 0;if(0===t.length||0===this.length)return 0;if((r=r||0)<0)throw new RangeError("targetStart out of bounds");if(e<0||e>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length);var o,u=(n=t.length-r<n-e?t.length-r+e:n)-e;if(this===t&&e<r&&r<n)for(o=u-1;0<=o;--o)t[o+r]=this[o+e];else if(u<1e3||!i.TYPED_ARRAY_SUPPORT)for(o=0;o<u;++o)t[o+r]=this[o+e];else Uint8Array.prototype.set.call(t,this.subarray(e,e+u),r);return u},i.prototype.fill=function(t,r,e){var n;if("string"==typeof t?("string"==typeof r?(r=0,e=this.length):"string"==typeof e&&(e=this.length),1!==t.length||(n=t.charCodeAt(0))<256&&(t=n)):"number"==typeof t&&(t&=255),r<0||this.length<r||this.length<e)throw new RangeError("Out of range index");if(e<=r)return this;if(r>>>=0,e=void 0===e?this.length:e>>>0,"number"==typeof(t=t||0))for(a=r;a<e;++a)this[a]=t;else for(var o=i.isBuffer(t)?t:new i(t),u=o.length,a=0;a<e-r;++a)this[a+r]=o[a%u];return this},i.concat=function(t,r){if(!n(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return a(null,0);if(void 0===r)for(u=r=0;u<t.length;++u)r+=t[u].length;for(var e=s(null,r),o=0,u=0;u<t.length;++u){var f=t[u];if(!i.isBuffer(f))throw new TypeError('"list" argument must be an Array of Buffers');f.copy(e,o),o+=f.length}return e},i.byteLength=h,i.prototype._isBuffer=!0,i.isBuffer=function(t){return!(null==t||!t._isBuffer)},t.exports.alloc=function(t){return t=new i(t),t.fill(0),t},t.exports.from=function(t){return new i(t)}},function(t,r,e){"use strict";r.__esModule=!0,r.isImageDom=r.isString=r.isFunction=r.promisify=void 0,r.promisify=function(t){return function(){var r=Array.prototype.slice.call(arguments);return new Promise((function(e,n){r.push((function(t,r){t?n(t):e(r)})),t.apply(null,r)}))}},r.isFunction=function(t){return"function"==typeof t},r.isString=function(t){return"string"==typeof t},r.isImageDom=function(t){return t&&["IMAGE","IMG"].includes(t.tagName)}},function(t,r){var e={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==e.call(t)}},function(t,r){r.L={bit:1},r.M={bit:0},r.Q={bit:3},r.H={bit:2},r.isValid=function(t){return t&&void 0!==t.bit&&0<=t.bit&&t.bit<4},r.from=function(t,e){if(r.isValid(t))return t;try{return function(t){if("string"!=typeof t)throw new Error("Param is not a string");switch(t.toLowerCase()){case"l":case"low":return r.L;case"m":case"medium":return r.M;case"q":case"quartile":return r.Q;case"h":case"high":return r.H;default:throw new Error("Unknown EC Level: "+t)}}(t)}catch(t){return e}}},function(t,r,e){"use strict";r.__esModule=!0,r.toCanvas=void 0;var n=e(12),o=e(39);r.toCanvas=function(t){return n.renderQrCode(t).then((function(){return o.drawLogo(t)}))}},function(t,r,e){var n=e(5),o=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],i=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];r.getBlocksCount=function(t,r){switch(r){case n.L:return o[4*(t-1)+0];case n.M:return o[4*(t-1)+1];case n.Q:return o[4*(t-1)+2];case n.H:return o[4*(t-1)+3];default:return}},r.getTotalCodewordsCount=function(t,r){switch(r){case n.L:return i[4*(t-1)+0];case n.M:return i[4*(t-1)+1];case n.Q:return i[4*(t-1)+2];case n.H:return i[4*(t-1)+3];default:return}}},function(t,r){r.isValid=function(t){return!isNaN(t)&&1<=t&&t<=40}},function(t,r){var e="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+",n="(?:(?![A-Z0-9 $%*+\\-./:]|"+(e=e.replace(/u/g,"\\u"))+")(?:.|[\r\n]))+";r.KANJI=new RegExp(e,"g"),r.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g"),r.BYTE=new RegExp(n,"g"),r.NUMERIC=new RegExp("[0-9]+","g"),r.ALPHANUMERIC=new RegExp("[A-Z $%*+\\-./:]+","g");var o=new RegExp("^"+e+"$"),i=new RegExp("^[0-9]+$"),u=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");r.testKanji=function(t){return o.test(t)},r.testNumeric=function(t){return i.test(t)},r.testAlphanumeric=function(t){return u.test(t)}},function(t,r){function e(t){if("string"!=typeof(t="number"==typeof t?t.toString():t))throw new Error("Color should be defined as hex string");var r=t.slice().replace("#","").split("");if(r.length<3||5===r.length||8<r.length)throw new Error("Invalid hex color: "+t);return 6===(r=3===r.length||4===r.length?Array.prototype.concat.apply([],r.map((function(t){return[t,t]}))):r).length&&r.push("F","F"),t=parseInt(r.join(""),16),{r:t>>24&255,g:t>>16&255,b:t>>8&255,a:255&t,hex:"#"+r.slice(0,6).join("")}}r.getOptions=function(t){(t=t||{}).color||(t.color={});var r=void 0===t.margin||null===t.margin||t.margin<0?4:t.margin,n=t.width&&21<=t.width?t.width:void 0,o=t.scale||4;return{width:n,scale:n?4:o,margin:r,color:{dark:e(t.color.dark||"#000000ff"),light:e(t.color.light||"#ffffffff")},type:t.type,rendererOpts:t.rendererOpts||{}}},r.getScale=function(t,r){return r.width&&r.width>=t+2*r.margin?r.width/(t+2*r.margin):r.scale},r.getImageWidth=function(t,e){var n=r.getScale(t,e);return Math.floor((t+2*e.margin)*n)},r.qrToImageData=function(t,e,n){for(var o=e.modules.size,i=e.modules.data,u=r.getScale(o,n),a=Math.floor((o+2*n.margin)*u),s=n.margin*u,f=[n.color.light,n.color.dark],c=0;c<a;c++)for(var h=0;h<a;h++){var l=4*(c*a+h),p=n.color.light;s<=c&&s<=h&&c<a-s&&h<a-s&&(p=f[i[Math.floor((c-s)/u)*o+Math.floor((h-s)/u)]?1:0]),t[l++]=p.r,t[l++]=p.g,t[l++]=p.b,t[l]=p.a}}},function(t,r,e){"use strict";var n=this&&this.__awaiter||function(t,r,e,n){return new(e=e||Promise)((function(o,i){function u(t){try{s(n.next(t))}catch(t){i(t)}}function a(t){try{s(n.throw(t))}catch(t){i(t)}}function s(t){var r;t.done?o(t.value):((r=t.value)instanceof e?r:new e((function(t){t(r)}))).then(u,a)}s((n=n.apply(t,r||[])).next())}))},o=this&&this.__generator||function(t,r){var e,n,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},u={next:a(0),throw:a(1),return:a(2)};return"function"==typeof Symbol&&(u[Symbol.iterator]=function(){return this}),u;function a(u){return function(a){return function(u){if(e)throw new TypeError("Generator is already executing.");for(;i;)try{if(e=1,n&&(o=2&u[0]?n.return:u[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,u[1])).done)return o;switch(n=0,(u=o?[2&u[0],o.value]:u)[0]){case 0:case 1:o=u;break;case 4:return i.label++,{value:u[1],done:!1};case 5:i.label++,n=u[1],u=[0];continue;case 7:u=i.ops.pop(),i.trys.pop();continue;default:if(!(o=0<(o=i.trys).length&&o[o.length-1])&&(6===u[0]||2===u[0])){i=0;continue}if(3===u[0]&&(!o||u[1]>o[0]&&u[1]<o[3])){i.label=u[1];break}if(6===u[0]&&i.label<o[1]){i.label=o[1],o=u;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(u);break}o[2]&&i.ops.pop(),i.trys.pop();continue}u=r.call(t,i)}catch(a){u=[6,a],n=0}finally{e=o=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([u,a])}}};r.__esModule=!0;var i=e(6),u=e(40);e=e(41).version,a.prototype.toCanvas=function(){var t=this;return i.toCanvas.call(this,this.option).then((function(){return t.ifCanvasDrawed=!0,Promise.resolve()}))},a.prototype.toImage=function(){return u.toImage.call(this,this.option)},a.prototype.downloadImage=function(t){return n(this,void 0,void 0,(function(){return o(this,(function(r){switch(r.label){case 0:return this.ifImageCreated?[3,2]:[4,this.toImage()];case 1:r.sent(),r.label=2;case 2:return u.saveImage(this.option.image,t),[2]}}))}))},a.prototype.getCanvas=function(){return n(this,void 0,void 0,(function(){return o(this,(function(t){switch(t.label){case 0:return this.ifCanvasDrawed?[3,2]:[4,this.toCanvas()];case 1:t.sent(),t.label=2;case 2:return[2,this.option.canvas]}}))}))},a.version=e,e=a;function a(t){this.ifCanvasDrawed=!1,this.ifImageCreated=!1,this.defaultOption={canvas:document.createElement("canvas"),image:new Image,content:""},this.option=Object.assign(this.defaultOption,t)}r.default=e},function(t,r,e){"use strict";r.__esModule=!0,r.renderQrCode=void 0;var n=e(3),o=(e=e(13),n.promisify(e.toCanvas));r.renderQrCode=function(t){var r=t.canvas,e=t.content,n=t.width,a=void 0===n?0:n,s=(t=t.nodeQrCodeOptions,void 0===t?{}:t);return s.errorCorrectionLevel=s.errorCorrectionLevel||u(e),i(e,s).then((function(t){return s.scale=0===a?void 0:a/t*4,o(r,e,s)}))};var i=function(t,r){var e=document.createElement("canvas");return o(e,t,r).then((function(){return e.width}))},u=function(t){return 36<t.length?"M":16<t.length?"Q":"H"}},function(t,r,e){var n=e(14),o=e(15),i=e(37),u=e(38);function a(t,r,e,i,u){var a=[].slice.call(arguments,1),s=a.length;a="function"==typeof a[s-1];if(!a&&!n())throw new Error("Callback required as last argument");if(!a){if(s<1)throw new Error("Too few arguments provided");return 1===s?(e=r,r=i=void 0):2!==s||r.getContext||(i=e,e=r,r=void 0),new Promise((function(n,u){try{var a=o.create(e,i);n(t(a,r,i))}catch(n){u(n)}}))}if(s<2)throw new Error("Too few arguments provided");2===s?(u=e,e=r,r=i=void 0):3===s&&(r.getContext&&void 0===u?(u=i,i=void 0):(u=i,i=e,e=r,r=void 0));try{var f=o.create(e,i);u(null,t(f,r,i))}catch(a){u(a)}}r.create=o.create,r.toCanvas=a.bind(null,i.render),r.toDataURL=a.bind(null,i.renderToDataURL),r.toString=a.bind(null,(function(t,r,e){return u.render(t,e)}))},function(t,r){t.exports=function(){return"function"==typeof Promise&&Promise.prototype&&Promise.prototype.then}},function(t,r,e){var n=e(2),o=e(0),i=e(5),u=e(16),a=e(17),s=e(18),f=e(19),c=e(20),h=e(7),l=e(21),p=e(29),g=e(30),d=e(1),y=e(31),v=e(4);function w(t,r,e){for(var n,o=t.size,i=g.getEncodedBits(r,e),u=0;u<15;u++)n=1==(i>>u&1),u<6?t.set(u,8,n,!0):u<8?t.set(u+1,8,n,!0):t.set(o-15+u,8,n,!0),u<8?t.set(8,o-u-1,n,!0):u<9?t.set(8,15-u-1+1,n,!0):t.set(8,15-u-1,n,!0);t.set(o-8,8,1,!0)}function m(t,r,e){var i=new u;for(e.forEach((function(r){i.put(r.mode.bit,4),i.put(r.getLength(),d.getCharCountIndicator(r.mode,t)),r.write(i)})),e=8*(o.getSymbolTotalCodewords(t)-h.getTotalCodewordsCount(t,r)),i.getLengthInBits()+4<=e&&i.put(0,4);i.getLengthInBits()%8!=0;)i.putBit(0);for(var a=(e-i.getLengthInBits())/8,s=0;s<a;s++)i.put(s%2?17:236,8);return function(t,r,e){for(var i=o.getSymbolTotalCodewords(r),u=h.getTotalCodewordsCount(r,e),a=(u=i-u,h.getBlocksCount(r,e)),s=a-i%a,f=(e=Math.floor(i/a),Math.floor(u/a)),c=f+1,p=e-f,g=new l(p),d=0,y=new Array(a),v=new Array(a),w=0,m=n.from(t.buffer),b=0;b<a;b++){var E=b<s?f:c;y[b]=m.slice(d,d+E),v[b]=g.encode(y[b]),d+=E,w=Math.max(w,E)}var A,_,T=n.alloc(i),x=0;for(A=0;A<w;A++)for(_=0;_<a;_++)A<y[_].length&&(T[x++]=y[_][A]);for(A=0;A<p;A++)for(_=0;_<a;_++)T[x++]=v[_][A];return T}(i,t,r)}function b(t,r,e,n){var i;if(v(t))i=y.fromArray(t);else{if("string"!=typeof t)throw new Error("Invalid data");var u,h=r;h||(u=y.rawSplit(t),h=p.getBestVersionForData(u,e)),i=y.fromString(t,h||40)}if(t=p.getBestVersionForData(i,e),!t)throw new Error("The amount of data is too big to be stored in a QR Code");if(r){if(r<t)throw new Error("\nThe chosen QR Code version cannot contain this amount of data.\nMinimum version required to store current data is: "+t+".\n")}else r=t;return h=m(r,e,i),t=o.getSymbolSize(r),t=new a(t),function(t,r){for(var e=t.size,n=f.getPositions(r),o=0;o<n.length;o++)for(var i=n[o][0],u=n[o][1],a=-1;a<=7;a++)if(!(i+a<=-1||e<=i+a))for(var s=-1;s<=7;s++)u+s<=-1||e<=u+s||(0<=a&&a<=6&&(0===s||6===s)||0<=s&&s<=6&&(0===a||6===a)||2<=a&&a<=4&&2<=s&&s<=4?t.set(i+a,u+s,!0,!0):t.set(i+a,u+s,!1,!0))}(t,r),function(t){for(var r=t.size,e=8;e<r-8;e++){var n=e%2==0;t.set(e,6,n,!0),t.set(6,e,n,!0)}}(t),function(t,r){for(var e=s.getPositions(r),n=0;n<e.length;n++)for(var o=e[n][0],i=e[n][1],u=-2;u<=2;u++)for(var a=-2;a<=2;a++)-2===u||2===u||-2===a||2===a||0===u&&0===a?t.set(o+u,i+a,!0,!0):t.set(o+u,i+a,!1,!0)}(t,r),w(t,e,0),7<=r&&function(t,r){for(var e,n,o,i=t.size,u=p.getEncodedBits(r),a=0;a<18;a++)e=Math.floor(a/3),t.set(e,n=a%3+i-8-3,o=1==(u>>a&1),!0),t.set(n,e,o,!0)}(t,r),function(t,r){for(var e=t.size,n=-1,o=e-1,i=7,u=0,a=e-1;0<a;a-=2)for(6===a&&a--;;){for(var s,f=0;f<2;f++)t.isReserved(o,a-f)||(s=!1,u<r.length&&(s=1==(r[u]>>>i&1)),t.set(o,a-f,s),-1===--i&&(u++,i=7));if((o+=n)<0||e<=o){o-=n,n=-n;break}}}(t,h),isNaN(n)&&(n=c.getBestMask(t,w.bind(null,t,e))),c.applyMask(n,t),w(t,e,n),{modules:t,version:r,errorCorrectionLevel:e,maskPattern:n,segments:i}}r.create=function(t,r){if(void 0===t||""===t)throw new Error("No input text");var e,n,u=i.M;return void 0!==r&&(u=i.from(r.errorCorrectionLevel,i.M),e=p.from(r.version),n=c.from(r.maskPattern),r.toSJISFunc&&o.setToSJISFunction(r.toSJISFunc)),b(t,e,u,n)}},function(t,r){function e(){this.buffer=[],this.length=0}e.prototype={get:function(t){var r=Math.floor(t/8);return 1==(this.buffer[r]>>>7-t%8&1)},put:function(t,r){for(var e=0;e<r;e++)this.putBit(1==(t>>>r-e-1&1))},getLengthInBits:function(){return this.length},putBit:function(t){var r=Math.floor(this.length/8);this.buffer.length<=r&&this.buffer.push(0),t&&(this.buffer[r]|=128>>>this.length%8),this.length++}},t.exports=e},function(t,r,e){var n=e(2);function o(t){if(!t||t<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=t,this.data=n.alloc(t*t),this.reservedBit=n.alloc(t*t)}o.prototype.set=function(t,r,e,n){r=t*this.size+r,this.data[r]=e,n&&(this.reservedBit[r]=!0)},o.prototype.get=function(t,r){return this.data[t*this.size+r]},o.prototype.xor=function(t,r,e){this.data[t*this.size+r]^=e},o.prototype.isReserved=function(t,r){return this.reservedBit[t*this.size+r]},t.exports=o},function(t,r,e){var n=e(0).getSymbolSize;r.getRowColCoords=function(t){if(1===t)return[];for(var r=Math.floor(t/7)+2,e=(t=n(t),145===t?26:2*Math.ceil((t-13)/(2*r-2))),o=[t-7],i=1;i<r-1;i++)o[i]=o[i-1]-e;return o.push(6),o.reverse()},r.getPositions=function(t){for(var e=[],n=r.getRowColCoords(t),o=n.length,i=0;i<o;i++)for(var u=0;u<o;u++)0===i&&0===u||0===i&&u===o-1||i===o-1&&0===u||e.push([n[i],n[u]]);return e}},function(t,r,e){var n=e(0).getSymbolSize;r.getPositions=function(t){return t=n(t),[[0,0],[t-7,0],[0,t-7]]}},function(t,r){r.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};var e=3,n=3,o=40,i=10;r.isValid=function(t){return null!=t&&""!==t&&!isNaN(t)&&0<=t&&t<=7},r.from=function(t){return r.isValid(t)?parseInt(t,10):void 0},r.getPenaltyN1=function(t){for(var r=t.size,n=0,o=0,i=0,u=null,a=null,s=0;s<r;s++){o=i=0,u=a=null;for(var f=0;f<r;f++){var c=t.get(s,f);c===u?o++:(5<=o&&(n+=e+(o-5)),u=c,o=1),(c=t.get(f,s))===a?i++:(5<=i&&(n+=e+(i-5)),a=c,i=1)}5<=o&&(n+=e+(o-5)),5<=i&&(n+=e+(i-5))}return n},r.getPenaltyN2=function(t){for(var r=t.size,e=0,o=0;o<r-1;o++)for(var i=0;i<r-1;i++){var u=t.get(o,i)+t.get(o,i+1)+t.get(o+1,i)+t.get(o+1,i+1);4!==u&&0!==u||e++}return e*n},r.getPenaltyN3=function(t){for(var r=t.size,e=0,n=0,i=0,u=0;u<r;u++){n=i=0;for(var a=0;a<r;a++)n=n<<1&2047|t.get(u,a),10<=a&&(1488===n||93===n)&&e++,i=i<<1&2047|t.get(a,u),10<=a&&(1488===i||93===i)&&e++}return e*o},r.getPenaltyN4=function(t){for(var r=0,e=t.data.length,n=0;n<e;n++)r+=t.data[n];return Math.abs(Math.ceil(100*r/e/5)-10)*i},r.applyMask=function(t,e){for(var n=e.size,o=0;o<n;o++)for(var i=0;i<n;i++)e.isReserved(i,o)||e.xor(i,o,function(t,e,n){switch(t){case r.Patterns.PATTERN000:return(e+n)%2==0;case r.Patterns.PATTERN001:return e%2==0;case r.Patterns.PATTERN010:return n%3==0;case r.Patterns.PATTERN011:return(e+n)%3==0;case r.Patterns.PATTERN100:return(Math.floor(e/2)+Math.floor(n/3))%2==0;case r.Patterns.PATTERN101:return e*n%2+e*n%3==0;case r.Patterns.PATTERN110:return(e*n%2+e*n%3)%2==0;case r.Patterns.PATTERN111:return(e*n%3+(e+n)%2)%2==0;default:throw new Error("bad maskPattern:"+t)}}(t,i,o))},r.getBestMask=function(t,e){for(var n=Object.keys(r.Patterns).length,o=0,i=1/0,u=0;u<n;u++){e(u),r.applyMask(u,t);var a=r.getPenaltyN1(t)+r.getPenaltyN2(t)+r.getPenaltyN3(t)+r.getPenaltyN4(t);r.applyMask(u,t),a<i&&(i=a,o=u)}return o}},function(t,r,e){var n=e(2),o=e(22),i=e(24).Buffer;function u(t){this.genPoly=void 0,this.degree=t,this.degree&&this.initialize(this.degree)}u.prototype.initialize=function(t){this.degree=t,this.genPoly=o.generateECPolynomial(this.degree)},u.prototype.encode=function(t){if(!this.genPoly)throw new Error("Encoder not initialized");var r=n.alloc(this.degree),e=i.concat([t,r],t.length+this.degree);r=o.mod(e,this.genPoly),t=this.degree-r.length;return 0<t?(e=n.alloc(this.degree),r.copy(e,t),e):r},t.exports=u},function(t,r,e){var n=e(2),o=e(23);r.mul=function(t,r){for(var e=n.alloc(t.length+r.length-1),i=0;i<t.length;i++)for(var u=0;u<r.length;u++)e[i+u]^=o.mul(t[i],r[u]);return e},r.mod=function(t,r){for(var e=n.from(t);0<=e.length-r.length;){for(var i=e[0],u=0;u<r.length;u++)e[u]^=o.mul(r[u],i);for(var a=0;a<e.length&&0===e[a];)a++;e=e.slice(a)}return e},r.generateECPolynomial=function(t){for(var e=n.from([1]),i=0;i<t;i++)e=r.mul(e,[1,o.exp(i)]);return e}},function(t,r,e){e=e(2);var n=e.alloc(512),o=e.alloc(256);!function(){for(var t=1,r=0;r<255;r++)n[r]=t,o[t]=r,256&(t<<=1)&&(t^=285);for(r=255;r<512;r++)n[r]=n[r-255]}(),r.log=function(t){if(t<1)throw new Error("log("+t+")");return o[t]},r.exp=function(t){return n[t]},r.mul=function(t,r){return 0===t||0===r?0:n[o[t]+o[r]]}},function(t,r,e){"use strict";(function(t){ /*! * The buffer module from node.js, for the browser. * * @author Feross Aboukhadijeh <http://feross.org> * @license MIT */ var n=e(26),o=e(27),i=e(28);function u(){return s.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function a(t,r){if(u()<r)throw new RangeError("Invalid typed array length");return s.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(r)).__proto__=s.prototype:(t=null===t?new s(r):t).length=r,t}function s(t,r,e){if(!(s.TYPED_ARRAY_SUPPORT||this instanceof s))return new s(t,r,e);if("number"!=typeof t)return f(this,t,r,e);if("string"==typeof r)throw new Error("If encoding is specified then the first argument must be a string");return h(this,t)}function f(t,r,e,n){if("number"==typeof r)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&r instanceof ArrayBuffer?function(t,r,e,n){if(r.byteLength,e<0||r.byteLength<e)throw new RangeError("'offset' is out of bounds");if(r.byteLength<e+(n||0))throw new RangeError("'length' is out of bounds");return r=void 0===e&&void 0===n?new Uint8Array(r):void 0===n?new Uint8Array(r,e):new Uint8Array(r,e,n),s.TYPED_ARRAY_SUPPORT?(t=r).__proto__=s.prototype:t=l(t,r),t}(t,r,e,n):"string"==typeof r?function(t,r,e){if("string"==typeof e&&""!==e||(e="utf8"),!s.isEncoding(e))throw new TypeError('"encoding" must be a valid string encoding');var n=0|g(r,e);e=(t=a(t,n)).write(r,e);return e!==n&&(t=t.slice(0,e)),t}(t,r,e):function(t,r){if(s.isBuffer(r)){var e=0|p(r.length);return 0===(t=a(t,e)).length||r.copy(t,0,0,e),t}if(r){if("undefined"!=typeof ArrayBuffer&&r.buffer instanceof ArrayBuffer||"length"in r)return"number"!=typeof r.length||function(t){return t!=t}(r.length)?a(t,0):l(t,r);if("Buffer"===r.type&&i(r.data))return l(t,r.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(t,r)}function c(t){if("number"!=typeof t)throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function h(t,r){if(c(r),t=a(t,r<0?0:0|p(r)),!s.TYPED_ARRAY_SUPPORT)for(var e=0;e<r;++e)t[e]=0;return t}function l(t,r){var e=r.length<0?0:0|p(r.length);t=a(t,e);for(var n=0;n<e;n+=1)t[n]=255&r[n];return t}function p(t){if(t>=u())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+u().toString(16)+" bytes");return 0|t}function g(t,r){if(s.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;var e=(t="string"!=typeof t?""+t:t).length;if(0===e)return 0;for(var n=!1;;)switch(r){case"ascii":case"latin1":case"binary":return e;case"utf8":case"utf-8":case void 0:return I(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*e;case"hex":return e>>>1;case"base64":return M(t).length;default:if(n)return I(t).length;r=(""+r).toLowerCase(),n=!0}}function d(t,r,e){var o,i,u,a=!1;if((r=void 0===r||r<0?0:r)>this.length)return"";if((e=void 0===e||e>this.length?this.length:e)<=0)return"";if((e>>>=0)<=(r>>>=0))return"";for(t=t||"utf8";;)switch(t){case"hex":return function(t,r,e){var n=t.length;(!r||r<0)&&(r=0),(!e||e<0||n<e)&&(e=n);for(var o="",i=r;i<e;++i)o+=function(t){return t<16?"0"+t.toString(16):t.toString(16)}(t[i]);return o}(this,r,e);case"utf8":case"utf-8":return E(this,r,e);case"ascii":return function(t,r,e){var n="";e=Math.min(t.length,e);for(var o=r;o<e;++o)n+=String.fromCharCode(127&t[o]);return n}(this,r,e);case"latin1":case"binary":return function(t,r,e){var n="";e=Math.min(t.length,e);for(var o=r;o<e;++o)n+=String.fromCharCode(t[o]);return n}(this,r,e);case"base64":return o=this,u=e,0===(i=r)&&u===o.length?n.fromByteArray(o):n.fromByteArray(o.slice(i,u));case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return function(t,r,e){for(var n=t.slice(r,e),o="",i=0;i<n.length;i+=2)o+=String.fromCharCode(n[i]+256*n[i+1]);return o}(this,r,e);default:if(a)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),a=!0}}function y(t,r,e){var n=t[r];t[r]=t[e],t[e]=n}function v(t,r,e,n,o){if(0===t.length)return-1;if("string"==typeof e?(n=e,e=0):2147483647<e?e=2147483647:e<-2147483648&&(e=-2147483648),e=+e,(e=(e=isNaN(e)?o?0:t.length-1:e)<0?t.length+e:e)>=t.length){if(o)return-1;e=t.length-1}else if(e<0){if(!o)return-1;e=0}if("string"==typeof r&&(r=s.from(r,n)),s.isBuffer(r))return 0===r.length?-1:w(t,r,e,n,o);if("number"==typeof r)return r&=255,s.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?(o?Uint8Array.prototype.indexOf:Uint8Array.prototype.lastIndexOf).call(t,r,e):w(t,[r],e,n,o);throw new TypeError("val must be string, number or Buffer")}function w(t,r,e,n,o){var i=1,u=t.length,a=r.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||r.length<2)return-1;u/=i=2,a/=2,e/=2}function s(t,r){return 1===i?t[r]:t.readUInt16BE(r*i)}if(o)for(var f=-1,c=e;c<u;c++)if(s(t,c)===s(r,-1===f?0:c-f)){if(c-(f=-1===f?c:f)+1===a)return f*i}else-1!==f&&(c-=c-f),f=-1;else for(c=e=u<e+a?u-a:e;0<=c;c--){for(var h=!0,l=0;l<a;l++)if(s(t,c+l)!==s(r,l)){h=!1;break}if(h)return c}return-1}function m(t,r,e,n){return O(function(t){for(var r=[],e=0;e<t.length;++e)r.push(255&t.charCodeAt(e));return r}(r),t,e,n)}function b(t,r,e,n){return O(function(t,r){for(var e,n,o=[],i=0;i<t.length&&!((r-=2)<0);++i)n=t.charCodeAt(i),e=n>>8,n%=256,o.push(n),o.push(e);return o}(r,t.length-e),t,e,n)}function E(t,r,e){e=Math.min(t.length,e);for(var n=[],o=r;o<e;){var i,u,a,s,f=t[o],c=null,h=239<f?4:223<f?3:191<f?2:1;if(o+h<=e)switch(h){case 1:f<128&&(c=f);break;case 2:128==(192&(i=t[o+1]))&&127<(s=(31&f)<<6|63&i)&&(c=s);break;case 3:i=t[o+1],u=t[o+2],128==(192&i)&&128==(192&u)&&2047<(s=(15&f)<<12|(63&i)<<6|63&u)&&(s<55296||57343<s)&&(c=s);break;case 4:i=t[o+1],u=t[o+2],a=t[o+3],128==(192&i)&&128==(192&u)&&128==(192&a)&&65535<(s=(15&f)<<18|(63&i)<<12|(63&u)<<6|63&a)&&s<1114112&&(c=s)}null===c?(c=65533,h=1):65535<c&&(c-=65536,n.push(c>>>10&1023|55296),c=56320|1023&c),n.push(c),o+=h}return function(t){var r=t.length;if(r<=A)return String.fromCharCode.apply(String,t);for(var e="",n=0;n<r;)e+=String.fromCharCode.apply(String,t.slice(n,n+=A));return e}(n)}r.Buffer=s,r.SlowBuffer=function(t){return+t!=t&&(t=0),s.alloc(+t)},r.INSPECT_MAX_BYTES=50,s.TYPED_ARRAY_SUPPORT=void 0!==t.TYPED_ARRAY_SUPPORT?t.TYPED_ARRAY_SUPPORT:function(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()&&"function"==typeof t.subarray&&0===t.subarray(1,1).byteLength}catch(t){return!1}}(),r.kMaxLength=u(),s.poolSize=8192,s._augment=function(t){return t.__proto__=s.prototype,t},s.from=function(t,r,e){return f(null,t,r,e)},s.TYPED_ARRAY_SUPPORT&&(s.prototype.__proto__=Uint8Array.prototype,s.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&s[Symbol.species]===s&&Object.defineProperty(s,Symbol.species,{value:null,configurable:!0})),s.alloc=function(t,r,e){return n=null,c(t),t<=0||void 0===r?a(n,t):"string"==typeof e?a(n,t).fill(r,e):a(n,t).fill(r);var n},s.allocUnsafe=function(t){return h(null,t)},s.allocUnsafeSlow=function(t){return h(null,t)},s.isBuffer=function(t){return!(null==t||!t._isBuffer)},s.compare=function(t,r){if(!s.isBuffer(t)||!s.isBuffer(r))throw new TypeError("Arguments must be Buffers");if(t===r)return 0;for(var e=t.length,n=r.length,o=0,i=Math.min(e,n);o<i;++o)if(t[o]!==r[o]){e=t[o],n=r[o];break}return e<n?-1:n<e?1:0},s.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},s.concat=function(t,r){if(!i(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return s.alloc(0);if(void 0===r)for(o=r=0;o<t.length;++o)r+=t[o].length;for(var e=s.allocUnsafe(r),n=0,o=0;o<t.length;++o){var u=t[o];if(!s.isBuffer(u))throw new TypeError('"list" argument must be an Array of Buffers');u.copy(e,n),n+=u.length}return e},s.byteLength=g,s.prototype._isBuffer=!0,s.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var r=0;r<t;r+=2)y(this,r,r+1);return this},s.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var r=0;r<t;r+=4)y(this,r,r+3),y(this,r+1,r+2);return this},s.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var r=0;r<t;r+=8)y(this,r,r+7),y(this,r+1,r+6),y(this,r+2,r+5),y(this,r+3,r+4);return this},s.prototype.toString=function(){var t=0|this.length;return 0==t?"":0===arguments.length?E(this,0,t):d.apply(this,arguments)},s.prototype.equals=function(t){if(!s.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===s.compare(this,t)},s.prototype.inspect=function(){var t="",e=r.INSPECT_MAX_BYTES;return 0<this.length&&(t=this.toString("hex",0,e).match(/.{2}/g).join(" "),this.length>e&&(t+=" ... ")),"<Buffer "+t+">"},s.prototype.compare=function(t,r,e,n,o){if(!s.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=t?t.length:0),void 0===n&&(n=0),void 0===o&&(o=this.length),(r=void 0===r?0:r)<0||e>t.length||n<0||o>this.length)throw new RangeError("out of range index");if(o<=n&&e<=r)return 0;if(o<=n)return-1;if(e<=r)return 1;if(this===t)return 0;for(var i=(o>>>=0)-(n>>>=0),u=(e>>>=0)-(r>>>=0),a=Math.min(i,u),f=this.slice(n,o),c=t.slice(r,e),h=0;h<a;++h)if(f[h]!==c[h]){i=f[h],u=c[h];break}return i<u?-1:u<i?1:0},s.prototype.includes=function(t,r,e){return-1!==this.indexOf(t,r,e)},s.prototype.indexOf=function(t,r,e){return v(this,t,r,e,!0)},s.prototype.lastIndexOf=function(t,r,e){return v(this,t,r,e,!1)},s.prototype.write=function(t,r,e,n){if(void 0===r)n="utf8",e=this.length,r=0;else if(void 0===e&&"string"==typeof r)n=r,e=this.length,r=0;else{if(!isFinite(r))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");r|=0,isFinite(e)?(e|=0,void 0===n&&(n="utf8")):(n=e,e=void 0)}var o=this.length-r;if((void 0===e||o<e)&&(e=o),0<t.length&&(e<0||r<0)||r>this.length)throw new RangeError("Attempt to write outside buffer bounds");n=n||"utf8";for(var i,u,a,s=!1;;)switch(n){case"hex":return function(t,r,e,n){e=Number(e)||0;var o=t.length-e;if((!n||o<(n=Number(n)))&&(n=o),(o=r.length)%2!=0)throw new TypeError("Invalid hex string");o/2<n&&(n=o/2);for(var i=0;i<n;++i){var u=parseInt(r.substr(2*i,2),16);if(isNaN(u))return i;t[e+i]=u}return i}(this,t,r,e);case"utf8":case"utf-8":return u=r,a=e,O(I(t,(i=this).length-u),i,u,a);case"ascii":return m(this,t,r,e);case"latin1":case"binary":return m(this,t,r,e);case"base64":return i=this,u=r,a=e,O(M(t),i,u,a);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return b(this,t,r,e);default:if(s)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),s=!0}},s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var A=4096;function _(t,r,e){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(e<t+r)throw new RangeError("Trying to access beyond buffer length")}function T(t,r,e,n,o,i){if(!s.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(o<r||r<i)throw new RangeError('"value" argument is out of bounds');if(e+n>t.length)throw new RangeError("Index out of range")}function x(t,r,e,n){r<0&&(r=65535+r+1);for(var o=0,i=Math.min(t.length-e,2);o<i;++o)t[e+o]=(r&255<<8*(n?o:1-o))>>>8*(n?o:1-o)}function P(t,r,e,n){r<0&&(r=4294967295+r+1);for(var o=0,i=Math.min(t.length-e,4);o<i;++o)t[e+o]=r>>>8*(n?o:3-o)&255}function R(t,r,e,n){if(e+n>t.length)throw new RangeError("Index out of range");if(e<0)throw new RangeError("Index out of range")}function B(t,r,e,n,i){return i||R(t,0,e,4),o.write(t,r,e,n,23,4),e+4}function S(t,r,e,n,i){return i||R(t,0,e,8),o.write(t,r,e,n,52,8),e+8}s.prototype.slice=function(t,r){var e=this.length;if((t=~~t)<0?(t+=e)<0&&(t=0):e<t&&(t=e),(r=void 0===r?e:~~r)<0?(r+=e)<0&&(r=0):e<r&&(r=e),r<t&&(r=t),s.TYPED_ARRAY_SUPPORT)(o=this.subarray(t,r)).__proto__=s.prototype;else for(var n=r-t,o=new s(n,void 0),i=0;i<n;++i)o[i]=this[i+t];return o},s.prototype.readUIntLE=function(t,r,e){t|=0,r|=0,e||_(t,r,this.length);for(var n=this[t],o=1,i=0;++i<r&&(o*=256);)n+=this[t+i]*o;return n},s.prototype.readUIntBE=function(t,r,e){t|=0,r|=0,e||_(t,r,this.length);for(var n=this[t+--r],o=1;0<r&&(o*=256);)n+=this[t+--r]*o;return n},s.prototype.readUInt8=function(t,r){return r||_(t,1,this.length),this[t]},s.prototype.readUInt16LE=function(t,r){return r||_(t,2,this.length),this[t]|this[t+1]<<8},s.prototype.readUInt16BE=function(t,r){return r||_(t,2,this.length),this[t]<<8|this[t+1]},s.prototype.readUInt32LE=function(t,r){return r||_(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},s.prototype.readUInt32BE=function(t,r){return r||_(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},s.prototype.readIntLE=function(t,r,e){t|=0,r|=0,e||_(t,r,this.length);for(var n=this[t],o=1,i=0;++i<r&&(o*=256);)n+=this[t+i]*o;return(o*=128)<=n&&(n-=Math.pow(2,8*r)),n},s.prototype.readIntBE=function(t,r,e){t|=0,r|=0,e||_(t,r,this.length);for(var n=r,o=1,i=this[t+--n];0<n&&(o*=256);)i+=this[t+--n]*o;return(o*=128)<=i&&(i-=Math.pow(2,8*r)),i},s.prototype.readInt8=function(t,r){return r||_(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},s.prototype.readInt16LE=function(t,r){return r||_(t,2,this.length),t=this[t]|this[t+1]<<8,32768&t?4294901760|t:t},s.prototype.readInt16BE=function(t,r){return r||_(t,2,this.length),t=this[t+1]|this[t]<<8,32768&t?4294901760|t:t},s.prototype.readInt32LE=function(t,r){return r||_(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},s.prototype.readInt32BE=function(t,r){return r||_(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},s.prototype.readFloatLE=function(t,r){return r||_(t,4,this.length),o.read(this,t,!0,23,4)},s.prototype.readFloatBE=function(t,r){return r||_(t,4,this.length),o.read(this,t,!1,23,4)},s.prototype.readDoubleLE=function(t,r){return r||_(t,8,this.length),o.read(this,t,!0,52,8)},s.prototype.readDoubleBE=function(t,r){return r||_(t,8,this.length),o.read(this,t,!1,52,8)},s.prototype.writeUIntLE=function(t,r,e,n){t=+t,r|=0,e|=0,n||T(this,t,r,e,Math.pow(2,8*e)-1,0);var o=1,i=0;for(this[r]=255&t;++i<e&&(o*=256);)this[r+i]=t/o&255;return r+e},s.prototype.writeUIntBE=function(t,r,e,n){t=+t,r|=0,e|=0,n||T(this,t,r,e,Math.pow(2,8*e)-1,0);var o=e-1,i=1;for(this[r+o]=255&t;0<=--o&&(i*=256);)this[r+o]=t/i&255;return r+e},s.prototype.writeUInt8=function(t,r,e){return t=+t,r|=0,e||T(this,t,r,1,255,0),s.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[r]=255&t,r+1},s.prototype.writeUInt16LE=function(t,r,e){return t=+t,r|=0,e||T(this,t,r,2,65535,0),s.TYPED_ARRAY_SUPPORT?(this[r]=255&t,this[r+1]=t>>>8):x(this,t,r,!0),r+2},s.prototype.writeUInt16BE=function(t,r,e){return t=+t,r|=0,e||T(this,t,r,2,65535,0),s.TYPED_ARRAY_SUPPORT?(this[r]=t>>>8,this[r+1]=255&t):x(this,t,r,!1),r+2},s.prototype.writeUInt32LE=function(t,r,e){return t=+t,r|=0,e||T(this,t,r,4,4294967295,0),s.TYPED_ARRAY_SUPPORT?(this[r+3]=t>>>24,this[r+2]=t>>>16,this[r+1]=t>>>8,this[r]=255&t):P(this,t,r,!0),r+4},s.prototype.writeUInt32BE=function(t,r,e){return t=+t,r|=0,e||T(this,t,r,4,4294967295,0),s.TYPED_ARRAY_SUPPORT?(this[r]=t>>>24,this[r+1]=t>>>16,this[r+2]=t>>>8,this[r+3]=255&t):P(this,t,r,!1),r+4},s.prototype.writeIntLE=function(t,r,e,n){t=+t,r|=0,n||T(this,t,r,e,(n=Math.pow(2,8*e-1))-1,-n);var o=0,i=1,u=0;for(this[r]=255&t;++o<e&&(i*=256);)t<0&&0===u&&0!==this[r+o-1]&&(u=1),this[r+o]=(t/i|0)-u&255;return r+e},s.prototype.writeIntBE=function(t,r,e,n){t=+t,r|=0,n||T(this,t,r,e,(n=Math.pow(2,8*e-1))-1,-n);var o=e-1,i=1,u=0;for(this[r+o]=255&t;0<=--o&&(i*=256);)t<0&&0===u&&0!==this[r+o+1]&&(u=1),this[r+o]=(t/i|0)-u&255;return r+e},s.prototype.writeInt8=function(t,r,e){return t=+t,r|=0,e||T(this,t,r,1,127,-128),s.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[r]=255&(t=t<0?255+t+1:t),r+1},s.prototype.writeInt16LE=function(t,r,e){return t=+t,r|=0,e||T(this,t,r,2,32767,-32768),s.TYPED_ARRAY_SUPPORT?(this[r]=255&t,this[r+1]=t>>>8):x(this,t,r,!0),r+2},s.prototype.writeInt16BE=function(t,r,e){return t=+t,r|=0,e||T(this,t,r,2,32767,-32768),s.TYPED_ARRAY_SUPPORT?(this[r]=t>>>8,this[r+1]=255&t):x(this,t,r,!1),r+2},s.prototype.writeInt32LE=function(t,r,e){return t=+t,r|=0,e||T(this,t,r,4,2147483647,-2147483648),s.TYPED_ARRAY_SUPPORT?(this[r]=255&t,this[r+1]=t>>>8,this[r+2]=t>>>16,this[r+3]=t>>>24):P(this,t,r,!0),r+4},s.prototype.writeInt32BE=function(t,r,e){return t=+t,r|=0,e||T(this,t,r,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),s.TYPED_ARRAY_SUPPORT?(this[r]=t>>>24,this[r+1]=t>>>16,this[r+2]=t>>>8,this[r+3]=255&t):P(this,t,r,!1),r+4},s.prototype.writeFloatLE=function(t,r,e){return B(this,t,r,!0,e)},s.prototype.writeFloatBE=function(t,r,e){return B(this,t,r,!1,e)},s.prototype.writeDoubleLE=function(t,r,e){return S(this,t,r,!0,e)},s.prototype.writeDoubleBE=function(t,r,e){return S(this,t,r,!1,e)},s.prototype.copy=function(t,r,e,n){if(e=e||0,n||0===n||(n=this.length),r>=t.length&&(r=t.length),(n=0<n&&n<e?e:n)===e)return 0;if(0===t.length||0===this.length)return 0;if((r=r||0)<0)throw new RangeError("targetStart out of bounds");if(e<0||e>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length);var o,i=(n=t.length-r<n-e?t.length-r+e:n)-e;if(this===t&&e<r&&r<n)for(o=i-1;0<=o;--o)t[o+r]=this[o+e];else if(i<1e3||!s.TYPED_ARRAY_SUPPORT)for(o=0;o<i;++o)t[o+r]=this[o+e];else Uint8Array.prototype.set.call(t,this.subarray(e,e+i),r);return i},s.prototype.fill=function(t,r,e,n){if("string"==typeof t){var o;if("string"==typeof r?(n=r,r=0,e=this.length):"string"==typeof e&&(n=e,e=this.length),1!==t.length||(o=t.charCodeAt(0))<256&&(t=o),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!s.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else"number"==typeof t&&(t&=255);if(r<0||this.length<r||this.length<e)throw new RangeError("Out of range index");if(e<=r)return this;if(r>>>=0,e=void 0===e?this.length:e>>>0,"number"==typeof(t=t||0))for(a=r;a<e;++a)this[a]=t;else for(var i=s.isBuffer(t)?t:I(new s(t,n).toString()),u=i.length,a=0;a<e-r;++a)this[a+r]=i[a%u];return this};var C=/[^+\/0-9A-Za-z-_]/g;function I(t,r){var e;r=r||1/0;for(var n=t.length,o=null,i=[],u=0;u<n;++u){if(55295<(e=t.charCodeAt(u))&&e<57344){if(!o){if(56319<e){-1<(r-=3)&&i.push(239,191,189);continue}if(u+1===n){-1<(r-=3)&&i.push(239,191,189);continue}o=e;continue}if(e<56320){-1<(r-=3)&&i.push(239,191,189),o=e;continue}e=65536+(o-55296<<10|e-56320)}else o&&-1<(r-=3)&&i.push(239,191,189);if(o=null,e<128){if(--r<0)break;i.push(e)}else if(e<2048){if((r-=2)<0)break;i.push(e>>6|192,63&e|128)}else if(e<65536){if((r-=3)<0)break;i.push(e>>12|224,e>>6&63|128,63&e|128)}else{if(!(e<1114112))throw new Error("Invalid code point");if((r-=4)<0)break;i.push(e>>18|240,e>>12&63|128,e>>6&63|128,63&e|128)}}return i}function M(t){return n.toByteArray(function(t){var r;if((t=((r=t).trim?r.trim():r.replace(/^\s+|\s+$/g,"")).replace(C,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function O(t,r,e,n){for(var o=0;o<n&&!(o+e>=r.length||o>=t.length);++o)r[o+e]=t[o];return o}}).call(this,e(25))},function(t,r){var e=function(){return this}();try{e=e||new Function("return this")()}catch(t){"object"==typeof window&&(e=window)}t.exports=e},function(t,r,e){"use strict";r.byteLength=function(t){var r=f(t);t=r[0],r=r[1];return 3*(t+r)/4-r},r.toByteArray=function(t){var r,e,n=f(t),u=n[0],a=(n=n[1],new i(function(t,r){return 3*(t+r)/4-r}(u,n))),s=0,c=0<n?u-4:u;for(e=0;e<c;e+=4)r=o[t.charCodeAt(e)]<<18|o[t.charCodeAt(e+1)]<<12|o[t.charCodeAt(e+2)]<<6|o[t.charCodeAt(e+3)],a[s++]=r>>16&255,a[s++]=r>>8&255,a[s++]=255&r;return 2===n&&(r=o[t.charCodeAt(e)]<<2|o[t.charCodeAt(e+1)]>>4,a[s++]=255&r),1===n&&(r=o[t.charCodeAt(e)]<<10|o[t.charCodeAt(e+1)]<<4|o[t.charCodeAt(e+2)]>>2,a[s++]=r>>8&255,a[s++]=255&r),a},r.fromByteArray=function(t){for(var r,e=t.length,o=e%3,i=[],u=0,a=e-o;u<a;u+=16383)i.push(function(t,r,e){for(var o,i=[],u=r;u<e;u+=3)o=(t[u]<<16&16711680)+(t[u+1]<<8&65280)+(255&t[u+2]),i.push(function(t){return n[t>>18&63]+n[t>>12&63]+n[t>>6&63]+n[63&t]}(o));return i.join("")}(t,u,a<u+16383?a:u+16383));return 1==o?(r=t[e-1],i.push(n[r>>2]+n[r<<4&63]+"==")):2==o&&(r=(t[e-2]<<8)+t[e-1],i.push(n[r>>10]+n[r>>4&63]+n[r<<2&63]+"=")),i.join("")};for(var n=[],o=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,u="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,s=u.length;a<s;++a)n[a]=u[a],o[u.charCodeAt(a)]=a;function f(t){var r=t.length;if(0<r%4)throw new Error("Invalid string. Length must be a multiple of 4");return t=t.indexOf("="),[t=-1===t?r:t,t===r?0:4-t%4]}o["-".charCodeAt(0)]=62,o["_".charCodeAt(0)]=63},function(t,r){ /*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */ r.read=function(t,r,e,n,o){var i,u,a=8*o-n-1,s=(1<<a)-1,f=s>>1,c=-7,h=e?o-1:0,l=e?-1:1;e=t[r+h];for(h+=l,i=e&(1<<-c)-1,e>>=-c,c+=a;0<c;i=256*i+t[r+h],h+=l,c-=8);for(u=i&(1<<-c)-1,i>>=-c,c+=n;0<c;u=256*u+t[r+h],h+=l,c-=8);if(0===i)i=1-f;else{if(i===s)return u?NaN:1/0*(e?-1:1);u+=Math.pow(2,n),i-=f}return(e?-1:1)*u*Math.pow(2,i-n)},r.write=function(t,r,e,n,o,i){var u,a,s=8*i-o-1,f=(1<<s)-1,c=f>>1,h=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,l=n?0:i-1,p=n?1:-1;i=r<0||0===r&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(a=isNaN(r)?1:0,u=f):(u=Math.floor(Math.log(r)/Math.LN2),r*(n=Math.pow(2,-u))<1&&(u--,n*=2),2<=(r+=1<=u+c?h/n:h*Math.pow(2,1-c))*n&&(u++,n/=2),f<=u+c?(a=0,u=f):1<=u+c?(a=(r*n-1)*Math.pow(2,o),u+=c):(a=r*Math.pow(2,c-1)*Math.pow(2,o),u=0));8<=o;t[e+l]=255&a,l+=p,a/=256,o-=8);for(u=u<<o|a,s+=o;0<s;t[e+l]=255&u,l+=p,u/=256,s-=8);t[e+l-p]|=128*i}},function(t,r){var e={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==e.call(t)}},function(t,r,e){var n=e(0),o=e(7),i=e(5),u=e(1),a=e(8),s=e(4),f=n.getBCHDigit(7973);function c(t,r){return u.getCharCountIndicator(t,r)+4}function h(t,e){for(var n=1;n<=40;n++)if(function(t,r){var e=0;return t.forEach((function(t){var n=c(t.mode,r);e+=n+t.getBitsLength()})),e}(t,n)<=r.getCapacity(n,e,u.MIXED))return n}r.from=function(t,r){return a.isValid(t)?parseInt(t,10):r},r.getCapacity=function(t,r,e){if(!a.isValid(t))throw new Error("Invalid QR Code version");if(void 0===e&&(e=u.BYTE),r=8*(n.getSymbolTotalCodewords(t)-o.getTotalCodewordsCount(t,r)),e===u.MIXED)return r;var i=r-c(e,t);switch(e){case u.NUMERIC:return Math.floor(i/10*3);case u.ALPHANUMERIC:return Math.floor(i/11*2);case u.KANJI:return Math.floor(i/13);default:return u.BYTE,Math.floor(i/8)}},r.getBestVersionForData=function(t,e){var n;e=i.from(e,i.M);if(s(t)){if(1<t.length)return h(t,e);if(0===t.length)return 1;n=t[0]}else n=t;return function(t,e,n){for(var o=1;o<=40;o++)if(e<=r.getCapacity(o,n,t))return o}(n.mode,n.getLength(),e)},r.getEncodedBits=function(t){if(!a.isValid(t)||t<7)throw new Error("Invalid QR Code version");for(var r=t<<12;0<=n.getBCHDigit(r)-f;)r^=7973<<n.getBCHDigit(r)-f;return t<<12|r}},function(t,r,e){var n=e(0),o=n.getBCHDigit(1335);r.getEncodedBits=function(t,r){r=t.bit<<3|r;for(var e=r<<10;0<=n.getBCHDigit(e)-o;)e^=1335<<n.getBCHDigit(e)-o;return 21522^(r<<10|e)}},function(t,r,e){var n=e(1),o=e(32),i=e(33),u=e(34),a=e(35),s=e(9),f=e(0),c=e(36);function h(t){return unescape(encodeURIComponent(t)).length}function l(t,r,e){for(var n,o=[];null!==(n=t.exec(e));)o.push({data:n[0],index:n.index,mode:r,length:n[0].length});return o}function p(t){var r,e=l(s.NUMERIC,n.NUMERIC,t),o=l(s.ALPHANUMERIC,n.ALPHANUMERIC,t);t=f.isKanjiModeEnabled()?(r=l(s.BYTE,n.BYTE,t),l(s.KANJI,n.KANJI,t)):(r=l(s.BYTE_KANJI,n.BYTE,t),[]);return e.concat(o,r,t).sort((function(t,r){return t.index-r.index})).map((function(t){return{data:t.data,mode:t.mode,length:t.length}}))}function g(t,r){switch(r){case n.NUMERIC:return o.getBitsLength(t);case n.ALPHANUMERIC:return i.getBitsLength(t);case n.KANJI:return a.getBitsLength(t);case n.BYTE:return u.getBitsLength(t)}}function d(t,r){var e=n.getBestModeForData(t);r=n.from(r,e);if(r!==n.BYTE&&r.bit<e.bit)throw new Error('"'+t+'" cannot be encoded with mode '+n.toString(r)+".\n Suggested mode is: "+n.toString(e));switch(r=r!==n.KANJI||f.isKanjiModeEnabled()?r:n.BYTE){case n.NUMERIC:return new o(t);case n.ALPHANUMERIC:return new i(t);case n.KANJI:return new a(t);case n.BYTE:return new u(t)}}r.fromArray=function(t){return t.reduce((function(t,r){return"string"==typeof r?t.push(d(r,null)):r.data&&t.push(d(r.data,r.mode)),t}),[])},r.fromString=function(t,e){for(var o=function(t,r){for(var e={},o={start:{}},i=["start"],u=0;u<t.length;u++){for(var a=t[u],s=[],f=0;f<a.length;f++){var c=a[f],h=""+u+f;s.push(h),e[h]={node:c,lastCount:0},o[h]={};for(var l=0;l<i.length;l++){var p=i[l];e[p]&&e[p].node.mode===c.mode?(o[p][h]=g(e[p].lastCount+c.length,c.mode)-g(e[p].lastCount,c.mode),e[p].lastCount+=c.length):(e[p]&&(e[p].lastCount=c.length),o[p][h]=g(c.length,c.mode)+4+n.getCharCountIndicator(c.mode,r))}}i=s}for(l=0;l<i.length;l++)o[i[l]].end=0;return{map:o,table:e}}(function(t){for(var r=[],e=0;e<t.length;e++){var o=t[e];switch(o.mode){case n.NUMERIC:r.push([o,{data:o.data,mode:n.ALPHANUMERIC,length:o.length},{data:o.data,mode:n.BYTE,length:o.length}]);break;case n.ALPHANUMERIC:r.push([o,{data:o.data,mode:n.BYTE,length:o.length}]);break;case n.KANJI:r.push([o,{data:o.data,mode:n.BYTE,length:h(o.data)}]);break;case n.BYTE:r.push([{data:o.dat