mirror of
https://github.com/XiaoDaiGua-Ray/ray-template.git
synced 2026-12-01 17:23:40 +08:00
44 lines
74 KiB
JavaScript
44 lines
74 KiB
JavaScript
import{d as Qe,o as C,c as N,j as I,N as ue,b as or,E as Z,T as Er,h as ee,s as ur,p as te,ag as tt,q as Or,v as br,P as rt,$ as mr,a4 as Je,k as B,t as H,a5 as Ye,a6 as wr,F as xr,B as Sr,aS as Rr,a as Ar,a9 as Pr,e as Tr}from"./framework.DdJ92B9j.js";import{f as Mr,p as Ir,b as nt,c as We}from"./element.IaaiWsV4.js";import{b as Dr}from"./index.DH6t3psb.js";import{g as kr}from"./commonjsHelpers.CqkleIqs.js";import{c as it,a as G,d as at,aa as Cr,u as fr,n as V,g as q,L as Br,h as qr,ab as jr,j as Lr,k as Nr}from"./light.BSHrazt5.js";import{u as $r}from"./use-compitable.b_UbE6-q.js";var Gr=it([it("@keyframes spin-rotate",`
|
||
from {
|
||
transform: rotate(0);
|
||
}
|
||
to {
|
||
transform: rotate(360deg);
|
||
}
|
||
`),G("spin-container",`
|
||
position: relative;
|
||
`,[G("spin-body",`
|
||
position: absolute;
|
||
top: 50%;
|
||
left: 50%;
|
||
transform: translateX(-50%) translateY(-50%);
|
||
`,[Mr()])]),G("spin-body",`
|
||
display: inline-flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
flex-direction: column;
|
||
`),G("spin",`
|
||
display: inline-flex;
|
||
height: var(--n-size);
|
||
width: var(--n-size);
|
||
font-size: var(--n-size);
|
||
color: var(--n-color);
|
||
`,[at("rotate",`
|
||
animation: spin-rotate 2s linear infinite;
|
||
`)]),G("spin-description",`
|
||
display: inline-block;
|
||
font-size: var(--n-font-size);
|
||
color: var(--n-text-color);
|
||
transition: color .3s var(--n-bezier);
|
||
margin-top: 8px;
|
||
`),G("spin-content",`
|
||
opacity: 1;
|
||
transition: opacity .3s var(--n-bezier);
|
||
pointer-events: all;
|
||
`,[at("spinning",`
|
||
user-select: none;
|
||
-webkit-user-select: none;
|
||
pointer-events: none;
|
||
opacity: var(--n-opacity-spinning);
|
||
`)])]);const Fr={small:20,medium:18,large:16},zr={...fr.props,contentClass:String,contentStyle:[Object,String],description:String,size:{type:[String,Number],default:"medium"},show:{type:Boolean,default:!0},rotate:{type:Boolean,default:!0},spinning:{type:Boolean,validator:()=>!0,default:void 0},delay:Number,...Cr,strokeWidth:Number};var Ur=Qe({name:"Spin",props:zr,slots:Object,setup(s){const{mergedClsPrefixRef:d,inlineThemeDisabled:v}=qr(s),l=fr("Spin","-spin",Gr,jr,s,d),h=ee(()=>{const{size:i}=s,{common:{cubicBezierEaseInOut:e},self:t}=l.value,{opacitySpinning:n,color:r,textColor:a}=t;return{"--n-bezier":e,"--n-opacity-spinning":n,"--n-size":typeof i=="number"?Ir(i):t[Nr("size",i)],"--n-color":r,"--n-text-color":a}}),_=v?Lr("spin",ee(()=>{const{size:i}=s;return typeof i=="number"?String(i):i[0]}),h,s):void 0,c=$r(s,["spinning","show"]),f=te(!1);return ur(i=>{let e;if(c.value){const{delay:t}=s;if(t){e=window.setTimeout(()=>{f.value=!0},t),i(()=>{clearTimeout(e)});return}}f.value=c.value}),{mergedClsPrefix:d,active:f,mergedStrokeWidth:ee(()=>{const{strokeWidth:i}=s;if(i!==void 0)return i;const{size:e}=s;return Fr[typeof e=="number"?"medium":e]}),cssVars:v?void 0:h,themeClass:_==null?void 0:_.themeClass,onRender:_==null?void 0:_.onRender}},render(){var c;const{$slots:s,mergedClsPrefix:d,description:v}=this,l=s.icon&&this.rotate,h=(v||s.description)&&(C(),N("div",{class:q(`${d}-spin-description`)},[V(()=>{var f;return v||((f=s.description)==null?void 0:f.call(s))})],2)),_=s.icon?(C(),N("div",{key:1,class:q([`${d}-spin-body`,this.themeClass])},[I("div",{class:q([`${d}-spin`,l&&`${d}-spin--rotate`]),style:ue(s.default?"":this.cssVars)},[V(()=>s.icon())],6),V(()=>h)],2)):(C(),N("div",{key:2,class:q([`${d}-spin-body`,this.themeClass])},[(C(),or(Br,{clsPrefix:d,style:ue(s.default?"":this.cssVars),stroke:this.stroke,"stroke-width":this.mergedStrokeWidth,radius:this.radius,scale:this.scale,class:q(`${d}-spin`)},null,8,["clsPrefix","style","stroke","stroke-width","radius","scale","class"])),V(()=>h)],2));return(c=this.onRender)==null||c.call(this),s.default?(C(),N("div",{key:3,class:q([`${d}-spin-container`,this.themeClass]),style:ue(this.cssVars)},[I("div",{class:q([`${d}-spin-content`,this.active&&`${d}-spin-content--spinning`,this.contentClass]),style:ue(this.contentStyle)},[V(()=>{var f;return(f=s.default)==null?void 0:f.call(s)})],6),Z(Er,{name:"fade-in-transition"},{default:()=>this.active?_:null},1024)],6)):_}}),fe={},X={},ce={},ot;function T(){if(ot)return ce;ot=1,Object.defineProperty(ce,"__esModule",{value:!0});function s(v,l){if(!(v instanceof l))throw new TypeError("Cannot call a class as a function")}var d=function v(l,h){s(this,v),this.data=l,this.text=h.text||l,this.options=h};return ce.default=d,ce}var ut;function Hr(){if(ut)return X;ut=1,Object.defineProperty(X,"__esModule",{value:!0}),X.CODE39=void 0;var s=(function(){function u(y,p){for(var g=0;g<p.length;g++){var w=p[g];w.enumerable=w.enumerable||!1,w.configurable=!0,"value"in w&&(w.writable=!0),Object.defineProperty(y,w.key,w)}}return function(y,p,g){return p&&u(y.prototype,p),g&&u(y,g),y}})(),d=T(),v=l(d);function l(u){return u&&u.__esModule?u:{default:u}}function h(u,y){if(!(u instanceof y))throw new TypeError("Cannot call a class as a function")}function _(u,y){if(!u)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return y&&(typeof y=="object"||typeof y=="function")?y:u}function c(u,y){if(typeof y!="function"&&y!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof y);u.prototype=Object.create(y&&y.prototype,{constructor:{value:u,enumerable:!1,writable:!0,configurable:!0}}),y&&(Object.setPrototypeOf?Object.setPrototypeOf(u,y):u.__proto__=y)}var f=(function(u){c(y,u);function y(p,g){return h(this,y),p=p.toUpperCase(),g.mod43&&(p+=r(o(p))),_(this,(y.__proto__||Object.getPrototypeOf(y)).call(this,p,g))}return s(y,[{key:"encode",value:function(){for(var g=t("*"),w=0;w<this.data.length;w++)g+=t(this.data[w])+"0";return g+=t("*"),{data:g,text:this.text}}},{key:"valid",value:function(){return this.data.search(/^[0-9A-Z\-\.\ \$\/\+\%]+$/)!==-1}}]),y})(v.default),i=["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","-","."," ","$","/","+","%","*"],e=[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 t(u){return n(a(u))}function n(u){return e[u].toString(2)}function r(u){return i[u]}function a(u){return i.indexOf(u)}function o(u){for(var y=0,p=0;p<u.length;p++)y+=a(u[p]);return y=y%43,y}return X.CODE39=f,X}var D={},le={},de={},x={},ft;function re(){if(ft)return x;ft=1,Object.defineProperty(x,"__esModule",{value:!0});var s;function d(i,e,t){return e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}var v=x.SET_A=0,l=x.SET_B=1,h=x.SET_C=2;x.SHIFT=98;var _=x.START_A=103,c=x.START_B=104,f=x.START_C=105;return x.MODULO=103,x.STOP=106,x.FNC1=207,x.SET_BY_CODE=(s={},d(s,_,v),d(s,c,l),d(s,f,h),s),x.SWAP={101:v,100:l,99:h},x.A_START_CHAR="Ð",x.B_START_CHAR="Ñ",x.C_START_CHAR="Ò",x.A_CHARS="[\0-_È-Ï]",x.B_CHARS="[ -È-Ï]",x.C_CHARS="(Ï*[0-9]{2}Ï*)",x.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],x}var ct;function Ue(){if(ct)return de;ct=1,Object.defineProperty(de,"__esModule",{value:!0});var s=(function(){function e(t,n){for(var r=0;r<n.length;r++){var a=n[r];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(t,a.key,a)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}})(),d=T(),v=h(d),l=re();function h(e){return e&&e.__esModule?e:{default:e}}function _(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function c(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&(typeof t=="object"||typeof t=="function")?t:e}function f(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var i=(function(e){f(t,e);function t(n,r){_(this,t);var a=c(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,n.substring(1),r));return a.bytes=n.split("").map(function(o){return o.charCodeAt(0)}),a}return s(t,[{key:"valid",value:function(){return/^[\x00-\x7F\xC8-\xD3]+$/.test(this.data)}},{key:"encode",value:function(){var r=this.bytes,a=r.shift()-105,o=l.SET_BY_CODE[a];if(o===void 0)throw new RangeError("The encoding does not start with a start character.");this.shouldEncodeAsEan128()===!0&&r.unshift(l.FNC1);var u=t.next(r,1,o);return{text:this.text===this.data?this.text.replace(/[^\x20-\x7E]/g,""):this.text,data:t.getBar(a)+u.result+t.getBar((u.checksum+a)%l.MODULO)+t.getBar(l.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 l.BARS[r]?l.BARS[r].toString():""}},{key:"correctIndex",value:function(r,a){if(a===l.SET_A){var o=r.shift();return o<32?o+64:o-32}else return a===l.SET_B?r.shift()-32:(r.shift()-48)*10+r.shift()-48}},{key:"next",value:function(r,a,o){if(!r.length)return{result:"",checksum:0};var u=void 0,y=void 0;if(r[0]>=200){y=r.shift()-105;var p=l.SWAP[y];p!==void 0?u=t.next(r,a+1,p):((o===l.SET_A||o===l.SET_B)&&y===l.SHIFT&&(r[0]=o===l.SET_A?r[0]>95?r[0]-96:r[0]:r[0]<32?r[0]+96:r[0]),u=t.next(r,a+1,o))}else y=t.correctIndex(r,o),u=t.next(r,a+1,o);var g=t.getBar(y),w=y*a;return{result:g+u.result,checksum:w+u.checksum}}}]),t})(v.default);return de.default=i,de}var he={},lt;function Vr(){if(lt)return he;lt=1,Object.defineProperty(he,"__esModule",{value:!0});var s=re(),d=function(f){return f.match(new RegExp("^"+s.A_CHARS+"*"))[0].length},v=function(f){return f.match(new RegExp("^"+s.B_CHARS+"*"))[0].length},l=function(f){return f.match(new RegExp("^"+s.C_CHARS+"*"))[0]};function h(c,f){var i=f?s.A_CHARS:s.B_CHARS,e=c.match(new RegExp("^("+i+"+?)(([0-9]{2}){2,})([^0-9]|$)"));if(e)return e[1]+"Ì"+_(c.substring(e[1].length));var t=c.match(new RegExp("^"+i+"+"))[0];return t.length===c.length?c:t+String.fromCharCode(f?205:206)+h(c.substring(t.length),!f)}function _(c){var f=l(c),i=f.length;if(i===c.length)return c;c=c.substring(i);var e=d(c)>=v(c);return f+String.fromCharCode(e?206:205)+h(c,e)}return he.default=function(c){var f=void 0,i=l(c).length;if(i>=2)f=s.C_START_CHAR+_(c);else{var e=d(c)>v(c);f=(e?s.A_START_CHAR:s.B_START_CHAR)+h(c,e)}return f.replace(/[\xCD\xCE]([^])[\xCD\xCE]/,function(t,n){return"Ë"+n})},he}var dt;function Xr(){if(dt)return le;dt=1,Object.defineProperty(le,"__esModule",{value:!0});var s=Ue(),d=h(s),v=Vr(),l=h(v);function h(e){return e&&e.__esModule?e:{default:e}}function _(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function c(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&(typeof t=="object"||typeof t=="function")?t:e}function f(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var i=(function(e){f(t,e);function t(n,r){if(_(this,t),/^[\x00-\x7F\xC8-\xD3]+$/.test(n))var a=c(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,(0,l.default)(n),r));else var a=c(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,n,r));return c(a)}return t})(d.default);return le.default=i,le}var se={},ht;function Jr(){if(ht)return se;ht=1,Object.defineProperty(se,"__esModule",{value:!0});var s=(function(){function e(t,n){for(var r=0;r<n.length;r++){var a=n[r];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(t,a.key,a)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}})(),d=Ue(),v=h(d),l=re();function h(e){return e&&e.__esModule?e:{default:e}}function _(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function c(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&(typeof t=="object"||typeof t=="function")?t:e}function f(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var i=(function(e){f(t,e);function t(n,r){return _(this,t),c(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,l.A_START_CHAR+n,r))}return s(t,[{key:"valid",value:function(){return new RegExp("^"+l.A_CHARS+"+$").test(this.data)}}]),t})(v.default);return se.default=i,se}var ve={},st;function Yr(){if(st)return ve;st=1,Object.defineProperty(ve,"__esModule",{value:!0});var s=(function(){function e(t,n){for(var r=0;r<n.length;r++){var a=n[r];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(t,a.key,a)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}})(),d=Ue(),v=h(d),l=re();function h(e){return e&&e.__esModule?e:{default:e}}function _(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function c(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&(typeof t=="object"||typeof t=="function")?t:e}function f(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var i=(function(e){f(t,e);function t(n,r){return _(this,t),c(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,l.B_START_CHAR+n,r))}return s(t,[{key:"valid",value:function(){return new RegExp("^"+l.B_CHARS+"+$").test(this.data)}}]),t})(v.default);return ve.default=i,ve}var _e={},vt;function Wr(){if(vt)return _e;vt=1,Object.defineProperty(_e,"__esModule",{value:!0});var s=(function(){function e(t,n){for(var r=0;r<n.length;r++){var a=n[r];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(t,a.key,a)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}})(),d=Ue(),v=h(d),l=re();function h(e){return e&&e.__esModule?e:{default:e}}function _(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function c(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&(typeof t=="object"||typeof t=="function")?t:e}function f(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var i=(function(e){f(t,e);function t(n,r){return _(this,t),c(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,l.C_START_CHAR+n,r))}return s(t,[{key:"valid",value:function(){return new RegExp("^"+l.C_CHARS+"+$").test(this.data)}}]),t})(v.default);return _e.default=i,_e}var _t;function Kr(){if(_t)return D;_t=1,Object.defineProperty(D,"__esModule",{value:!0}),D.CODE128C=D.CODE128B=D.CODE128A=D.CODE128=void 0;var s=Xr(),d=i(s),v=Jr(),l=i(v),h=Yr(),_=i(h),c=Wr(),f=i(c);function i(e){return e&&e.__esModule?e:{default:e}}return D.CODE128=d.default,D.CODE128A=l.default,D.CODE128B=_.default,D.CODE128C=f.default,D}var R={},ye={},k={},yt;function ne(){return yt||(yt=1,Object.defineProperty(k,"__esModule",{value:!0}),k.SIDE_BIN="101",k.MIDDLE_BIN="01010",k.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"]},k.EAN2_STRUCTURE=["LL","LG","GL","GG"],k.EAN5_STRUCTURE=["GGLLL","GLGLL","GLLGL","GLLLG","LGGLL","LLGGL","LLLGG","LGLGL","LGLLG","LLGLG"],k.EAN13_STRUCTURE=["LLLLLL","LLGLGG","LLGGLG","LLGGGL","LGLLGG","LGGLLG","LGGGLL","LGLGLG","LGLGGL","LGGLGL"]),k}var pe={},ge={},pt;function ie(){if(pt)return ge;pt=1,Object.defineProperty(ge,"__esModule",{value:!0});var s=ne(),d=function(l,h,_){var c=l.split("").map(function(i,e){return s.BINARIES[h[e]]}).map(function(i,e){return i?i[l[e]]:""});if(_){var f=l.length-1;c=c.map(function(i,e){return e<f?i+_:i})}return c.join("")};return ge.default=d,ge}var gt;function cr(){if(gt)return pe;gt=1,Object.defineProperty(pe,"__esModule",{value:!0});var s=(function(){function n(r,a){for(var o=0;o<a.length;o++){var u=a[o];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(r,u.key,u)}}return function(r,a,o){return a&&n(r.prototype,a),o&&n(r,o),r}})(),d=ne(),v=ie(),l=c(v),h=T(),_=c(h);function c(n){return n&&n.__esModule?n:{default:n}}function f(n,r){if(!(n instanceof r))throw new TypeError("Cannot call a class as a function")}function i(n,r){if(!n)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return r&&(typeof r=="object"||typeof r=="function")?r:n}function e(n,r){if(typeof r!="function"&&r!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof r);n.prototype=Object.create(r&&r.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),r&&(Object.setPrototypeOf?Object.setPrototypeOf(n,r):n.__proto__=r)}var t=(function(n){e(r,n);function r(a,o){f(this,r);var u=i(this,(r.__proto__||Object.getPrototypeOf(r)).call(this,a,o));return u.fontSize=!o.flat&&o.fontSize>o.width*10?o.width*10:o.fontSize,u.guardHeight=o.height+u.fontSize/2+o.textMargin,u}return s(r,[{key:"encode",value:function(){return this.options.flat?this.encodeFlat():this.encodeGuarded()}},{key:"leftText",value:function(o,u){return this.text.substr(o,u)}},{key:"leftEncode",value:function(o,u){return(0,l.default)(o,u)}},{key:"rightText",value:function(o,u){return this.text.substr(o,u)}},{key:"rightEncode",value:function(o,u){return(0,l.default)(o,u)}},{key:"encodeGuarded",value:function(){var o={fontSize:this.fontSize},u={height:this.guardHeight};return[{data:d.SIDE_BIN,options:u},{data:this.leftEncode(),text:this.leftText(),options:o},{data:d.MIDDLE_BIN,options:u},{data:this.rightEncode(),text:this.rightText(),options:o},{data:d.SIDE_BIN,options:u}]}},{key:"encodeFlat",value:function(){var o=[d.SIDE_BIN,this.leftEncode(),d.MIDDLE_BIN,this.rightEncode(),d.SIDE_BIN];return{data:o.join(""),text:this.text}}}]),r})(_.default);return pe.default=t,pe}var Et;function Qr(){if(Et)return ye;Et=1,Object.defineProperty(ye,"__esModule",{value:!0});var s=(function(){function n(r,a){for(var o=0;o<a.length;o++){var u=a[o];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(r,u.key,u)}}return function(r,a,o){return a&&n(r.prototype,a),o&&n(r,o),r}})(),d=function n(r,a,o){r===null&&(r=Function.prototype);var u=Object.getOwnPropertyDescriptor(r,a);if(u===void 0){var y=Object.getPrototypeOf(r);return y===null?void 0:n(y,a,o)}else{if("value"in u)return u.value;var p=u.get;return p===void 0?void 0:p.call(o)}},v=ne(),l=cr(),h=_(l);function _(n){return n&&n.__esModule?n:{default:n}}function c(n,r){if(!(n instanceof r))throw new TypeError("Cannot call a class as a function")}function f(n,r){if(!n)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return r&&(typeof r=="object"||typeof r=="function")?r:n}function i(n,r){if(typeof r!="function"&&r!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof r);n.prototype=Object.create(r&&r.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),r&&(Object.setPrototypeOf?Object.setPrototypeOf(n,r):n.__proto__=r)}var e=function(r){var a=r.substr(0,12).split("").map(function(o){return+o}).reduce(function(o,u,y){return y%2?o+u*3:o+u},0);return(10-a%10)%10},t=(function(n){i(r,n);function r(a,o){c(this,r),a.search(/^[0-9]{12}$/)!==-1&&(a+=e(a));var u=f(this,(r.__proto__||Object.getPrototypeOf(r)).call(this,a,o));return u.lastChar=o.lastChar,u}return s(r,[{key:"valid",value:function(){return this.data.search(/^[0-9]{13}$/)!==-1&&+this.data[12]===e(this.data)}},{key:"leftText",value:function(){return d(r.prototype.__proto__||Object.getPrototypeOf(r.prototype),"leftText",this).call(this,1,6)}},{key:"leftEncode",value:function(){var o=this.data.substr(1,6),u=v.EAN13_STRUCTURE[this.data[0]];return d(r.prototype.__proto__||Object.getPrototypeOf(r.prototype),"leftEncode",this).call(this,o,u)}},{key:"rightText",value:function(){return d(r.prototype.__proto__||Object.getPrototypeOf(r.prototype),"rightText",this).call(this,7,6)}},{key:"rightEncode",value:function(){var o=this.data.substr(7,6);return d(r.prototype.__proto__||Object.getPrototypeOf(r.prototype),"rightEncode",this).call(this,o,"RRRRRR")}},{key:"encodeGuarded",value:function(){var o=d(r.prototype.__proto__||Object.getPrototypeOf(r.prototype),"encodeGuarded",this).call(this);return this.options.displayValue&&(o.unshift({data:"000000000000",text:this.text.substr(0,1),options:{textAlign:"left",fontSize:this.fontSize}}),this.options.lastChar&&(o.push({data:"00"}),o.push({data:"00000",text:this.options.lastChar,options:{fontSize:this.fontSize}}))),o}}]),r})(h.default);return ye.default=t,ye}var Ee={},Ot;function Zr(){if(Ot)return Ee;Ot=1,Object.defineProperty(Ee,"__esModule",{value:!0});var s=(function(){function t(n,r){for(var a=0;a<r.length;a++){var o=r[a];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(n,o.key,o)}}return function(n,r,a){return r&&t(n.prototype,r),a&&t(n,a),n}})(),d=function t(n,r,a){n===null&&(n=Function.prototype);var o=Object.getOwnPropertyDescriptor(n,r);if(o===void 0){var u=Object.getPrototypeOf(n);return u===null?void 0:t(u,r,a)}else{if("value"in o)return o.value;var y=o.get;return y===void 0?void 0:y.call(a)}},v=cr(),l=h(v);function h(t){return t&&t.__esModule?t:{default:t}}function _(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}function c(t,n){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return n&&(typeof n=="object"||typeof n=="function")?n:t}function f(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof n);t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),n&&(Object.setPrototypeOf?Object.setPrototypeOf(t,n):t.__proto__=n)}var i=function(n){var r=n.substr(0,7).split("").map(function(a){return+a}).reduce(function(a,o,u){return u%2?a+o:a+o*3},0);return(10-r%10)%10},e=(function(t){f(n,t);function n(r,a){return _(this,n),r.search(/^[0-9]{7}$/)!==-1&&(r+=i(r)),c(this,(n.__proto__||Object.getPrototypeOf(n)).call(this,r,a))}return s(n,[{key:"valid",value:function(){return this.data.search(/^[0-9]{8}$/)!==-1&&+this.data[7]===i(this.data)}},{key:"leftText",value:function(){return d(n.prototype.__proto__||Object.getPrototypeOf(n.prototype),"leftText",this).call(this,0,4)}},{key:"leftEncode",value:function(){var a=this.data.substr(0,4);return d(n.prototype.__proto__||Object.getPrototypeOf(n.prototype),"leftEncode",this).call(this,a,"LLLL")}},{key:"rightText",value:function(){return d(n.prototype.__proto__||Object.getPrototypeOf(n.prototype),"rightText",this).call(this,4,4)}},{key:"rightEncode",value:function(){var a=this.data.substr(4,4);return d(n.prototype.__proto__||Object.getPrototypeOf(n.prototype),"rightEncode",this).call(this,a,"RRRR")}}]),n})(l.default);return Ee.default=e,Ee}var Oe={},bt;function en(){if(bt)return Oe;bt=1,Object.defineProperty(Oe,"__esModule",{value:!0});var s=(function(){function r(a,o){for(var u=0;u<o.length;u++){var y=o[u];y.enumerable=y.enumerable||!1,y.configurable=!0,"value"in y&&(y.writable=!0),Object.defineProperty(a,y.key,y)}}return function(a,o,u){return o&&r(a.prototype,o),u&&r(a,u),a}})(),d=ne(),v=ie(),l=c(v),h=T(),_=c(h);function c(r){return r&&r.__esModule?r:{default:r}}function f(r,a){if(!(r instanceof a))throw new TypeError("Cannot call a class as a function")}function i(r,a){if(!r)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return a&&(typeof a=="object"||typeof a=="function")?a:r}function e(r,a){if(typeof a!="function"&&a!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof a);r.prototype=Object.create(a&&a.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),a&&(Object.setPrototypeOf?Object.setPrototypeOf(r,a):r.__proto__=a)}var t=function(a){var o=a.split("").map(function(u){return+u}).reduce(function(u,y,p){return p%2?u+y*9:u+y*3},0);return o%10},n=(function(r){e(a,r);function a(o,u){return f(this,a),i(this,(a.__proto__||Object.getPrototypeOf(a)).call(this,o,u))}return s(a,[{key:"valid",value:function(){return this.data.search(/^[0-9]{5}$/)!==-1}},{key:"encode",value:function(){var u=d.EAN5_STRUCTURE[t(this.data)];return{data:"1011"+(0,l.default)(this.data,u,"01"),text:this.text}}}]),a})(_.default);return Oe.default=n,Oe}var be={},mt;function tn(){if(mt)return be;mt=1,Object.defineProperty(be,"__esModule",{value:!0});var s=(function(){function n(r,a){for(var o=0;o<a.length;o++){var u=a[o];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(r,u.key,u)}}return function(r,a,o){return a&&n(r.prototype,a),o&&n(r,o),r}})(),d=ne(),v=ie(),l=c(v),h=T(),_=c(h);function c(n){return n&&n.__esModule?n:{default:n}}function f(n,r){if(!(n instanceof r))throw new TypeError("Cannot call a class as a function")}function i(n,r){if(!n)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return r&&(typeof r=="object"||typeof r=="function")?r:n}function e(n,r){if(typeof r!="function"&&r!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof r);n.prototype=Object.create(r&&r.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),r&&(Object.setPrototypeOf?Object.setPrototypeOf(n,r):n.__proto__=r)}var t=(function(n){e(r,n);function r(a,o){return f(this,r),i(this,(r.__proto__||Object.getPrototypeOf(r)).call(this,a,o))}return s(r,[{key:"valid",value:function(){return this.data.search(/^[0-9]{2}$/)!==-1}},{key:"encode",value:function(){var o=d.EAN2_STRUCTURE[parseInt(this.data)%4];return{data:"1011"+(0,l.default)(this.data,o,"01"),text:this.text}}}]),r})(_.default);return be.default=t,be}var J={},wt;function lr(){if(wt)return J;wt=1,Object.defineProperty(J,"__esModule",{value:!0});var s=(function(){function n(r,a){for(var o=0;o<a.length;o++){var u=a[o];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(r,u.key,u)}}return function(r,a,o){return a&&n(r.prototype,a),o&&n(r,o),r}})();J.checksum=t;var d=ie(),v=_(d),l=T(),h=_(l);function _(n){return n&&n.__esModule?n:{default:n}}function c(n,r){if(!(n instanceof r))throw new TypeError("Cannot call a class as a function")}function f(n,r){if(!n)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return r&&(typeof r=="object"||typeof r=="function")?r:n}function i(n,r){if(typeof r!="function"&&r!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof r);n.prototype=Object.create(r&&r.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),r&&(Object.setPrototypeOf?Object.setPrototypeOf(n,r):n.__proto__=r)}var e=(function(n){i(r,n);function r(a,o){c(this,r),a.search(/^[0-9]{11}$/)!==-1&&(a+=t(a));var u=f(this,(r.__proto__||Object.getPrototypeOf(r)).call(this,a,o));return u.displayValue=o.displayValue,o.fontSize>o.width*10?u.fontSize=o.width*10:u.fontSize=o.fontSize,u.guardHeight=o.height+u.fontSize/2+o.textMargin,u}return s(r,[{key:"valid",value:function(){return this.data.search(/^[0-9]{12}$/)!==-1&&this.data[11]==t(this.data)}},{key:"encode",value:function(){return this.options.flat?this.flatEncoding():this.guardedEncoding()}},{key:"flatEncoding",value:function(){var o="";return o+="101",o+=(0,v.default)(this.data.substr(0,6),"LLLLLL"),o+="01010",o+=(0,v.default)(this.data.substr(6,6),"RRRRRR"),o+="101",{data:o,text:this.text}}},{key:"guardedEncoding",value:function(){var o=[];return this.displayValue&&o.push({data:"00000000",text:this.text.substr(0,1),options:{textAlign:"left",fontSize:this.fontSize}}),o.push({data:"101"+(0,v.default)(this.data[0],"L"),options:{height:this.guardHeight}}),o.push({data:(0,v.default)(this.data.substr(1,5),"LLLLL"),text:this.text.substr(1,5),options:{fontSize:this.fontSize}}),o.push({data:"01010",options:{height:this.guardHeight}}),o.push({data:(0,v.default)(this.data.substr(6,5),"RRRRR"),text:this.text.substr(6,5),options:{fontSize:this.fontSize}}),o.push({data:(0,v.default)(this.data[11],"R")+"101",options:{height:this.guardHeight}}),this.displayValue&&o.push({data:"00000000",text:this.text.substr(11,1),options:{textAlign:"right",fontSize:this.fontSize}}),o}}]),r})(h.default);function t(n){var r=0,a;for(a=1;a<11;a+=2)r+=parseInt(n[a]);for(a=0;a<11;a+=2)r+=parseInt(n[a])*3;return(10-r%10)%10}return J.default=e,J}var me={},xt;function rn(){if(xt)return me;xt=1,Object.defineProperty(me,"__esModule",{value:!0});var s=(function(){function o(u,y){for(var p=0;p<y.length;p++){var g=y[p];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(u,g.key,g)}}return function(u,y,p){return y&&o(u.prototype,y),p&&o(u,p),u}})(),d=ie(),v=c(d),l=T(),h=c(l),_=lr();function c(o){return o&&o.__esModule?o:{default:o}}function f(o,u){if(!(o instanceof u))throw new TypeError("Cannot call a class as a function")}function i(o,u){if(!o)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return u&&(typeof u=="object"||typeof u=="function")?u:o}function e(o,u){if(typeof u!="function"&&u!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof u);o.prototype=Object.create(u&&u.prototype,{constructor:{value:o,enumerable:!1,writable:!0,configurable:!0}}),u&&(Object.setPrototypeOf?Object.setPrototypeOf(o,u):o.__proto__=u)}var t=["XX00000XXX","XX10000XXX","XX20000XXX","XXX00000XX","XXXX00000X","XXXXX00005","XXXXX00006","XXXXX00007","XXXXX00008","XXXXX00009"],n=[["EEEOOO","OOOEEE"],["EEOEOO","OOEOEE"],["EEOOEO","OOEEOE"],["EEOOOE","OOEEEO"],["EOEEOO","OEOOEE"],["EOOEEO","OEEOOE"],["EOOOEE","OEEEOO"],["EOEOEO","OEOEOE"],["EOEOOE","OEOEEO"],["EOOEOE","OEEOEO"]],r=(function(o){e(u,o);function u(y,p){f(this,u);var g=i(this,(u.__proto__||Object.getPrototypeOf(u)).call(this,y,p));if(g.isValid=!1,y.search(/^[0-9]{6}$/)!==-1)g.middleDigits=y,g.upcA=a(y,"0"),g.text=p.text||""+g.upcA[0]+y+g.upcA[g.upcA.length-1],g.isValid=!0;else if(y.search(/^[01][0-9]{7}$/)!==-1)if(g.middleDigits=y.substring(1,y.length-1),g.upcA=a(g.middleDigits,y[0]),g.upcA[g.upcA.length-1]===y[y.length-1])g.isValid=!0;else return i(g);else return i(g);return g.displayValue=p.displayValue,p.fontSize>p.width*10?g.fontSize=p.width*10:g.fontSize=p.fontSize,g.guardHeight=p.height+g.fontSize/2+p.textMargin,g}return s(u,[{key:"valid",value:function(){return this.isValid}},{key:"encode",value:function(){return this.options.flat?this.flatEncoding():this.guardedEncoding()}},{key:"flatEncoding",value:function(){var p="";return p+="101",p+=this.encodeMiddleDigits(),p+="010101",{data:p,text:this.text}}},{key:"guardedEncoding",value:function(){var p=[];return this.displayValue&&p.push({data:"00000000",text:this.text[0],options:{textAlign:"left",fontSize:this.fontSize}}),p.push({data:"101",options:{height:this.guardHeight}}),p.push({data:this.encodeMiddleDigits(),text:this.text.substring(1,7),options:{fontSize:this.fontSize}}),p.push({data:"010101",options:{height:this.guardHeight}}),this.displayValue&&p.push({data:"00000000",text:this.text[7],options:{textAlign:"right",fontSize:this.fontSize}}),p}},{key:"encodeMiddleDigits",value:function(){var p=this.upcA[0],g=this.upcA[this.upcA.length-1],w=n[parseInt(g)][parseInt(p)];return(0,v.default)(this.middleDigits,w)}}]),u})(h.default);function a(o,u){for(var y=parseInt(o[o.length-1]),p=t[y],g="",w=0,$=0;$<p.length;$++){var oe=p[$];oe==="X"?g+=o[w++]:g+=oe}return g=""+u+g,""+g+(0,_.checksum)(g)}return me.default=r,me}var St;function nn(){if(St)return R;St=1,Object.defineProperty(R,"__esModule",{value:!0}),R.UPCE=R.UPC=R.EAN2=R.EAN5=R.EAN8=R.EAN13=void 0;var s=Qr(),d=r(s),v=Zr(),l=r(v),h=en(),_=r(h),c=tn(),f=r(c),i=lr(),e=r(i),t=rn(),n=r(t);function r(a){return a&&a.__esModule?a:{default:a}}return R.EAN13=d.default,R.EAN8=l.default,R.EAN5=_.default,R.EAN2=f.default,R.UPC=e.default,R.UPCE=n.default,R}var j={},we={},F={},Rt;function an(){return Rt||(Rt=1,Object.defineProperty(F,"__esModule",{value:!0}),F.START_BIN="1010",F.END_BIN="11101",F.BINARIES=["00110","10001","01001","11000","00101","10100","01100","00011","10010","01010"]),F}var At;function dr(){if(At)return we;At=1,Object.defineProperty(we,"__esModule",{value:!0});var s=(function(){function e(t,n){for(var r=0;r<n.length;r++){var a=n[r];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(t,a.key,a)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}})(),d=an(),v=T(),l=h(v);function h(e){return e&&e.__esModule?e:{default:e}}function _(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function c(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&(typeof t=="object"||typeof t=="function")?t:e}function f(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var i=(function(e){f(t,e);function t(){return _(this,t),c(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return s(t,[{key:"valid",value:function(){return this.data.search(/^([0-9]{2})+$/)!==-1}},{key:"encode",value:function(){var r=this,a=this.data.match(/.{2}/g).map(function(o){return r.encodePair(o)}).join("");return{data:d.START_BIN+a+d.END_BIN,text:this.text}}},{key:"encodePair",value:function(r){var a=d.BINARIES[r[1]];return d.BINARIES[r[0]].split("").map(function(o,u){return(o==="1"?"111":"1")+(a[u]==="1"?"000":"0")}).join("")}}]),t})(l.default);return we.default=i,we}var xe={},Pt;function on(){if(Pt)return xe;Pt=1,Object.defineProperty(xe,"__esModule",{value:!0});var s=(function(){function e(t,n){for(var r=0;r<n.length;r++){var a=n[r];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(t,a.key,a)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}})(),d=dr(),v=l(d);function l(e){return e&&e.__esModule?e:{default:e}}function h(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&(typeof t=="object"||typeof t=="function")?t:e}function c(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var f=function(t){var n=t.substr(0,13).split("").map(function(r){return parseInt(r,10)}).reduce(function(r,a,o){return r+a*(3-o%2*2)},0);return Math.ceil(n/10)*10-n},i=(function(e){c(t,e);function t(n,r){return h(this,t),n.search(/^[0-9]{13}$/)!==-1&&(n+=f(n)),_(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,n,r))}return s(t,[{key:"valid",value:function(){return this.data.search(/^[0-9]{14}$/)!==-1&&+this.data[13]===f(this.data)}}]),t})(v.default);return xe.default=i,xe}var Tt;function un(){if(Tt)return j;Tt=1,Object.defineProperty(j,"__esModule",{value:!0}),j.ITF14=j.ITF=void 0;var s=dr(),d=h(s),v=on(),l=h(v);function h(_){return _&&_.__esModule?_:{default:_}}return j.ITF=d.default,j.ITF14=l.default,j}var A={},Se={},Mt;function ae(){if(Mt)return Se;Mt=1,Object.defineProperty(Se,"__esModule",{value:!0});var s=(function(){function e(t,n){for(var r=0;r<n.length;r++){var a=n[r];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(t,a.key,a)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}})(),d=T(),v=l(d);function l(e){return e&&e.__esModule?e:{default:e}}function h(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&(typeof t=="object"||typeof t=="function")?t:e}function c(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var f=(function(e){c(t,e);function t(n,r){return h(this,t),_(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,n,r))}return s(t,[{key:"encode",value:function(){for(var r="110",a=0;a<this.data.length;a++){var o=parseInt(this.data[a]),u=o.toString(2);u=i(u,4-u.length);for(var y=0;y<u.length;y++)r+=u[y]=="0"?"100":"110"}return r+="1001",{data:r,text:this.text}}},{key:"valid",value:function(){return this.data.search(/^[0-9]+$/)!==-1}}]),t})(v.default);function i(e,t){for(var n=0;n<t;n++)e="0"+e;return e}return Se.default=f,Se}var Re={},Y={},It;function He(){if(It)return Y;It=1,Object.defineProperty(Y,"__esModule",{value:!0}),Y.mod10=s,Y.mod11=d;function s(v){for(var l=0,h=0;h<v.length;h++){var _=parseInt(v[h]);(h+v.length)%2===0?l+=_:l+=_*2%10+Math.floor(_*2/10)}return(10-l%10)%10}function d(v){for(var l=0,h=[2,3,4,5,6,7],_=0;_<v.length;_++){var c=parseInt(v[v.length-1-_]);l+=h[_%h.length]*c}return(11-l%11)%11}return Y}var Dt;function fn(){if(Dt)return Re;Dt=1,Object.defineProperty(Re,"__esModule",{value:!0});var s=ae(),d=l(s),v=He();function l(i){return i&&i.__esModule?i:{default:i}}function h(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}function _(i,e){if(!i)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:i}function c(i,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);i.prototype=Object.create(e&&e.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(i,e):i.__proto__=e)}var f=(function(i){c(e,i);function e(t,n){return h(this,e),_(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t+(0,v.mod10)(t),n))}return e})(d.default);return Re.default=f,Re}var Ae={},kt;function cn(){if(kt)return Ae;kt=1,Object.defineProperty(Ae,"__esModule",{value:!0});var s=ae(),d=l(s),v=He();function l(i){return i&&i.__esModule?i:{default:i}}function h(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}function _(i,e){if(!i)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:i}function c(i,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);i.prototype=Object.create(e&&e.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(i,e):i.__proto__=e)}var f=(function(i){c(e,i);function e(t,n){return h(this,e),_(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t+(0,v.mod11)(t),n))}return e})(d.default);return Ae.default=f,Ae}var Pe={},Ct;function ln(){if(Ct)return Pe;Ct=1,Object.defineProperty(Pe,"__esModule",{value:!0});var s=ae(),d=l(s),v=He();function l(i){return i&&i.__esModule?i:{default:i}}function h(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}function _(i,e){if(!i)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:i}function c(i,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);i.prototype=Object.create(e&&e.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(i,e):i.__proto__=e)}var f=(function(i){c(e,i);function e(t,n){return h(this,e),t+=(0,v.mod10)(t),t+=(0,v.mod10)(t),_(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n))}return e})(d.default);return Pe.default=f,Pe}var Te={},Bt;function dn(){if(Bt)return Te;Bt=1,Object.defineProperty(Te,"__esModule",{value:!0});var s=ae(),d=l(s),v=He();function l(i){return i&&i.__esModule?i:{default:i}}function h(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}function _(i,e){if(!i)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:i}function c(i,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);i.prototype=Object.create(e&&e.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(i,e):i.__proto__=e)}var f=(function(i){c(e,i);function e(t,n){return h(this,e),t+=(0,v.mod11)(t),t+=(0,v.mod10)(t),_(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n))}return e})(d.default);return Te.default=f,Te}var qt;function hn(){if(qt)return A;qt=1,Object.defineProperty(A,"__esModule",{value:!0}),A.MSI1110=A.MSI1010=A.MSI11=A.MSI10=A.MSI=void 0;var s=ae(),d=t(s),v=fn(),l=t(v),h=cn(),_=t(h),c=ln(),f=t(c),i=dn(),e=t(i);function t(n){return n&&n.__esModule?n:{default:n}}return A.MSI=d.default,A.MSI10=l.default,A.MSI11=_.default,A.MSI1010=f.default,A.MSI1110=e.default,A}var W={},jt;function sn(){if(jt)return W;jt=1,Object.defineProperty(W,"__esModule",{value:!0}),W.pharmacode=void 0;var s=(function(){function i(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),e}})(),d=T(),v=l(d);function l(i){return i&&i.__esModule?i:{default:i}}function h(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}function _(i,e){if(!i)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:i}function c(i,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);i.prototype=Object.create(e&&e.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(i,e):i.__proto__=e)}var f=(function(i){c(e,i);function e(t,n){h(this,e);var r=_(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n));return r.number=parseInt(t,10),r}return s(e,[{key:"encode",value:function(){for(var n=this.number,r="";!isNaN(n)&&n!=0;)n%2===0?(r="11100"+r,n=(n-2)/2):(r="100"+r,n=(n-1)/2);return r=r.slice(0,-2),{data:r,text:this.text}}},{key:"valid",value:function(){return this.number>=3&&this.number<=131070}}]),e})(v.default);return W.pharmacode=f,W}var K={},Lt;function vn(){if(Lt)return K;Lt=1,Object.defineProperty(K,"__esModule",{value:!0}),K.codabar=void 0;var s=(function(){function i(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),e}})(),d=T(),v=l(d);function l(i){return i&&i.__esModule?i:{default:i}}function h(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}function _(i,e){if(!i)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:i}function c(i,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);i.prototype=Object.create(e&&e.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(i,e):i.__proto__=e)}var f=(function(i){c(e,i);function e(t,n){h(this,e),t.search(/^[0-9\-\$\:\.\+\/]+$/)===0&&(t="A"+t+"A");var r=_(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t.toUpperCase(),n));return r.text=r.options.text||r.text.replace(/[A-D]/g,""),r}return s(e,[{key:"valid",value:function(){return this.data.search(/^[A-D][0-9\-\$\:\.\+\/]+[A-D]$/)!==-1}},{key:"encode",value:function(){for(var n=[],r=this.getEncodings(),a=0;a<this.data.length;a++)n.push(r[this.data.charAt(a)]),a!==this.data.length-1&&n.push("0");return{text:this.text,data:n.join("")}}},{key:"getEncodings",value:function(){return{0:"101010011",1:"101011001",2:"101001011",3:"110010101",4:"101101001",5:"110101001",6:"100101011",7:"100101101",8:"100110101",9:"110100101","-":"101001101",$:"101100101",":":"1101011011","/":"1101101011",".":"1101101101","+":"1011011011",A:"1011001001",B:"1001001011",C:"1010010011",D:"1010011001"}}}]),e})(v.default);return K.codabar=f,K}var L={},Me={},z={},Nt;function _n(){return Nt||(Nt=1,Object.defineProperty(z,"__esModule",{value:!0}),z.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","-","."," ","$","/","+","%","($)","(%)","(/)","(+)","ÿ"],z.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"],z.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"],"":["(%)","T"]}),z}var $t;function hr(){if($t)return Me;$t=1,Object.defineProperty(Me,"__esModule",{value:!0});var s=(function(){function e(t,n){for(var r=0;r<n.length;r++){var a=n[r];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(t,a.key,a)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}})(),d=_n(),v=T(),l=h(v);function h(e){return e&&e.__esModule?e:{default:e}}function _(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function c(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&(typeof t=="object"||typeof t=="function")?t:e}function f(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var i=(function(e){f(t,e);function t(n,r){return _(this,t),c(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,n,r))}return s(t,[{key:"valid",value:function(){return/^[0-9A-Z\-. $/+%]+$/.test(this.data)}},{key:"encode",value:function(){var r=this.data.split("").flatMap(function(y){return d.MULTI_SYMBOLS[y]||y}),a=r.map(function(y){return t.getEncoding(y)}).join(""),o=t.checksum(r,20),u=t.checksum(r.concat(o),15);return{text:this.text,data:t.getEncoding("ÿ")+a+t.getEncoding(o)+t.getEncoding(u)+t.getEncoding("ÿ")+"1"}}}],[{key:"getEncoding",value:function(r){return d.BINARIES[t.symbolValue(r)]}},{key:"getSymbol",value:function(r){return d.SYMBOLS[r]}},{key:"symbolValue",value:function(r){return d.SYMBOLS.indexOf(r)}},{key:"checksum",value:function(r,a){var o=r.slice().reverse().reduce(function(u,y,p){var g=p%a+1;return u+t.symbolValue(y)*g},0);return t.getSymbol(o%47)}}]),t})(l.default);return Me.default=i,Me}var Ie={},Gt;function yn(){if(Gt)return Ie;Gt=1,Object.defineProperty(Ie,"__esModule",{value:!0});var s=(function(){function i(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),e}})(),d=hr(),v=l(d);function l(i){return i&&i.__esModule?i:{default:i}}function h(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}function _(i,e){if(!i)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:i}function c(i,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);i.prototype=Object.create(e&&e.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(i,e):i.__proto__=e)}var f=(function(i){c(e,i);function e(t,n){return h(this,e),_(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n))}return s(e,[{key:"valid",value:function(){return/^[\x00-\x7f]+$/.test(this.data)}}]),e})(v.default);return Ie.default=f,Ie}var Ft;function pn(){if(Ft)return L;Ft=1,Object.defineProperty(L,"__esModule",{value:!0}),L.CODE93FullASCII=L.CODE93=void 0;var s=hr(),d=h(s),v=yn(),l=h(v);function h(_){return _&&_.__esModule?_:{default:_}}return L.CODE93=d.default,L.CODE93FullASCII=l.default,L}var Q={},zt;function gn(){if(zt)return Q;zt=1,Object.defineProperty(Q,"__esModule",{value:!0}),Q.GenericBarcode=void 0;var s=(function(){function i(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),e}})(),d=T(),v=l(d);function l(i){return i&&i.__esModule?i:{default:i}}function h(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}function _(i,e){if(!i)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:i}function c(i,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);i.prototype=Object.create(e&&e.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(i,e):i.__proto__=e)}var f=(function(i){c(e,i);function e(t,n){return h(this,e),_(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n))}return s(e,[{key:"encode",value:function(){return{data:"10101010101010101010101010101010101010101",text:this.text}}},{key:"valid",value:function(){return!0}}]),e})(v.default);return Q.GenericBarcode=f,Q}var Ut;function En(){if(Ut)return fe;Ut=1,Object.defineProperty(fe,"__esModule",{value:!0});var s=Hr(),d=Kr(),v=nn(),l=un(),h=hn(),_=sn(),c=vn(),f=pn(),i=gn();return fe.default={CODE39:s.CODE39,CODE128:d.CODE128,CODE128A:d.CODE128A,CODE128B:d.CODE128B,CODE128C:d.CODE128C,EAN13:v.EAN13,EAN8:v.EAN8,EAN5:v.EAN5,EAN2:v.EAN2,UPC:v.UPC,UPCE:v.UPCE,ITF14:l.ITF14,ITF:l.ITF,MSI:h.MSI,MSI10:h.MSI10,MSI11:h.MSI11,MSI1010:h.MSI1010,MSI1110:h.MSI1110,pharmacode:_.pharmacode,codabar:c.codabar,CODE93:f.CODE93,CODE93FullASCII:f.CODE93FullASCII,GenericBarcode:i.GenericBarcode},fe}var De={},Ht;function Ve(){if(Ht)return De;Ht=1,Object.defineProperty(De,"__esModule",{value:!0});var s=Object.assign||function(d){for(var v=1;v<arguments.length;v++){var l=arguments[v];for(var h in l)Object.prototype.hasOwnProperty.call(l,h)&&(d[h]=l[h])}return d};return De.default=function(d,v){return s({},d,v)},De}var ke={},Vt;function On(){if(Vt)return ke;Vt=1,Object.defineProperty(ke,"__esModule",{value:!0}),ke.default=s;function s(d){var v=[];function l(h){if(Array.isArray(h))for(var _=0;_<h.length;_++)l(h[_]);else h.text=h.text||"",h.data=h.data||"",v.push(h)}return l(d),v}return ke}var Ce={},Xt;function bn(){if(Xt)return Ce;Xt=1,Object.defineProperty(Ce,"__esModule",{value:!0}),Ce.default=s;function s(d){return d.marginTop=d.marginTop||d.margin,d.marginBottom=d.marginBottom||d.margin,d.marginRight=d.marginRight||d.margin,d.marginLeft=d.marginLeft||d.margin,d}return Ce}var Be={},qe={},je={},Jt;function sr(){if(Jt)return je;Jt=1,Object.defineProperty(je,"__esModule",{value:!0}),je.default=s;function s(d){var v=["width","height","textMargin","fontSize","margin","marginTop","marginBottom","marginLeft","marginRight"];for(var l in v)v.hasOwnProperty(l)&&(l=v[l],typeof d[l]=="string"&&(d[l]=parseInt(d[l],10)));return typeof d.displayValue=="string"&&(d.displayValue=d.displayValue!="false"),d}return je}var Le={},Yt;function vr(){if(Yt)return Le;Yt=1,Object.defineProperty(Le,"__esModule",{value:!0});var s={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(){}};return Le.default=s,Le}var Wt;function mn(){if(Wt)return qe;Wt=1,Object.defineProperty(qe,"__esModule",{value:!0});var s=sr(),d=h(s),v=vr(),l=h(v);function h(c){return c&&c.__esModule?c:{default:c}}function _(c){var f={};for(var i in l.default)l.default.hasOwnProperty(i)&&(c.hasAttribute("jsbarcode-"+i.toLowerCase())&&(f[i]=c.getAttribute("jsbarcode-"+i.toLowerCase())),c.hasAttribute("data-"+i.toLowerCase())&&(f[i]=c.getAttribute("data-"+i.toLowerCase())));return f.value=c.getAttribute("jsbarcode-value")||c.getAttribute("data-value"),f=(0,d.default)(f),f}return qe.default=_,qe}var Ne={},$e={},P={},Kt;function _r(){if(Kt)return P;Kt=1,Object.defineProperty(P,"__esModule",{value:!0}),P.getTotalWidthOfEncodings=P.calculateEncodingAttributes=P.getBarcodePadding=P.getEncodingHeight=P.getMaximumHeightOfEncodings=void 0;var s=Ve(),d=v(s);function v(e){return e&&e.__esModule?e:{default:e}}function l(e,t){return t.height+(t.displayValue&&e.text.length>0?t.fontSize+t.textMargin:0)+t.marginTop+t.marginBottom}function h(e,t,n){if(n.displayValue&&t<e){if(n.textAlign=="center")return Math.floor((e-t)/2);if(n.textAlign=="left")return 0;if(n.textAlign=="right")return Math.floor(e-t)}return 0}function _(e,t,n){for(var r=0;r<e.length;r++){var a=e[r],o=(0,d.default)(t,a.options),u;o.displayValue?u=i(a.text,o,n):u=0;var y=a.data.length*o.width;a.width=Math.ceil(Math.max(u,y)),a.height=l(a,o),a.barcodePadding=h(u,y,o)}}function c(e){for(var t=0,n=0;n<e.length;n++)t+=e[n].width;return t}function f(e){for(var t=0,n=0;n<e.length;n++)e[n].height>t&&(t=e[n].height);return t}function i(e,t,n){var r;if(n)r=n;else if(typeof document<"u")r=document.createElement("canvas").getContext("2d");else return 0;r.font=t.fontOptions+" "+t.fontSize+"px "+t.font;var a=r.measureText(e);if(!a)return 0;var o=a.width;return o}return P.getMaximumHeightOfEncodings=f,P.getEncodingHeight=l,P.getBarcodePadding=h,P.calculateEncodingAttributes=_,P.getTotalWidthOfEncodings=c,P}var Qt;function wn(){if(Qt)return $e;Qt=1,Object.defineProperty($e,"__esModule",{value:!0});var s=(function(){function f(i,e){for(var t=0;t<e.length;t++){var n=e[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(i,n.key,n)}}return function(i,e,t){return e&&f(i.prototype,e),t&&f(i,t),i}})(),d=Ve(),v=h(d),l=_r();function h(f){return f&&f.__esModule?f:{default:f}}function _(f,i){if(!(f instanceof i))throw new TypeError("Cannot call a class as a function")}var c=(function(){function f(i,e,t){_(this,f),this.canvas=i,this.encodings=e,this.options=t}return s(f,[{key:"render",value:function(){if(!this.canvas.getContext)throw new Error("The browser does not support canvas.");this.prepareCanvas();for(var e=0;e<this.encodings.length;e++){var t=(0,v.default)(this.options,this.encodings[e].options);this.drawCanvasBarcode(t,this.encodings[e]),this.drawCanvasText(t,this.encodings[e]),this.moveCanvasDrawing(this.encodings[e])}this.restoreCanvas()}},{key:"prepareCanvas",value:function(){var e=this.canvas.getContext("2d");e.save(),(0,l.calculateEncodingAttributes)(this.encodings,this.options,e);var t=(0,l.getTotalWidthOfEncodings)(this.encodings),n=(0,l.getMaximumHeightOfEncodings)(this.encodings);this.canvas.width=t+this.options.marginLeft+this.options.marginRight,this.canvas.height=n,e.clearRect(0,0,this.canvas.width,this.canvas.height),this.options.background&&(e.fillStyle=this.options.background,e.fillRect(0,0,this.canvas.width,this.canvas.height)),e.translate(this.options.marginLeft,0)}},{key:"drawCanvasBarcode",value:function(e,t){var n=this.canvas.getContext("2d"),r=t.data,a;e.textPosition=="top"?a=e.marginTop+e.fontSize+e.textMargin:a=e.marginTop,n.fillStyle=e.lineColor;for(var o=0;o<r.length;o++){var u=o*e.width+t.barcodePadding;r[o]==="1"?n.fillRect(u,a,e.width,e.height):r[o]&&n.fillRect(u,a,e.width,e.height*r[o])}}},{key:"drawCanvasText",value:function(e,t){var n=this.canvas.getContext("2d"),r=e.fontOptions+" "+e.fontSize+"px "+e.font;if(e.displayValue){var a,o;e.textPosition=="top"?o=e.marginTop+e.fontSize-e.textMargin:o=e.height+e.textMargin+e.marginTop+e.fontSize,n.font=r,e.textAlign=="left"||t.barcodePadding>0?(a=0,n.textAlign="left"):e.textAlign=="right"?(a=t.width-1,n.textAlign="right"):(a=t.width/2,n.textAlign="center"),n.fillText(t.text,a,o)}}},{key:"moveCanvasDrawing",value:function(e){var t=this.canvas.getContext("2d");t.translate(e.width,0)}},{key:"restoreCanvas",value:function(){var e=this.canvas.getContext("2d");e.restore()}}]),f})();return $e.default=c,$e}var Ge={},Zt;function xn(){if(Zt)return Ge;Zt=1,Object.defineProperty(Ge,"__esModule",{value:!0});var s=(function(){function i(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),e}})(),d=Ve(),v=h(d),l=_r();function h(i){return i&&i.__esModule?i:{default:i}}function _(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}var c="http://www.w3.org/2000/svg",f=(function(){function i(e,t,n){_(this,i),this.svg=e,this.encodings=t,this.options=n,this.document=n.xmlDocument||document}return s(i,[{key:"render",value:function(){var t=this.options.marginLeft;this.prepareSVG();for(var n=0;n<this.encodings.length;n++){var r=this.encodings[n],a=(0,v.default)(this.options,r.options),o=this.createGroup(t,a.marginTop,this.svg);this.setGroupOptions(o,a),this.drawSvgBarcode(o,a,r),this.drawSVGText(o,a,r),t+=r.width}}},{key:"prepareSVG",value:function(){for(;this.svg.firstChild;)this.svg.removeChild(this.svg.firstChild);(0,l.calculateEncodingAttributes)(this.encodings,this.options);var t=(0,l.getTotalWidthOfEncodings)(this.encodings),n=(0,l.getMaximumHeightOfEncodings)(this.encodings),r=t+this.options.marginLeft+this.options.marginRight;this.setSvgAttributes(r,n),this.options.background&&this.drawRect(0,0,r,n,this.svg).setAttribute("fill",this.options.background)}},{key:"drawSvgBarcode",value:function(t,n,r){var a=r.data,o;n.textPosition=="top"?o=n.fontSize+n.textMargin:o=0;for(var u=0,y=0,p=0;p<a.length;p++)y=p*n.width+r.barcodePadding,a[p]==="1"?u++:u>0&&(this.drawRect(y-n.width*u,o,n.width*u,n.height,t),u=0);u>0&&this.drawRect(y-n.width*(u-1),o,n.width*u,n.height,t)}},{key:"drawSVGText",value:function(t,n,r){var a=this.document.createElementNS(c,"text");if(n.displayValue){var o,u;a.setAttribute("font-family",n.font),a.setAttribute("font-size",n.fontSize),n.fontOptions.includes("bold")&&a.setAttribute("font-weight","bold"),n.fontOptions.includes("italic")&&a.setAttribute("font-style","italic"),n.textPosition=="top"?u=n.fontSize-n.textMargin:u=n.height+n.textMargin+n.fontSize,n.textAlign=="left"||r.barcodePadding>0?(o=0,a.setAttribute("text-anchor","start")):n.textAlign=="right"?(o=r.width-1,a.setAttribute("text-anchor","end")):(o=r.width/2,a.setAttribute("text-anchor","middle")),a.setAttribute("x",o),a.setAttribute("y",u),a.appendChild(this.document.createTextNode(r.text)),t.appendChild(a)}}},{key:"setSvgAttributes",value:function(t,n){var r=this.svg;r.setAttribute("width",t+"px"),r.setAttribute("height",n+"px"),r.setAttribute("x","0px"),r.setAttribute("y","0px"),r.setAttribute("viewBox","0 0 "+t+" "+n),r.setAttribute("xmlns",c),r.setAttribute("version","1.1")}},{key:"createGroup",value:function(t,n,r){var a=this.document.createElementNS(c,"g");return a.setAttribute("transform","translate("+t+", "+n+")"),r.appendChild(a),a}},{key:"setGroupOptions",value:function(t,n){t.setAttribute("fill",n.lineColor)}},{key:"drawRect",value:function(t,n,r,a,o){var u=this.document.createElementNS(c,"rect");return u.setAttribute("x",t),u.setAttribute("y",n),u.setAttribute("width",r),u.setAttribute("height",a),o.appendChild(u),u}}]),i})();return Ge.default=f,Ge}var Fe={},er;function Sn(){if(er)return Fe;er=1,Object.defineProperty(Fe,"__esModule",{value:!0});var s=(function(){function l(h,_){for(var c=0;c<_.length;c++){var f=_[c];f.enumerable=f.enumerable||!1,f.configurable=!0,"value"in f&&(f.writable=!0),Object.defineProperty(h,f.key,f)}}return function(h,_,c){return _&&l(h.prototype,_),c&&l(h,c),h}})();function d(l,h){if(!(l instanceof h))throw new TypeError("Cannot call a class as a function")}var v=(function(){function l(h,_,c){d(this,l),this.object=h,this.encodings=_,this.options=c}return s(l,[{key:"render",value:function(){this.object.encodings=this.encodings}}]),l})();return Fe.default=v,Fe}var tr;function Rn(){if(tr)return Ne;tr=1,Object.defineProperty(Ne,"__esModule",{value:!0});var s=wn(),d=c(s),v=xn(),l=c(v),h=Sn(),_=c(h);function c(f){return f&&f.__esModule?f:{default:f}}return Ne.default={CanvasRenderer:d.default,SVGRenderer:l.default,ObjectRenderer:_.default},Ne}var U={},rr;function yr(){if(rr)return U;rr=1,Object.defineProperty(U,"__esModule",{value:!0});function s(c,f){if(!(c instanceof f))throw new TypeError("Cannot call a class as a function")}function d(c,f){if(!c)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return f&&(typeof f=="object"||typeof f=="function")?f:c}function v(c,f){if(typeof f!="function"&&f!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof f);c.prototype=Object.create(f&&f.prototype,{constructor:{value:c,enumerable:!1,writable:!0,configurable:!0}}),f&&(Object.setPrototypeOf?Object.setPrototypeOf(c,f):c.__proto__=f)}var l=(function(c){v(f,c);function f(i,e){s(this,f);var t=d(this,(f.__proto__||Object.getPrototypeOf(f)).call(this));return t.name="InvalidInputException",t.symbology=i,t.input=e,t.message='"'+t.input+'" is not a valid input for '+t.symbology,t}return f})(Error),h=(function(c){v(f,c);function f(){s(this,f);var i=d(this,(f.__proto__||Object.getPrototypeOf(f)).call(this));return i.name="InvalidElementException",i.message="Not supported type to render on",i}return f})(Error),_=(function(c){v(f,c);function f(){s(this,f);var i=d(this,(f.__proto__||Object.getPrototypeOf(f)).call(this));return i.name="NoElementException",i.message="No element to render on.",i}return f})(Error);return U.InvalidInputException=l,U.InvalidElementException=h,U.NoElementException=_,U}var nr;function An(){if(nr)return Be;nr=1,Object.defineProperty(Be,"__esModule",{value:!0});var s=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},d=mn(),v=c(d),l=Rn(),h=c(l),_=yr();function c(t){return t&&t.__esModule?t:{default:t}}function f(t){if(typeof t=="string")return i(t);if(Array.isArray(t)){for(var n=[],r=0;r<t.length;r++)n.push(f(t[r]));return n}else{if(typeof HTMLCanvasElement<"u"&&t instanceof HTMLImageElement)return e(t);if(t&&t.nodeName&&t.nodeName.toLowerCase()==="svg"||typeof SVGElement<"u"&&t instanceof SVGElement)return{element:t,options:(0,v.default)(t),renderer:h.default.SVGRenderer};if(typeof HTMLCanvasElement<"u"&&t instanceof HTMLCanvasElement)return{element:t,options:(0,v.default)(t),renderer:h.default.CanvasRenderer};if(t&&t.getContext)return{element:t,renderer:h.default.CanvasRenderer};if(t&&(typeof t>"u"?"undefined":s(t))==="object"&&!t.nodeName)return{element:t,renderer:h.default.ObjectRenderer};throw new _.InvalidElementException}}function i(t){var n=document.querySelectorAll(t);if(n.length!==0){for(var r=[],a=0;a<n.length;a++)r.push(f(n[a]));return r}}function e(t){var n=document.createElement("canvas");return{element:n,options:(0,v.default)(t),renderer:h.default.CanvasRenderer,afterRender:function(){t.setAttribute("src",n.toDataURL())}}}return Be.default=f,Be}var ze={},ir;function Pn(){if(ir)return ze;ir=1,Object.defineProperty(ze,"__esModule",{value:!0});var s=(function(){function l(h,_){for(var c=0;c<_.length;c++){var f=_[c];f.enumerable=f.enumerable||!1,f.configurable=!0,"value"in f&&(f.writable=!0),Object.defineProperty(h,f.key,f)}}return function(h,_,c){return _&&l(h.prototype,_),c&&l(h,c),h}})();function d(l,h){if(!(l instanceof h))throw new TypeError("Cannot call a class as a function")}var v=(function(){function l(h){d(this,l),this.api=h}return s(l,[{key:"handleCatch",value:function(_){if(_.name==="InvalidInputException")if(this.api._options.valid!==this.api._defaults.valid)this.api._options.valid(!1);else throw _.message;else throw _;this.api.render=function(){}}},{key:"wrapBarcodeCall",value:function(_){try{var c=_.apply(void 0,arguments);return this.api._options.valid(!0),c}catch(f){return this.handleCatch(f),this.api}}}]),l})();return ze.default=v,ze}var Ke,ar;function Tn(){if(ar)return Ke;ar=1;var s=En(),d=p(s),v=Ve(),l=p(v),h=On(),_=p(h),c=bn(),f=p(c),i=An(),e=p(i),t=sr(),n=p(t),r=Pn(),a=p(r),o=yr(),u=vr(),y=p(u);function p(E){return E&&E.__esModule?E:{default:E}}var g=function(){},w=function(b,S,O){var m=new g;if(typeof b>"u")throw Error("No element to render on was provided.");return m._renderProperties=(0,e.default)(b),m._encodings=[],m._options=y.default,m._errorHandler=new a.default(m),typeof S<"u"&&(O=O||{},O.format||(O.format=et()),m.options(O)[O.format](S,O).render()),m};w.getModule=function(E){return d.default[E]};for(var $ in d.default)d.default.hasOwnProperty($)&&oe(d.default,$);function oe(E,b){g.prototype[b]=g.prototype[b.toUpperCase()]=g.prototype[b.toLowerCase()]=function(S,O){var m=this;return m._errorHandler.wrapBarcodeCall(function(){O.text=typeof O.text>"u"?void 0:""+O.text;var M=(0,l.default)(m._options,O);M=(0,n.default)(M);var pr=E[b],gr=Ze(S,pr,M);return m._encodings.push(gr),m})}}function Ze(E,b,S){E=""+E;var O=new b(E,S);if(!O.valid())throw new o.InvalidInputException(O.constructor.name,E);var m=O.encode();m=(0,_.default)(m);for(var M=0;M<m.length;M++)m[M].options=(0,l.default)(S,m[M].options);return m}function et(){return d.default.CODE128?"CODE128":Object.keys(d.default)[0]}g.prototype.options=function(E){return this._options=(0,l.default)(this._options,E),this},g.prototype.blank=function(E){var b=new Array(E+1).join("0");return this._encodings.push({data:b}),this},g.prototype.init=function(){if(this._renderProperties){Array.isArray(this._renderProperties)||(this._renderProperties=[this._renderProperties]);var E;for(var b in this._renderProperties){E=this._renderProperties[b];var S=(0,l.default)(this._options,E.options);S.format=="auto"&&(S.format=et()),this._errorHandler.wrapBarcodeCall(function(){var O=S.value,m=d.default[S.format.toUpperCase()],M=Ze(O,m,S);Xe(E,M,S)})}}},g.prototype.render=function(){if(!this._renderProperties)throw new o.NoElementException;if(Array.isArray(this._renderProperties))for(var E=0;E<this._renderProperties.length;E++)Xe(this._renderProperties[E],this._encodings,this._options);else Xe(this._renderProperties,this._encodings,this._options);return this},g.prototype._defaults=y.default;function Xe(E,b,S){b=(0,_.default)(b);for(var O=0;O<b.length;O++)b[O].options=(0,l.default)(S,b[O].options),(0,f.default)(b[O].options);(0,f.default)(S);var m=E.renderer,M=new m(E.element,b,S);M.render(),E.afterRender&&E.afterRender()}return typeof window<"u"&&(window.JsBarcode=w),typeof jQuery<"u"&&(jQuery.fn.JsBarcode=function(E,b){var S=[];return jQuery(this).each(function(){S.push(this)}),w(S,E,b)}),Ke=w,Ke}var Mn=Tn();const In=kr(Mn),Dn={width:{type:[String,Number],default:"auto"},height:{type:[String,Number],default:"auto"},loading:{type:Boolean,default:!1},barcodeRender:{type:String,default:"canvas",validator:s=>["canvas","svg"].includes(s)},text:{type:String},options:{type:Object,default:()=>({})},format:{type:String,default:()=>"CODE128"},watchText:{type:Boolean,default:!0},onSuccess:{type:[Function,Array]},onError:{type:[Function,Array]},onFinally:{type:[Function,Array]},responsive:{type:Boolean,default:!1}},kn=Qe({name:"RBarcode",props:Dn,setup(s){const d=tt("barcodeRef"),v=tt("containerRef"),l=te({width:0,height:0});let h;const _=ee(()=>{let i=nt(s.width),e=nt(s.height);return s.width==="responsive"&&l.value.width>0&&(i=`${l.value.width}px`),s.height==="responsive"&&l.value.height>0&&(e=`${l.value.height}px`),{"--r-barcode-width":i,"--r-barcode-height":e}});let c;const f=()=>{if(d.value)try{const{format:i,text:e,options:t,onSuccess:n}=s,r=Object.assign({},t,{format:i});l.value.width>0&&(s.width==="responsive"&&(r.width=Math.max(1,l.value.width/100)),s.height==="responsive"&&(r.height=Math.max(20,l.value.height*.8))),In(d.value,e!=null?e.toString():"",r),n&&We(n,e,i,t)}catch(i){const{onError:e}=s;e&&We(e,i)}finally{const{onFinally:i}=s;i&&We(i)}};return ur(()=>{s.watchText?(c==null||c(),c=Or(()=>s.text,f)):c==null||c(),s.responsive?(h==null||h.stop(),h=Dr(v,i=>{const e=i[0];if(e){const{width:t,height:n}=e.contentRect;l.value={width:t,height:n},rt(()=>{f()})}})):(h==null||h.stop(),h=null)}),br(()=>{if(v.value){const i=v.value.getBoundingClientRect();l.value={width:i.width,height:i.height}}rt(()=>{f()})}),mr(()=>{c==null||c()}),{barcodeRef:d,containerRef:v,cssVars:_}},render(){const{barcodeRender:s,loading:d,cssVars:v,responsive:l}=this,h=["r-barcode",{"r-barcode--loading":d}],_=s==="canvas"?Z("canvas",{class:h,style:v,ref:"barcodeRef"},null):Z("svg",{class:h,style:v,ref:"barcodeRef"},null);return Z(Ur,{class:"r-barcode-spin",show:d},{default:()=>[l?Z("div",{class:"r-barcode-container",ref:"containerRef"},[_]):_]})}}),Cn=["lang"],Bn={class:"ray-demo-fields"},qn=["for"],jn=["id","inputmode","aria-describedby","aria-invalid"],Ln={class:"ray-demo-options ray-demo-native-options"},Nn=["for"],$n=["id","name","value"],Gn=["id"],Fn=["aria-label"],Yn=Qe({__name:"RBarcodeDemo",props:{locale:{}},setup(s){const d=s,v=ee(()=>d.locale==="en"?{text:"Barcode text",format:"Format",empty:"Enter text to generate a barcode.",invalid:"This text is invalid for the selected format.",ean:"Try 590123412345: EAN-13 takes 12 digits or 13 with a valid check digit."}:{text:"条码文本",format:"条码制式",empty:"输入文本后生成条码。",invalid:"这段文本不符合当前制式。",ean:"可试试 590123412345:EAN-13 接受 12 位数字,或附带正确校验位的 13 位数字。"}),l=Je(),h=Je(),_=Je(),c=["CODE128","CODE39","EAN13"],f=te("CODE128"),i=te("RAY-2026"),e=te(!1),t={width:1.5,height:52,background:"#fff",lineColor:"#111"};return(n,r)=>(C(),N("div",{class:"ray-demo",lang:s.locale??"zh-CN"},[I("div",Bn,[I("div",null,[I("label",{for:B(l)},H(v.value.text),9,qn),Ye(I("input",{id:B(l),"onUpdate:modelValue":r[0]||(r[0]=a=>i.value=a),class:"ray-demo-input",maxlength:"24",inputmode:f.value==="EAN13"?"numeric":"text","aria-describedby":B(h),"aria-invalid":!!(i.value&&e.value)},null,8,jn),[[wr,i.value]])]),I("fieldset",null,[I("legend",null,H(v.value.format),1),I("div",Ln,[(C(),N(xr,null,Sr(c,a=>I("label",{key:a,for:`${B(_)}-${a}`},[Ye(I("input",{id:`${B(_)}-${a}`,"onUpdate:modelValue":r[1]||(r[1]=o=>f.value=o),type:"radio",name:B(_),value:a},null,8,$n),[[Rr,f.value]]),Ar(" "+H(a),1)],8,Nn)),64))])])]),I("p",{id:B(h),class:"ray-demo-hint","aria-live":"polite"},H(i.value?e.value?v.value.invalid:"":v.value.empty)+" "+H(f.value==="EAN13"?v.value.ean:""),9,Gn),i.value?Ye((C(),N("div",{key:0,class:"ray-demo-barcode",role:"img","aria-label":`${f.value}: ${i.value}`},[(C(),or(B(kn),{key:f.value,text:i.value,format:f.value,options:t,barcodeRender:"svg",onSuccess:r[2]||(r[2]=a=>e.value=!1),onError:r[3]||(r[3]=a=>e.value=!0)},null,8,["text","format"]))],8,Fn)),[[Pr,!e.value]]):Tr("",!0)],8,Cn))}});export{Yn as default};
|