angular-barcode
Advanced tools
Comparing version 1.1.0 to 1.1.1
@@ -1,3 +0,3 @@ | ||
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("barcode",[],e):"object"==typeof exports?exports.barcode=e():t.barcode=e()}(this,function(){return function(t){function e(r){if(n[r])return n[r].exports;var i=n[r]={exports:{},id:r,loaded:!1};return t[r].call(i.exports,i,i.exports,e),i.loaded=!0,i.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}([function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(1),o=r(i),a=angular.module("barcode",[]);a.directive("barcode",o["default"].directiveFactory),e["default"]=a,t.exports=e["default"]},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var o=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),a=n(2),s=r(a),u=function(){function t(){i(this,t),this.replace=!0,this.restrict="E",this.scope={type:"@",text:"@","class":"@?",format:"@?",lineColor:"@?",width:"@?",height:"@?",displayValue:"@?",fontOptions:"@?",font:"@?",textAlign:"@?",textPosition:"@?",textMargin:"@?",fontSize:"@?",background:"@?",margin:"@?",marginTop:"@?",marginBottom:"@?",marginLeft:"@?",marginRight:"@?",valid:"=?"},this.template=t.resolveTemplate}return o(t,null,[{key:"resolveTemplate",value:function(t,e){var n=e["class"]||"barcode";switch(e.type){case"svg":return'<svg class="'+n+'"></svg>';case"img":return'<img class="'+n+'">';case"canvas":return'<canvas class="'+n+'"></canvas>'}}}]),o(t,[{key:"link",value:function(t,e,n){(0,s["default"])(e[0],t.text,{format:t.format||"CODE128",lineColor:t.lineColor||"#000000",width:parseInt(t.width,10)||2,height:parseInt(t.height,10)||100,displayValue:"true"===t.displayValue||!0,fontOptions:t.fontOptions||"",font:t.font||"monospace",textAlign:t.textAlign||"center",textPosition:t.textPosition||"bottom",textMargin:parseInt(t.textMargin,10)||2,fontSize:parseInt(t.fontSize,10)||20,background:t.background||"#ffffff",margin:parseInt(t.margin,10)||10,marginTop:parseInt(t.marginTop,10)||void 0,marginBottom:parseInt(t.marginBottom,10)||void 0,marginLeft:parseInt(t.marginLeft,10)||void 0,marginRight:parseInt(t.marginRight,10)||void 0,valid:t.valid||function(t){}})}}],[{key:"directiveFactory",value:function(){return t.instance=new t,t.instance}}]),t}();e["default"]=u,u.directiveFactory.$inject=[],t.exports=e["default"]},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t,e){_.prototype[e]=_.prototype[e.toUpperCase()]=_.prototype[e.toLowerCase()]=function(n,r){var i=(0,p["default"])(this._options,r),a=t[e],s=o(n,a,i);return this._encodings.push(s),this}}function o(t,e,n){t=""+t;var r=new e(t,n);if(!r.valid()){if(n.valid===O.valid)throw new Error('"'+t+'" is not a valid input for '+C);n.valid(!1)}var i=r.encode();i=(0,y["default"])(i);for(var o=0;o<i.length;o++)i[o].options=(0,p["default"])(n,i[o].options);return i}function a(){return c["default"].CODE128?"CODE128":Object.keys(c["default"])[0]}function s(t,e,n){var r=h["default"][t.renderer];e=(0,y["default"])(e);for(var i=0;i<e.length;i++)e[i].options=(0,p["default"])(n,e[i].options),(0,b["default"])(e[i].options);(0,b["default"])(n),r(t.element,e,n),t.afterRender&&t.afterRender()}function u(t){if("string"==typeof t){var e=document.querySelectorAll(t);if(0===e.length)throw new Error("No element found");for(var n=[],r=0;r<e.length;r++)n.push(u(e[r]));return n}if(Array.isArray(t)){for(var n=[],r=0;r<t.length;r++)n.push(u(t[r]));return n}if("undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLImageElement){var i=document.createElement("canvas");return{element:i,options:(0,x["default"])(t,O),renderer:"canvas",afterRender:function(){t.setAttribute("src",i.toDataURL())}}}if("undefined"!=typeof SVGElement&&t instanceof SVGElement)return{element:t,options:(0,x["default"])(t,O),renderer:"svg"};if("undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement)return{element:t,options:(0,x["default"])(t,O),renderer:"canvas"};if(t.getContext)return{element:t,renderer:"canvas"};throw new Error("Not supported type to render on.")}var f=n(3),c=r(f),l=n(29),h=r(l),d=n(31),p=r(d),g=n(33),y=r(g),v=n(34),b=r(v),m=n(35),x=r(m),_=function(){},w=function(t,e,n){var r=new _;if("undefined"==typeof t)throw Error("No element to render on was provided.");return r._renderProperties=u(t),r._encodings=[],r._options=O,"undefined"!=typeof e&&(n=n||{},n.format||(n.format=a()),r.options(n),r[n.format](e,n),r.render()),r};w.getModule=function(t){return c["default"][t]};for(var C in c["default"])c["default"].hasOwnProperty(C)&&i(c["default"],C);_.prototype.options=function(t){return this._options=(0,p["default"])(this._options,t),this},_.prototype.blank=function(t){var e="0".repeat(t);return this._encodings.push({data:e}),this},_.prototype.init=function(){Array.isArray(this._renderProperties)||(this._renderProperties=[this._renderProperties]);var t;for(var e in this._renderProperties){t=this._renderProperties[e];var n=(0,p["default"])(this._options,t.options);"auto"==n.format&&(n.format=a());var r=n.value,i=c["default"][n.format.toUpperCase()],u=o(r,i,n);s(t,u,n)}},_.prototype.render=function(){if(Array.isArray(this._renderProperties))for(var t in this._renderProperties)s(this._renderProperties[t],this._encodings,this._options);else s(this._renderProperties,this._encodings,this._options);return this._options.valid(!0),this},"undefined"!=typeof window&&(window.JsBarcode=w),"undefined"!=typeof jQuery&&(jQuery.fn.JsBarcode=function(t,e){var n=[];return jQuery(this).each(function(){n.push(this)}),w(n,t,e)}),t.exports=w;var O={width:2,height:100,format:"auto",displayValue:!0,fontOptions:"",font:"monospace",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(t){}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(4),i=n(5),o=n(11),a=n(18),s=n(19),u=n(20),f=n(27),c=n(28);e["default"]={CODE39:r.CODE39,CODE128:i.CODE128,CODE128A:i.CODE128A,CODE128B:i.CODE128B,CODE128C:i.CODE128C,EAN13:o.EAN13,EAN8:o.EAN8,EAN5:o.EAN5,EAN2:o.EAN2,UPC:o.UPC,ITF14:a.ITF14,ITF:s.ITF,MSI:u.MSI,MSI10:u.MSI10,MSI11:u.MSI11,MSI1010:u.MSI1010,MSI1110:u.MSI1110,pharmacode:f.pharmacode,GenericBarcode:c.GenericBarcode}},function(t,e){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(e,r){n(this,t),this.string=e.toUpperCase(),this.mod43Enabled=r.mod43||!1,this.characters=["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","-","."," ","$","/","+","%","*"],this.encodings=[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]}return t.prototype.getEncoding=function(t){return this.getBinary(this.characterValue(t))},t.prototype.getBinary=function(t){return this.encodings[t].toString(2)},t.prototype.getCharacter=function(t){return this.characters[t]},t.prototype.characterValue=function(t){return this.characters.indexOf(t)},t.prototype.encode=function(){for(var t=this.string,e=this.getEncoding("*"),n=0;n<this.string.length;n++)e+=this.getEncoding(this.string[n])+"0";if(this.mod43Enabled){for(var r=0,n=0;n<this.string.length;n++)r+=this.characterValue(this.string[n]);r%=43,e+=this.getBinary(r)+"0",t+=this.getCharacter(r)}return e+=this.getEncoding("*"),{data:e,text:t}},t.prototype.valid=function(){return this.string.search(/^[0-9A-Z\-\.\ \$\/\+\%]+$/)!==-1},t}();e.CODE39=r},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0}),e.CODE128C=e.CODE128B=e.CODE128A=e.CODE128=void 0;var i=n(6),o=r(i),a=n(8),s=r(a),u=n(9),f=r(u),c=n(10),l=r(c);e.CODE128=o["default"],e.CODE128A=s["default"],e.CODE128B=f["default"],e.CODE128C=l["default"]},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)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)}function s(t){var e,n=t.match(/^[\x00-\x5F\xC8-\xCF]*/)[0].length,r=t.match(/^[\x20-\x7F\xC8-\xCF]*/)[0].length,i=t.match(/^(\xCF*[0-9]{2}\xCF*)*/)[0].length;return e=i>=2?String.fromCharCode(210)+c(t):n>r?String.fromCharCode(208)+u(t):String.fromCharCode(209)+f(t),e=e.replace(/[\xCD\xCE]([^])[\xCD\xCE]/,function(t,e){return String.fromCharCode(203)+e})}function u(t){var e=t.match(/^([\x00-\x5F\xC8-\xCF]+?)(([0-9]{2}){2,})([^0-9]|$)/);if(e)return e[1]+String.fromCharCode(204)+c(t.substring(e[1].length));var n=t.match(/^[\x00-\x5F\xC8-\xCF]+/);return n[0].length===t.length?t:n[0]+String.fromCharCode(205)+f(t.substring(n[0].length))}function f(t){var e=t.match(/^([\x20-\x7F\xC8-\xCF]+?)(([0-9]{2}){2,})([^0-9]|$)/);if(e)return e[1]+String.fromCharCode(204)+c(t.substring(e[1].length));var n=t.match(/^[\x20-\x7F\xC8-\xCF]+/);return n[0].length===t.length?t:n[0]+String.fromCharCode(206)+u(t.substring(n[0].length))}function c(t){var e=t.match(/^(\xCF*[0-9]{2}\xCF*)+/)[0],n=e.length;if(n===t.length)return t;t=t.substring(n);var r=t.match(/^[\x00-\x5F\xC8-\xCF]*/)[0].length,i=t.match(/^[\x20-\x7F\xC8-\xCF]*/)[0].length;return r>=i?e+String.fromCharCode(206)+u(t):e+String.fromCharCode(205)+f(t)}Object.defineProperty(e,"__esModule",{value:!0});var l=n(7),h=r(l),d=function(t){function e(n){i(this,e);var r=o(this,t.call(this,n));if(n.search(/^[\x00-\x7F\xC8-\xD3]+$/)!==-1)var r=o(this,t.call(this,s(n)));else var r=o(this,t.call(this,n));return o(r)}return a(e,t),e}(h["default"]);e["default"]=d},function(t,e){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(e){n(this,t),this.bytes=[];for(var r=0;r<e.length;++r)this.bytes.push(e.charCodeAt(r));this.string=e.substring(1),this.encodings=[740,644,638,176,164,100,224,220,124,608,604,572,436,244,230,484,260,254,650,628,614,764,652,902,868,836,830,892,844,842,752,734,590,304,112,94,416,128,122,672,576,570,464,422,134,496,478,142,910,678,582,768,762,774,880,862,814,896,890,818,914,602,930,328,292,200,158,68,62,424,412,232,218,76,74,554,616,978,556,146,340,212,182,508,268,266,956,940,938,758,782,974,400,310,118,512,506,960,954,502,518,886,966,668,680,692,5379]}return t.prototype.encode=function(){var t,e=this.bytes,n=e.shift()-105;return 103===n?t=this.nextA(e,1):104===n?t=this.nextB(e,1):105===n&&(t=this.nextC(e,1)),{text:this.string.replace(/[^\x20-\x7E]/g,""),data:this.getEncoding(n)+t.result+this.getEncoding((t.checksum+n)%103)+this.getEncoding(106)}},t.prototype.getEncoding=function(t){return this.encodings[t]?(this.encodings[t]+1e3).toString(2):""},t.prototype.valid=function(){return this.string.search(/^[\x00-\x7F\xC8-\xD3]+$/)!==-1},t.prototype.nextA=function(t,e){if(t.length<=0)return{result:"",checksum:0};var n,r;if(t[0]>=200)r=t[0]-105,t.shift(),99===r?n=this.nextC(t,e+1):100===r?n=this.nextB(t,e+1):98===r?(t[0]=t[0]>95?t[0]-96:t[0],n=this.nextA(t,e+1)):n=this.nextA(t,e+1);else{var i=t[0];r=i<32?i+64:i-32,t.shift(),n=this.nextA(t,e+1)}var o=this.getEncoding(r),a=r*e;return{result:o+n.result,checksum:a+n.checksum}},t.prototype.nextB=function(t,e){if(t.length<=0)return{result:"",checksum:0};var n,r;t[0]>=200?(r=t[0]-105,t.shift(),99===r?n=this.nextC(t,e+1):101===r?n=this.nextA(t,e+1):98===r?(t[0]=t[0]<32?t[0]+96:t[0],n=this.nextB(t,e+1)):n=this.nextB(t,e+1)):(r=t[0]-32,t.shift(),n=this.nextB(t,e+1));var i=this.getEncoding(r),o=r*e;return{result:i+n.result,checksum:o+n.checksum}},t.prototype.nextC=function(t,e){if(t.length<=0)return{result:"",checksum:0};var n,r;t[0]>=200?(r=t[0]-105,t.shift(),n=100===r?this.nextB(t,e+1):101===r?this.nextA(t,e+1):this.nextC(t,e+1)):(r=10*(t[0]-48)+t[1]-48,t.shift(),t.shift(),n=this.nextC(t,e+1));var i=this.getEncoding(r),o=r*e;return{result:i+n.result,checksum:o+n.checksum}},t}();e["default"]=r},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)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)}Object.defineProperty(e,"__esModule",{value:!0});var s=n(7),u=r(s),f=function(t){function e(n){return i(this,e),o(this,t.call(this,String.fromCharCode(208)+n))}return a(e,t),e.prototype.valid=function(){return this.string.search(/^[\x00-\x5F\xC8-\xCF]+$/)!==-1},e}(u["default"]);e["default"]=f},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)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)}Object.defineProperty(e,"__esModule",{value:!0});var s=n(7),u=r(s),f=function(t){function e(n){return i(this,e),o(this,t.call(this,String.fromCharCode(209)+n))}return a(e,t),e.prototype.valid=function(){return this.string.search(/^[\x20-\x7F\xC8-\xCF]+$/)!==-1},e}(u["default"]);e["default"]=f},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)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)}Object.defineProperty(e,"__esModule",{value:!0});var s=n(7),u=r(s),f=function(t){function e(n){return i(this,e),o(this,t.call(this,String.fromCharCode(210)+n))}return a(e,t),e.prototype.valid=function(){return this.string.search(/^(\xCF*[0-9]{2}\xCF*)+$/)!==-1},e}(u["default"]);e["default"]=f},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0}),e.UPC=e.EAN2=e.EAN5=e.EAN8=e.EAN13=void 0;var i=n(12),o=r(i),a=n(14),s=r(a),u=n(15),f=r(u),c=n(16),l=r(c),h=n(17),d=r(h);e.EAN13=o["default"],e.EAN8=s["default"],e.EAN5=f["default"],e.EAN2=l["default"],e.UPC=d["default"]},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var o=n(13),a=r(o),s=function(){function t(e,n){i(this,t),e.search(/^[0-9]{12}$/)!==-1?this.string=e+this.checksum(e):this.string=e,this.displayValue=n.displayValue,this.structure=["LLLLLL","LLGLGG","LLGGLG","LLGGGL","LGLLGG","LGGLLG","LGGGLL","LGLGLG","LGLGGL","LGGLGL"],n.fontSize>10*n.width?this.fontSize=10*n.width:this.fontSize=n.fontSize,this.guardHeight=n.height+this.fontSize/2+n.textMargin,this.lastChar=n.lastChar}return t.prototype.valid=function(){return this.string.search(/^[0-9]{13}$/)!==-1&&this.string[12]==this.checksum(this.string)},t.prototype.encode=function(){var t=new a["default"],e=[],n=this.structure[this.string[0]],r=this.string.substr(1,6),i=this.string.substr(7,6);return this.displayValue&&e.push({data:"000000000000",text:this.string[0],options:{textAlign:"left",fontSize:this.fontSize}}),e.push({data:"101",options:{height:this.guardHeight}}),e.push({data:t.encode(r,n),text:r,options:{fontSize:this.fontSize}}),e.push({data:"01010",options:{height:this.guardHeight}}),e.push({data:t.encode(i,"RRRRRR"),text:i,options:{fontSize:this.fontSize}}),e.push({data:"101",options:{height:this.guardHeight}}),this.lastChar&&this.displayValue&&(e.push({data:"00"}),e.push({data:"00000",text:this.lastChar,options:{fontSize:this.fontSize}})),e},t.prototype.checksum=function(t){var e,n=0;for(e=0;e<12;e+=2)n+=parseInt(t[e]);for(e=1;e<12;e+=2)n+=3*parseInt(t[e]);return(10-n%10)%10},t}();e["default"]=s},function(t,e){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(){n(this,t),this.startBin="101",this.endBin="101",this.middleBin="01010",this.Lbinary=["0001101","0011001","0010011","0111101","0100011","0110001","0101111","0111011","0110111","0001011"],this.Gbinary=["0100111","0110011","0011011","0100001","0011101","0111001","0000101","0010001","0001001","0010111"],this.Rbinary=["1110010","1100110","1101100","1000010","1011100","1001110","1010000","1000100","1001000","1110100"]}return t.prototype.encode=function(t,e,n){var r="";n=n||"";for(var i=0;i<t.length;i++)"L"==e[i]?r+=this.Lbinary[t[i]]:"G"==e[i]?r+=this.Gbinary[t[i]]:"R"==e[i]&&(r+=this.Rbinary[t[i]]),i<t.length-1&&(r+=n);return r},t}();e["default"]=r},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var o=n(13),a=r(o),s=function(){function t(e){i(this,t),e.search(/^[0-9]{7}$/)!==-1?this.string=e+this.checksum(e):this.string=e}return t.prototype.valid=function(){return this.string.search(/^[0-9]{8}$/)!==-1&&this.string[7]==this.checksum(this.string)},t.prototype.encode=function(){var t=new a["default"],e="",n=this.string.substr(0,4),r=this.string.substr(4,4);return e+=t.startBin,e+=t.encode(n,"LLLL"),e+=t.middleBin,e+=t.encode(r,"RRRR"),e+=t.endBin,{data:e,text:this.string}},t.prototype.checksum=function(t){var e,n=0;for(e=0;e<7;e+=2)n+=3*parseInt(t[e]);for(e=1;e<7;e+=2)n+=parseInt(t[e]);return(10-n%10)%10},t}();e["default"]=s},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var o=n(13),a=r(o),s=function(){function t(e){i(this,t),this.string=e,this.structure=["GGLLL","GLGLL","GLLGL","GLLLG","LGGLL","LLGGL","LLLGG","LGLGL","LGLLG","LLGLG"]}return t.prototype.valid=function(){return this.string.search(/^[0-9]{5}$/)!==-1},t.prototype.encode=function(){var t=new a["default"],e=this.checksum(),n="1011";return n+=t.encode(this.string,this.structure[e],"01"),{data:n,text:this.string}},t.prototype.checksum=function(){var t=0;return t+=3*parseInt(this.string[0]),t+=9*parseInt(this.string[1]),t+=3*parseInt(this.string[2]),t+=9*parseInt(this.string[3]),t+=3*parseInt(this.string[4]),t%10},t}();e["default"]=s},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var o=n(13),a=r(o),s=function(){function t(e){i(this,t),this.string=e,this.structure=["LL","LG","GL","GG"]}return t.prototype.valid=function(){return this.string.search(/^[0-9]{2}$/)!==-1},t.prototype.encode=function(){var t=new a["default"],e=this.structure[parseInt(this.string)%4],n="1011";return n+=t.encode(this.string,e,"01"),{data:n,text:this.string}},t}();e["default"]=s},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var o=n(13),a=r(o),s=function(){function t(e,n){i(this,t),e.search(/^[0-9]{11}$/)!==-1?this.string=e+this.checksum(e):this.string=e,this.displayValue=n.displayValue,n.fontSize>10*n.width?this.fontSize=10*n.width:this.fontSize=n.fontSize,this.guardHeight=n.height+this.fontSize/2+n.textMargin}return t.prototype.valid=function(){return this.string.search(/^[0-9]{12}$/)!==-1&&this.string[11]==this.checksum(this.string)},t.prototype.encode=function(){var t=new a["default"],e=[];return this.displayValue&&e.push({data:"00000000",text:this.string[0],options:{textAlign:"left",fontSize:this.fontSize}}),e.push({data:"101"+t.encode(this.string[0],"L"),options:{height:this.guardHeight}}),e.push({data:t.encode(this.string.substr(1,5),"LLLLL"),text:this.string.substr(1,5),options:{fontSize:this.fontSize}}),e.push({data:"01010",options:{height:this.guardHeight}}),e.push({data:t.encode(this.string.substr(6,5),"RRRRR"),text:this.string.substr(6,5),options:{fontSize:this.fontSize}}),e.push({data:t.encode(this.string[11],"R")+"101",options:{height:this.guardHeight}}),this.displayValue&&e.push({data:"00000000",text:this.string[11],options:{textAlign:"right",fontSize:this.fontSize}}),e},t.prototype.checksum=function(t){var e,n=0;for(e=1;e<11;e+=2)n+=parseInt(t[e]);for(e=0;e<11;e+=2)n+=3*parseInt(t[e]);return(10-n%10)%10},t}();e["default"]=s},function(t,e){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(e){n(this,t),this.string=e,e.search(/^[0-9]{13}$/)!==-1&&(this.string+=this.checksum(e)),this.binaryRepresentation={0:"00110",1:"10001",2:"01001",3:"11000",4:"00101",5:"10100",6:"01100",7:"00011",8:"10010",9:"01010"}}return t.prototype.valid=function(){return this.string.search(/^[0-9]{14}$/)!==-1&&this.string[13]==this.checksum()},t.prototype.encode=function(){for(var t="1010",e=0;e<14;e+=2)t+=this.calculatePair(this.string.substr(e,2));return t+="11101",{data:t,text:this.string}},t.prototype.calculatePair=function(t){for(var e="",n=this.binaryRepresentation[t[0]],r=this.binaryRepresentation[t[1]],i=0;i<5;i++)e+="1"==n[i]?"111":"1",e+="1"==r[i]?"000":"0";return e},t.prototype.checksum=function(){for(var t=0,e=0;e<13;e++)t+=parseInt(this.string[e])*(3-e%2*2);return 10-t%10},t}();e.ITF14=r},function(t,e){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(e){n(this,t),this.string=e,this.binaryRepresentation={0:"00110",1:"10001",2:"01001",3:"11000",4:"00101",5:"10100",6:"01100",7:"00011",8:"10010",9:"01010"}}return t.prototype.valid=function(){return this.string.search(/^([0-9]{2})+$/)!==-1},t.prototype.encode=function(){for(var t="1010",e=0;e<this.string.length;e+=2)t+=this.calculatePair(this.string.substr(e,2));return t+="11101",{data:t,text:this.string}},t.prototype.calculatePair=function(t){for(var e="",n=this.binaryRepresentation[t[0]],r=this.binaryRepresentation[t[1]],i=0;i<5;i++)e+="1"==n[i]?"111":"1",e+="1"==r[i]?"000":"0";return e},t}();e.ITF=r},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0}),e.MSI1110=e.MSI1010=e.MSI11=e.MSI10=e.MSI=void 0;var i=n(21),o=r(i),a=n(22),s=r(a),u=n(24),f=r(u),c=n(25),l=r(c),h=n(26),d=r(h);e.MSI=o["default"],e.MSI10=s["default"],e.MSI11=f["default"],e.MSI1010=l["default"],e.MSI1110=d["default"]},function(t,e){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function r(t,e){for(var n=0;n<e;n++)t="0"+t;return t}Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(e){n(this,t),this.string=e}return t.prototype.encode=function(){for(var t="110",e=0;e<this.string.length;e++){var n=parseInt(this.string[e]),i=n.toString(2);i=r(i,4-i.length);for(var o=0;o<i.length;o++)t+="0"==i[o]?"100":"110"}return t+="1001",{data:t,text:this.string}},t.prototype.valid=function(){return this.string.search(/^[0-9]+$/)!==-1},t}();e["default"]=i},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)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)}Object.defineProperty(e,"__esModule",{value:!0});var s=n(21),u=r(s),f=n(23),c=function(t){function e(n){i(this,e);var r=o(this,t.call(this,n));return r.string+=(0,f.mod10)(r.string),r}return a(e,t),e}(u["default"]);e["default"]=c},function(t,e){"use strict";function n(t){for(var e=0,n=0;n<t.length;n++){var r=parseInt(t[n]);e+=(n+t.length)%2===0?r:2*r%10+Math.floor(2*r/10)}return(10-e%10)%10}function r(t){for(var e=0,n=[2,3,4,5,6,7],r=0;r<t.length;r++){var i=parseInt(t[t.length-1-r]);e+=n[r%n.length]*i}return(11-e%11)%11}Object.defineProperty(e,"__esModule",{value:!0}),e.mod10=n,e.mod11=r},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)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)}Object.defineProperty(e,"__esModule",{value:!0});var s=n(21),u=r(s),f=n(23),c=function(t){function e(n){i(this,e);var r=o(this,t.call(this,n));return r.string+=(0,f.mod11)(r.string),r}return a(e,t),e}(u["default"]);e["default"]=c},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)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)}Object.defineProperty(e,"__esModule",{value:!0});var s=n(21),u=r(s),f=n(23),c=function(t){function e(n){i(this,e);var r=o(this,t.call(this,n));return r.string+=(0,f.mod10)(r.string),r.string+=(0,f.mod10)(r.string),r}return a(e,t),e}(u["default"]);e["default"]=c},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)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)}Object.defineProperty(e,"__esModule",{value:!0});var s=n(21),u=r(s),f=n(23),c=function(t){function e(n){i(this,e);var r=o(this,t.call(this,n));return r.string+=(0,f.mod11)(r.string),r.string+=(0,f.mod10)(r.string),r}return a(e,t),e}(u["default"]);e["default"]=c},function(t,e){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(e){n(this,t),this.number=parseInt(e,10)}return t.prototype.encode=function(){for(var t=this.number,e="";!isNaN(t)&&0!=t;)t%2===0?(e="11100"+e,t=(t-2)/2):(e="100"+e,t=(t-1)/2);return e=e.slice(0,-2),{data:e,text:this.number+""}},t.prototype.valid=function(){return this.number>=3&&this.number<=131070},t}();e.pharmacode=r},function(t,e){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(e){n(this,t),this.string=e}return t.prototype.encode=function(){return{data:"10101010101010101010101010101010101010101",text:this.string}},t.prototype.valid=function(){return!0},t}();e.GenericBarcode=r},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(30),o=r(i),a=n(32),s=r(a);e["default"]={canvas:o["default"],svg:s["default"]}},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t,e,n){if(!t.getContext)throw new Error("The browser does not support canvas.");o(t,n,e);for(var r=0;r<e.length;r++){var i=(0,l["default"])(n,e[r].options);a(t,i,e[r]),s(t,i,e[r]),u(t,e[r])}f(t)}function o(t,e,n){var r=t.getContext("2d");r.save();for(var i=0,o=0,a=0;a<n.length;a++){var s=(0,l["default"])(s,n[a].options);r.font=s.fontOptions+" "+s.fontSize+"px "+s.font;var u=r.measureText(n[a].text).width,f=n[a].data.length*s.width;n[a].width=Math.ceil(Math.max(u,f));var c=s.height+(s.displayValue&&n[a].text.length>0?s.fontSize:0)+s.textMargin+s.marginTop+s.marginBottom,h=0;s.displayValue&&f<u&&("center"==s.textAlign?h=Math.floor((u-f)/2):"left"==s.textAlign?h=0:"right"==s.textAlign&&(h=Math.floor(u-f))),n[a].barcodePadding=h,c>o&&(o=c),i+=n[a].width}t.width=i+e.marginLeft+e.marginRight,t.height=o,r.clearRect(0,0,t.width,t.height),e.background&&(r.fillStyle=e.background,r.fillRect(0,0,t.width,t.height)),r.translate(e.marginLeft,0)}function a(t,e,n){var r,i,o=t.getContext("2d"),a=n.data;r="top"==e.textPosition?e.marginTop+e.fontSize+e.textMargin:e.marginTop,i=e.height,o.fillStyle=e.lineColor;for(var s=0;s<a.length;s++){var u=s*e.width+n.barcodePadding;"1"===a[s]?o.fillRect(u,r,e.width,e.height):a[s]&&o.fillRect(u,r,e.width,e.height*a[s])}}function s(t,e,n){var r=t.getContext("2d"),i=e.fontOptions+" "+e.fontSize+"px "+e.font; | ||
if(e.displayValue){var o,a;a="top"==e.textPosition?e.marginTop+e.fontSize-e.textMargin:e.height+e.textMargin+e.marginTop+e.fontSize,r.font=i,"left"==e.textAlign||n.barcodePadding>0?(o=0,r.textAlign="left"):"right"==e.textAlign?(o=n.width-1,r.textAlign="right"):(o=n.width/2,r.textAlign="center"),r.fillText(n.text,o,a)}}function u(t,e){var n=t.getContext("2d");n.translate(e.width,0)}function f(t){var e=t.getContext("2d");e.restore()}Object.defineProperty(e,"__esModule",{value:!0});var c=n(31),l=r(c);e["default"]=i},function(t,e){"use strict";function n(t,e){var n,r={};for(n in t)t.hasOwnProperty(n)&&(r[n]=t[n]);for(n in e)e.hasOwnProperty(n)&&"undefined"!=typeof e[n]&&(r[n]=e[n]);return r}Object.defineProperty(e,"__esModule",{value:!0}),e["default"]=n},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t,e,n){var r=n.marginLeft;o(t,n,e);for(var i=0;i<e.length;i++){var u=(0,d["default"])(n,e[i].options),l=f(r,u.marginTop,t);c(l,u,e[i]),a(l,u,e[i]),s(l,u,e[i]),r+=e[i].width}}function o(t,e,n){for(;t.firstChild;)t.removeChild(t.firstChild);for(var r=0,i=0,o=0;o<n.length;o++){var a=(0,d["default"])(a,n[o].options),s=u(n[o].text,t,a),f=n[o].data.length*a.width;n[o].width=Math.ceil(Math.max(s,f));var c=a.height+(a.displayValue&&n[o].text.length>0?a.fontSize:0)+a.textMargin+a.marginTop+a.marginBottom,l=0;a.displayValue&&f<s&&("center"==a.textAlign?l=Math.floor((s-f)/2):"left"==a.textAlign?l=0:"right"==a.textAlign&&(l=Math.floor(s-f))),n[o].barcodePadding=l,c>i&&(i=c),r+=n[o].width}var h=r+e.marginLeft+e.marginRight,g=i;t.setAttribute("width",h+"px"),t.setAttribute("height",g+"px"),t.setAttribute("x","0px"),t.setAttribute("y","0px"),t.setAttribute("viewBox","0 0 "+h+" "+g),t.setAttribute("xmlns",p),t.setAttribute("version","1.1"),t.style.transform="translate(0,0)",e.background&&(t.style.background=e.background)}function a(t,e,n){var r,i,o=n.data;r="top"==e.textPosition?e.fontSize+e.textMargin:0,i=e.height;for(var a=0,s=0;s<o.length;s++){var u=s*e.width+n.barcodePadding;"1"===o[s]?a++:a>0&&(l(u-e.width*a,r,e.width*a,e.height,t),a=0)}a>0&&l(u-e.width*(a-1),r,e.width*a,e.height,t)}function s(t,e,n){var r=document.createElementNS(p,"text");if(e.displayValue){var i,o;r.setAttribute("style","font:"+e.fontOptions+" "+e.fontSize+"px "+e.font),o="top"==e.textPosition?e.fontSize-e.textMargin:e.height+e.textMargin+e.fontSize,"left"==e.textAlign||n.barcodePadding>0?(i=0,r.setAttribute("text-anchor","start")):"right"==e.textAlign?(i=n.width-1,r.setAttribute("text-anchor","end")):(i=n.width/2,r.setAttribute("text-anchor","middle")),r.setAttribute("x",i),r.setAttribute("y",o),r.appendChild(document.createTextNode(n.text)),t.appendChild(r)}}function u(t,e,n){var r=document.createElement("canvas").getContext("2d");r.font=n.fontOptions+" "+n.fontSize+"px "+n.font;var i=r.measureText(t).width;return i}function f(t,e,n){var r=document.createElementNS(p,"g");return r.setAttribute("transform","translate("+t+", "+e+")"),n.appendChild(r),r}function c(t,e,n){t.setAttribute("style","fill:"+e.lineColor+";")}function l(t,e,n,r,i){var o=document.createElementNS(p,"rect");o.setAttribute("x",t),o.setAttribute("y",e),o.setAttribute("width",n),o.setAttribute("height",r),i.appendChild(o)}Object.defineProperty(e,"__esModule",{value:!0});var h=n(31),d=r(h);e["default"]=i;var p="http://www.w3.org/2000/svg"},function(t,e){"use strict";function n(t){function e(t){if(Array.isArray(t))for(var r=0;r<t.length;r++)e(t[r]);else t.text=t.text||"",t.data=t.data||"",n.push(t)}var n=[];return e(t),n}Object.defineProperty(e,"__esModule",{value:!0}),e["default"]=n},function(t,e){"use strict";function n(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}Object.defineProperty(e,"__esModule",{value:!0}),e["default"]=n},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t,e){var n={};for(var r in e)t.hasAttribute("jsbarcode-"+r.toLowerCase())&&(n[r]=t.getAttribute("jsbarcode-"+r.toLowerCase())),t.hasAttribute("data-"+r.toLowerCase())&&(n[r]=t.getAttribute("data-"+r.toLowerCase()));return n.value=t.getAttribute("jsbarcode-value")||t.getAttribute("data-value"),n=(0,a["default"])(n)}Object.defineProperty(e,"__esModule",{value:!0});var o=n(36),a=r(o);e["default"]=i},function(t,e){"use strict";function n(t){var e=["width","height","textMargin","fontSize","margin","marginTop","marginBottom","marginLeft","marginRight"];for(var n in e)n=e[n],"string"==typeof t[n]&&(t[n]=parseInt(t[n],10));return"string"==typeof t.displayValue&&(t.displayValue="false"!=t.displayValue),t}Object.defineProperty(e,"__esModule",{value:!0}),e["default"]=n}])}); | ||
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("barcode",[],e):"object"==typeof exports?exports.barcode=e():t.barcode=e()}(this,function(){return function(t){function e(r){if(n[r])return n[r].exports;var i=n[r]={exports:{},id:r,loaded:!1};return t[r].call(i.exports,i,i.exports,e),i.loaded=!0,i.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}([function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(1),o=r(i),a=angular.module("barcode",[]);a.directive("barcode",o["default"].directiveFactory),e["default"]=a,t.exports=e["default"]},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var o=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),a=n(2),s=r(a),u=function(){function t(){i(this,t),this.defaults={format:"CODE128",lineColor:"#000000",width:2,height:100,displayValue:!0,fontOptions:"",font:"monospace",textAlign:"center",textPosition:"bottom",textMargin:2,fontSize:20,background:"#ffffff",margin:10,marginTop:void 0,marginBottom:void 0,marginLeft:void 0,marginRight:void 0,valid:function(t){}},this.replace=!0,this.restrict="E",this.scope={bcType:"@",bcText:"@",bcClass:"@?",bcFormat:"@?",bcLineColor:"@?",bcWidth:"@?",bcHeight:"@?",bcDisplayValue:"@?",bcFontOptions:"@?",bcFont:"@?",bcTextAlign:"@?",bcTextPosition:"@?",bcTextMargin:"@?",bcFontSize:"@?",bcBackground:"@?",bcMargin:"@?",bcMarginTop:"@?",bcMarginBottom:"@?",bcMarginLeft:"@?",bcMarginRight:"@?",bcValid:"=?"},this.template=t.resolveTemplate}return o(t,null,[{key:"resolveTemplate",value:function(t,e){var n=e.bcClass||"barcode";switch(e.bcType){case"svg":return'<svg class="'+n+'"></svg>';case"img":return'<img class="'+n+'">';case"canvas":return'<canvas class="'+n+'"></canvas>'}}}]),o(t,[{key:"link",value:function(t,e,n){var r=this;t.$watch(function(){void 0!==t.bcText&&t.bcText.length>0&&(0,s["default"])(e[0],t.bcText,{format:t.bcFormat||r.defaults.format,lineColor:t.bcLineColor||r.defaults.lineColor,width:parseInt(t.bcWidth,10)||r.defaults.width,height:parseInt(t.bcHeight,10)||r.defaults.height,displayValue:"true"===t.bcDisplayValue||r.defaults.displayValue,fontOptions:t.bcFontOptions||r.defaults.fontOptions,font:t.bcFont||r.defaults.font,textAlign:t.bcTextAlign||r.defaults.textAlign,textPosition:t.bcTextPosition||r.defaults.textPosition,textMargin:parseInt(t.bcTextMargin,10)||r.defaults.textMargin,fontSize:parseInt(t.bcFontSize,10)||r.defaults.fontSize,background:t.bcBackground||r.defaults.background,margin:parseInt(t.bcMargin,10)||r.defaults.margin,marginTop:parseInt(t.bcMarginTop,10)||r.defaults.marginTop,marginBottom:parseInt(t.bcMarginBottom,10)||r.defaults.marginBottom,marginLeft:parseInt(t.bcMarginLeft,10)||r.defaults.marginLeft,marginRight:parseInt(t.bcMarginRight,10)||r.defaults.marginRight,valid:t.bcValid||r.defaults.valid})})}}],[{key:"directiveFactory",value:function(){return t.instance=new t,t.instance}}]),t}();e["default"]=u,u.directiveFactory.$inject=[],t.exports=e["default"]},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t,e){_.prototype[e]=_.prototype[e.toUpperCase()]=_.prototype[e.toLowerCase()]=function(n,r){var i=(0,p["default"])(this._options,r),a=t[e],s=o(n,a,i);return this._encodings.push(s),this}}function o(t,e,n){t=""+t;var r=new e(t,n);if(!r.valid()){if(n.valid===M.valid)throw new Error('"'+t+'" is not a valid input for '+w);n.valid(!1)}var i=r.encode();i=(0,y["default"])(i);for(var o=0;o<i.length;o++)i[o].options=(0,p["default"])(n,i[o].options);return i}function a(){return f["default"].CODE128?"CODE128":Object.keys(f["default"])[0]}function s(t,e,n){var r=h["default"][t.renderer];e=(0,y["default"])(e);for(var i=0;i<e.length;i++)e[i].options=(0,p["default"])(n,e[i].options),(0,b["default"])(e[i].options);(0,b["default"])(n),r(t.element,e,n),t.afterRender&&t.afterRender()}function u(t){if("string"==typeof t){var e=document.querySelectorAll(t);if(0===e.length)throw new Error("No element found");for(var n=[],r=0;r<e.length;r++)n.push(u(e[r]));return n}if(Array.isArray(t)){for(var n=[],r=0;r<t.length;r++)n.push(u(t[r]));return n}if("undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLImageElement){var i=document.createElement("canvas");return{element:i,options:(0,m["default"])(t,M),renderer:"canvas",afterRender:function(){t.setAttribute("src",i.toDataURL())}}}if("undefined"!=typeof SVGElement&&t instanceof SVGElement)return{element:t,options:(0,m["default"])(t,M),renderer:"svg"};if("undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement)return{element:t,options:(0,m["default"])(t,M),renderer:"canvas"};if(t.getContext)return{element:t,renderer:"canvas"};throw new Error("Not supported type to render on.")}var c=n(3),f=r(c),l=n(29),h=r(l),d=n(31),p=r(d),g=n(33),y=r(g),v=n(34),b=r(v),x=n(35),m=r(x),_=function(){},C=function(t,e,n){var r=new _;if("undefined"==typeof t)throw Error("No element to render on was provided.");return r._renderProperties=u(t),r._encodings=[],r._options=M,"undefined"!=typeof e&&(n=n||{},n.format||(n.format=a()),r.options(n),r[n.format](e,n),r.render()),r};C.getModule=function(t){return f["default"][t]};for(var w in f["default"])f["default"].hasOwnProperty(w)&&i(f["default"],w);_.prototype.options=function(t){return this._options=(0,p["default"])(this._options,t),this},_.prototype.blank=function(t){var e="0".repeat(t);return this._encodings.push({data:e}),this},_.prototype.init=function(){Array.isArray(this._renderProperties)||(this._renderProperties=[this._renderProperties]);var t;for(var e in this._renderProperties){t=this._renderProperties[e];var n=(0,p["default"])(this._options,t.options);"auto"==n.format&&(n.format=a());var r=n.value,i=f["default"][n.format.toUpperCase()],u=o(r,i,n);s(t,u,n)}},_.prototype.render=function(){if(Array.isArray(this._renderProperties))for(var t in this._renderProperties)s(this._renderProperties[t],this._encodings,this._options);else s(this._renderProperties,this._encodings,this._options);return this._options.valid(!0),this},"undefined"!=typeof window&&(window.JsBarcode=C),"undefined"!=typeof jQuery&&(jQuery.fn.JsBarcode=function(t,e){var n=[];return jQuery(this).each(function(){n.push(this)}),C(n,t,e)}),t.exports=C;var M={width:2,height:100,format:"auto",displayValue:!0,fontOptions:"",font:"monospace",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(t){}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(4),i=n(5),o=n(11),a=n(18),s=n(19),u=n(20),c=n(27),f=n(28);e["default"]={CODE39:r.CODE39,CODE128:i.CODE128,CODE128A:i.CODE128A,CODE128B:i.CODE128B,CODE128C:i.CODE128C,EAN13:o.EAN13,EAN8:o.EAN8,EAN5:o.EAN5,EAN2:o.EAN2,UPC:o.UPC,ITF14:a.ITF14,ITF:s.ITF,MSI:u.MSI,MSI10:u.MSI10,MSI11:u.MSI11,MSI1010:u.MSI1010,MSI1110:u.MSI1110,pharmacode:c.pharmacode,GenericBarcode:f.GenericBarcode}},function(t,e){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(e,r){n(this,t),this.string=e.toUpperCase(),this.mod43Enabled=r.mod43||!1,this.characters=["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","-","."," ","$","/","+","%","*"],this.encodings=[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]}return t.prototype.getEncoding=function(t){return this.getBinary(this.characterValue(t))},t.prototype.getBinary=function(t){return this.encodings[t].toString(2)},t.prototype.getCharacter=function(t){return this.characters[t]},t.prototype.characterValue=function(t){return this.characters.indexOf(t)},t.prototype.encode=function(){for(var t=this.string,e=this.getEncoding("*"),n=0;n<this.string.length;n++)e+=this.getEncoding(this.string[n])+"0";if(this.mod43Enabled){for(var r=0,n=0;n<this.string.length;n++)r+=this.characterValue(this.string[n]);r%=43,e+=this.getBinary(r)+"0",t+=this.getCharacter(r)}return e+=this.getEncoding("*"),{data:e,text:t}},t.prototype.valid=function(){return this.string.search(/^[0-9A-Z\-\.\ \$\/\+\%]+$/)!==-1},t}();e.CODE39=r},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0}),e.CODE128C=e.CODE128B=e.CODE128A=e.CODE128=void 0;var i=n(6),o=r(i),a=n(8),s=r(a),u=n(9),c=r(u),f=n(10),l=r(f);e.CODE128=o["default"],e.CODE128A=s["default"],e.CODE128B=c["default"],e.CODE128C=l["default"]},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)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)}function s(t){var e,n=t.match(/^[\x00-\x5F\xC8-\xCF]*/)[0].length,r=t.match(/^[\x20-\x7F\xC8-\xCF]*/)[0].length,i=t.match(/^(\xCF*[0-9]{2}\xCF*)*/)[0].length;return e=i>=2?String.fromCharCode(210)+f(t):n>r?String.fromCharCode(208)+u(t):String.fromCharCode(209)+c(t),e=e.replace(/[\xCD\xCE]([^])[\xCD\xCE]/,function(t,e){return String.fromCharCode(203)+e})}function u(t){var e=t.match(/^([\x00-\x5F\xC8-\xCF]+?)(([0-9]{2}){2,})([^0-9]|$)/);if(e)return e[1]+String.fromCharCode(204)+f(t.substring(e[1].length));var n=t.match(/^[\x00-\x5F\xC8-\xCF]+/);return n[0].length===t.length?t:n[0]+String.fromCharCode(205)+c(t.substring(n[0].length))}function c(t){var e=t.match(/^([\x20-\x7F\xC8-\xCF]+?)(([0-9]{2}){2,})([^0-9]|$)/);if(e)return e[1]+String.fromCharCode(204)+f(t.substring(e[1].length));var n=t.match(/^[\x20-\x7F\xC8-\xCF]+/);return n[0].length===t.length?t:n[0]+String.fromCharCode(206)+u(t.substring(n[0].length))}function f(t){var e=t.match(/^(\xCF*[0-9]{2}\xCF*)+/)[0],n=e.length;if(n===t.length)return t;t=t.substring(n);var r=t.match(/^[\x00-\x5F\xC8-\xCF]*/)[0].length,i=t.match(/^[\x20-\x7F\xC8-\xCF]*/)[0].length;return r>=i?e+String.fromCharCode(206)+u(t):e+String.fromCharCode(205)+c(t)}Object.defineProperty(e,"__esModule",{value:!0});var l=n(7),h=r(l),d=function(t){function e(n){i(this,e);var r=o(this,t.call(this,n));if(n.search(/^[\x00-\x7F\xC8-\xD3]+$/)!==-1)var r=o(this,t.call(this,s(n)));else var r=o(this,t.call(this,n));return o(r)}return a(e,t),e}(h["default"]);e["default"]=d},function(t,e){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(e){n(this,t),this.bytes=[];for(var r=0;r<e.length;++r)this.bytes.push(e.charCodeAt(r));this.string=e.substring(1),this.encodings=[740,644,638,176,164,100,224,220,124,608,604,572,436,244,230,484,260,254,650,628,614,764,652,902,868,836,830,892,844,842,752,734,590,304,112,94,416,128,122,672,576,570,464,422,134,496,478,142,910,678,582,768,762,774,880,862,814,896,890,818,914,602,930,328,292,200,158,68,62,424,412,232,218,76,74,554,616,978,556,146,340,212,182,508,268,266,956,940,938,758,782,974,400,310,118,512,506,960,954,502,518,886,966,668,680,692,5379]}return t.prototype.encode=function(){var t,e=this.bytes,n=e.shift()-105;return 103===n?t=this.nextA(e,1):104===n?t=this.nextB(e,1):105===n&&(t=this.nextC(e,1)),{text:this.string.replace(/[^\x20-\x7E]/g,""),data:this.getEncoding(n)+t.result+this.getEncoding((t.checksum+n)%103)+this.getEncoding(106)}},t.prototype.getEncoding=function(t){return this.encodings[t]?(this.encodings[t]+1e3).toString(2):""},t.prototype.valid=function(){return this.string.search(/^[\x00-\x7F\xC8-\xD3]+$/)!==-1},t.prototype.nextA=function(t,e){if(t.length<=0)return{result:"",checksum:0};var n,r;if(t[0]>=200)r=t[0]-105,t.shift(),99===r?n=this.nextC(t,e+1):100===r?n=this.nextB(t,e+1):98===r?(t[0]=t[0]>95?t[0]-96:t[0],n=this.nextA(t,e+1)):n=this.nextA(t,e+1);else{var i=t[0];r=i<32?i+64:i-32,t.shift(),n=this.nextA(t,e+1)}var o=this.getEncoding(r),a=r*e;return{result:o+n.result,checksum:a+n.checksum}},t.prototype.nextB=function(t,e){if(t.length<=0)return{result:"",checksum:0};var n,r;t[0]>=200?(r=t[0]-105,t.shift(),99===r?n=this.nextC(t,e+1):101===r?n=this.nextA(t,e+1):98===r?(t[0]=t[0]<32?t[0]+96:t[0],n=this.nextB(t,e+1)):n=this.nextB(t,e+1)):(r=t[0]-32,t.shift(),n=this.nextB(t,e+1));var i=this.getEncoding(r),o=r*e;return{result:i+n.result,checksum:o+n.checksum}},t.prototype.nextC=function(t,e){if(t.length<=0)return{result:"",checksum:0};var n,r;t[0]>=200?(r=t[0]-105,t.shift(),n=100===r?this.nextB(t,e+1):101===r?this.nextA(t,e+1):this.nextC(t,e+1)):(r=10*(t[0]-48)+t[1]-48,t.shift(),t.shift(),n=this.nextC(t,e+1));var i=this.getEncoding(r),o=r*e;return{result:i+n.result,checksum:o+n.checksum}},t}();e["default"]=r},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)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)}Object.defineProperty(e,"__esModule",{value:!0});var s=n(7),u=r(s),c=function(t){function e(n){return i(this,e),o(this,t.call(this,String.fromCharCode(208)+n))}return a(e,t),e.prototype.valid=function(){return this.string.search(/^[\x00-\x5F\xC8-\xCF]+$/)!==-1},e}(u["default"]);e["default"]=c},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)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)}Object.defineProperty(e,"__esModule",{value:!0});var s=n(7),u=r(s),c=function(t){function e(n){return i(this,e),o(this,t.call(this,String.fromCharCode(209)+n))}return a(e,t),e.prototype.valid=function(){return this.string.search(/^[\x20-\x7F\xC8-\xCF]+$/)!==-1},e}(u["default"]);e["default"]=c},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)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)}Object.defineProperty(e,"__esModule",{value:!0});var s=n(7),u=r(s),c=function(t){function e(n){return i(this,e),o(this,t.call(this,String.fromCharCode(210)+n))}return a(e,t),e.prototype.valid=function(){return this.string.search(/^(\xCF*[0-9]{2}\xCF*)+$/)!==-1},e}(u["default"]);e["default"]=c},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0}),e.UPC=e.EAN2=e.EAN5=e.EAN8=e.EAN13=void 0;var i=n(12),o=r(i),a=n(14),s=r(a),u=n(15),c=r(u),f=n(16),l=r(f),h=n(17),d=r(h);e.EAN13=o["default"],e.EAN8=s["default"],e.EAN5=c["default"],e.EAN2=l["default"],e.UPC=d["default"]},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var o=n(13),a=r(o),s=function(){function t(e,n){i(this,t),e.search(/^[0-9]{12}$/)!==-1?this.string=e+this.checksum(e):this.string=e,this.displayValue=n.displayValue,this.structure=["LLLLLL","LLGLGG","LLGGLG","LLGGGL","LGLLGG","LGGLLG","LGGGLL","LGLGLG","LGLGGL","LGGLGL"],n.fontSize>10*n.width?this.fontSize=10*n.width:this.fontSize=n.fontSize,this.guardHeight=n.height+this.fontSize/2+n.textMargin,this.lastChar=n.lastChar}return t.prototype.valid=function(){return this.string.search(/^[0-9]{13}$/)!==-1&&this.string[12]==this.checksum(this.string)},t.prototype.encode=function(){var t=new a["default"],e=[],n=this.structure[this.string[0]],r=this.string.substr(1,6),i=this.string.substr(7,6);return this.displayValue&&e.push({data:"000000000000",text:this.string[0],options:{textAlign:"left",fontSize:this.fontSize}}),e.push({data:"101",options:{height:this.guardHeight}}),e.push({data:t.encode(r,n),text:r,options:{fontSize:this.fontSize}}),e.push({data:"01010",options:{height:this.guardHeight}}),e.push({data:t.encode(i,"RRRRRR"),text:i,options:{fontSize:this.fontSize}}),e.push({data:"101",options:{height:this.guardHeight}}),this.lastChar&&this.displayValue&&(e.push({data:"00"}),e.push({data:"00000",text:this.lastChar,options:{fontSize:this.fontSize}})),e},t.prototype.checksum=function(t){var e,n=0;for(e=0;e<12;e+=2)n+=parseInt(t[e]);for(e=1;e<12;e+=2)n+=3*parseInt(t[e]);return(10-n%10)%10},t}();e["default"]=s},function(t,e){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(){n(this,t),this.startBin="101",this.endBin="101",this.middleBin="01010",this.Lbinary=["0001101","0011001","0010011","0111101","0100011","0110001","0101111","0111011","0110111","0001011"],this.Gbinary=["0100111","0110011","0011011","0100001","0011101","0111001","0000101","0010001","0001001","0010111"],this.Rbinary=["1110010","1100110","1101100","1000010","1011100","1001110","1010000","1000100","1001000","1110100"]}return t.prototype.encode=function(t,e,n){var r="";n=n||"";for(var i=0;i<t.length;i++)"L"==e[i]?r+=this.Lbinary[t[i]]:"G"==e[i]?r+=this.Gbinary[t[i]]:"R"==e[i]&&(r+=this.Rbinary[t[i]]),i<t.length-1&&(r+=n);return r},t}();e["default"]=r},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var o=n(13),a=r(o),s=function(){function t(e){i(this,t),e.search(/^[0-9]{7}$/)!==-1?this.string=e+this.checksum(e):this.string=e}return t.prototype.valid=function(){return this.string.search(/^[0-9]{8}$/)!==-1&&this.string[7]==this.checksum(this.string)},t.prototype.encode=function(){var t=new a["default"],e="",n=this.string.substr(0,4),r=this.string.substr(4,4);return e+=t.startBin,e+=t.encode(n,"LLLL"),e+=t.middleBin,e+=t.encode(r,"RRRR"),e+=t.endBin,{data:e,text:this.string}},t.prototype.checksum=function(t){var e,n=0;for(e=0;e<7;e+=2)n+=3*parseInt(t[e]);for(e=1;e<7;e+=2)n+=parseInt(t[e]);return(10-n%10)%10},t}();e["default"]=s},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var o=n(13),a=r(o),s=function(){function t(e){i(this,t),this.string=e,this.structure=["GGLLL","GLGLL","GLLGL","GLLLG","LGGLL","LLGGL","LLLGG","LGLGL","LGLLG","LLGLG"]}return t.prototype.valid=function(){return this.string.search(/^[0-9]{5}$/)!==-1},t.prototype.encode=function(){var t=new a["default"],e=this.checksum(),n="1011";return n+=t.encode(this.string,this.structure[e],"01"),{data:n,text:this.string}},t.prototype.checksum=function(){var t=0;return t+=3*parseInt(this.string[0]),t+=9*parseInt(this.string[1]),t+=3*parseInt(this.string[2]),t+=9*parseInt(this.string[3]),t+=3*parseInt(this.string[4]),t%10},t}();e["default"]=s},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var o=n(13),a=r(o),s=function(){function t(e){i(this,t),this.string=e,this.structure=["LL","LG","GL","GG"]}return t.prototype.valid=function(){return this.string.search(/^[0-9]{2}$/)!==-1},t.prototype.encode=function(){var t=new a["default"],e=this.structure[parseInt(this.string)%4],n="1011";return n+=t.encode(this.string,e,"01"),{data:n,text:this.string}},t}();e["default"]=s},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var o=n(13),a=r(o),s=function(){function t(e,n){i(this,t),e.search(/^[0-9]{11}$/)!==-1?this.string=e+this.checksum(e):this.string=e,this.displayValue=n.displayValue,n.fontSize>10*n.width?this.fontSize=10*n.width:this.fontSize=n.fontSize,this.guardHeight=n.height+this.fontSize/2+n.textMargin}return t.prototype.valid=function(){return this.string.search(/^[0-9]{12}$/)!==-1&&this.string[11]==this.checksum(this.string)},t.prototype.encode=function(){var t=new a["default"],e=[];return this.displayValue&&e.push({data:"00000000",text:this.string[0],options:{textAlign:"left",fontSize:this.fontSize}}),e.push({data:"101"+t.encode(this.string[0],"L"),options:{height:this.guardHeight}}),e.push({data:t.encode(this.string.substr(1,5),"LLLLL"),text:this.string.substr(1,5),options:{fontSize:this.fontSize}}),e.push({data:"01010",options:{height:this.guardHeight}}),e.push({data:t.encode(this.string.substr(6,5),"RRRRR"),text:this.string.substr(6,5),options:{fontSize:this.fontSize}}),e.push({data:t.encode(this.string[11],"R")+"101",options:{height:this.guardHeight}}),this.displayValue&&e.push({data:"00000000",text:this.string[11],options:{textAlign:"right",fontSize:this.fontSize}}),e},t.prototype.checksum=function(t){var e,n=0;for(e=1;e<11;e+=2)n+=parseInt(t[e]);for(e=0;e<11;e+=2)n+=3*parseInt(t[e]);return(10-n%10)%10},t}();e["default"]=s},function(t,e){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(e){n(this,t),this.string=e,e.search(/^[0-9]{13}$/)!==-1&&(this.string+=this.checksum(e)),this.binaryRepresentation={0:"00110",1:"10001",2:"01001",3:"11000",4:"00101",5:"10100",6:"01100",7:"00011",8:"10010",9:"01010"}}return t.prototype.valid=function(){return this.string.search(/^[0-9]{14}$/)!==-1&&this.string[13]==this.checksum()},t.prototype.encode=function(){for(var t="1010",e=0;e<14;e+=2)t+=this.calculatePair(this.string.substr(e,2));return t+="11101",{data:t,text:this.string}},t.prototype.calculatePair=function(t){for(var e="",n=this.binaryRepresentation[t[0]],r=this.binaryRepresentation[t[1]],i=0;i<5;i++)e+="1"==n[i]?"111":"1",e+="1"==r[i]?"000":"0";return e},t.prototype.checksum=function(){for(var t=0,e=0;e<13;e++)t+=parseInt(this.string[e])*(3-e%2*2);return 10-t%10},t}();e.ITF14=r},function(t,e){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(e){n(this,t),this.string=e,this.binaryRepresentation={0:"00110",1:"10001",2:"01001",3:"11000",4:"00101",5:"10100",6:"01100",7:"00011",8:"10010",9:"01010"}}return t.prototype.valid=function(){return this.string.search(/^([0-9]{2})+$/)!==-1},t.prototype.encode=function(){for(var t="1010",e=0;e<this.string.length;e+=2)t+=this.calculatePair(this.string.substr(e,2));return t+="11101",{data:t,text:this.string}},t.prototype.calculatePair=function(t){for(var e="",n=this.binaryRepresentation[t[0]],r=this.binaryRepresentation[t[1]],i=0;i<5;i++)e+="1"==n[i]?"111":"1",e+="1"==r[i]?"000":"0";return e},t}();e.ITF=r},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0}),e.MSI1110=e.MSI1010=e.MSI11=e.MSI10=e.MSI=void 0;var i=n(21),o=r(i),a=n(22),s=r(a),u=n(24),c=r(u),f=n(25),l=r(f),h=n(26),d=r(h);e.MSI=o["default"],e.MSI10=s["default"],e.MSI11=c["default"],e.MSI1010=l["default"],e.MSI1110=d["default"]},function(t,e){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function r(t,e){for(var n=0;n<e;n++)t="0"+t;return t}Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(e){n(this,t),this.string=e}return t.prototype.encode=function(){for(var t="110",e=0;e<this.string.length;e++){var n=parseInt(this.string[e]),i=n.toString(2);i=r(i,4-i.length);for(var o=0;o<i.length;o++)t+="0"==i[o]?"100":"110"}return t+="1001",{data:t,text:this.string}},t.prototype.valid=function(){return this.string.search(/^[0-9]+$/)!==-1},t}();e["default"]=i},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)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)}Object.defineProperty(e,"__esModule",{value:!0});var s=n(21),u=r(s),c=n(23),f=function(t){function e(n){i(this,e);var r=o(this,t.call(this,n));return r.string+=(0,c.mod10)(r.string),r}return a(e,t),e}(u["default"]);e["default"]=f},function(t,e){"use strict";function n(t){for(var e=0,n=0;n<t.length;n++){var r=parseInt(t[n]);e+=(n+t.length)%2===0?r:2*r%10+Math.floor(2*r/10)}return(10-e%10)%10}function r(t){for(var e=0,n=[2,3,4,5,6,7],r=0;r<t.length;r++){var i=parseInt(t[t.length-1-r]);e+=n[r%n.length]*i}return(11-e%11)%11}Object.defineProperty(e,"__esModule",{value:!0}),e.mod10=n,e.mod11=r},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)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)}Object.defineProperty(e,"__esModule",{value:!0});var s=n(21),u=r(s),c=n(23),f=function(t){function e(n){i(this,e);var r=o(this,t.call(this,n));return r.string+=(0,c.mod11)(r.string),r}return a(e,t),e}(u["default"]);e["default"]=f},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)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)}Object.defineProperty(e,"__esModule",{value:!0});var s=n(21),u=r(s),c=n(23),f=function(t){function e(n){i(this,e);var r=o(this,t.call(this,n));return r.string+=(0,c.mod10)(r.string),r.string+=(0,c.mod10)(r.string),r}return a(e,t),e}(u["default"]);e["default"]=f},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)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)}Object.defineProperty(e,"__esModule",{value:!0});var s=n(21),u=r(s),c=n(23),f=function(t){function e(n){i(this,e);var r=o(this,t.call(this,n));return r.string+=(0,c.mod11)(r.string),r.string+=(0,c.mod10)(r.string),r}return a(e,t),e}(u["default"]);e["default"]=f},function(t,e){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(e){n(this,t),this.number=parseInt(e,10)}return t.prototype.encode=function(){for(var t=this.number,e="";!isNaN(t)&&0!=t;)t%2===0?(e="11100"+e,t=(t-2)/2):(e="100"+e,t=(t-1)/2);return e=e.slice(0,-2),{data:e,text:this.number+""}},t.prototype.valid=function(){return this.number>=3&&this.number<=131070},t}();e.pharmacode=r},function(t,e){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(e){n(this,t),this.string=e}return t.prototype.encode=function(){return{data:"10101010101010101010101010101010101010101",text:this.string}},t.prototype.valid=function(){return!0},t}();e.GenericBarcode=r},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(30),o=r(i),a=n(32),s=r(a);e["default"]={canvas:o["default"],svg:s["default"]}},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t,e,n){if(!t.getContext)throw new Error("The browser does not support canvas.");o(t,n,e);for(var r=0;r<e.length;r++){var i=(0,l["default"])(n,e[r].options);a(t,i,e[r]),s(t,i,e[r]),u(t,e[r])}c(t)}function o(t,e,n){var r=t.getContext("2d");r.save();for(var i=0,o=0,a=0;a<n.length;a++){var s=(0,l["default"])(s,n[a].options);r.font=s.fontOptions+" "+s.fontSize+"px "+s.font;var u=r.measureText(n[a].text).width,c=n[a].data.length*s.width;n[a].width=Math.ceil(Math.max(u,c));var f=s.height+(s.displayValue&&n[a].text.length>0?s.fontSize:0)+s.textMargin+s.marginTop+s.marginBottom,h=0;s.displayValue&&c<u&&("center"==s.textAlign?h=Math.floor((u-c)/2):"left"==s.textAlign?h=0:"right"==s.textAlign&&(h=Math.floor(u-c))), | ||
n[a].barcodePadding=h,f>o&&(o=f),i+=n[a].width}t.width=i+e.marginLeft+e.marginRight,t.height=o,r.clearRect(0,0,t.width,t.height),e.background&&(r.fillStyle=e.background,r.fillRect(0,0,t.width,t.height)),r.translate(e.marginLeft,0)}function a(t,e,n){var r,i,o=t.getContext("2d"),a=n.data;r="top"==e.textPosition?e.marginTop+e.fontSize+e.textMargin:e.marginTop,i=e.height,o.fillStyle=e.lineColor;for(var s=0;s<a.length;s++){var u=s*e.width+n.barcodePadding;"1"===a[s]?o.fillRect(u,r,e.width,e.height):a[s]&&o.fillRect(u,r,e.width,e.height*a[s])}}function s(t,e,n){var r=t.getContext("2d"),i=e.fontOptions+" "+e.fontSize+"px "+e.font;if(e.displayValue){var o,a;a="top"==e.textPosition?e.marginTop+e.fontSize-e.textMargin:e.height+e.textMargin+e.marginTop+e.fontSize,r.font=i,"left"==e.textAlign||n.barcodePadding>0?(o=0,r.textAlign="left"):"right"==e.textAlign?(o=n.width-1,r.textAlign="right"):(o=n.width/2,r.textAlign="center"),r.fillText(n.text,o,a)}}function u(t,e){var n=t.getContext("2d");n.translate(e.width,0)}function c(t){var e=t.getContext("2d");e.restore()}Object.defineProperty(e,"__esModule",{value:!0});var f=n(31),l=r(f);e["default"]=i},function(t,e){"use strict";function n(t,e){var n,r={};for(n in t)t.hasOwnProperty(n)&&(r[n]=t[n]);for(n in e)e.hasOwnProperty(n)&&"undefined"!=typeof e[n]&&(r[n]=e[n]);return r}Object.defineProperty(e,"__esModule",{value:!0}),e["default"]=n},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t,e,n){var r=n.marginLeft;o(t,n,e);for(var i=0;i<e.length;i++){var u=(0,d["default"])(n,e[i].options),l=c(r,u.marginTop,t);f(l,u,e[i]),a(l,u,e[i]),s(l,u,e[i]),r+=e[i].width}}function o(t,e,n){for(;t.firstChild;)t.removeChild(t.firstChild);for(var r=0,i=0,o=0;o<n.length;o++){var a=(0,d["default"])(a,n[o].options),s=u(n[o].text,t,a),c=n[o].data.length*a.width;n[o].width=Math.ceil(Math.max(s,c));var f=a.height+(a.displayValue&&n[o].text.length>0?a.fontSize:0)+a.textMargin+a.marginTop+a.marginBottom,l=0;a.displayValue&&c<s&&("center"==a.textAlign?l=Math.floor((s-c)/2):"left"==a.textAlign?l=0:"right"==a.textAlign&&(l=Math.floor(s-c))),n[o].barcodePadding=l,f>i&&(i=f),r+=n[o].width}var h=r+e.marginLeft+e.marginRight,g=i;t.setAttribute("width",h+"px"),t.setAttribute("height",g+"px"),t.setAttribute("x","0px"),t.setAttribute("y","0px"),t.setAttribute("viewBox","0 0 "+h+" "+g),t.setAttribute("xmlns",p),t.setAttribute("version","1.1"),t.style.transform="translate(0,0)",e.background&&(t.style.background=e.background)}function a(t,e,n){var r,i,o=n.data;r="top"==e.textPosition?e.fontSize+e.textMargin:0,i=e.height;for(var a=0,s=0;s<o.length;s++){var u=s*e.width+n.barcodePadding;"1"===o[s]?a++:a>0&&(l(u-e.width*a,r,e.width*a,e.height,t),a=0)}a>0&&l(u-e.width*(a-1),r,e.width*a,e.height,t)}function s(t,e,n){var r=document.createElementNS(p,"text");if(e.displayValue){var i,o;r.setAttribute("style","font:"+e.fontOptions+" "+e.fontSize+"px "+e.font),o="top"==e.textPosition?e.fontSize-e.textMargin:e.height+e.textMargin+e.fontSize,"left"==e.textAlign||n.barcodePadding>0?(i=0,r.setAttribute("text-anchor","start")):"right"==e.textAlign?(i=n.width-1,r.setAttribute("text-anchor","end")):(i=n.width/2,r.setAttribute("text-anchor","middle")),r.setAttribute("x",i),r.setAttribute("y",o),r.appendChild(document.createTextNode(n.text)),t.appendChild(r)}}function u(t,e,n){var r=document.createElement("canvas").getContext("2d");r.font=n.fontOptions+" "+n.fontSize+"px "+n.font;var i=r.measureText(t).width;return i}function c(t,e,n){var r=document.createElementNS(p,"g");return r.setAttribute("transform","translate("+t+", "+e+")"),n.appendChild(r),r}function f(t,e,n){t.setAttribute("style","fill:"+e.lineColor+";")}function l(t,e,n,r,i){var o=document.createElementNS(p,"rect");o.setAttribute("x",t),o.setAttribute("y",e),o.setAttribute("width",n),o.setAttribute("height",r),i.appendChild(o)}Object.defineProperty(e,"__esModule",{value:!0});var h=n(31),d=r(h);e["default"]=i;var p="http://www.w3.org/2000/svg"},function(t,e){"use strict";function n(t){function e(t){if(Array.isArray(t))for(var r=0;r<t.length;r++)e(t[r]);else t.text=t.text||"",t.data=t.data||"",n.push(t)}var n=[];return e(t),n}Object.defineProperty(e,"__esModule",{value:!0}),e["default"]=n},function(t,e){"use strict";function n(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}Object.defineProperty(e,"__esModule",{value:!0}),e["default"]=n},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t,e){var n={};for(var r in e)t.hasAttribute("jsbarcode-"+r.toLowerCase())&&(n[r]=t.getAttribute("jsbarcode-"+r.toLowerCase())),t.hasAttribute("data-"+r.toLowerCase())&&(n[r]=t.getAttribute("data-"+r.toLowerCase()));return n.value=t.getAttribute("jsbarcode-value")||t.getAttribute("data-value"),n=(0,a["default"])(n)}Object.defineProperty(e,"__esModule",{value:!0});var o=n(36),a=r(o);e["default"]=i},function(t,e){"use strict";function n(t){var e=["width","height","textMargin","fontSize","margin","marginTop","marginBottom","marginLeft","marginRight"];for(var n in e)n=e[n],"string"==typeof t[n]&&(t[n]=parseInt(t[n],10));return"string"==typeof t.displayValue&&(t.displayValue="false"!=t.displayValue),t}Object.defineProperty(e,"__esModule",{value:!0}),e["default"]=n}])}); | ||
//# sourceMappingURL=barcode.min.js.map |
{ | ||
"name": "angular-barcode", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"description": "An angular directive for lindell's JsBarcode", | ||
@@ -39,2 +39,3 @@ "main": "dist/barcode.js", | ||
"babel-preset-es2015": "^6.9.0", | ||
"bootstrap": "^3.3.6", | ||
"jsbarcode": "^3.3.14", | ||
@@ -41,0 +42,0 @@ "loader-utils": "^0.2.15", |
@@ -8,4 +8,4 @@ 'use strict'; | ||
static resolveTemplate(element, attrs) { | ||
let cssClass = attrs.class || 'barcode'; | ||
switch(attrs.type) { | ||
let cssClass = attrs.bcClass || 'barcode'; | ||
switch(attrs.bcType) { | ||
case 'svg': | ||
@@ -25,3 +25,24 @@ return `<svg class="${cssClass}"></svg>`; | ||
this.defaults = { | ||
format: 'CODE128', | ||
lineColor: '#000000', | ||
width: 2, | ||
height: 100, | ||
displayValue: true, | ||
fontOptions: '', | ||
font: 'monospace', | ||
textAlign: 'center', | ||
textPosition: 'bottom', | ||
textMargin: 2, | ||
fontSize: 20, | ||
background: '#ffffff', | ||
margin: 10, | ||
marginTop: undefined, | ||
marginBottom: undefined, | ||
marginLeft: undefined, | ||
marginRight: undefined, | ||
valid: function(valid){} | ||
}; | ||
// Directive config | ||
@@ -31,24 +52,24 @@ this.replace = true; | ||
this.scope = { | ||
type: '@', | ||
text: '@', | ||
class: '@?', | ||
bcType: '@', | ||
bcText: '@', | ||
bcClass: '@?', | ||
// https://github.com/lindell/JsBarcode/wiki/Options#format | ||
format: '@?', | ||
lineColor: '@?', | ||
width: '@?', | ||
height: '@?', | ||
displayValue: '@?', | ||
fontOptions: '@?', | ||
font: '@?', | ||
textAlign: '@?', | ||
textPosition: '@?', | ||
textMargin: '@?', | ||
fontSize: '@?', | ||
background: '@?', | ||
margin: '@?', | ||
marginTop: '@?', | ||
marginBottom: '@?', | ||
marginLeft: '@?', | ||
marginRight: '@?', | ||
valid: '=?' | ||
bcFormat: '@?', | ||
bcLineColor: '@?', | ||
bcWidth: '@?', | ||
bcHeight: '@?', | ||
bcDisplayValue: '@?', | ||
bcFontOptions: '@?', | ||
bcFont: '@?', | ||
bcTextAlign: '@?', | ||
bcTextPosition: '@?', | ||
bcTextMargin: '@?', | ||
bcFontSize: '@?', | ||
bcBackground: '@?', | ||
bcMargin: '@?', | ||
bcMarginTop: '@?', | ||
bcMarginBottom: '@?', | ||
bcMarginLeft: '@?', | ||
bcMarginRight: '@?', | ||
bcValid: '=?' | ||
}; | ||
@@ -59,22 +80,29 @@ this.template = BarcodeDirective.resolveTemplate; | ||
link(scope, element, attributes) { | ||
JsBarcode(element[0], scope.text, { | ||
format: scope.format || 'CODE128', | ||
lineColor: scope.lineColor || '#000000', | ||
width: parseInt(scope.width, 10) || 2, | ||
height: parseInt(scope.height, 10) || 100, | ||
displayValue: (scope.displayValue === 'true') || true, | ||
fontOptions: scope.fontOptions || '', | ||
font: scope.font || 'monospace', | ||
textAlign: scope.textAlign || 'center', | ||
textPosition: scope.textPosition || 'bottom', | ||
textMargin: parseInt(scope.textMargin, 10) || 2, | ||
fontSize: parseInt(scope.fontSize, 10) || 20, | ||
background: scope.background || '#ffffff', | ||
margin: parseInt(scope.margin, 10) || 10, | ||
marginTop: parseInt(scope.marginTop, 10) || undefined, | ||
marginBottom: parseInt(scope.marginBottom, 10) || undefined, | ||
marginLeft: parseInt(scope.marginLeft, 10) || undefined, | ||
marginRight: parseInt(scope.marginRight, 10) || undefined, | ||
valid: scope.valid || function(valid){} | ||
}) | ||
scope.$watch(() => { | ||
if(scope.bcText !== undefined && scope.bcText.length > 0) { | ||
JsBarcode(element[0], scope.bcText, { | ||
format: scope.bcFormat || this.defaults.format, | ||
lineColor: scope.bcLineColor || this.defaults.lineColor, | ||
width: parseInt(scope.bcWidth, 10) || this.defaults.width, | ||
height: parseInt(scope.bcHeight, 10) || this.defaults.height, | ||
displayValue: (scope.bcDisplayValue === 'true') || this.defaults.displayValue, | ||
fontOptions: scope.bcFontOptions || this.defaults.fontOptions, | ||
font: scope.bcFont || this.defaults.font, | ||
textAlign: scope.bcTextAlign || this.defaults.textAlign, | ||
textPosition: scope.bcTextPosition || this.defaults.textPosition, | ||
textMargin: parseInt(scope.bcTextMargin, 10) || this.defaults.textMargin, | ||
fontSize: parseInt(scope.bcFontSize, 10) || this.defaults.fontSize, | ||
background: scope.bcBackground || this.defaults.background, | ||
margin: parseInt(scope.bcMargin, 10) || this.defaults.margin, | ||
marginTop: parseInt(scope.bcMarginTop, 10) || this.defaults.marginTop, | ||
marginBottom: parseInt(scope.bcMarginBottom, 10) || this.defaults.marginBottom, | ||
marginLeft: parseInt(scope.bcMarginLeft, 10) || this.defaults.marginLeft, | ||
marginRight: parseInt(scope.bcMarginRight, 10) || this.defaults.marginRight, | ||
valid: scope.bcValid || this.defaults.valid | ||
}) | ||
} | ||
}); | ||
} | ||
@@ -81,0 +109,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
480458
17
2452
13