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 • 60.7 kB
JavaScript
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.QrCodeWithLogo=e():t.QrCodeWithLogo=e()}(window,function(){return r=[function(t,e){var r,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];e.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},e.getSymbolTotalCodewords=function(t){return n[t]},e.getBCHDigit=function(t){for(var e=0;0!==t;)e++,t>>>=1;return e},e.setToSJISFunction=function(t){if("function"!=typeof t)throw new Error('"toSJISFunc" is not a valid function.');r=t},e.isKanjiModeEnabled=function(){return void 0!==r},e.toSJIS=function(t){return r(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,e){if(!t.ccBits)throw new Error("Invalid mode: "+t);if(!n.isValid(e))throw new Error("Invalid version: "+e);return 1<=e&&e<10?t.ccBits[0]:e<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,e,r){"use strict";var a=r(4);var n=(u.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 u(t,e,r){return u.TYPED_ARRAY_SUPPORT||this instanceof u?"number"==typeof t?f(this,t):function(t,e,r,n){if("number"==typeof e)throw new TypeError('"value" argument must not be a number');if("undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer)return function(t,e,r,n){if(r<0||e.byteLength<r)throw new RangeError("'offset' is out of bounds");if(e.byteLength<r+(n||0))throw new RangeError("'length' is out of bounds");n=void 0===r&&void 0===n?new Uint8Array(e):void 0===n?new Uint8Array(e,r):new Uint8Array(e,r,n);u.TYPED_ARRAY_SUPPORT?n.__proto__=u.prototype:n=o(t,n);return n}(t,e,r,n);return("string"!=typeof e?function(t,e){if(u.isBuffer(e)){var r=0|i(e.length),n=s(t,r);return 0===n.length?n:(e.copy(n,0,0,r),n)}if(e){if("undefined"!=typeof ArrayBuffer&&e.buffer instanceof ArrayBuffer||"length"in e)return"number"!=typeof e.length||function(t){return t!=t}(e.length)?s(t,0):o(t,e);if("Buffer"===e.type&&Array.isArray(e.data))return o(t,e.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}:function(t,e){var r=0|c(e),t=s(t,r),e=t.write(e);e!==r&&(t=t.slice(0,e));return t})(t,e)}(this,t,e,r):new u(t,e,r)}function i(t){if(n<=t)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+n.toString(16)+" bytes");return 0|t}function s(t,e){var r;return u.TYPED_ARRAY_SUPPORT?(r=new Uint8Array(e)).__proto__=u.prototype:(r=null===(r=t)?new u(e):r).length=e,r}function f(t,e){var r=s(t,e<0?0:0|i(e));if(!u.TYPED_ARRAY_SUPPORT)for(var n=0;n<e;++n)r[n]=0;return r}function o(t,e){for(var r=e.length<0?0:0|i(e.length),n=s(t,r),o=0;o<r;o+=1)n[o]=255&e[o];return n}function h(t,e){var r;e=e||1/0;for(var n=t.length,o=null,i=[],a=0;a<n;++a){if(55295<(r=t.charCodeAt(a))&&r<57344){if(!o){if(56319<r){-1<(e-=3)&&i.push(239,191,189);continue}if(a+1===n){-1<(e-=3)&&i.push(239,191,189);continue}o=r;continue}if(r<56320){-1<(e-=3)&&i.push(239,191,189),o=r;continue}r=65536+(o-55296<<10|r-56320)}else o&&-1<(e-=3)&&i.push(239,191,189);if(o=null,r<128){if(--e<0)break;i.push(r)}else if(r<2048){if((e-=2)<0)break;i.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;i.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return i}function c(t){return u.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:h(t).length}function l(t,e,r,n){return function(t,e,r,n){for(var o=0;o<n&&!(o+r>=e.length||o>=t.length);++o)e[o+r]=t[o];return o}(h(e,t.length-r),t,r,n)}u.TYPED_ARRAY_SUPPORT&&(u.prototype.__proto__=Uint8Array.prototype,u.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&u[Symbol.species]===u&&Object.defineProperty(u,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1})),u.prototype.write=function(t,e,r){void 0===e||void 0===r&&"string"==typeof e?(r=this.length,e=0):isFinite(e)&&(e|=0,isFinite(r)?r|=0:r=void 0);var n=this.length-e;if((void 0===r||n<r)&&(r=n),0<t.length&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");return l(this,t,e,r)},u.prototype.slice=function(t,e){var r=this.length;if((t=~~t)<0?(t+=r)<0&&(t=0):r<t&&(t=r),(e=void 0===e?r:~~e)<0?(e+=r)<0&&(e=0):r<e&&(e=r),e<t&&(e=t),u.TYPED_ARRAY_SUPPORT)(o=this.subarray(t,e)).__proto__=u.prototype;else for(var n=e-t,o=new u(n,void 0),i=0;i<n;++i)o[i]=this[i+t];return o},u.prototype.copy=function(t,e,r,n){if(r=r||0,n||0===n||(n=this.length),e>=t.length&&(e=t.length),(n=0<n&&n<r?r:n)===r)return 0;if(0===t.length||0===this.length)return 0;if((e=e||0)<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=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-e<n-r?t.length-e+r:n)-r;if(this===t&&r<e&&e<n)for(o=i-1;0<=o;--o)t[o+e]=this[o+r];else if(i<1e3||!u.TYPED_ARRAY_SUPPORT)for(o=0;o<i;++o)t[o+e]=this[o+r];else Uint8Array.prototype.set.call(t,this.subarray(r,r+i),e);return i},u.prototype.fill=function(t,e,r){var n;if("string"==typeof t?("string"==typeof e?(e=0,r=this.length):"string"==typeof r&&(r=this.length),1!==t.length||(n=t.charCodeAt(0))<256&&(t=n)):"number"==typeof t&&(t&=255),e<0||this.length<e||this.length<r)throw new RangeError("Out of range index");if(r<=e)return this;if(e>>>=0,r=void 0===r?this.length:r>>>0,"number"==typeof(t=t||0))for(a=e;a<r;++a)this[a]=t;else for(var o=u.isBuffer(t)?t:new u(t),i=o.length,a=0;a<r-e;++a)this[a+e]=o[a%i];return this},u.concat=function(t,e){if(!a(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return s(null,0);if(void 0===e)for(o=e=0;o<t.length;++o)e+=t[o].length;for(var r=f(null,e),n=0,o=0;o<t.length;++o){var i=t[o];if(!u.isBuffer(i))throw new TypeError('"list" argument must be an Array of Buffers');i.copy(r,n),n+=i.length}return r},u.byteLength=c,u.prototype._isBuffer=!0,u.isBuffer=function(t){return!(null==t||!t._isBuffer)},t.exports.alloc=function(t){t=new u(t);return t.fill(0),t},t.exports.from=function(t){return new u(t)}},function(t,e,r){"use strict";e.__esModule=!0,e.isImageDom=e.isString=e.isFunction=e.promisify=void 0,e.promisify=function(e){return function(){var t=Array.prototype.slice.call(arguments);return new Promise(function(r,n){t.push(function(t,e){t?n(t):r(e)}),e.apply(null,t)})}},e.isFunction=function(t){return"function"==typeof t},e.isString=function(t){return"string"==typeof t},e.isImageDom=function(t){return t&&["IMAGE","IMG"].includes(t.tagName)}},function(t,e){var r={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==r.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,e,r){"use strict";e.__esModule=!0,e.toCanvas=void 0;var n=r(12),o=r(39);e.toCanvas=function(t){return n.renderQrCode(t).then(function(){return o.drawLogo(t)})}},function(t,e,r){var n=r(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];e.getBlocksCount=function(t,e){switch(e){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}},e.getTotalCodewordsCount=function(t,e){switch(e){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,e){e.isValid=function(t){return!isNaN(t)&&1<=t&&t<=40}},function(t,e){var r="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+",n="(?:(?![A-Z0-9 $%*+\\-./:]|"+(r=r.replace(/u/g,"\\u"))+")(?:.|[\r\n]))+";e.KANJI=new RegExp(r,"g"),e.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g"),e.BYTE=new RegExp(n,"g"),e.NUMERIC=new RegExp("[0-9]+","g"),e.ALPHANUMERIC=new RegExp("[A-Z $%*+\\-./:]+","g");var o=new RegExp("^"+r+"$"),i=new RegExp("^[0-9]+$"),a=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");e.testKanji=function(t){return o.test(t)},e.testNumeric=function(t){return i.test(t)},e.testAlphanumeric=function(t){return a.test(t)}},function(t,g){function o(t){if("string"!=typeof(t="number"==typeof t?t.toString():t))throw new Error("Color should be defined as hex string");var e=t.slice().replace("#","").split("");if(e.length<3||5===e.length||8<e.length)throw new Error("Invalid hex color: "+t);6===(e=3===e.length||4===e.length?Array.prototype.concat.apply([],e.map(function(t){return[t,t]})):e).length&&e.push("F","F");t=parseInt(e.join(""),16);return{r:t>>24&255,g:t>>16&255,b:t>>8&255,a:255&t,hex:"#"+e.slice(0,6).join("")}}g.getOptions=function(t){(t=t||{}).color||(t.color={});var e=void 0===t.margin||null===t.margin||t.margin<0?4:t.margin,r=t.width&&21<=t.width?t.width:void 0,n=t.scale||4;return{width:r,scale:r?4:n,margin:e,color:{dark:o(t.color.dark||"#000000ff"),light:o(t.color.light||"#ffffffff")},type:t.type,rendererOpts:t.rendererOpts||{}}},g.getScale=function(t,e){return e.width&&e.width>=t+2*e.margin?e.width/(t+2*e.margin):e.scale},g.getImageWidth=function(t,e){var r=g.getScale(t,e);return Math.floor((t+2*e.margin)*r)},g.qrToImageData=function(t,e,r){for(var n=e.modules.size,o=e.modules.data,i=g.getScale(n,r),a=Math.floor((n+2*r.margin)*i),u=r.margin*i,s=[r.color.light,r.color.dark],f=0;f<a;f++)for(var h=0;h<a;h++){var c=4*(f*a+h),l=r.color.light;u<=f&&u<=h&&f<a-u&&h<a-u&&(l=s[o[Math.floor((f-u)/i)*n+Math.floor((h-u)/i)]?1:0]),t[c++]=l.r,t[c++]=l.g,t[c++]=l.b,t[c]=l.a}}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,a,u,s){return new(u=u||Promise)(function(r,e){function n(t){try{i(s.next(t))}catch(t){e(t)}}function o(t){try{i(s.throw(t))}catch(t){e(t)}}function i(t){var e;t.done?r(t.value):((e=t.value)instanceof u?e:new u(function(t){t(e)})).then(n,o)}i((s=s.apply(t,a||[])).next())})},o=this&&this.__generator||function(r,n){var o,i,a,u={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},t={next:e(0),throw:e(1),return:e(2)};return"function"==typeof Symbol&&(t[Symbol.iterator]=function(){return this}),t;function e(e){return function(t){return function(e){if(o)throw new TypeError("Generator is already executing.");for(;u;)try{if(o=1,i&&(a=2&e[0]?i.return:e[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,e[1])).done)return a;switch(i=0,(e=a?[2&e[0],a.value]:e)[0]){case 0:case 1:a=e;break;case 4:return u.label++,{value:e[1],done:!1};case 5:u.label++,i=e[1],e=[0];continue;case 7:e=u.ops.pop(),u.trys.pop();continue;default:if(!(a=0<(a=u.trys).length&&a[a.length-1])&&(6===e[0]||2===e[0])){u=0;continue}if(3===e[0]&&(!a||e[1]>a[0]&&e[1]<a[3])){u.label=e[1];break}if(6===e[0]&&u.label<a[1]){u.label=a[1],a=e;break}if(a&&u.label<a[2]){u.label=a[2],u.ops.push(e);break}a[2]&&u.ops.pop(),u.trys.pop();continue}e=n.call(r,u)}catch(t){e=[6,t],i=0}finally{o=a=0}if(5&e[0])throw e[1];return{value:e[0]?e[1]:void 0,done:!0}}([e,t])}}};e.__esModule=!0;var i=r(6),a=r(40),r=r(41).version,r=(u.prototype.toCanvas=function(){var t=this;return i.toCanvas.call(this,this.option).then(function(){return t.ifCanvasDrawed=!0,Promise.resolve()})},u.prototype.toImage=function(){return a.toImage.call(this,this.option)},u.prototype.downloadImage=function(e){return n(this,void 0,void 0,function(){return o(this,function(t){switch(t.label){case 0:return this.ifImageCreated?[3,2]:[4,this.toImage()];case 1:t.sent(),t.label=2;case 2:return a.saveImage(this.option.image,e),[2]}})})},u.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]}})})},u.version=r,u);function u(t){this.ifCanvasDrawed=!1,this.ifImageCreated=!1,this.defaultOption={canvas:document.createElement("canvas"),image:new Image,content:""},this.option=Object.assign(this.defaultOption,t)}e.default=r},function(t,e,r){"use strict";e.__esModule=!0,e.renderQrCode=void 0;var n=r(3),r=r(13),a=n.promisify(r.toCanvas);e.renderQrCode=function(t){var e=t.canvas,r=t.content,n=t.width,o=void 0===n?0:n,t=t.nodeQrCodeOptions,i=void 0===t?{}:t;return i.errorCorrectionLevel=i.errorCorrectionLevel||s(r),u(r,i).then(function(t){return i.scale=0===o?void 0:o/t*4,a(e,r,i)})};var u=function(t,e){var r=document.createElement("canvas");return a(r,t,e).then(function(){return r.width})},s=function(t){return 36<t.length?"M":16<t.length?"Q":"H"}},function(t,e,r){var s=r(14),f=r(15),n=r(37),o=r(38);function i(n,o,i,a,e){var t=[].slice.call(arguments,1),r=t.length,t="function"==typeof t[r-1];if(!t&&!s())throw new Error("Callback required as last argument");if(!t){if(r<1)throw new Error("Too few arguments provided");return 1===r?(i=o,o=a=void 0):2!==r||o.getContext||(a=i,i=o,o=void 0),new Promise(function(t,e){try{var r=f.create(i,a);t(n(r,o,a))}catch(t){e(t)}})}if(r<2)throw new Error("Too few arguments provided");2===r?(e=i,i=o,o=a=void 0):3===r&&(o.getContext&&void 0===e?(e=a,a=void 0):(e=a,a=i,i=o,o=void 0));try{var u=f.create(i,a);e(null,n(u,o,a))}catch(t){e(t)}}e.create=f.create,e.toCanvas=i.bind(null,n.render),e.toDataURL=i.bind(null,n.renderToDataURL),e.toString=i.bind(null,function(t,e,r){return o.render(t,r)})},function(t,e){t.exports=function(){return"function"==typeof Promise&&Promise.prototype&&Promise.prototype.then}},function(t,e,r){var A=r(2),R=r(0),i=r(5),a=r(16),u=r(17),s=r(18),f=r(19),h=r(20),P=r(7),_=r(21),c=r(29),l=r(30),g=r(1),p=r(31),d=r(4);function v(t,e,r){for(var n,o=t.size,i=l.getEncodedBits(e,r),a=0;a<15;a++)n=1==(i>>a&1),a<6?t.set(a,8,n,!0):a<8?t.set(a+1,8,n,!0):t.set(o-15+a,8,n,!0),a<8?t.set(8,o-a-1,n,!0):a<9?t.set(8,15-a-1+1,n,!0):t.set(8,15-a-1,n,!0);t.set(o-8,8,1,!0)}function y(e,t,r){var n=new a;r.forEach(function(t){n.put(t.mode.bit,4),n.put(t.getLength(),g.getCharCountIndicator(t.mode,e)),t.write(n)});r=8*(R.getSymbolTotalCodewords(e)-P.getTotalCodewordsCount(e,t));for(n.getLengthInBits()+4<=r&&n.put(0,4);n.getLengthInBits()%8!=0;)n.putBit(0);for(var o=(r-n.getLengthInBits())/8,i=0;i<o;i++)n.put(i%2?17:236,8);return function(t,e,r){for(var n=R.getSymbolTotalCodewords(e),o=P.getTotalCodewordsCount(e,r),o=n-o,i=P.getBlocksCount(e,r),a=i-n%i,r=Math.floor(n/i),u=Math.floor(o/i),s=u+1,f=r-u,h=new _(f),c=0,l=new Array(i),g=new Array(i),p=0,d=A.from(t.buffer),v=0;v<i;v++){var y=v<a?u:s;l[v]=d.slice(c,c+y),g[v]=h.encode(l[v]),c+=y,p=Math.max(p,y)}var w,m,b=A.alloc(n),E=0;for(w=0;w<p;w++)for(m=0;m<i;m++)w<l[m].length&&(b[E++]=l[m][w]);for(w=0;w<f;w++)for(m=0;m<i;m++)b[E++]=g[m][w];return b}(n,e,t)}function w(t,e,r,n){var o;if(d(t))o=p.fromArray(t);else{if("string"!=typeof t)throw new Error("Invalid data");var i,a=e;a||(i=p.rawSplit(t),a=c.getBestVersionForData(i,r)),o=p.fromString(t,a||40)}t=c.getBestVersionForData(o,r);if(!t)throw new Error("The amount of data is too big to be stored in a QR Code");if(e){if(e<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 e=t;a=y(e,r,o),t=R.getSymbolSize(e),t=new u(t);return function(t,e){for(var r=t.size,n=f.getPositions(e),o=0;o<n.length;o++)for(var i=n[o][0],a=n[o][1],u=-1;u<=7;u++)if(!(i+u<=-1||r<=i+u))for(var s=-1;s<=7;s++)a+s<=-1||r<=a+s||(0<=u&&u<=6&&(0===s||6===s)||0<=s&&s<=6&&(0===u||6===u)||2<=u&&u<=4&&2<=s&&s<=4?t.set(i+u,a+s,!0,!0):t.set(i+u,a+s,!1,!0))}(t,e),function(t){for(var e=t.size,r=8;r<e-8;r++){var n=r%2==0;t.set(r,6,n,!0),t.set(6,r,n,!0)}}(t),function(t,e){for(var r=s.getPositions(e),n=0;n<r.length;n++)for(var o=r[n][0],i=r[n][1],a=-2;a<=2;a++)for(var u=-2;u<=2;u++)-2===a||2===a||-2===u||2===u||0===a&&0===u?t.set(o+a,i+u,!0,!0):t.set(o+a,i+u,!1,!0)}(t,e),v(t,r,0),7<=e&&function(t,e){for(var r,n,o,i=t.size,a=c.getEncodedBits(e),u=0;u<18;u++)r=Math.floor(u/3),t.set(r,n=u%3+i-8-3,o=1==(a>>u&1),!0),t.set(n,r,o,!0)}(t,e),function(t,e){for(var r=t.size,n=-1,o=r-1,i=7,a=0,u=r-1;0<u;u-=2)for(6===u&&u--;;){for(var s,f=0;f<2;f++)t.isReserved(o,u-f)||(s=!1,a<e.length&&(s=1==(e[a]>>>i&1)),t.set(o,u-f,s),-1===--i&&(a++,i=7));if((o+=n)<0||r<=o){o-=n,n=-n;break}}}(t,a),isNaN(n)&&(n=h.getBestMask(t,v.bind(null,t,r))),h.applyMask(n,t),v(t,r,n),{modules:t,version:e,errorCorrectionLevel:r,maskPattern:n,segments:o}}e.create=function(t,e){if(void 0===t||""===t)throw new Error("No input text");var r,n,o=i.M;return void 0!==e&&(o=i.from(e.errorCorrectionLevel,i.M),r=c.from(e.version),n=h.from(e.maskPattern),e.toSJISFunc&&R.setToSJISFunction(e.toSJISFunc)),w(t,r,o,n)}},function(t,e){function r(){this.buffer=[],this.length=0}r.prototype={get:function(t){var e=Math.floor(t/8);return 1==(this.buffer[e]>>>7-t%8&1)},put:function(t,e){for(var r=0;r<e;r++)this.putBit(1==(t>>>e-r-1&1))},getLengthInBits:function(){return this.length},putBit:function(t){var e=Math.floor(this.length/8);this.buffer.length<=e&&this.buffer.push(0),t&&(this.buffer[e]|=128>>>this.length%8),this.length++}},t.exports=r},function(t,e,r){var n=r(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,e,r,n){e=t*this.size+e;this.data[e]=r,n&&(this.reservedBit[e]=!0)},o.prototype.get=function(t,e){return this.data[t*this.size+e]},o.prototype.xor=function(t,e,r){this.data[t*this.size+e]^=r},o.prototype.isReserved=function(t,e){return this.reservedBit[t*this.size+e]},t.exports=o},function(t,a,e){var i=e(0).getSymbolSize;a.getRowColCoords=function(t){if(1===t)return[];for(var e=Math.floor(t/7)+2,t=i(t),r=145===t?26:2*Math.ceil((t-13)/(2*e-2)),n=[t-7],o=1;o<e-1;o++)n[o]=n[o-1]-r;return n.push(6),n.reverse()},a.getPositions=function(t){for(var e=[],r=a.getRowColCoords(t),n=r.length,o=0;o<n;o++)for(var i=0;i<n;i++)0===o&&0===i||0===o&&i===n-1||o===n-1&&0===i||e.push([r[o],r[i]]);return e}},function(t,e,r){var n=r(0).getSymbolSize;e.getPositions=function(t){t=n(t);return[[0,0],[t-7,0],[0,t-7]]}},function(t,u){u.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};var h=3,a=3,s=40,o=10;u.isValid=function(t){return null!=t&&""!==t&&!isNaN(t)&&0<=t&&t<=7},u.from=function(t){return u.isValid(t)?parseInt(t,10):void 0},u.getPenaltyN1=function(t){for(var e=t.size,r=0,n=0,o=0,i=null,a=null,u=0;u<e;u++){for(var n=o=0,i=a=null,s=0;s<e;s++){var f=t.get(u,s);f===i?n++:(5<=n&&(r+=h+(n-5)),i=f,n=1),(f=t.get(s,u))===a?o++:(5<=o&&(r+=h+(o-5)),a=f,o=1)}5<=n&&(r+=h+(n-5)),5<=o&&(r+=h+(o-5))}return r},u.getPenaltyN2=function(t){for(var e=t.size,r=0,n=0;n<e-1;n++)for(var o=0;o<e-1;o++){var i=t.get(n,o)+t.get(n,o+1)+t.get(n+1,o)+t.get(n+1,o+1);4!==i&&0!==i||r++}return r*a},u.getPenaltyN3=function(t){for(var e=t.size,r=0,n=0,o=0,i=0;i<e;i++)for(var n=o=0,a=0;a<e;a++)n=n<<1&2047|t.get(i,a),10<=a&&(1488===n||93===n)&&r++,o=o<<1&2047|t.get(a,i),10<=a&&(1488===o||93===o)&&r++;return r*s},u.getPenaltyN4=function(t){for(var e=0,r=t.data.length,n=0;n<r;n++)e+=t.data[n];return Math.abs(Math.ceil(100*e/r/5)-10)*o},u.applyMask=function(t,e){for(var r=e.size,n=0;n<r;n++)for(var o=0;o<r;o++)e.isReserved(o,n)||e.xor(o,n,function(t,e,r){switch(t){case u.Patterns.PATTERN000:return(e+r)%2==0;case u.Patterns.PATTERN001:return e%2==0;case u.Patterns.PATTERN010:return r%3==0;case u.Patterns.PATTERN011:return(e+r)%3==0;case u.Patterns.PATTERN100:return(Math.floor(e/2)+Math.floor(r/3))%2==0;case u.Patterns.PATTERN101:return e*r%2+e*r%3==0;case u.Patterns.PATTERN110:return(e*r%2+e*r%3)%2==0;case u.Patterns.PATTERN111:return(e*r%3+(e+r)%2)%2==0;default:throw new Error("bad maskPattern:"+t)}}(t,o,n))},u.getBestMask=function(t,e){for(var r=Object.keys(u.Patterns).length,n=0,o=1/0,i=0;i<r;i++){e(i),u.applyMask(i,t);var a=u.getPenaltyN1(t)+u.getPenaltyN2(t)+u.getPenaltyN3(t)+u.getPenaltyN4(t);u.applyMask(i,t),a<o&&(o=a,n=i)}return n}},function(t,e,r){var n=r(2),o=r(22),i=r(24).Buffer;function a(t){this.genPoly=void 0,this.degree=t,this.degree&&this.initialize(this.degree)}a.prototype.initialize=function(t){this.degree=t,this.genPoly=o.generateECPolynomial(this.degree)},a.prototype.encode=function(t){if(!this.genPoly)throw new Error("Encoder not initialized");var e=n.alloc(this.degree),r=i.concat([t,e],t.length+this.degree),e=o.mod(r,this.genPoly),t=this.degree-e.length;if(0<t){r=n.alloc(this.degree);return e.copy(r,t),r}return e},t.exports=a},function(t,n,e){var a=e(2),u=e(23);n.mul=function(t,e){for(var r=a.alloc(t.length+e.length-1),n=0;n<t.length;n++)for(var o=0;o<e.length;o++)r[n+o]^=u.mul(t[n],e[o]);return r},n.mod=function(t,e){for(var r=a.from(t);0<=r.length-e.length;){for(var n=r[0],o=0;o<e.length;o++)r[o]^=u.mul(e[o],n);for(var i=0;i<r.length&&0===r[i];)i++;r=r.slice(i)}return r},n.generateECPolynomial=function(t){for(var e=a.from([1]),r=0;r<t;r++)e=n.mul(e,[1,u.exp(r)]);return e}},function(t,e,r){var r=r(2),n=r.alloc(512),o=r.alloc(256);!function(){for(var t=1,e=0;e<255;e++)n[e]=t,o[t]=e,256&(t<<=1)&&(t^=285);for(e=255;e<512;e++)n[e]=n[e-255]}(),e.log=function(t){if(t<1)throw new Error("log("+t+")");return o[t]},e.exp=function(t){return n[t]},e.mul=function(t,e){return 0===t||0===e?0:n[o[t]+o[e]]}},function(t,U,x){"use strict";!function(t){
/*!
* The buffer module from node.js, for the browser.
*
* @author Feross Aboukhadijeh <http://feross.org>
* @license MIT
*/
var u=x(26),i=x(27),a=x(28);function r(){return c.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function o(t,e){if(r()<e)throw new RangeError("Invalid typed array length");return c.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(e)).__proto__=c.prototype:(t=null===t?new c(e):t).length=e,t}function c(t,e,r){if(!(c.TYPED_ARRAY_SUPPORT||this instanceof c))return new c(t,e,r);if("number"!=typeof t)return n(this,t,e,r);if("string"==typeof e)throw new Error("If encoding is specified then the first argument must be a string");return f(this,t)}function n(t,e,r,n){if("number"==typeof e)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer?function(t,e,r,n){if(e.byteLength,r<0||e.byteLength<r)throw new RangeError("'offset' is out of bounds");if(e.byteLength<r+(n||0))throw new RangeError("'length' is out of bounds");e=void 0===r&&void 0===n?new Uint8Array(e):void 0===n?new Uint8Array(e,r):new Uint8Array(e,r,n);c.TYPED_ARRAY_SUPPORT?(t=e).__proto__=c.prototype:t=h(t,e);return t}(t,e,r,n):"string"==typeof e?function(t,e,r){"string"==typeof r&&""!==r||(r="utf8");if(!c.isEncoding(r))throw new TypeError('"encoding" must be a valid string encoding');var n=0|g(e,r),r=(t=o(t,n)).write(e,r);r!==n&&(t=t.slice(0,r));return t}(t,e,r):function(t,e){if(c.isBuffer(e)){var r=0|l(e.length);return 0===(t=o(t,r)).length?t:(e.copy(t,0,0,r),t)}if(e){if("undefined"!=typeof ArrayBuffer&&e.buffer instanceof ArrayBuffer||"length"in e)return"number"!=typeof e.length||function(t){return t!=t}(e.length)?o(t,0):h(t,e);if("Buffer"===e.type&&a(e.data))return h(t,e.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(t,e)}function s(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 f(t,e){if(s(e),t=o(t,e<0?0:0|l(e)),!c.TYPED_ARRAY_SUPPORT)for(var r=0;r<e;++r)t[r]=0;return t}function h(t,e){var r=e.length<0?0:0|l(e.length);t=o(t,r);for(var n=0;n<r;n+=1)t[n]=255&e[n];return t}function l(t){if(t>=r())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+r().toString(16)+" bytes");return 0|t}function g(t,e){if(c.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;var r=(t="string"!=typeof t?""+t:t).length;if(0===r)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return I(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return S(t).length;default:if(n)return I(t).length;e=(""+e).toLowerCase(),n=!0}}function e(t,e,r){var n,o,i,a=!1;if((e=void 0===e||e<0?0:e)>this.length)return"";if((r=void 0===r||r>this.length?this.length:r)<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t=t||"utf8";;)switch(t){case"hex":return function(t,e,r){var n=t.length;(!e||e<0)&&(e=0);(!r||r<0||n<r)&&(r=n);for(var o="",i=e;i<r;++i)o+=function(t){return t<16?"0"+t.toString(16):t.toString(16)}(t[i]);return o}(this,e,r);case"utf8":case"utf-8":return m(this,e,r);case"ascii":return function(t,e,r){var n="";r=Math.min(t.length,r);for(var o=e;o<r;++o)n+=String.fromCharCode(127&t[o]);return n}(this,e,r);case"latin1":case"binary":return function(t,e,r){var n="";r=Math.min(t.length,r);for(var o=e;o<r;++o)n+=String.fromCharCode(t[o]);return n}(this,e,r);case"base64":return n=this,i=r,0===(o=e)&&i===n.length?u.fromByteArray(n):u.fromByteArray(n.slice(o,i));case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return function(t,e,r){for(var n=t.slice(e,r),o="",i=0;i<n.length;i+=2)o+=String.fromCharCode(n[i]+256*n[i+1]);return o}(this,e,r);default:if(a)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),a=!0}}function p(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function d(t,e,r,n,o){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):2147483647<r?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,(r=(r=isNaN(r)?o?0:t.length-1:r)<0?t.length+r:r)>=t.length){if(o)return-1;r=t.length-1}else if(r<0){if(!o)return-1;r=0}if("string"==typeof e&&(e=c.from(e,n)),c.isBuffer(e))return 0===e.length?-1:v(t,e,r,n,o);if("number"==typeof e)return e&=255,c.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?(o?Uint8Array.prototype.indexOf:Uint8Array.prototype.lastIndexOf).call(t,e,r):v(t,[e],r,n,o);throw new TypeError("val must be string, number or Buffer")}function v(t,e,r,n,o){var i=1,a=t.length,u=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;a/=i=2,u/=2,r/=2}function s(t,e){return 1===i?t[e]:t.readUInt16BE(e*i)}if(o)for(var f=-1,h=r;h<a;h++)if(s(t,h)===s(e,-1===f?0:h-f)){if(h-(f=-1===f?h:f)+1===u)return f*i}else-1!==f&&(h-=h-f),f=-1;else for(h=r=a<r+u?a-u:r;0<=h;h--){for(var c=!0,l=0;l<u;l++)if(s(t,h+l)!==s(e,l)){c=!1;break}if(c)return h}return-1}function y(t,e,r,n){return M(function(t){for(var e=[],r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}(e),t,r,n)}function w(t,e,r,n){return M(function(t,e){for(var r,n,o=[],i=0;i<t.length&&!((e-=2)<0);++i)n=t.charCodeAt(i),r=n>>8,n=n%256,o.push(n),o.push(r);return o}(e,t.length-r),t,r,n)}function m(t,e,r){r=Math.min(t.length,r);for(var n=[],o=e;o<r;){var i,a,u,s,f=t[o],h=null,c=239<f?4:223<f?3:191<f?2:1;if(o+c<=r)switch(c){case 1:f<128&&(h=f);break;case 2:128==(192&(i=t[o+1]))&&127<(s=(31&f)<<6|63&i)&&(h=s);break;case 3:i=t[o+1],a=t[o+2],128==(192&i)&&128==(192&a)&&2047<(s=(15&f)<<12|(63&i)<<6|63&a)&&(s<55296||57343<s)&&(h=s);break;case 4:i=t[o+1],a=t[o+2],u=t[o+3],128==(192&i)&&128==(192&a)&&128==(192&u)&&65535<(s=(15&f)<<18|(63&i)<<12|(63&a)<<6|63&u)&&s<1114112&&(h=s)}null===h?(h=65533,c=1):65535<h&&(h-=65536,n.push(h>>>10&1023|55296),h=56320|1023&h),n.push(h),o+=c}return function(t){var e=t.length;if(e<=b)return String.fromCharCode.apply(String,t);var r="",n=0;for(;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=b));return r}(n)}U.Buffer=c,U.SlowBuffer=function(t){+t!=t&&(t=0);return c.alloc(+t)},U.INSPECT_MAX_BYTES=50,c.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}}(),U.kMaxLength=r(),c.poolSize=8192,c._augment=function(t){return t.__proto__=c.prototype,t},c.from=function(t,e,r){return n(null,t,e,r)},c.TYPED_ARRAY_SUPPORT&&(c.prototype.__proto__=Uint8Array.prototype,c.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&c[Symbol.species]===c&&Object.defineProperty(c,Symbol.species,{value:null,configurable:!0})),c.alloc=function(t,e,r){return n=null,e=e,r=r,s(t=t),!(t<=0)&&void 0!==e?"string"==typeof r?o(n,t).fill(e,r):o(n,t).fill(e):o(n,t);var n},c.allocUnsafe=function(t){return f(null,t)},c.allocUnsafeSlow=function(t){return f(null,t)},c.isBuffer=function(t){return!(null==t||!t._isBuffer)},c.compare=function(t,e){if(!c.isBuffer(t)||!c.isBuffer(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var r=t.length,n=e.length,o=0,i=Math.min(r,n);o<i;++o)if(t[o]!==e[o]){r=t[o],n=e[o];break}return r<n?-1:n<r?1:0},c.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}},c.concat=function(t,e){if(!a(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return c.alloc(0);if(void 0===e)for(o=e=0;o<t.length;++o)e+=t[o].length;for(var r=c.allocUnsafe(e),n=0,o=0;o<t.length;++o){var i=t[o];if(!c.isBuffer(i))throw new TypeError('"list" argument must be an Array of Buffers');i.copy(r,n),n+=i.length}return r},c.byteLength=g,c.prototype._isBuffer=!0,c.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 e=0;e<t;e+=2)p(this,e,e+1);return this},c.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 e=0;e<t;e+=4)p(this,e,e+3),p(this,e+1,e+2);return this},c.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 e=0;e<t;e+=8)p(this,e,e+7),p(this,e+1,e+6),p(this,e+2,e+5),p(this,e+3,e+4);return this},c.prototype.toString=function(){var t=0|this.length;return 0==t?"":0===arguments.length?m(this,0,t):e.apply(this,arguments)},c.prototype.equals=function(t){if(!c.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===c.compare(this,t)},c.prototype.inspect=function(){var t="",e=U.INSPECT_MAX_BYTES;return 0<this.length&&(t=this.toString("hex",0,e).match(/.{2}/g).join(" "),this.length>e&&(t+=" ... ")),"<Buffer "+t+">"},c.prototype.compare=function(t,e,r,n,o){if(!c.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===o&&(o=this.length),(e=void 0===e?0:e)<0||r>t.length||n<0||o>this.length)throw new RangeError("out of range index");if(o<=n&&r<=e)return 0;if(o<=n)return-1;if(r<=e)return 1;if(this===t)return 0;for(var i=(o>>>=0)-(n>>>=0),a=(r>>>=0)-(e>>>=0),u=Math.min(i,a),s=this.slice(n,o),f=t.slice(e,r),h=0;h<u;++h)if(s[h]!==f[h]){i=s[h],a=f[h];break}return i<a?-1:a<i?1:0},c.prototype.includes=function(t,e,r){return-1!==this.indexOf(t,e,r)},c.prototype.indexOf=function(t,e,r){return d(this,t,e,r,!0)},c.prototype.lastIndexOf=function(t,e,r){return d(this,t,e,r,!1)},c.prototype.write=function(t,e,r,n){if(void 0===e)n="utf8",r=this.length,e=0;else if(void 0===r&&"string"==typeof e)n=e,r=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e|=0,isFinite(r)?(r|=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var o=this.length-e;if((void 0===r||o<r)&&(r=o),0<t.length&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n=n||"utf8";for(var i,a,u,s=!1;;)switch(n){case"hex":return function(t,e,r,n){r=Number(r)||0;var o=t.length-r;if((!n||o<(n=Number(n)))&&(n=o),(o=e.length)%2!=0)throw new TypeError("Invalid hex string");o/2<n&&(n=o/2);for(var i=0;i<n;++i){var a=parseInt(e.substr(2*i,2),16);if(isNaN(a))return i;t[r+i]=a}return i}(this,t,e,r);case"utf8":case"utf-8":return a=e,u=r,M(I(t,(i=this).length-a),i,a,u);case"ascii":return y(this,t,e,r);case"latin1":case"binary":return y(this,t,e,r);case"base64":return i=this,a=e,u=r,M(S(t),i,a,u);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return w(this,t,e,r);default:if(s)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),s=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var b=4096;function E(t,e,r){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(r<t+e)throw new RangeError("Trying to access beyond buffer length")}function A(t,e,r,n,o,i){if(!c.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(o<e||e<i)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}function R(t,e,r,n){e<0&&(e=65535+e+1);for(var o=0,i=Math.min(t.length-r,2);o<i;++o)t[r+o]=(e&255<<8*(n?o:1-o))>>>8*(n?o:1-o)}function P(t,e,r,n){e<0&&(e=4294967295+e+1);for(var o=0,i=Math.min(t.length-r,4);o<i;++o)t[r+o]=e>>>8*(n?o:3-o)&255}function _(t,e,r,n){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function B(t,e,r,n,o){return o||_(t,0,r,4),i.write(t,e,r,n,23,4),r+4}function T(t,e,r,n,o){return o||_(t,0,r,8),i.write(t,e,r,n,52,8),r+8}c.prototype.slice=function(t,e){var r=this.length;if((t=~~t)<0?(t+=r)<0&&(t=0):r<t&&(t=r),(e=void 0===e?r:~~e)<0?(e+=r)<0&&(e=0):r<e&&(e=r),e<t&&(e=t),c.TYPED_ARRAY_SUPPORT)(o=this.subarray(t,e)).__proto__=c.prototype;else for(var n=e-t,o=new c(n,void 0),i=0;i<n;++i)o[i]=this[i+t];return o},c.prototype.readUIntLE=function(t,e,r){t|=0,e|=0,r||E(t,e,this.length);for(var n=this[t],o=1,i=0;++i<e&&(o*=256);)n+=this[t+i]*o;return n},c.prototype.readUIntBE=function(t,e,r){t|=0,e|=0,r||E(t,e,this.length);for(var n=this[t+--e],o=1;0<e&&(o*=256);)n+=this[t+--e]*o;return n},c.prototype.readUInt8=function(t,e){return e||E(t,1,this.length),this[t]},c.prototype.readUInt16LE=function(t,e){return e||E(t,2,this.length),this[t]|this[t+1]<<8},c.prototype.readUInt16BE=function(t,e){return e||E(t,2,this.length),this[t]<<8|this[t+1]},c.prototype.readUInt32LE=function(t,e){return e||E(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},c.prototype.readUInt32BE=function(t,e){return e||E(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},c.prototype.readIntLE=function(t,e,r){t|=0,e|=0,r||E(t,e,this.length);for(var n=this[t],o=1,i=0;++i<e&&(o*=256);)n+=this[t+i]*o;return(o*=128)<=n&&(n-=Math.pow(2,8*e)),n},c.prototype.readIntBE=function(t,e,r){t|=0,e|=0,r||E(t,e,this.length);for(var n=e,o=1,i=this[t+--n];0<n&&(o*=256);)i+=this[t+--n]*o;return(o*=128)<=i&&(i-=Math.pow(2,8*e)),i},c.prototype.readInt8=function(t,e){return e||E(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},c.prototype.readInt16LE=function(t,e){e||E(t,2,this.length);t=this[t]|this[t+1]<<8;return 32768&t?4294901760|t:t},c.prototype.readInt16BE=function(t,e){e||E(t,2,this.length);t=this[t+1]|this[t]<<8;return 32768&t?4294901760|t:t},c.prototype.readInt32LE=function(t,e){return e||E(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},c.prototype.readInt32BE=function(t,e){return e||E(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},c.prototype.readFloatLE=function(t,e){return e||E(t,4,this.length),i.read(this,t,!0,23,4)},c.prototype.readFloatBE=function(t,e){return e||E(t,4,this.length),i.read(this,t,!1,23,4)},c.prototype.readDoubleLE=function(t,e){return e||E(t,8,this.length),i.read(this,t,!0,52,8)},c.prototype.readDoubleBE=function(t,e){return e||E(t,8,this.length),i.read(this,t,!1,52,8)},c.prototype.writeUIntLE=function(t,e,r,n){t=+t,e|=0,r|=0,n||A(this,t,e,r,Math.pow(2,8*r)-1,0);var o=1,i=0;for(this[e]=255&t;++i<r&&(o*=256);)this[e+i]=t/o&255;return e+r},c.prototype.writeUIntBE=function(t,e,r,n){t=+t,e|=0,r|=0,n||A(this,t,e,r,Math.pow(2,8*r)-1,0);var o=r-1,i=1;for(this[e+o]=255&t;0<=--o&&(i*=256);)this[e+o]=t/i&255;return e+r},c.prototype.writeUInt8=function(t,e,r){return t=+t,e|=0,r||A(this,t,e,1,255,0),c.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},c.prototype.writeUInt16LE=function(t,e,r){return t=+t,e|=0,r||A(this,t,e,2,65535,0),c.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):R(this,t,e,!0),e+2},c.prototype.writeUInt16BE=function(t,e,r){return t=+t,e|=0,r||A(this,t,e,2,65535,0),c.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):R(this,t,e,!1),e+2},c.prototype.writeUInt32LE=function(t,e,r){return t=+t,e|=0,r||A(this,t,e,4,4294967295,0),c.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):P(this,t,e,!0),e+4},c.prototype.writeUInt32BE=function(t,e,r){return t=+t,e|=0,r||A(this,t,e,4,4294967295,0),c.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):P(this,t,e,!1),e+4},c.prototype.writeIntLE=function(t,e,r,n){t=+t,e|=0,n||A(this,t,e,r,(n=Math.pow(2,8*r-1))-1,-n);var o=0,i=1,a=0;for(this[e]=255&t;++o<r&&(i*=256);)t<0&&0===a&&0!==this[e+o-1]&&(a=1),this[e+o]=(t/i>>0)-a&255;return e+r},c.prototype.writeIntBE=function(t,e,r,n){t=+t,e|=0,n||A(this,t,e,r,(n=Math.pow(2,8*r-1))-1,-n);var o=r-1,i=1,a=0;for(this[e+o]=255&t;0<=--o&&(i*=256);)t<0&&0===a&&0!==this[e+o+1]&&(a=1),this[e+o]=(t/i>>0)-a&255;return e+r},c.prototype.writeInt8=function(t,e,r){return t=+t,e|=0,r||A(this,t,e,1,127,-128),c.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&(t=t<0?255+t+1:t),e+1},c.prototype.writeInt16LE=function(t,e,r){return t=+t,e|=0,r||A(this,t,e,2,32767,-32768),c.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):R(this,t,e,!0),e+2},c.prototype.writeInt16BE=function(t,e,r){return t=+t,e|=0,r||A(this,t,e,2,32767,-32768),c.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):R(this,t,e,!1),e+2},c.prototype.writeInt32LE=function(t,e,r){return t=+t,e|=0,r||A(this,t,e,4,2147483647,-2147483648),c.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):P(this,t,e,!0),e+4},c.prototype.writeInt32BE=function(t,e,r){return t=+t,e|=0,r||A(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),c.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):P(this,t,e,!1),e+4},c.prototype.writeFloatLE=function(t,e,r){return B(this,t,e,!0,r)},c.prototype.writeFloatBE=function(t,e,r){return B(this,t,e,!1,r)},c.prototype.writeDoubleLE=function(t,e,r){return T(this,t,e,!0,r)},c.prototype.writeDoubleBE=function(t,e,r){return T(this,t,e,!1,r)},c.prototype.copy=function(t,e,r,n){if(r=r||0,n||0===n||(n=this.length),e>=t.length&&(e=t.length),(n=0<n&&n<r?r:n)===r)return 0;if(0===t.length||0===this.length)return 0;if((e=e||0)<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=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-e<n-r?t.length-e+r:n)-r;if(this===t&&r<e&&e<n)for(o=i-1;0<=o;--o)t[o+e]=this[o+r];else if(i<1e3||!c.TYPED_ARRAY_SUPPORT)for(o=0;o<i;++o)t[o+e]=this[o+r];else Uint8Array.prototype.set.call(t,this.subarray(r,r+i),e);return i},c.prototype.fill=function(t,e,r,n){if("string"==typeof t){var o;if("string"==typeof e?(n=e,e=0,r=this.length):"string"==typeof r&&(n=r,r=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&&!c.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else"number"==typeof t&&(t&=255);if(e<0||this.length<e||this.length<r)throw new RangeError("Out of range index");if(r<=e)return this;if(e>>>=0,r=void 0===r?this.length:r>>>0,"number"==typeof(t=t||0))for(u=e;u<r;++u)this[u]=t;else for(var i=c.isBuffer(t)?t:I(new c(t,n).toString()),a=i.length,u=0;u<r-e;++u)this[u+e]=i[u%a];return this};var C=/[^+\/0-9A-Za-z-_]/g;function I(t,e){var r;e=e||1/0;for(var n=t.length,o=null,i=[],a=0;a<n;++a){if(55295<(r=t.charCodeAt(a))&&r<57344){if(!o){if(56319<r){-1<(e-=3)&&i.push(239,191,189);continue}if(a+1===n){-1<(e-=3)&&i.push(239,191,189);continue}o=r;continue}if(r<56320){-1<(e-=3)&&i.push(239,191,189),o=r;continue}r=65536+(o-55296<<10|r-56320)}else o&&-1<(e-=3)&&i.push(239,191,189);if(o=null,r<128){if(--e<0)break;i.push(r)}else if(r<2048){if((e-=2)<0)break;i.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;i.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return i}function S(t){return u.toByteArray(function(t){var e;if((t=((e=t).trim?e.trim():e.replace(/^\s+|\s+$/g,"")).replace(C,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function M(t,e,r,n){for(var o=0;o<n&&!(o+r>=e.length||o>=t.length);++o)e[o+r]=t[o];return o}}.call(this,x(25))},function(t,e){var r=function(){return this}();try{r=r||new Function("return this")()}catch(t){"object"==typeof window&&(r=window)}t.exports=r},function(t,e,r){"use strict";e.byteLength=function(t){var e=h(t),t=e[0],e=e[1];return 3*(t+e)/4-e},e.toByteArray=function(t){var e,r,n=h(t),o=n[0],n=n[1],i=new f(function(t,e){return 3*(t+e)/4-e}(o,n)),a=0,u=0<n?o-4:o;for(r=0;r<u;r+=4)e=s[t.charCodeAt(r)]<<18|s[t.charCodeAt(r+1)]<<12|s[t.charCodeAt(r+2)]<<6|s[t.charCodeAt(r+3)],i[a++]=e>>16&255,i[a++]=e>>8&255,i[a++]=255&e;2===n&&(e=s[t.charCodeAt(r)]<<2|s[t.charCodeAt(r+1)]>>4,i[a++]=255&e);1===n&&(e=s[t.charCodeAt(r)]<<10|s[t.charCodeAt(r+1)]<<4|s[t.charCodeAt(r+2)]>>2,i[a++]=e>>8&255,i[a++]=255&e);return i},e.fromByteArray=function(t){for(var e,r=t.length,n=r%3,o=[],i=0,a=r-n;i<a;i+=16383)o.push(function(t,e,r){for(var n,o=[],i=e;i<r;i+=3)n=(t[i]<<16&16711680)+(t[i+1]<<8&65280)+(255&t[i+2]),o.push(function(t){return u[t>>18&63]+u[t>>12&63]+u[t>>6&63]+u[63&t]}(n));return o.join("")}(t,i,a<i+16383?a:i+16383));1==n?(e=t[r-1],o.push(u[e>>2]+u[e<<4&63]+"==")):2==n&&(e=(t[r-2]<<8)+t[r-1],o.push(u[e>>10]+u[e>>4&63]+u[e<<2&63]+"="));return o.join("")};for(var u=[],s=[],f="undefined"!=typeof Uint8Array?Uint8Array:Array,n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=0,i=n.length;o<i;++o)u[o]=n[o],s[n.charCodeAt(o)]=o;function h(t){var e=t.length;if(0<e%4)throw new Error("Invalid string. Length must be a multiple of 4");t=t.indexOf("=");return[t=-1===t?e:t,t===e?0:4-t%4]}s["-".charCodeAt(0)]=62,s["_".charCodeAt(0)]=63},function(t,e){
/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
e.read=function(t,e,r,n,o){var i,a,u=8*o-n-1,s=(1<<u)-1,f=s>>1,h=-7,c=r?o-1:0,l=r?-1:1,r=t[e+c];for(c+=l,i=r&(1<<-h)-1,r>>=-h,h+=u;0<h;i=256*i+t[e+c],c+=l,h-=8);for(a=i&(1<<-h)-1,i>>=-h,h+=n;0<h;a=256*a+t[e+c],c+=l,h-=8);if(0===i)i=1-f;else{if(i===s)return a?NaN:1/0*(r?-1:1);a+=Math.pow(2,n),i-=f}return(r?-1:1)*a*Math.pow(2,i-n)},e.write=function(t,e,r,n,o,i){var a,u,s=8*i-o-1,f=(1<<s)-1,h=f>>1,c=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,l=n?0:i-1,g=n?1:-1,i=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(u=isNaN(e)?1:0,a=f):(a=Math.floor(Math.log(e)/Math.LN2),e*(n=Math.pow(2,-a))<1&&(a--,n*=2),2<=(e+=1<=a+h?c/n:c*Math.pow(2,1-h))*n&&(a++,n/=2),f<=a+h?(u=0,a=f):1<=a+h?(u=(e*n-1)*Math.pow(2,o),a+=h):(u=e*Math.pow(2,h-1)*Math.pow(2,o),a=0));8<=o;t[r+l]=255&u,l+=g,u/=256,o-=8);for(a=a<<o|u,s+=o;0<s;t[r+l]=255&a,l+=g,a/=256,s-=8);t[r+l-g]|=128*i}},function(t,e){var r={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==r.call(t)}},function(t,o,e){var i=e(0),a=e(7),n=e(5),u=e(1),s=e(8),f=e(4),r=i.getBCHDigit(7973);function h(t,e){return u.getCharCountIndicator(t,e)+4}function c(t,e){for(var r=1;r<=40;r++)if(function(t,r){var n=0;return t.forEach(function(t){var e=h(t.mode,r);n+=e+t.getBitsLength()}),n}(t,r)<=o.getCapacity(r,e,u.MIXED))return r}o.from=function(t,e){return s.isValid(t)?parseInt(t,10):e},o.getCapacity=function(t,e,r){if(!s.isValid(t))throw new Error("Invalid QR Code version");void 0===r&&(r=u.BYTE);e=8*(i.getSymbolTotalCodewords(t)-a.getTotalCodewordsCount(t,e));if(r===u.MIXED)return e;var n=e-h(r,t);switch(r){case u.NUMERIC:return Math.floor(n/10*3);case u.ALPHANUMERIC:return Math.floor(n/11*2);case u.KANJI:return Math.floor(n/13);default:u.BYTE;return Math.floor(n/8)}},o.getBestVersionForData=function(t,e){var r,e=n.from(e,n.M);if(f(t)){if(1<t.length)return c(t,e);if(0===t.length)return 1;r=t[0]}else r=t;return function(t,e,r){for(var n=1;n<=40;n++)if(e<=o.getCapacity(n,r,t))return n}(r.mode,r.getLength(),e)},o.getEncodedBits=function(t){if(!s.isValid(t)||t<7)throw new Error("Invalid QR Code version");for(var e=t<<12;0<=i.getBCHDigit(e)-r;)e^=7973<<i.getBCHDigit(e)-r;return t<<12|e}},function(t,e,r){var n=r(0),o=n.getBCHDigit(1335);e.getEncodedBits=function(t,e){for(var e=t.bit<<3|e,r=e<<10;0<=n.getBCHDigit(r)-o;)r^=1335<<n.getBCHDigit(r)-o;return 21522^(e<<10|r)}},function(t,a,e){var g=e(1),n=e(32),o=e(33),i=e(34),u=e(35),s=e(9),f=e(0),h=e(36);function c(t){return unescape(encodeURIComponent(t)).length}function l(t,e,r){for(var n,o=[];null!==(n=t.exec(r));)o.push({data:n[0],index:n.index,mode:e,length:n[0].length});return o}function p(t){var e,r=l(s.NUMERIC,g.NUMERIC,t),n=l(s.ALPHANUMERIC,g.ALPHANUMERIC,t),t=f.isKanjiModeEnabled()?(e=l(s.BYTE,g.BYTE,t),l(s.KANJI,g.KANJI,t)):(e=l(s.BYTE_KANJI,g.BYTE,t),[]);return r.concat(n,e,t).sort(function(t,e){return t.index-e.index}).map(function(t){return{data:t.data,mode:t.mode,length:t.length}})}function d(t,e){switch(e){case g.NUMERIC:return n.getBitsLength(t);case g.ALPHANUMERIC:return o.getBitsLength(t);case g.KANJI:return u.getBitsLength(t);case g.BYTE:return i.getBitsLength(t)}}function r(t,e){var r=g.getBestModeForData(t),e=g.from(e,r);if(e!==g.BYTE&&e.bit<r.bit)throw new Error('"'+t+'" cannot be encoded with mode '+g.toString(e)+".\n Suggested mode is: "+g.toString(r));switch(e=e===g.KANJI&&!f.isKanjiModeEnabled()?g.BYTE:e){case g.NUMERIC:return new n(t);case g.ALPHANUMERIC:return new o(t);case g.KANJI:return new u(t);case g.BYTE:return new i(t)}}a.fromArray=function(t){return t.reduce(function(t,e){return"string"==typeof e?t.push(r(e,null)):e.data&&t.push(r(e.data,e.mode)),t},[])},a.fromString=function(t,e){for(var r=function(t,e){for(var r={},n={start:{}},o=["start"],i=0;i<t.length;i++){for(var a=t[i],u=[],s=0;s<a.length;s++){var f=a[s],h=""+i+s;u.push(h),r[h]={node:f,lastCount:0},n[h]={};for(var c=0;c<o.length;c++){var l=o[c];r[l]&&r[l].node.mode===f.mode?(n[l][h]=d(r[l].lastCount+f.length,f.mode)-d(r[l].lastCount,f.mode),r[l].lastCount+=f.length):(r[l]&&(r[l].lastCount=f.length),n[l][h]=d(f.length,f.mode)+4+g.getCharCountIndicator(f.mode,e))}}o=u}for(c=0;c<o.length;c++)n[o[c]].end=0;return{map:n,table:r}}(function(t){for(var e=[],r=0;r<t.length;r++){var n=t[r];switch(n.mode){case g.NUMERIC:e.push([n,{data:n.data,mode:g.ALPHANUMERIC,length:n.length},{data:n.data,mode:g.BYTE,length:n.length}]);break;case g.ALPHANUMERIC:e.push([n,{data:n.data,mode:g.BYTE,length:n.length}]);break;case g.KANJI:e.push([n,{data:n.data,mode:g.BYTE,length:c(n.data)}]);break;case g.BYTE:e.push([{data:n.data,mode:g.BYTE,length:c(n.data)}])}}return e}(p(t,f.isKanjiModeEnabled())),e),n=h.find_path(r.map,"start","end"),o=[],i=1;i<n.length-1;i++)o.push(r.table[n[i]].node);return a.fromArray(o.reduce(function(t,e){var