useblocks 1.1.31 → 1.1.36
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/iframe/js/amp.fvKwVZZd.js +1 -0
- package/iframe/js/iframe-eblock.js +1 -1
- package/iframe/js/iframe.js +1 -1
- package/iframe/js/rules.B4dVzZIU.js +1 -1
- package/package.json +1 -1
- package/singlepage_headless_plugin.html +1 -1
- package/static/core/0bc7891f.js +3 -0
- package/static/core/{adfe3cf3.js → 1b0f6f4c.js} +2 -2
- package/static/core/{4730e885.js → 1d945c1c.js} +2 -2
- package/static/core/{1f9e8a57.js → 259710d9.js} +1 -1
- package/static/core/{843bb3422.js → 38a5ad5e2.js} +1 -1
- package/static/core/{7f689997.js → 3dec3d84.js} +1 -1
- package/static/core/{594882f0.js → 51aa77cd.js} +3 -3
- package/static/core/{928d808b.js → 545b5c1c.js} +2 -2
- package/static/core/{f6dff18b.js → 84d85698.js} +1 -1
- package/static/core/{2c61f14b.js → 892a65e5.js} +2 -2
- package/static/core/8e2c3ebd.js +33 -0
- package/static/core/{b77ec308.js → 9bd41e07.js} +1 -1
- package/static/core/9c0bdeaa.js +895 -0
- package/static/core/9f938b05.js +1 -0
- package/static/core/{3cec0f58.js → b07072e6.js} +1 -1
- package/static/core/c8899df9.js +78 -0
- package/static/core/{beb4d9d1.js → c9c989ee.js} +1 -1
- package/static/core/{fe5c643b.js → f534b225.js} +2 -2
- package/static/esm/533d7587.js +1 -0
- package/two_step_headless_plugin.html +1 -1
- package/{useblocks-core.c327bc79.js → useblocks-core.e9f78aba.js} +1 -1
- package/useblocks-esm.js +17 -6
- package/useblocks.d.ts +9 -2
- package/useblocks.js +176 -12
- package/vite/index.cjs +109 -18
- package/vite/index.js +109 -18
- package/webpack/index.cjs +108 -11
- package/webpack/index.js +108 -11
- package/iframe/js/amp.A5wCvj7V.js +0 -1
- package/static/core/4235932f.js +0 -895
- package/static/core/a90628e5.js +0 -33
- package/static/core/b2b58546.js +0 -3
- package/static/core/bd80f6b9.js +0 -1
- package/static/core/f069f304.js +0 -78
- /package/iframe/{iframe-eblock.c327bc79.html → iframe-eblock.e9f78aba.html} +0 -0
- /package/iframe/{iframe.c327bc79.html → iframe.e9f78aba.html} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
__useblocks__.define(`static/core/
|
|
1
|
+
__useblocks__.define(`static/core/c9c989ee.js`,[`require`,`exports`,`module`,`static/core/4dc58c63.js`,`static/core/545b5c1c.js`],function(e,t,n){e("./4dc58c63.js");let r=e("./545b5c1c.js");var i,a,o={};function s(){return a?i:(a=1,i=function(){return typeof Promise==`function`&&Promise.prototype&&Promise.prototype.then})}var c,l={},u={};function d(){if(c)return u;let e;c=1;let t=[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];return u.getSymbolSize=function(e){if(!e)throw Error(`"version" cannot be null or undefined`);if(e<1||e>40)throw Error(`"version" should be in range from 1 to 40`);return 4*e+17},u.getSymbolTotalCodewords=function(e){return t[e]},u.getBCHDigit=function(e){let t=0;for(;e!==0;)t++,e>>>=1;return t},u.setToSJISFunction=function(t){if(typeof t!=`function`)throw Error(`"toSJISFunc" is not a valid function.`);e=t},u.isKanjiModeEnabled=function(){return e!==void 0},u.toSJIS=function(t){return e(t)},u}var f,p,m,h,g,_={};function v(){return f||(f=1,(e=_).L={bit:1},e.M={bit:0},e.Q={bit:3},e.H={bit:2},e.isValid=function(e){return e&&e.bit!==void 0&&e.bit>=0&&e.bit<4},e.from=function(t,n){if(e.isValid(t))return t;try{return function(t){if(typeof t!=`string`)throw Error(`Param is not a string`);switch(t.toLowerCase()){case`l`:case`low`:return e.L;case`m`:case`medium`:return e.M;case`q`:case`quartile`:return e.Q;case`h`:case`high`:return e.H;default:throw Error(`Unknown EC Level: `+t)}}(t)}catch{return n}}),_;var e}var y,b={},x,S={},C,ee={},w,T={};function E(){if(w)return T;w=1;let e=v(),t=[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],n=[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];return T.getBlocksCount=function(n,r){switch(r){case e.L:return t[4*(n-1)+0];case e.M:return t[4*(n-1)+1];case e.Q:return t[4*(n-1)+2];case e.H:return t[4*(n-1)+3];default:return}},T.getTotalCodewordsCount=function(t,r){switch(r){case e.L:return n[4*(t-1)+0];case e.M:return n[4*(t-1)+1];case e.Q:return n[4*(t-1)+2];case e.H:return n[4*(t-1)+3];default:return}},T}var D,O,k,A,j={},M={};function te(){return O||(O=1,function(e){let t=function(){if(D)return M;D=1;let e=new Uint8Array(512),t=new Uint8Array(256);return function(){let n=1;for(let r=0;r<255;r++)e[r]=n,t[n]=r,n<<=1,256&n&&(n^=285);for(let t=255;t<512;t++)e[t]=e[t-255]}(),M.log=function(e){if(e<1)throw Error(`log(`+e+`)`);return t[e]},M.exp=function(t){return e[t]},M.mul=function(n,r){return n===0||r===0?0:e[t[n]+t[r]]},M}();e.mul=function(e,n){let r=new Uint8Array(e.length+n.length-1);for(let i=0;i<e.length;i++)for(let a=0;a<n.length;a++)r[i+a]^=t.mul(e[i],n[a]);return r},e.mod=function(e,n){let r=new Uint8Array(e);for(;r.length-n.length>=0;){let e=r[0];for(let i=0;i<n.length;i++)r[i]^=t.mul(n[i],e);let i=0;for(;i<r.length&&r[i]===0;)i++;r=r.slice(i)}return r},e.generateECPolynomial=function(n){let r=new Uint8Array([1]);for(let i=0;i<n;i++)r=e.mul(r,new Uint8Array([1,t.exp(i)]));return r}}(j)),j}var N,P={},F={},I={};function L(){return N||(N=1,I.isValid=function(e){return!isNaN(e)&&e>=1&&e<=40}),I}var R,z,B,V={};function H(){if(R)return V;R=1;let e=`(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+`;e=e.replace(/u/g,`\\u`);let t=`(?:(?![A-Z0-9 $%*+\\-./:]|`+e+`)(?:.|[\r
|
|
2
2
|
]))+`;V.KANJI=new RegExp(e,`g`),V.BYTE_KANJI=RegExp(`[^A-Z0-9 $%*+\\-./:]+`,`g`),V.BYTE=new RegExp(t,`g`),V.NUMERIC=RegExp(`[0-9]+`,`g`),V.ALPHANUMERIC=RegExp(`[A-Z $%*+\\-./:]+`,`g`);let n=RegExp(`^`+e+`$`),r=RegExp(`^[0-9]+$`),i=RegExp(`^[A-Z0-9 $%*+\\-./:]+$`);return V.testKanji=function(e){return n.test(e)},V.testNumeric=function(e){return r.test(e)},V.testAlphanumeric=function(e){return i.test(e)},V}function U(){return z||(z=1,function(e){let t=L(),n=H();e.NUMERIC={id:`Numeric`,bit:1,ccBits:[10,12,14]},e.ALPHANUMERIC={id:`Alphanumeric`,bit:2,ccBits:[9,11,13]},e.BYTE={id:`Byte`,bit:4,ccBits:[8,16,16]},e.KANJI={id:`Kanji`,bit:8,ccBits:[8,10,12]},e.MIXED={bit:-1},e.getCharCountIndicator=function(e,n){if(!e.ccBits)throw Error(`Invalid mode: `+e);if(!t.isValid(n))throw Error(`Invalid version: `+n);return n>=1&&n<10?e.ccBits[0]:n<27?e.ccBits[1]:e.ccBits[2]},e.getBestModeForData=function(t){return n.testNumeric(t)?e.NUMERIC:n.testAlphanumeric(t)?e.ALPHANUMERIC:n.testKanji(t)?e.KANJI:e.BYTE},e.toString=function(e){if(e&&e.id)return e.id;throw Error(`Invalid mode`)},e.isValid=function(e){return e&&e.bit&&e.ccBits},e.from=function(t,n){if(e.isValid(t))return t;try{return function(t){if(typeof t!=`string`)throw Error(`Param is not a string`);switch(t.toLowerCase()){case`numeric`:return e.NUMERIC;case`alphanumeric`:return e.ALPHANUMERIC;case`kanji`:return e.KANJI;case`byte`:return e.BYTE;default:throw Error(`Unknown mode: `+t)}}(t)}catch{return n}}}(F)),F}function ne(){return B||(B=1,function(e){let t=d(),n=E(),r=v(),i=U(),a=L(),o=t.getBCHDigit(7973);function s(e,t){return i.getCharCountIndicator(e,t)+4}function c(e,t){let n=0;return e.forEach(function(e){let r=s(e.mode,t);n+=r+e.getBitsLength()}),n}e.from=function(e,t){return a.isValid(e)?parseInt(e,10):t},e.getCapacity=function(e,r,o){if(!a.isValid(e))throw Error(`Invalid QR Code version`);o===void 0&&(o=i.BYTE);let c=8*(t.getSymbolTotalCodewords(e)-n.getTotalCodewordsCount(e,r));if(o===i.MIXED)return c;let l=c-s(o,e);switch(o){case i.NUMERIC:return Math.floor(l/10*3);case i.ALPHANUMERIC:return Math.floor(l/11*2);case i.KANJI:return Math.floor(l/13);case i.BYTE:default:return Math.floor(l/8)}},e.getBestVersionForData=function(t,n){let a,o=r.from(n,r.M);if(Array.isArray(t)){if(t.length>1)return function(t,n){for(let r=1;r<=40;r++)if(c(t,r)<=e.getCapacity(r,n,i.MIXED))return r}(t,o);if(t.length===0)return 1;a=t[0]}else a=t;return function(t,n,r){for(let i=1;i<=40;i++)if(n<=e.getCapacity(i,r,t))return i}(a.mode,a.getLength(),o)},e.getEncodedBits=function(e){if(!a.isValid(e)||e<7)throw Error(`Invalid QR Code version`);let n=e<<12;for(;t.getBCHDigit(n)-o>=0;)n^=7973<<t.getBCHDigit(n)-o;return e<<12|n}}(P)),P}var W,G={},K,q,J,Y,X,re,Z,Q,ie={},ae,oe,se,ce={exports:{}};function le(){return ae||(ae=1,function(e){var t={single_source_shortest_paths:function(e,n,r){var i={},a={};a[n]=0;var o,s,c,l,u,d,f,p=t.PriorityQueue.make();for(p.push(n,0);!p.empty();)for(c in s=(o=p.pop()).value,l=o.cost,u=e[s]||{})u.hasOwnProperty(c)&&(d=l+u[c],f=a[c],(a[c]===void 0||f>d)&&(a[c]=d,p.push(c,d),i[c]=s));if(r!==void 0&&a[r]===void 0){var m=[`Could not find a path from `,n,` to `,r,`.`].join(``);throw Error(m)}return i},extract_shortest_path_from_predecessor_list:function(e,t){for(var n=[],r=t;r;)n.push(r),e[r],r=e[r];return n.reverse(),n},find_path:function(e,n,r){var i=t.single_source_shortest_paths(e,n,r);return t.extract_shortest_path_from_predecessor_list(i,r)},PriorityQueue:{make:function(e){var n,r=t.PriorityQueue,i={};for(n in e||={},r)r.hasOwnProperty(n)&&(i[n]=r[n]);return i.queue=[],i.sorter=e.sorter||r.default_sorter,i},default_sorter:function(e,t){return e.cost-t.cost},push:function(e,t){var n={value:e,cost:t};this.queue.push(n),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return this.queue.length===0}}};e.exports=t}(ce)),ce.exports}function ue(){return oe||(oe=1,function(e){let t=U(),n=function(){if(q)return K;q=1;let e=U();function t(t){this.mode=e.NUMERIC,this.data=t.toString()}return t.getBitsLength=function(e){return 10*Math.floor(e/3)+(e%3?e%3*3+1:0)},t.prototype.getLength=function(){return this.data.length},t.prototype.getBitsLength=function(){return t.getBitsLength(this.data.length)},t.prototype.write=function(e){let t,n,r;for(t=0;t+3<=this.data.length;t+=3)n=this.data.substr(t,3),r=parseInt(n,10),e.put(r,10);let i=this.data.length-t;i>0&&(n=this.data.substr(t),r=parseInt(n,10),e.put(r,3*i+1))},K=t}(),r=function(){if(Y)return J;Y=1;let e=U(),t=`0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:`.split(``);function n(t){this.mode=e.ALPHANUMERIC,this.data=t}return n.getBitsLength=function(e){return 11*Math.floor(e/2)+e%2*6},n.prototype.getLength=function(){return this.data.length},n.prototype.getBitsLength=function(){return n.getBitsLength(this.data.length)},n.prototype.write=function(e){let n;for(n=0;n+2<=this.data.length;n+=2){let r=45*t.indexOf(this.data[n]);r+=t.indexOf(this.data[n+1]),e.put(r,11)}this.data.length%2&&e.put(t.indexOf(this.data[n]),6)},J=n}(),i=function(){if(re)return X;re=1;let e=U();function t(t){this.mode=e.BYTE,this.data=typeof t==`string`?new TextEncoder().encode(t):new Uint8Array(t)}return t.getBitsLength=function(e){return 8*e},t.prototype.getLength=function(){return this.data.length},t.prototype.getBitsLength=function(){return t.getBitsLength(this.data.length)},t.prototype.write=function(e){for(let t=0,n=this.data.length;t<n;t++)e.put(this.data[t],8)},X=t}(),a=function(){if(Q)return Z;Q=1;let e=U(),t=d();function n(t){this.mode=e.KANJI,this.data=t}return n.getBitsLength=function(e){return 13*e},n.prototype.getLength=function(){return this.data.length},n.prototype.getBitsLength=function(){return n.getBitsLength(this.data.length)},n.prototype.write=function(e){let n;for(n=0;n<this.data.length;n++){let r=t.toSJIS(this.data[n]);if(r>=33088&&r<=40956)r-=33088;else{if(!(r>=57408&&r<=60351))throw Error(`Invalid SJIS character: `+this.data[n]+`
|
|
3
3
|
Make sure your charset is UTF-8`);r-=49472}r=192*(r>>>8&255)+(255&r),e.put(r,13)}},Z=n}(),o=H(),s=d(),c=le();function l(e){return unescape(encodeURIComponent(e)).length}function u(e,t,n){let r=[],i;for(;(i=e.exec(n))!==null;)r.push({data:i[0],index:i.index,mode:t,length:i[0].length});return r}function f(e){let n=u(o.NUMERIC,t.NUMERIC,e),r=u(o.ALPHANUMERIC,t.ALPHANUMERIC,e),i,a;return s.isKanjiModeEnabled()?(i=u(o.BYTE,t.BYTE,e),a=u(o.KANJI,t.KANJI,e)):(i=u(o.BYTE_KANJI,t.BYTE,e),a=[]),n.concat(r,i,a).sort(function(e,t){return e.index-t.index}).map(function(e){return{data:e.data,mode:e.mode,length:e.length}})}function p(e,o){switch(o){case t.NUMERIC:return n.getBitsLength(e);case t.ALPHANUMERIC:return r.getBitsLength(e);case t.KANJI:return a.getBitsLength(e);case t.BYTE:return i.getBitsLength(e)}}function m(e,o){let c,l=t.getBestModeForData(e);if(c=t.from(o,l),c!==t.BYTE&&c.bit<l.bit)throw Error(`"`+e+`" cannot be encoded with mode `+t.toString(c)+`.
|
|
4
4
|
Suggested mode is: `+t.toString(l));switch(c!==t.KANJI||s.isKanjiModeEnabled()||(c=t.BYTE),c){case t.NUMERIC:return new n(e);case t.ALPHANUMERIC:return new r(e);case t.KANJI:return new a(e);case t.BYTE:return new i(e)}}e.fromArray=function(e){return e.reduce(function(e,t){return typeof t==`string`?e.push(m(t,null)):t.data&&e.push(m(t.data,t.mode)),e},[])},e.fromString=function(n,r){let i=function(e,n){let r={},i={start:{}},a=[`start`];for(let o=0;o<e.length;o++){let s=e[o],c=[];for(let e=0;e<s.length;e++){let l=s[e],u=``+o+e;c.push(u),r[u]={node:l,lastCount:0},i[u]={};for(let e=0;e<a.length;e++){let o=a[e];r[o]&&r[o].node.mode===l.mode?(i[o][u]=p(r[o].lastCount+l.length,l.mode)-p(r[o].lastCount,l.mode),r[o].lastCount+=l.length):(r[o]&&(r[o].lastCount=l.length),i[o][u]=p(l.length,l.mode)+4+t.getCharCountIndicator(l.mode,n))}}a=c}for(let e=0;e<a.length;e++)i[a[e]].end=0;return{map:i,table:r}}(function(e){let n=[];for(let r=0;r<e.length;r++){let i=e[r];switch(i.mode){case t.NUMERIC:n.push([i,{data:i.data,mode:t.ALPHANUMERIC,length:i.length},{data:i.data,mode:t.BYTE,length:i.length}]);break;case t.ALPHANUMERIC:n.push([i,{data:i.data,mode:t.BYTE,length:i.length}]);break;case t.KANJI:n.push([i,{data:i.data,mode:t.BYTE,length:l(i.data)}]);break;case t.BYTE:n.push([{data:i.data,mode:t.BYTE,length:l(i.data)}])}}return n}(f(n,s.isKanjiModeEnabled())),r),a=c.find_path(i.map,`start`,`end`),o=[];for(let e=1;e<a.length-1;e++)o.push(i.table[a[e]].node);return e.fromArray(function(e){return e.reduce(function(e,t){let n=e.length-1>=0?e[e.length-1]:null;return n&&n.mode===t.mode?(e[e.length-1].data+=t.data,e):(e.push(t),e)},[])}(o))},e.rawSplit=function(t){return e.fromArray(f(t,s.isKanjiModeEnabled()))}}(ie)),ie}function de(){if(se)return l;se=1;let e=d(),t=v(),n=function(){if(m)return p;function e(){this.buffer=[],this.length=0}return m=1,e.prototype={get:function(e){let t=Math.floor(e/8);return(this.buffer[t]>>>7-e%8&1)==1},put:function(e,t){for(let n=0;n<t;n++)this.putBit((e>>>t-n-1&1)==1)},getLengthInBits:function(){return this.length},putBit:function(e){let t=Math.floor(this.length/8);this.buffer.length<=t&&this.buffer.push(0),e&&(this.buffer[t]|=128>>>this.length%8),this.length++}},p=e}(),r=function(){if(g)return h;function e(e){if(!e||e<1)throw Error(`BitMatrix size must be defined and greater than 0`);this.size=e,this.data=new Uint8Array(e*e),this.reservedBit=new Uint8Array(e*e)}return g=1,e.prototype.set=function(e,t,n,r){let i=e*this.size+t;this.data[i]=n,r&&(this.reservedBit[i]=!0)},e.prototype.get=function(e,t){return this.data[e*this.size+t]},e.prototype.xor=function(e,t,n){this.data[e*this.size+t]^=n},e.prototype.isReserved=function(e,t){return this.reservedBit[e*this.size+t]},h=e}(),i=(y||(y=1,function(e){let t=d().getSymbolSize;e.getRowColCoords=function(e){if(e===1)return[];let n=Math.floor(e/7)+2,r=t(e),i=r===145?26:2*Math.ceil((r-13)/(2*n-2)),a=[r-7];for(let e=1;e<n-1;e++)a[e]=a[e-1]-i;return a.push(6),a.reverse()},e.getPositions=function(t){let n=[],r=e.getRowColCoords(t),i=r.length;for(let e=0;e<i;e++)for(let t=0;t<i;t++)e===0&&t===0||e===0&&t===i-1||e===i-1&&t===0||n.push([r[e],r[t]]);return n}}(b)),b),a=function(){if(x)return S;x=1;let e=d().getSymbolSize;return S.getPositions=function(t){let n=e(t);return[[0,0],[n-7,0],[0,n-7]]},S}(),o=(C||(C=1,function(e){e.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};function t(t,n,r){switch(t){case e.Patterns.PATTERN000:return(n+r)%2==0;case e.Patterns.PATTERN001:return n%2==0;case e.Patterns.PATTERN010:return r%3==0;case e.Patterns.PATTERN011:return(n+r)%3==0;case e.Patterns.PATTERN100:return(Math.floor(n/2)+Math.floor(r/3))%2==0;case e.Patterns.PATTERN101:return n*r%2+n*r%3==0;case e.Patterns.PATTERN110:return(n*r%2+n*r%3)%2==0;case e.Patterns.PATTERN111:return(n*r%3+(n+r)%2)%2==0;default:throw Error(`bad maskPattern:`+t)}}e.isValid=function(e){return e!=null&&e!==``&&!isNaN(e)&&e>=0&&e<=7},e.from=function(t){return e.isValid(t)?parseInt(t,10):void 0},e.getPenaltyN1=function(e){let t=e.size,n=0,r=0,i=0,a=null,o=null;for(let s=0;s<t;s++){r=i=0,a=o=null;for(let c=0;c<t;c++){let t=e.get(s,c);t===a?r++:(r>=5&&(n+=3+(r-5)),a=t,r=1),t=e.get(c,s),t===o?i++:(i>=5&&(n+=3+(i-5)),o=t,i=1)}r>=5&&(n+=3+(r-5)),i>=5&&(n+=3+(i-5))}return n},e.getPenaltyN2=function(e){let t=e.size,n=0;for(let r=0;r<t-1;r++)for(let i=0;i<t-1;i++){let t=e.get(r,i)+e.get(r,i+1)+e.get(r+1,i)+e.get(r+1,i+1);t!==4&&t!==0||n++}return n*3},e.getPenaltyN3=function(e){let t=e.size,n=0,r=0,i=0;for(let a=0;a<t;a++){r=i=0;for(let o=0;o<t;o++)r=r<<1&2047|e.get(a,o),o>=10&&(r===1488||r===93)&&n++,i=i<<1&2047|e.get(o,a),o>=10&&(i===1488||i===93)&&n++}return n*40},e.getPenaltyN4=function(e){let t=0,n=e.data.length;for(let r=0;r<n;r++)t+=e.data[r];return Math.abs(Math.ceil(100*t/n/5)-10)*10},e.applyMask=function(e,n){let r=n.size;for(let i=0;i<r;i++)for(let a=0;a<r;a++)n.isReserved(a,i)||n.xor(a,i,t(e,a,i))},e.getBestMask=function(t,n){let r=Object.keys(e.Patterns).length,i=0,a=1/0;for(let o=0;o<r;o++){n(o),e.applyMask(o,t);let r=e.getPenaltyN1(t)+e.getPenaltyN2(t)+e.getPenaltyN3(t)+e.getPenaltyN4(t);e.applyMask(o,t),r<a&&(a=r,i=o)}return i}}(ee)),ee),s=E(),c=function(){if(A)return k;A=1;let e=te();function t(e){this.genPoly=void 0,this.degree=e,this.degree&&this.initialize(this.degree)}return t.prototype.initialize=function(t){this.degree=t,this.genPoly=e.generateECPolynomial(this.degree)},t.prototype.encode=function(t){if(!this.genPoly)throw Error(`Encoder not initialized`);let n=new Uint8Array(t.length+this.degree);n.set(t);let r=e.mod(n,this.genPoly),i=this.degree-r.length;if(i>0){let e=new Uint8Array(this.degree);return e.set(r,i),e}return r},k=t}(),u=ne(),f=function(){if(W)return G;W=1;let e=d(),t=e.getBCHDigit(1335);return G.getEncodedBits=function(n,r){let i=n.bit<<3|r,a=i<<10;for(;e.getBCHDigit(a)-t>=0;)a^=1335<<e.getBCHDigit(a)-t;return 21522^(i<<10|a)},G}(),_=U(),w=ue();function T(e,t,n){let r=e.size,i=f.getEncodedBits(t,n),a,o;for(a=0;a<15;a++)o=(i>>a&1)==1,a<6?e.set(a,8,o,!0):a<8?e.set(a+1,8,o,!0):e.set(r-15+a,8,o,!0),a<8?e.set(8,r-a-1,o,!0):a<9?e.set(8,15-a-1+1,o,!0):e.set(8,15-a-1,o,!0);e.set(r-8,8,1,!0)}function D(t,r,i){let a=new n;i.forEach(function(e){a.put(e.mode.bit,4),a.put(e.getLength(),_.getCharCountIndicator(e.mode,t)),e.write(a)});let o=8*(e.getSymbolTotalCodewords(t)-s.getTotalCodewordsCount(t,r));for(a.getLengthInBits()+4<=o&&a.put(0,4);a.getLengthInBits()%8!=0;)a.putBit(0);let l=(o-a.getLengthInBits())/8;for(let e=0;e<l;e++)a.put(e%2?17:236,8);return function(t,n,r){let i=e.getSymbolTotalCodewords(n),a=i-s.getTotalCodewordsCount(n,r),o=s.getBlocksCount(n,r),l=o-i%o,u=Math.floor(i/o),d=Math.floor(a/o),f=d+1,p=u-d,m=new c(p),h=0,g=Array(o),_=Array(o),v=0,y=new Uint8Array(t.buffer);for(let e=0;e<o;e++){let t=e<l?d:f;g[e]=y.slice(h,h+t),_[e]=m.encode(g[e]),h+=t,v=Math.max(v,t)}let b=new Uint8Array(i),x,S,C=0;for(x=0;x<v;x++)for(S=0;S<o;S++)x<g[S].length&&(b[C++]=g[S][x]);for(x=0;x<p;x++)for(S=0;S<o;S++)b[C++]=_[S][x];return b}(a,t,r)}function O(t,n,s,c){let l;if(Array.isArray(t))l=w.fromArray(t);else{if(typeof t!=`string`)throw Error(`Invalid data`);{let e=n;if(!e){let n=w.rawSplit(t);e=u.getBestVersionForData(n,s)}l=w.fromString(t,e||40)}}let d=u.getBestVersionForData(l,s);if(!d)throw Error(`The amount of data is too big to be stored in a QR Code`);if(n){if(n<d)throw Error(`
|