2 lines
60 KiB
JavaScript
2 lines
60 KiB
JavaScript
import{b as At,R as te,t as Pt}from"./index.ea99f164.js";var he={},U={},l={};Object.defineProperty(l,"__esModule",{value:!0});function Tt(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var Mt=function t(e,r){Tt(this,t),this.data=e,this.text=r.text||e,this.options=r};l.default=Mt;Object.defineProperty(U,"__esModule",{value:!0});U.CODE39=void 0;var kt=function(){function t(e,r){for(var n=0;n<r.length;n++){var a=r[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}(),It=l,Dt=jt(It);function jt(t){return t&&t.__esModule?t:{default:t}}function Bt(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Lt(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:t}function Nt(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var Ct=function(t){Nt(e,t);function e(r,n){return Bt(this,e),r=r.toUpperCase(),n.mod43&&(r+=Ft(Xt(r))),Lt(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,r,n))}return kt(e,[{key:"encode",value:function(){for(var n=ne("*"),a=0;a<this.data.length;a++)n+=ne(this.data[a])+"0";return n+=ne("*"),{data:n,text:this.text}}},{key:"valid",value:function(){return this.data.search(/^[0-9A-Z\-\.\ \$\/\+\%]+$/)!==-1}}]),e}(Dt.default),nt=["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","-","."," ","$","/","+","%","*"],Gt=[20957,29783,23639,30485,20951,29813,23669,20855,29789,23645,29975,23831,30533,22295,30149,24005,21623,29981,23837,22301,30023,23879,30545,22343,30161,24017,21959,30065,23921,22385,29015,18263,29141,17879,29045,18293,17783,29021,18269,17477,17489,17681,20753,35770];function ne(t){return Ht(rt(t))}function Ht(t){return Gt[t].toString(2)}function Ft(t){return nt[t]}function rt(t){return nt.indexOf(t)}function Xt(t){for(var e=0,r=0;r<t.length;r++)e+=rt(t[r]);return e=e%43,e}U.CODE39=Ct;var s={},de={},P={},f={};Object.defineProperty(f,"__esModule",{value:!0});var I;function re(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var at=f.SET_A=0,it=f.SET_B=1,ot=f.SET_C=2;f.SHIFT=98;var zt=f.START_A=103,Ut=f.START_B=104,qt=f.START_C=105;f.MODULO=103;f.STOP=106;f.FNC1=207;f.SET_BY_CODE=(I={},re(I,zt,at),re(I,Ut,it),re(I,qt,ot),I);f.SWAP={101:at,100:it,99:ot};f.A_START_CHAR=String.fromCharCode(208);f.B_START_CHAR=String.fromCharCode(209);f.C_START_CHAR=String.fromCharCode(210);f.A_CHARS="[\0-_\xC8-\xCF]";f.B_CHARS="[ -\x7F\xC8-\xCF]";f.C_CHARS="(\xCF*[0-9]{2}\xCF*)";f.BARS=[11011001100,11001101100,11001100110,10010011e3,10010001100,10001001100,10011001e3,10011000100,10001100100,11001001e3,11001000100,11000100100,10110011100,10011011100,10011001110,10111001100,10011101100,10011100110,11001110010,11001011100,11001001110,11011100100,11001110100,11101101110,11101001100,11100101100,11100100110,11101100100,11100110100,11100110010,11011011e3,11011000110,11000110110,10100011e3,10001011e3,10001000110,10110001e3,10001101e3,10001100010,11010001e3,11000101e3,11000100010,10110111e3,10110001110,10001101110,10111011e3,10111000110,10001110110,11101110110,11010001110,11000101110,11011101e3,11011100010,11011101110,11101011e3,11101000110,11100010110,11101101e3,11101100010,11100011010,11101111010,11001000010,11110001010,1010011e4,10100001100,1001011e4,10010000110,10000101100,10000100110,1011001e4,10110000100,1001101e4,10011000010,10000110100,10000110010,11000010010,1100101e4,11110111010,11000010100,10001111010,10100111100,10010111100,10010011110,10111100100,10011110100,10011110010,11110100100,11110010100,11110010010,11011011110,11011110110,11110110110,10101111e3,10100011110,10001011110,10111101e3,10111100010,11110101e3,11110100010,10111011110,10111101110,11101011110,11110101110,11010000100,1101001e4,11010011100,1100011101011];Object.defineProperty(P,"__esModule",{value:!0});var Vt=function(){function t(e,r){for(var n=0;n<r.length;n++){var a=r[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}(),Jt=l,Qt=Wt(Jt),h=f;function Wt(t){return t&&t.__esModule?t:{default:t}}function Yt(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Zt(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:t}function Kt(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var en=function(t){Kt(e,t);function e(r,n){Yt(this,e);var a=Zt(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,r.substring(1),n));return a.bytes=r.split("").map(function(i){return i.charCodeAt(0)}),a}return Vt(e,[{key:"valid",value:function(){return/^[\x00-\x7F\xC8-\xD3]+$/.test(this.data)}},{key:"encode",value:function(){var n=this.bytes,a=n.shift()-105,i=h.SET_BY_CODE[a];if(i===void 0)throw new RangeError("The encoding does not start with a start character.");this.shouldEncodeAsEan128()===!0&&n.unshift(h.FNC1);var o=e.next(n,1,i);return{text:this.text===this.data?this.text.replace(/[^\x20-\x7E]/g,""):this.text,data:e.getBar(a)+o.result+e.getBar((o.checksum+a)%h.MODULO)+e.getBar(h.STOP)}}},{key:"shouldEncodeAsEan128",value:function(){var n=this.options.ean128||!1;return typeof n=="string"&&(n=n.toLowerCase()==="true"),n}}],[{key:"getBar",value:function(n){return h.BARS[n]?h.BARS[n].toString():""}},{key:"correctIndex",value:function(n,a){if(a===h.SET_A){var i=n.shift();return i<32?i+64:i-32}else return a===h.SET_B?n.shift()-32:(n.shift()-48)*10+n.shift()-48}},{key:"next",value:function(n,a,i){if(!n.length)return{result:"",checksum:0};var o=void 0,u=void 0;if(n[0]>=200){u=n.shift()-105;var y=h.SWAP[u];y!==void 0?o=e.next(n,a+1,y):((i===h.SET_A||i===h.SET_B)&&u===h.SHIFT&&(n[0]=i===h.SET_A?n[0]>95?n[0]-96:n[0]:n[0]<32?n[0]+96:n[0]),o=e.next(n,a+1,i))}else u=e.correctIndex(n,i),o=e.next(n,a+1,i);var $=e.getBar(u),Rt=u*a;return{result:$+o.result,checksum:Rt+o.checksum}}}]),e}(Qt.default);P.default=en;var _e={};Object.defineProperty(_e,"__esModule",{value:!0});var g=f,ut=function(e){return e.match(new RegExp("^"+g.A_CHARS+"*"))[0].length},ft=function(e){return e.match(new RegExp("^"+g.B_CHARS+"*"))[0].length},ct=function(e){return e.match(new RegExp("^"+g.C_CHARS+"*"))[0]};function ve(t,e){var r=e?g.A_CHARS:g.B_CHARS,n=t.match(new RegExp("^("+r+"+?)(([0-9]{2}){2,})([^0-9]|$)"));if(n)return n[1]+String.fromCharCode(204)+lt(t.substring(n[1].length));var a=t.match(new RegExp("^"+r+"+"))[0];return a.length===t.length?t:a+String.fromCharCode(e?205:206)+ve(t.substring(a.length),!e)}function lt(t){var e=ct(t),r=e.length;if(r===t.length)return t;t=t.substring(r);var n=ut(t)>=ft(t);return e+String.fromCharCode(n?206:205)+ve(t,n)}_e.default=function(t){var e=void 0,r=ct(t).length;if(r>=2)e=g.C_START_CHAR+lt(t);else{var n=ut(t)>ft(t);e=(n?g.A_START_CHAR:g.B_START_CHAR)+ve(t,n)}return e.replace(/[\xCD\xCE]([^])[\xCD\xCE]/,function(a,i){return String.fromCharCode(203)+i})};Object.defineProperty(de,"__esModule",{value:!0});var tn=P,nn=ht(tn),rn=_e,an=ht(rn);function ht(t){return t&&t.__esModule?t:{default:t}}function on(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function ae(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:t}function un(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var fn=function(t){un(e,t);function e(r,n){if(on(this,e),/^[\x00-\x7F\xC8-\xD3]+$/.test(r))var a=ae(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,(0,an.default)(r),n));else var a=ae(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,r,n));return ae(a)}return e}(nn.default);de.default=fn;var se={};Object.defineProperty(se,"__esModule",{value:!0});var cn=function(){function t(e,r){for(var n=0;n<r.length;n++){var a=r[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}(),ln=P,hn=dn(ln),Fe=f;function dn(t){return t&&t.__esModule?t:{default:t}}function _n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function vn(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:t}function sn(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var yn=function(t){sn(e,t);function e(r,n){return _n(this,e),vn(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,Fe.A_START_CHAR+r,n))}return cn(e,[{key:"valid",value:function(){return new RegExp("^"+Fe.A_CHARS+"+$").test(this.data)}}]),e}(hn.default);se.default=yn;var ye={};Object.defineProperty(ye,"__esModule",{value:!0});var pn=function(){function t(e,r){for(var n=0;n<r.length;n++){var a=r[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}(),gn=P,On=En(gn),Xe=f;function En(t){return t&&t.__esModule?t:{default:t}}function bn(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function mn(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:t}function wn(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var $n=function(t){wn(e,t);function e(r,n){return bn(this,e),mn(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,Xe.B_START_CHAR+r,n))}return pn(e,[{key:"valid",value:function(){return new RegExp("^"+Xe.B_CHARS+"+$").test(this.data)}}]),e}(On.default);ye.default=$n;var pe={};Object.defineProperty(pe,"__esModule",{value:!0});var Sn=function(){function t(e,r){for(var n=0;n<r.length;n++){var a=r[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}(),xn=P,Rn=An(xn),ze=f;function An(t){return t&&t.__esModule?t:{default:t}}function Pn(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Tn(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:t}function Mn(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var kn=function(t){Mn(e,t);function e(r,n){return Pn(this,e),Tn(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,ze.C_START_CHAR+r,n))}return Sn(e,[{key:"valid",value:function(){return new RegExp("^"+ze.C_CHARS+"+$").test(this.data)}}]),e}(Rn.default);pe.default=kn;Object.defineProperty(s,"__esModule",{value:!0});s.CODE128C=s.CODE128B=s.CODE128A=s.CODE128=void 0;var In=de,Dn=q(In),jn=se,Bn=q(jn),Ln=ye,Nn=q(Ln),Cn=pe,Gn=q(Cn);function q(t){return t&&t.__esModule?t:{default:t}}s.CODE128=Dn.default;s.CODE128A=Bn.default;s.CODE128B=Nn.default;s.CODE128C=Gn.default;var c={},ge={},v={};Object.defineProperty(v,"__esModule",{value:!0});v.SIDE_BIN="101";v.MIDDLE_BIN="01010";v.BINARIES={L:["0001101","0011001","0010011","0111101","0100011","0110001","0101111","0111011","0110111","0001011"],G:["0100111","0110011","0011011","0100001","0011101","0111001","0000101","0010001","0001001","0010111"],R:["1110010","1100110","1101100","1000010","1011100","1001110","1010000","1000100","1001000","1110100"],O:["0001101","0011001","0010011","0111101","0100011","0110001","0101111","0111011","0110111","0001011"],E:["0100111","0110011","0011011","0100001","0011101","0111001","0000101","0010001","0001001","0010111"]};v.EAN2_STRUCTURE=["LL","LG","GL","GG"];v.EAN5_STRUCTURE=["GGLLL","GLGLL","GLLGL","GLLLG","LGGLL","LLGGL","LLLGG","LGLGL","LGLLG","LLGLG"];v.EAN13_STRUCTURE=["LLLLLL","LLGLGG","LLGGLG","LLGGGL","LGLLGG","LGGLLG","LGGGLL","LGLGLG","LGLGGL","LGGLGL"];var V={},b={};Object.defineProperty(b,"__esModule",{value:!0});var Hn=v,Fn=function(e,r,n){var a=e.split("").map(function(o,u){return Hn.BINARIES[r[u]]}).map(function(o,u){return o?o[e[u]]:""});if(n){var i=e.length-1;a=a.map(function(o,u){return u<i?o+n:o})}return a.join("")};b.default=Fn;Object.defineProperty(V,"__esModule",{value:!0});var Xn=function(){function t(e,r){for(var n=0;n<r.length;n++){var a=r[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}(),S=v,zn=b,Ue=dt(zn),Un=l,qn=dt(Un);function dt(t){return t&&t.__esModule?t:{default:t}}function Vn(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Jn(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:t}function Qn(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var Wn=function(t){Qn(e,t);function e(r,n){Vn(this,e);var a=Jn(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,r,n));return a.fontSize=!n.flat&&n.fontSize>n.width*10?n.width*10:n.fontSize,a.guardHeight=n.height+a.fontSize/2+n.textMargin,a}return Xn(e,[{key:"encode",value:function(){return this.options.flat?this.encodeFlat():this.encodeGuarded()}},{key:"leftText",value:function(n,a){return this.text.substr(n,a)}},{key:"leftEncode",value:function(n,a){return(0,Ue.default)(n,a)}},{key:"rightText",value:function(n,a){return this.text.substr(n,a)}},{key:"rightEncode",value:function(n,a){return(0,Ue.default)(n,a)}},{key:"encodeGuarded",value:function(){var n={fontSize:this.fontSize},a={height:this.guardHeight};return[{data:S.SIDE_BIN,options:a},{data:this.leftEncode(),text:this.leftText(),options:n},{data:S.MIDDLE_BIN,options:a},{data:this.rightEncode(),text:this.rightText(),options:n},{data:S.SIDE_BIN,options:a}]}},{key:"encodeFlat",value:function(){var n=[S.SIDE_BIN,this.leftEncode(),S.MIDDLE_BIN,this.rightEncode(),S.SIDE_BIN];return{data:n.join(""),text:this.text}}}]),e}(qn.default);V.default=Wn;Object.defineProperty(ge,"__esModule",{value:!0});var Yn=function(){function t(e,r){for(var n=0;n<r.length;n++){var a=r[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}(),D=function t(e,r,n){e===null&&(e=Function.prototype);var a=Object.getOwnPropertyDescriptor(e,r);if(a===void 0){var i=Object.getPrototypeOf(e);return i===null?void 0:t(i,r,n)}else{if("value"in a)return a.value;var o=a.get;return o===void 0?void 0:o.call(n)}},Zn=v,Kn=V,er=tr(Kn);function tr(t){return t&&t.__esModule?t:{default:t}}function nr(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function rr(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:t}function ar(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var qe=function(e){var r=e.substr(0,12).split("").map(function(n){return+n}).reduce(function(n,a,i){return i%2?n+a*3:n+a},0);return(10-r%10)%10},ir=function(t){ar(e,t);function e(r,n){nr(this,e),r.search(/^[0-9]{12}$/)!==-1&&(r+=qe(r));var a=rr(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,r,n));return a.lastChar=n.lastChar,a}return Yn(e,[{key:"valid",value:function(){return this.data.search(/^[0-9]{13}$/)!==-1&&+this.data[12]===qe(this.data)}},{key:"leftText",value:function(){return D(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"leftText",this).call(this,1,6)}},{key:"leftEncode",value:function(){var n=this.data.substr(1,6),a=Zn.EAN13_STRUCTURE[this.data[0]];return D(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"leftEncode",this).call(this,n,a)}},{key:"rightText",value:function(){return D(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"rightText",this).call(this,7,6)}},{key:"rightEncode",value:function(){var n=this.data.substr(7,6);return D(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"rightEncode",this).call(this,n,"RRRRRR")}},{key:"encodeGuarded",value:function(){var n=D(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"encodeGuarded",this).call(this);return this.options.displayValue&&(n.unshift({data:"000000000000",text:this.text.substr(0,1),options:{textAlign:"left",fontSize:this.fontSize}}),this.options.lastChar&&(n.push({data:"00"}),n.push({data:"00000",text:this.options.lastChar,options:{fontSize:this.fontSize}}))),n}}]),e}(er.default);ge.default=ir;var Oe={};Object.defineProperty(Oe,"__esModule",{value:!0});var or=function(){function t(e,r){for(var n=0;n<r.length;n++){var a=r[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}(),H=function t(e,r,n){e===null&&(e=Function.prototype);var a=Object.getOwnPropertyDescriptor(e,r);if(a===void 0){var i=Object.getPrototypeOf(e);return i===null?void 0:t(i,r,n)}else{if("value"in a)return a.value;var o=a.get;return o===void 0?void 0:o.call(n)}},ur=V,fr=cr(ur);function cr(t){return t&&t.__esModule?t:{default:t}}function lr(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function hr(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:t}function dr(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var Ve=function(e){var r=e.substr(0,7).split("").map(function(n){return+n}).reduce(function(n,a,i){return i%2?n+a:n+a*3},0);return(10-r%10)%10},_r=function(t){dr(e,t);function e(r,n){return lr(this,e),r.search(/^[0-9]{7}$/)!==-1&&(r+=Ve(r)),hr(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,r,n))}return or(e,[{key:"valid",value:function(){return this.data.search(/^[0-9]{8}$/)!==-1&&+this.data[7]===Ve(this.data)}},{key:"leftText",value:function(){return H(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"leftText",this).call(this,0,4)}},{key:"leftEncode",value:function(){var n=this.data.substr(0,4);return H(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"leftEncode",this).call(this,n,"LLLL")}},{key:"rightText",value:function(){return H(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"rightText",this).call(this,4,4)}},{key:"rightEncode",value:function(){var n=this.data.substr(4,4);return H(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"rightEncode",this).call(this,n,"RRRR")}}]),e}(fr.default);Oe.default=_r;var Ee={};Object.defineProperty(Ee,"__esModule",{value:!0});var vr=function(){function t(e,r){for(var n=0;n<r.length;n++){var a=r[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}(),sr=v,yr=b,pr=_t(yr),gr=l,Or=_t(gr);function _t(t){return t&&t.__esModule?t:{default:t}}function Er(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function br(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:t}function mr(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var wr=function(e){var r=e.split("").map(function(n){return+n}).reduce(function(n,a,i){return i%2?n+a*9:n+a*3},0);return r%10},$r=function(t){mr(e,t);function e(r,n){return Er(this,e),br(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,r,n))}return vr(e,[{key:"valid",value:function(){return this.data.search(/^[0-9]{5}$/)!==-1}},{key:"encode",value:function(){var n=sr.EAN5_STRUCTURE[wr(this.data)];return{data:"1011"+(0,pr.default)(this.data,n,"01"),text:this.text}}}]),e}(Or.default);Ee.default=$r;var be={};Object.defineProperty(be,"__esModule",{value:!0});var Sr=function(){function t(e,r){for(var n=0;n<r.length;n++){var a=r[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}(),xr=v,Rr=b,Ar=vt(Rr),Pr=l,Tr=vt(Pr);function vt(t){return t&&t.__esModule?t:{default:t}}function Mr(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function kr(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:t}function Ir(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var Dr=function(t){Ir(e,t);function e(r,n){return Mr(this,e),kr(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,r,n))}return Sr(e,[{key:"valid",value:function(){return this.data.search(/^[0-9]{2}$/)!==-1}},{key:"encode",value:function(){var n=xr.EAN2_STRUCTURE[parseInt(this.data)%4];return{data:"1011"+(0,Ar.default)(this.data,n,"01"),text:this.text}}}]),e}(Tr.default);be.default=Dr;var L={};Object.defineProperty(L,"__esModule",{value:!0});var jr=function(){function t(e,r){for(var n=0;n<r.length;n++){var a=r[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}();L.checksum=fe;var Br=b,x=st(Br),Lr=l,Nr=st(Lr);function st(t){return t&&t.__esModule?t:{default:t}}function Cr(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Gr(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:t}function Hr(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var Fr=function(t){Hr(e,t);function e(r,n){Cr(this,e),r.search(/^[0-9]{11}$/)!==-1&&(r+=fe(r));var a=Gr(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,r,n));return a.displayValue=n.displayValue,n.fontSize>n.width*10?a.fontSize=n.width*10:a.fontSize=n.fontSize,a.guardHeight=n.height+a.fontSize/2+n.textMargin,a}return jr(e,[{key:"valid",value:function(){return this.data.search(/^[0-9]{12}$/)!==-1&&this.data[11]==fe(this.data)}},{key:"encode",value:function(){return this.options.flat?this.flatEncoding():this.guardedEncoding()}},{key:"flatEncoding",value:function(){var n="";return n+="101",n+=(0,x.default)(this.data.substr(0,6),"LLLLLL"),n+="01010",n+=(0,x.default)(this.data.substr(6,6),"RRRRRR"),n+="101",{data:n,text:this.text}}},{key:"guardedEncoding",value:function(){var n=[];return this.displayValue&&n.push({data:"00000000",text:this.text.substr(0,1),options:{textAlign:"left",fontSize:this.fontSize}}),n.push({data:"101"+(0,x.default)(this.data[0],"L"),options:{height:this.guardHeight}}),n.push({data:(0,x.default)(this.data.substr(1,5),"LLLLL"),text:this.text.substr(1,5),options:{fontSize:this.fontSize}}),n.push({data:"01010",options:{height:this.guardHeight}}),n.push({data:(0,x.default)(this.data.substr(6,5),"RRRRR"),text:this.text.substr(6,5),options:{fontSize:this.fontSize}}),n.push({data:(0,x.default)(this.data[11],"R")+"101",options:{height:this.guardHeight}}),this.displayValue&&n.push({data:"00000000",text:this.text.substr(11,1),options:{textAlign:"right",fontSize:this.fontSize}}),n}}]),e}(Nr.default);function fe(t){var e=0,r;for(r=1;r<11;r+=2)e+=parseInt(t[r]);for(r=0;r<11;r+=2)e+=parseInt(t[r])*3;return(10-e%10)%10}L.default=Fr;var me={};Object.defineProperty(me,"__esModule",{value:!0});var Xr=function(){function t(e,r){for(var n=0;n<r.length;n++){var a=r[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}(),zr=b,Ur=yt(zr),qr=l,Vr=yt(qr),Jr=L;function yt(t){return t&&t.__esModule?t:{default:t}}function Qr(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function ie(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:t}function Wr(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var Yr=["XX00000XXX","XX10000XXX","XX20000XXX","XXX00000XX","XXXX00000X","XXXXX00005","XXXXX00006","XXXXX00007","XXXXX00008","XXXXX00009"],Zr=[["EEEOOO","OOOEEE"],["EEOEOO","OOEOEE"],["EEOOEO","OOEEOE"],["EEOOOE","OOEEEO"],["EOEEOO","OEOOEE"],["EOOEEO","OEEOOE"],["EOOOEE","OEEEOO"],["EOEOEO","OEOEOE"],["EOEOOE","OEOEEO"],["EOOEOE","OEEOEO"]],Kr=function(t){Wr(e,t);function e(r,n){Qr(this,e);var a=ie(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,r,n));if(a.isValid=!1,r.search(/^[0-9]{6}$/)!==-1)a.middleDigits=r,a.upcA=Je(r,"0"),a.text=n.text||""+a.upcA[0]+r+a.upcA[a.upcA.length-1],a.isValid=!0;else if(r.search(/^[01][0-9]{7}$/)!==-1)if(a.middleDigits=r.substring(1,r.length-1),a.upcA=Je(a.middleDigits,r[0]),a.upcA[a.upcA.length-1]===r[r.length-1])a.isValid=!0;else return ie(a);else return ie(a);return a.displayValue=n.displayValue,n.fontSize>n.width*10?a.fontSize=n.width*10:a.fontSize=n.fontSize,a.guardHeight=n.height+a.fontSize/2+n.textMargin,a}return Xr(e,[{key:"valid",value:function(){return this.isValid}},{key:"encode",value:function(){return this.options.flat?this.flatEncoding():this.guardedEncoding()}},{key:"flatEncoding",value:function(){var n="";return n+="101",n+=this.encodeMiddleDigits(),n+="010101",{data:n,text:this.text}}},{key:"guardedEncoding",value:function(){var n=[];return this.displayValue&&n.push({data:"00000000",text:this.text[0],options:{textAlign:"left",fontSize:this.fontSize}}),n.push({data:"101",options:{height:this.guardHeight}}),n.push({data:this.encodeMiddleDigits(),text:this.text.substring(1,7),options:{fontSize:this.fontSize}}),n.push({data:"010101",options:{height:this.guardHeight}}),this.displayValue&&n.push({data:"00000000",text:this.text[7],options:{textAlign:"right",fontSize:this.fontSize}}),n}},{key:"encodeMiddleDigits",value:function(){var n=this.upcA[0],a=this.upcA[this.upcA.length-1],i=Zr[parseInt(a)][parseInt(n)];return(0,Ur.default)(this.middleDigits,i)}}]),e}(Vr.default);function Je(t,e){for(var r=parseInt(t[t.length-1]),n=Yr[r],a="",i=0,o=0;o<n.length;o++){var u=n[o];u==="X"?a+=t[i++]:a+=u}return a=""+e+a,""+a+(0,Jr.checksum)(a)}me.default=Kr;Object.defineProperty(c,"__esModule",{value:!0});c.UPCE=c.UPC=c.EAN2=c.EAN5=c.EAN8=c.EAN13=void 0;var ea=ge,ta=T(ea),na=Oe,ra=T(na),aa=Ee,ia=T(aa),oa=be,ua=T(oa),fa=L,ca=T(fa),la=me,ha=T(la);function T(t){return t&&t.__esModule?t:{default:t}}c.EAN13=ta.default;c.EAN8=ra.default;c.EAN5=ia.default;c.EAN2=ua.default;c.UPC=ca.default;c.UPCE=ha.default;var A={},J={},N={};Object.defineProperty(N,"__esModule",{value:!0});N.START_BIN="1010";N.END_BIN="11101";N.BINARIES=["00110","10001","01001","11000","00101","10100","01100","00011","10010","01010"];Object.defineProperty(J,"__esModule",{value:!0});var da=function(){function t(e,r){for(var n=0;n<r.length;n++){var a=r[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}(),F=N,_a=l,va=sa(_a);function sa(t){return t&&t.__esModule?t:{default:t}}function ya(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function pa(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:t}function ga(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var Oa=function(t){ga(e,t);function e(){return ya(this,e),pa(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return da(e,[{key:"valid",value:function(){return this.data.search(/^([0-9]{2})+$/)!==-1}},{key:"encode",value:function(){var n=this,a=this.data.match(/.{2}/g).map(function(i){return n.encodePair(i)}).join("");return{data:F.START_BIN+a+F.END_BIN,text:this.text}}},{key:"encodePair",value:function(n){var a=F.BINARIES[n[1]];return F.BINARIES[n[0]].split("").map(function(i,o){return(i==="1"?"111":"1")+(a[o]==="1"?"000":"0")}).join("")}}]),e}(va.default);J.default=Oa;var we={};Object.defineProperty(we,"__esModule",{value:!0});var Ea=function(){function t(e,r){for(var n=0;n<r.length;n++){var a=r[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}(),ba=J,ma=wa(ba);function wa(t){return t&&t.__esModule?t:{default:t}}function $a(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Sa(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:t}function xa(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var Qe=function(e){var r=e.substr(0,13).split("").map(function(n){return parseInt(n,10)}).reduce(function(n,a,i){return n+a*(3-i%2*2)},0);return Math.ceil(r/10)*10-r},Ra=function(t){xa(e,t);function e(r,n){return $a(this,e),r.search(/^[0-9]{13}$/)!==-1&&(r+=Qe(r)),Sa(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,r,n))}return Ea(e,[{key:"valid",value:function(){return this.data.search(/^[0-9]{14}$/)!==-1&&+this.data[13]===Qe(this.data)}}]),e}(ma.default);we.default=Ra;Object.defineProperty(A,"__esModule",{value:!0});A.ITF14=A.ITF=void 0;var Aa=J,Pa=pt(Aa),Ta=we,Ma=pt(Ta);function pt(t){return t&&t.__esModule?t:{default:t}}A.ITF=Pa.default;A.ITF14=Ma.default;var _={},m={};Object.defineProperty(m,"__esModule",{value:!0});var ka=function(){function t(e,r){for(var n=0;n<r.length;n++){var a=r[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}(),Ia=l,Da=ja(Ia);function ja(t){return t&&t.__esModule?t:{default:t}}function Ba(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function La(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:t}function Na(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var Ca=function(t){Na(e,t);function e(r,n){return Ba(this,e),La(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,r,n))}return ka(e,[{key:"encode",value:function(){for(var n="110",a=0;a<this.data.length;a++){var i=parseInt(this.data[a]),o=i.toString(2);o=Ga(o,4-o.length);for(var u=0;u<o.length;u++)n+=o[u]=="0"?"100":"110"}return n+="1001",{data:n,text:this.text}}},{key:"valid",value:function(){return this.data.search(/^[0-9]+$/)!==-1}}]),e}(Da.default);function Ga(t,e){for(var r=0;r<e;r++)t="0"+t;return t}m.default=Ca;var $e={},w={};Object.defineProperty(w,"__esModule",{value:!0});w.mod10=Ha;w.mod11=Fa;function Ha(t){for(var e=0,r=0;r<t.length;r++){var n=parseInt(t[r]);(r+t.length)%2===0?e+=n:e+=n*2%10+Math.floor(n*2/10)}return(10-e%10)%10}function Fa(t){for(var e=0,r=[2,3,4,5,6,7],n=0;n<t.length;n++){var a=parseInt(t[t.length-1-n]);e+=r[n%r.length]*a}return(11-e%11)%11}Object.defineProperty($e,"__esModule",{value:!0});var Xa=m,za=qa(Xa),Ua=w;function qa(t){return t&&t.__esModule?t:{default:t}}function Va(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Ja(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:t}function Qa(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var Wa=function(t){Qa(e,t);function e(r,n){return Va(this,e),Ja(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,r+(0,Ua.mod10)(r),n))}return e}(za.default);$e.default=Wa;var Se={};Object.defineProperty(Se,"__esModule",{value:!0});var Ya=m,Za=ei(Ya),Ka=w;function ei(t){return t&&t.__esModule?t:{default:t}}function ti(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function ni(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:t}function ri(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var ai=function(t){ri(e,t);function e(r,n){return ti(this,e),ni(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,r+(0,Ka.mod11)(r),n))}return e}(Za.default);Se.default=ai;var xe={};Object.defineProperty(xe,"__esModule",{value:!0});var ii=m,oi=ui(ii),We=w;function ui(t){return t&&t.__esModule?t:{default:t}}function fi(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function ci(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:t}function li(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var hi=function(t){li(e,t);function e(r,n){return fi(this,e),r+=(0,We.mod10)(r),r+=(0,We.mod10)(r),ci(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,r,n))}return e}(oi.default);xe.default=hi;var Re={};Object.defineProperty(Re,"__esModule",{value:!0});var di=m,_i=vi(di),Ye=w;function vi(t){return t&&t.__esModule?t:{default:t}}function si(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function yi(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:t}function pi(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var gi=function(t){pi(e,t);function e(r,n){return si(this,e),r+=(0,Ye.mod11)(r),r+=(0,Ye.mod10)(r),yi(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,r,n))}return e}(_i.default);Re.default=gi;Object.defineProperty(_,"__esModule",{value:!0});_.MSI1110=_.MSI1010=_.MSI11=_.MSI10=_.MSI=void 0;var Oi=m,Ei=C(Oi),bi=$e,mi=C(bi),wi=Se,$i=C(wi),Si=xe,xi=C(Si),Ri=Re,Ai=C(Ri);function C(t){return t&&t.__esModule?t:{default:t}}_.MSI=Ei.default;_.MSI10=mi.default;_.MSI11=$i.default;_.MSI1010=xi.default;_.MSI1110=Ai.default;var Q={};Object.defineProperty(Q,"__esModule",{value:!0});Q.pharmacode=void 0;var Pi=function(){function t(e,r){for(var n=0;n<r.length;n++){var a=r[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}(),Ti=l,Mi=ki(Ti);function ki(t){return t&&t.__esModule?t:{default:t}}function Ii(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Di(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:t}function ji(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var Bi=function(t){ji(e,t);function e(r,n){Ii(this,e);var a=Di(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,r,n));return a.number=parseInt(r,10),a}return Pi(e,[{key:"encode",value:function(){for(var n=this.number,a="";!isNaN(n)&&n!=0;)n%2===0?(a="11100"+a,n=(n-2)/2):(a="100"+a,n=(n-1)/2);return a=a.slice(0,-2),{data:a,text:this.text}}},{key:"valid",value:function(){return this.number>=3&&this.number<=131070}}]),e}(Mi.default);Q.pharmacode=Bi;var W={};Object.defineProperty(W,"__esModule",{value:!0});W.codabar=void 0;var Li=function(){function t(e,r){for(var n=0;n<r.length;n++){var a=r[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}(),Ni=l,Ci=Gi(Ni);function Gi(t){return t&&t.__esModule?t:{default:t}}function Hi(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Fi(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:t}function Xi(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var zi=function(t){Xi(e,t);function e(r,n){Hi(this,e),r.search(/^[0-9\-\$\:\.\+\/]+$/)===0&&(r="A"+r+"A");var a=Fi(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,r.toUpperCase(),n));return a.text=a.options.text||a.text.replace(/[A-D]/g,""),a}return Li(e,[{key:"valid",value:function(){return this.data.search(/^[A-D][0-9\-\$\:\.\+\/]+[A-D]$/)!==-1}},{key:"encode",value:function(){for(var n=[],a=this.getEncodings(),i=0;i<this.data.length;i++)n.push(a[this.data.charAt(i)]),i!==this.data.length-1&&n.push("0");return{text:this.text,data:n.join("")}}},{key:"getEncodings",value:function(){return{0:"101010011",1:"101011001",2:"101001011",3:"110010101",4:"101101001",5:"110101001",6:"100101011",7:"100101101",8:"100110101",9:"110100101","-":"101001101",$:"101100101",":":"1101011011","/":"1101101011",".":"1101101101","+":"1011011011",A:"1011001001",B:"1001001011",C:"1010010011",D:"1010011001"}}}]),e}(Ci.default);W.codabar=zi;var Y={};Object.defineProperty(Y,"__esModule",{value:!0});Y.GenericBarcode=void 0;var Ui=function(){function t(e,r){for(var n=0;n<r.length;n++){var a=r[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}(),qi=l,Vi=Ji(qi);function Ji(t){return t&&t.__esModule?t:{default:t}}function Qi(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Wi(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:t}function Yi(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var Zi=function(t){Yi(e,t);function e(r,n){return Qi(this,e),Wi(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,r,n))}return Ui(e,[{key:"encode",value:function(){return{data:"10101010101010101010101010101010101010101",text:this.text}}},{key:"valid",value:function(){return!0}}]),e}(Vi.default);Y.GenericBarcode=Zi;Object.defineProperty(he,"__esModule",{value:!0});var Ki=U,X=s,R=c,Ze=A,j=_,eo=Q,to=W,no=Y;he.default={CODE39:Ki.CODE39,CODE128:X.CODE128,CODE128A:X.CODE128A,CODE128B:X.CODE128B,CODE128C:X.CODE128C,EAN13:R.EAN13,EAN8:R.EAN8,EAN5:R.EAN5,EAN2:R.EAN2,UPC:R.UPC,UPCE:R.UPCE,ITF14:Ze.ITF14,ITF:Ze.ITF,MSI:j.MSI,MSI10:j.MSI10,MSI11:j.MSI11,MSI1010:j.MSI1010,MSI1110:j.MSI1110,pharmacode:eo.pharmacode,codabar:to.codabar,GenericBarcode:no.GenericBarcode};var M={};Object.defineProperty(M,"__esModule",{value:!0});var ro=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t};M.default=function(t,e){return ro({},t,e)};var Ae={};Object.defineProperty(Ae,"__esModule",{value:!0});Ae.default=ao;function ao(t){var e=[];function r(n){if(Array.isArray(n))for(var a=0;a<n.length;a++)r(n[a]);else n.text=n.text||"",n.data=n.data||"",e.push(n)}return r(t),e}var Pe={};Object.defineProperty(Pe,"__esModule",{value:!0});Pe.default=io;function io(t){return t.marginTop=t.marginTop||t.margin,t.marginBottom=t.marginBottom||t.margin,t.marginRight=t.marginRight||t.margin,t.marginLeft=t.marginLeft||t.margin,t}var Te={},Me={},Z={};Object.defineProperty(Z,"__esModule",{value:!0});Z.default=oo;function oo(t){var e=["width","height","textMargin","fontSize","margin","marginTop","marginBottom","marginLeft","marginRight"];for(var r in e)e.hasOwnProperty(r)&&(r=e[r],typeof t[r]=="string"&&(t[r]=parseInt(t[r],10)));return typeof t.displayValue=="string"&&(t.displayValue=t.displayValue!="false"),t}var K={};Object.defineProperty(K,"__esModule",{value:!0});var uo={width:2,height:100,format:"auto",displayValue:!0,fontOptions:"",font:"monospace",text:void 0,textAlign:"center",textPosition:"bottom",textMargin:2,fontSize:20,background:"#ffffff",lineColor:"#000000",margin:10,marginTop:void 0,marginBottom:void 0,marginLeft:void 0,marginRight:void 0,valid:function(){}};K.default=uo;Object.defineProperty(Me,"__esModule",{value:!0});var fo=Z,co=gt(fo),lo=K,Ke=gt(lo);function gt(t){return t&&t.__esModule?t:{default:t}}function ho(t){var e={};for(var r in Ke.default)Ke.default.hasOwnProperty(r)&&(t.hasAttribute("jsbarcode-"+r.toLowerCase())&&(e[r]=t.getAttribute("jsbarcode-"+r.toLowerCase())),t.hasAttribute("data-"+r.toLowerCase())&&(e[r]=t.getAttribute("data-"+r.toLowerCase())));return e.value=t.getAttribute("jsbarcode-value")||t.getAttribute("data-value"),e=(0,co.default)(e),e}Me.default=ho;var ke={},Ie={},d={};Object.defineProperty(d,"__esModule",{value:!0});d.getTotalWidthOfEncodings=d.calculateEncodingAttributes=d.getBarcodePadding=d.getEncodingHeight=d.getMaximumHeightOfEncodings=void 0;var _o=M,vo=so(_o);function so(t){return t&&t.__esModule?t:{default:t}}function Ot(t,e){return e.height+(e.displayValue&&t.text.length>0?e.fontSize+e.textMargin:0)+e.marginTop+e.marginBottom}function Et(t,e,r){if(r.displayValue&&e<t){if(r.textAlign=="center")return Math.floor((t-e)/2);if(r.textAlign=="left")return 0;if(r.textAlign=="right")return Math.floor(t-e)}return 0}function yo(t,e,r){for(var n=0;n<t.length;n++){var a=t[n],i=(0,vo.default)(e,a.options),o;i.displayValue?o=Oo(a.text,i,r):o=0;var u=a.data.length*i.width;a.width=Math.ceil(Math.max(o,u)),a.height=Ot(a,i),a.barcodePadding=Et(o,u,i)}}function po(t){for(var e=0,r=0;r<t.length;r++)e+=t[r].width;return e}function go(t){for(var e=0,r=0;r<t.length;r++)t[r].height>e&&(e=t[r].height);return e}function Oo(t,e,r){var n;if(r)n=r;else if(typeof document!="undefined")n=document.createElement("canvas").getContext("2d");else return 0;n.font=e.fontOptions+" "+e.fontSize+"px "+e.font;var a=n.measureText(t);if(!a)return 0;var i=a.width;return i}d.getMaximumHeightOfEncodings=go;d.getEncodingHeight=Ot;d.getBarcodePadding=Et;d.calculateEncodingAttributes=yo;d.getTotalWidthOfEncodings=po;Object.defineProperty(Ie,"__esModule",{value:!0});var Eo=function(){function t(e,r){for(var n=0;n<r.length;n++){var a=r[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}(),bo=M,mo=wo(bo),oe=d;function wo(t){return t&&t.__esModule?t:{default:t}}function $o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var So=function(){function t(e,r,n){$o(this,t),this.canvas=e,this.encodings=r,this.options=n}return Eo(t,[{key:"render",value:function(){if(!this.canvas.getContext)throw new Error("The browser does not support canvas.");this.prepareCanvas();for(var r=0;r<this.encodings.length;r++){var n=(0,mo.default)(this.options,this.encodings[r].options);this.drawCanvasBarcode(n,this.encodings[r]),this.drawCanvasText(n,this.encodings[r]),this.moveCanvasDrawing(this.encodings[r])}this.restoreCanvas()}},{key:"prepareCanvas",value:function(){var r=this.canvas.getContext("2d");r.save(),(0,oe.calculateEncodingAttributes)(this.encodings,this.options,r);var n=(0,oe.getTotalWidthOfEncodings)(this.encodings),a=(0,oe.getMaximumHeightOfEncodings)(this.encodings);this.canvas.width=n+this.options.marginLeft+this.options.marginRight,this.canvas.height=a,r.clearRect(0,0,this.canvas.width,this.canvas.height),this.options.background&&(r.fillStyle=this.options.background,r.fillRect(0,0,this.canvas.width,this.canvas.height)),r.translate(this.options.marginLeft,0)}},{key:"drawCanvasBarcode",value:function(r,n){var a=this.canvas.getContext("2d"),i=n.data,o;r.textPosition=="top"?o=r.marginTop+r.fontSize+r.textMargin:o=r.marginTop,a.fillStyle=r.lineColor;for(var u=0;u<i.length;u++){var y=u*r.width+n.barcodePadding;i[u]==="1"?a.fillRect(y,o,r.width,r.height):i[u]&&a.fillRect(y,o,r.width,r.height*i[u])}}},{key:"drawCanvasText",value:function(r,n){var a=this.canvas.getContext("2d"),i=r.fontOptions+" "+r.fontSize+"px "+r.font;if(r.displayValue){var o,u;r.textPosition=="top"?u=r.marginTop+r.fontSize-r.textMargin:u=r.height+r.textMargin+r.marginTop+r.fontSize,a.font=i,r.textAlign=="left"||n.barcodePadding>0?(o=0,a.textAlign="left"):r.textAlign=="right"?(o=n.width-1,a.textAlign="right"):(o=n.width/2,a.textAlign="center"),a.fillText(n.text,o,u)}}},{key:"moveCanvasDrawing",value:function(r){var n=this.canvas.getContext("2d");n.translate(r.width,0)}},{key:"restoreCanvas",value:function(){var r=this.canvas.getContext("2d");r.restore()}}]),t}();Ie.default=So;var De={};Object.defineProperty(De,"__esModule",{value:!0});var xo=function(){function t(e,r){for(var n=0;n<r.length;n++){var a=r[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}(),Ro=M,Ao=Po(Ro),ue=d;function Po(t){return t&&t.__esModule?t:{default:t}}function To(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var z="http://www.w3.org/2000/svg",Mo=function(){function t(e,r,n){To(this,t),this.svg=e,this.encodings=r,this.options=n,this.document=n.xmlDocument||document}return xo(t,[{key:"render",value:function(){var r=this.options.marginLeft;this.prepareSVG();for(var n=0;n<this.encodings.length;n++){var a=this.encodings[n],i=(0,Ao.default)(this.options,a.options),o=this.createGroup(r,i.marginTop,this.svg);this.setGroupOptions(o,i),this.drawSvgBarcode(o,i,a),this.drawSVGText(o,i,a),r+=a.width}}},{key:"prepareSVG",value:function(){for(;this.svg.firstChild;)this.svg.removeChild(this.svg.firstChild);(0,ue.calculateEncodingAttributes)(this.encodings,this.options);var r=(0,ue.getTotalWidthOfEncodings)(this.encodings),n=(0,ue.getMaximumHeightOfEncodings)(this.encodings),a=r+this.options.marginLeft+this.options.marginRight;this.setSvgAttributes(a,n),this.options.background&&this.drawRect(0,0,a,n,this.svg).setAttribute("style","fill:"+this.options.background+";")}},{key:"drawSvgBarcode",value:function(r,n,a){var i=a.data,o;n.textPosition=="top"?o=n.fontSize+n.textMargin:o=0;for(var u=0,y=0,$=0;$<i.length;$++)y=$*n.width+a.barcodePadding,i[$]==="1"?u++:u>0&&(this.drawRect(y-n.width*u,o,n.width*u,n.height,r),u=0);u>0&&this.drawRect(y-n.width*(u-1),o,n.width*u,n.height,r)}},{key:"drawSVGText",value:function(r,n,a){var i=this.document.createElementNS(z,"text");if(n.displayValue){var o,u;i.setAttribute("style","font:"+n.fontOptions+" "+n.fontSize+"px "+n.font),n.textPosition=="top"?u=n.fontSize-n.textMargin:u=n.height+n.textMargin+n.fontSize,n.textAlign=="left"||a.barcodePadding>0?(o=0,i.setAttribute("text-anchor","start")):n.textAlign=="right"?(o=a.width-1,i.setAttribute("text-anchor","end")):(o=a.width/2,i.setAttribute("text-anchor","middle")),i.setAttribute("x",o),i.setAttribute("y",u),i.appendChild(this.document.createTextNode(a.text)),r.appendChild(i)}}},{key:"setSvgAttributes",value:function(r,n){var a=this.svg;a.setAttribute("width",r+"px"),a.setAttribute("height",n+"px"),a.setAttribute("x","0px"),a.setAttribute("y","0px"),a.setAttribute("viewBox","0 0 "+r+" "+n),a.setAttribute("xmlns",z),a.setAttribute("version","1.1"),a.setAttribute("style","transform: translate(0,0)")}},{key:"createGroup",value:function(r,n,a){var i=this.document.createElementNS(z,"g");return i.setAttribute("transform","translate("+r+", "+n+")"),a.appendChild(i),i}},{key:"setGroupOptions",value:function(r,n){r.setAttribute("style","fill:"+n.lineColor+";")}},{key:"drawRect",value:function(r,n,a,i,o){var u=this.document.createElementNS(z,"rect");return u.setAttribute("x",r),u.setAttribute("y",n),u.setAttribute("width",a),u.setAttribute("height",i),o.appendChild(u),u}}]),t}();De.default=Mo;var je={};Object.defineProperty(je,"__esModule",{value:!0});var ko=function(){function t(e,r){for(var n=0;n<r.length;n++){var a=r[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}();function Io(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var Do=function(){function t(e,r,n){Io(this,t),this.object=e,this.encodings=r,this.options=n}return ko(t,[{key:"render",value:function(){this.object.encodings=this.encodings}}]),t}();je.default=Do;Object.defineProperty(ke,"__esModule",{value:!0});var jo=Ie,Bo=Be(jo),Lo=De,No=Be(Lo),Co=je,Go=Be(Co);function Be(t){return t&&t.__esModule?t:{default:t}}ke.default={CanvasRenderer:Bo.default,SVGRenderer:No.default,ObjectRenderer:Go.default};var k={};Object.defineProperty(k,"__esModule",{value:!0});function Le(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Ne(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:t}function Ce(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var Ho=function(t){Ce(e,t);function e(r,n){Le(this,e);var a=Ne(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return a.name="InvalidInputException",a.symbology=r,a.input=n,a.message='"'+a.input+'" is not a valid input for '+a.symbology,a}return e}(Error),Fo=function(t){Ce(e,t);function e(){Le(this,e);var r=Ne(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return r.name="InvalidElementException",r.message="Not supported type to render on",r}return e}(Error),Xo=function(t){Ce(e,t);function e(){Le(this,e);var r=Ne(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return r.name="NoElementException",r.message="No element to render on.",r}return e}(Error);k.InvalidInputException=Ho;k.InvalidElementException=Fo;k.NoElementException=Xo;Object.defineProperty(Te,"__esModule",{value:!0});var zo=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Uo=Me,ce=bt(Uo),qo=ke,B=bt(qo),Vo=k;function bt(t){return t&&t.__esModule?t:{default:t}}function Ge(t){if(typeof t=="string")return Jo(t);if(Array.isArray(t)){for(var e=[],r=0;r<t.length;r++)e.push(Ge(t[r]));return e}else{if(typeof HTMLCanvasElement!="undefined"&&t instanceof HTMLImageElement)return Qo(t);if(t&&t.nodeName&&t.nodeName.toLowerCase()==="svg"||typeof SVGElement!="undefined"&&t instanceof SVGElement)return{element:t,options:(0,ce.default)(t),renderer:B.default.SVGRenderer};if(typeof HTMLCanvasElement!="undefined"&&t instanceof HTMLCanvasElement)return{element:t,options:(0,ce.default)(t),renderer:B.default.CanvasRenderer};if(t&&t.getContext)return{element:t,renderer:B.default.CanvasRenderer};if(t&&(typeof t=="undefined"?"undefined":zo(t))==="object"&&!t.nodeName)return{element:t,renderer:B.default.ObjectRenderer};throw new Vo.InvalidElementException}}function Jo(t){var e=document.querySelectorAll(t);if(e.length!==0){for(var r=[],n=0;n<e.length;n++)r.push(Ge(e[n]));return r}}function Qo(t){var e=document.createElement("canvas");return{element:e,options:(0,ce.default)(t),renderer:B.default.CanvasRenderer,afterRender:function(){t.setAttribute("src",e.toDataURL())}}}Te.default=Ge;var He={};Object.defineProperty(He,"__esModule",{value:!0});var Wo=function(){function t(e,r){for(var n=0;n<r.length;n++){var a=r[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}();function Yo(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var Zo=function(){function t(e){Yo(this,t),this.api=e}return Wo(t,[{key:"handleCatch",value:function(r){if(r.name==="InvalidInputException")if(this.api._options.valid!==this.api._defaults.valid)this.api._options.valid(!1);else throw r.message;else throw r;this.api.render=function(){}}},{key:"wrapBarcodeCall",value:function(r){try{var n=r.apply(void 0,arguments);return this.api._options.valid(!0),n}catch(a){return this.handleCatch(a),this.api}}}]),t}();He.default=Zo;var Ko=he,E=O(Ko),eu=M,G=O(eu),tu=Ae,mt=O(tu),nu=Pe,et=O(nu),ru=Te,au=O(ru),iu=Z,ou=O(iu),uu=He,fu=O(uu),wt=k,cu=K,$t=O(cu);function O(t){return t&&t.__esModule?t:{default:t}}var p=function(){},ee=function(e,r,n){var a=new p;if(typeof e=="undefined")throw Error("No element to render on was provided.");return a._renderProperties=(0,au.default)(e),a._encodings=[],a._options=$t.default,a._errorHandler=new fu.default(a),typeof r!="undefined"&&(n=n||{},n.format||(n.format=xt()),a.options(n)[n.format](r,n).render()),a};ee.getModule=function(t){return E.default[t]};for(var tt in E.default)E.default.hasOwnProperty(tt)&&lu(E.default,tt);function lu(t,e){p.prototype[e]=p.prototype[e.toUpperCase()]=p.prototype[e.toLowerCase()]=function(r,n){var a=this;return a._errorHandler.wrapBarcodeCall(function(){n.text=typeof n.text=="undefined"?void 0:""+n.text;var i=(0,G.default)(a._options,n);i=(0,ou.default)(i);var o=t[e],u=St(r,o,i);return a._encodings.push(u),a})}}function St(t,e,r){t=""+t;var n=new e(t,r);if(!n.valid())throw new wt.InvalidInputException(n.constructor.name,t);var a=n.encode();a=(0,mt.default)(a);for(var i=0;i<a.length;i++)a[i].options=(0,G.default)(r,a[i].options);return a}function xt(){return E.default.CODE128?"CODE128":Object.keys(E.default)[0]}p.prototype.options=function(t){return this._options=(0,G.default)(this._options,t),this};p.prototype.blank=function(t){var e=new Array(t+1).join("0");return this._encodings.push({data:e}),this};p.prototype.init=function(){if(!!this._renderProperties){Array.isArray(this._renderProperties)||(this._renderProperties=[this._renderProperties]);var t;for(var e in this._renderProperties){t=this._renderProperties[e];var r=(0,G.default)(this._options,t.options);r.format=="auto"&&(r.format=xt()),this._errorHandler.wrapBarcodeCall(function(){var n=r.value,a=E.default[r.format.toUpperCase()],i=St(n,a,r);le(t,i,r)})}}};p.prototype.render=function(){if(!this._renderProperties)throw new wt.NoElementException;if(Array.isArray(this._renderProperties))for(var t=0;t<this._renderProperties.length;t++)le(this._renderProperties[t],this._encodings,this._options);else le(this._renderProperties,this._encodings,this._options);return this};p.prototype._defaults=$t.default;function le(t,e,r){e=(0,mt.default)(e);for(var n=0;n<e.length;n++)e[n].options=(0,G.default)(r,e[n].options),(0,et.default)(e[n].options);(0,et.default)(r);var a=t.renderer,i=new a(t.element,e,r);i.render(),t.afterRender&&t.afterRender()}typeof window!="undefined"&&(window.JsBarcode=ee);typeof jQuery!="undefined"&&(jQuery.fn.JsBarcode=function(t,e){var r=[];return jQuery(this).each(function(){r.push(this)}),ee(r,t,e)});var hu=ee,du=function(t){At(e,t);function e(r){var n=t.call(this,r)||this;return n.dom=te.createRef(),n}return e.prototype.componentDidUpdate=function(r){(this.props.value!==r.value||JSON.stringify(this.props.options)!==JSON.stringify(r.options))&&this.renderBarCode()},e.prototype.renderBarCode=function(){this.dom.current&&hu(this.dom.current,this.props.value,this.props.options)},e.prototype.componentDidMount=function(){this.renderBarCode()},e.prototype.render=function(){return te.createElement("img",{ref:this.dom})},e}(te.Component),vu=Pt(du);export{du as BarCode,vu as default};
|