daShangDao_psiWebApp/dist/assets/print.31f754c1.js
97694731 1fa4f33695
Some checks failed
CI / build (18.x) (push) Failing after 37m26s
CI / build (20.x) (push) Failing after 15s
CI / deploy-preview (push) Has been skipped
CI / lint (push) Failing after 16m50s
CI / test (push) Successful in 40m41s
CI / security (push) Successful in 29m36s
多拍
2026-06-25 14:37:30 +08:00

4 lines
83 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

var Pe={},ce={},E={};Object.defineProperty(E,"__esModule",{value:!0});function en(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var tn=function t(e,n){en(this,t),this.data=e,this.text=n.text||e,this.options=n};E.default=tn;Object.defineProperty(ce,"__esModule",{value:!0});ce.CODE39=void 0;var nn=function(){function t(e,n){for(var r=0;r<n.length;r++){var o=n[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),rn=E,on=an(rn);function an(t){return t&&t.__esModule?t:{default:t}}function un(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function fn(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 cn(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 ln=function(t){cn(e,t);function e(n,r){return un(this,e),n=n.toUpperCase(),r.mod43&&(n+=hn(mn(n))),fn(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,n,r))}return nn(e,[{key:"encode",value:function(){for(var r=ye("*"),o=0;o<this.data.length;o++)r+=ye(this.data[o])+"0";return r+=ye("*"),{data:r,text:this.text}}},{key:"valid",value:function(){return this.data.search(/^[0-9A-Z\-\.\ \$\/\+\%]+$/)!==-1}}]),e}(on.default),wt=["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","-","."," ","$","/","+","%","*"],_n=[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 ye(t){return dn(Nt(t))}function dn(t){return _n[t].toString(2)}function hn(t){return wt[t]}function Nt(t){return wt.indexOf(t)}function mn(t){for(var e=0,n=0;n<t.length;n++)e+=Nt(t[n]);return e=e%43,e}ce.CODE39=ln;var w={},De={},Y={},d={};Object.defineProperty(d,"__esModule",{value:!0});var q;function pe(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var $t=d.SET_A=0,xt=d.SET_B=1,Pt=d.SET_C=2;d.SHIFT=98;var sn=d.START_A=103,vn=d.START_B=104,En=d.START_C=105;d.MODULO=103;d.STOP=106;d.FNC1=207;d.SET_BY_CODE=(q={},pe(q,sn,$t),pe(q,vn,xt),pe(q,En,Pt),q);d.SWAP={101:$t,100:xt,99:Pt};d.A_START_CHAR=String.fromCharCode(208);d.B_START_CHAR=String.fromCharCode(209);d.C_START_CHAR=String.fromCharCode(210);d.A_CHARS="[\0-_\xC8-\xCF]";d.B_CHARS="[ -\x7F\xC8-\xCF]";d.C_CHARS="(\xCF*[0-9]{2}\xCF*)";d.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(Y,"__esModule",{value:!0});var gn=function(){function t(e,n){for(var r=0;r<n.length;r++){var o=n[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),Tn=E,yn=pn(Tn),p=d;function pn(t){return t&&t.__esModule?t:{default:t}}function Sn(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function An(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 bn(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 In=function(t){bn(e,t);function e(n,r){Sn(this,e);var o=An(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,n.substring(1),r));return o.bytes=n.split("").map(function(i){return i.charCodeAt(0)}),o}return gn(e,[{key:"valid",value:function(){return/^[\x00-\x7F\xC8-\xD3]+$/.test(this.data)}},{key:"encode",value:function(){var r=this.bytes,o=r.shift()-105,i=p.SET_BY_CODE[o];if(i===void 0)throw new RangeError("The encoding does not start with a start character.");this.shouldEncodeAsEan128()===!0&&r.unshift(p.FNC1);var a=e.next(r,1,i);return{text:this.text===this.data?this.text.replace(/[^\x20-\x7E]/g,""):this.text,data:e.getBar(o)+a.result+e.getBar((a.checksum+o)%p.MODULO)+e.getBar(p.STOP)}}},{key:"shouldEncodeAsEan128",value:function(){var r=this.options.ean128||!1;return typeof r=="string"&&(r=r.toLowerCase()==="true"),r}}],[{key:"getBar",value:function(r){return p.BARS[r]?p.BARS[r].toString():""}},{key:"correctIndex",value:function(r,o){if(o===p.SET_A){var i=r.shift();return i<32?i+64:i-32}else return o===p.SET_B?r.shift()-32:(r.shift()-48)*10+r.shift()-48}},{key:"next",value:function(r,o,i){if(!r.length)return{result:"",checksum:0};var a=void 0,u=void 0;if(r[0]>=200){u=r.shift()-105;var s=p.SWAP[u];s!==void 0?a=e.next(r,o+1,s):((i===p.SET_A||i===p.SET_B)&&u===p.SHIFT&&(r[0]=i===p.SET_A?r[0]>95?r[0]-96:r[0]:r[0]<32?r[0]+96:r[0]),a=e.next(r,o+1,i))}else u=e.correctIndex(r,i),a=e.next(r,o+1,i);var _=e.getBar(u),g=u*o;return{result:_+a.result,checksum:g+a.checksum}}}]),e}(yn.default);Y.default=In;var Me={};Object.defineProperty(Me,"__esModule",{value:!0});var x=d,Dt=function(e){return e.match(new RegExp("^"+x.A_CHARS+"*"))[0].length},Mt=function(e){return e.match(new RegExp("^"+x.B_CHARS+"*"))[0].length},Ft=function(e){return e.match(new RegExp("^"+x.C_CHARS+"*"))[0]};function Fe(t,e){var n=e?x.A_CHARS:x.B_CHARS,r=t.match(new RegExp("^("+n+"+?)(([0-9]{2}){2,})([^0-9]|$)"));if(r)return r[1]+String.fromCharCode(204)+kt(t.substring(r[1].length));var o=t.match(new RegExp("^"+n+"+"))[0];return o.length===t.length?t:o+String.fromCharCode(e?205:206)+Fe(t.substring(o.length),!e)}function kt(t){var e=Ft(t),n=e.length;if(n===t.length)return t;t=t.substring(n);var r=Dt(t)>=Mt(t);return e+String.fromCharCode(r?206:205)+Fe(t,r)}Me.default=function(t){var e=void 0,n=Ft(t).length;if(n>=2)e=x.C_START_CHAR+kt(t);else{var r=Dt(t)>Mt(t);e=(r?x.A_START_CHAR:x.B_START_CHAR)+Fe(t,r)}return e.replace(/[\xCD\xCE]([^])[\xCD\xCE]/,function(o,i){return String.fromCharCode(203)+i})};Object.defineProperty(De,"__esModule",{value:!0});var Rn=Y,wn=Bt(Rn),Nn=Me,$n=Bt(Nn);function Bt(t){return t&&t.__esModule?t:{default:t}}function xn(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Se(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 Pn(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 Dn=function(t){Pn(e,t);function e(n,r){if(xn(this,e),/^[\x00-\x7F\xC8-\xD3]+$/.test(n))var o=Se(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,(0,$n.default)(n),r));else var o=Se(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,n,r));return Se(o)}return e}(wn.default);De.default=Dn;var ke={};Object.defineProperty(ke,"__esModule",{value:!0});var Mn=function(){function t(e,n){for(var r=0;r<n.length;r++){var o=n[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),Fn=Y,kn=Bn(Fn),ct=d;function Bn(t){return t&&t.__esModule?t:{default:t}}function Cn(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function On(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 Gn(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 jn=function(t){Gn(e,t);function e(n,r){return Cn(this,e),On(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,ct.A_START_CHAR+n,r))}return Mn(e,[{key:"valid",value:function(){return new RegExp("^"+ct.A_CHARS+"+$").test(this.data)}}]),e}(kn.default);ke.default=jn;var Be={};Object.defineProperty(Be,"__esModule",{value:!0});var zn=function(){function t(e,n){for(var r=0;r<n.length;r++){var o=n[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),Ln=Y,Yn=Xn(Ln),lt=d;function Xn(t){return t&&t.__esModule?t:{default:t}}function Hn(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 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 qn=function(t){Un(e,t);function e(n,r){return Hn(this,e),Vn(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,lt.B_START_CHAR+n,r))}return zn(e,[{key:"valid",value:function(){return new RegExp("^"+lt.B_CHARS+"+$").test(this.data)}}]),e}(Yn.default);Be.default=qn;var Ce={};Object.defineProperty(Ce,"__esModule",{value:!0});var Jn=function(){function t(e,n){for(var r=0;r<n.length;r++){var o=n[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),Wn=Y,Zn=Qn(Wn),_t=d;function Qn(t){return t&&t.__esModule?t:{default:t}}function Kn(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function er(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 tr(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 nr=function(t){tr(e,t);function e(n,r){return Kn(this,e),er(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,_t.C_START_CHAR+n,r))}return Jn(e,[{key:"valid",value:function(){return new RegExp("^"+_t.C_CHARS+"+$").test(this.data)}}]),e}(Zn.default);Ce.default=nr;Object.defineProperty(w,"__esModule",{value:!0});w.CODE128C=w.CODE128B=w.CODE128A=w.CODE128=void 0;var rr=De,or=le(rr),ir=ke,ar=le(ir),ur=Be,fr=le(ur),cr=Ce,lr=le(cr);function le(t){return t&&t.__esModule?t:{default:t}}w.CODE128=or.default;w.CODE128A=ar.default;w.CODE128B=fr.default;w.CODE128C=lr.default;var T={},Oe={},I={};Object.defineProperty(I,"__esModule",{value:!0});I.SIDE_BIN="101";I.MIDDLE_BIN="01010";I.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"]};I.EAN2_STRUCTURE=["LL","LG","GL","GG"];I.EAN5_STRUCTURE=["GGLLL","GLGLL","GLLGL","GLLLG","LGGLL","LLGGL","LLLGG","LGLGL","LGLLG","LLGLG"];I.EAN13_STRUCTURE=["LLLLLL","LLGLGG","LLGGLG","LLGGGL","LGLLGG","LGGLLG","LGGGLL","LGLGLG","LGLGGL","LGGLGL"];var _e={},k={};Object.defineProperty(k,"__esModule",{value:!0});var _r=I,dr=function(e,n,r){var o=e.split("").map(function(a,u){return _r.BINARIES[n[u]]}).map(function(a,u){return a?a[e[u]]:""});if(r){var i=e.length-1;o=o.map(function(a,u){return u<i?a+r:a})}return o.join("")};k.default=dr;Object.defineProperty(_e,"__esModule",{value:!0});var hr=function(){function t(e,n){for(var r=0;r<n.length;r++){var o=n[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),O=I,mr=k,dt=Ct(mr),sr=E,vr=Ct(sr);function Ct(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 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 Tr(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=function(t){Tr(e,t);function e(n,r){Er(this,e);var o=gr(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,n,r));return o.fontSize=!r.flat&&r.fontSize>r.width*10?r.width*10:r.fontSize,o.guardHeight=r.height+o.fontSize/2+r.textMargin,o}return hr(e,[{key:"encode",value:function(){return this.options.flat?this.encodeFlat():this.encodeGuarded()}},{key:"leftText",value:function(r,o){return this.text.substr(r,o)}},{key:"leftEncode",value:function(r,o){return(0,dt.default)(r,o)}},{key:"rightText",value:function(r,o){return this.text.substr(r,o)}},{key:"rightEncode",value:function(r,o){return(0,dt.default)(r,o)}},{key:"encodeGuarded",value:function(){var r={fontSize:this.fontSize},o={height:this.guardHeight};return[{data:O.SIDE_BIN,options:o},{data:this.leftEncode(),text:this.leftText(),options:r},{data:O.MIDDLE_BIN,options:o},{data:this.rightEncode(),text:this.rightText(),options:r},{data:O.SIDE_BIN,options:o}]}},{key:"encodeFlat",value:function(){var r=[O.SIDE_BIN,this.leftEncode(),O.MIDDLE_BIN,this.rightEncode(),O.SIDE_BIN];return{data:r.join(""),text:this.text}}}]),e}(vr.default);_e.default=yr;Object.defineProperty(Oe,"__esModule",{value:!0});var pr=function(){function t(e,n){for(var r=0;r<n.length;r++){var o=n[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),J=function t(e,n,r){e===null&&(e=Function.prototype);var o=Object.getOwnPropertyDescriptor(e,n);if(o===void 0){var i=Object.getPrototypeOf(e);return i===null?void 0:t(i,n,r)}else{if("value"in o)return o.value;var a=o.get;return a===void 0?void 0:a.call(r)}},Sr=I,Ar=_e,br=Ir(Ar);function Ir(t){return t&&t.__esModule?t:{default:t}}function Rr(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function wr(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 Nr(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 ht=function(e){var n=e.substr(0,12).split("").map(function(r){return+r}).reduce(function(r,o,i){return i%2?r+o*3:r+o},0);return(10-n%10)%10},$r=function(t){Nr(e,t);function e(n,r){Rr(this,e),n.search(/^[0-9]{12}$/)!==-1&&(n+=ht(n));var o=wr(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,n,r));return o.lastChar=r.lastChar,o}return pr(e,[{key:"valid",value:function(){return this.data.search(/^[0-9]{13}$/)!==-1&&+this.data[12]===ht(this.data)}},{key:"leftText",value:function(){return J(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"leftText",this).call(this,1,6)}},{key:"leftEncode",value:function(){var r=this.data.substr(1,6),o=Sr.EAN13_STRUCTURE[this.data[0]];return J(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"leftEncode",this).call(this,r,o)}},{key:"rightText",value:function(){return J(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"rightText",this).call(this,7,6)}},{key:"rightEncode",value:function(){var r=this.data.substr(7,6);return J(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"rightEncode",this).call(this,r,"RRRRRR")}},{key:"encodeGuarded",value:function(){var r=J(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"encodeGuarded",this).call(this);return this.options.displayValue&&(r.unshift({data:"000000000000",text:this.text.substr(0,1),options:{textAlign:"left",fontSize:this.fontSize}}),this.options.lastChar&&(r.push({data:"00"}),r.push({data:"00000",text:this.options.lastChar,options:{fontSize:this.fontSize}}))),r}}]),e}(br.default);Oe.default=$r;var Ge={};Object.defineProperty(Ge,"__esModule",{value:!0});var xr=function(){function t(e,n){for(var r=0;r<n.length;r++){var o=n[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),re=function t(e,n,r){e===null&&(e=Function.prototype);var o=Object.getOwnPropertyDescriptor(e,n);if(o===void 0){var i=Object.getPrototypeOf(e);return i===null?void 0:t(i,n,r)}else{if("value"in o)return o.value;var a=o.get;return a===void 0?void 0:a.call(r)}},Pr=_e,Dr=Mr(Pr);function Mr(t){return t&&t.__esModule?t:{default:t}}function Fr(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 Br(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 mt=function(e){var n=e.substr(0,7).split("").map(function(r){return+r}).reduce(function(r,o,i){return i%2?r+o:r+o*3},0);return(10-n%10)%10},Cr=function(t){Br(e,t);function e(n,r){return Fr(this,e),n.search(/^[0-9]{7}$/)!==-1&&(n+=mt(n)),kr(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,n,r))}return xr(e,[{key:"valid",value:function(){return this.data.search(/^[0-9]{8}$/)!==-1&&+this.data[7]===mt(this.data)}},{key:"leftText",value:function(){return re(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"leftText",this).call(this,0,4)}},{key:"leftEncode",value:function(){var r=this.data.substr(0,4);return re(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"leftEncode",this).call(this,r,"LLLL")}},{key:"rightText",value:function(){return re(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"rightText",this).call(this,4,4)}},{key:"rightEncode",value:function(){var r=this.data.substr(4,4);return re(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"rightEncode",this).call(this,r,"RRRR")}}]),e}(Dr.default);Ge.default=Cr;var je={};Object.defineProperty(je,"__esModule",{value:!0});var Or=function(){function t(e,n){for(var r=0;r<n.length;r++){var o=n[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),Gr=I,jr=k,zr=Ot(jr),Lr=E,Yr=Ot(Lr);function Ot(t){return t&&t.__esModule?t:{default:t}}function Xr(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 Vr(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 Ur=function(e){var n=e.split("").map(function(r){return+r}).reduce(function(r,o,i){return i%2?r+o*9:r+o*3},0);return n%10},qr=function(t){Vr(e,t);function e(n,r){return Xr(this,e),Hr(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,n,r))}return Or(e,[{key:"valid",value:function(){return this.data.search(/^[0-9]{5}$/)!==-1}},{key:"encode",value:function(){var r=Gr.EAN5_STRUCTURE[Ur(this.data)];return{data:"1011"+(0,zr.default)(this.data,r,"01"),text:this.text}}}]),e}(Yr.default);je.default=qr;var ze={};Object.defineProperty(ze,"__esModule",{value:!0});var Jr=function(){function t(e,n){for(var r=0;r<n.length;r++){var o=n[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),Wr=I,Zr=k,Qr=Gt(Zr),Kr=E,eo=Gt(Kr);function Gt(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")}function no(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 ro(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 oo=function(t){ro(e,t);function e(n,r){return to(this,e),no(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,n,r))}return Jr(e,[{key:"valid",value:function(){return this.data.search(/^[0-9]{2}$/)!==-1}},{key:"encode",value:function(){var r=Wr.EAN2_STRUCTURE[parseInt(this.data)%4];return{data:"1011"+(0,Qr.default)(this.data,r,"01"),text:this.text}}}]),e}(eo.default);ze.default=oo;var Q={};Object.defineProperty(Q,"__esModule",{value:!0});var io=function(){function t(e,n){for(var r=0;r<n.length;r++){var o=n[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}();Q.checksum=Ne;var ao=k,G=jt(ao),uo=E,fo=jt(uo);function jt(t){return t&&t.__esModule?t:{default:t}}function co(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function lo(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 _o(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){_o(e,t);function e(n,r){co(this,e),n.search(/^[0-9]{11}$/)!==-1&&(n+=Ne(n));var o=lo(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,n,r));return o.displayValue=r.displayValue,r.fontSize>r.width*10?o.fontSize=r.width*10:o.fontSize=r.fontSize,o.guardHeight=r.height+o.fontSize/2+r.textMargin,o}return io(e,[{key:"valid",value:function(){return this.data.search(/^[0-9]{12}$/)!==-1&&this.data[11]==Ne(this.data)}},{key:"encode",value:function(){return this.options.flat?this.flatEncoding():this.guardedEncoding()}},{key:"flatEncoding",value:function(){var r="";return r+="101",r+=(0,G.default)(this.data.substr(0,6),"LLLLLL"),r+="01010",r+=(0,G.default)(this.data.substr(6,6),"RRRRRR"),r+="101",{data:r,text:this.text}}},{key:"guardedEncoding",value:function(){var r=[];return this.displayValue&&r.push({data:"00000000",text:this.text.substr(0,1),options:{textAlign:"left",fontSize:this.fontSize}}),r.push({data:"101"+(0,G.default)(this.data[0],"L"),options:{height:this.guardHeight}}),r.push({data:(0,G.default)(this.data.substr(1,5),"LLLLL"),text:this.text.substr(1,5),options:{fontSize:this.fontSize}}),r.push({data:"01010",options:{height:this.guardHeight}}),r.push({data:(0,G.default)(this.data.substr(6,5),"RRRRR"),text:this.text.substr(6,5),options:{fontSize:this.fontSize}}),r.push({data:(0,G.default)(this.data[11],"R")+"101",options:{height:this.guardHeight}}),this.displayValue&&r.push({data:"00000000",text:this.text.substr(11,1),options:{textAlign:"right",fontSize:this.fontSize}}),r}}]),e}(fo.default);function Ne(t){var e=0,n;for(n=1;n<11;n+=2)e+=parseInt(t[n]);for(n=0;n<11;n+=2)e+=parseInt(t[n])*3;return(10-e%10)%10}Q.default=ho;var Le={};Object.defineProperty(Le,"__esModule",{value:!0});var mo=function(){function t(e,n){for(var r=0;r<n.length;r++){var o=n[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),so=k,vo=zt(so),Eo=E,go=zt(Eo),To=Q;function zt(t){return t&&t.__esModule?t:{default:t}}function yo(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 po(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 So=["XX00000XXX","XX10000XXX","XX20000XXX","XXX00000XX","XXXX00000X","XXXXX00005","XXXXX00006","XXXXX00007","XXXXX00008","XXXXX00009"],Ao=[["EEEOOO","OOOEEE"],["EEOEOO","OOEOEE"],["EEOOEO","OOEEOE"],["EEOOOE","OOEEEO"],["EOEEOO","OEOOEE"],["EOOEEO","OEEOOE"],["EOOOEE","OEEEOO"],["EOEOEO","OEOEOE"],["EOEOOE","OEOEEO"],["EOOEOE","OEEOEO"]],bo=function(t){po(e,t);function e(n,r){yo(this,e);var o=Ae(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,n,r));if(o.isValid=!1,n.search(/^[0-9]{6}$/)!==-1)o.middleDigits=n,o.upcA=st(n,"0"),o.text=r.text||""+o.upcA[0]+n+o.upcA[o.upcA.length-1],o.isValid=!0;else if(n.search(/^[01][0-9]{7}$/)!==-1)if(o.middleDigits=n.substring(1,n.length-1),o.upcA=st(o.middleDigits,n[0]),o.upcA[o.upcA.length-1]===n[n.length-1])o.isValid=!0;else return Ae(o);else return Ae(o);return o.displayValue=r.displayValue,r.fontSize>r.width*10?o.fontSize=r.width*10:o.fontSize=r.fontSize,o.guardHeight=r.height+o.fontSize/2+r.textMargin,o}return mo(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 r="";return r+="101",r+=this.encodeMiddleDigits(),r+="010101",{data:r,text:this.text}}},{key:"guardedEncoding",value:function(){var r=[];return this.displayValue&&r.push({data:"00000000",text:this.text[0],options:{textAlign:"left",fontSize:this.fontSize}}),r.push({data:"101",options:{height:this.guardHeight}}),r.push({data:this.encodeMiddleDigits(),text:this.text.substring(1,7),options:{fontSize:this.fontSize}}),r.push({data:"010101",options:{height:this.guardHeight}}),this.displayValue&&r.push({data:"00000000",text:this.text[7],options:{textAlign:"right",fontSize:this.fontSize}}),r}},{key:"encodeMiddleDigits",value:function(){var r=this.upcA[0],o=this.upcA[this.upcA.length-1],i=Ao[parseInt(o)][parseInt(r)];return(0,vo.default)(this.middleDigits,i)}}]),e}(go.default);function st(t,e){for(var n=parseInt(t[t.length-1]),r=So[n],o="",i=0,a=0;a<r.length;a++){var u=r[a];u==="X"?o+=t[i++]:o+=u}return o=""+e+o,""+o+(0,To.checksum)(o)}Le.default=bo;Object.defineProperty(T,"__esModule",{value:!0});T.UPCE=T.UPC=T.EAN2=T.EAN5=T.EAN8=T.EAN13=void 0;var Io=Oe,Ro=X(Io),wo=Ge,No=X(wo),$o=je,xo=X($o),Po=ze,Do=X(Po),Mo=Q,Fo=X(Mo),ko=Le,Bo=X(ko);function X(t){return t&&t.__esModule?t:{default:t}}T.EAN13=Ro.default;T.EAN8=No.default;T.EAN5=xo.default;T.EAN2=Do.default;T.UPC=Fo.default;T.UPCE=Bo.default;var z={},de={},K={};Object.defineProperty(K,"__esModule",{value:!0});K.START_BIN="1010";K.END_BIN="11101";K.BINARIES=["00110","10001","01001","11000","00101","10100","01100","00011","10010","01010"];Object.defineProperty(de,"__esModule",{value:!0});var Co=function(){function t(e,n){for(var r=0;r<n.length;r++){var o=n[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),oe=K,Oo=E,Go=jo(Oo);function jo(t){return t&&t.__esModule?t:{default:t}}function zo(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Lo(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 Yo(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 Xo=function(t){Yo(e,t);function e(){return zo(this,e),Lo(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return Co(e,[{key:"valid",value:function(){return this.data.search(/^([0-9]{2})+$/)!==-1}},{key:"encode",value:function(){var r=this,o=this.data.match(/.{2}/g).map(function(i){return r.encodePair(i)}).join("");return{data:oe.START_BIN+o+oe.END_BIN,text:this.text}}},{key:"encodePair",value:function(r){var o=oe.BINARIES[r[1]];return oe.BINARIES[r[0]].split("").map(function(i,a){return(i==="1"?"111":"1")+(o[a]==="1"?"000":"0")}).join("")}}]),e}(Go.default);de.default=Xo;var Ye={};Object.defineProperty(Ye,"__esModule",{value:!0});var Ho=function(){function t(e,n){for(var r=0;r<n.length;r++){var o=n[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),Vo=de,Uo=qo(Vo);function qo(t){return t&&t.__esModule?t:{default:t}}function Jo(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Wo(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 Zo(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 vt=function(e){var n=e.substr(0,13).split("").map(function(r){return parseInt(r,10)}).reduce(function(r,o,i){return r+o*(3-i%2*2)},0);return Math.ceil(n/10)*10-n},Qo=function(t){Zo(e,t);function e(n,r){return Jo(this,e),n.search(/^[0-9]{13}$/)!==-1&&(n+=vt(n)),Wo(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,n,r))}return Ho(e,[{key:"valid",value:function(){return this.data.search(/^[0-9]{14}$/)!==-1&&+this.data[13]===vt(this.data)}}]),e}(Uo.default);Ye.default=Qo;Object.defineProperty(z,"__esModule",{value:!0});z.ITF14=z.ITF=void 0;var Ko=de,ei=Lt(Ko),ti=Ye,ni=Lt(ti);function Lt(t){return t&&t.__esModule?t:{default:t}}z.ITF=ei.default;z.ITF14=ni.default;var b={},B={};Object.defineProperty(B,"__esModule",{value:!0});var ri=function(){function t(e,n){for(var r=0;r<n.length;r++){var o=n[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),oi=E,ii=ai(oi);function ai(t){return t&&t.__esModule?t:{default:t}}function ui(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 ci(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 li=function(t){ci(e,t);function e(n,r){return ui(this,e),fi(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,n,r))}return ri(e,[{key:"encode",value:function(){for(var r="110",o=0;o<this.data.length;o++){var i=parseInt(this.data[o]),a=i.toString(2);a=_i(a,4-a.length);for(var u=0;u<a.length;u++)r+=a[u]=="0"?"100":"110"}return r+="1001",{data:r,text:this.text}}},{key:"valid",value:function(){return this.data.search(/^[0-9]+$/)!==-1}}]),e}(ii.default);function _i(t,e){for(var n=0;n<e;n++)t="0"+t;return t}B.default=li;var Xe={},C={};Object.defineProperty(C,"__esModule",{value:!0});C.mod10=di;C.mod11=hi;function di(t){for(var e=0,n=0;n<t.length;n++){var r=parseInt(t[n]);(n+t.length)%2===0?e+=r:e+=r*2%10+Math.floor(r*2/10)}return(10-e%10)%10}function hi(t){for(var e=0,n=[2,3,4,5,6,7],r=0;r<t.length;r++){var o=parseInt(t[t.length-1-r]);e+=n[r%n.length]*o}return(11-e%11)%11}Object.defineProperty(Xe,"__esModule",{value:!0});var mi=B,si=Ei(mi),vi=C;function Ei(t){return t&&t.__esModule?t:{default:t}}function gi(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Ti(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 pi=function(t){yi(e,t);function e(n,r){return gi(this,e),Ti(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,n+(0,vi.mod10)(n),r))}return e}(si.default);Xe.default=pi;var He={};Object.defineProperty(He,"__esModule",{value:!0});var Si=B,Ai=Ii(Si),bi=C;function Ii(t){return t&&t.__esModule?t:{default:t}}function Ri(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 Ni(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 $i=function(t){Ni(e,t);function e(n,r){return Ri(this,e),wi(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,n+(0,bi.mod11)(n),r))}return e}(Ai.default);He.default=$i;var Ve={};Object.defineProperty(Ve,"__esModule",{value:!0});var xi=B,Pi=Di(xi),Et=C;function Di(t){return t&&t.__esModule?t:{default:t}}function Mi(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 ki(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){ki(e,t);function e(n,r){return Mi(this,e),n+=(0,Et.mod10)(n),n+=(0,Et.mod10)(n),Fi(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,n,r))}return e}(Pi.default);Ve.default=Bi;var Ue={};Object.defineProperty(Ue,"__esModule",{value:!0});var Ci=B,Oi=Gi(Ci),gt=C;function Gi(t){return t&&t.__esModule?t:{default:t}}function ji(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function zi(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 Yi=function(t){Li(e,t);function e(n,r){return ji(this,e),n+=(0,gt.mod11)(n),n+=(0,gt.mod10)(n),zi(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,n,r))}return e}(Oi.default);Ue.default=Yi;Object.defineProperty(b,"__esModule",{value:!0});b.MSI1110=b.MSI1010=b.MSI11=b.MSI10=b.MSI=void 0;var Xi=B,Hi=ee(Xi),Vi=Xe,Ui=ee(Vi),qi=He,Ji=ee(qi),Wi=Ve,Zi=ee(Wi),Qi=Ue,Ki=ee(Qi);function ee(t){return t&&t.__esModule?t:{default:t}}b.MSI=Hi.default;b.MSI10=Ui.default;b.MSI11=Ji.default;b.MSI1010=Zi.default;b.MSI1110=Ki.default;var he={};Object.defineProperty(he,"__esModule",{value:!0});he.pharmacode=void 0;var ea=function(){function t(e,n){for(var r=0;r<n.length;r++){var o=n[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),ta=E,na=ra(ta);function ra(t){return t&&t.__esModule?t:{default:t}}function oa(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function ia(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 aa(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 ua=function(t){aa(e,t);function e(n,r){oa(this,e);var o=ia(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,n,r));return o.number=parseInt(n,10),o}return ea(e,[{key:"encode",value:function(){for(var r=this.number,o="";!isNaN(r)&&r!=0;)r%2===0?(o="11100"+o,r=(r-2)/2):(o="100"+o,r=(r-1)/2);return o=o.slice(0,-2),{data:o,text:this.text}}},{key:"valid",value:function(){return this.number>=3&&this.number<=131070}}]),e}(na.default);he.pharmacode=ua;var me={};Object.defineProperty(me,"__esModule",{value:!0});me.codabar=void 0;var fa=function(){function t(e,n){for(var r=0;r<n.length;r++){var o=n[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),ca=E,la=_a(ca);function _a(t){return t&&t.__esModule?t:{default:t}}function da(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function ha(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 ma(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 sa=function(t){ma(e,t);function e(n,r){da(this,e),n.search(/^[0-9\-\$\:\.\+\/]+$/)===0&&(n="A"+n+"A");var o=ha(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,n.toUpperCase(),r));return o.text=o.options.text||o.text.replace(/[A-D]/g,""),o}return fa(e,[{key:"valid",value:function(){return this.data.search(/^[A-D][0-9\-\$\:\.\+\/]+[A-D]$/)!==-1}},{key:"encode",value:function(){for(var r=[],o=this.getEncodings(),i=0;i<this.data.length;i++)r.push(o[this.data.charAt(i)]),i!==this.data.length-1&&r.push("0");return{text:this.text,data:r.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}(la.default);me.codabar=sa;var L={},se={},te={};Object.defineProperty(te,"__esModule",{value:!0});te.SYMBOLS=["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","-","."," ","$","/","+","%","($)","(%)","(/)","(+)","\xFF"];te.BINARIES=["100010100","101001000","101000100","101000010","100101000","100100100","100100010","101010000","100010010","100001010","110101000","110100100","110100010","110010100","110010010","110001010","101101000","101100100","101100010","100110100","100011010","101011000","101001100","101000110","100101100","100010110","110110100","110110010","110101100","110100110","110010110","110011010","101101100","101100110","100110110","100111010","100101110","111010100","111010010","111001010","101101110","101110110","110101110","100100110","111011010","111010110","100110010","101011110"];te.MULTI_SYMBOLS={"\0":["(%)","U"],"":["($)","A"],"":["($)","B"],"":["($)","C"],"":["($)","D"],"":["($)","E"],"":["($)","F"],"\x07":["($)","G"],"\b":["($)","H"]," ":["($)","I"],"\n":["($)","J"],"\v":["($)","K"],"\f":["($)","L"],"\r":["($)","M"],"":["($)","N"],"":["($)","O"],"":["($)","P"],"":["($)","Q"],"":["($)","R"],"":["($)","S"],"":["($)","T"],"":["($)","U"],"":["($)","V"],"":["($)","W"],"":["($)","X"],"":["($)","Y"],"":["($)","Z"],"\x1B":["(%)","A"],"":["(%)","B"],"":["(%)","C"],"":["(%)","D"],"":["(%)","E"],"!":["(/)","A"],'"':["(/)","B"],"#":["(/)","C"],"&":["(/)","F"],"'":["(/)","G"],"(":["(/)","H"],")":["(/)","I"],"*":["(/)","J"],",":["(/)","L"],":":["(/)","Z"],";":["(%)","F"],"<":["(%)","G"],"=":["(%)","H"],">":["(%)","I"],"?":["(%)","J"],"@":["(%)","V"],"[":["(%)","K"],"\\":["(%)","L"],"]":["(%)","M"],"^":["(%)","N"],_:["(%)","O"],"`":["(%)","W"],a:["(+)","A"],b:["(+)","B"],c:["(+)","C"],d:["(+)","D"],e:["(+)","E"],f:["(+)","F"],g:["(+)","G"],h:["(+)","H"],i:["(+)","I"],j:["(+)","J"],k:["(+)","K"],l:["(+)","L"],m:["(+)","M"],n:["(+)","N"],o:["(+)","O"],p:["(+)","P"],q:["(+)","Q"],r:["(+)","R"],s:["(+)","S"],t:["(+)","T"],u:["(+)","U"],v:["(+)","V"],w:["(+)","W"],x:["(+)","X"],y:["(+)","Y"],z:["(+)","Z"],"{":["(%)","P"],"|":["(%)","Q"],"}":["(%)","R"],"~":["(%)","S"],"\x7F":["(%)","T"]};Object.defineProperty(se,"__esModule",{value:!0});var va=function(){function t(e,n){for(var r=0;r<n.length;r++){var o=n[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),ie=te,Ea=E,ga=Ta(Ea);function Ta(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 Sa(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 Aa=function(t){Sa(e,t);function e(n,r){return ya(this,e),pa(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,n,r))}return va(e,[{key:"valid",value:function(){return/^[0-9A-Z\-. $/+%]+$/.test(this.data)}},{key:"encode",value:function(){var r=this.data.split("").flatMap(function(u){return ie.MULTI_SYMBOLS[u]||u}),o=r.map(function(u){return e.getEncoding(u)}).join(""),i=e.checksum(r,20),a=e.checksum(r.concat(i),15);return{text:this.text,data:e.getEncoding("\xFF")+o+e.getEncoding(i)+e.getEncoding(a)+e.getEncoding("\xFF")+"1"}}}],[{key:"getEncoding",value:function(r){return ie.BINARIES[e.symbolValue(r)]}},{key:"getSymbol",value:function(r){return ie.SYMBOLS[r]}},{key:"symbolValue",value:function(r){return ie.SYMBOLS.indexOf(r)}},{key:"checksum",value:function(r,o){var i=r.slice().reverse().reduce(function(a,u,s){var _=s%o+1;return a+e.symbolValue(u)*_},0);return e.getSymbol(i%47)}}]),e}(ga.default);se.default=Aa;var qe={};Object.defineProperty(qe,"__esModule",{value:!0});var ba=function(){function t(e,n){for(var r=0;r<n.length;r++){var o=n[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),Ia=se,Ra=wa(Ia);function wa(t){return t&&t.__esModule?t:{default:t}}function Na(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function $a(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 Pa=function(t){xa(e,t);function e(n,r){return Na(this,e),$a(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,n,r))}return ba(e,[{key:"valid",value:function(){return/^[\x00-\x7f]+$/.test(this.data)}}]),e}(Ra.default);qe.default=Pa;Object.defineProperty(L,"__esModule",{value:!0});L.CODE93FullASCII=L.CODE93=void 0;var Da=se,Ma=Yt(Da),Fa=qe,ka=Yt(Fa);function Yt(t){return t&&t.__esModule?t:{default:t}}L.CODE93=Ma.default;L.CODE93FullASCII=ka.default;var ve={};Object.defineProperty(ve,"__esModule",{value:!0});ve.GenericBarcode=void 0;var Ba=function(){function t(e,n){for(var r=0;r<n.length;r++){var o=n[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),Ca=E,Oa=Ga(Ca);function Ga(t){return t&&t.__esModule?t:{default:t}}function ja(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function za(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 La(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 Ya=function(t){La(e,t);function e(n,r){return ja(this,e),za(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,n,r))}return Ba(e,[{key:"encode",value:function(){return{data:"10101010101010101010101010101010101010101",text:this.text}}},{key:"valid",value:function(){return!0}}]),e}(Oa.default);ve.GenericBarcode=Ya;Object.defineProperty(Pe,"__esModule",{value:!0});var Xa=ce,ae=w,j=T,Tt=z,W=b,Ha=he,Va=me,yt=L,Ua=ve;Pe.default={CODE39:Xa.CODE39,CODE128:ae.CODE128,CODE128A:ae.CODE128A,CODE128B:ae.CODE128B,CODE128C:ae.CODE128C,EAN13:j.EAN13,EAN8:j.EAN8,EAN5:j.EAN5,EAN2:j.EAN2,UPC:j.UPC,UPCE:j.UPCE,ITF14:Tt.ITF14,ITF:Tt.ITF,MSI:W.MSI,MSI10:W.MSI10,MSI11:W.MSI11,MSI1010:W.MSI1010,MSI1110:W.MSI1110,pharmacode:Ha.pharmacode,codabar:Va.codabar,CODE93:yt.CODE93,CODE93FullASCII:yt.CODE93FullASCII,GenericBarcode:Ua.GenericBarcode};var H={};Object.defineProperty(H,"__esModule",{value:!0});var qa=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t};H.default=function(t,e){return qa({},t,e)};var Je={};Object.defineProperty(Je,"__esModule",{value:!0});Je.default=Ja;function Ja(t){var e=[];function n(r){if(Array.isArray(r))for(var o=0;o<r.length;o++)n(r[o]);else r.text=r.text||"",r.data=r.data||"",e.push(r)}return n(t),e}var We={};Object.defineProperty(We,"__esModule",{value:!0});We.default=Wa;function Wa(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 Ze={},Qe={},Ee={};Object.defineProperty(Ee,"__esModule",{value:!0});Ee.default=Za;function Za(t){var e=["width","height","textMargin","fontSize","margin","marginTop","marginBottom","marginLeft","marginRight"];for(var n in e)e.hasOwnProperty(n)&&(n=e[n],typeof t[n]=="string"&&(t[n]=parseInt(t[n],10)));return typeof t.displayValue=="string"&&(t.displayValue=t.displayValue!="false"),t}var ge={};Object.defineProperty(ge,"__esModule",{value:!0});var Qa={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(){}};ge.default=Qa;Object.defineProperty(Qe,"__esModule",{value:!0});var Ka=Ee,eu=Xt(Ka),tu=ge,pt=Xt(tu);function Xt(t){return t&&t.__esModule?t:{default:t}}function nu(t){var e={};for(var n in pt.default)pt.default.hasOwnProperty(n)&&(t.hasAttribute("jsbarcode-"+n.toLowerCase())&&(e[n]=t.getAttribute("jsbarcode-"+n.toLowerCase())),t.hasAttribute("data-"+n.toLowerCase())&&(e[n]=t.getAttribute("data-"+n.toLowerCase())));return e.value=t.getAttribute("jsbarcode-value")||t.getAttribute("data-value"),e=(0,eu.default)(e),e}Qe.default=nu;var Ke={},et={},S={};Object.defineProperty(S,"__esModule",{value:!0});S.getTotalWidthOfEncodings=S.calculateEncodingAttributes=S.getBarcodePadding=S.getEncodingHeight=S.getMaximumHeightOfEncodings=void 0;var ru=H,ou=iu(ru);function iu(t){return t&&t.__esModule?t:{default:t}}function Ht(t,e){return e.height+(e.displayValue&&t.text.length>0?e.fontSize+e.textMargin:0)+e.marginTop+e.marginBottom}function Vt(t,e,n){if(n.displayValue&&e<t){if(n.textAlign=="center")return Math.floor((t-e)/2);if(n.textAlign=="left")return 0;if(n.textAlign=="right")return Math.floor(t-e)}return 0}function au(t,e,n){for(var r=0;r<t.length;r++){var o=t[r],i=(0,ou.default)(e,o.options),a;i.displayValue?a=cu(o.text,i,n):a=0;var u=o.data.length*i.width;o.width=Math.ceil(Math.max(a,u)),o.height=Ht(o,i),o.barcodePadding=Vt(a,u,i)}}function uu(t){for(var e=0,n=0;n<t.length;n++)e+=t[n].width;return e}function fu(t){for(var e=0,n=0;n<t.length;n++)t[n].height>e&&(e=t[n].height);return e}function cu(t,e,n){var r;if(n)r=n;else if(typeof document!="undefined")r=document.createElement("canvas").getContext("2d");else return 0;r.font=e.fontOptions+" "+e.fontSize+"px "+e.font;var o=r.measureText(t);if(!o)return 0;var i=o.width;return i}S.getMaximumHeightOfEncodings=fu;S.getEncodingHeight=Ht;S.getBarcodePadding=Vt;S.calculateEncodingAttributes=au;S.getTotalWidthOfEncodings=uu;Object.defineProperty(et,"__esModule",{value:!0});var lu=function(){function t(e,n){for(var r=0;r<n.length;r++){var o=n[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),_u=H,du=hu(_u),be=S;function hu(t){return t&&t.__esModule?t:{default:t}}function mu(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var su=function(){function t(e,n,r){mu(this,t),this.canvas=e,this.encodings=n,this.options=r}return lu(t,[{key:"render",value:function(){if(!this.canvas.getContext)throw new Error("The browser does not support canvas.");this.prepareCanvas();for(var n=0;n<this.encodings.length;n++){var r=(0,du.default)(this.options,this.encodings[n].options);this.drawCanvasBarcode(r,this.encodings[n]),this.drawCanvasText(r,this.encodings[n]),this.moveCanvasDrawing(this.encodings[n])}this.restoreCanvas()}},{key:"prepareCanvas",value:function(){var n=this.canvas.getContext("2d");n.save(),(0,be.calculateEncodingAttributes)(this.encodings,this.options,n);var r=(0,be.getTotalWidthOfEncodings)(this.encodings),o=(0,be.getMaximumHeightOfEncodings)(this.encodings);this.canvas.width=r+this.options.marginLeft+this.options.marginRight,this.canvas.height=o,n.clearRect(0,0,this.canvas.width,this.canvas.height),this.options.background&&(n.fillStyle=this.options.background,n.fillRect(0,0,this.canvas.width,this.canvas.height)),n.translate(this.options.marginLeft,0)}},{key:"drawCanvasBarcode",value:function(n,r){var o=this.canvas.getContext("2d"),i=r.data,a;n.textPosition=="top"?a=n.marginTop+n.fontSize+n.textMargin:a=n.marginTop,o.fillStyle=n.lineColor;for(var u=0;u<i.length;u++){var s=u*n.width+r.barcodePadding;i[u]==="1"?o.fillRect(s,a,n.width,n.height):i[u]&&o.fillRect(s,a,n.width,n.height*i[u])}}},{key:"drawCanvasText",value:function(n,r){var o=this.canvas.getContext("2d"),i=n.fontOptions+" "+n.fontSize+"px "+n.font;if(n.displayValue){var a,u;n.textPosition=="top"?u=n.marginTop+n.fontSize-n.textMargin:u=n.height+n.textMargin+n.marginTop+n.fontSize,o.font=i,n.textAlign=="left"||r.barcodePadding>0?(a=0,o.textAlign="left"):n.textAlign=="right"?(a=r.width-1,o.textAlign="right"):(a=r.width/2,o.textAlign="center"),o.fillText(r.text,a,u)}}},{key:"moveCanvasDrawing",value:function(n){var r=this.canvas.getContext("2d");r.translate(n.width,0)}},{key:"restoreCanvas",value:function(){var n=this.canvas.getContext("2d");n.restore()}}]),t}();et.default=su;var tt={};Object.defineProperty(tt,"__esModule",{value:!0});var vu=function(){function t(e,n){for(var r=0;r<n.length;r++){var o=n[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),Eu=H,gu=Tu(Eu),Ie=S;function Tu(t){return t&&t.__esModule?t:{default:t}}function yu(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var ue="http://www.w3.org/2000/svg",pu=function(){function t(e,n,r){yu(this,t),this.svg=e,this.encodings=n,this.options=r,this.document=r.xmlDocument||document}return vu(t,[{key:"render",value:function(){var n=this.options.marginLeft;this.prepareSVG();for(var r=0;r<this.encodings.length;r++){var o=this.encodings[r],i=(0,gu.default)(this.options,o.options),a=this.createGroup(n,i.marginTop,this.svg);this.setGroupOptions(a,i),this.drawSvgBarcode(a,i,o),this.drawSVGText(a,i,o),n+=o.width}}},{key:"prepareSVG",value:function(){for(;this.svg.firstChild;)this.svg.removeChild(this.svg.firstChild);(0,Ie.calculateEncodingAttributes)(this.encodings,this.options);var n=(0,Ie.getTotalWidthOfEncodings)(this.encodings),r=(0,Ie.getMaximumHeightOfEncodings)(this.encodings),o=n+this.options.marginLeft+this.options.marginRight;this.setSvgAttributes(o,r),this.options.background&&this.drawRect(0,0,o,r,this.svg).setAttribute("fill",this.options.background)}},{key:"drawSvgBarcode",value:function(n,r,o){var i=o.data,a;r.textPosition=="top"?a=r.fontSize+r.textMargin:a=0;for(var u=0,s=0,_=0;_<i.length;_++)s=_*r.width+o.barcodePadding,i[_]==="1"?u++:u>0&&(this.drawRect(s-r.width*u,a,r.width*u,r.height,n),u=0);u>0&&this.drawRect(s-r.width*(u-1),a,r.width*u,r.height,n)}},{key:"drawSVGText",value:function(n,r,o){var i=this.document.createElementNS(ue,"text");if(r.displayValue){var a,u;i.setAttribute("font-family",r.font),i.setAttribute("font-size",r.fontSize),r.fontOptions.includes("bold")&&i.setAttribute("font-weight","bold"),r.fontOptions.includes("italic")&&i.setAttribute("font-style","italic"),r.textPosition=="top"?u=r.fontSize-r.textMargin:u=r.height+r.textMargin+r.fontSize,r.textAlign=="left"||o.barcodePadding>0?(a=0,i.setAttribute("text-anchor","start")):r.textAlign=="right"?(a=o.width-1,i.setAttribute("text-anchor","end")):(a=o.width/2,i.setAttribute("text-anchor","middle")),i.setAttribute("x",a),i.setAttribute("y",u),i.appendChild(this.document.createTextNode(o.text)),n.appendChild(i)}}},{key:"setSvgAttributes",value:function(n,r){var o=this.svg;o.setAttribute("width",n+"px"),o.setAttribute("height",r+"px"),o.setAttribute("x","0px"),o.setAttribute("y","0px"),o.setAttribute("viewBox","0 0 "+n+" "+r),o.setAttribute("xmlns",ue),o.setAttribute("version","1.1")}},{key:"createGroup",value:function(n,r,o){var i=this.document.createElementNS(ue,"g");return i.setAttribute("transform","translate("+n+", "+r+")"),o.appendChild(i),i}},{key:"setGroupOptions",value:function(n,r){n.setAttribute("fill",r.lineColor)}},{key:"drawRect",value:function(n,r,o,i,a){var u=this.document.createElementNS(ue,"rect");return u.setAttribute("x",n),u.setAttribute("y",r),u.setAttribute("width",o),u.setAttribute("height",i),a.appendChild(u),u}}]),t}();tt.default=pu;var nt={};Object.defineProperty(nt,"__esModule",{value:!0});var Su=function(){function t(e,n){for(var r=0;r<n.length;r++){var o=n[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}();function Au(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var bu=function(){function t(e,n,r){Au(this,t),this.object=e,this.encodings=n,this.options=r}return Su(t,[{key:"render",value:function(){this.object.encodings=this.encodings}}]),t}();nt.default=bu;Object.defineProperty(Ke,"__esModule",{value:!0});var Iu=et,Ru=rt(Iu),wu=tt,Nu=rt(wu),$u=nt,xu=rt($u);function rt(t){return t&&t.__esModule?t:{default:t}}Ke.default={CanvasRenderer:Ru.default,SVGRenderer:Nu.default,ObjectRenderer:xu.default};var V={};Object.defineProperty(V,"__esModule",{value:!0});function ot(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function it(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 at(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 Pu=function(t){at(e,t);function e(n,r){ot(this,e);var o=it(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return o.name="InvalidInputException",o.symbology=n,o.input=r,o.message='"'+o.input+'" is not a valid input for '+o.symbology,o}return e}(Error),Du=function(t){at(e,t);function e(){ot(this,e);var n=it(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return n.name="InvalidElementException",n.message="Not supported type to render on",n}return e}(Error),Mu=function(t){at(e,t);function e(){ot(this,e);var n=it(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return n.name="NoElementException",n.message="No element to render on.",n}return e}(Error);V.InvalidInputException=Pu;V.InvalidElementException=Du;V.NoElementException=Mu;Object.defineProperty(Ze,"__esModule",{value:!0});var Fu=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},ku=Qe,$e=Ut(ku),Bu=Ke,Z=Ut(Bu),Cu=V;function Ut(t){return t&&t.__esModule?t:{default:t}}function ut(t){if(typeof t=="string")return Ou(t);if(Array.isArray(t)){for(var e=[],n=0;n<t.length;n++)e.push(ut(t[n]));return e}else{if(typeof HTMLCanvasElement!="undefined"&&t instanceof HTMLImageElement)return Gu(t);if(t&&t.nodeName&&t.nodeName.toLowerCase()==="svg"||typeof SVGElement!="undefined"&&t instanceof SVGElement)return{element:t,options:(0,$e.default)(t),renderer:Z.default.SVGRenderer};if(typeof HTMLCanvasElement!="undefined"&&t instanceof HTMLCanvasElement)return{element:t,options:(0,$e.default)(t),renderer:Z.default.CanvasRenderer};if(t&&t.getContext)return{element:t,renderer:Z.default.CanvasRenderer};if(t&&(typeof t=="undefined"?"undefined":Fu(t))==="object"&&!t.nodeName)return{element:t,renderer:Z.default.ObjectRenderer};throw new Cu.InvalidElementException}}function Ou(t){var e=document.querySelectorAll(t);if(e.length!==0){for(var n=[],r=0;r<e.length;r++)n.push(ut(e[r]));return n}}function Gu(t){var e=document.createElement("canvas");return{element:e,options:(0,$e.default)(t),renderer:Z.default.CanvasRenderer,afterRender:function(){t.setAttribute("src",e.toDataURL())}}}Ze.default=ut;var ft={};Object.defineProperty(ft,"__esModule",{value:!0});var ju=function(){function t(e,n){for(var r=0;r<n.length;r++){var o=n[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}();function zu(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var Lu=function(){function t(e){zu(this,t),this.api=e}return ju(t,[{key:"handleCatch",value:function(n){if(n.name==="InvalidInputException")if(this.api._options.valid!==this.api._defaults.valid)this.api._options.valid(!1);else throw n.message;else throw n;this.api.render=function(){}}},{key:"wrapBarcodeCall",value:function(n){try{var r=n.apply(void 0,arguments);return this.api._options.valid(!0),r}catch(o){return this.handleCatch(o),this.api}}}]),t}();ft.default=Lu;var Yu=Pe,F=D(Yu),Xu=H,ne=D(Xu),Hu=Je,qt=D(Hu),Vu=We,St=D(Vu),Uu=Ze,qu=D(Uu),Ju=Ee,Wu=D(Ju),Zu=ft,Qu=D(Zu),Jt=V,Ku=ge,Wt=D(Ku);function D(t){return t&&t.__esModule?t:{default:t}}var N=function(){},Te=function(e,n,r){var o=new N;if(typeof e=="undefined")throw Error("No element to render on was provided.");return o._renderProperties=(0,qu.default)(e),o._encodings=[],o._options=Wt.default,o._errorHandler=new Qu.default(o),typeof n!="undefined"&&(r=r||{},r.format||(r.format=Qt()),o.options(r)[r.format](n,r).render()),o};Te.getModule=function(t){return F.default[t]};for(var At in F.default)F.default.hasOwnProperty(At)&&e0(F.default,At);function e0(t,e){N.prototype[e]=N.prototype[e.toUpperCase()]=N.prototype[e.toLowerCase()]=function(n,r){var o=this;return o._errorHandler.wrapBarcodeCall(function(){r.text=typeof r.text=="undefined"?void 0:""+r.text;var i=(0,ne.default)(o._options,r);i=(0,Wu.default)(i);var a=t[e],u=Zt(n,a,i);return o._encodings.push(u),o})}}function Zt(t,e,n){t=""+t;var r=new e(t,n);if(!r.valid())throw new Jt.InvalidInputException(r.constructor.name,t);var o=r.encode();o=(0,qt.default)(o);for(var i=0;i<o.length;i++)o[i].options=(0,ne.default)(n,o[i].options);return o}function Qt(){return F.default.CODE128?"CODE128":Object.keys(F.default)[0]}N.prototype.options=function(t){return this._options=(0,ne.default)(this._options,t),this};N.prototype.blank=function(t){var e=new Array(t+1).join("0");return this._encodings.push({data:e}),this};N.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 n=(0,ne.default)(this._options,t.options);n.format=="auto"&&(n.format=Qt()),this._errorHandler.wrapBarcodeCall(function(){var r=n.value,o=F.default[n.format.toUpperCase()],i=Zt(r,o,n);xe(t,i,n)})}}};N.prototype.render=function(){if(!this._renderProperties)throw new Jt.NoElementException;if(Array.isArray(this._renderProperties))for(var t=0;t<this._renderProperties.length;t++)xe(this._renderProperties[t],this._encodings,this._options);else xe(this._renderProperties,this._encodings,this._options);return this};N.prototype._defaults=Wt.default;function xe(t,e,n){e=(0,qt.default)(e);for(var r=0;r<e.length;r++)e[r].options=(0,ne.default)(n,e[r].options),(0,St.default)(e[r].options);(0,St.default)(n);var o=t.renderer,i=new o(t.element,e,n);i.render(),t.afterRender&&t.afterRender()}typeof window!="undefined"&&(window.JsBarcode=Te);typeof jQuery!="undefined"&&(jQuery.fn.JsBarcode=function(t,e){var n=[];return jQuery(this).each(function(){n.push(this)}),Te(n,t,e)});var P=Te;let A=null;function Re(t,e,n,r){var o=document.createElement("canvas");o.width=t,o.height=e;var i=o.getContext("2d");return i.fillStyle="#ffffff",i.fillRect(0,0,o.width,o.height),i.fillStyle="#FFFFFF",i.fillText("",n,r),o.toDataURL("image/png")}function fe(t,e=!1){const a=document.createElement("canvas"),u=document.createElement("canvas");if(P(u,t,{format:"CODE128",fontSize:15,margin:0,displayValue:!0,lineColor:"#000000",width:1,height:40}),a.width=u.width*2,a.height=40*2,a.getContext("2d").scale(2,2),P(a,t,{format:"CODE128",fontSize:15,margin:0,displayValue:!0,lineColor:"#000000",width:1,height:40}),!e)return a.toDataURL("image/png",1);const _=document.createElement("canvas");_.width=a.height,_.height=a.width;const g=_.getContext("2d");return g.translate(_.width/2,_.height/2),g.rotate(Math.PI/2),g.drawImage(a,-u.width/2,-40/2),_.toDataURL("image/png",1)}function we(t){const e=document.createElement("canvas");P(e,t,{format:"CODE128",fontSize:"15",margin:0,displayValue:!0,lineColor:"#000000",width:1.5,height:40});const n=document.createElement("canvas");n.width=e.width,n.height=40,P(n,t,{format:"CODE128",fontSize:"15",margin:0,displayValue:!0,lineColor:"#000000",width:1.5,height:40});const r=document.createElement("canvas");r.width=n.height,r.height=n.width;const o=r.getContext("2d");return o.translate(r.width/2,r.height/2),o.rotate(Math.PI/2),o.drawImage(n,-n.width/2,-n.height/2),r.toDataURL("image/png")}function bt(t){const i=document.createElement("canvas"),a=document.createElement("canvas");return P(a,t,{format:"CODE128",fontSize:22,margin:0,displayValue:!0,lineColor:"#000000",width:1,height:80}),i.width=a.width*2,i.height=80*2,i.getContext("2d").scale(2,2),P(i,t,{format:"CODE128",fontSize:22,margin:0,displayValue:!0,lineColor:"#000000",width:1,height:80}),i.toDataURL("image/png",1)}function t0(t){const e=document.createElement("canvas");P(e,t,{format:"CODE128",fontSize:"22",margin:0,displayValue:!0,lineColor:"#000000",width:1,height:1});const n=document.createElement("canvas");n.width=200,n.height=100,P(n,t,{format:"CODE128",fontSize:"22",margin:0,displayValue:!0,lineColor:"#000000",width:1,height:100});const r=document.createElement("canvas");r.width=n.height,r.height=n.width;const o=r.getContext("2d");return o.translate(r.width/2,r.height/2),o.rotate(Math.PI/2),o.drawImage(n,-n.width/2,-n.height/2),r.toDataURL("image/png")}function n0(t,e=96,n=3.5,r=2,o=80,i=5){const a='[{"value":"isGoodsName","checked":true,"sort":1},{"value":"isGoodsArtno","checked":false,"sort":2},{"value":"isGoodsIsbn","checked":false,"sort":3},{"value":"isGoodsNum","checked":false,"sort":4}]';let u=[];try{u=JSON.parse(a||"[]"),u=u.sort((l,y)=>l.sort-y.sort)}catch(l){console.error("\u89E3\u6790printTemplateData\u5931\u8D25\uFF1A",l),u=[]}function s(l,y=30){if(!l)return"-";let c=0,f="";for(let h=0;h<l.length;h++){const m=l.charAt(h),v=/[\u4e00-\u9fa5]/.test(m)?2:1;if(c+v>y)break;f+=m,c+=v}return f.length<l.length?`${f}`:f}const _={isGoodsIsbn:{label:"ISBN\uFF1A",getValue:l=>l.isbn||"-"},isGoodsName:{label:"\u5546\u54C1\u540D\u79F0\uFF1A",getValue:l=>s(l.name)+" \xD7"+l.num},isGoodsArtno:{label:"\u8D27\u53F7/\u539F\u8D27\u53F7\uFF1A",getValue:l=>`${(l.artNo||"").toString().slice(0,6)}/${l.originalArtNo||""}`},isGoodsNum:{label:"\u6570\u91CF\uFF1A",getValue:l=>l.num||0}},g=Array.isArray(JSON.parse(t.itemStr))?JSON.parse(t.itemStr):[];g.forEach(l=>{u.forEach(y=>{if(!y.checked)return;const c=_[y.value];if(!c)return;const f=`${c.label}${c.getValue(l)}`;A.ADD_PRINT_TEXT(`${e}mm`,`${r}mm`,`${o}mm`,`${i}mm`,f),A.SET_PRINT_STYLEA(0,"FontSize",9),A.SET_PRINT_STYLEA(0,"Bold",1),e+=n})});const M=t.waybillNo.slice(-4);g.length>1&&(A.ADD_PRINT_TEXT("118mm","0mm","55mm","10mm",M),A.SET_PRINT_STYLEA(0,"Bold",1),A.SET_PRINT_STYLEA(0,"Alignment",2),A.SET_PRINT_STYLEA(0,"FontSize",16))}const It={receipt:(t,e)=>{t.PRINT_INIT("\u9500\u552E\u5C0F\u7968"),t.SET_PRINT_PAGESIZE(1,"76mm","110mm",""),t.ADD_PRINT_TEXT("10mm","5mm","60mm","5mm","=== \u9500\u552E\u5C0F\u7968 ==="),t.SET_PRINT_STYLEA(0,"FontSize",12),e.items.forEach((n,r)=>{t.ADD_PRINT_TEXT(`${25+r*8}mm`,"5mm","60mm","5mm",`${n.name} x${n.qty} \uFFE5${n.price}`)})},yunda:(t,e)=>{t.PRINT_INIT("\u97F5\u8FBE\u5FEB\u9012\u5355");debugger;const n=e.mailno||e.mail_no;let r;if(n)r=n.slice(-4),t.SET_PRINT_PAGESIZE(3,"77mm","120mm",""),t.ADD_PRINT_PDF("-4mm","-1mm","10mm","10mm",e.pdf_info),t.ADD_PRINT_IMAGE("100.5mm","1.5mm","5mm","15mm",Re(210,60,0,0)),t.ADD_PRINT_IMAGE("21.5mm","1.5mm","5mm","15mm",Re(210,60,0,0)),t.ADD_PRINT_IMAGE("38mm","56mm","4mm","15mm",Re(75,225,0,0)),t.ADD_PRINT_IMAGE("22mm","4mm","40mm","15mm",fe(n,!1)),t.ADD_PRINT_IMAGE("40mm","56mm","0mm","0mm",we(n)),t.ADD_PRINT_RECT("10.6mm","0","76mm","118mm",0,1);else{t.SET_PRINT_PAGESIZE(3,"77mm","0mm",""),t.ADD_PRINT_PDF("0","0mm","10mm","10mm",e.pdfInfo);const c=e.receiver||{},f=e.sender||{};t.ADD_PRINT_TEXT("55mm","10mm","48mm","8mm",(c.name||"")+" "+(c.mobile||"")),t.SET_PRINT_STYLEA(0,"FontSize",10),t.ADD_PRINT_TEXT("60mm","10mm","48mm","8mm",c.address||""),t.SET_PRINT_STYLEA(0,"FontSize",9),t.ADD_PRINT_TEXT("71mm","10mm","48mm","8mm",(f.name||"")+" "+(f.mobile||"")),t.SET_PRINT_STYLEA(0,"FontSize",8),t.ADD_PRINT_TEXT("74mm","10mm","48mm","8mm",f.address||""),t.SET_PRINT_STYLEA(0,"FontSize",8)}const o='[{"value":"isGoodsName","checked":true,"sort":1},{"value":"isGoodsArtno","checked":false,"sort":2},{"value":"isGoodsIsbn","checked":false,"sort":3},{"value":"isGoodsNum","checked":false,"sort":4}]';let i=[];try{i=JSON.parse(o||"[]"),i=i.sort((c,f)=>c.sort-f.sort)}catch{i=[]}function a(c,f=30){if(!c)return"-";let h=0,m="";for(let v=0;v<c.length;v++){const R=c.charAt(v),$=/[\u4e00-\u9fa5]/.test(R)?2:1;if(h+$>f)break;m+=R,h+=$}return m.length<c.length?`${m}`:m}const u={isGoodsIsbn:{label:"ISBN\uFF1A",getValue:c=>c.isbn||"-"},isGoodsName:{label:"\u5546\u54C1\u540D\u79F0\uFF1A",getValue:c=>a(c.goodsName)+" \xD7"+c.goodsCount},isGoodsArtno:{label:"\u8D27\u53F7/\u539F\u8D27\u53F7\uFF1A",getValue:c=>`${(c.artNo||"").toString().slice(0,6)}/${c.originalArtNo||""}`},isGoodsNum:{label:"\u6570\u91CF\uFF1A",getValue:c=>c.goodsCount||0}};let s=100;const _=3.5,g=2,M=80,l=5;debugger;const y=Array.isArray(e.dataList)?e.dataList:[];y.forEach(c=>{i.forEach(f=>{if(!f.checked)return;const h=u[f.value];if(!h)return;const m=`${h.label}${h.getValue(c)}`;t.ADD_PRINT_TEXT(`${s}mm`,`${g}mm`,`${M}mm`,`${l}mm`,m),t.SET_PRINT_STYLEA(0,"FontSize",9),t.SET_PRINT_STYLEA(0,"Bold",1),s+=_})}),y.length>1&&(t.ADD_PRINT_TEXT("118mm","0mm","55mm","10mm",r),t.SET_PRINT_STYLEA(0,"Bold",1),t.SET_PRINT_STYLEA(0,"Alignment",2),t.SET_PRINT_STYLEA(0,"FontSize",16))},YZXB:(t,e)=>{e=Rt(e),t.PRINT_INIT("\u90AE\u653F\u5FEB\u9012"),t.SET_PRINT_PAGESIZE(3,"76mm","130mm",""),t.ADD_PRINT_RECT("28mm","0","76mm","93mm",0,1);const n=e.waybillNo.slice(-4);t.ADD_PRINT_TEXT("1mm","66mm","15mm","50mm","\u5FEB\u9012\u5305\u88F9"),t.SET_PRINT_STYLEA(0,"Bold",1),t.SET_PRINT_STYLEA(0,"FontSize",13),t.SET_PRINT_STYLEA(0,"LineSpacing",-5),t.ADD_PRINT_LINE("95mm","55mm","28mm","55mm",0,1),t.ADD_PRINT_LINE("45mm","0mm","45mm","55mm",0,1),t.ADD_PRINT_LINE("53mm","0mm","53mm","55mm",0,1),t.ADD_PRINT_LINE("79mm","0mm","79mm","55mm",0,1),t.ADD_PRINT_IMAGE("12mm","14mm","40mm","15mm",fe(e.waybillNo,!1)),t.ADD_PRINT_IMAGE("35mm","58mm","0mm","0mm",we(e.waybillNo)),t.ADD_PRINT_TEXT("34mm","0mm","55mm","10mm",e.markDestinationName),t.SET_PRINT_STYLEA(0,"Bold",1),t.SET_PRINT_STYLEA(0,"Alignment",2),t.SET_PRINT_STYLEA(0,"FontSize",16);const r=JSON.parse(e.receiverStr);t.ADD_PRINT_RECT("54mm","1mm","6mm","6mm",0,3),t.ADD_PRINT_TEXT("55mm","2mm","5mm","8mm","\u6536"),t.SET_PRINT_STYLEA(0,"Bold",1),t.SET_PRINT_STYLEA(0,"FontSize",11),t.ADD_PRINT_TEXT("55mm","9mm","48mm","8mm",r.name+" "+r.phone),t.SET_PRINT_STYLEA(0,"Bold",1),t.SET_PRINT_STYLEA(0,"FontSize",10),t.ADD_PRINT_TEXT("64mm","9mm","48mm","20mm",r.prov+r.city+r.county+r.address),t.SET_PRINT_STYLEA(0,"Bold",1),t.SET_PRINT_STYLEA(0,"FontSize",10),t.SET_PRINT_STYLEA(0,"LineSpacing",-5);const o=JSON.parse(e.senderStr);t.ADD_PRINT_TEXT("81mm","2mm","6mm","6mm","\u5BC4"),t.SET_PRINT_STYLEA(0,"FontSize",11),t.ADD_PRINT_TEXT("79.5mm","9mm","70mm","8mm",o.name+" "+o.phone),t.SET_PRINT_STYLEA(0,"FontSize",9),t.ADD_PRINT_TEXT("85mm","9mm","45mm","20mm",o.prov+o.city+o.county+o.address),t.SET_PRINT_STYLEA(0,"FontSize",9),t.SET_PRINT_STYLEA(0,"LineSpacing",-5),t.ADD_PRINT_LINE("95mm","0mm","95mm","76mm",0,1);const i='[{"value":"isGoodsName","checked":true,"sort":1},{"value":"isGoodsArtno","checked":false,"sort":2},{"value":"isGoodsIsbn","checked":false,"sort":3},{"value":"isGoodsNum","checked":false,"sort":4}]';let a=[];try{a=JSON.parse(i||"[]"),a=a.sort((f,h)=>f.sort-h.sort)}catch(f){console.error("\u89E3\u6790printTemplateData\u5931\u8D25\uFF1A",f),a=[]}function u(f,h=26){if(!f)return"-";let m=0,v="";for(let R=0;R<f.length;R++){const $=f.charAt(R),U=/[\u4e00-\u9fa5]/.test($)?2:1;if(m+U>h)break;v+=$,m+=U}return v.length<f.length?`${v}`:v}const s={isGoodsIsbn:{label:"ISBN\uFF1A",getValue:f=>f.isbn||"-"},isGoodsName:{label:"\u5546\u54C1\u540D\u79F0\uFF1A",getValue:f=>u(f.name)+" \xD7"+f.num},isGoodsArtno:{label:"\u8D27\u53F7/\u539F\u8D27\u53F7\uFF1A",getValue:f=>`${(f.artNo||"").toString().slice(0,6)}/${f.originalArtNo||""}`},isGoodsNum:{label:"\u6570\u91CF\uFF1A",getValue:f=>f.num||0}};let _=96;const g=3.5,M=2,l=75,y=5,c=Array.isArray(JSON.parse(e.itemStr))?JSON.parse(e.itemStr):[];c.forEach(f=>{a.forEach(h=>{if(!h.checked)return;const m=s[h.value];if(!m)return;const v=`${m.label}${m.getValue(f)}`;t.ADD_PRINT_TEXT(`${_}mm`,`${M}mm`,`${l}mm`,`${y}mm`,v),t.SET_PRINT_STYLEA(0,"FontSize",9),t.SET_PRINT_STYLEA(0,"Bold",1),_+=g})}),c.length>1&&(t.ADD_PRINT_TEXT("121mm","0mm","55mm","10mm",n),t.SET_PRINT_STYLEA(0,"Bold",1),t.SET_PRINT_STYLEA(0,"FontSize",16))},JTSD:(t,e)=>{t.PRINT_INIT("\u6781\u5154\u901F\u9012"),t.SET_PRINT_PAGESIZE(3,"76mm","120mm",""),t.ADD_PRINT_RECT("10.6mm","0","76mm","118mm",0,1),t.ADD_PRINT_IMAGE("24mm","18mm","40mm","15mm",fe(e.waybillNo,!1)),t.ADD_PRINT_IMAGE("50mm","58mm","0mm","0mm",we(e.waybillNo)),t.ADD_PRINT_LINE("106mm","55mm","40mm","55mm",0,1),t.ADD_PRINT_LINE("106mm","8mm","56mm","8mm",0,1);const n=e.waybillNo.slice(-4);t.ADD_PRINT_LINE("23mm","0mm","23mm","76mm",0,1),t.ADD_PRINT_LINE("40mm","0mm","40mm","76mm",0,1),t.ADD_PRINT_LINE("48mm","0mm","48mm","55mm",0,1),t.ADD_PRINT_LINE("56mm","0mm","56mm","55mm",0,1),t.ADD_PRINT_LINE("74mm","0mm","74mm","55mm",0,1),t.ADD_PRINT_LINE("90mm","0mm","90mm","55mm",0,1),t.ADD_PRINT_TEXT("13mm","0mm","79mm","10mm",e.markDestinationName),t.SET_PRINT_STYLEA(0,"Bold",1),t.SET_PRINT_STYLEA(0,"Alignment",2),t.SET_PRINT_STYLEA(0,"FontSize",19),t.ADD_PRINT_RECT("41mm","1mm","6mm","6mm",0,3),t.ADD_PRINT_TEXT("42mm","2mm","5mm","8mm","\u96C6"),t.SET_PRINT_STYLEA(0,"Bold",1),t.SET_PRINT_STYLEA(0,"FontSize",12),t.ADD_PRINT_TEXT("42mm","9mm","40mm","8mm",e.packageCodeName),t.SET_PRINT_STYLEA(0,"Bold",1),t.SET_PRINT_STYLEA(0,"FontSize",13),t.ADD_PRINT_RECT("49mm","1mm","6mm","6mm",0,3),t.ADD_PRINT_TEXT("50mm","2mm","5mm","8mm","\u672B"),t.SET_PRINT_STYLEA(0,"Bold",1),t.SET_PRINT_STYLEA(0,"FontSize",12),t.ADD_PRINT_TEXT("50mm","9mm","40mm","8mm",e.moStr),t.SET_PRINT_STYLEA(0,"Bold",1),t.SET_PRINT_STYLEA(0,"FontSize",13);const r=JSON.parse(e.receiverStr);t.ADD_PRINT_RECT("57mm","1mm","6mm","6mm",0,3),t.ADD_PRINT_TEXT("58mm","2mm","5mm","8mm","\u6536"),t.SET_PRINT_STYLEA(0,"FontSize",11),t.ADD_PRINT_TEXT("57mm","9mm","48mm","8mm",r.name+" "+r.phone),t.SET_PRINT_STYLEA(0,"FontSize",9),t.ADD_PRINT_TEXT("64mm","9mm","48mm","20mm",r.prov+r.city+r.county+r.address),t.SET_PRINT_STYLEA(0,"FontSize",9),t.SET_PRINT_STYLEA(0,"LineSpacing",-5);const o=JSON.parse(e.senderStr);t.ADD_PRINT_TEXT("76mm","2mm","6mm","6mm","\u5BC4"),t.SET_PRINT_STYLEA(0,"Bold",1),t.SET_PRINT_STYLEA(0,"FontSize",12),t.ADD_PRINT_TEXT("74.5mm","9mm","70mm","8mm",o.name+" "+o.phone),t.SET_PRINT_STYLEA(0,"FontSize",8),t.ADD_PRINT_TEXT("80mm","9mm","45mm","20mm",o.prov+o.city+o.county+o.address),t.SET_PRINT_STYLEA(0,"FontSize",8),t.SET_PRINT_STYLEA(0,"LineSpacing",-5),t.ADD_PRINT_TEXT("93mm","2mm","5mm","8mm","\u4FDD"),t.SET_PRINT_STYLEA(0,"Bold",1),t.SET_PRINT_STYLEA(0,"FontSize",12),t.ADD_PRINT_LINE("96mm","8mm","96mm","55mm",0,1),t.ADD_PRINT_LINE("106mm","23mm","90mm","23mm",0,1),t.ADD_PRINT_LINE("106mm","40mm","90mm","40mm",0,1),t.ADD_PRINT_TEXT("91.5mm","9mm","20mm","9mm","\u4EE3\u6536\u8D37\u6B3E"),t.SET_PRINT_STYLEA(0,"Bold",1),t.ADD_PRINT_TEXT("91.5mm","25mm","20mm","25mm","\u5230\u4ED8\u8D37\u6B3E"),t.SET_PRINT_STYLEA(0,"Bold",1),t.ADD_PRINT_TEXT("91.5mm","41mm","20mm","41mm","\u8BA1\u4EF6\u91CD\u91CF"),t.SET_PRINT_STYLEA(0,"Bold",1),t.ADD_PRINT_LINE("106mm","0mm","106mm","76mm",0,1);const i='[{"value":"isGoodsName","checked":true,"sort":1},{"value":"isGoodsArtno","checked":false,"sort":2},{"value":"isGoodsIsbn","checked":false,"sort":3},{"value":"isGoodsNum","checked":false,"sort":4}]';let a=[];try{a=JSON.parse(i||"[]"),a=a.sort((f,h)=>f.sort-h.sort)}catch(f){console.error("\u89E3\u6790printTemplateData\u5931\u8D25\uFF1A",f),a=[]}function u(f,h=30){if(!f)return"-";let m=0,v="";for(let R=0;R<f.length;R++){const $=f.charAt(R),U=/[\u4e00-\u9fa5]/.test($)?2:1;if(m+U>h)break;v+=$,m+=U}return v.length<f.length?`${v}`:v}const s={isGoodsIsbn:{label:"ISBN\uFF1A",getValue:f=>f.isbn||"-"},isGoodsName:{label:"\u5546\u54C1\u540D\u79F0\uFF1A",getValue:f=>u(f.name)+" \xD7"+f.num},isGoodsArtno:{label:"\u8D27\u53F7/\u539F\u8D27\u53F7\uFF1A",getValue:f=>`${(f.artNo||"").toString().slice(0,6)}/${f.originalArtNo||""}`},isGoodsNum:{label:"\u6570\u91CF\uFF1A",getValue:f=>f.num||0}};let _=107;const g=3.5,M=2,l=80,y=5;debugger;const c=Array.isArray(JSON.parse(e.itemStr))?JSON.parse(e.itemStr):[];c.forEach(f=>{a.forEach(h=>{if(!h.checked)return;const m=s[h.value];if(!m)return;const v=`${m.label}${m.getValue(f)}`;t.ADD_PRINT_TEXT(`${_}mm`,`${M}mm`,`${l}mm`,`${y}mm`,v),t.SET_PRINT_STYLEA(0,"FontSize",9),t.SET_PRINT_STYLEA(0,"Bold",1),_+=g})}),c.length>1&&(t.ADD_PRINT_TEXT("121mm","0mm","55mm","10mm",n),t.SET_PRINT_STYLEA(0,"Bold",1),t.SET_PRINT_STYLEA(0,"FontSize",16))},YTO:(t,e)=>{e=Rt(e),t.PRINT_INIT("\u90AE\u653F\u5FEB\u9012"),t.SET_PRINT_PAGESIZE(3,"76mm","130mm",""),t.SET_PRINT_MODE("PRINT_NO_PAGE",!0),t.ADD_PRINT_RECT("28mm","0","76mm","93mm",0,1),t.ADD_PRINT_TEXT("1mm","66mm","15mm","50mm","\u5FEB\u9012\u5305\u88F9"),t.SET_PRINT_STYLEA(0,"Bold",1),t.SET_PRINT_STYLEA(0,"FontSize",13),t.SET_PRINT_STYLEA(0,"LineSpacing",-5),t.ADD_PRINT_LINE("38mm","0mm","38mm","76mm",0,1),t.ADD_PRINT_LINE("60mm","0mm","60mm","76mm",0,1),t.ADD_PRINT_LINE("73mm","0mm","73mm","76mm",0,1),t.ADD_PRINT_LINE("90mm","0mm","90mm","76mm",0,1),t.ADD_PRINT_LINE("90mm","30mm","73mm","30mm",0,1);const n=fe(e.waybillNo,!1);t.ADD_PRINT_IMAGE("12mm","18mm","40mm","15mm",n),t.ADD_PRINT_IMAGE("74mm","34mm","40mm","15mm",n),t.ADD_PRINT_TEXT("30mm","0mm","75mm","10mm",e.markDestinationName),t.SET_PRINT_STYLEA(0,"Bold",1),t.SET_PRINT_STYLEA(0,"Alignment",2),t.SET_PRINT_STYLEA(0,"FontSize",18);const r=JSON.parse(e.receiverStr);t.ADD_PRINT_RECT("40mm","1mm","6mm","6mm",0,3),t.ADD_PRINT_TEXT("41mm","2mm","5mm","8mm","\u6536"),t.SET_PRINT_STYLEA(0,"Bold",1),t.SET_PRINT_STYLEA(0,"FontSize",11),t.ADD_PRINT_TEXT("41mm","9mm","75mm","8mm",r.name+" "+r.phone),t.SET_PRINT_STYLEA(0,"Bold",1),t.SET_PRINT_STYLEA(0,"FontSize",10),t.ADD_PRINT_TEXT("50mm","9mm","75mm","20mm",r.prov+r.city+r.county+r.address),t.SET_PRINT_STYLEA(0,"Bold",1),t.SET_PRINT_STYLEA(0,"FontSize",10),t.SET_PRINT_STYLEA(0,"LineSpacing",-5);const o=JSON.parse(e.senderStr);t.ADD_PRINT_TEXT("62mm","2mm","6mm","6mm","\u5BC4"),t.SET_PRINT_STYLEA(0,"FontSize",15),t.ADD_PRINT_TEXT("60.5mm","9mm","75mm","8mm",o.name+" "+o.phone),t.SET_PRINT_STYLEA(0,"FontSize",9),t.ADD_PRINT_TEXT("66mm","9mm","75mm","20mm",o.prov+o.city+o.county+o.address),t.SET_PRINT_STYLEA(0,"FontSize",9),t.SET_PRINT_STYLEA(0,"LineSpacing",-5),n0(e,92)},barcode:async(t,e)=>{const n=e.content||"";if(!n)return;const r=localStorage.getItem("printer_paper_size")||"60*40";t.PRINT_INIT("\u5E93\u4F4D-"+n),r==="60*30"?(t.SET_PRINT_PAGESIZE(3,"60mm","30mm",""),t.ADD_PRINT_IMAGE("5mm","0mm","40mm","10mm",bt(n)),t.SET_PRINT_STYLEA(0,"Horient",2)):r==="40*60"?(t.SET_PRINT_PAGESIZE(3,"40mm","60mm",""),t.ADD_PRINT_IMAGE("5mm","0mm","40mm","10mm",t0(n)),t.SET_PRINT_STYLEA(0,"Horient",2)):(t.SET_PRINT_PAGESIZE(3,"60mm","40mm",""),t.ADD_PRINT_IMAGE("5mm","0mm","35mm","10mm",bt(n)),t.SET_PRINT_STYLEA(0,"Horient",2))}},Kt=()=>new Promise((t,e)=>{if(A)return t(A);const n=document.createElement("script");n.src="http://localhost:8000/CLodopfuncs.js",n.onload=()=>{A=getCLodop(),A||e(new Error("C-Lodop \u672A\u6B63\u786E\u5B89\u88C5")),t(A)},n.onerror=()=>{const r=new Error("\u52A0\u8F7D C-Lodop \u5931\u8D25");r0("C-Lodop\u63D2\u4EF6\u52A0\u8F7D\u5931\u8D25\uFF01"),e(r)},document.head.appendChild(n)});function r0(t){const e=`${t}
\u8BF7\u5148\u4E0B\u8F7D\u5B89\u88C5\u63D2\u4EF6\u540E\u91CD\u8BD5\uFF01
\u70B9\u51FB\u3010\u786E\u5B9A\u3011\u5F00\u59CB\u4E0B\u8F7D\uFF0C\u3010\u53D6\u6D88\u3011\u5219\u653E\u5F03\u3002`;if(confirm(e)){const n="http://103.236.68.64:19000/my-pics/Lodop/CLodop_Setup_for_Win64NT_6.623EN.exe",r=document.createElement("a");r.href=n,r.download="CLodop_Setup_for_Win64NT_6.623EN.exe",r.style.display="none",document.body.appendChild(r),r.click(),document.body.removeChild(r)}}const o0=async(t,e)=>{console.log("\u521B\u5EFA\u6253\u5370\u4EFB\u52A1\uFF0C\u6A21\u677F:",t,"\u5185\u5BB9:",e);try{const n=await Kt();if(n.SET_LICENSES("","630D8906DC4186920589CAE3FFA925A278D","",""),!It[t])throw console.log(t),new Error(`\u672A\u627E\u5230\u6A21\u677F: ${t}`);return await It[t](n,e),n}catch(n){throw n}},i0=async()=>{try{const t=await Kt(),e=[],n=t.GET_PRINTER_COUNT();for(let r=0;r<n;r++){const o=t.GET_PRINTER_NAME(r);e.push(o)}return e}catch{return[]}};function Rt(t){if(!t)return t;if(t.receiverStr)try{const e=JSON.parse(t.receiverStr);if(e){if(e.name&&e.name.length>1){const n=e.name;n.length===2?e.name=n[0]+"*":n.length>2&&(e.name=n[0]+"*".repeat(n.length-2)+n[n.length-1])}if(e.phone){const n=e.phone;if(n.length===11)e.phone=n.slice(0,3)+"****"+n.slice(7);else if(n.length>4){const r=Math.min(3,Math.floor(n.length/3)),o=Math.min(4,Math.floor(n.length/3)),i=n.length-r-o;e.phone=n.slice(0,r)+"*".repeat(i)+n.slice(-o)}}if(e.address){const n=e.address;n.length>6?e.address=n.slice(0,6)+"***":n.length>3&&(e.address=n.slice(0,3)+"***")}t.receiverStr=JSON.stringify(e)}}catch(e){console.error("\u6536\u4EF6\u4EBA\u6570\u636E\u8131\u654F\u5931\u8D25\uFF1A",e)}if(t.senderStr)try{const e=JSON.parse(t.senderStr);if(e){if(e.name&&e.name.length>1){const n=e.name;n.length===2?e.name=n[0]+"*":n.length>2&&(e.name=n[0]+"*".repeat(n.length-2)+n[n.length-1])}if(e.phone){const n=e.phone;if(n.length===11)e.phone=n.slice(0,3)+"****"+n.slice(7);else if(n.length>4){const r=Math.min(3,Math.floor(n.length/3)),o=Math.min(4,Math.floor(n.length/3)),i=n.length-r-o;e.phone=n.slice(0,r)+"*".repeat(i)+n.slice(-o)}}if(e.address){const n=e.address;n.length>6?e.address=n.slice(0,6)+"***":n.length>3&&(e.address=n.slice(0,3)+"***")}t.senderStr=JSON.stringify(e)}}catch(e){console.error("\u53D1\u4EF6\u4EBA\u6570\u636E\u8131\u654F\u5931\u8D25\uFF1A",e)}return t}export{P as J,o0 as c,i0 as g};