!function(u){function r(t){this.mode=o.mode_8bit_byte,this.data=t}function l(t,e){this.typenumber=t,this.errorcorrectlevel=e,this.modules=null,this.modulecount=0,this.datacache=null,this.datalist=new array}u.fn.qrcode=function(h){"string"==typeof h?h={text:h}:h.text&&(h.text=function(t){var e,r,o,n;for(e="",o=t.length,r=0;r>12&15),e+=string.fromcharcode(128|n>>6&63)):e+=string.fromcharcode(192|n>>6&31),e+=string.fromcharcode(128|n>>0&63));return e}(h.text)),h=u.extend({},{render:"canvas",width:256,height:256,typenumber:-1,correctlevel:n.h,background:"#ffffff",foreground:"#000000"},h);return this.each(function(){var t="canvas"==h.render?function(){var t=new l(h.typenumber,h.correctlevel);t.adddata(h.text),t.make();var e=document.createelement("canvas");e.width=h.width,e.height=h.height;for(var r=e.getcontext("2d"),o=h.width/t.getmodulecount(),n=h.height/t.getmodulecount(),i=0;i").css("width",h.width+"px").css("height",h.height+"px").css("border","0px").css("border-collapse","collapse").css("background-color",h.background),r=h.width/t.getmodulecount(),o=h.height/t.getmodulecount(),n=0;n").css("height",o+"px").appendto(e),a=0;a").css("width",r+"px").css("background-color",t.isdark(n,a)?h.foreground:h.background).appendto(i);return e}();u(t).appendto(this)})},r.prototype={getlength:function(t){return this.data.length},write:function(t){for(var e=0;e>r&1);this.modules[math.floor(r/3)][r%3+this.modulecount-8-3]=o}for(r=0;r<18;r++){o=!t&&1==(e>>r&1);this.modules[r%3+this.modulecount-8-3][math.floor(r/3)]=o}},setuptypeinfo:function(t,e){for(var r=this.errorcorrectlevel<<3|e,o=p.getbchtypeinfo(r),n=0;n<15;n++){var i=!t&&1==(o>>n&1);n<6?this.modules[n][8]=i:n<8?this.modules[n+1][8]=i:this.modules[this.modulecount-15+n][8]=i}for(n=0;n<15;n++){i=!t&&1==(o>>n&1);n<8?this.modules[8][this.modulecount-n-1]=i:n<9?this.modules[8][15-n-1+1]=i:this.modules[8][15-n-1]=i}this.modules[this.modulecount-8][8]=!t},mapdata:function(t,e){for(var r=-1,o=this.modulecount-1,n=7,i=0,a=this.modulecount-1;0>>n&1)),p.getmask(e,o,a-u)&&(s=!s),this.modules[o][a-u]=s,-1==--n&&(i++,n=7)}if((o+=r)<0||this.modulecount<=o){o-=r,r=-r;break}}}},l.pad0=236,l.pad1=17,l.createdata=function(t,e,r){for(var o=v.getrsblocks(t,e),n=new l,i=0;i8*u)throw new error("code length overflow. ("+n.getlengthinbits()+">"+8*u+")");for(n.getlengthinbits()+4<=8*u&&n.put(0,4);n.getlengthinbits()%8!=0;)n.putbit(!1);for(;!(n.getlengthinbits()>=8*u||(n.put(l.pad0,8),n.getlengthinbits()>=8*u));)n.put(l.pad1,8);return l.createbytes(n,o)},l.createbytes=function(t,e){for(var r=0,o=0,n=0,i=new array(e.length),a=new array(e.length),u=0;u>>=1;return e},getpatternposition:function(t){return p.pattern_position_table[t-1]},getmask:function(t,e,r){switch(t){case i:return(e+r)%2==0;case a:return e%2==0;case s:return r%3==0;case h:return(e+r)%3==0;case g:return(math.floor(e/2)+math.floor(r/3))%2==0;case f:return e*r%2+e*r%3==0;case d:return(e*r%2+e*r%3)%2==0;case c:return(e*r%3+(e+r)%2)%2==0;default:throw new error("bad maskpattern:"+t)}},geterrorcorrectpolynomial:function(t){for(var e=new c([1],0),r=0;r>>7-t%8&1)},put:function(t,e){for(var r=0;r>>e-r-1&1))},getlengthinbits:function(){return this.length},putbit:function(t){var e=math.floor(this.length/8);this.buffer.length<=e&&this.buffer.push(0),t&&(this.buffer[e]|=128>>>this.length%8),this.length++}}}(jquery);