commit d958c27111f5d3bfbae1c90126cc4c4ce317a1e4 Author: MatMasIt Date: Sat Nov 20 17:30:16 2021 +0100 first commit diff --git a/README.md b/README.md new file mode 100644 index 0000000..445d470 --- /dev/null +++ b/README.md @@ -0,0 +1,7 @@ +# A simple Green Pass data extractor + +Derivative work from [https://github.com/jumpjack/greenpass] + +Literally extract your data by uploading a photo of your green pass + +The data is never sent to any server and only used locally diff --git a/demoImgs/demo1-vaccinated.png b/demoImgs/demo1-vaccinated.png new file mode 100644 index 0000000..a4ea5a9 Binary files /dev/null and b/demoImgs/demo1-vaccinated.png differ diff --git a/demoImgs/demo2-healed.png b/demoImgs/demo2-healed.png new file mode 100644 index 0000000..3ca802d Binary files /dev/null and b/demoImgs/demo2-healed.png differ diff --git a/demoImgs/demo3-tested.png b/demoImgs/demo3-tested.png new file mode 100644 index 0000000..2e3a367 Binary files /dev/null and b/demoImgs/demo3-tested.png differ diff --git a/demoImgs/demo4-molecular.png b/demoImgs/demo4-molecular.png new file mode 100644 index 0000000..256a6bc Binary files /dev/null and b/demoImgs/demo4-molecular.png differ diff --git a/index.html b/index.html new file mode 100644 index 0000000..91b21e1 --- /dev/null +++ b/index.html @@ -0,0 +1,388 @@ + + + + + + Greenpass pure javascript decoder in browser + + + + + + + + + + + + +
+ + +
+ + + +
+
+
+

Your reading is back!

+
+
+

Holder

+ Name:
+ Surname:
+ Date Of birth
+
+ Covid test certificate:
+ Covid recovery certificate:
+ Covid vaccine certificate:
+
+
+

Covid test data

+ Date:
+ Device:
+ Type:
+ Name:
+ Country:
+ Center:
+ Id:
+ Issuer:
+ Disease:
+ RESULT:
+ +
+
+

Covid recovery data

+ Target desease:
+ First positive date:
+ Test country:
+ Certificate issuer:
+ Valid from:
+ Valid to:
+ Valid for: days
+ Id:
+
+
+

Covid vaccine data

+ Disease:
+ Profilaxis:
+ Vaccine ID:
+ Vaccine manufacturer:
+ dose number : of
+ Vaccination date
+ Country of vaccination:
+ Certificate issuer:
+ Certificate ID:
+
+
+

Validity

+ Creation date:
+ Expiry date:
+ Duration: days + ( months).
+ Remaining: days + ( months).
+
+ Scan again +
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/js/cbor.js b/js/cbor.js new file mode 100644 index 0000000..3e1f300 --- /dev/null +++ b/js/cbor.js @@ -0,0 +1,406 @@ +/* + * The MIT License (MIT) + * + * Copyright (c) 2014-2016 Patrick Gansterer + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +(function(global, undefined) { "use strict"; +var POW_2_24 = 5.960464477539063e-8, + POW_2_32 = 4294967296, + POW_2_53 = 9007199254740992; + +function encode(value) { + var data = new ArrayBuffer(256); + var dataView = new DataView(data); + var lastLength; + var offset = 0; + + function prepareWrite(length) { + var newByteLength = data.byteLength; + var requiredLength = offset + length; + while (newByteLength < requiredLength) + newByteLength <<= 1; + if (newByteLength !== data.byteLength) { + var oldDataView = dataView; + data = new ArrayBuffer(newByteLength); + dataView = new DataView(data); + var uint32count = (offset + 3) >> 2; + for (var i = 0; i < uint32count; ++i) + dataView.setUint32(i << 2, oldDataView.getUint32(i << 2)); + } + + lastLength = length; + return dataView; + } + function commitWrite() { + offset += lastLength; + } + function writeFloat64(value) { + commitWrite(prepareWrite(8).setFloat64(offset, value)); + } + function writeUint8(value) { + commitWrite(prepareWrite(1).setUint8(offset, value)); + } + function writeUint8Array(value) { + var dataView = prepareWrite(value.length); + for (var i = 0; i < value.length; ++i) + dataView.setUint8(offset + i, value[i]); + commitWrite(); + } + function writeUint16(value) { + commitWrite(prepareWrite(2).setUint16(offset, value)); + } + function writeUint32(value) { + commitWrite(prepareWrite(4).setUint32(offset, value)); + } + function writeUint64(value) { + var low = value % POW_2_32; + var high = (value - low) / POW_2_32; + var dataView = prepareWrite(8); + dataView.setUint32(offset, high); + dataView.setUint32(offset + 4, low); + commitWrite(); + } + function writeTypeAndLength(type, length) { + if (length < 24) { + writeUint8(type << 5 | length); + } else if (length < 0x100) { + writeUint8(type << 5 | 24); + writeUint8(length); + } else if (length < 0x10000) { + writeUint8(type << 5 | 25); + writeUint16(length); + } else if (length < 0x100000000) { + writeUint8(type << 5 | 26); + writeUint32(length); + } else { + writeUint8(type << 5 | 27); + writeUint64(length); + } + } + + function encodeItem(value) { + var i; + + if (value === false) + return writeUint8(0xf4); + if (value === true) + return writeUint8(0xf5); + if (value === null) + return writeUint8(0xf6); + if (value === undefined) + return writeUint8(0xf7); + + switch (typeof value) { + case "number": + if (Math.floor(value) === value) { + if (0 <= value && value <= POW_2_53) + return writeTypeAndLength(0, value); + if (-POW_2_53 <= value && value < 0) + return writeTypeAndLength(1, -(value + 1)); + } + writeUint8(0xfb); + return writeFloat64(value); + + case "string": + var utf8data = []; + for (i = 0; i < value.length; ++i) { + var charCode = value.charCodeAt(i); + if (charCode < 0x80) { + utf8data.push(charCode); + } else if (charCode < 0x800) { + utf8data.push(0xc0 | charCode >> 6); + utf8data.push(0x80 | charCode & 0x3f); + } else if (charCode < 0xd800) { + utf8data.push(0xe0 | charCode >> 12); + utf8data.push(0x80 | (charCode >> 6) & 0x3f); + utf8data.push(0x80 | charCode & 0x3f); + } else { + charCode = (charCode & 0x3ff) << 10; + charCode |= value.charCodeAt(++i) & 0x3ff; + charCode += 0x10000; + + utf8data.push(0xf0 | charCode >> 18); + utf8data.push(0x80 | (charCode >> 12) & 0x3f); + utf8data.push(0x80 | (charCode >> 6) & 0x3f); + utf8data.push(0x80 | charCode & 0x3f); + } + } + + writeTypeAndLength(3, utf8data.length); + return writeUint8Array(utf8data); + + default: + var length; + if (Array.isArray(value)) { + length = value.length; + writeTypeAndLength(4, length); + for (i = 0; i < length; ++i) + encodeItem(value[i]); + } else if (value instanceof Uint8Array) { + writeTypeAndLength(2, value.length); + writeUint8Array(value); + } else { + var keys = Object.keys(value); + length = keys.length; + writeTypeAndLength(5, length); + for (i = 0; i < length; ++i) { + var key = keys[i]; + encodeItem(key); + encodeItem(value[key]); + } + } + } + } + + encodeItem(value); + + if ("slice" in data) + return data.slice(0, offset); + + var ret = new ArrayBuffer(offset); + var retView = new DataView(ret); + for (var i = 0; i < offset; ++i) + retView.setUint8(i, dataView.getUint8(i)); + return ret; +} + +function decode(data, tagger, simpleValue) { + var dataView = new DataView(data); + var offset = 0; + + if (typeof tagger !== "function") + tagger = function(value) { return value; }; + if (typeof simpleValue !== "function") + simpleValue = function() { return undefined; }; + + function commitRead(length, value) { + offset += length; + return value; + } + function readArrayBuffer(length) { + return commitRead(length, new Uint8Array(data, offset, length)); + } + function readFloat16() { + var tempArrayBuffer = new ArrayBuffer(4); + var tempDataView = new DataView(tempArrayBuffer); + var value = readUint16(); + + var sign = value & 0x8000; + var exponent = value & 0x7c00; + var fraction = value & 0x03ff; + + if (exponent === 0x7c00) + exponent = 0xff << 10; + else if (exponent !== 0) + exponent += (127 - 15) << 10; + else if (fraction !== 0) + return (sign ? -1 : 1) * fraction * POW_2_24; + + tempDataView.setUint32(0, sign << 16 | exponent << 13 | fraction << 13); + return tempDataView.getFloat32(0); + } + function readFloat32() { + return commitRead(4, dataView.getFloat32(offset)); + } + function readFloat64() { + return commitRead(8, dataView.getFloat64(offset)); + } + function readUint8() { + return commitRead(1, dataView.getUint8(offset)); + } + function readUint16() { + return commitRead(2, dataView.getUint16(offset)); + } + function readUint32() { + return commitRead(4, dataView.getUint32(offset)); + } + function readUint64() { + return readUint32() * POW_2_32 + readUint32(); + } + function readBreak() { + if (dataView.getUint8(offset) !== 0xff) + return false; + offset += 1; + return true; + } + function readLength(additionalInformation) { + if (additionalInformation < 24) + return additionalInformation; + if (additionalInformation === 24) + return readUint8(); + if (additionalInformation === 25) + return readUint16(); + if (additionalInformation === 26) + return readUint32(); + if (additionalInformation === 27) + return readUint64(); + if (additionalInformation === 31) + return -1; + throw "Invalid length encoding"; + } + function readIndefiniteStringLength(majorType) { + var initialByte = readUint8(); + if (initialByte === 0xff) + return -1; + var length = readLength(initialByte & 0x1f); + if (length < 0 || (initialByte >> 5) !== majorType) + throw "Invalid indefinite length element"; + return length; + } + + function appendUtf16Data(utf16data, length) { + for (var i = 0; i < length; ++i) { + var value = readUint8(); + if (value & 0x80) { + if (value < 0xe0) { + value = (value & 0x1f) << 6 + | (readUint8() & 0x3f); + length -= 1; + } else if (value < 0xf0) { + value = (value & 0x0f) << 12 + | (readUint8() & 0x3f) << 6 + | (readUint8() & 0x3f); + length -= 2; + } else { + value = (value & 0x0f) << 18 + | (readUint8() & 0x3f) << 12 + | (readUint8() & 0x3f) << 6 + | (readUint8() & 0x3f); + length -= 3; + } + } + + if (value < 0x10000) { + utf16data.push(value); + } else { + value -= 0x10000; + utf16data.push(0xd800 | (value >> 10)); + utf16data.push(0xdc00 | (value & 0x3ff)); + } + } + } + + function decodeItem() { + var initialByte = readUint8(); + var majorType = initialByte >> 5; + var additionalInformation = initialByte & 0x1f; + var i; + var length; + + if (majorType === 7) { + switch (additionalInformation) { + case 25: + return readFloat16(); + case 26: + return readFloat32(); + case 27: + return readFloat64(); + } + } + + length = readLength(additionalInformation); + if (length < 0 && (majorType < 2 || 6 < majorType)) + throw "Invalid length"; + + switch (majorType) { + case 0: + return length; + case 1: + return -1 - length; + case 2: + if (length < 0) { + var elements = []; + var fullArrayLength = 0; + while ((length = readIndefiniteStringLength(majorType)) >= 0) { + fullArrayLength += length; + elements.push(readArrayBuffer(length)); + } + var fullArray = new Uint8Array(fullArrayLength); + var fullArrayOffset = 0; + for (i = 0; i < elements.length; ++i) { + fullArray.set(elements[i], fullArrayOffset); + fullArrayOffset += elements[i].length; + } + return fullArray; + } + return readArrayBuffer(length); + case 3: + var utf16data = []; + if (length < 0) { + while ((length = readIndefiniteStringLength(majorType)) >= 0) + appendUtf16Data(utf16data, length); + } else + appendUtf16Data(utf16data, length); + return String.fromCharCode.apply(null, utf16data); + case 4: + var retArray; + if (length < 0) { + retArray = []; + while (!readBreak()) + retArray.push(decodeItem()); + } else { + retArray = new Array(length); + for (i = 0; i < length; ++i) + retArray[i] = decodeItem(); + } + return retArray; + case 5: + var retObject = {}; + for (i = 0; i < length || length < 0 && !readBreak(); ++i) { + var key = decodeItem(); + retObject[key] = decodeItem(); + } + return retObject; + case 6: + return tagger(decodeItem(), length); + case 7: + switch (length) { + case 20: + return false; + case 21: + return true; + case 22: + return null; + case 23: + return undefined; + default: + return simpleValue(length); + } + } + } + + var ret = decodeItem(); + if (offset !== data.byteLength) + throw "Remaining bytes"; + return ret; +} + +var obj = { encode: encode, decode: decode }; + +if (typeof define === "function" && define.amd) + define("cbor/cbor", obj); +else if (typeof module !== "undefined" && module.exports) + module.exports = obj; +else if (!global.CBOR) + global.CBOR = obj; + +})(this); diff --git a/js/disease-agent-targeted.js b/js/disease-agent-targeted.js new file mode 100644 index 0000000..f2ebca4 --- /dev/null +++ b/js/disease-agent-targeted.js @@ -0,0 +1,13 @@ +diseases={ + "valueSetId": "disease-agent-targeted", + "valueSetDate": "2021-04-27", + "valueSetValues": { + "840539006": { + "display": "COVID-19", + "lang": "en", + "active": true, + "version": "http://snomed.info/sct/900000000000207008/version/20210131", + "system": "http://snomed.info/sct" + } + } +} diff --git a/js/explainer.js b/js/explainer.js new file mode 100644 index 0000000..078906b --- /dev/null +++ b/js/explainer.js @@ -0,0 +1,83 @@ +testData = { + "JSON": { + "ver": "1.0.0", + "nam": { + "fn": "Di Caprio", + "fnt": "DId||h<-1||h>b){throw"Error._ab "}c=false;if(a==-1){e[g]=0;c=true}else{if(a==d){e[g]=d-1;c=true}}if(h==-1){e[g+1]=0;c=true}else{if(h==b){e[g+1]=b-1;c=true}}}c=true;for(var g=e.length-2;g>=0&&c;g-=2){var a=Math.floor(e[g]);var h=Math.floor(e[g+1]);if(a<-1||a>d||h<-1||h>b){throw"Error._ab "}c=false;if(a==-1){e[g]=0;c=true}else{if(a==d){e[g]=d-1;c=true}}if(h==-1){e[g+1]=0;c=true}else{if(h==b){e[g+1]=b-1;c=true}}}};_aa._af=function(b,d,a){var l=new _ac(d);var k=new Array(d<<1);for(var g=0;g>1)+0.5;k[i+1]=j}a._ad(k);_aa._ab(b,k);try{for(var i=0;i>1,g)}}}catch(c){throw"Error._ab"}}return l};_aa._ah=function(h,o,l,k,r,q,b,a,f,e,n,m,t,s,d,c,j,i){var g=_ae._ag(l,k,r,q,b,a,f,e,n,m,t,s,d,c,j,i);return _aa._af(h,o,g)};function _a1(b,a){this.count=b;this._fc=a;this.__defineGetter__("Count",function(){return this.count});this.__defineGetter__("_dm",function(){return this._fc})}function _a2(a,c,b){this._bm=a;if(b){this._do=new Array(c,b)}else{this._do=new Array(c)}this.__defineGetter__("_bo",function(){return this._bm});this.__defineGetter__("_dn",function(){return this._bm*this._fo});this.__defineGetter__("_fo",function(){var e=0;for(var d=0;d6){o._bq(r-11,0,3,6);o._bq(0,r-11,6,3)}return o};this._bu=function(i){return this._do[i.ordinal()]}}_a3._bv=new Array(31892,34236,39577,42195,48118,51042,55367,58893,63784,68472,70749,76311,79154,84390,87683,92361,96236,102084,102881,110507,110734,117786,119615,126325,127568,133589,136944,141498,145311,150283,152622,158308,161089,167017);_a3.VERSIONS=_ay();_a3._av=function(a){if(a<1||a>40){throw"bad arguments"}return _a3.VERSIONS[a-1]};_a3._at=function(b){if(b%4!=1){throw"Error _at"}try{return _a3._av((b-17)>>2)}catch(a){throw"Error _av"}};_a3._aw=function(d){var b=4294967295;var f=0;for(var c=0;c<_a3._bv.length;c++){var a=_a3._bv[c];if(a==d){return this._av(c+7)}var e=_ax._gj(d,a);if(eMath.abs(c-m);if(d){var s=m;m=l;l=s;s=c;c=b;b=s}var j=Math.abs(c-m);var i=Math.abs(b-l);var q=-j>>1;var v=l0){if(g==b){break}g+=v;q-=j}}var k=c-m;var r=b-l;return Math.sqrt((k*k+r*r))};this._bh=function(i,g,h,f){var b=this._bi(i,g,h,f);var e=1;var d=i-(h-i);if(d<0){e=i/(i-d);d=0}else{if(d>=qrcode.width){e=(qrcode.width-1-i)/(d-i);d=qrcode.width-1}}var c=Math.floor(g-(f-g)*e);e=1;if(c<0){e=g/(g-c);c=0}else{if(c>=qrcode.height){e=(qrcode.height-1-g)/(c-g);c=qrcode.height-1}}d=Math.floor(i+(d-i)*e);b+=this._bi(i,g,d,c);return b-1};this._bj=function(c,d){var b=this._bh(Math.floor(c.X),Math.floor(c.Y),Math.floor(d.X),Math.floor(d.Y));var e=this._bh(Math.floor(d.X),Math.floor(d.Y),Math.floor(c.X),Math.floor(c.Y));if(isNaN(b)){return e/7}if(isNaN(e)){return b/7}return(b+e)/14};this._bk=function(d,c,b){return(this._bj(d,c)+this._bj(d,b))/2};this.distance=function(c,b){xDiff=c.X-b.X;yDiff=c.Y-b.Y;return Math.sqrt((xDiff*xDiff+yDiff*yDiff))};this._bx=function(g,f,d,e){var b=Math.round(this.distance(g,f)/e);var c=Math.round(this.distance(g,d)/e);var h=((b+c)>>1)+7;switch(h&3){case 0:h++;break;case 2:h--;break;case 3:throw"Error"}return h};this._bl=function(g,f,d,j){var k=Math.floor(j*g);var h=Math.max(0,f-k);var i=Math.min(qrcode.width-1,f+k);if(i-h0){var f=h.X-j.X+n.X;var e=h.Y-j.Y+n.Y;var c=1-3/k;var u=Math.floor(j.X+c*(f-j.X));var t=Math.floor(j.Y+c*(e-j.Y));for(var q=4;q<=16;q<<=1){l=this._bl(d,u,t,q);break}}var g=this.createTransform(j,h,n,l,s);var m=this._bz(this.image,g,s);var o;if(l==null){o=new Array(n,j,h)}else{o=new Array(n,j,h,l)}return new _bg(m,o)};this.detect=function(){var b=new _cc()._ce(this.image);return this._cd(b)}}var _ca=21522;var _cb=new Array(new Array(21522,0),new Array(20773,1),new Array(24188,2),new Array(23371,3),new Array(17913,4),new Array(16590,5),new Array(20375,6),new Array(19104,7),new Array(30660,8),new Array(29427,9),new Array(32170,10),new Array(30877,11),new Array(26159,12),new Array(25368,13),new Array(27713,14),new Array(26998,15),new Array(5769,16),new Array(5054,17),new Array(7399,18),new Array(6608,19),new Array(1890,20),new Array(597,21),new Array(3340,22),new Array(2107,23),new Array(13663,24),new Array(12392,25),new Array(16177,26),new Array(14854,27),new Array(9396,28),new Array(8579,29),new Array(11994,30),new Array(11245,31));var _ch=new Array(0,1,1,2,1,2,2,3,1,2,2,3,2,3,3,4);function _ax(a){this._cf=_cg.forBits((a>>3)&3);this._fe=(a&7);this.__defineGetter__("_cg",function(){return this._cf});this.__defineGetter__("_dx",function(){return this._fe});this.GetHashCode=function(){return(this._cf.ordinal()<<3)|_fe};this.Equals=function(c){var b=c;return this._cf==b._cf&&this._fe==b._fe}}_ax._gj=function(d,c){d^=c;return _ch[d&15]+_ch[(_ew(d,4)&15)]+_ch[(_ew(d,8)&15)]+_ch[(_ew(d,12)&15)]+_ch[(_ew(d,16)&15)]+_ch[(_ew(d,20)&15)]+_ch[(_ew(d,24)&15)]+_ch[(_ew(d,28)&15)]};_ax._ci=function(a){var b=_ax._cj(a);if(b!=null){return b}return _ax._cj(a^_ca)};_ax._cj=function(d){var b=4294967295;var a=0;for(var c=0;c<_cb.length;c++){var g=_cb[c];var f=g[0];if(f==d){return new _ax(g[1])}var e=this._gj(d,f);if(e=FOR_BITS.length){throw"bad arguments"}return FOR_BITS[a]};var L=new _cg(0,1,"L");var M=new _cg(1,0,"M");var Q=new _cg(2,3,"Q");var H=new _cg(3,2,"H");var FOR_BITS=new Array(M,L,H,Q);function _ac(d,a){if(!a){a=d}if(d<1||a<1){throw"Both dimensions must be greater than 0"}this.width=d;this.height=a;var c=d>>5;if((d&31)!=0){c++}this.rowSize=c;this.bits=new Array(c*a);for(var b=0;b>5);return((_ew(this.bits[f],(e&31)))&1)!=0};this._dq=function(e,g){var f=g*this.rowSize+(e>>5);this.bits[f]|=1<<(e&31)};this.flip=function(e,g){var f=g*this.rowSize+(e>>5);this.bits[f]^=1<<(e&31)};this.clear=function(){var e=this.bits.length;for(var f=0;fthis.height||l>this.width){throw"The region must fit inside the matrix"}for(var i=j;i>5)]|=1<<(k&31)}}}}function _dl(a,b){this._dv=a;this._dw=b;this.__defineGetter__("_du",function(){return this._dv});this.__defineGetter__("Codewords",function(){return this._dw})}_dl._gn=function(c,h,s){if(c.length!=h._dp){throw"bad arguments"}var k=h._bu(s);var e=0;var d=k._fb();for(var r=0;r=0){var w=l[b]._dw.length;if(w==u){break}b--}b++;var g=u-k._bo;var a=0;for(var r=0;r=0;c--){g=this._dk(8,c,g)}this._co=_ax._ci(g);if(this._co!=null){return this._co}var f=this._au.Dimension;g=0;var d=f-8;for(var e=f-1;e>=d;e--){g=this._dk(e,8,g)}for(var c=f-7;c>2;if(f<=6){return _a3._av(f)}var g=0;var e=h-11;for(var c=5;c>=0;c--){for(var d=h-9;d>=e;d--){g=this._dk(d,c,g)}}this._cp=_a3._aw(g);if(this._cp!=null&&this._cp._cr==h){return this._cp}g=0;for(var d=5;d>=0;d--){for(var c=h-9;c>=e;c--){g=this._dk(d,c,g)}}this._cp=_a3._aw(g);if(this._cp!=null&&this._cp._cr==h){return this._cp}throw"Error _cq"};this._gk=function(){var r=this._cm();var o=this._cq();var c=_dx._gl(r._dx);var f=this._au.Dimension;c._dj(this._au,f);var k=o._aq();var n=true;var s=new Array(o._dp);var m=0;var q=0;var h=0;for(var e=f-1;e>0;e-=2){if(e==6){e--}for(var l=0;l7){throw"bad arguments"}return _dx._dy[a]};function _fg(){this._dj=function(c,d){for(var b=0;b=Math.floor(R/2)){var rLastLast=rLast;var _ga=sLast;var _gb=tLast;rLast=r;sLast=s;tLast=t;if(rLast.Zero){throw"r_{i-1} was zero"}r=rLastLast;var q=this._fa.Zero;var _df=rLast._ex(rLast._ec);var _fy=this._fa.inverse(_df);while(r._ec>=rLast._ec&&!r.Zero){var _fx=r._ec-rLast._ec;var scale=this._fa.multiply(r._ex(r._ec),_fy);q=q._bd(this._fa._ba(_fx,scale));r=r._bd(rLast._dc(_fx,scale))}s=q.multiply1(sLast)._bd(_ga);t=q.multiply1(tLast)._bd(_gb)}var _de=t._ex(0);if(_de==0){throw"ReedSolomonException sigmaTilde(0) was zero"}var inverse=this._fa.inverse(_de);var sigma=t.multiply2(inverse);var omega=r.multiply2(inverse);return new Array(sigma,omega)};this._ey=function(_ez){var _fz=_ez._ec;if(_fz==1){return new Array(_ez._ex(1))}var result=new Array(_fz);var e=0;for(var i=1;i<256&&e<_fz;i++){if(_ez.evaluateAt(i)==0){result[e]=this._fa.inverse(i);e++}}if(e!=_fz){throw"Error locator degree does not match number of roots"}return result};this._di=function(_fs,_dz,_fq){var s=_dz.length;var result=new Array(s);for(var i=0;i1&&e[0]==0){var d=1;while(dn.length){var j=o;o=n;n=j}var h=new Array(n.length);var k=n.length-o.length;for(var m=0;m=l._ec&&!o.Zero){var m=o._ec-l._ec;var h=this._fa.multiply(o._ex(o._ec),n);var i=l._dc(m,h);var k=this._fa._ba(m,h);j=j._bd(k);o=o._bd(i)}return new Array(j,o)}}function _az(b){this._gh=new Array(256);this._gi=new Array(256);var a=1;for(var e=0;e<256;e++){this._gh[e]=a;a<<=1;if(a>=256){a^=b}}for(var e=0;e<255;e++){this._gi[this._gh[e]]=e}var d=new Array(1);d[0]=0;this.zero=new _bp(this,new Array(d));var c=new Array(1);c[0]=1;this.one=new _bp(this,new Array(c));this.__defineGetter__("Zero",function(){return this.zero});this.__defineGetter__("One",function(){return this.one});this._ba=function(j,f){if(j<0){throw"bad arguments"}if(f==0){return zero}var h=new Array(j+1);for(var g=0;gqrcode.maxImgSize){var k=c.width/c.height;f=Math.sqrt(qrcode.maxImgSize/k);l=k*f}i.width=l;i.height=f;h.drawImage(c,0,0,i.width,i.height);qrcode.width=i.width;qrcode.height=i.height;try{qrcode.imagedata=h.getImageData(0,0,i.width,i.height)}catch(m){qrcode.result="Cross domain image reading not supported in your browser! Save it to your computer then drag and drop the file!";if(qrcode.callback!=null){qrcode.callback(qrcode.result)}return}try{qrcode.result=qrcode.process(h)}catch(m){console.log(m);qrcode.result="error decoding QR Code"}if(qrcode.callback!=null){qrcode.callback(qrcode.result)}};c.src=d}};qrcode.isUrl=function(a){var b=/(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/;return b.test(a)};qrcode.decode_url=function(b){var d="";try{d=escape(b)}catch(c){console.log(c);d=b}var a="";try{a=decodeURIComponent(d)}catch(c){console.log(c);a=d}return a};qrcode.decode_utf8=function(a){if(qrcode.isUrl(a)){return qrcode.decode_url(a)}else{return a}};qrcode.process=function(r){var a=new Date().getTime();var c=qrcode.grayScaleToBitmap(qrcode.grayscale());if(qrcode.debug){for(var m=0;mf[a][o][1]){f[a][o][1]=h}}}}}var m=new Array(c);for(var b=0;b=0){return a>>b}else{return(a>>b)+(2<<~b)}}Array.prototype.remove=function(c,b){var a=this.slice((b||c)+1||this.length);this.length=c<0?this.length+c:c;return this.push.apply(this,a)};var _gf=3;var _eh=57;var _el=8;var _eg=2;qrcode._er=function(c){function b(l,k){xDiff=l.X-k.X;yDiff=l.Y-k.Y;return Math.sqrt((xDiff*xDiff+yDiff*yDiff))}function d(k,o,n){var m=o.x;var l=o.y;return((n.x-m)*(k.y-l))-((n.y-l)*(k.x-m))}var i=b(c[0],c[1]);var f=b(c[1],c[2]);var e=b(c[0],c[2]);var a,j,h;if(f>=i&&f>=e){j=c[0];a=c[1];h=c[2]}else{if(e>=f&&e>=i){j=c[1];a=c[0];h=c[2]}else{j=c[2];a=c[0];h=c[1]}}if(d(a,j,h)<0){var g=a;a=h;h=g}c[0]=a;c[1]=j;c[2]=h};function _cz(c,a,b){this.x=c;this.y=a;this.count=1;this._aj=b;this.__defineGetter__("_ei",function(){return this._aj});this.__defineGetter__("Count",function(){return this.count});this.__defineGetter__("X",function(){return this.x});this.__defineGetter__("Y",function(){return this.y});this._ek=function(){this.count++};this._ev=function(f,e,d){if(Math.abs(e-this.y)<=f&&Math.abs(d-this.x)<=f){var g=Math.abs(f-this._aj);return g<=1||g/this._aj<=1}return false}}function _es(a){this._go=a[0];this._gu=a[1];this._gr=a[2];this.__defineGetter__("_gp",function(){return this._go});this.__defineGetter__("_gq",function(){return this._gu});this.__defineGetter__("_gs",function(){return this._gr})}function _cc(){this.image=null;this._cv=[];this._ge=false;this._al=new Array(0,0,0,0,0);this._am=null;this.__defineGetter__("_da",function(){this._al[0]=0;this._al[1]=0;this._al[2]=0;this._al[3]=0;this._al[4]=0;return this._al});this._ao=function(f){var b=0;for(var d=0;d<5;d++){var e=f[d];if(e==0){return false}b+=e}if(b<7){return false}var c=Math.floor((b<<_el)/7);var a=Math.floor(c/2);return Math.abs(c-(f[0]<<_el))=0&&c[j+f*qrcode.width]){b[2]++;f--}if(f<0){return NaN}while(f>=0&&!c[j+f*qrcode.width]&&b[1]<=d){b[1]++;f--}if(f<0||b[1]>d){return NaN}while(f>=0&&c[j+f*qrcode.width]&&b[0]<=d){b[0]++;f--}if(b[0]>d){return NaN}f=a+1;while(f=d){return NaN}while(f=d){return NaN}var e=b[0]+b[1]+b[2]+b[3]+b[4];if(5*Math.abs(e-g)>=2*g){return NaN}return this._ao(b)?this._an(b,f):NaN};this._ej=function(b,a,e,h){var d=this.image;var i=qrcode.width;var c=this._da;var g=b;while(g>=0&&d[g+a*qrcode.width]){c[2]++;g--}if(g<0){return NaN}while(g>=0&&!d[g+a*qrcode.width]&&c[1]<=e){c[1]++;g--}if(g<0||c[1]>e){return NaN}while(g>=0&&d[g+a*qrcode.width]&&c[0]<=e){c[0]++;g--}if(c[0]>e){return NaN}g=b+1;while(g=e){return NaN}while(g=e){return NaN}var f=c[0]+c[1]+c[2]+c[3]+c[4];if(5*Math.abs(f-h)>=h){return NaN}return this._ao(c)?this._an(c,g):NaN};this._cu=function(c,f,e){var d=c[0]+c[1]+c[2]+c[3]+c[4];var n=this._an(c,e);var b=this._ap(f,Math.floor(n),c[2],d);if(!isNaN(b)){n=this._ej(Math.floor(n),Math.floor(b),c[2],d);if(!isNaN(n)){var l=d/7;var m=false;var h=this._cv.length;for(var g=0;g3){var b=0;var j=0;for(var d=0;d3;d++){var f=this._cv[d];if(Math.abs(f._ei-a)>c){this._cv.remove(d);d--}}}if(this._cv.length>3){this._cv.sort(function(k,i){if(k.count>i.count){return -1}if(k.count=_eg){if(c==null){c=a}else{this._ge=true;return Math.floor((Math.abs(c.X-a.X)-Math.abs(c.Y-a.Y))/2)}}}return 0};this._cx=function(){var g=0;var c=0;var a=this._cv.length;for(var d=0;d=_eg){g++;c+=f._ei}}if(g<3){return false}var e=c/a;var b=0;for(var d=0;dd[2]){h+=m-d[2]-a;f=k-1}}}else{do{f++}while(f=h){return false}}return true};this._ap=function(h,r,l,o){var k=this.image;var q=qrcode.height;var j=this._al;j[0]=0;j[1]=0;j[2]=0;var n=h;while(n>=0&&k[r+n*qrcode.width]&&j[1]<=l){j[1]++;n--}if(n<0||j[1]>l){return NaN}while(n>=0&&!k[r+n*qrcode.width]&&j[0]<=l){j[0]++;n--}if(j[0]>l){return NaN}n=h+1;while(nl){return NaN}while(nl){return NaN}var m=j[0]+j[1]+j[2];if(5*Math.abs(m-o)>=2*o){return NaN}return this._ao(j)?this._an(j,n):NaN};this._cu=function(l,o,n){var m=l[0]+l[1]+l[2];var u=this._an(l,n);var k=this._ap(o,Math.floor(u),2*l[1],m);if(!isNaN(k)){var t=(l[0]+l[1]+l[2])/3;var r=this._cv.length;for(var q=0;q>1);var m=new Array(0,0,0);for(var k=0;k>1):-((k+1)>>1));m[0]=0;m[1]=0;m[2]=0;var n=q;while(n=10&&a<=26){this.dataLengthMode=1}else{if(a>=27&&a<=40){this.dataLengthMode=2}}}this._gd=function(f){var k=0;if(f>(this._cw-f+1);this._cw-=f;return k}else{if(f>(8-(f-(this._cw+1))));this._cw=this._cw-f%8;if(this._cw<0){this._cw=8+this._cw}return k}else{if(f>(8-(f-(this._cw+1+8)));k=g+d+l;this._cw=this._cw-(f-8)%8;if(this._cw<0){this._cw=8+this._cw}return k}else{return 0}}}};this.NextMode=function(){if((this._ed>this.blocks.length-this._en-2)){return 0}else{return this._gd(4)}};this.getDataLength=function(d){var e=0;while(true){if((d>>e)==1){break}e++}return this._gd(qrcode._eo[this.dataLengthMode][e])};this.getRomanAndFigureString=function(h){var f=h;var g=0;var j="";var d=new Array("0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":");do{if(f>1){g=this._gd(11);var i=Math.floor(g/45);var e=g%45;j+=d[i];j+=d[e];f-=2}else{if(f==1){g=this._gd(6);j+=d[g];f-=1}}}while(f>0);return j};this.getFigureString=function(f){var d=f;var e=0;var g="";do{if(d>=3){e=this._gd(10);if(e<100){g+="0"}if(e<10){g+="0"}d-=3}else{if(d==2){e=this._gd(7);if(e<10){g+="0"}d-=2}else{if(d==1){e=this._gd(4);d-=1}}}g+=e}while(d>0);return g};this.get8bitByteArray=function(g){var e=g;var f=0;var d=new Array();do{f=this._gd(8);d.push(f);e--}while(e>0);return d};this.getKanjiString=function(j){var g=j;var i=0;var h="";do{i=_gd(13);var e=i%192;var f=i/192;var k=(f<<8)+e;var d=0;if(k+33088<=40956){d=k+33088}else{d=k+49472}h+=String.fromCharCode(d);g--}while(g>0);return h};this.__defineGetter__("DataByte",function(){var g=new Array();var e=1;var f=2;var d=4;var n=8;do{var k=this.NextMode();if(k==0){if(g.length>0){break}else{throw"Empty data block"}}if(k!=e&&k!=f&&k!=d&&k!=n){throw"Invalid mode: "+k+" in (block:"+this._ed+" bit:"+this._cw+")"}dataLength=this.getDataLength(k);if(dataLength<1){throw"Invalid data length: "+dataLength}switch(k){case e:var l=this.getFigureString(dataLength);var i=new Array(l.length);for(var h=0;h 1) { + var x = (uint8array[i]<<8)+ uint8array[i+1] + var [ e, x ] = divmod(x, 45*45) + var [ d, c ] = divmod(x, 45) + output.push(fromCharCode(c) + fromCharCode(d) + fromCharCode(e)) + } else { + var x = uint8array[i] + var [ d, c ] = divmod(x, 45) + output.push(fromCharCode(c) + fromCharCode(d)) + } + } + return output.join('') + }; + + var divmod = function divmod(a,b) { + var remainder = a + var quotient = 0 + if (a >= b) { + remainder = a % b + quotient = (a - remainder) / b + } + return [ quotient, remainder ] + } + + const BASE45_CHARSET = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:" + var fromCharCode = function fromCharCode(c) { + return BASE45_CHARSET.charAt(c); + }; + +function decode(str) { + var output = [] + var buf = [] + + for(var i = 0, length=str.length; i < length; i++) { +//console.log(i); + var j = BASE45_CHARSET.indexOf(str[i]) + if (j < 0) + console.log('Base45 decode: unknown character n.', i, j); + //throw new Error('Base45 decode: unknown character'); + buf.push(j) + } + + for(var i = 0, length=buf.length; i < length; i+=3) { + var x = buf[i] + buf[i + 1] * 45 + if (length - i >= 3) { + var [d, c] = divmod(x + buf[i + 2] * 45 * 45,256) + output.push(d) + output.push(c) + } else { + output.push(x) + } + } +console.log("output",output); + var enc = new TextEncoder(); + return {"enc" : enc.encode(output), "raw" : output}; + //return Buffer.from(output); + }; \ No newline at end of file diff --git a/js/pako.min.js b/js/pako.min.js new file mode 100644 index 0000000..5f0fee1 --- /dev/null +++ b/js/pako.min.js @@ -0,0 +1,2 @@ +/*! pako 2.0.4 https://github.com/nodeca/pako @license (MIT AND Zlib) */ +!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).pako={})}(this,(function(t){"use strict";function e(t){let e=t.length;for(;--e>=0;)t[e]=0}const a=256,i=286,n=30,s=15,r=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),l=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),o=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),h=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),d=new Array(576);e(d);const _=new Array(60);e(_);const f=new Array(512);e(f);const c=new Array(256);e(c);const u=new Array(29);e(u);const w=new Array(n);function b(t,e,a,i,n){this.static_tree=t,this.extra_bits=e,this.extra_base=a,this.elems=i,this.max_length=n,this.has_stree=t&&t.length}let g,p,m;function k(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}e(w);const v=t=>t<256?f[t]:f[256+(t>>>7)],y=(t,e)=>{t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255},x=(t,e,a)=>{t.bi_valid>16-a?(t.bi_buf|=e<>16-t.bi_valid,t.bi_valid+=a-16):(t.bi_buf|=e<{x(t,a[2*e],a[2*e+1])},A=(t,e)=>{let a=0;do{a|=1&t,t>>>=1,a<<=1}while(--e>0);return a>>>1},E=(t,e,a)=>{const i=new Array(16);let n,r,l=0;for(n=1;n<=s;n++)i[n]=l=l+a[n-1]<<1;for(r=0;r<=e;r++){let e=t[2*r+1];0!==e&&(t[2*r]=A(i[e]++,e))}},R=t=>{let e;for(e=0;e{t.bi_valid>8?y(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0},U=(t,e,a,i)=>{const n=2*e,s=2*a;return t[n]{const i=t.heap[a];let n=a<<1;for(;n<=t.heap_len&&(n{let n,s,o,h,d=0;if(0!==t.last_lit)do{n=t.pending_buf[t.d_buf+2*d]<<8|t.pending_buf[t.d_buf+2*d+1],s=t.pending_buf[t.l_buf+d],d++,0===n?z(t,s,e):(o=c[s],z(t,o+a+1,e),h=r[o],0!==h&&(s-=u[o],x(t,s,h)),n--,o=v(n),z(t,o,i),h=l[o],0!==h&&(n-=w[o],x(t,n,h)))}while(d{const a=e.dyn_tree,i=e.stat_desc.static_tree,n=e.stat_desc.has_stree,r=e.stat_desc.elems;let l,o,h,d=-1;for(t.heap_len=0,t.heap_max=573,l=0;l>1;l>=1;l--)S(t,a,l);h=r;do{l=t.heap[1],t.heap[1]=t.heap[t.heap_len--],S(t,a,1),o=t.heap[1],t.heap[--t.heap_max]=l,t.heap[--t.heap_max]=o,a[2*h]=a[2*l]+a[2*o],t.depth[h]=(t.depth[l]>=t.depth[o]?t.depth[l]:t.depth[o])+1,a[2*l+1]=a[2*o+1]=h,t.heap[1]=h++,S(t,a,1)}while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],((t,e)=>{const a=e.dyn_tree,i=e.max_code,n=e.stat_desc.static_tree,r=e.stat_desc.has_stree,l=e.stat_desc.extra_bits,o=e.stat_desc.extra_base,h=e.stat_desc.max_length;let d,_,f,c,u,w,b=0;for(c=0;c<=s;c++)t.bl_count[c]=0;for(a[2*t.heap[t.heap_max]+1]=0,d=t.heap_max+1;d<573;d++)_=t.heap[d],c=a[2*a[2*_+1]+1]+1,c>h&&(c=h,b++),a[2*_+1]=c,_>i||(t.bl_count[c]++,u=0,_>=o&&(u=l[_-o]),w=a[2*_],t.opt_len+=w*(c+u),r&&(t.static_len+=w*(n[2*_+1]+u)));if(0!==b){do{for(c=h-1;0===t.bl_count[c];)c--;t.bl_count[c]--,t.bl_count[c+1]+=2,t.bl_count[h]--,b-=2}while(b>0);for(c=h;0!==c;c--)for(_=t.bl_count[c];0!==_;)f=t.heap[--d],f>i||(a[2*f+1]!==c&&(t.opt_len+=(c-a[2*f+1])*a[2*f],a[2*f+1]=c),_--)}})(t,e),E(a,d,t.bl_count)},O=(t,e,a)=>{let i,n,s=-1,r=e[1],l=0,o=7,h=4;for(0===r&&(o=138,h=3),e[2*(a+1)+1]=65535,i=0;i<=a;i++)n=r,r=e[2*(i+1)+1],++l{let i,n,s=-1,r=e[1],l=0,o=7,h=4;for(0===r&&(o=138,h=3),i=0;i<=a;i++)if(n=r,r=e[2*(i+1)+1],!(++l{x(t,0+(i?1:0),3),((t,e,a,i)=>{Z(t),i&&(y(t,a),y(t,~a)),t.pending_buf.set(t.window.subarray(e,e+a),t.pending),t.pending+=a})(t,e,a,!0)};var N={_tr_init:t=>{F||((()=>{let t,e,a,h,k;const v=new Array(16);for(a=0,h=0;h<28;h++)for(u[h]=a,t=0;t<1<>=7;h{let s,r,l=0;t.level>0?(2===t.strm.data_type&&(t.strm.data_type=(t=>{let e,i=4093624447;for(e=0;e<=31;e++,i>>>=1)if(1&i&&0!==t.dyn_ltree[2*e])return 0;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return 1;for(e=32;e{let e;for(O(t,t.dyn_ltree,t.l_desc.max_code),O(t,t.dyn_dtree,t.d_desc.max_code),T(t,t.bl_desc),e=18;e>=3&&0===t.bl_tree[2*h[e]+1];e--);return t.opt_len+=3*(e+1)+5+5+4,e})(t),s=t.opt_len+3+7>>>3,r=t.static_len+3+7>>>3,r<=s&&(s=r)):s=r=i+5,i+4<=s&&-1!==e?L(t,e,i,n):4===t.strategy||r===s?(x(t,2+(n?1:0),3),D(t,d,_)):(x(t,4+(n?1:0),3),((t,e,a,i)=>{let n;for(x(t,e-257,5),x(t,a-1,5),x(t,i-4,4),n=0;n(t.pending_buf[t.d_buf+2*t.last_lit]=e>>>8&255,t.pending_buf[t.d_buf+2*t.last_lit+1]=255&e,t.pending_buf[t.l_buf+t.last_lit]=255&i,t.last_lit++,0===e?t.dyn_ltree[2*i]++:(t.matches++,e--,t.dyn_ltree[2*(c[i]+a+1)]++,t.dyn_dtree[2*v(e)]++),t.last_lit===t.lit_bufsize-1),_tr_align:t=>{x(t,2,3),z(t,256,d),(t=>{16===t.bi_valid?(y(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)})(t)}};var B=(t,e,a,i)=>{let n=65535&t|0,s=t>>>16&65535|0,r=0;for(;0!==a;){r=a>2e3?2e3:a,a-=r;do{n=n+e[i++]|0,s=s+n|0}while(--r);n%=65521,s%=65521}return n|s<<16|0};const C=new Uint32Array((()=>{let t,e=[];for(var a=0;a<256;a++){t=a;for(var i=0;i<8;i++)t=1&t?3988292384^t>>>1:t>>>1;e[a]=t}return e})());var M=(t,e,a,i)=>{const n=C,s=i+a;t^=-1;for(let a=i;a>>8^n[255&(t^e[a])];return-1^t},H={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},j={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8};const{_tr_init:K,_tr_stored_block:P,_tr_flush_block:Y,_tr_tally:G,_tr_align:X}=N,{Z_NO_FLUSH:W,Z_PARTIAL_FLUSH:q,Z_FULL_FLUSH:J,Z_FINISH:Q,Z_BLOCK:V,Z_OK:$,Z_STREAM_END:tt,Z_STREAM_ERROR:et,Z_DATA_ERROR:at,Z_BUF_ERROR:it,Z_DEFAULT_COMPRESSION:nt,Z_FILTERED:st,Z_HUFFMAN_ONLY:rt,Z_RLE:lt,Z_FIXED:ot,Z_DEFAULT_STRATEGY:ht,Z_UNKNOWN:dt,Z_DEFLATED:_t}=j,ft=258,ct=262,ut=103,wt=113,bt=666,gt=(t,e)=>(t.msg=H[e],e),pt=t=>(t<<1)-(t>4?9:0),mt=t=>{let e=t.length;for(;--e>=0;)t[e]=0};let kt=(t,e,a)=>(e<{const e=t.state;let a=e.pending;a>t.avail_out&&(a=t.avail_out),0!==a&&(t.output.set(e.pending_buf.subarray(e.pending_out,e.pending_out+a),t.next_out),t.next_out+=a,e.pending_out+=a,t.total_out+=a,t.avail_out-=a,e.pending-=a,0===e.pending&&(e.pending_out=0))},yt=(t,e)=>{Y(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,vt(t.strm)},xt=(t,e)=>{t.pending_buf[t.pending++]=e},zt=(t,e)=>{t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e},At=(t,e,a,i)=>{let n=t.avail_in;return n>i&&(n=i),0===n?0:(t.avail_in-=n,e.set(t.input.subarray(t.next_in,t.next_in+n),a),1===t.state.wrap?t.adler=B(t.adler,e,n,a):2===t.state.wrap&&(t.adler=M(t.adler,e,n,a)),t.next_in+=n,t.total_in+=n,n)},Et=(t,e)=>{let a,i,n=t.max_chain_length,s=t.strstart,r=t.prev_length,l=t.nice_match;const o=t.strstart>t.w_size-ct?t.strstart-(t.w_size-ct):0,h=t.window,d=t.w_mask,_=t.prev,f=t.strstart+ft;let c=h[s+r-1],u=h[s+r];t.prev_length>=t.good_match&&(n>>=2),l>t.lookahead&&(l=t.lookahead);do{if(a=e,h[a+r]===u&&h[a+r-1]===c&&h[a]===h[s]&&h[++a]===h[s+1]){s+=2,a++;do{}while(h[++s]===h[++a]&&h[++s]===h[++a]&&h[++s]===h[++a]&&h[++s]===h[++a]&&h[++s]===h[++a]&&h[++s]===h[++a]&&h[++s]===h[++a]&&h[++s]===h[++a]&&sr){if(t.match_start=e,r=i,i>=l)break;c=h[s+r-1],u=h[s+r]}}}while((e=_[e&d])>o&&0!=--n);return r<=t.lookahead?r:t.lookahead},Rt=t=>{const e=t.w_size;let a,i,n,s,r;do{if(s=t.window_size-t.lookahead-t.strstart,t.strstart>=e+(e-ct)){t.window.set(t.window.subarray(e,e+e),0),t.match_start-=e,t.strstart-=e,t.block_start-=e,i=t.hash_size,a=i;do{n=t.head[--a],t.head[a]=n>=e?n-e:0}while(--i);i=e,a=i;do{n=t.prev[--a],t.prev[a]=n>=e?n-e:0}while(--i);s+=e}if(0===t.strm.avail_in)break;if(i=At(t.strm,t.window,t.strstart+t.lookahead,s),t.lookahead+=i,t.lookahead+t.insert>=3)for(r=t.strstart-t.insert,t.ins_h=t.window[r],t.ins_h=kt(t,t.ins_h,t.window[r+1]);t.insert&&(t.ins_h=kt(t,t.ins_h,t.window[r+3-1]),t.prev[r&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=r,r++,t.insert--,!(t.lookahead+t.insert<3)););}while(t.lookahead{let a,i;for(;;){if(t.lookahead=3&&(t.ins_h=kt(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),0!==a&&t.strstart-a<=t.w_size-ct&&(t.match_length=Et(t,a)),t.match_length>=3)if(i=G(t,t.strstart-t.match_start,t.match_length-3),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=3){t.match_length--;do{t.strstart++,t.ins_h=kt(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart}while(0!=--t.match_length);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=kt(t,t.ins_h,t.window[t.strstart+1]);else i=G(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(i&&(yt(t,!1),0===t.strm.avail_out))return 1}return t.insert=t.strstart<2?t.strstart:2,e===Q?(yt(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(yt(t,!1),0===t.strm.avail_out)?1:2},Ut=(t,e)=>{let a,i,n;for(;;){if(t.lookahead=3&&(t.ins_h=kt(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=2,0!==a&&t.prev_length4096)&&(t.match_length=2)),t.prev_length>=3&&t.match_length<=t.prev_length){n=t.strstart+t.lookahead-3,i=G(t,t.strstart-1-t.prev_match,t.prev_length-3),t.lookahead-=t.prev_length-1,t.prev_length-=2;do{++t.strstart<=n&&(t.ins_h=kt(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart)}while(0!=--t.prev_length);if(t.match_available=0,t.match_length=2,t.strstart++,i&&(yt(t,!1),0===t.strm.avail_out))return 1}else if(t.match_available){if(i=G(t,0,t.window[t.strstart-1]),i&&yt(t,!1),t.strstart++,t.lookahead--,0===t.strm.avail_out)return 1}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(i=G(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<2?t.strstart:2,e===Q?(yt(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(yt(t,!1),0===t.strm.avail_out)?1:2};function St(t,e,a,i,n){this.good_length=t,this.max_lazy=e,this.nice_length=a,this.max_chain=i,this.func=n}const Dt=[new St(0,0,0,0,((t,e)=>{let a=65535;for(a>t.pending_buf_size-5&&(a=t.pending_buf_size-5);;){if(t.lookahead<=1){if(Rt(t),0===t.lookahead&&e===W)return 1;if(0===t.lookahead)break}t.strstart+=t.lookahead,t.lookahead=0;const i=t.block_start+a;if((0===t.strstart||t.strstart>=i)&&(t.lookahead=t.strstart-i,t.strstart=i,yt(t,!1),0===t.strm.avail_out))return 1;if(t.strstart-t.block_start>=t.w_size-ct&&(yt(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,e===Q?(yt(t,!0),0===t.strm.avail_out?3:4):(t.strstart>t.block_start&&(yt(t,!1),t.strm.avail_out),1)})),new St(4,4,8,4,Zt),new St(4,5,16,8,Zt),new St(4,6,32,32,Zt),new St(4,4,16,16,Ut),new St(8,16,32,32,Ut),new St(8,16,128,128,Ut),new St(8,32,128,256,Ut),new St(32,128,258,1024,Ut),new St(32,258,258,4096,Ut)];function Tt(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=_t,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(1146),this.dyn_dtree=new Uint16Array(122),this.bl_tree=new Uint16Array(78),mt(this.dyn_ltree),mt(this.dyn_dtree),mt(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(16),this.heap=new Uint16Array(573),mt(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(573),mt(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}const Ot=t=>{if(!t||!t.state)return gt(t,et);t.total_in=t.total_out=0,t.data_type=dt;const e=t.state;return e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap?42:wt,t.adler=2===e.wrap?0:1,e.last_flush=W,K(e),$},It=t=>{const e=Ot(t);var a;return e===$&&((a=t.state).window_size=2*a.w_size,mt(a.head),a.max_lazy_match=Dt[a.level].max_lazy,a.good_match=Dt[a.level].good_length,a.nice_match=Dt[a.level].nice_length,a.max_chain_length=Dt[a.level].max_chain,a.strstart=0,a.block_start=0,a.lookahead=0,a.insert=0,a.match_length=a.prev_length=2,a.match_available=0,a.ins_h=0),e},Ft=(t,e,a,i,n,s)=>{if(!t)return et;let r=1;if(e===nt&&(e=6),i<0?(r=0,i=-i):i>15&&(r=2,i-=16),n<1||n>9||a!==_t||i<8||i>15||e<0||e>9||s<0||s>ot)return gt(t,et);8===i&&(i=9);const l=new Tt;return t.state=l,l.strm=t,l.wrap=r,l.gzhead=null,l.w_bits=i,l.w_size=1<Ft(t,e,_t,15,8,ht),deflateInit2:Ft,deflateReset:It,deflateResetKeep:Ot,deflateSetHeader:(t,e)=>t&&t.state?2!==t.state.wrap?et:(t.state.gzhead=e,$):et,deflate:(t,e)=>{let a,i;if(!t||!t.state||e>V||e<0)return t?gt(t,et):et;const n=t.state;if(!t.output||!t.input&&0!==t.avail_in||n.status===bt&&e!==Q)return gt(t,0===t.avail_out?it:et);n.strm=t;const s=n.last_flush;if(n.last_flush=e,42===n.status)if(2===n.wrap)t.adler=0,xt(n,31),xt(n,139),xt(n,8),n.gzhead?(xt(n,(n.gzhead.text?1:0)+(n.gzhead.hcrc?2:0)+(n.gzhead.extra?4:0)+(n.gzhead.name?8:0)+(n.gzhead.comment?16:0)),xt(n,255&n.gzhead.time),xt(n,n.gzhead.time>>8&255),xt(n,n.gzhead.time>>16&255),xt(n,n.gzhead.time>>24&255),xt(n,9===n.level?2:n.strategy>=rt||n.level<2?4:0),xt(n,255&n.gzhead.os),n.gzhead.extra&&n.gzhead.extra.length&&(xt(n,255&n.gzhead.extra.length),xt(n,n.gzhead.extra.length>>8&255)),n.gzhead.hcrc&&(t.adler=M(t.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=69):(xt(n,0),xt(n,0),xt(n,0),xt(n,0),xt(n,0),xt(n,9===n.level?2:n.strategy>=rt||n.level<2?4:0),xt(n,3),n.status=wt);else{let e=_t+(n.w_bits-8<<4)<<8,a=-1;a=n.strategy>=rt||n.level<2?0:n.level<6?1:6===n.level?2:3,e|=a<<6,0!==n.strstart&&(e|=32),e+=31-e%31,n.status=wt,zt(n,e),0!==n.strstart&&(zt(n,t.adler>>>16),zt(n,65535&t.adler)),t.adler=1}if(69===n.status)if(n.gzhead.extra){for(a=n.pending;n.gzindex<(65535&n.gzhead.extra.length)&&(n.pending!==n.pending_buf_size||(n.gzhead.hcrc&&n.pending>a&&(t.adler=M(t.adler,n.pending_buf,n.pending-a,a)),vt(t),a=n.pending,n.pending!==n.pending_buf_size));)xt(n,255&n.gzhead.extra[n.gzindex]),n.gzindex++;n.gzhead.hcrc&&n.pending>a&&(t.adler=M(t.adler,n.pending_buf,n.pending-a,a)),n.gzindex===n.gzhead.extra.length&&(n.gzindex=0,n.status=73)}else n.status=73;if(73===n.status)if(n.gzhead.name){a=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>a&&(t.adler=M(t.adler,n.pending_buf,n.pending-a,a)),vt(t),a=n.pending,n.pending===n.pending_buf_size)){i=1;break}i=n.gzindexa&&(t.adler=M(t.adler,n.pending_buf,n.pending-a,a)),0===i&&(n.gzindex=0,n.status=91)}else n.status=91;if(91===n.status)if(n.gzhead.comment){a=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>a&&(t.adler=M(t.adler,n.pending_buf,n.pending-a,a)),vt(t),a=n.pending,n.pending===n.pending_buf_size)){i=1;break}i=n.gzindexa&&(t.adler=M(t.adler,n.pending_buf,n.pending-a,a)),0===i&&(n.status=ut)}else n.status=ut;if(n.status===ut&&(n.gzhead.hcrc?(n.pending+2>n.pending_buf_size&&vt(t),n.pending+2<=n.pending_buf_size&&(xt(n,255&t.adler),xt(n,t.adler>>8&255),t.adler=0,n.status=wt)):n.status=wt),0!==n.pending){if(vt(t),0===t.avail_out)return n.last_flush=-1,$}else if(0===t.avail_in&&pt(e)<=pt(s)&&e!==Q)return gt(t,it);if(n.status===bt&&0!==t.avail_in)return gt(t,it);if(0!==t.avail_in||0!==n.lookahead||e!==W&&n.status!==bt){let a=n.strategy===rt?((t,e)=>{let a;for(;;){if(0===t.lookahead&&(Rt(t),0===t.lookahead)){if(e===W)return 1;break}if(t.match_length=0,a=G(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,a&&(yt(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,e===Q?(yt(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(yt(t,!1),0===t.strm.avail_out)?1:2})(n,e):n.strategy===lt?((t,e)=>{let a,i,n,s;const r=t.window;for(;;){if(t.lookahead<=ft){if(Rt(t),t.lookahead<=ft&&e===W)return 1;if(0===t.lookahead)break}if(t.match_length=0,t.lookahead>=3&&t.strstart>0&&(n=t.strstart-1,i=r[n],i===r[++n]&&i===r[++n]&&i===r[++n])){s=t.strstart+ft;do{}while(i===r[++n]&&i===r[++n]&&i===r[++n]&&i===r[++n]&&i===r[++n]&&i===r[++n]&&i===r[++n]&&i===r[++n]&&nt.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=3?(a=G(t,1,t.match_length-3),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(a=G(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),a&&(yt(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,e===Q?(yt(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(yt(t,!1),0===t.strm.avail_out)?1:2})(n,e):Dt[n.level].func(n,e);if(3!==a&&4!==a||(n.status=bt),1===a||3===a)return 0===t.avail_out&&(n.last_flush=-1),$;if(2===a&&(e===q?X(n):e!==V&&(P(n,0,0,!1),e===J&&(mt(n.head),0===n.lookahead&&(n.strstart=0,n.block_start=0,n.insert=0))),vt(t),0===t.avail_out))return n.last_flush=-1,$}return e!==Q?$:n.wrap<=0?tt:(2===n.wrap?(xt(n,255&t.adler),xt(n,t.adler>>8&255),xt(n,t.adler>>16&255),xt(n,t.adler>>24&255),xt(n,255&t.total_in),xt(n,t.total_in>>8&255),xt(n,t.total_in>>16&255),xt(n,t.total_in>>24&255)):(zt(n,t.adler>>>16),zt(n,65535&t.adler)),vt(t),n.wrap>0&&(n.wrap=-n.wrap),0!==n.pending?$:tt)},deflateEnd:t=>{if(!t||!t.state)return et;const e=t.state.status;return 42!==e&&69!==e&&73!==e&&91!==e&&e!==ut&&e!==wt&&e!==bt?gt(t,et):(t.state=null,e===wt?gt(t,at):$)},deflateSetDictionary:(t,e)=>{let a=e.length;if(!t||!t.state)return et;const i=t.state,n=i.wrap;if(2===n||1===n&&42!==i.status||i.lookahead)return et;if(1===n&&(t.adler=B(t.adler,e,a,0)),i.wrap=0,a>=i.w_size){0===n&&(mt(i.head),i.strstart=0,i.block_start=0,i.insert=0);let t=new Uint8Array(i.w_size);t.set(e.subarray(a-i.w_size,a),0),e=t,a=i.w_size}const s=t.avail_in,r=t.next_in,l=t.input;for(t.avail_in=a,t.next_in=0,t.input=e,Rt(i);i.lookahead>=3;){let t=i.strstart,e=i.lookahead-2;do{i.ins_h=kt(i,i.ins_h,i.window[t+3-1]),i.prev[t&i.w_mask]=i.head[i.ins_h],i.head[i.ins_h]=t,t++}while(--e);i.strstart=t,i.lookahead=2,Rt(i)}return i.strstart+=i.lookahead,i.block_start=i.strstart,i.insert=i.lookahead,i.lookahead=0,i.match_length=i.prev_length=2,i.match_available=0,t.next_in=r,t.input=l,t.avail_in=s,i.wrap=n,$},deflateInfo:"pako deflate (from Nodeca project)"};const Nt=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);var Bt=function(t){const e=Array.prototype.slice.call(arguments,1);for(;e.length;){const a=e.shift();if(a){if("object"!=typeof a)throw new TypeError(a+"must be non-object");for(const e in a)Nt(a,e)&&(t[e]=a[e])}}return t},Ct=t=>{let e=0;for(let a=0,i=t.length;a=252?6:t>=248?5:t>=240?4:t>=224?3:t>=192?2:1;Ht[254]=Ht[254]=1;var jt=t=>{if("function"==typeof TextEncoder&&TextEncoder.prototype.encode)return(new TextEncoder).encode(t);let e,a,i,n,s,r=t.length,l=0;for(n=0;n>>6,e[s++]=128|63&a):a<65536?(e[s++]=224|a>>>12,e[s++]=128|a>>>6&63,e[s++]=128|63&a):(e[s++]=240|a>>>18,e[s++]=128|a>>>12&63,e[s++]=128|a>>>6&63,e[s++]=128|63&a);return e},Kt=(t,e)=>{const a=e||t.length;if("function"==typeof TextDecoder&&TextDecoder.prototype.decode)return(new TextDecoder).decode(t.subarray(0,e));let i,n;const s=new Array(2*a);for(n=0,i=0;i4)s[n++]=65533,i+=r-1;else{for(e&=2===r?31:3===r?15:7;r>1&&i1?s[n++]=65533:e<65536?s[n++]=e:(e-=65536,s[n++]=55296|e>>10&1023,s[n++]=56320|1023&e)}}return((t,e)=>{if(e<65534&&t.subarray&&Mt)return String.fromCharCode.apply(null,t.length===e?t:t.subarray(0,e));let a="";for(let i=0;i{(e=e||t.length)>t.length&&(e=t.length);let a=e-1;for(;a>=0&&128==(192&t[a]);)a--;return a<0||0===a?e:a+Ht[t[a]]>e?a:e};var Yt=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0};const Gt=Object.prototype.toString,{Z_NO_FLUSH:Xt,Z_SYNC_FLUSH:Wt,Z_FULL_FLUSH:qt,Z_FINISH:Jt,Z_OK:Qt,Z_STREAM_END:Vt,Z_DEFAULT_COMPRESSION:$t,Z_DEFAULT_STRATEGY:te,Z_DEFLATED:ee}=j;function ae(t){this.options=Bt({level:$t,method:ee,chunkSize:16384,windowBits:15,memLevel:8,strategy:te},t||{});let e=this.options;e.raw&&e.windowBits>0?e.windowBits=-e.windowBits:e.gzip&&e.windowBits>0&&e.windowBits<16&&(e.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Yt,this.strm.avail_out=0;let a=Lt.deflateInit2(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(a!==Qt)throw new Error(H[a]);if(e.header&&Lt.deflateSetHeader(this.strm,e.header),e.dictionary){let t;if(t="string"==typeof e.dictionary?jt(e.dictionary):"[object ArrayBuffer]"===Gt.call(e.dictionary)?new Uint8Array(e.dictionary):e.dictionary,a=Lt.deflateSetDictionary(this.strm,t),a!==Qt)throw new Error(H[a]);this._dict_set=!0}}function ie(t,e){const a=new ae(e);if(a.push(t,!0),a.err)throw a.msg||H[a.err];return a.result}ae.prototype.push=function(t,e){const a=this.strm,i=this.options.chunkSize;let n,s;if(this.ended)return!1;for(s=e===~~e?e:!0===e?Jt:Xt,"string"==typeof t?a.input=jt(t):"[object ArrayBuffer]"===Gt.call(t)?a.input=new Uint8Array(t):a.input=t,a.next_in=0,a.avail_in=a.input.length;;)if(0===a.avail_out&&(a.output=new Uint8Array(i),a.next_out=0,a.avail_out=i),(s===Wt||s===qt)&&a.avail_out<=6)this.onData(a.output.subarray(0,a.next_out)),a.avail_out=0;else{if(n=Lt.deflate(a,s),n===Vt)return a.next_out>0&&this.onData(a.output.subarray(0,a.next_out)),n=Lt.deflateEnd(this.strm),this.onEnd(n),this.ended=!0,n===Qt;if(0!==a.avail_out){if(s>0&&a.next_out>0)this.onData(a.output.subarray(0,a.next_out)),a.avail_out=0;else if(0===a.avail_in)break}else this.onData(a.output)}return!0},ae.prototype.onData=function(t){this.chunks.push(t)},ae.prototype.onEnd=function(t){t===Qt&&(this.result=Ct(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};var ne={Deflate:ae,deflate:ie,deflateRaw:function(t,e){return(e=e||{}).raw=!0,ie(t,e)},gzip:function(t,e){return(e=e||{}).gzip=!0,ie(t,e)},constants:j};var se=function(t,e){let a,i,n,s,r,l,o,h,d,_,f,c,u,w,b,g,p,m,k,v,y,x,z,A;const E=t.state;a=t.next_in,z=t.input,i=a+(t.avail_in-5),n=t.next_out,A=t.output,s=n-(e-t.avail_out),r=n+(t.avail_out-257),l=E.dmax,o=E.wsize,h=E.whave,d=E.wnext,_=E.window,f=E.hold,c=E.bits,u=E.lencode,w=E.distcode,b=(1<>>24,f>>>=m,c-=m,m=p>>>16&255,0===m)A[n++]=65535&p;else{if(!(16&m)){if(0==(64&m)){p=u[(65535&p)+(f&(1<>>=m,c-=m),c<15&&(f+=z[a++]<>>24,f>>>=m,c-=m,m=p>>>16&255,!(16&m)){if(0==(64&m)){p=w[(65535&p)+(f&(1<l){t.msg="invalid distance too far back",E.mode=30;break t}if(f>>>=m,c-=m,m=n-s,v>m){if(m=v-m,m>h&&E.sane){t.msg="invalid distance too far back",E.mode=30;break t}if(y=0,x=_,0===d){if(y+=o-m,m2;)A[n++]=x[y++],A[n++]=x[y++],A[n++]=x[y++],k-=3;k&&(A[n++]=x[y++],k>1&&(A[n++]=x[y++]))}else{y=n-v;do{A[n++]=A[y++],A[n++]=A[y++],A[n++]=A[y++],k-=3}while(k>2);k&&(A[n++]=A[y++],k>1&&(A[n++]=A[y++]))}break}}break}}while(a>3,a-=k,c-=k<<3,f&=(1<{const o=l.bits;let h,d,_,f,c,u,w=0,b=0,g=0,p=0,m=0,k=0,v=0,y=0,x=0,z=0,A=null,E=0;const R=new Uint16Array(16),Z=new Uint16Array(16);let U,S,D,T=null,O=0;for(w=0;w<=re;w++)R[w]=0;for(b=0;b=1&&0===R[p];p--);if(m>p&&(m=p),0===p)return n[s++]=20971520,n[s++]=20971520,l.bits=1,0;for(g=1;g0&&(0===t||1!==p))return-1;for(Z[1]=0,w=1;w852||2===t&&x>592)return 1;for(;;){U=w-v,r[b]u?(S=T[O+r[b]],D=A[E+r[b]]):(S=96,D=0),h=1<>v)+d]=U<<24|S<<16|D|0}while(0!==d);for(h=1<>=1;if(0!==h?(z&=h-1,z+=h):z=0,b++,0==--R[w]){if(w===p)break;w=e[a+r[b]]}if(w>m&&(z&f)!==_){for(0===v&&(v=m),c+=g,k=w-v,y=1<852||2===t&&x>592)return 1;_=z&f,n[_]=m<<24|k<<16|c-s|0}}return 0!==z&&(n[c+z]=w-v<<24|64<<16|0),l.bits=m,0};const{Z_FINISH:fe,Z_BLOCK:ce,Z_TREES:ue,Z_OK:we,Z_STREAM_END:be,Z_NEED_DICT:ge,Z_STREAM_ERROR:pe,Z_DATA_ERROR:me,Z_MEM_ERROR:ke,Z_BUF_ERROR:ve,Z_DEFLATED:ye}=j,xe=12,ze=30,Ae=t=>(t>>>24&255)+(t>>>8&65280)+((65280&t)<<8)+((255&t)<<24);function Ee(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}const Re=t=>{if(!t||!t.state)return pe;const e=t.state;return t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=1&e.wrap),e.mode=1,e.last=0,e.havedict=0,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new Int32Array(852),e.distcode=e.distdyn=new Int32Array(592),e.sane=1,e.back=-1,we},Ze=t=>{if(!t||!t.state)return pe;const e=t.state;return e.wsize=0,e.whave=0,e.wnext=0,Re(t)},Ue=(t,e)=>{let a;if(!t||!t.state)return pe;const i=t.state;return e<0?(a=0,e=-e):(a=1+(e>>4),e<48&&(e&=15)),e&&(e<8||e>15)?pe:(null!==i.window&&i.wbits!==e&&(i.window=null),i.wrap=a,i.wbits=e,Ze(t))},Se=(t,e)=>{if(!t)return pe;const a=new Ee;t.state=a,a.window=null;const i=Ue(t,e);return i!==we&&(t.state=null),i};let De,Te,Oe=!0;const Ie=t=>{if(Oe){De=new Int32Array(512),Te=new Int32Array(32);let e=0;for(;e<144;)t.lens[e++]=8;for(;e<256;)t.lens[e++]=9;for(;e<280;)t.lens[e++]=7;for(;e<288;)t.lens[e++]=8;for(_e(1,t.lens,0,288,De,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;_e(2,t.lens,0,32,Te,0,t.work,{bits:5}),Oe=!1}t.lencode=De,t.lenbits=9,t.distcode=Te,t.distbits=5},Fe=(t,e,a,i)=>{let n;const s=t.state;return null===s.window&&(s.wsize=1<=s.wsize?(s.window.set(e.subarray(a-s.wsize,a),0),s.wnext=0,s.whave=s.wsize):(n=s.wsize-s.wnext,n>i&&(n=i),s.window.set(e.subarray(a-i,a-i+n),s.wnext),(i-=n)?(s.window.set(e.subarray(a-i,a),0),s.wnext=i,s.whave=s.wsize):(s.wnext+=n,s.wnext===s.wsize&&(s.wnext=0),s.whaveSe(t,15),inflateInit2:Se,inflate:(t,e)=>{let a,i,n,s,r,l,o,h,d,_,f,c,u,w,b,g,p,m,k,v,y,x,z=0;const A=new Uint8Array(4);let E,R;const Z=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(!t||!t.state||!t.output||!t.input&&0!==t.avail_in)return pe;a=t.state,a.mode===xe&&(a.mode=13),r=t.next_out,n=t.output,o=t.avail_out,s=t.next_in,i=t.input,l=t.avail_in,h=a.hold,d=a.bits,_=l,f=o,x=we;t:for(;;)switch(a.mode){case 1:if(0===a.wrap){a.mode=13;break}for(;d<16;){if(0===l)break t;l--,h+=i[s++]<>>8&255,a.check=M(a.check,A,2,0),h=0,d=0,a.mode=2;break}if(a.flags=0,a.head&&(a.head.done=!1),!(1&a.wrap)||(((255&h)<<8)+(h>>8))%31){t.msg="incorrect header check",a.mode=ze;break}if((15&h)!==ye){t.msg="unknown compression method",a.mode=ze;break}if(h>>>=4,d-=4,y=8+(15&h),0===a.wbits)a.wbits=y;else if(y>a.wbits){t.msg="invalid window size",a.mode=ze;break}a.dmax=1<>8&1),512&a.flags&&(A[0]=255&h,A[1]=h>>>8&255,a.check=M(a.check,A,2,0)),h=0,d=0,a.mode=3;case 3:for(;d<32;){if(0===l)break t;l--,h+=i[s++]<>>8&255,A[2]=h>>>16&255,A[3]=h>>>24&255,a.check=M(a.check,A,4,0)),h=0,d=0,a.mode=4;case 4:for(;d<16;){if(0===l)break t;l--,h+=i[s++]<>8),512&a.flags&&(A[0]=255&h,A[1]=h>>>8&255,a.check=M(a.check,A,2,0)),h=0,d=0,a.mode=5;case 5:if(1024&a.flags){for(;d<16;){if(0===l)break t;l--,h+=i[s++]<>>8&255,a.check=M(a.check,A,2,0)),h=0,d=0}else a.head&&(a.head.extra=null);a.mode=6;case 6:if(1024&a.flags&&(c=a.length,c>l&&(c=l),c&&(a.head&&(y=a.head.extra_len-a.length,a.head.extra||(a.head.extra=new Uint8Array(a.head.extra_len)),a.head.extra.set(i.subarray(s,s+c),y)),512&a.flags&&(a.check=M(a.check,i,c,s)),l-=c,s+=c,a.length-=c),a.length))break t;a.length=0,a.mode=7;case 7:if(2048&a.flags){if(0===l)break t;c=0;do{y=i[s+c++],a.head&&y&&a.length<65536&&(a.head.name+=String.fromCharCode(y))}while(y&&c>9&1,a.head.done=!0),t.adler=a.check=0,a.mode=xe;break;case 10:for(;d<32;){if(0===l)break t;l--,h+=i[s++]<>>=7&d,d-=7&d,a.mode=27;break}for(;d<3;){if(0===l)break t;l--,h+=i[s++]<>>=1,d-=1,3&h){case 0:a.mode=14;break;case 1:if(Ie(a),a.mode=20,e===ue){h>>>=2,d-=2;break t}break;case 2:a.mode=17;break;case 3:t.msg="invalid block type",a.mode=ze}h>>>=2,d-=2;break;case 14:for(h>>>=7&d,d-=7&d;d<32;){if(0===l)break t;l--,h+=i[s++]<>>16^65535)){t.msg="invalid stored block lengths",a.mode=ze;break}if(a.length=65535&h,h=0,d=0,a.mode=15,e===ue)break t;case 15:a.mode=16;case 16:if(c=a.length,c){if(c>l&&(c=l),c>o&&(c=o),0===c)break t;n.set(i.subarray(s,s+c),r),l-=c,s+=c,o-=c,r+=c,a.length-=c;break}a.mode=xe;break;case 17:for(;d<14;){if(0===l)break t;l--,h+=i[s++]<>>=5,d-=5,a.ndist=1+(31&h),h>>>=5,d-=5,a.ncode=4+(15&h),h>>>=4,d-=4,a.nlen>286||a.ndist>30){t.msg="too many length or distance symbols",a.mode=ze;break}a.have=0,a.mode=18;case 18:for(;a.have>>=3,d-=3}for(;a.have<19;)a.lens[Z[a.have++]]=0;if(a.lencode=a.lendyn,a.lenbits=7,E={bits:a.lenbits},x=_e(0,a.lens,0,19,a.lencode,0,a.work,E),a.lenbits=E.bits,x){t.msg="invalid code lengths set",a.mode=ze;break}a.have=0,a.mode=19;case 19:for(;a.have>>24,g=z>>>16&255,p=65535&z,!(b<=d);){if(0===l)break t;l--,h+=i[s++]<>>=b,d-=b,a.lens[a.have++]=p;else{if(16===p){for(R=b+2;d>>=b,d-=b,0===a.have){t.msg="invalid bit length repeat",a.mode=ze;break}y=a.lens[a.have-1],c=3+(3&h),h>>>=2,d-=2}else if(17===p){for(R=b+3;d>>=b,d-=b,y=0,c=3+(7&h),h>>>=3,d-=3}else{for(R=b+7;d>>=b,d-=b,y=0,c=11+(127&h),h>>>=7,d-=7}if(a.have+c>a.nlen+a.ndist){t.msg="invalid bit length repeat",a.mode=ze;break}for(;c--;)a.lens[a.have++]=y}}if(a.mode===ze)break;if(0===a.lens[256]){t.msg="invalid code -- missing end-of-block",a.mode=ze;break}if(a.lenbits=9,E={bits:a.lenbits},x=_e(1,a.lens,0,a.nlen,a.lencode,0,a.work,E),a.lenbits=E.bits,x){t.msg="invalid literal/lengths set",a.mode=ze;break}if(a.distbits=6,a.distcode=a.distdyn,E={bits:a.distbits},x=_e(2,a.lens,a.nlen,a.ndist,a.distcode,0,a.work,E),a.distbits=E.bits,x){t.msg="invalid distances set",a.mode=ze;break}if(a.mode=20,e===ue)break t;case 20:a.mode=21;case 21:if(l>=6&&o>=258){t.next_out=r,t.avail_out=o,t.next_in=s,t.avail_in=l,a.hold=h,a.bits=d,se(t,f),r=t.next_out,n=t.output,o=t.avail_out,s=t.next_in,i=t.input,l=t.avail_in,h=a.hold,d=a.bits,a.mode===xe&&(a.back=-1);break}for(a.back=0;z=a.lencode[h&(1<>>24,g=z>>>16&255,p=65535&z,!(b<=d);){if(0===l)break t;l--,h+=i[s++]<>m)],b=z>>>24,g=z>>>16&255,p=65535&z,!(m+b<=d);){if(0===l)break t;l--,h+=i[s++]<>>=m,d-=m,a.back+=m}if(h>>>=b,d-=b,a.back+=b,a.length=p,0===g){a.mode=26;break}if(32&g){a.back=-1,a.mode=xe;break}if(64&g){t.msg="invalid literal/length code",a.mode=ze;break}a.extra=15&g,a.mode=22;case 22:if(a.extra){for(R=a.extra;d>>=a.extra,d-=a.extra,a.back+=a.extra}a.was=a.length,a.mode=23;case 23:for(;z=a.distcode[h&(1<>>24,g=z>>>16&255,p=65535&z,!(b<=d);){if(0===l)break t;l--,h+=i[s++]<>m)],b=z>>>24,g=z>>>16&255,p=65535&z,!(m+b<=d);){if(0===l)break t;l--,h+=i[s++]<>>=m,d-=m,a.back+=m}if(h>>>=b,d-=b,a.back+=b,64&g){t.msg="invalid distance code",a.mode=ze;break}a.offset=p,a.extra=15&g,a.mode=24;case 24:if(a.extra){for(R=a.extra;d>>=a.extra,d-=a.extra,a.back+=a.extra}if(a.offset>a.dmax){t.msg="invalid distance too far back",a.mode=ze;break}a.mode=25;case 25:if(0===o)break t;if(c=f-o,a.offset>c){if(c=a.offset-c,c>a.whave&&a.sane){t.msg="invalid distance too far back",a.mode=ze;break}c>a.wnext?(c-=a.wnext,u=a.wsize-c):u=a.wnext-c,c>a.length&&(c=a.length),w=a.window}else w=n,u=r-a.offset,c=a.length;c>o&&(c=o),o-=c,a.length-=c;do{n[r++]=w[u++]}while(--c);0===a.length&&(a.mode=21);break;case 26:if(0===o)break t;n[r++]=a.length,o--,a.mode=21;break;case 27:if(a.wrap){for(;d<32;){if(0===l)break t;l--,h|=i[s++]<{if(!t||!t.state)return pe;let e=t.state;return e.window&&(e.window=null),t.state=null,we},inflateGetHeader:(t,e)=>{if(!t||!t.state)return pe;const a=t.state;return 0==(2&a.wrap)?pe:(a.head=e,e.done=!1,we)},inflateSetDictionary:(t,e)=>{const a=e.length;let i,n,s;return t&&t.state?(i=t.state,0!==i.wrap&&11!==i.mode?pe:11===i.mode&&(n=1,n=B(n,e,a,0),n!==i.check)?me:(s=Fe(t,e,a,a),s?(i.mode=31,ke):(i.havedict=1,we))):pe},inflateInfo:"pako inflate (from Nodeca project)"};var Ne=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1};const Be=Object.prototype.toString,{Z_NO_FLUSH:Ce,Z_FINISH:Me,Z_OK:He,Z_STREAM_END:je,Z_NEED_DICT:Ke,Z_STREAM_ERROR:Pe,Z_DATA_ERROR:Ye,Z_MEM_ERROR:Ge}=j;function Xe(t){this.options=Bt({chunkSize:65536,windowBits:15,to:""},t||{});const e=this.options;e.raw&&e.windowBits>=0&&e.windowBits<16&&(e.windowBits=-e.windowBits,0===e.windowBits&&(e.windowBits=-15)),!(e.windowBits>=0&&e.windowBits<16)||t&&t.windowBits||(e.windowBits+=32),e.windowBits>15&&e.windowBits<48&&0==(15&e.windowBits)&&(e.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Yt,this.strm.avail_out=0;let a=Le.inflateInit2(this.strm,e.windowBits);if(a!==He)throw new Error(H[a]);if(this.header=new Ne,Le.inflateGetHeader(this.strm,this.header),e.dictionary&&("string"==typeof e.dictionary?e.dictionary=jt(e.dictionary):"[object ArrayBuffer]"===Be.call(e.dictionary)&&(e.dictionary=new Uint8Array(e.dictionary)),e.raw&&(a=Le.inflateSetDictionary(this.strm,e.dictionary),a!==He)))throw new Error(H[a])}function We(t,e){const a=new Xe(e);if(a.push(t),a.err)throw a.msg||H[a.err];return a.result}Xe.prototype.push=function(t,e){const a=this.strm,i=this.options.chunkSize,n=this.options.dictionary;let s,r,l;if(this.ended)return!1;for(r=e===~~e?e:!0===e?Me:Ce,"[object ArrayBuffer]"===Be.call(t)?a.input=new Uint8Array(t):a.input=t,a.next_in=0,a.avail_in=a.input.length;;){for(0===a.avail_out&&(a.output=new Uint8Array(i),a.next_out=0,a.avail_out=i),s=Le.inflate(a,r),s===Ke&&n&&(s=Le.inflateSetDictionary(a,n),s===He?s=Le.inflate(a,r):s===Ye&&(s=Ke));a.avail_in>0&&s===je&&a.state.wrap>0&&0!==t[a.next_in];)Le.inflateReset(a),s=Le.inflate(a,r);switch(s){case Pe:case Ye:case Ke:case Ge:return this.onEnd(s),this.ended=!0,!1}if(l=a.avail_out,a.next_out&&(0===a.avail_out||s===je))if("string"===this.options.to){let t=Pt(a.output,a.next_out),e=a.next_out-t,n=Kt(a.output,t);a.next_out=e,a.avail_out=i-e,e&&a.output.set(a.output.subarray(t,t+e),0),this.onData(n)}else this.onData(a.output.length===a.next_out?a.output:a.output.subarray(0,a.next_out));if(s!==He||0!==l){if(s===je)return s=Le.inflateEnd(this.strm),this.onEnd(s),this.ended=!0,!0;if(0===a.avail_in)break}}return!0},Xe.prototype.onData=function(t){this.chunks.push(t)},Xe.prototype.onEnd=function(t){t===He&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=Ct(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};var qe={Inflate:Xe,inflate:We,inflateRaw:function(t,e){return(e=e||{}).raw=!0,We(t,e)},ungzip:We,constants:j};const{Deflate:Je,deflate:Qe,deflateRaw:Ve,gzip:$e}=ne,{Inflate:ta,inflate:ea,inflateRaw:aa,ungzip:ia}=qe;var na=Je,sa=Qe,ra=Ve,la=$e,oa=ta,ha=ea,da=aa,_a=ia,fa=j,ca={Deflate:na,deflate:sa,deflateRaw:ra,gzip:la,Inflate:oa,inflate:ha,inflateRaw:da,ungzip:_a,constants:fa};t.Deflate=na,t.Inflate=oa,t.constants=fa,t.default=ca,t.deflate=sa,t.deflateRaw=ra,t.gzip=la,t.inflate=ha,t.inflateRaw=da,t.ungzip=_a,Object.defineProperty(t,"__esModule",{value:!0})})); diff --git a/js/qrcode.js b/js/qrcode.js new file mode 100644 index 0000000..1980d68 --- /dev/null +++ b/js/qrcode.js @@ -0,0 +1,614 @@ +/** + * @fileoverview + * - Using the 'QRCode for Javascript library' + * - Fixed dataset of 'QRCode for Javascript library' for support full-spec. + * - this library has no dependencies. + * + * @author davidshimjs + * @see http://www.d-project.com/ + * @see http://jeromeetienne.github.com/jquery-qrcode/ + */ +var QRCode; + +(function () { + //--------------------------------------------------------------------- + // QRCode for JavaScript + // + // Copyright (c) 2009 Kazuhiko Arase + // + // URL: http://www.d-project.com/ + // + // Licensed under the MIT license: + // http://www.opensource.org/licenses/mit-license.php + // + // The word "QR Code" is registered trademark of + // DENSO WAVE INCORPORATED + // http://www.denso-wave.com/qrcode/faqpatent-e.html + // + //--------------------------------------------------------------------- + function QR8bitByte(data) { + this.mode = QRMode.MODE_8BIT_BYTE; + this.data = data; + this.parsedData = []; + + // Added to support UTF-8 Characters + for (var i = 0, l = this.data.length; i < l; i++) { + var byteArray = []; + var code = this.data.charCodeAt(i); + + if (code > 0x10000) { + byteArray[0] = 0xF0 | ((code & 0x1C0000) >>> 18); + byteArray[1] = 0x80 | ((code & 0x3F000) >>> 12); + byteArray[2] = 0x80 | ((code & 0xFC0) >>> 6); + byteArray[3] = 0x80 | (code & 0x3F); + } else if (code > 0x800) { + byteArray[0] = 0xE0 | ((code & 0xF000) >>> 12); + byteArray[1] = 0x80 | ((code & 0xFC0) >>> 6); + byteArray[2] = 0x80 | (code & 0x3F); + } else if (code > 0x80) { + byteArray[0] = 0xC0 | ((code & 0x7C0) >>> 6); + byteArray[1] = 0x80 | (code & 0x3F); + } else { + byteArray[0] = code; + } + + this.parsedData.push(byteArray); + } + + this.parsedData = Array.prototype.concat.apply([], this.parsedData); + + if (this.parsedData.length != this.data.length) { + this.parsedData.unshift(191); + this.parsedData.unshift(187); + this.parsedData.unshift(239); + } + } + + QR8bitByte.prototype = { + getLength: function (buffer) { + return this.parsedData.length; + }, + write: function (buffer) { + for (var i = 0, l = this.parsedData.length; i < l; i++) { + buffer.put(this.parsedData[i], 8); + } + } + }; + + function QRCodeModel(typeNumber, errorCorrectLevel) { + this.typeNumber = typeNumber; + this.errorCorrectLevel = errorCorrectLevel; + this.modules = null; + this.moduleCount = 0; + this.dataCache = null; + this.dataList = []; + } + + QRCodeModel.prototype={addData:function(data){var newData=new QR8bitByte(data);this.dataList.push(newData);this.dataCache=null;},isDark:function(row,col){if(row<0||this.moduleCount<=row||col<0||this.moduleCount<=col){throw new Error(row+","+col);} + return this.modules[row][col];},getModuleCount:function(){return this.moduleCount;},make:function(){this.makeImpl(false,this.getBestMaskPattern());},makeImpl:function(test,maskPattern){this.moduleCount=this.typeNumber*4+17;this.modules=new Array(this.moduleCount);for(var row=0;row=7){this.setupTypeNumber(test);} + if(this.dataCache==null){this.dataCache=QRCodeModel.createData(this.typeNumber,this.errorCorrectLevel,this.dataList);} + this.mapData(this.dataCache,maskPattern);},setupPositionProbePattern:function(row,col){for(var r=-1;r<=7;r++){if(row+r<=-1||this.moduleCount<=row+r)continue;for(var c=-1;c<=7;c++){if(col+c<=-1||this.moduleCount<=col+c)continue;if((0<=r&&r<=6&&(c==0||c==6))||(0<=c&&c<=6&&(r==0||r==6))||(2<=r&&r<=4&&2<=c&&c<=4)){this.modules[row+r][col+c]=true;}else{this.modules[row+r][col+c]=false;}}}},getBestMaskPattern:function(){var minLostPoint=0;var pattern=0;for(var i=0;i<8;i++){this.makeImpl(true,i);var lostPoint=QRUtil.getLostPoint(this);if(i==0||minLostPoint>lostPoint){minLostPoint=lostPoint;pattern=i;}} + return pattern;},createMovieClip:function(target_mc,instance_name,depth){var qr_mc=target_mc.createEmptyMovieClip(instance_name,depth);var cs=1;this.make();for(var row=0;row>i)&1)==1);this.modules[Math.floor(i/3)][i%3+this.moduleCount-8-3]=mod;} + for(var i=0;i<18;i++){var mod=(!test&&((bits>>i)&1)==1);this.modules[i%3+this.moduleCount-8-3][Math.floor(i/3)]=mod;}},setupTypeInfo:function(test,maskPattern){var data=(this.errorCorrectLevel<<3)|maskPattern;var bits=QRUtil.getBCHTypeInfo(data);for(var i=0;i<15;i++){var mod=(!test&&((bits>>i)&1)==1);if(i<6){this.modules[i][8]=mod;}else if(i<8){this.modules[i+1][8]=mod;}else{this.modules[this.moduleCount-15+i][8]=mod;}} + for(var i=0;i<15;i++){var mod=(!test&&((bits>>i)&1)==1);if(i<8){this.modules[8][this.moduleCount-i-1]=mod;}else if(i<9){this.modules[8][15-i-1+1]=mod;}else{this.modules[8][15-i-1]=mod;}} + this.modules[this.moduleCount-8][8]=(!test);},mapData:function(data,maskPattern){var inc=-1;var row=this.moduleCount-1;var bitIndex=7;var byteIndex=0;for(var col=this.moduleCount-1;col>0;col-=2){if(col==6)col--;while(true){for(var c=0;c<2;c++){if(this.modules[row][col-c]==null){var dark=false;if(byteIndex>>bitIndex)&1)==1);} + var mask=QRUtil.getMask(maskPattern,row,col-c);if(mask){dark=!dark;} + this.modules[row][col-c]=dark;bitIndex--;if(bitIndex==-1){byteIndex++;bitIndex=7;}}} + row+=inc;if(row<0||this.moduleCount<=row){row-=inc;inc=-inc;break;}}}}};QRCodeModel.PAD0=0xEC;QRCodeModel.PAD1=0x11;QRCodeModel.createData=function(typeNumber,errorCorrectLevel,dataList){var rsBlocks=QRRSBlock.getRSBlocks(typeNumber,errorCorrectLevel);var buffer=new QRBitBuffer();for(var i=0;itotalDataCount*8){throw new Error("code length overflow. (" + +buffer.getLengthInBits() + +">" + +totalDataCount*8 + +")");} + if(buffer.getLengthInBits()+4<=totalDataCount*8){buffer.put(0,4);} + while(buffer.getLengthInBits()%8!=0){buffer.putBit(false);} + while(true){if(buffer.getLengthInBits()>=totalDataCount*8){break;} + buffer.put(QRCodeModel.PAD0,8);if(buffer.getLengthInBits()>=totalDataCount*8){break;} + buffer.put(QRCodeModel.PAD1,8);} + return QRCodeModel.createBytes(buffer,rsBlocks);};QRCodeModel.createBytes=function(buffer,rsBlocks){var offset=0;var maxDcCount=0;var maxEcCount=0;var dcdata=new Array(rsBlocks.length);var ecdata=new Array(rsBlocks.length);for(var r=0;r=0)?modPoly.get(modIndex):0;}} + var totalCodeCount=0;for(var i=0;i=0){d^=(QRUtil.G15<<(QRUtil.getBCHDigit(d)-QRUtil.getBCHDigit(QRUtil.G15)));} + return((data<<10)|d)^QRUtil.G15_MASK;},getBCHTypeNumber:function(data){var d=data<<12;while(QRUtil.getBCHDigit(d)-QRUtil.getBCHDigit(QRUtil.G18)>=0){d^=(QRUtil.G18<<(QRUtil.getBCHDigit(d)-QRUtil.getBCHDigit(QRUtil.G18)));} + return(data<<12)|d;},getBCHDigit:function(data){var digit=0;while(data!=0){digit++;data>>>=1;} + return digit;},getPatternPosition:function(typeNumber){return QRUtil.PATTERN_POSITION_TABLE[typeNumber-1];},getMask:function(maskPattern,i,j){switch(maskPattern){case QRMaskPattern.PATTERN000:return(i+j)%2==0;case QRMaskPattern.PATTERN001:return i%2==0;case QRMaskPattern.PATTERN010:return j%3==0;case QRMaskPattern.PATTERN011:return(i+j)%3==0;case QRMaskPattern.PATTERN100:return(Math.floor(i/2)+Math.floor(j/3))%2==0;case QRMaskPattern.PATTERN101:return(i*j)%2+(i*j)%3==0;case QRMaskPattern.PATTERN110:return((i*j)%2+(i*j)%3)%2==0;case QRMaskPattern.PATTERN111:return((i*j)%3+(i+j)%2)%2==0;default:throw new Error("bad maskPattern:"+maskPattern);}},getErrorCorrectPolynomial:function(errorCorrectLength){var a=new QRPolynomial([1],0);for(var i=0;i5){lostPoint+=(3+sameCount-5);}}} + for(var row=0;row=256){n-=255;} + return QRMath.EXP_TABLE[n];},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)};for(var i=0;i<8;i++){QRMath.EXP_TABLE[i]=1<>>(7-index%8))&1)==1;},put:function(num,length){for(var i=0;i>>(length-i-1))&1)==1);}},getLengthInBits:function(){return this.length;},putBit:function(bit){var bufIndex=Math.floor(this.length/8);if(this.buffer.length<=bufIndex){this.buffer.push(0);} + if(bit){this.buffer[bufIndex]|=(0x80>>>(this.length%8));} + this.length++;}};var QRCodeLimitLength=[[17,14,11,7],[32,26,20,14],[53,42,32,24],[78,62,46,34],[106,84,60,44],[134,106,74,58],[154,122,86,64],[192,152,108,84],[230,180,130,98],[271,213,151,119],[321,251,177,137],[367,287,203,155],[425,331,241,177],[458,362,258,194],[520,412,292,220],[586,450,322,250],[644,504,364,280],[718,560,394,310],[792,624,442,338],[858,666,482,382],[929,711,509,403],[1003,779,565,439],[1091,857,611,461],[1171,911,661,511],[1273,997,715,535],[1367,1059,751,593],[1465,1125,805,625],[1528,1190,868,658],[1628,1264,908,698],[1732,1370,982,742],[1840,1452,1030,790],[1952,1538,1112,842],[2068,1628,1168,898],[2188,1722,1228,958],[2303,1809,1283,983],[2431,1911,1351,1051],[2563,1989,1423,1093],[2699,2099,1499,1139],[2809,2213,1579,1219],[2953,2331,1663,1273]]; + + function _isSupportCanvas() { + return typeof CanvasRenderingContext2D != "undefined"; + } + + // android 2.x doesn't support Data-URI spec + function _getAndroid() { + var android = false; + var sAgent = navigator.userAgent; + + if (/android/i.test(sAgent)) { // android + android = true; + var aMat = sAgent.toString().match(/android ([0-9]\.[0-9])/i); + + if (aMat && aMat[1]) { + android = parseFloat(aMat[1]); + } + } + + return android; + } + + var svgDrawer = (function() { + + var Drawing = function (el, htOption) { + this._el = el; + this._htOption = htOption; + }; + + Drawing.prototype.draw = function (oQRCode) { + var _htOption = this._htOption; + var _el = this._el; + var nCount = oQRCode.getModuleCount(); + var nWidth = Math.floor(_htOption.width / nCount); + var nHeight = Math.floor(_htOption.height / nCount); + + this.clear(); + + function makeSVG(tag, attrs) { + var el = document.createElementNS('http://www.w3.org/2000/svg', tag); + for (var k in attrs) + if (attrs.hasOwnProperty(k)) el.setAttribute(k, attrs[k]); + return el; + } + + var svg = makeSVG("svg" , {'viewBox': '0 0 ' + String(nCount) + " " + String(nCount), 'width': '100%', 'height': '100%', 'fill': _htOption.colorLight}); + svg.setAttributeNS("http://www.w3.org/2000/xmlns/", "xmlns:xlink", "http://www.w3.org/1999/xlink"); + _el.appendChild(svg); + + svg.appendChild(makeSVG("rect", {"fill": _htOption.colorLight, "width": "100%", "height": "100%"})); + svg.appendChild(makeSVG("rect", {"fill": _htOption.colorDark, "width": "1", "height": "1", "id": "template"})); + + for (var row = 0; row < nCount; row++) { + for (var col = 0; col < nCount; col++) { + if (oQRCode.isDark(row, col)) { + var child = makeSVG("use", {"x": String(row), "y": String(col)}); + child.setAttributeNS("http://www.w3.org/1999/xlink", "href", "#template") + svg.appendChild(child); + } + } + } + }; + Drawing.prototype.clear = function () { + while (this._el.hasChildNodes()) + this._el.removeChild(this._el.lastChild); + }; + return Drawing; + })(); + + var useSVG = document.documentElement.tagName.toLowerCase() === "svg"; + + // Drawing in DOM by using Table tag + var Drawing = useSVG ? svgDrawer : !_isSupportCanvas() ? (function () { + var Drawing = function (el, htOption) { + this._el = el; + this._htOption = htOption; + }; + + /** + * Draw the QRCode + * + * @param {QRCode} oQRCode + */ + Drawing.prototype.draw = function (oQRCode) { + var _htOption = this._htOption; + var _el = this._el; + var nCount = oQRCode.getModuleCount(); + var nWidth = Math.floor(_htOption.width / nCount); + var nHeight = Math.floor(_htOption.height / nCount); + var aHTML = ['']; + + for (var row = 0; row < nCount; row++) { + aHTML.push(''); + + for (var col = 0; col < nCount; col++) { + aHTML.push(''); + } + + aHTML.push(''); + } + + aHTML.push('
'); + _el.innerHTML = aHTML.join(''); + + // Fix the margin values as real size. + var elTable = _el.childNodes[0]; + var nLeftMarginTable = (_htOption.width - elTable.offsetWidth) / 2; + var nTopMarginTable = (_htOption.height - elTable.offsetHeight) / 2; + + if (nLeftMarginTable > 0 && nTopMarginTable > 0) { + elTable.style.margin = nTopMarginTable + "px " + nLeftMarginTable + "px"; + } + }; + + /** + * Clear the QRCode + */ + Drawing.prototype.clear = function () { + this._el.innerHTML = ''; + }; + + return Drawing; + })() : (function () { // Drawing in Canvas + function _onMakeImage() { + this._elImage.src = this._elCanvas.toDataURL("image/png"); + this._elImage.style.display = "block"; + this._elCanvas.style.display = "none"; + } + + // Android 2.1 bug workaround + // http://code.google.com/p/android/issues/detail?id=5141 + if (this._android && this._android <= 2.1) { + var factor = 1 / window.devicePixelRatio; + var drawImage = CanvasRenderingContext2D.prototype.drawImage; + CanvasRenderingContext2D.prototype.drawImage = function (image, sx, sy, sw, sh, dx, dy, dw, dh) { + if (("nodeName" in image) && /img/i.test(image.nodeName)) { + for (var i = arguments.length - 1; i >= 1; i--) { + arguments[i] = arguments[i] * factor; + } + } else if (typeof dw == "undefined") { + arguments[1] *= factor; + arguments[2] *= factor; + arguments[3] *= factor; + arguments[4] *= factor; + } + + drawImage.apply(this, arguments); + }; + } + + /** + * Check whether the user's browser supports Data URI or not + * + * @private + * @param {Function} fSuccess Occurs if it supports Data URI + * @param {Function} fFail Occurs if it doesn't support Data URI + */ + function _safeSetDataURI(fSuccess, fFail) { + var self = this; + self._fFail = fFail; + self._fSuccess = fSuccess; + + // Check it just once + if (self._bSupportDataURI === null) { + var el = document.createElement("img"); + var fOnError = function() { + self._bSupportDataURI = false; + + if (self._fFail) { + self._fFail.call(self); + } + }; + var fOnSuccess = function() { + self._bSupportDataURI = true; + + if (self._fSuccess) { + self._fSuccess.call(self); + } + }; + + el.onabort = fOnError; + el.onerror = fOnError; + el.onload = fOnSuccess; + el.src = "data:image/gif;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg=="; // the Image contains 1px data. + return; + } else if (self._bSupportDataURI === true && self._fSuccess) { + self._fSuccess.call(self); + } else if (self._bSupportDataURI === false && self._fFail) { + self._fFail.call(self); + } + }; + + /** + * Drawing QRCode by using canvas + * + * @constructor + * @param {HTMLElement} el + * @param {Object} htOption QRCode Options + */ + var Drawing = function (el, htOption) { + this._bIsPainted = false; + this._android = _getAndroid(); + + this._htOption = htOption; + this._elCanvas = document.createElement("canvas"); + this._elCanvas.width = htOption.width; + this._elCanvas.height = htOption.height; + el.appendChild(this._elCanvas); + this._el = el; + this._oContext = this._elCanvas.getContext("2d"); + this._bIsPainted = false; + this._elImage = document.createElement("img"); + this._elImage.alt = "Scan me!"; + this._elImage.style.display = "none"; + this._el.appendChild(this._elImage); + this._bSupportDataURI = null; + }; + + /** + * Draw the QRCode + * + * @param {QRCode} oQRCode + */ + Drawing.prototype.draw = function (oQRCode) { + var _elImage = this._elImage; + var _oContext = this._oContext; + var _htOption = this._htOption; + + var nCount = oQRCode.getModuleCount(); + var nWidth = _htOption.width / nCount; + var nHeight = _htOption.height / nCount; + var nRoundedWidth = Math.round(nWidth); + var nRoundedHeight = Math.round(nHeight); + + _elImage.style.display = "none"; + this.clear(); + + for (var row = 0; row < nCount; row++) { + for (var col = 0; col < nCount; col++) { + var bIsDark = oQRCode.isDark(row, col); + var nLeft = col * nWidth; + var nTop = row * nHeight; + _oContext.strokeStyle = bIsDark ? _htOption.colorDark : _htOption.colorLight; + _oContext.lineWidth = 1; + _oContext.fillStyle = bIsDark ? _htOption.colorDark : _htOption.colorLight; + _oContext.fillRect(nLeft, nTop, nWidth, nHeight); + + // 안티 앨리어싱 방지 처리 + _oContext.strokeRect( + Math.floor(nLeft) + 0.5, + Math.floor(nTop) + 0.5, + nRoundedWidth, + nRoundedHeight + ); + + _oContext.strokeRect( + Math.ceil(nLeft) - 0.5, + Math.ceil(nTop) - 0.5, + nRoundedWidth, + nRoundedHeight + ); + } + } + + this._bIsPainted = true; + }; + + /** + * Make the image from Canvas if the browser supports Data URI. + */ + Drawing.prototype.makeImage = function () { + if (this._bIsPainted) { + _safeSetDataURI.call(this, _onMakeImage); + } + }; + + /** + * Return whether the QRCode is painted or not + * + * @return {Boolean} + */ + Drawing.prototype.isPainted = function () { + return this._bIsPainted; + }; + + /** + * Clear the QRCode + */ + Drawing.prototype.clear = function () { + this._oContext.clearRect(0, 0, this._elCanvas.width, this._elCanvas.height); + this._bIsPainted = false; + }; + + /** + * @private + * @param {Number} nNumber + */ + Drawing.prototype.round = function (nNumber) { + if (!nNumber) { + return nNumber; + } + + return Math.floor(nNumber * 1000) / 1000; + }; + + return Drawing; + })(); + + /** + * Get the type by string length + * + * @private + * @param {String} sText + * @param {Number} nCorrectLevel + * @return {Number} type + */ + function _getTypeNumber(sText, nCorrectLevel) { + var nType = 1; + var length = _getUTF8Length(sText); + + for (var i = 0, len = QRCodeLimitLength.length; i <= len; i++) { + var nLimit = 0; + + switch (nCorrectLevel) { + case QRErrorCorrectLevel.L : + nLimit = QRCodeLimitLength[i][0]; + break; + case QRErrorCorrectLevel.M : + nLimit = QRCodeLimitLength[i][1]; + break; + case QRErrorCorrectLevel.Q : + nLimit = QRCodeLimitLength[i][2]; + break; + case QRErrorCorrectLevel.H : + nLimit = QRCodeLimitLength[i][3]; + break; + } + + if (length <= nLimit) { + break; + } else { + nType++; + } + } + + if (nType > QRCodeLimitLength.length) { + throw new Error("Too long data"); + } + + return nType; + } + + function _getUTF8Length(sText) { + var replacedText = encodeURI(sText).toString().replace(/\%[0-9a-fA-F]{2}/g, 'a'); + return replacedText.length + (replacedText.length != sText ? 3 : 0); + } + + /** + * @class QRCode + * @constructor + * @example + * new QRCode(document.getElementById("test"), "http://jindo.dev.naver.com/collie"); + * + * @example + * var oQRCode = new QRCode("test", { + * text : "http://naver.com", + * width : 128, + * height : 128 + * }); + * + * oQRCode.clear(); // Clear the QRCode. + * oQRCode.makeCode("http://map.naver.com"); // Re-create the QRCode. + * + * @param {HTMLElement|String} el target element or 'id' attribute of element. + * @param {Object|String} vOption + * @param {String} vOption.text QRCode link data + * @param {Number} [vOption.width=256] + * @param {Number} [vOption.height=256] + * @param {String} [vOption.colorDark="#000000"] + * @param {String} [vOption.colorLight="#ffffff"] + * @param {QRCode.CorrectLevel} [vOption.correctLevel=QRCode.CorrectLevel.H] [L|M|Q|H] + */ + QRCode = function (el, vOption) { + this._htOption = { + width : 256, + height : 256, + typeNumber : 4, + colorDark : "#000000", + colorLight : "#ffffff", + correctLevel : QRErrorCorrectLevel.H + }; + + if (typeof vOption === 'string') { + vOption = { + text : vOption + }; + } + + // Overwrites options + if (vOption) { + for (var i in vOption) { + this._htOption[i] = vOption[i]; + } + } + + if (typeof el == "string") { + el = document.getElementById(el); + } + + if (this._htOption.useSVG) { + Drawing = svgDrawer; + } + + this._android = _getAndroid(); + this._el = el; + this._oQRCode = null; + this._oDrawing = new Drawing(this._el, this._htOption); + + if (this._htOption.text) { + this.makeCode(this._htOption.text); + } + }; + + /** + * Make the QRCode + * + * @param {String} sText link data + */ + QRCode.prototype.makeCode = function (sText) { + this._oQRCode = new QRCodeModel(_getTypeNumber(sText, this._htOption.correctLevel), this._htOption.correctLevel); + this._oQRCode.addData(sText); + this._oQRCode.make(); + this._el.title = sText; + this._oDrawing.draw(this._oQRCode); + this.makeImage(); + }; + + /** + * Make the Image from Canvas element + * - It occurs automatically + * - Android below 3 doesn't support Data-URI spec. + * + * @private + */ + QRCode.prototype.makeImage = function () { + if (typeof this._oDrawing.makeImage == "function" && (!this._android || this._android >= 3)) { + this._oDrawing.makeImage(); + } + }; + + /** + * Clear the QRCode + */ + QRCode.prototype.clear = function () { + this._oDrawing.clear(); + }; + + /** + * @name QRCode.CorrectLevel + */ + QRCode.CorrectLevel = QRErrorCorrectLevel; +})(); diff --git a/js/qrcode.min.js b/js/qrcode.min.js new file mode 100644 index 0000000..993e88f --- /dev/null +++ b/js/qrcode.min.js @@ -0,0 +1 @@ +var QRCode;!function(){function a(a){this.mode=c.MODE_8BIT_BYTE,this.data=a,this.parsedData=[];for(var b=[],d=0,e=this.data.length;e>d;d++){var f=this.data.charCodeAt(d);f>65536?(b[0]=240|(1835008&f)>>>18,b[1]=128|(258048&f)>>>12,b[2]=128|(4032&f)>>>6,b[3]=128|63&f):f>2048?(b[0]=224|(61440&f)>>>12,b[1]=128|(4032&f)>>>6,b[2]=128|63&f):f>128?(b[0]=192|(1984&f)>>>6,b[1]=128|63&f):b[0]=f,this.parsedData=this.parsedData.concat(b)}this.parsedData.length!=this.data.length&&(this.parsedData.unshift(191),this.parsedData.unshift(187),this.parsedData.unshift(239))}function b(a,b){this.typeNumber=a,this.errorCorrectLevel=b,this.modules=null,this.moduleCount=0,this.dataCache=null,this.dataList=[]}function i(a,b){if(void 0==a.length)throw new Error(a.length+"/"+b);for(var c=0;c=f;f++){var h=0;switch(b){case d.L:h=l[f][0];break;case d.M:h=l[f][1];break;case d.Q:h=l[f][2];break;case d.H:h=l[f][3]}if(h>=e)break;c++}if(c>l.length)throw new Error("Too long data");return c}function s(a){var b=encodeURI(a).toString().replace(/\%[0-9a-fA-F]{2}/g,"a");return b.length+(b.length!=a?3:0)}a.prototype={getLength:function(){return this.parsedData.length},write:function(a){for(var b=0,c=this.parsedData.length;c>b;b++)a.put(this.parsedData[b],8)}},b.prototype={addData:function(b){var c=new a(b);this.dataList.push(c),this.dataCache=null},isDark:function(a,b){if(0>a||this.moduleCount<=a||0>b||this.moduleCount<=b)throw new Error(a+","+b);return this.modules[a][b]},getModuleCount:function(){return this.moduleCount},make:function(){this.makeImpl(!1,this.getBestMaskPattern())},makeImpl:function(a,c){this.moduleCount=4*this.typeNumber+17,this.modules=new Array(this.moduleCount);for(var d=0;d=7&&this.setupTypeNumber(a),null==this.dataCache&&(this.dataCache=b.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,c)},setupPositionProbePattern:function(a,b){for(var c=-1;7>=c;c++)if(!(-1>=a+c||this.moduleCount<=a+c))for(var d=-1;7>=d;d++)-1>=b+d||this.moduleCount<=b+d||(this.modules[a+c][b+d]=c>=0&&6>=c&&(0==d||6==d)||d>=0&&6>=d&&(0==c||6==c)||c>=2&&4>=c&&d>=2&&4>=d?!0:!1)},getBestMaskPattern:function(){for(var a=0,b=0,c=0;8>c;c++){this.makeImpl(!0,c);var d=f.getLostPoint(this);(0==c||a>d)&&(a=d,b=c)}return b},createMovieClip:function(a,b,c){var d=a.createEmptyMovieClip(b,c),e=1;this.make();for(var f=0;f=g;g++)for(var h=-2;2>=h;h++)this.modules[d+g][e+h]=-2==g||2==g||-2==h||2==h||0==g&&0==h?!0:!1}},setupTypeNumber:function(a){for(var b=f.getBCHTypeNumber(this.typeNumber),c=0;18>c;c++){var d=!a&&1==(1&b>>c);this.modules[Math.floor(c/3)][c%3+this.moduleCount-8-3]=d}for(var c=0;18>c;c++){var d=!a&&1==(1&b>>c);this.modules[c%3+this.moduleCount-8-3][Math.floor(c/3)]=d}},setupTypeInfo:function(a,b){for(var c=this.errorCorrectLevel<<3|b,d=f.getBCHTypeInfo(c),e=0;15>e;e++){var g=!a&&1==(1&d>>e);6>e?this.modules[e][8]=g:8>e?this.modules[e+1][8]=g:this.modules[this.moduleCount-15+e][8]=g}for(var e=0;15>e;e++){var g=!a&&1==(1&d>>e);8>e?this.modules[8][this.moduleCount-e-1]=g:9>e?this.modules[8][15-e-1+1]=g:this.modules[8][15-e-1]=g}this.modules[this.moduleCount-8][8]=!a},mapData:function(a,b){for(var c=-1,d=this.moduleCount-1,e=7,g=0,h=this.moduleCount-1;h>0;h-=2)for(6==h&&h--;;){for(var i=0;2>i;i++)if(null==this.modules[d][h-i]){var j=!1;g>>e));var k=f.getMask(b,d,h-i);k&&(j=!j),this.modules[d][h-i]=j,e--,-1==e&&(g++,e=7)}if(d+=c,0>d||this.moduleCount<=d){d-=c,c=-c;break}}}},b.PAD0=236,b.PAD1=17,b.createData=function(a,c,d){for(var e=j.getRSBlocks(a,c),g=new k,h=0;h8*l)throw new Error("code length overflow. ("+g.getLengthInBits()+">"+8*l+")");for(g.getLengthInBits()+4<=8*l&&g.put(0,4);0!=g.getLengthInBits()%8;)g.putBit(!1);for(;;){if(g.getLengthInBits()>=8*l)break;if(g.put(b.PAD0,8),g.getLengthInBits()>=8*l)break;g.put(b.PAD1,8)}return b.createBytes(g,e)},b.createBytes=function(a,b){for(var c=0,d=0,e=0,g=new Array(b.length),h=new Array(b.length),j=0;j=0?p.get(q):0}}for(var r=0,m=0;mm;m++)for(var j=0;jm;m++)for(var j=0;j=0;)b^=f.G15<=0;)b^=f.G18<>>=1;return b},getPatternPosition:function(a){return f.PATTERN_POSITION_TABLE[a-1]},getMask:function(a,b,c){switch(a){case e.PATTERN000:return 0==(b+c)%2;case e.PATTERN001:return 0==b%2;case e.PATTERN010:return 0==c%3;case e.PATTERN011:return 0==(b+c)%3;case e.PATTERN100:return 0==(Math.floor(b/2)+Math.floor(c/3))%2;case e.PATTERN101:return 0==b*c%2+b*c%3;case e.PATTERN110:return 0==(b*c%2+b*c%3)%2;case e.PATTERN111:return 0==(b*c%3+(b+c)%2)%2;default:throw new Error("bad maskPattern:"+a)}},getErrorCorrectPolynomial:function(a){for(var b=new i([1],0),c=0;a>c;c++)b=b.multiply(new i([1,g.gexp(c)],0));return b},getLengthInBits:function(a,b){if(b>=1&&10>b)switch(a){case c.MODE_NUMBER:return 10;case c.MODE_ALPHA_NUM:return 9;case c.MODE_8BIT_BYTE:return 8;case c.MODE_KANJI:return 8;default:throw new Error("mode:"+a)}else if(27>b)switch(a){case c.MODE_NUMBER:return 12;case c.MODE_ALPHA_NUM:return 11;case c.MODE_8BIT_BYTE:return 16;case c.MODE_KANJI:return 10;default:throw new Error("mode:"+a)}else{if(!(41>b))throw new Error("type:"+b);switch(a){case c.MODE_NUMBER:return 14;case c.MODE_ALPHA_NUM:return 13;case c.MODE_8BIT_BYTE:return 16;case c.MODE_KANJI:return 12;default:throw new Error("mode:"+a)}}},getLostPoint:function(a){for(var b=a.getModuleCount(),c=0,d=0;b>d;d++)for(var e=0;b>e;e++){for(var f=0,g=a.isDark(d,e),h=-1;1>=h;h++)if(!(0>d+h||d+h>=b))for(var i=-1;1>=i;i++)0>e+i||e+i>=b||(0!=h||0!=i)&&g==a.isDark(d+h,e+i)&&f++;f>5&&(c+=3+f-5)}for(var d=0;b-1>d;d++)for(var e=0;b-1>e;e++){var j=0;a.isDark(d,e)&&j++,a.isDark(d+1,e)&&j++,a.isDark(d,e+1)&&j++,a.isDark(d+1,e+1)&&j++,(0==j||4==j)&&(c+=3)}for(var d=0;b>d;d++)for(var e=0;b-6>e;e++)a.isDark(d,e)&&!a.isDark(d,e+1)&&a.isDark(d,e+2)&&a.isDark(d,e+3)&&a.isDark(d,e+4)&&!a.isDark(d,e+5)&&a.isDark(d,e+6)&&(c+=40);for(var e=0;b>e;e++)for(var d=0;b-6>d;d++)a.isDark(d,e)&&!a.isDark(d+1,e)&&a.isDark(d+2,e)&&a.isDark(d+3,e)&&a.isDark(d+4,e)&&!a.isDark(d+5,e)&&a.isDark(d+6,e)&&(c+=40);for(var k=0,e=0;b>e;e++)for(var d=0;b>d;d++)a.isDark(d,e)&&k++;var l=Math.abs(100*k/b/b-50)/5;return c+=10*l}},g={glog:function(a){if(1>a)throw new Error("glog("+a+")");return g.LOG_TABLE[a]},gexp:function(a){for(;0>a;)a+=255;for(;a>=256;)a-=255;return g.EXP_TABLE[a]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)},h=0;8>h;h++)g.EXP_TABLE[h]=1<h;h++)g.EXP_TABLE[h]=g.EXP_TABLE[h-4]^g.EXP_TABLE[h-5]^g.EXP_TABLE[h-6]^g.EXP_TABLE[h-8];for(var h=0;255>h;h++)g.LOG_TABLE[g.EXP_TABLE[h]]=h;i.prototype={get:function(a){return this.num[a]},getLength:function(){return this.num.length},multiply:function(a){for(var b=new Array(this.getLength()+a.getLength()-1),c=0;cf;f++)for(var g=c[3*f+0],h=c[3*f+1],i=c[3*f+2],k=0;g>k;k++)e.push(new j(h,i));return e},j.getRsBlockTable=function(a,b){switch(b){case d.L:return j.RS_BLOCK_TABLE[4*(a-1)+0];case d.M:return j.RS_BLOCK_TABLE[4*(a-1)+1];case d.Q:return j.RS_BLOCK_TABLE[4*(a-1)+2];case d.H:return j.RS_BLOCK_TABLE[4*(a-1)+3];default:return void 0}},k.prototype={get:function(a){var b=Math.floor(a/8);return 1==(1&this.buffer[b]>>>7-a%8)},put:function(a,b){for(var c=0;b>c;c++)this.putBit(1==(1&a>>>b-c-1))},getLengthInBits:function(){return this.length},putBit:function(a){var b=Math.floor(this.length/8);this.buffer.length<=b&&this.buffer.push(0),a&&(this.buffer[b]|=128>>>this.length%8),this.length++}};var l=[[17,14,11,7],[32,26,20,14],[53,42,32,24],[78,62,46,34],[106,84,60,44],[134,106,74,58],[154,122,86,64],[192,152,108,84],[230,180,130,98],[271,213,151,119],[321,251,177,137],[367,287,203,155],[425,331,241,177],[458,362,258,194],[520,412,292,220],[586,450,322,250],[644,504,364,280],[718,560,394,310],[792,624,442,338],[858,666,482,382],[929,711,509,403],[1003,779,565,439],[1091,857,611,461],[1171,911,661,511],[1273,997,715,535],[1367,1059,751,593],[1465,1125,805,625],[1528,1190,868,658],[1628,1264,908,698],[1732,1370,982,742],[1840,1452,1030,790],[1952,1538,1112,842],[2068,1628,1168,898],[2188,1722,1228,958],[2303,1809,1283,983],[2431,1911,1351,1051],[2563,1989,1423,1093],[2699,2099,1499,1139],[2809,2213,1579,1219],[2953,2331,1663,1273]],o=function(){var a=function(a,b){this._el=a,this._htOption=b};return a.prototype.draw=function(a){function g(a,b){var c=document.createElementNS("http://www.w3.org/2000/svg",a);for(var d in b)b.hasOwnProperty(d)&&c.setAttribute(d,b[d]);return c}var b=this._htOption,c=this._el,d=a.getModuleCount();Math.floor(b.width/d),Math.floor(b.height/d),this.clear();var h=g("svg",{viewBox:"0 0 "+String(d)+" "+String(d),width:"100%",height:"100%",fill:b.colorLight});h.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink","http://www.w3.org/1999/xlink"),c.appendChild(h),h.appendChild(g("rect",{fill:b.colorDark,width:"1",height:"1",id:"template"}));for(var i=0;d>i;i++)for(var j=0;d>j;j++)if(a.isDark(i,j)){var k=g("use",{x:String(i),y:String(j)});k.setAttributeNS("http://www.w3.org/1999/xlink","href","#template"),h.appendChild(k)}},a.prototype.clear=function(){for(;this._el.hasChildNodes();)this._el.removeChild(this._el.lastChild)},a}(),p="svg"===document.documentElement.tagName.toLowerCase(),q=p?o:m()?function(){function a(){this._elImage.src=this._elCanvas.toDataURL("image/png"),this._elImage.style.display="block",this._elCanvas.style.display="none"}function d(a,b){var c=this;if(c._fFail=b,c._fSuccess=a,null===c._bSupportDataURI){var d=document.createElement("img"),e=function(){c._bSupportDataURI=!1,c._fFail&&_fFail.call(c)},f=function(){c._bSupportDataURI=!0,c._fSuccess&&c._fSuccess.call(c)};return d.onabort=e,d.onerror=e,d.onload=f,d.src="data:image/gif;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg==",void 0}c._bSupportDataURI===!0&&c._fSuccess?c._fSuccess.call(c):c._bSupportDataURI===!1&&c._fFail&&c._fFail.call(c)}if(this._android&&this._android<=2.1){var b=1/window.devicePixelRatio,c=CanvasRenderingContext2D.prototype.drawImage;CanvasRenderingContext2D.prototype.drawImage=function(a,d,e,f,g,h,i,j){if("nodeName"in a&&/img/i.test(a.nodeName))for(var l=arguments.length-1;l>=1;l--)arguments[l]=arguments[l]*b;else"undefined"==typeof j&&(arguments[1]*=b,arguments[2]*=b,arguments[3]*=b,arguments[4]*=b);c.apply(this,arguments)}}var e=function(a,b){this._bIsPainted=!1,this._android=n(),this._htOption=b,this._elCanvas=document.createElement("canvas"),this._elCanvas.width=b.width,this._elCanvas.height=b.height,a.appendChild(this._elCanvas),this._el=a,this._oContext=this._elCanvas.getContext("2d"),this._bIsPainted=!1,this._elImage=document.createElement("img"),this._elImage.style.display="none",this._el.appendChild(this._elImage),this._bSupportDataURI=null};return e.prototype.draw=function(a){var b=this._elImage,c=this._oContext,d=this._htOption,e=a.getModuleCount(),f=d.width/e,g=d.height/e,h=Math.round(f),i=Math.round(g);b.style.display="none",this.clear();for(var j=0;e>j;j++)for(var k=0;e>k;k++){var l=a.isDark(j,k),m=k*f,n=j*g;c.strokeStyle=l?d.colorDark:d.colorLight,c.lineWidth=1,c.fillStyle=l?d.colorDark:d.colorLight,c.fillRect(m,n,f,g),c.strokeRect(Math.floor(m)+.5,Math.floor(n)+.5,h,i),c.strokeRect(Math.ceil(m)-.5,Math.ceil(n)-.5,h,i)}this._bIsPainted=!0},e.prototype.makeImage=function(){this._bIsPainted&&d.call(this,a)},e.prototype.isPainted=function(){return this._bIsPainted},e.prototype.clear=function(){this._oContext.clearRect(0,0,this._elCanvas.width,this._elCanvas.height),this._bIsPainted=!1},e.prototype.round=function(a){return a?Math.floor(1e3*a)/1e3:a},e}():function(){var a=function(a,b){this._el=a,this._htOption=b};return a.prototype.draw=function(a){for(var b=this._htOption,c=this._el,d=a.getModuleCount(),e=Math.floor(b.width/d),f=Math.floor(b.height/d),g=[''],h=0;d>h;h++){g.push("");for(var i=0;d>i;i++)g.push('');g.push("")}g.push("
"),c.innerHTML=g.join("");var j=c.childNodes[0],k=(b.width-j.offsetWidth)/2,l=(b.height-j.offsetHeight)/2;k>0&&l>0&&(j.style.margin=l+"px "+k+"px")},a.prototype.clear=function(){this._el.innerHTML=""},a}();QRCode=function(a,b){if(this._htOption={width:256,height:256,typeNumber:4,colorDark:"#000000",colorLight:"#ffffff",correctLevel:d.H},"string"==typeof b&&(b={text:b}),b)for(var c in b)this._htOption[c]=b[c];"string"==typeof a&&(a=document.getElementById(a)),this._android=n(),this._el=a,this._oQRCode=null,this._oDrawing=new q(this._el,this._htOption),this._htOption.text&&this.makeCode(this._htOption.text)},QRCode.prototype.makeCode=function(a){this._oQRCode=new b(r(a,this._htOption.correctLevel),this._htOption.correctLevel),this._oQRCode.addData(a),this._oQRCode.make(),this._el.title=a,this._oDrawing.draw(this._oQRCode),this.makeImage()},QRCode.prototype.makeImage=function(){"function"==typeof this._oDrawing.makeImage&&(!this._android||this._android>=3)&&this._oDrawing.makeImage()},QRCode.prototype.clear=function(){this._oDrawing.clear()},QRCode.CorrectLevel=d}(); \ No newline at end of file diff --git a/js/qrdecode.js b/js/qrdecode.js new file mode 100644 index 0000000..7a55b89 --- /dev/null +++ b/js/qrdecode.js @@ -0,0 +1,240 @@ +var gCtx = null; +var gCanvas = null; +var c = 0; +var stype = 0; +var gUM = false; +var webkit = false; +var moz = false; +var v = null; + +var imghtml = '
' + + '
drag and drop the QRCode here' + + '
or select a file' + + '' + + '
' + + '
'; + +var vidhtml = ''; + +function dragenter(e) { + e.stopPropagation(); + e.preventDefault(); +} + +function dragover(e) { + e.stopPropagation(); + e.preventDefault(); +} +function drop(e) { + e.stopPropagation(); + e.preventDefault(); + + var dt = e.dataTransfer; + var files = dt.files; + if (files.length > 0) { + handleFiles(files); + } + else + if (dt.getData('URL')) { + qrcode.decode(dt.getData('URL')); + } +} + +function handleFiles(f) { + var o = []; + + for (var i = 0; i < f.length; i++) { + var reader = new FileReader(); + reader.onload = (function (theFile) { + return function (e) { + gCtx.clearRect(0, 0, gCanvas.width, gCanvas.height); + + qrcode.decode(e.target.result); + }; + })(f[i]); + reader.readAsDataURL(f[i]); + } +} + +function initCanvas(w, h) { + gCanvas = document.getElementById("qr-canvas"); + gCanvas.style.width = w + "px"; + gCanvas.style.height = h + "px"; + gCanvas.width = w; + gCanvas.height = h; + gCtx = gCanvas.getContext("2d"); + gCtx.clearRect(0, 0, w, h); +} + + +function captureToCanvas() { + if (stype != 1) + return; + if (gUM) { + try { + gCtx.drawImage(v, 0, 0); + try { + qrcode.decode(); + setTimeout(captureToCanvas, 500); + } + catch (e) { + console.log(e); + setTimeout(captureToCanvas, 500); + }; + } + catch (e) { + console.log(e); + setTimeout(captureToCanvas, 500); + }; + } + else { + console.log("Media not captured yet or error in capturing media"); + } +} + +function htmlEntities(str) { + return String(str).replace(/&/g, '&').replace(//g, '>').replace(/"/g, '"'); +} + +function read(a) { + window["raw"] = a; + check(); +} + +function isCanvasSupported() { + var elem = document.createElement('canvas'); + return !!(elem.getContext && elem.getContext('2d')); +} + +function success(stream) { + window.stream = stream; + if (webkit) { + if (window.URL) + v.src = window.URL.createObjectURL(stream); + else if (window.webkitURL) + v.src = window.webkitURL.createObjectURL(stream); + + v.play(); + } + else + if (moz) { + v.mozSrcObject = stream; + v.play(); + } + else + v.src = stream; + + gUM = true; + setTimeout(captureToCanvas, 500); +} + +function error(error) { + gUM = false; + alert("Failed to access webcam"); + return; +} + +function gotSources(sourceInfos) { + var videoSelect = document.querySelector('select#videoSource'); + //var audioSelect = document.querySelector('select#audioSource'); + while (videoSelect.firstChild) + videoSelect.removeChild(videoSelect.firstChild); + + // Run the loop in the reverse order to get rear camera first + for (var i = sourceInfos.length - 1; i >= 0; --i) { + var sourceInfo = sourceInfos[i]; + var option = document.createElement('option'); + option.value = sourceInfo.id; + if (sourceInfo.kind === 'audio') { + //option.text = sourceInfo.label || 'microphone ' + (audioSelect.length + 1); + //audioSelect.appendChild(option); + } else if (sourceInfo.kind === 'video') { + option.text = sourceInfo.label || 'camera ' + (videoSelect.length + 1); + videoSelect.appendChild(option); + } else { + console.log('Some other kind of source: ', sourceInfo); + } + } + setwebcam(); +} + +function load() { + + if (isCanvasSupported() && window.File && window.FileReader) { + initCanvas(800, 600); + qrcode.callback = read; + document.getElementById("mainbody").style.display = "inline"; + //setwebcam(); + var videoSelect = document.querySelector('select#videoSource'); + videoSelect.onchange = setwebcam; + if (typeof MediaStreamTrack === 'undefined') { + alert('This browser does not support MediaStreamTrack.\n\nTry Chrome Canary.'); + } else { + MediaStreamTrack.getSources(gotSources); + } + } + else { + document.getElementById("mainbody").style.display = "inline"; + document.getElementById("mainbody").innerHTML = '

QR code scanner for HTML5 capable browsers


' + + '

sorry your browser is not supported



' + + '

try or or

'; + } +} + +function setwebcam() { + if (stype == 1) { + //setTimeout(captureToCanvas, 500); + //return; + } + var videoSelect = document.querySelector('select#videoSource'); + var videoSource = videoSelect.value; + var constraints = { + audio: false, + video: { + optional: [{ sourceId: videoSource }] + } + }; + var n = navigator; + document.getElementById("outdiv").innerHTML = vidhtml; + v = document.getElementById("v"); + if (!!window.stream) { + v.src = null; + window.stream.stop(); + } + + if (n.getUserMedia) + n.getUserMedia(constraints, success, error); + else + if (n.webkitGetUserMedia) { + webkit = true; + n.webkitGetUserMedia(constraints, success, error); + } + else + if (n.mozGetUserMedia) { + moz = true; + n.mozGetUserMedia(constraints, success, error); + } + + //document.getElementById("qrimg").src="qrimg2.png"; + //document.getElementById("webcamimg").src="webcam.png"; + document.getElementById("qrimg").style.opacity = 0.2; + document.getElementById("webcamimg").style.opacity = 1.0; + + stype = 1; + //setTimeout(captureToCanvas, 500); +} + +function setimg() { + if (stype == 2) + return; + document.getElementById("outdiv").innerHTML = imghtml; + //document.getElementById("qrimg").src="qrimg.png"; + //document.getElementById("webcamimg").src="webcam2.png"; + + var qrfile = document.getElementById("qrfile"); + qrfile.addEventListener("dragenter", dragenter, false); + qrfile.addEventListener("dragover", dragover, false); + qrfile.addEventListener("drop", drop, false); + stype = 2; +} + diff --git a/js/test-manf.js b/js/test-manf.js new file mode 100644 index 0000000..790a8a8 --- /dev/null +++ b/js/test-manf.js @@ -0,0 +1,510 @@ +testManufObj={ + "valueSetId": "covid-19-lab-test-manufacturer-and-name", + "valueSetDate": "2021-05-27", + "valueSetValues": { + "1833": { + "display": "AAZ-LMB, COVID-VIRO", + "lang": "en", + "active": true, + "system": "https://covid-19-diagnostics.jrc.ec.europa.eu/devices", + "version": "2021-05-17 11:02:12 CET" + }, + "1232": { + "display": "Abbott Rapid Diagnostics, Panbio COVID-19 Ag Rapid Test", + "lang": "en", + "active": true, + "system": "https://covid-19-diagnostics.jrc.ec.europa.eu/devices", + "version": "2021-05-17 11:01:42 CET" + }, + "1468": { + "display": "ACON Laboratories, Inc, Flowflex SARS-CoV-2 Antigen rapid test", + "lang": "en", + "active": true, + "system": "https://covid-19-diagnostics.jrc.ec.europa.eu/devices", + "version": "2021-05-10 20:07:30 CET" + }, + "1304": { + "display": "AMEDA Labordiagnostik GmbH, AMP Rapid Test SARS-CoV-2 Ag", + "lang": "en", + "active": true, + "system": "https://covid-19-diagnostics.jrc.ec.europa.eu/devices", + "version": "2021-05-10 13:04:00 CET" + }, + "1822": { + "display": "Anbio (Xiamen) Biotechnology Co., Ltd, Rapid COVID-19 Antigen Test(Colloidal Gold)", + "lang": "en", + "active": true, + "system": "https://covid-19-diagnostics.jrc.ec.europa.eu/devices", + "version": "2021-05-10 19:40:14 CET" + }, + "1815": { + "display": "Anhui Deep Blue Medical Technology Co., Ltd, COVID-19 (SARS-CoV-2) Antigen Test Kit (Colloidal Gold) - Nasal Swab", + "lang": "en", + "active": true, + "system": "https://covid-19-diagnostics.jrc.ec.europa.eu/devices", + "version": "2021-05-12 12:27:46 CET" + }, + "1736": { + "display": "Anhui Deep Blue Medical Technology Co., Ltd, COVID-19 (SARS-CoV-2) Antigen Test Kit(Colloidal Gold)", + "lang": "en", + "active": true, + "system": "https://covid-19-diagnostics.jrc.ec.europa.eu/devices", + "version": "2021-05-10 19:40:14 CET" + }, + "768": { + "display": "ArcDia International Ltd, mariPOC SARS-CoV-2", + "lang": "en", + "active": true, + "system": "https://covid-19-diagnostics.jrc.ec.europa.eu/devices", + "version": "2021-05-19 17:12:12 CET" + }, + "1654": { + "display": "Asan Pharmaceutical CO., LTD, Asan Easy Test COVID-19 Ag", + "lang": "en", + "active": true, + "system": "https://covid-19-diagnostics.jrc.ec.europa.eu/devices", + "version": "2021-05-10 19:40:14 CET" + }, + "2010": { + "display": "Atlas Link Technology Co., Ltd., NOVA Test® SARS-CoV-2 Antigen Rapid Test Kit (Colloidal Gold Immunochromatography)", + "lang": "en", + "active": true, + "system": "https://covid-19-diagnostics.jrc.ec.europa.eu/devices", + "version": "2021-05-11 09:29:55 CET" + }, + "1906": { + "display": "Azure Biotech Inc, COVID-19 Antigen Rapid Test Device", + "lang": "en", + "active": true, + "system": "https://covid-19-diagnostics.jrc.ec.europa.eu/devices", + "version": "2021-05-19 17:14:21 CET" + }, + "1870": { + "display": "Beijing Hotgen Biotech Co., Ltd, Novel Coronavirus 2019-nCoV Antigen Test (Colloidal Gold)", + "lang": "en", + "active": true, + "system": "https://covid-19-diagnostics.jrc.ec.europa.eu/devices", + "version": "2021-05-10 20:07:30 CET" + }, + "1331": { + "display": "Beijing Lepu Medical Technology Co., Ltd, SARS-CoV-2 Antigen Rapid Test Kit", + "lang": "en", + "active": true, + "system": "https://covid-19-diagnostics.jrc.ec.europa.eu/devices", + "version": "2021-05-10 13:04:00 CET" + }, + "1484": { + "display": "Beijing Wantai Biological Pharmacy Enterprise Co., Ltd, Wantai SARS-CoV-2 Ag Rapid Test (FIA)", + "lang": "en", + "active": true, + "system": "https://covid-19-diagnostics.jrc.ec.europa.eu/devices", + "version": "2021-05-10 13:04:00 CET" + }, + "1223": { + "display": "BIOSYNEX S.A., BIOSYNEX COVID-19 Ag BSS", + "lang": "en", + "active": true, + "system": "https://covid-19-diagnostics.jrc.ec.europa.eu/devices", + "version": "2021-05-10 13:18:20 CET" + }, + "1236": { + "display": "BTNX Inc, Rapid Response COVID-19 Antigen Rapid Test", + "lang": "en", + "active": true, + "system": "https://covid-19-diagnostics.jrc.ec.europa.eu/devices", + "version": "2021-05-10 19:40:13 CET" + }, + "1173": { + "display": "CerTest Biotec, CerTest SARS-CoV-2 Card test", + "lang": "en", + "active": true, + "system": "https://covid-19-diagnostics.jrc.ec.europa.eu/devices", + "version": "2021-05-10 13:18:20 CET" + }, + "1919": { + "display": "Core Technology Co., Ltd, Coretests COVID-19 Ag Test", + "lang": "en", + "active": true, + "system": "https://covid-19-diagnostics.jrc.ec.europa.eu/devices", + "version": "2021-05-10 20:12:51 CET" + }, + "1225": { + "display": "DDS DIAGNOSTIC, Test Rapid Covid-19 Antigen (tampon nazofaringian)", + "lang": "en", + "active": true, + "system": "https://covid-19-diagnostics.jrc.ec.europa.eu/devices", + "version": "2021-05-10 19:40:13 CET" + }, + "1375": { + "display": "DIALAB GmbH, DIAQUICK COVID-19 Ag Cassette", + "lang": "en", + "active": true, + "system": "https://covid-19-diagnostics.jrc.ec.europa.eu/devices", + "version": "2021-05-10 20:07:30 CET" + }, + "1244": { + "display": "GenBody, Inc, Genbody COVID-19 Ag Test", + "lang": "en", + "active": true, + "system": "https://covid-19-diagnostics.jrc.ec.europa.eu/devices", + "version": "2021-05-10 13:04:00 CET" + }, + "1253": { + "display": "GenSure Biotech Inc, GenSure COVID-19 Antigen Rapid Kit (REF: P2004)", + "lang": "en", + "active": true, + "system": "https://covid-19-diagnostics.jrc.ec.europa.eu/devices", + "version": "2021-05-10 19:40:14 CET" + }, + "1144": { + "display": "Green Cross Medical Science Corp., GENEDIA W COVID-19 Ag", + "lang": "en", + "active": true, + "system": "https://covid-19-diagnostics.jrc.ec.europa.eu/devices", + "version": "2021-05-11 09:31:09 CET" + }, + "1747": { + "display": "Guangdong Hecin Scientific, Inc., 2019-nCoV Antigen Test Kit (colloidal gold method)", + "lang": "en", + "active": true, + "system": "https://covid-19-diagnostics.jrc.ec.europa.eu/devices", + "version": "2021-05-10 19:40:14 CET" + }, + "1360": { + "display": "Guangdong Wesail Biotech Co., Ltd, COVID-19 Ag Test Kit", + "lang": "en", + "active": true, + "system": "https://covid-19-diagnostics.jrc.ec.europa.eu/devices", + "version": "2021-05-10 13:04:00 CET" + }, + "1437": { + "display": "Guangzhou Wondfo Biotech Co., Ltd, Wondfo 2019-nCoV Antigen Test (Lateral Flow Method)", + "lang": "en", + "active": true, + "system": "https://covid-19-diagnostics.jrc.ec.europa.eu/devices", + "version": "2021-05-10 20:07:30 CET" + }, + "1256": { + "display": "Hangzhou AllTest Biotech Co., Ltd, COVID-19 and Influenza A+B Antigen Combo Rapid Test", + "lang": "en", + "active": true, + "system": "https://covid-19-diagnostics.jrc.ec.europa.eu/devices", + "version": "2021-05-10 19:40:14 CET" + }, + "1363": { + "display": "Hangzhou Clongene Biotech Co., Ltd, Covid-19 Antigen Rapid Test Kit", + "lang": "en", + "active": true, + "system": "https://covid-19-diagnostics.jrc.ec.europa.eu/devices", + "version": "2021-05-10 13:04:00 CET" + }, + "1365": { + "display": "Hangzhou Clongene Biotech Co., Ltd, COVID-19/Influenza A+B Antigen Combo Rapid Test", + "lang": "en", + "active": true, + "system": "https://covid-19-diagnostics.jrc.ec.europa.eu/devices", + "version": "2021-05-10 19:40:14 CET" + }, + "1844": { + "display": "Hangzhou Immuno Biotech Co.,Ltd, Immunobio SARS-CoV-2 Antigen ANTERIOR NASAL Rapid Test Kit (minimal invasive)", + "lang": "en", + "active": true, + "system": "https://covid-19-diagnostics.jrc.ec.europa.eu/devices", + "version": "2021-05-10 19:40:14 CET" + }, + "1215": { + "display": "Hangzhou Laihe Biotech Co., Ltd, LYHER Novel Coronavirus (COVID-19) Antigen Test Kit(Colloidal Gold)", + "lang": "en", + "active": true, + "system": "https://covid-19-diagnostics.jrc.ec.europa.eu/devices", + "version": "2021-05-10 19:40:13 CET" + }, + "1392": { + "display": "Hangzhou Testsea Biotechnology Co., Ltd, COVID-19 Antigen Test Cassette", + "lang": "en", + "active": true, + "system": "https://covid-19-diagnostics.jrc.ec.europa.eu/devices", + "version": "2021-05-10 19:40:14 CET" + }, + "1767": { + "display": "Healgen Scientific, Coronavirus Ag Rapid Test Cassette", + "lang": "en", + "active": true, + "system": "https://covid-19-diagnostics.jrc.ec.europa.eu/devices", + "version": "2021-05-10 13:18:20 CET" + }, + "1263": { + "display": "Humasis, Humasis COVID-19 Ag Test", + "lang": "en", + "active": true, + "system": "https://covid-19-diagnostics.jrc.ec.europa.eu/devices", + "version": "2021-05-10 20:07:30 CET" + }, + "1333": { + "display": "Joinstar Biomedical Technology Co., Ltd, COVID-19 Rapid Antigen Test (Colloidal Gold)", + "lang": "en", + "active": true, + "system": "https://covid-19-diagnostics.jrc.ec.europa.eu/devices", + "version": "2021-05-10 20:07:30 CET" + }, + "1764": { + "display": "JOYSBIO (Tianjin) Biotechnology Co., Ltd, SARS-CoV-2 Antigen Rapid Test Kit (Colloidal Gold)", + "lang": "en", + "active": true, + "system": "https://covid-19-diagnostics.jrc.ec.europa.eu/devices", + "version": "2021-05-11 09:28:10 CET" + }, + "1266": { + "display": "Labnovation Technologies Inc, SARS-CoV-2 Antigen Rapid Test Kit", + "lang": "en", + "active": true, + "system": "https://covid-19-diagnostics.jrc.ec.europa.eu/devices", + "version": "2021-05-10 19:40:14 CET" + }, + "1267": { + "display": "LumiQuick Diagnostics Inc, QuickProfile COVID-19 Antigen Test", + "lang": "en", + "active": true, + "system": "https://covid-19-diagnostics.jrc.ec.europa.eu/devices", + "version": "2021-05-10 20:07:30 CET" + }, + "1268": { + "display": "LumiraDX, LumiraDx SARS-CoV-2 Ag Test", + "lang": "en", + "active": true, + "system": "https://covid-19-diagnostics.jrc.ec.europa.eu/devices", + "version": "2021-05-10 13:18:20 CET" + }, + "1180": { + "display": "MEDsan GmbH, MEDsan SARS-CoV-2 Antigen Rapid Test", + "lang": "en", + "active": true, + "system": "https://covid-19-diagnostics.jrc.ec.europa.eu/devices", + "version": "2021-05-10 20:07:30 CET" + }, + "1190": { + "display": "möLab, COVID-19 Rapid Antigen Test", + "lang": "en", + "active": true, + "system": "https://covid-19-diagnostics.jrc.ec.europa.eu/devices", + "version": "2021-05-10 19:40:13 CET" + }, + "1481": { + "display": "MP Biomedicals, Rapid SARS-CoV-2 Antigen Test Card", + "lang": "en", + "active": true, + "system": "https://covid-19-diagnostics.jrc.ec.europa.eu/devices", + "version": "2021-05-10 20:07:30 CET" + }, + "1162": { + "display": "Nal von minden GmbH, NADAL COVID-19 Ag Test", + "lang": "en", + "active": true, + "system": "https://covid-19-diagnostics.jrc.ec.europa.eu/devices", + "version": "2021-05-10 13:04:00 CET" + }, + "1420": { + "display": "NanoEntek, FREND COVID-19 Ag", + "lang": "en", + "active": true, + "system": "https://covid-19-diagnostics.jrc.ec.europa.eu/devices", + "version": "2021-05-10 19:40:14 CET" + }, + "1199": { + "display": "Oncosem Onkolojik Sistemler San. ve Tic. A.S., CAT", + "lang": "en", + "active": true, + "system": "https://covid-19-diagnostics.jrc.ec.europa.eu/devices", + "version": "2021-05-10 19:40:13 CET" + }, + "308": { + "display": "PCL Inc, PCL COVID19 Ag Rapid FIA", + "lang": "en", + "active": true, + "system": "https://covid-19-diagnostics.jrc.ec.europa.eu/devices", + "version": "2021-05-10 20:07:30 CET" + }, + "1271": { + "display": "Precision Biosensor, Inc, Exdia COVID-19 Ag", + "lang": "en", + "active": true, + "system": "https://covid-19-diagnostics.jrc.ec.europa.eu/devices", + "version": "2021-05-10 13:04:00 CET" + }, + "1341": { + "display": "Qingdao Hightop Biotech Co., Ltd, SARS-CoV-2 Antigen Rapid Test (Immunochromatography)", + "lang": "en", + "active": true, + "system": "https://covid-19-diagnostics.jrc.ec.europa.eu/devices", + "version": "2021-05-10 13:04:00 CET" + }, + "1097": { + "display": "Quidel Corporation, Sofia SARS Antigen FIA", + "lang": "en", + "active": true, + "system": "https://covid-19-diagnostics.jrc.ec.europa.eu/devices", + "version": "2021-05-10 13:04:00 CET" + }, + "1606": { + "display": "RapiGEN Inc, BIOCREDIT COVID-19 Ag - SARS-CoV 2 Antigen test", + "lang": "en", + "active": true, + "system": "https://covid-19-diagnostics.jrc.ec.europa.eu/devices", + "version": "2021-05-10 20:07:30 CET" + }, + "1604": { + "display": "Roche (SD BIOSENSOR), SARS-CoV-2 Antigen Rapid Test", + "lang": "en", + "active": true, + "system": "https://covid-19-diagnostics.jrc.ec.europa.eu/devices", + "version": "2021-05-10 20:07:30 CET" + }, + "1489": { + "display": "Safecare Biotech (Hangzhou) Co. Ltd, COVID-19 Antigen Rapid Test Kit (Swab)", + "lang": "en", + "active": true, + "system": "https://covid-19-diagnostics.jrc.ec.europa.eu/devices", + "version": "2021-05-12 12:58:25 CET" + }, + "1490": { + "display": "Safecare Biotech (Hangzhou) Co. Ltd, Multi-Respiratory Virus Antigen Test Kit(Swab) (Influenza A+B/ COVID-19)", + "lang": "en", + "active": true, + "system": "https://covid-19-diagnostics.jrc.ec.europa.eu/devices", + "version": "2021-05-10 19:40:14 CET" + }, + "344": { + "display": "SD BIOSENSOR Inc, STANDARD F COVID-19 Ag FIA", + "lang": "en", + "active": true, + "system": "https://covid-19-diagnostics.jrc.ec.europa.eu/devices", + "version": "2021-05-10 13:04:00 CET" + }, + "345": { + "display": "SD BIOSENSOR Inc, STANDARD Q COVID-19 Ag Test", + "lang": "en", + "active": true, + "system": "https://covid-19-diagnostics.jrc.ec.europa.eu/devices", + "version": "2021-05-10 13:04:00 CET" + }, + "1319": { + "display": "SGA Medikal, V-Chek SARS-CoV-2 Ag Rapid Test Kit (Colloidal Gold)", + "lang": "en", + "active": true, + "system": "https://covid-19-diagnostics.jrc.ec.europa.eu/devices", + "version": "2021-05-10 19:40:14 CET" + }, + "2017": { + "display": "Shenzhen Ultra-Diagnostics Biotec.Co.,Ltd, SARS-CoV-2 Antigen Test Kit", + "lang": "en", + "active": true, + "system": "https://covid-19-diagnostics.jrc.ec.europa.eu/devices", + "version": "2021-05-19 17:15:38 CET" + }, + "1769": { + "display": "Shenzhen Watmind Medical Co., Ltd, SARS-CoV-2 Ag Diagnostic Test Kit (Colloidal Gold)", + "lang": "en", + "active": true, + "system": "https://covid-19-diagnostics.jrc.ec.europa.eu/devices", + "version": "2021-05-10 20:07:30 CET" + }, + "1574": { + "display": "Shenzhen Zhenrui Biotechnology Co., Ltd, Zhenrui ®COVID-19 Antigen Test Cassette", + "lang": "en", + "active": true, + "system": "https://covid-19-diagnostics.jrc.ec.europa.eu/devices", + "version": "2021-05-10 19:40:14 CET" + }, + "1218": { + "display": "Siemens Healthineers, CLINITEST Rapid Covid-19 Antigen Test", + "lang": "en", + "active": true, + "system": "https://covid-19-diagnostics.jrc.ec.europa.eu/devices", + "version": "2021-05-10 13:04:00 CET" + }, + "1114": { + "display": "Sugentech, Inc, SGTi-flex COVID-19 Ag", + "lang": "en", + "active": true, + "system": "https://covid-19-diagnostics.jrc.ec.europa.eu/devices", + "version": "2021-05-10 19:40:13 CET" + }, + "1466": { + "display": "TODA PHARMA, TODA CORONADIAG Ag", + "lang": "en", + "active": true, + "system": "https://covid-19-diagnostics.jrc.ec.europa.eu/devices", + "version": "2021-05-10 20:07:30 CET" + }, + "1934": { + "display": "Tody Laboratories Int., Coronavirus (SARS-CoV 2) Antigen - Oral Fluid", + "lang": "en", + "active": true, + "system": "https://covid-19-diagnostics.jrc.ec.europa.eu/devices", + "version": "2021-05-19 17:16:42 CET" + }, + "1443": { + "display": "Vitrosens Biotechnology Co., Ltd, RapidFor SARS-CoV-2 Rapid Ag Test", + "lang": "en", + "active": true, + "system": "https://covid-19-diagnostics.jrc.ec.europa.eu/devices", + "version": "2021-05-10 19:40:14 CET" + }, + "1246": { + "display": "VivaChek Biotech (Hangzhou) Co., Ltd, Vivadiag SARS CoV 2 Ag Rapid Test", + "lang": "en", + "active": true, + "system": "https://covid-19-diagnostics.jrc.ec.europa.eu/devices", + "version": "2021-05-10 19:40:14 CET" + }, + "1763": { + "display": "Xiamen AmonMed Biotechnology Co., Ltd, COVID-19 Antigen Rapid Test Kit (Colloidal Gold)", + "lang": "en", + "active": true, + "system": "https://covid-19-diagnostics.jrc.ec.europa.eu/devices", + "version": "2021-05-10 19:40:14 CET" + }, + "1278": { + "display": "Xiamen Boson Biotech Co. Ltd, Rapid SARS-CoV-2 Antigen Test Card", + "lang": "en", + "active": true, + "system": "https://covid-19-diagnostics.jrc.ec.europa.eu/devices", + "version": "2021-05-10 13:04:00 CET" + }, + "1456": { + "display": "Xiamen Wiz Biotech Co., Ltd, SARS-CoV-2 Antigen Rapid Test", + "lang": "en", + "active": true, + "system": "https://covid-19-diagnostics.jrc.ec.europa.eu/devices", + "version": "2021-05-19 17:10:21 CET" + }, + "1884": { + "display": "Xiamen Wiz Biotech Co., Ltd, SARS-CoV-2 Antigen Rapid Test (Colloidal Gold)", + "lang": "en", + "active": true, + "system": "https://covid-19-diagnostics.jrc.ec.europa.eu/devices", + "version": "2021-05-20 15:15:25 CET" + }, + "1296": { + "display": "Zhejiang Anji Saianfu Biotech Co., Ltd, AndLucky COVID-19 Antigen Rapid Test", + "lang": "en", + "active": true, + "system": "https://covid-19-diagnostics.jrc.ec.europa.eu/devices", + "version": "2021-05-10 19:40:14 CET" + }, + "1295": { + "display": "Zhejiang Anji Saianfu Biotech Co., Ltd, reOpenTest COVID-19 Antigen Rapid Test", + "lang": "en", + "active": true, + "system": "https://covid-19-diagnostics.jrc.ec.europa.eu/devices", + "version": "2021-05-10 19:40:14 CET" + }, + "1343": { + "display": "Zhezhiang Orient Gene Biotech Co., Ltd, Coronavirus Ag Rapid Test Cassette (Swab)", + "lang": "en", + "active": true, + "system": "https://covid-19-diagnostics.jrc.ec.europa.eu/devices", + "version": "2021-05-10 13:18:20 CET" + } + } +} diff --git a/js/test-result.js b/js/test-result.js new file mode 100644 index 0000000..afbcfcd --- /dev/null +++ b/js/test-result.js @@ -0,0 +1,20 @@ +testResultObj={ + "valueSetId": "covid-19-lab-result", + "valueSetDate": "2021-04-27", + "valueSetValues": { + "260415000": { + "display": "Not detected", + "lang": "en", + "active": true, + "version": "http://snomed.info/sct/900000000000207008/version/20210131", + "system": "http://snomed.info/sct" + }, + "260373001": { + "display": "Detected", + "lang": "en", + "active": true, + "version": "http://snomed.info/sct/900000000000207008/version/20210131", + "system": "http://snomed.info/sct" + } + } +} diff --git a/js/test-type.js b/js/test-type.js new file mode 100644 index 0000000..8b7cac9 --- /dev/null +++ b/js/test-type.js @@ -0,0 +1,20 @@ +testTypeObj={ + "valueSetId": "covid-19-lab-test-type", + "valueSetDate": "2021-04-27", + "valueSetValues": { + "LP6464-4": { + "display": "Nucleic acid amplification with probe detection", + "lang": "en", + "active": true, + "version": "2.69", + "system": "http://loinc.org" + }, + "LP217198-3": { + "display": "Rapid immunoassay", + "lang": "en", + "active": true, + "version": "2.69", + "system": "http://loinc.org" + } + } +} diff --git a/js/vaccine-mah-manf.js b/js/vaccine-mah-manf.js new file mode 100644 index 0000000..ec8d101 --- /dev/null +++ b/js/vaccine-mah-manf.js @@ -0,0 +1,104 @@ +manufacturer={ + "valueSetId": "vaccines-covid-19-auth-holders", + "valueSetDate": "2021-04-27", + "valueSetValues": { + "ORG-100001699": { + "display": "AstraZeneca AB", + "lang": "en", + "active": true, + "system": "https://spor.ema.europa.eu/v1/organisations", + "version": "" + }, + "ORG-100030215": { + "display": "Biontech Manufacturing GmbH", + "lang": "en", + "active": true, + "system": "https://spor.ema.europa.eu/v1/organisations", + "version": "" + }, + "ORG-100001417": { + "display": "Janssen-Cilag International", + "lang": "en", + "active": true, + "system": "https://spor.ema.europa.eu/v1/organisations", + "version": "" + }, + "ORG-100031184": { + "display": "Moderna Biotech Spain S.L.", + "lang": "en", + "active": true, + "system": "https://spor.ema.europa.eu/v1/organisations", + "version": "" + }, + "ORG-100006270": { + "display": "Curevac AG", + "lang": "en", + "active": true, + "system": "https://spor.ema.europa.eu/v1/organisations", + "version": "" + }, + "ORG-100013793": { + "display": "CanSino Biologics", + "lang": "en", + "active": true, + "system": "https://spor.ema.europa.eu/v1/organisations", + "version": "" + }, + "ORG-100020693": { + "display": "China Sinopharm International Corp. - Beijing location", + "lang": "en", + "active": true, + "system": "https://spor.ema.europa.eu/v1/organisations", + "version": "" + }, + "ORG-100010771": { + "display": "Sinopharm Weiqida Europe Pharmaceutical s.r.o. - Prague location", + "lang": "en", + "active": true, + "system": "https://spor.ema.europa.eu/v1/organisations", + "version": "" + }, + "ORG-100024420": { + "display": "Sinopharm Zhijun (Shenzhen) Pharmaceutical Co. Ltd. - Shenzhen location", + "lang": "en", + "active": true, + "system": "https://spor.ema.europa.eu/v1/organisations", + "version": "" + }, + "ORG-100032020": { + "display": "Novavax CZ AS", + "lang": "en", + "active": true, + "system": "https://spor.ema.europa.eu/v1/organisations", + "version": "" + }, + "Gamaleya-Research-Institute": { + "display": "Gamaleya Research Institute", + "lang": "en", + "active": true, + "system": "http://ec.europa.eu/temp/vaccinemanufacturer", + "version": "1.0" + }, + "Vector-Institute": { + "display": "Vector Institute", + "lang": "en", + "active": true, + "system": "http://ec.europa.eu/temp/vaccinemanufacturer", + "version": "1.0" + }, + "Sinovac-Biotech": { + "display": "Sinovac Biotech", + "lang": "en", + "active": true, + "system": "http://ec.europa.eu/temp/vaccinemanufacturer", + "version": "1.0" + }, + "Bharat-Biotech": { + "display": "Bharat Biotech", + "lang": "en", + "active": true, + "system": "http://ec.europa.eu/temp/vaccinemanufacturer", + "version": "1.0" + } + } +} diff --git a/js/vaccine-medicinal-product.js b/js/vaccine-medicinal-product.js new file mode 100644 index 0000000..eeab8ad --- /dev/null +++ b/js/vaccine-medicinal-product.js @@ -0,0 +1,90 @@ +product={ + "valueSetId": "vaccines-covid-19-names", + "valueSetDate": "2021-04-27", + "valueSetValues": { + "EU/1/20/1528": { + "display": "Comirnaty", + "lang": "en", + "active": true, + "system": "https://ec.europa.eu/health/documents/community-register/html/", + "version": "" + }, + "EU/1/20/1507": { + "display": "COVID-19 Vaccine Moderna", + "lang": "en", + "active": true, + "system": "https://ec.europa.eu/health/documents/community-register/html/", + "version": "" + }, + "EU/1/21/1529": { + "display": "Vaxzevria", + "lang": "en", + "active": true, + "system": "https://ec.europa.eu/health/documents/community-register/html/", + "version": "" + }, + "EU/1/20/1525": { + "display": "COVID-19 Vaccine Janssen", + "lang": "en", + "active": true, + "system": "https://ec.europa.eu/health/documents/community-register/html/", + "version": "" + }, + "CVnCoV": { + "display": "CVnCoV", + "lang": "en", + "active": true, + "system": "http://ec.europa.eu/temp/vaccineproductname", + "version": "1.0" + }, + "Sputnik-V": { + "display": "Sputnik-V", + "lang": "en", + "active": true, + "system": "http://ec.europa.eu/temp/vaccineproductname", + "version": "1.0" + }, + "Convidecia": { + "display": "Convidecia", + "lang": "en", + "active": true, + "system": "http://ec.europa.eu/temp/vaccineproductname", + "version": "1.0" + }, + "EpiVacCorona": { + "display": "EpiVacCorona", + "lang": "en", + "active": true, + "system": "http://ec.europa.eu/temp/vaccineproductname", + "version": "1.0" + }, + "BBIBP-CorV": { + "display": "BBIBP-CorV", + "lang": "en", + "active": true, + "system": "http://ec.europa.eu/temp/vaccineproductname", + "version": "1.0" + }, + "Inactivated-SARS-CoV-2-Vero-Cell": { + "display": "Inactivated SARS-CoV-2 (Vero Cell)", + "lang": "en", + "active": true, + "system": "http://ec.europa.eu/temp/vaccineproductname", + "version": "1.0" + }, + "CoronaVac": { + "display": "CoronaVac", + "lang": "en", + "active": true, + "system": "http://ec.europa.eu/temp/vaccineproductname", + "version": "1.0" + }, + "Covaxin": { + "display": "Covaxin (also known as BBV152 A, B, C)", + "lang": "en", + "active": true, + "system": "http://ec.europa.eu/temp/vaccineproductname", + "version": "1.0" + } + } +} diff --git a/js/vaccine-prophylaxis.js b/js/vaccine-prophylaxis.js new file mode 100644 index 0000000..e986845 --- /dev/null +++ b/js/vaccine-prophylaxis.js @@ -0,0 +1,27 @@ +prophylaxis={ + "valueSetId": "sct-vaccines-covid-19", + "valueSetDate": "2021-04-27", + "valueSetValues": { + "1119349007": { + "display": "SARS-CoV-2 mRNA vaccine", + "lang": "en", + "active": true, + "version": "http://snomed.info/sct/900000000000207008/version/20210131", + "system": "http://snomed.info/sct" + }, + "1119305005": { + "display": "SARS-CoV-2 antigen vaccine", + "lang": "en", + "active": true, + "version": "http://snomed.info/sct/900000000000207008/version/20210131", + "system": "http://snomed.info/sct" + }, + "J07BX03": { + "display": "covid-19 vaccines", + "lang": "en", + "active": true, + "version": "2021-01", + "system": "http://www.whocc.no/atc" + } + } +} diff --git a/style.css b/style.css new file mode 100644 index 0000000..77268c3 --- /dev/null +++ b/style.css @@ -0,0 +1,131 @@ +body { + width: 100%; + text-align: center; +} + +img { + border: 0; +} + +#main { + margin: 15px auto; + background: white; + overflow: auto; + width: 100%; +} + +#header { + background: white; + margin-bottom: 15px; +} + +#mainbody { + background: white; + width: 100%; + display: none; +} + +#footer { + background: white; +} + +#v { + width: 320px; + height: 240px; +} + +#qr-canvas { + display: none; +} + +#qrfile { + width: 320px; + height: 240px; +} + +#mp1 { + text-align: center; + font-size: 35px; +} + +#imghelp { + position: relative; + left: 0px; + top: -160px; + z-index: 100; + font: 18px arial, sans-serif; + background: #f0f0f0; + margin-left: 35px; + margin-right: 35px; + padding-top: 10px; + padding-bottom: 10px; + border-radius: 20px; +} + +.selector { + margin: 0; + padding: 0; + cursor: pointer; + margin-bottom: -5px; +} + +div.select { + margin: 0 0 1em 0; +} + +select { + margin: 0 1em 1em 0; + position: relative; + top: -1px; +} + +div#container { + margin: 0 auto 0 auto; + max-width: 40em; + padding: 1em 1.5em 1.3em 1.5em; +} + +#outdiv { + width: 320px; + height: 240px; + border: solid; + border-width: 3px 3px 3px 3px; +} + +#result { + border: solid; + border-width: 1px 1px 1px 1px; + padding: 20px; + width: 70%; +} + +ul { + margin-bottom: 0; + margin-right: 40px; +} + +li { + display: inline; + padding-right: 0.5em; + padding-left: 0.5em; + font-weight: bold; + border-right: 1px solid #333333; +} + +li a { + text-decoration: none; + color: black; +} + +#footer a { + color: black; +} + +.tsel { + padding: 0; +} + +#res { + display: none; + text-align: center; +} \ No newline at end of file