import{g as At}from"./call-bind@1.0.7-Cpj98o6Y.js";var le={},U={},l={};Object.defineProperty(l,"__esModule",{value:!0});function Rt(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var Pt=function t(e,r){Rt(this,t),this.data=e,this.text=r.text||e,this.options=r};l.default=Pt;Object.defineProperty(U,"__esModule",{value:!0});U.CODE39=void 0;var Tt=function(){function t(e,r){for(var n=0;n=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),xt=u*a;return{result:$+o.result,checksum:xt+o.checksum}}}]),e}(Vt.default);P.default=Zt;var de={};Object.defineProperty(de,"__esModule",{value:!0});var g=f,ot=function(e){return e.match(new RegExp("^"+g.A_CHARS+"*"))[0].length},ut=function(e){return e.match(new RegExp("^"+g.B_CHARS+"*"))[0].length},ft=function(e){return e.match(new RegExp("^"+g.C_CHARS+"*"))[0]};function _e(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]+"Ì"+ct(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)+_e(t.substring(a.length),!e)}function ct(t){var e=ft(t),r=e.length;if(r===t.length)return t;t=t.substring(r);var n=ot(t)>=ut(t);return e+String.fromCharCode(n?206:205)+_e(t,n)}de.default=function(t){var e=void 0,r=ft(t).length;if(r>=2)e=g.C_START_CHAR+ct(t);else{var n=ot(t)>ut(t);e=(n?g.A_START_CHAR:g.B_START_CHAR)+_e(t,n)}return e.replace(/[\xCD\xCE]([^])[\xCD\xCE]/,function(a,i){return"Ë"+i})};Object.defineProperty(he,"__esModule",{value:!0});var Kt=P,en=lt(Kt),tn=de,nn=lt(tn);function lt(t){return t&&t.__esModule?t:{default:t}}function rn(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function re(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 an(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 on=function(t){an(e,t);function e(r,n){if(rn(this,e),/^[\x00-\x7F\xC8-\xD3]+$/.test(r))var a=re(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,(0,nn.default)(r),n));else var a=re(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,r,n));return re(a)}return e}(en.default);he.default=on;var ve={};Object.defineProperty(ve,"__esModule",{value:!0});var un=function(){function t(e,r){for(var n=0;nn.width*10?n.width*10:n.fontSize,a.guardHeight=n.height+a.fontSize/2+n.textMargin,a}return Fn(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,ze.default)(n,a)}},{key:"rightText",value:function(n,a){return this.text.substr(n,a)}},{key:"rightEncode",value:function(n,a){return(0,ze.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}(zn.default);V.default=Jn;Object.defineProperty(pe,"__esModule",{value:!0});var Qn=function(){function t(e,r){for(var n=0;nn.width*10?a.fontSize=n.width*10:a.fontSize=n.fontSize,a.guardHeight=n.height+a.fontSize/2+n.textMargin,a}return Ir(e,[{key:"valid",value:function(){return this.data.search(/^[0-9]{12}$/)!==-1&&this.data[11]==ue(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}(Br.default);function ue(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=Cr;var be={};Object.defineProperty(be,"__esModule",{value:!0});var Fr=function(){function t(e,r){for(var n=0;nn.width*10?a.fontSize=n.width*10:a.fontSize=n.fontSize,a.guardHeight=n.height+a.fontSize/2+n.textMargin,a}return Fr(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=Wr[parseInt(a)][parseInt(n)];return(0,Xr.default)(this.middleDigits,i)}}]),e}(Ur.default);function Ve(t,e){for(var r=parseInt(t[t.length-1]),n=Qr[r],a="",i=0,o=0;o=3&&this.number<=131070}}]),e}(Pi.default);Q.pharmacode=Di;var W={};Object.defineProperty(W,"__esModule",{value:!0});W.codabar=void 0;var ji=function(){function t(e,r){for(var n=0;n0?e.fontSize+e.textMargin:0)+e.marginTop+e.marginBottom}function Ot(t,e,r){if(r.displayValue&&ee&&(e=t[r].height);return e}function po(t,e,r){var n;if(r)n=r;else if(typeof document<"u")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=yo;d.getEncodingHeight=gt;d.getBarcodePadding=Ot;d.calculateEncodingAttributes=vo;d.getTotalWidthOfEncodings=so;Object.defineProperty(ke,"__esModule",{value:!0});var go=function(){function t(e,r){for(var n=0;n0?(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}();ke.default=mo;var Ie={};Object.defineProperty(Ie,"__esModule",{value:!0});var $o=function(){function t(e,r){for(var n=0;n0&&(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}();Ie.default=Po;var De={};Object.defineProperty(De,"__esModule",{value:!0});var To=function(){function t(e,r){for(var n=0;n"u"?"undefined":Ho(t))==="object"&&!t.nodeName)return{element:t,renderer:B.default.ObjectRenderer};throw new Uo.InvalidElementException}}function qo(t){var e=document.querySelectorAll(t);if(e.length!==0){for(var r=[],n=0;n"u")throw Error("No element to render on was provided.");return a._renderProperties=(0,nu.default)(e),a._encodings=[],a._options=mt.default,a._errorHandler=new ou.default(a),typeof r<"u"&&(n=n||{},n.format||(n.format=St()),a.options(n)[n.format](r,n).render()),a};ee.getModule=function(t){return E.default[t]};for(var et in E.default)E.default.hasOwnProperty(et)&&fu(E.default,et);function fu(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>"u"?void 0:""+n.text;var i=(0,C.default)(a._options,n);i=(0,au.default)(i);var o=t[e],u=$t(r,o,i);return a._encodings.push(u),a})}}function $t(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,bt.default)(a);for(var i=0;i