jclib-ui 1.0.237 → 1.0.239

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("react"),require("jcinfo-utils"),require("framer-motion"),require("styled-components"),require("reactstrap"),require("react-router-dom"),require("js-file-download"),require("axios"),require("react-number-format")):"function"==typeof define&&define.amd?define(["exports","react","jcinfo-utils","framer-motion","styled-components","reactstrap","react-router-dom","js-file-download","axios","react-number-format"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).JCLibUI={},t.React,t.JCInfoUtils,t.FramerMotion,t.styled,t.Reactstrap,t.ReactRouterDom,t.jcFileDownload,t.Axios,t.ReactNumberFormat)}(this,function(t,e,r,n,o,i,a,s,c,u){"use strict";function l(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t)for(const r in t)if("default"!==r){const n=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(e,r,n.get?n:{enumerable:!0,get:()=>t[r]})}return e.default=t,Object.freeze(e)}const f=l(e);var d="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function h(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function p(t){if(t.__esModule)return t;var e=t.default;if("function"==typeof e){var r=function t(){return this instanceof t?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};r.prototype=e.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(t).forEach(function(e){var n=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(r,e,n.get?n:{enumerable:!0,get:function(){return t[e]}})}),r}var g="top",m="bottom",v="right",y="left",_="auto",w=[g,m,v,y],b="start",C="end",A="clippingParents",E="viewport",I="popper",S="reference",O=w.reduce(function(t,e){return t.concat([e+"-"+b,e+"-"+C])},[]),T=[].concat(w,[_]).reduce(function(t,e){return t.concat([e,e+"-"+b,e+"-"+C])},[]),N="beforeRead",x="read",R="afterRead",D="beforeMain",P="main",M="afterMain",k="beforeWrite",L="write",j="afterWrite",B=[N,x,R,D,P,M,k,L,j];function F(t){return t?(t.nodeName||"").toLowerCase():null}function V(t){if(null==t)return window;if("[object Window]"!==t.toString()){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function H(t){return t instanceof V(t).Element||t instanceof Element}function U(t){return t instanceof V(t).HTMLElement||t instanceof HTMLElement}function W(t){return"undefined"!=typeof ShadowRoot&&(t instanceof V(t).ShadowRoot||t instanceof ShadowRoot)}const z={name:"applyStyles",enabled:!0,phase:"write",fn:function(t){var e=t.state;Object.keys(e.elements).forEach(function(t){var r=e.styles[t]||{},n=e.attributes[t]||{},o=e.elements[t];U(o)&&F(o)&&(Object.assign(o.style,r),Object.keys(n).forEach(function(t){var e=n[t];!1===e?o.removeAttribute(t):o.setAttribute(t,!0===e?"":e)}))})},effect:function(t){var e=t.state,r={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,r.popper),e.styles=r,e.elements.arrow&&Object.assign(e.elements.arrow.style,r.arrow),function(){Object.keys(e.elements).forEach(function(t){var n=e.elements[t],o=e.attributes[t]||{},i=Object.keys(e.styles.hasOwnProperty(t)?e.styles[t]:r[t]).reduce(function(t,e){return t[e]="",t},{});U(n)&&F(n)&&(Object.assign(n.style,i),Object.keys(o).forEach(function(t){n.removeAttribute(t)}))})}},requires:["computeStyles"]};function G(t){return t.split("-")[0]}var X=Math.max,$=Math.min,Y=Math.round;function q(){var t=navigator.userAgentData;return null!=t&&t.brands&&Array.isArray(t.brands)?t.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function K(){return!/^((?!chrome|android).)*safari/i.test(q())}function Z(t,e,r){void 0===e&&(e=!1),void 0===r&&(r=!1);var n=t.getBoundingClientRect(),o=1,i=1;e&&U(t)&&(o=t.offsetWidth>0&&Y(n.width)/t.offsetWidth||1,i=t.offsetHeight>0&&Y(n.height)/t.offsetHeight||1);var a=(H(t)?V(t):window).visualViewport,s=!K()&&r,c=(n.left+(s&&a?a.offsetLeft:0))/o,u=(n.top+(s&&a?a.offsetTop:0))/i,l=n.width/o,f=n.height/i;return{width:l,height:f,top:u,right:c+l,bottom:u+f,left:c,x:c,y:u}}function Q(t){var e=Z(t),r=t.offsetWidth,n=t.offsetHeight;return Math.abs(e.width-r)<=1&&(r=e.width),Math.abs(e.height-n)<=1&&(n=e.height),{x:t.offsetLeft,y:t.offsetTop,width:r,height:n}}function J(t,e){var r=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(r&&W(r)){var n=e;do{if(n&&t.isSameNode(n))return!0;n=n.parentNode||n.host}while(n)}return!1}function tt(t){return V(t).getComputedStyle(t)}function et(t){return["table","td","th"].indexOf(F(t))>=0}function rt(t){return((H(t)?t.ownerDocument:t.document)||window.document).documentElement}function nt(t){return"html"===F(t)?t:t.assignedSlot||t.parentNode||(W(t)?t.host:null)||rt(t)}function ot(t){return U(t)&&"fixed"!==tt(t).position?t.offsetParent:null}function it(t){for(var e=V(t),r=ot(t);r&&et(r)&&"static"===tt(r).position;)r=ot(r);return r&&("html"===F(r)||"body"===F(r)&&"static"===tt(r).position)?e:r||function(t){var e=/firefox/i.test(q());if(/Trident/i.test(q())&&U(t)&&"fixed"===tt(t).position)return null;var r=nt(t);for(W(r)&&(r=r.host);U(r)&&["html","body"].indexOf(F(r))<0;){var n=tt(r);if("none"!==n.transform||"none"!==n.perspective||"paint"===n.contain||-1!==["transform","perspective"].indexOf(n.willChange)||e&&"filter"===n.willChange||e&&n.filter&&"none"!==n.filter)return r;r=r.parentNode}return null}(t)||e}function at(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function st(t,e,r){return X(t,$(e,r))}function ct(t){return Object.assign({},{top:0,right:0,bottom:0,left:0},t)}function ut(t,e){return e.reduce(function(e,r){return e[r]=t,e},{})}const lt={name:"arrow",enabled:!0,phase:"main",fn:function(t){var e,r=t.state,n=t.name,o=t.options,i=r.elements.arrow,a=r.modifiersData.popperOffsets,s=G(r.placement),c=at(s),u=[y,v].indexOf(s)>=0?"height":"width";if(i&&a){var l=function(t,e){return ct("number"!=typeof(t="function"==typeof t?t(Object.assign({},e.rects,{placement:e.placement})):t)?t:ut(t,w))}(o.padding,r),f=Q(i),d="y"===c?g:y,h="y"===c?m:v,p=r.rects.reference[u]+r.rects.reference[c]-a[c]-r.rects.popper[u],_=a[c]-r.rects.reference[c],b=it(i),C=b?"y"===c?b.clientHeight||0:b.clientWidth||0:0,A=p/2-_/2,E=l[d],I=C-f[u]-l[h],S=C/2-f[u]/2+A,O=st(E,S,I),T=c;r.modifiersData[n]=((e={})[T]=O,e.centerOffset=O-S,e)}},effect:function(t){var e=t.state,r=t.options.element,n=void 0===r?"[data-popper-arrow]":r;null!=n&&("string"!=typeof n||(n=e.elements.popper.querySelector(n)))&&J(e.elements.popper,n)&&(e.elements.arrow=n)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function ft(t){return t.split("-")[1]}var dt={top:"auto",right:"auto",bottom:"auto",left:"auto"};function ht(t){var e,r=t.popper,n=t.popperRect,o=t.placement,i=t.variation,a=t.offsets,s=t.position,c=t.gpuAcceleration,u=t.adaptive,l=t.roundOffsets,f=t.isFixed,d=a.x,h=void 0===d?0:d,p=a.y,_=void 0===p?0:p,w="function"==typeof l?l({x:h,y:_}):{x:h,y:_};h=w.x,_=w.y;var b=a.hasOwnProperty("x"),A=a.hasOwnProperty("y"),E=y,I=g,S=window;if(u){var O=it(r),T="clientHeight",N="clientWidth";if(O===V(r)&&"static"!==tt(O=rt(r)).position&&"absolute"===s&&(T="scrollHeight",N="scrollWidth"),o===g||(o===y||o===v)&&i===C)I=m,_-=(f&&O===S&&S.visualViewport?S.visualViewport.height:O[T])-n.height,_*=c?1:-1;if(o===y||(o===g||o===m)&&i===C)E=v,h-=(f&&O===S&&S.visualViewport?S.visualViewport.width:O[N])-n.width,h*=c?1:-1}var x,R=Object.assign({position:s},u&&dt),D=!0===l?function(t,e){var r=t.x,n=t.y,o=e.devicePixelRatio||1;return{x:Y(r*o)/o||0,y:Y(n*o)/o||0}}({x:h,y:_},V(r)):{x:h,y:_};return h=D.x,_=D.y,c?Object.assign({},R,((x={})[I]=A?"0":"",x[E]=b?"0":"",x.transform=(S.devicePixelRatio||1)<=1?"translate("+h+"px, "+_+"px)":"translate3d("+h+"px, "+_+"px, 0)",x)):Object.assign({},R,((e={})[I]=A?_+"px":"",e[E]=b?h+"px":"",e.transform="",e))}const pt={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(t){var e=t.state,r=t.options,n=r.gpuAcceleration,o=void 0===n||n,i=r.adaptive,a=void 0===i||i,s=r.roundOffsets,c=void 0===s||s,u={placement:G(e.placement),variation:ft(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:o,isFixed:"fixed"===e.options.strategy};null!=e.modifiersData.popperOffsets&&(e.styles.popper=Object.assign({},e.styles.popper,ht(Object.assign({},u,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:a,roundOffsets:c})))),null!=e.modifiersData.arrow&&(e.styles.arrow=Object.assign({},e.styles.arrow,ht(Object.assign({},u,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:c})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})},data:{}};var gt={passive:!0};const mt={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(t){var e=t.state,r=t.instance,n=t.options,o=n.scroll,i=void 0===o||o,a=n.resize,s=void 0===a||a,c=V(e.elements.popper),u=[].concat(e.scrollParents.reference,e.scrollParents.popper);return i&&u.forEach(function(t){t.addEventListener("scroll",r.update,gt)}),s&&c.addEventListener("resize",r.update,gt),function(){i&&u.forEach(function(t){t.removeEventListener("scroll",r.update,gt)}),s&&c.removeEventListener("resize",r.update,gt)}},data:{}};var vt={left:"right",right:"left",bottom:"top",top:"bottom"};function yt(t){return t.replace(/left|right|bottom|top/g,function(t){return vt[t]})}var _t={start:"end",end:"start"};function wt(t){return t.replace(/start|end/g,function(t){return _t[t]})}function bt(t){var e=V(t);return{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function Ct(t){return Z(rt(t)).left+bt(t).scrollLeft}function At(t){var e=tt(t),r=e.overflow,n=e.overflowX,o=e.overflowY;return/auto|scroll|overlay|hidden/.test(r+o+n)}function Et(t){return["html","body","#document"].indexOf(F(t))>=0?t.ownerDocument.body:U(t)&&At(t)?t:Et(nt(t))}function It(t,e){var r;void 0===e&&(e=[]);var n=Et(t),o=n===(null==(r=t.ownerDocument)?void 0:r.body),i=V(n),a=o?[i].concat(i.visualViewport||[],At(n)?n:[]):n,s=e.concat(a);return o?s:s.concat(It(nt(a)))}function St(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function Ot(t,e,r){return e===E?St(function(t,e){var r=V(t),n=rt(t),o=r.visualViewport,i=n.clientWidth,a=n.clientHeight,s=0,c=0;if(o){i=o.width,a=o.height;var u=K();(u||!u&&"fixed"===e)&&(s=o.offsetLeft,c=o.offsetTop)}return{width:i,height:a,x:s+Ct(t),y:c}}(t,r)):H(e)?function(t,e){var r=Z(t,!1,"fixed"===e);return r.top=r.top+t.clientTop,r.left=r.left+t.clientLeft,r.bottom=r.top+t.clientHeight,r.right=r.left+t.clientWidth,r.width=t.clientWidth,r.height=t.clientHeight,r.x=r.left,r.y=r.top,r}(e,r):St(function(t){var e,r=rt(t),n=bt(t),o=null==(e=t.ownerDocument)?void 0:e.body,i=X(r.scrollWidth,r.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),a=X(r.scrollHeight,r.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0),s=-n.scrollLeft+Ct(t),c=-n.scrollTop;return"rtl"===tt(o||r).direction&&(s+=X(r.clientWidth,o?o.clientWidth:0)-i),{width:i,height:a,x:s,y:c}}(rt(t)))}function Tt(t,e,r,n){var o="clippingParents"===e?function(t){var e=It(nt(t)),r=["absolute","fixed"].indexOf(tt(t).position)>=0&&U(t)?it(t):t;return H(r)?e.filter(function(t){return H(t)&&J(t,r)&&"body"!==F(t)}):[]}(t):[].concat(e),i=[].concat(o,[r]),a=i[0],s=i.reduce(function(e,r){var o=Ot(t,r,n);return e.top=X(o.top,e.top),e.right=$(o.right,e.right),e.bottom=$(o.bottom,e.bottom),e.left=X(o.left,e.left),e},Ot(t,a,n));return s.width=s.right-s.left,s.height=s.bottom-s.top,s.x=s.left,s.y=s.top,s}function Nt(t){var e,r=t.reference,n=t.element,o=t.placement,i=o?G(o):null,a=o?ft(o):null,s=r.x+r.width/2-n.width/2,c=r.y+r.height/2-n.height/2;switch(i){case g:e={x:s,y:r.y-n.height};break;case m:e={x:s,y:r.y+r.height};break;case v:e={x:r.x+r.width,y:c};break;case y:e={x:r.x-n.width,y:c};break;default:e={x:r.x,y:r.y}}var u=i?at(i):null;if(null!=u){var l="y"===u?"height":"width";switch(a){case b:e[u]=e[u]-(r[l]/2-n[l]/2);break;case C:e[u]=e[u]+(r[l]/2-n[l]/2)}}return e}function xt(t,e){void 0===e&&(e={});var r=e,n=r.placement,o=void 0===n?t.placement:n,i=r.strategy,a=void 0===i?t.strategy:i,s=r.boundary,c=void 0===s?A:s,u=r.rootBoundary,l=void 0===u?E:u,f=r.elementContext,d=void 0===f?I:f,h=r.altBoundary,p=void 0!==h&&h,y=r.padding,_=void 0===y?0:y,b=ct("number"!=typeof _?_:ut(_,w)),C=d===I?S:I,O=t.rects.popper,T=t.elements[p?C:d],N=Tt(H(T)?T:T.contextElement||rt(t.elements.popper),c,l,a),x=Z(t.elements.reference),R=Nt({reference:x,element:O,placement:o}),D=St(Object.assign({},O,R)),P=d===I?D:x,M={top:N.top-P.top+b.top,bottom:P.bottom-N.bottom+b.bottom,left:N.left-P.left+b.left,right:P.right-N.right+b.right},k=t.modifiersData.offset;if(d===I&&k){var L=k[o];Object.keys(M).forEach(function(t){var e=[v,m].indexOf(t)>=0?1:-1,r=[g,m].indexOf(t)>=0?"y":"x";M[t]+=L[r]*e})}return M}const Rt={name:"flip",enabled:!0,phase:"main",fn:function(t){var e=t.state,r=t.options,n=t.name;if(!e.modifiersData[n]._skip){for(var o=r.mainAxis,i=void 0===o||o,a=r.altAxis,s=void 0===a||a,c=r.fallbackPlacements,u=r.padding,l=r.boundary,f=r.rootBoundary,d=r.altBoundary,h=r.flipVariations,p=void 0===h||h,C=r.allowedAutoPlacements,A=e.options.placement,E=G(A),I=c||(E===A||!p?[yt(A)]:function(t){if(G(t)===_)return[];var e=yt(t);return[wt(t),e,wt(e)]}(A)),S=[A].concat(I).reduce(function(t,r){return t.concat(G(r)===_?function(t,e){void 0===e&&(e={});var r=e,n=r.placement,o=r.boundary,i=r.rootBoundary,a=r.padding,s=r.flipVariations,c=r.allowedAutoPlacements,u=void 0===c?T:c,l=ft(n),f=l?s?O:O.filter(function(t){return ft(t)===l}):w,d=f.filter(function(t){return u.indexOf(t)>=0});0===d.length&&(d=f);var h=d.reduce(function(e,r){return e[r]=xt(t,{placement:r,boundary:o,rootBoundary:i,padding:a})[G(r)],e},{});return Object.keys(h).sort(function(t,e){return h[t]-h[e]})}(e,{placement:r,boundary:l,rootBoundary:f,padding:u,flipVariations:p,allowedAutoPlacements:C}):r)},[]),N=e.rects.reference,x=e.rects.popper,R=new Map,D=!0,P=S[0],M=0;M<S.length;M++){var k=S[M],L=G(k),j=ft(k)===b,B=[g,m].indexOf(L)>=0,F=B?"width":"height",V=xt(e,{placement:k,boundary:l,rootBoundary:f,altBoundary:d,padding:u}),H=B?j?v:y:j?m:g;N[F]>x[F]&&(H=yt(H));var U=yt(H),W=[];if(i&&W.push(V[L]<=0),s&&W.push(V[H]<=0,V[U]<=0),W.every(function(t){return t})){P=k,D=!1;break}R.set(k,W)}if(D)for(var z=function(t){var e=S.find(function(e){var r=R.get(e);if(r)return r.slice(0,t).every(function(t){return t})});if(e)return P=e,"break"},X=p?3:1;X>0;X--){if("break"===z(X))break}e.placement!==P&&(e.modifiersData[n]._skip=!0,e.placement=P,e.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function Dt(t,e,r){return void 0===r&&(r={x:0,y:0}),{top:t.top-e.height-r.y,right:t.right-e.width+r.x,bottom:t.bottom-e.height+r.y,left:t.left-e.width-r.x}}function Pt(t){return[g,v,m,y].some(function(e){return t[e]>=0})}const Mt={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(t){var e=t.state,r=t.name,n=e.rects.reference,o=e.rects.popper,i=e.modifiersData.preventOverflow,a=xt(e,{elementContext:"reference"}),s=xt(e,{altBoundary:!0}),c=Dt(a,n),u=Dt(s,o,i),l=Pt(c),f=Pt(u);e.modifiersData[r]={referenceClippingOffsets:c,popperEscapeOffsets:u,isReferenceHidden:l,hasPopperEscaped:f},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":l,"data-popper-escaped":f})}};const kt={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(t){var e=t.state,r=t.options,n=t.name,o=r.offset,i=void 0===o?[0,0]:o,a=T.reduce(function(t,r){return t[r]=function(t,e,r){var n=G(t),o=[y,g].indexOf(n)>=0?-1:1,i="function"==typeof r?r(Object.assign({},e,{placement:t})):r,a=i[0],s=i[1];return a=a||0,s=(s||0)*o,[y,v].indexOf(n)>=0?{x:s,y:a}:{x:a,y:s}}(r,e.rects,i),t},{}),s=a[e.placement],c=s.x,u=s.y;null!=e.modifiersData.popperOffsets&&(e.modifiersData.popperOffsets.x+=c,e.modifiersData.popperOffsets.y+=u),e.modifiersData[n]=a}};const Lt={name:"popperOffsets",enabled:!0,phase:"read",fn:function(t){var e=t.state,r=t.name;e.modifiersData[r]=Nt({reference:e.rects.reference,element:e.rects.popper,placement:e.placement})},data:{}};const jt={name:"preventOverflow",enabled:!0,phase:"main",fn:function(t){var e=t.state,r=t.options,n=t.name,o=r.mainAxis,i=void 0===o||o,a=r.altAxis,s=void 0!==a&&a,c=r.boundary,u=r.rootBoundary,l=r.altBoundary,f=r.padding,d=r.tether,h=void 0===d||d,p=r.tetherOffset,_=void 0===p?0:p,w=xt(e,{boundary:c,rootBoundary:u,padding:f,altBoundary:l}),C=G(e.placement),A=ft(e.placement),E=!A,I=at(C),S="x"===I?"y":"x",O=e.modifiersData.popperOffsets,T=e.rects.reference,N=e.rects.popper,x="function"==typeof _?_(Object.assign({},e.rects,{placement:e.placement})):_,R="number"==typeof x?{mainAxis:x,altAxis:x}:Object.assign({mainAxis:0,altAxis:0},x),D=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,P={x:0,y:0};if(O){if(i){var M,k="y"===I?g:y,L="y"===I?m:v,j="y"===I?"height":"width",B=O[I],F=B+w[k],V=B-w[L],H=h?-N[j]/2:0,U=A===b?T[j]:N[j],W=A===b?-N[j]:-T[j],z=e.elements.arrow,Y=h&&z?Q(z):{width:0,height:0},q=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},K=q[k],Z=q[L],J=st(0,T[j],Y[j]),tt=E?T[j]/2-H-J-K-R.mainAxis:U-J-K-R.mainAxis,et=E?-T[j]/2+H+J+Z+R.mainAxis:W+J+Z+R.mainAxis,rt=e.elements.arrow&&it(e.elements.arrow),nt=rt?"y"===I?rt.clientTop||0:rt.clientLeft||0:0,ot=null!=(M=null==D?void 0:D[I])?M:0,ct=B+et-ot,ut=st(h?$(F,B+tt-ot-nt):F,B,h?X(V,ct):V);O[I]=ut,P[I]=ut-B}if(s){var lt,dt="x"===I?g:y,ht="x"===I?m:v,pt=O[S],gt="y"===S?"height":"width",mt=pt+w[dt],vt=pt-w[ht],yt=-1!==[g,y].indexOf(C),_t=null!=(lt=null==D?void 0:D[S])?lt:0,wt=yt?mt:pt-T[gt]-N[gt]-_t+R.altAxis,bt=yt?pt+T[gt]+N[gt]-_t-R.altAxis:vt,Ct=h&&yt?(Et=st(wt,pt,At=bt))>At?At:Et:st(h?wt:mt,pt,h?bt:vt);O[S]=Ct,P[S]=Ct-pt}var At,Et;e.modifiersData[n]=P}},requiresIfExists:["offset"]};function Bt(t,e,r){void 0===r&&(r=!1);var n,o,i=U(e),a=U(e)&&function(t){var e=t.getBoundingClientRect(),r=Y(e.width)/t.offsetWidth||1,n=Y(e.height)/t.offsetHeight||1;return 1!==r||1!==n}(e),s=rt(e),c=Z(t,a,r),u={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(i||!i&&!r)&&(("body"!==F(e)||At(s))&&(u=(n=e)!==V(n)&&U(n)?{scrollLeft:(o=n).scrollLeft,scrollTop:o.scrollTop}:bt(n)),U(e)?((l=Z(e,!0)).x+=e.clientLeft,l.y+=e.clientTop):s&&(l.x=Ct(s))),{x:c.left+u.scrollLeft-l.x,y:c.top+u.scrollTop-l.y,width:c.width,height:c.height}}function Ft(t){var e=new Map,r=new Set,n=[];function o(t){r.add(t.name),[].concat(t.requires||[],t.requiresIfExists||[]).forEach(function(t){if(!r.has(t)){var n=e.get(t);n&&o(n)}}),n.push(t)}return t.forEach(function(t){e.set(t.name,t)}),t.forEach(function(t){r.has(t.name)||o(t)}),n}var Vt={placement:"bottom",modifiers:[],strategy:"absolute"};function Ht(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return!e.some(function(t){return!(t&&"function"==typeof t.getBoundingClientRect)})}function Ut(t){void 0===t&&(t={});var e=t,r=e.defaultModifiers,n=void 0===r?[]:r,o=e.defaultOptions,i=void 0===o?Vt:o;return function(t,e,r){void 0===r&&(r=i);var o,a,s={placement:"bottom",orderedModifiers:[],options:Object.assign({},Vt,i),modifiersData:{},elements:{reference:t,popper:e},attributes:{},styles:{}},c=[],u=!1,l={state:s,setOptions:function(r){var o="function"==typeof r?r(s.options):r;f(),s.options=Object.assign({},i,s.options,o),s.scrollParents={reference:H(t)?It(t):t.contextElement?It(t.contextElement):[],popper:It(e)};var a,u,d=function(t){var e=Ft(t);return B.reduce(function(t,r){return t.concat(e.filter(function(t){return t.phase===r}))},[])}((a=[].concat(n,s.options.modifiers),u=a.reduce(function(t,e){var r=t[e.name];return t[e.name]=r?Object.assign({},r,e,{options:Object.assign({},r.options,e.options),data:Object.assign({},r.data,e.data)}):e,t},{}),Object.keys(u).map(function(t){return u[t]})));return s.orderedModifiers=d.filter(function(t){return t.enabled}),s.orderedModifiers.forEach(function(t){var e=t.name,r=t.options,n=void 0===r?{}:r,o=t.effect;if("function"==typeof o){var i=o({state:s,name:e,instance:l,options:n}),a=function(){};c.push(i||a)}}),l.update()},forceUpdate:function(){if(!u){var t=s.elements,e=t.reference,r=t.popper;if(Ht(e,r)){s.rects={reference:Bt(e,it(r),"fixed"===s.options.strategy),popper:Q(r)},s.reset=!1,s.placement=s.options.placement,s.orderedModifiers.forEach(function(t){return s.modifiersData[t.name]=Object.assign({},t.data)});for(var n=0;n<s.orderedModifiers.length;n++)if(!0!==s.reset){var o=s.orderedModifiers[n],i=o.fn,a=o.options,c=void 0===a?{}:a,f=o.name;"function"==typeof i&&(s=i({state:s,options:c,name:f,instance:l})||s)}else s.reset=!1,n=-1}}},update:(o=function(){return new Promise(function(t){l.forceUpdate(),t(s)})},function(){return a||(a=new Promise(function(t){Promise.resolve().then(function(){a=void 0,t(o())})})),a}),destroy:function(){f(),u=!0}};if(!Ht(t,e))return l;function f(){c.forEach(function(t){return t()}),c=[]}return l.setOptions(r).then(function(t){!u&&r.onFirstUpdate&&r.onFirstUpdate(t)}),l}}var Wt=Ut(),zt=Ut({defaultModifiers:[mt,Lt,pt,z]}),Gt=Ut({defaultModifiers:[mt,Lt,pt,z,kt,Rt,jt,lt,Mt]});const Xt=Object.freeze(Object.defineProperty({__proto__:null,afterMain:M,afterRead:R,afterWrite:j,applyStyles:z,arrow:lt,auto:_,basePlacements:w,beforeMain:D,beforeRead:N,beforeWrite:k,bottom:m,clippingParents:A,computeStyles:pt,createPopper:Gt,createPopperBase:Wt,createPopperLite:zt,detectOverflow:xt,end:C,eventListeners:mt,flip:Rt,hide:Mt,left:y,main:P,modifierPhases:B,offset:kt,placements:T,popper:I,popperGenerator:Ut,popperOffsets:Lt,preventOverflow:jt,read:x,reference:S,right:v,start:b,top:g,variationPlacements:O,viewport:E,write:L},Symbol.toStringTag,{value:"Module"}));(function(t){function e(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t)for(const r in t)if("default"!==r){const n=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(e,r,n.get?n:{enumerable:!0,get:()=>t[r]})}return e.default=t,Object.freeze(e)}const r=e(t),n=new Map,o={set(t,e,r){n.has(t)||n.set(t,new Map);const o=n.get(t);o.has(e)||0===o.size?o.set(e,r):console.error(`Bootstrap doesn't allow more than one instance per element. Bound instance: ${Array.from(o.keys())[0]}.`)},get:(t,e)=>n.has(t)&&n.get(t).get(e)||null,remove(t,e){if(!n.has(t))return;const r=n.get(t);r.delete(e),0===r.size&&n.delete(t)}},i="transitionend",a=t=>(t&&window.CSS&&window.CSS.escape&&(t=t.replace(/#([^\s"#']+)/g,(t,e)=>`#${CSS.escape(e)}`)),t),s=t=>null==t?`${t}`:Object.prototype.toString.call(t).match(/\s([a-z]+)/i)[1].toLowerCase(),c=t=>{t.dispatchEvent(new Event(i))},u=t=>!(!t||"object"!=typeof t)&&(void 0!==t.jquery&&(t=t[0]),void 0!==t.nodeType),l=t=>u(t)?t.jquery?t[0]:t:"string"==typeof t&&t.length>0?document.querySelector(a(t)):null,f=t=>{if(!u(t)||0===t.getClientRects().length)return!1;const e="visible"===getComputedStyle(t).getPropertyValue("visibility"),r=t.closest("details:not([open])");if(!r)return e;if(r!==t){const e=t.closest("summary");if(e&&e.parentNode!==r)return!1;if(null===e)return!1}return e},d=t=>!t||t.nodeType!==Node.ELEMENT_NODE||!!t.classList.contains("disabled")||(void 0!==t.disabled?t.disabled:t.hasAttribute("disabled")&&"false"!==t.getAttribute("disabled")),h=t=>{if(!document.documentElement.attachShadow)return null;if("function"==typeof t.getRootNode){const e=t.getRootNode();return e instanceof ShadowRoot?e:null}return t instanceof ShadowRoot?t:t.parentNode?h(t.parentNode):null},p=()=>{},g=t=>{t.offsetHeight},m=()=>window.jQuery&&!document.body.hasAttribute("data-bs-no-jquery")?window.jQuery:null,v=[],y=()=>"rtl"===document.documentElement.dir,_=t=>{var e;e=()=>{const e=m();if(e){const r=t.NAME,n=e.fn[r];e.fn[r]=t.jQueryInterface,e.fn[r].Constructor=t,e.fn[r].noConflict=()=>(e.fn[r]=n,t.jQueryInterface)}},"loading"===document.readyState?(v.length||document.addEventListener("DOMContentLoaded",()=>{for(const t of v)t()}),v.push(e)):e()},w=(t,e=[],r=t)=>"function"==typeof t?t.call(...e):r,b=(t,e,r=!0)=>{if(!r)return void w(t);const n=(t=>{if(!t)return 0;let{transitionDuration:e,transitionDelay:r}=window.getComputedStyle(t);const n=Number.parseFloat(e),o=Number.parseFloat(r);return n||o?(e=e.split(",")[0],r=r.split(",")[0],1e3*(Number.parseFloat(e)+Number.parseFloat(r))):0})(e)+5;let o=!1;const a=({target:r})=>{r===e&&(o=!0,e.removeEventListener(i,a),w(t))};e.addEventListener(i,a),setTimeout(()=>{o||c(e)},n)},C=(t,e,r,n)=>{const o=t.length;let i=t.indexOf(e);return-1===i?!r&&n?t[o-1]:t[0]:(i+=r?1:-1,n&&(i=(i+o)%o),t[Math.max(0,Math.min(i,o-1))])},A=/[^.]*(?=\..*)\.|.*/,E=/\..*/,I=/::\d+$/,S={};let O=1;const T={mouseenter:"mouseover",mouseleave:"mouseout"},N=new Set(["click","dblclick","mouseup","mousedown","contextmenu","mousewheel","DOMMouseScroll","mouseover","mouseout","mousemove","selectstart","selectend","keydown","keypress","keyup","orientationchange","touchstart","touchmove","touchend","touchcancel","pointerdown","pointermove","pointerup","pointerleave","pointercancel","gesturestart","gesturechange","gestureend","focus","blur","change","reset","select","submit","focusin","focusout","load","unload","beforeunload","resize","move","DOMContentLoaded","readystatechange","error","abort","scroll"]);function x(t,e){return e&&`${e}::${O++}`||t.uidEvent||O++}function R(t){const e=x(t);return t.uidEvent=e,S[e]=S[e]||{},S[e]}function D(t,e,r=null){return Object.values(t).find(t=>t.callable===e&&t.delegationSelector===r)}function P(t,e,r){const n="string"==typeof e,o=n?r:e||r;let i=j(t);return N.has(i)||(i=t),[n,o,i]}function M(t,e,r,n,o){if("string"!=typeof e||!t)return;let[i,a,s]=P(e,r,n);var c;e in T&&(c=a,a=function(t){if(!t.relatedTarget||t.relatedTarget!==t.delegateTarget&&!t.delegateTarget.contains(t.relatedTarget))return c.call(this,t)});const u=R(t),l=u[s]||(u[s]={}),f=D(l,a,i?r:null);if(f)return void(f.oneOff=f.oneOff&&o);const d=x(a,e.replace(A,"")),h=i?function(t,e,r){return function n(o){const i=t.querySelectorAll(e);for(let{target:a}=o;a&&a!==this;a=a.parentNode)for(const s of i)if(s===a)return F(o,{delegateTarget:a}),n.oneOff&&B.off(t,o.type,e,r),r.apply(a,[o])}}(t,r,a):function(t,e){return function r(n){return F(n,{delegateTarget:t}),r.oneOff&&B.off(t,n.type,e),e.apply(t,[n])}}(t,a);h.delegationSelector=i?r:null,h.callable=a,h.oneOff=o,h.uidEvent=d,l[d]=h,t.addEventListener(s,h,i)}function k(t,e,r,n,o){const i=D(e[r],n,o);i&&(t.removeEventListener(r,i,Boolean(o)),delete e[r][i.uidEvent])}function L(t,e,r,n){const o=e[r]||{};for(const[i,a]of Object.entries(o))i.includes(n)&&k(t,e,r,a.callable,a.delegationSelector)}function j(t){return t=t.replace(E,""),T[t]||t}const B={on(t,e,r,n){M(t,e,r,n,!1)},one(t,e,r,n){M(t,e,r,n,!0)},off(t,e,r,n){if("string"!=typeof e||!t)return;const[o,i,a]=P(e,r,n),s=a!==e,c=R(t),u=c[a]||{},l=e.startsWith(".");if(void 0===i){if(l)for(const r of Object.keys(c))L(t,c,r,e.slice(1));for(const[r,n]of Object.entries(u)){const o=r.replace(I,"");s&&!e.includes(o)||k(t,c,a,n.callable,n.delegationSelector)}}else{if(!Object.keys(u).length)return;k(t,c,a,i,o?r:null)}},trigger(t,e,r){if("string"!=typeof e||!t)return null;const n=m();let o=null,i=!0,a=!0,s=!1;e!==j(e)&&n&&(o=n.Event(e,r),n(t).trigger(o),i=!o.isPropagationStopped(),a=!o.isImmediatePropagationStopped(),s=o.isDefaultPrevented());const c=F(new Event(e,{bubbles:i,cancelable:!0}),r);return s&&c.preventDefault(),a&&t.dispatchEvent(c),c.defaultPrevented&&o&&o.preventDefault(),c}};function F(t,e={}){for(const[n,o]of Object.entries(e))try{t[n]=o}catch(r){Object.defineProperty(t,n,{configurable:!0,get:()=>o})}return t}function V(t){if("true"===t)return!0;if("false"===t)return!1;if(t===Number(t).toString())return Number(t);if(""===t||"null"===t)return null;if("string"!=typeof t)return t;try{return JSON.parse(decodeURIComponent(t))}catch(e){return t}}function H(t){return t.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}const U={setDataAttribute(t,e,r){t.setAttribute(`data-bs-${H(e)}`,r)},removeDataAttribute(t,e){t.removeAttribute(`data-bs-${H(e)}`)},getDataAttributes(t){if(!t)return{};const e={},r=Object.keys(t.dataset).filter(t=>t.startsWith("bs")&&!t.startsWith("bsConfig"));for(const n of r){let r=n.replace(/^bs/,"");r=r.charAt(0).toLowerCase()+r.slice(1),e[r]=V(t.dataset[n])}return e},getDataAttribute:(t,e)=>V(t.getAttribute(`data-bs-${H(e)}`))};class W{static get Default(){return{}}static get DefaultType(){return{}}static get NAME(){throw new Error('You have to implement the static method "NAME", for each component!')}_getConfig(t){return t=this._mergeConfigObj(t),t=this._configAfterMerge(t),this._typeCheckConfig(t),t}_configAfterMerge(t){return t}_mergeConfigObj(t,e){const r=u(e)?U.getDataAttribute(e,"config"):{};return{...this.constructor.Default,..."object"==typeof r?r:{},...u(e)?U.getDataAttributes(e):{},..."object"==typeof t?t:{}}}_typeCheckConfig(t,e=this.constructor.DefaultType){for(const[r,n]of Object.entries(e)){const e=t[r],o=u(e)?"element":s(e);if(!new RegExp(n).test(o))throw new TypeError(`${this.constructor.NAME.toUpperCase()}: Option "${r}" provided type "${o}" but expected type "${n}".`)}}}class z extends W{constructor(t,e){super(),(t=l(t))&&(this._element=t,this._config=this._getConfig(e),o.set(this._element,this.constructor.DATA_KEY,this))}dispose(){o.remove(this._element,this.constructor.DATA_KEY),B.off(this._element,this.constructor.EVENT_KEY);for(const t of Object.getOwnPropertyNames(this))this[t]=null}_queueCallback(t,e,r=!0){b(t,e,r)}_getConfig(t){return t=this._mergeConfigObj(t,this._element),t=this._configAfterMerge(t),this._typeCheckConfig(t),t}static getInstance(t){return o.get(l(t),this.DATA_KEY)}static getOrCreateInstance(t,e={}){return this.getInstance(t)||new this(t,"object"==typeof e?e:null)}static get VERSION(){return"5.3.8"}static get DATA_KEY(){return`bs.${this.NAME}`}static get EVENT_KEY(){return`.${this.DATA_KEY}`}static eventName(t){return`${t}${this.EVENT_KEY}`}}const G=t=>{let e=t.getAttribute("data-bs-target");if(!e||"#"===e){let r=t.getAttribute("href");if(!r||!r.includes("#")&&!r.startsWith("."))return null;r.includes("#")&&!r.startsWith("#")&&(r=`#${r.split("#")[1]}`),e=r&&"#"!==r?r.trim():null}return e?e.split(",").map(t=>a(t)).join(","):null},X={find:(t,e=document.documentElement)=>[].concat(...Element.prototype.querySelectorAll.call(e,t)),findOne:(t,e=document.documentElement)=>Element.prototype.querySelector.call(e,t),children:(t,e)=>[].concat(...t.children).filter(t=>t.matches(e)),parents(t,e){const r=[];let n=t.parentNode.closest(e);for(;n;)r.push(n),n=n.parentNode.closest(e);return r},prev(t,e){let r=t.previousElementSibling;for(;r;){if(r.matches(e))return[r];r=r.previousElementSibling}return[]},next(t,e){let r=t.nextElementSibling;for(;r;){if(r.matches(e))return[r];r=r.nextElementSibling}return[]},focusableChildren(t){const e=["a","button","input","textarea","select","details","[tabindex]",'[contenteditable="true"]'].map(t=>`${t}:not([tabindex^="-"])`).join(",");return this.find(e,t).filter(t=>!d(t)&&f(t))},getSelectorFromElement(t){const e=G(t);return e&&X.findOne(e)?e:null},getElementFromSelector(t){const e=G(t);return e?X.findOne(e):null},getMultipleElementsFromSelector(t){const e=G(t);return e?X.find(e):[]}},$=(t,e="hide")=>{const r=`click.dismiss${t.EVENT_KEY}`,n=t.NAME;B.on(document,r,`[data-bs-dismiss="${n}"]`,function(r){if(["A","AREA"].includes(this.tagName)&&r.preventDefault(),d(this))return;const o=X.getElementFromSelector(this)||this.closest(`.${n}`);t.getOrCreateInstance(o)[e]()})},Y=".bs.alert",q=`close${Y}`,K=`closed${Y}`;class Z extends z{static get NAME(){return"alert"}close(){if(B.trigger(this._element,q).defaultPrevented)return;this._element.classList.remove("show");const t=this._element.classList.contains("fade");this._queueCallback(()=>this._destroyElement(),this._element,t)}_destroyElement(){this._element.remove(),B.trigger(this._element,K),this.dispose()}static jQueryInterface(t){return this.each(function(){const e=Z.getOrCreateInstance(this);if("string"==typeof t){if(void 0===e[t]||t.startsWith("_")||"constructor"===t)throw new TypeError(`No method named "${t}"`);e[t](this)}})}}$(Z,"close"),_(Z);const Q='[data-bs-toggle="button"]';class J extends z{static get NAME(){return"button"}toggle(){this._element.setAttribute("aria-pressed",this._element.classList.toggle("active"))}static jQueryInterface(t){return this.each(function(){const e=J.getOrCreateInstance(this);"toggle"===t&&e[t]()})}}B.on(document,"click.bs.button.data-api",Q,t=>{t.preventDefault();const e=t.target.closest(Q);J.getOrCreateInstance(e).toggle()}),_(J);const tt=".bs.swipe",et=`touchstart${tt}`,rt=`touchmove${tt}`,nt=`touchend${tt}`,ot=`pointerdown${tt}`,it=`pointerup${tt}`,at={endCallback:null,leftCallback:null,rightCallback:null},st={endCallback:"(function|null)",leftCallback:"(function|null)",rightCallback:"(function|null)"};class ct extends W{constructor(t,e){super(),this._element=t,t&&ct.isSupported()&&(this._config=this._getConfig(e),this._deltaX=0,this._supportPointerEvents=Boolean(window.PointerEvent),this._initEvents())}static get Default(){return at}static get DefaultType(){return st}static get NAME(){return"swipe"}dispose(){B.off(this._element,tt)}_start(t){this._supportPointerEvents?this._eventIsPointerPenTouch(t)&&(this._deltaX=t.clientX):this._deltaX=t.touches[0].clientX}_end(t){this._eventIsPointerPenTouch(t)&&(this._deltaX=t.clientX-this._deltaX),this._handleSwipe(),w(this._config.endCallback)}_move(t){this._deltaX=t.touches&&t.touches.length>1?0:t.touches[0].clientX-this._deltaX}_handleSwipe(){const t=Math.abs(this._deltaX);if(t<=40)return;const e=t/this._deltaX;this._deltaX=0,e&&w(e>0?this._config.rightCallback:this._config.leftCallback)}_initEvents(){this._supportPointerEvents?(B.on(this._element,ot,t=>this._start(t)),B.on(this._element,it,t=>this._end(t)),this._element.classList.add("pointer-event")):(B.on(this._element,et,t=>this._start(t)),B.on(this._element,rt,t=>this._move(t)),B.on(this._element,nt,t=>this._end(t)))}_eventIsPointerPenTouch(t){return this._supportPointerEvents&&("pen"===t.pointerType||"touch"===t.pointerType)}static isSupported(){return"ontouchstart"in document.documentElement||navigator.maxTouchPoints>0}}const ut=".bs.carousel",lt=".data-api",ft="ArrowLeft",dt="ArrowRight",ht="next",pt="prev",gt="left",mt="right",vt=`slide${ut}`,yt=`slid${ut}`,_t=`keydown${ut}`,wt=`mouseenter${ut}`,bt=`mouseleave${ut}`,Ct=`dragstart${ut}`,At=`load${ut}${lt}`,Et=`click${ut}${lt}`,It="carousel",St="active",Ot=".active",Tt=".carousel-item",Nt=Ot+Tt,xt={[ft]:mt,[dt]:gt},Rt={interval:5e3,keyboard:!0,pause:"hover",ride:!1,touch:!0,wrap:!0},Dt={interval:"(number|boolean)",keyboard:"boolean",pause:"(string|boolean)",ride:"(boolean|string)",touch:"boolean",wrap:"boolean"};class Pt extends z{constructor(t,e){super(t,e),this._interval=null,this._activeElement=null,this._isSliding=!1,this.touchTimeout=null,this._swipeHelper=null,this._indicatorsElement=X.findOne(".carousel-indicators",this._element),this._addEventListeners(),this._config.ride===It&&this.cycle()}static get Default(){return Rt}static get DefaultType(){return Dt}static get NAME(){return"carousel"}next(){this._slide(ht)}nextWhenVisible(){!document.hidden&&f(this._element)&&this.next()}prev(){this._slide(pt)}pause(){this._isSliding&&c(this._element),this._clearInterval()}cycle(){this._clearInterval(),this._updateInterval(),this._interval=setInterval(()=>this.nextWhenVisible(),this._config.interval)}_maybeEnableCycle(){this._config.ride&&(this._isSliding?B.one(this._element,yt,()=>this.cycle()):this.cycle())}to(t){const e=this._getItems();if(t>e.length-1||t<0)return;if(this._isSliding)return void B.one(this._element,yt,()=>this.to(t));const r=this._getItemIndex(this._getActive());if(r===t)return;const n=t>r?ht:pt;this._slide(n,e[t])}dispose(){this._swipeHelper&&this._swipeHelper.dispose(),super.dispose()}_configAfterMerge(t){return t.defaultInterval=t.interval,t}_addEventListeners(){this._config.keyboard&&B.on(this._element,_t,t=>this._keydown(t)),"hover"===this._config.pause&&(B.on(this._element,wt,()=>this.pause()),B.on(this._element,bt,()=>this._maybeEnableCycle())),this._config.touch&&ct.isSupported()&&this._addTouchEventListeners()}_addTouchEventListeners(){for(const e of X.find(".carousel-item img",this._element))B.on(e,Ct,t=>t.preventDefault());const t={leftCallback:()=>this._slide(this._directionToOrder(gt)),rightCallback:()=>this._slide(this._directionToOrder(mt)),endCallback:()=>{"hover"===this._config.pause&&(this.pause(),this.touchTimeout&&clearTimeout(this.touchTimeout),this.touchTimeout=setTimeout(()=>this._maybeEnableCycle(),500+this._config.interval))}};this._swipeHelper=new ct(this._element,t)}_keydown(t){if(/input|textarea/i.test(t.target.tagName))return;const e=xt[t.key];e&&(t.preventDefault(),this._slide(this._directionToOrder(e)))}_getItemIndex(t){return this._getItems().indexOf(t)}_setActiveIndicatorElement(t){if(!this._indicatorsElement)return;const e=X.findOne(Ot,this._indicatorsElement);e.classList.remove(St),e.removeAttribute("aria-current");const r=X.findOne(`[data-bs-slide-to="${t}"]`,this._indicatorsElement);r&&(r.classList.add(St),r.setAttribute("aria-current","true"))}_updateInterval(){const t=this._activeElement||this._getActive();if(!t)return;const e=Number.parseInt(t.getAttribute("data-bs-interval"),10);this._config.interval=e||this._config.defaultInterval}_slide(t,e=null){if(this._isSliding)return;const r=this._getActive(),n=t===ht,o=e||C(this._getItems(),r,n,this._config.wrap);if(o===r)return;const i=this._getItemIndex(o),a=e=>B.trigger(this._element,e,{relatedTarget:o,direction:this._orderToDirection(t),from:this._getItemIndex(r),to:i});if(a(vt).defaultPrevented)return;if(!r||!o)return;const s=Boolean(this._interval);this.pause(),this._isSliding=!0,this._setActiveIndicatorElement(i),this._activeElement=o;const c=n?"carousel-item-start":"carousel-item-end",u=n?"carousel-item-next":"carousel-item-prev";o.classList.add(u),g(o),r.classList.add(c),o.classList.add(c),this._queueCallback(()=>{o.classList.remove(c,u),o.classList.add(St),r.classList.remove(St,u,c),this._isSliding=!1,a(yt)},r,this._isAnimated()),s&&this.cycle()}_isAnimated(){return this._element.classList.contains("slide")}_getActive(){return X.findOne(Nt,this._element)}_getItems(){return X.find(Tt,this._element)}_clearInterval(){this._interval&&(clearInterval(this._interval),this._interval=null)}_directionToOrder(t){return y()?t===gt?pt:ht:t===gt?ht:pt}_orderToDirection(t){return y()?t===pt?gt:mt:t===pt?mt:gt}static jQueryInterface(t){return this.each(function(){const e=Pt.getOrCreateInstance(this,t);if("number"!=typeof t){if("string"==typeof t){if(void 0===e[t]||t.startsWith("_")||"constructor"===t)throw new TypeError(`No method named "${t}"`);e[t]()}}else e.to(t)})}}B.on(document,Et,"[data-bs-slide], [data-bs-slide-to]",function(t){const e=X.getElementFromSelector(this);if(!e||!e.classList.contains(It))return;t.preventDefault();const r=Pt.getOrCreateInstance(e),n=this.getAttribute("data-bs-slide-to");return n?(r.to(n),void r._maybeEnableCycle()):"next"===U.getDataAttribute(this,"slide")?(r.next(),void r._maybeEnableCycle()):(r.prev(),void r._maybeEnableCycle())}),B.on(window,At,()=>{const t=X.find('[data-bs-ride="carousel"]');for(const e of t)Pt.getOrCreateInstance(e)}),_(Pt);const Mt=".bs.collapse",kt=`show${Mt}`,Lt=`shown${Mt}`,jt=`hide${Mt}`,Bt=`hidden${Mt}`,Ft=`click${Mt}.data-api`,Vt="show",Ht="collapse",Ut="collapsing",Wt=`:scope .${Ht} .${Ht}`,zt='[data-bs-toggle="collapse"]',Gt={parent:null,toggle:!0},Xt={parent:"(null|element)",toggle:"boolean"};class $t extends z{constructor(t,e){super(t,e),this._isTransitioning=!1,this._triggerArray=[];const r=X.find(zt);for(const n of r){const t=X.getSelectorFromElement(n),e=X.find(t).filter(t=>t===this._element);null!==t&&e.length&&this._triggerArray.push(n)}this._initializeChildren(),this._config.parent||this._addAriaAndCollapsedClass(this._triggerArray,this._isShown()),this._config.toggle&&this.toggle()}static get Default(){return Gt}static get DefaultType(){return Xt}static get NAME(){return"collapse"}toggle(){this._isShown()?this.hide():this.show()}show(){if(this._isTransitioning||this._isShown())return;let t=[];if(this._config.parent&&(t=this._getFirstLevelChildren(".collapse.show, .collapse.collapsing").filter(t=>t!==this._element).map(t=>$t.getOrCreateInstance(t,{toggle:!1}))),t.length&&t[0]._isTransitioning)return;if(B.trigger(this._element,kt).defaultPrevented)return;for(const n of t)n.hide();const e=this._getDimension();this._element.classList.remove(Ht),this._element.classList.add(Ut),this._element.style[e]=0,this._addAriaAndCollapsedClass(this._triggerArray,!0),this._isTransitioning=!0;const r=`scroll${e[0].toUpperCase()+e.slice(1)}`;this._queueCallback(()=>{this._isTransitioning=!1,this._element.classList.remove(Ut),this._element.classList.add(Ht,Vt),this._element.style[e]="",B.trigger(this._element,Lt)},this._element,!0),this._element.style[e]=`${this._element[r]}px`}hide(){if(this._isTransitioning||!this._isShown())return;if(B.trigger(this._element,jt).defaultPrevented)return;const t=this._getDimension();this._element.style[t]=`${this._element.getBoundingClientRect()[t]}px`,g(this._element),this._element.classList.add(Ut),this._element.classList.remove(Ht,Vt);for(const e of this._triggerArray){const t=X.getElementFromSelector(e);t&&!this._isShown(t)&&this._addAriaAndCollapsedClass([e],!1)}this._isTransitioning=!0,this._element.style[t]="",this._queueCallback(()=>{this._isTransitioning=!1,this._element.classList.remove(Ut),this._element.classList.add(Ht),B.trigger(this._element,Bt)},this._element,!0)}_isShown(t=this._element){return t.classList.contains(Vt)}_configAfterMerge(t){return t.toggle=Boolean(t.toggle),t.parent=l(t.parent),t}_getDimension(){return this._element.classList.contains("collapse-horizontal")?"width":"height"}_initializeChildren(){if(!this._config.parent)return;const t=this._getFirstLevelChildren(zt);for(const e of t){const t=X.getElementFromSelector(e);t&&this._addAriaAndCollapsedClass([e],this._isShown(t))}}_getFirstLevelChildren(t){const e=X.find(Wt,this._config.parent);return X.find(t,this._config.parent).filter(t=>!e.includes(t))}_addAriaAndCollapsedClass(t,e){if(t.length)for(const r of t)r.classList.toggle("collapsed",!e),r.setAttribute("aria-expanded",e)}static jQueryInterface(t){const e={};return"string"==typeof t&&/show|hide/.test(t)&&(e.toggle=!1),this.each(function(){const r=$t.getOrCreateInstance(this,e);if("string"==typeof t){if(void 0===r[t])throw new TypeError(`No method named "${t}"`);r[t]()}})}}B.on(document,Ft,zt,function(t){("A"===t.target.tagName||t.delegateTarget&&"A"===t.delegateTarget.tagName)&&t.preventDefault();for(const e of X.getMultipleElementsFromSelector(this))$t.getOrCreateInstance(e,{toggle:!1}).toggle()}),_($t);const Yt="dropdown",qt=".bs.dropdown",Kt=".data-api",Zt="ArrowUp",Qt="ArrowDown",Jt=`hide${qt}`,te=`hidden${qt}`,ee=`show${qt}`,re=`shown${qt}`,ne=`click${qt}${Kt}`,oe=`keydown${qt}${Kt}`,ie=`keyup${qt}${Kt}`,ae="show",se='[data-bs-toggle="dropdown"]:not(.disabled):not(:disabled)',ce=`${se}.${ae}`,ue=".dropdown-menu",le=y()?"top-end":"top-start",fe=y()?"top-start":"top-end",de=y()?"bottom-end":"bottom-start",he=y()?"bottom-start":"bottom-end",pe=y()?"left-start":"right-start",ge=y()?"right-start":"left-start",me={autoClose:!0,boundary:"clippingParents",display:"dynamic",offset:[0,2],popperConfig:null,reference:"toggle"},ve={autoClose:"(boolean|string)",boundary:"(string|element)",display:"string",offset:"(array|string|function)",popperConfig:"(null|object|function)",reference:"(string|element|object)"};class ye extends z{constructor(t,e){super(t,e),this._popper=null,this._parent=this._element.parentNode,this._menu=X.next(this._element,ue)[0]||X.prev(this._element,ue)[0]||X.findOne(ue,this._parent),this._inNavbar=this._detectNavbar()}static get Default(){return me}static get DefaultType(){return ve}static get NAME(){return Yt}toggle(){return this._isShown()?this.hide():this.show()}show(){if(d(this._element)||this._isShown())return;const t={relatedTarget:this._element};if(!B.trigger(this._element,ee,t).defaultPrevented){if(this._createPopper(),"ontouchstart"in document.documentElement&&!this._parent.closest(".navbar-nav"))for(const t of[].concat(...document.body.children))B.on(t,"mouseover",p);this._element.focus(),this._element.setAttribute("aria-expanded",!0),this._menu.classList.add(ae),this._element.classList.add(ae),B.trigger(this._element,re,t)}}hide(){if(d(this._element)||!this._isShown())return;const t={relatedTarget:this._element};this._completeHide(t)}dispose(){this._popper&&this._popper.destroy(),super.dispose()}update(){this._inNavbar=this._detectNavbar(),this._popper&&this._popper.update()}_completeHide(t){if(!B.trigger(this._element,Jt,t).defaultPrevented){if("ontouchstart"in document.documentElement)for(const t of[].concat(...document.body.children))B.off(t,"mouseover",p);this._popper&&this._popper.destroy(),this._menu.classList.remove(ae),this._element.classList.remove(ae),this._element.setAttribute("aria-expanded","false"),U.removeDataAttribute(this._menu,"popper"),B.trigger(this._element,te,t)}}_getConfig(t){if("object"==typeof(t=super._getConfig(t)).reference&&!u(t.reference)&&"function"!=typeof t.reference.getBoundingClientRect)throw new TypeError(`${Yt.toUpperCase()}: Option "reference" provided type "object" without a required "getBoundingClientRect" method.`);return t}_createPopper(){if(void 0===r)throw new TypeError("Bootstrap's dropdowns require Popper (https://popper.js.org/docs/v2/)");let t=this._element;"parent"===this._config.reference?t=this._parent:u(this._config.reference)?t=l(this._config.reference):"object"==typeof this._config.reference&&(t=this._config.reference);const e=this._getPopperConfig();this._popper=r.createPopper(t,this._menu,e)}_isShown(){return this._menu.classList.contains(ae)}_getPlacement(){const t=this._parent;if(t.classList.contains("dropend"))return pe;if(t.classList.contains("dropstart"))return ge;if(t.classList.contains("dropup-center"))return"top";if(t.classList.contains("dropdown-center"))return"bottom";const e="end"===getComputedStyle(this._menu).getPropertyValue("--bs-position").trim();return t.classList.contains("dropup")?e?fe:le:e?he:de}_detectNavbar(){return null!==this._element.closest(".navbar")}_getOffset(){const{offset:t}=this._config;return"string"==typeof t?t.split(",").map(t=>Number.parseInt(t,10)):"function"==typeof t?e=>t(e,this._element):t}_getPopperConfig(){const t={placement:this._getPlacement(),modifiers:[{name:"preventOverflow",options:{boundary:this._config.boundary}},{name:"offset",options:{offset:this._getOffset()}}]};return(this._inNavbar||"static"===this._config.display)&&(U.setDataAttribute(this._menu,"popper","static"),t.modifiers=[{name:"applyStyles",enabled:!1}]),{...t,...w(this._config.popperConfig,[void 0,t])}}_selectMenuItem({key:t,target:e}){const r=X.find(".dropdown-menu .dropdown-item:not(.disabled):not(:disabled)",this._menu).filter(t=>f(t));r.length&&C(r,e,t===Qt,!r.includes(e)).focus()}static jQueryInterface(t){return this.each(function(){const e=ye.getOrCreateInstance(this,t);if("string"==typeof t){if(void 0===e[t])throw new TypeError(`No method named "${t}"`);e[t]()}})}static clearMenus(t){if(2===t.button||"keyup"===t.type&&"Tab"!==t.key)return;const e=X.find(ce);for(const r of e){const e=ye.getInstance(r);if(!e||!1===e._config.autoClose)continue;const n=t.composedPath(),o=n.includes(e._menu);if(n.includes(e._element)||"inside"===e._config.autoClose&&!o||"outside"===e._config.autoClose&&o)continue;if(e._menu.contains(t.target)&&("keyup"===t.type&&"Tab"===t.key||/input|select|option|textarea|form/i.test(t.target.tagName)))continue;const i={relatedTarget:e._element};"click"===t.type&&(i.clickEvent=t),e._completeHide(i)}}static dataApiKeydownHandler(t){const e=/input|textarea/i.test(t.target.tagName),r="Escape"===t.key,n=[Zt,Qt].includes(t.key);if(!n&&!r)return;if(e&&!r)return;t.preventDefault();const o=this.matches(se)?this:X.prev(this,se)[0]||X.next(this,se)[0]||X.findOne(se,t.delegateTarget.parentNode),i=ye.getOrCreateInstance(o);if(n)return t.stopPropagation(),i.show(),void i._selectMenuItem(t);i._isShown()&&(t.stopPropagation(),i.hide(),o.focus())}}B.on(document,oe,se,ye.dataApiKeydownHandler),B.on(document,oe,ue,ye.dataApiKeydownHandler),B.on(document,ne,ye.clearMenus),B.on(document,ie,ye.clearMenus),B.on(document,ne,se,function(t){t.preventDefault(),ye.getOrCreateInstance(this).toggle()}),_(ye);const _e="backdrop",we="show",be=`mousedown.bs.${_e}`,Ce={className:"modal-backdrop",clickCallback:null,isAnimated:!1,isVisible:!0,rootElement:"body"},Ae={className:"string",clickCallback:"(function|null)",isAnimated:"boolean",isVisible:"boolean",rootElement:"(element|string)"};class Ee extends W{constructor(t){super(),this._config=this._getConfig(t),this._isAppended=!1,this._element=null}static get Default(){return Ce}static get DefaultType(){return Ae}static get NAME(){return _e}show(t){if(!this._config.isVisible)return void w(t);this._append();const e=this._getElement();this._config.isAnimated&&g(e),e.classList.add(we),this._emulateAnimation(()=>{w(t)})}hide(t){this._config.isVisible?(this._getElement().classList.remove(we),this._emulateAnimation(()=>{this.dispose(),w(t)})):w(t)}dispose(){this._isAppended&&(B.off(this._element,be),this._element.remove(),this._isAppended=!1)}_getElement(){if(!this._element){const t=document.createElement("div");t.className=this._config.className,this._config.isAnimated&&t.classList.add("fade"),this._element=t}return this._element}_configAfterMerge(t){return t.rootElement=l(t.rootElement),t}_append(){if(this._isAppended)return;const t=this._getElement();this._config.rootElement.append(t),B.on(t,be,()=>{w(this._config.clickCallback)}),this._isAppended=!0}_emulateAnimation(t){b(t,this._getElement(),this._config.isAnimated)}}const Ie=".bs.focustrap",Se=`focusin${Ie}`,Oe=`keydown.tab${Ie}`,Te="backward",Ne={autofocus:!0,trapElement:null},xe={autofocus:"boolean",trapElement:"element"};class Re extends W{constructor(t){super(),this._config=this._getConfig(t),this._isActive=!1,this._lastTabNavDirection=null}static get Default(){return Ne}static get DefaultType(){return xe}static get NAME(){return"focustrap"}activate(){this._isActive||(this._config.autofocus&&this._config.trapElement.focus(),B.off(document,Ie),B.on(document,Se,t=>this._handleFocusin(t)),B.on(document,Oe,t=>this._handleKeydown(t)),this._isActive=!0)}deactivate(){this._isActive&&(this._isActive=!1,B.off(document,Ie))}_handleFocusin(t){const{trapElement:e}=this._config;if(t.target===document||t.target===e||e.contains(t.target))return;const r=X.focusableChildren(e);0===r.length?e.focus():this._lastTabNavDirection===Te?r[r.length-1].focus():r[0].focus()}_handleKeydown(t){"Tab"===t.key&&(this._lastTabNavDirection=t.shiftKey?Te:"forward")}}const De=".fixed-top, .fixed-bottom, .is-fixed, .sticky-top",Pe=".sticky-top",Me="padding-right",ke="margin-right";class Le{constructor(){this._element=document.body}getWidth(){const t=document.documentElement.clientWidth;return Math.abs(window.innerWidth-t)}hide(){const t=this.getWidth();this._disableOverFlow(),this._setElementAttributes(this._element,Me,e=>e+t),this._setElementAttributes(De,Me,e=>e+t),this._setElementAttributes(Pe,ke,e=>e-t)}reset(){this._resetElementAttributes(this._element,"overflow"),this._resetElementAttributes(this._element,Me),this._resetElementAttributes(De,Me),this._resetElementAttributes(Pe,ke)}isOverflowing(){return this.getWidth()>0}_disableOverFlow(){this._saveInitialAttribute(this._element,"overflow"),this._element.style.overflow="hidden"}_setElementAttributes(t,e,r){const n=this.getWidth();this._applyManipulationCallback(t,t=>{if(t!==this._element&&window.innerWidth>t.clientWidth+n)return;this._saveInitialAttribute(t,e);const o=window.getComputedStyle(t).getPropertyValue(e);t.style.setProperty(e,`${r(Number.parseFloat(o))}px`)})}_saveInitialAttribute(t,e){const r=t.style.getPropertyValue(e);r&&U.setDataAttribute(t,e,r)}_resetElementAttributes(t,e){this._applyManipulationCallback(t,t=>{const r=U.getDataAttribute(t,e);null!==r?(U.removeDataAttribute(t,e),t.style.setProperty(e,r)):t.style.removeProperty(e)})}_applyManipulationCallback(t,e){if(u(t))e(t);else for(const r of X.find(t,this._element))e(r)}}const je=".bs.modal",Be=`hide${je}`,Fe=`hidePrevented${je}`,Ve=`hidden${je}`,He=`show${je}`,Ue=`shown${je}`,We=`resize${je}`,ze=`click.dismiss${je}`,Ge=`mousedown.dismiss${je}`,Xe=`keydown.dismiss${je}`,$e=`click${je}.data-api`,Ye="modal-open",qe="show",Ke="modal-static",Ze={backdrop:!0,focus:!0,keyboard:!0},Qe={backdrop:"(boolean|string)",focus:"boolean",keyboard:"boolean"};class Je extends z{constructor(t,e){super(t,e),this._dialog=X.findOne(".modal-dialog",this._element),this._backdrop=this._initializeBackDrop(),this._focustrap=this._initializeFocusTrap(),this._isShown=!1,this._isTransitioning=!1,this._scrollBar=new Le,this._addEventListeners()}static get Default(){return Ze}static get DefaultType(){return Qe}static get NAME(){return"modal"}toggle(t){return this._isShown?this.hide():this.show(t)}show(t){this._isShown||this._isTransitioning||B.trigger(this._element,He,{relatedTarget:t}).defaultPrevented||(this._isShown=!0,this._isTransitioning=!0,this._scrollBar.hide(),document.body.classList.add(Ye),this._adjustDialog(),this._backdrop.show(()=>this._showElement(t)))}hide(){this._isShown&&!this._isTransitioning&&(B.trigger(this._element,Be).defaultPrevented||(this._isShown=!1,this._isTransitioning=!0,this._focustrap.deactivate(),this._element.classList.remove(qe),this._queueCallback(()=>this._hideModal(),this._element,this._isAnimated())))}dispose(){B.off(window,je),B.off(this._dialog,je),this._backdrop.dispose(),this._focustrap.deactivate(),super.dispose()}handleUpdate(){this._adjustDialog()}_initializeBackDrop(){return new Ee({isVisible:Boolean(this._config.backdrop),isAnimated:this._isAnimated()})}_initializeFocusTrap(){return new Re({trapElement:this._element})}_showElement(t){document.body.contains(this._element)||document.body.append(this._element),this._element.style.display="block",this._element.removeAttribute("aria-hidden"),this._element.setAttribute("aria-modal",!0),this._element.setAttribute("role","dialog"),this._element.scrollTop=0;const e=X.findOne(".modal-body",this._dialog);e&&(e.scrollTop=0),g(this._element),this._element.classList.add(qe),this._queueCallback(()=>{this._config.focus&&this._focustrap.activate(),this._isTransitioning=!1,B.trigger(this._element,Ue,{relatedTarget:t})},this._dialog,this._isAnimated())}_addEventListeners(){B.on(this._element,Xe,t=>{"Escape"===t.key&&(this._config.keyboard?this.hide():this._triggerBackdropTransition())}),B.on(window,We,()=>{this._isShown&&!this._isTransitioning&&this._adjustDialog()}),B.on(this._element,Ge,t=>{B.one(this._element,ze,e=>{this._element===t.target&&this._element===e.target&&("static"!==this._config.backdrop?this._config.backdrop&&this.hide():this._triggerBackdropTransition())})})}_hideModal(){this._element.style.display="none",this._element.setAttribute("aria-hidden",!0),this._element.removeAttribute("aria-modal"),this._element.removeAttribute("role"),this._isTransitioning=!1,this._backdrop.hide(()=>{document.body.classList.remove(Ye),this._resetAdjustments(),this._scrollBar.reset(),B.trigger(this._element,Ve)})}_isAnimated(){return this._element.classList.contains("fade")}_triggerBackdropTransition(){if(B.trigger(this._element,Fe).defaultPrevented)return;const t=this._element.scrollHeight>document.documentElement.clientHeight,e=this._element.style.overflowY;"hidden"===e||this._element.classList.contains(Ke)||(t||(this._element.style.overflowY="hidden"),this._element.classList.add(Ke),this._queueCallback(()=>{this._element.classList.remove(Ke),this._queueCallback(()=>{this._element.style.overflowY=e},this._dialog)},this._dialog),this._element.focus())}_adjustDialog(){const t=this._element.scrollHeight>document.documentElement.clientHeight,e=this._scrollBar.getWidth(),r=e>0;if(r&&!t){const t=y()?"paddingLeft":"paddingRight";this._element.style[t]=`${e}px`}if(!r&&t){const t=y()?"paddingRight":"paddingLeft";this._element.style[t]=`${e}px`}}_resetAdjustments(){this._element.style.paddingLeft="",this._element.style.paddingRight=""}static jQueryInterface(t,e){return this.each(function(){const r=Je.getOrCreateInstance(this,t);if("string"==typeof t){if(void 0===r[t])throw new TypeError(`No method named "${t}"`);r[t](e)}})}}B.on(document,$e,'[data-bs-toggle="modal"]',function(t){const e=X.getElementFromSelector(this);["A","AREA"].includes(this.tagName)&&t.preventDefault(),B.one(e,He,t=>{t.defaultPrevented||B.one(e,Ve,()=>{f(this)&&this.focus()})});const r=X.findOne(".modal.show");r&&Je.getInstance(r).hide(),Je.getOrCreateInstance(e).toggle(this)}),$(Je),_(Je);const tr=".bs.offcanvas",er=".data-api",rr=`load${tr}${er}`,nr="show",or="showing",ir="hiding",ar=".offcanvas.show",sr=`show${tr}`,cr=`shown${tr}`,ur=`hide${tr}`,lr=`hidePrevented${tr}`,fr=`hidden${tr}`,dr=`resize${tr}`,hr=`click${tr}${er}`,pr=`keydown.dismiss${tr}`,gr={backdrop:!0,keyboard:!0,scroll:!1},mr={backdrop:"(boolean|string)",keyboard:"boolean",scroll:"boolean"};class vr extends z{constructor(t,e){super(t,e),this._isShown=!1,this._backdrop=this._initializeBackDrop(),this._focustrap=this._initializeFocusTrap(),this._addEventListeners()}static get Default(){return gr}static get DefaultType(){return mr}static get NAME(){return"offcanvas"}toggle(t){return this._isShown?this.hide():this.show(t)}show(t){this._isShown||B.trigger(this._element,sr,{relatedTarget:t}).defaultPrevented||(this._isShown=!0,this._backdrop.show(),this._config.scroll||(new Le).hide(),this._element.setAttribute("aria-modal",!0),this._element.setAttribute("role","dialog"),this._element.classList.add(or),this._queueCallback(()=>{this._config.scroll&&!this._config.backdrop||this._focustrap.activate(),this._element.classList.add(nr),this._element.classList.remove(or),B.trigger(this._element,cr,{relatedTarget:t})},this._element,!0))}hide(){this._isShown&&(B.trigger(this._element,ur).defaultPrevented||(this._focustrap.deactivate(),this._element.blur(),this._isShown=!1,this._element.classList.add(ir),this._backdrop.hide(),this._queueCallback(()=>{this._element.classList.remove(nr,ir),this._element.removeAttribute("aria-modal"),this._element.removeAttribute("role"),this._config.scroll||(new Le).reset(),B.trigger(this._element,fr)},this._element,!0)))}dispose(){this._backdrop.dispose(),this._focustrap.deactivate(),super.dispose()}_initializeBackDrop(){const t=Boolean(this._config.backdrop);return new Ee({className:"offcanvas-backdrop",isVisible:t,isAnimated:!0,rootElement:this._element.parentNode,clickCallback:t?()=>{"static"!==this._config.backdrop?this.hide():B.trigger(this._element,lr)}:null})}_initializeFocusTrap(){return new Re({trapElement:this._element})}_addEventListeners(){B.on(this._element,pr,t=>{"Escape"===t.key&&(this._config.keyboard?this.hide():B.trigger(this._element,lr))})}static jQueryInterface(t){return this.each(function(){const e=vr.getOrCreateInstance(this,t);if("string"==typeof t){if(void 0===e[t]||t.startsWith("_")||"constructor"===t)throw new TypeError(`No method named "${t}"`);e[t](this)}})}}B.on(document,hr,'[data-bs-toggle="offcanvas"]',function(t){const e=X.getElementFromSelector(this);if(["A","AREA"].includes(this.tagName)&&t.preventDefault(),d(this))return;B.one(e,fr,()=>{f(this)&&this.focus()});const r=X.findOne(ar);r&&r!==e&&vr.getInstance(r).hide(),vr.getOrCreateInstance(e).toggle(this)}),B.on(window,rr,()=>{for(const t of X.find(ar))vr.getOrCreateInstance(t).show()}),B.on(window,dr,()=>{for(const t of X.find("[aria-modal][class*=show][class*=offcanvas-]"))"fixed"!==getComputedStyle(t).position&&vr.getOrCreateInstance(t).hide()}),$(vr),_(vr);const yr={"*":["class","dir","id","lang","role",/^aria-[\w-]*$/i],a:["target","href","title","rel"],area:[],b:[],br:[],col:[],code:[],dd:[],div:[],dl:[],dt:[],em:[],hr:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],i:[],img:["src","srcset","alt","title","width","height"],li:[],ol:[],p:[],pre:[],s:[],small:[],span:[],sub:[],sup:[],strong:[],u:[],ul:[]},_r=new Set(["background","cite","href","itemtype","longdesc","poster","src","xlink:href"]),wr=/^(?!javascript:)(?:[a-z0-9+.-]+:|[^&:/?#]*(?:[/?#]|$))/i,br=(t,e)=>{const r=t.nodeName.toLowerCase();return e.includes(r)?!_r.has(r)||Boolean(wr.test(t.nodeValue)):e.filter(t=>t instanceof RegExp).some(t=>t.test(r))},Cr={allowList:yr,content:{},extraClass:"",html:!1,sanitize:!0,sanitizeFn:null,template:"<div></div>"},Ar={allowList:"object",content:"object",extraClass:"(string|function)",html:"boolean",sanitize:"boolean",sanitizeFn:"(null|function)",template:"string"},Er={entry:"(string|element|function|null)",selector:"(string|element)"};class Ir extends W{constructor(t){super(),this._config=this._getConfig(t)}static get Default(){return Cr}static get DefaultType(){return Ar}static get NAME(){return"TemplateFactory"}getContent(){return Object.values(this._config.content).map(t=>this._resolvePossibleFunction(t)).filter(Boolean)}hasContent(){return this.getContent().length>0}changeContent(t){return this._checkContent(t),this._config.content={...this._config.content,...t},this}toHtml(){const t=document.createElement("div");t.innerHTML=this._maybeSanitize(this._config.template);for(const[n,o]of Object.entries(this._config.content))this._setContent(t,o,n);const e=t.children[0],r=this._resolvePossibleFunction(this._config.extraClass);return r&&e.classList.add(...r.split(" ")),e}_typeCheckConfig(t){super._typeCheckConfig(t),this._checkContent(t.content)}_checkContent(t){for(const[e,r]of Object.entries(t))super._typeCheckConfig({selector:e,entry:r},Er)}_setContent(t,e,r){const n=X.findOne(r,t);n&&((e=this._resolvePossibleFunction(e))?u(e)?this._putElementInTemplate(l(e),n):this._config.html?n.innerHTML=this._maybeSanitize(e):n.textContent=e:n.remove())}_maybeSanitize(t){return this._config.sanitize?function(t,e,r){if(!t.length)return t;if(r&&"function"==typeof r)return r(t);const n=(new window.DOMParser).parseFromString(t,"text/html"),o=[].concat(...n.body.querySelectorAll("*"));for(const i of o){const t=i.nodeName.toLowerCase();if(!Object.keys(e).includes(t)){i.remove();continue}const r=[].concat(...i.attributes),n=[].concat(e["*"]||[],e[t]||[]);for(const e of r)br(e,n)||i.removeAttribute(e.nodeName)}return n.body.innerHTML}(t,this._config.allowList,this._config.sanitizeFn):t}_resolvePossibleFunction(t){return w(t,[void 0,this])}_putElementInTemplate(t,e){if(this._config.html)return e.innerHTML="",void e.append(t);e.textContent=t.textContent}}const Sr=new Set(["sanitize","allowList","sanitizeFn"]),Or="fade",Tr="show",Nr=".tooltip-inner",xr=".modal",Rr="hide.bs.modal",Dr="hover",Pr="focus",Mr="click",kr={AUTO:"auto",TOP:"top",RIGHT:y()?"left":"right",BOTTOM:"bottom",LEFT:y()?"right":"left"},Lr={allowList:yr,animation:!0,boundary:"clippingParents",container:!1,customClass:"",delay:0,fallbackPlacements:["top","right","bottom","left"],html:!1,offset:[0,6],placement:"top",popperConfig:null,sanitize:!0,sanitizeFn:null,selector:!1,template:'<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',title:"",trigger:"hover focus"},jr={allowList:"object",animation:"boolean",boundary:"(string|element)",container:"(string|element|boolean)",customClass:"(string|function)",delay:"(number|object)",fallbackPlacements:"array",html:"boolean",offset:"(array|string|function)",placement:"(string|function)",popperConfig:"(null|object|function)",sanitize:"boolean",sanitizeFn:"(null|function)",selector:"(string|boolean)",template:"string",title:"(string|element|function)",trigger:"string"};class Br extends z{constructor(t,e){if(void 0===r)throw new TypeError("Bootstrap's tooltips require Popper (https://popper.js.org/docs/v2/)");super(t,e),this._isEnabled=!0,this._timeout=0,this._isHovered=null,this._activeTrigger={},this._popper=null,this._templateFactory=null,this._newContent=null,this.tip=null,this._setListeners(),this._config.selector||this._fixTitle()}static get Default(){return Lr}static get DefaultType(){return jr}static get NAME(){return"tooltip"}enable(){this._isEnabled=!0}disable(){this._isEnabled=!1}toggleEnabled(){this._isEnabled=!this._isEnabled}toggle(){this._isEnabled&&(this._isShown()?this._leave():this._enter())}dispose(){clearTimeout(this._timeout),B.off(this._element.closest(xr),Rr,this._hideModalHandler),this._element.getAttribute("data-bs-original-title")&&this._element.setAttribute("title",this._element.getAttribute("data-bs-original-title")),this._disposePopper(),super.dispose()}show(){if("none"===this._element.style.display)throw new Error("Please use show on visible elements");if(!this._isWithContent()||!this._isEnabled)return;const t=B.trigger(this._element,this.constructor.eventName("show")),e=(h(this._element)||this._element.ownerDocument.documentElement).contains(this._element);if(t.defaultPrevented||!e)return;this._disposePopper();const r=this._getTipElement();this._element.setAttribute("aria-describedby",r.getAttribute("id"));const{container:n}=this._config;if(this._element.ownerDocument.documentElement.contains(this.tip)||(n.append(r),B.trigger(this._element,this.constructor.eventName("inserted"))),this._popper=this._createPopper(r),r.classList.add(Tr),"ontouchstart"in document.documentElement)for(const o of[].concat(...document.body.children))B.on(o,"mouseover",p);this._queueCallback(()=>{B.trigger(this._element,this.constructor.eventName("shown")),!1===this._isHovered&&this._leave(),this._isHovered=!1},this.tip,this._isAnimated())}hide(){if(this._isShown()&&!B.trigger(this._element,this.constructor.eventName("hide")).defaultPrevented){if(this._getTipElement().classList.remove(Tr),"ontouchstart"in document.documentElement)for(const t of[].concat(...document.body.children))B.off(t,"mouseover",p);this._activeTrigger[Mr]=!1,this._activeTrigger[Pr]=!1,this._activeTrigger[Dr]=!1,this._isHovered=null,this._queueCallback(()=>{this._isWithActiveTrigger()||(this._isHovered||this._disposePopper(),this._element.removeAttribute("aria-describedby"),B.trigger(this._element,this.constructor.eventName("hidden")))},this.tip,this._isAnimated())}}update(){this._popper&&this._popper.update()}_isWithContent(){return Boolean(this._getTitle())}_getTipElement(){return this.tip||(this.tip=this._createTipElement(this._newContent||this._getContentForTemplate())),this.tip}_createTipElement(t){const e=this._getTemplateFactory(t).toHtml();if(!e)return null;e.classList.remove(Or,Tr),e.classList.add(`bs-${this.constructor.NAME}-auto`);const r=(t=>{do{t+=Math.floor(1e6*Math.random())}while(document.getElementById(t));return t})(this.constructor.NAME).toString();return e.setAttribute("id",r),this._isAnimated()&&e.classList.add(Or),e}setContent(t){this._newContent=t,this._isShown()&&(this._disposePopper(),this.show())}_getTemplateFactory(t){return this._templateFactory?this._templateFactory.changeContent(t):this._templateFactory=new Ir({...this._config,content:t,extraClass:this._resolvePossibleFunction(this._config.customClass)}),this._templateFactory}_getContentForTemplate(){return{[Nr]:this._getTitle()}}_getTitle(){return this._resolvePossibleFunction(this._config.title)||this._element.getAttribute("data-bs-original-title")}_initializeOnDelegatedTarget(t){return this.constructor.getOrCreateInstance(t.delegateTarget,this._getDelegateConfig())}_isAnimated(){return this._config.animation||this.tip&&this.tip.classList.contains(Or)}_isShown(){return this.tip&&this.tip.classList.contains(Tr)}_createPopper(t){const e=w(this._config.placement,[this,t,this._element]),n=kr[e.toUpperCase()];return r.createPopper(this._element,t,this._getPopperConfig(n))}_getOffset(){const{offset:t}=this._config;return"string"==typeof t?t.split(",").map(t=>Number.parseInt(t,10)):"function"==typeof t?e=>t(e,this._element):t}_resolvePossibleFunction(t){return w(t,[this._element,this._element])}_getPopperConfig(t){const e={placement:t,modifiers:[{name:"flip",options:{fallbackPlacements:this._config.fallbackPlacements}},{name:"offset",options:{offset:this._getOffset()}},{name:"preventOverflow",options:{boundary:this._config.boundary}},{name:"arrow",options:{element:`.${this.constructor.NAME}-arrow`}},{name:"preSetPlacement",enabled:!0,phase:"beforeMain",fn:t=>{this._getTipElement().setAttribute("data-popper-placement",t.state.placement)}}]};return{...e,...w(this._config.popperConfig,[void 0,e])}}_setListeners(){const t=this._config.trigger.split(" ");for(const e of t)if("click"===e)B.on(this._element,this.constructor.eventName("click"),this._config.selector,t=>{const e=this._initializeOnDelegatedTarget(t);e._activeTrigger[Mr]=!(e._isShown()&&e._activeTrigger[Mr]),e.toggle()});else if("manual"!==e){const t=e===Dr?this.constructor.eventName("mouseenter"):this.constructor.eventName("focusin"),r=e===Dr?this.constructor.eventName("mouseleave"):this.constructor.eventName("focusout");B.on(this._element,t,this._config.selector,t=>{const e=this._initializeOnDelegatedTarget(t);e._activeTrigger["focusin"===t.type?Pr:Dr]=!0,e._enter()}),B.on(this._element,r,this._config.selector,t=>{const e=this._initializeOnDelegatedTarget(t);e._activeTrigger["focusout"===t.type?Pr:Dr]=e._element.contains(t.relatedTarget),e._leave()})}this._hideModalHandler=()=>{this._element&&this.hide()},B.on(this._element.closest(xr),Rr,this._hideModalHandler)}_fixTitle(){const t=this._element.getAttribute("title");t&&(this._element.getAttribute("aria-label")||this._element.textContent.trim()||this._element.setAttribute("aria-label",t),this._element.setAttribute("data-bs-original-title",t),this._element.removeAttribute("title"))}_enter(){this._isShown()||this._isHovered?this._isHovered=!0:(this._isHovered=!0,this._setTimeout(()=>{this._isHovered&&this.show()},this._config.delay.show))}_leave(){this._isWithActiveTrigger()||(this._isHovered=!1,this._setTimeout(()=>{this._isHovered||this.hide()},this._config.delay.hide))}_setTimeout(t,e){clearTimeout(this._timeout),this._timeout=setTimeout(t,e)}_isWithActiveTrigger(){return Object.values(this._activeTrigger).includes(!0)}_getConfig(t){const e=U.getDataAttributes(this._element);for(const r of Object.keys(e))Sr.has(r)&&delete e[r];return t={...e,..."object"==typeof t&&t?t:{}},t=this._mergeConfigObj(t),t=this._configAfterMerge(t),this._typeCheckConfig(t),t}_configAfterMerge(t){return t.container=!1===t.container?document.body:l(t.container),"number"==typeof t.delay&&(t.delay={show:t.delay,hide:t.delay}),"number"==typeof t.title&&(t.title=t.title.toString()),"number"==typeof t.content&&(t.content=t.content.toString()),t}_getDelegateConfig(){const t={};for(const[e,r]of Object.entries(this._config))this.constructor.Default[e]!==r&&(t[e]=r);return t.selector=!1,t.trigger="manual",t}_disposePopper(){this._popper&&(this._popper.destroy(),this._popper=null),this.tip&&(this.tip.remove(),this.tip=null)}static jQueryInterface(t){return this.each(function(){const e=Br.getOrCreateInstance(this,t);if("string"==typeof t){if(void 0===e[t])throw new TypeError(`No method named "${t}"`);e[t]()}})}}_(Br);const Fr=".popover-header",Vr=".popover-body",Hr={...Br.Default,content:"",offset:[0,8],placement:"right",template:'<div class="popover" role="tooltip"><div class="popover-arrow"></div><h3 class="popover-header"></h3><div class="popover-body"></div></div>',trigger:"click"},Ur={...Br.DefaultType,content:"(null|string|element|function)"};class Wr extends Br{static get Default(){return Hr}static get DefaultType(){return Ur}static get NAME(){return"popover"}_isWithContent(){return this._getTitle()||this._getContent()}_getContentForTemplate(){return{[Fr]:this._getTitle(),[Vr]:this._getContent()}}_getContent(){return this._resolvePossibleFunction(this._config.content)}static jQueryInterface(t){return this.each(function(){const e=Wr.getOrCreateInstance(this,t);if("string"==typeof t){if(void 0===e[t])throw new TypeError(`No method named "${t}"`);e[t]()}})}}_(Wr);const zr=".bs.scrollspy",Gr=`activate${zr}`,Xr=`click${zr}`,$r=`load${zr}.data-api`,Yr="active",qr="[href]",Kr=".nav-link",Zr=`${Kr}, .nav-item > ${Kr}, .list-group-item`,Qr={offset:null,rootMargin:"0px 0px -25%",smoothScroll:!1,target:null,threshold:[.1,.5,1]},Jr={offset:"(number|null)",rootMargin:"string",smoothScroll:"boolean",target:"element",threshold:"array"};class tn extends z{constructor(t,e){super(t,e),this._targetLinks=new Map,this._observableSections=new Map,this._rootElement="visible"===getComputedStyle(this._element).overflowY?null:this._element,this._activeTarget=null,this._observer=null,this._previousScrollData={visibleEntryTop:0,parentScrollTop:0},this.refresh()}static get Default(){return Qr}static get DefaultType(){return Jr}static get NAME(){return"scrollspy"}refresh(){this._initializeTargetsAndObservables(),this._maybeEnableSmoothScroll(),this._observer?this._observer.disconnect():this._observer=this._getNewObserver();for(const t of this._observableSections.values())this._observer.observe(t)}dispose(){this._observer.disconnect(),super.dispose()}_configAfterMerge(t){return t.target=l(t.target)||document.body,t.rootMargin=t.offset?`${t.offset}px 0px -30%`:t.rootMargin,"string"==typeof t.threshold&&(t.threshold=t.threshold.split(",").map(t=>Number.parseFloat(t))),t}_maybeEnableSmoothScroll(){this._config.smoothScroll&&(B.off(this._config.target,Xr),B.on(this._config.target,Xr,qr,t=>{const e=this._observableSections.get(t.target.hash);if(e){t.preventDefault();const r=this._rootElement||window,n=e.offsetTop-this._element.offsetTop;if(r.scrollTo)return void r.scrollTo({top:n,behavior:"smooth"});r.scrollTop=n}}))}_getNewObserver(){const t={root:this._rootElement,threshold:this._config.threshold,rootMargin:this._config.rootMargin};return new IntersectionObserver(t=>this._observerCallback(t),t)}_observerCallback(t){const e=t=>this._targetLinks.get(`#${t.target.id}`),r=t=>{this._previousScrollData.visibleEntryTop=t.target.offsetTop,this._process(e(t))},n=(this._rootElement||document.documentElement).scrollTop,o=n>=this._previousScrollData.parentScrollTop;this._previousScrollData.parentScrollTop=n;for(const i of t){if(!i.isIntersecting){this._activeTarget=null,this._clearActiveClass(e(i));continue}const t=i.target.offsetTop>=this._previousScrollData.visibleEntryTop;if(o&&t){if(r(i),!n)return}else o||t||r(i)}}_initializeTargetsAndObservables(){this._targetLinks=new Map,this._observableSections=new Map;const t=X.find(qr,this._config.target);for(const e of t){if(!e.hash||d(e))continue;const t=X.findOne(decodeURI(e.hash),this._element);f(t)&&(this._targetLinks.set(decodeURI(e.hash),e),this._observableSections.set(e.hash,t))}}_process(t){this._activeTarget!==t&&(this._clearActiveClass(this._config.target),this._activeTarget=t,t.classList.add(Yr),this._activateParents(t),B.trigger(this._element,Gr,{relatedTarget:t}))}_activateParents(t){if(t.classList.contains("dropdown-item"))X.findOne(".dropdown-toggle",t.closest(".dropdown")).classList.add(Yr);else for(const e of X.parents(t,".nav, .list-group"))for(const t of X.prev(e,Zr))t.classList.add(Yr)}_clearActiveClass(t){t.classList.remove(Yr);const e=X.find(`${qr}.${Yr}`,t);for(const r of e)r.classList.remove(Yr)}static jQueryInterface(t){return this.each(function(){const e=tn.getOrCreateInstance(this,t);if("string"==typeof t){if(void 0===e[t]||t.startsWith("_")||"constructor"===t)throw new TypeError(`No method named "${t}"`);e[t]()}})}}B.on(window,$r,()=>{for(const t of X.find('[data-bs-spy="scroll"]'))tn.getOrCreateInstance(t)}),_(tn);const en=".bs.tab",rn=`hide${en}`,nn=`hidden${en}`,on=`show${en}`,an=`shown${en}`,sn=`click${en}`,cn=`keydown${en}`,un=`load${en}`,ln="ArrowLeft",fn="ArrowRight",dn="ArrowUp",hn="ArrowDown",pn="Home",gn="End",mn="active",vn="fade",yn="show",_n=".dropdown-toggle",wn=`:not(${_n})`,bn='[data-bs-toggle="tab"], [data-bs-toggle="pill"], [data-bs-toggle="list"]',Cn=`.nav-link${wn}, .list-group-item${wn}, [role="tab"]${wn}, ${bn}`,An=`.${mn}[data-bs-toggle="tab"], .${mn}[data-bs-toggle="pill"], .${mn}[data-bs-toggle="list"]`;class En extends z{constructor(t){super(t),this._parent=this._element.closest('.list-group, .nav, [role="tablist"]'),this._parent&&(this._setInitialAttributes(this._parent,this._getChildren()),B.on(this._element,cn,t=>this._keydown(t)))}static get NAME(){return"tab"}show(){const t=this._element;if(this._elemIsActive(t))return;const e=this._getActiveElem(),r=e?B.trigger(e,rn,{relatedTarget:t}):null;B.trigger(t,on,{relatedTarget:e}).defaultPrevented||r&&r.defaultPrevented||(this._deactivate(e,t),this._activate(t,e))}_activate(t,e){t&&(t.classList.add(mn),this._activate(X.getElementFromSelector(t)),this._queueCallback(()=>{"tab"===t.getAttribute("role")?(t.removeAttribute("tabindex"),t.setAttribute("aria-selected",!0),this._toggleDropDown(t,!0),B.trigger(t,an,{relatedTarget:e})):t.classList.add(yn)},t,t.classList.contains(vn)))}_deactivate(t,e){t&&(t.classList.remove(mn),t.blur(),this._deactivate(X.getElementFromSelector(t)),this._queueCallback(()=>{"tab"===t.getAttribute("role")?(t.setAttribute("aria-selected",!1),t.setAttribute("tabindex","-1"),this._toggleDropDown(t,!1),B.trigger(t,nn,{relatedTarget:e})):t.classList.remove(yn)},t,t.classList.contains(vn)))}_keydown(t){if(![ln,fn,dn,hn,pn,gn].includes(t.key))return;t.stopPropagation(),t.preventDefault();const e=this._getChildren().filter(t=>!d(t));let r;if([pn,gn].includes(t.key))r=e[t.key===pn?0:e.length-1];else{const n=[fn,hn].includes(t.key);r=C(e,t.target,n,!0)}r&&(r.focus({preventScroll:!0}),En.getOrCreateInstance(r).show())}_getChildren(){return X.find(Cn,this._parent)}_getActiveElem(){return this._getChildren().find(t=>this._elemIsActive(t))||null}_setInitialAttributes(t,e){this._setAttributeIfNotExists(t,"role","tablist");for(const r of e)this._setInitialAttributesOnChild(r)}_setInitialAttributesOnChild(t){t=this._getInnerElement(t);const e=this._elemIsActive(t),r=this._getOuterElement(t);t.setAttribute("aria-selected",e),r!==t&&this._setAttributeIfNotExists(r,"role","presentation"),e||t.setAttribute("tabindex","-1"),this._setAttributeIfNotExists(t,"role","tab"),this._setInitialAttributesOnTargetPanel(t)}_setInitialAttributesOnTargetPanel(t){const e=X.getElementFromSelector(t);e&&(this._setAttributeIfNotExists(e,"role","tabpanel"),t.id&&this._setAttributeIfNotExists(e,"aria-labelledby",`${t.id}`))}_toggleDropDown(t,e){const r=this._getOuterElement(t);if(!r.classList.contains("dropdown"))return;const n=(t,n)=>{const o=X.findOne(t,r);o&&o.classList.toggle(n,e)};n(_n,mn),n(".dropdown-menu",yn),r.setAttribute("aria-expanded",e)}_setAttributeIfNotExists(t,e,r){t.hasAttribute(e)||t.setAttribute(e,r)}_elemIsActive(t){return t.classList.contains(mn)}_getInnerElement(t){return t.matches(Cn)?t:X.findOne(Cn,t)}_getOuterElement(t){return t.closest(".nav-item, .list-group-item")||t}static jQueryInterface(t){return this.each(function(){const e=En.getOrCreateInstance(this);if("string"==typeof t){if(void 0===e[t]||t.startsWith("_")||"constructor"===t)throw new TypeError(`No method named "${t}"`);e[t]()}})}}B.on(document,sn,bn,function(t){["A","AREA"].includes(this.tagName)&&t.preventDefault(),d(this)||En.getOrCreateInstance(this).show()}),B.on(window,un,()=>{for(const t of X.find(An))En.getOrCreateInstance(t)}),_(En);const In=".bs.toast",Sn=`mouseover${In}`,On=`mouseout${In}`,Tn=`focusin${In}`,Nn=`focusout${In}`,xn=`hide${In}`,Rn=`hidden${In}`,Dn=`show${In}`,Pn=`shown${In}`,Mn="hide",kn="show",Ln="showing",jn={animation:"boolean",autohide:"boolean",delay:"number"},Bn={animation:!0,autohide:!0,delay:5e3};class Fn extends z{constructor(t,e){super(t,e),this._timeout=null,this._hasMouseInteraction=!1,this._hasKeyboardInteraction=!1,this._setListeners()}static get Default(){return Bn}static get DefaultType(){return jn}static get NAME(){return"toast"}show(){B.trigger(this._element,Dn).defaultPrevented||(this._clearTimeout(),this._config.animation&&this._element.classList.add("fade"),this._element.classList.remove(Mn),g(this._element),this._element.classList.add(kn,Ln),this._queueCallback(()=>{this._element.classList.remove(Ln),B.trigger(this._element,Pn),this._maybeScheduleHide()},this._element,this._config.animation))}hide(){this.isShown()&&(B.trigger(this._element,xn).defaultPrevented||(this._element.classList.add(Ln),this._queueCallback(()=>{this._element.classList.add(Mn),this._element.classList.remove(Ln,kn),B.trigger(this._element,Rn)},this._element,this._config.animation)))}dispose(){this._clearTimeout(),this.isShown()&&this._element.classList.remove(kn),super.dispose()}isShown(){return this._element.classList.contains(kn)}_maybeScheduleHide(){this._config.autohide&&(this._hasMouseInteraction||this._hasKeyboardInteraction||(this._timeout=setTimeout(()=>{this.hide()},this._config.delay)))}_onInteraction(t,e){switch(t.type){case"mouseover":case"mouseout":this._hasMouseInteraction=e;break;case"focusin":case"focusout":this._hasKeyboardInteraction=e}if(e)return void this._clearTimeout();const r=t.relatedTarget;this._element===r||this._element.contains(r)||this._maybeScheduleHide()}_setListeners(){B.on(this._element,Sn,t=>this._onInteraction(t,!0)),B.on(this._element,On,t=>this._onInteraction(t,!1)),B.on(this._element,Tn,t=>this._onInteraction(t,!0)),B.on(this._element,Nn,t=>this._onInteraction(t,!1))}_clearTimeout(){clearTimeout(this._timeout),this._timeout=null}static jQueryInterface(t){return this.each(function(){const e=Fn.getOrCreateInstance(this,t);if("string"==typeof t){if(void 0===e[t])throw new TypeError(`No method named "${t}"`);e[t](this)}})}}$(Fn),_(Fn)})(p(Xt));var $t,Yt={exports:{}},qt={};var Kt,Zt={};
1
+ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("react"),require("jcinfo-utils"),require("framer-motion"),require("styled-components"),require("reactstrap"),require("react-router-dom"),require("js-file-download"),require("axios"),require("react-number-format")):"function"==typeof define&&define.amd?define(["exports","react","jcinfo-utils","framer-motion","styled-components","reactstrap","react-router-dom","js-file-download","axios","react-number-format"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).JCLibUI={},t.React,t.JCInfoUtils,t.FramerMotion,t.styled,t.Reactstrap,t.ReactRouterDom,t.jcFileDownload,t.Axios,t.ReactNumberFormat)}(this,function(t,e,r,n,o,i,a,s,u,l){"use strict";function c(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t)for(const r in t)if("default"!==r){const n=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(e,r,n.get?n:{enumerable:!0,get:()=>t[r]})}return e.default=t,Object.freeze(e)}const h=c(e);var f="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function d(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function p(t){if(t.__esModule)return t;var e=t.default;if("function"==typeof e){var r=function t(){return this instanceof t?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};r.prototype=e.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(t).forEach(function(e){var n=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(r,e,n.get?n:{enumerable:!0,get:function(){return t[e]}})}),r}var g="top",m="bottom",v="right",y="left",_="auto",w=[g,m,v,y],b="start",C="end",A="clippingParents",E="viewport",I="popper",S="reference",x=w.reduce(function(t,e){return t.concat([e+"-"+b,e+"-"+C])},[]),O=[].concat(w,[_]).reduce(function(t,e){return t.concat([e,e+"-"+b,e+"-"+C])},[]),T="beforeRead",N="read",k="afterRead",R="beforeMain",D="main",P="afterMain",M="beforeWrite",B="write",L="afterWrite",F=[T,N,k,R,D,P,M,B,L];function j(t){return t?(t.nodeName||"").toLowerCase():null}function V(t){if(null==t)return window;if("[object Window]"!==t.toString()){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function U(t){return t instanceof V(t).Element||t instanceof Element}function H(t){return t instanceof V(t).HTMLElement||t instanceof HTMLElement}function z(t){return"undefined"!=typeof ShadowRoot&&(t instanceof V(t).ShadowRoot||t instanceof ShadowRoot)}const W={name:"applyStyles",enabled:!0,phase:"write",fn:function(t){var e=t.state;Object.keys(e.elements).forEach(function(t){var r=e.styles[t]||{},n=e.attributes[t]||{},o=e.elements[t];H(o)&&j(o)&&(Object.assign(o.style,r),Object.keys(n).forEach(function(t){var e=n[t];!1===e?o.removeAttribute(t):o.setAttribute(t,!0===e?"":e)}))})},effect:function(t){var e=t.state,r={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,r.popper),e.styles=r,e.elements.arrow&&Object.assign(e.elements.arrow.style,r.arrow),function(){Object.keys(e.elements).forEach(function(t){var n=e.elements[t],o=e.attributes[t]||{},i=Object.keys(e.styles.hasOwnProperty(t)?e.styles[t]:r[t]).reduce(function(t,e){return t[e]="",t},{});H(n)&&j(n)&&(Object.assign(n.style,i),Object.keys(o).forEach(function(t){n.removeAttribute(t)}))})}},requires:["computeStyles"]};function G(t){return t.split("-")[0]}var X=Math.max,$=Math.min,Y=Math.round;function q(){var t=navigator.userAgentData;return null!=t&&t.brands&&Array.isArray(t.brands)?t.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function K(){return!/^((?!chrome|android).)*safari/i.test(q())}function Z(t,e,r){void 0===e&&(e=!1),void 0===r&&(r=!1);var n=t.getBoundingClientRect(),o=1,i=1;e&&H(t)&&(o=t.offsetWidth>0&&Y(n.width)/t.offsetWidth||1,i=t.offsetHeight>0&&Y(n.height)/t.offsetHeight||1);var a=(U(t)?V(t):window).visualViewport,s=!K()&&r,u=(n.left+(s&&a?a.offsetLeft:0))/o,l=(n.top+(s&&a?a.offsetTop:0))/i,c=n.width/o,h=n.height/i;return{width:c,height:h,top:l,right:u+c,bottom:l+h,left:u,x:u,y:l}}function Q(t){var e=Z(t),r=t.offsetWidth,n=t.offsetHeight;return Math.abs(e.width-r)<=1&&(r=e.width),Math.abs(e.height-n)<=1&&(n=e.height),{x:t.offsetLeft,y:t.offsetTop,width:r,height:n}}function J(t,e){var r=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(r&&z(r)){var n=e;do{if(n&&t.isSameNode(n))return!0;n=n.parentNode||n.host}while(n)}return!1}function tt(t){return V(t).getComputedStyle(t)}function et(t){return["table","td","th"].indexOf(j(t))>=0}function rt(t){return((U(t)?t.ownerDocument:t.document)||window.document).documentElement}function nt(t){return"html"===j(t)?t:t.assignedSlot||t.parentNode||(z(t)?t.host:null)||rt(t)}function ot(t){return H(t)&&"fixed"!==tt(t).position?t.offsetParent:null}function it(t){for(var e=V(t),r=ot(t);r&&et(r)&&"static"===tt(r).position;)r=ot(r);return r&&("html"===j(r)||"body"===j(r)&&"static"===tt(r).position)?e:r||function(t){var e=/firefox/i.test(q());if(/Trident/i.test(q())&&H(t)&&"fixed"===tt(t).position)return null;var r=nt(t);for(z(r)&&(r=r.host);H(r)&&["html","body"].indexOf(j(r))<0;){var n=tt(r);if("none"!==n.transform||"none"!==n.perspective||"paint"===n.contain||-1!==["transform","perspective"].indexOf(n.willChange)||e&&"filter"===n.willChange||e&&n.filter&&"none"!==n.filter)return r;r=r.parentNode}return null}(t)||e}function at(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function st(t,e,r){return X(t,$(e,r))}function ut(t){return Object.assign({},{top:0,right:0,bottom:0,left:0},t)}function lt(t,e){return e.reduce(function(e,r){return e[r]=t,e},{})}const ct={name:"arrow",enabled:!0,phase:"main",fn:function(t){var e,r=t.state,n=t.name,o=t.options,i=r.elements.arrow,a=r.modifiersData.popperOffsets,s=G(r.placement),u=at(s),l=[y,v].indexOf(s)>=0?"height":"width";if(i&&a){var c=function(t,e){return ut("number"!=typeof(t="function"==typeof t?t(Object.assign({},e.rects,{placement:e.placement})):t)?t:lt(t,w))}(o.padding,r),h=Q(i),f="y"===u?g:y,d="y"===u?m:v,p=r.rects.reference[l]+r.rects.reference[u]-a[u]-r.rects.popper[l],_=a[u]-r.rects.reference[u],b=it(i),C=b?"y"===u?b.clientHeight||0:b.clientWidth||0:0,A=p/2-_/2,E=c[f],I=C-h[l]-c[d],S=C/2-h[l]/2+A,x=st(E,S,I),O=u;r.modifiersData[n]=((e={})[O]=x,e.centerOffset=x-S,e)}},effect:function(t){var e=t.state,r=t.options.element,n=void 0===r?"[data-popper-arrow]":r;null!=n&&("string"!=typeof n||(n=e.elements.popper.querySelector(n)))&&J(e.elements.popper,n)&&(e.elements.arrow=n)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function ht(t){return t.split("-")[1]}var ft={top:"auto",right:"auto",bottom:"auto",left:"auto"};function dt(t){var e,r=t.popper,n=t.popperRect,o=t.placement,i=t.variation,a=t.offsets,s=t.position,u=t.gpuAcceleration,l=t.adaptive,c=t.roundOffsets,h=t.isFixed,f=a.x,d=void 0===f?0:f,p=a.y,_=void 0===p?0:p,w="function"==typeof c?c({x:d,y:_}):{x:d,y:_};d=w.x,_=w.y;var b=a.hasOwnProperty("x"),A=a.hasOwnProperty("y"),E=y,I=g,S=window;if(l){var x=it(r),O="clientHeight",T="clientWidth";if(x===V(r)&&"static"!==tt(x=rt(r)).position&&"absolute"===s&&(O="scrollHeight",T="scrollWidth"),o===g||(o===y||o===v)&&i===C)I=m,_-=(h&&x===S&&S.visualViewport?S.visualViewport.height:x[O])-n.height,_*=u?1:-1;if(o===y||(o===g||o===m)&&i===C)E=v,d-=(h&&x===S&&S.visualViewport?S.visualViewport.width:x[T])-n.width,d*=u?1:-1}var N,k=Object.assign({position:s},l&&ft),R=!0===c?function(t,e){var r=t.x,n=t.y,o=e.devicePixelRatio||1;return{x:Y(r*o)/o||0,y:Y(n*o)/o||0}}({x:d,y:_},V(r)):{x:d,y:_};return d=R.x,_=R.y,u?Object.assign({},k,((N={})[I]=A?"0":"",N[E]=b?"0":"",N.transform=(S.devicePixelRatio||1)<=1?"translate("+d+"px, "+_+"px)":"translate3d("+d+"px, "+_+"px, 0)",N)):Object.assign({},k,((e={})[I]=A?_+"px":"",e[E]=b?d+"px":"",e.transform="",e))}const pt={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(t){var e=t.state,r=t.options,n=r.gpuAcceleration,o=void 0===n||n,i=r.adaptive,a=void 0===i||i,s=r.roundOffsets,u=void 0===s||s,l={placement:G(e.placement),variation:ht(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:o,isFixed:"fixed"===e.options.strategy};null!=e.modifiersData.popperOffsets&&(e.styles.popper=Object.assign({},e.styles.popper,dt(Object.assign({},l,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:a,roundOffsets:u})))),null!=e.modifiersData.arrow&&(e.styles.arrow=Object.assign({},e.styles.arrow,dt(Object.assign({},l,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:u})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})},data:{}};var gt={passive:!0};const mt={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(t){var e=t.state,r=t.instance,n=t.options,o=n.scroll,i=void 0===o||o,a=n.resize,s=void 0===a||a,u=V(e.elements.popper),l=[].concat(e.scrollParents.reference,e.scrollParents.popper);return i&&l.forEach(function(t){t.addEventListener("scroll",r.update,gt)}),s&&u.addEventListener("resize",r.update,gt),function(){i&&l.forEach(function(t){t.removeEventListener("scroll",r.update,gt)}),s&&u.removeEventListener("resize",r.update,gt)}},data:{}};var vt={left:"right",right:"left",bottom:"top",top:"bottom"};function yt(t){return t.replace(/left|right|bottom|top/g,function(t){return vt[t]})}var _t={start:"end",end:"start"};function wt(t){return t.replace(/start|end/g,function(t){return _t[t]})}function bt(t){var e=V(t);return{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function Ct(t){return Z(rt(t)).left+bt(t).scrollLeft}function At(t){var e=tt(t),r=e.overflow,n=e.overflowX,o=e.overflowY;return/auto|scroll|overlay|hidden/.test(r+o+n)}function Et(t){return["html","body","#document"].indexOf(j(t))>=0?t.ownerDocument.body:H(t)&&At(t)?t:Et(nt(t))}function It(t,e){var r;void 0===e&&(e=[]);var n=Et(t),o=n===(null==(r=t.ownerDocument)?void 0:r.body),i=V(n),a=o?[i].concat(i.visualViewport||[],At(n)?n:[]):n,s=e.concat(a);return o?s:s.concat(It(nt(a)))}function St(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function xt(t,e,r){return e===E?St(function(t,e){var r=V(t),n=rt(t),o=r.visualViewport,i=n.clientWidth,a=n.clientHeight,s=0,u=0;if(o){i=o.width,a=o.height;var l=K();(l||!l&&"fixed"===e)&&(s=o.offsetLeft,u=o.offsetTop)}return{width:i,height:a,x:s+Ct(t),y:u}}(t,r)):U(e)?function(t,e){var r=Z(t,!1,"fixed"===e);return r.top=r.top+t.clientTop,r.left=r.left+t.clientLeft,r.bottom=r.top+t.clientHeight,r.right=r.left+t.clientWidth,r.width=t.clientWidth,r.height=t.clientHeight,r.x=r.left,r.y=r.top,r}(e,r):St(function(t){var e,r=rt(t),n=bt(t),o=null==(e=t.ownerDocument)?void 0:e.body,i=X(r.scrollWidth,r.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),a=X(r.scrollHeight,r.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0),s=-n.scrollLeft+Ct(t),u=-n.scrollTop;return"rtl"===tt(o||r).direction&&(s+=X(r.clientWidth,o?o.clientWidth:0)-i),{width:i,height:a,x:s,y:u}}(rt(t)))}function Ot(t,e,r,n){var o="clippingParents"===e?function(t){var e=It(nt(t)),r=["absolute","fixed"].indexOf(tt(t).position)>=0&&H(t)?it(t):t;return U(r)?e.filter(function(t){return U(t)&&J(t,r)&&"body"!==j(t)}):[]}(t):[].concat(e),i=[].concat(o,[r]),a=i[0],s=i.reduce(function(e,r){var o=xt(t,r,n);return e.top=X(o.top,e.top),e.right=$(o.right,e.right),e.bottom=$(o.bottom,e.bottom),e.left=X(o.left,e.left),e},xt(t,a,n));return s.width=s.right-s.left,s.height=s.bottom-s.top,s.x=s.left,s.y=s.top,s}function Tt(t){var e,r=t.reference,n=t.element,o=t.placement,i=o?G(o):null,a=o?ht(o):null,s=r.x+r.width/2-n.width/2,u=r.y+r.height/2-n.height/2;switch(i){case g:e={x:s,y:r.y-n.height};break;case m:e={x:s,y:r.y+r.height};break;case v:e={x:r.x+r.width,y:u};break;case y:e={x:r.x-n.width,y:u};break;default:e={x:r.x,y:r.y}}var l=i?at(i):null;if(null!=l){var c="y"===l?"height":"width";switch(a){case b:e[l]=e[l]-(r[c]/2-n[c]/2);break;case C:e[l]=e[l]+(r[c]/2-n[c]/2)}}return e}function Nt(t,e){void 0===e&&(e={});var r=e,n=r.placement,o=void 0===n?t.placement:n,i=r.strategy,a=void 0===i?t.strategy:i,s=r.boundary,u=void 0===s?A:s,l=r.rootBoundary,c=void 0===l?E:l,h=r.elementContext,f=void 0===h?I:h,d=r.altBoundary,p=void 0!==d&&d,y=r.padding,_=void 0===y?0:y,b=ut("number"!=typeof _?_:lt(_,w)),C=f===I?S:I,x=t.rects.popper,O=t.elements[p?C:f],T=Ot(U(O)?O:O.contextElement||rt(t.elements.popper),u,c,a),N=Z(t.elements.reference),k=Tt({reference:N,element:x,placement:o}),R=St(Object.assign({},x,k)),D=f===I?R:N,P={top:T.top-D.top+b.top,bottom:D.bottom-T.bottom+b.bottom,left:T.left-D.left+b.left,right:D.right-T.right+b.right},M=t.modifiersData.offset;if(f===I&&M){var B=M[o];Object.keys(P).forEach(function(t){var e=[v,m].indexOf(t)>=0?1:-1,r=[g,m].indexOf(t)>=0?"y":"x";P[t]+=B[r]*e})}return P}const kt={name:"flip",enabled:!0,phase:"main",fn:function(t){var e=t.state,r=t.options,n=t.name;if(!e.modifiersData[n]._skip){for(var o=r.mainAxis,i=void 0===o||o,a=r.altAxis,s=void 0===a||a,u=r.fallbackPlacements,l=r.padding,c=r.boundary,h=r.rootBoundary,f=r.altBoundary,d=r.flipVariations,p=void 0===d||d,C=r.allowedAutoPlacements,A=e.options.placement,E=G(A),I=u||(E===A||!p?[yt(A)]:function(t){if(G(t)===_)return[];var e=yt(t);return[wt(t),e,wt(e)]}(A)),S=[A].concat(I).reduce(function(t,r){return t.concat(G(r)===_?function(t,e){void 0===e&&(e={});var r=e,n=r.placement,o=r.boundary,i=r.rootBoundary,a=r.padding,s=r.flipVariations,u=r.allowedAutoPlacements,l=void 0===u?O:u,c=ht(n),h=c?s?x:x.filter(function(t){return ht(t)===c}):w,f=h.filter(function(t){return l.indexOf(t)>=0});0===f.length&&(f=h);var d=f.reduce(function(e,r){return e[r]=Nt(t,{placement:r,boundary:o,rootBoundary:i,padding:a})[G(r)],e},{});return Object.keys(d).sort(function(t,e){return d[t]-d[e]})}(e,{placement:r,boundary:c,rootBoundary:h,padding:l,flipVariations:p,allowedAutoPlacements:C}):r)},[]),T=e.rects.reference,N=e.rects.popper,k=new Map,R=!0,D=S[0],P=0;P<S.length;P++){var M=S[P],B=G(M),L=ht(M)===b,F=[g,m].indexOf(B)>=0,j=F?"width":"height",V=Nt(e,{placement:M,boundary:c,rootBoundary:h,altBoundary:f,padding:l}),U=F?L?v:y:L?m:g;T[j]>N[j]&&(U=yt(U));var H=yt(U),z=[];if(i&&z.push(V[B]<=0),s&&z.push(V[U]<=0,V[H]<=0),z.every(function(t){return t})){D=M,R=!1;break}k.set(M,z)}if(R)for(var W=function(t){var e=S.find(function(e){var r=k.get(e);if(r)return r.slice(0,t).every(function(t){return t})});if(e)return D=e,"break"},X=p?3:1;X>0;X--){if("break"===W(X))break}e.placement!==D&&(e.modifiersData[n]._skip=!0,e.placement=D,e.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function Rt(t,e,r){return void 0===r&&(r={x:0,y:0}),{top:t.top-e.height-r.y,right:t.right-e.width+r.x,bottom:t.bottom-e.height+r.y,left:t.left-e.width-r.x}}function Dt(t){return[g,v,m,y].some(function(e){return t[e]>=0})}const Pt={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(t){var e=t.state,r=t.name,n=e.rects.reference,o=e.rects.popper,i=e.modifiersData.preventOverflow,a=Nt(e,{elementContext:"reference"}),s=Nt(e,{altBoundary:!0}),u=Rt(a,n),l=Rt(s,o,i),c=Dt(u),h=Dt(l);e.modifiersData[r]={referenceClippingOffsets:u,popperEscapeOffsets:l,isReferenceHidden:c,hasPopperEscaped:h},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":c,"data-popper-escaped":h})}};const Mt={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(t){var e=t.state,r=t.options,n=t.name,o=r.offset,i=void 0===o?[0,0]:o,a=O.reduce(function(t,r){return t[r]=function(t,e,r){var n=G(t),o=[y,g].indexOf(n)>=0?-1:1,i="function"==typeof r?r(Object.assign({},e,{placement:t})):r,a=i[0],s=i[1];return a=a||0,s=(s||0)*o,[y,v].indexOf(n)>=0?{x:s,y:a}:{x:a,y:s}}(r,e.rects,i),t},{}),s=a[e.placement],u=s.x,l=s.y;null!=e.modifiersData.popperOffsets&&(e.modifiersData.popperOffsets.x+=u,e.modifiersData.popperOffsets.y+=l),e.modifiersData[n]=a}};const Bt={name:"popperOffsets",enabled:!0,phase:"read",fn:function(t){var e=t.state,r=t.name;e.modifiersData[r]=Tt({reference:e.rects.reference,element:e.rects.popper,placement:e.placement})},data:{}};const Lt={name:"preventOverflow",enabled:!0,phase:"main",fn:function(t){var e=t.state,r=t.options,n=t.name,o=r.mainAxis,i=void 0===o||o,a=r.altAxis,s=void 0!==a&&a,u=r.boundary,l=r.rootBoundary,c=r.altBoundary,h=r.padding,f=r.tether,d=void 0===f||f,p=r.tetherOffset,_=void 0===p?0:p,w=Nt(e,{boundary:u,rootBoundary:l,padding:h,altBoundary:c}),C=G(e.placement),A=ht(e.placement),E=!A,I=at(C),S="x"===I?"y":"x",x=e.modifiersData.popperOffsets,O=e.rects.reference,T=e.rects.popper,N="function"==typeof _?_(Object.assign({},e.rects,{placement:e.placement})):_,k="number"==typeof N?{mainAxis:N,altAxis:N}:Object.assign({mainAxis:0,altAxis:0},N),R=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,D={x:0,y:0};if(x){if(i){var P,M="y"===I?g:y,B="y"===I?m:v,L="y"===I?"height":"width",F=x[I],j=F+w[M],V=F-w[B],U=d?-T[L]/2:0,H=A===b?O[L]:T[L],z=A===b?-T[L]:-O[L],W=e.elements.arrow,Y=d&&W?Q(W):{width:0,height:0},q=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},K=q[M],Z=q[B],J=st(0,O[L],Y[L]),tt=E?O[L]/2-U-J-K-k.mainAxis:H-J-K-k.mainAxis,et=E?-O[L]/2+U+J+Z+k.mainAxis:z+J+Z+k.mainAxis,rt=e.elements.arrow&&it(e.elements.arrow),nt=rt?"y"===I?rt.clientTop||0:rt.clientLeft||0:0,ot=null!=(P=null==R?void 0:R[I])?P:0,ut=F+et-ot,lt=st(d?$(j,F+tt-ot-nt):j,F,d?X(V,ut):V);x[I]=lt,D[I]=lt-F}if(s){var ct,ft="x"===I?g:y,dt="x"===I?m:v,pt=x[S],gt="y"===S?"height":"width",mt=pt+w[ft],vt=pt-w[dt],yt=-1!==[g,y].indexOf(C),_t=null!=(ct=null==R?void 0:R[S])?ct:0,wt=yt?mt:pt-O[gt]-T[gt]-_t+k.altAxis,bt=yt?pt+O[gt]+T[gt]-_t-k.altAxis:vt,Ct=d&&yt?(Et=st(wt,pt,At=bt))>At?At:Et:st(d?wt:mt,pt,d?bt:vt);x[S]=Ct,D[S]=Ct-pt}var At,Et;e.modifiersData[n]=D}},requiresIfExists:["offset"]};function Ft(t,e,r){void 0===r&&(r=!1);var n,o,i=H(e),a=H(e)&&function(t){var e=t.getBoundingClientRect(),r=Y(e.width)/t.offsetWidth||1,n=Y(e.height)/t.offsetHeight||1;return 1!==r||1!==n}(e),s=rt(e),u=Z(t,a,r),l={scrollLeft:0,scrollTop:0},c={x:0,y:0};return(i||!i&&!r)&&(("body"!==j(e)||At(s))&&(l=(n=e)!==V(n)&&H(n)?{scrollLeft:(o=n).scrollLeft,scrollTop:o.scrollTop}:bt(n)),H(e)?((c=Z(e,!0)).x+=e.clientLeft,c.y+=e.clientTop):s&&(c.x=Ct(s))),{x:u.left+l.scrollLeft-c.x,y:u.top+l.scrollTop-c.y,width:u.width,height:u.height}}function jt(t){var e=new Map,r=new Set,n=[];function o(t){r.add(t.name),[].concat(t.requires||[],t.requiresIfExists||[]).forEach(function(t){if(!r.has(t)){var n=e.get(t);n&&o(n)}}),n.push(t)}return t.forEach(function(t){e.set(t.name,t)}),t.forEach(function(t){r.has(t.name)||o(t)}),n}var Vt={placement:"bottom",modifiers:[],strategy:"absolute"};function Ut(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return!e.some(function(t){return!(t&&"function"==typeof t.getBoundingClientRect)})}function Ht(t){void 0===t&&(t={});var e=t,r=e.defaultModifiers,n=void 0===r?[]:r,o=e.defaultOptions,i=void 0===o?Vt:o;return function(t,e,r){void 0===r&&(r=i);var o,a,s={placement:"bottom",orderedModifiers:[],options:Object.assign({},Vt,i),modifiersData:{},elements:{reference:t,popper:e},attributes:{},styles:{}},u=[],l=!1,c={state:s,setOptions:function(r){var o="function"==typeof r?r(s.options):r;h(),s.options=Object.assign({},i,s.options,o),s.scrollParents={reference:U(t)?It(t):t.contextElement?It(t.contextElement):[],popper:It(e)};var a,l,f=function(t){var e=jt(t);return F.reduce(function(t,r){return t.concat(e.filter(function(t){return t.phase===r}))},[])}((a=[].concat(n,s.options.modifiers),l=a.reduce(function(t,e){var r=t[e.name];return t[e.name]=r?Object.assign({},r,e,{options:Object.assign({},r.options,e.options),data:Object.assign({},r.data,e.data)}):e,t},{}),Object.keys(l).map(function(t){return l[t]})));return s.orderedModifiers=f.filter(function(t){return t.enabled}),s.orderedModifiers.forEach(function(t){var e=t.name,r=t.options,n=void 0===r?{}:r,o=t.effect;if("function"==typeof o){var i=o({state:s,name:e,instance:c,options:n}),a=function(){};u.push(i||a)}}),c.update()},forceUpdate:function(){if(!l){var t=s.elements,e=t.reference,r=t.popper;if(Ut(e,r)){s.rects={reference:Ft(e,it(r),"fixed"===s.options.strategy),popper:Q(r)},s.reset=!1,s.placement=s.options.placement,s.orderedModifiers.forEach(function(t){return s.modifiersData[t.name]=Object.assign({},t.data)});for(var n=0;n<s.orderedModifiers.length;n++)if(!0!==s.reset){var o=s.orderedModifiers[n],i=o.fn,a=o.options,u=void 0===a?{}:a,h=o.name;"function"==typeof i&&(s=i({state:s,options:u,name:h,instance:c})||s)}else s.reset=!1,n=-1}}},update:(o=function(){return new Promise(function(t){c.forceUpdate(),t(s)})},function(){return a||(a=new Promise(function(t){Promise.resolve().then(function(){a=void 0,t(o())})})),a}),destroy:function(){h(),l=!0}};if(!Ut(t,e))return c;function h(){u.forEach(function(t){return t()}),u=[]}return c.setOptions(r).then(function(t){!l&&r.onFirstUpdate&&r.onFirstUpdate(t)}),c}}var zt=Ht(),Wt=Ht({defaultModifiers:[mt,Bt,pt,W]}),Gt=Ht({defaultModifiers:[mt,Bt,pt,W,Mt,kt,Lt,ct,Pt]});const Xt=Object.freeze(Object.defineProperty({__proto__:null,afterMain:P,afterRead:k,afterWrite:L,applyStyles:W,arrow:ct,auto:_,basePlacements:w,beforeMain:R,beforeRead:T,beforeWrite:M,bottom:m,clippingParents:A,computeStyles:pt,createPopper:Gt,createPopperBase:zt,createPopperLite:Wt,detectOverflow:Nt,end:C,eventListeners:mt,flip:kt,hide:Pt,left:y,main:D,modifierPhases:F,offset:Mt,placements:O,popper:I,popperGenerator:Ht,popperOffsets:Bt,preventOverflow:Lt,read:N,reference:S,right:v,start:b,top:g,variationPlacements:x,viewport:E,write:B},Symbol.toStringTag,{value:"Module"}));(function(t){function e(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t)for(const r in t)if("default"!==r){const n=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(e,r,n.get?n:{enumerable:!0,get:()=>t[r]})}return e.default=t,Object.freeze(e)}const r=e(t),n=new Map,o={set(t,e,r){n.has(t)||n.set(t,new Map);const o=n.get(t);o.has(e)||0===o.size?o.set(e,r):console.error(`Bootstrap doesn't allow more than one instance per element. Bound instance: ${Array.from(o.keys())[0]}.`)},get:(t,e)=>n.has(t)&&n.get(t).get(e)||null,remove(t,e){if(!n.has(t))return;const r=n.get(t);r.delete(e),0===r.size&&n.delete(t)}},i="transitionend",a=t=>(t&&window.CSS&&window.CSS.escape&&(t=t.replace(/#([^\s"#']+)/g,(t,e)=>`#${CSS.escape(e)}`)),t),s=t=>null==t?`${t}`:Object.prototype.toString.call(t).match(/\s([a-z]+)/i)[1].toLowerCase(),u=t=>{t.dispatchEvent(new Event(i))},l=t=>!(!t||"object"!=typeof t)&&(void 0!==t.jquery&&(t=t[0]),void 0!==t.nodeType),c=t=>l(t)?t.jquery?t[0]:t:"string"==typeof t&&t.length>0?document.querySelector(a(t)):null,h=t=>{if(!l(t)||0===t.getClientRects().length)return!1;const e="visible"===getComputedStyle(t).getPropertyValue("visibility"),r=t.closest("details:not([open])");if(!r)return e;if(r!==t){const e=t.closest("summary");if(e&&e.parentNode!==r)return!1;if(null===e)return!1}return e},f=t=>!t||t.nodeType!==Node.ELEMENT_NODE||!!t.classList.contains("disabled")||(void 0!==t.disabled?t.disabled:t.hasAttribute("disabled")&&"false"!==t.getAttribute("disabled")),d=t=>{if(!document.documentElement.attachShadow)return null;if("function"==typeof t.getRootNode){const e=t.getRootNode();return e instanceof ShadowRoot?e:null}return t instanceof ShadowRoot?t:t.parentNode?d(t.parentNode):null},p=()=>{},g=t=>{t.offsetHeight},m=()=>window.jQuery&&!document.body.hasAttribute("data-bs-no-jquery")?window.jQuery:null,v=[],y=()=>"rtl"===document.documentElement.dir,_=t=>{var e;e=()=>{const e=m();if(e){const r=t.NAME,n=e.fn[r];e.fn[r]=t.jQueryInterface,e.fn[r].Constructor=t,e.fn[r].noConflict=()=>(e.fn[r]=n,t.jQueryInterface)}},"loading"===document.readyState?(v.length||document.addEventListener("DOMContentLoaded",()=>{for(const t of v)t()}),v.push(e)):e()},w=(t,e=[],r=t)=>"function"==typeof t?t.call(...e):r,b=(t,e,r=!0)=>{if(!r)return void w(t);const n=(t=>{if(!t)return 0;let{transitionDuration:e,transitionDelay:r}=window.getComputedStyle(t);const n=Number.parseFloat(e),o=Number.parseFloat(r);return n||o?(e=e.split(",")[0],r=r.split(",")[0],1e3*(Number.parseFloat(e)+Number.parseFloat(r))):0})(e)+5;let o=!1;const a=({target:r})=>{r===e&&(o=!0,e.removeEventListener(i,a),w(t))};e.addEventListener(i,a),setTimeout(()=>{o||u(e)},n)},C=(t,e,r,n)=>{const o=t.length;let i=t.indexOf(e);return-1===i?!r&&n?t[o-1]:t[0]:(i+=r?1:-1,n&&(i=(i+o)%o),t[Math.max(0,Math.min(i,o-1))])},A=/[^.]*(?=\..*)\.|.*/,E=/\..*/,I=/::\d+$/,S={};let x=1;const O={mouseenter:"mouseover",mouseleave:"mouseout"},T=new Set(["click","dblclick","mouseup","mousedown","contextmenu","mousewheel","DOMMouseScroll","mouseover","mouseout","mousemove","selectstart","selectend","keydown","keypress","keyup","orientationchange","touchstart","touchmove","touchend","touchcancel","pointerdown","pointermove","pointerup","pointerleave","pointercancel","gesturestart","gesturechange","gestureend","focus","blur","change","reset","select","submit","focusin","focusout","load","unload","beforeunload","resize","move","DOMContentLoaded","readystatechange","error","abort","scroll"]);function N(t,e){return e&&`${e}::${x++}`||t.uidEvent||x++}function k(t){const e=N(t);return t.uidEvent=e,S[e]=S[e]||{},S[e]}function R(t,e,r=null){return Object.values(t).find(t=>t.callable===e&&t.delegationSelector===r)}function D(t,e,r){const n="string"==typeof e,o=n?r:e||r;let i=L(t);return T.has(i)||(i=t),[n,o,i]}function P(t,e,r,n,o){if("string"!=typeof e||!t)return;let[i,a,s]=D(e,r,n);var u;e in O&&(u=a,a=function(t){if(!t.relatedTarget||t.relatedTarget!==t.delegateTarget&&!t.delegateTarget.contains(t.relatedTarget))return u.call(this,t)});const l=k(t),c=l[s]||(l[s]={}),h=R(c,a,i?r:null);if(h)return void(h.oneOff=h.oneOff&&o);const f=N(a,e.replace(A,"")),d=i?function(t,e,r){return function n(o){const i=t.querySelectorAll(e);for(let{target:a}=o;a&&a!==this;a=a.parentNode)for(const s of i)if(s===a)return j(o,{delegateTarget:a}),n.oneOff&&F.off(t,o.type,e,r),r.apply(a,[o])}}(t,r,a):function(t,e){return function r(n){return j(n,{delegateTarget:t}),r.oneOff&&F.off(t,n.type,e),e.apply(t,[n])}}(t,a);d.delegationSelector=i?r:null,d.callable=a,d.oneOff=o,d.uidEvent=f,c[f]=d,t.addEventListener(s,d,i)}function M(t,e,r,n,o){const i=R(e[r],n,o);i&&(t.removeEventListener(r,i,Boolean(o)),delete e[r][i.uidEvent])}function B(t,e,r,n){const o=e[r]||{};for(const[i,a]of Object.entries(o))i.includes(n)&&M(t,e,r,a.callable,a.delegationSelector)}function L(t){return t=t.replace(E,""),O[t]||t}const F={on(t,e,r,n){P(t,e,r,n,!1)},one(t,e,r,n){P(t,e,r,n,!0)},off(t,e,r,n){if("string"!=typeof e||!t)return;const[o,i,a]=D(e,r,n),s=a!==e,u=k(t),l=u[a]||{},c=e.startsWith(".");if(void 0===i){if(c)for(const r of Object.keys(u))B(t,u,r,e.slice(1));for(const[r,n]of Object.entries(l)){const o=r.replace(I,"");s&&!e.includes(o)||M(t,u,a,n.callable,n.delegationSelector)}}else{if(!Object.keys(l).length)return;M(t,u,a,i,o?r:null)}},trigger(t,e,r){if("string"!=typeof e||!t)return null;const n=m();let o=null,i=!0,a=!0,s=!1;e!==L(e)&&n&&(o=n.Event(e,r),n(t).trigger(o),i=!o.isPropagationStopped(),a=!o.isImmediatePropagationStopped(),s=o.isDefaultPrevented());const u=j(new Event(e,{bubbles:i,cancelable:!0}),r);return s&&u.preventDefault(),a&&t.dispatchEvent(u),u.defaultPrevented&&o&&o.preventDefault(),u}};function j(t,e={}){for(const[n,o]of Object.entries(e))try{t[n]=o}catch(r){Object.defineProperty(t,n,{configurable:!0,get:()=>o})}return t}function V(t){if("true"===t)return!0;if("false"===t)return!1;if(t===Number(t).toString())return Number(t);if(""===t||"null"===t)return null;if("string"!=typeof t)return t;try{return JSON.parse(decodeURIComponent(t))}catch(e){return t}}function U(t){return t.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}const H={setDataAttribute(t,e,r){t.setAttribute(`data-bs-${U(e)}`,r)},removeDataAttribute(t,e){t.removeAttribute(`data-bs-${U(e)}`)},getDataAttributes(t){if(!t)return{};const e={},r=Object.keys(t.dataset).filter(t=>t.startsWith("bs")&&!t.startsWith("bsConfig"));for(const n of r){let r=n.replace(/^bs/,"");r=r.charAt(0).toLowerCase()+r.slice(1),e[r]=V(t.dataset[n])}return e},getDataAttribute:(t,e)=>V(t.getAttribute(`data-bs-${U(e)}`))};class z{static get Default(){return{}}static get DefaultType(){return{}}static get NAME(){throw new Error('You have to implement the static method "NAME", for each component!')}_getConfig(t){return t=this._mergeConfigObj(t),t=this._configAfterMerge(t),this._typeCheckConfig(t),t}_configAfterMerge(t){return t}_mergeConfigObj(t,e){const r=l(e)?H.getDataAttribute(e,"config"):{};return{...this.constructor.Default,..."object"==typeof r?r:{},...l(e)?H.getDataAttributes(e):{},..."object"==typeof t?t:{}}}_typeCheckConfig(t,e=this.constructor.DefaultType){for(const[r,n]of Object.entries(e)){const e=t[r],o=l(e)?"element":s(e);if(!new RegExp(n).test(o))throw new TypeError(`${this.constructor.NAME.toUpperCase()}: Option "${r}" provided type "${o}" but expected type "${n}".`)}}}class W extends z{constructor(t,e){super(),(t=c(t))&&(this._element=t,this._config=this._getConfig(e),o.set(this._element,this.constructor.DATA_KEY,this))}dispose(){o.remove(this._element,this.constructor.DATA_KEY),F.off(this._element,this.constructor.EVENT_KEY);for(const t of Object.getOwnPropertyNames(this))this[t]=null}_queueCallback(t,e,r=!0){b(t,e,r)}_getConfig(t){return t=this._mergeConfigObj(t,this._element),t=this._configAfterMerge(t),this._typeCheckConfig(t),t}static getInstance(t){return o.get(c(t),this.DATA_KEY)}static getOrCreateInstance(t,e={}){return this.getInstance(t)||new this(t,"object"==typeof e?e:null)}static get VERSION(){return"5.3.8"}static get DATA_KEY(){return`bs.${this.NAME}`}static get EVENT_KEY(){return`.${this.DATA_KEY}`}static eventName(t){return`${t}${this.EVENT_KEY}`}}const G=t=>{let e=t.getAttribute("data-bs-target");if(!e||"#"===e){let r=t.getAttribute("href");if(!r||!r.includes("#")&&!r.startsWith("."))return null;r.includes("#")&&!r.startsWith("#")&&(r=`#${r.split("#")[1]}`),e=r&&"#"!==r?r.trim():null}return e?e.split(",").map(t=>a(t)).join(","):null},X={find:(t,e=document.documentElement)=>[].concat(...Element.prototype.querySelectorAll.call(e,t)),findOne:(t,e=document.documentElement)=>Element.prototype.querySelector.call(e,t),children:(t,e)=>[].concat(...t.children).filter(t=>t.matches(e)),parents(t,e){const r=[];let n=t.parentNode.closest(e);for(;n;)r.push(n),n=n.parentNode.closest(e);return r},prev(t,e){let r=t.previousElementSibling;for(;r;){if(r.matches(e))return[r];r=r.previousElementSibling}return[]},next(t,e){let r=t.nextElementSibling;for(;r;){if(r.matches(e))return[r];r=r.nextElementSibling}return[]},focusableChildren(t){const e=["a","button","input","textarea","select","details","[tabindex]",'[contenteditable="true"]'].map(t=>`${t}:not([tabindex^="-"])`).join(",");return this.find(e,t).filter(t=>!f(t)&&h(t))},getSelectorFromElement(t){const e=G(t);return e&&X.findOne(e)?e:null},getElementFromSelector(t){const e=G(t);return e?X.findOne(e):null},getMultipleElementsFromSelector(t){const e=G(t);return e?X.find(e):[]}},$=(t,e="hide")=>{const r=`click.dismiss${t.EVENT_KEY}`,n=t.NAME;F.on(document,r,`[data-bs-dismiss="${n}"]`,function(r){if(["A","AREA"].includes(this.tagName)&&r.preventDefault(),f(this))return;const o=X.getElementFromSelector(this)||this.closest(`.${n}`);t.getOrCreateInstance(o)[e]()})},Y=".bs.alert",q=`close${Y}`,K=`closed${Y}`;class Z extends W{static get NAME(){return"alert"}close(){if(F.trigger(this._element,q).defaultPrevented)return;this._element.classList.remove("show");const t=this._element.classList.contains("fade");this._queueCallback(()=>this._destroyElement(),this._element,t)}_destroyElement(){this._element.remove(),F.trigger(this._element,K),this.dispose()}static jQueryInterface(t){return this.each(function(){const e=Z.getOrCreateInstance(this);if("string"==typeof t){if(void 0===e[t]||t.startsWith("_")||"constructor"===t)throw new TypeError(`No method named "${t}"`);e[t](this)}})}}$(Z,"close"),_(Z);const Q='[data-bs-toggle="button"]';class J extends W{static get NAME(){return"button"}toggle(){this._element.setAttribute("aria-pressed",this._element.classList.toggle("active"))}static jQueryInterface(t){return this.each(function(){const e=J.getOrCreateInstance(this);"toggle"===t&&e[t]()})}}F.on(document,"click.bs.button.data-api",Q,t=>{t.preventDefault();const e=t.target.closest(Q);J.getOrCreateInstance(e).toggle()}),_(J);const tt=".bs.swipe",et=`touchstart${tt}`,rt=`touchmove${tt}`,nt=`touchend${tt}`,ot=`pointerdown${tt}`,it=`pointerup${tt}`,at={endCallback:null,leftCallback:null,rightCallback:null},st={endCallback:"(function|null)",leftCallback:"(function|null)",rightCallback:"(function|null)"};class ut extends z{constructor(t,e){super(),this._element=t,t&&ut.isSupported()&&(this._config=this._getConfig(e),this._deltaX=0,this._supportPointerEvents=Boolean(window.PointerEvent),this._initEvents())}static get Default(){return at}static get DefaultType(){return st}static get NAME(){return"swipe"}dispose(){F.off(this._element,tt)}_start(t){this._supportPointerEvents?this._eventIsPointerPenTouch(t)&&(this._deltaX=t.clientX):this._deltaX=t.touches[0].clientX}_end(t){this._eventIsPointerPenTouch(t)&&(this._deltaX=t.clientX-this._deltaX),this._handleSwipe(),w(this._config.endCallback)}_move(t){this._deltaX=t.touches&&t.touches.length>1?0:t.touches[0].clientX-this._deltaX}_handleSwipe(){const t=Math.abs(this._deltaX);if(t<=40)return;const e=t/this._deltaX;this._deltaX=0,e&&w(e>0?this._config.rightCallback:this._config.leftCallback)}_initEvents(){this._supportPointerEvents?(F.on(this._element,ot,t=>this._start(t)),F.on(this._element,it,t=>this._end(t)),this._element.classList.add("pointer-event")):(F.on(this._element,et,t=>this._start(t)),F.on(this._element,rt,t=>this._move(t)),F.on(this._element,nt,t=>this._end(t)))}_eventIsPointerPenTouch(t){return this._supportPointerEvents&&("pen"===t.pointerType||"touch"===t.pointerType)}static isSupported(){return"ontouchstart"in document.documentElement||navigator.maxTouchPoints>0}}const lt=".bs.carousel",ct=".data-api",ht="ArrowLeft",ft="ArrowRight",dt="next",pt="prev",gt="left",mt="right",vt=`slide${lt}`,yt=`slid${lt}`,_t=`keydown${lt}`,wt=`mouseenter${lt}`,bt=`mouseleave${lt}`,Ct=`dragstart${lt}`,At=`load${lt}${ct}`,Et=`click${lt}${ct}`,It="carousel",St="active",xt=".active",Ot=".carousel-item",Tt=xt+Ot,Nt={[ht]:mt,[ft]:gt},kt={interval:5e3,keyboard:!0,pause:"hover",ride:!1,touch:!0,wrap:!0},Rt={interval:"(number|boolean)",keyboard:"boolean",pause:"(string|boolean)",ride:"(boolean|string)",touch:"boolean",wrap:"boolean"};class Dt extends W{constructor(t,e){super(t,e),this._interval=null,this._activeElement=null,this._isSliding=!1,this.touchTimeout=null,this._swipeHelper=null,this._indicatorsElement=X.findOne(".carousel-indicators",this._element),this._addEventListeners(),this._config.ride===It&&this.cycle()}static get Default(){return kt}static get DefaultType(){return Rt}static get NAME(){return"carousel"}next(){this._slide(dt)}nextWhenVisible(){!document.hidden&&h(this._element)&&this.next()}prev(){this._slide(pt)}pause(){this._isSliding&&u(this._element),this._clearInterval()}cycle(){this._clearInterval(),this._updateInterval(),this._interval=setInterval(()=>this.nextWhenVisible(),this._config.interval)}_maybeEnableCycle(){this._config.ride&&(this._isSliding?F.one(this._element,yt,()=>this.cycle()):this.cycle())}to(t){const e=this._getItems();if(t>e.length-1||t<0)return;if(this._isSliding)return void F.one(this._element,yt,()=>this.to(t));const r=this._getItemIndex(this._getActive());if(r===t)return;const n=t>r?dt:pt;this._slide(n,e[t])}dispose(){this._swipeHelper&&this._swipeHelper.dispose(),super.dispose()}_configAfterMerge(t){return t.defaultInterval=t.interval,t}_addEventListeners(){this._config.keyboard&&F.on(this._element,_t,t=>this._keydown(t)),"hover"===this._config.pause&&(F.on(this._element,wt,()=>this.pause()),F.on(this._element,bt,()=>this._maybeEnableCycle())),this._config.touch&&ut.isSupported()&&this._addTouchEventListeners()}_addTouchEventListeners(){for(const e of X.find(".carousel-item img",this._element))F.on(e,Ct,t=>t.preventDefault());const t={leftCallback:()=>this._slide(this._directionToOrder(gt)),rightCallback:()=>this._slide(this._directionToOrder(mt)),endCallback:()=>{"hover"===this._config.pause&&(this.pause(),this.touchTimeout&&clearTimeout(this.touchTimeout),this.touchTimeout=setTimeout(()=>this._maybeEnableCycle(),500+this._config.interval))}};this._swipeHelper=new ut(this._element,t)}_keydown(t){if(/input|textarea/i.test(t.target.tagName))return;const e=Nt[t.key];e&&(t.preventDefault(),this._slide(this._directionToOrder(e)))}_getItemIndex(t){return this._getItems().indexOf(t)}_setActiveIndicatorElement(t){if(!this._indicatorsElement)return;const e=X.findOne(xt,this._indicatorsElement);e.classList.remove(St),e.removeAttribute("aria-current");const r=X.findOne(`[data-bs-slide-to="${t}"]`,this._indicatorsElement);r&&(r.classList.add(St),r.setAttribute("aria-current","true"))}_updateInterval(){const t=this._activeElement||this._getActive();if(!t)return;const e=Number.parseInt(t.getAttribute("data-bs-interval"),10);this._config.interval=e||this._config.defaultInterval}_slide(t,e=null){if(this._isSliding)return;const r=this._getActive(),n=t===dt,o=e||C(this._getItems(),r,n,this._config.wrap);if(o===r)return;const i=this._getItemIndex(o),a=e=>F.trigger(this._element,e,{relatedTarget:o,direction:this._orderToDirection(t),from:this._getItemIndex(r),to:i});if(a(vt).defaultPrevented)return;if(!r||!o)return;const s=Boolean(this._interval);this.pause(),this._isSliding=!0,this._setActiveIndicatorElement(i),this._activeElement=o;const u=n?"carousel-item-start":"carousel-item-end",l=n?"carousel-item-next":"carousel-item-prev";o.classList.add(l),g(o),r.classList.add(u),o.classList.add(u),this._queueCallback(()=>{o.classList.remove(u,l),o.classList.add(St),r.classList.remove(St,l,u),this._isSliding=!1,a(yt)},r,this._isAnimated()),s&&this.cycle()}_isAnimated(){return this._element.classList.contains("slide")}_getActive(){return X.findOne(Tt,this._element)}_getItems(){return X.find(Ot,this._element)}_clearInterval(){this._interval&&(clearInterval(this._interval),this._interval=null)}_directionToOrder(t){return y()?t===gt?pt:dt:t===gt?dt:pt}_orderToDirection(t){return y()?t===pt?gt:mt:t===pt?mt:gt}static jQueryInterface(t){return this.each(function(){const e=Dt.getOrCreateInstance(this,t);if("number"!=typeof t){if("string"==typeof t){if(void 0===e[t]||t.startsWith("_")||"constructor"===t)throw new TypeError(`No method named "${t}"`);e[t]()}}else e.to(t)})}}F.on(document,Et,"[data-bs-slide], [data-bs-slide-to]",function(t){const e=X.getElementFromSelector(this);if(!e||!e.classList.contains(It))return;t.preventDefault();const r=Dt.getOrCreateInstance(e),n=this.getAttribute("data-bs-slide-to");return n?(r.to(n),void r._maybeEnableCycle()):"next"===H.getDataAttribute(this,"slide")?(r.next(),void r._maybeEnableCycle()):(r.prev(),void r._maybeEnableCycle())}),F.on(window,At,()=>{const t=X.find('[data-bs-ride="carousel"]');for(const e of t)Dt.getOrCreateInstance(e)}),_(Dt);const Pt=".bs.collapse",Mt=`show${Pt}`,Bt=`shown${Pt}`,Lt=`hide${Pt}`,Ft=`hidden${Pt}`,jt=`click${Pt}.data-api`,Vt="show",Ut="collapse",Ht="collapsing",zt=`:scope .${Ut} .${Ut}`,Wt='[data-bs-toggle="collapse"]',Gt={parent:null,toggle:!0},Xt={parent:"(null|element)",toggle:"boolean"};class $t extends W{constructor(t,e){super(t,e),this._isTransitioning=!1,this._triggerArray=[];const r=X.find(Wt);for(const n of r){const t=X.getSelectorFromElement(n),e=X.find(t).filter(t=>t===this._element);null!==t&&e.length&&this._triggerArray.push(n)}this._initializeChildren(),this._config.parent||this._addAriaAndCollapsedClass(this._triggerArray,this._isShown()),this._config.toggle&&this.toggle()}static get Default(){return Gt}static get DefaultType(){return Xt}static get NAME(){return"collapse"}toggle(){this._isShown()?this.hide():this.show()}show(){if(this._isTransitioning||this._isShown())return;let t=[];if(this._config.parent&&(t=this._getFirstLevelChildren(".collapse.show, .collapse.collapsing").filter(t=>t!==this._element).map(t=>$t.getOrCreateInstance(t,{toggle:!1}))),t.length&&t[0]._isTransitioning)return;if(F.trigger(this._element,Mt).defaultPrevented)return;for(const n of t)n.hide();const e=this._getDimension();this._element.classList.remove(Ut),this._element.classList.add(Ht),this._element.style[e]=0,this._addAriaAndCollapsedClass(this._triggerArray,!0),this._isTransitioning=!0;const r=`scroll${e[0].toUpperCase()+e.slice(1)}`;this._queueCallback(()=>{this._isTransitioning=!1,this._element.classList.remove(Ht),this._element.classList.add(Ut,Vt),this._element.style[e]="",F.trigger(this._element,Bt)},this._element,!0),this._element.style[e]=`${this._element[r]}px`}hide(){if(this._isTransitioning||!this._isShown())return;if(F.trigger(this._element,Lt).defaultPrevented)return;const t=this._getDimension();this._element.style[t]=`${this._element.getBoundingClientRect()[t]}px`,g(this._element),this._element.classList.add(Ht),this._element.classList.remove(Ut,Vt);for(const e of this._triggerArray){const t=X.getElementFromSelector(e);t&&!this._isShown(t)&&this._addAriaAndCollapsedClass([e],!1)}this._isTransitioning=!0,this._element.style[t]="",this._queueCallback(()=>{this._isTransitioning=!1,this._element.classList.remove(Ht),this._element.classList.add(Ut),F.trigger(this._element,Ft)},this._element,!0)}_isShown(t=this._element){return t.classList.contains(Vt)}_configAfterMerge(t){return t.toggle=Boolean(t.toggle),t.parent=c(t.parent),t}_getDimension(){return this._element.classList.contains("collapse-horizontal")?"width":"height"}_initializeChildren(){if(!this._config.parent)return;const t=this._getFirstLevelChildren(Wt);for(const e of t){const t=X.getElementFromSelector(e);t&&this._addAriaAndCollapsedClass([e],this._isShown(t))}}_getFirstLevelChildren(t){const e=X.find(zt,this._config.parent);return X.find(t,this._config.parent).filter(t=>!e.includes(t))}_addAriaAndCollapsedClass(t,e){if(t.length)for(const r of t)r.classList.toggle("collapsed",!e),r.setAttribute("aria-expanded",e)}static jQueryInterface(t){const e={};return"string"==typeof t&&/show|hide/.test(t)&&(e.toggle=!1),this.each(function(){const r=$t.getOrCreateInstance(this,e);if("string"==typeof t){if(void 0===r[t])throw new TypeError(`No method named "${t}"`);r[t]()}})}}F.on(document,jt,Wt,function(t){("A"===t.target.tagName||t.delegateTarget&&"A"===t.delegateTarget.tagName)&&t.preventDefault();for(const e of X.getMultipleElementsFromSelector(this))$t.getOrCreateInstance(e,{toggle:!1}).toggle()}),_($t);const Yt="dropdown",qt=".bs.dropdown",Kt=".data-api",Zt="ArrowUp",Qt="ArrowDown",Jt=`hide${qt}`,te=`hidden${qt}`,ee=`show${qt}`,re=`shown${qt}`,ne=`click${qt}${Kt}`,oe=`keydown${qt}${Kt}`,ie=`keyup${qt}${Kt}`,ae="show",se='[data-bs-toggle="dropdown"]:not(.disabled):not(:disabled)',ue=`${se}.${ae}`,le=".dropdown-menu",ce=y()?"top-end":"top-start",he=y()?"top-start":"top-end",fe=y()?"bottom-end":"bottom-start",de=y()?"bottom-start":"bottom-end",pe=y()?"left-start":"right-start",ge=y()?"right-start":"left-start",me={autoClose:!0,boundary:"clippingParents",display:"dynamic",offset:[0,2],popperConfig:null,reference:"toggle"},ve={autoClose:"(boolean|string)",boundary:"(string|element)",display:"string",offset:"(array|string|function)",popperConfig:"(null|object|function)",reference:"(string|element|object)"};class ye extends W{constructor(t,e){super(t,e),this._popper=null,this._parent=this._element.parentNode,this._menu=X.next(this._element,le)[0]||X.prev(this._element,le)[0]||X.findOne(le,this._parent),this._inNavbar=this._detectNavbar()}static get Default(){return me}static get DefaultType(){return ve}static get NAME(){return Yt}toggle(){return this._isShown()?this.hide():this.show()}show(){if(f(this._element)||this._isShown())return;const t={relatedTarget:this._element};if(!F.trigger(this._element,ee,t).defaultPrevented){if(this._createPopper(),"ontouchstart"in document.documentElement&&!this._parent.closest(".navbar-nav"))for(const t of[].concat(...document.body.children))F.on(t,"mouseover",p);this._element.focus(),this._element.setAttribute("aria-expanded",!0),this._menu.classList.add(ae),this._element.classList.add(ae),F.trigger(this._element,re,t)}}hide(){if(f(this._element)||!this._isShown())return;const t={relatedTarget:this._element};this._completeHide(t)}dispose(){this._popper&&this._popper.destroy(),super.dispose()}update(){this._inNavbar=this._detectNavbar(),this._popper&&this._popper.update()}_completeHide(t){if(!F.trigger(this._element,Jt,t).defaultPrevented){if("ontouchstart"in document.documentElement)for(const t of[].concat(...document.body.children))F.off(t,"mouseover",p);this._popper&&this._popper.destroy(),this._menu.classList.remove(ae),this._element.classList.remove(ae),this._element.setAttribute("aria-expanded","false"),H.removeDataAttribute(this._menu,"popper"),F.trigger(this._element,te,t)}}_getConfig(t){if("object"==typeof(t=super._getConfig(t)).reference&&!l(t.reference)&&"function"!=typeof t.reference.getBoundingClientRect)throw new TypeError(`${Yt.toUpperCase()}: Option "reference" provided type "object" without a required "getBoundingClientRect" method.`);return t}_createPopper(){if(void 0===r)throw new TypeError("Bootstrap's dropdowns require Popper (https://popper.js.org/docs/v2/)");let t=this._element;"parent"===this._config.reference?t=this._parent:l(this._config.reference)?t=c(this._config.reference):"object"==typeof this._config.reference&&(t=this._config.reference);const e=this._getPopperConfig();this._popper=r.createPopper(t,this._menu,e)}_isShown(){return this._menu.classList.contains(ae)}_getPlacement(){const t=this._parent;if(t.classList.contains("dropend"))return pe;if(t.classList.contains("dropstart"))return ge;if(t.classList.contains("dropup-center"))return"top";if(t.classList.contains("dropdown-center"))return"bottom";const e="end"===getComputedStyle(this._menu).getPropertyValue("--bs-position").trim();return t.classList.contains("dropup")?e?he:ce:e?de:fe}_detectNavbar(){return null!==this._element.closest(".navbar")}_getOffset(){const{offset:t}=this._config;return"string"==typeof t?t.split(",").map(t=>Number.parseInt(t,10)):"function"==typeof t?e=>t(e,this._element):t}_getPopperConfig(){const t={placement:this._getPlacement(),modifiers:[{name:"preventOverflow",options:{boundary:this._config.boundary}},{name:"offset",options:{offset:this._getOffset()}}]};return(this._inNavbar||"static"===this._config.display)&&(H.setDataAttribute(this._menu,"popper","static"),t.modifiers=[{name:"applyStyles",enabled:!1}]),{...t,...w(this._config.popperConfig,[void 0,t])}}_selectMenuItem({key:t,target:e}){const r=X.find(".dropdown-menu .dropdown-item:not(.disabled):not(:disabled)",this._menu).filter(t=>h(t));r.length&&C(r,e,t===Qt,!r.includes(e)).focus()}static jQueryInterface(t){return this.each(function(){const e=ye.getOrCreateInstance(this,t);if("string"==typeof t){if(void 0===e[t])throw new TypeError(`No method named "${t}"`);e[t]()}})}static clearMenus(t){if(2===t.button||"keyup"===t.type&&"Tab"!==t.key)return;const e=X.find(ue);for(const r of e){const e=ye.getInstance(r);if(!e||!1===e._config.autoClose)continue;const n=t.composedPath(),o=n.includes(e._menu);if(n.includes(e._element)||"inside"===e._config.autoClose&&!o||"outside"===e._config.autoClose&&o)continue;if(e._menu.contains(t.target)&&("keyup"===t.type&&"Tab"===t.key||/input|select|option|textarea|form/i.test(t.target.tagName)))continue;const i={relatedTarget:e._element};"click"===t.type&&(i.clickEvent=t),e._completeHide(i)}}static dataApiKeydownHandler(t){const e=/input|textarea/i.test(t.target.tagName),r="Escape"===t.key,n=[Zt,Qt].includes(t.key);if(!n&&!r)return;if(e&&!r)return;t.preventDefault();const o=this.matches(se)?this:X.prev(this,se)[0]||X.next(this,se)[0]||X.findOne(se,t.delegateTarget.parentNode),i=ye.getOrCreateInstance(o);if(n)return t.stopPropagation(),i.show(),void i._selectMenuItem(t);i._isShown()&&(t.stopPropagation(),i.hide(),o.focus())}}F.on(document,oe,se,ye.dataApiKeydownHandler),F.on(document,oe,le,ye.dataApiKeydownHandler),F.on(document,ne,ye.clearMenus),F.on(document,ie,ye.clearMenus),F.on(document,ne,se,function(t){t.preventDefault(),ye.getOrCreateInstance(this).toggle()}),_(ye);const _e="backdrop",we="show",be=`mousedown.bs.${_e}`,Ce={className:"modal-backdrop",clickCallback:null,isAnimated:!1,isVisible:!0,rootElement:"body"},Ae={className:"string",clickCallback:"(function|null)",isAnimated:"boolean",isVisible:"boolean",rootElement:"(element|string)"};class Ee extends z{constructor(t){super(),this._config=this._getConfig(t),this._isAppended=!1,this._element=null}static get Default(){return Ce}static get DefaultType(){return Ae}static get NAME(){return _e}show(t){if(!this._config.isVisible)return void w(t);this._append();const e=this._getElement();this._config.isAnimated&&g(e),e.classList.add(we),this._emulateAnimation(()=>{w(t)})}hide(t){this._config.isVisible?(this._getElement().classList.remove(we),this._emulateAnimation(()=>{this.dispose(),w(t)})):w(t)}dispose(){this._isAppended&&(F.off(this._element,be),this._element.remove(),this._isAppended=!1)}_getElement(){if(!this._element){const t=document.createElement("div");t.className=this._config.className,this._config.isAnimated&&t.classList.add("fade"),this._element=t}return this._element}_configAfterMerge(t){return t.rootElement=c(t.rootElement),t}_append(){if(this._isAppended)return;const t=this._getElement();this._config.rootElement.append(t),F.on(t,be,()=>{w(this._config.clickCallback)}),this._isAppended=!0}_emulateAnimation(t){b(t,this._getElement(),this._config.isAnimated)}}const Ie=".bs.focustrap",Se=`focusin${Ie}`,xe=`keydown.tab${Ie}`,Oe="backward",Te={autofocus:!0,trapElement:null},Ne={autofocus:"boolean",trapElement:"element"};class ke extends z{constructor(t){super(),this._config=this._getConfig(t),this._isActive=!1,this._lastTabNavDirection=null}static get Default(){return Te}static get DefaultType(){return Ne}static get NAME(){return"focustrap"}activate(){this._isActive||(this._config.autofocus&&this._config.trapElement.focus(),F.off(document,Ie),F.on(document,Se,t=>this._handleFocusin(t)),F.on(document,xe,t=>this._handleKeydown(t)),this._isActive=!0)}deactivate(){this._isActive&&(this._isActive=!1,F.off(document,Ie))}_handleFocusin(t){const{trapElement:e}=this._config;if(t.target===document||t.target===e||e.contains(t.target))return;const r=X.focusableChildren(e);0===r.length?e.focus():this._lastTabNavDirection===Oe?r[r.length-1].focus():r[0].focus()}_handleKeydown(t){"Tab"===t.key&&(this._lastTabNavDirection=t.shiftKey?Oe:"forward")}}const Re=".fixed-top, .fixed-bottom, .is-fixed, .sticky-top",De=".sticky-top",Pe="padding-right",Me="margin-right";class Be{constructor(){this._element=document.body}getWidth(){const t=document.documentElement.clientWidth;return Math.abs(window.innerWidth-t)}hide(){const t=this.getWidth();this._disableOverFlow(),this._setElementAttributes(this._element,Pe,e=>e+t),this._setElementAttributes(Re,Pe,e=>e+t),this._setElementAttributes(De,Me,e=>e-t)}reset(){this._resetElementAttributes(this._element,"overflow"),this._resetElementAttributes(this._element,Pe),this._resetElementAttributes(Re,Pe),this._resetElementAttributes(De,Me)}isOverflowing(){return this.getWidth()>0}_disableOverFlow(){this._saveInitialAttribute(this._element,"overflow"),this._element.style.overflow="hidden"}_setElementAttributes(t,e,r){const n=this.getWidth();this._applyManipulationCallback(t,t=>{if(t!==this._element&&window.innerWidth>t.clientWidth+n)return;this._saveInitialAttribute(t,e);const o=window.getComputedStyle(t).getPropertyValue(e);t.style.setProperty(e,`${r(Number.parseFloat(o))}px`)})}_saveInitialAttribute(t,e){const r=t.style.getPropertyValue(e);r&&H.setDataAttribute(t,e,r)}_resetElementAttributes(t,e){this._applyManipulationCallback(t,t=>{const r=H.getDataAttribute(t,e);null!==r?(H.removeDataAttribute(t,e),t.style.setProperty(e,r)):t.style.removeProperty(e)})}_applyManipulationCallback(t,e){if(l(t))e(t);else for(const r of X.find(t,this._element))e(r)}}const Le=".bs.modal",Fe=`hide${Le}`,je=`hidePrevented${Le}`,Ve=`hidden${Le}`,Ue=`show${Le}`,He=`shown${Le}`,ze=`resize${Le}`,We=`click.dismiss${Le}`,Ge=`mousedown.dismiss${Le}`,Xe=`keydown.dismiss${Le}`,$e=`click${Le}.data-api`,Ye="modal-open",qe="show",Ke="modal-static",Ze={backdrop:!0,focus:!0,keyboard:!0},Qe={backdrop:"(boolean|string)",focus:"boolean",keyboard:"boolean"};class Je extends W{constructor(t,e){super(t,e),this._dialog=X.findOne(".modal-dialog",this._element),this._backdrop=this._initializeBackDrop(),this._focustrap=this._initializeFocusTrap(),this._isShown=!1,this._isTransitioning=!1,this._scrollBar=new Be,this._addEventListeners()}static get Default(){return Ze}static get DefaultType(){return Qe}static get NAME(){return"modal"}toggle(t){return this._isShown?this.hide():this.show(t)}show(t){this._isShown||this._isTransitioning||F.trigger(this._element,Ue,{relatedTarget:t}).defaultPrevented||(this._isShown=!0,this._isTransitioning=!0,this._scrollBar.hide(),document.body.classList.add(Ye),this._adjustDialog(),this._backdrop.show(()=>this._showElement(t)))}hide(){this._isShown&&!this._isTransitioning&&(F.trigger(this._element,Fe).defaultPrevented||(this._isShown=!1,this._isTransitioning=!0,this._focustrap.deactivate(),this._element.classList.remove(qe),this._queueCallback(()=>this._hideModal(),this._element,this._isAnimated())))}dispose(){F.off(window,Le),F.off(this._dialog,Le),this._backdrop.dispose(),this._focustrap.deactivate(),super.dispose()}handleUpdate(){this._adjustDialog()}_initializeBackDrop(){return new Ee({isVisible:Boolean(this._config.backdrop),isAnimated:this._isAnimated()})}_initializeFocusTrap(){return new ke({trapElement:this._element})}_showElement(t){document.body.contains(this._element)||document.body.append(this._element),this._element.style.display="block",this._element.removeAttribute("aria-hidden"),this._element.setAttribute("aria-modal",!0),this._element.setAttribute("role","dialog"),this._element.scrollTop=0;const e=X.findOne(".modal-body",this._dialog);e&&(e.scrollTop=0),g(this._element),this._element.classList.add(qe),this._queueCallback(()=>{this._config.focus&&this._focustrap.activate(),this._isTransitioning=!1,F.trigger(this._element,He,{relatedTarget:t})},this._dialog,this._isAnimated())}_addEventListeners(){F.on(this._element,Xe,t=>{"Escape"===t.key&&(this._config.keyboard?this.hide():this._triggerBackdropTransition())}),F.on(window,ze,()=>{this._isShown&&!this._isTransitioning&&this._adjustDialog()}),F.on(this._element,Ge,t=>{F.one(this._element,We,e=>{this._element===t.target&&this._element===e.target&&("static"!==this._config.backdrop?this._config.backdrop&&this.hide():this._triggerBackdropTransition())})})}_hideModal(){this._element.style.display="none",this._element.setAttribute("aria-hidden",!0),this._element.removeAttribute("aria-modal"),this._element.removeAttribute("role"),this._isTransitioning=!1,this._backdrop.hide(()=>{document.body.classList.remove(Ye),this._resetAdjustments(),this._scrollBar.reset(),F.trigger(this._element,Ve)})}_isAnimated(){return this._element.classList.contains("fade")}_triggerBackdropTransition(){if(F.trigger(this._element,je).defaultPrevented)return;const t=this._element.scrollHeight>document.documentElement.clientHeight,e=this._element.style.overflowY;"hidden"===e||this._element.classList.contains(Ke)||(t||(this._element.style.overflowY="hidden"),this._element.classList.add(Ke),this._queueCallback(()=>{this._element.classList.remove(Ke),this._queueCallback(()=>{this._element.style.overflowY=e},this._dialog)},this._dialog),this._element.focus())}_adjustDialog(){const t=this._element.scrollHeight>document.documentElement.clientHeight,e=this._scrollBar.getWidth(),r=e>0;if(r&&!t){const t=y()?"paddingLeft":"paddingRight";this._element.style[t]=`${e}px`}if(!r&&t){const t=y()?"paddingRight":"paddingLeft";this._element.style[t]=`${e}px`}}_resetAdjustments(){this._element.style.paddingLeft="",this._element.style.paddingRight=""}static jQueryInterface(t,e){return this.each(function(){const r=Je.getOrCreateInstance(this,t);if("string"==typeof t){if(void 0===r[t])throw new TypeError(`No method named "${t}"`);r[t](e)}})}}F.on(document,$e,'[data-bs-toggle="modal"]',function(t){const e=X.getElementFromSelector(this);["A","AREA"].includes(this.tagName)&&t.preventDefault(),F.one(e,Ue,t=>{t.defaultPrevented||F.one(e,Ve,()=>{h(this)&&this.focus()})});const r=X.findOne(".modal.show");r&&Je.getInstance(r).hide(),Je.getOrCreateInstance(e).toggle(this)}),$(Je),_(Je);const tr=".bs.offcanvas",er=".data-api",rr=`load${tr}${er}`,nr="show",or="showing",ir="hiding",ar=".offcanvas.show",sr=`show${tr}`,ur=`shown${tr}`,lr=`hide${tr}`,cr=`hidePrevented${tr}`,hr=`hidden${tr}`,fr=`resize${tr}`,dr=`click${tr}${er}`,pr=`keydown.dismiss${tr}`,gr={backdrop:!0,keyboard:!0,scroll:!1},mr={backdrop:"(boolean|string)",keyboard:"boolean",scroll:"boolean"};class vr extends W{constructor(t,e){super(t,e),this._isShown=!1,this._backdrop=this._initializeBackDrop(),this._focustrap=this._initializeFocusTrap(),this._addEventListeners()}static get Default(){return gr}static get DefaultType(){return mr}static get NAME(){return"offcanvas"}toggle(t){return this._isShown?this.hide():this.show(t)}show(t){this._isShown||F.trigger(this._element,sr,{relatedTarget:t}).defaultPrevented||(this._isShown=!0,this._backdrop.show(),this._config.scroll||(new Be).hide(),this._element.setAttribute("aria-modal",!0),this._element.setAttribute("role","dialog"),this._element.classList.add(or),this._queueCallback(()=>{this._config.scroll&&!this._config.backdrop||this._focustrap.activate(),this._element.classList.add(nr),this._element.classList.remove(or),F.trigger(this._element,ur,{relatedTarget:t})},this._element,!0))}hide(){this._isShown&&(F.trigger(this._element,lr).defaultPrevented||(this._focustrap.deactivate(),this._element.blur(),this._isShown=!1,this._element.classList.add(ir),this._backdrop.hide(),this._queueCallback(()=>{this._element.classList.remove(nr,ir),this._element.removeAttribute("aria-modal"),this._element.removeAttribute("role"),this._config.scroll||(new Be).reset(),F.trigger(this._element,hr)},this._element,!0)))}dispose(){this._backdrop.dispose(),this._focustrap.deactivate(),super.dispose()}_initializeBackDrop(){const t=Boolean(this._config.backdrop);return new Ee({className:"offcanvas-backdrop",isVisible:t,isAnimated:!0,rootElement:this._element.parentNode,clickCallback:t?()=>{"static"!==this._config.backdrop?this.hide():F.trigger(this._element,cr)}:null})}_initializeFocusTrap(){return new ke({trapElement:this._element})}_addEventListeners(){F.on(this._element,pr,t=>{"Escape"===t.key&&(this._config.keyboard?this.hide():F.trigger(this._element,cr))})}static jQueryInterface(t){return this.each(function(){const e=vr.getOrCreateInstance(this,t);if("string"==typeof t){if(void 0===e[t]||t.startsWith("_")||"constructor"===t)throw new TypeError(`No method named "${t}"`);e[t](this)}})}}F.on(document,dr,'[data-bs-toggle="offcanvas"]',function(t){const e=X.getElementFromSelector(this);if(["A","AREA"].includes(this.tagName)&&t.preventDefault(),f(this))return;F.one(e,hr,()=>{h(this)&&this.focus()});const r=X.findOne(ar);r&&r!==e&&vr.getInstance(r).hide(),vr.getOrCreateInstance(e).toggle(this)}),F.on(window,rr,()=>{for(const t of X.find(ar))vr.getOrCreateInstance(t).show()}),F.on(window,fr,()=>{for(const t of X.find("[aria-modal][class*=show][class*=offcanvas-]"))"fixed"!==getComputedStyle(t).position&&vr.getOrCreateInstance(t).hide()}),$(vr),_(vr);const yr={"*":["class","dir","id","lang","role",/^aria-[\w-]*$/i],a:["target","href","title","rel"],area:[],b:[],br:[],col:[],code:[],dd:[],div:[],dl:[],dt:[],em:[],hr:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],i:[],img:["src","srcset","alt","title","width","height"],li:[],ol:[],p:[],pre:[],s:[],small:[],span:[],sub:[],sup:[],strong:[],u:[],ul:[]},_r=new Set(["background","cite","href","itemtype","longdesc","poster","src","xlink:href"]),wr=/^(?!javascript:)(?:[a-z0-9+.-]+:|[^&:/?#]*(?:[/?#]|$))/i,br=(t,e)=>{const r=t.nodeName.toLowerCase();return e.includes(r)?!_r.has(r)||Boolean(wr.test(t.nodeValue)):e.filter(t=>t instanceof RegExp).some(t=>t.test(r))},Cr={allowList:yr,content:{},extraClass:"",html:!1,sanitize:!0,sanitizeFn:null,template:"<div></div>"},Ar={allowList:"object",content:"object",extraClass:"(string|function)",html:"boolean",sanitize:"boolean",sanitizeFn:"(null|function)",template:"string"},Er={entry:"(string|element|function|null)",selector:"(string|element)"};class Ir extends z{constructor(t){super(),this._config=this._getConfig(t)}static get Default(){return Cr}static get DefaultType(){return Ar}static get NAME(){return"TemplateFactory"}getContent(){return Object.values(this._config.content).map(t=>this._resolvePossibleFunction(t)).filter(Boolean)}hasContent(){return this.getContent().length>0}changeContent(t){return this._checkContent(t),this._config.content={...this._config.content,...t},this}toHtml(){const t=document.createElement("div");t.innerHTML=this._maybeSanitize(this._config.template);for(const[n,o]of Object.entries(this._config.content))this._setContent(t,o,n);const e=t.children[0],r=this._resolvePossibleFunction(this._config.extraClass);return r&&e.classList.add(...r.split(" ")),e}_typeCheckConfig(t){super._typeCheckConfig(t),this._checkContent(t.content)}_checkContent(t){for(const[e,r]of Object.entries(t))super._typeCheckConfig({selector:e,entry:r},Er)}_setContent(t,e,r){const n=X.findOne(r,t);n&&((e=this._resolvePossibleFunction(e))?l(e)?this._putElementInTemplate(c(e),n):this._config.html?n.innerHTML=this._maybeSanitize(e):n.textContent=e:n.remove())}_maybeSanitize(t){return this._config.sanitize?function(t,e,r){if(!t.length)return t;if(r&&"function"==typeof r)return r(t);const n=(new window.DOMParser).parseFromString(t,"text/html"),o=[].concat(...n.body.querySelectorAll("*"));for(const i of o){const t=i.nodeName.toLowerCase();if(!Object.keys(e).includes(t)){i.remove();continue}const r=[].concat(...i.attributes),n=[].concat(e["*"]||[],e[t]||[]);for(const e of r)br(e,n)||i.removeAttribute(e.nodeName)}return n.body.innerHTML}(t,this._config.allowList,this._config.sanitizeFn):t}_resolvePossibleFunction(t){return w(t,[void 0,this])}_putElementInTemplate(t,e){if(this._config.html)return e.innerHTML="",void e.append(t);e.textContent=t.textContent}}const Sr=new Set(["sanitize","allowList","sanitizeFn"]),xr="fade",Or="show",Tr=".tooltip-inner",Nr=".modal",kr="hide.bs.modal",Rr="hover",Dr="focus",Pr="click",Mr={AUTO:"auto",TOP:"top",RIGHT:y()?"left":"right",BOTTOM:"bottom",LEFT:y()?"right":"left"},Br={allowList:yr,animation:!0,boundary:"clippingParents",container:!1,customClass:"",delay:0,fallbackPlacements:["top","right","bottom","left"],html:!1,offset:[0,6],placement:"top",popperConfig:null,sanitize:!0,sanitizeFn:null,selector:!1,template:'<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',title:"",trigger:"hover focus"},Lr={allowList:"object",animation:"boolean",boundary:"(string|element)",container:"(string|element|boolean)",customClass:"(string|function)",delay:"(number|object)",fallbackPlacements:"array",html:"boolean",offset:"(array|string|function)",placement:"(string|function)",popperConfig:"(null|object|function)",sanitize:"boolean",sanitizeFn:"(null|function)",selector:"(string|boolean)",template:"string",title:"(string|element|function)",trigger:"string"};class Fr extends W{constructor(t,e){if(void 0===r)throw new TypeError("Bootstrap's tooltips require Popper (https://popper.js.org/docs/v2/)");super(t,e),this._isEnabled=!0,this._timeout=0,this._isHovered=null,this._activeTrigger={},this._popper=null,this._templateFactory=null,this._newContent=null,this.tip=null,this._setListeners(),this._config.selector||this._fixTitle()}static get Default(){return Br}static get DefaultType(){return Lr}static get NAME(){return"tooltip"}enable(){this._isEnabled=!0}disable(){this._isEnabled=!1}toggleEnabled(){this._isEnabled=!this._isEnabled}toggle(){this._isEnabled&&(this._isShown()?this._leave():this._enter())}dispose(){clearTimeout(this._timeout),F.off(this._element.closest(Nr),kr,this._hideModalHandler),this._element.getAttribute("data-bs-original-title")&&this._element.setAttribute("title",this._element.getAttribute("data-bs-original-title")),this._disposePopper(),super.dispose()}show(){if("none"===this._element.style.display)throw new Error("Please use show on visible elements");if(!this._isWithContent()||!this._isEnabled)return;const t=F.trigger(this._element,this.constructor.eventName("show")),e=(d(this._element)||this._element.ownerDocument.documentElement).contains(this._element);if(t.defaultPrevented||!e)return;this._disposePopper();const r=this._getTipElement();this._element.setAttribute("aria-describedby",r.getAttribute("id"));const{container:n}=this._config;if(this._element.ownerDocument.documentElement.contains(this.tip)||(n.append(r),F.trigger(this._element,this.constructor.eventName("inserted"))),this._popper=this._createPopper(r),r.classList.add(Or),"ontouchstart"in document.documentElement)for(const o of[].concat(...document.body.children))F.on(o,"mouseover",p);this._queueCallback(()=>{F.trigger(this._element,this.constructor.eventName("shown")),!1===this._isHovered&&this._leave(),this._isHovered=!1},this.tip,this._isAnimated())}hide(){if(this._isShown()&&!F.trigger(this._element,this.constructor.eventName("hide")).defaultPrevented){if(this._getTipElement().classList.remove(Or),"ontouchstart"in document.documentElement)for(const t of[].concat(...document.body.children))F.off(t,"mouseover",p);this._activeTrigger[Pr]=!1,this._activeTrigger[Dr]=!1,this._activeTrigger[Rr]=!1,this._isHovered=null,this._queueCallback(()=>{this._isWithActiveTrigger()||(this._isHovered||this._disposePopper(),this._element.removeAttribute("aria-describedby"),F.trigger(this._element,this.constructor.eventName("hidden")))},this.tip,this._isAnimated())}}update(){this._popper&&this._popper.update()}_isWithContent(){return Boolean(this._getTitle())}_getTipElement(){return this.tip||(this.tip=this._createTipElement(this._newContent||this._getContentForTemplate())),this.tip}_createTipElement(t){const e=this._getTemplateFactory(t).toHtml();if(!e)return null;e.classList.remove(xr,Or),e.classList.add(`bs-${this.constructor.NAME}-auto`);const r=(t=>{do{t+=Math.floor(1e6*Math.random())}while(document.getElementById(t));return t})(this.constructor.NAME).toString();return e.setAttribute("id",r),this._isAnimated()&&e.classList.add(xr),e}setContent(t){this._newContent=t,this._isShown()&&(this._disposePopper(),this.show())}_getTemplateFactory(t){return this._templateFactory?this._templateFactory.changeContent(t):this._templateFactory=new Ir({...this._config,content:t,extraClass:this._resolvePossibleFunction(this._config.customClass)}),this._templateFactory}_getContentForTemplate(){return{[Tr]:this._getTitle()}}_getTitle(){return this._resolvePossibleFunction(this._config.title)||this._element.getAttribute("data-bs-original-title")}_initializeOnDelegatedTarget(t){return this.constructor.getOrCreateInstance(t.delegateTarget,this._getDelegateConfig())}_isAnimated(){return this._config.animation||this.tip&&this.tip.classList.contains(xr)}_isShown(){return this.tip&&this.tip.classList.contains(Or)}_createPopper(t){const e=w(this._config.placement,[this,t,this._element]),n=Mr[e.toUpperCase()];return r.createPopper(this._element,t,this._getPopperConfig(n))}_getOffset(){const{offset:t}=this._config;return"string"==typeof t?t.split(",").map(t=>Number.parseInt(t,10)):"function"==typeof t?e=>t(e,this._element):t}_resolvePossibleFunction(t){return w(t,[this._element,this._element])}_getPopperConfig(t){const e={placement:t,modifiers:[{name:"flip",options:{fallbackPlacements:this._config.fallbackPlacements}},{name:"offset",options:{offset:this._getOffset()}},{name:"preventOverflow",options:{boundary:this._config.boundary}},{name:"arrow",options:{element:`.${this.constructor.NAME}-arrow`}},{name:"preSetPlacement",enabled:!0,phase:"beforeMain",fn:t=>{this._getTipElement().setAttribute("data-popper-placement",t.state.placement)}}]};return{...e,...w(this._config.popperConfig,[void 0,e])}}_setListeners(){const t=this._config.trigger.split(" ");for(const e of t)if("click"===e)F.on(this._element,this.constructor.eventName("click"),this._config.selector,t=>{const e=this._initializeOnDelegatedTarget(t);e._activeTrigger[Pr]=!(e._isShown()&&e._activeTrigger[Pr]),e.toggle()});else if("manual"!==e){const t=e===Rr?this.constructor.eventName("mouseenter"):this.constructor.eventName("focusin"),r=e===Rr?this.constructor.eventName("mouseleave"):this.constructor.eventName("focusout");F.on(this._element,t,this._config.selector,t=>{const e=this._initializeOnDelegatedTarget(t);e._activeTrigger["focusin"===t.type?Dr:Rr]=!0,e._enter()}),F.on(this._element,r,this._config.selector,t=>{const e=this._initializeOnDelegatedTarget(t);e._activeTrigger["focusout"===t.type?Dr:Rr]=e._element.contains(t.relatedTarget),e._leave()})}this._hideModalHandler=()=>{this._element&&this.hide()},F.on(this._element.closest(Nr),kr,this._hideModalHandler)}_fixTitle(){const t=this._element.getAttribute("title");t&&(this._element.getAttribute("aria-label")||this._element.textContent.trim()||this._element.setAttribute("aria-label",t),this._element.setAttribute("data-bs-original-title",t),this._element.removeAttribute("title"))}_enter(){this._isShown()||this._isHovered?this._isHovered=!0:(this._isHovered=!0,this._setTimeout(()=>{this._isHovered&&this.show()},this._config.delay.show))}_leave(){this._isWithActiveTrigger()||(this._isHovered=!1,this._setTimeout(()=>{this._isHovered||this.hide()},this._config.delay.hide))}_setTimeout(t,e){clearTimeout(this._timeout),this._timeout=setTimeout(t,e)}_isWithActiveTrigger(){return Object.values(this._activeTrigger).includes(!0)}_getConfig(t){const e=H.getDataAttributes(this._element);for(const r of Object.keys(e))Sr.has(r)&&delete e[r];return t={...e,..."object"==typeof t&&t?t:{}},t=this._mergeConfigObj(t),t=this._configAfterMerge(t),this._typeCheckConfig(t),t}_configAfterMerge(t){return t.container=!1===t.container?document.body:c(t.container),"number"==typeof t.delay&&(t.delay={show:t.delay,hide:t.delay}),"number"==typeof t.title&&(t.title=t.title.toString()),"number"==typeof t.content&&(t.content=t.content.toString()),t}_getDelegateConfig(){const t={};for(const[e,r]of Object.entries(this._config))this.constructor.Default[e]!==r&&(t[e]=r);return t.selector=!1,t.trigger="manual",t}_disposePopper(){this._popper&&(this._popper.destroy(),this._popper=null),this.tip&&(this.tip.remove(),this.tip=null)}static jQueryInterface(t){return this.each(function(){const e=Fr.getOrCreateInstance(this,t);if("string"==typeof t){if(void 0===e[t])throw new TypeError(`No method named "${t}"`);e[t]()}})}}_(Fr);const jr=".popover-header",Vr=".popover-body",Ur={...Fr.Default,content:"",offset:[0,8],placement:"right",template:'<div class="popover" role="tooltip"><div class="popover-arrow"></div><h3 class="popover-header"></h3><div class="popover-body"></div></div>',trigger:"click"},Hr={...Fr.DefaultType,content:"(null|string|element|function)"};class zr extends Fr{static get Default(){return Ur}static get DefaultType(){return Hr}static get NAME(){return"popover"}_isWithContent(){return this._getTitle()||this._getContent()}_getContentForTemplate(){return{[jr]:this._getTitle(),[Vr]:this._getContent()}}_getContent(){return this._resolvePossibleFunction(this._config.content)}static jQueryInterface(t){return this.each(function(){const e=zr.getOrCreateInstance(this,t);if("string"==typeof t){if(void 0===e[t])throw new TypeError(`No method named "${t}"`);e[t]()}})}}_(zr);const Wr=".bs.scrollspy",Gr=`activate${Wr}`,Xr=`click${Wr}`,$r=`load${Wr}.data-api`,Yr="active",qr="[href]",Kr=".nav-link",Zr=`${Kr}, .nav-item > ${Kr}, .list-group-item`,Qr={offset:null,rootMargin:"0px 0px -25%",smoothScroll:!1,target:null,threshold:[.1,.5,1]},Jr={offset:"(number|null)",rootMargin:"string",smoothScroll:"boolean",target:"element",threshold:"array"};class tn extends W{constructor(t,e){super(t,e),this._targetLinks=new Map,this._observableSections=new Map,this._rootElement="visible"===getComputedStyle(this._element).overflowY?null:this._element,this._activeTarget=null,this._observer=null,this._previousScrollData={visibleEntryTop:0,parentScrollTop:0},this.refresh()}static get Default(){return Qr}static get DefaultType(){return Jr}static get NAME(){return"scrollspy"}refresh(){this._initializeTargetsAndObservables(),this._maybeEnableSmoothScroll(),this._observer?this._observer.disconnect():this._observer=this._getNewObserver();for(const t of this._observableSections.values())this._observer.observe(t)}dispose(){this._observer.disconnect(),super.dispose()}_configAfterMerge(t){return t.target=c(t.target)||document.body,t.rootMargin=t.offset?`${t.offset}px 0px -30%`:t.rootMargin,"string"==typeof t.threshold&&(t.threshold=t.threshold.split(",").map(t=>Number.parseFloat(t))),t}_maybeEnableSmoothScroll(){this._config.smoothScroll&&(F.off(this._config.target,Xr),F.on(this._config.target,Xr,qr,t=>{const e=this._observableSections.get(t.target.hash);if(e){t.preventDefault();const r=this._rootElement||window,n=e.offsetTop-this._element.offsetTop;if(r.scrollTo)return void r.scrollTo({top:n,behavior:"smooth"});r.scrollTop=n}}))}_getNewObserver(){const t={root:this._rootElement,threshold:this._config.threshold,rootMargin:this._config.rootMargin};return new IntersectionObserver(t=>this._observerCallback(t),t)}_observerCallback(t){const e=t=>this._targetLinks.get(`#${t.target.id}`),r=t=>{this._previousScrollData.visibleEntryTop=t.target.offsetTop,this._process(e(t))},n=(this._rootElement||document.documentElement).scrollTop,o=n>=this._previousScrollData.parentScrollTop;this._previousScrollData.parentScrollTop=n;for(const i of t){if(!i.isIntersecting){this._activeTarget=null,this._clearActiveClass(e(i));continue}const t=i.target.offsetTop>=this._previousScrollData.visibleEntryTop;if(o&&t){if(r(i),!n)return}else o||t||r(i)}}_initializeTargetsAndObservables(){this._targetLinks=new Map,this._observableSections=new Map;const t=X.find(qr,this._config.target);for(const e of t){if(!e.hash||f(e))continue;const t=X.findOne(decodeURI(e.hash),this._element);h(t)&&(this._targetLinks.set(decodeURI(e.hash),e),this._observableSections.set(e.hash,t))}}_process(t){this._activeTarget!==t&&(this._clearActiveClass(this._config.target),this._activeTarget=t,t.classList.add(Yr),this._activateParents(t),F.trigger(this._element,Gr,{relatedTarget:t}))}_activateParents(t){if(t.classList.contains("dropdown-item"))X.findOne(".dropdown-toggle",t.closest(".dropdown")).classList.add(Yr);else for(const e of X.parents(t,".nav, .list-group"))for(const t of X.prev(e,Zr))t.classList.add(Yr)}_clearActiveClass(t){t.classList.remove(Yr);const e=X.find(`${qr}.${Yr}`,t);for(const r of e)r.classList.remove(Yr)}static jQueryInterface(t){return this.each(function(){const e=tn.getOrCreateInstance(this,t);if("string"==typeof t){if(void 0===e[t]||t.startsWith("_")||"constructor"===t)throw new TypeError(`No method named "${t}"`);e[t]()}})}}F.on(window,$r,()=>{for(const t of X.find('[data-bs-spy="scroll"]'))tn.getOrCreateInstance(t)}),_(tn);const en=".bs.tab",rn=`hide${en}`,nn=`hidden${en}`,on=`show${en}`,an=`shown${en}`,sn=`click${en}`,un=`keydown${en}`,ln=`load${en}`,cn="ArrowLeft",hn="ArrowRight",fn="ArrowUp",dn="ArrowDown",pn="Home",gn="End",mn="active",vn="fade",yn="show",_n=".dropdown-toggle",wn=`:not(${_n})`,bn='[data-bs-toggle="tab"], [data-bs-toggle="pill"], [data-bs-toggle="list"]',Cn=`.nav-link${wn}, .list-group-item${wn}, [role="tab"]${wn}, ${bn}`,An=`.${mn}[data-bs-toggle="tab"], .${mn}[data-bs-toggle="pill"], .${mn}[data-bs-toggle="list"]`;class En extends W{constructor(t){super(t),this._parent=this._element.closest('.list-group, .nav, [role="tablist"]'),this._parent&&(this._setInitialAttributes(this._parent,this._getChildren()),F.on(this._element,un,t=>this._keydown(t)))}static get NAME(){return"tab"}show(){const t=this._element;if(this._elemIsActive(t))return;const e=this._getActiveElem(),r=e?F.trigger(e,rn,{relatedTarget:t}):null;F.trigger(t,on,{relatedTarget:e}).defaultPrevented||r&&r.defaultPrevented||(this._deactivate(e,t),this._activate(t,e))}_activate(t,e){t&&(t.classList.add(mn),this._activate(X.getElementFromSelector(t)),this._queueCallback(()=>{"tab"===t.getAttribute("role")?(t.removeAttribute("tabindex"),t.setAttribute("aria-selected",!0),this._toggleDropDown(t,!0),F.trigger(t,an,{relatedTarget:e})):t.classList.add(yn)},t,t.classList.contains(vn)))}_deactivate(t,e){t&&(t.classList.remove(mn),t.blur(),this._deactivate(X.getElementFromSelector(t)),this._queueCallback(()=>{"tab"===t.getAttribute("role")?(t.setAttribute("aria-selected",!1),t.setAttribute("tabindex","-1"),this._toggleDropDown(t,!1),F.trigger(t,nn,{relatedTarget:e})):t.classList.remove(yn)},t,t.classList.contains(vn)))}_keydown(t){if(![cn,hn,fn,dn,pn,gn].includes(t.key))return;t.stopPropagation(),t.preventDefault();const e=this._getChildren().filter(t=>!f(t));let r;if([pn,gn].includes(t.key))r=e[t.key===pn?0:e.length-1];else{const n=[hn,dn].includes(t.key);r=C(e,t.target,n,!0)}r&&(r.focus({preventScroll:!0}),En.getOrCreateInstance(r).show())}_getChildren(){return X.find(Cn,this._parent)}_getActiveElem(){return this._getChildren().find(t=>this._elemIsActive(t))||null}_setInitialAttributes(t,e){this._setAttributeIfNotExists(t,"role","tablist");for(const r of e)this._setInitialAttributesOnChild(r)}_setInitialAttributesOnChild(t){t=this._getInnerElement(t);const e=this._elemIsActive(t),r=this._getOuterElement(t);t.setAttribute("aria-selected",e),r!==t&&this._setAttributeIfNotExists(r,"role","presentation"),e||t.setAttribute("tabindex","-1"),this._setAttributeIfNotExists(t,"role","tab"),this._setInitialAttributesOnTargetPanel(t)}_setInitialAttributesOnTargetPanel(t){const e=X.getElementFromSelector(t);e&&(this._setAttributeIfNotExists(e,"role","tabpanel"),t.id&&this._setAttributeIfNotExists(e,"aria-labelledby",`${t.id}`))}_toggleDropDown(t,e){const r=this._getOuterElement(t);if(!r.classList.contains("dropdown"))return;const n=(t,n)=>{const o=X.findOne(t,r);o&&o.classList.toggle(n,e)};n(_n,mn),n(".dropdown-menu",yn),r.setAttribute("aria-expanded",e)}_setAttributeIfNotExists(t,e,r){t.hasAttribute(e)||t.setAttribute(e,r)}_elemIsActive(t){return t.classList.contains(mn)}_getInnerElement(t){return t.matches(Cn)?t:X.findOne(Cn,t)}_getOuterElement(t){return t.closest(".nav-item, .list-group-item")||t}static jQueryInterface(t){return this.each(function(){const e=En.getOrCreateInstance(this);if("string"==typeof t){if(void 0===e[t]||t.startsWith("_")||"constructor"===t)throw new TypeError(`No method named "${t}"`);e[t]()}})}}F.on(document,sn,bn,function(t){["A","AREA"].includes(this.tagName)&&t.preventDefault(),f(this)||En.getOrCreateInstance(this).show()}),F.on(window,ln,()=>{for(const t of X.find(An))En.getOrCreateInstance(t)}),_(En);const In=".bs.toast",Sn=`mouseover${In}`,xn=`mouseout${In}`,On=`focusin${In}`,Tn=`focusout${In}`,Nn=`hide${In}`,kn=`hidden${In}`,Rn=`show${In}`,Dn=`shown${In}`,Pn="hide",Mn="show",Bn="showing",Ln={animation:"boolean",autohide:"boolean",delay:"number"},Fn={animation:!0,autohide:!0,delay:5e3};class jn extends W{constructor(t,e){super(t,e),this._timeout=null,this._hasMouseInteraction=!1,this._hasKeyboardInteraction=!1,this._setListeners()}static get Default(){return Fn}static get DefaultType(){return Ln}static get NAME(){return"toast"}show(){F.trigger(this._element,Rn).defaultPrevented||(this._clearTimeout(),this._config.animation&&this._element.classList.add("fade"),this._element.classList.remove(Pn),g(this._element),this._element.classList.add(Mn,Bn),this._queueCallback(()=>{this._element.classList.remove(Bn),F.trigger(this._element,Dn),this._maybeScheduleHide()},this._element,this._config.animation))}hide(){this.isShown()&&(F.trigger(this._element,Nn).defaultPrevented||(this._element.classList.add(Bn),this._queueCallback(()=>{this._element.classList.add(Pn),this._element.classList.remove(Bn,Mn),F.trigger(this._element,kn)},this._element,this._config.animation)))}dispose(){this._clearTimeout(),this.isShown()&&this._element.classList.remove(Mn),super.dispose()}isShown(){return this._element.classList.contains(Mn)}_maybeScheduleHide(){this._config.autohide&&(this._hasMouseInteraction||this._hasKeyboardInteraction||(this._timeout=setTimeout(()=>{this.hide()},this._config.delay)))}_onInteraction(t,e){switch(t.type){case"mouseover":case"mouseout":this._hasMouseInteraction=e;break;case"focusin":case"focusout":this._hasKeyboardInteraction=e}if(e)return void this._clearTimeout();const r=t.relatedTarget;this._element===r||this._element.contains(r)||this._maybeScheduleHide()}_setListeners(){F.on(this._element,Sn,t=>this._onInteraction(t,!0)),F.on(this._element,xn,t=>this._onInteraction(t,!1)),F.on(this._element,On,t=>this._onInteraction(t,!0)),F.on(this._element,Tn,t=>this._onInteraction(t,!1))}_clearTimeout(){clearTimeout(this._timeout),this._timeout=null}static jQueryInterface(t){return this.each(function(){const e=jn.getOrCreateInstance(this,t);if("string"==typeof t){if(void 0===e[t])throw new TypeError(`No method named "${t}"`);e[t](this)}})}}$(jn),_(jn)})(p(Xt));var $t,Yt={exports:{}},qt={};var Kt,Zt={};
2
2
  /**
3
3
  * @license React
4
4
  * react-jsx-runtime.development.js
@@ -7,11 +7,11 @@
7
7
  *
8
8
  * This source code is licensed under the MIT license found in the
9
9
  * LICENSE file in the root directory of this source tree.
10
- */"production"===process.env.NODE_ENV?Yt.exports=function(){if($t)return qt;$t=1;var t=e,r=Symbol.for("react.element"),n=Symbol.for("react.fragment"),o=Object.prototype.hasOwnProperty,i=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,a={key:!0,ref:!0,__self:!0,__source:!0};function s(t,e,n){var s,c={},u=null,l=null;for(s in void 0!==n&&(u=""+n),void 0!==e.key&&(u=""+e.key),void 0!==e.ref&&(l=e.ref),e)o.call(e,s)&&!a.hasOwnProperty(s)&&(c[s]=e[s]);if(t&&t.defaultProps)for(s in e=t.defaultProps)void 0===c[s]&&(c[s]=e[s]);return{$$typeof:r,type:t,key:u,ref:l,props:c,_owner:i.current}}return qt.Fragment=n,qt.jsx=s,qt.jsxs=s,qt}():Yt.exports=(Kt||(Kt=1,"production"!==process.env.NODE_ENV&&function(){var t,r=e,n=Symbol.for("react.element"),o=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),c=Symbol.for("react.provider"),u=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),d=Symbol.for("react.suspense_list"),h=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),g=Symbol.for("react.offscreen"),m=Symbol.iterator,v=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function y(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),n=1;n<e;n++)r[n-1]=arguments[n];!function(t,e,r){var n=v.ReactDebugCurrentFrame.getStackAddendum();""!==n&&(e+="%s",r=r.concat([n]));var o=r.map(function(t){return String(t)});o.unshift("Warning: "+e),Function.prototype.apply.call(console[t],console,o)}("error",t,r)}function _(t){return t.displayName||"Context"}function w(t){if(null==t)return null;if("number"==typeof t.tag&&y("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),"function"==typeof t)return t.displayName||t.name||null;if("string"==typeof t)return t;switch(t){case i:return"Fragment";case o:return"Portal";case s:return"Profiler";case a:return"StrictMode";case f:return"Suspense";case d:return"SuspenseList"}if("object"==typeof t)switch(t.$$typeof){case u:return _(t)+".Consumer";case c:return _(t._context)+".Provider";case l:return function(t,e,r){var n=t.displayName;if(n)return n;var o=e.displayName||e.name||"";return""!==o?r+"("+o+")":r}(t,t.render,"ForwardRef");case h:var e=t.displayName||null;return null!==e?e:w(t.type)||"Memo";case p:var r=t,n=r._payload,g=r._init;try{return w(g(n))}catch(m){return null}}return null}t=Symbol.for("react.module.reference");var b,C,A,E,I,S,O,T=Object.assign,N=0;function x(){}x.__reactDisabledLog=!0;var R,D=v.ReactCurrentDispatcher;function P(t,e,r){if(void 0===R)try{throw Error()}catch(o){var n=o.stack.trim().match(/\n( *(at )?)/);R=n&&n[1]||""}return"\n"+R+t}var M,k=!1,L="function"==typeof WeakMap?WeakMap:Map;function j(t,e){if(!t||k)return"";var r,n=M.get(t);if(void 0!==n)return n;k=!0;var o,i=Error.prepareStackTrace;Error.prepareStackTrace=void 0,o=D.current,D.current=null,function(){if(0===N){b=console.log,C=console.info,A=console.warn,E=console.error,I=console.group,S=console.groupCollapsed,O=console.groupEnd;var t={configurable:!0,enumerable:!0,value:x,writable:!0};Object.defineProperties(console,{info:t,log:t,warn:t,error:t,group:t,groupCollapsed:t,groupEnd:t})}N++}();try{if(e){var a=function(){throw Error()};if(Object.defineProperty(a.prototype,"props",{set:function(){throw Error()}}),"object"==typeof Reflect&&Reflect.construct){try{Reflect.construct(a,[])}catch(p){r=p}Reflect.construct(t,[],a)}else{try{a.call()}catch(p){r=p}t.call(a.prototype)}}else{try{throw Error()}catch(p){r=p}t()}}catch(g){if(g&&r&&"string"==typeof g.stack){for(var s=g.stack.split("\n"),c=r.stack.split("\n"),u=s.length-1,l=c.length-1;u>=1&&l>=0&&s[u]!==c[l];)l--;for(;u>=1&&l>=0;u--,l--)if(s[u]!==c[l]){if(1!==u||1!==l)do{if(u--,--l<0||s[u]!==c[l]){var f="\n"+s[u].replace(" at new "," at ");return t.displayName&&f.includes("<anonymous>")&&(f=f.replace("<anonymous>",t.displayName)),"function"==typeof t&&M.set(t,f),f}}while(u>=1&&l>=0);break}}}finally{k=!1,D.current=o,function(){if(0===--N){var t={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:T({},t,{value:b}),info:T({},t,{value:C}),warn:T({},t,{value:A}),error:T({},t,{value:E}),group:T({},t,{value:I}),groupCollapsed:T({},t,{value:S}),groupEnd:T({},t,{value:O})})}N<0&&y("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}(),Error.prepareStackTrace=i}var d=t?t.displayName||t.name:"",h=d?P(d):"";return"function"==typeof t&&M.set(t,h),h}function B(t,e,r){if(null==t)return"";if("function"==typeof t)return j(t,!(!(n=t.prototype)||!n.isReactComponent));var n;if("string"==typeof t)return P(t);switch(t){case f:return P("Suspense");case d:return P("SuspenseList")}if("object"==typeof t)switch(t.$$typeof){case l:return j(t.render,!1);case h:return B(t.type,e,r);case p:var o=t,i=o._payload,a=o._init;try{return B(a(i),e,r)}catch(s){}}return""}M=new L;var F=Object.prototype.hasOwnProperty,V={},H=v.ReactDebugCurrentFrame;function U(t){if(t){var e=t._owner,r=B(t.type,t._source,e?e.type:null);H.setExtraStackFrame(r)}else H.setExtraStackFrame(null)}var W=Array.isArray;function z(t){return W(t)}function G(t){return""+t}function X(t){if(function(t){try{return G(t),!1}catch(e){return!0}}(t))return y("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",function(t){return"function"==typeof Symbol&&Symbol.toStringTag&&t[Symbol.toStringTag]||t.constructor.name||"Object"}(t)),G(t)}var $,Y,q=v.ReactCurrentOwner,K={key:!0,ref:!0,__self:!0,__source:!0};function Z(t,e,r,o,i){var a,s={},c=null,u=null;for(a in void 0!==r&&(X(r),c=""+r),function(t){if(F.call(t,"key")){var e=Object.getOwnPropertyDescriptor(t,"key").get;if(e&&e.isReactWarning)return!1}return void 0!==t.key}(e)&&(X(e.key),c=""+e.key),function(t){if(F.call(t,"ref")){var e=Object.getOwnPropertyDescriptor(t,"ref").get;if(e&&e.isReactWarning)return!1}return void 0!==t.ref}(e)&&(u=e.ref,function(t){"string"==typeof t.ref&&q.current}(e)),e)F.call(e,a)&&!K.hasOwnProperty(a)&&(s[a]=e[a]);if(t&&t.defaultProps){var l=t.defaultProps;for(a in l)void 0===s[a]&&(s[a]=l[a])}if(c||u){var f="function"==typeof t?t.displayName||t.name||"Unknown":t;c&&function(t,e){var r=function(){$||($=!0,y("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",e))};r.isReactWarning=!0,Object.defineProperty(t,"key",{get:r,configurable:!0})}(s,f),u&&function(t,e){var r=function(){Y||(Y=!0,y("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",e))};r.isReactWarning=!0,Object.defineProperty(t,"ref",{get:r,configurable:!0})}(s,f)}return function(t,e,r,o,i,a,s){var c={$$typeof:n,type:t,key:e,ref:r,props:s,_owner:a,_store:{}};return Object.defineProperty(c._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(c,"_self",{configurable:!1,enumerable:!1,writable:!1,value:o}),Object.defineProperty(c,"_source",{configurable:!1,enumerable:!1,writable:!1,value:i}),Object.freeze&&(Object.freeze(c.props),Object.freeze(c)),c}(t,c,u,i,o,q.current,s)}var Q,J=v.ReactCurrentOwner,tt=v.ReactDebugCurrentFrame;function et(t){if(t){var e=t._owner,r=B(t.type,t._source,e?e.type:null);tt.setExtraStackFrame(r)}else tt.setExtraStackFrame(null)}function rt(t){return"object"==typeof t&&null!==t&&t.$$typeof===n}function nt(){if(J.current){var t=w(J.current.type);if(t)return"\n\nCheck the render method of `"+t+"`."}return""}Q=!1;var ot={};function it(t,e){if(t._store&&!t._store.validated&&null==t.key){t._store.validated=!0;var r=function(t){var e=nt();if(!e){var r="string"==typeof t?t:t.displayName||t.name;r&&(e="\n\nCheck the top-level render call using <"+r+">.")}return e}(e);if(!ot[r]){ot[r]=!0;var n="";t&&t._owner&&t._owner!==J.current&&(n=" It was passed a child from "+w(t._owner.type)+"."),et(t),y('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',r,n),et(null)}}}function at(t,e){if("object"==typeof t)if(z(t))for(var r=0;r<t.length;r++){var n=t[r];rt(n)&&it(n,e)}else if(rt(t))t._store&&(t._store.validated=!0);else if(t){var o=function(t){if(null===t||"object"!=typeof t)return null;var e=m&&t[m]||t["@@iterator"];return"function"==typeof e?e:null}(t);if("function"==typeof o&&o!==t.entries)for(var i,a=o.call(t);!(i=a.next()).done;)rt(i.value)&&it(i.value,e)}}function st(t){var e,r=t.type;if(null!=r&&"string"!=typeof r){if("function"==typeof r)e=r.propTypes;else{if("object"!=typeof r||r.$$typeof!==l&&r.$$typeof!==h)return;e=r.propTypes}if(e){var n=w(r);!function(t,e,r,n,o){var i=Function.call.bind(F);for(var a in t)if(i(t,a)){var s=void 0;try{if("function"!=typeof t[a]){var c=Error((n||"React class")+": "+r+" type `"+a+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof t[a]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw c.name="Invariant Violation",c}s=t[a](e,a,n,r,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(u){s=u}!s||s instanceof Error||(U(o),y("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",n||"React class",r,a,typeof s),U(null)),s instanceof Error&&!(s.message in V)&&(V[s.message]=!0,U(o),y("Failed %s type: %s",r,s.message),U(null))}}(e,t.props,"prop",n,t)}else void 0===r.PropTypes||Q||(Q=!0,y("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",w(r)||"Unknown"));"function"!=typeof r.getDefaultProps||r.getDefaultProps.isReactClassApproved||y("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}var ct={};function ut(e,r,o,m,v,_){var b=function(e){return"string"==typeof e||"function"==typeof e||e===i||e===s||e===a||e===f||e===d||e===g||"object"==typeof e&&null!==e&&(e.$$typeof===p||e.$$typeof===h||e.$$typeof===c||e.$$typeof===u||e.$$typeof===l||e.$$typeof===t||void 0!==e.getModuleId)}(e);if(!b){var C,A="";(void 0===e||"object"==typeof e&&null!==e&&0===Object.keys(e).length)&&(A+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports."),A+=nt(),null===e?C="null":z(e)?C="array":void 0!==e&&e.$$typeof===n?(C="<"+(w(e.type)||"Unknown")+" />",A=" Did you accidentally export a JSX literal instead of a component?"):C=typeof e,y("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",C,A)}var E=Z(e,r,o,v,_);if(null==E)return E;if(b){var I=r.children;if(void 0!==I)if(m)if(z(I)){for(var S=0;S<I.length;S++)at(I[S],e);Object.freeze&&Object.freeze(I)}else y("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else at(I,e)}if(F.call(r,"key")){var O=w(e),T=Object.keys(r).filter(function(t){return"key"!==t}),N=T.length>0?"{key: someKey, "+T.join(": ..., ")+": ...}":"{key: someKey}";ct[O+N]||(y('A props object containing a "key" prop is being spread into JSX:\n let props = %s;\n <%s {...props} />\nReact keys must be passed directly to JSX without using spread:\n let props = %s;\n <%s key={someKey} {...props} />',N,O,T.length>0?"{"+T.join(": ..., ")+": ...}":"{}",O),ct[O+N]=!0)}return e===i?function(t){for(var e=Object.keys(t.props),r=0;r<e.length;r++){var n=e[r];if("children"!==n&&"key"!==n){et(t),y("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",n),et(null);break}}null!==t.ref&&(et(t),y("Invalid attribute `ref` supplied to `React.Fragment`."),et(null))}(E):st(E),E}var lt=function(t,e,r){return ut(t,e,r,!1)},ft=function(t,e,r){return ut(t,e,r,!0)};Zt.Fragment=i,Zt.jsx=lt,Zt.jsxs=ft}()),Zt);var Qt=Yt.exports;const Jt=e.createContext({modalList:[],theme:"light"}),te="sys/theme";function ee(){const t=e.useContext(Jt);if(!(null==t?void 0:t.addModal))throw new Error("'ModalProvider' não encontrado!");return t}const re=1,ne=2,oe=3,ie="jc-alert-hide-sb";function ae({type:t=ne,onConfirm:o,onCancel:i,title:a,text:s="",children:c,defaultBtn:u=2}){const l=e.useRef(),f=e.useRef(),{addModal:d,removeModal:h}=ee(),[p]=e.useState("alert-"+r.random()),g=n.useDragControls();let m="jc-erro";switch(t){case ne:m="jc-aviso";break;case oe:m="jc-conf"}const v=e.useCallback(e=>{t===oe&&("KeyS"===e.code&&o&&o(),"KeyN"===e.code&&i&&i())},[i,o,t]);return e.useEffect(()=>(d(p,t===oe?i:o),()=>h(p)),[]),e.useEffect(()=>{var t;null==(t=null==l?void 0:l.current)||t.focus()},[l]),e.useEffect(()=>(document.addEventListener("keydown",v,!1),document.body.classList.add(ie),()=>{document.removeEventListener("keydown",v,!1),document.body.classList.remove(ie)}),[v]),Qt.jsx(n.motion.div,{className:"jc-alert--container",ref:f,children:Qt.jsxs(n.motion.div,{className:"jc-alert "+m,drag:!0,dragConstraints:f,dragElastic:.1,dragMomentum:!1,dragControls:g,dragListener:!1,animate:{scale:1},transition:{ease:"easeOut",duration:.3},children:[Qt.jsx("div",{className:"jc-close-button",onClick:function(){t===oe?i():o()},children:Qt.jsx("i",{className:"fa-solid fa-xmark"})}),Qt.jsxs("div",{className:"jc-alert-header",onPointerDown:function(t){r.isMobile()||g.start(t)},children:[Qt.jsxs("div",{className:"icon",children:[t===ne&&Qt.jsx("i",{className:"fa-solid fa-check"}),t===re&&Qt.jsx("i",{className:"fa-solid fa-triangle-exclamation"}),t===oe&&Qt.jsx("i",{className:"fas fa-question"})]}),Qt.jsx("div",{className:"jc-alert-title",children:a})]}),Qt.jsx("div",{className:"jc-alert-body",children:s&&"string"==typeof s?Qt.jsx("span",{dangerouslySetInnerHTML:{__html:s.replaceAll("\n","<br/>")}}):Qt.jsx(Qt.Fragment,{children:s||c})}),Qt.jsxs("div",{className:"jc-alert-buttons",children:[(t===re||t===ne)&&Qt.jsx("button",{ref:l,type:"button",className:"btn btn-confirm",onClick:o,children:"OK"}),t===oe&&Qt.jsxs(Qt.Fragment,{children:[Qt.jsxs("button",{type:"button",className:"btn btn-confirm",onClick:o,tabIndex:99,ref:1===u?l:null,children:[Qt.jsx("u",{children:"S"}),"im"]}),Qt.jsxs("button",{type:"button",className:"btn btn-confirm btn-nao",onClick:i,tabIndex:98,ref:2===u?l:null,children:[Qt.jsx("u",{children:"N"}),"ão"]})]})]})]})})}function se({onConfirm:t,text:e="",children:r}){return Qt.jsx(ae,{type:re,title:"Atenção!",text:e,onConfirm:t,children:r})}const ce={baseURL:"",timeout:3e4,auth:{username:"",password:"",header:"x-auth",prefix:"Bearer"},version:"",ident:"",loginRoute:"/",isProductionMode:!0,getToken:()=>"",setToken:t=>console.error("*** setToken() is not defined ***",t),afterRequest:t=>{}};const ue=o.div`
10
+ */"production"===process.env.NODE_ENV?Yt.exports=function(){if($t)return qt;$t=1;var t=e,r=Symbol.for("react.element"),n=Symbol.for("react.fragment"),o=Object.prototype.hasOwnProperty,i=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,a={key:!0,ref:!0,__self:!0,__source:!0};function s(t,e,n){var s,u={},l=null,c=null;for(s in void 0!==n&&(l=""+n),void 0!==e.key&&(l=""+e.key),void 0!==e.ref&&(c=e.ref),e)o.call(e,s)&&!a.hasOwnProperty(s)&&(u[s]=e[s]);if(t&&t.defaultProps)for(s in e=t.defaultProps)void 0===u[s]&&(u[s]=e[s]);return{$$typeof:r,type:t,key:l,ref:c,props:u,_owner:i.current}}return qt.Fragment=n,qt.jsx=s,qt.jsxs=s,qt}():Yt.exports=(Kt||(Kt=1,"production"!==process.env.NODE_ENV&&function(){var t,r=e,n=Symbol.for("react.element"),o=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),u=Symbol.for("react.provider"),l=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),f=Symbol.for("react.suspense_list"),d=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),g=Symbol.for("react.offscreen"),m=Symbol.iterator,v=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function y(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),n=1;n<e;n++)r[n-1]=arguments[n];!function(t,e,r){var n=v.ReactDebugCurrentFrame.getStackAddendum();""!==n&&(e+="%s",r=r.concat([n]));var o=r.map(function(t){return String(t)});o.unshift("Warning: "+e),Function.prototype.apply.call(console[t],console,o)}("error",t,r)}function _(t){return t.displayName||"Context"}function w(t){if(null==t)return null;if("number"==typeof t.tag&&y("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),"function"==typeof t)return t.displayName||t.name||null;if("string"==typeof t)return t;switch(t){case i:return"Fragment";case o:return"Portal";case s:return"Profiler";case a:return"StrictMode";case h:return"Suspense";case f:return"SuspenseList"}if("object"==typeof t)switch(t.$$typeof){case l:return _(t)+".Consumer";case u:return _(t._context)+".Provider";case c:return function(t,e,r){var n=t.displayName;if(n)return n;var o=e.displayName||e.name||"";return""!==o?r+"("+o+")":r}(t,t.render,"ForwardRef");case d:var e=t.displayName||null;return null!==e?e:w(t.type)||"Memo";case p:var r=t,n=r._payload,g=r._init;try{return w(g(n))}catch(m){return null}}return null}t=Symbol.for("react.module.reference");var b,C,A,E,I,S,x,O=Object.assign,T=0;function N(){}N.__reactDisabledLog=!0;var k,R=v.ReactCurrentDispatcher;function D(t,e,r){if(void 0===k)try{throw Error()}catch(o){var n=o.stack.trim().match(/\n( *(at )?)/);k=n&&n[1]||""}return"\n"+k+t}var P,M=!1,B="function"==typeof WeakMap?WeakMap:Map;function L(t,e){if(!t||M)return"";var r,n=P.get(t);if(void 0!==n)return n;M=!0;var o,i=Error.prepareStackTrace;Error.prepareStackTrace=void 0,o=R.current,R.current=null,function(){if(0===T){b=console.log,C=console.info,A=console.warn,E=console.error,I=console.group,S=console.groupCollapsed,x=console.groupEnd;var t={configurable:!0,enumerable:!0,value:N,writable:!0};Object.defineProperties(console,{info:t,log:t,warn:t,error:t,group:t,groupCollapsed:t,groupEnd:t})}T++}();try{if(e){var a=function(){throw Error()};if(Object.defineProperty(a.prototype,"props",{set:function(){throw Error()}}),"object"==typeof Reflect&&Reflect.construct){try{Reflect.construct(a,[])}catch(p){r=p}Reflect.construct(t,[],a)}else{try{a.call()}catch(p){r=p}t.call(a.prototype)}}else{try{throw Error()}catch(p){r=p}t()}}catch(g){if(g&&r&&"string"==typeof g.stack){for(var s=g.stack.split("\n"),u=r.stack.split("\n"),l=s.length-1,c=u.length-1;l>=1&&c>=0&&s[l]!==u[c];)c--;for(;l>=1&&c>=0;l--,c--)if(s[l]!==u[c]){if(1!==l||1!==c)do{if(l--,--c<0||s[l]!==u[c]){var h="\n"+s[l].replace(" at new "," at ");return t.displayName&&h.includes("<anonymous>")&&(h=h.replace("<anonymous>",t.displayName)),"function"==typeof t&&P.set(t,h),h}}while(l>=1&&c>=0);break}}}finally{M=!1,R.current=o,function(){if(0===--T){var t={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:O({},t,{value:b}),info:O({},t,{value:C}),warn:O({},t,{value:A}),error:O({},t,{value:E}),group:O({},t,{value:I}),groupCollapsed:O({},t,{value:S}),groupEnd:O({},t,{value:x})})}T<0&&y("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}(),Error.prepareStackTrace=i}var f=t?t.displayName||t.name:"",d=f?D(f):"";return"function"==typeof t&&P.set(t,d),d}function F(t,e,r){if(null==t)return"";if("function"==typeof t)return L(t,!(!(n=t.prototype)||!n.isReactComponent));var n;if("string"==typeof t)return D(t);switch(t){case h:return D("Suspense");case f:return D("SuspenseList")}if("object"==typeof t)switch(t.$$typeof){case c:return L(t.render,!1);case d:return F(t.type,e,r);case p:var o=t,i=o._payload,a=o._init;try{return F(a(i),e,r)}catch(s){}}return""}P=new B;var j=Object.prototype.hasOwnProperty,V={},U=v.ReactDebugCurrentFrame;function H(t){if(t){var e=t._owner,r=F(t.type,t._source,e?e.type:null);U.setExtraStackFrame(r)}else U.setExtraStackFrame(null)}var z=Array.isArray;function W(t){return z(t)}function G(t){return""+t}function X(t){if(function(t){try{return G(t),!1}catch(e){return!0}}(t))return y("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",function(t){return"function"==typeof Symbol&&Symbol.toStringTag&&t[Symbol.toStringTag]||t.constructor.name||"Object"}(t)),G(t)}var $,Y,q=v.ReactCurrentOwner,K={key:!0,ref:!0,__self:!0,__source:!0};function Z(t,e,r,o,i){var a,s={},u=null,l=null;for(a in void 0!==r&&(X(r),u=""+r),function(t){if(j.call(t,"key")){var e=Object.getOwnPropertyDescriptor(t,"key").get;if(e&&e.isReactWarning)return!1}return void 0!==t.key}(e)&&(X(e.key),u=""+e.key),function(t){if(j.call(t,"ref")){var e=Object.getOwnPropertyDescriptor(t,"ref").get;if(e&&e.isReactWarning)return!1}return void 0!==t.ref}(e)&&(l=e.ref,function(t){"string"==typeof t.ref&&q.current}(e)),e)j.call(e,a)&&!K.hasOwnProperty(a)&&(s[a]=e[a]);if(t&&t.defaultProps){var c=t.defaultProps;for(a in c)void 0===s[a]&&(s[a]=c[a])}if(u||l){var h="function"==typeof t?t.displayName||t.name||"Unknown":t;u&&function(t,e){var r=function(){$||($=!0,y("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",e))};r.isReactWarning=!0,Object.defineProperty(t,"key",{get:r,configurable:!0})}(s,h),l&&function(t,e){var r=function(){Y||(Y=!0,y("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",e))};r.isReactWarning=!0,Object.defineProperty(t,"ref",{get:r,configurable:!0})}(s,h)}return function(t,e,r,o,i,a,s){var u={$$typeof:n,type:t,key:e,ref:r,props:s,_owner:a,_store:{}};return Object.defineProperty(u._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(u,"_self",{configurable:!1,enumerable:!1,writable:!1,value:o}),Object.defineProperty(u,"_source",{configurable:!1,enumerable:!1,writable:!1,value:i}),Object.freeze&&(Object.freeze(u.props),Object.freeze(u)),u}(t,u,l,i,o,q.current,s)}var Q,J=v.ReactCurrentOwner,tt=v.ReactDebugCurrentFrame;function et(t){if(t){var e=t._owner,r=F(t.type,t._source,e?e.type:null);tt.setExtraStackFrame(r)}else tt.setExtraStackFrame(null)}function rt(t){return"object"==typeof t&&null!==t&&t.$$typeof===n}function nt(){if(J.current){var t=w(J.current.type);if(t)return"\n\nCheck the render method of `"+t+"`."}return""}Q=!1;var ot={};function it(t,e){if(t._store&&!t._store.validated&&null==t.key){t._store.validated=!0;var r=function(t){var e=nt();if(!e){var r="string"==typeof t?t:t.displayName||t.name;r&&(e="\n\nCheck the top-level render call using <"+r+">.")}return e}(e);if(!ot[r]){ot[r]=!0;var n="";t&&t._owner&&t._owner!==J.current&&(n=" It was passed a child from "+w(t._owner.type)+"."),et(t),y('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',r,n),et(null)}}}function at(t,e){if("object"==typeof t)if(W(t))for(var r=0;r<t.length;r++){var n=t[r];rt(n)&&it(n,e)}else if(rt(t))t._store&&(t._store.validated=!0);else if(t){var o=function(t){if(null===t||"object"!=typeof t)return null;var e=m&&t[m]||t["@@iterator"];return"function"==typeof e?e:null}(t);if("function"==typeof o&&o!==t.entries)for(var i,a=o.call(t);!(i=a.next()).done;)rt(i.value)&&it(i.value,e)}}function st(t){var e,r=t.type;if(null!=r&&"string"!=typeof r){if("function"==typeof r)e=r.propTypes;else{if("object"!=typeof r||r.$$typeof!==c&&r.$$typeof!==d)return;e=r.propTypes}if(e){var n=w(r);!function(t,e,r,n,o){var i=Function.call.bind(j);for(var a in t)if(i(t,a)){var s=void 0;try{if("function"!=typeof t[a]){var u=Error((n||"React class")+": "+r+" type `"+a+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof t[a]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw u.name="Invariant Violation",u}s=t[a](e,a,n,r,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(l){s=l}!s||s instanceof Error||(H(o),y("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",n||"React class",r,a,typeof s),H(null)),s instanceof Error&&!(s.message in V)&&(V[s.message]=!0,H(o),y("Failed %s type: %s",r,s.message),H(null))}}(e,t.props,"prop",n,t)}else void 0===r.PropTypes||Q||(Q=!0,y("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",w(r)||"Unknown"));"function"!=typeof r.getDefaultProps||r.getDefaultProps.isReactClassApproved||y("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}var ut={};function lt(e,r,o,m,v,_){var b=function(e){return"string"==typeof e||"function"==typeof e||e===i||e===s||e===a||e===h||e===f||e===g||"object"==typeof e&&null!==e&&(e.$$typeof===p||e.$$typeof===d||e.$$typeof===u||e.$$typeof===l||e.$$typeof===c||e.$$typeof===t||void 0!==e.getModuleId)}(e);if(!b){var C,A="";(void 0===e||"object"==typeof e&&null!==e&&0===Object.keys(e).length)&&(A+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports."),A+=nt(),null===e?C="null":W(e)?C="array":void 0!==e&&e.$$typeof===n?(C="<"+(w(e.type)||"Unknown")+" />",A=" Did you accidentally export a JSX literal instead of a component?"):C=typeof e,y("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",C,A)}var E=Z(e,r,o,v,_);if(null==E)return E;if(b){var I=r.children;if(void 0!==I)if(m)if(W(I)){for(var S=0;S<I.length;S++)at(I[S],e);Object.freeze&&Object.freeze(I)}else y("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else at(I,e)}if(j.call(r,"key")){var x=w(e),O=Object.keys(r).filter(function(t){return"key"!==t}),T=O.length>0?"{key: someKey, "+O.join(": ..., ")+": ...}":"{key: someKey}";ut[x+T]||(y('A props object containing a "key" prop is being spread into JSX:\n let props = %s;\n <%s {...props} />\nReact keys must be passed directly to JSX without using spread:\n let props = %s;\n <%s key={someKey} {...props} />',T,x,O.length>0?"{"+O.join(": ..., ")+": ...}":"{}",x),ut[x+T]=!0)}return e===i?function(t){for(var e=Object.keys(t.props),r=0;r<e.length;r++){var n=e[r];if("children"!==n&&"key"!==n){et(t),y("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",n),et(null);break}}null!==t.ref&&(et(t),y("Invalid attribute `ref` supplied to `React.Fragment`."),et(null))}(E):st(E),E}var ct=function(t,e,r){return lt(t,e,r,!1)},ht=function(t,e,r){return lt(t,e,r,!0)};Zt.Fragment=i,Zt.jsx=ct,Zt.jsxs=ht}()),Zt);var Qt=Yt.exports;const Jt=e.createContext({modalList:[],theme:"light"}),te="sys/theme";function ee(){const t=e.useContext(Jt);if(!(null==t?void 0:t.addModal))throw new Error("'ModalProvider' não encontrado!");return t}const re=1,ne=2,oe=3,ie="jc-alert-hide-sb";function ae({type:t=ne,onConfirm:o,onCancel:i,title:a,text:s="",children:u,defaultBtn:l=2}){const c=e.useRef(),h=e.useRef(),{addModal:f,removeModal:d}=ee(),[p]=e.useState("alert-"+r.random()),g=n.useDragControls();let m="jc-erro";switch(t){case ne:m="jc-aviso";break;case oe:m="jc-conf"}const v=e.useCallback(e=>{t===oe&&("KeyS"===e.code&&o&&o(),"KeyN"===e.code&&i&&i())},[i,o,t]);return e.useEffect(()=>(f(p,t===oe?i:o),()=>d(p)),[]),e.useEffect(()=>{var t;null==(t=null==c?void 0:c.current)||t.focus()},[c]),e.useEffect(()=>(document.addEventListener("keydown",v,!1),document.body.classList.add(ie),()=>{document.removeEventListener("keydown",v,!1),document.body.classList.remove(ie)}),[v]),Qt.jsx(n.motion.div,{className:"jc-alert--container",ref:h,children:Qt.jsxs(n.motion.div,{className:"jc-alert "+m,drag:!0,dragConstraints:h,dragElastic:.1,dragMomentum:!1,dragControls:g,dragListener:!1,animate:{scale:1},transition:{ease:"easeOut",duration:.3},children:[Qt.jsx("div",{className:"jc-close-button",onClick:function(){t===oe?i():o()},children:Qt.jsx("i",{className:"fa-solid fa-xmark"})}),Qt.jsxs("div",{className:"jc-alert-header",onPointerDown:function(t){r.isMobile()||g.start(t)},children:[Qt.jsxs("div",{className:"icon",children:[t===ne&&Qt.jsx("i",{className:"fa-solid fa-check"}),t===re&&Qt.jsx("i",{className:"fa-solid fa-triangle-exclamation"}),t===oe&&Qt.jsx("i",{className:"fas fa-question"})]}),Qt.jsx("div",{className:"jc-alert-title",children:a})]}),Qt.jsx("div",{className:"jc-alert-body",children:s&&"string"==typeof s?Qt.jsx("span",{dangerouslySetInnerHTML:{__html:s.replaceAll("\n","<br/>")}}):Qt.jsx(Qt.Fragment,{children:s||u})}),Qt.jsxs("div",{className:"jc-alert-buttons",children:[(t===re||t===ne)&&Qt.jsx("button",{ref:c,type:"button",className:"btn btn-confirm",onClick:o,children:"OK"}),t===oe&&Qt.jsxs(Qt.Fragment,{children:[Qt.jsxs("button",{type:"button",className:"btn btn-confirm",onClick:o,tabIndex:99,ref:1===l?c:null,children:[Qt.jsx("u",{children:"S"}),"im"]}),Qt.jsxs("button",{type:"button",className:"btn btn-confirm btn-nao",onClick:i,tabIndex:98,ref:2===l?c:null,children:[Qt.jsx("u",{children:"N"}),"ão"]})]})]})]})})}function se({onConfirm:t,text:e="",children:r}){return Qt.jsx(ae,{type:re,title:"Atenção!",text:e,onConfirm:t,children:r})}const ue={baseURL:"",timeout:3e4,auth:{username:"",password:"",header:"x-auth",prefix:"Bearer"},version:"",ident:"",loginRoute:"/",isProductionMode:!0,getToken:()=>"",setToken:t=>console.error("*** setToken() is not defined ***",t),afterRequest:t=>{}};const le=o.div`
11
11
  @media (max-width: 767px) {
12
12
  overflow-x: auto;
13
13
  }
14
- `,le=o.table`
14
+ `,ce=o.table`
15
15
  --color-tb: var(--pn-color-border);
16
16
  --color-bg: var(--bs-body);
17
17
  --table-border: 1px solid var(--bs-border-color);
@@ -186,7 +186,7 @@
186
186
  }
187
187
  }
188
188
  }
189
- `;function fe({title:t,items:r,size:n,children:o,direction:s="start",color:c,dados:u,...l}){const f=a.useHistory(),[d,h]=e.useState(!1);return Qt.jsxs(i.Dropdown,{isOpen:d,toggle:()=>{h(t=>!t)},direction:s,size:n,title:t,children:[Qt.jsxs(i.DropdownMenu,{className:"left-shadow",style:{backgroundColor:"var(--ddm-body-bg)"},children:[t&&Qt.jsxs(Qt.Fragment,{children:[Qt.jsx(i.DropdownItem,{header:!0,children:Qt.jsx("strong",{className:"fs-6 text-body",children:t})}),Qt.jsx(i.DropdownItem,{divider:!0})]}),r&&r.map((t,e)=>t.isLine?Qt.jsx(i.DropdownItem,{divider:!0},e):Qt.jsx(i.DropdownItem,{disabled:t.disabled,onClick:()=>{var e;(e=t).route?f.push(e.route,!0):e.onClick(u)},children:Qt.jsxs("div",{className:"dropdown-btn--opt-area","data-disabled":Boolean(t.disabled),children:[Qt.jsx("span",{children:t.icon}),Qt.jsx("div",{children:t.title})]})},e))]}),Qt.jsx(i.DropdownToggle,{color:c||"secondary",...l,size:n,children:o})]})}o.span`
189
+ `;function he({title:t,items:r,size:n,children:o,direction:s="start",color:u,dados:l,...c}){const h=a.useHistory(),[f,d]=e.useState(!1);return Qt.jsxs(i.Dropdown,{isOpen:f,toggle:()=>{d(t=>!t)},direction:s,size:n,title:t,children:[Qt.jsxs(i.DropdownMenu,{className:"left-shadow",style:{backgroundColor:"var(--ddm-body-bg)"},children:[t&&Qt.jsxs(Qt.Fragment,{children:[Qt.jsx(i.DropdownItem,{header:!0,children:Qt.jsx("strong",{className:"fs-6 text-body",children:t})}),Qt.jsx(i.DropdownItem,{divider:!0})]}),r&&r.map((t,e)=>t.isLine?Qt.jsx(i.DropdownItem,{divider:!0},e):Qt.jsx(i.DropdownItem,{disabled:t.disabled,onClick:()=>{var e;(e=t).route?h.push(e.route,!0):e.onClick(l)},children:Qt.jsxs("div",{className:"dropdown-btn--opt-area","data-disabled":Boolean(t.disabled),children:[Qt.jsx("span",{children:t.icon}),Qt.jsx("div",{children:t.title})]})},e))]}),Qt.jsx(i.DropdownToggle,{color:u||"secondary",...c,size:n,children:o})]})}o.span`
190
190
  display: inline-flex;
191
191
  align-items: center;
192
192
  justify-content: center;
@@ -198,7 +198,7 @@
198
198
  border-radius: 1px;
199
199
  color: ${t=>t.value?"#fff":""};
200
200
  background-color: ${t=>t.value?"#346fdd":"var(--bs-body-color"};
201
- `,t.hasTableLineClick=!1;function de(t,e){if("function"==typeof t.campo)return t.campo(e);if("string"==typeof t.campo){const n=e[t.campo];return t.campo2?Qt.jsxs("div",{className:"col-campo2",children:[Qt.jsx("div",{className:"fw-bold",children:n}),Qt.jsx("small",{className:"text-secondary",children:e[t.campo2]})]}):"date"==t.tipo?r.formatData(n):"datetime"==t.tipo?r.formatDataHora(n):"float"==t.tipo||"numeric"==t.tipo?r.formatValor(n,2,!1):"money"==t.tipo||"currency"==t.tipo||t.money?r.formatValor(n,2,!0):"boolean"==typeof n?Qt.jsx("input",{type:"checkbox",checked:n,readOnly:!0,className:"form-check-input",style:{marginTop:3,cursor:"default"}}):n}return null}const he=t=>{let e="left";return("float"===t.tipo||"currency"===t.tipo||t.money)&&(e="right"),t.campoChave&&(e="center"),t.align&&(e=t.align),e};function pe({colunas:t,fixedHeader:e,incColActions:r=!0}){return t?Qt.jsx("thead",{className:e?"table-header--fixed":"",children:Qt.jsxs("tr",{children:[t.filter(t=>"color"!==t.campo).map((t,e)=>"boolean"!=typeof t.visible||t.visible?Qt.jsx("th",{className:(null==t?void 0:t.className)||"",style:{textAlign:he(t)},children:t.titulo},e):null),r&&Qt.jsx("th",{})]})}):null}function ge({colunas:t,acoes:e,opcoes:r,dados:n,colorir:o,getLineColor:i,onClick:a}){var s;const c=(null==(s=null==e?void 0:e.acoes)?void 0:s.length)||"auto";function u(t,e){let r="var(--bs-body-color)";return o&&e.color?e.color:(i&&(r=i(e)||r),r)}if(!n||0==(null==n?void 0:n.length))return null;function l(t){t.preventDefault(),t.stopPropagation()}return Qt.jsx("tbody",{children:null==n?void 0:n.map((n,o)=>{var i;return Qt.jsxs("tr",{role:a?"button":"",onClick:t=>a&&a(n,t),children:[null==t?void 0:t.map((t,e)=>{if("boolean"==typeof t.visible&&!t.visible)return null;let r=t.campoChave?65:t.largura||"auto";return t.campoChave&&t.largura&&(r=t.largura),Qt.jsx("td",{className:t.className||"",style:{textAlign:he(t),fontWeight:t.campoChave||t.bold?"bold":"normal",color:u(0,n),width:r},onClick:e=>{(null==t?void 0:t.onClick)&&(e.stopPropagation(),t.onClick(n))},role:(null==t?void 0:t.onClick)?"button":"",children:Qt.jsxs("div",{children:[t.titulo&&Qt.jsxs("span",{className:"titulo",children:[t.tituloCard||t.titulo,": "]}),de(t,n)]})},e)}),e&&(null==(i=e.acoes)?void 0:i.length)>0&&Qt.jsx("td",{className:"acoes",style:{width:c},onClick:l,children:Qt.jsxs("div",{className:"acoes-layout",children:[null==e?void 0:e.acoes.map((t,r)=>Qt.jsx("span",{onClick:()=>{var r,i;(null==(i=null==(r=null==t?void 0:t.botao)?void 0:r.props)?void 0:i.disabled)||t.funcao(n[e.campo],n,o)},children:t.botao},r)),r&&Qt.jsx("span",{children:Qt.jsx(fe,{items:r,size:"sm",title:"Opções",dados:n,children:Qt.jsx("i",{className:"fas fa-ellipsis-h"})})})]})})]},o)})})}o.div`
201
+ `,t.hasTableLineClick=!1;function fe(t,e){if("function"==typeof t.campo)return t.campo(e);if("string"==typeof t.campo){const n=e[t.campo];return t.campo2?Qt.jsxs("div",{className:"col-campo2",children:[Qt.jsx("div",{className:"fw-bold",children:n}),Qt.jsx("small",{className:"text-secondary",children:e[t.campo2]})]}):"date"==t.tipo?r.formatData(n):"datetime"==t.tipo?r.formatDataHora(n):"float"==t.tipo||"numeric"==t.tipo?r.formatValor(n,2,!1):"money"==t.tipo||"currency"==t.tipo||t.money?r.formatValor(n,2,!0):"boolean"==typeof n?Qt.jsx("input",{type:"checkbox",checked:n,readOnly:!0,className:"form-check-input",style:{marginTop:3,cursor:"default"}}):n}return null}const de=t=>{let e="left";return("float"===t.tipo||"currency"===t.tipo||t.money)&&(e="right"),t.campoChave&&(e="center"),t.align&&(e=t.align),e};function pe({colunas:t,fixedHeader:e,incColActions:r=!0}){return t?Qt.jsx("thead",{className:e?"table-header--fixed":"",children:Qt.jsxs("tr",{children:[t.filter(t=>"color"!==t.campo).map((t,e)=>"boolean"!=typeof t.visible||t.visible?Qt.jsx("th",{className:(null==t?void 0:t.className)||"",style:{textAlign:de(t)},children:t.titulo},e):null),r&&Qt.jsx("th",{})]})}):null}function ge({colunas:t,acoes:e,opcoes:r,dados:n,colorir:o,getLineColor:i,onClick:a}){var s;const u=(null==(s=null==e?void 0:e.acoes)?void 0:s.length)||"auto";function l(t,e){let r="var(--bs-body-color)";return o&&e.color?e.color:(i&&(r=i(e)||r),r)}if(!n||0==(null==n?void 0:n.length))return null;function c(t){t.preventDefault(),t.stopPropagation()}return Qt.jsx("tbody",{children:null==n?void 0:n.map((n,o)=>{var i;return Qt.jsxs("tr",{role:a?"button":"",onClick:t=>a&&a(n,t),children:[null==t?void 0:t.map((t,e)=>{if("boolean"==typeof t.visible&&!t.visible)return null;let r=t.campoChave?65:t.largura||"auto";return t.campoChave&&t.largura&&(r=t.largura),Qt.jsx("td",{className:t.className||"",style:{textAlign:de(t),fontWeight:t.campoChave||t.bold?"bold":"normal",color:l(0,n),width:r},onClick:e=>{(null==t?void 0:t.onClick)&&(e.stopPropagation(),t.onClick(n))},role:(null==t?void 0:t.onClick)?"button":"",children:Qt.jsxs("div",{children:[t.titulo&&Qt.jsxs("span",{className:"titulo",children:[t.tituloCard||t.titulo,": "]}),fe(t,n)]})},e)}),e&&(null==(i=e.acoes)?void 0:i.length)>0&&Qt.jsx("td",{className:"acoes",style:{width:u},onClick:c,children:Qt.jsxs("div",{className:"acoes-layout",children:[null==e?void 0:e.acoes.map((t,r)=>Qt.jsx("span",{onClick:()=>{var r,i;(null==(i=null==(r=null==t?void 0:t.botao)?void 0:r.props)?void 0:i.disabled)||t.funcao(n[e.campo],n,o)},children:t.botao},r)),r&&Qt.jsx("span",{children:Qt.jsx(he,{items:r,size:"sm",title:"Opções",dados:n,children:Qt.jsx("i",{className:"fas fa-ellipsis-h"})})})]})})]},o)})})}o.div`
202
202
  display: inline-block;
203
203
  width: 27px;
204
204
  height: 25px;
@@ -251,7 +251,7 @@
251
251
  border: 1px solid ${t=>t.checked?"#0067C0":"silver"};
252
252
  border-radius: 4px;
253
253
  cursor: ${t=>t.onClick?"pointer":"default"};
254
- `;const Ce=({...t})=>Qt.jsx("i",{className:"fas fa-sign-out-alt",...t}),Ae=()=>Qt.jsx("i",{className:"fa-solid fa-plus"}),Ee=()=>Qt.jsx("i",{className:"fas fa-pencil-alt"}),Ie=()=>Qt.jsx("i",{className:"fas fa-trash-alt"}),Se=()=>Qt.jsx("i",{className:"fas fa-search"}),Oe=()=>Qt.jsx("i",{className:"fa-solid fa-xmark"}),Te=()=>Qt.jsx("i",{className:"fa-solid fa-circle-question"}),Ne=({...t})=>Qt.jsx("i",{className:"fa-solid fa-arrow-up-right-from-square",...t}),xe=({...t})=>Qt.jsx("i",{className:"fa-solid fa-qrcode",...t});function Re({label:t,...e}){return Qt.jsxs("div",{className:"inp-color--container",children:[Qt.jsx("input",{type:"color",...e}),Qt.jsx("div",{children:t})]})}const De=o.div`
254
+ `;const Ce=({...t})=>Qt.jsx("i",{className:"fas fa-sign-out-alt",...t}),Ae=()=>Qt.jsx("i",{className:"fa-solid fa-plus"}),Ee=()=>Qt.jsx("i",{className:"fas fa-pencil-alt"}),Ie=()=>Qt.jsx("i",{className:"fas fa-trash-alt"}),Se=()=>Qt.jsx("i",{className:"fas fa-search"}),xe=()=>Qt.jsx("i",{className:"fa-solid fa-xmark"}),Oe=()=>Qt.jsx("i",{className:"fa-solid fa-circle-question"}),Te=({...t})=>Qt.jsx("i",{className:"fa-solid fa-arrow-up-right-from-square",...t}),Ne=({...t})=>Qt.jsx("i",{className:"fa-solid fa-qrcode",...t});function ke({label:t,...e}){return Qt.jsxs("div",{className:"inp-color--container",children:[Qt.jsx("input",{type:"color",...e}),Qt.jsx("div",{children:t})]})}const Re=o.div`
255
255
  margin: ${({noMargin:t})=>t?"0":"5px 0 8px"};
256
256
  border: 1px solid var(--bi-color-border);
257
257
  border-radius: ${t=>t.open?"0 0 var(--pn-border-radius) var(--pn-border-radius)":"0"};
@@ -320,7 +320,7 @@
320
320
  display: block;
321
321
  animation: slide-open 0.2s linear;
322
322
  }
323
- `;const Pe=o.button`
323
+ `;const De=o.button`
324
324
  --margin-hor: -10px;
325
325
 
326
326
  background-color: transparent;
@@ -363,7 +363,7 @@
363
363
  color: #ff4545;
364
364
  }
365
365
  }
366
- `,Me=({...t})=>Qt.jsx(Pe,{type:"button",title:"Fechar",className:"close",...t,children:Qt.jsx("i",{className:"fa-solid fa-xmark"})});function ke({...t}){return Qt.jsx(Pe,{type:"button",className:"btn-help",...t,children:Qt.jsx(Te,{})})}const Le=({...t})=>Qt.jsx(Pe,{type:"button",className:"back",...t,children:Qt.jsx("i",{className:"fa-solid fa-arrow-left"})}),je=o.div`
366
+ `,Pe=({...t})=>Qt.jsx(De,{type:"button",title:"Fechar",className:"close",...t,children:Qt.jsx("i",{className:"fa-solid fa-xmark"})});function Me({...t}){return Qt.jsx(De,{type:"button",className:"btn-help",...t,children:Qt.jsx(Oe,{})})}const Be=({...t})=>Qt.jsx(De,{type:"button",className:"back",...t,children:Qt.jsx("i",{className:"fa-solid fa-arrow-left"})}),Le=o.div`
367
367
  font-size: 1.4rem;
368
368
  line-height: 100%;
369
369
  color: #fff;
@@ -400,7 +400,7 @@
400
400
  @media (max-width: 340px) {
401
401
  right: calc(50vw - 24px);
402
402
  }
403
- `;let Be;function Fe(t){return t}function Ve(t){return Qt.jsx("svg",{fill:"none",viewBox:"0 0 24 24",height:"1em",width:"1em",...t,children:Qt.jsx("path",{fill:"currentColor",d:"M6.225 4.811a1 1 0 00-1.414 1.414L10.586 12 4.81 17.775a1 1 0 101.414 1.414L12 13.414l5.775 5.775a1 1 0 001.414-1.414L13.414 12l5.775-5.775a1 1 0 00-1.414-1.414L12 10.586 6.225 4.81z"})})}function He(t){return Qt.jsx("svg",{fill:"none",viewBox:"0 0 24 24",height:"1em",width:"1em",...t,children:Qt.jsx("path",{fill:"currentColor",d:"M2 6a1 1 0 011-1h18a1 1 0 110 2H3a1 1 0 01-1-1zM2 12.032a1 1 0 011-1h18a1 1 0 110 2H3a1 1 0 01-1-1zM3 17.064a1 1 0 100 2h18a1 1 0 000-2H3z"})})}const Ue=o.div`
403
+ `;let Fe;function je(t){return t}function Ve(t){return Qt.jsx("svg",{fill:"none",viewBox:"0 0 24 24",height:"1em",width:"1em",...t,children:Qt.jsx("path",{fill:"currentColor",d:"M6.225 4.811a1 1 0 00-1.414 1.414L10.586 12 4.81 17.775a1 1 0 101.414 1.414L12 13.414l5.775 5.775a1 1 0 001.414-1.414L13.414 12l5.775-5.775a1 1 0 00-1.414-1.414L12 10.586 6.225 4.81z"})})}function Ue(t){return Qt.jsx("svg",{fill:"none",viewBox:"0 0 24 24",height:"1em",width:"1em",...t,children:Qt.jsx("path",{fill:"currentColor",d:"M2 6a1 1 0 011-1h18a1 1 0 110 2H3a1 1 0 01-1-1zM2 12.032a1 1 0 011-1h18a1 1 0 110 2H3a1 1 0 01-1-1zM3 17.064a1 1 0 100 2h18a1 1 0 000-2H3z"})})}const He=o.div`
404
404
  --pn-internal-radius: calc(var(--pn-border-radius) - 1px);
405
405
 
406
406
  display: flex;
@@ -433,13 +433,13 @@
433
433
  display: none;
434
434
  }
435
435
  }
436
- `;function We({value:t,isCount:e,...r}){let n;return n="number"==typeof t?e?Math.min(t,9999):t<=0?"Inclusão":`#${t}`:t,Qt.jsx("div",{className:"badge bg-info text-dark",style:{borderRadius:"var(--pn-border-radius)"},...r,children:n})}let ze="/home";function Ge({title:t,count:e,codigo:r,goBack:n,goHome:o,onClose:i,children:s,maxWidth:c,className:u="",helpLink:l="",...f}){const d=a.useHistory(),h=e&&"number"==typeof e?e:0,p=h>9999?"9999+":h,g=Intl.NumberFormat("pt-br",{}).format(h),m=()=>{if(i)return i();n?d.goBack():d.push(ze)},v=f.style||{};return c&&(v.maxWidth=c,f.style=v),Qt.jsxs("div",{className:"panel--container "+u,...f,children:[Qt.jsxs(Ue,{children:[Qt.jsx("div",{className:"d-none d-sm-block",children:(n||o||i)&&Qt.jsx(Le,{title:"Fechar",onClick:m})}),Qt.jsxs("div",{className:"pn-title",children:[t,0!==h&&Qt.jsx(We,{title:`Total de registros: ${g}`,value:p,isCount:!0}),Qt.jsx(We,{value:r})]}),l&&Qt.jsx(ke,{title:"Ir para ajuda",onClick:()=>window.open(l,"_blank")}),(n||o||i)&&Qt.jsx(Me,{title:"Fechar",onClick:m})]}),Qt.jsx("div",{className:"pn-body",children:s})]})}function Xe({fileTo:t,previewUrl:n,visible:o,setVisible:i}){const{addModal:a,removeModal:s}=ee(),[c]=e.useState("preview-"+r.random());return e.useEffect(()=>(o||s(c),()=>s(c)),[o]),e.useEffect(()=>{a(c,i)},[c]),Qt.jsxs("div",{className:"pr-box",children:[Qt.jsxs("div",{className:"pr-box--header",children:[Qt.jsxs("div",{className:"pr-box--title",children:[Qt.jsxs("div",{className:"pr-box--name",children:[Qt.jsx("div",{children:"Visualizar relatório:"}),Qt.jsx("div",{className:"fw-bold",children:t})]}),Qt.jsx("div",{children:Qt.jsxs("a",{href:n,download:t,children:[Qt.jsx("i",{className:"fa-solid fa-download me-2"}),"Salvar relatório"]})})]}),Qt.jsx("button",{className:"ms-4 btn btn-danger rounded-pill",onClick:i,children:Qt.jsx(Oe,{})})]}),Qt.jsx("iframe",{className:"pr-box--preview",src:n})]})}function $e(t){throw new Error('Could not dynamically require "'+t+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var Ye={exports:{}};
436
+ `;function ze({value:t,isCount:e,...r}){let n;return n="number"==typeof t?e?Math.min(t,9999):t<=0?"Inclusão":`#${t}`:t,Qt.jsx("div",{className:"badge bg-info text-dark",style:{borderRadius:"var(--pn-border-radius)"},...r,children:n})}let We="/home";function Ge({title:t,count:e,codigo:r,goBack:n,goHome:o,onClose:i,children:s,maxWidth:u,className:l="",helpLink:c="",...h}){const f=a.useHistory(),d=e&&"number"==typeof e?e:0,p=d>9999?"9999+":d,g=Intl.NumberFormat("pt-br",{}).format(d),m=()=>{if(i)return i();n?f.goBack():f.push(We)},v=h.style||{};return u&&(v.maxWidth=u,h.style=v),Qt.jsxs("div",{className:"panel--container "+l,...h,children:[Qt.jsxs(He,{children:[Qt.jsx("div",{className:"d-none d-sm-block",children:(n||o||i)&&Qt.jsx(Be,{title:"Fechar",onClick:m})}),Qt.jsxs("div",{className:"pn-title",children:[t,0!==d&&Qt.jsx(ze,{title:`Total de registros: ${g}`,value:p,isCount:!0}),Qt.jsx(ze,{value:r})]}),c&&Qt.jsx(Me,{title:"Ir para ajuda",onClick:()=>window.open(c,"_blank")}),(n||o||i)&&Qt.jsx(Pe,{title:"Fechar",onClick:m})]}),Qt.jsx("div",{className:"pn-body",children:s})]})}function Xe({fileTo:t,previewUrl:n,visible:o,setVisible:i}){const{addModal:a,removeModal:s}=ee(),[u]=e.useState("preview-"+r.random());return e.useEffect(()=>(o||s(u),()=>s(u)),[o]),e.useEffect(()=>{a(u,i)},[u]),Qt.jsxs("div",{className:"pr-box",children:[Qt.jsxs("div",{className:"pr-box--header",children:[Qt.jsxs("div",{className:"pr-box--title",children:[Qt.jsxs("div",{className:"pr-box--name",children:[Qt.jsx("div",{children:"Visualizar relatório:"}),Qt.jsx("div",{className:"fw-bold",children:t})]}),Qt.jsx("div",{children:Qt.jsxs("a",{href:n,download:t,children:[Qt.jsx("i",{className:"fa-solid fa-download me-2"}),"Salvar relatório"]})})]}),Qt.jsx("button",{className:"ms-4 btn btn-danger rounded-pill",onClick:i,children:Qt.jsx(xe,{})})]}),Qt.jsx("iframe",{className:"pr-box--preview",src:n})]})}function $e(t){throw new Error('Could not dynamically require "'+t+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var Ye={exports:{}};
437
437
  /*!
438
438
  localForage -- Offline Storage, Improved
439
439
  Version 1.10.0
440
440
  https://localforage.github.io/localForage
441
441
  (c) 2013-2017 Mozilla, Apache License 2.0
442
- */!function(t){t.exports=function t(e,r,n){function o(a,s){if(!r[a]){if(!e[a]){if(!s&&$e)return $e(a);if(i)return i(a,!0);var c=new Error("Cannot find module '"+a+"'");throw c.code="MODULE_NOT_FOUND",c}var u=r[a]={exports:{}};e[a][0].call(u.exports,function(t){var r=e[a][1][t];return o(r||t)},u,u.exports,t,e,r,n)}return r[a].exports}for(var i=$e,a=0;a<n.length;a++)o(n[a]);return o}({1:[function(t,e,r){(function(t){var r,n,o=t.MutationObserver||t.WebKitMutationObserver;if(o){var i=0,a=new o(l),s=t.document.createTextNode("");a.observe(s,{characterData:!0}),r=function(){s.data=i=++i%2}}else if(t.setImmediate||void 0===t.MessageChannel)r="document"in t&&"onreadystatechange"in t.document.createElement("script")?function(){var e=t.document.createElement("script");e.onreadystatechange=function(){l(),e.onreadystatechange=null,e.parentNode.removeChild(e),e=null},t.document.documentElement.appendChild(e)}:function(){setTimeout(l,0)};else{var c=new t.MessageChannel;c.port1.onmessage=l,r=function(){c.port2.postMessage(0)}}var u=[];function l(){var t,e;n=!0;for(var r=u.length;r;){for(e=u,u=[],t=-1;++t<r;)e[t]();r=u.length}n=!1}function f(t){1!==u.push(t)||n||r()}e.exports=f}).call(this,void 0!==d?d:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],2:[function(t,e,r){var n=t(1);function o(){}var i={},a=["REJECTED"],s=["FULFILLED"],c=["PENDING"];function u(t){if("function"!=typeof t)throw new TypeError("resolver must be a function");this.state=c,this.queue=[],this.outcome=void 0,t!==o&&h(this,t)}function l(t,e,r){this.promise=t,"function"==typeof e&&(this.onFulfilled=e,this.callFulfilled=this.otherCallFulfilled),"function"==typeof r&&(this.onRejected=r,this.callRejected=this.otherCallRejected)}function f(t,e,r){n(function(){var n;try{n=e(r)}catch(o){return i.reject(t,o)}n===t?i.reject(t,new TypeError("Cannot resolve promise with itself")):i.resolve(t,n)})}function d(t){var e=t&&t.then;if(t&&("object"==typeof t||"function"==typeof t)&&"function"==typeof e)return function(){e.apply(t,arguments)}}function h(t,e){var r=!1;function n(e){r||(r=!0,i.reject(t,e))}function o(e){r||(r=!0,i.resolve(t,e))}function a(){e(o,n)}var s=p(a);"error"===s.status&&n(s.value)}function p(t,e){var r={};try{r.value=t(e),r.status="success"}catch(n){r.status="error",r.value=n}return r}function g(t){return t instanceof this?t:i.resolve(new this(o),t)}function m(t){var e=new this(o);return i.reject(e,t)}function v(t){var e=this;if("[object Array]"!==Object.prototype.toString.call(t))return this.reject(new TypeError("must be an array"));var r=t.length,n=!1;if(!r)return this.resolve([]);for(var a=new Array(r),s=0,c=-1,u=new this(o);++c<r;)l(t[c],c);return u;function l(t,o){function c(t){a[o]=t,++s!==r||n||(n=!0,i.resolve(u,a))}e.resolve(t).then(c,function(t){n||(n=!0,i.reject(u,t))})}}function y(t){var e=this;if("[object Array]"!==Object.prototype.toString.call(t))return this.reject(new TypeError("must be an array"));var r=t.length,n=!1;if(!r)return this.resolve([]);for(var a=-1,s=new this(o);++a<r;)c(t[a]);return s;function c(t){e.resolve(t).then(function(t){n||(n=!0,i.resolve(s,t))},function(t){n||(n=!0,i.reject(s,t))})}}e.exports=u,u.prototype.catch=function(t){return this.then(null,t)},u.prototype.then=function(t,e){if("function"!=typeof t&&this.state===s||"function"!=typeof e&&this.state===a)return this;var r=new this.constructor(o);return this.state!==c?f(r,this.state===s?t:e,this.outcome):this.queue.push(new l(r,t,e)),r},l.prototype.callFulfilled=function(t){i.resolve(this.promise,t)},l.prototype.otherCallFulfilled=function(t){f(this.promise,this.onFulfilled,t)},l.prototype.callRejected=function(t){i.reject(this.promise,t)},l.prototype.otherCallRejected=function(t){f(this.promise,this.onRejected,t)},i.resolve=function(t,e){var r=p(d,e);if("error"===r.status)return i.reject(t,r.value);var n=r.value;if(n)h(t,n);else{t.state=s,t.outcome=e;for(var o=-1,a=t.queue.length;++o<a;)t.queue[o].callFulfilled(e)}return t},i.reject=function(t,e){t.state=a,t.outcome=e;for(var r=-1,n=t.queue.length;++r<n;)t.queue[r].callRejected(e);return t},u.resolve=g,u.reject=m,u.all=v,u.race=y},{1:1}],3:[function(t,e,r){(function(e){"function"!=typeof e.Promise&&(e.Promise=t(2))}).call(this,void 0!==d?d:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{2:2}],4:[function(t,e,r){var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(){try{if("undefined"!=typeof indexedDB)return indexedDB;if("undefined"!=typeof webkitIndexedDB)return webkitIndexedDB;if("undefined"!=typeof mozIndexedDB)return mozIndexedDB;if("undefined"!=typeof OIndexedDB)return OIndexedDB;if("undefined"!=typeof msIndexedDB)return msIndexedDB}catch(t){return}}var a=i();function s(){try{if(!a||!a.open)return!1;var t="undefined"!=typeof openDatabase&&/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),e="function"==typeof fetch&&-1!==fetch.toString().indexOf("[native code");return(!t||e)&&"undefined"!=typeof indexedDB&&"undefined"!=typeof IDBKeyRange}catch(r){return!1}}function c(t,e){t=t||[],e=e||{};try{return new Blob(t,e)}catch(o){if("TypeError"!==o.name)throw o;for(var r=new("undefined"!=typeof BlobBuilder?BlobBuilder:"undefined"!=typeof MSBlobBuilder?MSBlobBuilder:"undefined"!=typeof MozBlobBuilder?MozBlobBuilder:WebKitBlobBuilder),n=0;n<t.length;n+=1)r.append(t[n]);return r.getBlob(e.type)}}"undefined"==typeof Promise&&t(3);var u=Promise;function l(t,e){e&&t.then(function(t){e(null,t)},function(t){e(t)})}function f(t,e,r){"function"==typeof e&&t.then(e),"function"==typeof r&&t.catch(r)}function d(t){return"string"!=typeof t&&(console.warn(t+" used as a key, but it is not a string."),t=String(t)),t}function h(){if(arguments.length&&"function"==typeof arguments[arguments.length-1])return arguments[arguments.length-1]}var p="local-forage-detect-blob-support",g=void 0,m={},v=Object.prototype.toString,y="readonly",_="readwrite";function w(t){for(var e=t.length,r=new ArrayBuffer(e),n=new Uint8Array(r),o=0;o<e;o++)n[o]=t.charCodeAt(o);return r}function b(t){return new u(function(e){var r=t.transaction(p,_),n=c([""]);r.objectStore(p).put(n,"key"),r.onabort=function(t){t.preventDefault(),t.stopPropagation(),e(!1)},r.oncomplete=function(){var t=navigator.userAgent.match(/Chrome\/(\d+)/),r=navigator.userAgent.match(/Edge\//);e(r||!t||parseInt(t[1],10)>=43)}}).catch(function(){return!1})}function C(t){return"boolean"==typeof g?u.resolve(g):b(t).then(function(t){return g=t})}function A(t){var e=m[t.name],r={};r.promise=new u(function(t,e){r.resolve=t,r.reject=e}),e.deferredOperations.push(r),e.dbReady?e.dbReady=e.dbReady.then(function(){return r.promise}):e.dbReady=r.promise}function E(t){var e=m[t.name].deferredOperations.pop();if(e)return e.resolve(),e.promise}function I(t,e){var r=m[t.name].deferredOperations.pop();if(r)return r.reject(e),r.promise}function S(t,e){return new u(function(r,n){if(m[t.name]=m[t.name]||L(),t.db){if(!e)return r(t.db);A(t),t.db.close()}var o=[t.name];e&&o.push(t.version);var i=a.open.apply(a,o);e&&(i.onupgradeneeded=function(e){var r=i.result;try{r.createObjectStore(t.storeName),e.oldVersion<=1&&r.createObjectStore(p)}catch(n){if("ConstraintError"!==n.name)throw n;console.warn('The database "'+t.name+'" has been upgraded from version '+e.oldVersion+" to version "+e.newVersion+', but the storage "'+t.storeName+'" already exists.')}}),i.onerror=function(t){t.preventDefault(),n(i.error)},i.onsuccess=function(){var e=i.result;e.onversionchange=function(t){t.target.close()},r(e),E(t)}})}function O(t){return S(t,!1)}function T(t){return S(t,!0)}function N(t,e){if(!t.db)return!0;var r=!t.db.objectStoreNames.contains(t.storeName),n=t.version<t.db.version,o=t.version>t.db.version;if(n&&(t.version!==e&&console.warn('The database "'+t.name+"\" can't be downgraded from version "+t.db.version+" to version "+t.version+"."),t.version=t.db.version),o||r){if(r){var i=t.db.version+1;i>t.version&&(t.version=i)}return!0}return!1}function x(t){return new u(function(e,r){var n=new FileReader;n.onerror=r,n.onloadend=function(r){var n=btoa(r.target.result||"");e({__local_forage_encoded_blob:!0,data:n,type:t.type})},n.readAsBinaryString(t)})}function R(t){return c([w(atob(t.data))],{type:t.type})}function D(t){return t&&t.__local_forage_encoded_blob}function P(t){var e=this,r=e._initReady().then(function(){var t=m[e._dbInfo.name];if(t&&t.dbReady)return t.dbReady});return f(r,t,t),r}function M(t){A(t);for(var e=m[t.name],r=e.forages,n=0;n<r.length;n++){var o=r[n];o._dbInfo.db&&(o._dbInfo.db.close(),o._dbInfo.db=null)}return t.db=null,O(t).then(function(e){return t.db=e,N(t)?T(t):e}).then(function(n){t.db=e.db=n;for(var o=0;o<r.length;o++)r[o]._dbInfo.db=n}).catch(function(e){throw I(t,e),e})}function k(t,e,r,n){void 0===n&&(n=1);try{var o=t.db.transaction(t.storeName,e);r(null,o)}catch(i){if(n>0&&(!t.db||"InvalidStateError"===i.name||"NotFoundError"===i.name))return u.resolve().then(function(){if(!t.db||"NotFoundError"===i.name&&!t.db.objectStoreNames.contains(t.storeName)&&t.version<=t.db.version)return t.db&&(t.version=t.db.version+1),T(t)}).then(function(){return M(t).then(function(){k(t,e,r,n-1)})}).catch(r);r(i)}}function L(){return{forages:[],db:null,dbReady:null,deferredOperations:[]}}function j(t){var e=this,r={db:null};if(t)for(var n in t)r[n]=t[n];var o=m[r.name];o||(o=L(),m[r.name]=o),o.forages.push(e),e._initReady||(e._initReady=e.ready,e.ready=P);var i=[];function a(){return u.resolve()}for(var s=0;s<o.forages.length;s++){var c=o.forages[s];c!==e&&i.push(c._initReady().catch(a))}var l=o.forages.slice(0);return u.all(i).then(function(){return r.db=o.db,O(r)}).then(function(t){return r.db=t,N(r,e._defaultConfig.version)?T(r):t}).then(function(t){r.db=o.db=t,e._dbInfo=r;for(var n=0;n<l.length;n++){var i=l[n];i!==e&&(i._dbInfo.db=r.db,i._dbInfo.version=r.version)}})}function B(t,e){var r=this;t=d(t);var n=new u(function(e,n){r.ready().then(function(){k(r._dbInfo,y,function(o,i){if(o)return n(o);try{var a=i.objectStore(r._dbInfo.storeName).get(t);a.onsuccess=function(){var t=a.result;void 0===t&&(t=null),D(t)&&(t=R(t)),e(t)},a.onerror=function(){n(a.error)}}catch(s){n(s)}})}).catch(n)});return l(n,e),n}function F(t,e){var r=this,n=new u(function(e,n){r.ready().then(function(){k(r._dbInfo,y,function(o,i){if(o)return n(o);try{var a=i.objectStore(r._dbInfo.storeName).openCursor(),s=1;a.onsuccess=function(){var r=a.result;if(r){var n=r.value;D(n)&&(n=R(n));var o=t(n,r.key,s++);void 0!==o?e(o):r.continue()}else e()},a.onerror=function(){n(a.error)}}catch(c){n(c)}})}).catch(n)});return l(n,e),n}function V(t,e,r){var n=this;t=d(t);var o=new u(function(r,o){var i;n.ready().then(function(){return i=n._dbInfo,"[object Blob]"===v.call(e)?C(i.db).then(function(t){return t?e:x(e)}):e}).then(function(e){k(n._dbInfo,_,function(i,a){if(i)return o(i);try{var s=a.objectStore(n._dbInfo.storeName);null===e&&(e=void 0);var c=s.put(e,t);a.oncomplete=function(){void 0===e&&(e=null),r(e)},a.onabort=a.onerror=function(){var t=c.error?c.error:c.transaction.error;o(t)}}catch(u){o(u)}})}).catch(o)});return l(o,r),o}function H(t,e){var r=this;t=d(t);var n=new u(function(e,n){r.ready().then(function(){k(r._dbInfo,_,function(o,i){if(o)return n(o);try{var a=i.objectStore(r._dbInfo.storeName).delete(t);i.oncomplete=function(){e()},i.onerror=function(){n(a.error)},i.onabort=function(){var t=a.error?a.error:a.transaction.error;n(t)}}catch(s){n(s)}})}).catch(n)});return l(n,e),n}function U(t){var e=this,r=new u(function(t,r){e.ready().then(function(){k(e._dbInfo,_,function(n,o){if(n)return r(n);try{var i=o.objectStore(e._dbInfo.storeName).clear();o.oncomplete=function(){t()},o.onabort=o.onerror=function(){var t=i.error?i.error:i.transaction.error;r(t)}}catch(a){r(a)}})}).catch(r)});return l(r,t),r}function W(t){var e=this,r=new u(function(t,r){e.ready().then(function(){k(e._dbInfo,y,function(n,o){if(n)return r(n);try{var i=o.objectStore(e._dbInfo.storeName).count();i.onsuccess=function(){t(i.result)},i.onerror=function(){r(i.error)}}catch(a){r(a)}})}).catch(r)});return l(r,t),r}function z(t,e){var r=this,n=new u(function(e,n){t<0?e(null):r.ready().then(function(){k(r._dbInfo,y,function(o,i){if(o)return n(o);try{var a=i.objectStore(r._dbInfo.storeName),s=!1,c=a.openKeyCursor();c.onsuccess=function(){var r=c.result;r?0===t||s?e(r.key):(s=!0,r.advance(t)):e(null)},c.onerror=function(){n(c.error)}}catch(u){n(u)}})}).catch(n)});return l(n,e),n}function G(t){var e=this,r=new u(function(t,r){e.ready().then(function(){k(e._dbInfo,y,function(n,o){if(n)return r(n);try{var i=o.objectStore(e._dbInfo.storeName).openKeyCursor(),a=[];i.onsuccess=function(){var e=i.result;e?(a.push(e.key),e.continue()):t(a)},i.onerror=function(){r(i.error)}}catch(s){r(s)}})}).catch(r)});return l(r,t),r}function X(t,e){e=h.apply(this,arguments);var r=this.config();(t="function"!=typeof t&&t||{}).name||(t.name=t.name||r.name,t.storeName=t.storeName||r.storeName);var n,o=this;if(t.name){var i=t.name===r.name&&o._dbInfo.db?u.resolve(o._dbInfo.db):O(t).then(function(e){var r=m[t.name],n=r.forages;r.db=e;for(var o=0;o<n.length;o++)n[o]._dbInfo.db=e;return e});n=t.storeName?i.then(function(e){if(e.objectStoreNames.contains(t.storeName)){var r=e.version+1;A(t);var n=m[t.name],o=n.forages;e.close();for(var i=0;i<o.length;i++){var s=o[i];s._dbInfo.db=null,s._dbInfo.version=r}return new u(function(e,n){var o=a.open(t.name,r);o.onerror=function(t){o.result.close(),n(t)},o.onupgradeneeded=function(){o.result.deleteObjectStore(t.storeName)},o.onsuccess=function(){var t=o.result;t.close(),e(t)}}).then(function(t){n.db=t;for(var e=0;e<o.length;e++){var r=o[e];r._dbInfo.db=t,E(r._dbInfo)}}).catch(function(e){throw(I(t,e)||u.resolve()).catch(function(){}),e})}}):i.then(function(e){A(t);var r=m[t.name],n=r.forages;e.close();for(var o=0;o<n.length;o++)n[o]._dbInfo.db=null;return new u(function(e,r){var n=a.deleteDatabase(t.name);n.onerror=function(){var t=n.result;t&&t.close(),r(n.error)},n.onblocked=function(){console.warn('dropInstance blocked for database "'+t.name+'" until all open connections are closed')},n.onsuccess=function(){var t=n.result;t&&t.close(),e(t)}}).then(function(t){r.db=t;for(var e=0;e<n.length;e++)E(n[e]._dbInfo)}).catch(function(e){throw(I(t,e)||u.resolve()).catch(function(){}),e})})}else n=u.reject("Invalid arguments");return l(n,e),n}var $={_driver:"asyncStorage",_initStorage:j,_support:s(),iterate:F,getItem:B,setItem:V,removeItem:H,clear:U,length:W,key:z,keys:G,dropInstance:X};function Y(){return"function"==typeof openDatabase}var q="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",K="~~local_forage_type~",Z=/^~~local_forage_type~([^~]+)~/,Q="__lfsc__:",J=Q.length,tt="arbf",et="blob",rt="si08",nt="ui08",ot="uic8",it="si16",at="si32",st="ur16",ct="ui32",ut="fl32",lt="fl64",ft=J+tt.length,dt=Object.prototype.toString;function ht(t){var e,r,n,o,i,a=.75*t.length,s=t.length,c=0;"="===t[t.length-1]&&(a--,"="===t[t.length-2]&&a--);var u=new ArrayBuffer(a),l=new Uint8Array(u);for(e=0;e<s;e+=4)r=q.indexOf(t[e]),n=q.indexOf(t[e+1]),o=q.indexOf(t[e+2]),i=q.indexOf(t[e+3]),l[c++]=r<<2|n>>4,l[c++]=(15&n)<<4|o>>2,l[c++]=(3&o)<<6|63&i;return u}function pt(t){var e,r=new Uint8Array(t),n="";for(e=0;e<r.length;e+=3)n+=q[r[e]>>2],n+=q[(3&r[e])<<4|r[e+1]>>4],n+=q[(15&r[e+1])<<2|r[e+2]>>6],n+=q[63&r[e+2]];return r.length%3==2?n=n.substring(0,n.length-1)+"=":r.length%3==1&&(n=n.substring(0,n.length-2)+"=="),n}function gt(t,e){var r="";if(t&&(r=dt.call(t)),t&&("[object ArrayBuffer]"===r||t.buffer&&"[object ArrayBuffer]"===dt.call(t.buffer))){var n,o=Q;t instanceof ArrayBuffer?(n=t,o+=tt):(n=t.buffer,"[object Int8Array]"===r?o+=rt:"[object Uint8Array]"===r?o+=nt:"[object Uint8ClampedArray]"===r?o+=ot:"[object Int16Array]"===r?o+=it:"[object Uint16Array]"===r?o+=st:"[object Int32Array]"===r?o+=at:"[object Uint32Array]"===r?o+=ct:"[object Float32Array]"===r?o+=ut:"[object Float64Array]"===r?o+=lt:e(new Error("Failed to get type for BinaryArray"))),e(o+pt(n))}else if("[object Blob]"===r){var i=new FileReader;i.onload=function(){var r=K+t.type+"~"+pt(this.result);e(Q+et+r)},i.readAsArrayBuffer(t)}else try{e(JSON.stringify(t))}catch(a){console.error("Couldn't convert value into a JSON string: ",t),e(null,a)}}function mt(t){if(t.substring(0,J)!==Q)return JSON.parse(t);var e,r=t.substring(ft),n=t.substring(J,ft);if(n===et&&Z.test(r)){var o=r.match(Z);e=o[1],r=r.substring(o[0].length)}var i=ht(r);switch(n){case tt:return i;case et:return c([i],{type:e});case rt:return new Int8Array(i);case nt:return new Uint8Array(i);case ot:return new Uint8ClampedArray(i);case it:return new Int16Array(i);case st:return new Uint16Array(i);case at:return new Int32Array(i);case ct:return new Uint32Array(i);case ut:return new Float32Array(i);case lt:return new Float64Array(i);default:throw new Error("Unkown type: "+n)}}var vt={serialize:gt,deserialize:mt,stringToBuffer:ht,bufferToString:pt};function yt(t,e,r,n){t.executeSql("CREATE TABLE IF NOT EXISTS "+e.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],r,n)}function _t(t){var e=this,r={db:null};if(t)for(var n in t)r[n]="string"!=typeof t[n]?t[n].toString():t[n];var o=new u(function(t,n){try{r.db=openDatabase(r.name,String(r.version),r.description,r.size)}catch(o){return n(o)}r.db.transaction(function(o){yt(o,r,function(){e._dbInfo=r,t()},function(t,e){n(e)})},n)});return r.serializer=vt,o}function wt(t,e,r,n,o,i){t.executeSql(r,n,o,function(t,a){a.code===a.SYNTAX_ERR?t.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[e.storeName],function(t,s){s.rows.length?i(t,a):yt(t,e,function(){t.executeSql(r,n,o,i)},i)},i):i(t,a)},i)}function bt(t,e){var r=this;t=d(t);var n=new u(function(e,n){r.ready().then(function(){var o=r._dbInfo;o.db.transaction(function(r){wt(r,o,"SELECT * FROM "+o.storeName+" WHERE key = ? LIMIT 1",[t],function(t,r){var n=r.rows.length?r.rows.item(0).value:null;n&&(n=o.serializer.deserialize(n)),e(n)},function(t,e){n(e)})})}).catch(n)});return l(n,e),n}function Ct(t,e){var r=this,n=new u(function(e,n){r.ready().then(function(){var o=r._dbInfo;o.db.transaction(function(r){wt(r,o,"SELECT * FROM "+o.storeName,[],function(r,n){for(var i=n.rows,a=i.length,s=0;s<a;s++){var c=i.item(s),u=c.value;if(u&&(u=o.serializer.deserialize(u)),void 0!==(u=t(u,c.key,s+1)))return void e(u)}e()},function(t,e){n(e)})})}).catch(n)});return l(n,e),n}function At(t,e,r,n){var o=this;t=d(t);var i=new u(function(i,a){o.ready().then(function(){void 0===e&&(e=null);var s=e,c=o._dbInfo;c.serializer.serialize(e,function(e,u){u?a(u):c.db.transaction(function(r){wt(r,c,"INSERT OR REPLACE INTO "+c.storeName+" (key, value) VALUES (?, ?)",[t,e],function(){i(s)},function(t,e){a(e)})},function(e){if(e.code===e.QUOTA_ERR){if(n>0)return void i(At.apply(o,[t,s,r,n-1]));a(e)}})})}).catch(a)});return l(i,r),i}function Et(t,e,r){return At.apply(this,[t,e,r,1])}function It(t,e){var r=this;t=d(t);var n=new u(function(e,n){r.ready().then(function(){var o=r._dbInfo;o.db.transaction(function(r){wt(r,o,"DELETE FROM "+o.storeName+" WHERE key = ?",[t],function(){e()},function(t,e){n(e)})})}).catch(n)});return l(n,e),n}function St(t){var e=this,r=new u(function(t,r){e.ready().then(function(){var n=e._dbInfo;n.db.transaction(function(e){wt(e,n,"DELETE FROM "+n.storeName,[],function(){t()},function(t,e){r(e)})})}).catch(r)});return l(r,t),r}function Ot(t){var e=this,r=new u(function(t,r){e.ready().then(function(){var n=e._dbInfo;n.db.transaction(function(e){wt(e,n,"SELECT COUNT(key) as c FROM "+n.storeName,[],function(e,r){var n=r.rows.item(0).c;t(n)},function(t,e){r(e)})})}).catch(r)});return l(r,t),r}function Tt(t,e){var r=this,n=new u(function(e,n){r.ready().then(function(){var o=r._dbInfo;o.db.transaction(function(r){wt(r,o,"SELECT key FROM "+o.storeName+" WHERE id = ? LIMIT 1",[t+1],function(t,r){var n=r.rows.length?r.rows.item(0).key:null;e(n)},function(t,e){n(e)})})}).catch(n)});return l(n,e),n}function Nt(t){var e=this,r=new u(function(t,r){e.ready().then(function(){var n=e._dbInfo;n.db.transaction(function(e){wt(e,n,"SELECT key FROM "+n.storeName,[],function(e,r){for(var n=[],o=0;o<r.rows.length;o++)n.push(r.rows.item(o).key);t(n)},function(t,e){r(e)})})}).catch(r)});return l(r,t),r}function xt(t){return new u(function(e,r){t.transaction(function(n){n.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],function(r,n){for(var o=[],i=0;i<n.rows.length;i++)o.push(n.rows.item(i).name);e({db:t,storeNames:o})},function(t,e){r(e)})},function(t){r(t)})})}function Rt(t,e){e=h.apply(this,arguments);var r=this.config();(t="function"!=typeof t&&t||{}).name||(t.name=t.name||r.name,t.storeName=t.storeName||r.storeName);var n,o=this;return l(n=t.name?new u(function(e){var n;n=t.name===r.name?o._dbInfo.db:openDatabase(t.name,"","",0),t.storeName?e({db:n,storeNames:[t.storeName]}):e(xt(n))}).then(function(t){return new u(function(e,r){t.db.transaction(function(n){function o(t){return new u(function(e,r){n.executeSql("DROP TABLE IF EXISTS "+t,[],function(){e()},function(t,e){r(e)})})}for(var i=[],a=0,s=t.storeNames.length;a<s;a++)i.push(o(t.storeNames[a]));u.all(i).then(function(){e()}).catch(function(t){r(t)})},function(t){r(t)})})}):u.reject("Invalid arguments"),e),n}var Dt={_driver:"webSQLStorage",_initStorage:_t,_support:Y(),iterate:Ct,getItem:bt,setItem:Et,removeItem:It,clear:St,length:Ot,key:Tt,keys:Nt,dropInstance:Rt};function Pt(){try{return"undefined"!=typeof localStorage&&"setItem"in localStorage&&!!localStorage.setItem}catch(t){return!1}}function Mt(t,e){var r=t.name+"/";return t.storeName!==e.storeName&&(r+=t.storeName+"/"),r}function kt(){var t="_localforage_support_test";try{return localStorage.setItem(t,!0),localStorage.removeItem(t),!1}catch(e){return!0}}function Lt(){return!kt()||localStorage.length>0}function jt(t){var e=this,r={};if(t)for(var n in t)r[n]=t[n];return r.keyPrefix=Mt(t,e._defaultConfig),Lt()?(e._dbInfo=r,r.serializer=vt,u.resolve()):u.reject()}function Bt(t){var e=this,r=e.ready().then(function(){for(var t=e._dbInfo.keyPrefix,r=localStorage.length-1;r>=0;r--){var n=localStorage.key(r);0===n.indexOf(t)&&localStorage.removeItem(n)}});return l(r,t),r}function Ft(t,e){var r=this;t=d(t);var n=r.ready().then(function(){var e=r._dbInfo,n=localStorage.getItem(e.keyPrefix+t);return n&&(n=e.serializer.deserialize(n)),n});return l(n,e),n}function Vt(t,e){var r=this,n=r.ready().then(function(){for(var e=r._dbInfo,n=e.keyPrefix,o=n.length,i=localStorage.length,a=1,s=0;s<i;s++){var c=localStorage.key(s);if(0===c.indexOf(n)){var u=localStorage.getItem(c);if(u&&(u=e.serializer.deserialize(u)),void 0!==(u=t(u,c.substring(o),a++)))return u}}});return l(n,e),n}function Ht(t,e){var r=this,n=r.ready().then(function(){var e,n=r._dbInfo;try{e=localStorage.key(t)}catch(o){e=null}return e&&(e=e.substring(n.keyPrefix.length)),e});return l(n,e),n}function Ut(t){var e=this,r=e.ready().then(function(){for(var t=e._dbInfo,r=localStorage.length,n=[],o=0;o<r;o++){var i=localStorage.key(o);0===i.indexOf(t.keyPrefix)&&n.push(i.substring(t.keyPrefix.length))}return n});return l(r,t),r}function Wt(t){var e=this.keys().then(function(t){return t.length});return l(e,t),e}function zt(t,e){var r=this;t=d(t);var n=r.ready().then(function(){var e=r._dbInfo;localStorage.removeItem(e.keyPrefix+t)});return l(n,e),n}function Gt(t,e,r){var n=this;t=d(t);var o=n.ready().then(function(){void 0===e&&(e=null);var r=e;return new u(function(o,i){var a=n._dbInfo;a.serializer.serialize(e,function(e,n){if(n)i(n);else try{localStorage.setItem(a.keyPrefix+t,e),o(r)}catch(s){"QuotaExceededError"!==s.name&&"NS_ERROR_DOM_QUOTA_REACHED"!==s.name||i(s),i(s)}})})});return l(o,r),o}function Xt(t,e){if(e=h.apply(this,arguments),!(t="function"!=typeof t&&t||{}).name){var r=this.config();t.name=t.name||r.name,t.storeName=t.storeName||r.storeName}var n,o=this;return l(n=t.name?new u(function(e){t.storeName?e(Mt(t,o._defaultConfig)):e(t.name+"/")}).then(function(t){for(var e=localStorage.length-1;e>=0;e--){var r=localStorage.key(e);0===r.indexOf(t)&&localStorage.removeItem(r)}}):u.reject("Invalid arguments"),e),n}var $t={_driver:"localStorageWrapper",_initStorage:jt,_support:Pt(),iterate:Vt,getItem:Ft,setItem:Gt,removeItem:zt,clear:Bt,length:Wt,key:Ht,keys:Ut,dropInstance:Xt},Yt=function(t,e){return t===e||"number"==typeof t&&"number"==typeof e&&isNaN(t)&&isNaN(e)},qt=function(t,e){for(var r=t.length,n=0;n<r;){if(Yt(t[n],e))return!0;n++}return!1},Kt=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)},Zt={},Qt={},Jt={INDEXEDDB:$,WEBSQL:Dt,LOCALSTORAGE:$t},te=[Jt.INDEXEDDB._driver,Jt.WEBSQL._driver,Jt.LOCALSTORAGE._driver],ee=["dropInstance"],re=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(ee),ne={description:"",driver:te.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function oe(t,e){t[e]=function(){var r=arguments;return t.ready().then(function(){return t[e].apply(t,r)})}}function ie(){for(var t=1;t<arguments.length;t++){var e=arguments[t];if(e)for(var r in e)e.hasOwnProperty(r)&&(Kt(e[r])?arguments[0][r]=e[r].slice():arguments[0][r]=e[r])}return arguments[0]}var ae=function(){function t(e){for(var r in o(this,t),Jt)if(Jt.hasOwnProperty(r)){var n=Jt[r],i=n._driver;this[r]=i,Zt[i]||this.defineDriver(n)}this._defaultConfig=ie({},ne),this._config=ie({},this._defaultConfig,e),this._driverSet=null,this._initDriver=null,this._ready=!1,this._dbInfo=null,this._wrapLibraryMethodsWithReady(),this.setDriver(this._config.driver).catch(function(){})}return t.prototype.config=function(t){if("object"===(void 0===t?"undefined":n(t))){if(this._ready)return new Error("Can't call config() after localforage has been used.");for(var e in t){if("storeName"===e&&(t[e]=t[e].replace(/\W/g,"_")),"version"===e&&"number"!=typeof t[e])return new Error("Database version must be a number.");this._config[e]=t[e]}return!("driver"in t)||!t.driver||this.setDriver(this._config.driver)}return"string"==typeof t?this._config[t]:this._config},t.prototype.defineDriver=function(t,e,r){var n=new u(function(e,r){try{var n=t._driver,o=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!t._driver)return void r(o);for(var i=re.concat("_initStorage"),a=0,s=i.length;a<s;a++){var c=i[a];if((!qt(ee,c)||t[c])&&"function"!=typeof t[c])return void r(o)}var f=function(){for(var e=function(t){return function(){var e=new Error("Method "+t+" is not implemented by the current driver"),r=u.reject(e);return l(r,arguments[arguments.length-1]),r}},r=0,n=ee.length;r<n;r++){var o=ee[r];t[o]||(t[o]=e(o))}};f();var d=function(r){Zt[n]&&console.info("Redefining LocalForage driver: "+n),Zt[n]=t,Qt[n]=r,e()};"_support"in t?t._support&&"function"==typeof t._support?t._support().then(d,r):d(!!t._support):d(!0)}catch(h){r(h)}});return f(n,e,r),n},t.prototype.driver=function(){return this._driver||null},t.prototype.getDriver=function(t,e,r){var n=Zt[t]?u.resolve(Zt[t]):u.reject(new Error("Driver not found."));return f(n,e,r),n},t.prototype.getSerializer=function(t){var e=u.resolve(vt);return f(e,t),e},t.prototype.ready=function(t){var e=this,r=e._driverSet.then(function(){return null===e._ready&&(e._ready=e._initDriver()),e._ready});return f(r,t,t),r},t.prototype.setDriver=function(t,e,r){var n=this;Kt(t)||(t=[t]);var o=this._getSupportedDrivers(t);function i(){n._config.driver=n.driver()}function a(t){return n._extend(t),i(),n._ready=n._initStorage(n._config),n._ready}function s(t){return function(){var e=0;function r(){for(;e<t.length;){var o=t[e];return e++,n._dbInfo=null,n._ready=null,n.getDriver(o).then(a).catch(r)}i();var s=new Error("No available storage method found.");return n._driverSet=u.reject(s),n._driverSet}return r()}}var c=null!==this._driverSet?this._driverSet.catch(function(){return u.resolve()}):u.resolve();return this._driverSet=c.then(function(){var t=o[0];return n._dbInfo=null,n._ready=null,n.getDriver(t).then(function(t){n._driver=t._driver,i(),n._wrapLibraryMethodsWithReady(),n._initDriver=s(o)})}).catch(function(){i();var t=new Error("No available storage method found.");return n._driverSet=u.reject(t),n._driverSet}),f(this._driverSet,e,r),this._driverSet},t.prototype.supports=function(t){return!!Qt[t]},t.prototype._extend=function(t){ie(this,t)},t.prototype._getSupportedDrivers=function(t){for(var e=[],r=0,n=t.length;r<n;r++){var o=t[r];this.supports(o)&&e.push(o)}return e},t.prototype._wrapLibraryMethodsWithReady=function(){for(var t=0,e=re.length;t<e;t++)oe(this,re[t])},t.prototype.createInstance=function(e){return new t(e)},t}(),se=new ae;e.exports=se},{3:3}]},{},[4])(4)}(Ye);const qe=h(Ye.exports);function Ke(t){let e=t.url;if(t.params){e=e+"?"+new URLSearchParams(t.params).toString()}return e}qe.config({driver:qe.INDEXEDDB,name:"cache",version:1,storeName:"requests",description:"local cache"});const Ze={init:async t=>{let e=await qe.getItem(Ke(t));e&&(t.headers["x-tag"]=e.xtag,t.data=e.data)},save:async(t,e)=>{if(304==t.status)t.data=e.data;else if(t.status<400)try{let r={xtag:t.headers["x-tag"],data:t.data,create_at:new Date};await qe.setItem(Ke(e),r)}catch(r){console.info("Cache: ",r)}},clear:async(t=3)=>{const e=864e5*t,r=await qe.keys(),n=new Date;for(const o of r){const t=await qe.getItem(o);if(t&&t.create_at){n-new Date(t.create_at)>=e&&await qe.removeItem(o)}}},clearAll:()=>{qe.clear()}};function Qe({title:t,href:e,text:r="",children:n,...o}){let i="";return i=e?e.replace(/\D/g,""):null==n?void 0:n.replace(/\D/g,""),Qt.jsx("a",{href:`https://wa.me/${i}?text=${encodeURI(r)}`,target:"_blank",rel:"noreferrer",title:t||"Enviar mensagem para este número usando o WhatsApp",...o,children:n||e})}function Je({href:t,title:e,children:r,...n}){return Qt.jsx("a",{href:`mailto:${t||r}`,title:e||"Enviar um e-mail para este endereço",...n,children:r||t})}function tr({to:t,children:e,...r}){return Qt.jsx("a",{href:t||e,target:"_blank",rel:"noreferrer",...r,children:e||t})}const er=o.div`
442
+ */!function(t){t.exports=function t(e,r,n){function o(a,s){if(!r[a]){if(!e[a]){if(!s&&$e)return $e(a);if(i)return i(a,!0);var u=new Error("Cannot find module '"+a+"'");throw u.code="MODULE_NOT_FOUND",u}var l=r[a]={exports:{}};e[a][0].call(l.exports,function(t){var r=e[a][1][t];return o(r||t)},l,l.exports,t,e,r,n)}return r[a].exports}for(var i=$e,a=0;a<n.length;a++)o(n[a]);return o}({1:[function(t,e,r){(function(t){var r,n,o=t.MutationObserver||t.WebKitMutationObserver;if(o){var i=0,a=new o(c),s=t.document.createTextNode("");a.observe(s,{characterData:!0}),r=function(){s.data=i=++i%2}}else if(t.setImmediate||void 0===t.MessageChannel)r="document"in t&&"onreadystatechange"in t.document.createElement("script")?function(){var e=t.document.createElement("script");e.onreadystatechange=function(){c(),e.onreadystatechange=null,e.parentNode.removeChild(e),e=null},t.document.documentElement.appendChild(e)}:function(){setTimeout(c,0)};else{var u=new t.MessageChannel;u.port1.onmessage=c,r=function(){u.port2.postMessage(0)}}var l=[];function c(){var t,e;n=!0;for(var r=l.length;r;){for(e=l,l=[],t=-1;++t<r;)e[t]();r=l.length}n=!1}function h(t){1!==l.push(t)||n||r()}e.exports=h}).call(this,void 0!==f?f:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],2:[function(t,e,r){var n=t(1);function o(){}var i={},a=["REJECTED"],s=["FULFILLED"],u=["PENDING"];function l(t){if("function"!=typeof t)throw new TypeError("resolver must be a function");this.state=u,this.queue=[],this.outcome=void 0,t!==o&&d(this,t)}function c(t,e,r){this.promise=t,"function"==typeof e&&(this.onFulfilled=e,this.callFulfilled=this.otherCallFulfilled),"function"==typeof r&&(this.onRejected=r,this.callRejected=this.otherCallRejected)}function h(t,e,r){n(function(){var n;try{n=e(r)}catch(o){return i.reject(t,o)}n===t?i.reject(t,new TypeError("Cannot resolve promise with itself")):i.resolve(t,n)})}function f(t){var e=t&&t.then;if(t&&("object"==typeof t||"function"==typeof t)&&"function"==typeof e)return function(){e.apply(t,arguments)}}function d(t,e){var r=!1;function n(e){r||(r=!0,i.reject(t,e))}function o(e){r||(r=!0,i.resolve(t,e))}function a(){e(o,n)}var s=p(a);"error"===s.status&&n(s.value)}function p(t,e){var r={};try{r.value=t(e),r.status="success"}catch(n){r.status="error",r.value=n}return r}function g(t){return t instanceof this?t:i.resolve(new this(o),t)}function m(t){var e=new this(o);return i.reject(e,t)}function v(t){var e=this;if("[object Array]"!==Object.prototype.toString.call(t))return this.reject(new TypeError("must be an array"));var r=t.length,n=!1;if(!r)return this.resolve([]);for(var a=new Array(r),s=0,u=-1,l=new this(o);++u<r;)c(t[u],u);return l;function c(t,o){function u(t){a[o]=t,++s!==r||n||(n=!0,i.resolve(l,a))}e.resolve(t).then(u,function(t){n||(n=!0,i.reject(l,t))})}}function y(t){var e=this;if("[object Array]"!==Object.prototype.toString.call(t))return this.reject(new TypeError("must be an array"));var r=t.length,n=!1;if(!r)return this.resolve([]);for(var a=-1,s=new this(o);++a<r;)u(t[a]);return s;function u(t){e.resolve(t).then(function(t){n||(n=!0,i.resolve(s,t))},function(t){n||(n=!0,i.reject(s,t))})}}e.exports=l,l.prototype.catch=function(t){return this.then(null,t)},l.prototype.then=function(t,e){if("function"!=typeof t&&this.state===s||"function"!=typeof e&&this.state===a)return this;var r=new this.constructor(o);return this.state!==u?h(r,this.state===s?t:e,this.outcome):this.queue.push(new c(r,t,e)),r},c.prototype.callFulfilled=function(t){i.resolve(this.promise,t)},c.prototype.otherCallFulfilled=function(t){h(this.promise,this.onFulfilled,t)},c.prototype.callRejected=function(t){i.reject(this.promise,t)},c.prototype.otherCallRejected=function(t){h(this.promise,this.onRejected,t)},i.resolve=function(t,e){var r=p(f,e);if("error"===r.status)return i.reject(t,r.value);var n=r.value;if(n)d(t,n);else{t.state=s,t.outcome=e;for(var o=-1,a=t.queue.length;++o<a;)t.queue[o].callFulfilled(e)}return t},i.reject=function(t,e){t.state=a,t.outcome=e;for(var r=-1,n=t.queue.length;++r<n;)t.queue[r].callRejected(e);return t},l.resolve=g,l.reject=m,l.all=v,l.race=y},{1:1}],3:[function(t,e,r){(function(e){"function"!=typeof e.Promise&&(e.Promise=t(2))}).call(this,void 0!==f?f:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{2:2}],4:[function(t,e,r){var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(){try{if("undefined"!=typeof indexedDB)return indexedDB;if("undefined"!=typeof webkitIndexedDB)return webkitIndexedDB;if("undefined"!=typeof mozIndexedDB)return mozIndexedDB;if("undefined"!=typeof OIndexedDB)return OIndexedDB;if("undefined"!=typeof msIndexedDB)return msIndexedDB}catch(t){return}}var a=i();function s(){try{if(!a||!a.open)return!1;var t="undefined"!=typeof openDatabase&&/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),e="function"==typeof fetch&&-1!==fetch.toString().indexOf("[native code");return(!t||e)&&"undefined"!=typeof indexedDB&&"undefined"!=typeof IDBKeyRange}catch(r){return!1}}function u(t,e){t=t||[],e=e||{};try{return new Blob(t,e)}catch(o){if("TypeError"!==o.name)throw o;for(var r=new("undefined"!=typeof BlobBuilder?BlobBuilder:"undefined"!=typeof MSBlobBuilder?MSBlobBuilder:"undefined"!=typeof MozBlobBuilder?MozBlobBuilder:WebKitBlobBuilder),n=0;n<t.length;n+=1)r.append(t[n]);return r.getBlob(e.type)}}"undefined"==typeof Promise&&t(3);var l=Promise;function c(t,e){e&&t.then(function(t){e(null,t)},function(t){e(t)})}function h(t,e,r){"function"==typeof e&&t.then(e),"function"==typeof r&&t.catch(r)}function f(t){return"string"!=typeof t&&(console.warn(t+" used as a key, but it is not a string."),t=String(t)),t}function d(){if(arguments.length&&"function"==typeof arguments[arguments.length-1])return arguments[arguments.length-1]}var p="local-forage-detect-blob-support",g=void 0,m={},v=Object.prototype.toString,y="readonly",_="readwrite";function w(t){for(var e=t.length,r=new ArrayBuffer(e),n=new Uint8Array(r),o=0;o<e;o++)n[o]=t.charCodeAt(o);return r}function b(t){return new l(function(e){var r=t.transaction(p,_),n=u([""]);r.objectStore(p).put(n,"key"),r.onabort=function(t){t.preventDefault(),t.stopPropagation(),e(!1)},r.oncomplete=function(){var t=navigator.userAgent.match(/Chrome\/(\d+)/),r=navigator.userAgent.match(/Edge\//);e(r||!t||parseInt(t[1],10)>=43)}}).catch(function(){return!1})}function C(t){return"boolean"==typeof g?l.resolve(g):b(t).then(function(t){return g=t})}function A(t){var e=m[t.name],r={};r.promise=new l(function(t,e){r.resolve=t,r.reject=e}),e.deferredOperations.push(r),e.dbReady?e.dbReady=e.dbReady.then(function(){return r.promise}):e.dbReady=r.promise}function E(t){var e=m[t.name].deferredOperations.pop();if(e)return e.resolve(),e.promise}function I(t,e){var r=m[t.name].deferredOperations.pop();if(r)return r.reject(e),r.promise}function S(t,e){return new l(function(r,n){if(m[t.name]=m[t.name]||B(),t.db){if(!e)return r(t.db);A(t),t.db.close()}var o=[t.name];e&&o.push(t.version);var i=a.open.apply(a,o);e&&(i.onupgradeneeded=function(e){var r=i.result;try{r.createObjectStore(t.storeName),e.oldVersion<=1&&r.createObjectStore(p)}catch(n){if("ConstraintError"!==n.name)throw n;console.warn('The database "'+t.name+'" has been upgraded from version '+e.oldVersion+" to version "+e.newVersion+', but the storage "'+t.storeName+'" already exists.')}}),i.onerror=function(t){t.preventDefault(),n(i.error)},i.onsuccess=function(){var e=i.result;e.onversionchange=function(t){t.target.close()},r(e),E(t)}})}function x(t){return S(t,!1)}function O(t){return S(t,!0)}function T(t,e){if(!t.db)return!0;var r=!t.db.objectStoreNames.contains(t.storeName),n=t.version<t.db.version,o=t.version>t.db.version;if(n&&(t.version!==e&&console.warn('The database "'+t.name+"\" can't be downgraded from version "+t.db.version+" to version "+t.version+"."),t.version=t.db.version),o||r){if(r){var i=t.db.version+1;i>t.version&&(t.version=i)}return!0}return!1}function N(t){return new l(function(e,r){var n=new FileReader;n.onerror=r,n.onloadend=function(r){var n=btoa(r.target.result||"");e({__local_forage_encoded_blob:!0,data:n,type:t.type})},n.readAsBinaryString(t)})}function k(t){return u([w(atob(t.data))],{type:t.type})}function R(t){return t&&t.__local_forage_encoded_blob}function D(t){var e=this,r=e._initReady().then(function(){var t=m[e._dbInfo.name];if(t&&t.dbReady)return t.dbReady});return h(r,t,t),r}function P(t){A(t);for(var e=m[t.name],r=e.forages,n=0;n<r.length;n++){var o=r[n];o._dbInfo.db&&(o._dbInfo.db.close(),o._dbInfo.db=null)}return t.db=null,x(t).then(function(e){return t.db=e,T(t)?O(t):e}).then(function(n){t.db=e.db=n;for(var o=0;o<r.length;o++)r[o]._dbInfo.db=n}).catch(function(e){throw I(t,e),e})}function M(t,e,r,n){void 0===n&&(n=1);try{var o=t.db.transaction(t.storeName,e);r(null,o)}catch(i){if(n>0&&(!t.db||"InvalidStateError"===i.name||"NotFoundError"===i.name))return l.resolve().then(function(){if(!t.db||"NotFoundError"===i.name&&!t.db.objectStoreNames.contains(t.storeName)&&t.version<=t.db.version)return t.db&&(t.version=t.db.version+1),O(t)}).then(function(){return P(t).then(function(){M(t,e,r,n-1)})}).catch(r);r(i)}}function B(){return{forages:[],db:null,dbReady:null,deferredOperations:[]}}function L(t){var e=this,r={db:null};if(t)for(var n in t)r[n]=t[n];var o=m[r.name];o||(o=B(),m[r.name]=o),o.forages.push(e),e._initReady||(e._initReady=e.ready,e.ready=D);var i=[];function a(){return l.resolve()}for(var s=0;s<o.forages.length;s++){var u=o.forages[s];u!==e&&i.push(u._initReady().catch(a))}var c=o.forages.slice(0);return l.all(i).then(function(){return r.db=o.db,x(r)}).then(function(t){return r.db=t,T(r,e._defaultConfig.version)?O(r):t}).then(function(t){r.db=o.db=t,e._dbInfo=r;for(var n=0;n<c.length;n++){var i=c[n];i!==e&&(i._dbInfo.db=r.db,i._dbInfo.version=r.version)}})}function F(t,e){var r=this;t=f(t);var n=new l(function(e,n){r.ready().then(function(){M(r._dbInfo,y,function(o,i){if(o)return n(o);try{var a=i.objectStore(r._dbInfo.storeName).get(t);a.onsuccess=function(){var t=a.result;void 0===t&&(t=null),R(t)&&(t=k(t)),e(t)},a.onerror=function(){n(a.error)}}catch(s){n(s)}})}).catch(n)});return c(n,e),n}function j(t,e){var r=this,n=new l(function(e,n){r.ready().then(function(){M(r._dbInfo,y,function(o,i){if(o)return n(o);try{var a=i.objectStore(r._dbInfo.storeName).openCursor(),s=1;a.onsuccess=function(){var r=a.result;if(r){var n=r.value;R(n)&&(n=k(n));var o=t(n,r.key,s++);void 0!==o?e(o):r.continue()}else e()},a.onerror=function(){n(a.error)}}catch(u){n(u)}})}).catch(n)});return c(n,e),n}function V(t,e,r){var n=this;t=f(t);var o=new l(function(r,o){var i;n.ready().then(function(){return i=n._dbInfo,"[object Blob]"===v.call(e)?C(i.db).then(function(t){return t?e:N(e)}):e}).then(function(e){M(n._dbInfo,_,function(i,a){if(i)return o(i);try{var s=a.objectStore(n._dbInfo.storeName);null===e&&(e=void 0);var u=s.put(e,t);a.oncomplete=function(){void 0===e&&(e=null),r(e)},a.onabort=a.onerror=function(){var t=u.error?u.error:u.transaction.error;o(t)}}catch(l){o(l)}})}).catch(o)});return c(o,r),o}function U(t,e){var r=this;t=f(t);var n=new l(function(e,n){r.ready().then(function(){M(r._dbInfo,_,function(o,i){if(o)return n(o);try{var a=i.objectStore(r._dbInfo.storeName).delete(t);i.oncomplete=function(){e()},i.onerror=function(){n(a.error)},i.onabort=function(){var t=a.error?a.error:a.transaction.error;n(t)}}catch(s){n(s)}})}).catch(n)});return c(n,e),n}function H(t){var e=this,r=new l(function(t,r){e.ready().then(function(){M(e._dbInfo,_,function(n,o){if(n)return r(n);try{var i=o.objectStore(e._dbInfo.storeName).clear();o.oncomplete=function(){t()},o.onabort=o.onerror=function(){var t=i.error?i.error:i.transaction.error;r(t)}}catch(a){r(a)}})}).catch(r)});return c(r,t),r}function z(t){var e=this,r=new l(function(t,r){e.ready().then(function(){M(e._dbInfo,y,function(n,o){if(n)return r(n);try{var i=o.objectStore(e._dbInfo.storeName).count();i.onsuccess=function(){t(i.result)},i.onerror=function(){r(i.error)}}catch(a){r(a)}})}).catch(r)});return c(r,t),r}function W(t,e){var r=this,n=new l(function(e,n){t<0?e(null):r.ready().then(function(){M(r._dbInfo,y,function(o,i){if(o)return n(o);try{var a=i.objectStore(r._dbInfo.storeName),s=!1,u=a.openKeyCursor();u.onsuccess=function(){var r=u.result;r?0===t||s?e(r.key):(s=!0,r.advance(t)):e(null)},u.onerror=function(){n(u.error)}}catch(l){n(l)}})}).catch(n)});return c(n,e),n}function G(t){var e=this,r=new l(function(t,r){e.ready().then(function(){M(e._dbInfo,y,function(n,o){if(n)return r(n);try{var i=o.objectStore(e._dbInfo.storeName).openKeyCursor(),a=[];i.onsuccess=function(){var e=i.result;e?(a.push(e.key),e.continue()):t(a)},i.onerror=function(){r(i.error)}}catch(s){r(s)}})}).catch(r)});return c(r,t),r}function X(t,e){e=d.apply(this,arguments);var r=this.config();(t="function"!=typeof t&&t||{}).name||(t.name=t.name||r.name,t.storeName=t.storeName||r.storeName);var n,o=this;if(t.name){var i=t.name===r.name&&o._dbInfo.db?l.resolve(o._dbInfo.db):x(t).then(function(e){var r=m[t.name],n=r.forages;r.db=e;for(var o=0;o<n.length;o++)n[o]._dbInfo.db=e;return e});n=t.storeName?i.then(function(e){if(e.objectStoreNames.contains(t.storeName)){var r=e.version+1;A(t);var n=m[t.name],o=n.forages;e.close();for(var i=0;i<o.length;i++){var s=o[i];s._dbInfo.db=null,s._dbInfo.version=r}return new l(function(e,n){var o=a.open(t.name,r);o.onerror=function(t){o.result.close(),n(t)},o.onupgradeneeded=function(){o.result.deleteObjectStore(t.storeName)},o.onsuccess=function(){var t=o.result;t.close(),e(t)}}).then(function(t){n.db=t;for(var e=0;e<o.length;e++){var r=o[e];r._dbInfo.db=t,E(r._dbInfo)}}).catch(function(e){throw(I(t,e)||l.resolve()).catch(function(){}),e})}}):i.then(function(e){A(t);var r=m[t.name],n=r.forages;e.close();for(var o=0;o<n.length;o++)n[o]._dbInfo.db=null;return new l(function(e,r){var n=a.deleteDatabase(t.name);n.onerror=function(){var t=n.result;t&&t.close(),r(n.error)},n.onblocked=function(){console.warn('dropInstance blocked for database "'+t.name+'" until all open connections are closed')},n.onsuccess=function(){var t=n.result;t&&t.close(),e(t)}}).then(function(t){r.db=t;for(var e=0;e<n.length;e++)E(n[e]._dbInfo)}).catch(function(e){throw(I(t,e)||l.resolve()).catch(function(){}),e})})}else n=l.reject("Invalid arguments");return c(n,e),n}var $={_driver:"asyncStorage",_initStorage:L,_support:s(),iterate:j,getItem:F,setItem:V,removeItem:U,clear:H,length:z,key:W,keys:G,dropInstance:X};function Y(){return"function"==typeof openDatabase}var q="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",K="~~local_forage_type~",Z=/^~~local_forage_type~([^~]+)~/,Q="__lfsc__:",J=Q.length,tt="arbf",et="blob",rt="si08",nt="ui08",ot="uic8",it="si16",at="si32",st="ur16",ut="ui32",lt="fl32",ct="fl64",ht=J+tt.length,ft=Object.prototype.toString;function dt(t){var e,r,n,o,i,a=.75*t.length,s=t.length,u=0;"="===t[t.length-1]&&(a--,"="===t[t.length-2]&&a--);var l=new ArrayBuffer(a),c=new Uint8Array(l);for(e=0;e<s;e+=4)r=q.indexOf(t[e]),n=q.indexOf(t[e+1]),o=q.indexOf(t[e+2]),i=q.indexOf(t[e+3]),c[u++]=r<<2|n>>4,c[u++]=(15&n)<<4|o>>2,c[u++]=(3&o)<<6|63&i;return l}function pt(t){var e,r=new Uint8Array(t),n="";for(e=0;e<r.length;e+=3)n+=q[r[e]>>2],n+=q[(3&r[e])<<4|r[e+1]>>4],n+=q[(15&r[e+1])<<2|r[e+2]>>6],n+=q[63&r[e+2]];return r.length%3==2?n=n.substring(0,n.length-1)+"=":r.length%3==1&&(n=n.substring(0,n.length-2)+"=="),n}function gt(t,e){var r="";if(t&&(r=ft.call(t)),t&&("[object ArrayBuffer]"===r||t.buffer&&"[object ArrayBuffer]"===ft.call(t.buffer))){var n,o=Q;t instanceof ArrayBuffer?(n=t,o+=tt):(n=t.buffer,"[object Int8Array]"===r?o+=rt:"[object Uint8Array]"===r?o+=nt:"[object Uint8ClampedArray]"===r?o+=ot:"[object Int16Array]"===r?o+=it:"[object Uint16Array]"===r?o+=st:"[object Int32Array]"===r?o+=at:"[object Uint32Array]"===r?o+=ut:"[object Float32Array]"===r?o+=lt:"[object Float64Array]"===r?o+=ct:e(new Error("Failed to get type for BinaryArray"))),e(o+pt(n))}else if("[object Blob]"===r){var i=new FileReader;i.onload=function(){var r=K+t.type+"~"+pt(this.result);e(Q+et+r)},i.readAsArrayBuffer(t)}else try{e(JSON.stringify(t))}catch(a){console.error("Couldn't convert value into a JSON string: ",t),e(null,a)}}function mt(t){if(t.substring(0,J)!==Q)return JSON.parse(t);var e,r=t.substring(ht),n=t.substring(J,ht);if(n===et&&Z.test(r)){var o=r.match(Z);e=o[1],r=r.substring(o[0].length)}var i=dt(r);switch(n){case tt:return i;case et:return u([i],{type:e});case rt:return new Int8Array(i);case nt:return new Uint8Array(i);case ot:return new Uint8ClampedArray(i);case it:return new Int16Array(i);case st:return new Uint16Array(i);case at:return new Int32Array(i);case ut:return new Uint32Array(i);case lt:return new Float32Array(i);case ct:return new Float64Array(i);default:throw new Error("Unkown type: "+n)}}var vt={serialize:gt,deserialize:mt,stringToBuffer:dt,bufferToString:pt};function yt(t,e,r,n){t.executeSql("CREATE TABLE IF NOT EXISTS "+e.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],r,n)}function _t(t){var e=this,r={db:null};if(t)for(var n in t)r[n]="string"!=typeof t[n]?t[n].toString():t[n];var o=new l(function(t,n){try{r.db=openDatabase(r.name,String(r.version),r.description,r.size)}catch(o){return n(o)}r.db.transaction(function(o){yt(o,r,function(){e._dbInfo=r,t()},function(t,e){n(e)})},n)});return r.serializer=vt,o}function wt(t,e,r,n,o,i){t.executeSql(r,n,o,function(t,a){a.code===a.SYNTAX_ERR?t.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[e.storeName],function(t,s){s.rows.length?i(t,a):yt(t,e,function(){t.executeSql(r,n,o,i)},i)},i):i(t,a)},i)}function bt(t,e){var r=this;t=f(t);var n=new l(function(e,n){r.ready().then(function(){var o=r._dbInfo;o.db.transaction(function(r){wt(r,o,"SELECT * FROM "+o.storeName+" WHERE key = ? LIMIT 1",[t],function(t,r){var n=r.rows.length?r.rows.item(0).value:null;n&&(n=o.serializer.deserialize(n)),e(n)},function(t,e){n(e)})})}).catch(n)});return c(n,e),n}function Ct(t,e){var r=this,n=new l(function(e,n){r.ready().then(function(){var o=r._dbInfo;o.db.transaction(function(r){wt(r,o,"SELECT * FROM "+o.storeName,[],function(r,n){for(var i=n.rows,a=i.length,s=0;s<a;s++){var u=i.item(s),l=u.value;if(l&&(l=o.serializer.deserialize(l)),void 0!==(l=t(l,u.key,s+1)))return void e(l)}e()},function(t,e){n(e)})})}).catch(n)});return c(n,e),n}function At(t,e,r,n){var o=this;t=f(t);var i=new l(function(i,a){o.ready().then(function(){void 0===e&&(e=null);var s=e,u=o._dbInfo;u.serializer.serialize(e,function(e,l){l?a(l):u.db.transaction(function(r){wt(r,u,"INSERT OR REPLACE INTO "+u.storeName+" (key, value) VALUES (?, ?)",[t,e],function(){i(s)},function(t,e){a(e)})},function(e){if(e.code===e.QUOTA_ERR){if(n>0)return void i(At.apply(o,[t,s,r,n-1]));a(e)}})})}).catch(a)});return c(i,r),i}function Et(t,e,r){return At.apply(this,[t,e,r,1])}function It(t,e){var r=this;t=f(t);var n=new l(function(e,n){r.ready().then(function(){var o=r._dbInfo;o.db.transaction(function(r){wt(r,o,"DELETE FROM "+o.storeName+" WHERE key = ?",[t],function(){e()},function(t,e){n(e)})})}).catch(n)});return c(n,e),n}function St(t){var e=this,r=new l(function(t,r){e.ready().then(function(){var n=e._dbInfo;n.db.transaction(function(e){wt(e,n,"DELETE FROM "+n.storeName,[],function(){t()},function(t,e){r(e)})})}).catch(r)});return c(r,t),r}function xt(t){var e=this,r=new l(function(t,r){e.ready().then(function(){var n=e._dbInfo;n.db.transaction(function(e){wt(e,n,"SELECT COUNT(key) as c FROM "+n.storeName,[],function(e,r){var n=r.rows.item(0).c;t(n)},function(t,e){r(e)})})}).catch(r)});return c(r,t),r}function Ot(t,e){var r=this,n=new l(function(e,n){r.ready().then(function(){var o=r._dbInfo;o.db.transaction(function(r){wt(r,o,"SELECT key FROM "+o.storeName+" WHERE id = ? LIMIT 1",[t+1],function(t,r){var n=r.rows.length?r.rows.item(0).key:null;e(n)},function(t,e){n(e)})})}).catch(n)});return c(n,e),n}function Tt(t){var e=this,r=new l(function(t,r){e.ready().then(function(){var n=e._dbInfo;n.db.transaction(function(e){wt(e,n,"SELECT key FROM "+n.storeName,[],function(e,r){for(var n=[],o=0;o<r.rows.length;o++)n.push(r.rows.item(o).key);t(n)},function(t,e){r(e)})})}).catch(r)});return c(r,t),r}function Nt(t){return new l(function(e,r){t.transaction(function(n){n.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],function(r,n){for(var o=[],i=0;i<n.rows.length;i++)o.push(n.rows.item(i).name);e({db:t,storeNames:o})},function(t,e){r(e)})},function(t){r(t)})})}function kt(t,e){e=d.apply(this,arguments);var r=this.config();(t="function"!=typeof t&&t||{}).name||(t.name=t.name||r.name,t.storeName=t.storeName||r.storeName);var n,o=this;return c(n=t.name?new l(function(e){var n;n=t.name===r.name?o._dbInfo.db:openDatabase(t.name,"","",0),t.storeName?e({db:n,storeNames:[t.storeName]}):e(Nt(n))}).then(function(t){return new l(function(e,r){t.db.transaction(function(n){function o(t){return new l(function(e,r){n.executeSql("DROP TABLE IF EXISTS "+t,[],function(){e()},function(t,e){r(e)})})}for(var i=[],a=0,s=t.storeNames.length;a<s;a++)i.push(o(t.storeNames[a]));l.all(i).then(function(){e()}).catch(function(t){r(t)})},function(t){r(t)})})}):l.reject("Invalid arguments"),e),n}var Rt={_driver:"webSQLStorage",_initStorage:_t,_support:Y(),iterate:Ct,getItem:bt,setItem:Et,removeItem:It,clear:St,length:xt,key:Ot,keys:Tt,dropInstance:kt};function Dt(){try{return"undefined"!=typeof localStorage&&"setItem"in localStorage&&!!localStorage.setItem}catch(t){return!1}}function Pt(t,e){var r=t.name+"/";return t.storeName!==e.storeName&&(r+=t.storeName+"/"),r}function Mt(){var t="_localforage_support_test";try{return localStorage.setItem(t,!0),localStorage.removeItem(t),!1}catch(e){return!0}}function Bt(){return!Mt()||localStorage.length>0}function Lt(t){var e=this,r={};if(t)for(var n in t)r[n]=t[n];return r.keyPrefix=Pt(t,e._defaultConfig),Bt()?(e._dbInfo=r,r.serializer=vt,l.resolve()):l.reject()}function Ft(t){var e=this,r=e.ready().then(function(){for(var t=e._dbInfo.keyPrefix,r=localStorage.length-1;r>=0;r--){var n=localStorage.key(r);0===n.indexOf(t)&&localStorage.removeItem(n)}});return c(r,t),r}function jt(t,e){var r=this;t=f(t);var n=r.ready().then(function(){var e=r._dbInfo,n=localStorage.getItem(e.keyPrefix+t);return n&&(n=e.serializer.deserialize(n)),n});return c(n,e),n}function Vt(t,e){var r=this,n=r.ready().then(function(){for(var e=r._dbInfo,n=e.keyPrefix,o=n.length,i=localStorage.length,a=1,s=0;s<i;s++){var u=localStorage.key(s);if(0===u.indexOf(n)){var l=localStorage.getItem(u);if(l&&(l=e.serializer.deserialize(l)),void 0!==(l=t(l,u.substring(o),a++)))return l}}});return c(n,e),n}function Ut(t,e){var r=this,n=r.ready().then(function(){var e,n=r._dbInfo;try{e=localStorage.key(t)}catch(o){e=null}return e&&(e=e.substring(n.keyPrefix.length)),e});return c(n,e),n}function Ht(t){var e=this,r=e.ready().then(function(){for(var t=e._dbInfo,r=localStorage.length,n=[],o=0;o<r;o++){var i=localStorage.key(o);0===i.indexOf(t.keyPrefix)&&n.push(i.substring(t.keyPrefix.length))}return n});return c(r,t),r}function zt(t){var e=this.keys().then(function(t){return t.length});return c(e,t),e}function Wt(t,e){var r=this;t=f(t);var n=r.ready().then(function(){var e=r._dbInfo;localStorage.removeItem(e.keyPrefix+t)});return c(n,e),n}function Gt(t,e,r){var n=this;t=f(t);var o=n.ready().then(function(){void 0===e&&(e=null);var r=e;return new l(function(o,i){var a=n._dbInfo;a.serializer.serialize(e,function(e,n){if(n)i(n);else try{localStorage.setItem(a.keyPrefix+t,e),o(r)}catch(s){"QuotaExceededError"!==s.name&&"NS_ERROR_DOM_QUOTA_REACHED"!==s.name||i(s),i(s)}})})});return c(o,r),o}function Xt(t,e){if(e=d.apply(this,arguments),!(t="function"!=typeof t&&t||{}).name){var r=this.config();t.name=t.name||r.name,t.storeName=t.storeName||r.storeName}var n,o=this;return c(n=t.name?new l(function(e){t.storeName?e(Pt(t,o._defaultConfig)):e(t.name+"/")}).then(function(t){for(var e=localStorage.length-1;e>=0;e--){var r=localStorage.key(e);0===r.indexOf(t)&&localStorage.removeItem(r)}}):l.reject("Invalid arguments"),e),n}var $t={_driver:"localStorageWrapper",_initStorage:Lt,_support:Dt(),iterate:Vt,getItem:jt,setItem:Gt,removeItem:Wt,clear:Ft,length:zt,key:Ut,keys:Ht,dropInstance:Xt},Yt=function(t,e){return t===e||"number"==typeof t&&"number"==typeof e&&isNaN(t)&&isNaN(e)},qt=function(t,e){for(var r=t.length,n=0;n<r;){if(Yt(t[n],e))return!0;n++}return!1},Kt=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)},Zt={},Qt={},Jt={INDEXEDDB:$,WEBSQL:Rt,LOCALSTORAGE:$t},te=[Jt.INDEXEDDB._driver,Jt.WEBSQL._driver,Jt.LOCALSTORAGE._driver],ee=["dropInstance"],re=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(ee),ne={description:"",driver:te.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function oe(t,e){t[e]=function(){var r=arguments;return t.ready().then(function(){return t[e].apply(t,r)})}}function ie(){for(var t=1;t<arguments.length;t++){var e=arguments[t];if(e)for(var r in e)e.hasOwnProperty(r)&&(Kt(e[r])?arguments[0][r]=e[r].slice():arguments[0][r]=e[r])}return arguments[0]}var ae=function(){function t(e){for(var r in o(this,t),Jt)if(Jt.hasOwnProperty(r)){var n=Jt[r],i=n._driver;this[r]=i,Zt[i]||this.defineDriver(n)}this._defaultConfig=ie({},ne),this._config=ie({},this._defaultConfig,e),this._driverSet=null,this._initDriver=null,this._ready=!1,this._dbInfo=null,this._wrapLibraryMethodsWithReady(),this.setDriver(this._config.driver).catch(function(){})}return t.prototype.config=function(t){if("object"===(void 0===t?"undefined":n(t))){if(this._ready)return new Error("Can't call config() after localforage has been used.");for(var e in t){if("storeName"===e&&(t[e]=t[e].replace(/\W/g,"_")),"version"===e&&"number"!=typeof t[e])return new Error("Database version must be a number.");this._config[e]=t[e]}return!("driver"in t)||!t.driver||this.setDriver(this._config.driver)}return"string"==typeof t?this._config[t]:this._config},t.prototype.defineDriver=function(t,e,r){var n=new l(function(e,r){try{var n=t._driver,o=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!t._driver)return void r(o);for(var i=re.concat("_initStorage"),a=0,s=i.length;a<s;a++){var u=i[a];if((!qt(ee,u)||t[u])&&"function"!=typeof t[u])return void r(o)}var h=function(){for(var e=function(t){return function(){var e=new Error("Method "+t+" is not implemented by the current driver"),r=l.reject(e);return c(r,arguments[arguments.length-1]),r}},r=0,n=ee.length;r<n;r++){var o=ee[r];t[o]||(t[o]=e(o))}};h();var f=function(r){Zt[n]&&console.info("Redefining LocalForage driver: "+n),Zt[n]=t,Qt[n]=r,e()};"_support"in t?t._support&&"function"==typeof t._support?t._support().then(f,r):f(!!t._support):f(!0)}catch(d){r(d)}});return h(n,e,r),n},t.prototype.driver=function(){return this._driver||null},t.prototype.getDriver=function(t,e,r){var n=Zt[t]?l.resolve(Zt[t]):l.reject(new Error("Driver not found."));return h(n,e,r),n},t.prototype.getSerializer=function(t){var e=l.resolve(vt);return h(e,t),e},t.prototype.ready=function(t){var e=this,r=e._driverSet.then(function(){return null===e._ready&&(e._ready=e._initDriver()),e._ready});return h(r,t,t),r},t.prototype.setDriver=function(t,e,r){var n=this;Kt(t)||(t=[t]);var o=this._getSupportedDrivers(t);function i(){n._config.driver=n.driver()}function a(t){return n._extend(t),i(),n._ready=n._initStorage(n._config),n._ready}function s(t){return function(){var e=0;function r(){for(;e<t.length;){var o=t[e];return e++,n._dbInfo=null,n._ready=null,n.getDriver(o).then(a).catch(r)}i();var s=new Error("No available storage method found.");return n._driverSet=l.reject(s),n._driverSet}return r()}}var u=null!==this._driverSet?this._driverSet.catch(function(){return l.resolve()}):l.resolve();return this._driverSet=u.then(function(){var t=o[0];return n._dbInfo=null,n._ready=null,n.getDriver(t).then(function(t){n._driver=t._driver,i(),n._wrapLibraryMethodsWithReady(),n._initDriver=s(o)})}).catch(function(){i();var t=new Error("No available storage method found.");return n._driverSet=l.reject(t),n._driverSet}),h(this._driverSet,e,r),this._driverSet},t.prototype.supports=function(t){return!!Qt[t]},t.prototype._extend=function(t){ie(this,t)},t.prototype._getSupportedDrivers=function(t){for(var e=[],r=0,n=t.length;r<n;r++){var o=t[r];this.supports(o)&&e.push(o)}return e},t.prototype._wrapLibraryMethodsWithReady=function(){for(var t=0,e=re.length;t<e;t++)oe(this,re[t])},t.prototype.createInstance=function(e){return new t(e)},t}(),se=new ae;e.exports=se},{3:3}]},{},[4])(4)}(Ye);const qe=d(Ye.exports);function Ke(t){let e=t.url;if(t.params){e=e+"?"+new URLSearchParams(t.params).toString()}return e}qe.config({driver:qe.INDEXEDDB,name:"cache",version:1,storeName:"requests",description:"local cache"});const Ze={init:async t=>{let e=await qe.getItem(Ke(t));e&&(t.headers["x-tag"]=e.xtag,t.data=e.data)},save:async(t,e)=>{if(304==t.status)t.data=e.data;else if(t.status<400)try{let r={xtag:t.headers["x-tag"],data:t.data,create_at:new Date};await qe.setItem(Ke(e),r)}catch(r){console.info("Cache: ",r)}},clear:async(t=3)=>{const e=864e5*t,r=await qe.keys(),n=new Date;for(const o of r){const t=await qe.getItem(o);if(t&&t.create_at){n-new Date(t.create_at)>=e&&await qe.removeItem(o)}}},clearAll:()=>{qe.clear()}};function Qe({title:t,href:e,text:r="",children:n,...o}){let i="";return i=e?e.replace(/\D/g,""):null==n?void 0:n.replace(/\D/g,""),Qt.jsx("a",{href:`https://wa.me/${i}?text=${encodeURI(r)}`,target:"_blank",rel:"noreferrer",title:t||"Enviar mensagem para este número usando o WhatsApp",...o,children:n||e})}function Je({href:t,title:e,children:r,...n}){return Qt.jsx("a",{href:`mailto:${t||r}`,title:e||"Enviar um e-mail para este endereço",...n,children:r||t})}function tr({to:t,children:e,...r}){return Qt.jsx("a",{href:t||e,target:"_blank",rel:"noreferrer",...r,children:e||t})}const er=o.div`
443
443
  .alert {
444
444
  font-weight: bold;
445
445
  margin-bottom: 0;
@@ -463,7 +463,7 @@
463
463
  padding-top: 8px;
464
464
  }
465
465
  }
466
- `;function rr(){return Qt.jsxs(er,{children:[Qt.jsx("div",{className:"alert alert-danger",children:"Falha na conexão!"}),Qt.jsxs("div",{children:["Possíveis causas:",Qt.jsx("ul",{children:navigator.onLine?Qt.jsxs(Qt.Fragment,{children:[Qt.jsx("li",{children:"Você está sem conexão com a internet;"}),Qt.jsx("li",{children:"O servidor pode estar passando por uma atualização. Por favor, tente novamente em alguns instantes."}),Qt.jsx("li",{children:"O servidor pode estar temporariamente indisponível."})]}):Qt.jsx("li",{children:"Você está sem conexão com a internet;"})}),Qt.jsxs("div",{children:["Se o erro persistir, por favor, entre em contato com nosso suporte técnico:",Qt.jsxs("ul",{children:[Qt.jsxs("li",{children:["Fone e WhatsApp:"," ",Qt.jsx(Qe,{className:"numeros",children:"(27) 9 9774-2904"})]}),Qt.jsxs("li",{children:["E-mail:"," ",Qt.jsx(Je,{href:"suporte@jcinfoes.com.br?subject="+encodeURI("SIPAR - Sem conexão com o servidor!"),children:"suporte@jcinfoes.com.br"})]})]})]})]})]})}const nr={isError:!1,message:null,loading:!1,headers:null,data:null,error:null,code:0,status:503,report:!1,onBefore:null};function or(t={}){const r=a.useHistory(),n=new AbortController,{globalApiConfig:o}=ee(),[i,s]=e.useState(nr);return"string"==typeof t&&(t={url:t}),[async function(e){var i,a,u,l,f;let d,h={username:null==(i=o.auth)?void 0:i.username,password:null==(a=o.auth)?void 0:a.password};if(t.headers={...t.headers,...null==e?void 0:e.headers},o.getToken){let e=o.getToken();e&&(o.auth.prefix&&(e=`${o.auth.prefix} ${e}`),t.headers[o.auth.header]=e)}o.version&&(t.headers["x-ver"]=encodeURIComponent(o.version)),o.ident&&(t.headers["x-identify"]=encodeURIComponent(o.ident)),t.cache=Boolean(o.isProductionMode&&(!t.method||"get"==t.method)),t.cache&&await Ze.init(t);let p={baseURL:o.baseURL,timeout:o.timeout,auth:h,validateStatus:t=>t>=200&&t<400,...t,...e,headers:t.headers};p.report&&(p={...p,responseType:"blob",timeout:0}),s({...nr,loading:!0}),p.onBefore&&p.onBefore(p);try{const t=await c({...p,signal:n.signal});o.afterRequest&&o.afterRequest(t),d={...nr,data:t.data,message:t.statusText,status:t.status,headers:t.headers}}catch(m){const{ERR_NETWORK:t,ECONNABORTED:e,ETIMEDOUT:n}=c.AxiosError;if([t,e,n].includes(null==m?void 0:m.code))d={...nr,isError:!0,status:400,message:Qt.jsx(rr,{})};else if(m.response)switch(d={...nr,isError:!0,status:m.response.status,message:(null==(u=m.response.data)?void 0:u.error)||m.response.data,code:null==(l=m.response.data)?void 0:l.code},m.response.status){case 400:if("blob"==(null==p?void 0:p.responseType)){let t=await m.response.data.text();t=JSON.parse(t),d.message=t.error||"Ocorreu um erro ao consultar o servidor!"}break;case 401:d.message="Servidor requer autenticação!",o.setToken&&o.setToken(""),r.push(o.loginRoute);break;case 404:d.message="Servidor não possui este recurso!";break;case 405:d.message=`Método [${(null==(f=p.method)?void 0:f.toUpperCase())||"GET"}] indisponível!`}else d={...nr,isError:!0,message:m.message}}const g=`timeout of ${o.timeout}ms exceeded`;return d.message!=g&&"Network Error"!=d.message||(d.message="Sem conexão com o servidor!"),d.isError?d.error=d.message:d.error=null,(null==t?void 0:t.cache)&&await Ze.save(d,t),d={...d,loading:!1},s(d),(null==t?void 0:t.onTerminated)&&t.onTerminated(d),d},i,function(){n&&n.abort("Cancelado pelo usuário!")}]}let ir=null;function ar({url:t,file:n,fileTo:o,setLoading:i}){const[a,c]=e.useState(""),[u,l]=e.useState(!1),[f,d]=e.useState(0),[h,p]=e.useState(n),[g,m]=e.useState(""),[v,,y]=or({url:t,method:"post",data:{file:h},report:!0,onDownloadProgress:t=>{l(t.loaded>0),d(t.loaded/t.total*100)},onTerminated:t=>{if(204===t.status)return w(3);if(t.error)c(t.error),_();else{const[,n]=o.split(".");r.isDesktop()&&"pdf"==n.toLowerCase()?(e=t.data,m(URL.createObjectURL(e))):(s(t.data,function(){let t=o.split("."),e=`-${r.getDateTimeStr().replace(/\D/g,"")}-${r.getHash(o)}`;return t[0]+=e,t=t.join("."),t}()),p(""))}var e}});function _(){ir&&clearTimeout(ir)}function w(t){_(),ir=setTimeout(()=>v(),1e3*t)}return e.useEffect(()=>()=>_(),[]),e.useEffect(()=>()=>g&&URL.revokeObjectURL(g),[g]),e.useEffect(()=>{h?(i(!0),w(2)):i(!1)},[h]),Qt.jsxs(Qt.Fragment,{children:[Qt.jsxs("div",{className:"loading-report--area",children:[Qt.jsxs("div",{className:"loading-box",style:{display:g?"none":"block"},children:[Qt.jsx("button",{className:"btn-loading-close",title:"Cancelar",onClick:function(){u?y():c(""),i(!1)},children:Qt.jsx("i",{className:"fas fa-times"})}),Qt.jsxs("div",{className:"line",children:[u?Qt.jsx("i",{className:"fa-solid fa-file-arrow-down pulse"}):Qt.jsx("div",{className:"spinner"}),Qt.jsx("span",{children:u?"Baixando relatório...":"Gerando relatório..."})]}),Qt.jsx("div",{className:"pbar",children:Qt.jsx("div",{style:{width:`${f}%`}})})]}),g&&Qt.jsx(Xe,{fileTo:o,previewUrl:g,setVisible:()=>p(""),visible:!0})]}),a&&Qt.jsx(se,{onConfirm:()=>i(!1),children:a})]})}function sr({search:t,setSearch:n,fnSearch:o,fnFilter:a,fnValidateFilter:s,placeHolder:c,...u}){const l=e.useRef();return Qt.jsxs("div",{className:"inp-pesq--input-area",children:[Qt.jsxs(i.InputGroup,{children:[Qt.jsx(i.Input,{innerRef:l,value:t,onChange:t=>n(t.target.value),placeholder:c,...u}),Qt.jsx(i.Button,{color:"outline-secondary",type:"button",onClick:()=>{n(""),r.isDesktop()&&(null==l?void 0:l.current)&&l.current.focus()},title:"Limpar campo de pesquisa",children:Qt.jsx(Oe,{})}),Qt.jsx(i.Button,{color:"info",title:"Pesquisar",onClick:o,type:o?"button":"submit",children:Qt.jsx(Se,{})})]}),a&&Qt.jsxs(i.Button,{type:"button",color:"outline-filter",className:"position-relative ip--btn-filter",title:"Filtros avançados",onClick:a,children:[Qt.jsx("i",{className:"fas fa-filter"}),Qt.jsx("span",{className:"ip--btn-caption",children:" Filtros"}),s&&s()&&Qt.jsx("span",{className:"position-absolute top-0 start-100 translate-middle \r\n p-2 bg-danger border border-light rounded-circle",children:Qt.jsx("span",{className:"visually-hidden",children:"Filtro ativo"})})]})]})}const cr=o.div`
466
+ `;function rr(){return Qt.jsxs(er,{children:[Qt.jsx("div",{className:"alert alert-danger",children:"Falha na conexão!"}),Qt.jsxs("div",{children:["Possíveis causas:",Qt.jsx("ul",{children:navigator.onLine?Qt.jsxs(Qt.Fragment,{children:[Qt.jsx("li",{children:"Você está sem conexão com a internet;"}),Qt.jsx("li",{children:"O servidor pode estar passando por uma atualização. Por favor, tente novamente em alguns instantes."}),Qt.jsx("li",{children:"O servidor pode estar temporariamente indisponível."})]}):Qt.jsx("li",{children:"Você está sem conexão com a internet;"})}),Qt.jsxs("div",{children:["Se o erro persistir, por favor, entre em contato com nosso suporte técnico:",Qt.jsxs("ul",{children:[Qt.jsxs("li",{children:["Fone e WhatsApp:"," ",Qt.jsx(Qe,{className:"numeros",children:"(27) 9 9774-2904"})]}),Qt.jsxs("li",{children:["E-mail:"," ",Qt.jsx(Je,{href:"suporte@jcinfoes.com.br?subject="+encodeURI("SIPAR - Sem conexão com o servidor!"),children:"suporte@jcinfoes.com.br"})]})]})]})]})]})}const nr={isError:!1,message:null,loading:!1,headers:null,data:null,error:null,code:0,status:503,report:!1,onBefore:null};function or(t={}){const r=a.useHistory(),n=new AbortController,{globalApiConfig:o}=ee(),[i,s]=e.useState(nr);return"string"==typeof t&&(t={url:t}),[async function(e){var i,a,l,c,h;let f,d={username:null==(i=o.auth)?void 0:i.username,password:null==(a=o.auth)?void 0:a.password};if(t.headers={...t.headers,...null==e?void 0:e.headers},o.getToken){let e=o.getToken();e&&(o.auth.prefix&&(e=`${o.auth.prefix} ${e}`),t.headers[o.auth.header]=e)}o.version&&(t.headers["x-ver"]=encodeURIComponent(o.version)),o.ident&&(t.headers["x-identify"]=encodeURIComponent(o.ident)),t.cache=Boolean(o.isProductionMode&&(!t.method||"get"==t.method)),t.cache&&await Ze.init(t);let p={baseURL:o.baseURL,timeout:o.timeout,auth:d,validateStatus:t=>t>=200&&t<400,...t,...e,headers:t.headers};p.report&&(p={...p,responseType:"blob",timeout:0}),s({...nr,loading:!0}),p.onBefore&&p.onBefore(p);try{const t=await u({...p,signal:n.signal});o.afterRequest&&o.afterRequest(t),f={...nr,data:t.data,message:t.statusText,status:t.status,headers:t.headers}}catch(m){const{ERR_NETWORK:t,ECONNABORTED:e,ETIMEDOUT:n}=u.AxiosError;if([t,e,n].includes(null==m?void 0:m.code))f={...nr,isError:!0,status:400,message:Qt.jsx(rr,{})};else if(m.response)switch(f={...nr,isError:!0,status:m.response.status,message:(null==(l=m.response.data)?void 0:l.error)||m.response.data,code:null==(c=m.response.data)?void 0:c.code},m.response.status){case 400:if("blob"==(null==p?void 0:p.responseType)){let t=await m.response.data.text();t=JSON.parse(t),f.message=t.error||"Ocorreu um erro ao consultar o servidor!"}break;case 401:f.message="Servidor requer autenticação!",o.setToken&&o.setToken(""),r.push(o.loginRoute);break;case 404:f.message="Servidor não possui este recurso!";break;case 405:f.message=`Método [${(null==(h=p.method)?void 0:h.toUpperCase())||"GET"}] indisponível!`}else f={...nr,isError:!0,message:m.message}}const g=`timeout of ${o.timeout}ms exceeded`;return f.message!=g&&"Network Error"!=f.message||(f.message="Sem conexão com o servidor!"),f.isError?f.error=f.message:f.error=null,(null==t?void 0:t.cache)&&await Ze.save(f,t),f={...f,loading:!1},s(f),(null==t?void 0:t.onTerminated)&&t.onTerminated(f),f},i,function(){n&&n.abort("Cancelado pelo usuário!")}]}let ir=null;function ar({url:t,file:n,fileTo:o,setLoading:i}){const[a,u]=e.useState(""),[l,c]=e.useState(!1),[h,f]=e.useState(0),[d,p]=e.useState(n),[g,m]=e.useState(""),[v,,y]=or({url:t,method:"post",data:{file:d},report:!0,onDownloadProgress:t=>{c(t.loaded>0),f(t.loaded/t.total*100)},onTerminated:t=>{if(204===t.status)return w(3);if(t.error)u(t.error),_();else{const[,n]=o.split(".");r.isDesktop()&&"pdf"==n.toLowerCase()?(e=t.data,m(URL.createObjectURL(e))):(s(t.data,function(){let t=o.split("."),e=`-${r.getDateTimeStr().replace(/\D/g,"")}-${r.getHash(o)}`;return t[0]+=e,t=t.join("."),t}()),p(""))}var e}});function _(){ir&&clearTimeout(ir)}function w(t){_(),ir=setTimeout(()=>v(),1e3*t)}return e.useEffect(()=>()=>_(),[]),e.useEffect(()=>()=>g&&URL.revokeObjectURL(g),[g]),e.useEffect(()=>{d?(i(!0),w(2)):i(!1)},[d]),Qt.jsxs(Qt.Fragment,{children:[Qt.jsxs("div",{className:"loading-report--area",children:[Qt.jsxs("div",{className:"loading-box",style:{display:g?"none":"block"},children:[Qt.jsx("button",{className:"btn-loading-close",title:"Cancelar",onClick:function(){l?y():u(""),i(!1)},children:Qt.jsx("i",{className:"fas fa-times"})}),Qt.jsxs("div",{className:"line",children:[l?Qt.jsx("i",{className:"fa-solid fa-file-arrow-down pulse"}):Qt.jsx("div",{className:"spinner"}),Qt.jsx("span",{children:l?"Baixando relatório...":"Gerando relatório..."})]}),Qt.jsx("div",{className:"pbar",children:Qt.jsx("div",{style:{width:`${h}%`}})})]}),g&&Qt.jsx(Xe,{fileTo:o,previewUrl:g,setVisible:()=>p(""),visible:!0})]}),a&&Qt.jsx(se,{onConfirm:()=>i(!1),children:a})]})}function sr({search:t,setSearch:n,fnSearch:o,fnFilter:a,fnValidateFilter:s,placeHolder:u,...l}){const c=e.useRef();return Qt.jsxs("div",{className:"inp-pesq--input-area",children:[Qt.jsxs(i.InputGroup,{children:[Qt.jsx(i.Input,{innerRef:c,value:t,onChange:t=>n(t.target.value),placeholder:u,...l}),Qt.jsx(i.Button,{color:"outline-secondary",type:"button",onClick:()=>{n(""),r.isDesktop()&&(null==c?void 0:c.current)&&c.current.focus()},title:"Limpar campo de pesquisa",children:Qt.jsx(xe,{})}),Qt.jsx(i.Button,{color:"info",title:"Pesquisar",onClick:o,type:o?"button":"submit",children:Qt.jsx(Se,{})})]}),a&&Qt.jsxs(i.Button,{type:"button",color:"outline-filter",className:"position-relative ip--btn-filter",title:"Filtros avançados",onClick:a,children:[Qt.jsx("i",{className:"fas fa-filter"}),Qt.jsx("span",{className:"ip--btn-caption",children:" Filtros"}),s&&s()&&Qt.jsx("span",{className:"position-absolute top-0 start-100 translate-middle \r\n p-2 bg-danger border border-light rounded-circle",children:Qt.jsx("span",{className:"visually-hidden",children:"Filtro ativo"})})]})]})}const ur=o.div`
467
467
  position: fixed;
468
468
  inset: 0 0 0;
469
469
  background-color: var(--jc-overlay-bg);
@@ -531,7 +531,7 @@
531
531
  ${t=>t.alignTop?"max-height: calc(100vh - 110px);":""}
532
532
  }
533
533
  }
534
- `,ur="modal-hide-sb";function lr({maxWidth:t,visible:n,setVisible:o,children:i,hideScrollBar:a=!0,id:s,alignTop:c}){const{addModal:u,removeModal:l}=ee(),[f]=e.useState(s||"modal-"+r.random());return e.useEffect(()=>(n?a&&document.body.classList.add(ur):(l(f),a&&document.body.classList.remove(ur)),()=>{l(f),a&&document.body.classList.remove(ur)}),[n,a]),e.useEffect(()=>{u(f,o)},[f]),n?Qt.jsx(cr,{alignTop:c,maxWidth:t,children:Qt.jsx("div",{className:"mod-panel",children:i})}):null}function fr({className:t="",...e}){return Qt.jsx("div",{className:`modal--body ${t}`,...e})}function dr({className:t="",...e}){return Qt.jsx("div",{className:`modal--content ${t}`,...e})}function hr({className:t="",setVisible:e,children:r,helpLink:n,...o}){return Qt.jsxs(Ue,{className:`modal--header ${t}`,...o,children:[Qt.jsx("span",{className:"pn-title",children:r}),n&&Qt.jsx(ke,{title:"Ir para a ajuda",onClick:()=>window.open(n,"_blank")}),Qt.jsx(Me,{type:"button",onClick:()=>e(!1)})]})}var pr,gr,mr,vr=(pr=function(t,e){return(pr=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}pr(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),yr=function(t){function e(e){var r,n,o,i=this.constructor,a=t.call(this,e)||this;return Object.defineProperty(a,"name",{value:i.name,enumerable:!1,configurable:!0}),r=a,n=i.prototype,(o=Object.setPrototypeOf)?o(r,n):r.__proto__=n,function(t,e){void 0===e&&(e=t.constructor);var r=Error.captureStackTrace;r&&r(t,e)}(a),a}return vr(e,t),e}(Error),_r=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),wr=function(t){function e(e){void 0===e&&(e=void 0);var r=t.call(this,e)||this;return r.message=e,r}return _r(e,t),e.prototype.getKind=function(){return this.constructor.kind},e.kind="Exception",e}(yr),br=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Cr=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return br(e,t),e.kind="ArgumentException",e}(wr),Ar=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Er=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Ar(e,t),e.kind="IllegalArgumentException",e}(wr),Ir=function(){function t(t){if(this.binarizer=t,null===t)throw new Er("Binarizer must be non-null.")}return t.prototype.getWidth=function(){return this.binarizer.getWidth()},t.prototype.getHeight=function(){return this.binarizer.getHeight()},t.prototype.getBlackRow=function(t,e){return this.binarizer.getBlackRow(t,e)},t.prototype.getBlackMatrix=function(){return null!==this.matrix&&void 0!==this.matrix||(this.matrix=this.binarizer.getBlackMatrix()),this.matrix},t.prototype.isCropSupported=function(){return this.binarizer.getLuminanceSource().isCropSupported()},t.prototype.crop=function(e,r,n,o){var i=this.binarizer.getLuminanceSource().crop(e,r,n,o);return new t(this.binarizer.createBinarizer(i))},t.prototype.isRotateSupported=function(){return this.binarizer.getLuminanceSource().isRotateSupported()},t.prototype.rotateCounterClockwise=function(){var e=this.binarizer.getLuminanceSource().rotateCounterClockwise();return new t(this.binarizer.createBinarizer(e))},t.prototype.rotateCounterClockwise45=function(){var e=this.binarizer.getLuminanceSource().rotateCounterClockwise45();return new t(this.binarizer.createBinarizer(e))},t.prototype.toString=function(){try{return this.getBlackMatrix().toString()}catch(t){return""}},t}(),Sr=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Or=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Sr(e,t),e.getChecksumInstance=function(){return new e},e.kind="ChecksumException",e}(wr),Tr=function(){function t(t){this.source=t}return t.prototype.getLuminanceSource=function(){return this.source},t.prototype.getWidth=function(){return this.source.getWidth()},t.prototype.getHeight=function(){return this.source.getHeight()},t}(),Nr=function(){function t(){}return t.arraycopy=function(t,e,r,n,o){for(;o--;)r[n++]=t[e++]},t.currentTimeMillis=function(){return Date.now()},t}(),xr=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Rr=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return xr(e,t),e.kind="IndexOutOfBoundsException",e}(wr),Dr=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Pr=function(t){function e(e,r){void 0===e&&(e=void 0),void 0===r&&(r=void 0);var n=t.call(this,r)||this;return n.index=e,n.message=r,n}return Dr(e,t),e.kind="ArrayIndexOutOfBoundsException",e}(Rr),Mr=function(){function t(){}return t.fill=function(t,e){for(var r=0,n=t.length;r<n;r++)t[r]=e},t.fillWithin=function(e,r,n,o){t.rangeCheck(e.length,r,n);for(var i=r;i<n;i++)e[i]=o},t.rangeCheck=function(t,e,r){if(e>r)throw new Er("fromIndex("+e+") > toIndex("+r+")");if(e<0)throw new Pr(e);if(r>t)throw new Pr(r)},t.asList=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return t},t.create=function(t,e,r){return Array.from({length:t}).map(function(t){return Array.from({length:e}).fill(r)})},t.createInt32Array=function(t,e,r){return Array.from({length:t}).map(function(t){return Int32Array.from({length:e}).fill(r)})},t.equals=function(t,e){if(!t)return!1;if(!e)return!1;if(!t.length)return!1;if(!e.length)return!1;if(t.length!==e.length)return!1;for(var r=0,n=t.length;r<n;r++)if(t[r]!==e[r])return!1;return!0},t.hashCode=function(t){var e,r;if(null===t)return 0;var n=1;try{for(var o=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}(t),i=o.next();!i.done;i=o.next())n=31*n+i.value}catch(a){e={error:a}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(e)throw e.error}}return n},t.fillUint8Array=function(t,e){for(var r=0;r!==t.length;r++)t[r]=e},t.copyOf=function(t,e){return t.slice(0,e)},t.copyOfUint8Array=function(t,e){if(t.length<=e){var r=new Uint8Array(e);return r.set(t),r}return t.slice(0,e)},t.copyOfRange=function(t,e,r){var n=r-e,o=new Int32Array(n);return Nr.arraycopy(t,e,o,0,n),o},t.binarySearch=function(e,r,n){void 0===n&&(n=t.numberComparator);for(var o=0,i=e.length-1;o<=i;){var a=i+o>>1,s=n(r,e[a]);if(s>0)o=a+1;else{if(!(s<0))return a;i=a-1}}return-o-1},t.numberComparator=function(t,e){return t-e},t}(),kr=function(){function t(){}return t.numberOfTrailingZeros=function(t){var e;if(0===t)return 32;var r=31;return 0!=(e=t<<16)&&(r-=16,t=e),0!=(e=t<<8)&&(r-=8,t=e),0!=(e=t<<4)&&(r-=4,t=e),0!=(e=t<<2)&&(r-=2,t=e),r-(t<<1>>>31)},t.numberOfLeadingZeros=function(t){if(0===t)return 32;var e=1;return t>>>16==0&&(e+=16,t<<=16),t>>>24==0&&(e+=8,t<<=8),t>>>28==0&&(e+=4,t<<=4),t>>>30==0&&(e+=2,t<<=2),e-(t>>>31)},t.toHexString=function(t){return t.toString(16)},t.toBinaryString=function(t){return String(parseInt(String(t),2))},t.bitCount=function(t){return t=(t=(858993459&(t-=t>>>1&1431655765))+(t>>>2&858993459))+(t>>>4)&252645135,63&(t+=t>>>8)+(t>>>16)},t.truncDivision=function(t,e){return Math.trunc(t/e)},t.parseInt=function(t,e){return void 0===e&&(e=void 0),parseInt(t,e)},t.MIN_VALUE_32_BITS=-2147483648,t.MAX_VALUE=Number.MAX_SAFE_INTEGER,t}(),Lr=function(){function t(e,r){void 0===e?(this.size=0,this.bits=new Int32Array(1)):(this.size=e,this.bits=null==r?t.makeArray(e):r)}return t.prototype.getSize=function(){return this.size},t.prototype.getSizeInBytes=function(){return Math.floor((this.size+7)/8)},t.prototype.ensureCapacity=function(e){if(e>32*this.bits.length){var r=t.makeArray(e);Nr.arraycopy(this.bits,0,r,0,this.bits.length),this.bits=r}},t.prototype.get=function(t){return!!(this.bits[Math.floor(t/32)]&1<<(31&t))},t.prototype.set=function(t){this.bits[Math.floor(t/32)]|=1<<(31&t)},t.prototype.flip=function(t){this.bits[Math.floor(t/32)]^=1<<(31&t)},t.prototype.getNextSet=function(t){var e=this.size;if(t>=e)return e;var r=this.bits,n=Math.floor(t/32),o=r[n];o&=~((1<<(31&t))-1);for(var i=r.length;0===o;){if(++n===i)return e;o=r[n]}var a=32*n+kr.numberOfTrailingZeros(o);return a>e?e:a},t.prototype.getNextUnset=function(t){var e=this.size;if(t>=e)return e;var r=this.bits,n=Math.floor(t/32),o=~r[n];o&=~((1<<(31&t))-1);for(var i=r.length;0===o;){if(++n===i)return e;o=~r[n]}var a=32*n+kr.numberOfTrailingZeros(o);return a>e?e:a},t.prototype.setBulk=function(t,e){this.bits[Math.floor(t/32)]=e},t.prototype.setRange=function(t,e){if(e<t||t<0||e>this.size)throw new Er;if(e!==t){e--;for(var r=Math.floor(t/32),n=Math.floor(e/32),o=this.bits,i=r;i<=n;i++){var a=(2<<(i<n?31:31&e))-(1<<(i>r?0:31&t));o[i]|=a}}},t.prototype.clear=function(){for(var t=this.bits.length,e=this.bits,r=0;r<t;r++)e[r]=0},t.prototype.isRange=function(t,e,r){if(e<t||t<0||e>this.size)throw new Er;if(e===t)return!0;e--;for(var n=Math.floor(t/32),o=Math.floor(e/32),i=this.bits,a=n;a<=o;a++){var s=(2<<(a<o?31:31&e))-(1<<(a>n?0:31&t))&4294967295;if((i[a]&s)!==(r?s:0))return!1}return!0},t.prototype.appendBit=function(t){this.ensureCapacity(this.size+1),t&&(this.bits[Math.floor(this.size/32)]|=1<<(31&this.size)),this.size++},t.prototype.appendBits=function(t,e){if(e<0||e>32)throw new Er("Num bits must be between 0 and 32");this.ensureCapacity(this.size+e);for(var r=e;r>0;r--)this.appendBit(1==(t>>r-1&1))},t.prototype.appendBitArray=function(t){var e=t.size;this.ensureCapacity(this.size+e);for(var r=0;r<e;r++)this.appendBit(t.get(r))},t.prototype.xor=function(t){if(this.size!==t.size)throw new Er("Sizes don't match");for(var e=this.bits,r=0,n=e.length;r<n;r++)e[r]^=t.bits[r]},t.prototype.toBytes=function(t,e,r,n){for(var o=0;o<n;o++){for(var i=0,a=0;a<8;a++)this.get(t)&&(i|=1<<7-a),t++;e[r+o]=i}},t.prototype.getBitArray=function(){return this.bits},t.prototype.reverse=function(){for(var t=new Int32Array(this.bits.length),e=Math.floor((this.size-1)/32),r=e+1,n=this.bits,o=0;o<r;o++){var i=n[o];i=(i=(i=(i=(i=i>>1&1431655765|(1431655765&i)<<1)>>2&858993459|(858993459&i)<<2)>>4&252645135|(252645135&i)<<4)>>8&16711935|(16711935&i)<<8)>>16&65535|(65535&i)<<16,t[e-o]=i}if(this.size!==32*r){var a=32*r-this.size,s=t[0]>>>a;for(o=1;o<r;o++){var c=t[o];s|=c<<32-a,t[o-1]=s,s=c>>>a}t[r-1]=s}this.bits=t},t.makeArray=function(t){return new Int32Array(Math.floor((t+31)/32))},t.prototype.equals=function(e){if(!(e instanceof t))return!1;var r=e;return this.size===r.size&&Mr.equals(this.bits,r.bits)},t.prototype.hashCode=function(){return 31*this.size+Mr.hashCode(this.bits)},t.prototype.toString=function(){for(var t="",e=0,r=this.size;e<r;e++)!(7&e)&&(t+=" "),t+=this.get(e)?"X":".";return t},t.prototype.clone=function(){return new t(this.size,this.bits.slice())},t}();(mr=gr||(gr={}))[mr.OTHER=0]="OTHER",mr[mr.PURE_BARCODE=1]="PURE_BARCODE",mr[mr.POSSIBLE_FORMATS=2]="POSSIBLE_FORMATS",mr[mr.TRY_HARDER=3]="TRY_HARDER",mr[mr.CHARACTER_SET=4]="CHARACTER_SET",mr[mr.ALLOWED_LENGTHS=5]="ALLOWED_LENGTHS",mr[mr.ASSUME_CODE_39_CHECK_DIGIT=6]="ASSUME_CODE_39_CHECK_DIGIT",mr[mr.ASSUME_GS1=7]="ASSUME_GS1",mr[mr.RETURN_CODABAR_START_END=8]="RETURN_CODABAR_START_END",mr[mr.NEED_RESULT_POINT_CALLBACK=9]="NEED_RESULT_POINT_CALLBACK",mr[mr.ALLOWED_EAN_EXTENSIONS=10]="ALLOWED_EAN_EXTENSIONS";var jr,Br=gr,Fr=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Vr=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Fr(e,t),e.getFormatInstance=function(){return new e},e.kind="FormatException",e}(wr);!function(t){t[t.Cp437=0]="Cp437",t[t.ISO8859_1=1]="ISO8859_1",t[t.ISO8859_2=2]="ISO8859_2",t[t.ISO8859_3=3]="ISO8859_3",t[t.ISO8859_4=4]="ISO8859_4",t[t.ISO8859_5=5]="ISO8859_5",t[t.ISO8859_6=6]="ISO8859_6",t[t.ISO8859_7=7]="ISO8859_7",t[t.ISO8859_8=8]="ISO8859_8",t[t.ISO8859_9=9]="ISO8859_9",t[t.ISO8859_10=10]="ISO8859_10",t[t.ISO8859_11=11]="ISO8859_11",t[t.ISO8859_13=12]="ISO8859_13",t[t.ISO8859_14=13]="ISO8859_14",t[t.ISO8859_15=14]="ISO8859_15",t[t.ISO8859_16=15]="ISO8859_16",t[t.SJIS=16]="SJIS",t[t.Cp1250=17]="Cp1250",t[t.Cp1251=18]="Cp1251",t[t.Cp1252=19]="Cp1252",t[t.Cp1256=20]="Cp1256",t[t.UnicodeBigUnmarked=21]="UnicodeBigUnmarked",t[t.UTF8=22]="UTF8",t[t.ASCII=23]="ASCII",t[t.Big5=24]="Big5",t[t.GB18030=25]="GB18030",t[t.EUC_KR=26]="EUC_KR"}(jr||(jr={}));var Hr,Ur=function(){function t(e,r,n){for(var o,i,a=[],s=3;s<arguments.length;s++)a[s-3]=arguments[s];this.valueIdentifier=e,this.name=n,this.values="number"==typeof r?Int32Array.from([r]):r,this.otherEncodingNames=a,t.VALUE_IDENTIFIER_TO_ECI.set(e,this),t.NAME_TO_ECI.set(n,this);for(var c=this.values,u=0,l=c.length;u!==l;u++){var f=c[u];t.VALUES_TO_ECI.set(f,this)}try{for(var d=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}(a),h=d.next();!h.done;h=d.next()){var p=h.value;t.NAME_TO_ECI.set(p,this)}}catch(g){o={error:g}}finally{try{h&&!h.done&&(i=d.return)&&i.call(d)}finally{if(o)throw o.error}}}return t.prototype.getValueIdentifier=function(){return this.valueIdentifier},t.prototype.getName=function(){return this.name},t.prototype.getValue=function(){return this.values[0]},t.getCharacterSetECIByValue=function(e){if(e<0||e>=900)throw new Vr("incorect value");var r=t.VALUES_TO_ECI.get(e);if(void 0===r)throw new Vr("incorect value");return r},t.getCharacterSetECIByName=function(e){var r=t.NAME_TO_ECI.get(e);if(void 0===r)throw new Vr("incorect value");return r},t.prototype.equals=function(e){if(!(e instanceof t))return!1;var r=e;return this.getName()===r.getName()},t.VALUE_IDENTIFIER_TO_ECI=new Map,t.VALUES_TO_ECI=new Map,t.NAME_TO_ECI=new Map,t.Cp437=new t(jr.Cp437,Int32Array.from([0,2]),"Cp437"),t.ISO8859_1=new t(jr.ISO8859_1,Int32Array.from([1,3]),"ISO-8859-1","ISO88591","ISO8859_1"),t.ISO8859_2=new t(jr.ISO8859_2,4,"ISO-8859-2","ISO88592","ISO8859_2"),t.ISO8859_3=new t(jr.ISO8859_3,5,"ISO-8859-3","ISO88593","ISO8859_3"),t.ISO8859_4=new t(jr.ISO8859_4,6,"ISO-8859-4","ISO88594","ISO8859_4"),t.ISO8859_5=new t(jr.ISO8859_5,7,"ISO-8859-5","ISO88595","ISO8859_5"),t.ISO8859_6=new t(jr.ISO8859_6,8,"ISO-8859-6","ISO88596","ISO8859_6"),t.ISO8859_7=new t(jr.ISO8859_7,9,"ISO-8859-7","ISO88597","ISO8859_7"),t.ISO8859_8=new t(jr.ISO8859_8,10,"ISO-8859-8","ISO88598","ISO8859_8"),t.ISO8859_9=new t(jr.ISO8859_9,11,"ISO-8859-9","ISO88599","ISO8859_9"),t.ISO8859_10=new t(jr.ISO8859_10,12,"ISO-8859-10","ISO885910","ISO8859_10"),t.ISO8859_11=new t(jr.ISO8859_11,13,"ISO-8859-11","ISO885911","ISO8859_11"),t.ISO8859_13=new t(jr.ISO8859_13,15,"ISO-8859-13","ISO885913","ISO8859_13"),t.ISO8859_14=new t(jr.ISO8859_14,16,"ISO-8859-14","ISO885914","ISO8859_14"),t.ISO8859_15=new t(jr.ISO8859_15,17,"ISO-8859-15","ISO885915","ISO8859_15"),t.ISO8859_16=new t(jr.ISO8859_16,18,"ISO-8859-16","ISO885916","ISO8859_16"),t.SJIS=new t(jr.SJIS,20,"SJIS","Shift_JIS"),t.Cp1250=new t(jr.Cp1250,21,"Cp1250","windows-1250"),t.Cp1251=new t(jr.Cp1251,22,"Cp1251","windows-1251"),t.Cp1252=new t(jr.Cp1252,23,"Cp1252","windows-1252"),t.Cp1256=new t(jr.Cp1256,24,"Cp1256","windows-1256"),t.UnicodeBigUnmarked=new t(jr.UnicodeBigUnmarked,25,"UnicodeBigUnmarked","UTF-16BE","UnicodeBig"),t.UTF8=new t(jr.UTF8,26,"UTF8","UTF-8"),t.ASCII=new t(jr.ASCII,Int32Array.from([27,170]),"ASCII","US-ASCII"),t.Big5=new t(jr.Big5,28,"Big5"),t.GB18030=new t(jr.GB18030,29,"GB18030","GB2312","EUC_CN","GBK"),t.EUC_KR=new t(jr.EUC_KR,30,"EUC_KR","EUC-KR"),t}(),Wr=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),zr=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Wr(e,t),e.kind="UnsupportedOperationException",e}(wr),Gr=function(){function t(){}return t.decode=function(t,e){var r=this.encodingName(e);return this.customDecoder?this.customDecoder(t,r):"undefined"==typeof TextDecoder||this.shouldDecodeOnFallback(r)?this.decodeFallback(t,r):new TextDecoder(r).decode(t)},t.shouldDecodeOnFallback=function(e){return!t.isBrowser()&&"ISO-8859-1"===e},t.encode=function(t,e){var r=this.encodingName(e);return this.customEncoder?this.customEncoder(t,r):"undefined"==typeof TextEncoder?this.encodeFallback(t):(new TextEncoder).encode(t)},t.isBrowser=function(){return"undefined"!=typeof window&&"[object Window]"==={}.toString.call(window)},t.encodingName=function(t){return"string"==typeof t?t:t.getName()},t.encodingCharacterSet=function(t){return t instanceof Ur?t:Ur.getCharacterSetECIByName(t)},t.decodeFallback=function(e,r){var n=this.encodingCharacterSet(r);if(t.isDecodeFallbackSupported(n)){for(var o="",i=0,a=e.length;i<a;i++){var s=e[i].toString(16);s.length<2&&(s="0"+s),o+="%"+s}return decodeURIComponent(o)}if(n.equals(Ur.UnicodeBigUnmarked))return String.fromCharCode.apply(null,new Uint16Array(e.buffer));throw new zr("Encoding "+this.encodingName(r)+" not supported by fallback.")},t.isDecodeFallbackSupported=function(t){return t.equals(Ur.UTF8)||t.equals(Ur.ISO8859_1)||t.equals(Ur.ASCII)},t.encodeFallback=function(t){for(var e=btoa(unescape(encodeURIComponent(t))).split(""),r=[],n=0;n<e.length;n++)r.push(e[n].charCodeAt(0));return new Uint8Array(r)},t}(),Xr=function(){function t(){}return t.castAsNonUtf8Char=function(t,e){void 0===e&&(e=null);var r=e?e.getName():this.ISO88591;return Gr.decode(new Uint8Array([t]),r)},t.guessEncoding=function(e,r){if(null!=r&&void 0!==r.get(Br.CHARACTER_SET))return r.get(Br.CHARACTER_SET).toString();for(var n=e.length,o=!0,i=!0,a=!0,s=0,c=0,u=0,l=0,f=0,d=0,h=0,p=0,g=0,m=0,v=0,y=e.length>3&&239===e[0]&&187===e[1]&&191===e[2],_=0;_<n&&(o||i||a);_++){var w=255&e[_];a&&(s>0?128&w?s--:a=!1:!!(128&w)&&(64&w?(s++,32&w?(s++,16&w?(s++,8&w?a=!1:l++):u++):c++):a=!1)),o&&(w>127&&w<160?o=!1:w>159&&(w<192||215===w||247===w)&&v++),i&&(f>0?w<64||127===w||w>252?i=!1:f--:128===w||160===w||w>239?i=!1:w>160&&w<224?(d++,p=0,++h>g&&(g=h)):w>127?(f++,h=0,++p>m&&(m=p)):(h=0,p=0))}return a&&s>0&&(a=!1),i&&f>0&&(i=!1),a&&(y||c+u+l>0)?t.UTF8:i&&(t.ASSUME_SHIFT_JIS||g>=3||m>=3)?t.SHIFT_JIS:o&&i?2===g&&2===d||10*v>=n?t.SHIFT_JIS:t.ISO88591:o?t.ISO88591:i?t.SHIFT_JIS:a?t.UTF8:t.PLATFORM_DEFAULT_ENCODING},t.format=function(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];var n=-1;return t.replace(/%(-)?(0?[0-9]+)?([.][0-9]+)?([#][0-9]+)?([scfpexd%])/g,function(t,r,o,i,a,s){if("%%"===t)return"%";if(void 0!==e[++n]){t=i?parseInt(i.substr(1)):void 0;var c,u=a?parseInt(a.substr(1)):void 0;switch(s){case"s":c=e[n];break;case"c":c=e[n][0];break;case"f":c=parseFloat(e[n]).toFixed(t);break;case"p":c=parseFloat(e[n]).toPrecision(t);break;case"e":c=parseFloat(e[n]).toExponential(t);break;case"x":c=parseInt(e[n]).toString(u||16);break;case"d":c=parseFloat(parseInt(e[n],u||10).toPrecision(t)).toFixed(0)}c="object"==typeof c?JSON.stringify(c):(+c).toString(u);for(var l=parseInt(o),f=o&&o[0]+""=="0"?"0":" ";c.length<l;)c=void 0!==r?c+f:f+c;return c}})},t.getBytes=function(t,e){return Gr.encode(t,e)},t.getCharCode=function(t,e){return void 0===e&&(e=0),t.charCodeAt(e)},t.getCharAt=function(t){return String.fromCharCode(t)},t.SHIFT_JIS=Ur.SJIS.getName(),t.GB2312="GB2312",t.ISO88591=Ur.ISO8859_1.getName(),t.EUC_JP="EUC_JP",t.UTF8=Ur.UTF8.getName(),t.PLATFORM_DEFAULT_ENCODING=t.UTF8,t.ASSUME_SHIFT_JIS=!1,t}(),$r=function(){function t(t){void 0===t&&(t=""),this.value=t}return t.prototype.enableDecoding=function(t){return this.encoding=t,this},t.prototype.append=function(t){return"string"==typeof t?this.value+=t.toString():this.encoding?this.value+=Xr.castAsNonUtf8Char(t,this.encoding):this.value+=String.fromCharCode(t),this},t.prototype.appendChars=function(t,e,r){for(var n=e;e<e+r;n++)this.append(t[n]);return this},t.prototype.length=function(){return this.value.length},t.prototype.charAt=function(t){return this.value.charAt(t)},t.prototype.deleteCharAt=function(t){this.value=this.value.substr(0,t)+this.value.substring(t+1)},t.prototype.setCharAt=function(t,e){this.value=this.value.substr(0,t)+e+this.value.substr(t+1)},t.prototype.substring=function(t,e){return this.value.substring(t,e)},t.prototype.setLengthToZero=function(){this.value=""},t.prototype.toString=function(){return this.value},t.prototype.insert=function(t,e){this.value=this.value.substr(0,t)+e+this.value.substr(t+e.length)},t}(),Yr=function(){function t(t,e,r,n){if(this.width=t,this.height=e,this.rowSize=r,this.bits=n,null==e&&(e=t),this.height=e,t<1||e<1)throw new Er("Both dimensions must be greater than 0");null==r&&(r=Math.floor((t+31)/32)),this.rowSize=r,null==n&&(this.bits=new Int32Array(this.rowSize*this.height))}return t.parseFromBooleanArray=function(e){for(var r=e.length,n=e[0].length,o=new t(n,r),i=0;i<r;i++)for(var a=e[i],s=0;s<n;s++)a[s]&&o.set(s,i);return o},t.parseFromString=function(e,r,n){if(null===e)throw new Er("stringRepresentation cannot be null");for(var o=new Array(e.length),i=0,a=0,s=-1,c=0,u=0;u<e.length;)if("\n"===e.charAt(u)||"\r"===e.charAt(u)){if(i>a){if(-1===s)s=i-a;else if(i-a!==s)throw new Er("row lengths do not match");a=i,c++}u++}else if(e.substring(u,u+r.length)===r)u+=r.length,o[i]=!0,i++;else{if(e.substring(u,u+n.length)!==n)throw new Er("illegal character encountered: "+e.substring(u));u+=n.length,o[i]=!1,i++}if(i>a){if(-1===s)s=i-a;else if(i-a!==s)throw new Er("row lengths do not match");c++}for(var l=new t(s,c),f=0;f<i;f++)o[f]&&l.set(Math.floor(f%s),Math.floor(f/s));return l},t.prototype.get=function(t,e){var r=e*this.rowSize+Math.floor(t/32);return!!(this.bits[r]>>>(31&t)&1)},t.prototype.set=function(t,e){var r=e*this.rowSize+Math.floor(t/32);this.bits[r]|=1<<(31&t)&4294967295},t.prototype.unset=function(t,e){var r=e*this.rowSize+Math.floor(t/32);this.bits[r]&=~(1<<(31&t)&4294967295)},t.prototype.flip=function(t,e){var r=e*this.rowSize+Math.floor(t/32);this.bits[r]^=1<<(31&t)&4294967295},t.prototype.xor=function(t){if(this.width!==t.getWidth()||this.height!==t.getHeight()||this.rowSize!==t.getRowSize())throw new Er("input matrix dimensions do not match");for(var e=new Lr(Math.floor(this.width/32)+1),r=this.rowSize,n=this.bits,o=0,i=this.height;o<i;o++)for(var a=o*r,s=t.getRow(o,e).getBitArray(),c=0;c<r;c++)n[a+c]^=s[c]},t.prototype.clear=function(){for(var t=this.bits,e=t.length,r=0;r<e;r++)t[r]=0},t.prototype.setRegion=function(t,e,r,n){if(e<0||t<0)throw new Er("Left and top must be nonnegative");if(n<1||r<1)throw new Er("Height and width must be at least 1");var o=t+r,i=e+n;if(i>this.height||o>this.width)throw new Er("The region must fit inside the matrix");for(var a=this.rowSize,s=this.bits,c=e;c<i;c++)for(var u=c*a,l=t;l<o;l++)s[u+Math.floor(l/32)]|=1<<(31&l)&4294967295},t.prototype.getRow=function(t,e){null==e||e.getSize()<this.width?e=new Lr(this.width):e.clear();for(var r=this.rowSize,n=this.bits,o=t*r,i=0;i<r;i++)e.setBulk(32*i,n[o+i]);return e},t.prototype.setRow=function(t,e){Nr.arraycopy(e.getBitArray(),0,this.bits,t*this.rowSize,this.rowSize)},t.prototype.rotate180=function(){for(var t=this.getWidth(),e=this.getHeight(),r=new Lr(t),n=new Lr(t),o=0,i=Math.floor((e+1)/2);o<i;o++)r=this.getRow(o,r),n=this.getRow(e-1-o,n),r.reverse(),n.reverse(),this.setRow(o,n),this.setRow(e-1-o,r)},t.prototype.getEnclosingRectangle=function(){for(var t=this.width,e=this.height,r=this.rowSize,n=this.bits,o=t,i=e,a=-1,s=-1,c=0;c<e;c++)for(var u=0;u<r;u++){var l=n[c*r+u];if(0!==l){if(c<i&&(i=c),c>s&&(s=c),32*u<o){for(var f=0;!(l<<31-f&4294967295);)f++;32*u+f<o&&(o=32*u+f)}if(32*u+31>a){for(f=31;l>>>f==0;)f--;32*u+f>a&&(a=32*u+f)}}}return a<o||s<i?null:Int32Array.from([o,i,a-o+1,s-i+1])},t.prototype.getTopLeftOnBit=function(){for(var t=this.rowSize,e=this.bits,r=0;r<e.length&&0===e[r];)r++;if(r===e.length)return null;for(var n=r/t,o=r%t*32,i=e[r],a=0;!(i<<31-a&4294967295);)a++;return o+=a,Int32Array.from([o,n])},t.prototype.getBottomRightOnBit=function(){for(var t=this.rowSize,e=this.bits,r=e.length-1;r>=0&&0===e[r];)r--;if(r<0)return null;for(var n=Math.floor(r/t),o=32*Math.floor(r%t),i=e[r],a=31;i>>>a==0;)a--;return o+=a,Int32Array.from([o,n])},t.prototype.getWidth=function(){return this.width},t.prototype.getHeight=function(){return this.height},t.prototype.getRowSize=function(){return this.rowSize},t.prototype.equals=function(e){if(!(e instanceof t))return!1;var r=e;return this.width===r.width&&this.height===r.height&&this.rowSize===r.rowSize&&Mr.equals(this.bits,r.bits)},t.prototype.hashCode=function(){var t=this.width;return 31*(t=31*(t=31*(t=31*t+this.width)+this.height)+this.rowSize)+Mr.hashCode(this.bits)},t.prototype.toString=function(t,e,r){return void 0===t&&(t="X "),void 0===e&&(e=" "),void 0===r&&(r="\n"),this.buildToString(t,e,r)},t.prototype.buildToString=function(t,e,r){for(var n=new $r,o=0,i=this.height;o<i;o++){for(var a=0,s=this.width;a<s;a++)n.append(this.get(a,o)?t:e);n.append(r)}return n.toString()},t.prototype.clone=function(){return new t(this.width,this.height,this.rowSize,this.bits.slice())},t}(),qr=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Kr=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return qr(e,t),e.getNotFoundInstance=function(){return new e},e.kind="NotFoundException",e}(wr),Zr=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Qr=function(t){function e(r){var n=t.call(this,r)||this;return n.luminances=e.EMPTY,n.buckets=new Int32Array(e.LUMINANCE_BUCKETS),n}return Zr(e,t),e.prototype.getBlackRow=function(t,r){var n=this.getLuminanceSource(),o=n.getWidth();null==r||r.getSize()<o?r=new Lr(o):r.clear(),this.initArrays(o);for(var i=n.getRow(t,this.luminances),a=this.buckets,s=0;s<o;s++)a[(255&i[s])>>e.LUMINANCE_SHIFT]++;var c=e.estimateBlackPoint(a);if(o<3)for(s=0;s<o;s++)(255&i[s])<c&&r.set(s);else{var u=255&i[0],l=255&i[1];for(s=1;s<o-1;s++){var f=255&i[s+1];(4*l-u-f)/2<c&&r.set(s),u=l,l=f}}return r},e.prototype.getBlackMatrix=function(){var t=this.getLuminanceSource(),r=t.getWidth(),n=t.getHeight(),o=new Yr(r,n);this.initArrays(r);for(var i=this.buckets,a=1;a<5;a++)for(var s=Math.floor(n*a/5),c=t.getRow(s,this.luminances),u=Math.floor(4*r/5),l=Math.floor(r/5);l<u;l++)i[(255&c[l])>>e.LUMINANCE_SHIFT]++;var f=e.estimateBlackPoint(i),d=t.getMatrix();for(a=0;a<n;a++){var h=a*r;for(l=0;l<r;l++)(255&d[h+l])<f&&o.set(l,a)}return o},e.prototype.createBinarizer=function(t){return new e(t)},e.prototype.initArrays=function(t){this.luminances.length<t&&(this.luminances=new Uint8ClampedArray(t));for(var r=this.buckets,n=0;n<e.LUMINANCE_BUCKETS;n++)r[n]=0},e.estimateBlackPoint=function(t){for(var r=t.length,n=0,o=0,i=0,a=0;a<r;a++)t[a]>i&&(o=a,i=t[a]),t[a]>n&&(n=t[a]);var s=0,c=0;for(a=0;a<r;a++){var u=a-o;(h=t[a]*u*u)>c&&(s=a,c=h)}if(o>s){var l=o;o=s,s=l}if(s-o<=r/16)throw new Kr;var f=s-1,d=-1;for(a=s-1;a>o;a--){var h,p=a-o;(h=p*p*(s-a)*(n-t[a]))>d&&(f=a,d=h)}return f<<e.LUMINANCE_SHIFT},e.LUMINANCE_BITS=5,e.LUMINANCE_SHIFT=8-e.LUMINANCE_BITS,e.LUMINANCE_BUCKETS=1<<e.LUMINANCE_BITS,e.EMPTY=Uint8ClampedArray.from([0]),e}(Tr),Jr=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),tn=function(t){function e(e){var r=t.call(this,e)||this;return r.matrix=null,r}return Jr(e,t),e.prototype.getBlackMatrix=function(){if(null!==this.matrix)return this.matrix;var r=this.getLuminanceSource(),n=r.getWidth(),o=r.getHeight();if(n>=e.MINIMUM_DIMENSION&&o>=e.MINIMUM_DIMENSION){var i=r.getMatrix(),a=n>>e.BLOCK_SIZE_POWER;0!=(n&e.BLOCK_SIZE_MASK)&&a++;var s=o>>e.BLOCK_SIZE_POWER;0!=(o&e.BLOCK_SIZE_MASK)&&s++;var c=e.calculateBlackPoints(i,a,s,n,o),u=new Yr(n,o);e.calculateThresholdForBlock(i,a,s,n,o,c,u),this.matrix=u}else this.matrix=t.prototype.getBlackMatrix.call(this);return this.matrix},e.prototype.createBinarizer=function(t){return new e(t)},e.calculateThresholdForBlock=function(t,r,n,o,i,a,s){for(var c=i-e.BLOCK_SIZE,u=o-e.BLOCK_SIZE,l=0;l<n;l++){var f=l<<e.BLOCK_SIZE_POWER;f>c&&(f=c);for(var d=e.cap(l,2,n-3),h=0;h<r;h++){var p=h<<e.BLOCK_SIZE_POWER;p>u&&(p=u);for(var g=e.cap(h,2,r-3),m=0,v=-2;v<=2;v++){var y=a[d+v];m+=y[g-2]+y[g-1]+y[g]+y[g+1]+y[g+2]}var _=m/25;e.thresholdBlock(t,p,f,_,o,s)}}},e.cap=function(t,e,r){return t<e?e:t>r?r:t},e.thresholdBlock=function(t,r,n,o,i,a){for(var s=0,c=n*i+r;s<e.BLOCK_SIZE;s++,c+=i)for(var u=0;u<e.BLOCK_SIZE;u++)(255&t[c+u])<=o&&a.set(r+u,n+s)},e.calculateBlackPoints=function(t,r,n,o,i){for(var a=i-e.BLOCK_SIZE,s=o-e.BLOCK_SIZE,c=new Array(n),u=0;u<n;u++){c[u]=new Int32Array(r);var l=u<<e.BLOCK_SIZE_POWER;l>a&&(l=a);for(var f=0;f<r;f++){var d=f<<e.BLOCK_SIZE_POWER;d>s&&(d=s);for(var h=0,p=255,g=0,m=0,v=l*o+d;m<e.BLOCK_SIZE;m++,v+=o){for(var y=0;y<e.BLOCK_SIZE;y++){var _=255&t[v+y];h+=_,_<p&&(p=_),_>g&&(g=_)}if(g-p>e.MIN_DYNAMIC_RANGE)for(m++,v+=o;m<e.BLOCK_SIZE;m++,v+=o)for(y=0;y<e.BLOCK_SIZE;y++)h+=255&t[v+y]}var w=h>>2*e.BLOCK_SIZE_POWER;if(g-p<=e.MIN_DYNAMIC_RANGE&&(w=p/2,u>0&&f>0)){var b=(c[u-1][f]+2*c[u][f-1]+c[u-1][f-1])/4;p<b&&(w=b)}c[u][f]=w}}return c},e.BLOCK_SIZE_POWER=3,e.BLOCK_SIZE=1<<e.BLOCK_SIZE_POWER,e.BLOCK_SIZE_MASK=e.BLOCK_SIZE-1,e.MINIMUM_DIMENSION=5*e.BLOCK_SIZE,e.MIN_DYNAMIC_RANGE=24,e}(Qr),en=function(){function t(t,e){this.width=t,this.height=e}return t.prototype.getWidth=function(){return this.width},t.prototype.getHeight=function(){return this.height},t.prototype.isCropSupported=function(){return!1},t.prototype.crop=function(t,e,r,n){throw new zr("This luminance source does not support cropping.")},t.prototype.isRotateSupported=function(){return!1},t.prototype.rotateCounterClockwise=function(){throw new zr("This luminance source does not support rotation by 90 degrees.")},t.prototype.rotateCounterClockwise45=function(){throw new zr("This luminance source does not support rotation by 45 degrees.")},t.prototype.toString=function(){for(var t=new Uint8ClampedArray(this.width),e=new $r,r=0;r<this.height;r++){for(var n=this.getRow(r,t),o=0;o<this.width;o++){var i,a=255&n[o];i=a<64?"#":a<128?"+":a<192?".":" ",e.append(i)}e.append("\n")}return e.toString()},t}(),rn=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),nn=function(t){function e(e){var r=t.call(this,e.getWidth(),e.getHeight())||this;return r.delegate=e,r}return rn(e,t),e.prototype.getRow=function(t,e){for(var r=this.delegate.getRow(t,e),n=this.getWidth(),o=0;o<n;o++)r[o]=255-(255&r[o]);return r},e.prototype.getMatrix=function(){for(var t=this.delegate.getMatrix(),e=this.getWidth()*this.getHeight(),r=new Uint8ClampedArray(e),n=0;n<e;n++)r[n]=255-(255&t[n]);return r},e.prototype.isCropSupported=function(){return this.delegate.isCropSupported()},e.prototype.crop=function(t,r,n,o){return new e(this.delegate.crop(t,r,n,o))},e.prototype.isRotateSupported=function(){return this.delegate.isRotateSupported()},e.prototype.invert=function(){return this.delegate},e.prototype.rotateCounterClockwise=function(){return new e(this.delegate.rotateCounterClockwise())},e.prototype.rotateCounterClockwise45=function(){return new e(this.delegate.rotateCounterClockwise45())},e}(en),on=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),an=function(t){function e(r){var n=t.call(this,r.width,r.height)||this;return n.canvas=r,n.tempCanvasElement=null,n.buffer=e.makeBufferFromCanvasImageData(r),n}return on(e,t),e.makeBufferFromCanvasImageData=function(t){var r=t.getContext("2d").getImageData(0,0,t.width,t.height);return e.toGrayscaleBuffer(r.data,t.width,t.height)},e.toGrayscaleBuffer=function(t,e,r){for(var n=new Uint8ClampedArray(e*r),o=0,i=0,a=t.length;o<a;o+=4,i++){var s=void 0;s=0===t[o+3]?255:306*t[o]+601*t[o+1]+117*t[o+2]+512>>10,n[i]=s}return n},e.prototype.getRow=function(t,e){if(t<0||t>=this.getHeight())throw new Er("Requested row is outside the image: "+t);var r=this.getWidth(),n=t*r;return null===e?e=this.buffer.slice(n,n+r):(e.length<r&&(e=new Uint8ClampedArray(r)),e.set(this.buffer.slice(n,n+r))),e},e.prototype.getMatrix=function(){return this.buffer},e.prototype.isCropSupported=function(){return!0},e.prototype.crop=function(e,r,n,o){return t.prototype.crop.call(this,e,r,n,o),this},e.prototype.isRotateSupported=function(){return!0},e.prototype.rotateCounterClockwise=function(){return this.rotate(-90),this},e.prototype.rotateCounterClockwise45=function(){return this.rotate(-45),this},e.prototype.getTempCanvasElement=function(){if(null===this.tempCanvasElement){var t=this.canvas.ownerDocument.createElement("canvas");t.width=this.canvas.width,t.height=this.canvas.height,this.tempCanvasElement=t}return this.tempCanvasElement},e.prototype.rotate=function(t){var r=this.getTempCanvasElement(),n=r.getContext("2d"),o=t*e.DEGREE_TO_RADIANS,i=this.canvas.width,a=this.canvas.height,s=Math.ceil(Math.abs(Math.cos(o))*i+Math.abs(Math.sin(o))*a),c=Math.ceil(Math.abs(Math.sin(o))*i+Math.abs(Math.cos(o))*a);return r.width=s,r.height=c,n.translate(s/2,c/2),n.rotate(o),n.drawImage(this.canvas,i/-2,a/-2),this.buffer=e.makeBufferFromCanvasImageData(r),this},e.prototype.invert=function(){return new nn(this)},e.DEGREE_TO_RADIANS=Math.PI/180,e}(en),sn=function(){function t(t,e,r){this.deviceId=t,this.label=e,this.kind="videoinput",this.groupId=r||void 0}return t.prototype.toJSON=function(){return{kind:this.kind,groupId:this.groupId,deviceId:this.deviceId,label:this.label}},t}(),cn=function(t,e,r,n){return new(r||(r=Promise))(function(e,o){function i(t){try{s(n.next(t))}catch(e){o(e)}}function a(t){try{s(n.throw(t))}catch(e){o(e)}}function s(t){var n;t.done?e(t.value):(n=t.value,n instanceof r?n:new r(function(t){t(n)})).then(i,a)}s((n=n.apply(t,[])).next())})},un=function(t,e){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(s){i=[6,s],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},ln=function(){function t(t,e,r){void 0===e&&(e=500),this.reader=t,this.timeBetweenScansMillis=e,this._hints=r,this._stopContinuousDecode=!1,this._stopAsyncDecode=!1,this._timeBetweenDecodingAttempts=0}return Object.defineProperty(t.prototype,"hasNavigator",{get:function(){return"undefined"!=typeof navigator},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isMediaDevicesSuported",{get:function(){return this.hasNavigator&&!!navigator.mediaDevices},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"canEnumerateDevices",{get:function(){return!(!this.isMediaDevicesSuported||!navigator.mediaDevices.enumerateDevices)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"timeBetweenDecodingAttempts",{get:function(){return this._timeBetweenDecodingAttempts},set:function(t){this._timeBetweenDecodingAttempts=t<0?0:t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"hints",{get:function(){return this._hints},set:function(t){this._hints=t||null},enumerable:!1,configurable:!0}),t.prototype.listVideoInputDevices=function(){return cn(this,0,void 0,function(){var t,e,r,n,o,i,a,s,c,u,l,f;return un(this,function(d){switch(d.label){case 0:if(!this.hasNavigator)throw new Error("Can't enumerate devices, navigator is not present.");if(!this.canEnumerateDevices)throw new Error("Can't enumerate devices, method not supported.");return[4,navigator.mediaDevices.enumerateDevices()];case 1:t=d.sent(),e=[];try{for(r=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}(t),n=r.next();!n.done;n=r.next())o=n.value,"videoinput"===(i="video"===o.kind?"videoinput":o.kind)&&(a=o.deviceId||o.id,s=o.label||"Video device "+(e.length+1),c=o.groupId,u={deviceId:a,label:s,kind:i,groupId:c},e.push(u))}catch(h){l={error:h}}finally{try{n&&!n.done&&(f=r.return)&&f.call(r)}finally{if(l)throw l.error}}return[2,e]}})})},t.prototype.getVideoInputDevices=function(){return cn(this,0,void 0,function(){return un(this,function(t){switch(t.label){case 0:return[4,this.listVideoInputDevices()];case 1:return[2,t.sent().map(function(t){return new sn(t.deviceId,t.label)})]}})})},t.prototype.findDeviceById=function(t){return cn(this,0,void 0,function(){var e;return un(this,function(r){switch(r.label){case 0:return[4,this.listVideoInputDevices()];case 1:return(e=r.sent())?[2,e.find(function(e){return e.deviceId===t})]:[2,null]}})})},t.prototype.decodeFromInputVideoDevice=function(t,e){return cn(this,0,void 0,function(){return un(this,function(r){switch(r.label){case 0:return[4,this.decodeOnceFromVideoDevice(t,e)];case 1:return[2,r.sent()]}})})},t.prototype.decodeOnceFromVideoDevice=function(t,e){return cn(this,0,void 0,function(){var r;return un(this,function(n){switch(n.label){case 0:return this.reset(),r={video:t?{deviceId:{exact:t}}:{facingMode:"environment"}},[4,this.decodeOnceFromConstraints(r,e)];case 1:return[2,n.sent()]}})})},t.prototype.decodeOnceFromConstraints=function(t,e){return cn(this,0,void 0,function(){var r;return un(this,function(n){switch(n.label){case 0:return[4,navigator.mediaDevices.getUserMedia(t)];case 1:return r=n.sent(),[4,this.decodeOnceFromStream(r,e)];case 2:return[2,n.sent()]}})})},t.prototype.decodeOnceFromStream=function(t,e){return cn(this,0,void 0,function(){var r;return un(this,function(n){switch(n.label){case 0:return this.reset(),[4,this.attachStreamToVideo(t,e)];case 1:return r=n.sent(),[4,this.decodeOnce(r)];case 2:return[2,n.sent()]}})})},t.prototype.decodeFromInputVideoDeviceContinuously=function(t,e,r){return cn(this,0,void 0,function(){return un(this,function(n){switch(n.label){case 0:return[4,this.decodeFromVideoDevice(t,e,r)];case 1:return[2,n.sent()]}})})},t.prototype.decodeFromVideoDevice=function(t,e,r){return cn(this,0,void 0,function(){var n;return un(this,function(o){switch(o.label){case 0:return n={video:t?{deviceId:{exact:t}}:{facingMode:"environment"}},[4,this.decodeFromConstraints(n,e,r)];case 1:return[2,o.sent()]}})})},t.prototype.decodeFromConstraints=function(t,e,r){return cn(this,0,void 0,function(){var n;return un(this,function(o){switch(o.label){case 0:return[4,navigator.mediaDevices.getUserMedia(t)];case 1:return n=o.sent(),[4,this.decodeFromStream(n,e,r)];case 2:return[2,o.sent()]}})})},t.prototype.decodeFromStream=function(t,e,r){return cn(this,0,void 0,function(){var n;return un(this,function(o){switch(o.label){case 0:return this.reset(),[4,this.attachStreamToVideo(t,e)];case 1:return n=o.sent(),[4,this.decodeContinuously(n,r)];case 2:return[2,o.sent()]}})})},t.prototype.stopAsyncDecode=function(){this._stopAsyncDecode=!0},t.prototype.stopContinuousDecode=function(){this._stopContinuousDecode=!0},t.prototype.attachStreamToVideo=function(t,e){return cn(this,0,void 0,function(){var r;return un(this,function(n){switch(n.label){case 0:return r=this.prepareVideoElement(e),this.addVideoSource(r,t),this.videoElement=r,this.stream=t,[4,this.playVideoOnLoadAsync(r)];case 1:return n.sent(),[2,r]}})})},t.prototype.playVideoOnLoadAsync=function(t){var e=this;return new Promise(function(r,n){return e.playVideoOnLoad(t,function(){return r()})})},t.prototype.playVideoOnLoad=function(t,e){var r=this;this.videoEndedListener=function(){return r.stopStreams()},this.videoCanPlayListener=function(){return r.tryPlayVideo(t)},t.addEventListener("ended",this.videoEndedListener),t.addEventListener("canplay",this.videoCanPlayListener),t.addEventListener("playing",e),this.tryPlayVideo(t)},t.prototype.isVideoPlaying=function(t){return t.currentTime>0&&!t.paused&&!t.ended&&t.readyState>2},t.prototype.tryPlayVideo=function(t){return cn(this,0,void 0,function(){return un(this,function(e){switch(e.label){case 0:if(this.isVideoPlaying(t))return console.warn("Trying to play video that is already playing."),[2];e.label=1;case 1:return e.trys.push([1,3,,4]),[4,t.play()];case 2:return e.sent(),[3,4];case 3:return e.sent(),console.warn("It was not possible to play the video."),[3,4];case 4:return[2]}})})},t.prototype.getMediaElement=function(t,e){var r=document.getElementById(t);if(!r)throw new Cr("element with id '"+t+"' not found");if(r.nodeName.toLowerCase()!==e.toLowerCase())throw new Cr("element with id '"+t+"' must be an "+e+" element");return r},t.prototype.decodeFromImage=function(t,e){if(!t&&!e)throw new Cr("either imageElement with a src set or an url must be provided");return e&&!t?this.decodeFromImageUrl(e):this.decodeFromImageElement(t)},t.prototype.decodeFromVideo=function(t,e){if(!t&&!e)throw new Cr("Either an element with a src set or an URL must be provided");return e&&!t?this.decodeFromVideoUrl(e):this.decodeFromVideoElement(t)},t.prototype.decodeFromVideoContinuously=function(t,e,r){if(void 0===t&&void 0===e)throw new Cr("Either an element with a src set or an URL must be provided");return e&&!t?this.decodeFromVideoUrlContinuously(e,r):this.decodeFromVideoElementContinuously(t,r)},t.prototype.decodeFromImageElement=function(t){if(!t)throw new Cr("An image element must be provided.");this.reset();var e=this.prepareImageElement(t);return this.imageElement=e,this.isImageLoaded(e)?this.decodeOnce(e,!1,!0):this._decodeOnLoadImage(e)},t.prototype.decodeFromVideoElement=function(t){var e=this._decodeFromVideoElementSetup(t);return this._decodeOnLoadVideo(e)},t.prototype.decodeFromVideoElementContinuously=function(t,e){var r=this._decodeFromVideoElementSetup(t);return this._decodeOnLoadVideoContinuously(r,e)},t.prototype._decodeFromVideoElementSetup=function(t){if(!t)throw new Cr("A video element must be provided.");this.reset();var e=this.prepareVideoElement(t);return this.videoElement=e,e},t.prototype.decodeFromImageUrl=function(t){if(!t)throw new Cr("An URL must be provided.");this.reset();var e=this.prepareImageElement();this.imageElement=e;var r=this._decodeOnLoadImage(e);return e.src=t,r},t.prototype.decodeFromVideoUrl=function(t){if(!t)throw new Cr("An URL must be provided.");this.reset();var e=this.prepareVideoElement(),r=this.decodeFromVideoElement(e);return e.src=t,r},t.prototype.decodeFromVideoUrlContinuously=function(t,e){if(!t)throw new Cr("An URL must be provided.");this.reset();var r=this.prepareVideoElement(),n=this.decodeFromVideoElementContinuously(r,e);return r.src=t,n},t.prototype._decodeOnLoadImage=function(t){var e=this;return new Promise(function(r,n){e.imageLoadedListener=function(){return e.decodeOnce(t,!1,!0).then(r,n)},t.addEventListener("load",e.imageLoadedListener)})},t.prototype._decodeOnLoadVideo=function(t){return cn(this,0,void 0,function(){return un(this,function(e){switch(e.label){case 0:return[4,this.playVideoOnLoadAsync(t)];case 1:return e.sent(),[4,this.decodeOnce(t)];case 2:return[2,e.sent()]}})})},t.prototype._decodeOnLoadVideoContinuously=function(t,e){return cn(this,0,void 0,function(){return un(this,function(r){switch(r.label){case 0:return[4,this.playVideoOnLoadAsync(t)];case 1:return r.sent(),this.decodeContinuously(t,e),[2]}})})},t.prototype.isImageLoaded=function(t){return!!t.complete&&0!==t.naturalWidth},t.prototype.prepareImageElement=function(t){var e;return void 0===t&&((e=document.createElement("img")).width=200,e.height=200),"string"==typeof t&&(e=this.getMediaElement(t,"img")),t instanceof HTMLImageElement&&(e=t),e},t.prototype.prepareVideoElement=function(t){var e;return t||"undefined"==typeof document||((e=document.createElement("video")).width=200,e.height=200),"string"==typeof t&&(e=this.getMediaElement(t,"video")),t instanceof HTMLVideoElement&&(e=t),e.setAttribute("autoplay","true"),e.setAttribute("muted","true"),e.setAttribute("playsinline","true"),e},t.prototype.decodeOnce=function(t,e,r){var n=this;void 0===e&&(e=!0),void 0===r&&(r=!0),this._stopAsyncDecode=!1;var o=function(i,a){if(n._stopAsyncDecode)return a(new Kr("Video stream has ended before any code could be detected.")),void(n._stopAsyncDecode=void 0);try{i(n.decode(t))}catch(s){if(e&&s instanceof Kr||(s instanceof Or||s instanceof Vr)&&r)return setTimeout(o,n._timeBetweenDecodingAttempts,i,a);a(s)}};return new Promise(function(t,e){return o(t,e)})},t.prototype.decodeContinuously=function(t,e){var r=this;this._stopContinuousDecode=!1;var n=function(){if(r._stopContinuousDecode)r._stopContinuousDecode=void 0;else try{var o=r.decode(t);e(o,null),setTimeout(n,r.timeBetweenScansMillis)}catch(i){e(null,i),(i instanceof Or||i instanceof Vr||i instanceof Kr)&&setTimeout(n,r._timeBetweenDecodingAttempts)}};n()},t.prototype.decode=function(t){var e=this.createBinaryBitmap(t);return this.decodeBitmap(e)},t.prototype.createBinaryBitmap=function(t){var e=this.getCaptureCanvasContext(t);this.drawImageOnCanvas(e,t);var r=this.getCaptureCanvas(t),n=new an(r),o=new tn(n);return new Ir(o)},t.prototype.getCaptureCanvasContext=function(t){if(!this.captureCanvasContext){var e=this.getCaptureCanvas(t).getContext("2d");this.captureCanvasContext=e}return this.captureCanvasContext},t.prototype.getCaptureCanvas=function(t){if(!this.captureCanvas){var e=this.createCaptureCanvas(t);this.captureCanvas=e}return this.captureCanvas},t.prototype.drawImageOnCanvas=function(t,e){t.drawImage(e,0,0)},t.prototype.decodeBitmap=function(t){return this.reader.decode(t,this._hints)},t.prototype.createCaptureCanvas=function(t){if("undefined"==typeof document)return this._destroyCaptureCanvas(),null;var e,r,n=document.createElement("canvas");return void 0!==t&&(t instanceof HTMLVideoElement?(e=t.videoWidth,r=t.videoHeight):t instanceof HTMLImageElement&&(e=t.naturalWidth||t.width,r=t.naturalHeight||t.height)),n.style.width=e+"px",n.style.height=r+"px",n.width=e,n.height=r,n},t.prototype.stopStreams=function(){this.stream&&(this.stream.getVideoTracks().forEach(function(t){return t.stop()}),this.stream=void 0),!1===this._stopAsyncDecode&&this.stopAsyncDecode(),!1===this._stopContinuousDecode&&this.stopContinuousDecode()},t.prototype.reset=function(){this.stopStreams(),this._destroyVideoElement(),this._destroyImageElement(),this._destroyCaptureCanvas()},t.prototype._destroyVideoElement=function(){this.videoElement&&(void 0!==this.videoEndedListener&&this.videoElement.removeEventListener("ended",this.videoEndedListener),void 0!==this.videoPlayingEventListener&&this.videoElement.removeEventListener("playing",this.videoPlayingEventListener),void 0!==this.videoCanPlayListener&&this.videoElement.removeEventListener("loadedmetadata",this.videoCanPlayListener),this.cleanVideoSource(this.videoElement),this.videoElement=void 0)},t.prototype._destroyImageElement=function(){this.imageElement&&(void 0!==this.imageLoadedListener&&this.imageElement.removeEventListener("load",this.imageLoadedListener),this.imageElement.src=void 0,this.imageElement.removeAttribute("src"),this.imageElement=void 0)},t.prototype._destroyCaptureCanvas=function(){this.captureCanvasContext=void 0,this.captureCanvas=void 0},t.prototype.addVideoSource=function(t,e){try{t.srcObject=e}catch(r){t.src=URL.createObjectURL(e)}},t.prototype.cleanVideoSource=function(t){try{t.srcObject=null}catch(e){t.src=""}this.videoElement.removeAttribute("src")},t}(),fn=function(){function t(t,e,r,n,o,i){void 0===r&&(r=null==e?0:8*e.length),void 0===i&&(i=Nr.currentTimeMillis()),this.text=t,this.rawBytes=e,this.numBits=r,this.resultPoints=n,this.format=o,this.timestamp=i,this.text=t,this.rawBytes=e,this.numBits=null==r?null==e?0:8*e.length:r,this.resultPoints=n,this.format=o,this.resultMetadata=null,this.timestamp=null==i?Nr.currentTimeMillis():i}return t.prototype.getText=function(){return this.text},t.prototype.getRawBytes=function(){return this.rawBytes},t.prototype.getNumBits=function(){return this.numBits},t.prototype.getResultPoints=function(){return this.resultPoints},t.prototype.getBarcodeFormat=function(){return this.format},t.prototype.getResultMetadata=function(){return this.resultMetadata},t.prototype.putMetadata=function(t,e){null===this.resultMetadata&&(this.resultMetadata=new Map),this.resultMetadata.set(t,e)},t.prototype.putAllMetadata=function(t){null!==t&&(null===this.resultMetadata?this.resultMetadata=t:this.resultMetadata=new Map(t))},t.prototype.addResultPoints=function(t){var e=this.resultPoints;if(null===e)this.resultPoints=t;else if(null!==t&&t.length>0){var r=new Array(e.length+t.length);Nr.arraycopy(e,0,r,0,e.length),Nr.arraycopy(t,0,r,e.length,t.length),this.resultPoints=r}},t.prototype.getTimestamp=function(){return this.timestamp},t.prototype.toString=function(){return this.text},t}();!function(t){t[t.AZTEC=0]="AZTEC",t[t.CODABAR=1]="CODABAR",t[t.CODE_39=2]="CODE_39",t[t.CODE_93=3]="CODE_93",t[t.CODE_128=4]="CODE_128",t[t.DATA_MATRIX=5]="DATA_MATRIX",t[t.EAN_8=6]="EAN_8",t[t.EAN_13=7]="EAN_13",t[t.ITF=8]="ITF",t[t.MAXICODE=9]="MAXICODE",t[t.PDF_417=10]="PDF_417",t[t.QR_CODE=11]="QR_CODE",t[t.RSS_14=12]="RSS_14",t[t.RSS_EXPANDED=13]="RSS_EXPANDED",t[t.UPC_A=14]="UPC_A",t[t.UPC_E=15]="UPC_E",t[t.UPC_EAN_EXTENSION=16]="UPC_EAN_EXTENSION"}(Hr||(Hr={}));var dn,hn=Hr;!function(t){t[t.OTHER=0]="OTHER",t[t.ORIENTATION=1]="ORIENTATION",t[t.BYTE_SEGMENTS=2]="BYTE_SEGMENTS",t[t.ERROR_CORRECTION_LEVEL=3]="ERROR_CORRECTION_LEVEL",t[t.ISSUE_NUMBER=4]="ISSUE_NUMBER",t[t.SUGGESTED_PRICE=5]="SUGGESTED_PRICE",t[t.POSSIBLE_COUNTRY=6]="POSSIBLE_COUNTRY",t[t.UPC_EAN_EXTENSION=7]="UPC_EAN_EXTENSION",t[t.PDF417_EXTRA_METADATA=8]="PDF417_EXTRA_METADATA",t[t.STRUCTURED_APPEND_SEQUENCE=9]="STRUCTURED_APPEND_SEQUENCE",t[t.STRUCTURED_APPEND_PARITY=10]="STRUCTURED_APPEND_PARITY"}(dn||(dn={}));var pn,gn=dn,mn=function(){function t(t,e,r,n,o,i){void 0===o&&(o=-1),void 0===i&&(i=-1),this.rawBytes=t,this.text=e,this.byteSegments=r,this.ecLevel=n,this.structuredAppendSequenceNumber=o,this.structuredAppendParity=i,this.numBits=null==t?0:8*t.length}return t.prototype.getRawBytes=function(){return this.rawBytes},t.prototype.getNumBits=function(){return this.numBits},t.prototype.setNumBits=function(t){this.numBits=t},t.prototype.getText=function(){return this.text},t.prototype.getByteSegments=function(){return this.byteSegments},t.prototype.getECLevel=function(){return this.ecLevel},t.prototype.getErrorsCorrected=function(){return this.errorsCorrected},t.prototype.setErrorsCorrected=function(t){this.errorsCorrected=t},t.prototype.getErasures=function(){return this.erasures},t.prototype.setErasures=function(t){this.erasures=t},t.prototype.getOther=function(){return this.other},t.prototype.setOther=function(t){this.other=t},t.prototype.hasStructuredAppend=function(){return this.structuredAppendParity>=0&&this.structuredAppendSequenceNumber>=0},t.prototype.getStructuredAppendParity=function(){return this.structuredAppendParity},t.prototype.getStructuredAppendSequenceNumber=function(){return this.structuredAppendSequenceNumber},t}(),vn=function(){function t(){}return t.prototype.exp=function(t){return this.expTable[t]},t.prototype.log=function(t){if(0===t)throw new Er;return this.logTable[t]},t.addOrSubtract=function(t,e){return t^e},t}(),yn=function(){function t(t,e){if(0===e.length)throw new Er;this.field=t;var r=e.length;if(r>1&&0===e[0]){for(var n=1;n<r&&0===e[n];)n++;n===r?this.coefficients=Int32Array.from([0]):(this.coefficients=new Int32Array(r-n),Nr.arraycopy(e,n,this.coefficients,0,this.coefficients.length))}else this.coefficients=e}return t.prototype.getCoefficients=function(){return this.coefficients},t.prototype.getDegree=function(){return this.coefficients.length-1},t.prototype.isZero=function(){return 0===this.coefficients[0]},t.prototype.getCoefficient=function(t){return this.coefficients[this.coefficients.length-1-t]},t.prototype.evaluateAt=function(t){if(0===t)return this.getCoefficient(0);var e,r=this.coefficients;if(1===t){e=0;for(var n=0,o=r.length;n!==o;n++){var i=r[n];e=vn.addOrSubtract(e,i)}return e}e=r[0];var a=r.length,s=this.field;for(n=1;n<a;n++)e=vn.addOrSubtract(s.multiply(t,e),r[n]);return e},t.prototype.addOrSubtract=function(e){if(!this.field.equals(e.field))throw new Er("GenericGFPolys do not have same GenericGF field");if(this.isZero())return e;if(e.isZero())return this;var r=this.coefficients,n=e.coefficients;if(r.length>n.length){var o=r;r=n,n=o}var i=new Int32Array(n.length),a=n.length-r.length;Nr.arraycopy(n,0,i,0,a);for(var s=a;s<n.length;s++)i[s]=vn.addOrSubtract(r[s-a],n[s]);return new t(this.field,i)},t.prototype.multiply=function(e){if(!this.field.equals(e.field))throw new Er("GenericGFPolys do not have same GenericGF field");if(this.isZero()||e.isZero())return this.field.getZero();for(var r=this.coefficients,n=r.length,o=e.coefficients,i=o.length,a=new Int32Array(n+i-1),s=this.field,c=0;c<n;c++)for(var u=r[c],l=0;l<i;l++)a[c+l]=vn.addOrSubtract(a[c+l],s.multiply(u,o[l]));return new t(s,a)},t.prototype.multiplyScalar=function(e){if(0===e)return this.field.getZero();if(1===e)return this;for(var r=this.coefficients.length,n=this.field,o=new Int32Array(r),i=this.coefficients,a=0;a<r;a++)o[a]=n.multiply(i[a],e);return new t(n,o)},t.prototype.multiplyByMonomial=function(e,r){if(e<0)throw new Er;if(0===r)return this.field.getZero();for(var n=this.coefficients,o=n.length,i=new Int32Array(o+e),a=this.field,s=0;s<o;s++)i[s]=a.multiply(n[s],r);return new t(a,i)},t.prototype.divide=function(t){if(!this.field.equals(t.field))throw new Er("GenericGFPolys do not have same GenericGF field");if(t.isZero())throw new Er("Divide by 0");for(var e=this.field,r=e.getZero(),n=this,o=t.getCoefficient(t.getDegree()),i=e.inverse(o);n.getDegree()>=t.getDegree()&&!n.isZero();){var a=n.getDegree()-t.getDegree(),s=e.multiply(n.getCoefficient(n.getDegree()),i),c=t.multiplyByMonomial(a,s),u=e.buildMonomial(a,s);r=r.addOrSubtract(u),n=n.addOrSubtract(c)}return[r,n]},t.prototype.toString=function(){for(var t="",e=this.getDegree();e>=0;e--){var r=this.getCoefficient(e);if(0!==r){if(r<0?(t+=" - ",r=-r):t.length>0&&(t+=" + "),0===e||1!==r){var n=this.field.log(r);0===n?t+="1":1===n?t+="a":(t+="a^",t+=n)}0!==e&&(1===e?t+="x":(t+="x^",t+=e))}}return t},t}(),_n=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),wn=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return _n(e,t),e.kind="ArithmeticException",e}(wr),bn=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Cn=function(t){function e(e,r,n){var o=t.call(this)||this;o.primitive=e,o.size=r,o.generatorBase=n;for(var i=new Int32Array(r),a=1,s=0;s<r;s++)i[s]=a,(a*=2)>=r&&(a^=e,a&=r-1);o.expTable=i;var c=new Int32Array(r);for(s=0;s<r-1;s++)c[i[s]]=s;return o.logTable=c,o.zero=new yn(o,Int32Array.from([0])),o.one=new yn(o,Int32Array.from([1])),o}return bn(e,t),e.prototype.getZero=function(){return this.zero},e.prototype.getOne=function(){return this.one},e.prototype.buildMonomial=function(t,e){if(t<0)throw new Er;if(0===e)return this.zero;var r=new Int32Array(t+1);return r[0]=e,new yn(this,r)},e.prototype.inverse=function(t){if(0===t)throw new wn;return this.expTable[this.size-this.logTable[t]-1]},e.prototype.multiply=function(t,e){return 0===t||0===e?0:this.expTable[(this.logTable[t]+this.logTable[e])%(this.size-1)]},e.prototype.getSize=function(){return this.size},e.prototype.getGeneratorBase=function(){return this.generatorBase},e.prototype.toString=function(){return"GF(0x"+kr.toHexString(this.primitive)+","+this.size+")"},e.prototype.equals=function(t){return t===this},e.AZTEC_DATA_12=new e(4201,4096,1),e.AZTEC_DATA_10=new e(1033,1024,1),e.AZTEC_DATA_6=new e(67,64,1),e.AZTEC_PARAM=new e(19,16,1),e.QR_CODE_FIELD_256=new e(285,256,0),e.DATA_MATRIX_FIELD_256=new e(301,256,1),e.AZTEC_DATA_8=e.DATA_MATRIX_FIELD_256,e.MAXICODE_FIELD_64=e.AZTEC_DATA_6,e}(vn),An=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),En=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return An(e,t),e.kind="ReedSolomonException",e}(wr),In=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Sn=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return In(e,t),e.kind="IllegalStateException",e}(wr),On=function(){function t(t){this.field=t}return t.prototype.decode=function(t,e){for(var r=this.field,n=new yn(r,t),o=new Int32Array(e),i=!0,a=0;a<e;a++){var s=n.evaluateAt(r.exp(a+r.getGeneratorBase()));o[o.length-1-a]=s,0!==s&&(i=!1)}if(!i){var c=new yn(r,o),u=this.runEuclideanAlgorithm(r.buildMonomial(e,1),c,e),l=u[0],f=u[1],d=this.findErrorLocations(l),h=this.findErrorMagnitudes(f,d);for(a=0;a<d.length;a++){var p=t.length-1-r.log(d[a]);if(p<0)throw new En("Bad error location");t[p]=Cn.addOrSubtract(t[p],h[a])}}},t.prototype.runEuclideanAlgorithm=function(t,e,r){if(t.getDegree()<e.getDegree()){var n=t;t=e,e=n}for(var o=this.field,i=t,a=e,s=o.getZero(),c=o.getOne();a.getDegree()>=(r/2|0);){var u=i,l=s;if(s=c,(i=a).isZero())throw new En("r_{i-1} was zero");a=u;for(var f=o.getZero(),d=i.getCoefficient(i.getDegree()),h=o.inverse(d);a.getDegree()>=i.getDegree()&&!a.isZero();){var p=a.getDegree()-i.getDegree(),g=o.multiply(a.getCoefficient(a.getDegree()),h);f=f.addOrSubtract(o.buildMonomial(p,g)),a=a.addOrSubtract(i.multiplyByMonomial(p,g))}if(c=f.multiply(s).addOrSubtract(l),a.getDegree()>=i.getDegree())throw new Sn("Division algorithm failed to reduce polynomial?")}var m=c.getCoefficient(0);if(0===m)throw new En("sigmaTilde(0) was zero");var v=o.inverse(m);return[c.multiplyScalar(v),a.multiplyScalar(v)]},t.prototype.findErrorLocations=function(t){var e=t.getDegree();if(1===e)return Int32Array.from([t.getCoefficient(1)]);for(var r=new Int32Array(e),n=0,o=this.field,i=1;i<o.getSize()&&n<e;i++)0===t.evaluateAt(i)&&(r[n]=o.inverse(i),n++);if(n!==e)throw new En("Error locator degree does not match number of roots");return r},t.prototype.findErrorMagnitudes=function(t,e){for(var r=e.length,n=new Int32Array(r),o=this.field,i=0;i<r;i++){for(var a=o.inverse(e[i]),s=1,c=0;c<r;c++)if(i!==c){var u=o.multiply(e[c],a),l=1&u?-2&u:1|u;s=o.multiply(s,l)}n[i]=o.multiply(t.evaluateAt(a),o.inverse(s)),0!==o.getGeneratorBase()&&(n[i]=o.multiply(n[i],a))}return n},t}();!function(t){t[t.UPPER=0]="UPPER",t[t.LOWER=1]="LOWER",t[t.MIXED=2]="MIXED",t[t.DIGIT=3]="DIGIT",t[t.PUNCT=4]="PUNCT",t[t.BINARY=5]="BINARY"}(pn||(pn={}));var Tn=function(){function t(){}return t.prototype.decode=function(e){this.ddata=e;var r=e.getBits(),n=this.extractBits(r),o=this.correctBits(n),i=t.convertBoolArrayToByteArray(o),a=t.getEncodedData(o),s=new mn(i,a,null,null);return s.setNumBits(o.length),s},t.highLevelDecode=function(t){return this.getEncodedData(t)},t.getEncodedData=function(e){for(var r=e.length,n=pn.UPPER,o=pn.UPPER,i="",a=0;a<r;)if(o===pn.BINARY){if(r-a<5)break;var s=t.readCode(e,a,5);if(a+=5,0===s){if(r-a<11)break;s=t.readCode(e,a,11)+31,a+=11}for(var c=0;c<s;c++){if(r-a<8){a=r;break}var u=t.readCode(e,a,8);i+=Xr.castAsNonUtf8Char(u),a+=8}o=n}else{var l=o===pn.DIGIT?4:5;if(r-a<l)break;u=t.readCode(e,a,l),a+=l;var f=t.getCharacter(o,u);f.startsWith("CTRL_")?(n=o,o=t.getTable(f.charAt(5)),"L"===f.charAt(6)&&(n=o)):(i+=f,o=n)}return i},t.getTable=function(t){switch(t){case"L":return pn.LOWER;case"P":return pn.PUNCT;case"M":return pn.MIXED;case"D":return pn.DIGIT;case"B":return pn.BINARY;default:return pn.UPPER}},t.getCharacter=function(e,r){switch(e){case pn.UPPER:return t.UPPER_TABLE[r];case pn.LOWER:return t.LOWER_TABLE[r];case pn.MIXED:return t.MIXED_TABLE[r];case pn.PUNCT:return t.PUNCT_TABLE[r];case pn.DIGIT:return t.DIGIT_TABLE[r];default:throw new Sn("Bad table")}},t.prototype.correctBits=function(e){var r,n;this.ddata.getNbLayers()<=2?(n=6,r=Cn.AZTEC_DATA_6):this.ddata.getNbLayers()<=8?(n=8,r=Cn.AZTEC_DATA_8):this.ddata.getNbLayers()<=22?(n=10,r=Cn.AZTEC_DATA_10):(n=12,r=Cn.AZTEC_DATA_12);var o=this.ddata.getNbDatablocks(),i=e.length/n;if(i<o)throw new Vr;for(var a=e.length%n,s=new Int32Array(i),c=0;c<i;c++,a+=n)s[c]=t.readCode(e,a,n);try{new On(r).decode(s,i-o)}catch(g){throw new Vr(g)}var u=(1<<n)-1,l=0;for(c=0;c<o;c++){if(0===(h=s[c])||h===u)throw new Vr;1!==h&&h!==u-1||l++}var f=new Array(o*n-l),d=0;for(c=0;c<o;c++){var h;if(1===(h=s[c])||h===u-1)f.fill(h>1,d,d+n-1),d+=n-1;else for(var p=n-1;p>=0;--p)f[d++]=!!(h&1<<p)}return f},t.prototype.extractBits=function(t){var e=this.ddata.isCompact(),r=this.ddata.getNbLayers(),n=(e?11:14)+4*r,o=new Int32Array(n),i=new Array(this.totalBitsInLayer(r,e));if(e)for(var a=0;a<o.length;a++)o[a]=a;else{var s=n+1+2*kr.truncDivision(kr.truncDivision(n,2)-1,15),c=n/2,u=kr.truncDivision(s,2);for(a=0;a<c;a++){var l=a+kr.truncDivision(a,15);o[c-a-1]=u-l-1,o[c+a]=u+l+1}}a=0;for(var f=0;a<r;a++){for(var d=4*(r-a)+(e?9:12),h=2*a,p=n-1-h,g=0;g<d;g++)for(var m=2*g,v=0;v<2;v++)i[f+m+v]=t.get(o[h+v],o[h+g]),i[f+2*d+m+v]=t.get(o[h+g],o[p-v]),i[f+4*d+m+v]=t.get(o[p-v],o[p-g]),i[f+6*d+m+v]=t.get(o[p-g],o[h+v]);f+=8*d}return i},t.readCode=function(t,e,r){for(var n=0,o=e;o<e+r;o++)n<<=1,t[o]&&(n|=1);return n},t.readByte=function(e,r){var n=e.length-r;return n>=8?t.readCode(e,r,8):t.readCode(e,r,n)<<8-n},t.convertBoolArrayToByteArray=function(e){for(var r=new Uint8Array((e.length+7)/8),n=0;n<r.length;n++)r[n]=t.readByte(e,8*n);return r},t.prototype.totalBitsInLayer=function(t,e){return((e?88:112)+16*t)*t},t.UPPER_TABLE=["CTRL_PS"," ","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","CTRL_LL","CTRL_ML","CTRL_DL","CTRL_BS"],t.LOWER_TABLE=["CTRL_PS"," ","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","CTRL_US","CTRL_ML","CTRL_DL","CTRL_BS"],t.MIXED_TABLE=["CTRL_PS"," ","\\1","\\2","\\3","\\4","\\5","\\6","\\7","\b","\t","\n","\\13","\f","\r","\\33","\\34","\\35","\\36","\\37","@","\\","^","_","`","|","~","\\177","CTRL_LL","CTRL_UL","CTRL_PL","CTRL_BS"],t.PUNCT_TABLE=["","\r","\r\n",". ",", ",": ","!",'"',"#","$","%","&","'","(",")","*","+",",","-",".","/",":",";","<","=",">","?","[","]","{","}","CTRL_UL"],t.DIGIT_TABLE=["CTRL_PS"," ","0","1","2","3","4","5","6","7","8","9",",",".","CTRL_UL","CTRL_US"],t}(),Nn=function(){function t(){}return t.round=function(t){return NaN===t?0:t<=Number.MIN_SAFE_INTEGER?Number.MIN_SAFE_INTEGER:t>=Number.MAX_SAFE_INTEGER?Number.MAX_SAFE_INTEGER:t+(t<0?-.5:.5)|0},t.distance=function(t,e,r,n){var o=t-r,i=e-n;return Math.sqrt(o*o+i*i)},t.sum=function(t){for(var e=0,r=0,n=t.length;r!==n;r++)e+=t[r];return e},t}(),xn=function(){function t(){}return t.floatToIntBits=function(t){return t},t.MAX_VALUE=Number.MAX_SAFE_INTEGER,t}(),Rn=function(){function t(t,e){this.x=t,this.y=e}return t.prototype.getX=function(){return this.x},t.prototype.getY=function(){return this.y},t.prototype.equals=function(e){if(e instanceof t){var r=e;return this.x===r.x&&this.y===r.y}return!1},t.prototype.hashCode=function(){return 31*xn.floatToIntBits(this.x)+xn.floatToIntBits(this.y)},t.prototype.toString=function(){return"("+this.x+","+this.y+")"},t.orderBestPatterns=function(t){var e,r,n,o=this.distance(t[0],t[1]),i=this.distance(t[1],t[2]),a=this.distance(t[0],t[2]);if(i>=o&&i>=a?(r=t[0],e=t[1],n=t[2]):a>=i&&a>=o?(r=t[1],e=t[0],n=t[2]):(r=t[2],e=t[0],n=t[1]),this.crossProductZ(e,r,n)<0){var s=e;e=n,n=s}t[0]=e,t[1]=r,t[2]=n},t.distance=function(t,e){return Nn.distance(t.x,t.y,e.x,e.y)},t.crossProductZ=function(t,e,r){var n=e.x,o=e.y;return(r.x-n)*(t.y-o)-(r.y-o)*(t.x-n)},t}(),Dn=function(){function t(t,e){this.bits=t,this.points=e}return t.prototype.getBits=function(){return this.bits},t.prototype.getPoints=function(){return this.points},t}(),Pn=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Mn=function(t){function e(e,r,n,o,i){var a=t.call(this,e,r)||this;return a.compact=n,a.nbDatablocks=o,a.nbLayers=i,a}return Pn(e,t),e.prototype.getNbLayers=function(){return this.nbLayers},e.prototype.getNbDatablocks=function(){return this.nbDatablocks},e.prototype.isCompact=function(){return this.compact},e}(Dn),kn=function(){function t(e,r,n,o){this.image=e,this.height=e.getHeight(),this.width=e.getWidth(),null==r&&(r=t.INIT_SIZE),null==n&&(n=e.getWidth()/2|0),null==o&&(o=e.getHeight()/2|0);var i=r/2|0;if(this.leftInit=n-i,this.rightInit=n+i,this.upInit=o-i,this.downInit=o+i,this.upInit<0||this.leftInit<0||this.downInit>=this.height||this.rightInit>=this.width)throw new Kr}return t.prototype.detect=function(){for(var t=this.leftInit,e=this.rightInit,r=this.upInit,n=this.downInit,o=!1,i=!0,a=!1,s=!1,c=!1,u=!1,l=!1,f=this.width,d=this.height;i;){i=!1;for(var h=!0;(h||!s)&&e<f;)(h=this.containsBlackPoint(r,n,e,!1))?(e++,i=!0,s=!0):s||e++;if(e>=f){o=!0;break}for(var p=!0;(p||!c)&&n<d;)(p=this.containsBlackPoint(t,e,n,!0))?(n++,i=!0,c=!0):c||n++;if(n>=d){o=!0;break}for(var g=!0;(g||!u)&&t>=0;)(g=this.containsBlackPoint(r,n,t,!1))?(t--,i=!0,u=!0):u||t--;if(t<0){o=!0;break}for(var m=!0;(m||!l)&&r>=0;)(m=this.containsBlackPoint(t,e,r,!0))?(r--,i=!0,l=!0):l||r--;if(r<0){o=!0;break}i&&(a=!0)}if(!o&&a){for(var v=e-t,y=null,_=1;null===y&&_<v;_++)y=this.getBlackPointOnSegment(t,n-_,t+_,n);if(null==y)throw new Kr;var w=null;for(_=1;null===w&&_<v;_++)w=this.getBlackPointOnSegment(t,r+_,t+_,r);if(null==w)throw new Kr;var b=null;for(_=1;null===b&&_<v;_++)b=this.getBlackPointOnSegment(e,r+_,e-_,r);if(null==b)throw new Kr;var C=null;for(_=1;null===C&&_<v;_++)C=this.getBlackPointOnSegment(e,n-_,e-_,n);if(null==C)throw new Kr;return this.centerEdges(C,y,b,w)}throw new Kr},t.prototype.getBlackPointOnSegment=function(t,e,r,n){for(var o=Nn.round(Nn.distance(t,e,r,n)),i=(r-t)/o,a=(n-e)/o,s=this.image,c=0;c<o;c++){var u=Nn.round(t+c*i),l=Nn.round(e+c*a);if(s.get(u,l))return new Rn(u,l)}return null},t.prototype.centerEdges=function(e,r,n,o){var i=e.getX(),a=e.getY(),s=r.getX(),c=r.getY(),u=n.getX(),l=n.getY(),f=o.getX(),d=o.getY(),h=t.CORR;return i<this.width/2?[new Rn(f-h,d+h),new Rn(s+h,c+h),new Rn(u-h,l-h),new Rn(i+h,a-h)]:[new Rn(f+h,d+h),new Rn(s+h,c-h),new Rn(u-h,l+h),new Rn(i-h,a-h)]},t.prototype.containsBlackPoint=function(t,e,r,n){var o=this.image;if(n){for(var i=t;i<=e;i++)if(o.get(i,r))return!0}else for(var a=t;a<=e;a++)if(o.get(r,a))return!0;return!1},t.INIT_SIZE=10,t.CORR=1,t}(),Ln=function(){function t(){}return t.checkAndNudgePoints=function(t,e){for(var r=t.getWidth(),n=t.getHeight(),o=!0,i=0;i<e.length&&o;i+=2){var a=Math.floor(e[i]),s=Math.floor(e[i+1]);if(a<-1||a>r||s<-1||s>n)throw new Kr;o=!1,-1===a?(e[i]=0,o=!0):a===r&&(e[i]=r-1,o=!0),-1===s?(e[i+1]=0,o=!0):s===n&&(e[i+1]=n-1,o=!0)}for(o=!0,i=e.length-2;i>=0&&o;i-=2){if(a=Math.floor(e[i]),s=Math.floor(e[i+1]),a<-1||a>r||s<-1||s>n)throw new Kr;o=!1,-1===a?(e[i]=0,o=!0):a===r&&(e[i]=r-1,o=!0),-1===s?(e[i+1]=0,o=!0):s===n&&(e[i+1]=n-1,o=!0)}},t}(),jn=function(){function t(t,e,r,n,o,i,a,s,c){this.a11=t,this.a21=e,this.a31=r,this.a12=n,this.a22=o,this.a32=i,this.a13=a,this.a23=s,this.a33=c}return t.quadrilateralToQuadrilateral=function(e,r,n,o,i,a,s,c,u,l,f,d,h,p,g,m){var v=t.quadrilateralToSquare(e,r,n,o,i,a,s,c);return t.squareToQuadrilateral(u,l,f,d,h,p,g,m).times(v)},t.prototype.transformPoints=function(t){for(var e=t.length,r=this.a11,n=this.a12,o=this.a13,i=this.a21,a=this.a22,s=this.a23,c=this.a31,u=this.a32,l=this.a33,f=0;f<e;f+=2){var d=t[f],h=t[f+1],p=o*d+s*h+l;t[f]=(r*d+i*h+c)/p,t[f+1]=(n*d+a*h+u)/p}},t.prototype.transformPointsWithValues=function(t,e){for(var r=this.a11,n=this.a12,o=this.a13,i=this.a21,a=this.a22,s=this.a23,c=this.a31,u=this.a32,l=this.a33,f=t.length,d=0;d<f;d++){var h=t[d],p=e[d],g=o*h+s*p+l;t[d]=(r*h+i*p+c)/g,e[d]=(n*h+a*p+u)/g}},t.squareToQuadrilateral=function(e,r,n,o,i,a,s,c){var u=e-n+i-s,l=r-o+a-c;if(0===u&&0===l)return new t(n-e,i-n,e,o-r,a-o,r,0,0,1);var f=n-i,d=s-i,h=o-a,p=c-a,g=f*p-d*h,m=(u*p-d*l)/g,v=(f*l-u*h)/g;return new t(n-e+m*n,s-e+v*s,e,o-r+m*o,c-r+v*c,r,m,v,1)},t.quadrilateralToSquare=function(e,r,n,o,i,a,s,c){return t.squareToQuadrilateral(e,r,n,o,i,a,s,c).buildAdjoint()},t.prototype.buildAdjoint=function(){return new t(this.a22*this.a33-this.a23*this.a32,this.a23*this.a31-this.a21*this.a33,this.a21*this.a32-this.a22*this.a31,this.a13*this.a32-this.a12*this.a33,this.a11*this.a33-this.a13*this.a31,this.a12*this.a31-this.a11*this.a32,this.a12*this.a23-this.a13*this.a22,this.a13*this.a21-this.a11*this.a23,this.a11*this.a22-this.a12*this.a21)},t.prototype.times=function(e){return new t(this.a11*e.a11+this.a21*e.a12+this.a31*e.a13,this.a11*e.a21+this.a21*e.a22+this.a31*e.a23,this.a11*e.a31+this.a21*e.a32+this.a31*e.a33,this.a12*e.a11+this.a22*e.a12+this.a32*e.a13,this.a12*e.a21+this.a22*e.a22+this.a32*e.a23,this.a12*e.a31+this.a22*e.a32+this.a32*e.a33,this.a13*e.a11+this.a23*e.a12+this.a33*e.a13,this.a13*e.a21+this.a23*e.a22+this.a33*e.a23,this.a13*e.a31+this.a23*e.a32+this.a33*e.a33)},t}(),Bn=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Fn=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Bn(e,t),e.prototype.sampleGrid=function(t,e,r,n,o,i,a,s,c,u,l,f,d,h,p,g,m,v,y){var _=jn.quadrilateralToQuadrilateral(n,o,i,a,s,c,u,l,f,d,h,p,g,m,v,y);return this.sampleGridWithTransform(t,e,r,_)},e.prototype.sampleGridWithTransform=function(t,e,r,n){if(e<=0||r<=0)throw new Kr;for(var o=new Yr(e,r),i=new Float32Array(2*e),a=0;a<r;a++){for(var s=i.length,c=a+.5,u=0;u<s;u+=2)i[u]=u/2+.5,i[u+1]=c;n.transformPoints(i),Ln.checkAndNudgePoints(t,i);try{for(u=0;u<s;u+=2)t.get(Math.floor(i[u]),Math.floor(i[u+1]))&&o.set(u/2,a)}catch(l){throw new Kr}}return o},e}(Ln),Vn=function(){function t(){}return t.setGridSampler=function(e){t.gridSampler=e},t.getInstance=function(){return t.gridSampler},t.gridSampler=new Fn,t}(),Hn=function(){function t(t,e){this.x=t,this.y=e}return t.prototype.toResultPoint=function(){return new Rn(this.getX(),this.getY())},t.prototype.getX=function(){return this.x},t.prototype.getY=function(){return this.y},t}(),Un=function(){function t(t){this.EXPECTED_CORNER_BITS=new Int32Array([3808,476,2107,1799]),this.image=t}return t.prototype.detect=function(){return this.detectMirror(!1)},t.prototype.detectMirror=function(t){var e=this.getMatrixCenter(),r=this.getBullsEyeCorners(e);if(t){var n=r[0];r[0]=r[2],r[2]=n}this.extractParameters(r);var o=this.sampleGrid(this.image,r[this.shift%4],r[(this.shift+1)%4],r[(this.shift+2)%4],r[(this.shift+3)%4]),i=this.getMatrixCornerPoints(r);return new Mn(o,i,this.compact,this.nbDataBlocks,this.nbLayers)},t.prototype.extractParameters=function(t){if(!(this.isValidPoint(t[0])&&this.isValidPoint(t[1])&&this.isValidPoint(t[2])&&this.isValidPoint(t[3])))throw new Kr;var e=2*this.nbCenterLayers,r=new Int32Array([this.sampleLine(t[0],t[1],e),this.sampleLine(t[1],t[2],e),this.sampleLine(t[2],t[3],e),this.sampleLine(t[3],t[0],e)]);this.shift=this.getRotation(r,e);for(var n=0,o=0;o<4;o++){var i=r[(this.shift+o)%4];this.compact?(n<<=7,n+=i>>1&127):(n<<=10,n+=(i>>2&992)+(i>>1&31))}var a=this.getCorrectedParameterData(n,this.compact);this.compact?(this.nbLayers=1+(a>>6),this.nbDataBlocks=1+(63&a)):(this.nbLayers=1+(a>>11),this.nbDataBlocks=1+(2047&a))},t.prototype.getRotation=function(t,e){var r=0;t.forEach(function(t,n,o){r=(t>>e-2<<1)+(1&t)+(r<<3)}),r=((1&r)<<11)+(r>>1);for(var n=0;n<4;n++)if(kr.bitCount(r^this.EXPECTED_CORNER_BITS[n])<=2)return n;throw new Kr},t.prototype.getCorrectedParameterData=function(t,e){var r,n;e?(r=7,n=2):(r=10,n=4);for(var o=r-n,i=new Int32Array(r),a=r-1;a>=0;--a)i[a]=15&t,t>>=4;try{new On(Cn.AZTEC_PARAM).decode(i,o)}catch(c){throw new Kr}var s=0;for(a=0;a<n;a++)s=(s<<4)+i[a];return s},t.prototype.getBullsEyeCorners=function(t){var e=t,r=t,n=t,o=t,i=!0;for(this.nbCenterLayers=1;this.nbCenterLayers<9;this.nbCenterLayers++){var a=this.getFirstDifferent(e,i,1,-1),s=this.getFirstDifferent(r,i,1,1),c=this.getFirstDifferent(n,i,-1,1),u=this.getFirstDifferent(o,i,-1,-1);if(this.nbCenterLayers>2){var l=this.distancePoint(u,a)*this.nbCenterLayers/(this.distancePoint(o,e)*(this.nbCenterLayers+2));if(l<.75||l>1.25||!this.isWhiteOrBlackRectangle(a,s,c,u))break}e=a,r=s,n=c,o=u,i=!i}if(5!==this.nbCenterLayers&&7!==this.nbCenterLayers)throw new Kr;this.compact=5===this.nbCenterLayers;var f=new Rn(e.getX()+.5,e.getY()-.5),d=new Rn(r.getX()+.5,r.getY()+.5),h=new Rn(n.getX()-.5,n.getY()+.5),p=new Rn(o.getX()-.5,o.getY()-.5);return this.expandSquare([f,d,h,p],2*this.nbCenterLayers-3,2*this.nbCenterLayers)},t.prototype.getMatrixCenter=function(){var t,e,r,n;try{t=(c=new kn(this.image).detect())[0],e=c[1],r=c[2],n=c[3]}catch(u){var o=this.image.getWidth()/2,i=this.image.getHeight()/2;t=this.getFirstDifferent(new Hn(o+7,i-7),!1,1,-1).toResultPoint(),e=this.getFirstDifferent(new Hn(o+7,i+7),!1,1,1).toResultPoint(),r=this.getFirstDifferent(new Hn(o-7,i+7),!1,-1,1).toResultPoint(),n=this.getFirstDifferent(new Hn(o-7,i-7),!1,-1,-1).toResultPoint()}var a=Nn.round((t.getX()+n.getX()+e.getX()+r.getX())/4),s=Nn.round((t.getY()+n.getY()+e.getY()+r.getY())/4);try{var c;t=(c=new kn(this.image,15,a,s).detect())[0],e=c[1],r=c[2],n=c[3]}catch(l){t=this.getFirstDifferent(new Hn(a+7,s-7),!1,1,-1).toResultPoint(),e=this.getFirstDifferent(new Hn(a+7,s+7),!1,1,1).toResultPoint(),r=this.getFirstDifferent(new Hn(a-7,s+7),!1,-1,1).toResultPoint(),n=this.getFirstDifferent(new Hn(a-7,s-7),!1,-1,-1).toResultPoint()}return a=Nn.round((t.getX()+n.getX()+e.getX()+r.getX())/4),s=Nn.round((t.getY()+n.getY()+e.getY()+r.getY())/4),new Hn(a,s)},t.prototype.getMatrixCornerPoints=function(t){return this.expandSquare(t,2*this.nbCenterLayers,this.getDimension())},t.prototype.sampleGrid=function(t,e,r,n,o){var i=Vn.getInstance(),a=this.getDimension(),s=a/2-this.nbCenterLayers,c=a/2+this.nbCenterLayers;return i.sampleGrid(t,a,a,s,s,c,s,c,c,s,c,e.getX(),e.getY(),r.getX(),r.getY(),n.getX(),n.getY(),o.getX(),o.getY())},t.prototype.sampleLine=function(t,e,r){for(var n=0,o=this.distanceResultPoint(t,e),i=o/r,a=t.getX(),s=t.getY(),c=i*(e.getX()-t.getX())/o,u=i*(e.getY()-t.getY())/o,l=0;l<r;l++)this.image.get(Nn.round(a+l*c),Nn.round(s+l*u))&&(n|=1<<r-l-1);return n},t.prototype.isWhiteOrBlackRectangle=function(t,e,r,n){t=new Hn(t.getX()-3,t.getY()+3),e=new Hn(e.getX()-3,e.getY()-3),r=new Hn(r.getX()+3,r.getY()-3),n=new Hn(n.getX()+3,n.getY()+3);var o=this.getColor(n,t);if(0===o)return!1;var i=this.getColor(t,e);return i===o&&(i=this.getColor(e,r))===o&&(i=this.getColor(r,n))===o},t.prototype.getColor=function(t,e){for(var r=this.distancePoint(t,e),n=(e.getX()-t.getX())/r,o=(e.getY()-t.getY())/r,i=0,a=t.getX(),s=t.getY(),c=this.image.get(t.getX(),t.getY()),u=Math.ceil(r),l=0;l<u;l++)a+=n,s+=o,this.image.get(Nn.round(a),Nn.round(s))!==c&&i++;var f=i/r;return f>.1&&f<.9?0:f<=.1===c?1:-1},t.prototype.getFirstDifferent=function(t,e,r,n){for(var o=t.getX()+r,i=t.getY()+n;this.isValid(o,i)&&this.image.get(o,i)===e;)o+=r,i+=n;for(o-=r,i-=n;this.isValid(o,i)&&this.image.get(o,i)===e;)o+=r;for(o-=r;this.isValid(o,i)&&this.image.get(o,i)===e;)i+=n;return new Hn(o,i-=n)},t.prototype.expandSquare=function(t,e,r){var n=r/(2*e),o=t[0].getX()-t[2].getX(),i=t[0].getY()-t[2].getY(),a=(t[0].getX()+t[2].getX())/2,s=(t[0].getY()+t[2].getY())/2,c=new Rn(a+n*o,s+n*i),u=new Rn(a-n*o,s-n*i);return o=t[1].getX()-t[3].getX(),i=t[1].getY()-t[3].getY(),a=(t[1].getX()+t[3].getX())/2,s=(t[1].getY()+t[3].getY())/2,[c,new Rn(a+n*o,s+n*i),u,new Rn(a-n*o,s-n*i)]},t.prototype.isValid=function(t,e){return t>=0&&t<this.image.getWidth()&&e>0&&e<this.image.getHeight()},t.prototype.isValidPoint=function(t){var e=Nn.round(t.getX()),r=Nn.round(t.getY());return this.isValid(e,r)},t.prototype.distancePoint=function(t,e){return Nn.distance(t.getX(),t.getY(),e.getX(),e.getY())},t.prototype.distanceResultPoint=function(t,e){return Nn.distance(t.getX(),t.getY(),e.getX(),e.getY())},t.prototype.getDimension=function(){return this.compact?4*this.nbLayers+11:this.nbLayers<=4?4*this.nbLayers+15:4*this.nbLayers+2*(kr.truncDivision(this.nbLayers-4,8)+1)+15},t}(),Wn=function(){function t(){}return t.prototype.decode=function(t,e){void 0===e&&(e=null);var r=null,n=new Un(t.getBlackMatrix()),o=null,i=null;try{o=(a=n.detectMirror(!1)).getPoints(),this.reportFoundResultPoints(e,o),i=(new Tn).decode(a)}catch(l){r=l}if(null==i)try{var a;o=(a=n.detectMirror(!0)).getPoints(),this.reportFoundResultPoints(e,o),i=(new Tn).decode(a)}catch(l){if(null!=r)throw r;throw l}var s=new fn(i.getText(),i.getRawBytes(),i.getNumBits(),o,hn.AZTEC,Nr.currentTimeMillis()),c=i.getByteSegments();null!=c&&s.putMetadata(gn.BYTE_SEGMENTS,c);var u=i.getECLevel();return null!=u&&s.putMetadata(gn.ERROR_CORRECTION_LEVEL,u),s},t.prototype.reportFoundResultPoints=function(t,e){if(null!=t){var r=t.get(Br.NEED_RESULT_POINT_CALLBACK);null!=r&&e.forEach(function(t,e,n){r.foundPossibleResultPoint(t)})}},t.prototype.reset=function(){},t}(),zn=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();!function(t){zn(function(e){return void 0===e&&(e=500),t.call(this,new Wn,e)||this},t)}(ln);var Gn=function(){function t(){}return t.prototype.decode=function(t,e){try{return this.doDecode(t,e)}catch(u){if(e&&!0===e.get(Br.TRY_HARDER)&&t.isRotateSupported()){var r=t.rotateCounterClockwise(),n=this.doDecode(r,e),o=n.getResultMetadata(),i=270;null!==o&&!0===o.get(gn.ORIENTATION)&&(i+=o.get(gn.ORIENTATION)%360),n.putMetadata(gn.ORIENTATION,i);var a=n.getResultPoints();if(null!==a)for(var s=r.getHeight(),c=0;c<a.length;c++)a[c]=new Rn(s-a[c].getY()-1,a[c].getX());return n}throw new Kr}},t.prototype.reset=function(){},t.prototype.doDecode=function(t,e){var r,n=t.getWidth(),o=t.getHeight(),i=new Lr(n),a=e&&!0===e.get(Br.TRY_HARDER),s=Math.max(1,o>>(a?8:5));r=a?o:15;for(var c=Math.trunc(o/2),u=0;u<r;u++){var l=Math.trunc((u+1)/2),f=c+s*(1&u?-l:l);if(f<0||f>=o)break;try{i=t.getBlackRow(f,i)}catch(m){continue}for(var d=function(t){if(1===t&&(i.reverse(),e&&!0===e.get(Br.NEED_RESULT_POINT_CALLBACK))){var r=new Map;e.forEach(function(t,e){return r.set(e,t)}),r.delete(Br.NEED_RESULT_POINT_CALLBACK),e=r}try{var o=h.decodeRow(f,i,e);if(1===t){o.putMetadata(gn.ORIENTATION,180);var a=o.getResultPoints();null!==a&&(a[0]=new Rn(n-a[0].getX()-1,a[0].getY()),a[1]=new Rn(n-a[1].getX()-1,a[1].getY()))}return{value:o}}catch(s){}},h=this,p=0;p<2;p++){var g=d(p);if("object"==typeof g)return g.value}}throw new Kr},t.recordPattern=function(t,e,r){for(var n=r.length,o=0;o<n;o++)r[o]=0;var i=t.getSize();if(e>=i)throw new Kr;for(var a=!t.get(e),s=0,c=e;c<i;){if(t.get(c)!==a)r[s]++;else{if(++s===n)break;r[s]=1,a=!a}c++}if(s!==n&&(s!==n-1||c!==i))throw new Kr},t.recordPatternInReverse=function(e,r,n){for(var o=n.length,i=e.get(r);r>0&&o>=0;)e.get(--r)!==i&&(o--,i=!i);if(o>=0)throw new Kr;t.recordPattern(e,r+1,n)},t.patternMatchVariance=function(t,e,r){for(var n=t.length,o=0,i=0,a=0;a<n;a++)o+=t[a],i+=e[a];if(o<i)return Number.POSITIVE_INFINITY;var s=o/i;r*=s;for(var c=0,u=0;u<n;u++){var l=t[u],f=e[u]*s,d=l>f?l-f:f-l;if(d>r)return Number.POSITIVE_INFINITY;c+=d}return c/o},t}(),Xn=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),$n=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Xn(e,t),e.findStartPattern=function(t){for(var r=t.getSize(),n=t.getNextSet(0),o=0,i=Int32Array.from([0,0,0,0,0,0]),a=n,s=!1,c=n;c<r;c++)if(t.get(c)!==s)i[o]++;else{if(5===o){for(var u=e.MAX_AVG_VARIANCE,l=-1,f=e.CODE_START_A;f<=e.CODE_START_C;f++){var d=Gn.patternMatchVariance(i,e.CODE_PATTERNS[f],e.MAX_INDIVIDUAL_VARIANCE);d<u&&(u=d,l=f)}if(l>=0&&t.isRange(Math.max(0,a-(c-a)/2),a,!1))return Int32Array.from([a,c,l]);a+=i[0]+i[1],(i=i.slice(2,i.length-1))[o-1]=0,i[o]=0,o--}else o++;i[o]=1,s=!s}throw new Kr},e.decodeCode=function(t,r,n){Gn.recordPattern(t,n,r);for(var o=e.MAX_AVG_VARIANCE,i=-1,a=0;a<e.CODE_PATTERNS.length;a++){var s=e.CODE_PATTERNS[a],c=this.patternMatchVariance(r,s,e.MAX_INDIVIDUAL_VARIANCE);c<o&&(o=c,i=a)}if(i>=0)return i;throw new Kr},e.prototype.decodeRow=function(t,r,n){var o,i=n&&!0===n.get(Br.ASSUME_GS1),a=e.findStartPattern(r),s=a[2],c=0,u=new Uint8Array(20);switch(u[c++]=s,s){case e.CODE_START_A:o=e.CODE_CODE_A;break;case e.CODE_START_B:o=e.CODE_CODE_B;break;case e.CODE_START_C:o=e.CODE_CODE_C;break;default:throw new Vr}for(var l=!1,f=!1,d="",h=a[0],p=a[1],g=Int32Array.from([0,0,0,0,0,0]),m=0,v=0,y=s,_=0,w=!0,b=!1,C=!1;!l;){var A=f;switch(f=!1,m=v,v=e.decodeCode(r,g,p),u[c++]=v,v!==e.CODE_STOP&&(w=!0),v!==e.CODE_STOP&&(y+=++_*v),h=p,p+=g.reduce(function(t,e){return t+e},0),v){case e.CODE_START_A:case e.CODE_START_B:case e.CODE_START_C:throw new Vr}switch(o){case e.CODE_CODE_A:if(v<64)d+=C===b?String.fromCharCode(" ".charCodeAt(0)+v):String.fromCharCode(" ".charCodeAt(0)+v+128),C=!1;else if(v<96)d+=C===b?String.fromCharCode(v-64):String.fromCharCode(v+64),C=!1;else switch(v!==e.CODE_STOP&&(w=!1),v){case e.CODE_FNC_1:i&&(0===d.length?d+="]C1":d+=String.fromCharCode(29));break;case e.CODE_FNC_2:case e.CODE_FNC_3:break;case e.CODE_FNC_4_A:!b&&C?(b=!0,C=!1):b&&C?(b=!1,C=!1):C=!0;break;case e.CODE_SHIFT:f=!0,o=e.CODE_CODE_B;break;case e.CODE_CODE_B:o=e.CODE_CODE_B;break;case e.CODE_CODE_C:o=e.CODE_CODE_C;break;case e.CODE_STOP:l=!0}break;case e.CODE_CODE_B:if(v<96)d+=C===b?String.fromCharCode(" ".charCodeAt(0)+v):String.fromCharCode(" ".charCodeAt(0)+v+128),C=!1;else switch(v!==e.CODE_STOP&&(w=!1),v){case e.CODE_FNC_1:i&&(0===d.length?d+="]C1":d+=String.fromCharCode(29));break;case e.CODE_FNC_2:case e.CODE_FNC_3:break;case e.CODE_FNC_4_B:!b&&C?(b=!0,C=!1):b&&C?(b=!1,C=!1):C=!0;break;case e.CODE_SHIFT:f=!0,o=e.CODE_CODE_A;break;case e.CODE_CODE_A:o=e.CODE_CODE_A;break;case e.CODE_CODE_C:o=e.CODE_CODE_C;break;case e.CODE_STOP:l=!0}break;case e.CODE_CODE_C:if(v<100)v<10&&(d+="0"),d+=v;else switch(v!==e.CODE_STOP&&(w=!1),v){case e.CODE_FNC_1:i&&(0===d.length?d+="]C1":d+=String.fromCharCode(29));break;case e.CODE_CODE_A:o=e.CODE_CODE_A;break;case e.CODE_CODE_B:o=e.CODE_CODE_B;break;case e.CODE_STOP:l=!0}}A&&(o=o===e.CODE_CODE_A?e.CODE_CODE_B:e.CODE_CODE_A)}var E=p-h;if(p=r.getNextUnset(p),!r.isRange(p,Math.min(r.getSize(),p+(p-h)/2),!1))throw new Kr;if((y-=_*m)%103!==m)throw new Or;var I=d.length;if(0===I)throw new Kr;I>0&&w&&(d=o===e.CODE_CODE_C?d.substring(0,I-2):d.substring(0,I-1));for(var S=(a[1]+a[0])/2,O=h+E/2,T=u.length,N=new Uint8Array(T),x=0;x<T;x++)N[x]=u[x];var R=[new Rn(S,t),new Rn(O,t)];return new fn(d,N,0,R,hn.CODE_128,(new Date).getTime())},e.CODE_PATTERNS=[Int32Array.from([2,1,2,2,2,2]),Int32Array.from([2,2,2,1,2,2]),Int32Array.from([2,2,2,2,2,1]),Int32Array.from([1,2,1,2,2,3]),Int32Array.from([1,2,1,3,2,2]),Int32Array.from([1,3,1,2,2,2]),Int32Array.from([1,2,2,2,1,3]),Int32Array.from([1,2,2,3,1,2]),Int32Array.from([1,3,2,2,1,2]),Int32Array.from([2,2,1,2,1,3]),Int32Array.from([2,2,1,3,1,2]),Int32Array.from([2,3,1,2,1,2]),Int32Array.from([1,1,2,2,3,2]),Int32Array.from([1,2,2,1,3,2]),Int32Array.from([1,2,2,2,3,1]),Int32Array.from([1,1,3,2,2,2]),Int32Array.from([1,2,3,1,2,2]),Int32Array.from([1,2,3,2,2,1]),Int32Array.from([2,2,3,2,1,1]),Int32Array.from([2,2,1,1,3,2]),Int32Array.from([2,2,1,2,3,1]),Int32Array.from([2,1,3,2,1,2]),Int32Array.from([2,2,3,1,1,2]),Int32Array.from([3,1,2,1,3,1]),Int32Array.from([3,1,1,2,2,2]),Int32Array.from([3,2,1,1,2,2]),Int32Array.from([3,2,1,2,2,1]),Int32Array.from([3,1,2,2,1,2]),Int32Array.from([3,2,2,1,1,2]),Int32Array.from([3,2,2,2,1,1]),Int32Array.from([2,1,2,1,2,3]),Int32Array.from([2,1,2,3,2,1]),Int32Array.from([2,3,2,1,2,1]),Int32Array.from([1,1,1,3,2,3]),Int32Array.from([1,3,1,1,2,3]),Int32Array.from([1,3,1,3,2,1]),Int32Array.from([1,1,2,3,1,3]),Int32Array.from([1,3,2,1,1,3]),Int32Array.from([1,3,2,3,1,1]),Int32Array.from([2,1,1,3,1,3]),Int32Array.from([2,3,1,1,1,3]),Int32Array.from([2,3,1,3,1,1]),Int32Array.from([1,1,2,1,3,3]),Int32Array.from([1,1,2,3,3,1]),Int32Array.from([1,3,2,1,3,1]),Int32Array.from([1,1,3,1,2,3]),Int32Array.from([1,1,3,3,2,1]),Int32Array.from([1,3,3,1,2,1]),Int32Array.from([3,1,3,1,2,1]),Int32Array.from([2,1,1,3,3,1]),Int32Array.from([2,3,1,1,3,1]),Int32Array.from([2,1,3,1,1,3]),Int32Array.from([2,1,3,3,1,1]),Int32Array.from([2,1,3,1,3,1]),Int32Array.from([3,1,1,1,2,3]),Int32Array.from([3,1,1,3,2,1]),Int32Array.from([3,3,1,1,2,1]),Int32Array.from([3,1,2,1,1,3]),Int32Array.from([3,1,2,3,1,1]),Int32Array.from([3,3,2,1,1,1]),Int32Array.from([3,1,4,1,1,1]),Int32Array.from([2,2,1,4,1,1]),Int32Array.from([4,3,1,1,1,1]),Int32Array.from([1,1,1,2,2,4]),Int32Array.from([1,1,1,4,2,2]),Int32Array.from([1,2,1,1,2,4]),Int32Array.from([1,2,1,4,2,1]),Int32Array.from([1,4,1,1,2,2]),Int32Array.from([1,4,1,2,2,1]),Int32Array.from([1,1,2,2,1,4]),Int32Array.from([1,1,2,4,1,2]),Int32Array.from([1,2,2,1,1,4]),Int32Array.from([1,2,2,4,1,1]),Int32Array.from([1,4,2,1,1,2]),Int32Array.from([1,4,2,2,1,1]),Int32Array.from([2,4,1,2,1,1]),Int32Array.from([2,2,1,1,1,4]),Int32Array.from([4,1,3,1,1,1]),Int32Array.from([2,4,1,1,1,2]),Int32Array.from([1,3,4,1,1,1]),Int32Array.from([1,1,1,2,4,2]),Int32Array.from([1,2,1,1,4,2]),Int32Array.from([1,2,1,2,4,1]),Int32Array.from([1,1,4,2,1,2]),Int32Array.from([1,2,4,1,1,2]),Int32Array.from([1,2,4,2,1,1]),Int32Array.from([4,1,1,2,1,2]),Int32Array.from([4,2,1,1,1,2]),Int32Array.from([4,2,1,2,1,1]),Int32Array.from([2,1,2,1,4,1]),Int32Array.from([2,1,4,1,2,1]),Int32Array.from([4,1,2,1,2,1]),Int32Array.from([1,1,1,1,4,3]),Int32Array.from([1,1,1,3,4,1]),Int32Array.from([1,3,1,1,4,1]),Int32Array.from([1,1,4,1,1,3]),Int32Array.from([1,1,4,3,1,1]),Int32Array.from([4,1,1,1,1,3]),Int32Array.from([4,1,1,3,1,1]),Int32Array.from([1,1,3,1,4,1]),Int32Array.from([1,1,4,1,3,1]),Int32Array.from([3,1,1,1,4,1]),Int32Array.from([4,1,1,1,3,1]),Int32Array.from([2,1,1,4,1,2]),Int32Array.from([2,1,1,2,1,4]),Int32Array.from([2,1,1,2,3,2]),Int32Array.from([2,3,3,1,1,1,2])],e.MAX_AVG_VARIANCE=.25,e.MAX_INDIVIDUAL_VARIANCE=.7,e.CODE_SHIFT=98,e.CODE_CODE_C=99,e.CODE_CODE_B=100,e.CODE_CODE_A=101,e.CODE_FNC_1=102,e.CODE_FNC_2=97,e.CODE_FNC_3=96,e.CODE_FNC_4_A=101,e.CODE_FNC_4_B=100,e.CODE_START_A=103,e.CODE_START_B=104,e.CODE_START_C=105,e.CODE_STOP=106,e}(Gn),Yn=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),qn=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Kn=function(t){function e(e,r){void 0===e&&(e=!1),void 0===r&&(r=!1);var n=t.call(this)||this;return n.usingCheckDigit=e,n.extendedMode=r,n.decodeRowResult="",n.counters=new Int32Array(9),n}return Yn(e,t),e.prototype.decodeRow=function(t,r,n){var o,i,a,s,c=this.counters;c.fill(0),this.decodeRowResult="";var u,l,f=e.findAsteriskPattern(r,c),d=r.getNextSet(f[1]),h=r.getSize();do{e.recordPattern(r,d,c);var p=e.toNarrowWidePattern(c);if(p<0)throw new Kr;u=e.patternToChar(p),this.decodeRowResult+=u,l=d;try{for(var g=(o=void 0,qn(c)),m=g.next();!m.done;m=g.next())d+=m.value}catch(S){o={error:S}}finally{try{m&&!m.done&&(i=g.return)&&i.call(g)}finally{if(o)throw o.error}}d=r.getNextSet(d)}while("*"!==u);this.decodeRowResult=this.decodeRowResult.substring(0,this.decodeRowResult.length-1);var v,y=0;try{for(var _=qn(c),w=_.next();!w.done;w=_.next())y+=w.value}catch(S){a={error:S}}finally{try{w&&!w.done&&(s=_.return)&&s.call(_)}finally{if(a)throw a.error}}if(d!==h&&2*(d-l-y)<y)throw new Kr;if(this.usingCheckDigit){for(var b=this.decodeRowResult.length-1,C=0,A=0;A<b;A++)C+=e.ALPHABET_STRING.indexOf(this.decodeRowResult.charAt(A));if(this.decodeRowResult.charAt(b)!==e.ALPHABET_STRING.charAt(C%43))throw new Or;this.decodeRowResult=this.decodeRowResult.substring(0,b)}if(0===this.decodeRowResult.length)throw new Kr;v=this.extendedMode?e.decodeExtended(this.decodeRowResult):this.decodeRowResult;var E=(f[1]+f[0])/2,I=l+y/2;return new fn(v,null,0,[new Rn(E,t),new Rn(I,t)],hn.CODE_39,(new Date).getTime())},e.findAsteriskPattern=function(t,r){for(var n=t.getSize(),o=t.getNextSet(0),i=0,a=o,s=!1,c=r.length,u=o;u<n;u++)if(t.get(u)!==s)r[i]++;else{if(i===c-1){if(this.toNarrowWidePattern(r)===e.ASTERISK_ENCODING&&t.isRange(Math.max(0,a-Math.floor((u-a)/2)),a,!1))return[a,u];a+=r[0]+r[1],r.copyWithin(0,2,2+i-1),r[i-1]=0,r[i]=0,i--}else i++;r[i]=1,s=!s}throw new Kr},e.toNarrowWidePattern=function(t){var e,r,n,o=t.length,i=0;do{var a=2147483647;try{for(var s=(e=void 0,qn(t)),c=s.next();!c.done;c=s.next())(d=c.value)<a&&d>i&&(a=d)}catch(h){e={error:h}}finally{try{c&&!c.done&&(r=s.return)&&r.call(s)}finally{if(e)throw e.error}}i=a,n=0;for(var u=0,l=0,f=0;f<o;f++)(d=t[f])>i&&(l|=1<<o-1-f,n++,u+=d);if(3===n){for(f=0;f<o&&n>0;f++){var d;if((d=t[f])>i&&(n--,2*d>=u))return-1}return l}}while(n>3);return-1},e.patternToChar=function(t){for(var r=0;r<e.CHARACTER_ENCODINGS.length;r++)if(e.CHARACTER_ENCODINGS[r]===t)return e.ALPHABET_STRING.charAt(r);if(t===e.ASTERISK_ENCODING)return"*";throw new Kr},e.decodeExtended=function(t){for(var e=t.length,r="",n=0;n<e;n++){var o=t.charAt(n);if("+"===o||"$"===o||"%"===o||"/"===o){var i=t.charAt(n+1),a="\0";switch(o){case"+":if(!(i>="A"&&i<="Z"))throw new Vr;a=String.fromCharCode(i.charCodeAt(0)+32);break;case"$":if(!(i>="A"&&i<="Z"))throw new Vr;a=String.fromCharCode(i.charCodeAt(0)-64);break;case"%":if(i>="A"&&i<="E")a=String.fromCharCode(i.charCodeAt(0)-38);else if(i>="F"&&i<="J")a=String.fromCharCode(i.charCodeAt(0)-11);else if(i>="K"&&i<="O")a=String.fromCharCode(i.charCodeAt(0)+16);else if(i>="P"&&i<="T")a=String.fromCharCode(i.charCodeAt(0)+43);else if("U"===i)a="\0";else if("V"===i)a="@";else if("W"===i)a="`";else{if("X"!==i&&"Y"!==i&&"Z"!==i)throw new Vr;a=""}break;case"/":if(i>="A"&&i<="O")a=String.fromCharCode(i.charCodeAt(0)-32);else{if("Z"!==i)throw new Vr;a=":"}}r+=a,n++}else r+=o}return r},e.ALPHABET_STRING="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-. $/+%",e.CHARACTER_ENCODINGS=[52,289,97,352,49,304,112,37,292,100,265,73,328,25,280,88,13,268,76,28,259,67,322,19,274,82,7,262,70,22,385,193,448,145,400,208,133,388,196,168,162,138,42],e.ASTERISK_ENCODING=148,e}(Gn),Zn=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Qn=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.narrowLineWidth=-1,e}return Zn(e,t),e.prototype.decodeRow=function(t,r,n){var o,i,a=this.decodeStart(r),s=this.decodeEnd(r),c=new $r;e.decodeMiddle(r,a[1],s[0],c);var u=c.toString(),l=null;null!=n&&(l=n.get(Br.ALLOWED_LENGTHS)),null==l&&(l=e.DEFAULT_ALLOWED_LENGTHS);var f=u.length,d=!1,h=0;try{for(var p=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}(l),g=p.next();!g.done;g=p.next()){var m=g.value;if(f===m){d=!0;break}m>h&&(h=m)}}catch(y){o={error:y}}finally{try{g&&!g.done&&(i=p.return)&&i.call(p)}finally{if(o)throw o.error}}if(!d&&f>h&&(d=!0),!d)throw new Vr;var v=[new Rn(a[1],t),new Rn(s[0],t)];return new fn(u,null,0,v,hn.ITF,(new Date).getTime())},e.decodeMiddle=function(t,r,n,o){var i=new Int32Array(10),a=new Int32Array(5),s=new Int32Array(5);for(i.fill(0),a.fill(0),s.fill(0);r<n;){Gn.recordPattern(t,r,i);for(var c=0;c<5;c++){var u=2*c;a[c]=i[u],s[c]=i[u+1]}var l=e.decodeDigit(a);o.append(l.toString()),l=this.decodeDigit(s),o.append(l.toString()),i.forEach(function(t){r+=t})}},e.prototype.decodeStart=function(t){var r=e.skipWhiteSpace(t),n=e.findGuardPattern(t,r,e.START_PATTERN);return this.narrowLineWidth=(n[1]-n[0])/4,this.validateQuietZone(t,n[0]),n},e.prototype.validateQuietZone=function(t,e){var r=10*this.narrowLineWidth;r=r<e?r:e;for(var n=e-1;r>0&&n>=0&&!t.get(n);n--)r--;if(0!==r)throw new Kr},e.skipWhiteSpace=function(t){var e=t.getSize(),r=t.getNextSet(0);if(r===e)throw new Kr;return r},e.prototype.decodeEnd=function(t){t.reverse();try{var r=e.skipWhiteSpace(t),n=void 0;try{n=e.findGuardPattern(t,r,e.END_PATTERN_REVERSED[0])}catch(i){i instanceof Kr&&(n=e.findGuardPattern(t,r,e.END_PATTERN_REVERSED[1]))}this.validateQuietZone(t,n[0]);var o=n[0];return n[0]=t.getSize()-n[1],n[1]=t.getSize()-o,n}finally{t.reverse()}},e.findGuardPattern=function(t,r,n){var o=n.length,i=new Int32Array(o),a=t.getSize(),s=!1,c=0,u=r;i.fill(0);for(var l=r;l<a;l++)if(t.get(l)!==s)i[c]++;else{if(c===o-1){if(Gn.patternMatchVariance(i,n,e.MAX_INDIVIDUAL_VARIANCE)<e.MAX_AVG_VARIANCE)return[u,l];u+=i[0]+i[1],Nr.arraycopy(i,2,i,0,c-1),i[c-1]=0,i[c]=0,c--}else c++;i[c]=1,s=!s}throw new Kr},e.decodeDigit=function(t){for(var r=e.MAX_AVG_VARIANCE,n=-1,o=e.PATTERNS.length,i=0;i<o;i++){var a=e.PATTERNS[i],s=Gn.patternMatchVariance(t,a,e.MAX_INDIVIDUAL_VARIANCE);s<r?(r=s,n=i):s===r&&(n=-1)}if(n>=0)return n%10;throw new Kr},e.PATTERNS=[Int32Array.from([1,1,2,2,1]),Int32Array.from([2,1,1,1,2]),Int32Array.from([1,2,1,1,2]),Int32Array.from([2,2,1,1,1]),Int32Array.from([1,1,2,1,2]),Int32Array.from([2,1,2,1,1]),Int32Array.from([1,2,2,1,1]),Int32Array.from([1,1,1,2,2]),Int32Array.from([2,1,1,2,1]),Int32Array.from([1,2,1,2,1]),Int32Array.from([1,1,3,3,1]),Int32Array.from([3,1,1,1,3]),Int32Array.from([1,3,1,1,3]),Int32Array.from([3,3,1,1,1]),Int32Array.from([1,1,3,1,3]),Int32Array.from([3,1,3,1,1]),Int32Array.from([1,3,3,1,1]),Int32Array.from([1,1,1,3,3]),Int32Array.from([3,1,1,3,1]),Int32Array.from([1,3,1,3,1])],e.MAX_AVG_VARIANCE=.38,e.MAX_INDIVIDUAL_VARIANCE=.5,e.DEFAULT_ALLOWED_LENGTHS=[6,8,10,12,14],e.START_PATTERN=Int32Array.from([1,1,1,1]),e.END_PATTERN_REVERSED=[Int32Array.from([1,1,2]),Int32Array.from([1,1,3])],e}(Gn),Jn=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),to=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.decodeRowStringBuffer="",e}return Jn(e,t),e.findStartGuardPattern=function(t){for(var r,n=!1,o=0,i=Int32Array.from([0,0,0]);!n;){i=Int32Array.from([0,0,0]);var a=(r=e.findGuardPattern(t,o,!1,this.START_END_PATTERN,i))[0],s=a-((o=r[1])-a);s>=0&&(n=t.isRange(s,a,!1))}return r},e.checkChecksum=function(t){return e.checkStandardUPCEANChecksum(t)},e.checkStandardUPCEANChecksum=function(t){var r=t.length;if(0===r)return!1;var n=parseInt(t.charAt(r-1),10);return e.getStandardUPCEANChecksum(t.substring(0,r-1))===n},e.getStandardUPCEANChecksum=function(t){for(var e=t.length,r=0,n=e-1;n>=0;n-=2){if((o=t.charAt(n).charCodeAt(0)-"0".charCodeAt(0))<0||o>9)throw new Vr;r+=o}for(r*=3,n=e-2;n>=0;n-=2){var o;if((o=t.charAt(n).charCodeAt(0)-"0".charCodeAt(0))<0||o>9)throw new Vr;r+=o}return(1e3-r)%10},e.decodeEnd=function(t,r){return e.findGuardPattern(t,r,!1,e.START_END_PATTERN,new Int32Array(e.START_END_PATTERN.length).fill(0))},e.findGuardPatternWithoutCounters=function(t,e,r,n){return this.findGuardPattern(t,e,r,n,new Int32Array(n.length))},e.findGuardPattern=function(t,r,n,o,i){for(var a=t.getSize(),s=0,c=r=n?t.getNextUnset(r):t.getNextSet(r),u=o.length,l=n,f=r;f<a;f++)if(t.get(f)!==l)i[s]++;else{if(s===u-1){if(Gn.patternMatchVariance(i,o,e.MAX_INDIVIDUAL_VARIANCE)<e.MAX_AVG_VARIANCE)return Int32Array.from([c,f]);c+=i[0]+i[1];for(var d=i.slice(2,i.length-1),h=0;h<s-1;h++)i[h]=d[h];i[s-1]=0,i[s]=0,s--}else s++;i[s]=1,l=!l}throw new Kr},e.decodeDigit=function(t,r,n,o){this.recordPattern(t,n,r);for(var i=this.MAX_AVG_VARIANCE,a=-1,s=o.length,c=0;c<s;c++){var u=o[c],l=Gn.patternMatchVariance(r,u,e.MAX_INDIVIDUAL_VARIANCE);l<i&&(i=l,a=c)}if(a>=0)return a;throw new Kr},e.MAX_AVG_VARIANCE=.48,e.MAX_INDIVIDUAL_VARIANCE=.7,e.START_END_PATTERN=Int32Array.from([1,1,1]),e.MIDDLE_PATTERN=Int32Array.from([1,1,1,1,1]),e.END_PATTERN=Int32Array.from([1,1,1,1,1,1]),e.L_PATTERNS=[Int32Array.from([3,2,1,1]),Int32Array.from([2,2,2,1]),Int32Array.from([2,1,2,2]),Int32Array.from([1,4,1,1]),Int32Array.from([1,1,3,2]),Int32Array.from([1,2,3,1]),Int32Array.from([1,1,1,4]),Int32Array.from([1,3,1,2]),Int32Array.from([1,2,1,3]),Int32Array.from([3,1,1,2])],e}(Gn),eo=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},ro=function(){function t(){this.CHECK_DIGIT_ENCODINGS=[24,20,18,17,12,6,3,10,9,5],this.decodeMiddleCounters=Int32Array.from([0,0,0,0]),this.decodeRowStringBuffer=""}return t.prototype.decodeRow=function(e,r,n){var o=this.decodeRowStringBuffer,i=this.decodeMiddle(r,n,o),a=o.toString(),s=t.parseExtensionString(a),c=[new Rn((n[0]+n[1])/2,e),new Rn(i,e)],u=new fn(a,null,0,c,hn.UPC_EAN_EXTENSION,(new Date).getTime());return null!=s&&u.putAllMetadata(s),u},t.prototype.decodeMiddle=function(e,r,n){var o,i,a=this.decodeMiddleCounters;a[0]=0,a[1]=0,a[2]=0,a[3]=0;for(var s=e.getSize(),c=r[1],u=0,l=0;l<5&&c<s;l++){var f=to.decodeDigit(e,a,c,to.L_AND_G_PATTERNS);n+=String.fromCharCode("0".charCodeAt(0)+f%10);try{for(var d=(o=void 0,eo(a)),h=d.next();!h.done;h=d.next())c+=h.value}catch(g){o={error:g}}finally{try{h&&!h.done&&(i=d.return)&&i.call(d)}finally{if(o)throw o.error}}f>=10&&(u|=1<<4-l),4!==l&&(c=e.getNextSet(c),c=e.getNextUnset(c))}if(5!==n.length)throw new Kr;var p=this.determineCheckDigit(u);if(t.extensionChecksum(n.toString())!==p)throw new Kr;return c},t.extensionChecksum=function(t){for(var e=t.length,r=0,n=e-2;n>=0;n-=2)r+=t.charAt(n).charCodeAt(0)-"0".charCodeAt(0);for(r*=3,n=e-1;n>=0;n-=2)r+=t.charAt(n).charCodeAt(0)-"0".charCodeAt(0);return(r*=3)%10},t.prototype.determineCheckDigit=function(t){for(var e=0;e<10;e++)if(t===this.CHECK_DIGIT_ENCODINGS[e])return e;throw new Kr},t.parseExtensionString=function(e){if(5!==e.length)return null;var r=t.parseExtension5String(e);return null==r?null:new Map([[gn.SUGGESTED_PRICE,r]])},t.parseExtension5String=function(t){var e;switch(t.charAt(0)){case"0":e="£";break;case"5":e="$";break;case"9":switch(t){case"90000":return null;case"99991":return"0.00";case"99990":return"Used"}e="";break;default:e=""}var r=parseInt(t.substring(1)),n=r%100;return e+(r/100).toString()+"."+(n<10?"0"+n:n.toString())},t}(),no=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},oo=function(){function t(){this.decodeMiddleCounters=Int32Array.from([0,0,0,0]),this.decodeRowStringBuffer=""}return t.prototype.decodeRow=function(e,r,n){var o=this.decodeRowStringBuffer,i=this.decodeMiddle(r,n,o),a=o.toString(),s=t.parseExtensionString(a),c=[new Rn((n[0]+n[1])/2,e),new Rn(i,e)],u=new fn(a,null,0,c,hn.UPC_EAN_EXTENSION,(new Date).getTime());return null!=s&&u.putAllMetadata(s),u},t.prototype.decodeMiddle=function(t,e,r){var n,o,i=this.decodeMiddleCounters;i[0]=0,i[1]=0,i[2]=0,i[3]=0;for(var a=t.getSize(),s=e[1],c=0,u=0;u<2&&s<a;u++){var l=to.decodeDigit(t,i,s,to.L_AND_G_PATTERNS);r+=String.fromCharCode("0".charCodeAt(0)+l%10);try{for(var f=(n=void 0,no(i)),d=f.next();!d.done;d=f.next())s+=d.value}catch(h){n={error:h}}finally{try{d&&!d.done&&(o=f.return)&&o.call(f)}finally{if(n)throw n.error}}l>=10&&(c|=1<<1-u),1!==u&&(s=t.getNextSet(s),s=t.getNextUnset(s))}if(2!==r.length)throw new Kr;if(parseInt(r.toString())%4!==c)throw new Kr;return s},t.parseExtensionString=function(t){return 2!==t.length?null:new Map([[gn.ISSUE_NUMBER,parseInt(t)]])},t}(),io=function(){function t(){}return t.decodeRow=function(t,e,r){var n=to.findGuardPattern(e,r,!1,this.EXTENSION_START_PATTERN,new Int32Array(this.EXTENSION_START_PATTERN.length).fill(0));try{return(new ro).decodeRow(t,e,n)}catch(o){return(new oo).decodeRow(t,e,n)}},t.EXTENSION_START_PATTERN=Int32Array.from([1,1,2]),t}(),ao=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),so=function(t){function e(){var r=t.call(this)||this;r.decodeRowStringBuffer="",e.L_AND_G_PATTERNS=e.L_PATTERNS.map(function(t){return Int32Array.from(t)});for(var n=10;n<20;n++){for(var o=e.L_PATTERNS[n-10],i=new Int32Array(o.length),a=0;a<o.length;a++)i[a]=o[o.length-a-1];e.L_AND_G_PATTERNS[n]=i}return r}return ao(e,t),e.prototype.decodeRow=function(t,r,n){var o=e.findStartGuardPattern(r),i=null==n?null:n.get(Br.NEED_RESULT_POINT_CALLBACK);if(null!=i){var a=new Rn((o[0]+o[1])/2,t);i.foundPossibleResultPoint(a)}var s=this.decodeMiddle(r,o,this.decodeRowStringBuffer),c=s.rowOffset,u=s.resultString;if(null!=i){var l=new Rn(c,t);i.foundPossibleResultPoint(l)}var f=e.decodeEnd(r,c);if(null!=i){var d=new Rn((f[0]+f[1])/2,t);i.foundPossibleResultPoint(d)}var h=f[1],p=h+(h-f[0]);if(p>=r.getSize()||!r.isRange(h,p,!1))throw new Kr;var g=u.toString();if(g.length<8)throw new Vr;if(!e.checkChecksum(g))throw new Or;var m=(o[1]+o[0])/2,v=(f[1]+f[0])/2,y=this.getBarcodeFormat(),_=[new Rn(m,t),new Rn(v,t)],w=new fn(g,null,0,_,y,(new Date).getTime()),b=0;try{var C=io.decodeRow(t,r,f[1]);w.putMetadata(gn.UPC_EAN_EXTENSION,C.getText()),w.putAllMetadata(C.getResultMetadata()),w.addResultPoints(C.getResultPoints()),b=C.getText().length}catch(S){}var A=null==n?null:n.get(Br.ALLOWED_EAN_EXTENSIONS);if(null!=A){var E=!1;for(var I in A)if(b.toString()===I){E=!0;break}if(!E)throw new Kr}return y===hn.EAN_13||hn.UPC_A,w},e.checkChecksum=function(t){return e.checkStandardUPCEANChecksum(t)},e.checkStandardUPCEANChecksum=function(t){var r=t.length;if(0===r)return!1;var n=parseInt(t.charAt(r-1),10);return e.getStandardUPCEANChecksum(t.substring(0,r-1))===n},e.getStandardUPCEANChecksum=function(t){for(var e=t.length,r=0,n=e-1;n>=0;n-=2){if((o=t.charAt(n).charCodeAt(0)-"0".charCodeAt(0))<0||o>9)throw new Vr;r+=o}for(r*=3,n=e-2;n>=0;n-=2){var o;if((o=t.charAt(n).charCodeAt(0)-"0".charCodeAt(0))<0||o>9)throw new Vr;r+=o}return(1e3-r)%10},e.decodeEnd=function(t,r){return e.findGuardPattern(t,r,!1,e.START_END_PATTERN,new Int32Array(e.START_END_PATTERN.length).fill(0))},e}(to),co=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),uo=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},lo=function(t){function e(){var e=t.call(this)||this;return e.decodeMiddleCounters=Int32Array.from([0,0,0,0]),e}return co(e,t),e.prototype.decodeMiddle=function(t,r,n){var o,i,a,s,c=this.decodeMiddleCounters;c[0]=0,c[1]=0,c[2]=0,c[3]=0;for(var u=t.getSize(),l=r[1],f=0,d=0;d<6&&l<u;d++){var h=so.decodeDigit(t,c,l,so.L_AND_G_PATTERNS);n+=String.fromCharCode("0".charCodeAt(0)+h%10);try{for(var p=(o=void 0,uo(c)),g=p.next();!g.done;g=p.next())l+=g.value}catch(y){o={error:y}}finally{try{g&&!g.done&&(i=p.return)&&i.call(p)}finally{if(o)throw o.error}}h>=10&&(f|=1<<5-d)}for(n=e.determineFirstDigit(n,f),l=so.findGuardPattern(t,l,!0,so.MIDDLE_PATTERN,new Int32Array(so.MIDDLE_PATTERN.length).fill(0))[1],d=0;d<6&&l<u;d++){h=so.decodeDigit(t,c,l,so.L_PATTERNS),n+=String.fromCharCode("0".charCodeAt(0)+h);try{for(var m=(a=void 0,uo(c)),v=m.next();!v.done;v=m.next())l+=v.value}catch(y){a={error:y}}finally{try{v&&!v.done&&(s=m.return)&&s.call(m)}finally{if(a)throw a.error}}}return{rowOffset:l,resultString:n}},e.prototype.getBarcodeFormat=function(){return hn.EAN_13},e.determineFirstDigit=function(t,e){for(var r=0;r<10;r++)if(e===this.FIRST_DIGIT_ENCODINGS[r])return String.fromCharCode("0".charCodeAt(0)+r)+t;throw new Kr},e.FIRST_DIGIT_ENCODINGS=[0,11,13,14,19,25,28,21,22,26],e}(so),fo=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),ho=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},po=function(t){function e(){var e=t.call(this)||this;return e.decodeMiddleCounters=Int32Array.from([0,0,0,0]),e}return fo(e,t),e.prototype.decodeMiddle=function(t,e,r){var n,o,i,a,s=this.decodeMiddleCounters;s[0]=0,s[1]=0,s[2]=0,s[3]=0;for(var c=t.getSize(),u=e[1],l=0;l<4&&u<c;l++){var f=so.decodeDigit(t,s,u,so.L_PATTERNS);r+=String.fromCharCode("0".charCodeAt(0)+f);try{for(var d=(n=void 0,ho(s)),h=d.next();!h.done;h=d.next())u+=h.value}catch(m){n={error:m}}finally{try{h&&!h.done&&(o=d.return)&&o.call(d)}finally{if(n)throw n.error}}}for(u=so.findGuardPattern(t,u,!0,so.MIDDLE_PATTERN,new Int32Array(so.MIDDLE_PATTERN.length).fill(0))[1],l=0;l<4&&u<c;l++){f=so.decodeDigit(t,s,u,so.L_PATTERNS),r+=String.fromCharCode("0".charCodeAt(0)+f);try{for(var p=(i=void 0,ho(s)),g=p.next();!g.done;g=p.next())u+=g.value}catch(m){i={error:m}}finally{try{g&&!g.done&&(a=p.return)&&a.call(p)}finally{if(i)throw i.error}}}return{rowOffset:u,resultString:r}},e.prototype.getBarcodeFormat=function(){return hn.EAN_8},e}(so),go=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),mo=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.ean13Reader=new lo,e}return go(e,t),e.prototype.getBarcodeFormat=function(){return hn.UPC_A},e.prototype.decode=function(t,e){return this.maybeReturnResult(this.ean13Reader.decode(t))},e.prototype.decodeRow=function(t,e,r){return this.maybeReturnResult(this.ean13Reader.decodeRow(t,e,r))},e.prototype.decodeMiddle=function(t,e,r){return this.ean13Reader.decodeMiddle(t,e,r)},e.prototype.maybeReturnResult=function(t){var e=t.getText();if("0"===e.charAt(0)){var r=new fn(e.substring(1),null,null,t.getResultPoints(),hn.UPC_A);return null!=t.getResultMetadata()&&r.putAllMetadata(t.getResultMetadata()),r}throw new Kr},e.prototype.reset=function(){this.ean13Reader.reset()},e}(so),vo=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),yo=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},_o=function(t){function e(){var e=t.call(this)||this;return e.decodeMiddleCounters=new Int32Array(4),e}return vo(e,t),e.prototype.decodeMiddle=function(t,r,n){var o,i,a=this.decodeMiddleCounters.map(function(t){return t});a[0]=0,a[1]=0,a[2]=0,a[3]=0;for(var s=t.getSize(),c=r[1],u=0,l=0;l<6&&c<s;l++){var f=e.decodeDigit(t,a,c,e.L_AND_G_PATTERNS);n+=String.fromCharCode("0".charCodeAt(0)+f%10);try{for(var d=(o=void 0,yo(a)),h=d.next();!h.done;h=d.next())c+=h.value}catch(p){o={error:p}}finally{try{h&&!h.done&&(i=d.return)&&i.call(d)}finally{if(o)throw o.error}}f>=10&&(u|=1<<5-l)}return e.determineNumSysAndCheckDigit(new $r(n),u),c},e.prototype.decodeEnd=function(t,r){return e.findGuardPatternWithoutCounters(t,r,!0,e.MIDDLE_END_PATTERN)},e.prototype.checkChecksum=function(t){return so.checkChecksum(e.convertUPCEtoUPCA(t))},e.determineNumSysAndCheckDigit=function(t,e){for(var r=0;r<=1;r++)for(var n=0;n<10;n++)if(e===this.NUMSYS_AND_CHECK_DIGIT_PATTERNS[r][n])return t.insert(0,"0"+r),void t.append("0"+n);throw Kr.getNotFoundInstance()},e.prototype.getBarcodeFormat=function(){return hn.UPC_E},e.convertUPCEtoUPCA=function(t){var e=t.slice(1,7).split("").map(function(t){return t.charCodeAt(0)}),r=new $r;r.append(t.charAt(0));var n=e[5];switch(n){case 0:case 1:case 2:r.appendChars(e,0,2),r.append(n),r.append("0000"),r.appendChars(e,2,3);break;case 3:r.appendChars(e,0,3),r.append("00000"),r.appendChars(e,3,2);break;case 4:r.appendChars(e,0,4),r.append("00000"),r.append(e[4]);break;default:r.appendChars(e,0,5),r.append("0000"),r.append(n)}return t.length>=8&&r.append(t.charAt(7)),r.toString()},e.MIDDLE_END_PATTERN=Int32Array.from([1,1,1,1,1,1]),e.NUMSYS_AND_CHECK_DIGIT_PATTERNS=[Int32Array.from([56,52,50,49,44,38,35,42,41,37]),Int32Array.from([7,11,13,14,19,25,28,21,22,1])],e}(so),wo=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),bo=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Co=function(t){function e(e){var r=t.call(this)||this,n=null==e?null:e.get(Br.POSSIBLE_FORMATS),o=[];return null!=n&&(n.indexOf(hn.EAN_13)>-1?o.push(new lo):n.indexOf(hn.UPC_A)>-1&&o.push(new mo),n.indexOf(hn.EAN_8)>-1&&o.push(new po),n.indexOf(hn.UPC_E)>-1&&o.push(new _o)),0===o.length&&(o.push(new lo),o.push(new po),o.push(new _o)),r.readers=o,r}return wo(e,t),e.prototype.decodeRow=function(t,e,r){var n,o;try{for(var i=bo(this.readers),a=i.next();!a.done;a=i.next()){var s=a.value;try{var c=s.decodeRow(t,e,r),u=c.getBarcodeFormat()===hn.EAN_13&&"0"===c.getText().charAt(0),l=null==r?null:r.get(Br.POSSIBLE_FORMATS),f=null==l||l.includes(hn.UPC_A);if(u&&f){var d=c.getRawBytes(),h=new fn(c.getText().substring(1),d,d.length,c.getResultPoints(),hn.UPC_A);return h.putAllMetadata(c.getResultMetadata()),h}return c}catch(p){}}}catch(p){n={error:p}}finally{try{a&&!a.done&&(o=i.return)&&o.call(i)}finally{if(n)throw n.error}}throw new Kr},e.prototype.reset=function(){var t,e;try{for(var r=bo(this.readers),n=r.next();!n.done;n=r.next())n.value.reset()}catch(o){t={error:o}}finally{try{n&&!n.done&&(e=r.return)&&e.call(r)}finally{if(t)throw t.error}}},e}(Gn),Ao=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Eo=function(t){function e(){var e=t.call(this)||this;return e.decodeFinderCounters=new Int32Array(4),e.dataCharacterCounters=new Int32Array(8),e.oddRoundingErrors=new Array(4),e.evenRoundingErrors=new Array(4),e.oddCounts=new Array(e.dataCharacterCounters.length/2),e.evenCounts=new Array(e.dataCharacterCounters.length/2),e}return Ao(e,t),e.prototype.getDecodeFinderCounters=function(){return this.decodeFinderCounters},e.prototype.getDataCharacterCounters=function(){return this.dataCharacterCounters},e.prototype.getOddRoundingErrors=function(){return this.oddRoundingErrors},e.prototype.getEvenRoundingErrors=function(){return this.evenRoundingErrors},e.prototype.getOddCounts=function(){return this.oddCounts},e.prototype.getEvenCounts=function(){return this.evenCounts},e.prototype.parseFinderValue=function(t,r){for(var n=0;n<r.length;n++)if(Gn.patternMatchVariance(t,r[n],e.MAX_INDIVIDUAL_VARIANCE)<e.MAX_AVG_VARIANCE)return n;throw new Kr},e.count=function(t){return Nn.sum(new Int32Array(t))},e.increment=function(t,e){for(var r=0,n=e[0],o=1;o<t.length;o++)e[o]>n&&(n=e[o],r=o);t[r]++},e.decrement=function(t,e){for(var r=0,n=e[0],o=1;o<t.length;o++)e[o]<n&&(n=e[o],r=o);t[r]--},e.isFinderPattern=function(t){var r,n,o=t[0]+t[1],i=o/(o+t[2]+t[3]);if(i>=e.MIN_FINDER_PATTERN_RATIO&&i<=e.MAX_FINDER_PATTERN_RATIO){var a=Number.MAX_SAFE_INTEGER,s=Number.MIN_SAFE_INTEGER;try{for(var c=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}(t),u=c.next();!u.done;u=c.next()){var l=u.value;l>s&&(s=l),l<a&&(a=l)}}catch(f){r={error:f}}finally{try{u&&!u.done&&(n=c.return)&&n.call(c)}finally{if(r)throw r.error}}return s<10*a}return!1},e.MAX_AVG_VARIANCE=.2,e.MAX_INDIVIDUAL_VARIANCE=.45,e.MIN_FINDER_PATTERN_RATIO=9.5/12,e.MAX_FINDER_PATTERN_RATIO=12.5/14,e}(Gn),Io=function(){function t(t,e){this.value=t,this.checksumPortion=e}return t.prototype.getValue=function(){return this.value},t.prototype.getChecksumPortion=function(){return this.checksumPortion},t.prototype.toString=function(){return this.value+"("+this.checksumPortion+")"},t.prototype.equals=function(e){if(!(e instanceof t))return!1;var r=e;return this.value===r.value&&this.checksumPortion===r.checksumPortion},t.prototype.hashCode=function(){return this.value^this.checksumPortion},t}(),So=function(){function t(t,e,r,n,o){this.value=t,this.startEnd=e,this.value=t,this.startEnd=e,this.resultPoints=new Array,this.resultPoints.push(new Rn(r,o)),this.resultPoints.push(new Rn(n,o))}return t.prototype.getValue=function(){return this.value},t.prototype.getStartEnd=function(){return this.startEnd},t.prototype.getResultPoints=function(){return this.resultPoints},t.prototype.equals=function(e){if(!(e instanceof t))return!1;var r=e;return this.value===r.value},t.prototype.hashCode=function(){return this.value},t}(),Oo=function(){function t(){}return t.getRSSvalue=function(e,r,n){var o,i,a=0;try{for(var s=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}(e),c=s.next();!c.done;c=s.next())a+=c.value}catch(v){o={error:v}}finally{try{c&&!c.done&&(i=s.return)&&i.call(s)}finally{if(o)throw o.error}}for(var u=0,l=0,f=e.length,d=0;d<f-1;d++){var h=void 0;for(h=1,l|=1<<d;h<e[d];h++,l&=~(1<<d)){var p=t.combins(a-h-1,f-d-2);if(n&&0===l&&a-h-(f-d-1)>=f-d-1&&(p-=t.combins(a-h-(f-d),f-d-2)),f-d-1>1){for(var g=0,m=a-h-(f-d-2);m>r;m--)g+=t.combins(a-h-m-1,f-d-3);p-=g*(f-1-d)}else a-h>r&&p--;u+=p}a-=h}return u},t.combins=function(t,e){var r,n;t-e>e?(n=e,r=t-e):(n=t-e,r=e);for(var o=1,i=1,a=t;a>r;a--)o*=a,i<=n&&(o/=i,i++);for(;i<=n;)o/=i,i++;return o},t}(),To=function(){function t(){}return t.buildBitArray=function(t){var e=2*t.length-1;null==t[t.length-1].getRightChar()&&(e-=1);for(var r=new Lr(12*e),n=0,o=t[0].getRightChar().getValue(),i=11;i>=0;--i)!!(o&1<<i)&&r.set(n),n++;for(i=1;i<t.length;++i){for(var a=t[i],s=a.getLeftChar().getValue(),c=11;c>=0;--c)!!(s&1<<c)&&r.set(n),n++;if(null!=a.getRightChar()){var u=a.getRightChar().getValue();for(c=11;c>=0;--c)!!(u&1<<c)&&r.set(n),n++}}return r},t}(),No=function(){function t(t,e){e?this.decodedInformation=null:(this.finished=t,this.decodedInformation=e)}return t.prototype.getDecodedInformation=function(){return this.decodedInformation},t.prototype.isFinished=function(){return this.finished},t}(),xo=function(){function t(t){this.newPosition=t}return t.prototype.getNewPosition=function(){return this.newPosition},t}(),Ro=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Do=function(t){function e(e,r){var n=t.call(this,e)||this;return n.value=r,n}return Ro(e,t),e.prototype.getValue=function(){return this.value},e.prototype.isFNC1=function(){return this.value===e.FNC1},e.FNC1="$",e}(xo),Po=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Mo=function(t){function e(e,r,n){var o=t.call(this,e)||this;return n?(o.remaining=!0,o.remainingValue=o.remainingValue):(o.remaining=!1,o.remainingValue=0),o.newString=r,o}return Po(e,t),e.prototype.getNewString=function(){return this.newString},e.prototype.isRemaining=function(){return this.remaining},e.prototype.getRemainingValue=function(){return this.remainingValue},e}(xo),ko=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Lo=function(t){function e(e,r,n){var o=t.call(this,e)||this;if(r<0||r>10||n<0||n>10)throw new Vr;return o.firstDigit=r,o.secondDigit=n,o}return ko(e,t),e.prototype.getFirstDigit=function(){return this.firstDigit},e.prototype.getSecondDigit=function(){return this.secondDigit},e.prototype.getValue=function(){return 10*this.firstDigit+this.secondDigit},e.prototype.isFirstDigitFNC1=function(){return this.firstDigit===e.FNC1},e.prototype.isSecondDigitFNC1=function(){return this.secondDigit===e.FNC1},e.prototype.isAnyFNC1=function(){return this.firstDigit===e.FNC1||this.secondDigit===e.FNC1},e.FNC1=10,e}(xo),jo=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Bo=function(){function t(){}return t.parseFieldsInGeneralPurpose=function(e){var r,n,o,i,a,s,c,u;if(!e)return null;if(e.length<2)throw new Kr;var l=e.substring(0,2);try{for(var f=jo(t.TWO_DIGIT_DATA_LENGTH),d=f.next();!d.done;d=f.next())if((b=d.value)[0]===l)return b[1]===t.VARIABLE_LENGTH?t.processVariableAI(2,b[2],e):t.processFixedAI(2,b[1],e)}catch(C){r={error:C}}finally{try{d&&!d.done&&(n=f.return)&&n.call(f)}finally{if(r)throw r.error}}if(e.length<3)throw new Kr;var h=e.substring(0,3);try{for(var p=jo(t.THREE_DIGIT_DATA_LENGTH),g=p.next();!g.done;g=p.next())if((b=g.value)[0]===h)return b[1]===t.VARIABLE_LENGTH?t.processVariableAI(3,b[2],e):t.processFixedAI(3,b[1],e)}catch(C){o={error:C}}finally{try{g&&!g.done&&(i=p.return)&&i.call(p)}finally{if(o)throw o.error}}try{for(var m=jo(t.THREE_DIGIT_PLUS_DIGIT_DATA_LENGTH),v=m.next();!v.done;v=m.next())if((b=v.value)[0]===h)return b[1]===t.VARIABLE_LENGTH?t.processVariableAI(4,b[2],e):t.processFixedAI(4,b[1],e)}catch(C){a={error:C}}finally{try{v&&!v.done&&(s=m.return)&&s.call(m)}finally{if(a)throw a.error}}if(e.length<4)throw new Kr;var y=e.substring(0,4);try{for(var _=jo(t.FOUR_DIGIT_DATA_LENGTH),w=_.next();!w.done;w=_.next()){var b;if((b=w.value)[0]===y)return b[1]===t.VARIABLE_LENGTH?t.processVariableAI(4,b[2],e):t.processFixedAI(4,b[1],e)}}catch(C){c={error:C}}finally{try{w&&!w.done&&(u=_.return)&&u.call(_)}finally{if(c)throw c.error}}throw new Kr},t.processFixedAI=function(e,r,n){if(n.length<e)throw new Kr;var o=n.substring(0,e);if(n.length<e+r)throw new Kr;var i=n.substring(e,e+r),a=n.substring(e+r),s="("+o+")"+i,c=t.parseFieldsInGeneralPurpose(a);return null==c?s:s+c},t.processVariableAI=function(e,r,n){var o,i=n.substring(0,e);o=n.length<e+r?n.length:e+r;var a=n.substring(e,o),s=n.substring(o),c="("+i+")"+a,u=t.parseFieldsInGeneralPurpose(s);return null==u?c:c+u},t.VARIABLE_LENGTH=[],t.TWO_DIGIT_DATA_LENGTH=[["00",18],["01",14],["02",14],["10",t.VARIABLE_LENGTH,20],["11",6],["12",6],["13",6],["15",6],["17",6],["20",2],["21",t.VARIABLE_LENGTH,20],["22",t.VARIABLE_LENGTH,29],["30",t.VARIABLE_LENGTH,8],["37",t.VARIABLE_LENGTH,8],["90",t.VARIABLE_LENGTH,30],["91",t.VARIABLE_LENGTH,30],["92",t.VARIABLE_LENGTH,30],["93",t.VARIABLE_LENGTH,30],["94",t.VARIABLE_LENGTH,30],["95",t.VARIABLE_LENGTH,30],["96",t.VARIABLE_LENGTH,30],["97",t.VARIABLE_LENGTH,3],["98",t.VARIABLE_LENGTH,30],["99",t.VARIABLE_LENGTH,30]],t.THREE_DIGIT_DATA_LENGTH=[["240",t.VARIABLE_LENGTH,30],["241",t.VARIABLE_LENGTH,30],["242",t.VARIABLE_LENGTH,6],["250",t.VARIABLE_LENGTH,30],["251",t.VARIABLE_LENGTH,30],["253",t.VARIABLE_LENGTH,17],["254",t.VARIABLE_LENGTH,20],["400",t.VARIABLE_LENGTH,30],["401",t.VARIABLE_LENGTH,30],["402",17],["403",t.VARIABLE_LENGTH,30],["410",13],["411",13],["412",13],["413",13],["414",13],["420",t.VARIABLE_LENGTH,20],["421",t.VARIABLE_LENGTH,15],["422",3],["423",t.VARIABLE_LENGTH,15],["424",3],["425",3],["426",3]],t.THREE_DIGIT_PLUS_DIGIT_DATA_LENGTH=[["310",6],["311",6],["312",6],["313",6],["314",6],["315",6],["316",6],["320",6],["321",6],["322",6],["323",6],["324",6],["325",6],["326",6],["327",6],["328",6],["329",6],["330",6],["331",6],["332",6],["333",6],["334",6],["335",6],["336",6],["340",6],["341",6],["342",6],["343",6],["344",6],["345",6],["346",6],["347",6],["348",6],["349",6],["350",6],["351",6],["352",6],["353",6],["354",6],["355",6],["356",6],["357",6],["360",6],["361",6],["362",6],["363",6],["364",6],["365",6],["366",6],["367",6],["368",6],["369",6],["390",t.VARIABLE_LENGTH,15],["391",t.VARIABLE_LENGTH,18],["392",t.VARIABLE_LENGTH,15],["393",t.VARIABLE_LENGTH,18],["703",t.VARIABLE_LENGTH,30]],t.FOUR_DIGIT_DATA_LENGTH=[["7001",13],["7002",t.VARIABLE_LENGTH,30],["7003",10],["8001",14],["8002",t.VARIABLE_LENGTH,20],["8003",t.VARIABLE_LENGTH,30],["8004",t.VARIABLE_LENGTH,30],["8005",6],["8006",18],["8007",t.VARIABLE_LENGTH,30],["8008",t.VARIABLE_LENGTH,12],["8018",18],["8020",t.VARIABLE_LENGTH,25],["8100",6],["8101",10],["8102",2],["8110",t.VARIABLE_LENGTH,70],["8200",t.VARIABLE_LENGTH,70]],t}(),Fo=function(){function t(t){this.buffer=new $r,this.information=t}return t.prototype.decodeAllCodes=function(t,e){for(var r=e,n=null;;){var o=this.decodeGeneralPurposeField(r,n),i=Bo.parseFieldsInGeneralPurpose(o.getNewString());if(null!=i&&t.append(i),n=o.isRemaining()?""+o.getRemainingValue():null,r===o.getNewPosition())break;r=o.getNewPosition()}return t.toString()},t.prototype.isStillNumeric=function(t){if(t+7>this.information.getSize())return t+4<=this.information.getSize();for(var e=t;e<t+3;++e)if(this.information.get(e))return!0;return this.information.get(t+3)},t.prototype.decodeNumeric=function(t){if(t+7>this.information.getSize()){var e=this.extractNumericValueFromBitArray(t,4);return new Lo(this.information.getSize(),0===e?Lo.FNC1:e-1,Lo.FNC1)}var r=this.extractNumericValueFromBitArray(t,7);return new Lo(t+7,(r-8)/11,(r-8)%11)},t.prototype.extractNumericValueFromBitArray=function(e,r){return t.extractNumericValueFromBitArray(this.information,e,r)},t.extractNumericValueFromBitArray=function(t,e,r){for(var n=0,o=0;o<r;++o)t.get(e+o)&&(n|=1<<r-o-1);return n},t.prototype.decodeGeneralPurposeField=function(t,e){this.buffer.setLengthToZero(),null!=e&&this.buffer.append(e),this.current.setPosition(t);var r=this.parseBlocks();return null!=r&&r.isRemaining()?new Mo(this.current.getPosition(),this.buffer.toString(),r.getRemainingValue()):new Mo(this.current.getPosition(),this.buffer.toString())},t.prototype.parseBlocks=function(){var t,e;do{var r=this.current.getPosition();if(t=this.current.isAlpha()?(e=this.parseAlphaBlock()).isFinished():this.current.isIsoIec646()?(e=this.parseIsoIec646Block()).isFinished():(e=this.parseNumericBlock()).isFinished(),r===this.current.getPosition()&&!t)break}while(!t);return e.getDecodedInformation()},t.prototype.parseNumericBlock=function(){for(;this.isStillNumeric(this.current.getPosition());){var t=this.decodeNumeric(this.current.getPosition());if(this.current.setPosition(t.getNewPosition()),t.isFirstDigitFNC1()){var e=void 0;return e=t.isSecondDigitFNC1()?new Mo(this.current.getPosition(),this.buffer.toString()):new Mo(this.current.getPosition(),this.buffer.toString(),t.getSecondDigit()),new No(!0,e)}if(this.buffer.append(t.getFirstDigit()),t.isSecondDigitFNC1())return e=new Mo(this.current.getPosition(),this.buffer.toString()),new No(!0,e);this.buffer.append(t.getSecondDigit())}return this.isNumericToAlphaNumericLatch(this.current.getPosition())&&(this.current.setAlpha(),this.current.incrementPosition(4)),new No(!1)},t.prototype.parseIsoIec646Block=function(){for(;this.isStillIsoIec646(this.current.getPosition());){var t=this.decodeIsoIec646(this.current.getPosition());if(this.current.setPosition(t.getNewPosition()),t.isFNC1()){var e=new Mo(this.current.getPosition(),this.buffer.toString());return new No(!0,e)}this.buffer.append(t.getValue())}return this.isAlphaOr646ToNumericLatch(this.current.getPosition())?(this.current.incrementPosition(3),this.current.setNumeric()):this.isAlphaTo646ToAlphaLatch(this.current.getPosition())&&(this.current.getPosition()+5<this.information.getSize()?this.current.incrementPosition(5):this.current.setPosition(this.information.getSize()),this.current.setAlpha()),new No(!1)},t.prototype.parseAlphaBlock=function(){for(;this.isStillAlpha(this.current.getPosition());){var t=this.decodeAlphanumeric(this.current.getPosition());if(this.current.setPosition(t.getNewPosition()),t.isFNC1()){var e=new Mo(this.current.getPosition(),this.buffer.toString());return new No(!0,e)}this.buffer.append(t.getValue())}return this.isAlphaOr646ToNumericLatch(this.current.getPosition())?(this.current.incrementPosition(3),this.current.setNumeric()):this.isAlphaTo646ToAlphaLatch(this.current.getPosition())&&(this.current.getPosition()+5<this.information.getSize()?this.current.incrementPosition(5):this.current.setPosition(this.information.getSize()),this.current.setIsoIec646()),new No(!1)},t.prototype.isStillIsoIec646=function(t){if(t+5>this.information.getSize())return!1;var e=this.extractNumericValueFromBitArray(t,5);if(e>=5&&e<16)return!0;if(t+7>this.information.getSize())return!1;var r=this.extractNumericValueFromBitArray(t,7);if(r>=64&&r<116)return!0;if(t+8>this.information.getSize())return!1;var n=this.extractNumericValueFromBitArray(t,8);return n>=232&&n<253},t.prototype.decodeIsoIec646=function(t){var e=this.extractNumericValueFromBitArray(t,5);if(15===e)return new Do(t+5,Do.FNC1);if(e>=5&&e<15)return new Do(t+5,"0"+(e-5));var r,n=this.extractNumericValueFromBitArray(t,7);if(n>=64&&n<90)return new Do(t+7,""+(n+1));if(n>=90&&n<116)return new Do(t+7,""+(n+7));switch(this.extractNumericValueFromBitArray(t,8)){case 232:r="!";break;case 233:r='"';break;case 234:r="%";break;case 235:r="&";break;case 236:r="'";break;case 237:r="(";break;case 238:r=")";break;case 239:r="*";break;case 240:r="+";break;case 241:r=",";break;case 242:r="-";break;case 243:r=".";break;case 244:r="/";break;case 245:r=":";break;case 246:r=";";break;case 247:r="<";break;case 248:r="=";break;case 249:r=">";break;case 250:r="?";break;case 251:r="_";break;case 252:r=" ";break;default:throw new Vr}return new Do(t+8,r)},t.prototype.isStillAlpha=function(t){if(t+5>this.information.getSize())return!1;var e=this.extractNumericValueFromBitArray(t,5);if(e>=5&&e<16)return!0;if(t+6>this.information.getSize())return!1;var r=this.extractNumericValueFromBitArray(t,6);return r>=16&&r<63},t.prototype.decodeAlphanumeric=function(t){var e=this.extractNumericValueFromBitArray(t,5);if(15===e)return new Do(t+5,Do.FNC1);if(e>=5&&e<15)return new Do(t+5,"0"+(e-5));var r,n=this.extractNumericValueFromBitArray(t,6);if(n>=32&&n<58)return new Do(t+6,""+(n+33));switch(n){case 58:r="*";break;case 59:r=",";break;case 60:r="-";break;case 61:r=".";break;case 62:r="/";break;default:throw new Sn("Decoding invalid alphanumeric value: "+n)}return new Do(t+6,r)},t.prototype.isAlphaTo646ToAlphaLatch=function(t){if(t+1>this.information.getSize())return!1;for(var e=0;e<5&&e+t<this.information.getSize();++e)if(2===e){if(!this.information.get(t+2))return!1}else if(this.information.get(t+e))return!1;return!0},t.prototype.isAlphaOr646ToNumericLatch=function(t){if(t+3>this.information.getSize())return!1;for(var e=t;e<t+3;++e)if(this.information.get(e))return!1;return!0},t.prototype.isNumericToAlphaNumericLatch=function(t){if(t+1>this.information.getSize())return!1;for(var e=0;e<4&&e+t<this.information.getSize();++e)if(this.information.get(t+e))return!1;return!0},t}(),Vo=function(){function t(t){this.information=t,this.generalDecoder=new Fo(t)}return t.prototype.getInformation=function(){return this.information},t.prototype.getGeneralDecoder=function(){return this.generalDecoder},t}(),Ho=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Uo=function(t){function e(e){return t.call(this,e)||this}return Ho(e,t),e.prototype.encodeCompressedGtin=function(t,e){t.append("(01)");var r=t.length();t.append("9"),this.encodeCompressedGtinWithoutAI(t,e,r)},e.prototype.encodeCompressedGtinWithoutAI=function(t,r,n){for(var o=0;o<4;++o){var i=this.getGeneralDecoder().extractNumericValueFromBitArray(r+10*o,10);i/100==0&&t.append("0"),i/10==0&&t.append("0"),t.append(i)}e.appendCheckDigit(t,n)},e.appendCheckDigit=function(t,e){for(var r=0,n=0;n<13;n++){var o=t.charAt(n+e).charCodeAt(0)-"0".charCodeAt(0);r+=1&n?o:3*o}10==(r=10-r%10)&&(r=0),t.append(r)},e.GTIN_SIZE=40,e}(Vo),Wo=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),zo=function(t){function e(e){return t.call(this,e)||this}return Wo(e,t),e.prototype.parseInformation=function(){var t=new $r;t.append("(01)");var r=t.length(),n=this.getGeneralDecoder().extractNumericValueFromBitArray(e.HEADER_SIZE,4);return t.append(n),this.encodeCompressedGtinWithoutAI(t,e.HEADER_SIZE+4,r),this.getGeneralDecoder().decodeAllCodes(t,e.HEADER_SIZE+44)},e.HEADER_SIZE=4,e}(Uo),Go=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Xo=function(t){function e(e){return t.call(this,e)||this}return Go(e,t),e.prototype.parseInformation=function(){var t=new $r;return this.getGeneralDecoder().decodeAllCodes(t,e.HEADER_SIZE)},e.HEADER_SIZE=5,e}(Vo),$o=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Yo=function(t){function e(e){return t.call(this,e)||this}return $o(e,t),e.prototype.encodeCompressedWeight=function(t,e,r){var n=this.getGeneralDecoder().extractNumericValueFromBitArray(e,r);this.addWeightCode(t,n);for(var o=this.checkWeight(n),i=1e5,a=0;a<5;++a)o/i==0&&t.append("0"),i/=10;t.append(o)},e}(Uo),qo=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Ko=function(t){function e(e){return t.call(this,e)||this}return qo(e,t),e.prototype.parseInformation=function(){if(this.getInformation().getSize()!=e.HEADER_SIZE+Yo.GTIN_SIZE+e.WEIGHT_SIZE)throw new Kr;var t=new $r;return this.encodeCompressedGtin(t,e.HEADER_SIZE),this.encodeCompressedWeight(t,e.HEADER_SIZE+Yo.GTIN_SIZE,e.WEIGHT_SIZE),t.toString()},e.HEADER_SIZE=5,e.WEIGHT_SIZE=15,e}(Yo),Zo=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Qo=function(t){function e(e){return t.call(this,e)||this}return Zo(e,t),e.prototype.addWeightCode=function(t,e){t.append("(3103)")},e.prototype.checkWeight=function(t){return t},e}(Ko),Jo=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),ti=function(t){function e(e){return t.call(this,e)||this}return Jo(e,t),e.prototype.addWeightCode=function(t,e){e<1e4?t.append("(3202)"):t.append("(3203)")},e.prototype.checkWeight=function(t){return t<1e4?t:t-1e4},e}(Ko),ei=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),ri=function(t){function e(e){return t.call(this,e)||this}return ei(e,t),e.prototype.parseInformation=function(){if(this.getInformation().getSize()<e.HEADER_SIZE+Uo.GTIN_SIZE)throw new Kr;var t=new $r;this.encodeCompressedGtin(t,e.HEADER_SIZE);var r=this.getGeneralDecoder().extractNumericValueFromBitArray(e.HEADER_SIZE+Uo.GTIN_SIZE,e.LAST_DIGIT_SIZE);t.append("(392"),t.append(r),t.append(")");var n=this.getGeneralDecoder().decodeGeneralPurposeField(e.HEADER_SIZE+Uo.GTIN_SIZE+e.LAST_DIGIT_SIZE,null);return t.append(n.getNewString()),t.toString()},e.HEADER_SIZE=8,e.LAST_DIGIT_SIZE=2,e}(Uo),ni=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),oi=function(t){function e(e){return t.call(this,e)||this}return ni(e,t),e.prototype.parseInformation=function(){if(this.getInformation().getSize()<e.HEADER_SIZE+Uo.GTIN_SIZE)throw new Kr;var t=new $r;this.encodeCompressedGtin(t,e.HEADER_SIZE);var r=this.getGeneralDecoder().extractNumericValueFromBitArray(e.HEADER_SIZE+Uo.GTIN_SIZE,e.LAST_DIGIT_SIZE);t.append("(393"),t.append(r),t.append(")");var n=this.getGeneralDecoder().extractNumericValueFromBitArray(e.HEADER_SIZE+Uo.GTIN_SIZE+e.LAST_DIGIT_SIZE,e.FIRST_THREE_DIGITS_SIZE);n/100==0&&t.append("0"),n/10==0&&t.append("0"),t.append(n);var o=this.getGeneralDecoder().decodeGeneralPurposeField(e.HEADER_SIZE+Uo.GTIN_SIZE+e.LAST_DIGIT_SIZE+e.FIRST_THREE_DIGITS_SIZE,null);return t.append(o.getNewString()),t.toString()},e.HEADER_SIZE=8,e.LAST_DIGIT_SIZE=2,e.FIRST_THREE_DIGITS_SIZE=10,e}(Uo),ii=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),ai=function(t){function e(e,r,n){var o=t.call(this,e)||this;return o.dateCode=n,o.firstAIdigits=r,o}return ii(e,t),e.prototype.parseInformation=function(){if(this.getInformation().getSize()!=e.HEADER_SIZE+e.GTIN_SIZE+e.WEIGHT_SIZE+e.DATE_SIZE)throw new Kr;var t=new $r;return this.encodeCompressedGtin(t,e.HEADER_SIZE),this.encodeCompressedWeight(t,e.HEADER_SIZE+e.GTIN_SIZE,e.WEIGHT_SIZE),this.encodeCompressedDate(t,e.HEADER_SIZE+e.GTIN_SIZE+e.WEIGHT_SIZE),t.toString()},e.prototype.encodeCompressedDate=function(t,r){var n=this.getGeneralDecoder().extractNumericValueFromBitArray(r,e.DATE_SIZE);if(38400!=n){t.append("("),t.append(this.dateCode),t.append(")");var o=n%32,i=(n/=32)%12+1,a=n/=12;a/10==0&&t.append("0"),t.append(a),i/10==0&&t.append("0"),t.append(i),o/10==0&&t.append("0"),t.append(o)}},e.prototype.addWeightCode=function(t,e){t.append("("),t.append(this.firstAIdigits),t.append(e/1e5),t.append(")")},e.prototype.checkWeight=function(t){return t%1e5},e.HEADER_SIZE=8,e.WEIGHT_SIZE=20,e.DATE_SIZE=16,e}(Yo),si=function(){function t(t,e,r,n){this.leftchar=t,this.rightchar=e,this.finderpattern=r,this.maybeLast=n}return t.prototype.mayBeLast=function(){return this.maybeLast},t.prototype.getLeftChar=function(){return this.leftchar},t.prototype.getRightChar=function(){return this.rightchar},t.prototype.getFinderPattern=function(){return this.finderpattern},t.prototype.mustBeLast=function(){return null==this.rightchar},t.prototype.toString=function(){return"[ "+this.leftchar+", "+this.rightchar+" : "+(null==this.finderpattern?"null":this.finderpattern.getValue())+" ]"},t.equals=function(e,r){return e instanceof t&&t.equalsOrNull(e.leftchar,r.leftchar)&&t.equalsOrNull(e.rightchar,r.rightchar)&&t.equalsOrNull(e.finderpattern,r.finderpattern)},t.equalsOrNull=function(e,r){return null===e?null===r:t.equals(e,r)},t.prototype.hashCode=function(){return this.leftchar.getValue()^this.rightchar.getValue()^this.finderpattern.getValue()},t}(),ci=function(){function t(t,e,r){this.pairs=t,this.rowNumber=e,this.wasReversed=r}return t.prototype.getPairs=function(){return this.pairs},t.prototype.getRowNumber=function(){return this.rowNumber},t.prototype.isReversed=function(){return this.wasReversed},t.prototype.isEquivalent=function(t){return this.checkEqualitity(this,t)},t.prototype.toString=function(){return"{ "+this.pairs+" }"},t.prototype.equals=function(e,r){return e instanceof t&&this.checkEqualitity(e,r)&&e.wasReversed===r.wasReversed},t.prototype.checkEqualitity=function(t,e){var r;if(t&&e)return t.forEach(function(t,n){e.forEach(function(e){t.getLeftChar().getValue()===e.getLeftChar().getValue()&&t.getRightChar().getValue()===e.getRightChar().getValue()&&t.getFinderPatter().getValue()===e.getFinderPatter().getValue()&&(r=!0)})}),r},t}(),ui=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),li=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},fi=function(t){function e(){var r=null!==t&&t.apply(this,arguments)||this;return r.pairs=new Array(e.MAX_PAIRS),r.rows=new Array,r.startEnd=[2],r}return ui(e,t),e.prototype.decodeRow=function(t,r,n){this.pairs.length=0,this.startFromEven=!1;try{return e.constructResult(this.decodeRow2pairs(t,r))}catch(o){}return this.pairs.length=0,this.startFromEven=!0,e.constructResult(this.decodeRow2pairs(t,r))},e.prototype.reset=function(){this.pairs.length=0,this.rows.length=0},e.prototype.decodeRow2pairs=function(t,e){for(var r,n=!1;!n;)try{this.pairs.push(this.retrieveNextPair(e,this.pairs,t))}catch(i){if(i instanceof Kr){if(!this.pairs.length)throw new Kr;n=!0}}if(this.checkChecksum())return this.pairs;if(r=!!this.rows.length,this.storeRow(t,!1),r){var o=this.checkRowsBoolean(!1);if(null!=o)return o;if(null!=(o=this.checkRowsBoolean(!0)))return o}throw new Kr},e.prototype.checkRowsBoolean=function(t){if(this.rows.length>25)return this.rows.length=0,null;this.pairs.length=0,t&&(this.rows=this.rows.reverse());var e=null;try{e=this.checkRows(new Array,0)}catch(r){console.log(r)}return t&&(this.rows=this.rows.reverse()),e},e.prototype.checkRows=function(t,r){for(var n,o,i=r;i<this.rows.length;i++){var a=this.rows[i];this.pairs.length=0;try{for(var s=(n=void 0,li(t)),c=s.next();!c.done;c=s.next()){var u=c.value;this.pairs.push(u.getPairs())}}catch(f){n={error:f}}finally{try{c&&!c.done&&(o=s.return)&&o.call(s)}finally{if(n)throw n.error}}if(this.pairs.push(a.getPairs()),e.isValidSequence(this.pairs)){if(this.checkChecksum())return this.pairs;var l=new Array(t);l.push(a);try{return this.checkRows(l,i+1)}catch(f){console.log(f)}}}throw new Kr},e.isValidSequence=function(t){var r,n;try{for(var o=li(e.FINDER_PATTERN_SEQUENCES),i=o.next();!i.done;i=o.next()){var a=i.value;if(!(t.length>a.length)){for(var s=!0,c=0;c<t.length;c++)if(t[c].getFinderPattern().getValue()!=a[c]){s=!1;break}if(s)return!0}}}catch(u){r={error:u}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}return!1},e.prototype.storeRow=function(t,r){for(var n=0,o=!1,i=!1;n<this.rows.length;){var a=this.rows[n];if(a.getRowNumber()>t){i=a.isEquivalent(this.pairs);break}o=a.isEquivalent(this.pairs),n++}i||o||e.isPartialRow(this.pairs,this.rows)||(this.rows.push(n,new ci(this.pairs,t,r)),this.removePartialRows(this.pairs,this.rows))},e.prototype.removePartialRows=function(t,e){var r,n,o,i,a,s;try{for(var c=li(e),u=c.next();!u.done;u=c.next()){var l=u.value;if(l.getPairs().length!==t.length)try{for(var f=(o=void 0,li(l.getPairs())),d=f.next();!d.done;d=f.next()){var h=d.value;try{for(var p=(a=void 0,li(t)),g=p.next();!g.done;g=p.next()){var m=g.value;if(si.equals(h,m)){0;break}}}catch(v){a={error:v}}finally{try{g&&!g.done&&(s=p.return)&&s.call(p)}finally{if(a)throw a.error}}}}catch(v){o={error:v}}finally{try{d&&!d.done&&(i=f.return)&&i.call(f)}finally{if(o)throw o.error}}}}catch(v){r={error:v}}finally{try{u&&!u.done&&(n=c.return)&&n.call(c)}finally{if(r)throw r.error}}},e.isPartialRow=function(t,e){var r,n,o,i,a,s;try{for(var c=li(e),u=c.next();!u.done;u=c.next()){var l=u.value,f=!0;try{for(var d=(o=void 0,li(t)),h=d.next();!h.done;h=d.next()){var p=h.value,g=!1;try{for(var m=(a=void 0,li(l.getPairs())),v=m.next();!v.done;v=m.next()){var y=v.value;if(p.equals(y)){g=!0;break}}}catch(_){a={error:_}}finally{try{v&&!v.done&&(s=m.return)&&s.call(m)}finally{if(a)throw a.error}}if(!g){f=!1;break}}}catch(_){o={error:_}}finally{try{h&&!h.done&&(i=d.return)&&i.call(d)}finally{if(o)throw o.error}}if(f)return!0}}catch(_){r={error:_}}finally{try{u&&!u.done&&(n=c.return)&&n.call(c)}finally{if(r)throw r.error}}return!1},e.prototype.getRows=function(){return this.rows},e.constructResult=function(t){var e=function(t){try{if(t.get(1))return new zo(t);if(!t.get(2))return new Xo(t);switch(Fo.extractNumericValueFromBitArray(t,1,4)){case 4:return new Qo(t);case 5:return new ti(t)}switch(Fo.extractNumericValueFromBitArray(t,1,5)){case 12:return new ri(t);case 13:return new oi(t)}switch(Fo.extractNumericValueFromBitArray(t,1,7)){case 56:return new ai(t,"310","11");case 57:return new ai(t,"320","11");case 58:return new ai(t,"310","13");case 59:return new ai(t,"320","13");case 60:return new ai(t,"310","15");case 61:return new ai(t,"320","15");case 62:return new ai(t,"310","17");case 63:return new ai(t,"320","17")}}catch(e){throw console.log(e),new Sn("unknown decoder: "+t)}}(To.buildBitArray(t)).parseInformation(),r=t[0].getFinderPattern().getResultPoints(),n=t[t.length-1].getFinderPattern().getResultPoints(),o=[r[0],r[1],n[0],n[1]];return new fn(e,null,null,o,hn.RSS_EXPANDED,null)},e.prototype.checkChecksum=function(){var t=this.pairs.get(0),e=t.getLeftChar(),r=t.getRightChar();if(null==r)return!1;for(var n=r.getChecksumPortion(),o=2,i=1;i<this.pairs.size();++i){var a=this.pairs.get(i);n+=a.getLeftChar().getChecksumPortion(),o++;var s=a.getRightChar();null!=s&&(n+=s.getChecksumPortion(),o++)}return 211*(o-4)+(n%=211)==e.getValue()},e.getNextSecondBar=function(t,e){var r;return t.get(e)?(r=t.getNextUnset(e),r=t.getNextSet(r)):(r=t.getNextSet(e),r=t.getNextUnset(r)),r},e.prototype.retrieveNextPair=function(t,r,n){var o,i=r.length%2==0;this.startFromEven&&(i=!i);var a=!0,s=-1;do{this.findNextPair(t,r,s),null==(o=this.parseFoundFinderPattern(t,n,i))?s=e.getNextSecondBar(t,this.startEnd[0]):a=!1}while(a);var c,u=this.decodeDataCharacter(t,o,i,!0);if(!this.isEmptyPair(r)&&r[r.length-1].mustBeLast())throw new Kr;try{c=this.decodeDataCharacter(t,o,i,!1)}catch(l){c=null,console.log(l)}return new si(u,c,o,!0)},e.prototype.isEmptyPair=function(t){return 0===t.length},e.prototype.findNextPair=function(t,r,n){var o=this.getDecodeFinderCounters();o[0]=0,o[1]=0,o[2]=0,o[3]=0;var i,a=t.getSize();i=n>=0?n:this.isEmptyPair(r)?0:r[r.length-1].getFinderPattern().getStartEnd()[1];var s=r.length%2!=0;this.startFromEven&&(s=!s);for(var c=!1;i<a&&(c=!t.get(i));)i++;for(var u=0,l=i,f=i;f<a;f++)if(t.get(f)!=c)o[u]++;else{if(3==u){if(s&&e.reverseCounters(o),e.isFinderPattern(o))return this.startEnd[0]=l,void(this.startEnd[1]=f);s&&e.reverseCounters(o),l+=o[0]+o[1],o[0]=o[2],o[1]=o[3],o[2]=0,o[3]=0,u--}else u++;o[u]=1,c=!c}throw new Kr},e.reverseCounters=function(t){for(var e=t.length,r=0;r<e/2;++r){var n=t[r];t[r]=t[e-r-1],t[e-r-1]=n}},e.prototype.parseFoundFinderPattern=function(t,r,n){var o,i,a;if(n){for(var s=this.startEnd[0]-1;s>=0&&!t.get(s);)s--;s++,o=this.startEnd[0]-s,i=s,a=this.startEnd[1]}else i=this.startEnd[0],o=(a=t.getNextUnset(this.startEnd[1]+1))-this.startEnd[1];var c,u=this.getDecodeFinderCounters();Nr.arraycopy(u,0,u,1,u.length-1),u[0]=o;try{c=this.parseFinderValue(u,e.FINDER_PATTERNS)}catch(l){return null}return new So(c,[i,a],i,a,r)},e.prototype.decodeDataCharacter=function(t,r,n,o){for(var i=this.getDataCharacterCounters(),a=0;a<i.length;a++)i[a]=0;if(o)e.recordPatternInReverse(t,r.getStartEnd()[0],i);else{e.recordPattern(t,r.getStartEnd()[1],i);for(var s=0,c=i.length-1;s<c;s++,c--){var u=i[s];i[s]=i[c],i[c]=u}}var l=Nn.sum(new Int32Array(i))/17,f=(r.getStartEnd()[1]-r.getStartEnd()[0])/15;if(Math.abs(l-f)/f>.3)throw new Kr;var d=this.getOddCounts(),h=this.getEvenCounts(),p=this.getOddRoundingErrors(),g=this.getEvenRoundingErrors();for(s=0;s<i.length;s++){var m=1*i[s]/l,v=m+.5;if(v<1){if(m<.3)throw new Kr;v=1}else if(v>8){if(m>8.7)throw new Kr;v=8}var y=s/2;1&s?(h[y]=v,g[y]=m-v):(d[y]=v,p[y]=m-v)}this.adjustOddEvenCounts(17);var _=4*r.getValue()+(n?0:2)+(o?0:1)-1,w=0,b=0;for(s=d.length-1;s>=0;s--){if(e.isNotA1left(r,n,o)){var C=e.WEIGHTS[_][2*s];b+=d[s]*C}w+=d[s]}var A=0;for(s=h.length-1;s>=0;s--)e.isNotA1left(r,n,o)&&(C=e.WEIGHTS[_][2*s+1],A+=h[s]*C);var E=b+A;if(1&w||w>13||w<4)throw new Kr;var I=(13-w)/2,S=e.SYMBOL_WIDEST[I],O=9-S,T=Oo.getRSSvalue(d,S,!0),N=Oo.getRSSvalue(h,O,!1),x=e.EVEN_TOTAL_SUBSET[I],R=e.GSUM[I];return new Io(T*x+N+R,E)},e.isNotA1left=function(t,e,r){return!(0==t.getValue()&&e&&r)},e.prototype.adjustOddEvenCounts=function(t){var r=Nn.sum(new Int32Array(this.getOddCounts())),n=Nn.sum(new Int32Array(this.getEvenCounts())),o=!1,i=!1;r>13?i=!0:r<4&&(o=!0);var a=!1,s=!1;n>13?s=!0:n<4&&(a=!0);var c=r+n-t,u=!(1&~r),l=!(1&n);if(1==c)if(u){if(l)throw new Kr;i=!0}else{if(!l)throw new Kr;s=!0}else if(-1==c)if(u){if(l)throw new Kr;o=!0}else{if(!l)throw new Kr;a=!0}else{if(0!=c)throw new Kr;if(u){if(!l)throw new Kr;r<n?(o=!0,s=!0):(i=!0,a=!0)}else if(l)throw new Kr}if(o){if(i)throw new Kr;e.increment(this.getOddCounts(),this.getOddRoundingErrors())}if(i&&e.decrement(this.getOddCounts(),this.getOddRoundingErrors()),a){if(s)throw new Kr;e.increment(this.getEvenCounts(),this.getOddRoundingErrors())}s&&e.decrement(this.getEvenCounts(),this.getEvenRoundingErrors())},e.SYMBOL_WIDEST=[7,5,4,3,1],e.EVEN_TOTAL_SUBSET=[4,20,52,104,204],e.GSUM=[0,348,1388,2948,3988],e.FINDER_PATTERNS=[Int32Array.from([1,8,4,1]),Int32Array.from([3,6,4,1]),Int32Array.from([3,4,6,1]),Int32Array.from([3,2,8,1]),Int32Array.from([2,6,5,1]),Int32Array.from([2,2,9,1])],e.WEIGHTS=[[1,3,9,27,81,32,96,77],[20,60,180,118,143,7,21,63],[189,145,13,39,117,140,209,205],[193,157,49,147,19,57,171,91],[62,186,136,197,169,85,44,132],[185,133,188,142,4,12,36,108],[113,128,173,97,80,29,87,50],[150,28,84,41,123,158,52,156],[46,138,203,187,139,206,196,166],[76,17,51,153,37,111,122,155],[43,129,176,106,107,110,119,146],[16,48,144,10,30,90,59,177],[109,116,137,200,178,112,125,164],[70,210,208,202,184,130,179,115],[134,191,151,31,93,68,204,190],[148,22,66,198,172,94,71,2],[6,18,54,162,64,192,154,40],[120,149,25,75,14,42,126,167],[79,26,78,23,69,207,199,175],[103,98,83,38,114,131,182,124],[161,61,183,127,170,88,53,159],[55,165,73,8,24,72,5,15],[45,135,194,160,58,174,100,89]],e.FINDER_PAT_A=0,e.FINDER_PAT_B=1,e.FINDER_PAT_C=2,e.FINDER_PAT_D=3,e.FINDER_PAT_E=4,e.FINDER_PAT_F=5,e.FINDER_PATTERN_SEQUENCES=[[e.FINDER_PAT_A,e.FINDER_PAT_A],[e.FINDER_PAT_A,e.FINDER_PAT_B,e.FINDER_PAT_B],[e.FINDER_PAT_A,e.FINDER_PAT_C,e.FINDER_PAT_B,e.FINDER_PAT_D],[e.FINDER_PAT_A,e.FINDER_PAT_E,e.FINDER_PAT_B,e.FINDER_PAT_D,e.FINDER_PAT_C],[e.FINDER_PAT_A,e.FINDER_PAT_E,e.FINDER_PAT_B,e.FINDER_PAT_D,e.FINDER_PAT_D,e.FINDER_PAT_F],[e.FINDER_PAT_A,e.FINDER_PAT_E,e.FINDER_PAT_B,e.FINDER_PAT_D,e.FINDER_PAT_E,e.FINDER_PAT_F,e.FINDER_PAT_F],[e.FINDER_PAT_A,e.FINDER_PAT_A,e.FINDER_PAT_B,e.FINDER_PAT_B,e.FINDER_PAT_C,e.FINDER_PAT_C,e.FINDER_PAT_D,e.FINDER_PAT_D],[e.FINDER_PAT_A,e.FINDER_PAT_A,e.FINDER_PAT_B,e.FINDER_PAT_B,e.FINDER_PAT_C,e.FINDER_PAT_C,e.FINDER_PAT_D,e.FINDER_PAT_E,e.FINDER_PAT_E],[e.FINDER_PAT_A,e.FINDER_PAT_A,e.FINDER_PAT_B,e.FINDER_PAT_B,e.FINDER_PAT_C,e.FINDER_PAT_C,e.FINDER_PAT_D,e.FINDER_PAT_E,e.FINDER_PAT_F,e.FINDER_PAT_F],[e.FINDER_PAT_A,e.FINDER_PAT_A,e.FINDER_PAT_B,e.FINDER_PAT_B,e.FINDER_PAT_C,e.FINDER_PAT_D,e.FINDER_PAT_D,e.FINDER_PAT_E,e.FINDER_PAT_E,e.FINDER_PAT_F,e.FINDER_PAT_F]],e.MAX_PAIRS=11,e}(Eo),di=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),hi=function(t){function e(e,r,n){var o=t.call(this,e,r)||this;return o.count=0,o.finderPattern=n,o}return di(e,t),e.prototype.getFinderPattern=function(){return this.finderPattern},e.prototype.getCount=function(){return this.count},e.prototype.incrementCount=function(){this.count++},e}(Io),pi=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),gi=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},mi=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.possibleLeftPairs=[],e.possibleRightPairs=[],e}return pi(e,t),e.prototype.decodeRow=function(t,r,n){var o,i,a,s,c=this.decodePair(r,!1,t,n);e.addOrTally(this.possibleLeftPairs,c),r.reverse();var u=this.decodePair(r,!0,t,n);e.addOrTally(this.possibleRightPairs,u),r.reverse();try{for(var l=gi(this.possibleLeftPairs),f=l.next();!f.done;f=l.next()){var d=f.value;if(d.getCount()>1)try{for(var h=(a=void 0,gi(this.possibleRightPairs)),p=h.next();!p.done;p=h.next()){var g=p.value;if(g.getCount()>1&&e.checkChecksum(d,g))return e.constructResult(d,g)}}catch(m){a={error:m}}finally{try{p&&!p.done&&(s=h.return)&&s.call(h)}finally{if(a)throw a.error}}}}catch(m){o={error:m}}finally{try{f&&!f.done&&(i=l.return)&&i.call(l)}finally{if(o)throw o.error}}throw new Kr},e.addOrTally=function(t,e){var r,n;if(null!=e){var o=!1;try{for(var i=gi(t),a=i.next();!a.done;a=i.next()){var s=a.value;if(s.getValue()===e.getValue()){s.incrementCount(),o=!0;break}}}catch(c){r={error:c}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}o||t.push(e)}},e.prototype.reset=function(){this.possibleLeftPairs.length=0,this.possibleRightPairs.length=0},e.constructResult=function(t,e){for(var r=4537077*t.getValue()+e.getValue(),n=new String(r).toString(),o=new $r,i=13-n.length;i>0;i--)o.append("0");o.append(n);var a=0;for(i=0;i<13;i++){var s=o.charAt(i).charCodeAt(0)-"0".charCodeAt(0);a+=1&i?s:3*s}10==(a=10-a%10)&&(a=0),o.append(a.toString());var c=t.getFinderPattern().getResultPoints(),u=e.getFinderPattern().getResultPoints();return new fn(o.toString(),null,0,[c[0],c[1],u[0],u[1]],hn.RSS_14,(new Date).getTime())},e.checkChecksum=function(t,e){var r=(t.getChecksumPortion()+16*e.getChecksumPortion())%79,n=9*t.getFinderPattern().getValue()+e.getFinderPattern().getValue();return n>72&&n--,n>8&&n--,r===n},e.prototype.decodePair=function(t,e,r,n){try{var o=this.findFinderPattern(t,e),i=this.parseFoundFinderPattern(t,r,e,o),a=null==n?null:n.get(Br.NEED_RESULT_POINT_CALLBACK);if(null!=a){var s=(o[0]+o[1])/2;e&&(s=t.getSize()-1-s),a.foundPossibleResultPoint(new Rn(s,r))}var c=this.decodeDataCharacter(t,i,!0),u=this.decodeDataCharacter(t,i,!1);return new hi(1597*c.getValue()+u.getValue(),c.getChecksumPortion()+4*u.getChecksumPortion(),i)}catch(l){return null}},e.prototype.decodeDataCharacter=function(t,r,n){for(var o=this.getDataCharacterCounters(),i=0;i<o.length;i++)o[i]=0;if(n)Gn.recordPatternInReverse(t,r.getStartEnd()[0],o);else{Gn.recordPattern(t,r.getStartEnd()[1]+1,o);for(var a=0,s=o.length-1;a<s;a++,s--){var c=o[a];o[a]=o[s],o[s]=c}}var u=n?16:15,l=Nn.sum(new Int32Array(o))/u,f=this.getOddCounts(),d=this.getEvenCounts(),h=this.getOddRoundingErrors(),p=this.getEvenRoundingErrors();for(a=0;a<o.length;a++){var g=o[a]/l,m=Math.floor(g+.5);m<1?m=1:m>8&&(m=8);var v=Math.floor(a/2);1&a?(d[v]=m,p[v]=g-m):(f[v]=m,h[v]=g-m)}this.adjustOddEvenCounts(n,u);var y=0,_=0;for(a=f.length-1;a>=0;a--)_*=9,_+=f[a],y+=f[a];var w=0,b=0;for(a=d.length-1;a>=0;a--)w*=9,w+=d[a],b+=d[a];var C=_+3*w;if(n){if(1&y||y>12||y<4)throw new Kr;var A=(12-y)/2,E=9-(N=e.OUTSIDE_ODD_WIDEST[A]),I=Oo.getRSSvalue(f,N,!1),S=Oo.getRSSvalue(d,E,!0),O=e.OUTSIDE_EVEN_TOTAL_SUBSET[A],T=e.OUTSIDE_GSUM[A];return new Io(I*O+S+T,C)}if(1&b||b>10||b<4)throw new Kr;A=(10-b)/2,E=9-(N=e.INSIDE_ODD_WIDEST[A]),I=Oo.getRSSvalue(f,N,!0),S=Oo.getRSSvalue(d,E,!1);var N,x=e.INSIDE_ODD_TOTAL_SUBSET[A];return T=e.INSIDE_GSUM[A],new Io(S*x+I+T,C)},e.prototype.findFinderPattern=function(t,e){var r=this.getDecodeFinderCounters();r[0]=0,r[1]=0,r[2]=0,r[3]=0;for(var n=t.getSize(),o=!1,i=0;i<n&&e!==(o=!t.get(i));)i++;for(var a=0,s=i,c=i;c<n;c++)if(t.get(c)!==o)r[a]++;else{if(3===a){if(Eo.isFinderPattern(r))return[s,c];s+=r[0]+r[1],r[0]=r[2],r[1]=r[3],r[2]=0,r[3]=0,a--}else a++;r[a]=1,o=!o}throw new Kr},e.prototype.parseFoundFinderPattern=function(t,r,n,o){for(var i=t.get(o[0]),a=o[0]-1;a>=0&&i!==t.get(a);)a--;a++;var s=o[0]-a,c=this.getDecodeFinderCounters(),u=new Int32Array(c.length);Nr.arraycopy(c,0,u,1,c.length-1),u[0]=s;var l=this.parseFinderValue(u,e.FINDER_PATTERNS),f=a,d=o[1];return n&&(f=t.getSize()-1-f,d=t.getSize()-1-d),new So(l,[a,o[1]],f,d,r)},e.prototype.adjustOddEvenCounts=function(t,e){var r=Nn.sum(new Int32Array(this.getOddCounts())),n=Nn.sum(new Int32Array(this.getEvenCounts())),o=!1,i=!1,a=!1,s=!1;t?(r>12?i=!0:r<4&&(o=!0),n>12?s=!0:n<4&&(a=!0)):(r>11?i=!0:r<5&&(o=!0),n>10?s=!0:n<4&&(a=!0));var c=r+n-e,u=(1&r)==(t?1:0),l=!(1&~n);if(1===c)if(u){if(l)throw new Kr;i=!0}else{if(!l)throw new Kr;s=!0}else if(-1===c)if(u){if(l)throw new Kr;o=!0}else{if(!l)throw new Kr;a=!0}else{if(0!==c)throw new Kr;if(u){if(!l)throw new Kr;r<n?(o=!0,s=!0):(i=!0,a=!0)}else if(l)throw new Kr}if(o){if(i)throw new Kr;Eo.increment(this.getOddCounts(),this.getOddRoundingErrors())}if(i&&Eo.decrement(this.getOddCounts(),this.getOddRoundingErrors()),a){if(s)throw new Kr;Eo.increment(this.getEvenCounts(),this.getOddRoundingErrors())}s&&Eo.decrement(this.getEvenCounts(),this.getEvenRoundingErrors())},e.OUTSIDE_EVEN_TOTAL_SUBSET=[1,10,34,70,126],e.INSIDE_ODD_TOTAL_SUBSET=[4,20,48,81],e.OUTSIDE_GSUM=[0,161,961,2015,2715],e.INSIDE_GSUM=[0,336,1036,1516],e.OUTSIDE_ODD_WIDEST=[8,6,4,3,1],e.INSIDE_ODD_WIDEST=[2,4,6,8],e.FINDER_PATTERNS=[Int32Array.from([3,8,2,1]),Int32Array.from([3,5,5,1]),Int32Array.from([3,3,7,1]),Int32Array.from([3,1,9,1]),Int32Array.from([2,7,4,1]),Int32Array.from([2,5,6,1]),Int32Array.from([2,3,8,1]),Int32Array.from([1,5,7,1]),Int32Array.from([1,3,9,1])],e}(Eo),vi=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),yi=function(t){function e(e){var r=t.call(this)||this;r.readers=[];var n=e?e.get(Br.POSSIBLE_FORMATS):null,o=e&&void 0!==e.get(Br.ASSUME_CODE_39_CHECK_DIGIT);return n&&((n.includes(hn.EAN_13)||n.includes(hn.UPC_A)||n.includes(hn.EAN_8)||n.includes(hn.UPC_E))&&r.readers.push(new Co(e)),n.includes(hn.CODE_39)&&r.readers.push(new Kn(o)),n.includes(hn.CODE_128)&&r.readers.push(new $n),n.includes(hn.ITF)&&r.readers.push(new Qn),n.includes(hn.RSS_14)&&r.readers.push(new mi),n.includes(hn.RSS_EXPANDED)&&(console.warn("RSS Expanded reader IS NOT ready for production yet! use at your own risk."),r.readers.push(new fi))),0===r.readers.length&&(r.readers.push(new Co(e)),r.readers.push(new Kn),r.readers.push(new Co(e)),r.readers.push(new $n),r.readers.push(new Qn),r.readers.push(new mi)),r}return vi(e,t),e.prototype.decodeRow=function(t,e,r){for(var n=0;n<this.readers.length;n++)try{return this.readers[n].decodeRow(t,e,r)}catch(o){}throw new Kr},e.prototype.reset=function(){this.readers.forEach(function(t){return t.reset()})},e}(Gn),_i=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();!function(t){_i(function(e,r){return void 0===e&&(e=500),t.call(this,new yi(r),e,r)||this},t)}(ln);var wi,bi=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Ci=function(){function t(t,e,r){this.ecCodewords=t,this.ecBlocks=[e],r&&this.ecBlocks.push(r)}return t.prototype.getECCodewords=function(){return this.ecCodewords},t.prototype.getECBlocks=function(){return this.ecBlocks},t}(),Ai=function(){function t(t,e){this.count=t,this.dataCodewords=e}return t.prototype.getCount=function(){return this.count},t.prototype.getDataCodewords=function(){return this.dataCodewords},t}(),Ei=function(){function t(t,e,r,n,o,i){var a,s;this.versionNumber=t,this.symbolSizeRows=e,this.symbolSizeColumns=r,this.dataRegionSizeRows=n,this.dataRegionSizeColumns=o,this.ecBlocks=i;var c=0,u=i.getECCodewords(),l=i.getECBlocks();try{for(var f=bi(l),d=f.next();!d.done;d=f.next()){var h=d.value;c+=h.getCount()*(h.getDataCodewords()+u)}}catch(p){a={error:p}}finally{try{d&&!d.done&&(s=f.return)&&s.call(f)}finally{if(a)throw a.error}}this.totalCodewords=c}return t.prototype.getVersionNumber=function(){return this.versionNumber},t.prototype.getSymbolSizeRows=function(){return this.symbolSizeRows},t.prototype.getSymbolSizeColumns=function(){return this.symbolSizeColumns},t.prototype.getDataRegionSizeRows=function(){return this.dataRegionSizeRows},t.prototype.getDataRegionSizeColumns=function(){return this.dataRegionSizeColumns},t.prototype.getTotalCodewords=function(){return this.totalCodewords},t.prototype.getECBlocks=function(){return this.ecBlocks},t.getVersionForDimensions=function(e,r){var n,o;if(1&e||1&r)throw new Vr;try{for(var i=bi(t.VERSIONS),a=i.next();!a.done;a=i.next()){var s=a.value;if(s.symbolSizeRows===e&&s.symbolSizeColumns===r)return s}}catch(c){n={error:c}}finally{try{a&&!a.done&&(o=i.return)&&o.call(i)}finally{if(n)throw n.error}}throw new Vr},t.prototype.toString=function(){return""+this.versionNumber},t.buildVersions=function(){return[new t(1,10,10,8,8,new Ci(5,new Ai(1,3))),new t(2,12,12,10,10,new Ci(7,new Ai(1,5))),new t(3,14,14,12,12,new Ci(10,new Ai(1,8))),new t(4,16,16,14,14,new Ci(12,new Ai(1,12))),new t(5,18,18,16,16,new Ci(14,new Ai(1,18))),new t(6,20,20,18,18,new Ci(18,new Ai(1,22))),new t(7,22,22,20,20,new Ci(20,new Ai(1,30))),new t(8,24,24,22,22,new Ci(24,new Ai(1,36))),new t(9,26,26,24,24,new Ci(28,new Ai(1,44))),new t(10,32,32,14,14,new Ci(36,new Ai(1,62))),new t(11,36,36,16,16,new Ci(42,new Ai(1,86))),new t(12,40,40,18,18,new Ci(48,new Ai(1,114))),new t(13,44,44,20,20,new Ci(56,new Ai(1,144))),new t(14,48,48,22,22,new Ci(68,new Ai(1,174))),new t(15,52,52,24,24,new Ci(42,new Ai(2,102))),new t(16,64,64,14,14,new Ci(56,new Ai(2,140))),new t(17,72,72,16,16,new Ci(36,new Ai(4,92))),new t(18,80,80,18,18,new Ci(48,new Ai(4,114))),new t(19,88,88,20,20,new Ci(56,new Ai(4,144))),new t(20,96,96,22,22,new Ci(68,new Ai(4,174))),new t(21,104,104,24,24,new Ci(56,new Ai(6,136))),new t(22,120,120,18,18,new Ci(68,new Ai(6,175))),new t(23,132,132,20,20,new Ci(62,new Ai(8,163))),new t(24,144,144,22,22,new Ci(62,new Ai(8,156),new Ai(2,155))),new t(25,8,18,6,16,new Ci(7,new Ai(1,5))),new t(26,8,32,6,14,new Ci(11,new Ai(1,10))),new t(27,12,26,10,24,new Ci(14,new Ai(1,16))),new t(28,12,36,10,16,new Ci(18,new Ai(1,22))),new t(29,16,36,14,16,new Ci(24,new Ai(1,32))),new t(30,16,48,14,22,new Ci(28,new Ai(1,49)))]},t.VERSIONS=t.buildVersions(),t}(),Ii=function(){function t(e){var r=e.getHeight();if(r<8||r>144||1&r)throw new Vr;this.version=t.readVersion(e),this.mappingBitMatrix=this.extractDataRegion(e),this.readMappingMatrix=new Yr(this.mappingBitMatrix.getWidth(),this.mappingBitMatrix.getHeight())}return t.prototype.getVersion=function(){return this.version},t.readVersion=function(t){var e=t.getHeight(),r=t.getWidth();return Ei.getVersionForDimensions(e,r)},t.prototype.readCodewords=function(){var t=new Int8Array(this.version.getTotalCodewords()),e=0,r=4,n=0,o=this.mappingBitMatrix.getHeight(),i=this.mappingBitMatrix.getWidth(),a=!1,s=!1,c=!1,u=!1;do{if(r!==o||0!==n||a)if(r===o-2&&0===n&&3&i&&!s)t[e++]=255&this.readCorner2(o,i),r-=2,n+=2,s=!0;else if(r!==o+4||2!==n||7&i||c)if(r!==o-2||0!==n||4!=(7&i)||u){do{r<o&&n>=0&&!this.readMappingMatrix.get(n,r)&&(t[e++]=255&this.readUtah(r,n,o,i)),r-=2,n+=2}while(r>=0&&n<i);r+=1,n+=3;do{r>=0&&n<i&&!this.readMappingMatrix.get(n,r)&&(t[e++]=255&this.readUtah(r,n,o,i)),r+=2,n-=2}while(r<o&&n>=0);r+=3,n+=1}else t[e++]=255&this.readCorner4(o,i),r-=2,n+=2,u=!0;else t[e++]=255&this.readCorner3(o,i),r-=2,n+=2,c=!0;else t[e++]=255&this.readCorner1(o,i),r-=2,n+=2,a=!0}while(r<o||n<i);if(e!==this.version.getTotalCodewords())throw new Vr;return t},t.prototype.readModule=function(t,e,r,n){return t<0&&(t+=r,e+=4-(r+4&7)),e<0&&(e+=n,t+=4-(n+4&7)),this.readMappingMatrix.set(e,t),this.mappingBitMatrix.get(e,t)},t.prototype.readUtah=function(t,e,r,n){var o=0;return this.readModule(t-2,e-2,r,n)&&(o|=1),o<<=1,this.readModule(t-2,e-1,r,n)&&(o|=1),o<<=1,this.readModule(t-1,e-2,r,n)&&(o|=1),o<<=1,this.readModule(t-1,e-1,r,n)&&(o|=1),o<<=1,this.readModule(t-1,e,r,n)&&(o|=1),o<<=1,this.readModule(t,e-2,r,n)&&(o|=1),o<<=1,this.readModule(t,e-1,r,n)&&(o|=1),o<<=1,this.readModule(t,e,r,n)&&(o|=1),o},t.prototype.readCorner1=function(t,e){var r=0;return this.readModule(t-1,0,t,e)&&(r|=1),r<<=1,this.readModule(t-1,1,t,e)&&(r|=1),r<<=1,this.readModule(t-1,2,t,e)&&(r|=1),r<<=1,this.readModule(0,e-2,t,e)&&(r|=1),r<<=1,this.readModule(0,e-1,t,e)&&(r|=1),r<<=1,this.readModule(1,e-1,t,e)&&(r|=1),r<<=1,this.readModule(2,e-1,t,e)&&(r|=1),r<<=1,this.readModule(3,e-1,t,e)&&(r|=1),r},t.prototype.readCorner2=function(t,e){var r=0;return this.readModule(t-3,0,t,e)&&(r|=1),r<<=1,this.readModule(t-2,0,t,e)&&(r|=1),r<<=1,this.readModule(t-1,0,t,e)&&(r|=1),r<<=1,this.readModule(0,e-4,t,e)&&(r|=1),r<<=1,this.readModule(0,e-3,t,e)&&(r|=1),r<<=1,this.readModule(0,e-2,t,e)&&(r|=1),r<<=1,this.readModule(0,e-1,t,e)&&(r|=1),r<<=1,this.readModule(1,e-1,t,e)&&(r|=1),r},t.prototype.readCorner3=function(t,e){var r=0;return this.readModule(t-1,0,t,e)&&(r|=1),r<<=1,this.readModule(t-1,e-1,t,e)&&(r|=1),r<<=1,this.readModule(0,e-3,t,e)&&(r|=1),r<<=1,this.readModule(0,e-2,t,e)&&(r|=1),r<<=1,this.readModule(0,e-1,t,e)&&(r|=1),r<<=1,this.readModule(1,e-3,t,e)&&(r|=1),r<<=1,this.readModule(1,e-2,t,e)&&(r|=1),r<<=1,this.readModule(1,e-1,t,e)&&(r|=1),r},t.prototype.readCorner4=function(t,e){var r=0;return this.readModule(t-3,0,t,e)&&(r|=1),r<<=1,this.readModule(t-2,0,t,e)&&(r|=1),r<<=1,this.readModule(t-1,0,t,e)&&(r|=1),r<<=1,this.readModule(0,e-2,t,e)&&(r|=1),r<<=1,this.readModule(0,e-1,t,e)&&(r|=1),r<<=1,this.readModule(1,e-1,t,e)&&(r|=1),r<<=1,this.readModule(2,e-1,t,e)&&(r|=1),r<<=1,this.readModule(3,e-1,t,e)&&(r|=1),r},t.prototype.extractDataRegion=function(t){var e=this.version.getSymbolSizeRows(),r=this.version.getSymbolSizeColumns();if(t.getHeight()!==e)throw new Er("Dimension of bitMatrix must match the version size");for(var n=this.version.getDataRegionSizeRows(),o=this.version.getDataRegionSizeColumns(),i=e/n|0,a=r/o|0,s=new Yr(a*o,i*n),c=0;c<i;++c)for(var u=c*n,l=0;l<a;++l)for(var f=l*o,d=0;d<n;++d)for(var h=c*(n+2)+1+d,p=u+d,g=0;g<o;++g){var m=l*(o+2)+1+g;if(t.get(m,h)){var v=f+g;s.set(v,p)}}return s},t}(),Si=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Oi=function(){function t(t,e){this.numDataCodewords=t,this.codewords=e}return t.getDataBlocks=function(e,r){var n,o,i,a,s=r.getECBlocks(),c=0,u=s.getECBlocks();try{for(var l=Si(u),f=l.next();!f.done;f=l.next())c+=(m=f.value).getCount()}catch(N){n={error:N}}finally{try{f&&!f.done&&(o=l.return)&&o.call(l)}finally{if(n)throw n.error}}var d=new Array(c),h=0;try{for(var p=Si(u),g=p.next();!g.done;g=p.next())for(var m=g.value,v=0;v<m.getCount();v++){var y=m.getDataCodewords(),_=s.getECCodewords()+y;d[h++]=new t(y,new Uint8Array(_))}}catch(N){i={error:N}}finally{try{g&&!g.done&&(a=p.return)&&a.call(p)}finally{if(i)throw i.error}}var w=d[0].codewords.length-s.getECCodewords(),b=w-1,C=0;for(v=0;v<b;v++)for(var A=0;A<h;A++)d[A].codewords[v]=e[C++];var E=24===r.getVersionNumber(),I=E?8:h;for(A=0;A<I;A++)d[A].codewords[w-1]=e[C++];var S=d[0].codewords.length;for(v=w;v<S;v++)for(A=0;A<h;A++){var O=E?(A+8)%h:A,T=E&&O>7?v-1:v;d[O].codewords[T]=e[C++]}if(C!==e.length)throw new Er;return d},t.prototype.getNumDataCodewords=function(){return this.numDataCodewords},t.prototype.getCodewords=function(){return this.codewords},t}(),Ti=function(){function t(t){this.bytes=t,this.byteOffset=0,this.bitOffset=0}return t.prototype.getBitOffset=function(){return this.bitOffset},t.prototype.getByteOffset=function(){return this.byteOffset},t.prototype.readBits=function(t){if(t<1||t>32||t>this.available())throw new Er(""+t);var e=0,r=this.bitOffset,n=this.byteOffset,o=this.bytes;if(r>0){var i=8-r,a=t<i?t:i,s=255>>8-a<<(c=i-a);e=(o[n]&s)>>c,t-=a,8===(r+=a)&&(r=0,n++)}if(t>0){for(;t>=8;)e=e<<8|255&o[n],n++,t-=8;var c;if(t>0)s=255>>(c=8-t)<<c,e=e<<t|(o[n]&s)>>c,r+=t}return this.bitOffset=r,this.byteOffset=n,e},t.prototype.available=function(){return 8*(this.bytes.length-this.byteOffset)-this.bitOffset},t}();!function(t){t[t.PAD_ENCODE=0]="PAD_ENCODE",t[t.ASCII_ENCODE=1]="ASCII_ENCODE",t[t.C40_ENCODE=2]="C40_ENCODE",t[t.TEXT_ENCODE=3]="TEXT_ENCODE",t[t.ANSIX12_ENCODE=4]="ANSIX12_ENCODE",t[t.EDIFACT_ENCODE=5]="EDIFACT_ENCODE",t[t.BASE256_ENCODE=6]="BASE256_ENCODE"}(wi||(wi={}));var Ni,xi=function(){function t(){}return t.decode=function(t){var e=new Ti(t),r=new $r,n=new $r,o=new Array,i=wi.ASCII_ENCODE;do{if(i===wi.ASCII_ENCODE)i=this.decodeAsciiSegment(e,r,n);else{switch(i){case wi.C40_ENCODE:this.decodeC40Segment(e,r);break;case wi.TEXT_ENCODE:this.decodeTextSegment(e,r);break;case wi.ANSIX12_ENCODE:this.decodeAnsiX12Segment(e,r);break;case wi.EDIFACT_ENCODE:this.decodeEdifactSegment(e,r);break;case wi.BASE256_ENCODE:this.decodeBase256Segment(e,r,o);break;default:throw new Vr}i=wi.ASCII_ENCODE}}while(i!==wi.PAD_ENCODE&&e.available()>0);return n.length()>0&&r.append(n.toString()),new mn(t,r.toString(),0===o.length?null:o,null)},t.decodeAsciiSegment=function(t,e,r){var n=!1;do{var o=t.readBits(8);if(0===o)throw new Vr;if(o<=128)return n&&(o+=128),e.append(String.fromCharCode(o-1)),wi.ASCII_ENCODE;if(129===o)return wi.PAD_ENCODE;if(o<=229){var i=o-130;i<10&&e.append("0"),e.append(""+i)}else switch(o){case 230:return wi.C40_ENCODE;case 231:return wi.BASE256_ENCODE;case 232:e.append(String.fromCharCode(29));break;case 233:case 234:case 241:break;case 235:n=!0;break;case 236:e.append("[)>05"),r.insert(0,"");break;case 237:e.append("[)>06"),r.insert(0,"");break;case 238:return wi.ANSIX12_ENCODE;case 239:return wi.TEXT_ENCODE;case 240:return wi.EDIFACT_ENCODE;default:if(254!==o||0!==t.available())throw new Vr}}while(t.available()>0);return wi.ASCII_ENCODE},t.decodeC40Segment=function(t,e){var r=!1,n=[],o=0;do{if(8===t.available())return;var i=t.readBits(8);if(254===i)return;this.parseTwoBytes(i,t.readBits(8),n);for(var a=0;a<3;a++){var s=n[a];switch(o){case 0:if(s<3)o=s+1;else{if(!(s<this.C40_BASIC_SET_CHARS.length))throw new Vr;var c=this.C40_BASIC_SET_CHARS[s];r?(e.append(String.fromCharCode(c.charCodeAt(0)+128)),r=!1):e.append(c)}break;case 1:r?(e.append(String.fromCharCode(s+128)),r=!1):e.append(String.fromCharCode(s)),o=0;break;case 2:if(s<this.C40_SHIFT2_SET_CHARS.length)c=this.C40_SHIFT2_SET_CHARS[s],r?(e.append(String.fromCharCode(c.charCodeAt(0)+128)),r=!1):e.append(c);else switch(s){case 27:e.append(String.fromCharCode(29));break;case 30:r=!0;break;default:throw new Vr}o=0;break;case 3:r?(e.append(String.fromCharCode(s+224)),r=!1):e.append(String.fromCharCode(s+96)),o=0;break;default:throw new Vr}}}while(t.available()>0)},t.decodeTextSegment=function(t,e){var r=!1,n=[],o=0;do{if(8===t.available())return;var i=t.readBits(8);if(254===i)return;this.parseTwoBytes(i,t.readBits(8),n);for(var a=0;a<3;a++){var s=n[a];switch(o){case 0:if(s<3)o=s+1;else{if(!(s<this.TEXT_BASIC_SET_CHARS.length))throw new Vr;var c=this.TEXT_BASIC_SET_CHARS[s];r?(e.append(String.fromCharCode(c.charCodeAt(0)+128)),r=!1):e.append(c)}break;case 1:r?(e.append(String.fromCharCode(s+128)),r=!1):e.append(String.fromCharCode(s)),o=0;break;case 2:if(s<this.TEXT_SHIFT2_SET_CHARS.length)c=this.TEXT_SHIFT2_SET_CHARS[s],r?(e.append(String.fromCharCode(c.charCodeAt(0)+128)),r=!1):e.append(c);else switch(s){case 27:e.append(String.fromCharCode(29));break;case 30:r=!0;break;default:throw new Vr}o=0;break;case 3:if(!(s<this.TEXT_SHIFT3_SET_CHARS.length))throw new Vr;c=this.TEXT_SHIFT3_SET_CHARS[s],r?(e.append(String.fromCharCode(c.charCodeAt(0)+128)),r=!1):e.append(c),o=0;break;default:throw new Vr}}}while(t.available()>0)},t.decodeAnsiX12Segment=function(t,e){var r=[];do{if(8===t.available())return;var n=t.readBits(8);if(254===n)return;this.parseTwoBytes(n,t.readBits(8),r);for(var o=0;o<3;o++){var i=r[o];switch(i){case 0:e.append("\r");break;case 1:e.append("*");break;case 2:e.append(">");break;case 3:e.append(" ");break;default:if(i<14)e.append(String.fromCharCode(i+44));else{if(!(i<40))throw new Vr;e.append(String.fromCharCode(i+51))}}}}while(t.available()>0)},t.parseTwoBytes=function(t,e,r){var n=(t<<8)+e-1,o=Math.floor(n/1600);r[0]=o,n-=1600*o,o=Math.floor(n/40),r[1]=o,r[2]=n-40*o},t.decodeEdifactSegment=function(t,e){do{if(t.available()<=16)return;for(var r=0;r<4;r++){var n=t.readBits(6);if(31===n){var o=8-t.getBitOffset();return void(8!==o&&t.readBits(o))}!(32&n)&&(n|=64),e.append(String.fromCharCode(n))}}while(t.available()>0)},t.decodeBase256Segment=function(t,e,r){var n,o=1+t.getByteOffset(),i=this.unrandomize255State(t.readBits(8),o++);if((n=0===i?t.available()/8|0:i<250?i:250*(i-249)+this.unrandomize255State(t.readBits(8),o++))<0)throw new Vr;for(var a=new Uint8Array(n),s=0;s<n;s++){if(t.available()<8)throw new Vr;a[s]=this.unrandomize255State(t.readBits(8),o++)}r.push(a);try{e.append(Gr.decode(a,Xr.ISO88591))}catch(c){throw new Sn("Platform does not support required encoding: "+c.message)}},t.unrandomize255State=function(t,e){var r=t-(149*e%255+1);return r>=0?r:r+256},t.C40_BASIC_SET_CHARS=["*","*","*"," ","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"],t.C40_SHIFT2_SET_CHARS=["!",'"',"#","$","%","&","'","(",")","*","+",",","-",".","/",":",";","<","=",">","?","@","[","\\","]","^","_"],t.TEXT_BASIC_SET_CHARS=["*","*","*"," ","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"],t.TEXT_SHIFT2_SET_CHARS=t.C40_SHIFT2_SET_CHARS,t.TEXT_SHIFT3_SET_CHARS=["`","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","{","|","}","~",String.fromCharCode(127)],t}(),Ri=function(){function t(){this.rsDecoder=new On(Cn.DATA_MATRIX_FIELD_256)}return t.prototype.decode=function(t){var e,r,n=new Ii(t),o=n.getVersion(),i=n.readCodewords(),a=Oi.getDataBlocks(i,o),s=0;try{for(var c=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}(a),u=c.next();!u.done;u=c.next())s+=u.value.getNumDataCodewords()}catch(v){e={error:v}}finally{try{u&&!u.done&&(r=c.return)&&r.call(c)}finally{if(e)throw e.error}}for(var l=new Uint8Array(s),f=a.length,d=0;d<f;d++){var h=a[d],p=h.getCodewords(),g=h.getNumDataCodewords();this.correctErrors(p,g);for(var m=0;m<g;m++)l[m*f+d]=p[m]}return xi.decode(l)},t.prototype.correctErrors=function(t,e){var r=new Int32Array(t);try{this.rsDecoder.decode(r,t.length-e)}catch(o){throw new Or}for(var n=0;n<e;n++)t[n]=r[n]},t}(),Di=function(){function t(t){this.image=t,this.rectangleDetector=new kn(this.image)}return t.prototype.detect=function(){var e=this.rectangleDetector.detect(),r=this.detectSolid1(e);if((r=this.detectSolid2(r))[3]=this.correctTopRight(r),!r[3])throw new Kr;var n=(r=this.shiftToModuleCenter(r))[0],o=r[1],i=r[2],a=r[3],s=this.transitionsBetween(n,a)+1,c=this.transitionsBetween(i,a)+1;!(1&~s)&&(s+=1),!(1&~c)&&(c+=1),4*s<7*c&&4*c<7*s&&(s=c=Math.max(s,c));var u=t.sampleGrid(this.image,n,o,i,a,s,c);return new Dn(u,[n,o,i,a])},t.shiftPoint=function(t,e,r){var n=(e.getX()-t.getX())/(r+1),o=(e.getY()-t.getY())/(r+1);return new Rn(t.getX()+n,t.getY()+o)},t.moveAway=function(t,e,r){var n=t.getX(),o=t.getY();return n<e?n-=1:n+=1,o<r?o-=1:o+=1,new Rn(n,o)},t.prototype.detectSolid1=function(t){var e=t[0],r=t[1],n=t[3],o=t[2],i=this.transitionsBetween(e,r),a=this.transitionsBetween(r,n),s=this.transitionsBetween(n,o),c=this.transitionsBetween(o,e),u=i,l=[o,e,r,n];return u>a&&(u=a,l[0]=e,l[1]=r,l[2]=n,l[3]=o),u>s&&(u=s,l[0]=r,l[1]=n,l[2]=o,l[3]=e),u>c&&(l[0]=n,l[1]=o,l[2]=e,l[3]=r),l},t.prototype.detectSolid2=function(e){var r=e[0],n=e[1],o=e[2],i=e[3],a=this.transitionsBetween(r,i),s=t.shiftPoint(n,o,4*(a+1)),c=t.shiftPoint(o,n,4*(a+1));return this.transitionsBetween(s,r)<this.transitionsBetween(c,i)?(e[0]=r,e[1]=n,e[2]=o,e[3]=i):(e[0]=n,e[1]=o,e[2]=i,e[3]=r),e},t.prototype.correctTopRight=function(e){var r=e[0],n=e[1],o=e[2],i=e[3],a=this.transitionsBetween(r,i),s=this.transitionsBetween(n,i),c=t.shiftPoint(r,n,4*(s+1)),u=t.shiftPoint(o,n,4*(a+1));a=this.transitionsBetween(c,i),s=this.transitionsBetween(u,i);var l=new Rn(i.getX()+(o.getX()-n.getX())/(a+1),i.getY()+(o.getY()-n.getY())/(a+1)),f=new Rn(i.getX()+(r.getX()-n.getX())/(s+1),i.getY()+(r.getY()-n.getY())/(s+1));return this.isValid(l)?this.isValid(f)?this.transitionsBetween(c,l)+this.transitionsBetween(u,l)>this.transitionsBetween(c,f)+this.transitionsBetween(u,f)?l:f:l:this.isValid(f)?f:null},t.prototype.shiftToModuleCenter=function(e){var r=e[0],n=e[1],o=e[2],i=e[3],a=this.transitionsBetween(r,i)+1,s=this.transitionsBetween(o,i)+1,c=t.shiftPoint(r,n,4*s),u=t.shiftPoint(o,n,4*a);!(1&~(a=this.transitionsBetween(c,i)+1))&&(a+=1),!(1&~(s=this.transitionsBetween(u,i)+1))&&(s+=1);var l,f,d=(r.getX()+n.getX()+o.getX()+i.getX())/4,h=(r.getY()+n.getY()+o.getY()+i.getY())/4;return r=t.moveAway(r,d,h),n=t.moveAway(n,d,h),o=t.moveAway(o,d,h),i=t.moveAway(i,d,h),c=t.shiftPoint(r,n,4*s),c=t.shiftPoint(c,i,4*a),l=t.shiftPoint(n,r,4*s),l=t.shiftPoint(l,o,4*a),u=t.shiftPoint(o,i,4*s),u=t.shiftPoint(u,n,4*a),f=t.shiftPoint(i,o,4*s),[c,l,u,f=t.shiftPoint(f,r,4*a)]},t.prototype.isValid=function(t){return t.getX()>=0&&t.getX()<this.image.getWidth()&&t.getY()>0&&t.getY()<this.image.getHeight()},t.sampleGrid=function(t,e,r,n,o,i,a){return Vn.getInstance().sampleGrid(t,i,a,.5,.5,i-.5,.5,i-.5,a-.5,.5,a-.5,e.getX(),e.getY(),o.getX(),o.getY(),n.getX(),n.getY(),r.getX(),r.getY())},t.prototype.transitionsBetween=function(t,e){var r=Math.trunc(t.getX()),n=Math.trunc(t.getY()),o=Math.trunc(e.getX()),i=Math.trunc(e.getY()),a=Math.abs(i-n)>Math.abs(o-r);if(a){var s=r;r=n,n=s,s=o,o=i,i=s}for(var c=Math.abs(o-r),u=Math.abs(i-n),l=-c/2,f=n<i?1:-1,d=r<o?1:-1,h=0,p=this.image.get(a?n:r,a?r:n),g=r,m=n;g!==o;g+=d){var v=this.image.get(a?m:g,a?g:m);if(v!==p&&(h++,p=v),(l+=u)>0){if(m===i)break;m+=f,l-=c}}return h},t}(),Pi=function(){function t(){this.decoder=new Ri}return t.prototype.decode=function(e,r){var n,o;if(void 0===r&&(r=null),null!=r&&r.has(Br.PURE_BARCODE)){var i=t.extractPureBits(e.getBlackMatrix());n=this.decoder.decode(i),o=t.NO_POINTS}else{var a=new Di(e.getBlackMatrix()).detect();n=this.decoder.decode(a.getBits()),o=a.getPoints()}var s=n.getRawBytes(),c=new fn(n.getText(),s,8*s.length,o,hn.DATA_MATRIX,Nr.currentTimeMillis()),u=n.getByteSegments();null!=u&&c.putMetadata(gn.BYTE_SEGMENTS,u);var l=n.getECLevel();return null!=l&&c.putMetadata(gn.ERROR_CORRECTION_LEVEL,l),c},t.prototype.reset=function(){},t.extractPureBits=function(t){var e=t.getTopLeftOnBit(),r=t.getBottomRightOnBit();if(null==e||null==r)throw new Kr;var n=this.moduleSize(e,t),o=e[1],i=r[1],a=e[0],s=(r[0]-a+1)/n,c=(i-o+1)/n;if(s<=0||c<=0)throw new Kr;var u=n/2;o+=u,a+=u;for(var l=new Yr(s,c),f=0;f<c;f++)for(var d=o+f*n,h=0;h<s;h++)t.get(a+h*n,d)&&l.set(h,f);return l},t.moduleSize=function(t,e){for(var r=e.getWidth(),n=t[0],o=t[1];n<r&&e.get(n,o);)n++;if(n===r)throw new Kr;var i=n-t[0];if(0===i)throw new Kr;return i},t.NO_POINTS=[],t}(),Mi=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();!function(t){Mi(function(e){return void 0===e&&(e=500),t.call(this,new Pi,e)||this},t)}(ln),function(t){t[t.L=0]="L",t[t.M=1]="M",t[t.Q=2]="Q",t[t.H=3]="H"}(Ni||(Ni={}));var ki,Li=function(){function t(e,r,n){this.value=e,this.stringValue=r,this.bits=n,t.FOR_BITS.set(n,this),t.FOR_VALUE.set(e,this)}return t.prototype.getValue=function(){return this.value},t.prototype.getBits=function(){return this.bits},t.fromString=function(e){switch(e){case"L":return t.L;case"M":return t.M;case"Q":return t.Q;case"H":return t.H;default:throw new Cr(e+"not available")}},t.prototype.toString=function(){return this.stringValue},t.prototype.equals=function(e){if(!(e instanceof t))return!1;var r=e;return this.value===r.value},t.forBits=function(e){if(e<0||e>=t.FOR_BITS.size)throw new Er;return t.FOR_BITS.get(e)},t.FOR_BITS=new Map,t.FOR_VALUE=new Map,t.L=new t(Ni.L,"L",1),t.M=new t(Ni.M,"M",0),t.Q=new t(Ni.Q,"Q",3),t.H=new t(Ni.H,"H",2),t}(),ji=function(){function t(t){this.errorCorrectionLevel=Li.forBits(t>>3&3),this.dataMask=7&t}return t.numBitsDiffering=function(t,e){return kr.bitCount(t^e)},t.decodeFormatInformation=function(e,r){var n=t.doDecodeFormatInformation(e,r);return null!==n?n:t.doDecodeFormatInformation(e^t.FORMAT_INFO_MASK_QR,r^t.FORMAT_INFO_MASK_QR)},t.doDecodeFormatInformation=function(e,r){var n,o,i=Number.MAX_SAFE_INTEGER,a=0;try{for(var s=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}(t.FORMAT_INFO_DECODE_LOOKUP),c=s.next();!c.done;c=s.next()){var u=c.value,l=u[0];if(l===e||l===r)return new t(u[1]);var f=t.numBitsDiffering(e,l);f<i&&(a=u[1],i=f),e!==r&&(f=t.numBitsDiffering(r,l))<i&&(a=u[1],i=f)}}catch(d){n={error:d}}finally{try{c&&!c.done&&(o=s.return)&&o.call(s)}finally{if(n)throw n.error}}return i<=3?new t(a):null},t.prototype.getErrorCorrectionLevel=function(){return this.errorCorrectionLevel},t.prototype.getDataMask=function(){return this.dataMask},t.prototype.hashCode=function(){return this.errorCorrectionLevel.getBits()<<3|this.dataMask},t.prototype.equals=function(e){if(!(e instanceof t))return!1;var r=e;return this.errorCorrectionLevel===r.errorCorrectionLevel&&this.dataMask===r.dataMask},t.FORMAT_INFO_MASK_QR=21522,t.FORMAT_INFO_DECODE_LOOKUP=[Int32Array.from([21522,0]),Int32Array.from([20773,1]),Int32Array.from([24188,2]),Int32Array.from([23371,3]),Int32Array.from([17913,4]),Int32Array.from([16590,5]),Int32Array.from([20375,6]),Int32Array.from([19104,7]),Int32Array.from([30660,8]),Int32Array.from([29427,9]),Int32Array.from([32170,10]),Int32Array.from([30877,11]),Int32Array.from([26159,12]),Int32Array.from([25368,13]),Int32Array.from([27713,14]),Int32Array.from([26998,15]),Int32Array.from([5769,16]),Int32Array.from([5054,17]),Int32Array.from([7399,18]),Int32Array.from([6608,19]),Int32Array.from([1890,20]),Int32Array.from([597,21]),Int32Array.from([3340,22]),Int32Array.from([2107,23]),Int32Array.from([13663,24]),Int32Array.from([12392,25]),Int32Array.from([16177,26]),Int32Array.from([14854,27]),Int32Array.from([9396,28]),Int32Array.from([8579,29]),Int32Array.from([11994,30]),Int32Array.from([11245,31])],t}(),Bi=function(){function t(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];this.ecCodewordsPerBlock=t,this.ecBlocks=e}return t.prototype.getECCodewordsPerBlock=function(){return this.ecCodewordsPerBlock},t.prototype.getNumBlocks=function(){var t,e,r=0,n=this.ecBlocks;try{for(var o=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}(n),i=o.next();!i.done;i=o.next())r+=i.value.getCount()}catch(a){t={error:a}}finally{try{i&&!i.done&&(e=o.return)&&e.call(o)}finally{if(t)throw t.error}}return r},t.prototype.getTotalECCodewords=function(){return this.ecCodewordsPerBlock*this.getNumBlocks()},t.prototype.getECBlocks=function(){return this.ecBlocks},t}(),Fi=function(){function t(t,e){this.count=t,this.dataCodewords=e}return t.prototype.getCount=function(){return this.count},t.prototype.getDataCodewords=function(){return this.dataCodewords},t}(),Vi=function(){function t(t,e){for(var r,n,o=[],i=2;i<arguments.length;i++)o[i-2]=arguments[i];this.versionNumber=t,this.alignmentPatternCenters=e,this.ecBlocks=o;var a=0,s=o[0].getECCodewordsPerBlock(),c=o[0].getECBlocks();try{for(var u=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}(c),l=u.next();!l.done;l=u.next()){var f=l.value;a+=f.getCount()*(f.getDataCodewords()+s)}}catch(d){r={error:d}}finally{try{l&&!l.done&&(n=u.return)&&n.call(u)}finally{if(r)throw r.error}}this.totalCodewords=a}return t.prototype.getVersionNumber=function(){return this.versionNumber},t.prototype.getAlignmentPatternCenters=function(){return this.alignmentPatternCenters},t.prototype.getTotalCodewords=function(){return this.totalCodewords},t.prototype.getDimensionForVersion=function(){return 17+4*this.versionNumber},t.prototype.getECBlocksForLevel=function(t){return this.ecBlocks[t.getValue()]},t.getProvisionalVersionForDimension=function(t){if(t%4!=1)throw new Vr;try{return this.getVersionForNumber((t-17)/4)}catch(e){throw new Vr}},t.getVersionForNumber=function(e){if(e<1||e>40)throw new Er;return t.VERSIONS[e-1]},t.decodeVersionInformation=function(e){for(var r=Number.MAX_SAFE_INTEGER,n=0,o=0;o<t.VERSION_DECODE_INFO.length;o++){var i=t.VERSION_DECODE_INFO[o];if(i===e)return t.getVersionForNumber(o+7);var a=ji.numBitsDiffering(e,i);a<r&&(n=o+7,r=a)}return r<=3?t.getVersionForNumber(n):null},t.prototype.buildFunctionPattern=function(){var t=this.getDimensionForVersion(),e=new Yr(t);e.setRegion(0,0,9,9),e.setRegion(t-8,0,8,9),e.setRegion(0,t-8,9,8);for(var r=this.alignmentPatternCenters.length,n=0;n<r;n++)for(var o=this.alignmentPatternCenters[n]-2,i=0;i<r;i++)0===n&&(0===i||i===r-1)||n===r-1&&0===i||e.setRegion(this.alignmentPatternCenters[i]-2,o,5,5);return e.setRegion(6,9,1,t-17),e.setRegion(9,6,t-17,1),this.versionNumber>6&&(e.setRegion(t-11,0,3,6),e.setRegion(0,t-11,6,3)),e},t.prototype.toString=function(){return""+this.versionNumber},t.VERSION_DECODE_INFO=Int32Array.from([31892,34236,39577,42195,48118,51042,55367,58893,63784,68472,70749,76311,79154,84390,87683,92361,96236,102084,102881,110507,110734,117786,119615,126325,127568,133589,136944,141498,145311,150283,152622,158308,161089,167017]),t.VERSIONS=[new t(1,new Int32Array(0),new Bi(7,new Fi(1,19)),new Bi(10,new Fi(1,16)),new Bi(13,new Fi(1,13)),new Bi(17,new Fi(1,9))),new t(2,Int32Array.from([6,18]),new Bi(10,new Fi(1,34)),new Bi(16,new Fi(1,28)),new Bi(22,new Fi(1,22)),new Bi(28,new Fi(1,16))),new t(3,Int32Array.from([6,22]),new Bi(15,new Fi(1,55)),new Bi(26,new Fi(1,44)),new Bi(18,new Fi(2,17)),new Bi(22,new Fi(2,13))),new t(4,Int32Array.from([6,26]),new Bi(20,new Fi(1,80)),new Bi(18,new Fi(2,32)),new Bi(26,new Fi(2,24)),new Bi(16,new Fi(4,9))),new t(5,Int32Array.from([6,30]),new Bi(26,new Fi(1,108)),new Bi(24,new Fi(2,43)),new Bi(18,new Fi(2,15),new Fi(2,16)),new Bi(22,new Fi(2,11),new Fi(2,12))),new t(6,Int32Array.from([6,34]),new Bi(18,new Fi(2,68)),new Bi(16,new Fi(4,27)),new Bi(24,new Fi(4,19)),new Bi(28,new Fi(4,15))),new t(7,Int32Array.from([6,22,38]),new Bi(20,new Fi(2,78)),new Bi(18,new Fi(4,31)),new Bi(18,new Fi(2,14),new Fi(4,15)),new Bi(26,new Fi(4,13),new Fi(1,14))),new t(8,Int32Array.from([6,24,42]),new Bi(24,new Fi(2,97)),new Bi(22,new Fi(2,38),new Fi(2,39)),new Bi(22,new Fi(4,18),new Fi(2,19)),new Bi(26,new Fi(4,14),new Fi(2,15))),new t(9,Int32Array.from([6,26,46]),new Bi(30,new Fi(2,116)),new Bi(22,new Fi(3,36),new Fi(2,37)),new Bi(20,new Fi(4,16),new Fi(4,17)),new Bi(24,new Fi(4,12),new Fi(4,13))),new t(10,Int32Array.from([6,28,50]),new Bi(18,new Fi(2,68),new Fi(2,69)),new Bi(26,new Fi(4,43),new Fi(1,44)),new Bi(24,new Fi(6,19),new Fi(2,20)),new Bi(28,new Fi(6,15),new Fi(2,16))),new t(11,Int32Array.from([6,30,54]),new Bi(20,new Fi(4,81)),new Bi(30,new Fi(1,50),new Fi(4,51)),new Bi(28,new Fi(4,22),new Fi(4,23)),new Bi(24,new Fi(3,12),new Fi(8,13))),new t(12,Int32Array.from([6,32,58]),new Bi(24,new Fi(2,92),new Fi(2,93)),new Bi(22,new Fi(6,36),new Fi(2,37)),new Bi(26,new Fi(4,20),new Fi(6,21)),new Bi(28,new Fi(7,14),new Fi(4,15))),new t(13,Int32Array.from([6,34,62]),new Bi(26,new Fi(4,107)),new Bi(22,new Fi(8,37),new Fi(1,38)),new Bi(24,new Fi(8,20),new Fi(4,21)),new Bi(22,new Fi(12,11),new Fi(4,12))),new t(14,Int32Array.from([6,26,46,66]),new Bi(30,new Fi(3,115),new Fi(1,116)),new Bi(24,new Fi(4,40),new Fi(5,41)),new Bi(20,new Fi(11,16),new Fi(5,17)),new Bi(24,new Fi(11,12),new Fi(5,13))),new t(15,Int32Array.from([6,26,48,70]),new Bi(22,new Fi(5,87),new Fi(1,88)),new Bi(24,new Fi(5,41),new Fi(5,42)),new Bi(30,new Fi(5,24),new Fi(7,25)),new Bi(24,new Fi(11,12),new Fi(7,13))),new t(16,Int32Array.from([6,26,50,74]),new Bi(24,new Fi(5,98),new Fi(1,99)),new Bi(28,new Fi(7,45),new Fi(3,46)),new Bi(24,new Fi(15,19),new Fi(2,20)),new Bi(30,new Fi(3,15),new Fi(13,16))),new t(17,Int32Array.from([6,30,54,78]),new Bi(28,new Fi(1,107),new Fi(5,108)),new Bi(28,new Fi(10,46),new Fi(1,47)),new Bi(28,new Fi(1,22),new Fi(15,23)),new Bi(28,new Fi(2,14),new Fi(17,15))),new t(18,Int32Array.from([6,30,56,82]),new Bi(30,new Fi(5,120),new Fi(1,121)),new Bi(26,new Fi(9,43),new Fi(4,44)),new Bi(28,new Fi(17,22),new Fi(1,23)),new Bi(28,new Fi(2,14),new Fi(19,15))),new t(19,Int32Array.from([6,30,58,86]),new Bi(28,new Fi(3,113),new Fi(4,114)),new Bi(26,new Fi(3,44),new Fi(11,45)),new Bi(26,new Fi(17,21),new Fi(4,22)),new Bi(26,new Fi(9,13),new Fi(16,14))),new t(20,Int32Array.from([6,34,62,90]),new Bi(28,new Fi(3,107),new Fi(5,108)),new Bi(26,new Fi(3,41),new Fi(13,42)),new Bi(30,new Fi(15,24),new Fi(5,25)),new Bi(28,new Fi(15,15),new Fi(10,16))),new t(21,Int32Array.from([6,28,50,72,94]),new Bi(28,new Fi(4,116),new Fi(4,117)),new Bi(26,new Fi(17,42)),new Bi(28,new Fi(17,22),new Fi(6,23)),new Bi(30,new Fi(19,16),new Fi(6,17))),new t(22,Int32Array.from([6,26,50,74,98]),new Bi(28,new Fi(2,111),new Fi(7,112)),new Bi(28,new Fi(17,46)),new Bi(30,new Fi(7,24),new Fi(16,25)),new Bi(24,new Fi(34,13))),new t(23,Int32Array.from([6,30,54,78,102]),new Bi(30,new Fi(4,121),new Fi(5,122)),new Bi(28,new Fi(4,47),new Fi(14,48)),new Bi(30,new Fi(11,24),new Fi(14,25)),new Bi(30,new Fi(16,15),new Fi(14,16))),new t(24,Int32Array.from([6,28,54,80,106]),new Bi(30,new Fi(6,117),new Fi(4,118)),new Bi(28,new Fi(6,45),new Fi(14,46)),new Bi(30,new Fi(11,24),new Fi(16,25)),new Bi(30,new Fi(30,16),new Fi(2,17))),new t(25,Int32Array.from([6,32,58,84,110]),new Bi(26,new Fi(8,106),new Fi(4,107)),new Bi(28,new Fi(8,47),new Fi(13,48)),new Bi(30,new Fi(7,24),new Fi(22,25)),new Bi(30,new Fi(22,15),new Fi(13,16))),new t(26,Int32Array.from([6,30,58,86,114]),new Bi(28,new Fi(10,114),new Fi(2,115)),new Bi(28,new Fi(19,46),new Fi(4,47)),new Bi(28,new Fi(28,22),new Fi(6,23)),new Bi(30,new Fi(33,16),new Fi(4,17))),new t(27,Int32Array.from([6,34,62,90,118]),new Bi(30,new Fi(8,122),new Fi(4,123)),new Bi(28,new Fi(22,45),new Fi(3,46)),new Bi(30,new Fi(8,23),new Fi(26,24)),new Bi(30,new Fi(12,15),new Fi(28,16))),new t(28,Int32Array.from([6,26,50,74,98,122]),new Bi(30,new Fi(3,117),new Fi(10,118)),new Bi(28,new Fi(3,45),new Fi(23,46)),new Bi(30,new Fi(4,24),new Fi(31,25)),new Bi(30,new Fi(11,15),new Fi(31,16))),new t(29,Int32Array.from([6,30,54,78,102,126]),new Bi(30,new Fi(7,116),new Fi(7,117)),new Bi(28,new Fi(21,45),new Fi(7,46)),new Bi(30,new Fi(1,23),new Fi(37,24)),new Bi(30,new Fi(19,15),new Fi(26,16))),new t(30,Int32Array.from([6,26,52,78,104,130]),new Bi(30,new Fi(5,115),new Fi(10,116)),new Bi(28,new Fi(19,47),new Fi(10,48)),new Bi(30,new Fi(15,24),new Fi(25,25)),new Bi(30,new Fi(23,15),new Fi(25,16))),new t(31,Int32Array.from([6,30,56,82,108,134]),new Bi(30,new Fi(13,115),new Fi(3,116)),new Bi(28,new Fi(2,46),new Fi(29,47)),new Bi(30,new Fi(42,24),new Fi(1,25)),new Bi(30,new Fi(23,15),new Fi(28,16))),new t(32,Int32Array.from([6,34,60,86,112,138]),new Bi(30,new Fi(17,115)),new Bi(28,new Fi(10,46),new Fi(23,47)),new Bi(30,new Fi(10,24),new Fi(35,25)),new Bi(30,new Fi(19,15),new Fi(35,16))),new t(33,Int32Array.from([6,30,58,86,114,142]),new Bi(30,new Fi(17,115),new Fi(1,116)),new Bi(28,new Fi(14,46),new Fi(21,47)),new Bi(30,new Fi(29,24),new Fi(19,25)),new Bi(30,new Fi(11,15),new Fi(46,16))),new t(34,Int32Array.from([6,34,62,90,118,146]),new Bi(30,new Fi(13,115),new Fi(6,116)),new Bi(28,new Fi(14,46),new Fi(23,47)),new Bi(30,new Fi(44,24),new Fi(7,25)),new Bi(30,new Fi(59,16),new Fi(1,17))),new t(35,Int32Array.from([6,30,54,78,102,126,150]),new Bi(30,new Fi(12,121),new Fi(7,122)),new Bi(28,new Fi(12,47),new Fi(26,48)),new Bi(30,new Fi(39,24),new Fi(14,25)),new Bi(30,new Fi(22,15),new Fi(41,16))),new t(36,Int32Array.from([6,24,50,76,102,128,154]),new Bi(30,new Fi(6,121),new Fi(14,122)),new Bi(28,new Fi(6,47),new Fi(34,48)),new Bi(30,new Fi(46,24),new Fi(10,25)),new Bi(30,new Fi(2,15),new Fi(64,16))),new t(37,Int32Array.from([6,28,54,80,106,132,158]),new Bi(30,new Fi(17,122),new Fi(4,123)),new Bi(28,new Fi(29,46),new Fi(14,47)),new Bi(30,new Fi(49,24),new Fi(10,25)),new Bi(30,new Fi(24,15),new Fi(46,16))),new t(38,Int32Array.from([6,32,58,84,110,136,162]),new Bi(30,new Fi(4,122),new Fi(18,123)),new Bi(28,new Fi(13,46),new Fi(32,47)),new Bi(30,new Fi(48,24),new Fi(14,25)),new Bi(30,new Fi(42,15),new Fi(32,16))),new t(39,Int32Array.from([6,26,54,82,110,138,166]),new Bi(30,new Fi(20,117),new Fi(4,118)),new Bi(28,new Fi(40,47),new Fi(7,48)),new Bi(30,new Fi(43,24),new Fi(22,25)),new Bi(30,new Fi(10,15),new Fi(67,16))),new t(40,Int32Array.from([6,30,58,86,114,142,170]),new Bi(30,new Fi(19,118),new Fi(6,119)),new Bi(28,new Fi(18,47),new Fi(31,48)),new Bi(30,new Fi(34,24),new Fi(34,25)),new Bi(30,new Fi(20,15),new Fi(61,16)))],t}();!function(t){t[t.DATA_MASK_000=0]="DATA_MASK_000",t[t.DATA_MASK_001=1]="DATA_MASK_001",t[t.DATA_MASK_010=2]="DATA_MASK_010",t[t.DATA_MASK_011=3]="DATA_MASK_011",t[t.DATA_MASK_100=4]="DATA_MASK_100",t[t.DATA_MASK_101=5]="DATA_MASK_101",t[t.DATA_MASK_110=6]="DATA_MASK_110",t[t.DATA_MASK_111=7]="DATA_MASK_111"}(ki||(ki={}));var Hi,Ui=function(){function t(t,e){this.value=t,this.isMasked=e}return t.prototype.unmaskBitMatrix=function(t,e){for(var r=0;r<e;r++)for(var n=0;n<e;n++)this.isMasked(r,n)&&t.flip(n,r)},t.values=new Map([[ki.DATA_MASK_000,new t(ki.DATA_MASK_000,function(t,e){return!(t+e&1)})],[ki.DATA_MASK_001,new t(ki.DATA_MASK_001,function(t,e){return!(1&t)})],[ki.DATA_MASK_010,new t(ki.DATA_MASK_010,function(t,e){return e%3==0})],[ki.DATA_MASK_011,new t(ki.DATA_MASK_011,function(t,e){return(t+e)%3==0})],[ki.DATA_MASK_100,new t(ki.DATA_MASK_100,function(t,e){return!(Math.floor(t/2)+Math.floor(e/3)&1)})],[ki.DATA_MASK_101,new t(ki.DATA_MASK_101,function(t,e){return t*e%6==0})],[ki.DATA_MASK_110,new t(ki.DATA_MASK_110,function(t,e){return t*e%6<3})],[ki.DATA_MASK_111,new t(ki.DATA_MASK_111,function(t,e){return!(t+e+t*e%3&1)})]]),t}(),Wi=function(){function t(t){var e=t.getHeight();if(e<21||1!=(3&e))throw new Vr;this.bitMatrix=t}return t.prototype.readFormatInformation=function(){if(null!==this.parsedFormatInfo&&void 0!==this.parsedFormatInfo)return this.parsedFormatInfo;for(var t=0,e=0;e<6;e++)t=this.copyBit(e,8,t);t=this.copyBit(7,8,t),t=this.copyBit(8,8,t),t=this.copyBit(8,7,t);for(var r=5;r>=0;r--)t=this.copyBit(8,r,t);var n=this.bitMatrix.getHeight(),o=0,i=n-7;for(r=n-1;r>=i;r--)o=this.copyBit(8,r,o);for(e=n-8;e<n;e++)o=this.copyBit(e,8,o);if(this.parsedFormatInfo=ji.decodeFormatInformation(t,o),null!==this.parsedFormatInfo)return this.parsedFormatInfo;throw new Vr},t.prototype.readVersion=function(){if(null!==this.parsedVersion&&void 0!==this.parsedVersion)return this.parsedVersion;var t=this.bitMatrix.getHeight(),e=Math.floor((t-17)/4);if(e<=6)return Vi.getVersionForNumber(e);for(var r=0,n=t-11,o=5;o>=0;o--)for(var i=t-9;i>=n;i--)r=this.copyBit(i,o,r);var a=Vi.decodeVersionInformation(r);if(null!==a&&a.getDimensionForVersion()===t)return this.parsedVersion=a,a;for(r=0,i=5;i>=0;i--)for(o=t-9;o>=n;o--)r=this.copyBit(i,o,r);if(null!==(a=Vi.decodeVersionInformation(r))&&a.getDimensionForVersion()===t)return this.parsedVersion=a,a;throw new Vr},t.prototype.copyBit=function(t,e,r){return(this.isMirror?this.bitMatrix.get(e,t):this.bitMatrix.get(t,e))?r<<1|1:r<<1},t.prototype.readCodewords=function(){var t=this.readFormatInformation(),e=this.readVersion(),r=Ui.values.get(t.getDataMask()),n=this.bitMatrix.getHeight();r.unmaskBitMatrix(this.bitMatrix,n);for(var o=e.buildFunctionPattern(),i=!0,a=new Uint8Array(e.getTotalCodewords()),s=0,c=0,u=0,l=n-1;l>0;l-=2){6===l&&l--;for(var f=0;f<n;f++)for(var d=i?n-1-f:f,h=0;h<2;h++)o.get(l-h,d)||(u++,c<<=1,this.bitMatrix.get(l-h,d)&&(c|=1),8===u&&(a[s++]=c,u=0,c=0));i=!i}if(s!==e.getTotalCodewords())throw new Vr;return a},t.prototype.remask=function(){if(null!==this.parsedFormatInfo){var t=Ui.values[this.parsedFormatInfo.getDataMask()],e=this.bitMatrix.getHeight();t.unmaskBitMatrix(this.bitMatrix,e)}},t.prototype.setMirror=function(t){this.parsedVersion=null,this.parsedFormatInfo=null,this.isMirror=t},t.prototype.mirror=function(){for(var t=this.bitMatrix,e=0,r=t.getWidth();e<r;e++)for(var n=e+1,o=t.getHeight();n<o;n++)t.get(e,n)!==t.get(n,e)&&(t.flip(n,e),t.flip(e,n))},t}(),zi=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Gi=function(){function t(t,e){this.numDataCodewords=t,this.codewords=e}return t.getDataBlocks=function(e,r,n){var o,i,a,s;if(e.length!==r.getTotalCodewords())throw new Er;var c=r.getECBlocksForLevel(n),u=0,l=c.getECBlocks();try{for(var f=zi(l),d=f.next();!d.done;d=f.next())u+=(v=d.value).getCount()}catch(T){o={error:T}}finally{try{d&&!d.done&&(i=f.return)&&i.call(f)}finally{if(o)throw o.error}}var h=new Array(u),p=0;try{for(var g=zi(l),m=g.next();!m.done;m=g.next())for(var v=m.value,y=0;y<v.getCount();y++){var _=v.getDataCodewords(),w=c.getECCodewordsPerBlock()+_;h[p++]=new t(_,new Uint8Array(w))}}catch(T){a={error:T}}finally{try{m&&!m.done&&(s=g.return)&&s.call(g)}finally{if(a)throw a.error}}for(var b=h[0].codewords.length,C=h.length-1;C>=0&&h[C].codewords.length!==b;)C--;C++;var A=b-c.getECCodewordsPerBlock(),E=0;for(y=0;y<A;y++)for(var I=0;I<p;I++)h[I].codewords[y]=e[E++];for(I=C;I<p;I++)h[I].codewords[A]=e[E++];var S=h[0].codewords.length;for(y=A;y<S;y++)for(I=0;I<p;I++){var O=I<C?y:y+1;h[I].codewords[O]=e[E++]}return h},t.prototype.getNumDataCodewords=function(){return this.numDataCodewords},t.prototype.getCodewords=function(){return this.codewords},t}();!function(t){t[t.TERMINATOR=0]="TERMINATOR",t[t.NUMERIC=1]="NUMERIC",t[t.ALPHANUMERIC=2]="ALPHANUMERIC",t[t.STRUCTURED_APPEND=3]="STRUCTURED_APPEND",t[t.BYTE=4]="BYTE",t[t.ECI=5]="ECI",t[t.KANJI=6]="KANJI",t[t.FNC1_FIRST_POSITION=7]="FNC1_FIRST_POSITION",t[t.FNC1_SECOND_POSITION=8]="FNC1_SECOND_POSITION",t[t.HANZI=9]="HANZI"}(Hi||(Hi={}));var Xi,$i,Yi=function(){function t(e,r,n,o){this.value=e,this.stringValue=r,this.characterCountBitsForVersions=n,this.bits=o,t.FOR_BITS.set(o,this),t.FOR_VALUE.set(e,this)}return t.forBits=function(e){var r=t.FOR_BITS.get(e);if(void 0===r)throw new Er;return r},t.prototype.getCharacterCountBits=function(t){var e,r=t.getVersionNumber();return e=r<=9?0:r<=26?1:2,this.characterCountBitsForVersions[e]},t.prototype.getValue=function(){return this.value},t.prototype.getBits=function(){return this.bits},t.prototype.equals=function(e){if(!(e instanceof t))return!1;var r=e;return this.value===r.value},t.prototype.toString=function(){return this.stringValue},t.FOR_BITS=new Map,t.FOR_VALUE=new Map,t.TERMINATOR=new t(Hi.TERMINATOR,"TERMINATOR",Int32Array.from([0,0,0]),0),t.NUMERIC=new t(Hi.NUMERIC,"NUMERIC",Int32Array.from([10,12,14]),1),t.ALPHANUMERIC=new t(Hi.ALPHANUMERIC,"ALPHANUMERIC",Int32Array.from([9,11,13]),2),t.STRUCTURED_APPEND=new t(Hi.STRUCTURED_APPEND,"STRUCTURED_APPEND",Int32Array.from([0,0,0]),3),t.BYTE=new t(Hi.BYTE,"BYTE",Int32Array.from([8,16,16]),4),t.ECI=new t(Hi.ECI,"ECI",Int32Array.from([0,0,0]),7),t.KANJI=new t(Hi.KANJI,"KANJI",Int32Array.from([8,10,12]),8),t.FNC1_FIRST_POSITION=new t(Hi.FNC1_FIRST_POSITION,"FNC1_FIRST_POSITION",Int32Array.from([0,0,0]),5),t.FNC1_SECOND_POSITION=new t(Hi.FNC1_SECOND_POSITION,"FNC1_SECOND_POSITION",Int32Array.from([0,0,0]),9),t.HANZI=new t(Hi.HANZI,"HANZI",Int32Array.from([8,10,12]),13),t}(),qi=function(){function t(){}return t.decode=function(e,r,n,o){var i=new Ti(e),a=new $r,s=new Array,c=-1,u=-1;try{var l=null,f=!1,d=void 0;do{if(i.available()<4)d=Yi.TERMINATOR;else{var h=i.readBits(4);d=Yi.forBits(h)}switch(d){case Yi.TERMINATOR:break;case Yi.FNC1_FIRST_POSITION:case Yi.FNC1_SECOND_POSITION:f=!0;break;case Yi.STRUCTURED_APPEND:if(i.available()<16)throw new Vr;c=i.readBits(8),u=i.readBits(8);break;case Yi.ECI:var p=t.parseECIValue(i);if(null===(l=Ur.getCharacterSetECIByValue(p)))throw new Vr;break;case Yi.HANZI:var g=i.readBits(4),m=i.readBits(d.getCharacterCountBits(r));g===t.GB2312_SUBSET&&t.decodeHanziSegment(i,a,m);break;default:var v=i.readBits(d.getCharacterCountBits(r));switch(d){case Yi.NUMERIC:t.decodeNumericSegment(i,a,v);break;case Yi.ALPHANUMERIC:t.decodeAlphanumericSegment(i,a,v,f);break;case Yi.BYTE:t.decodeByteSegment(i,a,v,l,s,o);break;case Yi.KANJI:t.decodeKanjiSegment(i,a,v);break;default:throw new Vr}}}while(d!==Yi.TERMINATOR)}catch(y){throw new Vr}return new mn(e,a.toString(),0===s.length?null:s,null===n?null:n.toString(),c,u)},t.decodeHanziSegment=function(t,e,r){if(13*r>t.available())throw new Vr;for(var n=new Uint8Array(2*r),o=0;r>0;){var i=t.readBits(13),a=i/96<<8&4294967295|i%96;a+=a<959?41377:42657,n[o]=a>>8&255,n[o+1]=255&a,o+=2,r--}try{e.append(Gr.decode(n,Xr.GB2312))}catch(s){throw new Vr(s)}},t.decodeKanjiSegment=function(t,e,r){if(13*r>t.available())throw new Vr;for(var n=new Uint8Array(2*r),o=0;r>0;){var i=t.readBits(13),a=i/192<<8&4294967295|i%192;a+=a<7936?33088:49472,n[o]=a>>8,n[o+1]=a,o+=2,r--}try{e.append(Gr.decode(n,Xr.SHIFT_JIS))}catch(s){throw new Vr(s)}},t.decodeByteSegment=function(t,e,r,n,o,i){if(8*r>t.available())throw new Vr;for(var a,s=new Uint8Array(r),c=0;c<r;c++)s[c]=t.readBits(8);a=null===n?Xr.guessEncoding(s,i):n.getName();try{e.append(Gr.decode(s,a))}catch(u){throw new Vr(u)}o.push(s)},t.toAlphaNumericChar=function(e){if(e>=t.ALPHANUMERIC_CHARS.length)throw new Vr;return t.ALPHANUMERIC_CHARS[e]},t.decodeAlphanumericSegment=function(e,r,n,o){for(var i=r.length();n>1;){if(e.available()<11)throw new Vr;var a=e.readBits(11);r.append(t.toAlphaNumericChar(Math.floor(a/45))),r.append(t.toAlphaNumericChar(a%45)),n-=2}if(1===n){if(e.available()<6)throw new Vr;r.append(t.toAlphaNumericChar(e.readBits(6)))}if(o)for(var s=i;s<r.length();s++)"%"===r.charAt(s)&&(s<r.length()-1&&"%"===r.charAt(s+1)?r.deleteCharAt(s+1):r.setCharAt(s,String.fromCharCode(29)))},t.decodeNumericSegment=function(e,r,n){for(;n>=3;){if(e.available()<10)throw new Vr;var o=e.readBits(10);if(o>=1e3)throw new Vr;r.append(t.toAlphaNumericChar(Math.floor(o/100))),r.append(t.toAlphaNumericChar(Math.floor(o/10)%10)),r.append(t.toAlphaNumericChar(o%10)),n-=3}if(2===n){if(e.available()<7)throw new Vr;var i=e.readBits(7);if(i>=100)throw new Vr;r.append(t.toAlphaNumericChar(Math.floor(i/10))),r.append(t.toAlphaNumericChar(i%10))}else if(1===n){if(e.available()<4)throw new Vr;var a=e.readBits(4);if(a>=10)throw new Vr;r.append(t.toAlphaNumericChar(a))}},t.parseECIValue=function(t){var e=t.readBits(8);if(!(128&e))return 127&e;if(128==(192&e))return(63&e)<<8&4294967295|t.readBits(8);if(192==(224&e))return(31&e)<<16&4294967295|t.readBits(16);throw new Vr},t.ALPHANUMERIC_CHARS="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:",t.GB2312_SUBSET=1,t}(),Ki=function(){function t(t){this.mirrored=t}return t.prototype.isMirrored=function(){return this.mirrored},t.prototype.applyMirroredCorrection=function(t){if(this.mirrored&&null!==t&&!(t.length<3)){var e=t[0];t[0]=t[2],t[2]=e}},t}(),Zi=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Qi=function(){function t(){this.rsDecoder=new On(Cn.QR_CODE_FIELD_256)}return t.prototype.decodeBooleanArray=function(t,e){return this.decodeBitMatrix(Yr.parseFromBooleanArray(t),e)},t.prototype.decodeBitMatrix=function(t,e){var r=new Wi(t),n=null;try{return this.decodeBitMatrixParser(r,e)}catch(i){n=i}try{r.remask(),r.setMirror(!0),r.readVersion(),r.readFormatInformation(),r.mirror();var o=this.decodeBitMatrixParser(r,e);return o.setOther(new Ki(!0)),o}catch(i){if(null!==n)throw n;throw i}},t.prototype.decodeBitMatrixParser=function(t,e){var r,n,o,i,a=t.readVersion(),s=t.readFormatInformation().getErrorCorrectionLevel(),c=t.readCodewords(),u=Gi.getDataBlocks(c,a,s),l=0;try{for(var f=Zi(u),d=f.next();!d.done;d=f.next())l+=(v=d.value).getNumDataCodewords()}catch(b){r={error:b}}finally{try{d&&!d.done&&(n=f.return)&&n.call(f)}finally{if(r)throw r.error}}var h=new Uint8Array(l),p=0;try{for(var g=Zi(u),m=g.next();!m.done;m=g.next()){var v,y=(v=m.value).getCodewords(),_=v.getNumDataCodewords();this.correctErrors(y,_);for(var w=0;w<_;w++)h[p++]=y[w]}}catch(b){o={error:b}}finally{try{m&&!m.done&&(i=g.return)&&i.call(g)}finally{if(o)throw o.error}}return qi.decode(h,a,s,e)},t.prototype.correctErrors=function(t,e){var r=new Int32Array(t);try{this.rsDecoder.decode(r,t.length-e)}catch(o){throw new Or}for(var n=0;n<e;n++)t[n]=r[n]},t}(),Ji=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),ta=function(t){function e(e,r,n){var o=t.call(this,e,r)||this;return o.estimatedModuleSize=n,o}return Ji(e,t),e.prototype.aboutEquals=function(t,e,r){if(Math.abs(e-this.getY())<=t&&Math.abs(r-this.getX())<=t){var n=Math.abs(t-this.estimatedModuleSize);return n<=1||n<=this.estimatedModuleSize}return!1},e.prototype.combineEstimate=function(t,r,n){return new e((this.getX()+r)/2,(this.getY()+t)/2,(this.estimatedModuleSize+n)/2)},e}(Rn),ea=function(){function t(t,e,r,n,o,i,a){this.image=t,this.startX=e,this.startY=r,this.width=n,this.height=o,this.moduleSize=i,this.resultPointCallback=a,this.possibleCenters=[],this.crossCheckStateCount=new Int32Array(3)}return t.prototype.find=function(){for(var t=this.startX,e=this.height,r=t+this.width,n=this.startY+e/2,o=new Int32Array(3),i=this.image,a=0;a<e;a++){var s=n+(1&a?-Math.floor((a+1)/2):Math.floor((a+1)/2));o[0]=0,o[1]=0,o[2]=0;for(var c=t;c<r&&!i.get(c,s);)c++;for(var u=0;c<r;){if(i.get(c,s))if(1===u)o[1]++;else if(2===u){var l;if(this.foundPatternCross(o)&&null!==(l=this.handlePossibleCenter(o,s,c)))return l;o[0]=o[2],o[1]=1,o[2]=0,u=1}else o[++u]++;else 1===u&&u++,o[u]++;c++}if(this.foundPatternCross(o)&&null!==(l=this.handlePossibleCenter(o,s,r)))return l}if(0!==this.possibleCenters.length)return this.possibleCenters[0];throw new Kr},t.centerFromEnd=function(t,e){return e-t[2]-t[1]/2},t.prototype.foundPatternCross=function(t){for(var e=this.moduleSize,r=e/2,n=0;n<3;n++)if(Math.abs(e-t[n])>=r)return!1;return!0},t.prototype.crossCheckVertical=function(e,r,n,o){var i=this.image,a=i.getHeight(),s=this.crossCheckStateCount;s[0]=0,s[1]=0,s[2]=0;for(var c=e;c>=0&&i.get(r,c)&&s[1]<=n;)s[1]++,c--;if(c<0||s[1]>n)return NaN;for(;c>=0&&!i.get(r,c)&&s[0]<=n;)s[0]++,c--;if(s[0]>n)return NaN;for(c=e+1;c<a&&i.get(r,c)&&s[1]<=n;)s[1]++,c++;if(c===a||s[1]>n)return NaN;for(;c<a&&!i.get(r,c)&&s[2]<=n;)s[2]++,c++;if(s[2]>n)return NaN;var u=s[0]+s[1]+s[2];return 5*Math.abs(u-o)>=2*o?NaN:this.foundPatternCross(s)?t.centerFromEnd(s,c):NaN},t.prototype.handlePossibleCenter=function(e,r,n){var o,i,a=e[0]+e[1]+e[2],s=t.centerFromEnd(e,n),c=this.crossCheckVertical(r,s,2*e[1],a);if(!isNaN(c)){var u=(e[0]+e[1]+e[2])/3;try{for(var l=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}(this.possibleCenters),f=l.next();!f.done;f=l.next()){var d=f.value;if(d.aboutEquals(u,c,s))return d.combineEstimate(c,s,u)}}catch(p){o={error:p}}finally{try{f&&!f.done&&(i=l.return)&&i.call(l)}finally{if(o)throw o.error}}var h=new ta(s,c,u);this.possibleCenters.push(h),null!==this.resultPointCallback&&void 0!==this.resultPointCallback&&this.resultPointCallback.foundPossibleResultPoint(h)}return null},t}(),ra=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),na=function(t){function e(e,r,n,o){var i=t.call(this,e,r)||this;return i.estimatedModuleSize=n,i.count=o,void 0===o&&(i.count=1),i}return ra(e,t),e.prototype.getEstimatedModuleSize=function(){return this.estimatedModuleSize},e.prototype.getCount=function(){return this.count},e.prototype.aboutEquals=function(t,e,r){if(Math.abs(e-this.getY())<=t&&Math.abs(r-this.getX())<=t){var n=Math.abs(t-this.estimatedModuleSize);return n<=1||n<=this.estimatedModuleSize}return!1},e.prototype.combineEstimate=function(t,r,n){var o=this.count+1;return new e((this.count*this.getX()+r)/o,(this.count*this.getY()+t)/o,(this.count*this.estimatedModuleSize+n)/o,o)},e}(Rn),oa=function(){function t(t){this.bottomLeft=t[0],this.topLeft=t[1],this.topRight=t[2]}return t.prototype.getBottomLeft=function(){return this.bottomLeft},t.prototype.getTopLeft=function(){return this.topLeft},t.prototype.getTopRight=function(){return this.topRight},t}(),ia=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},aa=function(){function t(t,e){this.image=t,this.resultPointCallback=e,this.possibleCenters=[],this.crossCheckStateCount=new Int32Array(5),this.resultPointCallback=e}return t.prototype.getImage=function(){return this.image},t.prototype.getPossibleCenters=function(){return this.possibleCenters},t.prototype.find=function(e){var r=null!=e&&void 0!==e.get(Br.TRY_HARDER),n=null!=e&&void 0!==e.get(Br.PURE_BARCODE),o=this.image,i=o.getHeight(),a=o.getWidth(),s=Math.floor(3*i/(4*t.MAX_MODULES));(s<t.MIN_SKIP||r)&&(s=t.MIN_SKIP);for(var c=!1,u=new Int32Array(5),l=s-1;l<i&&!c;l+=s){u[0]=0,u[1]=0,u[2]=0,u[3]=0,u[4]=0;for(var f=0,d=0;d<a;d++)if(o.get(d,l))!(1&~f)&&f++,u[f]++;else if(1&f)u[f]++;else if(4===f)if(t.foundPatternCross(u)){if(!0!==this.handlePossibleCenter(u,l,d,n)){u[0]=u[2],u[1]=u[3],u[2]=u[4],u[3]=1,u[4]=0,f=3;continue}if(s=2,!0===this.hasSkipped)c=this.haveMultiplyConfirmedCenters();else{var h=this.findRowSkip();h>u[2]&&(l+=h-u[2]-s,d=a-1)}f=0,u[0]=0,u[1]=0,u[2]=0,u[3]=0,u[4]=0}else u[0]=u[2],u[1]=u[3],u[2]=u[4],u[3]=1,u[4]=0,f=3;else u[++f]++;t.foundPatternCross(u)&&!0===this.handlePossibleCenter(u,l,a,n)&&(s=u[0],this.hasSkipped&&(c=this.haveMultiplyConfirmedCenters()))}var p=this.selectBestPatterns();return Rn.orderBestPatterns(p),new oa(p)},t.centerFromEnd=function(t,e){return e-t[4]-t[3]-t[2]/2},t.foundPatternCross=function(t){for(var e=0,r=0;r<5;r++){var n=t[r];if(0===n)return!1;e+=n}if(e<7)return!1;var o=e/7,i=o/2;return Math.abs(o-t[0])<i&&Math.abs(o-t[1])<i&&Math.abs(3*o-t[2])<3*i&&Math.abs(o-t[3])<i&&Math.abs(o-t[4])<i},t.prototype.getCrossCheckStateCount=function(){var t=this.crossCheckStateCount;return t[0]=0,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t},t.prototype.crossCheckDiagonal=function(e,r,n,o){for(var i=this.getCrossCheckStateCount(),a=0,s=this.image;e>=a&&r>=a&&s.get(r-a,e-a);)i[2]++,a++;if(e<a||r<a)return!1;for(;e>=a&&r>=a&&!s.get(r-a,e-a)&&i[1]<=n;)i[1]++,a++;if(e<a||r<a||i[1]>n)return!1;for(;e>=a&&r>=a&&s.get(r-a,e-a)&&i[0]<=n;)i[0]++,a++;if(i[0]>n)return!1;var c=s.getHeight(),u=s.getWidth();for(a=1;e+a<c&&r+a<u&&s.get(r+a,e+a);)i[2]++,a++;if(e+a>=c||r+a>=u)return!1;for(;e+a<c&&r+a<u&&!s.get(r+a,e+a)&&i[3]<n;)i[3]++,a++;if(e+a>=c||r+a>=u||i[3]>=n)return!1;for(;e+a<c&&r+a<u&&s.get(r+a,e+a)&&i[4]<n;)i[4]++,a++;if(i[4]>=n)return!1;var l=i[0]+i[1]+i[2]+i[3]+i[4];return Math.abs(l-o)<2*o&&t.foundPatternCross(i)},t.prototype.crossCheckVertical=function(e,r,n,o){for(var i=this.image,a=i.getHeight(),s=this.getCrossCheckStateCount(),c=e;c>=0&&i.get(r,c);)s[2]++,c--;if(c<0)return NaN;for(;c>=0&&!i.get(r,c)&&s[1]<=n;)s[1]++,c--;if(c<0||s[1]>n)return NaN;for(;c>=0&&i.get(r,c)&&s[0]<=n;)s[0]++,c--;if(s[0]>n)return NaN;for(c=e+1;c<a&&i.get(r,c);)s[2]++,c++;if(c===a)return NaN;for(;c<a&&!i.get(r,c)&&s[3]<n;)s[3]++,c++;if(c===a||s[3]>=n)return NaN;for(;c<a&&i.get(r,c)&&s[4]<n;)s[4]++,c++;if(s[4]>=n)return NaN;var u=s[0]+s[1]+s[2]+s[3]+s[4];return 5*Math.abs(u-o)>=2*o?NaN:t.foundPatternCross(s)?t.centerFromEnd(s,c):NaN},t.prototype.crossCheckHorizontal=function(e,r,n,o){for(var i=this.image,a=i.getWidth(),s=this.getCrossCheckStateCount(),c=e;c>=0&&i.get(c,r);)s[2]++,c--;if(c<0)return NaN;for(;c>=0&&!i.get(c,r)&&s[1]<=n;)s[1]++,c--;if(c<0||s[1]>n)return NaN;for(;c>=0&&i.get(c,r)&&s[0]<=n;)s[0]++,c--;if(s[0]>n)return NaN;for(c=e+1;c<a&&i.get(c,r);)s[2]++,c++;if(c===a)return NaN;for(;c<a&&!i.get(c,r)&&s[3]<n;)s[3]++,c++;if(c===a||s[3]>=n)return NaN;for(;c<a&&i.get(c,r)&&s[4]<n;)s[4]++,c++;if(s[4]>=n)return NaN;var u=s[0]+s[1]+s[2]+s[3]+s[4];return 5*Math.abs(u-o)>=o?NaN:t.foundPatternCross(s)?t.centerFromEnd(s,c):NaN},t.prototype.handlePossibleCenter=function(e,r,n,o){var i=e[0]+e[1]+e[2]+e[3]+e[4],a=t.centerFromEnd(e,n),s=this.crossCheckVertical(r,Math.floor(a),e[2],i);if(!isNaN(s)&&(a=this.crossCheckHorizontal(Math.floor(a),Math.floor(s),e[2],i),!isNaN(a)&&(!o||this.crossCheckDiagonal(Math.floor(s),Math.floor(a),e[2],i)))){for(var c=i/7,u=!1,l=this.possibleCenters,f=0,d=l.length;f<d;f++){var h=l[f];if(h.aboutEquals(c,s,a)){l[f]=h.combineEstimate(s,a,c),u=!0;break}}if(!u){var p=new na(a,s,c);l.push(p),null!==this.resultPointCallback&&void 0!==this.resultPointCallback&&this.resultPointCallback.foundPossibleResultPoint(p)}return!0}return!1},t.prototype.findRowSkip=function(){var e,r;if(this.possibleCenters.length<=1)return 0;var n=null;try{for(var o=ia(this.possibleCenters),i=o.next();!i.done;i=o.next()){var a=i.value;if(a.getCount()>=t.CENTER_QUORUM){if(null!=n)return this.hasSkipped=!0,Math.floor((Math.abs(n.getX()-a.getX())-Math.abs(n.getY()-a.getY()))/2);n=a}}}catch(s){e={error:s}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(e)throw e.error}}return 0},t.prototype.haveMultiplyConfirmedCenters=function(){var e,r,n,o,i=0,a=0,s=this.possibleCenters.length;try{for(var c=ia(this.possibleCenters),u=c.next();!u.done;u=c.next())(p=u.value).getCount()>=t.CENTER_QUORUM&&(i++,a+=p.getEstimatedModuleSize())}catch(g){e={error:g}}finally{try{u&&!u.done&&(r=c.return)&&r.call(c)}finally{if(e)throw e.error}}if(i<3)return!1;var l=a/s,f=0;try{for(var d=ia(this.possibleCenters),h=d.next();!h.done;h=d.next()){var p=h.value;f+=Math.abs(p.getEstimatedModuleSize()-l)}}catch(g){n={error:g}}finally{try{h&&!h.done&&(o=d.return)&&o.call(d)}finally{if(n)throw n.error}}return f<=.05*a},t.prototype.selectBestPatterns=function(){var t,e,r,n,o=this.possibleCenters.length;if(o<3)throw new Kr;var i,a=this.possibleCenters;if(o>3){var s=0,c=0;try{for(var u=ia(this.possibleCenters),l=u.next();!l.done;l=u.next()){var f=l.value.getEstimatedModuleSize();s+=f,c+=f*f}}catch(y){t={error:y}}finally{try{l&&!l.done&&(e=u.return)&&e.call(u)}finally{if(t)throw t.error}}i=s/o;var d=Math.sqrt(c/o-i*i);a.sort(function(t,e){var r=Math.abs(e.getEstimatedModuleSize()-i),n=Math.abs(t.getEstimatedModuleSize()-i);return r<n?-1:r>n?1:0});for(var h=Math.max(.2*i,d),p=0;p<a.length&&a.length>3;p++){var g=a[p];Math.abs(g.getEstimatedModuleSize()-i)>h&&(a.splice(p,1),p--)}}if(a.length>3){s=0;try{for(var m=ia(a),v=m.next();!v.done;v=m.next())s+=v.value.getEstimatedModuleSize()}catch(_){r={error:_}}finally{try{v&&!v.done&&(n=m.return)&&n.call(m)}finally{if(r)throw r.error}}i=s/a.length,a.sort(function(t,e){if(e.getCount()===t.getCount()){var r=Math.abs(e.getEstimatedModuleSize()-i),n=Math.abs(t.getEstimatedModuleSize()-i);return r<n?1:r>n?-1:0}return e.getCount()-t.getCount()}),a.splice(3)}return[a[0],a[1],a[2]]},t.CENTER_QUORUM=2,t.MIN_SKIP=3,t.MAX_MODULES=57,t}(),sa=function(){function t(t){this.image=t}return t.prototype.getImage=function(){return this.image},t.prototype.getResultPointCallback=function(){return this.resultPointCallback},t.prototype.detect=function(t){this.resultPointCallback=null==t?null:t.get(Br.NEED_RESULT_POINT_CALLBACK);var e=new aa(this.image,this.resultPointCallback).find(t);return this.processFinderPatternInfo(e)},t.prototype.processFinderPatternInfo=function(e){var r=e.getTopLeft(),n=e.getTopRight(),o=e.getBottomLeft(),i=this.calculateModuleSize(r,n,o);if(i<1)throw new Kr("No pattern found in proccess finder.");var a=t.computeDimension(r,n,o,i),s=Vi.getProvisionalVersionForDimension(a),c=s.getDimensionForVersion()-7,u=null;if(s.getAlignmentPatternCenters().length>0)for(var l=n.getX()-r.getX()+o.getX(),f=n.getY()-r.getY()+o.getY(),d=1-3/c,h=Math.floor(r.getX()+d*(l-r.getX())),p=Math.floor(r.getY()+d*(f-r.getY())),g=4;g<=16;g<<=1)try{u=this.findAlignmentInRegion(i,h,p,g);break}catch(y){if(!(y instanceof Kr))throw y}var m=t.createTransform(r,n,o,u,a),v=t.sampleGrid(this.image,m,a);return new Dn(v,null===u?[o,r,n]:[o,r,n,u])},t.createTransform=function(t,e,r,n,o){var i,a,s,c,u=o-3.5;return null!==n?(i=n.getX(),a=n.getY(),c=s=u-3):(i=e.getX()-t.getX()+r.getX(),a=e.getY()-t.getY()+r.getY(),s=u,c=u),jn.quadrilateralToQuadrilateral(3.5,3.5,u,3.5,s,c,3.5,u,t.getX(),t.getY(),e.getX(),e.getY(),i,a,r.getX(),r.getY())},t.sampleGrid=function(t,e,r){return Vn.getInstance().sampleGridWithTransform(t,r,r,e)},t.computeDimension=function(t,e,r,n){var o=Nn.round(Rn.distance(t,e)/n),i=Nn.round(Rn.distance(t,r)/n),a=Math.floor((o+i)/2)+7;switch(3&a){case 0:a++;break;case 2:a--;break;case 3:throw new Kr("Dimensions could be not found.")}return a},t.prototype.calculateModuleSize=function(t,e,r){return(this.calculateModuleSizeOneWay(t,e)+this.calculateModuleSizeOneWay(t,r))/2},t.prototype.calculateModuleSizeOneWay=function(t,e){var r=this.sizeOfBlackWhiteBlackRunBothWays(Math.floor(t.getX()),Math.floor(t.getY()),Math.floor(e.getX()),Math.floor(e.getY())),n=this.sizeOfBlackWhiteBlackRunBothWays(Math.floor(e.getX()),Math.floor(e.getY()),Math.floor(t.getX()),Math.floor(t.getY()));return isNaN(r)?n/7:isNaN(n)?r/7:(r+n)/14},t.prototype.sizeOfBlackWhiteBlackRunBothWays=function(t,e,r,n){var o=this.sizeOfBlackWhiteBlackRun(t,e,r,n),i=1,a=t-(r-t);a<0?(i=t/(t-a),a=0):a>=this.image.getWidth()&&(i=(this.image.getWidth()-1-t)/(a-t),a=this.image.getWidth()-1);var s=Math.floor(e-(n-e)*i);return i=1,s<0?(i=e/(e-s),s=0):s>=this.image.getHeight()&&(i=(this.image.getHeight()-1-e)/(s-e),s=this.image.getHeight()-1),a=Math.floor(t+(a-t)*i),(o+=this.sizeOfBlackWhiteBlackRun(t,e,a,s))-1},t.prototype.sizeOfBlackWhiteBlackRun=function(t,e,r,n){var o=Math.abs(n-e)>Math.abs(r-t);if(o){var i=t;t=e,e=i,i=r,r=n,n=i}for(var a=Math.abs(r-t),s=Math.abs(n-e),c=-a/2,u=t<r?1:-1,l=e<n?1:-1,f=0,d=r+u,h=t,p=e;h!==d;h+=u){var g=o?p:h,m=o?h:p;if(1===f===this.image.get(g,m)){if(2===f)return Nn.distance(h,p,t,e);f++}if((c+=s)>0){if(p===n)break;p+=l,c-=a}}return 2===f?Nn.distance(r+u,n,t,e):NaN},t.prototype.findAlignmentInRegion=function(t,e,r,n){var o=Math.floor(n*t),i=Math.max(0,e-o),a=Math.min(this.image.getWidth()-1,e+o);if(a-i<3*t)throw new Kr("Alignment top exceeds estimated module size.");var s=Math.max(0,r-o),c=Math.min(this.image.getHeight()-1,r+o);if(c-s<3*t)throw new Kr("Alignment bottom exceeds estimated module size.");return new ea(this.image,i,s,a-i,c-s,t,this.resultPointCallback).find()},t}(),ca=function(){function t(){this.decoder=new Qi}return t.prototype.getDecoder=function(){return this.decoder},t.prototype.decode=function(e,r){var n,o;if(null!=r&&void 0!==r.get(Br.PURE_BARCODE)){var i=t.extractPureBits(e.getBlackMatrix());n=this.decoder.decodeBitMatrix(i,r),o=t.NO_POINTS}else{var a=new sa(e.getBlackMatrix()).detect(r);n=this.decoder.decodeBitMatrix(a.getBits(),r),o=a.getPoints()}n.getOther()instanceof Ki&&n.getOther().applyMirroredCorrection(o);var s=new fn(n.getText(),n.getRawBytes(),void 0,o,hn.QR_CODE,void 0),c=n.getByteSegments();null!==c&&s.putMetadata(gn.BYTE_SEGMENTS,c);var u=n.getECLevel();return null!==u&&s.putMetadata(gn.ERROR_CORRECTION_LEVEL,u),n.hasStructuredAppend()&&(s.putMetadata(gn.STRUCTURED_APPEND_SEQUENCE,n.getStructuredAppendSequenceNumber()),s.putMetadata(gn.STRUCTURED_APPEND_PARITY,n.getStructuredAppendParity())),s},t.prototype.reset=function(){},t.extractPureBits=function(t){var e=t.getTopLeftOnBit(),r=t.getBottomRightOnBit();if(null===e||null===r)throw new Kr;var n=this.moduleSize(e,t),o=e[1],i=r[1],a=e[0],s=r[0];if(a>=s||o>=i)throw new Kr;if(i-o!=s-a&&(s=a+(i-o))>=t.getWidth())throw new Kr;var c=Math.round((s-a+1)/n),u=Math.round((i-o+1)/n);if(c<=0||u<=0)throw new Kr;if(u!==c)throw new Kr;var l=Math.floor(n/2);o+=l;var f=(a+=l)+Math.floor((c-1)*n)-s;if(f>0){if(f>l)throw new Kr;a-=f}var d=o+Math.floor((u-1)*n)-i;if(d>0){if(d>l)throw new Kr;o-=d}for(var h=new Yr(c,u),p=0;p<u;p++)for(var g=o+Math.floor(p*n),m=0;m<c;m++)t.get(a+Math.floor(m*n),g)&&h.set(m,p);return h},t.moduleSize=function(t,e){for(var r=e.getHeight(),n=e.getWidth(),o=t[0],i=t[1],a=!0,s=0;o<n&&i<r;){if(a!==e.get(o,i)){if(5==++s)break;a=!a}o++,i++}if(o===n||i===r)throw new Kr;return(o-t[0])/7},t.NO_POINTS=new Array,t}(),ua=function(){function t(){}return t.prototype.PDF417Common=function(){},t.getBitCountSum=function(t){return Nn.sum(t)},t.toIntArray=function(e){var r,n;if(null==e||!e.length)return t.EMPTY_INT_ARRAY;var o=new Int32Array(e.length),i=0;try{for(var a=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}(e),s=a.next();!s.done;s=a.next()){var c=s.value;o[i++]=c}}catch(u){r={error:u}}finally{try{s&&!s.done&&(n=a.return)&&n.call(a)}finally{if(r)throw r.error}}return o},t.getCodeword=function(e){var r=Mr.binarySearch(t.SYMBOL_TABLE,262143&e);return r<0?-1:(t.CODEWORD_TABLE[r]-1)%t.NUMBER_OF_CODEWORDS},t.NUMBER_OF_CODEWORDS=929,t.MAX_CODEWORDS_IN_BARCODE=t.NUMBER_OF_CODEWORDS-1,t.MIN_ROWS_IN_BARCODE=3,t.MAX_ROWS_IN_BARCODE=90,t.MODULES_IN_CODEWORD=17,t.MODULES_IN_STOP_PATTERN=18,t.BARS_IN_MODULE=8,t.EMPTY_INT_ARRAY=new Int32Array([]),t.SYMBOL_TABLE=Int32Array.from([66142,66170,66206,66236,66290,66292,66350,66382,66396,66454,66470,66476,66594,66600,66614,66626,66628,66632,66640,66654,66662,66668,66682,66690,66718,66720,66748,66758,66776,66798,66802,66804,66820,66824,66832,66846,66848,66876,66880,66936,66950,66956,66968,66992,67006,67022,67036,67042,67044,67048,67062,67118,67150,67164,67214,67228,67256,67294,67322,67350,67366,67372,67398,67404,67416,67438,67474,67476,67490,67492,67496,67510,67618,67624,67650,67656,67664,67678,67686,67692,67706,67714,67716,67728,67742,67744,67772,67782,67788,67800,67822,67826,67828,67842,67848,67870,67872,67900,67904,67960,67974,67992,68016,68030,68046,68060,68066,68068,68072,68086,68104,68112,68126,68128,68156,68160,68216,68336,68358,68364,68376,68400,68414,68448,68476,68494,68508,68536,68546,68548,68552,68560,68574,68582,68588,68654,68686,68700,68706,68708,68712,68726,68750,68764,68792,68802,68804,68808,68816,68830,68838,68844,68858,68878,68892,68920,68976,68990,68994,68996,69e3,69008,69022,69024,69052,69062,69068,69080,69102,69106,69108,69142,69158,69164,69190,69208,69230,69254,69260,69272,69296,69310,69326,69340,69386,69394,69396,69410,69416,69430,69442,69444,69448,69456,69470,69478,69484,69554,69556,69666,69672,69698,69704,69712,69726,69754,69762,69764,69776,69790,69792,69820,69830,69836,69848,69870,69874,69876,69890,69918,69920,69948,69952,70008,70022,70040,70064,70078,70094,70108,70114,70116,70120,70134,70152,70174,70176,70264,70384,70412,70448,70462,70496,70524,70542,70556,70584,70594,70600,70608,70622,70630,70636,70664,70672,70686,70688,70716,70720,70776,70896,71136,71180,71192,71216,71230,71264,71292,71360,71416,71452,71480,71536,71550,71554,71556,71560,71568,71582,71584,71612,71622,71628,71640,71662,71726,71732,71758,71772,71778,71780,71784,71798,71822,71836,71864,71874,71880,71888,71902,71910,71916,71930,71950,71964,71992,72048,72062,72066,72068,72080,72094,72096,72124,72134,72140,72152,72174,72178,72180,72206,72220,72248,72304,72318,72416,72444,72456,72464,72478,72480,72508,72512,72568,72588,72600,72624,72638,72654,72668,72674,72676,72680,72694,72726,72742,72748,72774,72780,72792,72814,72838,72856,72880,72894,72910,72924,72930,72932,72936,72950,72966,72972,72984,73008,73022,73056,73084,73102,73116,73144,73156,73160,73168,73182,73190,73196,73210,73226,73234,73236,73250,73252,73256,73270,73282,73284,73296,73310,73318,73324,73346,73348,73352,73360,73374,73376,73404,73414,73420,73432,73454,73498,73518,73522,73524,73550,73564,73570,73572,73576,73590,73800,73822,73858,73860,73872,73886,73888,73916,73944,73970,73972,73992,74014,74016,74044,74048,74104,74118,74136,74160,74174,74210,74212,74216,74230,74244,74256,74270,74272,74360,74480,74502,74508,74544,74558,74592,74620,74638,74652,74680,74690,74696,74704,74726,74732,74782,74784,74812,74992,75232,75288,75326,75360,75388,75456,75512,75576,75632,75646,75650,75652,75664,75678,75680,75708,75718,75724,75736,75758,75808,75836,75840,75896,76016,76256,76736,76824,76848,76862,76896,76924,76992,77048,77296,77340,77368,77424,77438,77536,77564,77572,77576,77584,77600,77628,77632,77688,77702,77708,77720,77744,77758,77774,77788,77870,77902,77916,77922,77928,77966,77980,78008,78018,78024,78032,78046,78060,78074,78094,78136,78192,78206,78210,78212,78224,78238,78240,78268,78278,78284,78296,78322,78324,78350,78364,78448,78462,78560,78588,78600,78622,78624,78652,78656,78712,78726,78744,78768,78782,78798,78812,78818,78820,78824,78838,78862,78876,78904,78960,78974,79072,79100,79296,79352,79368,79376,79390,79392,79420,79424,79480,79600,79628,79640,79664,79678,79712,79740,79772,79800,79810,79812,79816,79824,79838,79846,79852,79894,79910,79916,79942,79948,79960,79982,79988,80006,80024,80048,80062,80078,80092,80098,80100,80104,80134,80140,80176,80190,80224,80252,80270,80284,80312,80328,80336,80350,80358,80364,80378,80390,80396,80408,80432,80446,80480,80508,80576,80632,80654,80668,80696,80752,80766,80776,80784,80798,80800,80828,80844,80856,80878,80882,80884,80914,80916,80930,80932,80936,80950,80962,80968,80976,80990,80998,81004,81026,81028,81040,81054,81056,81084,81094,81100,81112,81134,81154,81156,81160,81168,81182,81184,81212,81216,81272,81286,81292,81304,81328,81342,81358,81372,81380,81384,81398,81434,81454,81458,81460,81486,81500,81506,81508,81512,81526,81550,81564,81592,81602,81604,81608,81616,81630,81638,81644,81702,81708,81722,81734,81740,81752,81774,81778,81780,82050,82078,82080,82108,82180,82184,82192,82206,82208,82236,82240,82296,82316,82328,82352,82366,82402,82404,82408,82440,82448,82462,82464,82492,82496,82552,82672,82694,82700,82712,82736,82750,82784,82812,82830,82882,82884,82888,82896,82918,82924,82952,82960,82974,82976,83004,83008,83064,83184,83424,83468,83480,83504,83518,83552,83580,83648,83704,83740,83768,83824,83838,83842,83844,83848,83856,83872,83900,83910,83916,83928,83950,83984,84e3,84028,84032,84088,84208,84448,84928,85040,85054,85088,85116,85184,85240,85488,85560,85616,85630,85728,85756,85764,85768,85776,85790,85792,85820,85824,85880,85894,85900,85912,85936,85966,85980,86048,86080,86136,86256,86496,86976,88160,88188,88256,88312,88560,89056,89200,89214,89312,89340,89536,89592,89608,89616,89632,89664,89720,89840,89868,89880,89904,89952,89980,89998,90012,90040,90190,90204,90254,90268,90296,90306,90308,90312,90334,90382,90396,90424,90480,90494,90500,90504,90512,90526,90528,90556,90566,90572,90584,90610,90612,90638,90652,90680,90736,90750,90848,90876,90884,90888,90896,90910,90912,90940,90944,91e3,91014,91020,91032,91056,91070,91086,91100,91106,91108,91112,91126,91150,91164,91192,91248,91262,91360,91388,91584,91640,91664,91678,91680,91708,91712,91768,91888,91928,91952,91966,92e3,92028,92046,92060,92088,92098,92100,92104,92112,92126,92134,92140,92188,92216,92272,92384,92412,92608,92664,93168,93200,93214,93216,93244,93248,93304,93424,93664,93720,93744,93758,93792,93820,93888,93944,93980,94008,94064,94078,94084,94088,94096,94110,94112,94140,94150,94156,94168,94246,94252,94278,94284,94296,94318,94342,94348,94360,94384,94398,94414,94428,94440,94470,94476,94488,94512,94526,94560,94588,94606,94620,94648,94658,94660,94664,94672,94686,94694,94700,94714,94726,94732,94744,94768,94782,94816,94844,94912,94968,94990,95004,95032,95088,95102,95112,95120,95134,95136,95164,95180,95192,95214,95218,95220,95244,95256,95280,95294,95328,95356,95424,95480,95728,95758,95772,95800,95856,95870,95968,95996,96008,96016,96030,96032,96060,96064,96120,96152,96176,96190,96220,96226,96228,96232,96290,96292,96296,96310,96322,96324,96328,96336,96350,96358,96364,96386,96388,96392,96400,96414,96416,96444,96454,96460,96472,96494,96498,96500,96514,96516,96520,96528,96542,96544,96572,96576,96632,96646,96652,96664,96688,96702,96718,96732,96738,96740,96744,96758,96772,96776,96784,96798,96800,96828,96832,96888,97008,97030,97036,97048,97072,97086,97120,97148,97166,97180,97208,97220,97224,97232,97246,97254,97260,97326,97330,97332,97358,97372,97378,97380,97384,97398,97422,97436,97464,97474,97476,97480,97488,97502,97510,97516,97550,97564,97592,97648,97666,97668,97672,97680,97694,97696,97724,97734,97740,97752,97774,97830,97836,97850,97862,97868,97880,97902,97906,97908,97926,97932,97944,97968,97998,98012,98018,98020,98024,98038,98618,98674,98676,98838,98854,98874,98892,98904,98926,98930,98932,98968,99006,99042,99044,99048,99062,99166,99194,99246,99286,99350,99366,99372,99386,99398,99416,99438,99442,99444,99462,99504,99518,99534,99548,99554,99556,99560,99574,99590,99596,99608,99632,99646,99680,99708,99726,99740,99768,99778,99780,99784,99792,99806,99814,99820,99834,99858,99860,99874,99880,99894,99906,99920,99934,99962,99970,99972,99976,99984,99998,1e5,100028,100038,100044,100056,100078,100082,100084,100142,100174,100188,100246,100262,100268,100306,100308,100390,100396,100410,100422,100428,100440,100462,100466,100468,100486,100504,100528,100542,100558,100572,100578,100580,100584,100598,100620,100656,100670,100704,100732,100750,100792,100802,100808,100816,100830,100838,100844,100858,100888,100912,100926,100960,100988,101056,101112,101148,101176,101232,101246,101250,101252,101256,101264,101278,101280,101308,101318,101324,101336,101358,101362,101364,101410,101412,101416,101430,101442,101448,101456,101470,101478,101498,101506,101508,101520,101534,101536,101564,101580,101618,101620,101636,101640,101648,101662,101664,101692,101696,101752,101766,101784,101838,101858,101860,101864,101934,101938,101940,101966,101980,101986,101988,101992,102030,102044,102072,102082,102084,102088,102096,102138,102166,102182,102188,102214,102220,102232,102254,102282,102290,102292,102306,102308,102312,102326,102444,102458,102470,102476,102488,102514,102516,102534,102552,102576,102590,102606,102620,102626,102632,102646,102662,102668,102704,102718,102752,102780,102798,102812,102840,102850,102856,102864,102878,102886,102892,102906,102936,102974,103008,103036,103104,103160,103224,103280,103294,103298,103300,103312,103326,103328,103356,103366,103372,103384,103406,103410,103412,103472,103486,103520,103548,103616,103672,103920,103992,104048,104062,104160,104188,104194,104196,104200,104208,104224,104252,104256,104312,104326,104332,104344,104368,104382,104398,104412,104418,104420,104424,104482,104484,104514,104520,104528,104542,104550,104570,104578,104580,104592,104606,104608,104636,104652,104690,104692,104706,104712,104734,104736,104764,104768,104824,104838,104856,104910,104930,104932,104936,104968,104976,104990,104992,105020,105024,105080,105200,105240,105278,105312,105372,105410,105412,105416,105424,105446,105518,105524,105550,105564,105570,105572,105576,105614,105628,105656,105666,105672,105680,105702,105722,105742,105756,105784,105840,105854,105858,105860,105864,105872,105888,105932,105970,105972,106006,106022,106028,106054,106060,106072,106100,106118,106124,106136,106160,106174,106190,106210,106212,106216,106250,106258,106260,106274,106276,106280,106306,106308,106312,106320,106334,106348,106394,106414,106418,106420,106566,106572,106610,106612,106630,106636,106648,106672,106686,106722,106724,106728,106742,106758,106764,106776,106800,106814,106848,106876,106894,106908,106936,106946,106948,106952,106960,106974,106982,106988,107032,107056,107070,107104,107132,107200,107256,107292,107320,107376,107390,107394,107396,107400,107408,107422,107424,107452,107462,107468,107480,107502,107506,107508,107544,107568,107582,107616,107644,107712,107768,108016,108060,108088,108144,108158,108256,108284,108290,108292,108296,108304,108318,108320,108348,108352,108408,108422,108428,108440,108464,108478,108494,108508,108514,108516,108520,108592,108640,108668,108736,108792,109040,109536,109680,109694,109792,109820,110016,110072,110084,110088,110096,110112,110140,110144,110200,110320,110342,110348,110360,110384,110398,110432,110460,110478,110492,110520,110532,110536,110544,110558,110658,110686,110714,110722,110724,110728,110736,110750,110752,110780,110796,110834,110836,110850,110852,110856,110864,110878,110880,110908,110912,110968,110982,111e3,111054,111074,111076,111080,111108,111112,111120,111134,111136,111164,111168,111224,111344,111372,111422,111456,111516,111554,111556,111560,111568,111590,111632,111646,111648,111676,111680,111736,111856,112096,112152,112224,112252,112320,112440,112514,112516,112520,112528,112542,112544,112588,112686,112718,112732,112782,112796,112824,112834,112836,112840,112848,112870,112890,112910,112924,112952,113008,113022,113026,113028,113032,113040,113054,113056,113100,113138,113140,113166,113180,113208,113264,113278,113376,113404,113416,113424,113440,113468,113472,113560,113614,113634,113636,113640,113686,113702,113708,113734,113740,113752,113778,113780,113798,113804,113816,113840,113854,113870,113890,113892,113896,113926,113932,113944,113968,113982,114016,114044,114076,114114,114116,114120,114128,114150,114170,114194,114196,114210,114212,114216,114242,114244,114248,114256,114270,114278,114306,114308,114312,114320,114334,114336,114364,114380,114420,114458,114478,114482,114484,114510,114524,114530,114532,114536,114842,114866,114868,114970,114994,114996,115042,115044,115048,115062,115130,115226,115250,115252,115278,115292,115298,115300,115304,115318,115342,115394,115396,115400,115408,115422,115430,115436,115450,115478,115494,115514,115526,115532,115570,115572,115738,115758,115762,115764,115790,115804,115810,115812,115816,115830,115854,115868,115896,115906,115912,115920,115934,115942,115948,115962,115996,116024,116080,116094,116098,116100,116104,116112,116126,116128,116156,116166,116172,116184,116206,116210,116212,116246,116262,116268,116282,116294,116300,116312,116334,116338,116340,116358,116364,116376,116400,116414,116430,116444,116450,116452,116456,116498,116500,116514,116520,116534,116546,116548,116552,116560,116574,116582,116588,116602,116654,116694,116714,116762,116782,116786,116788,116814,116828,116834,116836,116840,116854,116878,116892,116920,116930,116936,116944,116958,116966,116972,116986,117006,117048,117104,117118,117122,117124,117136,117150,117152,117180,117190,117196,117208,117230,117234,117236,117304,117360,117374,117472,117500,117506,117508,117512,117520,117536,117564,117568,117624,117638,117644,117656,117680,117694,117710,117724,117730,117732,117736,117750,117782,117798,117804,117818,117830,117848,117874,117876,117894,117936,117950,117966,117986,117988,117992,118022,118028,118040,118064,118078,118112,118140,118172,118210,118212,118216,118224,118238,118246,118266,118306,118312,118338,118352,118366,118374,118394,118402,118404,118408,118416,118430,118432,118460,118476,118514,118516,118574,118578,118580,118606,118620,118626,118628,118632,118678,118694,118700,118730,118738,118740,118830,118834,118836,118862,118876,118882,118884,118888,118902,118926,118940,118968,118978,118980,118984,118992,119006,119014,119020,119034,119068,119096,119152,119166,119170,119172,119176,119184,119198,119200,119228,119238,119244,119256,119278,119282,119284,119324,119352,119408,119422,119520,119548,119554,119556,119560,119568,119582,119584,119612,119616,119672,119686,119692,119704,119728,119742,119758,119772,119778,119780,119784,119798,119920,119934,120032,120060,120256,120312,120324,120328,120336,120352,120384,120440,120560,120582,120588,120600,120624,120638,120672,120700,120718,120732,120760,120770,120772,120776,120784,120798,120806,120812,120870,120876,120890,120902,120908,120920,120946,120948,120966,120972,120984,121008,121022,121038,121058,121060,121064,121078,121100,121112,121136,121150,121184,121212,121244,121282,121284,121288,121296,121318,121338,121356,121368,121392,121406,121440,121468,121536,121592,121656,121730,121732,121736,121744,121758,121760,121804,121842,121844,121890,121922,121924,121928,121936,121950,121958,121978,121986,121988,121992,122e3,122014,122016,122044,122060,122098,122100,122116,122120,122128,122142,122144,122172,122176,122232,122246,122264,122318,122338,122340,122344,122414,122418,122420,122446,122460,122466,122468,122472,122510,122524,122552,122562,122564,122568,122576,122598,122618,122646,122662,122668,122694,122700,122712,122738,122740,122762,122770,122772,122786,122788,122792,123018,123026,123028,123042,123044,123048,123062,123098,123146,123154,123156,123170,123172,123176,123190,123202,123204,123208,123216,123238,123244,123258,123290,123314,123316,123402,123410,123412,123426,123428,123432,123446,123458,123464,123472,123486,123494,123500,123514,123522,123524,123528,123536,123552,123580,123590,123596,123608,123630,123634,123636,123674,123698,123700,123740,123746,123748,123752,123834,123914,123922,123924,123938,123944,123958,123970,123976,123984,123998,124006,124012,124026,124034,124036,124048,124062,124064,124092,124102,124108,124120,124142,124146,124148,124162,124164,124168,124176,124190,124192,124220,124224,124280,124294,124300,124312,124336,124350,124366,124380,124386,124388,124392,124406,124442,124462,124466,124468,124494,124508,124514,124520,124558,124572,124600,124610,124612,124616,124624,124646,124666,124694,124710,124716,124730,124742,124748,124760,124786,124788,124818,124820,124834,124836,124840,124854,124946,124948,124962,124964,124968,124982,124994,124996,125e3,125008,125022,125030,125036,125050,125058,125060,125064,125072,125086,125088,125116,125126,125132,125144,125166,125170,125172,125186,125188,125192,125200,125216,125244,125248,125304,125318,125324,125336,125360,125374,125390,125404,125410,125412,125416,125430,125444,125448,125456,125472,125504,125560,125680,125702,125708,125720,125744,125758,125792,125820,125838,125852,125880,125890,125892,125896,125904,125918,125926,125932,125978,125998,126002,126004,126030,126044,126050,126052,126056,126094,126108,126136,126146,126148,126152,126160,126182,126202,126222,126236,126264,126320,126334,126338,126340,126344,126352,126366,126368,126412,126450,126452,126486,126502,126508,126522,126534,126540,126552,126574,126578,126580,126598,126604,126616,126640,126654,126670,126684,126690,126692,126696,126738,126754,126756,126760,126774,126786,126788,126792,126800,126814,126822,126828,126842,126894,126898,126900,126934,127126,127142,127148,127162,127178,127186,127188,127254,127270,127276,127290,127302,127308,127320,127342,127346,127348,127370,127378,127380,127394,127396,127400,127450,127510,127526,127532,127546,127558,127576,127598,127602,127604,127622,127628,127640,127664,127678,127694,127708,127714,127716,127720,127734,127754,127762,127764,127778,127784,127810,127812,127816,127824,127838,127846,127866,127898,127918,127922,127924,128022,128038,128044,128058,128070,128076,128088,128110,128114,128116,128134,128140,128152,128176,128190,128206,128220,128226,128228,128232,128246,128262,128268,128280,128304,128318,128352,128380,128398,128412,128440,128450,128452,128456,128464,128478,128486,128492,128506,128522,128530,128532,128546,128548,128552,128566,128578,128580,128584,128592,128606,128614,128634,128642,128644,128648,128656,128670,128672,128700,128716,128754,128756,128794,128814,128818,128820,128846,128860,128866,128868,128872,128886,128918,128934,128940,128954,128978,128980,129178,129198,129202,129204,129238,129258,129306,129326,129330,129332,129358,129372,129378,129380,129384,129398,129430,129446,129452,129466,129482,129490,129492,129562,129582,129586,129588,129614,129628,129634,129636,129640,129654,129678,129692,129720,129730,129732,129736,129744,129758,129766,129772,129814,129830,129836,129850,129862,129868,129880,129902,129906,129908,129930,129938,129940,129954,129956,129960,129974,130010]),t.CODEWORD_TABLE=Int32Array.from([2627,1819,2622,2621,1813,1812,2729,2724,2723,2779,2774,2773,902,896,908,868,865,861,859,2511,873,871,1780,835,2493,825,2491,842,837,844,1764,1762,811,810,809,2483,807,2482,806,2480,815,814,813,812,2484,817,816,1745,1744,1742,1746,2655,2637,2635,2626,2625,2623,2628,1820,2752,2739,2737,2728,2727,2725,2730,2785,2783,2778,2777,2775,2780,787,781,747,739,736,2413,754,752,1719,692,689,681,2371,678,2369,700,697,694,703,1688,1686,642,638,2343,631,2341,627,2338,651,646,643,2345,654,652,1652,1650,1647,1654,601,599,2322,596,2321,594,2319,2317,611,610,608,606,2324,603,2323,615,614,612,1617,1616,1614,1612,616,1619,1618,2575,2538,2536,905,901,898,909,2509,2507,2504,870,867,864,860,2512,875,872,1781,2490,2489,2487,2485,1748,836,834,832,830,2494,827,2492,843,841,839,845,1765,1763,2701,2676,2674,2653,2648,2656,2634,2633,2631,2629,1821,2638,2636,2770,2763,2761,2750,2745,2753,2736,2735,2733,2731,1848,2740,2738,2786,2784,591,588,576,569,566,2296,1590,537,534,526,2276,522,2274,545,542,539,548,1572,1570,481,2245,466,2242,462,2239,492,485,482,2249,496,494,1534,1531,1528,1538,413,2196,406,2191,2188,425,419,2202,415,2199,432,430,427,1472,1467,1464,433,1476,1474,368,367,2160,365,2159,362,2157,2155,2152,378,377,375,2166,372,2165,369,2162,383,381,379,2168,1419,1418,1416,1414,385,1411,384,1423,1422,1420,1424,2461,802,2441,2439,790,786,783,794,2409,2406,2403,750,742,738,2414,756,753,1720,2367,2365,2362,2359,1663,693,691,684,2373,680,2370,702,699,696,704,1690,1687,2337,2336,2334,2332,1624,2329,1622,640,637,2344,634,2342,630,2340,650,648,645,2346,655,653,1653,1651,1649,1655,2612,2597,2595,2571,2568,2565,2576,2534,2529,2526,1787,2540,2537,907,904,900,910,2503,2502,2500,2498,1768,2495,1767,2510,2508,2506,869,866,863,2513,876,874,1782,2720,2713,2711,2697,2694,2691,2702,2672,2670,2664,1828,2678,2675,2647,2646,2644,2642,1823,2639,1822,2654,2652,2650,2657,2771,1855,2765,2762,1850,1849,2751,2749,2747,2754,353,2148,344,342,336,2142,332,2140,345,1375,1373,306,2130,299,2128,295,2125,319,314,311,2132,1354,1352,1349,1356,262,257,2101,253,2096,2093,274,273,267,2107,263,2104,280,278,275,1316,1311,1308,1320,1318,2052,202,2050,2044,2040,219,2063,212,2060,208,2055,224,221,2066,1260,1258,1252,231,1248,229,1266,1264,1261,1268,155,1998,153,1996,1994,1991,1988,165,164,2007,162,2006,159,2003,2e3,172,171,169,2012,166,2010,1186,1184,1182,1179,175,1176,173,1192,1191,1189,1187,176,1194,1193,2313,2307,2305,592,589,2294,2292,2289,578,572,568,2297,580,1591,2272,2267,2264,1547,538,536,529,2278,525,2275,547,544,541,1574,1571,2237,2235,2229,1493,2225,1489,478,2247,470,2244,465,2241,493,488,484,2250,498,495,1536,1533,1530,1539,2187,2186,2184,2182,1432,2179,1430,2176,1427,414,412,2197,409,2195,405,2193,2190,426,424,421,2203,418,2201,431,429,1473,1471,1469,1466,434,1477,1475,2478,2472,2470,2459,2457,2454,2462,803,2437,2432,2429,1726,2443,2440,792,789,785,2401,2399,2393,1702,2389,1699,2411,2408,2405,745,741,2415,758,755,1721,2358,2357,2355,2353,1661,2350,1660,2347,1657,2368,2366,2364,2361,1666,690,687,2374,683,2372,701,698,705,1691,1689,2619,2617,2610,2608,2605,2613,2593,2588,2585,1803,2599,2596,2563,2561,2555,1797,2551,1795,2573,2570,2567,2577,2525,2524,2522,2520,1786,2517,1785,2514,1783,2535,2533,2531,2528,1788,2541,2539,906,903,911,2721,1844,2715,2712,1838,1836,2699,2696,2693,2703,1827,1826,1824,2673,2671,2669,2666,1829,2679,2677,1858,1857,2772,1854,1853,1851,1856,2766,2764,143,1987,139,1986,135,133,131,1984,128,1983,125,1981,138,137,136,1985,1133,1132,1130,112,110,1974,107,1973,104,1971,1969,122,121,119,117,1977,114,1976,124,1115,1114,1112,1110,1117,1116,84,83,1953,81,1952,78,1950,1948,1945,94,93,91,1959,88,1958,85,1955,99,97,95,1961,1086,1085,1083,1081,1078,100,1090,1089,1087,1091,49,47,1917,44,1915,1913,1910,1907,59,1926,56,1925,53,1922,1919,66,64,1931,61,1929,1042,1040,1038,71,1035,70,1032,68,1048,1047,1045,1043,1050,1049,12,10,1869,1867,1864,1861,21,1880,19,1877,1874,1871,28,1888,25,1886,22,1883,982,980,977,974,32,30,991,989,987,984,34,995,994,992,2151,2150,2147,2146,2144,356,355,354,2149,2139,2138,2136,2134,1359,343,341,338,2143,335,2141,348,347,346,1376,1374,2124,2123,2121,2119,1326,2116,1324,310,308,305,2131,302,2129,298,2127,320,318,316,313,2133,322,321,1355,1353,1351,1357,2092,2091,2089,2087,1276,2084,1274,2081,1271,259,2102,256,2100,252,2098,2095,272,269,2108,266,2106,281,279,277,1317,1315,1313,1310,282,1321,1319,2039,2037,2035,2032,1203,2029,1200,1197,207,2053,205,2051,201,2049,2046,2043,220,218,2064,215,2062,211,2059,228,226,223,2069,1259,1257,1254,232,1251,230,1267,1265,1263,2316,2315,2312,2311,2309,2314,2304,2303,2301,2299,1593,2308,2306,590,2288,2287,2285,2283,1578,2280,1577,2295,2293,2291,579,577,574,571,2298,582,581,1592,2263,2262,2260,2258,1545,2255,1544,2252,1541,2273,2271,2269,2266,1550,535,532,2279,528,2277,546,543,549,1575,1573,2224,2222,2220,1486,2217,1485,2214,1482,1479,2238,2236,2234,2231,1496,2228,1492,480,477,2248,473,2246,469,2243,490,487,2251,497,1537,1535,1532,2477,2476,2474,2479,2469,2468,2466,2464,1730,2473,2471,2453,2452,2450,2448,1729,2445,1728,2460,2458,2456,2463,805,804,2428,2427,2425,2423,1725,2420,1724,2417,1722,2438,2436,2434,2431,1727,2444,2442,793,791,788,795,2388,2386,2384,1697,2381,1696,2378,1694,1692,2402,2400,2398,2395,1703,2392,1701,2412,2410,2407,751,748,744,2416,759,757,1807,2620,2618,1806,1805,2611,2609,2607,2614,1802,1801,1799,2594,2592,2590,2587,1804,2600,2598,1794,1793,1791,1789,2564,2562,2560,2557,1798,2554,1796,2574,2572,2569,2578,1847,1846,2722,1843,1842,1840,1845,2716,2714,1835,1834,1832,1830,1839,1837,2700,2698,2695,2704,1817,1811,1810,897,862,1777,829,826,838,1760,1758,808,2481,1741,1740,1738,1743,2624,1818,2726,2776,782,740,737,1715,686,679,695,1682,1680,639,628,2339,647,644,1645,1643,1640,1648,602,600,597,595,2320,593,2318,609,607,604,1611,1610,1608,1606,613,1615,1613,2328,926,924,892,886,899,857,850,2505,1778,824,823,821,819,2488,818,2486,833,831,828,840,1761,1759,2649,2632,2630,2746,2734,2732,2782,2781,570,567,1587,531,527,523,540,1566,1564,476,467,463,2240,486,483,1524,1521,1518,1529,411,403,2192,399,2189,423,416,1462,1457,1454,428,1468,1465,2210,366,363,2158,360,2156,357,2153,376,373,370,2163,1410,1409,1407,1405,382,1402,380,1417,1415,1412,1421,2175,2174,777,774,771,784,732,725,722,2404,743,1716,676,674,668,2363,665,2360,685,1684,1681,626,624,622,2335,620,2333,617,2330,641,635,649,1646,1644,1642,2566,928,925,2530,2527,894,891,888,2501,2499,2496,858,856,854,851,1779,2692,2668,2665,2645,2643,2640,2651,2768,2759,2757,2744,2743,2741,2748,352,1382,340,337,333,1371,1369,307,300,296,2126,315,312,1347,1342,1350,261,258,250,2097,246,2094,271,268,264,1306,1301,1298,276,1312,1309,2115,203,2048,195,2045,191,2041,213,209,2056,1246,1244,1238,225,1234,222,1256,1253,1249,1262,2080,2079,154,1997,150,1995,147,1992,1989,163,160,2004,156,2001,1175,1174,1172,1170,1167,170,1164,167,1185,1183,1180,1177,174,1190,1188,2025,2024,2022,587,586,564,559,556,2290,573,1588,520,518,512,2268,508,2265,530,1568,1565,461,457,2233,450,2230,446,2226,479,471,489,1526,1523,1520,397,395,2185,392,2183,389,2180,2177,410,2194,402,422,1463,1461,1459,1456,1470,2455,799,2433,2430,779,776,773,2397,2394,2390,734,728,724,746,1717,2356,2354,2351,2348,1658,677,675,673,670,667,688,1685,1683,2606,2589,2586,2559,2556,2552,927,2523,2521,2518,2515,1784,2532,895,893,890,2718,2709,2707,2689,2687,2684,2663,2662,2660,2658,1825,2667,2769,1852,2760,2758,142,141,1139,1138,134,132,129,126,1982,1129,1128,1126,1131,113,111,108,105,1972,101,1970,120,118,115,1109,1108,1106,1104,123,1113,1111,82,79,1951,75,1949,72,1946,92,89,86,1956,1077,1076,1074,1072,98,1069,96,1084,1082,1079,1088,1968,1967,48,45,1916,42,1914,39,1911,1908,60,57,54,1923,50,1920,1031,1030,1028,1026,67,1023,65,1020,62,1041,1039,1036,1033,69,1046,1044,1944,1943,1941,11,9,1868,7,1865,1862,1859,20,1878,16,1875,13,1872,970,968,966,963,29,960,26,23,983,981,978,975,33,971,31,990,988,985,1906,1904,1902,993,351,2145,1383,331,330,328,326,2137,323,2135,339,1372,1370,294,293,291,289,2122,286,2120,283,2117,309,303,317,1348,1346,1344,245,244,242,2090,239,2088,236,2085,2082,260,2099,249,270,1307,1305,1303,1300,1314,189,2038,186,2036,183,2033,2030,2026,206,198,2047,194,216,1247,1245,1243,1240,227,1237,1255,2310,2302,2300,2286,2284,2281,565,563,561,558,575,1589,2261,2259,2256,2253,1542,521,519,517,514,2270,511,533,1569,1567,2223,2221,2218,2215,1483,2211,1480,459,456,453,2232,449,474,491,1527,1525,1522,2475,2467,2465,2451,2449,2446,801,800,2426,2424,2421,2418,1723,2435,780,778,775,2387,2385,2382,2379,1695,2375,1693,2396,735,733,730,727,749,1718,2616,2615,2604,2603,2601,2584,2583,2581,2579,1800,2591,2550,2549,2547,2545,1792,2542,1790,2558,929,2719,1841,2710,2708,1833,1831,2690,2688,2686,1815,1809,1808,1774,1756,1754,1737,1736,1734,1739,1816,1711,1676,1674,633,629,1638,1636,1633,1641,598,1605,1604,1602,1600,605,1609,1607,2327,887,853,1775,822,820,1757,1755,1584,524,1560,1558,468,464,1514,1511,1508,1519,408,404,400,1452,1447,1444,417,1458,1455,2208,364,361,358,2154,1401,1400,1398,1396,374,1393,371,1408,1406,1403,1413,2173,2172,772,726,723,1712,672,669,666,682,1678,1675,625,623,621,618,2331,636,632,1639,1637,1635,920,918,884,880,889,849,848,847,846,2497,855,852,1776,2641,2742,2787,1380,334,1367,1365,301,297,1340,1338,1335,1343,255,251,247,1296,1291,1288,265,1302,1299,2113,204,196,192,2042,1232,1230,1224,214,1220,210,1242,1239,1235,1250,2077,2075,151,148,1993,144,1990,1163,1162,1160,1158,1155,161,1152,157,1173,1171,1168,1165,168,1181,1178,2021,2020,2018,2023,585,560,557,1585,516,509,1562,1559,458,447,2227,472,1516,1513,1510,398,396,393,390,2181,386,2178,407,1453,1451,1449,1446,420,1460,2209,769,764,720,712,2391,729,1713,664,663,661,659,2352,656,2349,671,1679,1677,2553,922,919,2519,2516,885,883,881,2685,2661,2659,2767,2756,2755,140,1137,1136,130,127,1125,1124,1122,1127,109,106,102,1103,1102,1100,1098,116,1107,1105,1980,80,76,73,1947,1068,1067,1065,1063,90,1060,87,1075,1073,1070,1080,1966,1965,46,43,40,1912,36,1909,1019,1018,1016,1014,58,1011,55,1008,51,1029,1027,1024,1021,63,1037,1034,1940,1939,1937,1942,8,1866,4,1863,1,1860,956,954,952,949,946,17,14,969,967,964,961,27,957,24,979,976,972,1901,1900,1898,1896,986,1905,1903,350,349,1381,329,327,324,1368,1366,292,290,287,284,2118,304,1341,1339,1337,1345,243,240,237,2086,233,2083,254,1297,1295,1293,1290,1304,2114,190,187,184,2034,180,2031,177,2027,199,1233,1231,1229,1226,217,1223,1241,2078,2076,584,555,554,552,550,2282,562,1586,507,506,504,502,2257,499,2254,515,1563,1561,445,443,441,2219,438,2216,435,2212,460,454,475,1517,1515,1512,2447,798,797,2422,2419,770,768,766,2383,2380,2376,721,719,717,714,731,1714,2602,2582,2580,2548,2546,2543,923,921,2717,2706,2705,2683,2682,2680,1771,1752,1750,1733,1732,1731,1735,1814,1707,1670,1668,1631,1629,1626,1634,1599,1598,1596,1594,1603,1601,2326,1772,1753,1751,1581,1554,1552,1504,1501,1498,1509,1442,1437,1434,401,1448,1445,2206,1392,1391,1389,1387,1384,359,1399,1397,1394,1404,2171,2170,1708,1672,1669,619,1632,1630,1628,1773,1378,1363,1361,1333,1328,1336,1286,1281,1278,248,1292,1289,2111,1218,1216,1210,197,1206,193,1228,1225,1221,1236,2073,2071,1151,1150,1148,1146,152,1143,149,1140,145,1161,1159,1156,1153,158,1169,1166,2017,2016,2014,2019,1582,510,1556,1553,452,448,1506,1500,394,391,387,1443,1441,1439,1436,1450,2207,765,716,713,1709,662,660,657,1673,1671,916,914,879,878,877,882,1135,1134,1121,1120,1118,1123,1097,1096,1094,1092,103,1101,1099,1979,1059,1058,1056,1054,77,1051,74,1066,1064,1061,1071,1964,1963,1007,1006,1004,1002,999,41,996,37,1017,1015,1012,1009,52,1025,1022,1936,1935,1933,1938,942,940,938,935,932,5,2,955,953,950,947,18,943,15,965,962,958,1895,1894,1892,1890,973,1899,1897,1379,325,1364,1362,288,285,1334,1332,1330,241,238,234,1287,1285,1283,1280,1294,2112,188,185,181,178,2028,1219,1217,1215,1212,200,1209,1227,2074,2072,583,553,551,1583,505,503,500,513,1557,1555,444,442,439,436,2213,455,451,1507,1505,1502,796,763,762,760,767,711,710,708,706,2377,718,715,1710,2544,917,915,2681,1627,1597,1595,2325,1769,1749,1747,1499,1438,1435,2204,1390,1388,1385,1395,2169,2167,1704,1665,1662,1625,1623,1620,1770,1329,1282,1279,2109,1214,1207,1222,2068,2065,1149,1147,1144,1141,146,1157,1154,2013,2011,2008,2015,1579,1549,1546,1495,1487,1433,1431,1428,1425,388,1440,2205,1705,658,1667,1664,1119,1095,1093,1978,1057,1055,1052,1062,1962,1960,1005,1003,1e3,997,38,1013,1010,1932,1930,1927,1934,941,939,936,933,6,930,3,951,948,944,1889,1887,1884,1881,959,1893,1891,35,1377,1360,1358,1327,1325,1322,1331,1277,1275,1272,1269,235,1284,2110,1205,1204,1201,1198,182,1195,179,1213,2070,2067,1580,501,1551,1548,440,437,1497,1494,1490,1503,761,709,707,1706,913,912,2198,1386,2164,2161,1621,1766,2103,1208,2058,2054,1145,1142,2005,2002,1999,2009,1488,1429,1426,2200,1698,1659,1656,1975,1053,1957,1954,1001,998,1924,1921,1918,1928,937,934,931,1879,1876,1873,1870,945,1885,1882,1323,1273,1270,2105,1202,1199,1196,1211,2061,2057,1576,1543,1540,1484,1481,1478,1491,1700]),t}(),la=function(){function t(t,e){this.bits=t,this.points=e}return t.prototype.getBits=function(){return this.bits},t.prototype.getPoints=function(){return this.points},t}(),fa=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},da=function(){function t(){}return t.detectMultiple=function(e,r,n){var o=e.getBlackMatrix(),i=t.detect(n,o);return i.length||((o=o.clone()).rotate180(),i=t.detect(n,o)),new la(o,i)},t.detect=function(e,r){for(var n,o,i=new Array,a=0,s=0,c=!1;a<r.getHeight();){var u=t.findVertices(r,a,s);if(null!=u[0]||null!=u[3]){if(c=!0,i.push(u),!e)break;null!=u[2]?(s=Math.trunc(u[2].getX()),a=Math.trunc(u[2].getY())):(s=Math.trunc(u[4].getX()),a=Math.trunc(u[4].getY()))}else{if(!c)break;c=!1,s=0;try{for(var l=(n=void 0,fa(i)),f=l.next();!f.done;f=l.next()){var d=f.value;null!=d[1]&&(a=Math.trunc(Math.max(a,d[1].getY()))),null!=d[3]&&(a=Math.max(a,Math.trunc(d[3].getY())))}}catch(h){n={error:h}}finally{try{f&&!f.done&&(o=l.return)&&o.call(l)}finally{if(n)throw n.error}}a+=t.ROW_STEP}}return i},t.findVertices=function(e,r,n){var o=e.getHeight(),i=e.getWidth(),a=new Array(8);return t.copyToResult(a,t.findRowsWithPattern(e,o,i,r,n,t.START_PATTERN),t.INDEXES_START_PATTERN),null!=a[4]&&(n=Math.trunc(a[4].getX()),r=Math.trunc(a[4].getY())),t.copyToResult(a,t.findRowsWithPattern(e,o,i,r,n,t.STOP_PATTERN),t.INDEXES_STOP_PATTERN),a},t.copyToResult=function(t,e,r){for(var n=0;n<r.length;n++)t[r[n]]=e[n]},t.findRowsWithPattern=function(e,r,n,o,i,a){for(var s=new Array(4),c=!1,u=new Int32Array(a.length);o<r;o+=t.ROW_STEP)if(null!=(h=t.findGuardPattern(e,i,o,n,!1,a,u))){for(;o>0;){if(null==(d=t.findGuardPattern(e,i,--o,n,!1,a,u))){o++;break}h=d}s[0]=new Rn(h[0],o),s[1]=new Rn(h[1],o),c=!0;break}var l=o+1;if(c){for(var f=0,d=Int32Array.from([Math.trunc(s[0].getX()),Math.trunc(s[1].getX())]);l<r;l++){var h;if(null!=(h=t.findGuardPattern(e,d[0],l,n,!1,a,u))&&Math.abs(d[0]-h[0])<t.MAX_PATTERN_DRIFT&&Math.abs(d[1]-h[1])<t.MAX_PATTERN_DRIFT)d=h,f=0;else{if(f>t.SKIPPED_ROW_COUNT_MAX)break;f++}}l-=f+1,s[2]=new Rn(d[0],l),s[3]=new Rn(d[1],l)}return l-o<t.BARCODE_MIN_HEIGHT&&Mr.fill(s,null),s},t.findGuardPattern=function(e,r,n,o,i,a,s){Mr.fillWithin(s,0,s.length,0);for(var c=r,u=0;e.get(c,n)&&c>0&&u++<t.MAX_PIXEL_DRIFT;)c--;for(var l=c,f=0,d=a.length,h=i;l<o;l++)if(e.get(l,n)!==h)s[f]++;else{if(f===d-1){if(t.patternMatchVariance(s,a,t.MAX_INDIVIDUAL_VARIANCE)<t.MAX_AVG_VARIANCE)return new Int32Array([c,l]);c+=s[0]+s[1],Nr.arraycopy(s,2,s,0,f-1),s[f-1]=0,s[f]=0,f--}else f++;s[f]=1,h=!h}return f===d-1&&t.patternMatchVariance(s,a,t.MAX_INDIVIDUAL_VARIANCE)<t.MAX_AVG_VARIANCE?new Int32Array([c,l-1]):null},t.patternMatchVariance=function(t,e,r){for(var n=t.length,o=0,i=0,a=0;a<n;a++)o+=t[a],i+=e[a];if(o<i)return 1/0;var s=o/i;r*=s;for(var c=0,u=0;u<n;u++){var l=t[u],f=e[u]*s,d=l>f?l-f:f-l;if(d>r)return 1/0;c+=d}return c/o},t.INDEXES_START_PATTERN=Int32Array.from([0,4,1,5]),t.INDEXES_STOP_PATTERN=Int32Array.from([6,2,7,3]),t.MAX_AVG_VARIANCE=.42,t.MAX_INDIVIDUAL_VARIANCE=.8,t.START_PATTERN=Int32Array.from([8,1,1,1,1,1,1,3]),t.STOP_PATTERN=Int32Array.from([7,1,1,3,1,1,1,2,1]),t.MAX_PIXEL_DRIFT=3,t.MAX_PATTERN_DRIFT=5,t.SKIPPED_ROW_COUNT_MAX=25,t.ROW_STEP=5,t.BARCODE_MIN_HEIGHT=10,t}(),ha=function(){function t(t,e){if(0===e.length)throw new Er;this.field=t;var r=e.length;if(r>1&&0===e[0]){for(var n=1;n<r&&0===e[n];)n++;n===r?this.coefficients=new Int32Array([0]):(this.coefficients=new Int32Array(r-n),Nr.arraycopy(e,n,this.coefficients,0,this.coefficients.length))}else this.coefficients=e}return t.prototype.getCoefficients=function(){return this.coefficients},t.prototype.getDegree=function(){return this.coefficients.length-1},t.prototype.isZero=function(){return 0===this.coefficients[0]},t.prototype.getCoefficient=function(t){return this.coefficients[this.coefficients.length-1-t]},t.prototype.evaluateAt=function(t){var e,r;if(0===t)return this.getCoefficient(0);if(1===t){var n=0;try{for(var o=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}(this.coefficients),i=o.next();!i.done;i=o.next()){var a=i.value;n=this.field.add(n,a)}}catch(l){e={error:l}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(e)throw e.error}}return n}for(var s=this.coefficients[0],c=this.coefficients.length,u=1;u<c;u++)s=this.field.add(this.field.multiply(t,s),this.coefficients[u]);return s},t.prototype.add=function(e){if(!this.field.equals(e.field))throw new Er("ModulusPolys do not have same ModulusGF field");if(this.isZero())return e;if(e.isZero())return this;var r=this.coefficients,n=e.coefficients;if(r.length>n.length){var o=r;r=n,n=o}var i=new Int32Array(n.length),a=n.length-r.length;Nr.arraycopy(n,0,i,0,a);for(var s=a;s<n.length;s++)i[s]=this.field.add(r[s-a],n[s]);return new t(this.field,i)},t.prototype.subtract=function(t){if(!this.field.equals(t.field))throw new Er("ModulusPolys do not have same ModulusGF field");return t.isZero()?this:this.add(t.negative())},t.prototype.multiply=function(e){return e instanceof t?this.multiplyOther(e):this.multiplyScalar(e)},t.prototype.multiplyOther=function(e){if(!this.field.equals(e.field))throw new Er("ModulusPolys do not have same ModulusGF field");if(this.isZero()||e.isZero())return new t(this.field,new Int32Array([0]));for(var r=this.coefficients,n=r.length,o=e.coefficients,i=o.length,a=new Int32Array(n+i-1),s=0;s<n;s++)for(var c=r[s],u=0;u<i;u++)a[s+u]=this.field.add(a[s+u],this.field.multiply(c,o[u]));return new t(this.field,a)},t.prototype.negative=function(){for(var e=this.coefficients.length,r=new Int32Array(e),n=0;n<e;n++)r[n]=this.field.subtract(0,this.coefficients[n]);return new t(this.field,r)},t.prototype.multiplyScalar=function(e){if(0===e)return new t(this.field,new Int32Array([0]));if(1===e)return this;for(var r=this.coefficients.length,n=new Int32Array(r),o=0;o<r;o++)n[o]=this.field.multiply(this.coefficients[o],e);return new t(this.field,n)},t.prototype.multiplyByMonomial=function(e,r){if(e<0)throw new Er;if(0===r)return new t(this.field,new Int32Array([0]));for(var n=this.coefficients.length,o=new Int32Array(n+e),i=0;i<n;i++)o[i]=this.field.multiply(this.coefficients[i],r);return new t(this.field,o)},t.prototype.toString=function(){for(var t=new $r,e=this.getDegree();e>=0;e--){var r=this.getCoefficient(e);0!==r&&(r<0?(t.append(" - "),r=-r):t.length()>0&&t.append(" + "),0!==e&&1===r||t.append(r),0!==e&&(1===e?t.append("x"):(t.append("x^"),t.append(e))))}return t.toString()},t}(),pa=function(){function t(){}return t.prototype.add=function(t,e){return(t+e)%this.modulus},t.prototype.subtract=function(t,e){return(this.modulus+t-e)%this.modulus},t.prototype.exp=function(t){return this.expTable[t]},t.prototype.log=function(t){if(0===t)throw new Er;return this.logTable[t]},t.prototype.inverse=function(t){if(0===t)throw new wn;return this.expTable[this.modulus-this.logTable[t]-1]},t.prototype.multiply=function(t,e){return 0===t||0===e?0:this.expTable[(this.logTable[t]+this.logTable[e])%(this.modulus-1)]},t.prototype.getSize=function(){return this.modulus},t.prototype.equals=function(t){return t===this},t}(),ga=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),ma=function(t){function e(e,r){var n=t.call(this)||this;n.modulus=e,n.expTable=new Int32Array(e),n.logTable=new Int32Array(e);for(var o=1,i=0;i<e;i++)n.expTable[i]=o,o=o*r%e;for(i=0;i<e-1;i++)n.logTable[n.expTable[i]]=i;return n.zero=new ha(n,new Int32Array([0])),n.one=new ha(n,new Int32Array([1])),n}return ga(e,t),e.prototype.getZero=function(){return this.zero},e.prototype.getOne=function(){return this.one},e.prototype.buildMonomial=function(t,e){if(t<0)throw new Er;if(0===e)return this.zero;var r=new Int32Array(t+1);return r[0]=e,new ha(this,r)},e.PDF417_GF=new e(ua.NUMBER_OF_CODEWORDS,3),e}(pa),va=function(){function t(){this.field=ma.PDF417_GF}return t.prototype.decode=function(t,e,r){for(var n,o,i=new ha(this.field,t),a=new Int32Array(e),s=!1,c=e;c>0;c--){var u=i.evaluateAt(this.field.exp(c));a[e-c]=u,0!==u&&(s=!0)}if(!s)return 0;var l=this.field.getOne();if(null!=r)try{for(var f=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}(r),d=f.next();!d.done;d=f.next()){var h=d.value,p=this.field.exp(t.length-1-h),g=new ha(this.field,new Int32Array([this.field.subtract(0,p),1]));l=l.multiply(g)}}catch(A){n={error:A}}finally{try{d&&!d.done&&(o=f.return)&&o.call(f)}finally{if(n)throw n.error}}var m=new ha(this.field,a),v=this.runEuclideanAlgorithm(this.field.buildMonomial(e,1),m,e),y=v[0],_=v[1],w=this.findErrorLocations(y),b=this.findErrorMagnitudes(_,y,w);for(c=0;c<w.length;c++){var C=t.length-1-this.field.log(w[c]);if(C<0)throw Or.getChecksumInstance();t[C]=this.field.subtract(t[C],b[c])}return w.length},t.prototype.runEuclideanAlgorithm=function(t,e,r){if(t.getDegree()<e.getDegree()){var n=t;t=e,e=n}for(var o=t,i=e,a=this.field.getZero(),s=this.field.getOne();i.getDegree()>=Math.round(r/2);){var c=o,u=a;if(a=s,(o=i).isZero())throw Or.getChecksumInstance();i=c;for(var l=this.field.getZero(),f=o.getCoefficient(o.getDegree()),d=this.field.inverse(f);i.getDegree()>=o.getDegree()&&!i.isZero();){var h=i.getDegree()-o.getDegree(),p=this.field.multiply(i.getCoefficient(i.getDegree()),d);l=l.add(this.field.buildMonomial(h,p)),i=i.subtract(o.multiplyByMonomial(h,p))}s=l.multiply(a).subtract(u).negative()}var g=s.getCoefficient(0);if(0===g)throw Or.getChecksumInstance();var m=this.field.inverse(g);return[s.multiply(m),i.multiply(m)]},t.prototype.findErrorLocations=function(t){for(var e=t.getDegree(),r=new Int32Array(e),n=0,o=1;o<this.field.getSize()&&n<e;o++)0===t.evaluateAt(o)&&(r[n]=this.field.inverse(o),n++);if(n!==e)throw Or.getChecksumInstance();return r},t.prototype.findErrorMagnitudes=function(t,e,r){for(var n=e.getDegree(),o=new Int32Array(n),i=1;i<=n;i++)o[n-i]=this.field.multiply(i,e.getCoefficient(i));var a=new ha(this.field,o),s=r.length,c=new Int32Array(s);for(i=0;i<s;i++){var u=this.field.inverse(r[i]),l=this.field.subtract(0,t.evaluateAt(u)),f=this.field.inverse(a.evaluateAt(u));c[i]=this.field.multiply(l,f)}return c},t}(),ya=function(){function t(e,r,n,o,i){e instanceof t?this.constructor_2(e):this.constructor_1(e,r,n,o,i)}return t.prototype.constructor_1=function(t,e,r,n,o){var i=null==e||null==r,a=null==n||null==o;if(i&&a)throw new Kr;i?(e=new Rn(0,n.getY()),r=new Rn(0,o.getY())):a&&(n=new Rn(t.getWidth()-1,e.getY()),o=new Rn(t.getWidth()-1,r.getY())),this.image=t,this.topLeft=e,this.bottomLeft=r,this.topRight=n,this.bottomRight=o,this.minX=Math.trunc(Math.min(e.getX(),r.getX())),this.maxX=Math.trunc(Math.max(n.getX(),o.getX())),this.minY=Math.trunc(Math.min(e.getY(),n.getY())),this.maxY=Math.trunc(Math.max(r.getY(),o.getY()))},t.prototype.constructor_2=function(t){this.image=t.image,this.topLeft=t.getTopLeft(),this.bottomLeft=t.getBottomLeft(),this.topRight=t.getTopRight(),this.bottomRight=t.getBottomRight(),this.minX=t.getMinX(),this.maxX=t.getMaxX(),this.minY=t.getMinY(),this.maxY=t.getMaxY()},t.merge=function(e,r){return null==e?r:null==r?e:new t(e.image,e.topLeft,e.bottomLeft,r.topRight,r.bottomRight)},t.prototype.addMissingRows=function(e,r,n){var o=this.topLeft,i=this.bottomLeft,a=this.topRight,s=this.bottomRight;if(e>0){var c=n?this.topLeft:this.topRight,u=Math.trunc(c.getY()-e);u<0&&(u=0);var l=new Rn(c.getX(),u);n?o=l:a=l}if(r>0){var f=n?this.bottomLeft:this.bottomRight,d=Math.trunc(f.getY()+r);d>=this.image.getHeight()&&(d=this.image.getHeight()-1);var h=new Rn(f.getX(),d);n?i=h:s=h}return new t(this.image,o,i,a,s)},t.prototype.getMinX=function(){return this.minX},t.prototype.getMaxX=function(){return this.maxX},t.prototype.getMinY=function(){return this.minY},t.prototype.getMaxY=function(){return this.maxY},t.prototype.getTopLeft=function(){return this.topLeft},t.prototype.getTopRight=function(){return this.topRight},t.prototype.getBottomLeft=function(){return this.bottomLeft},t.prototype.getBottomRight=function(){return this.bottomRight},t}(),_a=function(){function t(t,e,r,n){this.columnCount=t,this.errorCorrectionLevel=n,this.rowCountUpperPart=e,this.rowCountLowerPart=r,this.rowCount=e+r}return t.prototype.getColumnCount=function(){return this.columnCount},t.prototype.getErrorCorrectionLevel=function(){return this.errorCorrectionLevel},t.prototype.getRowCount=function(){return this.rowCount},t.prototype.getRowCountUpperPart=function(){return this.rowCountUpperPart},t.prototype.getRowCountLowerPart=function(){return this.rowCountLowerPart},t}(),wa=function(){function t(){this.buffer=""}return t.form=function(t,e){var r=-1;return t.replace(/%(-)?(0?[0-9]+)?([.][0-9]+)?([#][0-9]+)?([scfpexd%])/g,function(t,n,o,i,a,s){if("%%"===t)return"%";if(void 0!==e[++r]){t=i?parseInt(i.substr(1)):void 0;var c,u=a?parseInt(a.substr(1)):void 0;switch(s){case"s":c=e[r];break;case"c":c=e[r][0];break;case"f":c=parseFloat(e[r]).toFixed(t);break;case"p":c=parseFloat(e[r]).toPrecision(t);break;case"e":c=parseFloat(e[r]).toExponential(t);break;case"x":c=parseInt(e[r]).toString(u||16);break;case"d":c=parseFloat(parseInt(e[r],u||10).toPrecision(t)).toFixed(0)}c="object"==typeof c?JSON.stringify(c):(+c).toString(u);for(var l=parseInt(o),f=o&&o[0]+""=="0"?"0":" ";c.length<l;)c=void 0!==n?c+f:f+c;return c}})},t.prototype.format=function(e){for(var r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];this.buffer+=t.form(e,r)},t.prototype.toString=function(){return this.buffer},t}(),ba=function(){function t(t){this.boundingBox=new ya(t),this.codewords=new Array(t.getMaxY()-t.getMinY()+1)}return t.prototype.getCodewordNearby=function(e){var r=this.getCodeword(e);if(null!=r)return r;for(var n=1;n<t.MAX_NEARBY_DISTANCE;n++){var o=this.imageRowToCodewordIndex(e)-n;if(o>=0&&null!=(r=this.codewords[o]))return r;if((o=this.imageRowToCodewordIndex(e)+n)<this.codewords.length&&null!=(r=this.codewords[o]))return r}return null},t.prototype.imageRowToCodewordIndex=function(t){return t-this.boundingBox.getMinY()},t.prototype.setCodeword=function(t,e){this.codewords[this.imageRowToCodewordIndex(t)]=e},t.prototype.getCodeword=function(t){return this.codewords[this.imageRowToCodewordIndex(t)]},t.prototype.getBoundingBox=function(){return this.boundingBox},t.prototype.getCodewords=function(){return this.codewords},t.prototype.toString=function(){var t,e,r=new wa,n=0;try{for(var o=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}(this.codewords),i=o.next();!i.done;i=o.next()){var a=i.value;null!=a?r.format("%3d: %3d|%3d%n",n++,a.getRowNumber(),a.getValue()):r.format("%3d: | %n",n++)}}catch(s){t={error:s}}finally{try{i&&!i.done&&(e=o.return)&&e.call(o)}finally{if(t)throw t.error}}return r.toString()},t.MAX_NEARBY_DISTANCE=5,t}(),Ca=function(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var n,o,i=r.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(n=i.next()).done;)a.push(n.value)}catch(s){o={error:s}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a},Aa=function(){function t(){this.values=new Map}return t.prototype.setValue=function(t){t=Math.trunc(t);var e=this.values.get(t);null==e&&(e=0),e++,this.values.set(t,e)},t.prototype.getValue=function(){var t,e,r=-1,n=new Array,o=function(t,e){var o=function(){return t},i=function(){return e};i()>r?(r=i(),(n=[]).push(o())):i()===r&&n.push(o())};try{for(var i=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}(this.values.entries()),a=i.next();!a.done;a=i.next()){var s=Ca(a.value,2);o(s[0],s[1])}}catch(c){t={error:c}}finally{try{a&&!a.done&&(e=i.return)&&e.call(i)}finally{if(t)throw t.error}}return ua.toIntArray(n)},t.prototype.getConfidence=function(t){return this.values.get(t)},t}(),Ea=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Ia=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Sa=function(t){function e(e,r){var n=t.call(this,e)||this;return n._isLeft=r,n}return Ea(e,t),e.prototype.setRowNumbers=function(){var t,e;try{for(var r=Ia(this.getCodewords()),n=r.next();!n.done;n=r.next()){var o=n.value;null!=o&&o.setRowNumberAsRowIndicatorColumn()}}catch(i){t={error:i}}finally{try{n&&!n.done&&(e=r.return)&&e.call(r)}finally{if(t)throw t.error}}},e.prototype.adjustCompleteIndicatorColumnRowNumbers=function(t){var e=this.getCodewords();this.setRowNumbers(),this.removeIncorrectCodewords(e,t);for(var r=this.getBoundingBox(),n=this._isLeft?r.getTopLeft():r.getTopRight(),o=this._isLeft?r.getBottomLeft():r.getBottomRight(),i=this.imageRowToCodewordIndex(Math.trunc(n.getY())),a=this.imageRowToCodewordIndex(Math.trunc(o.getY())),s=-1,c=1,u=0,l=i;l<a;l++)if(null!=e[l]){var f=e[l],d=f.getRowNumber()-s;if(0===d)u++;else if(1===d)c=Math.max(c,u),u=1,s=f.getRowNumber();else if(d<0||f.getRowNumber()>=t.getRowCount()||d>l)e[l]=null;else{for(var h,p=(h=c>2?(c-2)*d:d)>=l,g=1;g<=h&&!p;g++)p=null!=e[l-g];p?e[l]=null:(s=f.getRowNumber(),u=1)}}},e.prototype.getRowHeights=function(){var t,e,r=this.getBarcodeMetadata();if(null==r)return null;this.adjustIncompleteIndicatorColumnRowNumbers(r);var n=new Int32Array(r.getRowCount());try{for(var o=Ia(this.getCodewords()),i=o.next();!i.done;i=o.next()){var a=i.value;if(null!=a){var s=a.getRowNumber();if(s>=n.length)continue;n[s]++}}}catch(c){t={error:c}}finally{try{i&&!i.done&&(e=o.return)&&e.call(o)}finally{if(t)throw t.error}}return n},e.prototype.adjustIncompleteIndicatorColumnRowNumbers=function(t){for(var e=this.getBoundingBox(),r=this._isLeft?e.getTopLeft():e.getTopRight(),n=this._isLeft?e.getBottomLeft():e.getBottomRight(),o=this.imageRowToCodewordIndex(Math.trunc(r.getY())),i=this.imageRowToCodewordIndex(Math.trunc(n.getY())),a=this.getCodewords(),s=-1,c=o;c<i;c++)if(null!=a[c]){var u=a[c];u.setRowNumberAsRowIndicatorColumn();var l=u.getRowNumber()-s;0===l||(1===l?s=u.getRowNumber():u.getRowNumber()>=t.getRowCount()?a[c]=null:s=u.getRowNumber())}},e.prototype.getBarcodeMetadata=function(){var t,e,r=this.getCodewords(),n=new Aa,o=new Aa,i=new Aa,a=new Aa;try{for(var s=Ia(r),c=s.next();!c.done;c=s.next()){var u=c.value;if(null!=u){u.setRowNumberAsRowIndicatorColumn();var l=u.getValue()%30,f=u.getRowNumber();switch(this._isLeft||(f+=2),f%3){case 0:o.setValue(3*l+1);break;case 1:a.setValue(l/3),i.setValue(l%3);break;case 2:n.setValue(l+1)}}}}catch(h){t={error:h}}finally{try{c&&!c.done&&(e=s.return)&&e.call(s)}finally{if(t)throw t.error}}if(0===n.getValue().length||0===o.getValue().length||0===i.getValue().length||0===a.getValue().length||n.getValue()[0]<1||o.getValue()[0]+i.getValue()[0]<ua.MIN_ROWS_IN_BARCODE||o.getValue()[0]+i.getValue()[0]>ua.MAX_ROWS_IN_BARCODE)return null;var d=new _a(n.getValue()[0],o.getValue()[0],i.getValue()[0],a.getValue()[0]);return this.removeIncorrectCodewords(r,d),d},e.prototype.removeIncorrectCodewords=function(t,e){for(var r=0;r<t.length;r++){var n=t[r];if(null!=t[r]){var o=n.getValue()%30,i=n.getRowNumber();if(i>e.getRowCount())t[r]=null;else switch(this._isLeft||(i+=2),i%3){case 0:3*o+1!==e.getRowCountUpperPart()&&(t[r]=null);break;case 1:Math.trunc(o/3)===e.getErrorCorrectionLevel()&&o%3===e.getRowCountLowerPart()||(t[r]=null);break;case 2:o+1!==e.getColumnCount()&&(t[r]=null)}}}},e.prototype.isLeft=function(){return this._isLeft},e.prototype.toString=function(){return"IsLeft: "+this._isLeft+"\n"+t.prototype.toString.call(this)},e}(ba),Oa=function(){function t(t,e){this.ADJUST_ROW_NUMBER_SKIP=2,this.barcodeMetadata=t,this.barcodeColumnCount=t.getColumnCount(),this.boundingBox=e,this.detectionResultColumns=new Array(this.barcodeColumnCount+2)}return t.prototype.getDetectionResultColumns=function(){this.adjustIndicatorColumnRowNumbers(this.detectionResultColumns[0]),this.adjustIndicatorColumnRowNumbers(this.detectionResultColumns[this.barcodeColumnCount+1]);var t,e=ua.MAX_CODEWORDS_IN_BARCODE;do{t=e,e=this.adjustRowNumbersAndGetCount()}while(e>0&&e<t);return this.detectionResultColumns},t.prototype.adjustIndicatorColumnRowNumbers=function(t){null!=t&&t.adjustCompleteIndicatorColumnRowNumbers(this.barcodeMetadata)},t.prototype.adjustRowNumbersAndGetCount=function(){var t=this.adjustRowNumbersByRow();if(0===t)return 0;for(var e=1;e<this.barcodeColumnCount+1;e++)for(var r=this.detectionResultColumns[e].getCodewords(),n=0;n<r.length;n++)null!=r[n]&&(r[n].hasValidRowNumber()||this.adjustRowNumbers(e,n,r));return t},t.prototype.adjustRowNumbersByRow=function(){return this.adjustRowNumbersFromBothRI(),this.adjustRowNumbersFromLRI()+this.adjustRowNumbersFromRRI()},t.prototype.adjustRowNumbersFromBothRI=function(){if(null!=this.detectionResultColumns[0]&&null!=this.detectionResultColumns[this.barcodeColumnCount+1])for(var t=this.detectionResultColumns[0].getCodewords(),e=this.detectionResultColumns[this.barcodeColumnCount+1].getCodewords(),r=0;r<t.length;r++)if(null!=t[r]&&null!=e[r]&&t[r].getRowNumber()===e[r].getRowNumber())for(var n=1;n<=this.barcodeColumnCount;n++){var o=this.detectionResultColumns[n].getCodewords()[r];null!=o&&(o.setRowNumber(t[r].getRowNumber()),o.hasValidRowNumber()||(this.detectionResultColumns[n].getCodewords()[r]=null))}},t.prototype.adjustRowNumbersFromRRI=function(){if(null==this.detectionResultColumns[this.barcodeColumnCount+1])return 0;for(var e=0,r=this.detectionResultColumns[this.barcodeColumnCount+1].getCodewords(),n=0;n<r.length;n++)if(null!=r[n])for(var o=r[n].getRowNumber(),i=0,a=this.barcodeColumnCount+1;a>0&&i<this.ADJUST_ROW_NUMBER_SKIP;a--){var s=this.detectionResultColumns[a].getCodewords()[n];null!=s&&(i=t.adjustRowNumberIfValid(o,i,s),s.hasValidRowNumber()||e++)}return e},t.prototype.adjustRowNumbersFromLRI=function(){if(null==this.detectionResultColumns[0])return 0;for(var e=0,r=this.detectionResultColumns[0].getCodewords(),n=0;n<r.length;n++)if(null!=r[n])for(var o=r[n].getRowNumber(),i=0,a=1;a<this.barcodeColumnCount+1&&i<this.ADJUST_ROW_NUMBER_SKIP;a++){var s=this.detectionResultColumns[a].getCodewords()[n];null!=s&&(i=t.adjustRowNumberIfValid(o,i,s),s.hasValidRowNumber()||e++)}return e},t.adjustRowNumberIfValid=function(t,e,r){return null==r||r.hasValidRowNumber()||(r.isValidRowNumber(t)?(r.setRowNumber(t),e=0):++e),e},t.prototype.adjustRowNumbers=function(e,r,n){var o,i,a=n[r],s=this.detectionResultColumns[e-1].getCodewords(),c=s;null!=this.detectionResultColumns[e+1]&&(c=this.detectionResultColumns[e+1].getCodewords());var u=new Array(14);u[2]=s[r],u[3]=c[r],r>0&&(u[0]=n[r-1],u[4]=s[r-1],u[5]=c[r-1]),r>1&&(u[8]=n[r-2],u[10]=s[r-2],u[11]=c[r-2]),r<n.length-1&&(u[1]=n[r+1],u[6]=s[r+1],u[7]=c[r+1]),r<n.length-2&&(u[9]=n[r+2],u[12]=s[r+2],u[13]=c[r+2]);try{for(var l=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}(u),f=l.next();!f.done;f=l.next()){var d=f.value;if(t.adjustRowNumber(a,d))return}}catch(h){o={error:h}}finally{try{f&&!f.done&&(i=l.return)&&i.call(l)}finally{if(o)throw o.error}}},t.adjustRowNumber=function(t,e){return!(null==e||!e.hasValidRowNumber()||e.getBucket()!==t.getBucket()||(t.setRowNumber(e.getRowNumber()),0))},t.prototype.getBarcodeColumnCount=function(){return this.barcodeColumnCount},t.prototype.getBarcodeRowCount=function(){return this.barcodeMetadata.getRowCount()},t.prototype.getBarcodeECLevel=function(){return this.barcodeMetadata.getErrorCorrectionLevel()},t.prototype.setBoundingBox=function(t){this.boundingBox=t},t.prototype.getBoundingBox=function(){return this.boundingBox},t.prototype.setDetectionResultColumn=function(t,e){this.detectionResultColumns[t]=e},t.prototype.getDetectionResultColumn=function(t){return this.detectionResultColumns[t]},t.prototype.toString=function(){var t=this.detectionResultColumns[0];null==t&&(t=this.detectionResultColumns[this.barcodeColumnCount+1]);for(var e=new wa,r=0;r<t.getCodewords().length;r++){e.format("CW %3d:",r);for(var n=0;n<this.barcodeColumnCount+2;n++)if(null!=this.detectionResultColumns[n]){var o=this.detectionResultColumns[n].getCodewords()[r];null!=o?e.format(" %3d|%3d",o.getRowNumber(),o.getValue()):e.format(" | ")}else e.format(" | ");e.format("%n")}return e.toString()},t}(),Ta=function(){function t(e,r,n,o){this.rowNumber=t.BARCODE_ROW_UNKNOWN,this.startX=Math.trunc(e),this.endX=Math.trunc(r),this.bucket=Math.trunc(n),this.value=Math.trunc(o)}return t.prototype.hasValidRowNumber=function(){return this.isValidRowNumber(this.rowNumber)},t.prototype.isValidRowNumber=function(e){return e!==t.BARCODE_ROW_UNKNOWN&&this.bucket===e%3*3},t.prototype.setRowNumberAsRowIndicatorColumn=function(){this.rowNumber=Math.trunc(3*Math.trunc(this.value/30)+Math.trunc(this.bucket/3))},t.prototype.getWidth=function(){return this.endX-this.startX},t.prototype.getStartX=function(){return this.startX},t.prototype.getEndX=function(){return this.endX},t.prototype.getBucket=function(){return this.bucket},t.prototype.getValue=function(){return this.value},t.prototype.getRowNumber=function(){return this.rowNumber},t.prototype.setRowNumber=function(t){this.rowNumber=t},t.prototype.toString=function(){return this.rowNumber+"|"+this.value},t.BARCODE_ROW_UNKNOWN=-1,t}(),Na=function(){function t(){}return t.initialize=function(){for(var e=0;e<ua.SYMBOL_TABLE.length;e++)for(var r=ua.SYMBOL_TABLE[e],n=1&r,o=0;o<ua.BARS_IN_MODULE;o++){for(var i=0;(1&r)===n;)i+=1,r>>=1;n=1&r,t.RATIOS_TABLE[e]||(t.RATIOS_TABLE[e]=new Array(ua.BARS_IN_MODULE)),t.RATIOS_TABLE[e][ua.BARS_IN_MODULE-o-1]=Math.fround(i/ua.MODULES_IN_CODEWORD)}this.bSymbolTableReady=!0},t.getDecodedValue=function(e){var r=t.getDecodedCodewordValue(t.sampleBitCounts(e));return-1!==r?r:t.getClosestDecodedValue(e)},t.sampleBitCounts=function(t){for(var e=Nn.sum(t),r=new Int32Array(ua.BARS_IN_MODULE),n=0,o=0,i=0;i<ua.MODULES_IN_CODEWORD;i++){var a=e/(2*ua.MODULES_IN_CODEWORD)+i*e/ua.MODULES_IN_CODEWORD;o+t[n]<=a&&(o+=t[n],n++),r[n]++}return r},t.getDecodedCodewordValue=function(e){var r=t.getBitValue(e);return-1===ua.getCodeword(r)?-1:r},t.getBitValue=function(t){for(var e=0,r=0;r<t.length;r++)for(var n=0;n<t[r];n++)e=e<<1|(r%2==0?1:0);return Math.trunc(e)},t.getClosestDecodedValue=function(e){var r=Nn.sum(e),n=new Array(ua.BARS_IN_MODULE);if(r>1)for(var o=0;o<n.length;o++)n[o]=Math.fround(e[o]/r);var i=xn.MAX_VALUE,a=-1;this.bSymbolTableReady||t.initialize();for(var s=0;s<t.RATIOS_TABLE.length;s++){for(var c=0,u=t.RATIOS_TABLE[s],l=0;l<ua.BARS_IN_MODULE;l++){var f=Math.fround(u[l]-n[l]);if((c+=Math.fround(f*f))>=i)break}c<i&&(i=c,a=ua.SYMBOL_TABLE[s])}return a},t.bSymbolTableReady=!1,t.RATIOS_TABLE=new Array(ua.SYMBOL_TABLE.length).map(function(t){return new Array(ua.BARS_IN_MODULE)}),t}(),xa=function(){function t(){this.segmentCount=-1,this.fileSize=-1,this.timestamp=-1,this.checksum=-1}return t.prototype.getSegmentIndex=function(){return this.segmentIndex},t.prototype.setSegmentIndex=function(t){this.segmentIndex=t},t.prototype.getFileId=function(){return this.fileId},t.prototype.setFileId=function(t){this.fileId=t},t.prototype.getOptionalData=function(){return this.optionalData},t.prototype.setOptionalData=function(t){this.optionalData=t},t.prototype.isLastSegment=function(){return this.lastSegment},t.prototype.setLastSegment=function(t){this.lastSegment=t},t.prototype.getSegmentCount=function(){return this.segmentCount},t.prototype.setSegmentCount=function(t){this.segmentCount=t},t.prototype.getSender=function(){return this.sender||null},t.prototype.setSender=function(t){this.sender=t},t.prototype.getAddressee=function(){return this.addressee||null},t.prototype.setAddressee=function(t){this.addressee=t},t.prototype.getFileName=function(){return this.fileName},t.prototype.setFileName=function(t){this.fileName=t},t.prototype.getFileSize=function(){return this.fileSize},t.prototype.setFileSize=function(t){this.fileSize=t},t.prototype.getChecksum=function(){return this.checksum},t.prototype.setChecksum=function(t){this.checksum=t},t.prototype.getTimestamp=function(){return this.timestamp},t.prototype.setTimestamp=function(t){this.timestamp=t},t}(),Ra=function(){function t(){}return t.parseLong=function(t,e){return void 0===e&&(e=void 0),parseInt(t,e)},t}(),Da=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Pa=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Da(e,t),e.kind="NullPointerException",e}(wr),Ma=function(){function t(){}return t.prototype.writeBytes=function(t){this.writeBytesOffset(t,0,t.length)},t.prototype.writeBytesOffset=function(t,e,r){if(null==t)throw new Pa;if(e<0||e>t.length||r<0||e+r>t.length||e+r<0)throw new Rr;if(0!==r)for(var n=0;n<r;n++)this.write(t[e+n])},t.prototype.flush=function(){},t.prototype.close=function(){},t}(),ka=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),La=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return ka(e,t),e}(wr),ja=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Ba=function(t){function e(e){void 0===e&&(e=32);var r=t.call(this)||this;if(r.count=0,e<0)throw new Er("Negative initial size: "+e);return r.buf=new Uint8Array(e),r}return ja(e,t),e.prototype.ensureCapacity=function(t){t-this.buf.length>0&&this.grow(t)},e.prototype.grow=function(t){var e=this.buf.length<<1;if(e-t<0&&(e=t),e<0){if(t<0)throw new La;e=kr.MAX_VALUE}this.buf=Mr.copyOfUint8Array(this.buf,e)},e.prototype.write=function(t){this.ensureCapacity(this.count+1),this.buf[this.count]=t,this.count+=1},e.prototype.writeBytesOffset=function(t,e,r){if(e<0||e>t.length||r<0||e+r-t.length>0)throw new Rr;this.ensureCapacity(this.count+r),Nr.arraycopy(t,e,this.buf,this.count,r),this.count+=r},e.prototype.writeTo=function(t){t.writeBytesOffset(this.buf,0,this.count)},e.prototype.reset=function(){this.count=0},e.prototype.toByteArray=function(){return Mr.copyOfUint8Array(this.buf,this.count)},e.prototype.size=function(){return this.count},e.prototype.toString=function(t){return t?"string"==typeof t?this.toString_string(t):this.toString_number(t):this.toString_void()},e.prototype.toString_void=function(){return new String(this.buf).toString()},e.prototype.toString_string=function(t){return new String(this.buf).toString()},e.prototype.toString_number=function(t){return new String(this.buf).toString()},e.prototype.close=function(){},e}(Ma);function Fa(){if("undefined"!=typeof window)return window.BigInt||null;if("undefined"!=typeof global)return global.BigInt||null;if("undefined"!=typeof self)return self.BigInt||null;throw new Error("Can't search globals for BigInt!")}function Va(t){if(void 0===$i&&($i=Fa()),null===$i)throw new Error("BigInt is not supported!");return $i(t)}!function(t){t[t.ALPHA=0]="ALPHA",t[t.LOWER=1]="LOWER",t[t.MIXED=2]="MIXED",t[t.PUNCT=3]="PUNCT",t[t.ALPHA_SHIFT=4]="ALPHA_SHIFT",t[t.PUNCT_SHIFT=5]="PUNCT_SHIFT"}(Xi||(Xi={}));var Ha=function(){function t(){}return t.decode=function(e,r){var n=new $r(""),o=Ur.ISO8859_1;n.enableDecoding(o);for(var i=1,a=e[i++],s=new xa;i<e[0];){switch(a){case t.TEXT_COMPACTION_MODE_LATCH:i=t.textCompaction(e,i,n);break;case t.BYTE_COMPACTION_MODE_LATCH:case t.BYTE_COMPACTION_MODE_LATCH_6:i=t.byteCompaction(a,e,o,i,n);break;case t.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:n.append(e[i++]);break;case t.NUMERIC_COMPACTION_MODE_LATCH:i=t.numericCompaction(e,i,n);break;case t.ECI_CHARSET:Ur.getCharacterSetECIByValue(e[i++]);break;case t.ECI_GENERAL_PURPOSE:i+=2;break;case t.ECI_USER_DEFINED:i++;break;case t.BEGIN_MACRO_PDF417_CONTROL_BLOCK:i=t.decodeMacroBlock(e,i,s);break;case t.BEGIN_MACRO_PDF417_OPTIONAL_FIELD:case t.MACRO_PDF417_TERMINATOR:throw new Vr;default:i--,i=t.textCompaction(e,i,n)}if(!(i<e.length))throw Vr.getFormatInstance();a=e[i++]}if(0===n.length())throw Vr.getFormatInstance();var c=new mn(null,n.toString(),null,r);return c.setOther(s),c},t.decodeMacroBlock=function(e,r,n){if(r+t.NUMBER_OF_SEQUENCE_CODEWORDS>e[0])throw Vr.getFormatInstance();for(var o=new Int32Array(t.NUMBER_OF_SEQUENCE_CODEWORDS),i=0;i<t.NUMBER_OF_SEQUENCE_CODEWORDS;i++,r++)o[i]=e[r];n.setSegmentIndex(kr.parseInt(t.decodeBase900toBase10(o,t.NUMBER_OF_SEQUENCE_CODEWORDS)));var a=new $r;r=t.textCompaction(e,r,a),n.setFileId(a.toString());var s=-1;for(e[r]===t.BEGIN_MACRO_PDF417_OPTIONAL_FIELD&&(s=r+1);r<e[0];)switch(e[r]){case t.BEGIN_MACRO_PDF417_OPTIONAL_FIELD:switch(e[++r]){case t.MACRO_PDF417_OPTIONAL_FIELD_FILE_NAME:var c=new $r;r=t.textCompaction(e,r+1,c),n.setFileName(c.toString());break;case t.MACRO_PDF417_OPTIONAL_FIELD_SENDER:var u=new $r;r=t.textCompaction(e,r+1,u),n.setSender(u.toString());break;case t.MACRO_PDF417_OPTIONAL_FIELD_ADDRESSEE:var l=new $r;r=t.textCompaction(e,r+1,l),n.setAddressee(l.toString());break;case t.MACRO_PDF417_OPTIONAL_FIELD_SEGMENT_COUNT:var f=new $r;r=t.numericCompaction(e,r+1,f),n.setSegmentCount(kr.parseInt(f.toString()));break;case t.MACRO_PDF417_OPTIONAL_FIELD_TIME_STAMP:var d=new $r;r=t.numericCompaction(e,r+1,d),n.setTimestamp(Ra.parseLong(d.toString()));break;case t.MACRO_PDF417_OPTIONAL_FIELD_CHECKSUM:var h=new $r;r=t.numericCompaction(e,r+1,h),n.setChecksum(kr.parseInt(h.toString()));break;case t.MACRO_PDF417_OPTIONAL_FIELD_FILE_SIZE:var p=new $r;r=t.numericCompaction(e,r+1,p),n.setFileSize(Ra.parseLong(p.toString()));break;default:throw Vr.getFormatInstance()}break;case t.MACRO_PDF417_TERMINATOR:r++,n.setLastSegment(!0);break;default:throw Vr.getFormatInstance()}if(-1!==s){var g=r-s;n.isLastSegment()&&g--,n.setOptionalData(Mr.copyOfRange(e,s,s+g))}return r},t.textCompaction=function(e,r,n){for(var o=new Int32Array(2*(e[0]-r)),i=new Int32Array(2*(e[0]-r)),a=0,s=!1;r<e[0]&&!s;){var c=e[r++];if(c<t.TEXT_COMPACTION_MODE_LATCH)o[a]=c/30,o[a+1]=c%30,a+=2;else switch(c){case t.TEXT_COMPACTION_MODE_LATCH:o[a++]=t.TEXT_COMPACTION_MODE_LATCH;break;case t.BYTE_COMPACTION_MODE_LATCH:case t.BYTE_COMPACTION_MODE_LATCH_6:case t.NUMERIC_COMPACTION_MODE_LATCH:case t.BEGIN_MACRO_PDF417_CONTROL_BLOCK:case t.BEGIN_MACRO_PDF417_OPTIONAL_FIELD:case t.MACRO_PDF417_TERMINATOR:r--,s=!0;break;case t.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:o[a]=t.MODE_SHIFT_TO_BYTE_COMPACTION_MODE,c=e[r++],i[a]=c,a++}}return t.decodeTextCompaction(o,i,a,n),r},t.decodeTextCompaction=function(e,r,n,o){for(var i=Xi.ALPHA,a=Xi.ALPHA,s=0;s<n;){var c=e[s],u="";switch(i){case Xi.ALPHA:if(c<26)u=String.fromCharCode(65+c);else switch(c){case 26:u=" ";break;case t.LL:i=Xi.LOWER;break;case t.ML:i=Xi.MIXED;break;case t.PS:a=i,i=Xi.PUNCT_SHIFT;break;case t.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:o.append(r[s]);break;case t.TEXT_COMPACTION_MODE_LATCH:i=Xi.ALPHA}break;case Xi.LOWER:if(c<26)u=String.fromCharCode(97+c);else switch(c){case 26:u=" ";break;case t.AS:a=i,i=Xi.ALPHA_SHIFT;break;case t.ML:i=Xi.MIXED;break;case t.PS:a=i,i=Xi.PUNCT_SHIFT;break;case t.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:o.append(r[s]);break;case t.TEXT_COMPACTION_MODE_LATCH:i=Xi.ALPHA}break;case Xi.MIXED:if(c<t.PL)u=t.MIXED_CHARS[c];else switch(c){case t.PL:i=Xi.PUNCT;break;case 26:u=" ";break;case t.LL:i=Xi.LOWER;break;case t.AL:i=Xi.ALPHA;break;case t.PS:a=i,i=Xi.PUNCT_SHIFT;break;case t.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:o.append(r[s]);break;case t.TEXT_COMPACTION_MODE_LATCH:i=Xi.ALPHA}break;case Xi.PUNCT:if(c<t.PAL)u=t.PUNCT_CHARS[c];else switch(c){case t.PAL:i=Xi.ALPHA;break;case t.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:o.append(r[s]);break;case t.TEXT_COMPACTION_MODE_LATCH:i=Xi.ALPHA}break;case Xi.ALPHA_SHIFT:if(i=a,c<26)u=String.fromCharCode(65+c);else switch(c){case 26:u=" ";break;case t.TEXT_COMPACTION_MODE_LATCH:i=Xi.ALPHA}break;case Xi.PUNCT_SHIFT:if(i=a,c<t.PAL)u=t.PUNCT_CHARS[c];else switch(c){case t.PAL:i=Xi.ALPHA;break;case t.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:o.append(r[s]);break;case t.TEXT_COMPACTION_MODE_LATCH:i=Xi.ALPHA}}""!==u&&o.append(u),s++}},t.byteCompaction=function(e,r,n,o,i){var a=new Ba,s=0,c=0,u=!1;switch(e){case t.BYTE_COMPACTION_MODE_LATCH:for(var l=new Int32Array(6),f=r[o++];o<r[0]&&!u;)switch(l[s++]=f,c=900*c+f,f=r[o++]){case t.TEXT_COMPACTION_MODE_LATCH:case t.BYTE_COMPACTION_MODE_LATCH:case t.NUMERIC_COMPACTION_MODE_LATCH:case t.BYTE_COMPACTION_MODE_LATCH_6:case t.BEGIN_MACRO_PDF417_CONTROL_BLOCK:case t.BEGIN_MACRO_PDF417_OPTIONAL_FIELD:case t.MACRO_PDF417_TERMINATOR:o--,u=!0;break;default:if(s%5==0&&s>0){for(var d=0;d<6;++d)a.write(Number(Va(c)>>Va(8*(5-d))));c=0,s=0}}o===r[0]&&f<t.TEXT_COMPACTION_MODE_LATCH&&(l[s++]=f);for(var h=0;h<s;h++)a.write(l[h]);break;case t.BYTE_COMPACTION_MODE_LATCH_6:for(;o<r[0]&&!u;){var p=r[o++];if(p<t.TEXT_COMPACTION_MODE_LATCH)s++,c=900*c+p;else switch(p){case t.TEXT_COMPACTION_MODE_LATCH:case t.BYTE_COMPACTION_MODE_LATCH:case t.NUMERIC_COMPACTION_MODE_LATCH:case t.BYTE_COMPACTION_MODE_LATCH_6:case t.BEGIN_MACRO_PDF417_CONTROL_BLOCK:case t.BEGIN_MACRO_PDF417_OPTIONAL_FIELD:case t.MACRO_PDF417_TERMINATOR:o--,u=!0}if(s%5==0&&s>0){for(d=0;d<6;++d)a.write(Number(Va(c)>>Va(8*(5-d))));c=0,s=0}}}return i.append(Gr.decode(a.toByteArray(),n)),o},t.numericCompaction=function(e,r,n){for(var o=0,i=!1,a=new Int32Array(t.MAX_NUMERIC_CODEWORDS);r<e[0]&&!i;){var s=e[r++];if(r===e[0]&&(i=!0),s<t.TEXT_COMPACTION_MODE_LATCH)a[o]=s,o++;else switch(s){case t.TEXT_COMPACTION_MODE_LATCH:case t.BYTE_COMPACTION_MODE_LATCH:case t.BYTE_COMPACTION_MODE_LATCH_6:case t.BEGIN_MACRO_PDF417_CONTROL_BLOCK:case t.BEGIN_MACRO_PDF417_OPTIONAL_FIELD:case t.MACRO_PDF417_TERMINATOR:r--,i=!0}(o%t.MAX_NUMERIC_CODEWORDS==0||s===t.NUMERIC_COMPACTION_MODE_LATCH||i)&&o>0&&(n.append(t.decodeBase900toBase10(a,o)),o=0)}return r},t.decodeBase900toBase10=function(e,r){for(var n=Va(0),o=0;o<r;o++)n+=t.EXP900[r-o-1]*Va(e[o]);var i=n.toString();if("1"!==i.charAt(0))throw new Vr;return i.substring(1)},t.TEXT_COMPACTION_MODE_LATCH=900,t.BYTE_COMPACTION_MODE_LATCH=901,t.NUMERIC_COMPACTION_MODE_LATCH=902,t.BYTE_COMPACTION_MODE_LATCH_6=924,t.ECI_USER_DEFINED=925,t.ECI_GENERAL_PURPOSE=926,t.ECI_CHARSET=927,t.BEGIN_MACRO_PDF417_CONTROL_BLOCK=928,t.BEGIN_MACRO_PDF417_OPTIONAL_FIELD=923,t.MACRO_PDF417_TERMINATOR=922,t.MODE_SHIFT_TO_BYTE_COMPACTION_MODE=913,t.MAX_NUMERIC_CODEWORDS=15,t.MACRO_PDF417_OPTIONAL_FIELD_FILE_NAME=0,t.MACRO_PDF417_OPTIONAL_FIELD_SEGMENT_COUNT=1,t.MACRO_PDF417_OPTIONAL_FIELD_TIME_STAMP=2,t.MACRO_PDF417_OPTIONAL_FIELD_SENDER=3,t.MACRO_PDF417_OPTIONAL_FIELD_ADDRESSEE=4,t.MACRO_PDF417_OPTIONAL_FIELD_FILE_SIZE=5,t.MACRO_PDF417_OPTIONAL_FIELD_CHECKSUM=6,t.PL=25,t.LL=27,t.AS=27,t.ML=28,t.AL=28,t.PS=29,t.PAL=29,t.PUNCT_CHARS=";<>@[\\]_`~!\r\t,:\n-.$/\"|*()?{}'",t.MIXED_CHARS="0123456789&\r\t,:#-.$/+%*=^",t.EXP900=Fa()?function(){var t=[];t[0]=Va(1);var e=Va(900);t[1]=e;for(var r=2;r<16;r++)t[r]=t[r-1]*e;return t}():[],t.NUMBER_OF_SEQUENCE_CODEWORDS=2,t}(),Ua=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Wa=function(){function t(){}return t.decode=function(e,r,n,o,i,a,s){for(var c,u=new ya(e,r,n,o,i),l=null,f=null,d=!0;;d=!1){if(null!=r&&(l=t.getRowIndicatorColumn(e,u,r,!0,a,s)),null!=o&&(f=t.getRowIndicatorColumn(e,u,o,!1,a,s)),null==(c=t.merge(l,f)))throw Kr.getNotFoundInstance();var h=c.getBoundingBox();if(!d||null==h||!(h.getMinY()<u.getMinY()||h.getMaxY()>u.getMaxY()))break;u=h}c.setBoundingBox(u);var p=c.getBarcodeColumnCount()+1;c.setDetectionResultColumn(0,l),c.setDetectionResultColumn(p,f);for(var g=null!=l,m=1;m<=p;m++){var v=g?m:p-m;if(void 0===c.getDetectionResultColumn(v)){var y=void 0;y=0===v||v===p?new Sa(u,0===v):new ba(u),c.setDetectionResultColumn(v,y);for(var _=-1,w=_,b=u.getMinY();b<=u.getMaxY();b++){if((_=t.getStartColumn(c,v,b,g))<0||_>u.getMaxX()){if(-1===w)continue;_=w}var C=t.detectCodeword(e,u.getMinX(),u.getMaxX(),g,_,b,a,s);null!=C&&(y.setCodeword(b,C),w=_,a=Math.min(a,C.getWidth()),s=Math.max(s,C.getWidth()))}}}return t.createDecoderResult(c)},t.merge=function(e,r){if(null==e&&null==r)return null;var n=t.getBarcodeMetadata(e,r);if(null==n)return null;var o=ya.merge(t.adjustBoundingBox(e),t.adjustBoundingBox(r));return new Oa(n,o)},t.adjustBoundingBox=function(e){var r,n;if(null==e)return null;var o=e.getRowHeights();if(null==o)return null;var i=t.getMax(o),a=0;try{for(var s=Ua(o),c=s.next();!c.done;c=s.next()){var u=c.value;if(a+=i-u,u>0)break}}catch(h){r={error:h}}finally{try{c&&!c.done&&(n=s.return)&&n.call(s)}finally{if(r)throw r.error}}for(var l=e.getCodewords(),f=0;a>0&&null==l[f];f++)a--;var d=0;for(f=o.length-1;f>=0&&(d+=i-o[f],!(o[f]>0));f--);for(f=l.length-1;d>0&&null==l[f];f--)d--;return e.getBoundingBox().addMissingRows(a,d,e.isLeft())},t.getMax=function(t){var e,r,n=-1;try{for(var o=Ua(t),i=o.next();!i.done;i=o.next()){var a=i.value;n=Math.max(n,a)}}catch(s){e={error:s}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(e)throw e.error}}return n},t.getBarcodeMetadata=function(t,e){var r,n;return null==t||null==(r=t.getBarcodeMetadata())?null==e?null:e.getBarcodeMetadata():null==e||null==(n=e.getBarcodeMetadata())?r:r.getColumnCount()!==n.getColumnCount()&&r.getErrorCorrectionLevel()!==n.getErrorCorrectionLevel()&&r.getRowCount()!==n.getRowCount()?null:r},t.getRowIndicatorColumn=function(e,r,n,o,i,a){for(var s=new Sa(r,o),c=0;c<2;c++)for(var u=0===c?1:-1,l=Math.trunc(Math.trunc(n.getX())),f=Math.trunc(Math.trunc(n.getY()));f<=r.getMaxY()&&f>=r.getMinY();f+=u){var d=t.detectCodeword(e,0,e.getWidth(),o,l,f,i,a);null!=d&&(s.setCodeword(f,d),l=o?d.getStartX():d.getEndX())}return s},t.adjustCodewordCount=function(e,r){var n=r[0][1],o=n.getValue(),i=e.getBarcodeColumnCount()*e.getBarcodeRowCount()-t.getNumberOfECCodeWords(e.getBarcodeECLevel());if(0===o.length){if(i<1||i>ua.MAX_CODEWORDS_IN_BARCODE)throw Kr.getNotFoundInstance();n.setValue(i)}else o[0]!==i&&n.setValue(i)},t.createDecoderResult=function(e){var r=t.createBarcodeMatrix(e);t.adjustCodewordCount(e,r);for(var n=new Array,o=new Int32Array(e.getBarcodeRowCount()*e.getBarcodeColumnCount()),i=[],a=new Array,s=0;s<e.getBarcodeRowCount();s++)for(var c=0;c<e.getBarcodeColumnCount();c++){var u=r[s][c+1].getValue(),l=s*e.getBarcodeColumnCount()+c;0===u.length?n.push(l):1===u.length?o[l]=u[0]:(a.push(l),i.push(u))}for(var f=new Array(i.length),d=0;d<f.length;d++)f[d]=i[d];return t.createDecoderResultFromAmbiguousValues(e.getBarcodeECLevel(),o,ua.toIntArray(n),ua.toIntArray(a),f)},t.createDecoderResultFromAmbiguousValues=function(e,r,n,o,i){for(var a=new Int32Array(o.length),s=100;s-- >0;){for(var c=0;c<a.length;c++)r[o[c]]=i[c][a[c]];try{return t.decodeCodewords(r,e,n)}catch(u){if(!(u instanceof Or))throw u}if(0===a.length)throw Or.getChecksumInstance();for(c=0;c<a.length;c++){if(a[c]<i[c].length-1){a[c]++;break}if(a[c]=0,c===a.length-1)throw Or.getChecksumInstance()}}throw Or.getChecksumInstance()},t.createBarcodeMatrix=function(t){for(var e,r,n,o,i=Array.from({length:t.getBarcodeRowCount()},function(){return new Array(t.getBarcodeColumnCount()+2)}),a=0;a<i.length;a++)for(var s=0;s<i[a].length;s++)i[a][s]=new Aa;var c=0;try{for(var u=Ua(t.getDetectionResultColumns()),l=u.next();!l.done;l=u.next()){var f=l.value;if(null!=f)try{for(var d=(n=void 0,Ua(f.getCodewords())),h=d.next();!h.done;h=d.next()){var p=h.value;if(null!=p){var g=p.getRowNumber();if(g>=0){if(g>=i.length)continue;i[g][c].setValue(p.getValue())}}}}catch(m){n={error:m}}finally{try{h&&!h.done&&(o=d.return)&&o.call(d)}finally{if(n)throw n.error}}c++}}catch(m){e={error:m}}finally{try{l&&!l.done&&(r=u.return)&&r.call(u)}finally{if(e)throw e.error}}return i},t.isValidBarcodeColumn=function(t,e){return e>=0&&e<=t.getBarcodeColumnCount()+1},t.getStartColumn=function(e,r,n,o){var i,a,s=o?1:-1,c=null;if(t.isValidBarcodeColumn(e,r-s)&&(c=e.getDetectionResultColumn(r-s).getCodeword(n)),null!=c)return o?c.getEndX():c.getStartX();if(null!=(c=e.getDetectionResultColumn(r).getCodewordNearby(n)))return o?c.getStartX():c.getEndX();if(t.isValidBarcodeColumn(e,r-s)&&(c=e.getDetectionResultColumn(r-s).getCodewordNearby(n)),null!=c)return o?c.getEndX():c.getStartX();for(var u=0;t.isValidBarcodeColumn(e,r-s);){r-=s;try{for(var l=(i=void 0,Ua(e.getDetectionResultColumn(r).getCodewords())),f=l.next();!f.done;f=l.next()){var d=f.value;if(null!=d)return(o?d.getEndX():d.getStartX())+s*u*(d.getEndX()-d.getStartX())}}catch(h){i={error:h}}finally{try{f&&!f.done&&(a=l.return)&&a.call(l)}finally{if(i)throw i.error}}u++}return o?e.getBoundingBox().getMinX():e.getBoundingBox().getMaxX()},t.detectCodeword=function(e,r,n,o,i,a,s,c){i=t.adjustCodewordStartColumn(e,r,n,o,i,a);var u,l=t.getModuleBitCount(e,r,n,o,i,a);if(null==l)return null;var f=Nn.sum(l);if(o)u=i+f;else{for(var d=0;d<l.length/2;d++){var h=l[d];l[d]=l[l.length-1-d],l[l.length-1-d]=h}i=(u=i)-f}if(!t.checkCodewordSkew(f,s,c))return null;var p=Na.getDecodedValue(l),g=ua.getCodeword(p);return-1===g?null:new Ta(i,u,t.getCodewordBucketNumber(p),g)},t.getModuleBitCount=function(t,e,r,n,o,i){for(var a=o,s=new Int32Array(8),c=0,u=n?1:-1,l=n;(n?a<r:a>=e)&&c<s.length;)t.get(a,i)===l?(s[c]++,a+=u):(c++,l=!l);return c===s.length||a===(n?r:e)&&c===s.length-1?s:null},t.getNumberOfECCodeWords=function(t){return 2<<t},t.adjustCodewordStartColumn=function(e,r,n,o,i,a){for(var s=i,c=o?-1:1,u=0;u<2;u++){for(;(o?s>=r:s<n)&&o===e.get(s,a);){if(Math.abs(i-s)>t.CODEWORD_SKEW_SIZE)return i;s+=c}c=-c,o=!o}return s},t.checkCodewordSkew=function(e,r,n){return r-t.CODEWORD_SKEW_SIZE<=e&&e<=n+t.CODEWORD_SKEW_SIZE},t.decodeCodewords=function(e,r,n){if(0===e.length)throw Vr.getFormatInstance();var o=1<<r+1,i=t.correctErrors(e,n,o);t.verifyCodewordCount(e,o);var a=Ha.decode(e,""+r);return a.setErrorsCorrected(i),a.setErasures(n.length),a},t.correctErrors=function(e,r,n){if(null!=r&&r.length>n/2+t.MAX_ERRORS||n<0||n>t.MAX_EC_CODEWORDS)throw Or.getChecksumInstance();return t.errorCorrection.decode(e,n,r)},t.verifyCodewordCount=function(t,e){if(t.length<4)throw Vr.getFormatInstance();var r=t[0];if(r>t.length)throw Vr.getFormatInstance();if(0===r){if(!(e<t.length))throw Vr.getFormatInstance();t[0]=t.length-e}},t.getBitCountForCodeword=function(t){for(var e=new Int32Array(8),r=0,n=e.length-1;!((1&t)!==r&&(r=1&t,--n<0));)e[n]++,t>>=1;return e},t.getCodewordBucketNumber=function(t){return t instanceof Int32Array?this.getCodewordBucketNumber_Int32Array(t):this.getCodewordBucketNumber_number(t)},t.getCodewordBucketNumber_number=function(e){return t.getCodewordBucketNumber(t.getBitCountForCodeword(e))},t.getCodewordBucketNumber_Int32Array=function(t){return(t[0]-t[2]+t[4]-t[6]+9)%9},t.toString=function(t){for(var e=new wa,r=0;r<t.length;r++){e.format("Row %2d: ",r);for(var n=0;n<t[r].length;n++){var o=t[r][n];0===o.getValue().length?e.format(" ",null):e.format("%4d(%2d)",o.getValue()[0],o.getConfidence(o.getValue()[0]))}e.format("%n")}return e.toString()},t.CODEWORD_SKEW_SIZE=2,t.MAX_ERRORS=3,t.MAX_EC_CODEWORDS=512,t.errorCorrection=new va,t}(),za=function(){function t(){}return t.prototype.decode=function(e,r){void 0===r&&(r=null);var n=t.decode(e,r,!1);if(null==n||0===n.length||null==n[0])throw Kr.getNotFoundInstance();return n[0]},t.prototype.decodeMultiple=function(e,r){void 0===r&&(r=null);try{return t.decode(e,r,!0)}catch(n){if(n instanceof Vr||n instanceof Or)throw Kr.getNotFoundInstance();throw n}},t.decode=function(e,r,n){var o,i,a=new Array,s=da.detectMultiple(e,r,n);try{for(var c=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}(s.getPoints()),u=c.next();!u.done;u=c.next()){var l=u.value,f=Wa.decode(s.getBits(),l[4],l[5],l[6],l[7],t.getMinCodewordWidth(l),t.getMaxCodewordWidth(l)),d=new fn(f.getText(),f.getRawBytes(),void 0,l,hn.PDF_417);d.putMetadata(gn.ERROR_CORRECTION_LEVEL,f.getECLevel());var h=f.getOther();null!=h&&d.putMetadata(gn.PDF417_EXTRA_METADATA,h),a.push(d)}}catch(p){o={error:p}}finally{try{u&&!u.done&&(i=c.return)&&i.call(c)}finally{if(o)throw o.error}}return a.map(function(t){return t})},t.getMaxWidth=function(t,e){return null==t||null==e?0:Math.trunc(Math.abs(t.getX()-e.getX()))},t.getMinWidth=function(t,e){return null==t||null==e?kr.MAX_VALUE:Math.trunc(Math.abs(t.getX()-e.getX()))},t.getMaxCodewordWidth=function(e){return Math.floor(Math.max(Math.max(t.getMaxWidth(e[0],e[4]),t.getMaxWidth(e[6],e[2])*ua.MODULES_IN_CODEWORD/ua.MODULES_IN_STOP_PATTERN),Math.max(t.getMaxWidth(e[1],e[5]),t.getMaxWidth(e[7],e[3])*ua.MODULES_IN_CODEWORD/ua.MODULES_IN_STOP_PATTERN)))},t.getMinCodewordWidth=function(e){return Math.floor(Math.min(Math.min(t.getMinWidth(e[0],e[4]),t.getMinWidth(e[6],e[2])*ua.MODULES_IN_CODEWORD/ua.MODULES_IN_STOP_PATTERN),Math.min(t.getMinWidth(e[1],e[5]),t.getMinWidth(e[7],e[3])*ua.MODULES_IN_CODEWORD/ua.MODULES_IN_STOP_PATTERN)))},t.prototype.reset=function(){},t}(),Ga=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Xa=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Ga(e,t),e.kind="ReaderException",e}(wr),$a=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Ya=function(){function t(){}return t.prototype.decode=function(t,e){return this.setHints(e),this.decodeInternal(t)},t.prototype.decodeWithState=function(t){return null!==this.readers&&void 0!==this.readers||this.setHints(null),this.decodeInternal(t)},t.prototype.setHints=function(t){this.hints=t;var e=null!=t&&void 0!==t.get(Br.TRY_HARDER),r=null==t?null:t.get(Br.POSSIBLE_FORMATS),n=new Array;if(null!=r){var o=r.some(function(t){return t===hn.UPC_A||t===hn.UPC_E||t===hn.EAN_13||t===hn.EAN_8||t===hn.CODABAR||t===hn.CODE_39||t===hn.CODE_93||t===hn.CODE_128||t===hn.ITF||t===hn.RSS_14||t===hn.RSS_EXPANDED});o&&!e&&n.push(new yi(t)),r.includes(hn.QR_CODE)&&n.push(new ca),r.includes(hn.DATA_MATRIX)&&n.push(new Pi),r.includes(hn.AZTEC)&&n.push(new Wn),r.includes(hn.PDF_417)&&n.push(new za),o&&e&&n.push(new yi(t))}0===n.length&&(e||n.push(new yi(t)),n.push(new ca),n.push(new Pi),n.push(new Wn),n.push(new za),e&&n.push(new yi(t))),this.readers=n},t.prototype.reset=function(){var t,e;if(null!==this.readers)try{for(var r=$a(this.readers),n=r.next();!n.done;n=r.next())n.value.reset()}catch(o){t={error:o}}finally{try{n&&!n.done&&(e=r.return)&&e.call(r)}finally{if(t)throw t.error}}},t.prototype.decodeInternal=function(t){var e,r;if(null===this.readers)throw new Xa("No readers where selected, nothing can be read.");try{for(var n=$a(this.readers),o=n.next();!o.done;o=n.next()){var i=o.value;try{return i.decode(t,this.hints)}catch(a){if(a instanceof Xa)continue}}}catch(a){e={error:a}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(e)throw e.error}}throw new Kr("No MultiFormat Readers were able to detect the code.")},t}(),qa=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();!function(t){function e(e,r){void 0===e&&(e=null),void 0===r&&(r=500);var n=new Ya;return n.setHints(e),t.call(this,n,r)||this}qa(e,t),e.prototype.decodeBitmap=function(t){return this.reader.decodeWithState(t)}}(ln);var Ka=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();!function(t){Ka(function(e){return void 0===e&&(e=500),t.call(this,new za,e)||this},t)}(ln);var Za,Qa=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();!function(t){Qa(function(e){return void 0===e&&(e=500),t.call(this,new ca,e)||this},t)}(ln),function(t){t[t.ERROR_CORRECTION=0]="ERROR_CORRECTION",t[t.CHARACTER_SET=1]="CHARACTER_SET",t[t.DATA_MATRIX_SHAPE=2]="DATA_MATRIX_SHAPE",t[t.MIN_SIZE=3]="MIN_SIZE",t[t.MAX_SIZE=4]="MAX_SIZE",t[t.MARGIN=5]="MARGIN",t[t.PDF417_COMPACT=6]="PDF417_COMPACT",t[t.PDF417_COMPACTION=7]="PDF417_COMPACTION",t[t.PDF417_DIMENSIONS=8]="PDF417_DIMENSIONS",t[t.AZTEC_LAYERS=9]="AZTEC_LAYERS",t[t.QR_VERSION=10]="QR_VERSION"}(Za||(Za={}));var Ja=function(){function t(){}return t.applyMaskPenaltyRule1=function(e){return t.applyMaskPenaltyRule1Internal(e,!0)+t.applyMaskPenaltyRule1Internal(e,!1)},t.applyMaskPenaltyRule2=function(e){for(var r=0,n=e.getArray(),o=e.getWidth(),i=e.getHeight(),a=0;a<i-1;a++)for(var s=n[a],c=0;c<o-1;c++){var u=s[c];u===s[c+1]&&u===n[a+1][c]&&u===n[a+1][c+1]&&r++}return t.N2*r},t.applyMaskPenaltyRule3=function(e){for(var r=0,n=e.getArray(),o=e.getWidth(),i=e.getHeight(),a=0;a<i;a++)for(var s=0;s<o;s++){var c=n[a];s+6<o&&1===c[s]&&0===c[s+1]&&1===c[s+2]&&1===c[s+3]&&1===c[s+4]&&0===c[s+5]&&1===c[s+6]&&(t.isWhiteHorizontal(c,s-4,s)||t.isWhiteHorizontal(c,s+7,s+11))&&r++,a+6<i&&1===n[a][s]&&0===n[a+1][s]&&1===n[a+2][s]&&1===n[a+3][s]&&1===n[a+4][s]&&0===n[a+5][s]&&1===n[a+6][s]&&(t.isWhiteVertical(n,s,a-4,a)||t.isWhiteVertical(n,s,a+7,a+11))&&r++}return r*t.N3},t.isWhiteHorizontal=function(t,e,r){e=Math.max(e,0),r=Math.min(r,t.length);for(var n=e;n<r;n++)if(1===t[n])return!1;return!0},t.isWhiteVertical=function(t,e,r,n){r=Math.max(r,0),n=Math.min(n,t.length);for(var o=r;o<n;o++)if(1===t[o][e])return!1;return!0},t.applyMaskPenaltyRule4=function(e){for(var r=0,n=e.getArray(),o=e.getWidth(),i=e.getHeight(),a=0;a<i;a++)for(var s=n[a],c=0;c<o;c++)1===s[c]&&r++;var u=e.getHeight()*e.getWidth();return Math.floor(10*Math.abs(2*r-u)/u)*t.N4},t.getDataMaskBit=function(t,e,r){var n,o;switch(t){case 0:n=r+e&1;break;case 1:n=1&r;break;case 2:n=e%3;break;case 3:n=(r+e)%3;break;case 4:n=Math.floor(r/2)+Math.floor(e/3)&1;break;case 5:n=(1&(o=r*e))+o%3;break;case 6:n=(1&(o=r*e))+o%3&1;break;case 7:n=(o=r*e)%3+(r+e&1)&1;break;default:throw new Er("Invalid mask pattern: "+t)}return 0===n},t.applyMaskPenaltyRule1Internal=function(e,r){for(var n=0,o=r?e.getHeight():e.getWidth(),i=r?e.getWidth():e.getHeight(),a=e.getArray(),s=0;s<o;s++){for(var c=0,u=-1,l=0;l<i;l++){var f=r?a[s][l]:a[l][s];f===u?c++:(c>=5&&(n+=t.N1+(c-5)),c=1,u=f)}c>=5&&(n+=t.N1+(c-5))}return n},t.N1=3,t.N2=3,t.N3=40,t.N4=10,t}(),ts=function(){function t(){this.maskPattern=-1}return t.prototype.getMode=function(){return this.mode},t.prototype.getECLevel=function(){return this.ecLevel},t.prototype.getVersion=function(){return this.version},t.prototype.getMaskPattern=function(){return this.maskPattern},t.prototype.getMatrix=function(){return this.matrix},t.prototype.toString=function(){var t=new $r;return t.append("<<\n"),t.append(" mode: "),t.append(this.mode?this.mode.toString():"null"),t.append("\n ecLevel: "),t.append(this.ecLevel?this.ecLevel.toString():"null"),t.append("\n version: "),t.append(this.version?this.version.toString():"null"),t.append("\n maskPattern: "),t.append(this.maskPattern.toString()),this.matrix?(t.append("\n matrix:\n"),t.append(this.matrix.toString())):t.append("\n matrix: null\n"),t.append(">>\n"),t.toString()},t.prototype.setMode=function(t){this.mode=t},t.prototype.setECLevel=function(t){this.ecLevel=t},t.prototype.setVersion=function(t){this.version=t},t.prototype.setMaskPattern=function(t){this.maskPattern=t},t.prototype.setMatrix=function(t){this.matrix=t},t.isValidMaskPattern=function(e){return e>=0&&e<t.NUM_MASK_PATTERNS},t.NUM_MASK_PATTERNS=8,t}(),es=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),rs=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return es(e,t),e.kind="WriterException",e}(wr);!function(){function t(){}t.clearMatrix=function(t){t.clear(255)},t.buildMatrix=function(e,r,n,o,i){t.clearMatrix(i),t.embedBasicPatterns(n,i),t.embedTypeInfo(r,o,i),t.maybeEmbedVersionInfo(n,i),t.embedDataBits(e,o,i)},t.embedBasicPatterns=function(e,r){t.embedPositionDetectionPatternsAndSeparators(r),t.embedDarkDotAtLeftBottomCorner(r),t.maybeEmbedPositionAdjustmentPatterns(e,r),t.embedTimingPatterns(r)},t.embedTypeInfo=function(e,r,n){var o=new Lr;t.makeTypeInfoBits(e,r,o);for(var i=0,a=o.getSize();i<a;++i){var s=o.get(o.getSize()-1-i),c=t.TYPE_INFO_COORDINATES[i],u=c[0],l=c[1];if(n.setBoolean(u,l,s),i<8){var f=n.getWidth()-i-1,d=8;n.setBoolean(f,d,s)}else f=8,d=n.getHeight()-7+(i-8),n.setBoolean(f,d,s)}},t.maybeEmbedVersionInfo=function(e,r){if(!(e.getVersionNumber()<7)){var n=new Lr;t.makeVersionInfoBits(e,n);for(var o=17,i=0;i<6;++i)for(var a=0;a<3;++a){var s=n.get(o);o--,r.setBoolean(i,r.getHeight()-11+a,s),r.setBoolean(r.getHeight()-11+a,i,s)}}},t.embedDataBits=function(e,r,n){for(var o=0,i=-1,a=n.getWidth()-1,s=n.getHeight()-1;a>0;){for(6===a&&(a-=1);s>=0&&s<n.getHeight();){for(var c=0;c<2;++c){var u=a-c;if(t.isEmpty(n.get(u,s))){var l=void 0;o<e.getSize()?(l=e.get(o),++o):l=!1,255!==r&&Ja.getDataMaskBit(r,u,s)&&(l=!l),n.setBoolean(u,s,l)}}s+=i}s+=i=-i,a-=2}if(o!==e.getSize())throw new rs("Not all bits consumed: "+o+"/"+e.getSize())},t.findMSBSet=function(t){return 32-kr.numberOfLeadingZeros(t)},t.calculateBCHCode=function(e,r){if(0===r)throw new Er("0 polynomial");var n=t.findMSBSet(r);for(e<<=n-1;t.findMSBSet(e)>=n;)e^=r<<t.findMSBSet(e)-n;return e},t.makeTypeInfoBits=function(e,r,n){if(!ts.isValidMaskPattern(r))throw new rs("Invalid mask pattern");var o=e.getBits()<<3|r;n.appendBits(o,5);var i=t.calculateBCHCode(o,t.TYPE_INFO_POLY);n.appendBits(i,10);var a=new Lr;if(a.appendBits(t.TYPE_INFO_MASK_PATTERN,15),n.xor(a),15!==n.getSize())throw new rs("should not happen but we got: "+n.getSize())},t.makeVersionInfoBits=function(e,r){r.appendBits(e.getVersionNumber(),6);var n=t.calculateBCHCode(e.getVersionNumber(),t.VERSION_INFO_POLY);if(r.appendBits(n,12),18!==r.getSize())throw new rs("should not happen but we got: "+r.getSize())},t.isEmpty=function(t){return 255===t},t.embedTimingPatterns=function(e){for(var r=8;r<e.getWidth()-8;++r){var n=(r+1)%2;t.isEmpty(e.get(r,6))&&e.setNumber(r,6,n),t.isEmpty(e.get(6,r))&&e.setNumber(6,r,n)}},t.embedDarkDotAtLeftBottomCorner=function(t){if(0===t.get(8,t.getHeight()-8))throw new rs;t.setNumber(8,t.getHeight()-8,1)},t.embedHorizontalSeparationPattern=function(e,r,n){for(var o=0;o<8;++o){if(!t.isEmpty(n.get(e+o,r)))throw new rs;n.setNumber(e+o,r,0)}},t.embedVerticalSeparationPattern=function(e,r,n){for(var o=0;o<7;++o){if(!t.isEmpty(n.get(e,r+o)))throw new rs;n.setNumber(e,r+o,0)}},t.embedPositionAdjustmentPattern=function(e,r,n){for(var o=0;o<5;++o)for(var i=t.POSITION_ADJUSTMENT_PATTERN[o],a=0;a<5;++a)n.setNumber(e+a,r+o,i[a])},t.embedPositionDetectionPattern=function(e,r,n){for(var o=0;o<7;++o)for(var i=t.POSITION_DETECTION_PATTERN[o],a=0;a<7;++a)n.setNumber(e+a,r+o,i[a])},t.embedPositionDetectionPatternsAndSeparators=function(e){var r=t.POSITION_DETECTION_PATTERN[0].length;t.embedPositionDetectionPattern(0,0,e),t.embedPositionDetectionPattern(e.getWidth()-r,0,e),t.embedPositionDetectionPattern(0,e.getWidth()-r,e),t.embedHorizontalSeparationPattern(0,7,e),t.embedHorizontalSeparationPattern(e.getWidth()-8,7,e),t.embedHorizontalSeparationPattern(0,e.getWidth()-8,e),t.embedVerticalSeparationPattern(7,0,e),t.embedVerticalSeparationPattern(e.getHeight()-7-1,0,e),t.embedVerticalSeparationPattern(7,e.getHeight()-7,e)},t.maybeEmbedPositionAdjustmentPatterns=function(e,r){if(!(e.getVersionNumber()<2))for(var n=e.getVersionNumber()-1,o=t.POSITION_ADJUSTMENT_PATTERN_COORDINATE_TABLE[n],i=0,a=o.length;i!==a;i++){var s=o[i];if(s>=0)for(var c=0;c!==a;c++){var u=o[c];u>=0&&t.isEmpty(r.get(u,s))&&t.embedPositionAdjustmentPattern(u-2,s-2,r)}}},t.POSITION_DETECTION_PATTERN=Array.from([Int32Array.from([1,1,1,1,1,1,1]),Int32Array.from([1,0,0,0,0,0,1]),Int32Array.from([1,0,1,1,1,0,1]),Int32Array.from([1,0,1,1,1,0,1]),Int32Array.from([1,0,1,1,1,0,1]),Int32Array.from([1,0,0,0,0,0,1]),Int32Array.from([1,1,1,1,1,1,1])]),t.POSITION_ADJUSTMENT_PATTERN=Array.from([Int32Array.from([1,1,1,1,1]),Int32Array.from([1,0,0,0,1]),Int32Array.from([1,0,1,0,1]),Int32Array.from([1,0,0,0,1]),Int32Array.from([1,1,1,1,1])]),t.POSITION_ADJUSTMENT_PATTERN_COORDINATE_TABLE=Array.from([Int32Array.from([-1,-1,-1,-1,-1,-1,-1]),Int32Array.from([6,18,-1,-1,-1,-1,-1]),Int32Array.from([6,22,-1,-1,-1,-1,-1]),Int32Array.from([6,26,-1,-1,-1,-1,-1]),Int32Array.from([6,30,-1,-1,-1,-1,-1]),Int32Array.from([6,34,-1,-1,-1,-1,-1]),Int32Array.from([6,22,38,-1,-1,-1,-1]),Int32Array.from([6,24,42,-1,-1,-1,-1]),Int32Array.from([6,26,46,-1,-1,-1,-1]),Int32Array.from([6,28,50,-1,-1,-1,-1]),Int32Array.from([6,30,54,-1,-1,-1,-1]),Int32Array.from([6,32,58,-1,-1,-1,-1]),Int32Array.from([6,34,62,-1,-1,-1,-1]),Int32Array.from([6,26,46,66,-1,-1,-1]),Int32Array.from([6,26,48,70,-1,-1,-1]),Int32Array.from([6,26,50,74,-1,-1,-1]),Int32Array.from([6,30,54,78,-1,-1,-1]),Int32Array.from([6,30,56,82,-1,-1,-1]),Int32Array.from([6,30,58,86,-1,-1,-1]),Int32Array.from([6,34,62,90,-1,-1,-1]),Int32Array.from([6,28,50,72,94,-1,-1]),Int32Array.from([6,26,50,74,98,-1,-1]),Int32Array.from([6,30,54,78,102,-1,-1]),Int32Array.from([6,28,54,80,106,-1,-1]),Int32Array.from([6,32,58,84,110,-1,-1]),Int32Array.from([6,30,58,86,114,-1,-1]),Int32Array.from([6,34,62,90,118,-1,-1]),Int32Array.from([6,26,50,74,98,122,-1]),Int32Array.from([6,30,54,78,102,126,-1]),Int32Array.from([6,26,52,78,104,130,-1]),Int32Array.from([6,30,56,82,108,134,-1]),Int32Array.from([6,34,60,86,112,138,-1]),Int32Array.from([6,30,58,86,114,142,-1]),Int32Array.from([6,34,62,90,118,146,-1]),Int32Array.from([6,30,54,78,102,126,150]),Int32Array.from([6,24,50,76,102,128,154]),Int32Array.from([6,28,54,80,106,132,158]),Int32Array.from([6,32,58,84,110,136,162]),Int32Array.from([6,26,54,82,110,138,166]),Int32Array.from([6,30,58,86,114,142,170])]),t.TYPE_INFO_COORDINATES=Array.from([Int32Array.from([8,0]),Int32Array.from([8,1]),Int32Array.from([8,2]),Int32Array.from([8,3]),Int32Array.from([8,4]),Int32Array.from([8,5]),Int32Array.from([8,7]),Int32Array.from([8,8]),Int32Array.from([7,8]),Int32Array.from([5,8]),Int32Array.from([4,8]),Int32Array.from([3,8]),Int32Array.from([2,8]),Int32Array.from([1,8]),Int32Array.from([0,8])]),t.VERSION_INFO_POLY=7973,t.TYPE_INFO_POLY=1335,t.TYPE_INFO_MASK_PATTERN=21522}(),Int32Array.from([-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,36,-1,-1,-1,37,38,-1,-1,-1,-1,39,40,-1,41,42,43,0,1,2,3,4,5,6,7,8,9,44,-1,-1,-1,-1,-1,-1,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,-1,-1,-1,-1,-1]),Ur.UTF8.getName();var ns=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();!function(t){function e(e,r,n,o,i,a,s,c){var u=t.call(this,a,s)||this;if(u.yuvData=e,u.dataWidth=r,u.dataHeight=n,u.left=o,u.top=i,o+a>r||i+s>n)throw new Er("Crop rectangle does not fit within image data.");return c&&u.reverseHorizontal(a,s),u}ns(e,t),e.prototype.getRow=function(t,e){if(t<0||t>=this.getHeight())throw new Er("Requested row is outside the image: "+t);var r=this.getWidth();(null==e||e.length<r)&&(e=new Uint8ClampedArray(r));var n=(t+this.top)*this.dataWidth+this.left;return Nr.arraycopy(this.yuvData,n,e,0,r),e},e.prototype.getMatrix=function(){var t=this.getWidth(),e=this.getHeight();if(t===this.dataWidth&&e===this.dataHeight)return this.yuvData;var r=t*e,n=new Uint8ClampedArray(r),o=this.top*this.dataWidth+this.left;if(t===this.dataWidth)return Nr.arraycopy(this.yuvData,o,n,0,r),n;for(var i=0;i<e;i++){var a=i*t;Nr.arraycopy(this.yuvData,o,n,a,t),o+=this.dataWidth}return n},e.prototype.isCropSupported=function(){return!0},e.prototype.crop=function(t,r,n,o){return new e(this.yuvData,this.dataWidth,this.dataHeight,this.left+t,this.top+r,n,o,!1)},e.prototype.renderThumbnail=function(){for(var t=this.getWidth()/e.THUMBNAIL_SCALE_FACTOR,r=this.getHeight()/e.THUMBNAIL_SCALE_FACTOR,n=new Int32Array(t*r),o=this.yuvData,i=this.top*this.dataWidth+this.left,a=0;a<r;a++){for(var s=a*t,c=0;c<t;c++){var u=255&o[i+c*e.THUMBNAIL_SCALE_FACTOR];n[s+c]=4278190080|65793*u}i+=this.dataWidth*e.THUMBNAIL_SCALE_FACTOR}return n},e.prototype.getThumbnailWidth=function(){return this.getWidth()/e.THUMBNAIL_SCALE_FACTOR},e.prototype.getThumbnailHeight=function(){return this.getHeight()/e.THUMBNAIL_SCALE_FACTOR},e.prototype.reverseHorizontal=function(t,e){for(var r=this.yuvData,n=0,o=this.top*this.dataWidth+this.left;n<e;n++,o+=this.dataWidth)for(var i=o+t/2,a=o,s=o+t-1;a<i;a++,s--){var c=r[a];r[a]=r[s],r[s]=c}},e.prototype.invert=function(){return new nn(this)},e.THUMBNAIL_SCALE_FACTOR=2}(en);var os=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();!function(t){function e(e,r,n,o,i,a,s){var c=t.call(this,r,n)||this;if(c.dataWidth=o,c.dataHeight=i,c.left=a,c.top=s,4===e.BYTES_PER_ELEMENT){for(var u=r*n,l=new Uint8ClampedArray(u),f=0;f<u;f++){var d=e[f],h=d>>16&255,p=d>>7&510,g=255&d;l[f]=(h+p+g)/4&255}c.luminances=l}else c.luminances=e;if(void 0===o&&(c.dataWidth=r),void 0===i&&(c.dataHeight=n),void 0===a&&(c.left=0),void 0===s&&(c.top=0),c.left+r>c.dataWidth||c.top+n>c.dataHeight)throw new Er("Crop rectangle does not fit within image data.");return c}os(e,t),e.prototype.getRow=function(t,e){if(t<0||t>=this.getHeight())throw new Er("Requested row is outside the image: "+t);var r=this.getWidth();(null==e||e.length<r)&&(e=new Uint8ClampedArray(r));var n=(t+this.top)*this.dataWidth+this.left;return Nr.arraycopy(this.luminances,n,e,0,r),e},e.prototype.getMatrix=function(){var t=this.getWidth(),e=this.getHeight();if(t===this.dataWidth&&e===this.dataHeight)return this.luminances;var r=t*e,n=new Uint8ClampedArray(r),o=this.top*this.dataWidth+this.left;if(t===this.dataWidth)return Nr.arraycopy(this.luminances,o,n,0,r),n;for(var i=0;i<e;i++){var a=i*t;Nr.arraycopy(this.luminances,o,n,a,t),o+=this.dataWidth}return n},e.prototype.isCropSupported=function(){return!0},e.prototype.crop=function(t,r,n,o){return new e(this.luminances,n,o,this.dataWidth,this.dataHeight,this.left+t,this.top+r)},e.prototype.invert=function(){return new nn(this)}}(en);var is=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();!function(t){function e(){return null!==t&&t.apply(this,arguments)||this}is(e,t),e.forName=function(t){return this.getCharacterSetECIByName(t)}}(Ur);var as=function(){function t(t){this.previous=t}return t.prototype.getPrevious=function(){return this.previous},t}(),ss=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),cs=function(t){function e(e,r,n){var o=t.call(this,e)||this;return o.value=r,o.bitCount=n,o}return ss(e,t),e.prototype.appendTo=function(t,e){t.appendBits(this.value,this.bitCount)},e.prototype.add=function(t,r){return new e(this,t,r)},e.prototype.addBinaryShift=function(t,r){return console.warn("addBinaryShift on SimpleToken, this simply returns a copy of this token"),new e(this,t,r)},e.prototype.toString=function(){var t=this.value&(1<<this.bitCount)-1;return t|=1<<this.bitCount,"<"+kr.toBinaryString(t|1<<this.bitCount).substring(1)+">"},e}(as),us=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();!function(t){function e(e,r,n){var o=t.call(this,e,0,0)||this;return o.binaryShiftStart=r,o.binaryShiftByteCount=n,o}us(e,t),e.prototype.appendTo=function(t,e){for(var r=0;r<this.binaryShiftByteCount;r++)(0===r||31===r&&this.binaryShiftByteCount<=62)&&(t.appendBits(31,5),this.binaryShiftByteCount>62?t.appendBits(this.binaryShiftByteCount-31,16):0===r?t.appendBits(Math.min(this.binaryShiftByteCount,31),5):t.appendBits(this.binaryShiftByteCount-31,5)),t.appendBits(e[this.binaryShiftStart+r],8)},e.prototype.addBinaryShift=function(t,r){return new e(this,t,r)},e.prototype.toString=function(){return"<"+this.binaryShiftStart+"::"+(this.binaryShiftStart+this.binaryShiftByteCount-1)+">"}}(cs),new cs(null,0,0);!function(t){var e,r;try{for(var n=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}(t),o=n.next();!o.done;o=n.next()){var i=o.value;Mr.fill(i,-1)}}catch(a){e={error:a}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(e)throw e.error}}t[0][4]=0,t[1][4]=0,t[1][0]=28,t[3][4]=0,t[2][4]=0,t[2][0]=15}(Mr.createInt32Array(6,6)),function(t){var e=Xr.getCharCode(" "),r=Xr.getCharCode("."),n=Xr.getCharCode(",");t[0][e]=1;for(var o=Xr.getCharCode("Z"),i=Xr.getCharCode("A"),a=i;a<=o;a++)t[0][a]=a-i+2;t[1][e]=1;var s=Xr.getCharCode("z"),c=Xr.getCharCode("a");for(a=c;a<=s;a++)t[1][a]=a-c+2;t[2][e]=1;var u=Xr.getCharCode("9"),l=Xr.getCharCode("0");for(a=l;a<=u;a++)t[2][a]=a-l+2;t[2][n]=12,t[2][r]=13;for(var f=["\0"," ","","","","","","","","\b","\t","\n","\v","\f","\r","","","","","","@","\\","^","_","`","|","~",""],d=0;d<f.length;d++)t[3][Xr.getCharCode(f[d])]=d;var h=["\0","\r","\0","\0","\0","\0","!","'","#","$","%","&","'","(",")","*","+",",","-",".","/",":",";","<","=",">","?","[","]","{","}"];for(d=0;d<h.length;d++)Xr.getCharCode(h[d])>0&&(t[4][Xr.getCharCode(h[d])]=d)}(Mr.createInt32Array(5,256));var ls=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),fs=function(t){function e(r){var n=t.call(this,r.width,r.height)||this;return n.canvas=r,n.buffer=e.makeBufferFromCanvasImageData(r),n}return ls(e,t),e.makeBufferFromCanvasImageData=function(t){var r=t.getContext("2d");if(!r)throw new Error("Couldn't get canvas context.");var n=r.getImageData(0,0,t.width,t.height);return e.toGrayscaleBuffer(n.data,t.width,t.height)},e.toGrayscaleBuffer=function(t,e,r){for(var n=new Uint8ClampedArray(e*r),o=0,i=0,a=t.length;o<a;o+=4,i++){var s=void 0;s=0===t[o+3]?255:306*t[o]+601*t[o+1]+117*t[o+2]+512>>10,n[i]=s}return n},e.prototype.getRow=function(t,e){if(t<0||t>=this.getHeight())throw new Er("Requested row is outside the image: "+t);var r=this.getWidth(),n=t*r;return null===e?e=this.buffer.slice(n,n+r):(e.length<r&&(e=new Uint8ClampedArray(r)),e.set(this.buffer.slice(n,n+r))),e},e.prototype.getMatrix=function(){return this.buffer},e.prototype.isCropSupported=function(){return!0},e.prototype.crop=function(e,r,n,o){return t.prototype.crop.call(this,e,r,n,o),this},e.prototype.isRotateSupported=function(){return!0},e.prototype.rotateCounterClockwise=function(){return this.rotate(-90),this},e.prototype.rotateCounterClockwise45=function(){return this.rotate(-45),this},e.prototype.invert=function(){return new nn(this)},e.prototype.getTempCanvasElement=function(){if(null===this.tempCanvasElement){var t=this.canvas.ownerDocument.createElement("canvas");t.width=this.canvas.width,t.height=this.canvas.height,this.tempCanvasElement=t}return this.tempCanvasElement},e.prototype.rotate=function(t){var r=this.getTempCanvasElement();if(!r)throw new Error("Could not create a Canvas element.");var n=t*e.DEGREE_TO_RADIANS,o=this.canvas.width,i=this.canvas.height,a=Math.ceil(Math.abs(Math.cos(n))*o+Math.abs(Math.sin(n))*i),s=Math.ceil(Math.abs(Math.sin(n))*o+Math.abs(Math.cos(n))*i);r.width=a,r.height=s;var c=r.getContext("2d");if(!c)throw new Error("Could not create a Convas Context element.");return c.translate(a/2,s/2),c.rotate(n),c.drawImage(this.canvas,o/-2,i/-2),this.buffer=e.makeBufferFromCanvasImageData(r),this},e.DEGREE_TO_RADIANS=Math.PI/180,e}(en);function ds(){return"undefined"!=typeof navigator}var hs=function(){return hs=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},hs.apply(this,arguments)},ps=function(t,e,r,n){return new(r||(r=Promise))(function(e,o){function i(t){try{s(n.next(t))}catch(e){o(e)}}function a(t){try{s(n.throw(t))}catch(e){o(e)}}function s(t){var n;t.done?e(t.value):(n=t.value,n instanceof r?n:new r(function(t){t(n)})).then(i,a)}s((n=n.apply(t,[])).next())})},gs=function(t,e){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(s){i=[6,s],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},ms=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},vs={delayBetweenScanAttempts:500,delayBetweenScanSuccess:500,tryPlayVideoTimeout:5e3},ys=function(){function t(t,e,r){void 0===e&&(e=new Map),void 0===r&&(r={}),this.reader=t,this.hints=e,this.options=hs(hs({},vs),r)}return Object.defineProperty(t.prototype,"possibleFormats",{set:function(t){this.hints.set(Br.POSSIBLE_FORMATS,t)},enumerable:!1,configurable:!0}),t.addVideoSource=function(t,e){try{t.srcObject=e}catch(r){t.src=URL.createObjectURL(e)}},t.mediaStreamSetTorch=function(t,e){return ps(this,0,void 0,function(){return gs(this,function(r){switch(r.label){case 0:return[4,t.applyConstraints({advanced:[{fillLightMode:e?"flash":"off",torch:!!e}]})];case 1:return r.sent(),[2]}})})},t.mediaStreamIsTorchCompatible=function(e){var r,n,o=e.getVideoTracks();try{for(var i=ms(o),a=i.next();!a.done;a=i.next()){var s=a.value;if(t.mediaStreamIsTorchCompatibleTrack(s))return!0}}catch(c){r={error:c}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return!1},t.mediaStreamIsTorchCompatibleTrack=function(t){try{return"torch"in t.getCapabilities()}catch(e){return console.error(e),console.warn("Your browser may be not fully compatible with WebRTC and/or ImageCapture specs. Torch will not be available."),!1}},t.isVideoPlaying=function(t){return t.currentTime>0&&!t.paused&&t.readyState>2},t.getMediaElement=function(t,e){var r=document.getElementById(t);if(!r)throw new Cr("element with id '"+t+"' not found");if(r.nodeName.toLowerCase()!==e.toLowerCase())throw new Cr("element with id '"+t+"' must be an "+e+" element");return r},t.createVideoElement=function(e){if(e instanceof HTMLVideoElement)return e;if("string"==typeof e)return t.getMediaElement(e,"video");if(!e&&"undefined"!=typeof document){var r=document.createElement("video");return r.width=200,r.height=200,r}throw new Error("Couldn't get videoElement from videoSource!")},t.prepareImageElement=function(e){if(e instanceof HTMLImageElement)return e;if("string"==typeof e)return t.getMediaElement(e,"img");if(void 0===e){var r=document.createElement("img");return r.width=200,r.height=200,r}throw new Error("Couldn't get imageElement from imageSource!")},t.prepareVideoElement=function(e){var r=t.createVideoElement(e);return r.setAttribute("autoplay","true"),r.setAttribute("muted","true"),r.setAttribute("playsinline","true"),r},t.isImageLoaded=function(t){return!!t.complete&&0!==t.naturalWidth},t.createBinaryBitmapFromCanvas=function(t){var e=new fs(t),r=new tn(e);return new Ir(r)},t.drawImageOnCanvas=function(t,e){t.drawImage(e,0,0)},t.getMediaElementDimensions=function(t){if(t instanceof HTMLVideoElement)return{height:t.videoHeight,width:t.videoWidth};if(t instanceof HTMLImageElement)return{height:t.naturalHeight||t.height,width:t.naturalWidth||t.width};throw new Error("Couldn't find the Source's dimentions!")},t.createCaptureCanvas=function(e){if(!e)throw new Cr("Cannot create a capture canvas without a media element.");if("undefined"==typeof document)throw new Error('The page "Document" is undefined, make sure you\'re running in a browser.');var r=document.createElement("canvas"),n=t.getMediaElementDimensions(e),o=n.width,i=n.height;return r.style.width=o+"px",r.style.height=i+"px",r.width=o,r.height=i,r},t.tryPlayVideo=function(e){return ps(this,0,void 0,function(){var r;return gs(this,function(n){switch(n.label){case 0:if(null==e?void 0:e.ended)return console.error("Trying to play video that has ended."),[2,!1];if(t.isVideoPlaying(e))return console.warn("Trying to play video that is already playing."),[2,!0];n.label=1;case 1:return n.trys.push([1,3,,4]),[4,e.play()];case 2:return n.sent(),[2,!0];case 3:return r=n.sent(),console.warn("It was not possible to play the video.",r),[2,!1];case 4:return[2]}})})},t.createCanvasFromMediaElement=function(e){var r=t.createCaptureCanvas(e),n=r.getContext("2d");if(!n)throw new Error("Couldn't find Canvas 2D Context.");return t.drawImageOnCanvas(n,e),r},t.createBinaryBitmapFromMediaElem=function(e){var r=t.createCanvasFromMediaElement(e);return t.createBinaryBitmapFromCanvas(r)},t.destroyImageElement=function(t){t.src="",t.removeAttribute("src"),t=void 0},t.listVideoInputDevices=function(){return ps(this,0,void 0,function(){var t,e,r,n,o,i,a,s,c,u,l,f;return gs(this,function(d){switch(d.label){case 0:if(!ds())throw new Error("Can't enumerate devices, navigator is not present.");if(!(ds()&&navigator.mediaDevices&&navigator.mediaDevices.enumerateDevices))throw new Error("Can't enumerate devices, method not supported.");return[4,navigator.mediaDevices.enumerateDevices()];case 1:t=d.sent(),e=[];try{for(r=ms(t),n=r.next();!n.done;n=r.next())o=n.value,"videoinput"===(i="video"===o.kind?"videoinput":o.kind)&&(a=o.deviceId||o.id,s=o.label||"Video device "+(e.length+1),c=o.groupId,u={deviceId:a,label:s,kind:i,groupId:c},e.push(u))}catch(h){l={error:h}}finally{try{n&&!n.done&&(f=r.return)&&f.call(r)}finally{if(l)throw l.error}}return[2,e]}})})},t.findDeviceById=function(e){return ps(this,0,void 0,function(){var r;return gs(this,function(n){switch(n.label){case 0:return[4,t.listVideoInputDevices()];case 1:return(r=n.sent())?[2,r.find(function(t){return t.deviceId===e})]:[2]}})})},t.cleanVideoSource=function(t){if(t){try{t.srcObject=null}catch(e){t.src=""}t&&t.removeAttribute("src")}},t.playVideoOnLoadAsync=function(e,r){return ps(this,0,void 0,function(){return gs(this,function(n){switch(n.label){case 0:return[4,t.tryPlayVideo(e)];case 1:return n.sent()?[2,!0]:[2,new Promise(function(n,o){var i=setTimeout(function(){t.isVideoPlaying(e)||(o(!1),e.removeEventListener("canplay",a))},r),a=function(){t.tryPlayVideo(e).then(function(t){clearTimeout(i),e.removeEventListener("canplay",a),n(t)})};e.addEventListener("canplay",a)})]}})})},t.attachStreamToVideo=function(e,r,n){return void 0===n&&(n=5e3),ps(this,0,void 0,function(){var o;return gs(this,function(i){switch(i.label){case 0:return o=t.prepareVideoElement(r),t.addVideoSource(o,e),[4,t.playVideoOnLoadAsync(o,n)];case 1:return i.sent(),[2,o]}})})},t._waitImageLoad=function(e){return new Promise(function(r,n){var o=setTimeout(function(){t.isImageLoaded(e)||(e.removeEventListener("load",i),n())},1e4),i=function(){clearTimeout(o),e.removeEventListener("load",i),r()};e.addEventListener("load",i)})},t.checkCallbackFnOrThrow=function(t){if(!t)throw new Cr("`callbackFn` is a required parameter, you cannot capture results without it.")},t.disposeMediaStream=function(t){t.getVideoTracks().forEach(function(t){return t.stop()}),t=void 0},t.prototype.decode=function(e){var r=t.createCanvasFromMediaElement(e);return this.decodeFromCanvas(r)},t.prototype.decodeBitmap=function(t){return this.reader.decode(t,this.hints)},t.prototype.decodeFromCanvas=function(e){var r=t.createBinaryBitmapFromCanvas(e);return this.decodeBitmap(r)},t.prototype.decodeFromImageElement=function(e){return ps(this,0,void 0,function(){var r;return gs(this,function(n){switch(n.label){case 0:if(!e)throw new Cr("An image element must be provided.");return r=t.prepareImageElement(e),[4,this._decodeOnLoadImage(r)];case 1:return[2,n.sent()]}})})},t.prototype.decodeFromImageUrl=function(e){return ps(this,0,void 0,function(){var r;return gs(this,function(n){switch(n.label){case 0:if(!e)throw new Cr("An URL must be provided.");(r=t.prepareImageElement()).src=e,n.label=1;case 1:return n.trys.push([1,,3,4]),[4,this.decodeFromImageElement(r)];case 2:return[2,n.sent()];case 3:return t.destroyImageElement(r),[7];case 4:return[2]}})})},t.prototype.decodeFromConstraints=function(e,r,n){return ps(this,0,void 0,function(){var o,i;return gs(this,function(a){switch(a.label){case 0:return t.checkCallbackFnOrThrow(n),[4,navigator.mediaDevices.getUserMedia(e)];case 1:o=a.sent(),a.label=2;case 2:return a.trys.push([2,4,,5]),[4,this.decodeFromStream(o,r,n)];case 3:return[2,a.sent()];case 4:throw i=a.sent(),t.disposeMediaStream(o),i;case 5:return[2]}})})},t.prototype.decodeFromStream=function(e,r,n){return ps(this,0,void 0,function(){var o,i,a,s,c,u,l,f,d,h,p=this;return gs(this,function(g){switch(g.label){case 0:return t.checkCallbackFnOrThrow(n),o=this.options.tryPlayVideoTimeout,[4,t.attachStreamToVideo(e,r,o)];case 1:return i=g.sent(),a=function(){var t,r;try{for(var n=ms(e.getVideoTracks()),o=n.next();!o.done;o=n.next())o.value.stop()}catch(i){t={error:i}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(t)throw t.error}}e=void 0},s=function(){a(),t.cleanVideoSource(i)},c=this.scan(i,n,s),u=e.getVideoTracks(),l=hs(hs({},c),{stop:function(){c.stop()},streamVideoConstraintsApply:function(t,e){return ps(this,0,void 0,function(){var r,n,o,i,a,s;return gs(this,function(c){switch(c.label){case 0:r=e?u.filter(e):u,c.label=1;case 1:c.trys.push([1,6,7,8]),n=ms(r),o=n.next(),c.label=2;case 2:return o.done?[3,5]:[4,o.value.applyConstraints(t)];case 3:c.sent(),c.label=4;case 4:return o=n.next(),[3,2];case 5:return[3,8];case 6:return i=c.sent(),a={error:i},[3,8];case 7:try{o&&!o.done&&(s=n.return)&&s.call(n)}finally{if(a)throw a.error}return[7];case 8:return[2]}})})},streamVideoConstraintsGet:function(t){return u.find(t).getConstraints()},streamVideoSettingsGet:function(t){return u.find(t).getSettings()},streamVideoCapabilitiesGet:function(t){return u.find(t).getCapabilities()}}),t.mediaStreamIsTorchCompatible(e)&&(f=null==u?void 0:u.find(function(e){return t.mediaStreamIsTorchCompatibleTrack(e)}),d=function(e){return ps(p,0,void 0,function(){return gs(this,function(r){switch(r.label){case 0:return[4,t.mediaStreamSetTorch(f,e)];case 1:return r.sent(),[2]}})})},l.switchTorch=d,h=function(){c.stop(),d(!1)},l.stop=h),[2,l]}})})},t.prototype.decodeFromVideoDevice=function(e,r,n){return ps(this,0,void 0,function(){var o;return gs(this,function(i){switch(i.label){case 0:return t.checkCallbackFnOrThrow(n),o={video:e?{deviceId:{exact:e}}:{facingMode:"environment"}},[4,this.decodeFromConstraints(o,r,n)];case 1:return[2,i.sent()]}})})},t.prototype.decodeFromVideoElement=function(e,r){return ps(this,0,void 0,function(){var n,o;return gs(this,function(i){switch(i.label){case 0:if(t.checkCallbackFnOrThrow(r),!e)throw new Cr("A video element must be provided.");return n=t.prepareVideoElement(e),o=this.options.tryPlayVideoTimeout,[4,t.playVideoOnLoadAsync(n,o)];case 1:return i.sent(),[2,this.scan(n,r)]}})})},t.prototype.decodeFromVideoUrl=function(e,r){return ps(this,0,void 0,function(){var n,o,i;return gs(this,function(a){switch(a.label){case 0:if(t.checkCallbackFnOrThrow(r),!e)throw new Cr("An URL must be provided.");return(n=t.prepareVideoElement()).src=e,o=function(){t.cleanVideoSource(n)},i=this.options.tryPlayVideoTimeout,[4,t.playVideoOnLoadAsync(n,i)];case 1:return a.sent(),[2,this.scan(n,r,o)]}})})},t.prototype.decodeOnceFromConstraints=function(t,e){return ps(this,0,void 0,function(){var r;return gs(this,function(n){switch(n.label){case 0:return[4,navigator.mediaDevices.getUserMedia(t)];case 1:return r=n.sent(),[4,this.decodeOnceFromStream(r,e)];case 2:return[2,n.sent()]}})})},t.prototype.decodeOnceFromStream=function(e,r){return ps(this,0,void 0,function(){var n,o;return gs(this,function(i){switch(i.label){case 0:return n=Boolean(r),[4,t.attachStreamToVideo(e,r)];case 1:o=i.sent(),i.label=2;case 2:return i.trys.push([2,,4,5]),[4,this.scanOneResult(o)];case 3:return[2,i.sent()];case 4:return n||t.cleanVideoSource(o),[7];case 5:return[2]}})})},t.prototype.decodeOnceFromVideoDevice=function(t,e){return ps(this,0,void 0,function(){var r;return gs(this,function(n){switch(n.label){case 0:return r={video:t?{deviceId:{exact:t}}:{facingMode:"environment"}},[4,this.decodeOnceFromConstraints(r,e)];case 1:return[2,n.sent()]}})})},t.prototype.decodeOnceFromVideoElement=function(e){return ps(this,0,void 0,function(){var r,n;return gs(this,function(o){switch(o.label){case 0:if(!e)throw new Cr("A video element must be provided.");return r=t.prepareVideoElement(e),n=this.options.tryPlayVideoTimeout,[4,t.playVideoOnLoadAsync(r,n)];case 1:return o.sent(),[4,this.scanOneResult(r)];case 2:return[2,o.sent()]}})})},t.prototype.decodeOnceFromVideoUrl=function(e){return ps(this,0,void 0,function(){var r,n;return gs(this,function(o){switch(o.label){case 0:if(!e)throw new Cr("An URL must be provided.");(r=t.prepareVideoElement()).src=e,n=this.decodeOnceFromVideoElement(r),o.label=1;case 1:return o.trys.push([1,,3,4]),[4,n];case 2:return[2,o.sent()];case 3:return t.cleanVideoSource(r),[7];case 4:return[2]}})})},t.prototype.scanOneResult=function(t,e,r,n){var o=this;return void 0===e&&(e=!0),void 0===r&&(r=!0),void 0===n&&(n=!0),new Promise(function(i,a){o.scan(t,function(t,o,s){if(t)return i(t),void s.stop();if(o){if(o instanceof Kr&&e)return;if(o instanceof Or&&r)return;if(o instanceof Vr&&n)return;s.stop(),a(o)}})})},t.prototype.scan=function(e,r,n){var o=this;t.checkCallbackFnOrThrow(r);var i=t.createCaptureCanvas(e),a=i.getContext("2d");if(!a)throw new Error("Couldn't create canvas for visual element scan.");var s,c=function(){a=void 0,i=void 0},u=!1,l={stop:function(){u=!0,clearTimeout(s),c(),n&&n()}},f=function(){if(!u)try{t.drawImageOnCanvas(a,e);var d=o.decodeFromCanvas(i);r(d,void 0,l),s=setTimeout(f,o.options.delayBetweenScanSuccess)}catch(h){if(r(void 0,h,l),h instanceof Or||h instanceof Vr||h instanceof Kr)return void(s=setTimeout(f,o.options.delayBetweenScanAttempts));c(),n&&n(h)}};return f(),l},t.prototype._decodeOnLoadImage=function(e){return ps(this,0,void 0,function(){return gs(this,function(r){switch(r.label){case 0:return t.isImageLoaded(e)?[3,2]:[4,t._waitImageLoad(e)];case 1:r.sent(),r.label=2;case 2:return[2,this.decode(e)]}})})},t}(),_s=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();!function(t){_s(function(e,r){return t.call(this,new Wn,e,r)||this},t)}(ys);var ws=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();!function(t){ws(function(e,r){return t.call(this,new yi(e),e,r)||this},t)}(ys);var bs=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();!function(t){bs(function(e,r){return t.call(this,new Pi,e,r)||this},t)}(ys);var Cs=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();!function(t){function e(e,r){var n=this,o=new Ya;return o.setHints(e),(n=t.call(this,o,e,r)||this).reader=o,n}Cs(e,t),Object.defineProperty(e.prototype,"possibleFormats",{set:function(t){this.hints.set(Br.POSSIBLE_FORMATS,t),this.reader.setHints(this.hints)},enumerable:!1,configurable:!0}),e.prototype.decodeBitmap=function(t){return this.reader.decodeWithState(t)},e.prototype.setHints=function(t){this.hints=t,this.reader.setHints(this.hints)}}(ys);var As=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();!function(t){As(function(e,r){return t.call(this,new za,e,r)||this},t)}(ys);var Es=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Is=function(t){function e(e,r){return t.call(this,new ca,e,r)||this}return Es(e,t),e}(ys),Ss=function(t,e,r){var n=typeof t===r;return n||console.warn('[ReactQrReader]: Expected "'.concat(e,'" to be a of type "').concat(r,'".')),n},Os=function(){return Os=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},Os.apply(this,arguments)},Ts={width:"100%",paddingTop:"100%",overflow:"hidden",position:"relative"},Ns={top:0,left:0,width:"100%",height:"100%",display:"block",overflow:"hidden",position:"absolute",transform:void 0},xs=function(t){var r=t.videoContainerStyle,n=t.containerStyle,o=t.videoStyle,i=t.constraints,a=t.ViewFinder,s=t.scanDelay,c=t.className,u=t.onResult,l=t.videoId;return function(t){var r=t.scanDelay,n=t.constraints,o=t.onResult,i=t.videoId,a=e.useRef(null);e.useEffect(function(){var t,e=new Is(null,{delayBetweenScanAttempts:r});return(t="undefined"!=typeof navigator&&!!navigator.mediaDevices)||console.warn('[ReactQrReader]: MediaDevices API has no support for your browser. You can fix this by running "npm i webrtc-adapter"'),!t&&Ss(o,"onResult","function")&&o(null,new Error('MediaDevices API has no support for your browser. You can fix this by running "npm i webrtc-adapter"'),e),Ss(n,"constraints","object")&&e.decodeFromConstraints({video:n},i,function(t,r){Ss(o,"onResult","function")&&o(t,r,e)}).then(function(t){return a.current=t}).catch(function(t){Ss(o,"onResult","function")&&o(null,t,e)}),function(){var t;null===(t=a.current)||void 0===t||t.stop()}},[])}({constraints:i,scanDelay:s,onResult:u,videoId:l}),f.createElement("section",{className:c,style:n},f.createElement("div",{style:Os(Os({},Ts),r)},!!a&&f.createElement(a,null),f.createElement("video",{muted:!0,id:l,style:Os(Os(Os({},Ns),o),{transform:"user"===(null==i?void 0:i.facingMode)&&"scaleX(-1)"})})))};function Rs({onResult:t,setVisible:r,title:n,helpLink:o}){const[i,a]=e.useState(""),[s,c]=e.useState(!1);return Qt.jsxs(Qt.Fragment,{children:[Qt.jsxs(lr,{visible:!0,setVisible:r,hideScrollBar:!1,maxWidth:500,children:[Qt.jsx(hr,{helpLink:o,setVisible:r,children:n}),Qt.jsx(dr,{children:Qt.jsx(fr,{children:Qt.jsxs("div",{className:"position-relative my-2",children:[Qt.jsx(xs,{onResult:function(e,n){(null==n?void 0:n.message)&&(a(`Ocorreu um erro ao fazer a leitura: ${n.message}`),"Requested device not found"===n.message&&c(!0)),e&&t&&(t(e),r(!1))},constraints:{facingMode:"environment"}}),Qt.jsxs("svg",{width:"50px",viewBox:"0 0 100 100",style:{top:"0px",left:"0px",zIndex:1,boxSizing:"border-box",border:"50px solid rgba(0, 0, 0, 0.25)",borderRadius:"15px",position:"absolute",width:"100%",height:"100%"},children:[Qt.jsx("path",{fill:"none",d:"M13,0 L0,0 L0,13",stroke:"rgba(255, 0, 0, 0.5)",strokeWidth:"5"}),Qt.jsx("path",{fill:"none",d:"M0,87 L0,100 L13,100",stroke:"rgba(255, 0, 0, 0.5)",strokeWidth:"5"}),Qt.jsx("path",{fill:"none",d:"M87,100 L100,100 L100,87",stroke:"rgba(255, 0, 0, 0.5)",strokeWidth:"5"}),Qt.jsx("path",{fill:"none",d:"M100,13 L100,0 87,0",stroke:"rgba(255, 0, 0, 0.5)",strokeWidth:"5"})]})]})})})]}),i&&Qt.jsx(se,{onConfirm:function(){a(),s&&r(!1)},children:i})]})}xs.displayName="QrReader",xs.defaultProps={constraints:{facingMode:"user"},videoId:"video",scanDelay:500};const Ds=o.div`
534
+ `,lr="modal-hide-sb";function cr({maxWidth:t,visible:n,setVisible:o,children:i,hideScrollBar:a=!0,id:s,alignTop:u}){const{addModal:l,removeModal:c}=ee(),[h]=e.useState(s||"modal-"+r.random());return e.useEffect(()=>(n?a&&document.body.classList.add(lr):(c(h),a&&document.body.classList.remove(lr)),()=>{c(h),a&&document.body.classList.remove(lr)}),[n,a]),e.useEffect(()=>{l(h,o)},[h]),n?Qt.jsx(ur,{alignTop:u,maxWidth:t,children:Qt.jsx("div",{className:"mod-panel",children:i})}):null}function hr({className:t="",...e}){return Qt.jsx("div",{className:`modal--body ${t}`,...e})}function fr({className:t="",...e}){return Qt.jsx("div",{className:`modal--content ${t}`,...e})}function dr({className:t="",setVisible:e,children:r,helpLink:n,...o}){return Qt.jsxs(He,{className:`modal--header ${t}`,...o,children:[Qt.jsx("span",{className:"pn-title",children:r}),n&&Qt.jsx(Me,{title:"Ir para a ajuda",onClick:()=>window.open(n,"_blank")}),Qt.jsx(Pe,{type:"button",onClick:()=>e(!1)})]})}var pr,gr,mr,vr=(pr=function(t,e){return(pr=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}pr(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),yr=function(t){function e(e){var r,n,o,i=this.constructor,a=t.call(this,e)||this;return Object.defineProperty(a,"name",{value:i.name,enumerable:!1,configurable:!0}),r=a,n=i.prototype,(o=Object.setPrototypeOf)?o(r,n):r.__proto__=n,function(t,e){void 0===e&&(e=t.constructor);var r=Error.captureStackTrace;r&&r(t,e)}(a),a}return vr(e,t),e}(Error),_r=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),wr=function(t){function e(e){void 0===e&&(e=void 0);var r=t.call(this,e)||this;return r.message=e,r}return _r(e,t),e.prototype.getKind=function(){return this.constructor.kind},e.kind="Exception",e}(yr),br=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Cr=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return br(e,t),e.kind="ArgumentException",e}(wr),Ar=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Er=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Ar(e,t),e.kind="IllegalArgumentException",e}(wr),Ir=function(){function t(t){if(this.binarizer=t,null===t)throw new Er("Binarizer must be non-null.")}return t.prototype.getWidth=function(){return this.binarizer.getWidth()},t.prototype.getHeight=function(){return this.binarizer.getHeight()},t.prototype.getBlackRow=function(t,e){return this.binarizer.getBlackRow(t,e)},t.prototype.getBlackMatrix=function(){return null!==this.matrix&&void 0!==this.matrix||(this.matrix=this.binarizer.getBlackMatrix()),this.matrix},t.prototype.isCropSupported=function(){return this.binarizer.getLuminanceSource().isCropSupported()},t.prototype.crop=function(e,r,n,o){var i=this.binarizer.getLuminanceSource().crop(e,r,n,o);return new t(this.binarizer.createBinarizer(i))},t.prototype.isRotateSupported=function(){return this.binarizer.getLuminanceSource().isRotateSupported()},t.prototype.rotateCounterClockwise=function(){var e=this.binarizer.getLuminanceSource().rotateCounterClockwise();return new t(this.binarizer.createBinarizer(e))},t.prototype.rotateCounterClockwise45=function(){var e=this.binarizer.getLuminanceSource().rotateCounterClockwise45();return new t(this.binarizer.createBinarizer(e))},t.prototype.toString=function(){try{return this.getBlackMatrix().toString()}catch(t){return""}},t}(),Sr=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),xr=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Sr(e,t),e.getChecksumInstance=function(){return new e},e.kind="ChecksumException",e}(wr),Or=function(){function t(t){this.source=t}return t.prototype.getLuminanceSource=function(){return this.source},t.prototype.getWidth=function(){return this.source.getWidth()},t.prototype.getHeight=function(){return this.source.getHeight()},t}(),Tr=function(){function t(){}return t.arraycopy=function(t,e,r,n,o){for(;o--;)r[n++]=t[e++]},t.currentTimeMillis=function(){return Date.now()},t}(),Nr=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),kr=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Nr(e,t),e.kind="IndexOutOfBoundsException",e}(wr),Rr=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Dr=function(t){function e(e,r){void 0===e&&(e=void 0),void 0===r&&(r=void 0);var n=t.call(this,r)||this;return n.index=e,n.message=r,n}return Rr(e,t),e.kind="ArrayIndexOutOfBoundsException",e}(kr),Pr=function(){function t(){}return t.fill=function(t,e){for(var r=0,n=t.length;r<n;r++)t[r]=e},t.fillWithin=function(e,r,n,o){t.rangeCheck(e.length,r,n);for(var i=r;i<n;i++)e[i]=o},t.rangeCheck=function(t,e,r){if(e>r)throw new Er("fromIndex("+e+") > toIndex("+r+")");if(e<0)throw new Dr(e);if(r>t)throw new Dr(r)},t.asList=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return t},t.create=function(t,e,r){return Array.from({length:t}).map(function(t){return Array.from({length:e}).fill(r)})},t.createInt32Array=function(t,e,r){return Array.from({length:t}).map(function(t){return Int32Array.from({length:e}).fill(r)})},t.equals=function(t,e){if(!t)return!1;if(!e)return!1;if(!t.length)return!1;if(!e.length)return!1;if(t.length!==e.length)return!1;for(var r=0,n=t.length;r<n;r++)if(t[r]!==e[r])return!1;return!0},t.hashCode=function(t){var e,r;if(null===t)return 0;var n=1;try{for(var o=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}(t),i=o.next();!i.done;i=o.next())n=31*n+i.value}catch(a){e={error:a}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(e)throw e.error}}return n},t.fillUint8Array=function(t,e){for(var r=0;r!==t.length;r++)t[r]=e},t.copyOf=function(t,e){return t.slice(0,e)},t.copyOfUint8Array=function(t,e){if(t.length<=e){var r=new Uint8Array(e);return r.set(t),r}return t.slice(0,e)},t.copyOfRange=function(t,e,r){var n=r-e,o=new Int32Array(n);return Tr.arraycopy(t,e,o,0,n),o},t.binarySearch=function(e,r,n){void 0===n&&(n=t.numberComparator);for(var o=0,i=e.length-1;o<=i;){var a=i+o>>1,s=n(r,e[a]);if(s>0)o=a+1;else{if(!(s<0))return a;i=a-1}}return-o-1},t.numberComparator=function(t,e){return t-e},t}(),Mr=function(){function t(){}return t.numberOfTrailingZeros=function(t){var e;if(0===t)return 32;var r=31;return 0!=(e=t<<16)&&(r-=16,t=e),0!=(e=t<<8)&&(r-=8,t=e),0!=(e=t<<4)&&(r-=4,t=e),0!=(e=t<<2)&&(r-=2,t=e),r-(t<<1>>>31)},t.numberOfLeadingZeros=function(t){if(0===t)return 32;var e=1;return t>>>16==0&&(e+=16,t<<=16),t>>>24==0&&(e+=8,t<<=8),t>>>28==0&&(e+=4,t<<=4),t>>>30==0&&(e+=2,t<<=2),e-(t>>>31)},t.toHexString=function(t){return t.toString(16)},t.toBinaryString=function(t){return String(parseInt(String(t),2))},t.bitCount=function(t){return t=(t=(858993459&(t-=t>>>1&1431655765))+(t>>>2&858993459))+(t>>>4)&252645135,63&(t+=t>>>8)+(t>>>16)},t.truncDivision=function(t,e){return Math.trunc(t/e)},t.parseInt=function(t,e){return void 0===e&&(e=void 0),parseInt(t,e)},t.MIN_VALUE_32_BITS=-2147483648,t.MAX_VALUE=Number.MAX_SAFE_INTEGER,t}(),Br=function(){function t(e,r){void 0===e?(this.size=0,this.bits=new Int32Array(1)):(this.size=e,this.bits=null==r?t.makeArray(e):r)}return t.prototype.getSize=function(){return this.size},t.prototype.getSizeInBytes=function(){return Math.floor((this.size+7)/8)},t.prototype.ensureCapacity=function(e){if(e>32*this.bits.length){var r=t.makeArray(e);Tr.arraycopy(this.bits,0,r,0,this.bits.length),this.bits=r}},t.prototype.get=function(t){return!!(this.bits[Math.floor(t/32)]&1<<(31&t))},t.prototype.set=function(t){this.bits[Math.floor(t/32)]|=1<<(31&t)},t.prototype.flip=function(t){this.bits[Math.floor(t/32)]^=1<<(31&t)},t.prototype.getNextSet=function(t){var e=this.size;if(t>=e)return e;var r=this.bits,n=Math.floor(t/32),o=r[n];o&=~((1<<(31&t))-1);for(var i=r.length;0===o;){if(++n===i)return e;o=r[n]}var a=32*n+Mr.numberOfTrailingZeros(o);return a>e?e:a},t.prototype.getNextUnset=function(t){var e=this.size;if(t>=e)return e;var r=this.bits,n=Math.floor(t/32),o=~r[n];o&=~((1<<(31&t))-1);for(var i=r.length;0===o;){if(++n===i)return e;o=~r[n]}var a=32*n+Mr.numberOfTrailingZeros(o);return a>e?e:a},t.prototype.setBulk=function(t,e){this.bits[Math.floor(t/32)]=e},t.prototype.setRange=function(t,e){if(e<t||t<0||e>this.size)throw new Er;if(e!==t){e--;for(var r=Math.floor(t/32),n=Math.floor(e/32),o=this.bits,i=r;i<=n;i++){var a=(2<<(i<n?31:31&e))-(1<<(i>r?0:31&t));o[i]|=a}}},t.prototype.clear=function(){for(var t=this.bits.length,e=this.bits,r=0;r<t;r++)e[r]=0},t.prototype.isRange=function(t,e,r){if(e<t||t<0||e>this.size)throw new Er;if(e===t)return!0;e--;for(var n=Math.floor(t/32),o=Math.floor(e/32),i=this.bits,a=n;a<=o;a++){var s=(2<<(a<o?31:31&e))-(1<<(a>n?0:31&t))&4294967295;if((i[a]&s)!==(r?s:0))return!1}return!0},t.prototype.appendBit=function(t){this.ensureCapacity(this.size+1),t&&(this.bits[Math.floor(this.size/32)]|=1<<(31&this.size)),this.size++},t.prototype.appendBits=function(t,e){if(e<0||e>32)throw new Er("Num bits must be between 0 and 32");this.ensureCapacity(this.size+e);for(var r=e;r>0;r--)this.appendBit(1==(t>>r-1&1))},t.prototype.appendBitArray=function(t){var e=t.size;this.ensureCapacity(this.size+e);for(var r=0;r<e;r++)this.appendBit(t.get(r))},t.prototype.xor=function(t){if(this.size!==t.size)throw new Er("Sizes don't match");for(var e=this.bits,r=0,n=e.length;r<n;r++)e[r]^=t.bits[r]},t.prototype.toBytes=function(t,e,r,n){for(var o=0;o<n;o++){for(var i=0,a=0;a<8;a++)this.get(t)&&(i|=1<<7-a),t++;e[r+o]=i}},t.prototype.getBitArray=function(){return this.bits},t.prototype.reverse=function(){for(var t=new Int32Array(this.bits.length),e=Math.floor((this.size-1)/32),r=e+1,n=this.bits,o=0;o<r;o++){var i=n[o];i=(i=(i=(i=(i=i>>1&1431655765|(1431655765&i)<<1)>>2&858993459|(858993459&i)<<2)>>4&252645135|(252645135&i)<<4)>>8&16711935|(16711935&i)<<8)>>16&65535|(65535&i)<<16,t[e-o]=i}if(this.size!==32*r){var a=32*r-this.size,s=t[0]>>>a;for(o=1;o<r;o++){var u=t[o];s|=u<<32-a,t[o-1]=s,s=u>>>a}t[r-1]=s}this.bits=t},t.makeArray=function(t){return new Int32Array(Math.floor((t+31)/32))},t.prototype.equals=function(e){if(!(e instanceof t))return!1;var r=e;return this.size===r.size&&Pr.equals(this.bits,r.bits)},t.prototype.hashCode=function(){return 31*this.size+Pr.hashCode(this.bits)},t.prototype.toString=function(){for(var t="",e=0,r=this.size;e<r;e++)!(7&e)&&(t+=" "),t+=this.get(e)?"X":".";return t},t.prototype.clone=function(){return new t(this.size,this.bits.slice())},t}();(mr=gr||(gr={}))[mr.OTHER=0]="OTHER",mr[mr.PURE_BARCODE=1]="PURE_BARCODE",mr[mr.POSSIBLE_FORMATS=2]="POSSIBLE_FORMATS",mr[mr.TRY_HARDER=3]="TRY_HARDER",mr[mr.CHARACTER_SET=4]="CHARACTER_SET",mr[mr.ALLOWED_LENGTHS=5]="ALLOWED_LENGTHS",mr[mr.ASSUME_CODE_39_CHECK_DIGIT=6]="ASSUME_CODE_39_CHECK_DIGIT",mr[mr.ASSUME_GS1=7]="ASSUME_GS1",mr[mr.RETURN_CODABAR_START_END=8]="RETURN_CODABAR_START_END",mr[mr.NEED_RESULT_POINT_CALLBACK=9]="NEED_RESULT_POINT_CALLBACK",mr[mr.ALLOWED_EAN_EXTENSIONS=10]="ALLOWED_EAN_EXTENSIONS";var Lr,Fr=gr,jr=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Vr=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return jr(e,t),e.getFormatInstance=function(){return new e},e.kind="FormatException",e}(wr);!function(t){t[t.Cp437=0]="Cp437",t[t.ISO8859_1=1]="ISO8859_1",t[t.ISO8859_2=2]="ISO8859_2",t[t.ISO8859_3=3]="ISO8859_3",t[t.ISO8859_4=4]="ISO8859_4",t[t.ISO8859_5=5]="ISO8859_5",t[t.ISO8859_6=6]="ISO8859_6",t[t.ISO8859_7=7]="ISO8859_7",t[t.ISO8859_8=8]="ISO8859_8",t[t.ISO8859_9=9]="ISO8859_9",t[t.ISO8859_10=10]="ISO8859_10",t[t.ISO8859_11=11]="ISO8859_11",t[t.ISO8859_13=12]="ISO8859_13",t[t.ISO8859_14=13]="ISO8859_14",t[t.ISO8859_15=14]="ISO8859_15",t[t.ISO8859_16=15]="ISO8859_16",t[t.SJIS=16]="SJIS",t[t.Cp1250=17]="Cp1250",t[t.Cp1251=18]="Cp1251",t[t.Cp1252=19]="Cp1252",t[t.Cp1256=20]="Cp1256",t[t.UnicodeBigUnmarked=21]="UnicodeBigUnmarked",t[t.UTF8=22]="UTF8",t[t.ASCII=23]="ASCII",t[t.Big5=24]="Big5",t[t.GB18030=25]="GB18030",t[t.EUC_KR=26]="EUC_KR"}(Lr||(Lr={}));var Ur,Hr=function(){function t(e,r,n){for(var o,i,a=[],s=3;s<arguments.length;s++)a[s-3]=arguments[s];this.valueIdentifier=e,this.name=n,this.values="number"==typeof r?Int32Array.from([r]):r,this.otherEncodingNames=a,t.VALUE_IDENTIFIER_TO_ECI.set(e,this),t.NAME_TO_ECI.set(n,this);for(var u=this.values,l=0,c=u.length;l!==c;l++){var h=u[l];t.VALUES_TO_ECI.set(h,this)}try{for(var f=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}(a),d=f.next();!d.done;d=f.next()){var p=d.value;t.NAME_TO_ECI.set(p,this)}}catch(g){o={error:g}}finally{try{d&&!d.done&&(i=f.return)&&i.call(f)}finally{if(o)throw o.error}}}return t.prototype.getValueIdentifier=function(){return this.valueIdentifier},t.prototype.getName=function(){return this.name},t.prototype.getValue=function(){return this.values[0]},t.getCharacterSetECIByValue=function(e){if(e<0||e>=900)throw new Vr("incorect value");var r=t.VALUES_TO_ECI.get(e);if(void 0===r)throw new Vr("incorect value");return r},t.getCharacterSetECIByName=function(e){var r=t.NAME_TO_ECI.get(e);if(void 0===r)throw new Vr("incorect value");return r},t.prototype.equals=function(e){if(!(e instanceof t))return!1;var r=e;return this.getName()===r.getName()},t.VALUE_IDENTIFIER_TO_ECI=new Map,t.VALUES_TO_ECI=new Map,t.NAME_TO_ECI=new Map,t.Cp437=new t(Lr.Cp437,Int32Array.from([0,2]),"Cp437"),t.ISO8859_1=new t(Lr.ISO8859_1,Int32Array.from([1,3]),"ISO-8859-1","ISO88591","ISO8859_1"),t.ISO8859_2=new t(Lr.ISO8859_2,4,"ISO-8859-2","ISO88592","ISO8859_2"),t.ISO8859_3=new t(Lr.ISO8859_3,5,"ISO-8859-3","ISO88593","ISO8859_3"),t.ISO8859_4=new t(Lr.ISO8859_4,6,"ISO-8859-4","ISO88594","ISO8859_4"),t.ISO8859_5=new t(Lr.ISO8859_5,7,"ISO-8859-5","ISO88595","ISO8859_5"),t.ISO8859_6=new t(Lr.ISO8859_6,8,"ISO-8859-6","ISO88596","ISO8859_6"),t.ISO8859_7=new t(Lr.ISO8859_7,9,"ISO-8859-7","ISO88597","ISO8859_7"),t.ISO8859_8=new t(Lr.ISO8859_8,10,"ISO-8859-8","ISO88598","ISO8859_8"),t.ISO8859_9=new t(Lr.ISO8859_9,11,"ISO-8859-9","ISO88599","ISO8859_9"),t.ISO8859_10=new t(Lr.ISO8859_10,12,"ISO-8859-10","ISO885910","ISO8859_10"),t.ISO8859_11=new t(Lr.ISO8859_11,13,"ISO-8859-11","ISO885911","ISO8859_11"),t.ISO8859_13=new t(Lr.ISO8859_13,15,"ISO-8859-13","ISO885913","ISO8859_13"),t.ISO8859_14=new t(Lr.ISO8859_14,16,"ISO-8859-14","ISO885914","ISO8859_14"),t.ISO8859_15=new t(Lr.ISO8859_15,17,"ISO-8859-15","ISO885915","ISO8859_15"),t.ISO8859_16=new t(Lr.ISO8859_16,18,"ISO-8859-16","ISO885916","ISO8859_16"),t.SJIS=new t(Lr.SJIS,20,"SJIS","Shift_JIS"),t.Cp1250=new t(Lr.Cp1250,21,"Cp1250","windows-1250"),t.Cp1251=new t(Lr.Cp1251,22,"Cp1251","windows-1251"),t.Cp1252=new t(Lr.Cp1252,23,"Cp1252","windows-1252"),t.Cp1256=new t(Lr.Cp1256,24,"Cp1256","windows-1256"),t.UnicodeBigUnmarked=new t(Lr.UnicodeBigUnmarked,25,"UnicodeBigUnmarked","UTF-16BE","UnicodeBig"),t.UTF8=new t(Lr.UTF8,26,"UTF8","UTF-8"),t.ASCII=new t(Lr.ASCII,Int32Array.from([27,170]),"ASCII","US-ASCII"),t.Big5=new t(Lr.Big5,28,"Big5"),t.GB18030=new t(Lr.GB18030,29,"GB18030","GB2312","EUC_CN","GBK"),t.EUC_KR=new t(Lr.EUC_KR,30,"EUC_KR","EUC-KR"),t}(),zr=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Wr=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return zr(e,t),e.kind="UnsupportedOperationException",e}(wr),Gr=function(){function t(){}return t.decode=function(t,e){var r=this.encodingName(e);return this.customDecoder?this.customDecoder(t,r):"undefined"==typeof TextDecoder||this.shouldDecodeOnFallback(r)?this.decodeFallback(t,r):new TextDecoder(r).decode(t)},t.shouldDecodeOnFallback=function(e){return!t.isBrowser()&&"ISO-8859-1"===e},t.encode=function(t,e){var r=this.encodingName(e);return this.customEncoder?this.customEncoder(t,r):"undefined"==typeof TextEncoder?this.encodeFallback(t):(new TextEncoder).encode(t)},t.isBrowser=function(){return"undefined"!=typeof window&&"[object Window]"==={}.toString.call(window)},t.encodingName=function(t){return"string"==typeof t?t:t.getName()},t.encodingCharacterSet=function(t){return t instanceof Hr?t:Hr.getCharacterSetECIByName(t)},t.decodeFallback=function(e,r){var n=this.encodingCharacterSet(r);if(t.isDecodeFallbackSupported(n)){for(var o="",i=0,a=e.length;i<a;i++){var s=e[i].toString(16);s.length<2&&(s="0"+s),o+="%"+s}return decodeURIComponent(o)}if(n.equals(Hr.UnicodeBigUnmarked))return String.fromCharCode.apply(null,new Uint16Array(e.buffer));throw new Wr("Encoding "+this.encodingName(r)+" not supported by fallback.")},t.isDecodeFallbackSupported=function(t){return t.equals(Hr.UTF8)||t.equals(Hr.ISO8859_1)||t.equals(Hr.ASCII)},t.encodeFallback=function(t){for(var e=btoa(unescape(encodeURIComponent(t))).split(""),r=[],n=0;n<e.length;n++)r.push(e[n].charCodeAt(0));return new Uint8Array(r)},t}(),Xr=function(){function t(){}return t.castAsNonUtf8Char=function(t,e){void 0===e&&(e=null);var r=e?e.getName():this.ISO88591;return Gr.decode(new Uint8Array([t]),r)},t.guessEncoding=function(e,r){if(null!=r&&void 0!==r.get(Fr.CHARACTER_SET))return r.get(Fr.CHARACTER_SET).toString();for(var n=e.length,o=!0,i=!0,a=!0,s=0,u=0,l=0,c=0,h=0,f=0,d=0,p=0,g=0,m=0,v=0,y=e.length>3&&239===e[0]&&187===e[1]&&191===e[2],_=0;_<n&&(o||i||a);_++){var w=255&e[_];a&&(s>0?128&w?s--:a=!1:!!(128&w)&&(64&w?(s++,32&w?(s++,16&w?(s++,8&w?a=!1:c++):l++):u++):a=!1)),o&&(w>127&&w<160?o=!1:w>159&&(w<192||215===w||247===w)&&v++),i&&(h>0?w<64||127===w||w>252?i=!1:h--:128===w||160===w||w>239?i=!1:w>160&&w<224?(f++,p=0,++d>g&&(g=d)):w>127?(h++,d=0,++p>m&&(m=p)):(d=0,p=0))}return a&&s>0&&(a=!1),i&&h>0&&(i=!1),a&&(y||u+l+c>0)?t.UTF8:i&&(t.ASSUME_SHIFT_JIS||g>=3||m>=3)?t.SHIFT_JIS:o&&i?2===g&&2===f||10*v>=n?t.SHIFT_JIS:t.ISO88591:o?t.ISO88591:i?t.SHIFT_JIS:a?t.UTF8:t.PLATFORM_DEFAULT_ENCODING},t.format=function(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];var n=-1;return t.replace(/%(-)?(0?[0-9]+)?([.][0-9]+)?([#][0-9]+)?([scfpexd%])/g,function(t,r,o,i,a,s){if("%%"===t)return"%";if(void 0!==e[++n]){t=i?parseInt(i.substr(1)):void 0;var u,l=a?parseInt(a.substr(1)):void 0;switch(s){case"s":u=e[n];break;case"c":u=e[n][0];break;case"f":u=parseFloat(e[n]).toFixed(t);break;case"p":u=parseFloat(e[n]).toPrecision(t);break;case"e":u=parseFloat(e[n]).toExponential(t);break;case"x":u=parseInt(e[n]).toString(l||16);break;case"d":u=parseFloat(parseInt(e[n],l||10).toPrecision(t)).toFixed(0)}u="object"==typeof u?JSON.stringify(u):(+u).toString(l);for(var c=parseInt(o),h=o&&o[0]+""=="0"?"0":" ";u.length<c;)u=void 0!==r?u+h:h+u;return u}})},t.getBytes=function(t,e){return Gr.encode(t,e)},t.getCharCode=function(t,e){return void 0===e&&(e=0),t.charCodeAt(e)},t.getCharAt=function(t){return String.fromCharCode(t)},t.SHIFT_JIS=Hr.SJIS.getName(),t.GB2312="GB2312",t.ISO88591=Hr.ISO8859_1.getName(),t.EUC_JP="EUC_JP",t.UTF8=Hr.UTF8.getName(),t.PLATFORM_DEFAULT_ENCODING=t.UTF8,t.ASSUME_SHIFT_JIS=!1,t}(),$r=function(){function t(t){void 0===t&&(t=""),this.value=t}return t.prototype.enableDecoding=function(t){return this.encoding=t,this},t.prototype.append=function(t){return"string"==typeof t?this.value+=t.toString():this.encoding?this.value+=Xr.castAsNonUtf8Char(t,this.encoding):this.value+=String.fromCharCode(t),this},t.prototype.appendChars=function(t,e,r){for(var n=e;e<e+r;n++)this.append(t[n]);return this},t.prototype.length=function(){return this.value.length},t.prototype.charAt=function(t){return this.value.charAt(t)},t.prototype.deleteCharAt=function(t){this.value=this.value.substr(0,t)+this.value.substring(t+1)},t.prototype.setCharAt=function(t,e){this.value=this.value.substr(0,t)+e+this.value.substr(t+1)},t.prototype.substring=function(t,e){return this.value.substring(t,e)},t.prototype.setLengthToZero=function(){this.value=""},t.prototype.toString=function(){return this.value},t.prototype.insert=function(t,e){this.value=this.value.substr(0,t)+e+this.value.substr(t+e.length)},t}(),Yr=function(){function t(t,e,r,n){if(this.width=t,this.height=e,this.rowSize=r,this.bits=n,null==e&&(e=t),this.height=e,t<1||e<1)throw new Er("Both dimensions must be greater than 0");null==r&&(r=Math.floor((t+31)/32)),this.rowSize=r,null==n&&(this.bits=new Int32Array(this.rowSize*this.height))}return t.parseFromBooleanArray=function(e){for(var r=e.length,n=e[0].length,o=new t(n,r),i=0;i<r;i++)for(var a=e[i],s=0;s<n;s++)a[s]&&o.set(s,i);return o},t.parseFromString=function(e,r,n){if(null===e)throw new Er("stringRepresentation cannot be null");for(var o=new Array(e.length),i=0,a=0,s=-1,u=0,l=0;l<e.length;)if("\n"===e.charAt(l)||"\r"===e.charAt(l)){if(i>a){if(-1===s)s=i-a;else if(i-a!==s)throw new Er("row lengths do not match");a=i,u++}l++}else if(e.substring(l,l+r.length)===r)l+=r.length,o[i]=!0,i++;else{if(e.substring(l,l+n.length)!==n)throw new Er("illegal character encountered: "+e.substring(l));l+=n.length,o[i]=!1,i++}if(i>a){if(-1===s)s=i-a;else if(i-a!==s)throw new Er("row lengths do not match");u++}for(var c=new t(s,u),h=0;h<i;h++)o[h]&&c.set(Math.floor(h%s),Math.floor(h/s));return c},t.prototype.get=function(t,e){var r=e*this.rowSize+Math.floor(t/32);return!!(this.bits[r]>>>(31&t)&1)},t.prototype.set=function(t,e){var r=e*this.rowSize+Math.floor(t/32);this.bits[r]|=1<<(31&t)&4294967295},t.prototype.unset=function(t,e){var r=e*this.rowSize+Math.floor(t/32);this.bits[r]&=~(1<<(31&t)&4294967295)},t.prototype.flip=function(t,e){var r=e*this.rowSize+Math.floor(t/32);this.bits[r]^=1<<(31&t)&4294967295},t.prototype.xor=function(t){if(this.width!==t.getWidth()||this.height!==t.getHeight()||this.rowSize!==t.getRowSize())throw new Er("input matrix dimensions do not match");for(var e=new Br(Math.floor(this.width/32)+1),r=this.rowSize,n=this.bits,o=0,i=this.height;o<i;o++)for(var a=o*r,s=t.getRow(o,e).getBitArray(),u=0;u<r;u++)n[a+u]^=s[u]},t.prototype.clear=function(){for(var t=this.bits,e=t.length,r=0;r<e;r++)t[r]=0},t.prototype.setRegion=function(t,e,r,n){if(e<0||t<0)throw new Er("Left and top must be nonnegative");if(n<1||r<1)throw new Er("Height and width must be at least 1");var o=t+r,i=e+n;if(i>this.height||o>this.width)throw new Er("The region must fit inside the matrix");for(var a=this.rowSize,s=this.bits,u=e;u<i;u++)for(var l=u*a,c=t;c<o;c++)s[l+Math.floor(c/32)]|=1<<(31&c)&4294967295},t.prototype.getRow=function(t,e){null==e||e.getSize()<this.width?e=new Br(this.width):e.clear();for(var r=this.rowSize,n=this.bits,o=t*r,i=0;i<r;i++)e.setBulk(32*i,n[o+i]);return e},t.prototype.setRow=function(t,e){Tr.arraycopy(e.getBitArray(),0,this.bits,t*this.rowSize,this.rowSize)},t.prototype.rotate180=function(){for(var t=this.getWidth(),e=this.getHeight(),r=new Br(t),n=new Br(t),o=0,i=Math.floor((e+1)/2);o<i;o++)r=this.getRow(o,r),n=this.getRow(e-1-o,n),r.reverse(),n.reverse(),this.setRow(o,n),this.setRow(e-1-o,r)},t.prototype.getEnclosingRectangle=function(){for(var t=this.width,e=this.height,r=this.rowSize,n=this.bits,o=t,i=e,a=-1,s=-1,u=0;u<e;u++)for(var l=0;l<r;l++){var c=n[u*r+l];if(0!==c){if(u<i&&(i=u),u>s&&(s=u),32*l<o){for(var h=0;!(c<<31-h&4294967295);)h++;32*l+h<o&&(o=32*l+h)}if(32*l+31>a){for(h=31;c>>>h==0;)h--;32*l+h>a&&(a=32*l+h)}}}return a<o||s<i?null:Int32Array.from([o,i,a-o+1,s-i+1])},t.prototype.getTopLeftOnBit=function(){for(var t=this.rowSize,e=this.bits,r=0;r<e.length&&0===e[r];)r++;if(r===e.length)return null;for(var n=r/t,o=r%t*32,i=e[r],a=0;!(i<<31-a&4294967295);)a++;return o+=a,Int32Array.from([o,n])},t.prototype.getBottomRightOnBit=function(){for(var t=this.rowSize,e=this.bits,r=e.length-1;r>=0&&0===e[r];)r--;if(r<0)return null;for(var n=Math.floor(r/t),o=32*Math.floor(r%t),i=e[r],a=31;i>>>a==0;)a--;return o+=a,Int32Array.from([o,n])},t.prototype.getWidth=function(){return this.width},t.prototype.getHeight=function(){return this.height},t.prototype.getRowSize=function(){return this.rowSize},t.prototype.equals=function(e){if(!(e instanceof t))return!1;var r=e;return this.width===r.width&&this.height===r.height&&this.rowSize===r.rowSize&&Pr.equals(this.bits,r.bits)},t.prototype.hashCode=function(){var t=this.width;return 31*(t=31*(t=31*(t=31*t+this.width)+this.height)+this.rowSize)+Pr.hashCode(this.bits)},t.prototype.toString=function(t,e,r){return void 0===t&&(t="X "),void 0===e&&(e=" "),void 0===r&&(r="\n"),this.buildToString(t,e,r)},t.prototype.buildToString=function(t,e,r){for(var n=new $r,o=0,i=this.height;o<i;o++){for(var a=0,s=this.width;a<s;a++)n.append(this.get(a,o)?t:e);n.append(r)}return n.toString()},t.prototype.clone=function(){return new t(this.width,this.height,this.rowSize,this.bits.slice())},t}(),qr=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Kr=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return qr(e,t),e.getNotFoundInstance=function(){return new e},e.kind="NotFoundException",e}(wr),Zr=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Qr=function(t){function e(r){var n=t.call(this,r)||this;return n.luminances=e.EMPTY,n.buckets=new Int32Array(e.LUMINANCE_BUCKETS),n}return Zr(e,t),e.prototype.getBlackRow=function(t,r){var n=this.getLuminanceSource(),o=n.getWidth();null==r||r.getSize()<o?r=new Br(o):r.clear(),this.initArrays(o);for(var i=n.getRow(t,this.luminances),a=this.buckets,s=0;s<o;s++)a[(255&i[s])>>e.LUMINANCE_SHIFT]++;var u=e.estimateBlackPoint(a);if(o<3)for(s=0;s<o;s++)(255&i[s])<u&&r.set(s);else{var l=255&i[0],c=255&i[1];for(s=1;s<o-1;s++){var h=255&i[s+1];(4*c-l-h)/2<u&&r.set(s),l=c,c=h}}return r},e.prototype.getBlackMatrix=function(){var t=this.getLuminanceSource(),r=t.getWidth(),n=t.getHeight(),o=new Yr(r,n);this.initArrays(r);for(var i=this.buckets,a=1;a<5;a++)for(var s=Math.floor(n*a/5),u=t.getRow(s,this.luminances),l=Math.floor(4*r/5),c=Math.floor(r/5);c<l;c++)i[(255&u[c])>>e.LUMINANCE_SHIFT]++;var h=e.estimateBlackPoint(i),f=t.getMatrix();for(a=0;a<n;a++){var d=a*r;for(c=0;c<r;c++)(255&f[d+c])<h&&o.set(c,a)}return o},e.prototype.createBinarizer=function(t){return new e(t)},e.prototype.initArrays=function(t){this.luminances.length<t&&(this.luminances=new Uint8ClampedArray(t));for(var r=this.buckets,n=0;n<e.LUMINANCE_BUCKETS;n++)r[n]=0},e.estimateBlackPoint=function(t){for(var r=t.length,n=0,o=0,i=0,a=0;a<r;a++)t[a]>i&&(o=a,i=t[a]),t[a]>n&&(n=t[a]);var s=0,u=0;for(a=0;a<r;a++){var l=a-o;(d=t[a]*l*l)>u&&(s=a,u=d)}if(o>s){var c=o;o=s,s=c}if(s-o<=r/16)throw new Kr;var h=s-1,f=-1;for(a=s-1;a>o;a--){var d,p=a-o;(d=p*p*(s-a)*(n-t[a]))>f&&(h=a,f=d)}return h<<e.LUMINANCE_SHIFT},e.LUMINANCE_BITS=5,e.LUMINANCE_SHIFT=8-e.LUMINANCE_BITS,e.LUMINANCE_BUCKETS=1<<e.LUMINANCE_BITS,e.EMPTY=Uint8ClampedArray.from([0]),e}(Or),Jr=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),tn=function(t){function e(e){var r=t.call(this,e)||this;return r.matrix=null,r}return Jr(e,t),e.prototype.getBlackMatrix=function(){if(null!==this.matrix)return this.matrix;var r=this.getLuminanceSource(),n=r.getWidth(),o=r.getHeight();if(n>=e.MINIMUM_DIMENSION&&o>=e.MINIMUM_DIMENSION){var i=r.getMatrix(),a=n>>e.BLOCK_SIZE_POWER;0!=(n&e.BLOCK_SIZE_MASK)&&a++;var s=o>>e.BLOCK_SIZE_POWER;0!=(o&e.BLOCK_SIZE_MASK)&&s++;var u=e.calculateBlackPoints(i,a,s,n,o),l=new Yr(n,o);e.calculateThresholdForBlock(i,a,s,n,o,u,l),this.matrix=l}else this.matrix=t.prototype.getBlackMatrix.call(this);return this.matrix},e.prototype.createBinarizer=function(t){return new e(t)},e.calculateThresholdForBlock=function(t,r,n,o,i,a,s){for(var u=i-e.BLOCK_SIZE,l=o-e.BLOCK_SIZE,c=0;c<n;c++){var h=c<<e.BLOCK_SIZE_POWER;h>u&&(h=u);for(var f=e.cap(c,2,n-3),d=0;d<r;d++){var p=d<<e.BLOCK_SIZE_POWER;p>l&&(p=l);for(var g=e.cap(d,2,r-3),m=0,v=-2;v<=2;v++){var y=a[f+v];m+=y[g-2]+y[g-1]+y[g]+y[g+1]+y[g+2]}var _=m/25;e.thresholdBlock(t,p,h,_,o,s)}}},e.cap=function(t,e,r){return t<e?e:t>r?r:t},e.thresholdBlock=function(t,r,n,o,i,a){for(var s=0,u=n*i+r;s<e.BLOCK_SIZE;s++,u+=i)for(var l=0;l<e.BLOCK_SIZE;l++)(255&t[u+l])<=o&&a.set(r+l,n+s)},e.calculateBlackPoints=function(t,r,n,o,i){for(var a=i-e.BLOCK_SIZE,s=o-e.BLOCK_SIZE,u=new Array(n),l=0;l<n;l++){u[l]=new Int32Array(r);var c=l<<e.BLOCK_SIZE_POWER;c>a&&(c=a);for(var h=0;h<r;h++){var f=h<<e.BLOCK_SIZE_POWER;f>s&&(f=s);for(var d=0,p=255,g=0,m=0,v=c*o+f;m<e.BLOCK_SIZE;m++,v+=o){for(var y=0;y<e.BLOCK_SIZE;y++){var _=255&t[v+y];d+=_,_<p&&(p=_),_>g&&(g=_)}if(g-p>e.MIN_DYNAMIC_RANGE)for(m++,v+=o;m<e.BLOCK_SIZE;m++,v+=o)for(y=0;y<e.BLOCK_SIZE;y++)d+=255&t[v+y]}var w=d>>2*e.BLOCK_SIZE_POWER;if(g-p<=e.MIN_DYNAMIC_RANGE&&(w=p/2,l>0&&h>0)){var b=(u[l-1][h]+2*u[l][h-1]+u[l-1][h-1])/4;p<b&&(w=b)}u[l][h]=w}}return u},e.BLOCK_SIZE_POWER=3,e.BLOCK_SIZE=1<<e.BLOCK_SIZE_POWER,e.BLOCK_SIZE_MASK=e.BLOCK_SIZE-1,e.MINIMUM_DIMENSION=5*e.BLOCK_SIZE,e.MIN_DYNAMIC_RANGE=24,e}(Qr),en=function(){function t(t,e){this.width=t,this.height=e}return t.prototype.getWidth=function(){return this.width},t.prototype.getHeight=function(){return this.height},t.prototype.isCropSupported=function(){return!1},t.prototype.crop=function(t,e,r,n){throw new Wr("This luminance source does not support cropping.")},t.prototype.isRotateSupported=function(){return!1},t.prototype.rotateCounterClockwise=function(){throw new Wr("This luminance source does not support rotation by 90 degrees.")},t.prototype.rotateCounterClockwise45=function(){throw new Wr("This luminance source does not support rotation by 45 degrees.")},t.prototype.toString=function(){for(var t=new Uint8ClampedArray(this.width),e=new $r,r=0;r<this.height;r++){for(var n=this.getRow(r,t),o=0;o<this.width;o++){var i,a=255&n[o];i=a<64?"#":a<128?"+":a<192?".":" ",e.append(i)}e.append("\n")}return e.toString()},t}(),rn=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),nn=function(t){function e(e){var r=t.call(this,e.getWidth(),e.getHeight())||this;return r.delegate=e,r}return rn(e,t),e.prototype.getRow=function(t,e){for(var r=this.delegate.getRow(t,e),n=this.getWidth(),o=0;o<n;o++)r[o]=255-(255&r[o]);return r},e.prototype.getMatrix=function(){for(var t=this.delegate.getMatrix(),e=this.getWidth()*this.getHeight(),r=new Uint8ClampedArray(e),n=0;n<e;n++)r[n]=255-(255&t[n]);return r},e.prototype.isCropSupported=function(){return this.delegate.isCropSupported()},e.prototype.crop=function(t,r,n,o){return new e(this.delegate.crop(t,r,n,o))},e.prototype.isRotateSupported=function(){return this.delegate.isRotateSupported()},e.prototype.invert=function(){return this.delegate},e.prototype.rotateCounterClockwise=function(){return new e(this.delegate.rotateCounterClockwise())},e.prototype.rotateCounterClockwise45=function(){return new e(this.delegate.rotateCounterClockwise45())},e}(en),on=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),an=function(t){function e(r){var n=t.call(this,r.width,r.height)||this;return n.canvas=r,n.tempCanvasElement=null,n.buffer=e.makeBufferFromCanvasImageData(r),n}return on(e,t),e.makeBufferFromCanvasImageData=function(t){var r=t.getContext("2d").getImageData(0,0,t.width,t.height);return e.toGrayscaleBuffer(r.data,t.width,t.height)},e.toGrayscaleBuffer=function(t,e,r){for(var n=new Uint8ClampedArray(e*r),o=0,i=0,a=t.length;o<a;o+=4,i++){var s=void 0;s=0===t[o+3]?255:306*t[o]+601*t[o+1]+117*t[o+2]+512>>10,n[i]=s}return n},e.prototype.getRow=function(t,e){if(t<0||t>=this.getHeight())throw new Er("Requested row is outside the image: "+t);var r=this.getWidth(),n=t*r;return null===e?e=this.buffer.slice(n,n+r):(e.length<r&&(e=new Uint8ClampedArray(r)),e.set(this.buffer.slice(n,n+r))),e},e.prototype.getMatrix=function(){return this.buffer},e.prototype.isCropSupported=function(){return!0},e.prototype.crop=function(e,r,n,o){return t.prototype.crop.call(this,e,r,n,o),this},e.prototype.isRotateSupported=function(){return!0},e.prototype.rotateCounterClockwise=function(){return this.rotate(-90),this},e.prototype.rotateCounterClockwise45=function(){return this.rotate(-45),this},e.prototype.getTempCanvasElement=function(){if(null===this.tempCanvasElement){var t=this.canvas.ownerDocument.createElement("canvas");t.width=this.canvas.width,t.height=this.canvas.height,this.tempCanvasElement=t}return this.tempCanvasElement},e.prototype.rotate=function(t){var r=this.getTempCanvasElement(),n=r.getContext("2d"),o=t*e.DEGREE_TO_RADIANS,i=this.canvas.width,a=this.canvas.height,s=Math.ceil(Math.abs(Math.cos(o))*i+Math.abs(Math.sin(o))*a),u=Math.ceil(Math.abs(Math.sin(o))*i+Math.abs(Math.cos(o))*a);return r.width=s,r.height=u,n.translate(s/2,u/2),n.rotate(o),n.drawImage(this.canvas,i/-2,a/-2),this.buffer=e.makeBufferFromCanvasImageData(r),this},e.prototype.invert=function(){return new nn(this)},e.DEGREE_TO_RADIANS=Math.PI/180,e}(en),sn=function(){function t(t,e,r){this.deviceId=t,this.label=e,this.kind="videoinput",this.groupId=r||void 0}return t.prototype.toJSON=function(){return{kind:this.kind,groupId:this.groupId,deviceId:this.deviceId,label:this.label}},t}(),un=function(t,e,r,n){return new(r||(r=Promise))(function(e,o){function i(t){try{s(n.next(t))}catch(e){o(e)}}function a(t){try{s(n.throw(t))}catch(e){o(e)}}function s(t){var n;t.done?e(t.value):(n=t.value,n instanceof r?n:new r(function(t){t(n)})).then(i,a)}s((n=n.apply(t,[])).next())})},ln=function(t,e){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(s){i=[6,s],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},cn=function(){function t(t,e,r){void 0===e&&(e=500),this.reader=t,this.timeBetweenScansMillis=e,this._hints=r,this._stopContinuousDecode=!1,this._stopAsyncDecode=!1,this._timeBetweenDecodingAttempts=0}return Object.defineProperty(t.prototype,"hasNavigator",{get:function(){return"undefined"!=typeof navigator},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isMediaDevicesSuported",{get:function(){return this.hasNavigator&&!!navigator.mediaDevices},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"canEnumerateDevices",{get:function(){return!(!this.isMediaDevicesSuported||!navigator.mediaDevices.enumerateDevices)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"timeBetweenDecodingAttempts",{get:function(){return this._timeBetweenDecodingAttempts},set:function(t){this._timeBetweenDecodingAttempts=t<0?0:t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"hints",{get:function(){return this._hints},set:function(t){this._hints=t||null},enumerable:!1,configurable:!0}),t.prototype.listVideoInputDevices=function(){return un(this,0,void 0,function(){var t,e,r,n,o,i,a,s,u,l,c,h;return ln(this,function(f){switch(f.label){case 0:if(!this.hasNavigator)throw new Error("Can't enumerate devices, navigator is not present.");if(!this.canEnumerateDevices)throw new Error("Can't enumerate devices, method not supported.");return[4,navigator.mediaDevices.enumerateDevices()];case 1:t=f.sent(),e=[];try{for(r=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}(t),n=r.next();!n.done;n=r.next())o=n.value,"videoinput"===(i="video"===o.kind?"videoinput":o.kind)&&(a=o.deviceId||o.id,s=o.label||"Video device "+(e.length+1),u=o.groupId,l={deviceId:a,label:s,kind:i,groupId:u},e.push(l))}catch(d){c={error:d}}finally{try{n&&!n.done&&(h=r.return)&&h.call(r)}finally{if(c)throw c.error}}return[2,e]}})})},t.prototype.getVideoInputDevices=function(){return un(this,0,void 0,function(){return ln(this,function(t){switch(t.label){case 0:return[4,this.listVideoInputDevices()];case 1:return[2,t.sent().map(function(t){return new sn(t.deviceId,t.label)})]}})})},t.prototype.findDeviceById=function(t){return un(this,0,void 0,function(){var e;return ln(this,function(r){switch(r.label){case 0:return[4,this.listVideoInputDevices()];case 1:return(e=r.sent())?[2,e.find(function(e){return e.deviceId===t})]:[2,null]}})})},t.prototype.decodeFromInputVideoDevice=function(t,e){return un(this,0,void 0,function(){return ln(this,function(r){switch(r.label){case 0:return[4,this.decodeOnceFromVideoDevice(t,e)];case 1:return[2,r.sent()]}})})},t.prototype.decodeOnceFromVideoDevice=function(t,e){return un(this,0,void 0,function(){var r;return ln(this,function(n){switch(n.label){case 0:return this.reset(),r={video:t?{deviceId:{exact:t}}:{facingMode:"environment"}},[4,this.decodeOnceFromConstraints(r,e)];case 1:return[2,n.sent()]}})})},t.prototype.decodeOnceFromConstraints=function(t,e){return un(this,0,void 0,function(){var r;return ln(this,function(n){switch(n.label){case 0:return[4,navigator.mediaDevices.getUserMedia(t)];case 1:return r=n.sent(),[4,this.decodeOnceFromStream(r,e)];case 2:return[2,n.sent()]}})})},t.prototype.decodeOnceFromStream=function(t,e){return un(this,0,void 0,function(){var r;return ln(this,function(n){switch(n.label){case 0:return this.reset(),[4,this.attachStreamToVideo(t,e)];case 1:return r=n.sent(),[4,this.decodeOnce(r)];case 2:return[2,n.sent()]}})})},t.prototype.decodeFromInputVideoDeviceContinuously=function(t,e,r){return un(this,0,void 0,function(){return ln(this,function(n){switch(n.label){case 0:return[4,this.decodeFromVideoDevice(t,e,r)];case 1:return[2,n.sent()]}})})},t.prototype.decodeFromVideoDevice=function(t,e,r){return un(this,0,void 0,function(){var n;return ln(this,function(o){switch(o.label){case 0:return n={video:t?{deviceId:{exact:t}}:{facingMode:"environment"}},[4,this.decodeFromConstraints(n,e,r)];case 1:return[2,o.sent()]}})})},t.prototype.decodeFromConstraints=function(t,e,r){return un(this,0,void 0,function(){var n;return ln(this,function(o){switch(o.label){case 0:return[4,navigator.mediaDevices.getUserMedia(t)];case 1:return n=o.sent(),[4,this.decodeFromStream(n,e,r)];case 2:return[2,o.sent()]}})})},t.prototype.decodeFromStream=function(t,e,r){return un(this,0,void 0,function(){var n;return ln(this,function(o){switch(o.label){case 0:return this.reset(),[4,this.attachStreamToVideo(t,e)];case 1:return n=o.sent(),[4,this.decodeContinuously(n,r)];case 2:return[2,o.sent()]}})})},t.prototype.stopAsyncDecode=function(){this._stopAsyncDecode=!0},t.prototype.stopContinuousDecode=function(){this._stopContinuousDecode=!0},t.prototype.attachStreamToVideo=function(t,e){return un(this,0,void 0,function(){var r;return ln(this,function(n){switch(n.label){case 0:return r=this.prepareVideoElement(e),this.addVideoSource(r,t),this.videoElement=r,this.stream=t,[4,this.playVideoOnLoadAsync(r)];case 1:return n.sent(),[2,r]}})})},t.prototype.playVideoOnLoadAsync=function(t){var e=this;return new Promise(function(r,n){return e.playVideoOnLoad(t,function(){return r()})})},t.prototype.playVideoOnLoad=function(t,e){var r=this;this.videoEndedListener=function(){return r.stopStreams()},this.videoCanPlayListener=function(){return r.tryPlayVideo(t)},t.addEventListener("ended",this.videoEndedListener),t.addEventListener("canplay",this.videoCanPlayListener),t.addEventListener("playing",e),this.tryPlayVideo(t)},t.prototype.isVideoPlaying=function(t){return t.currentTime>0&&!t.paused&&!t.ended&&t.readyState>2},t.prototype.tryPlayVideo=function(t){return un(this,0,void 0,function(){return ln(this,function(e){switch(e.label){case 0:if(this.isVideoPlaying(t))return console.warn("Trying to play video that is already playing."),[2];e.label=1;case 1:return e.trys.push([1,3,,4]),[4,t.play()];case 2:return e.sent(),[3,4];case 3:return e.sent(),console.warn("It was not possible to play the video."),[3,4];case 4:return[2]}})})},t.prototype.getMediaElement=function(t,e){var r=document.getElementById(t);if(!r)throw new Cr("element with id '"+t+"' not found");if(r.nodeName.toLowerCase()!==e.toLowerCase())throw new Cr("element with id '"+t+"' must be an "+e+" element");return r},t.prototype.decodeFromImage=function(t,e){if(!t&&!e)throw new Cr("either imageElement with a src set or an url must be provided");return e&&!t?this.decodeFromImageUrl(e):this.decodeFromImageElement(t)},t.prototype.decodeFromVideo=function(t,e){if(!t&&!e)throw new Cr("Either an element with a src set or an URL must be provided");return e&&!t?this.decodeFromVideoUrl(e):this.decodeFromVideoElement(t)},t.prototype.decodeFromVideoContinuously=function(t,e,r){if(void 0===t&&void 0===e)throw new Cr("Either an element with a src set or an URL must be provided");return e&&!t?this.decodeFromVideoUrlContinuously(e,r):this.decodeFromVideoElementContinuously(t,r)},t.prototype.decodeFromImageElement=function(t){if(!t)throw new Cr("An image element must be provided.");this.reset();var e=this.prepareImageElement(t);return this.imageElement=e,this.isImageLoaded(e)?this.decodeOnce(e,!1,!0):this._decodeOnLoadImage(e)},t.prototype.decodeFromVideoElement=function(t){var e=this._decodeFromVideoElementSetup(t);return this._decodeOnLoadVideo(e)},t.prototype.decodeFromVideoElementContinuously=function(t,e){var r=this._decodeFromVideoElementSetup(t);return this._decodeOnLoadVideoContinuously(r,e)},t.prototype._decodeFromVideoElementSetup=function(t){if(!t)throw new Cr("A video element must be provided.");this.reset();var e=this.prepareVideoElement(t);return this.videoElement=e,e},t.prototype.decodeFromImageUrl=function(t){if(!t)throw new Cr("An URL must be provided.");this.reset();var e=this.prepareImageElement();this.imageElement=e;var r=this._decodeOnLoadImage(e);return e.src=t,r},t.prototype.decodeFromVideoUrl=function(t){if(!t)throw new Cr("An URL must be provided.");this.reset();var e=this.prepareVideoElement(),r=this.decodeFromVideoElement(e);return e.src=t,r},t.prototype.decodeFromVideoUrlContinuously=function(t,e){if(!t)throw new Cr("An URL must be provided.");this.reset();var r=this.prepareVideoElement(),n=this.decodeFromVideoElementContinuously(r,e);return r.src=t,n},t.prototype._decodeOnLoadImage=function(t){var e=this;return new Promise(function(r,n){e.imageLoadedListener=function(){return e.decodeOnce(t,!1,!0).then(r,n)},t.addEventListener("load",e.imageLoadedListener)})},t.prototype._decodeOnLoadVideo=function(t){return un(this,0,void 0,function(){return ln(this,function(e){switch(e.label){case 0:return[4,this.playVideoOnLoadAsync(t)];case 1:return e.sent(),[4,this.decodeOnce(t)];case 2:return[2,e.sent()]}})})},t.prototype._decodeOnLoadVideoContinuously=function(t,e){return un(this,0,void 0,function(){return ln(this,function(r){switch(r.label){case 0:return[4,this.playVideoOnLoadAsync(t)];case 1:return r.sent(),this.decodeContinuously(t,e),[2]}})})},t.prototype.isImageLoaded=function(t){return!!t.complete&&0!==t.naturalWidth},t.prototype.prepareImageElement=function(t){var e;return void 0===t&&((e=document.createElement("img")).width=200,e.height=200),"string"==typeof t&&(e=this.getMediaElement(t,"img")),t instanceof HTMLImageElement&&(e=t),e},t.prototype.prepareVideoElement=function(t){var e;return t||"undefined"==typeof document||((e=document.createElement("video")).width=200,e.height=200),"string"==typeof t&&(e=this.getMediaElement(t,"video")),t instanceof HTMLVideoElement&&(e=t),e.setAttribute("autoplay","true"),e.setAttribute("muted","true"),e.setAttribute("playsinline","true"),e},t.prototype.decodeOnce=function(t,e,r){var n=this;void 0===e&&(e=!0),void 0===r&&(r=!0),this._stopAsyncDecode=!1;var o=function(i,a){if(n._stopAsyncDecode)return a(new Kr("Video stream has ended before any code could be detected.")),void(n._stopAsyncDecode=void 0);try{i(n.decode(t))}catch(s){if(e&&s instanceof Kr||(s instanceof xr||s instanceof Vr)&&r)return setTimeout(o,n._timeBetweenDecodingAttempts,i,a);a(s)}};return new Promise(function(t,e){return o(t,e)})},t.prototype.decodeContinuously=function(t,e){var r=this;this._stopContinuousDecode=!1;var n=function(){if(r._stopContinuousDecode)r._stopContinuousDecode=void 0;else try{var o=r.decode(t);e(o,null),setTimeout(n,r.timeBetweenScansMillis)}catch(i){e(null,i),(i instanceof xr||i instanceof Vr||i instanceof Kr)&&setTimeout(n,r._timeBetweenDecodingAttempts)}};n()},t.prototype.decode=function(t){var e=this.createBinaryBitmap(t);return this.decodeBitmap(e)},t.prototype.createBinaryBitmap=function(t){var e=this.getCaptureCanvasContext(t);this.drawImageOnCanvas(e,t);var r=this.getCaptureCanvas(t),n=new an(r),o=new tn(n);return new Ir(o)},t.prototype.getCaptureCanvasContext=function(t){if(!this.captureCanvasContext){var e=this.getCaptureCanvas(t).getContext("2d");this.captureCanvasContext=e}return this.captureCanvasContext},t.prototype.getCaptureCanvas=function(t){if(!this.captureCanvas){var e=this.createCaptureCanvas(t);this.captureCanvas=e}return this.captureCanvas},t.prototype.drawImageOnCanvas=function(t,e){t.drawImage(e,0,0)},t.prototype.decodeBitmap=function(t){return this.reader.decode(t,this._hints)},t.prototype.createCaptureCanvas=function(t){if("undefined"==typeof document)return this._destroyCaptureCanvas(),null;var e,r,n=document.createElement("canvas");return void 0!==t&&(t instanceof HTMLVideoElement?(e=t.videoWidth,r=t.videoHeight):t instanceof HTMLImageElement&&(e=t.naturalWidth||t.width,r=t.naturalHeight||t.height)),n.style.width=e+"px",n.style.height=r+"px",n.width=e,n.height=r,n},t.prototype.stopStreams=function(){this.stream&&(this.stream.getVideoTracks().forEach(function(t){return t.stop()}),this.stream=void 0),!1===this._stopAsyncDecode&&this.stopAsyncDecode(),!1===this._stopContinuousDecode&&this.stopContinuousDecode()},t.prototype.reset=function(){this.stopStreams(),this._destroyVideoElement(),this._destroyImageElement(),this._destroyCaptureCanvas()},t.prototype._destroyVideoElement=function(){this.videoElement&&(void 0!==this.videoEndedListener&&this.videoElement.removeEventListener("ended",this.videoEndedListener),void 0!==this.videoPlayingEventListener&&this.videoElement.removeEventListener("playing",this.videoPlayingEventListener),void 0!==this.videoCanPlayListener&&this.videoElement.removeEventListener("loadedmetadata",this.videoCanPlayListener),this.cleanVideoSource(this.videoElement),this.videoElement=void 0)},t.prototype._destroyImageElement=function(){this.imageElement&&(void 0!==this.imageLoadedListener&&this.imageElement.removeEventListener("load",this.imageLoadedListener),this.imageElement.src=void 0,this.imageElement.removeAttribute("src"),this.imageElement=void 0)},t.prototype._destroyCaptureCanvas=function(){this.captureCanvasContext=void 0,this.captureCanvas=void 0},t.prototype.addVideoSource=function(t,e){try{t.srcObject=e}catch(r){t.src=URL.createObjectURL(e)}},t.prototype.cleanVideoSource=function(t){try{t.srcObject=null}catch(e){t.src=""}this.videoElement.removeAttribute("src")},t}(),hn=function(){function t(t,e,r,n,o,i){void 0===r&&(r=null==e?0:8*e.length),void 0===i&&(i=Tr.currentTimeMillis()),this.text=t,this.rawBytes=e,this.numBits=r,this.resultPoints=n,this.format=o,this.timestamp=i,this.text=t,this.rawBytes=e,this.numBits=null==r?null==e?0:8*e.length:r,this.resultPoints=n,this.format=o,this.resultMetadata=null,this.timestamp=null==i?Tr.currentTimeMillis():i}return t.prototype.getText=function(){return this.text},t.prototype.getRawBytes=function(){return this.rawBytes},t.prototype.getNumBits=function(){return this.numBits},t.prototype.getResultPoints=function(){return this.resultPoints},t.prototype.getBarcodeFormat=function(){return this.format},t.prototype.getResultMetadata=function(){return this.resultMetadata},t.prototype.putMetadata=function(t,e){null===this.resultMetadata&&(this.resultMetadata=new Map),this.resultMetadata.set(t,e)},t.prototype.putAllMetadata=function(t){null!==t&&(null===this.resultMetadata?this.resultMetadata=t:this.resultMetadata=new Map(t))},t.prototype.addResultPoints=function(t){var e=this.resultPoints;if(null===e)this.resultPoints=t;else if(null!==t&&t.length>0){var r=new Array(e.length+t.length);Tr.arraycopy(e,0,r,0,e.length),Tr.arraycopy(t,0,r,e.length,t.length),this.resultPoints=r}},t.prototype.getTimestamp=function(){return this.timestamp},t.prototype.toString=function(){return this.text},t}();!function(t){t[t.AZTEC=0]="AZTEC",t[t.CODABAR=1]="CODABAR",t[t.CODE_39=2]="CODE_39",t[t.CODE_93=3]="CODE_93",t[t.CODE_128=4]="CODE_128",t[t.DATA_MATRIX=5]="DATA_MATRIX",t[t.EAN_8=6]="EAN_8",t[t.EAN_13=7]="EAN_13",t[t.ITF=8]="ITF",t[t.MAXICODE=9]="MAXICODE",t[t.PDF_417=10]="PDF_417",t[t.QR_CODE=11]="QR_CODE",t[t.RSS_14=12]="RSS_14",t[t.RSS_EXPANDED=13]="RSS_EXPANDED",t[t.UPC_A=14]="UPC_A",t[t.UPC_E=15]="UPC_E",t[t.UPC_EAN_EXTENSION=16]="UPC_EAN_EXTENSION"}(Ur||(Ur={}));var fn,dn=Ur;!function(t){t[t.OTHER=0]="OTHER",t[t.ORIENTATION=1]="ORIENTATION",t[t.BYTE_SEGMENTS=2]="BYTE_SEGMENTS",t[t.ERROR_CORRECTION_LEVEL=3]="ERROR_CORRECTION_LEVEL",t[t.ISSUE_NUMBER=4]="ISSUE_NUMBER",t[t.SUGGESTED_PRICE=5]="SUGGESTED_PRICE",t[t.POSSIBLE_COUNTRY=6]="POSSIBLE_COUNTRY",t[t.UPC_EAN_EXTENSION=7]="UPC_EAN_EXTENSION",t[t.PDF417_EXTRA_METADATA=8]="PDF417_EXTRA_METADATA",t[t.STRUCTURED_APPEND_SEQUENCE=9]="STRUCTURED_APPEND_SEQUENCE",t[t.STRUCTURED_APPEND_PARITY=10]="STRUCTURED_APPEND_PARITY"}(fn||(fn={}));var pn,gn=fn,mn=function(){function t(t,e,r,n,o,i){void 0===o&&(o=-1),void 0===i&&(i=-1),this.rawBytes=t,this.text=e,this.byteSegments=r,this.ecLevel=n,this.structuredAppendSequenceNumber=o,this.structuredAppendParity=i,this.numBits=null==t?0:8*t.length}return t.prototype.getRawBytes=function(){return this.rawBytes},t.prototype.getNumBits=function(){return this.numBits},t.prototype.setNumBits=function(t){this.numBits=t},t.prototype.getText=function(){return this.text},t.prototype.getByteSegments=function(){return this.byteSegments},t.prototype.getECLevel=function(){return this.ecLevel},t.prototype.getErrorsCorrected=function(){return this.errorsCorrected},t.prototype.setErrorsCorrected=function(t){this.errorsCorrected=t},t.prototype.getErasures=function(){return this.erasures},t.prototype.setErasures=function(t){this.erasures=t},t.prototype.getOther=function(){return this.other},t.prototype.setOther=function(t){this.other=t},t.prototype.hasStructuredAppend=function(){return this.structuredAppendParity>=0&&this.structuredAppendSequenceNumber>=0},t.prototype.getStructuredAppendParity=function(){return this.structuredAppendParity},t.prototype.getStructuredAppendSequenceNumber=function(){return this.structuredAppendSequenceNumber},t}(),vn=function(){function t(){}return t.prototype.exp=function(t){return this.expTable[t]},t.prototype.log=function(t){if(0===t)throw new Er;return this.logTable[t]},t.addOrSubtract=function(t,e){return t^e},t}(),yn=function(){function t(t,e){if(0===e.length)throw new Er;this.field=t;var r=e.length;if(r>1&&0===e[0]){for(var n=1;n<r&&0===e[n];)n++;n===r?this.coefficients=Int32Array.from([0]):(this.coefficients=new Int32Array(r-n),Tr.arraycopy(e,n,this.coefficients,0,this.coefficients.length))}else this.coefficients=e}return t.prototype.getCoefficients=function(){return this.coefficients},t.prototype.getDegree=function(){return this.coefficients.length-1},t.prototype.isZero=function(){return 0===this.coefficients[0]},t.prototype.getCoefficient=function(t){return this.coefficients[this.coefficients.length-1-t]},t.prototype.evaluateAt=function(t){if(0===t)return this.getCoefficient(0);var e,r=this.coefficients;if(1===t){e=0;for(var n=0,o=r.length;n!==o;n++){var i=r[n];e=vn.addOrSubtract(e,i)}return e}e=r[0];var a=r.length,s=this.field;for(n=1;n<a;n++)e=vn.addOrSubtract(s.multiply(t,e),r[n]);return e},t.prototype.addOrSubtract=function(e){if(!this.field.equals(e.field))throw new Er("GenericGFPolys do not have same GenericGF field");if(this.isZero())return e;if(e.isZero())return this;var r=this.coefficients,n=e.coefficients;if(r.length>n.length){var o=r;r=n,n=o}var i=new Int32Array(n.length),a=n.length-r.length;Tr.arraycopy(n,0,i,0,a);for(var s=a;s<n.length;s++)i[s]=vn.addOrSubtract(r[s-a],n[s]);return new t(this.field,i)},t.prototype.multiply=function(e){if(!this.field.equals(e.field))throw new Er("GenericGFPolys do not have same GenericGF field");if(this.isZero()||e.isZero())return this.field.getZero();for(var r=this.coefficients,n=r.length,o=e.coefficients,i=o.length,a=new Int32Array(n+i-1),s=this.field,u=0;u<n;u++)for(var l=r[u],c=0;c<i;c++)a[u+c]=vn.addOrSubtract(a[u+c],s.multiply(l,o[c]));return new t(s,a)},t.prototype.multiplyScalar=function(e){if(0===e)return this.field.getZero();if(1===e)return this;for(var r=this.coefficients.length,n=this.field,o=new Int32Array(r),i=this.coefficients,a=0;a<r;a++)o[a]=n.multiply(i[a],e);return new t(n,o)},t.prototype.multiplyByMonomial=function(e,r){if(e<0)throw new Er;if(0===r)return this.field.getZero();for(var n=this.coefficients,o=n.length,i=new Int32Array(o+e),a=this.field,s=0;s<o;s++)i[s]=a.multiply(n[s],r);return new t(a,i)},t.prototype.divide=function(t){if(!this.field.equals(t.field))throw new Er("GenericGFPolys do not have same GenericGF field");if(t.isZero())throw new Er("Divide by 0");for(var e=this.field,r=e.getZero(),n=this,o=t.getCoefficient(t.getDegree()),i=e.inverse(o);n.getDegree()>=t.getDegree()&&!n.isZero();){var a=n.getDegree()-t.getDegree(),s=e.multiply(n.getCoefficient(n.getDegree()),i),u=t.multiplyByMonomial(a,s),l=e.buildMonomial(a,s);r=r.addOrSubtract(l),n=n.addOrSubtract(u)}return[r,n]},t.prototype.toString=function(){for(var t="",e=this.getDegree();e>=0;e--){var r=this.getCoefficient(e);if(0!==r){if(r<0?(t+=" - ",r=-r):t.length>0&&(t+=" + "),0===e||1!==r){var n=this.field.log(r);0===n?t+="1":1===n?t+="a":(t+="a^",t+=n)}0!==e&&(1===e?t+="x":(t+="x^",t+=e))}}return t},t}(),_n=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),wn=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return _n(e,t),e.kind="ArithmeticException",e}(wr),bn=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Cn=function(t){function e(e,r,n){var o=t.call(this)||this;o.primitive=e,o.size=r,o.generatorBase=n;for(var i=new Int32Array(r),a=1,s=0;s<r;s++)i[s]=a,(a*=2)>=r&&(a^=e,a&=r-1);o.expTable=i;var u=new Int32Array(r);for(s=0;s<r-1;s++)u[i[s]]=s;return o.logTable=u,o.zero=new yn(o,Int32Array.from([0])),o.one=new yn(o,Int32Array.from([1])),o}return bn(e,t),e.prototype.getZero=function(){return this.zero},e.prototype.getOne=function(){return this.one},e.prototype.buildMonomial=function(t,e){if(t<0)throw new Er;if(0===e)return this.zero;var r=new Int32Array(t+1);return r[0]=e,new yn(this,r)},e.prototype.inverse=function(t){if(0===t)throw new wn;return this.expTable[this.size-this.logTable[t]-1]},e.prototype.multiply=function(t,e){return 0===t||0===e?0:this.expTable[(this.logTable[t]+this.logTable[e])%(this.size-1)]},e.prototype.getSize=function(){return this.size},e.prototype.getGeneratorBase=function(){return this.generatorBase},e.prototype.toString=function(){return"GF(0x"+Mr.toHexString(this.primitive)+","+this.size+")"},e.prototype.equals=function(t){return t===this},e.AZTEC_DATA_12=new e(4201,4096,1),e.AZTEC_DATA_10=new e(1033,1024,1),e.AZTEC_DATA_6=new e(67,64,1),e.AZTEC_PARAM=new e(19,16,1),e.QR_CODE_FIELD_256=new e(285,256,0),e.DATA_MATRIX_FIELD_256=new e(301,256,1),e.AZTEC_DATA_8=e.DATA_MATRIX_FIELD_256,e.MAXICODE_FIELD_64=e.AZTEC_DATA_6,e}(vn),An=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),En=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return An(e,t),e.kind="ReedSolomonException",e}(wr),In=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Sn=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return In(e,t),e.kind="IllegalStateException",e}(wr),xn=function(){function t(t){this.field=t}return t.prototype.decode=function(t,e){for(var r=this.field,n=new yn(r,t),o=new Int32Array(e),i=!0,a=0;a<e;a++){var s=n.evaluateAt(r.exp(a+r.getGeneratorBase()));o[o.length-1-a]=s,0!==s&&(i=!1)}if(!i){var u=new yn(r,o),l=this.runEuclideanAlgorithm(r.buildMonomial(e,1),u,e),c=l[0],h=l[1],f=this.findErrorLocations(c),d=this.findErrorMagnitudes(h,f);for(a=0;a<f.length;a++){var p=t.length-1-r.log(f[a]);if(p<0)throw new En("Bad error location");t[p]=Cn.addOrSubtract(t[p],d[a])}}},t.prototype.runEuclideanAlgorithm=function(t,e,r){if(t.getDegree()<e.getDegree()){var n=t;t=e,e=n}for(var o=this.field,i=t,a=e,s=o.getZero(),u=o.getOne();a.getDegree()>=(r/2|0);){var l=i,c=s;if(s=u,(i=a).isZero())throw new En("r_{i-1} was zero");a=l;for(var h=o.getZero(),f=i.getCoefficient(i.getDegree()),d=o.inverse(f);a.getDegree()>=i.getDegree()&&!a.isZero();){var p=a.getDegree()-i.getDegree(),g=o.multiply(a.getCoefficient(a.getDegree()),d);h=h.addOrSubtract(o.buildMonomial(p,g)),a=a.addOrSubtract(i.multiplyByMonomial(p,g))}if(u=h.multiply(s).addOrSubtract(c),a.getDegree()>=i.getDegree())throw new Sn("Division algorithm failed to reduce polynomial?")}var m=u.getCoefficient(0);if(0===m)throw new En("sigmaTilde(0) was zero");var v=o.inverse(m);return[u.multiplyScalar(v),a.multiplyScalar(v)]},t.prototype.findErrorLocations=function(t){var e=t.getDegree();if(1===e)return Int32Array.from([t.getCoefficient(1)]);for(var r=new Int32Array(e),n=0,o=this.field,i=1;i<o.getSize()&&n<e;i++)0===t.evaluateAt(i)&&(r[n]=o.inverse(i),n++);if(n!==e)throw new En("Error locator degree does not match number of roots");return r},t.prototype.findErrorMagnitudes=function(t,e){for(var r=e.length,n=new Int32Array(r),o=this.field,i=0;i<r;i++){for(var a=o.inverse(e[i]),s=1,u=0;u<r;u++)if(i!==u){var l=o.multiply(e[u],a),c=1&l?-2&l:1|l;s=o.multiply(s,c)}n[i]=o.multiply(t.evaluateAt(a),o.inverse(s)),0!==o.getGeneratorBase()&&(n[i]=o.multiply(n[i],a))}return n},t}();!function(t){t[t.UPPER=0]="UPPER",t[t.LOWER=1]="LOWER",t[t.MIXED=2]="MIXED",t[t.DIGIT=3]="DIGIT",t[t.PUNCT=4]="PUNCT",t[t.BINARY=5]="BINARY"}(pn||(pn={}));var On=function(){function t(){}return t.prototype.decode=function(e){this.ddata=e;var r=e.getBits(),n=this.extractBits(r),o=this.correctBits(n),i=t.convertBoolArrayToByteArray(o),a=t.getEncodedData(o),s=new mn(i,a,null,null);return s.setNumBits(o.length),s},t.highLevelDecode=function(t){return this.getEncodedData(t)},t.getEncodedData=function(e){for(var r=e.length,n=pn.UPPER,o=pn.UPPER,i="",a=0;a<r;)if(o===pn.BINARY){if(r-a<5)break;var s=t.readCode(e,a,5);if(a+=5,0===s){if(r-a<11)break;s=t.readCode(e,a,11)+31,a+=11}for(var u=0;u<s;u++){if(r-a<8){a=r;break}var l=t.readCode(e,a,8);i+=Xr.castAsNonUtf8Char(l),a+=8}o=n}else{var c=o===pn.DIGIT?4:5;if(r-a<c)break;l=t.readCode(e,a,c),a+=c;var h=t.getCharacter(o,l);h.startsWith("CTRL_")?(n=o,o=t.getTable(h.charAt(5)),"L"===h.charAt(6)&&(n=o)):(i+=h,o=n)}return i},t.getTable=function(t){switch(t){case"L":return pn.LOWER;case"P":return pn.PUNCT;case"M":return pn.MIXED;case"D":return pn.DIGIT;case"B":return pn.BINARY;default:return pn.UPPER}},t.getCharacter=function(e,r){switch(e){case pn.UPPER:return t.UPPER_TABLE[r];case pn.LOWER:return t.LOWER_TABLE[r];case pn.MIXED:return t.MIXED_TABLE[r];case pn.PUNCT:return t.PUNCT_TABLE[r];case pn.DIGIT:return t.DIGIT_TABLE[r];default:throw new Sn("Bad table")}},t.prototype.correctBits=function(e){var r,n;this.ddata.getNbLayers()<=2?(n=6,r=Cn.AZTEC_DATA_6):this.ddata.getNbLayers()<=8?(n=8,r=Cn.AZTEC_DATA_8):this.ddata.getNbLayers()<=22?(n=10,r=Cn.AZTEC_DATA_10):(n=12,r=Cn.AZTEC_DATA_12);var o=this.ddata.getNbDatablocks(),i=e.length/n;if(i<o)throw new Vr;for(var a=e.length%n,s=new Int32Array(i),u=0;u<i;u++,a+=n)s[u]=t.readCode(e,a,n);try{new xn(r).decode(s,i-o)}catch(g){throw new Vr(g)}var l=(1<<n)-1,c=0;for(u=0;u<o;u++){if(0===(d=s[u])||d===l)throw new Vr;1!==d&&d!==l-1||c++}var h=new Array(o*n-c),f=0;for(u=0;u<o;u++){var d;if(1===(d=s[u])||d===l-1)h.fill(d>1,f,f+n-1),f+=n-1;else for(var p=n-1;p>=0;--p)h[f++]=!!(d&1<<p)}return h},t.prototype.extractBits=function(t){var e=this.ddata.isCompact(),r=this.ddata.getNbLayers(),n=(e?11:14)+4*r,o=new Int32Array(n),i=new Array(this.totalBitsInLayer(r,e));if(e)for(var a=0;a<o.length;a++)o[a]=a;else{var s=n+1+2*Mr.truncDivision(Mr.truncDivision(n,2)-1,15),u=n/2,l=Mr.truncDivision(s,2);for(a=0;a<u;a++){var c=a+Mr.truncDivision(a,15);o[u-a-1]=l-c-1,o[u+a]=l+c+1}}a=0;for(var h=0;a<r;a++){for(var f=4*(r-a)+(e?9:12),d=2*a,p=n-1-d,g=0;g<f;g++)for(var m=2*g,v=0;v<2;v++)i[h+m+v]=t.get(o[d+v],o[d+g]),i[h+2*f+m+v]=t.get(o[d+g],o[p-v]),i[h+4*f+m+v]=t.get(o[p-v],o[p-g]),i[h+6*f+m+v]=t.get(o[p-g],o[d+v]);h+=8*f}return i},t.readCode=function(t,e,r){for(var n=0,o=e;o<e+r;o++)n<<=1,t[o]&&(n|=1);return n},t.readByte=function(e,r){var n=e.length-r;return n>=8?t.readCode(e,r,8):t.readCode(e,r,n)<<8-n},t.convertBoolArrayToByteArray=function(e){for(var r=new Uint8Array((e.length+7)/8),n=0;n<r.length;n++)r[n]=t.readByte(e,8*n);return r},t.prototype.totalBitsInLayer=function(t,e){return((e?88:112)+16*t)*t},t.UPPER_TABLE=["CTRL_PS"," ","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","CTRL_LL","CTRL_ML","CTRL_DL","CTRL_BS"],t.LOWER_TABLE=["CTRL_PS"," ","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","CTRL_US","CTRL_ML","CTRL_DL","CTRL_BS"],t.MIXED_TABLE=["CTRL_PS"," ","\\1","\\2","\\3","\\4","\\5","\\6","\\7","\b","\t","\n","\\13","\f","\r","\\33","\\34","\\35","\\36","\\37","@","\\","^","_","`","|","~","\\177","CTRL_LL","CTRL_UL","CTRL_PL","CTRL_BS"],t.PUNCT_TABLE=["","\r","\r\n",". ",", ",": ","!",'"',"#","$","%","&","'","(",")","*","+",",","-",".","/",":",";","<","=",">","?","[","]","{","}","CTRL_UL"],t.DIGIT_TABLE=["CTRL_PS"," ","0","1","2","3","4","5","6","7","8","9",",",".","CTRL_UL","CTRL_US"],t}(),Tn=function(){function t(){}return t.round=function(t){return NaN===t?0:t<=Number.MIN_SAFE_INTEGER?Number.MIN_SAFE_INTEGER:t>=Number.MAX_SAFE_INTEGER?Number.MAX_SAFE_INTEGER:t+(t<0?-.5:.5)|0},t.distance=function(t,e,r,n){var o=t-r,i=e-n;return Math.sqrt(o*o+i*i)},t.sum=function(t){for(var e=0,r=0,n=t.length;r!==n;r++)e+=t[r];return e},t}(),Nn=function(){function t(){}return t.floatToIntBits=function(t){return t},t.MAX_VALUE=Number.MAX_SAFE_INTEGER,t}(),kn=function(){function t(t,e){this.x=t,this.y=e}return t.prototype.getX=function(){return this.x},t.prototype.getY=function(){return this.y},t.prototype.equals=function(e){if(e instanceof t){var r=e;return this.x===r.x&&this.y===r.y}return!1},t.prototype.hashCode=function(){return 31*Nn.floatToIntBits(this.x)+Nn.floatToIntBits(this.y)},t.prototype.toString=function(){return"("+this.x+","+this.y+")"},t.orderBestPatterns=function(t){var e,r,n,o=this.distance(t[0],t[1]),i=this.distance(t[1],t[2]),a=this.distance(t[0],t[2]);if(i>=o&&i>=a?(r=t[0],e=t[1],n=t[2]):a>=i&&a>=o?(r=t[1],e=t[0],n=t[2]):(r=t[2],e=t[0],n=t[1]),this.crossProductZ(e,r,n)<0){var s=e;e=n,n=s}t[0]=e,t[1]=r,t[2]=n},t.distance=function(t,e){return Tn.distance(t.x,t.y,e.x,e.y)},t.crossProductZ=function(t,e,r){var n=e.x,o=e.y;return(r.x-n)*(t.y-o)-(r.y-o)*(t.x-n)},t}(),Rn=function(){function t(t,e){this.bits=t,this.points=e}return t.prototype.getBits=function(){return this.bits},t.prototype.getPoints=function(){return this.points},t}(),Dn=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Pn=function(t){function e(e,r,n,o,i){var a=t.call(this,e,r)||this;return a.compact=n,a.nbDatablocks=o,a.nbLayers=i,a}return Dn(e,t),e.prototype.getNbLayers=function(){return this.nbLayers},e.prototype.getNbDatablocks=function(){return this.nbDatablocks},e.prototype.isCompact=function(){return this.compact},e}(Rn),Mn=function(){function t(e,r,n,o){this.image=e,this.height=e.getHeight(),this.width=e.getWidth(),null==r&&(r=t.INIT_SIZE),null==n&&(n=e.getWidth()/2|0),null==o&&(o=e.getHeight()/2|0);var i=r/2|0;if(this.leftInit=n-i,this.rightInit=n+i,this.upInit=o-i,this.downInit=o+i,this.upInit<0||this.leftInit<0||this.downInit>=this.height||this.rightInit>=this.width)throw new Kr}return t.prototype.detect=function(){for(var t=this.leftInit,e=this.rightInit,r=this.upInit,n=this.downInit,o=!1,i=!0,a=!1,s=!1,u=!1,l=!1,c=!1,h=this.width,f=this.height;i;){i=!1;for(var d=!0;(d||!s)&&e<h;)(d=this.containsBlackPoint(r,n,e,!1))?(e++,i=!0,s=!0):s||e++;if(e>=h){o=!0;break}for(var p=!0;(p||!u)&&n<f;)(p=this.containsBlackPoint(t,e,n,!0))?(n++,i=!0,u=!0):u||n++;if(n>=f){o=!0;break}for(var g=!0;(g||!l)&&t>=0;)(g=this.containsBlackPoint(r,n,t,!1))?(t--,i=!0,l=!0):l||t--;if(t<0){o=!0;break}for(var m=!0;(m||!c)&&r>=0;)(m=this.containsBlackPoint(t,e,r,!0))?(r--,i=!0,c=!0):c||r--;if(r<0){o=!0;break}i&&(a=!0)}if(!o&&a){for(var v=e-t,y=null,_=1;null===y&&_<v;_++)y=this.getBlackPointOnSegment(t,n-_,t+_,n);if(null==y)throw new Kr;var w=null;for(_=1;null===w&&_<v;_++)w=this.getBlackPointOnSegment(t,r+_,t+_,r);if(null==w)throw new Kr;var b=null;for(_=1;null===b&&_<v;_++)b=this.getBlackPointOnSegment(e,r+_,e-_,r);if(null==b)throw new Kr;var C=null;for(_=1;null===C&&_<v;_++)C=this.getBlackPointOnSegment(e,n-_,e-_,n);if(null==C)throw new Kr;return this.centerEdges(C,y,b,w)}throw new Kr},t.prototype.getBlackPointOnSegment=function(t,e,r,n){for(var o=Tn.round(Tn.distance(t,e,r,n)),i=(r-t)/o,a=(n-e)/o,s=this.image,u=0;u<o;u++){var l=Tn.round(t+u*i),c=Tn.round(e+u*a);if(s.get(l,c))return new kn(l,c)}return null},t.prototype.centerEdges=function(e,r,n,o){var i=e.getX(),a=e.getY(),s=r.getX(),u=r.getY(),l=n.getX(),c=n.getY(),h=o.getX(),f=o.getY(),d=t.CORR;return i<this.width/2?[new kn(h-d,f+d),new kn(s+d,u+d),new kn(l-d,c-d),new kn(i+d,a-d)]:[new kn(h+d,f+d),new kn(s+d,u-d),new kn(l-d,c+d),new kn(i-d,a-d)]},t.prototype.containsBlackPoint=function(t,e,r,n){var o=this.image;if(n){for(var i=t;i<=e;i++)if(o.get(i,r))return!0}else for(var a=t;a<=e;a++)if(o.get(r,a))return!0;return!1},t.INIT_SIZE=10,t.CORR=1,t}(),Bn=function(){function t(){}return t.checkAndNudgePoints=function(t,e){for(var r=t.getWidth(),n=t.getHeight(),o=!0,i=0;i<e.length&&o;i+=2){var a=Math.floor(e[i]),s=Math.floor(e[i+1]);if(a<-1||a>r||s<-1||s>n)throw new Kr;o=!1,-1===a?(e[i]=0,o=!0):a===r&&(e[i]=r-1,o=!0),-1===s?(e[i+1]=0,o=!0):s===n&&(e[i+1]=n-1,o=!0)}for(o=!0,i=e.length-2;i>=0&&o;i-=2){if(a=Math.floor(e[i]),s=Math.floor(e[i+1]),a<-1||a>r||s<-1||s>n)throw new Kr;o=!1,-1===a?(e[i]=0,o=!0):a===r&&(e[i]=r-1,o=!0),-1===s?(e[i+1]=0,o=!0):s===n&&(e[i+1]=n-1,o=!0)}},t}(),Ln=function(){function t(t,e,r,n,o,i,a,s,u){this.a11=t,this.a21=e,this.a31=r,this.a12=n,this.a22=o,this.a32=i,this.a13=a,this.a23=s,this.a33=u}return t.quadrilateralToQuadrilateral=function(e,r,n,o,i,a,s,u,l,c,h,f,d,p,g,m){var v=t.quadrilateralToSquare(e,r,n,o,i,a,s,u);return t.squareToQuadrilateral(l,c,h,f,d,p,g,m).times(v)},t.prototype.transformPoints=function(t){for(var e=t.length,r=this.a11,n=this.a12,o=this.a13,i=this.a21,a=this.a22,s=this.a23,u=this.a31,l=this.a32,c=this.a33,h=0;h<e;h+=2){var f=t[h],d=t[h+1],p=o*f+s*d+c;t[h]=(r*f+i*d+u)/p,t[h+1]=(n*f+a*d+l)/p}},t.prototype.transformPointsWithValues=function(t,e){for(var r=this.a11,n=this.a12,o=this.a13,i=this.a21,a=this.a22,s=this.a23,u=this.a31,l=this.a32,c=this.a33,h=t.length,f=0;f<h;f++){var d=t[f],p=e[f],g=o*d+s*p+c;t[f]=(r*d+i*p+u)/g,e[f]=(n*d+a*p+l)/g}},t.squareToQuadrilateral=function(e,r,n,o,i,a,s,u){var l=e-n+i-s,c=r-o+a-u;if(0===l&&0===c)return new t(n-e,i-n,e,o-r,a-o,r,0,0,1);var h=n-i,f=s-i,d=o-a,p=u-a,g=h*p-f*d,m=(l*p-f*c)/g,v=(h*c-l*d)/g;return new t(n-e+m*n,s-e+v*s,e,o-r+m*o,u-r+v*u,r,m,v,1)},t.quadrilateralToSquare=function(e,r,n,o,i,a,s,u){return t.squareToQuadrilateral(e,r,n,o,i,a,s,u).buildAdjoint()},t.prototype.buildAdjoint=function(){return new t(this.a22*this.a33-this.a23*this.a32,this.a23*this.a31-this.a21*this.a33,this.a21*this.a32-this.a22*this.a31,this.a13*this.a32-this.a12*this.a33,this.a11*this.a33-this.a13*this.a31,this.a12*this.a31-this.a11*this.a32,this.a12*this.a23-this.a13*this.a22,this.a13*this.a21-this.a11*this.a23,this.a11*this.a22-this.a12*this.a21)},t.prototype.times=function(e){return new t(this.a11*e.a11+this.a21*e.a12+this.a31*e.a13,this.a11*e.a21+this.a21*e.a22+this.a31*e.a23,this.a11*e.a31+this.a21*e.a32+this.a31*e.a33,this.a12*e.a11+this.a22*e.a12+this.a32*e.a13,this.a12*e.a21+this.a22*e.a22+this.a32*e.a23,this.a12*e.a31+this.a22*e.a32+this.a32*e.a33,this.a13*e.a11+this.a23*e.a12+this.a33*e.a13,this.a13*e.a21+this.a23*e.a22+this.a33*e.a23,this.a13*e.a31+this.a23*e.a32+this.a33*e.a33)},t}(),Fn=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),jn=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Fn(e,t),e.prototype.sampleGrid=function(t,e,r,n,o,i,a,s,u,l,c,h,f,d,p,g,m,v,y){var _=Ln.quadrilateralToQuadrilateral(n,o,i,a,s,u,l,c,h,f,d,p,g,m,v,y);return this.sampleGridWithTransform(t,e,r,_)},e.prototype.sampleGridWithTransform=function(t,e,r,n){if(e<=0||r<=0)throw new Kr;for(var o=new Yr(e,r),i=new Float32Array(2*e),a=0;a<r;a++){for(var s=i.length,u=a+.5,l=0;l<s;l+=2)i[l]=l/2+.5,i[l+1]=u;n.transformPoints(i),Bn.checkAndNudgePoints(t,i);try{for(l=0;l<s;l+=2)t.get(Math.floor(i[l]),Math.floor(i[l+1]))&&o.set(l/2,a)}catch(c){throw new Kr}}return o},e}(Bn),Vn=function(){function t(){}return t.setGridSampler=function(e){t.gridSampler=e},t.getInstance=function(){return t.gridSampler},t.gridSampler=new jn,t}(),Un=function(){function t(t,e){this.x=t,this.y=e}return t.prototype.toResultPoint=function(){return new kn(this.getX(),this.getY())},t.prototype.getX=function(){return this.x},t.prototype.getY=function(){return this.y},t}(),Hn=function(){function t(t){this.EXPECTED_CORNER_BITS=new Int32Array([3808,476,2107,1799]),this.image=t}return t.prototype.detect=function(){return this.detectMirror(!1)},t.prototype.detectMirror=function(t){var e=this.getMatrixCenter(),r=this.getBullsEyeCorners(e);if(t){var n=r[0];r[0]=r[2],r[2]=n}this.extractParameters(r);var o=this.sampleGrid(this.image,r[this.shift%4],r[(this.shift+1)%4],r[(this.shift+2)%4],r[(this.shift+3)%4]),i=this.getMatrixCornerPoints(r);return new Pn(o,i,this.compact,this.nbDataBlocks,this.nbLayers)},t.prototype.extractParameters=function(t){if(!(this.isValidPoint(t[0])&&this.isValidPoint(t[1])&&this.isValidPoint(t[2])&&this.isValidPoint(t[3])))throw new Kr;var e=2*this.nbCenterLayers,r=new Int32Array([this.sampleLine(t[0],t[1],e),this.sampleLine(t[1],t[2],e),this.sampleLine(t[2],t[3],e),this.sampleLine(t[3],t[0],e)]);this.shift=this.getRotation(r,e);for(var n=0,o=0;o<4;o++){var i=r[(this.shift+o)%4];this.compact?(n<<=7,n+=i>>1&127):(n<<=10,n+=(i>>2&992)+(i>>1&31))}var a=this.getCorrectedParameterData(n,this.compact);this.compact?(this.nbLayers=1+(a>>6),this.nbDataBlocks=1+(63&a)):(this.nbLayers=1+(a>>11),this.nbDataBlocks=1+(2047&a))},t.prototype.getRotation=function(t,e){var r=0;t.forEach(function(t,n,o){r=(t>>e-2<<1)+(1&t)+(r<<3)}),r=((1&r)<<11)+(r>>1);for(var n=0;n<4;n++)if(Mr.bitCount(r^this.EXPECTED_CORNER_BITS[n])<=2)return n;throw new Kr},t.prototype.getCorrectedParameterData=function(t,e){var r,n;e?(r=7,n=2):(r=10,n=4);for(var o=r-n,i=new Int32Array(r),a=r-1;a>=0;--a)i[a]=15&t,t>>=4;try{new xn(Cn.AZTEC_PARAM).decode(i,o)}catch(u){throw new Kr}var s=0;for(a=0;a<n;a++)s=(s<<4)+i[a];return s},t.prototype.getBullsEyeCorners=function(t){var e=t,r=t,n=t,o=t,i=!0;for(this.nbCenterLayers=1;this.nbCenterLayers<9;this.nbCenterLayers++){var a=this.getFirstDifferent(e,i,1,-1),s=this.getFirstDifferent(r,i,1,1),u=this.getFirstDifferent(n,i,-1,1),l=this.getFirstDifferent(o,i,-1,-1);if(this.nbCenterLayers>2){var c=this.distancePoint(l,a)*this.nbCenterLayers/(this.distancePoint(o,e)*(this.nbCenterLayers+2));if(c<.75||c>1.25||!this.isWhiteOrBlackRectangle(a,s,u,l))break}e=a,r=s,n=u,o=l,i=!i}if(5!==this.nbCenterLayers&&7!==this.nbCenterLayers)throw new Kr;this.compact=5===this.nbCenterLayers;var h=new kn(e.getX()+.5,e.getY()-.5),f=new kn(r.getX()+.5,r.getY()+.5),d=new kn(n.getX()-.5,n.getY()+.5),p=new kn(o.getX()-.5,o.getY()-.5);return this.expandSquare([h,f,d,p],2*this.nbCenterLayers-3,2*this.nbCenterLayers)},t.prototype.getMatrixCenter=function(){var t,e,r,n;try{t=(u=new Mn(this.image).detect())[0],e=u[1],r=u[2],n=u[3]}catch(l){var o=this.image.getWidth()/2,i=this.image.getHeight()/2;t=this.getFirstDifferent(new Un(o+7,i-7),!1,1,-1).toResultPoint(),e=this.getFirstDifferent(new Un(o+7,i+7),!1,1,1).toResultPoint(),r=this.getFirstDifferent(new Un(o-7,i+7),!1,-1,1).toResultPoint(),n=this.getFirstDifferent(new Un(o-7,i-7),!1,-1,-1).toResultPoint()}var a=Tn.round((t.getX()+n.getX()+e.getX()+r.getX())/4),s=Tn.round((t.getY()+n.getY()+e.getY()+r.getY())/4);try{var u;t=(u=new Mn(this.image,15,a,s).detect())[0],e=u[1],r=u[2],n=u[3]}catch(c){t=this.getFirstDifferent(new Un(a+7,s-7),!1,1,-1).toResultPoint(),e=this.getFirstDifferent(new Un(a+7,s+7),!1,1,1).toResultPoint(),r=this.getFirstDifferent(new Un(a-7,s+7),!1,-1,1).toResultPoint(),n=this.getFirstDifferent(new Un(a-7,s-7),!1,-1,-1).toResultPoint()}return a=Tn.round((t.getX()+n.getX()+e.getX()+r.getX())/4),s=Tn.round((t.getY()+n.getY()+e.getY()+r.getY())/4),new Un(a,s)},t.prototype.getMatrixCornerPoints=function(t){return this.expandSquare(t,2*this.nbCenterLayers,this.getDimension())},t.prototype.sampleGrid=function(t,e,r,n,o){var i=Vn.getInstance(),a=this.getDimension(),s=a/2-this.nbCenterLayers,u=a/2+this.nbCenterLayers;return i.sampleGrid(t,a,a,s,s,u,s,u,u,s,u,e.getX(),e.getY(),r.getX(),r.getY(),n.getX(),n.getY(),o.getX(),o.getY())},t.prototype.sampleLine=function(t,e,r){for(var n=0,o=this.distanceResultPoint(t,e),i=o/r,a=t.getX(),s=t.getY(),u=i*(e.getX()-t.getX())/o,l=i*(e.getY()-t.getY())/o,c=0;c<r;c++)this.image.get(Tn.round(a+c*u),Tn.round(s+c*l))&&(n|=1<<r-c-1);return n},t.prototype.isWhiteOrBlackRectangle=function(t,e,r,n){t=new Un(t.getX()-3,t.getY()+3),e=new Un(e.getX()-3,e.getY()-3),r=new Un(r.getX()+3,r.getY()-3),n=new Un(n.getX()+3,n.getY()+3);var o=this.getColor(n,t);if(0===o)return!1;var i=this.getColor(t,e);return i===o&&(i=this.getColor(e,r))===o&&(i=this.getColor(r,n))===o},t.prototype.getColor=function(t,e){for(var r=this.distancePoint(t,e),n=(e.getX()-t.getX())/r,o=(e.getY()-t.getY())/r,i=0,a=t.getX(),s=t.getY(),u=this.image.get(t.getX(),t.getY()),l=Math.ceil(r),c=0;c<l;c++)a+=n,s+=o,this.image.get(Tn.round(a),Tn.round(s))!==u&&i++;var h=i/r;return h>.1&&h<.9?0:h<=.1===u?1:-1},t.prototype.getFirstDifferent=function(t,e,r,n){for(var o=t.getX()+r,i=t.getY()+n;this.isValid(o,i)&&this.image.get(o,i)===e;)o+=r,i+=n;for(o-=r,i-=n;this.isValid(o,i)&&this.image.get(o,i)===e;)o+=r;for(o-=r;this.isValid(o,i)&&this.image.get(o,i)===e;)i+=n;return new Un(o,i-=n)},t.prototype.expandSquare=function(t,e,r){var n=r/(2*e),o=t[0].getX()-t[2].getX(),i=t[0].getY()-t[2].getY(),a=(t[0].getX()+t[2].getX())/2,s=(t[0].getY()+t[2].getY())/2,u=new kn(a+n*o,s+n*i),l=new kn(a-n*o,s-n*i);return o=t[1].getX()-t[3].getX(),i=t[1].getY()-t[3].getY(),a=(t[1].getX()+t[3].getX())/2,s=(t[1].getY()+t[3].getY())/2,[u,new kn(a+n*o,s+n*i),l,new kn(a-n*o,s-n*i)]},t.prototype.isValid=function(t,e){return t>=0&&t<this.image.getWidth()&&e>0&&e<this.image.getHeight()},t.prototype.isValidPoint=function(t){var e=Tn.round(t.getX()),r=Tn.round(t.getY());return this.isValid(e,r)},t.prototype.distancePoint=function(t,e){return Tn.distance(t.getX(),t.getY(),e.getX(),e.getY())},t.prototype.distanceResultPoint=function(t,e){return Tn.distance(t.getX(),t.getY(),e.getX(),e.getY())},t.prototype.getDimension=function(){return this.compact?4*this.nbLayers+11:this.nbLayers<=4?4*this.nbLayers+15:4*this.nbLayers+2*(Mr.truncDivision(this.nbLayers-4,8)+1)+15},t}(),zn=function(){function t(){}return t.prototype.decode=function(t,e){void 0===e&&(e=null);var r=null,n=new Hn(t.getBlackMatrix()),o=null,i=null;try{o=(a=n.detectMirror(!1)).getPoints(),this.reportFoundResultPoints(e,o),i=(new On).decode(a)}catch(c){r=c}if(null==i)try{var a;o=(a=n.detectMirror(!0)).getPoints(),this.reportFoundResultPoints(e,o),i=(new On).decode(a)}catch(c){if(null!=r)throw r;throw c}var s=new hn(i.getText(),i.getRawBytes(),i.getNumBits(),o,dn.AZTEC,Tr.currentTimeMillis()),u=i.getByteSegments();null!=u&&s.putMetadata(gn.BYTE_SEGMENTS,u);var l=i.getECLevel();return null!=l&&s.putMetadata(gn.ERROR_CORRECTION_LEVEL,l),s},t.prototype.reportFoundResultPoints=function(t,e){if(null!=t){var r=t.get(Fr.NEED_RESULT_POINT_CALLBACK);null!=r&&e.forEach(function(t,e,n){r.foundPossibleResultPoint(t)})}},t.prototype.reset=function(){},t}(),Wn=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();!function(t){Wn(function(e){return void 0===e&&(e=500),t.call(this,new zn,e)||this},t)}(cn);var Gn=function(){function t(){}return t.prototype.decode=function(t,e){try{return this.doDecode(t,e)}catch(l){if(e&&!0===e.get(Fr.TRY_HARDER)&&t.isRotateSupported()){var r=t.rotateCounterClockwise(),n=this.doDecode(r,e),o=n.getResultMetadata(),i=270;null!==o&&!0===o.get(gn.ORIENTATION)&&(i+=o.get(gn.ORIENTATION)%360),n.putMetadata(gn.ORIENTATION,i);var a=n.getResultPoints();if(null!==a)for(var s=r.getHeight(),u=0;u<a.length;u++)a[u]=new kn(s-a[u].getY()-1,a[u].getX());return n}throw new Kr}},t.prototype.reset=function(){},t.prototype.doDecode=function(t,e){var r,n=t.getWidth(),o=t.getHeight(),i=new Br(n),a=e&&!0===e.get(Fr.TRY_HARDER),s=Math.max(1,o>>(a?8:5));r=a?o:15;for(var u=Math.trunc(o/2),l=0;l<r;l++){var c=Math.trunc((l+1)/2),h=u+s*(1&l?-c:c);if(h<0||h>=o)break;try{i=t.getBlackRow(h,i)}catch(m){continue}for(var f=function(t){if(1===t&&(i.reverse(),e&&!0===e.get(Fr.NEED_RESULT_POINT_CALLBACK))){var r=new Map;e.forEach(function(t,e){return r.set(e,t)}),r.delete(Fr.NEED_RESULT_POINT_CALLBACK),e=r}try{var o=d.decodeRow(h,i,e);if(1===t){o.putMetadata(gn.ORIENTATION,180);var a=o.getResultPoints();null!==a&&(a[0]=new kn(n-a[0].getX()-1,a[0].getY()),a[1]=new kn(n-a[1].getX()-1,a[1].getY()))}return{value:o}}catch(s){}},d=this,p=0;p<2;p++){var g=f(p);if("object"==typeof g)return g.value}}throw new Kr},t.recordPattern=function(t,e,r){for(var n=r.length,o=0;o<n;o++)r[o]=0;var i=t.getSize();if(e>=i)throw new Kr;for(var a=!t.get(e),s=0,u=e;u<i;){if(t.get(u)!==a)r[s]++;else{if(++s===n)break;r[s]=1,a=!a}u++}if(s!==n&&(s!==n-1||u!==i))throw new Kr},t.recordPatternInReverse=function(e,r,n){for(var o=n.length,i=e.get(r);r>0&&o>=0;)e.get(--r)!==i&&(o--,i=!i);if(o>=0)throw new Kr;t.recordPattern(e,r+1,n)},t.patternMatchVariance=function(t,e,r){for(var n=t.length,o=0,i=0,a=0;a<n;a++)o+=t[a],i+=e[a];if(o<i)return Number.POSITIVE_INFINITY;var s=o/i;r*=s;for(var u=0,l=0;l<n;l++){var c=t[l],h=e[l]*s,f=c>h?c-h:h-c;if(f>r)return Number.POSITIVE_INFINITY;u+=f}return u/o},t}(),Xn=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),$n=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Xn(e,t),e.findStartPattern=function(t){for(var r=t.getSize(),n=t.getNextSet(0),o=0,i=Int32Array.from([0,0,0,0,0,0]),a=n,s=!1,u=n;u<r;u++)if(t.get(u)!==s)i[o]++;else{if(5===o){for(var l=e.MAX_AVG_VARIANCE,c=-1,h=e.CODE_START_A;h<=e.CODE_START_C;h++){var f=Gn.patternMatchVariance(i,e.CODE_PATTERNS[h],e.MAX_INDIVIDUAL_VARIANCE);f<l&&(l=f,c=h)}if(c>=0&&t.isRange(Math.max(0,a-(u-a)/2),a,!1))return Int32Array.from([a,u,c]);a+=i[0]+i[1],(i=i.slice(2,i.length-1))[o-1]=0,i[o]=0,o--}else o++;i[o]=1,s=!s}throw new Kr},e.decodeCode=function(t,r,n){Gn.recordPattern(t,n,r);for(var o=e.MAX_AVG_VARIANCE,i=-1,a=0;a<e.CODE_PATTERNS.length;a++){var s=e.CODE_PATTERNS[a],u=this.patternMatchVariance(r,s,e.MAX_INDIVIDUAL_VARIANCE);u<o&&(o=u,i=a)}if(i>=0)return i;throw new Kr},e.prototype.decodeRow=function(t,r,n){var o,i=n&&!0===n.get(Fr.ASSUME_GS1),a=e.findStartPattern(r),s=a[2],u=0,l=new Uint8Array(20);switch(l[u++]=s,s){case e.CODE_START_A:o=e.CODE_CODE_A;break;case e.CODE_START_B:o=e.CODE_CODE_B;break;case e.CODE_START_C:o=e.CODE_CODE_C;break;default:throw new Vr}for(var c=!1,h=!1,f="",d=a[0],p=a[1],g=Int32Array.from([0,0,0,0,0,0]),m=0,v=0,y=s,_=0,w=!0,b=!1,C=!1;!c;){var A=h;switch(h=!1,m=v,v=e.decodeCode(r,g,p),l[u++]=v,v!==e.CODE_STOP&&(w=!0),v!==e.CODE_STOP&&(y+=++_*v),d=p,p+=g.reduce(function(t,e){return t+e},0),v){case e.CODE_START_A:case e.CODE_START_B:case e.CODE_START_C:throw new Vr}switch(o){case e.CODE_CODE_A:if(v<64)f+=C===b?String.fromCharCode(" ".charCodeAt(0)+v):String.fromCharCode(" ".charCodeAt(0)+v+128),C=!1;else if(v<96)f+=C===b?String.fromCharCode(v-64):String.fromCharCode(v+64),C=!1;else switch(v!==e.CODE_STOP&&(w=!1),v){case e.CODE_FNC_1:i&&(0===f.length?f+="]C1":f+=String.fromCharCode(29));break;case e.CODE_FNC_2:case e.CODE_FNC_3:break;case e.CODE_FNC_4_A:!b&&C?(b=!0,C=!1):b&&C?(b=!1,C=!1):C=!0;break;case e.CODE_SHIFT:h=!0,o=e.CODE_CODE_B;break;case e.CODE_CODE_B:o=e.CODE_CODE_B;break;case e.CODE_CODE_C:o=e.CODE_CODE_C;break;case e.CODE_STOP:c=!0}break;case e.CODE_CODE_B:if(v<96)f+=C===b?String.fromCharCode(" ".charCodeAt(0)+v):String.fromCharCode(" ".charCodeAt(0)+v+128),C=!1;else switch(v!==e.CODE_STOP&&(w=!1),v){case e.CODE_FNC_1:i&&(0===f.length?f+="]C1":f+=String.fromCharCode(29));break;case e.CODE_FNC_2:case e.CODE_FNC_3:break;case e.CODE_FNC_4_B:!b&&C?(b=!0,C=!1):b&&C?(b=!1,C=!1):C=!0;break;case e.CODE_SHIFT:h=!0,o=e.CODE_CODE_A;break;case e.CODE_CODE_A:o=e.CODE_CODE_A;break;case e.CODE_CODE_C:o=e.CODE_CODE_C;break;case e.CODE_STOP:c=!0}break;case e.CODE_CODE_C:if(v<100)v<10&&(f+="0"),f+=v;else switch(v!==e.CODE_STOP&&(w=!1),v){case e.CODE_FNC_1:i&&(0===f.length?f+="]C1":f+=String.fromCharCode(29));break;case e.CODE_CODE_A:o=e.CODE_CODE_A;break;case e.CODE_CODE_B:o=e.CODE_CODE_B;break;case e.CODE_STOP:c=!0}}A&&(o=o===e.CODE_CODE_A?e.CODE_CODE_B:e.CODE_CODE_A)}var E=p-d;if(p=r.getNextUnset(p),!r.isRange(p,Math.min(r.getSize(),p+(p-d)/2),!1))throw new Kr;if((y-=_*m)%103!==m)throw new xr;var I=f.length;if(0===I)throw new Kr;I>0&&w&&(f=o===e.CODE_CODE_C?f.substring(0,I-2):f.substring(0,I-1));for(var S=(a[1]+a[0])/2,x=d+E/2,O=l.length,T=new Uint8Array(O),N=0;N<O;N++)T[N]=l[N];var k=[new kn(S,t),new kn(x,t)];return new hn(f,T,0,k,dn.CODE_128,(new Date).getTime())},e.CODE_PATTERNS=[Int32Array.from([2,1,2,2,2,2]),Int32Array.from([2,2,2,1,2,2]),Int32Array.from([2,2,2,2,2,1]),Int32Array.from([1,2,1,2,2,3]),Int32Array.from([1,2,1,3,2,2]),Int32Array.from([1,3,1,2,2,2]),Int32Array.from([1,2,2,2,1,3]),Int32Array.from([1,2,2,3,1,2]),Int32Array.from([1,3,2,2,1,2]),Int32Array.from([2,2,1,2,1,3]),Int32Array.from([2,2,1,3,1,2]),Int32Array.from([2,3,1,2,1,2]),Int32Array.from([1,1,2,2,3,2]),Int32Array.from([1,2,2,1,3,2]),Int32Array.from([1,2,2,2,3,1]),Int32Array.from([1,1,3,2,2,2]),Int32Array.from([1,2,3,1,2,2]),Int32Array.from([1,2,3,2,2,1]),Int32Array.from([2,2,3,2,1,1]),Int32Array.from([2,2,1,1,3,2]),Int32Array.from([2,2,1,2,3,1]),Int32Array.from([2,1,3,2,1,2]),Int32Array.from([2,2,3,1,1,2]),Int32Array.from([3,1,2,1,3,1]),Int32Array.from([3,1,1,2,2,2]),Int32Array.from([3,2,1,1,2,2]),Int32Array.from([3,2,1,2,2,1]),Int32Array.from([3,1,2,2,1,2]),Int32Array.from([3,2,2,1,1,2]),Int32Array.from([3,2,2,2,1,1]),Int32Array.from([2,1,2,1,2,3]),Int32Array.from([2,1,2,3,2,1]),Int32Array.from([2,3,2,1,2,1]),Int32Array.from([1,1,1,3,2,3]),Int32Array.from([1,3,1,1,2,3]),Int32Array.from([1,3,1,3,2,1]),Int32Array.from([1,1,2,3,1,3]),Int32Array.from([1,3,2,1,1,3]),Int32Array.from([1,3,2,3,1,1]),Int32Array.from([2,1,1,3,1,3]),Int32Array.from([2,3,1,1,1,3]),Int32Array.from([2,3,1,3,1,1]),Int32Array.from([1,1,2,1,3,3]),Int32Array.from([1,1,2,3,3,1]),Int32Array.from([1,3,2,1,3,1]),Int32Array.from([1,1,3,1,2,3]),Int32Array.from([1,1,3,3,2,1]),Int32Array.from([1,3,3,1,2,1]),Int32Array.from([3,1,3,1,2,1]),Int32Array.from([2,1,1,3,3,1]),Int32Array.from([2,3,1,1,3,1]),Int32Array.from([2,1,3,1,1,3]),Int32Array.from([2,1,3,3,1,1]),Int32Array.from([2,1,3,1,3,1]),Int32Array.from([3,1,1,1,2,3]),Int32Array.from([3,1,1,3,2,1]),Int32Array.from([3,3,1,1,2,1]),Int32Array.from([3,1,2,1,1,3]),Int32Array.from([3,1,2,3,1,1]),Int32Array.from([3,3,2,1,1,1]),Int32Array.from([3,1,4,1,1,1]),Int32Array.from([2,2,1,4,1,1]),Int32Array.from([4,3,1,1,1,1]),Int32Array.from([1,1,1,2,2,4]),Int32Array.from([1,1,1,4,2,2]),Int32Array.from([1,2,1,1,2,4]),Int32Array.from([1,2,1,4,2,1]),Int32Array.from([1,4,1,1,2,2]),Int32Array.from([1,4,1,2,2,1]),Int32Array.from([1,1,2,2,1,4]),Int32Array.from([1,1,2,4,1,2]),Int32Array.from([1,2,2,1,1,4]),Int32Array.from([1,2,2,4,1,1]),Int32Array.from([1,4,2,1,1,2]),Int32Array.from([1,4,2,2,1,1]),Int32Array.from([2,4,1,2,1,1]),Int32Array.from([2,2,1,1,1,4]),Int32Array.from([4,1,3,1,1,1]),Int32Array.from([2,4,1,1,1,2]),Int32Array.from([1,3,4,1,1,1]),Int32Array.from([1,1,1,2,4,2]),Int32Array.from([1,2,1,1,4,2]),Int32Array.from([1,2,1,2,4,1]),Int32Array.from([1,1,4,2,1,2]),Int32Array.from([1,2,4,1,1,2]),Int32Array.from([1,2,4,2,1,1]),Int32Array.from([4,1,1,2,1,2]),Int32Array.from([4,2,1,1,1,2]),Int32Array.from([4,2,1,2,1,1]),Int32Array.from([2,1,2,1,4,1]),Int32Array.from([2,1,4,1,2,1]),Int32Array.from([4,1,2,1,2,1]),Int32Array.from([1,1,1,1,4,3]),Int32Array.from([1,1,1,3,4,1]),Int32Array.from([1,3,1,1,4,1]),Int32Array.from([1,1,4,1,1,3]),Int32Array.from([1,1,4,3,1,1]),Int32Array.from([4,1,1,1,1,3]),Int32Array.from([4,1,1,3,1,1]),Int32Array.from([1,1,3,1,4,1]),Int32Array.from([1,1,4,1,3,1]),Int32Array.from([3,1,1,1,4,1]),Int32Array.from([4,1,1,1,3,1]),Int32Array.from([2,1,1,4,1,2]),Int32Array.from([2,1,1,2,1,4]),Int32Array.from([2,1,1,2,3,2]),Int32Array.from([2,3,3,1,1,1,2])],e.MAX_AVG_VARIANCE=.25,e.MAX_INDIVIDUAL_VARIANCE=.7,e.CODE_SHIFT=98,e.CODE_CODE_C=99,e.CODE_CODE_B=100,e.CODE_CODE_A=101,e.CODE_FNC_1=102,e.CODE_FNC_2=97,e.CODE_FNC_3=96,e.CODE_FNC_4_A=101,e.CODE_FNC_4_B=100,e.CODE_START_A=103,e.CODE_START_B=104,e.CODE_START_C=105,e.CODE_STOP=106,e}(Gn),Yn=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),qn=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Kn=function(t){function e(e,r){void 0===e&&(e=!1),void 0===r&&(r=!1);var n=t.call(this)||this;return n.usingCheckDigit=e,n.extendedMode=r,n.decodeRowResult="",n.counters=new Int32Array(9),n}return Yn(e,t),e.prototype.decodeRow=function(t,r,n){var o,i,a,s,u=this.counters;u.fill(0),this.decodeRowResult="";var l,c,h=e.findAsteriskPattern(r,u),f=r.getNextSet(h[1]),d=r.getSize();do{e.recordPattern(r,f,u);var p=e.toNarrowWidePattern(u);if(p<0)throw new Kr;l=e.patternToChar(p),this.decodeRowResult+=l,c=f;try{for(var g=(o=void 0,qn(u)),m=g.next();!m.done;m=g.next())f+=m.value}catch(S){o={error:S}}finally{try{m&&!m.done&&(i=g.return)&&i.call(g)}finally{if(o)throw o.error}}f=r.getNextSet(f)}while("*"!==l);this.decodeRowResult=this.decodeRowResult.substring(0,this.decodeRowResult.length-1);var v,y=0;try{for(var _=qn(u),w=_.next();!w.done;w=_.next())y+=w.value}catch(S){a={error:S}}finally{try{w&&!w.done&&(s=_.return)&&s.call(_)}finally{if(a)throw a.error}}if(f!==d&&2*(f-c-y)<y)throw new Kr;if(this.usingCheckDigit){for(var b=this.decodeRowResult.length-1,C=0,A=0;A<b;A++)C+=e.ALPHABET_STRING.indexOf(this.decodeRowResult.charAt(A));if(this.decodeRowResult.charAt(b)!==e.ALPHABET_STRING.charAt(C%43))throw new xr;this.decodeRowResult=this.decodeRowResult.substring(0,b)}if(0===this.decodeRowResult.length)throw new Kr;v=this.extendedMode?e.decodeExtended(this.decodeRowResult):this.decodeRowResult;var E=(h[1]+h[0])/2,I=c+y/2;return new hn(v,null,0,[new kn(E,t),new kn(I,t)],dn.CODE_39,(new Date).getTime())},e.findAsteriskPattern=function(t,r){for(var n=t.getSize(),o=t.getNextSet(0),i=0,a=o,s=!1,u=r.length,l=o;l<n;l++)if(t.get(l)!==s)r[i]++;else{if(i===u-1){if(this.toNarrowWidePattern(r)===e.ASTERISK_ENCODING&&t.isRange(Math.max(0,a-Math.floor((l-a)/2)),a,!1))return[a,l];a+=r[0]+r[1],r.copyWithin(0,2,2+i-1),r[i-1]=0,r[i]=0,i--}else i++;r[i]=1,s=!s}throw new Kr},e.toNarrowWidePattern=function(t){var e,r,n,o=t.length,i=0;do{var a=2147483647;try{for(var s=(e=void 0,qn(t)),u=s.next();!u.done;u=s.next())(f=u.value)<a&&f>i&&(a=f)}catch(d){e={error:d}}finally{try{u&&!u.done&&(r=s.return)&&r.call(s)}finally{if(e)throw e.error}}i=a,n=0;for(var l=0,c=0,h=0;h<o;h++)(f=t[h])>i&&(c|=1<<o-1-h,n++,l+=f);if(3===n){for(h=0;h<o&&n>0;h++){var f;if((f=t[h])>i&&(n--,2*f>=l))return-1}return c}}while(n>3);return-1},e.patternToChar=function(t){for(var r=0;r<e.CHARACTER_ENCODINGS.length;r++)if(e.CHARACTER_ENCODINGS[r]===t)return e.ALPHABET_STRING.charAt(r);if(t===e.ASTERISK_ENCODING)return"*";throw new Kr},e.decodeExtended=function(t){for(var e=t.length,r="",n=0;n<e;n++){var o=t.charAt(n);if("+"===o||"$"===o||"%"===o||"/"===o){var i=t.charAt(n+1),a="\0";switch(o){case"+":if(!(i>="A"&&i<="Z"))throw new Vr;a=String.fromCharCode(i.charCodeAt(0)+32);break;case"$":if(!(i>="A"&&i<="Z"))throw new Vr;a=String.fromCharCode(i.charCodeAt(0)-64);break;case"%":if(i>="A"&&i<="E")a=String.fromCharCode(i.charCodeAt(0)-38);else if(i>="F"&&i<="J")a=String.fromCharCode(i.charCodeAt(0)-11);else if(i>="K"&&i<="O")a=String.fromCharCode(i.charCodeAt(0)+16);else if(i>="P"&&i<="T")a=String.fromCharCode(i.charCodeAt(0)+43);else if("U"===i)a="\0";else if("V"===i)a="@";else if("W"===i)a="`";else{if("X"!==i&&"Y"!==i&&"Z"!==i)throw new Vr;a=""}break;case"/":if(i>="A"&&i<="O")a=String.fromCharCode(i.charCodeAt(0)-32);else{if("Z"!==i)throw new Vr;a=":"}}r+=a,n++}else r+=o}return r},e.ALPHABET_STRING="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-. $/+%",e.CHARACTER_ENCODINGS=[52,289,97,352,49,304,112,37,292,100,265,73,328,25,280,88,13,268,76,28,259,67,322,19,274,82,7,262,70,22,385,193,448,145,400,208,133,388,196,168,162,138,42],e.ASTERISK_ENCODING=148,e}(Gn),Zn=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Qn=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.narrowLineWidth=-1,e}return Zn(e,t),e.prototype.decodeRow=function(t,r,n){var o,i,a=this.decodeStart(r),s=this.decodeEnd(r),u=new $r;e.decodeMiddle(r,a[1],s[0],u);var l=u.toString(),c=null;null!=n&&(c=n.get(Fr.ALLOWED_LENGTHS)),null==c&&(c=e.DEFAULT_ALLOWED_LENGTHS);var h=l.length,f=!1,d=0;try{for(var p=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}(c),g=p.next();!g.done;g=p.next()){var m=g.value;if(h===m){f=!0;break}m>d&&(d=m)}}catch(y){o={error:y}}finally{try{g&&!g.done&&(i=p.return)&&i.call(p)}finally{if(o)throw o.error}}if(!f&&h>d&&(f=!0),!f)throw new Vr;var v=[new kn(a[1],t),new kn(s[0],t)];return new hn(l,null,0,v,dn.ITF,(new Date).getTime())},e.decodeMiddle=function(t,r,n,o){var i=new Int32Array(10),a=new Int32Array(5),s=new Int32Array(5);for(i.fill(0),a.fill(0),s.fill(0);r<n;){Gn.recordPattern(t,r,i);for(var u=0;u<5;u++){var l=2*u;a[u]=i[l],s[u]=i[l+1]}var c=e.decodeDigit(a);o.append(c.toString()),c=this.decodeDigit(s),o.append(c.toString()),i.forEach(function(t){r+=t})}},e.prototype.decodeStart=function(t){var r=e.skipWhiteSpace(t),n=e.findGuardPattern(t,r,e.START_PATTERN);return this.narrowLineWidth=(n[1]-n[0])/4,this.validateQuietZone(t,n[0]),n},e.prototype.validateQuietZone=function(t,e){var r=10*this.narrowLineWidth;r=r<e?r:e;for(var n=e-1;r>0&&n>=0&&!t.get(n);n--)r--;if(0!==r)throw new Kr},e.skipWhiteSpace=function(t){var e=t.getSize(),r=t.getNextSet(0);if(r===e)throw new Kr;return r},e.prototype.decodeEnd=function(t){t.reverse();try{var r=e.skipWhiteSpace(t),n=void 0;try{n=e.findGuardPattern(t,r,e.END_PATTERN_REVERSED[0])}catch(i){i instanceof Kr&&(n=e.findGuardPattern(t,r,e.END_PATTERN_REVERSED[1]))}this.validateQuietZone(t,n[0]);var o=n[0];return n[0]=t.getSize()-n[1],n[1]=t.getSize()-o,n}finally{t.reverse()}},e.findGuardPattern=function(t,r,n){var o=n.length,i=new Int32Array(o),a=t.getSize(),s=!1,u=0,l=r;i.fill(0);for(var c=r;c<a;c++)if(t.get(c)!==s)i[u]++;else{if(u===o-1){if(Gn.patternMatchVariance(i,n,e.MAX_INDIVIDUAL_VARIANCE)<e.MAX_AVG_VARIANCE)return[l,c];l+=i[0]+i[1],Tr.arraycopy(i,2,i,0,u-1),i[u-1]=0,i[u]=0,u--}else u++;i[u]=1,s=!s}throw new Kr},e.decodeDigit=function(t){for(var r=e.MAX_AVG_VARIANCE,n=-1,o=e.PATTERNS.length,i=0;i<o;i++){var a=e.PATTERNS[i],s=Gn.patternMatchVariance(t,a,e.MAX_INDIVIDUAL_VARIANCE);s<r?(r=s,n=i):s===r&&(n=-1)}if(n>=0)return n%10;throw new Kr},e.PATTERNS=[Int32Array.from([1,1,2,2,1]),Int32Array.from([2,1,1,1,2]),Int32Array.from([1,2,1,1,2]),Int32Array.from([2,2,1,1,1]),Int32Array.from([1,1,2,1,2]),Int32Array.from([2,1,2,1,1]),Int32Array.from([1,2,2,1,1]),Int32Array.from([1,1,1,2,2]),Int32Array.from([2,1,1,2,1]),Int32Array.from([1,2,1,2,1]),Int32Array.from([1,1,3,3,1]),Int32Array.from([3,1,1,1,3]),Int32Array.from([1,3,1,1,3]),Int32Array.from([3,3,1,1,1]),Int32Array.from([1,1,3,1,3]),Int32Array.from([3,1,3,1,1]),Int32Array.from([1,3,3,1,1]),Int32Array.from([1,1,1,3,3]),Int32Array.from([3,1,1,3,1]),Int32Array.from([1,3,1,3,1])],e.MAX_AVG_VARIANCE=.38,e.MAX_INDIVIDUAL_VARIANCE=.5,e.DEFAULT_ALLOWED_LENGTHS=[6,8,10,12,14],e.START_PATTERN=Int32Array.from([1,1,1,1]),e.END_PATTERN_REVERSED=[Int32Array.from([1,1,2]),Int32Array.from([1,1,3])],e}(Gn),Jn=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),to=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.decodeRowStringBuffer="",e}return Jn(e,t),e.findStartGuardPattern=function(t){for(var r,n=!1,o=0,i=Int32Array.from([0,0,0]);!n;){i=Int32Array.from([0,0,0]);var a=(r=e.findGuardPattern(t,o,!1,this.START_END_PATTERN,i))[0],s=a-((o=r[1])-a);s>=0&&(n=t.isRange(s,a,!1))}return r},e.checkChecksum=function(t){return e.checkStandardUPCEANChecksum(t)},e.checkStandardUPCEANChecksum=function(t){var r=t.length;if(0===r)return!1;var n=parseInt(t.charAt(r-1),10);return e.getStandardUPCEANChecksum(t.substring(0,r-1))===n},e.getStandardUPCEANChecksum=function(t){for(var e=t.length,r=0,n=e-1;n>=0;n-=2){if((o=t.charAt(n).charCodeAt(0)-"0".charCodeAt(0))<0||o>9)throw new Vr;r+=o}for(r*=3,n=e-2;n>=0;n-=2){var o;if((o=t.charAt(n).charCodeAt(0)-"0".charCodeAt(0))<0||o>9)throw new Vr;r+=o}return(1e3-r)%10},e.decodeEnd=function(t,r){return e.findGuardPattern(t,r,!1,e.START_END_PATTERN,new Int32Array(e.START_END_PATTERN.length).fill(0))},e.findGuardPatternWithoutCounters=function(t,e,r,n){return this.findGuardPattern(t,e,r,n,new Int32Array(n.length))},e.findGuardPattern=function(t,r,n,o,i){for(var a=t.getSize(),s=0,u=r=n?t.getNextUnset(r):t.getNextSet(r),l=o.length,c=n,h=r;h<a;h++)if(t.get(h)!==c)i[s]++;else{if(s===l-1){if(Gn.patternMatchVariance(i,o,e.MAX_INDIVIDUAL_VARIANCE)<e.MAX_AVG_VARIANCE)return Int32Array.from([u,h]);u+=i[0]+i[1];for(var f=i.slice(2,i.length-1),d=0;d<s-1;d++)i[d]=f[d];i[s-1]=0,i[s]=0,s--}else s++;i[s]=1,c=!c}throw new Kr},e.decodeDigit=function(t,r,n,o){this.recordPattern(t,n,r);for(var i=this.MAX_AVG_VARIANCE,a=-1,s=o.length,u=0;u<s;u++){var l=o[u],c=Gn.patternMatchVariance(r,l,e.MAX_INDIVIDUAL_VARIANCE);c<i&&(i=c,a=u)}if(a>=0)return a;throw new Kr},e.MAX_AVG_VARIANCE=.48,e.MAX_INDIVIDUAL_VARIANCE=.7,e.START_END_PATTERN=Int32Array.from([1,1,1]),e.MIDDLE_PATTERN=Int32Array.from([1,1,1,1,1]),e.END_PATTERN=Int32Array.from([1,1,1,1,1,1]),e.L_PATTERNS=[Int32Array.from([3,2,1,1]),Int32Array.from([2,2,2,1]),Int32Array.from([2,1,2,2]),Int32Array.from([1,4,1,1]),Int32Array.from([1,1,3,2]),Int32Array.from([1,2,3,1]),Int32Array.from([1,1,1,4]),Int32Array.from([1,3,1,2]),Int32Array.from([1,2,1,3]),Int32Array.from([3,1,1,2])],e}(Gn),eo=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},ro=function(){function t(){this.CHECK_DIGIT_ENCODINGS=[24,20,18,17,12,6,3,10,9,5],this.decodeMiddleCounters=Int32Array.from([0,0,0,0]),this.decodeRowStringBuffer=""}return t.prototype.decodeRow=function(e,r,n){var o=this.decodeRowStringBuffer,i=this.decodeMiddle(r,n,o),a=o.toString(),s=t.parseExtensionString(a),u=[new kn((n[0]+n[1])/2,e),new kn(i,e)],l=new hn(a,null,0,u,dn.UPC_EAN_EXTENSION,(new Date).getTime());return null!=s&&l.putAllMetadata(s),l},t.prototype.decodeMiddle=function(e,r,n){var o,i,a=this.decodeMiddleCounters;a[0]=0,a[1]=0,a[2]=0,a[3]=0;for(var s=e.getSize(),u=r[1],l=0,c=0;c<5&&u<s;c++){var h=to.decodeDigit(e,a,u,to.L_AND_G_PATTERNS);n+=String.fromCharCode("0".charCodeAt(0)+h%10);try{for(var f=(o=void 0,eo(a)),d=f.next();!d.done;d=f.next())u+=d.value}catch(g){o={error:g}}finally{try{d&&!d.done&&(i=f.return)&&i.call(f)}finally{if(o)throw o.error}}h>=10&&(l|=1<<4-c),4!==c&&(u=e.getNextSet(u),u=e.getNextUnset(u))}if(5!==n.length)throw new Kr;var p=this.determineCheckDigit(l);if(t.extensionChecksum(n.toString())!==p)throw new Kr;return u},t.extensionChecksum=function(t){for(var e=t.length,r=0,n=e-2;n>=0;n-=2)r+=t.charAt(n).charCodeAt(0)-"0".charCodeAt(0);for(r*=3,n=e-1;n>=0;n-=2)r+=t.charAt(n).charCodeAt(0)-"0".charCodeAt(0);return(r*=3)%10},t.prototype.determineCheckDigit=function(t){for(var e=0;e<10;e++)if(t===this.CHECK_DIGIT_ENCODINGS[e])return e;throw new Kr},t.parseExtensionString=function(e){if(5!==e.length)return null;var r=t.parseExtension5String(e);return null==r?null:new Map([[gn.SUGGESTED_PRICE,r]])},t.parseExtension5String=function(t){var e;switch(t.charAt(0)){case"0":e="£";break;case"5":e="$";break;case"9":switch(t){case"90000":return null;case"99991":return"0.00";case"99990":return"Used"}e="";break;default:e=""}var r=parseInt(t.substring(1)),n=r%100;return e+(r/100).toString()+"."+(n<10?"0"+n:n.toString())},t}(),no=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},oo=function(){function t(){this.decodeMiddleCounters=Int32Array.from([0,0,0,0]),this.decodeRowStringBuffer=""}return t.prototype.decodeRow=function(e,r,n){var o=this.decodeRowStringBuffer,i=this.decodeMiddle(r,n,o),a=o.toString(),s=t.parseExtensionString(a),u=[new kn((n[0]+n[1])/2,e),new kn(i,e)],l=new hn(a,null,0,u,dn.UPC_EAN_EXTENSION,(new Date).getTime());return null!=s&&l.putAllMetadata(s),l},t.prototype.decodeMiddle=function(t,e,r){var n,o,i=this.decodeMiddleCounters;i[0]=0,i[1]=0,i[2]=0,i[3]=0;for(var a=t.getSize(),s=e[1],u=0,l=0;l<2&&s<a;l++){var c=to.decodeDigit(t,i,s,to.L_AND_G_PATTERNS);r+=String.fromCharCode("0".charCodeAt(0)+c%10);try{for(var h=(n=void 0,no(i)),f=h.next();!f.done;f=h.next())s+=f.value}catch(d){n={error:d}}finally{try{f&&!f.done&&(o=h.return)&&o.call(h)}finally{if(n)throw n.error}}c>=10&&(u|=1<<1-l),1!==l&&(s=t.getNextSet(s),s=t.getNextUnset(s))}if(2!==r.length)throw new Kr;if(parseInt(r.toString())%4!==u)throw new Kr;return s},t.parseExtensionString=function(t){return 2!==t.length?null:new Map([[gn.ISSUE_NUMBER,parseInt(t)]])},t}(),io=function(){function t(){}return t.decodeRow=function(t,e,r){var n=to.findGuardPattern(e,r,!1,this.EXTENSION_START_PATTERN,new Int32Array(this.EXTENSION_START_PATTERN.length).fill(0));try{return(new ro).decodeRow(t,e,n)}catch(o){return(new oo).decodeRow(t,e,n)}},t.EXTENSION_START_PATTERN=Int32Array.from([1,1,2]),t}(),ao=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),so=function(t){function e(){var r=t.call(this)||this;r.decodeRowStringBuffer="",e.L_AND_G_PATTERNS=e.L_PATTERNS.map(function(t){return Int32Array.from(t)});for(var n=10;n<20;n++){for(var o=e.L_PATTERNS[n-10],i=new Int32Array(o.length),a=0;a<o.length;a++)i[a]=o[o.length-a-1];e.L_AND_G_PATTERNS[n]=i}return r}return ao(e,t),e.prototype.decodeRow=function(t,r,n){var o=e.findStartGuardPattern(r),i=null==n?null:n.get(Fr.NEED_RESULT_POINT_CALLBACK);if(null!=i){var a=new kn((o[0]+o[1])/2,t);i.foundPossibleResultPoint(a)}var s=this.decodeMiddle(r,o,this.decodeRowStringBuffer),u=s.rowOffset,l=s.resultString;if(null!=i){var c=new kn(u,t);i.foundPossibleResultPoint(c)}var h=e.decodeEnd(r,u);if(null!=i){var f=new kn((h[0]+h[1])/2,t);i.foundPossibleResultPoint(f)}var d=h[1],p=d+(d-h[0]);if(p>=r.getSize()||!r.isRange(d,p,!1))throw new Kr;var g=l.toString();if(g.length<8)throw new Vr;if(!e.checkChecksum(g))throw new xr;var m=(o[1]+o[0])/2,v=(h[1]+h[0])/2,y=this.getBarcodeFormat(),_=[new kn(m,t),new kn(v,t)],w=new hn(g,null,0,_,y,(new Date).getTime()),b=0;try{var C=io.decodeRow(t,r,h[1]);w.putMetadata(gn.UPC_EAN_EXTENSION,C.getText()),w.putAllMetadata(C.getResultMetadata()),w.addResultPoints(C.getResultPoints()),b=C.getText().length}catch(S){}var A=null==n?null:n.get(Fr.ALLOWED_EAN_EXTENSIONS);if(null!=A){var E=!1;for(var I in A)if(b.toString()===I){E=!0;break}if(!E)throw new Kr}return y===dn.EAN_13||dn.UPC_A,w},e.checkChecksum=function(t){return e.checkStandardUPCEANChecksum(t)},e.checkStandardUPCEANChecksum=function(t){var r=t.length;if(0===r)return!1;var n=parseInt(t.charAt(r-1),10);return e.getStandardUPCEANChecksum(t.substring(0,r-1))===n},e.getStandardUPCEANChecksum=function(t){for(var e=t.length,r=0,n=e-1;n>=0;n-=2){if((o=t.charAt(n).charCodeAt(0)-"0".charCodeAt(0))<0||o>9)throw new Vr;r+=o}for(r*=3,n=e-2;n>=0;n-=2){var o;if((o=t.charAt(n).charCodeAt(0)-"0".charCodeAt(0))<0||o>9)throw new Vr;r+=o}return(1e3-r)%10},e.decodeEnd=function(t,r){return e.findGuardPattern(t,r,!1,e.START_END_PATTERN,new Int32Array(e.START_END_PATTERN.length).fill(0))},e}(to),uo=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),lo=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},co=function(t){function e(){var e=t.call(this)||this;return e.decodeMiddleCounters=Int32Array.from([0,0,0,0]),e}return uo(e,t),e.prototype.decodeMiddle=function(t,r,n){var o,i,a,s,u=this.decodeMiddleCounters;u[0]=0,u[1]=0,u[2]=0,u[3]=0;for(var l=t.getSize(),c=r[1],h=0,f=0;f<6&&c<l;f++){var d=so.decodeDigit(t,u,c,so.L_AND_G_PATTERNS);n+=String.fromCharCode("0".charCodeAt(0)+d%10);try{for(var p=(o=void 0,lo(u)),g=p.next();!g.done;g=p.next())c+=g.value}catch(y){o={error:y}}finally{try{g&&!g.done&&(i=p.return)&&i.call(p)}finally{if(o)throw o.error}}d>=10&&(h|=1<<5-f)}for(n=e.determineFirstDigit(n,h),c=so.findGuardPattern(t,c,!0,so.MIDDLE_PATTERN,new Int32Array(so.MIDDLE_PATTERN.length).fill(0))[1],f=0;f<6&&c<l;f++){d=so.decodeDigit(t,u,c,so.L_PATTERNS),n+=String.fromCharCode("0".charCodeAt(0)+d);try{for(var m=(a=void 0,lo(u)),v=m.next();!v.done;v=m.next())c+=v.value}catch(y){a={error:y}}finally{try{v&&!v.done&&(s=m.return)&&s.call(m)}finally{if(a)throw a.error}}}return{rowOffset:c,resultString:n}},e.prototype.getBarcodeFormat=function(){return dn.EAN_13},e.determineFirstDigit=function(t,e){for(var r=0;r<10;r++)if(e===this.FIRST_DIGIT_ENCODINGS[r])return String.fromCharCode("0".charCodeAt(0)+r)+t;throw new Kr},e.FIRST_DIGIT_ENCODINGS=[0,11,13,14,19,25,28,21,22,26],e}(so),ho=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),fo=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},po=function(t){function e(){var e=t.call(this)||this;return e.decodeMiddleCounters=Int32Array.from([0,0,0,0]),e}return ho(e,t),e.prototype.decodeMiddle=function(t,e,r){var n,o,i,a,s=this.decodeMiddleCounters;s[0]=0,s[1]=0,s[2]=0,s[3]=0;for(var u=t.getSize(),l=e[1],c=0;c<4&&l<u;c++){var h=so.decodeDigit(t,s,l,so.L_PATTERNS);r+=String.fromCharCode("0".charCodeAt(0)+h);try{for(var f=(n=void 0,fo(s)),d=f.next();!d.done;d=f.next())l+=d.value}catch(m){n={error:m}}finally{try{d&&!d.done&&(o=f.return)&&o.call(f)}finally{if(n)throw n.error}}}for(l=so.findGuardPattern(t,l,!0,so.MIDDLE_PATTERN,new Int32Array(so.MIDDLE_PATTERN.length).fill(0))[1],c=0;c<4&&l<u;c++){h=so.decodeDigit(t,s,l,so.L_PATTERNS),r+=String.fromCharCode("0".charCodeAt(0)+h);try{for(var p=(i=void 0,fo(s)),g=p.next();!g.done;g=p.next())l+=g.value}catch(m){i={error:m}}finally{try{g&&!g.done&&(a=p.return)&&a.call(p)}finally{if(i)throw i.error}}}return{rowOffset:l,resultString:r}},e.prototype.getBarcodeFormat=function(){return dn.EAN_8},e}(so),go=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),mo=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.ean13Reader=new co,e}return go(e,t),e.prototype.getBarcodeFormat=function(){return dn.UPC_A},e.prototype.decode=function(t,e){return this.maybeReturnResult(this.ean13Reader.decode(t))},e.prototype.decodeRow=function(t,e,r){return this.maybeReturnResult(this.ean13Reader.decodeRow(t,e,r))},e.prototype.decodeMiddle=function(t,e,r){return this.ean13Reader.decodeMiddle(t,e,r)},e.prototype.maybeReturnResult=function(t){var e=t.getText();if("0"===e.charAt(0)){var r=new hn(e.substring(1),null,null,t.getResultPoints(),dn.UPC_A);return null!=t.getResultMetadata()&&r.putAllMetadata(t.getResultMetadata()),r}throw new Kr},e.prototype.reset=function(){this.ean13Reader.reset()},e}(so),vo=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),yo=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},_o=function(t){function e(){var e=t.call(this)||this;return e.decodeMiddleCounters=new Int32Array(4),e}return vo(e,t),e.prototype.decodeMiddle=function(t,r,n){var o,i,a=this.decodeMiddleCounters.map(function(t){return t});a[0]=0,a[1]=0,a[2]=0,a[3]=0;for(var s=t.getSize(),u=r[1],l=0,c=0;c<6&&u<s;c++){var h=e.decodeDigit(t,a,u,e.L_AND_G_PATTERNS);n+=String.fromCharCode("0".charCodeAt(0)+h%10);try{for(var f=(o=void 0,yo(a)),d=f.next();!d.done;d=f.next())u+=d.value}catch(p){o={error:p}}finally{try{d&&!d.done&&(i=f.return)&&i.call(f)}finally{if(o)throw o.error}}h>=10&&(l|=1<<5-c)}return e.determineNumSysAndCheckDigit(new $r(n),l),u},e.prototype.decodeEnd=function(t,r){return e.findGuardPatternWithoutCounters(t,r,!0,e.MIDDLE_END_PATTERN)},e.prototype.checkChecksum=function(t){return so.checkChecksum(e.convertUPCEtoUPCA(t))},e.determineNumSysAndCheckDigit=function(t,e){for(var r=0;r<=1;r++)for(var n=0;n<10;n++)if(e===this.NUMSYS_AND_CHECK_DIGIT_PATTERNS[r][n])return t.insert(0,"0"+r),void t.append("0"+n);throw Kr.getNotFoundInstance()},e.prototype.getBarcodeFormat=function(){return dn.UPC_E},e.convertUPCEtoUPCA=function(t){var e=t.slice(1,7).split("").map(function(t){return t.charCodeAt(0)}),r=new $r;r.append(t.charAt(0));var n=e[5];switch(n){case 0:case 1:case 2:r.appendChars(e,0,2),r.append(n),r.append("0000"),r.appendChars(e,2,3);break;case 3:r.appendChars(e,0,3),r.append("00000"),r.appendChars(e,3,2);break;case 4:r.appendChars(e,0,4),r.append("00000"),r.append(e[4]);break;default:r.appendChars(e,0,5),r.append("0000"),r.append(n)}return t.length>=8&&r.append(t.charAt(7)),r.toString()},e.MIDDLE_END_PATTERN=Int32Array.from([1,1,1,1,1,1]),e.NUMSYS_AND_CHECK_DIGIT_PATTERNS=[Int32Array.from([56,52,50,49,44,38,35,42,41,37]),Int32Array.from([7,11,13,14,19,25,28,21,22,1])],e}(so),wo=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),bo=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Co=function(t){function e(e){var r=t.call(this)||this,n=null==e?null:e.get(Fr.POSSIBLE_FORMATS),o=[];return null!=n&&(n.indexOf(dn.EAN_13)>-1?o.push(new co):n.indexOf(dn.UPC_A)>-1&&o.push(new mo),n.indexOf(dn.EAN_8)>-1&&o.push(new po),n.indexOf(dn.UPC_E)>-1&&o.push(new _o)),0===o.length&&(o.push(new co),o.push(new po),o.push(new _o)),r.readers=o,r}return wo(e,t),e.prototype.decodeRow=function(t,e,r){var n,o;try{for(var i=bo(this.readers),a=i.next();!a.done;a=i.next()){var s=a.value;try{var u=s.decodeRow(t,e,r),l=u.getBarcodeFormat()===dn.EAN_13&&"0"===u.getText().charAt(0),c=null==r?null:r.get(Fr.POSSIBLE_FORMATS),h=null==c||c.includes(dn.UPC_A);if(l&&h){var f=u.getRawBytes(),d=new hn(u.getText().substring(1),f,f.length,u.getResultPoints(),dn.UPC_A);return d.putAllMetadata(u.getResultMetadata()),d}return u}catch(p){}}}catch(p){n={error:p}}finally{try{a&&!a.done&&(o=i.return)&&o.call(i)}finally{if(n)throw n.error}}throw new Kr},e.prototype.reset=function(){var t,e;try{for(var r=bo(this.readers),n=r.next();!n.done;n=r.next())n.value.reset()}catch(o){t={error:o}}finally{try{n&&!n.done&&(e=r.return)&&e.call(r)}finally{if(t)throw t.error}}},e}(Gn),Ao=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Eo=function(t){function e(){var e=t.call(this)||this;return e.decodeFinderCounters=new Int32Array(4),e.dataCharacterCounters=new Int32Array(8),e.oddRoundingErrors=new Array(4),e.evenRoundingErrors=new Array(4),e.oddCounts=new Array(e.dataCharacterCounters.length/2),e.evenCounts=new Array(e.dataCharacterCounters.length/2),e}return Ao(e,t),e.prototype.getDecodeFinderCounters=function(){return this.decodeFinderCounters},e.prototype.getDataCharacterCounters=function(){return this.dataCharacterCounters},e.prototype.getOddRoundingErrors=function(){return this.oddRoundingErrors},e.prototype.getEvenRoundingErrors=function(){return this.evenRoundingErrors},e.prototype.getOddCounts=function(){return this.oddCounts},e.prototype.getEvenCounts=function(){return this.evenCounts},e.prototype.parseFinderValue=function(t,r){for(var n=0;n<r.length;n++)if(Gn.patternMatchVariance(t,r[n],e.MAX_INDIVIDUAL_VARIANCE)<e.MAX_AVG_VARIANCE)return n;throw new Kr},e.count=function(t){return Tn.sum(new Int32Array(t))},e.increment=function(t,e){for(var r=0,n=e[0],o=1;o<t.length;o++)e[o]>n&&(n=e[o],r=o);t[r]++},e.decrement=function(t,e){for(var r=0,n=e[0],o=1;o<t.length;o++)e[o]<n&&(n=e[o],r=o);t[r]--},e.isFinderPattern=function(t){var r,n,o=t[0]+t[1],i=o/(o+t[2]+t[3]);if(i>=e.MIN_FINDER_PATTERN_RATIO&&i<=e.MAX_FINDER_PATTERN_RATIO){var a=Number.MAX_SAFE_INTEGER,s=Number.MIN_SAFE_INTEGER;try{for(var u=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}(t),l=u.next();!l.done;l=u.next()){var c=l.value;c>s&&(s=c),c<a&&(a=c)}}catch(h){r={error:h}}finally{try{l&&!l.done&&(n=u.return)&&n.call(u)}finally{if(r)throw r.error}}return s<10*a}return!1},e.MAX_AVG_VARIANCE=.2,e.MAX_INDIVIDUAL_VARIANCE=.45,e.MIN_FINDER_PATTERN_RATIO=9.5/12,e.MAX_FINDER_PATTERN_RATIO=12.5/14,e}(Gn),Io=function(){function t(t,e){this.value=t,this.checksumPortion=e}return t.prototype.getValue=function(){return this.value},t.prototype.getChecksumPortion=function(){return this.checksumPortion},t.prototype.toString=function(){return this.value+"("+this.checksumPortion+")"},t.prototype.equals=function(e){if(!(e instanceof t))return!1;var r=e;return this.value===r.value&&this.checksumPortion===r.checksumPortion},t.prototype.hashCode=function(){return this.value^this.checksumPortion},t}(),So=function(){function t(t,e,r,n,o){this.value=t,this.startEnd=e,this.value=t,this.startEnd=e,this.resultPoints=new Array,this.resultPoints.push(new kn(r,o)),this.resultPoints.push(new kn(n,o))}return t.prototype.getValue=function(){return this.value},t.prototype.getStartEnd=function(){return this.startEnd},t.prototype.getResultPoints=function(){return this.resultPoints},t.prototype.equals=function(e){if(!(e instanceof t))return!1;var r=e;return this.value===r.value},t.prototype.hashCode=function(){return this.value},t}(),xo=function(){function t(){}return t.getRSSvalue=function(e,r,n){var o,i,a=0;try{for(var s=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}(e),u=s.next();!u.done;u=s.next())a+=u.value}catch(v){o={error:v}}finally{try{u&&!u.done&&(i=s.return)&&i.call(s)}finally{if(o)throw o.error}}for(var l=0,c=0,h=e.length,f=0;f<h-1;f++){var d=void 0;for(d=1,c|=1<<f;d<e[f];d++,c&=~(1<<f)){var p=t.combins(a-d-1,h-f-2);if(n&&0===c&&a-d-(h-f-1)>=h-f-1&&(p-=t.combins(a-d-(h-f),h-f-2)),h-f-1>1){for(var g=0,m=a-d-(h-f-2);m>r;m--)g+=t.combins(a-d-m-1,h-f-3);p-=g*(h-1-f)}else a-d>r&&p--;l+=p}a-=d}return l},t.combins=function(t,e){var r,n;t-e>e?(n=e,r=t-e):(n=t-e,r=e);for(var o=1,i=1,a=t;a>r;a--)o*=a,i<=n&&(o/=i,i++);for(;i<=n;)o/=i,i++;return o},t}(),Oo=function(){function t(){}return t.buildBitArray=function(t){var e=2*t.length-1;null==t[t.length-1].getRightChar()&&(e-=1);for(var r=new Br(12*e),n=0,o=t[0].getRightChar().getValue(),i=11;i>=0;--i)!!(o&1<<i)&&r.set(n),n++;for(i=1;i<t.length;++i){for(var a=t[i],s=a.getLeftChar().getValue(),u=11;u>=0;--u)!!(s&1<<u)&&r.set(n),n++;if(null!=a.getRightChar()){var l=a.getRightChar().getValue();for(u=11;u>=0;--u)!!(l&1<<u)&&r.set(n),n++}}return r},t}(),To=function(){function t(t,e){e?this.decodedInformation=null:(this.finished=t,this.decodedInformation=e)}return t.prototype.getDecodedInformation=function(){return this.decodedInformation},t.prototype.isFinished=function(){return this.finished},t}(),No=function(){function t(t){this.newPosition=t}return t.prototype.getNewPosition=function(){return this.newPosition},t}(),ko=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Ro=function(t){function e(e,r){var n=t.call(this,e)||this;return n.value=r,n}return ko(e,t),e.prototype.getValue=function(){return this.value},e.prototype.isFNC1=function(){return this.value===e.FNC1},e.FNC1="$",e}(No),Do=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Po=function(t){function e(e,r,n){var o=t.call(this,e)||this;return n?(o.remaining=!0,o.remainingValue=o.remainingValue):(o.remaining=!1,o.remainingValue=0),o.newString=r,o}return Do(e,t),e.prototype.getNewString=function(){return this.newString},e.prototype.isRemaining=function(){return this.remaining},e.prototype.getRemainingValue=function(){return this.remainingValue},e}(No),Mo=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Bo=function(t){function e(e,r,n){var o=t.call(this,e)||this;if(r<0||r>10||n<0||n>10)throw new Vr;return o.firstDigit=r,o.secondDigit=n,o}return Mo(e,t),e.prototype.getFirstDigit=function(){return this.firstDigit},e.prototype.getSecondDigit=function(){return this.secondDigit},e.prototype.getValue=function(){return 10*this.firstDigit+this.secondDigit},e.prototype.isFirstDigitFNC1=function(){return this.firstDigit===e.FNC1},e.prototype.isSecondDigitFNC1=function(){return this.secondDigit===e.FNC1},e.prototype.isAnyFNC1=function(){return this.firstDigit===e.FNC1||this.secondDigit===e.FNC1},e.FNC1=10,e}(No),Lo=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Fo=function(){function t(){}return t.parseFieldsInGeneralPurpose=function(e){var r,n,o,i,a,s,u,l;if(!e)return null;if(e.length<2)throw new Kr;var c=e.substring(0,2);try{for(var h=Lo(t.TWO_DIGIT_DATA_LENGTH),f=h.next();!f.done;f=h.next())if((b=f.value)[0]===c)return b[1]===t.VARIABLE_LENGTH?t.processVariableAI(2,b[2],e):t.processFixedAI(2,b[1],e)}catch(C){r={error:C}}finally{try{f&&!f.done&&(n=h.return)&&n.call(h)}finally{if(r)throw r.error}}if(e.length<3)throw new Kr;var d=e.substring(0,3);try{for(var p=Lo(t.THREE_DIGIT_DATA_LENGTH),g=p.next();!g.done;g=p.next())if((b=g.value)[0]===d)return b[1]===t.VARIABLE_LENGTH?t.processVariableAI(3,b[2],e):t.processFixedAI(3,b[1],e)}catch(C){o={error:C}}finally{try{g&&!g.done&&(i=p.return)&&i.call(p)}finally{if(o)throw o.error}}try{for(var m=Lo(t.THREE_DIGIT_PLUS_DIGIT_DATA_LENGTH),v=m.next();!v.done;v=m.next())if((b=v.value)[0]===d)return b[1]===t.VARIABLE_LENGTH?t.processVariableAI(4,b[2],e):t.processFixedAI(4,b[1],e)}catch(C){a={error:C}}finally{try{v&&!v.done&&(s=m.return)&&s.call(m)}finally{if(a)throw a.error}}if(e.length<4)throw new Kr;var y=e.substring(0,4);try{for(var _=Lo(t.FOUR_DIGIT_DATA_LENGTH),w=_.next();!w.done;w=_.next()){var b;if((b=w.value)[0]===y)return b[1]===t.VARIABLE_LENGTH?t.processVariableAI(4,b[2],e):t.processFixedAI(4,b[1],e)}}catch(C){u={error:C}}finally{try{w&&!w.done&&(l=_.return)&&l.call(_)}finally{if(u)throw u.error}}throw new Kr},t.processFixedAI=function(e,r,n){if(n.length<e)throw new Kr;var o=n.substring(0,e);if(n.length<e+r)throw new Kr;var i=n.substring(e,e+r),a=n.substring(e+r),s="("+o+")"+i,u=t.parseFieldsInGeneralPurpose(a);return null==u?s:s+u},t.processVariableAI=function(e,r,n){var o,i=n.substring(0,e);o=n.length<e+r?n.length:e+r;var a=n.substring(e,o),s=n.substring(o),u="("+i+")"+a,l=t.parseFieldsInGeneralPurpose(s);return null==l?u:u+l},t.VARIABLE_LENGTH=[],t.TWO_DIGIT_DATA_LENGTH=[["00",18],["01",14],["02",14],["10",t.VARIABLE_LENGTH,20],["11",6],["12",6],["13",6],["15",6],["17",6],["20",2],["21",t.VARIABLE_LENGTH,20],["22",t.VARIABLE_LENGTH,29],["30",t.VARIABLE_LENGTH,8],["37",t.VARIABLE_LENGTH,8],["90",t.VARIABLE_LENGTH,30],["91",t.VARIABLE_LENGTH,30],["92",t.VARIABLE_LENGTH,30],["93",t.VARIABLE_LENGTH,30],["94",t.VARIABLE_LENGTH,30],["95",t.VARIABLE_LENGTH,30],["96",t.VARIABLE_LENGTH,30],["97",t.VARIABLE_LENGTH,3],["98",t.VARIABLE_LENGTH,30],["99",t.VARIABLE_LENGTH,30]],t.THREE_DIGIT_DATA_LENGTH=[["240",t.VARIABLE_LENGTH,30],["241",t.VARIABLE_LENGTH,30],["242",t.VARIABLE_LENGTH,6],["250",t.VARIABLE_LENGTH,30],["251",t.VARIABLE_LENGTH,30],["253",t.VARIABLE_LENGTH,17],["254",t.VARIABLE_LENGTH,20],["400",t.VARIABLE_LENGTH,30],["401",t.VARIABLE_LENGTH,30],["402",17],["403",t.VARIABLE_LENGTH,30],["410",13],["411",13],["412",13],["413",13],["414",13],["420",t.VARIABLE_LENGTH,20],["421",t.VARIABLE_LENGTH,15],["422",3],["423",t.VARIABLE_LENGTH,15],["424",3],["425",3],["426",3]],t.THREE_DIGIT_PLUS_DIGIT_DATA_LENGTH=[["310",6],["311",6],["312",6],["313",6],["314",6],["315",6],["316",6],["320",6],["321",6],["322",6],["323",6],["324",6],["325",6],["326",6],["327",6],["328",6],["329",6],["330",6],["331",6],["332",6],["333",6],["334",6],["335",6],["336",6],["340",6],["341",6],["342",6],["343",6],["344",6],["345",6],["346",6],["347",6],["348",6],["349",6],["350",6],["351",6],["352",6],["353",6],["354",6],["355",6],["356",6],["357",6],["360",6],["361",6],["362",6],["363",6],["364",6],["365",6],["366",6],["367",6],["368",6],["369",6],["390",t.VARIABLE_LENGTH,15],["391",t.VARIABLE_LENGTH,18],["392",t.VARIABLE_LENGTH,15],["393",t.VARIABLE_LENGTH,18],["703",t.VARIABLE_LENGTH,30]],t.FOUR_DIGIT_DATA_LENGTH=[["7001",13],["7002",t.VARIABLE_LENGTH,30],["7003",10],["8001",14],["8002",t.VARIABLE_LENGTH,20],["8003",t.VARIABLE_LENGTH,30],["8004",t.VARIABLE_LENGTH,30],["8005",6],["8006",18],["8007",t.VARIABLE_LENGTH,30],["8008",t.VARIABLE_LENGTH,12],["8018",18],["8020",t.VARIABLE_LENGTH,25],["8100",6],["8101",10],["8102",2],["8110",t.VARIABLE_LENGTH,70],["8200",t.VARIABLE_LENGTH,70]],t}(),jo=function(){function t(t){this.buffer=new $r,this.information=t}return t.prototype.decodeAllCodes=function(t,e){for(var r=e,n=null;;){var o=this.decodeGeneralPurposeField(r,n),i=Fo.parseFieldsInGeneralPurpose(o.getNewString());if(null!=i&&t.append(i),n=o.isRemaining()?""+o.getRemainingValue():null,r===o.getNewPosition())break;r=o.getNewPosition()}return t.toString()},t.prototype.isStillNumeric=function(t){if(t+7>this.information.getSize())return t+4<=this.information.getSize();for(var e=t;e<t+3;++e)if(this.information.get(e))return!0;return this.information.get(t+3)},t.prototype.decodeNumeric=function(t){if(t+7>this.information.getSize()){var e=this.extractNumericValueFromBitArray(t,4);return new Bo(this.information.getSize(),0===e?Bo.FNC1:e-1,Bo.FNC1)}var r=this.extractNumericValueFromBitArray(t,7);return new Bo(t+7,(r-8)/11,(r-8)%11)},t.prototype.extractNumericValueFromBitArray=function(e,r){return t.extractNumericValueFromBitArray(this.information,e,r)},t.extractNumericValueFromBitArray=function(t,e,r){for(var n=0,o=0;o<r;++o)t.get(e+o)&&(n|=1<<r-o-1);return n},t.prototype.decodeGeneralPurposeField=function(t,e){this.buffer.setLengthToZero(),null!=e&&this.buffer.append(e),this.current.setPosition(t);var r=this.parseBlocks();return null!=r&&r.isRemaining()?new Po(this.current.getPosition(),this.buffer.toString(),r.getRemainingValue()):new Po(this.current.getPosition(),this.buffer.toString())},t.prototype.parseBlocks=function(){var t,e;do{var r=this.current.getPosition();if(t=this.current.isAlpha()?(e=this.parseAlphaBlock()).isFinished():this.current.isIsoIec646()?(e=this.parseIsoIec646Block()).isFinished():(e=this.parseNumericBlock()).isFinished(),r===this.current.getPosition()&&!t)break}while(!t);return e.getDecodedInformation()},t.prototype.parseNumericBlock=function(){for(;this.isStillNumeric(this.current.getPosition());){var t=this.decodeNumeric(this.current.getPosition());if(this.current.setPosition(t.getNewPosition()),t.isFirstDigitFNC1()){var e=void 0;return e=t.isSecondDigitFNC1()?new Po(this.current.getPosition(),this.buffer.toString()):new Po(this.current.getPosition(),this.buffer.toString(),t.getSecondDigit()),new To(!0,e)}if(this.buffer.append(t.getFirstDigit()),t.isSecondDigitFNC1())return e=new Po(this.current.getPosition(),this.buffer.toString()),new To(!0,e);this.buffer.append(t.getSecondDigit())}return this.isNumericToAlphaNumericLatch(this.current.getPosition())&&(this.current.setAlpha(),this.current.incrementPosition(4)),new To(!1)},t.prototype.parseIsoIec646Block=function(){for(;this.isStillIsoIec646(this.current.getPosition());){var t=this.decodeIsoIec646(this.current.getPosition());if(this.current.setPosition(t.getNewPosition()),t.isFNC1()){var e=new Po(this.current.getPosition(),this.buffer.toString());return new To(!0,e)}this.buffer.append(t.getValue())}return this.isAlphaOr646ToNumericLatch(this.current.getPosition())?(this.current.incrementPosition(3),this.current.setNumeric()):this.isAlphaTo646ToAlphaLatch(this.current.getPosition())&&(this.current.getPosition()+5<this.information.getSize()?this.current.incrementPosition(5):this.current.setPosition(this.information.getSize()),this.current.setAlpha()),new To(!1)},t.prototype.parseAlphaBlock=function(){for(;this.isStillAlpha(this.current.getPosition());){var t=this.decodeAlphanumeric(this.current.getPosition());if(this.current.setPosition(t.getNewPosition()),t.isFNC1()){var e=new Po(this.current.getPosition(),this.buffer.toString());return new To(!0,e)}this.buffer.append(t.getValue())}return this.isAlphaOr646ToNumericLatch(this.current.getPosition())?(this.current.incrementPosition(3),this.current.setNumeric()):this.isAlphaTo646ToAlphaLatch(this.current.getPosition())&&(this.current.getPosition()+5<this.information.getSize()?this.current.incrementPosition(5):this.current.setPosition(this.information.getSize()),this.current.setIsoIec646()),new To(!1)},t.prototype.isStillIsoIec646=function(t){if(t+5>this.information.getSize())return!1;var e=this.extractNumericValueFromBitArray(t,5);if(e>=5&&e<16)return!0;if(t+7>this.information.getSize())return!1;var r=this.extractNumericValueFromBitArray(t,7);if(r>=64&&r<116)return!0;if(t+8>this.information.getSize())return!1;var n=this.extractNumericValueFromBitArray(t,8);return n>=232&&n<253},t.prototype.decodeIsoIec646=function(t){var e=this.extractNumericValueFromBitArray(t,5);if(15===e)return new Ro(t+5,Ro.FNC1);if(e>=5&&e<15)return new Ro(t+5,"0"+(e-5));var r,n=this.extractNumericValueFromBitArray(t,7);if(n>=64&&n<90)return new Ro(t+7,""+(n+1));if(n>=90&&n<116)return new Ro(t+7,""+(n+7));switch(this.extractNumericValueFromBitArray(t,8)){case 232:r="!";break;case 233:r='"';break;case 234:r="%";break;case 235:r="&";break;case 236:r="'";break;case 237:r="(";break;case 238:r=")";break;case 239:r="*";break;case 240:r="+";break;case 241:r=",";break;case 242:r="-";break;case 243:r=".";break;case 244:r="/";break;case 245:r=":";break;case 246:r=";";break;case 247:r="<";break;case 248:r="=";break;case 249:r=">";break;case 250:r="?";break;case 251:r="_";break;case 252:r=" ";break;default:throw new Vr}return new Ro(t+8,r)},t.prototype.isStillAlpha=function(t){if(t+5>this.information.getSize())return!1;var e=this.extractNumericValueFromBitArray(t,5);if(e>=5&&e<16)return!0;if(t+6>this.information.getSize())return!1;var r=this.extractNumericValueFromBitArray(t,6);return r>=16&&r<63},t.prototype.decodeAlphanumeric=function(t){var e=this.extractNumericValueFromBitArray(t,5);if(15===e)return new Ro(t+5,Ro.FNC1);if(e>=5&&e<15)return new Ro(t+5,"0"+(e-5));var r,n=this.extractNumericValueFromBitArray(t,6);if(n>=32&&n<58)return new Ro(t+6,""+(n+33));switch(n){case 58:r="*";break;case 59:r=",";break;case 60:r="-";break;case 61:r=".";break;case 62:r="/";break;default:throw new Sn("Decoding invalid alphanumeric value: "+n)}return new Ro(t+6,r)},t.prototype.isAlphaTo646ToAlphaLatch=function(t){if(t+1>this.information.getSize())return!1;for(var e=0;e<5&&e+t<this.information.getSize();++e)if(2===e){if(!this.information.get(t+2))return!1}else if(this.information.get(t+e))return!1;return!0},t.prototype.isAlphaOr646ToNumericLatch=function(t){if(t+3>this.information.getSize())return!1;for(var e=t;e<t+3;++e)if(this.information.get(e))return!1;return!0},t.prototype.isNumericToAlphaNumericLatch=function(t){if(t+1>this.information.getSize())return!1;for(var e=0;e<4&&e+t<this.information.getSize();++e)if(this.information.get(t+e))return!1;return!0},t}(),Vo=function(){function t(t){this.information=t,this.generalDecoder=new jo(t)}return t.prototype.getInformation=function(){return this.information},t.prototype.getGeneralDecoder=function(){return this.generalDecoder},t}(),Uo=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Ho=function(t){function e(e){return t.call(this,e)||this}return Uo(e,t),e.prototype.encodeCompressedGtin=function(t,e){t.append("(01)");var r=t.length();t.append("9"),this.encodeCompressedGtinWithoutAI(t,e,r)},e.prototype.encodeCompressedGtinWithoutAI=function(t,r,n){for(var o=0;o<4;++o){var i=this.getGeneralDecoder().extractNumericValueFromBitArray(r+10*o,10);i/100==0&&t.append("0"),i/10==0&&t.append("0"),t.append(i)}e.appendCheckDigit(t,n)},e.appendCheckDigit=function(t,e){for(var r=0,n=0;n<13;n++){var o=t.charAt(n+e).charCodeAt(0)-"0".charCodeAt(0);r+=1&n?o:3*o}10==(r=10-r%10)&&(r=0),t.append(r)},e.GTIN_SIZE=40,e}(Vo),zo=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Wo=function(t){function e(e){return t.call(this,e)||this}return zo(e,t),e.prototype.parseInformation=function(){var t=new $r;t.append("(01)");var r=t.length(),n=this.getGeneralDecoder().extractNumericValueFromBitArray(e.HEADER_SIZE,4);return t.append(n),this.encodeCompressedGtinWithoutAI(t,e.HEADER_SIZE+4,r),this.getGeneralDecoder().decodeAllCodes(t,e.HEADER_SIZE+44)},e.HEADER_SIZE=4,e}(Ho),Go=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Xo=function(t){function e(e){return t.call(this,e)||this}return Go(e,t),e.prototype.parseInformation=function(){var t=new $r;return this.getGeneralDecoder().decodeAllCodes(t,e.HEADER_SIZE)},e.HEADER_SIZE=5,e}(Vo),$o=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Yo=function(t){function e(e){return t.call(this,e)||this}return $o(e,t),e.prototype.encodeCompressedWeight=function(t,e,r){var n=this.getGeneralDecoder().extractNumericValueFromBitArray(e,r);this.addWeightCode(t,n);for(var o=this.checkWeight(n),i=1e5,a=0;a<5;++a)o/i==0&&t.append("0"),i/=10;t.append(o)},e}(Ho),qo=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Ko=function(t){function e(e){return t.call(this,e)||this}return qo(e,t),e.prototype.parseInformation=function(){if(this.getInformation().getSize()!=e.HEADER_SIZE+Yo.GTIN_SIZE+e.WEIGHT_SIZE)throw new Kr;var t=new $r;return this.encodeCompressedGtin(t,e.HEADER_SIZE),this.encodeCompressedWeight(t,e.HEADER_SIZE+Yo.GTIN_SIZE,e.WEIGHT_SIZE),t.toString()},e.HEADER_SIZE=5,e.WEIGHT_SIZE=15,e}(Yo),Zo=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Qo=function(t){function e(e){return t.call(this,e)||this}return Zo(e,t),e.prototype.addWeightCode=function(t,e){t.append("(3103)")},e.prototype.checkWeight=function(t){return t},e}(Ko),Jo=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),ti=function(t){function e(e){return t.call(this,e)||this}return Jo(e,t),e.prototype.addWeightCode=function(t,e){e<1e4?t.append("(3202)"):t.append("(3203)")},e.prototype.checkWeight=function(t){return t<1e4?t:t-1e4},e}(Ko),ei=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),ri=function(t){function e(e){return t.call(this,e)||this}return ei(e,t),e.prototype.parseInformation=function(){if(this.getInformation().getSize()<e.HEADER_SIZE+Ho.GTIN_SIZE)throw new Kr;var t=new $r;this.encodeCompressedGtin(t,e.HEADER_SIZE);var r=this.getGeneralDecoder().extractNumericValueFromBitArray(e.HEADER_SIZE+Ho.GTIN_SIZE,e.LAST_DIGIT_SIZE);t.append("(392"),t.append(r),t.append(")");var n=this.getGeneralDecoder().decodeGeneralPurposeField(e.HEADER_SIZE+Ho.GTIN_SIZE+e.LAST_DIGIT_SIZE,null);return t.append(n.getNewString()),t.toString()},e.HEADER_SIZE=8,e.LAST_DIGIT_SIZE=2,e}(Ho),ni=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),oi=function(t){function e(e){return t.call(this,e)||this}return ni(e,t),e.prototype.parseInformation=function(){if(this.getInformation().getSize()<e.HEADER_SIZE+Ho.GTIN_SIZE)throw new Kr;var t=new $r;this.encodeCompressedGtin(t,e.HEADER_SIZE);var r=this.getGeneralDecoder().extractNumericValueFromBitArray(e.HEADER_SIZE+Ho.GTIN_SIZE,e.LAST_DIGIT_SIZE);t.append("(393"),t.append(r),t.append(")");var n=this.getGeneralDecoder().extractNumericValueFromBitArray(e.HEADER_SIZE+Ho.GTIN_SIZE+e.LAST_DIGIT_SIZE,e.FIRST_THREE_DIGITS_SIZE);n/100==0&&t.append("0"),n/10==0&&t.append("0"),t.append(n);var o=this.getGeneralDecoder().decodeGeneralPurposeField(e.HEADER_SIZE+Ho.GTIN_SIZE+e.LAST_DIGIT_SIZE+e.FIRST_THREE_DIGITS_SIZE,null);return t.append(o.getNewString()),t.toString()},e.HEADER_SIZE=8,e.LAST_DIGIT_SIZE=2,e.FIRST_THREE_DIGITS_SIZE=10,e}(Ho),ii=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),ai=function(t){function e(e,r,n){var o=t.call(this,e)||this;return o.dateCode=n,o.firstAIdigits=r,o}return ii(e,t),e.prototype.parseInformation=function(){if(this.getInformation().getSize()!=e.HEADER_SIZE+e.GTIN_SIZE+e.WEIGHT_SIZE+e.DATE_SIZE)throw new Kr;var t=new $r;return this.encodeCompressedGtin(t,e.HEADER_SIZE),this.encodeCompressedWeight(t,e.HEADER_SIZE+e.GTIN_SIZE,e.WEIGHT_SIZE),this.encodeCompressedDate(t,e.HEADER_SIZE+e.GTIN_SIZE+e.WEIGHT_SIZE),t.toString()},e.prototype.encodeCompressedDate=function(t,r){var n=this.getGeneralDecoder().extractNumericValueFromBitArray(r,e.DATE_SIZE);if(38400!=n){t.append("("),t.append(this.dateCode),t.append(")");var o=n%32,i=(n/=32)%12+1,a=n/=12;a/10==0&&t.append("0"),t.append(a),i/10==0&&t.append("0"),t.append(i),o/10==0&&t.append("0"),t.append(o)}},e.prototype.addWeightCode=function(t,e){t.append("("),t.append(this.firstAIdigits),t.append(e/1e5),t.append(")")},e.prototype.checkWeight=function(t){return t%1e5},e.HEADER_SIZE=8,e.WEIGHT_SIZE=20,e.DATE_SIZE=16,e}(Yo),si=function(){function t(t,e,r,n){this.leftchar=t,this.rightchar=e,this.finderpattern=r,this.maybeLast=n}return t.prototype.mayBeLast=function(){return this.maybeLast},t.prototype.getLeftChar=function(){return this.leftchar},t.prototype.getRightChar=function(){return this.rightchar},t.prototype.getFinderPattern=function(){return this.finderpattern},t.prototype.mustBeLast=function(){return null==this.rightchar},t.prototype.toString=function(){return"[ "+this.leftchar+", "+this.rightchar+" : "+(null==this.finderpattern?"null":this.finderpattern.getValue())+" ]"},t.equals=function(e,r){return e instanceof t&&t.equalsOrNull(e.leftchar,r.leftchar)&&t.equalsOrNull(e.rightchar,r.rightchar)&&t.equalsOrNull(e.finderpattern,r.finderpattern)},t.equalsOrNull=function(e,r){return null===e?null===r:t.equals(e,r)},t.prototype.hashCode=function(){return this.leftchar.getValue()^this.rightchar.getValue()^this.finderpattern.getValue()},t}(),ui=function(){function t(t,e,r){this.pairs=t,this.rowNumber=e,this.wasReversed=r}return t.prototype.getPairs=function(){return this.pairs},t.prototype.getRowNumber=function(){return this.rowNumber},t.prototype.isReversed=function(){return this.wasReversed},t.prototype.isEquivalent=function(t){return this.checkEqualitity(this,t)},t.prototype.toString=function(){return"{ "+this.pairs+" }"},t.prototype.equals=function(e,r){return e instanceof t&&this.checkEqualitity(e,r)&&e.wasReversed===r.wasReversed},t.prototype.checkEqualitity=function(t,e){var r;if(t&&e)return t.forEach(function(t,n){e.forEach(function(e){t.getLeftChar().getValue()===e.getLeftChar().getValue()&&t.getRightChar().getValue()===e.getRightChar().getValue()&&t.getFinderPatter().getValue()===e.getFinderPatter().getValue()&&(r=!0)})}),r},t}(),li=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),ci=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},hi=function(t){function e(){var r=null!==t&&t.apply(this,arguments)||this;return r.pairs=new Array(e.MAX_PAIRS),r.rows=new Array,r.startEnd=[2],r}return li(e,t),e.prototype.decodeRow=function(t,r,n){this.pairs.length=0,this.startFromEven=!1;try{return e.constructResult(this.decodeRow2pairs(t,r))}catch(o){}return this.pairs.length=0,this.startFromEven=!0,e.constructResult(this.decodeRow2pairs(t,r))},e.prototype.reset=function(){this.pairs.length=0,this.rows.length=0},e.prototype.decodeRow2pairs=function(t,e){for(var r,n=!1;!n;)try{this.pairs.push(this.retrieveNextPair(e,this.pairs,t))}catch(i){if(i instanceof Kr){if(!this.pairs.length)throw new Kr;n=!0}}if(this.checkChecksum())return this.pairs;if(r=!!this.rows.length,this.storeRow(t,!1),r){var o=this.checkRowsBoolean(!1);if(null!=o)return o;if(null!=(o=this.checkRowsBoolean(!0)))return o}throw new Kr},e.prototype.checkRowsBoolean=function(t){if(this.rows.length>25)return this.rows.length=0,null;this.pairs.length=0,t&&(this.rows=this.rows.reverse());var e=null;try{e=this.checkRows(new Array,0)}catch(r){console.log(r)}return t&&(this.rows=this.rows.reverse()),e},e.prototype.checkRows=function(t,r){for(var n,o,i=r;i<this.rows.length;i++){var a=this.rows[i];this.pairs.length=0;try{for(var s=(n=void 0,ci(t)),u=s.next();!u.done;u=s.next()){var l=u.value;this.pairs.push(l.getPairs())}}catch(h){n={error:h}}finally{try{u&&!u.done&&(o=s.return)&&o.call(s)}finally{if(n)throw n.error}}if(this.pairs.push(a.getPairs()),e.isValidSequence(this.pairs)){if(this.checkChecksum())return this.pairs;var c=new Array(t);c.push(a);try{return this.checkRows(c,i+1)}catch(h){console.log(h)}}}throw new Kr},e.isValidSequence=function(t){var r,n;try{for(var o=ci(e.FINDER_PATTERN_SEQUENCES),i=o.next();!i.done;i=o.next()){var a=i.value;if(!(t.length>a.length)){for(var s=!0,u=0;u<t.length;u++)if(t[u].getFinderPattern().getValue()!=a[u]){s=!1;break}if(s)return!0}}}catch(l){r={error:l}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}return!1},e.prototype.storeRow=function(t,r){for(var n=0,o=!1,i=!1;n<this.rows.length;){var a=this.rows[n];if(a.getRowNumber()>t){i=a.isEquivalent(this.pairs);break}o=a.isEquivalent(this.pairs),n++}i||o||e.isPartialRow(this.pairs,this.rows)||(this.rows.push(n,new ui(this.pairs,t,r)),this.removePartialRows(this.pairs,this.rows))},e.prototype.removePartialRows=function(t,e){var r,n,o,i,a,s;try{for(var u=ci(e),l=u.next();!l.done;l=u.next()){var c=l.value;if(c.getPairs().length!==t.length)try{for(var h=(o=void 0,ci(c.getPairs())),f=h.next();!f.done;f=h.next()){var d=f.value;try{for(var p=(a=void 0,ci(t)),g=p.next();!g.done;g=p.next()){var m=g.value;if(si.equals(d,m)){0;break}}}catch(v){a={error:v}}finally{try{g&&!g.done&&(s=p.return)&&s.call(p)}finally{if(a)throw a.error}}}}catch(v){o={error:v}}finally{try{f&&!f.done&&(i=h.return)&&i.call(h)}finally{if(o)throw o.error}}}}catch(v){r={error:v}}finally{try{l&&!l.done&&(n=u.return)&&n.call(u)}finally{if(r)throw r.error}}},e.isPartialRow=function(t,e){var r,n,o,i,a,s;try{for(var u=ci(e),l=u.next();!l.done;l=u.next()){var c=l.value,h=!0;try{for(var f=(o=void 0,ci(t)),d=f.next();!d.done;d=f.next()){var p=d.value,g=!1;try{for(var m=(a=void 0,ci(c.getPairs())),v=m.next();!v.done;v=m.next()){var y=v.value;if(p.equals(y)){g=!0;break}}}catch(_){a={error:_}}finally{try{v&&!v.done&&(s=m.return)&&s.call(m)}finally{if(a)throw a.error}}if(!g){h=!1;break}}}catch(_){o={error:_}}finally{try{d&&!d.done&&(i=f.return)&&i.call(f)}finally{if(o)throw o.error}}if(h)return!0}}catch(_){r={error:_}}finally{try{l&&!l.done&&(n=u.return)&&n.call(u)}finally{if(r)throw r.error}}return!1},e.prototype.getRows=function(){return this.rows},e.constructResult=function(t){var e=function(t){try{if(t.get(1))return new Wo(t);if(!t.get(2))return new Xo(t);switch(jo.extractNumericValueFromBitArray(t,1,4)){case 4:return new Qo(t);case 5:return new ti(t)}switch(jo.extractNumericValueFromBitArray(t,1,5)){case 12:return new ri(t);case 13:return new oi(t)}switch(jo.extractNumericValueFromBitArray(t,1,7)){case 56:return new ai(t,"310","11");case 57:return new ai(t,"320","11");case 58:return new ai(t,"310","13");case 59:return new ai(t,"320","13");case 60:return new ai(t,"310","15");case 61:return new ai(t,"320","15");case 62:return new ai(t,"310","17");case 63:return new ai(t,"320","17")}}catch(e){throw console.log(e),new Sn("unknown decoder: "+t)}}(Oo.buildBitArray(t)).parseInformation(),r=t[0].getFinderPattern().getResultPoints(),n=t[t.length-1].getFinderPattern().getResultPoints(),o=[r[0],r[1],n[0],n[1]];return new hn(e,null,null,o,dn.RSS_EXPANDED,null)},e.prototype.checkChecksum=function(){var t=this.pairs.get(0),e=t.getLeftChar(),r=t.getRightChar();if(null==r)return!1;for(var n=r.getChecksumPortion(),o=2,i=1;i<this.pairs.size();++i){var a=this.pairs.get(i);n+=a.getLeftChar().getChecksumPortion(),o++;var s=a.getRightChar();null!=s&&(n+=s.getChecksumPortion(),o++)}return 211*(o-4)+(n%=211)==e.getValue()},e.getNextSecondBar=function(t,e){var r;return t.get(e)?(r=t.getNextUnset(e),r=t.getNextSet(r)):(r=t.getNextSet(e),r=t.getNextUnset(r)),r},e.prototype.retrieveNextPair=function(t,r,n){var o,i=r.length%2==0;this.startFromEven&&(i=!i);var a=!0,s=-1;do{this.findNextPair(t,r,s),null==(o=this.parseFoundFinderPattern(t,n,i))?s=e.getNextSecondBar(t,this.startEnd[0]):a=!1}while(a);var u,l=this.decodeDataCharacter(t,o,i,!0);if(!this.isEmptyPair(r)&&r[r.length-1].mustBeLast())throw new Kr;try{u=this.decodeDataCharacter(t,o,i,!1)}catch(c){u=null,console.log(c)}return new si(l,u,o,!0)},e.prototype.isEmptyPair=function(t){return 0===t.length},e.prototype.findNextPair=function(t,r,n){var o=this.getDecodeFinderCounters();o[0]=0,o[1]=0,o[2]=0,o[3]=0;var i,a=t.getSize();i=n>=0?n:this.isEmptyPair(r)?0:r[r.length-1].getFinderPattern().getStartEnd()[1];var s=r.length%2!=0;this.startFromEven&&(s=!s);for(var u=!1;i<a&&(u=!t.get(i));)i++;for(var l=0,c=i,h=i;h<a;h++)if(t.get(h)!=u)o[l]++;else{if(3==l){if(s&&e.reverseCounters(o),e.isFinderPattern(o))return this.startEnd[0]=c,void(this.startEnd[1]=h);s&&e.reverseCounters(o),c+=o[0]+o[1],o[0]=o[2],o[1]=o[3],o[2]=0,o[3]=0,l--}else l++;o[l]=1,u=!u}throw new Kr},e.reverseCounters=function(t){for(var e=t.length,r=0;r<e/2;++r){var n=t[r];t[r]=t[e-r-1],t[e-r-1]=n}},e.prototype.parseFoundFinderPattern=function(t,r,n){var o,i,a;if(n){for(var s=this.startEnd[0]-1;s>=0&&!t.get(s);)s--;s++,o=this.startEnd[0]-s,i=s,a=this.startEnd[1]}else i=this.startEnd[0],o=(a=t.getNextUnset(this.startEnd[1]+1))-this.startEnd[1];var u,l=this.getDecodeFinderCounters();Tr.arraycopy(l,0,l,1,l.length-1),l[0]=o;try{u=this.parseFinderValue(l,e.FINDER_PATTERNS)}catch(c){return null}return new So(u,[i,a],i,a,r)},e.prototype.decodeDataCharacter=function(t,r,n,o){for(var i=this.getDataCharacterCounters(),a=0;a<i.length;a++)i[a]=0;if(o)e.recordPatternInReverse(t,r.getStartEnd()[0],i);else{e.recordPattern(t,r.getStartEnd()[1],i);for(var s=0,u=i.length-1;s<u;s++,u--){var l=i[s];i[s]=i[u],i[u]=l}}var c=Tn.sum(new Int32Array(i))/17,h=(r.getStartEnd()[1]-r.getStartEnd()[0])/15;if(Math.abs(c-h)/h>.3)throw new Kr;var f=this.getOddCounts(),d=this.getEvenCounts(),p=this.getOddRoundingErrors(),g=this.getEvenRoundingErrors();for(s=0;s<i.length;s++){var m=1*i[s]/c,v=m+.5;if(v<1){if(m<.3)throw new Kr;v=1}else if(v>8){if(m>8.7)throw new Kr;v=8}var y=s/2;1&s?(d[y]=v,g[y]=m-v):(f[y]=v,p[y]=m-v)}this.adjustOddEvenCounts(17);var _=4*r.getValue()+(n?0:2)+(o?0:1)-1,w=0,b=0;for(s=f.length-1;s>=0;s--){if(e.isNotA1left(r,n,o)){var C=e.WEIGHTS[_][2*s];b+=f[s]*C}w+=f[s]}var A=0;for(s=d.length-1;s>=0;s--)e.isNotA1left(r,n,o)&&(C=e.WEIGHTS[_][2*s+1],A+=d[s]*C);var E=b+A;if(1&w||w>13||w<4)throw new Kr;var I=(13-w)/2,S=e.SYMBOL_WIDEST[I],x=9-S,O=xo.getRSSvalue(f,S,!0),T=xo.getRSSvalue(d,x,!1),N=e.EVEN_TOTAL_SUBSET[I],k=e.GSUM[I];return new Io(O*N+T+k,E)},e.isNotA1left=function(t,e,r){return!(0==t.getValue()&&e&&r)},e.prototype.adjustOddEvenCounts=function(t){var r=Tn.sum(new Int32Array(this.getOddCounts())),n=Tn.sum(new Int32Array(this.getEvenCounts())),o=!1,i=!1;r>13?i=!0:r<4&&(o=!0);var a=!1,s=!1;n>13?s=!0:n<4&&(a=!0);var u=r+n-t,l=!(1&~r),c=!(1&n);if(1==u)if(l){if(c)throw new Kr;i=!0}else{if(!c)throw new Kr;s=!0}else if(-1==u)if(l){if(c)throw new Kr;o=!0}else{if(!c)throw new Kr;a=!0}else{if(0!=u)throw new Kr;if(l){if(!c)throw new Kr;r<n?(o=!0,s=!0):(i=!0,a=!0)}else if(c)throw new Kr}if(o){if(i)throw new Kr;e.increment(this.getOddCounts(),this.getOddRoundingErrors())}if(i&&e.decrement(this.getOddCounts(),this.getOddRoundingErrors()),a){if(s)throw new Kr;e.increment(this.getEvenCounts(),this.getOddRoundingErrors())}s&&e.decrement(this.getEvenCounts(),this.getEvenRoundingErrors())},e.SYMBOL_WIDEST=[7,5,4,3,1],e.EVEN_TOTAL_SUBSET=[4,20,52,104,204],e.GSUM=[0,348,1388,2948,3988],e.FINDER_PATTERNS=[Int32Array.from([1,8,4,1]),Int32Array.from([3,6,4,1]),Int32Array.from([3,4,6,1]),Int32Array.from([3,2,8,1]),Int32Array.from([2,6,5,1]),Int32Array.from([2,2,9,1])],e.WEIGHTS=[[1,3,9,27,81,32,96,77],[20,60,180,118,143,7,21,63],[189,145,13,39,117,140,209,205],[193,157,49,147,19,57,171,91],[62,186,136,197,169,85,44,132],[185,133,188,142,4,12,36,108],[113,128,173,97,80,29,87,50],[150,28,84,41,123,158,52,156],[46,138,203,187,139,206,196,166],[76,17,51,153,37,111,122,155],[43,129,176,106,107,110,119,146],[16,48,144,10,30,90,59,177],[109,116,137,200,178,112,125,164],[70,210,208,202,184,130,179,115],[134,191,151,31,93,68,204,190],[148,22,66,198,172,94,71,2],[6,18,54,162,64,192,154,40],[120,149,25,75,14,42,126,167],[79,26,78,23,69,207,199,175],[103,98,83,38,114,131,182,124],[161,61,183,127,170,88,53,159],[55,165,73,8,24,72,5,15],[45,135,194,160,58,174,100,89]],e.FINDER_PAT_A=0,e.FINDER_PAT_B=1,e.FINDER_PAT_C=2,e.FINDER_PAT_D=3,e.FINDER_PAT_E=4,e.FINDER_PAT_F=5,e.FINDER_PATTERN_SEQUENCES=[[e.FINDER_PAT_A,e.FINDER_PAT_A],[e.FINDER_PAT_A,e.FINDER_PAT_B,e.FINDER_PAT_B],[e.FINDER_PAT_A,e.FINDER_PAT_C,e.FINDER_PAT_B,e.FINDER_PAT_D],[e.FINDER_PAT_A,e.FINDER_PAT_E,e.FINDER_PAT_B,e.FINDER_PAT_D,e.FINDER_PAT_C],[e.FINDER_PAT_A,e.FINDER_PAT_E,e.FINDER_PAT_B,e.FINDER_PAT_D,e.FINDER_PAT_D,e.FINDER_PAT_F],[e.FINDER_PAT_A,e.FINDER_PAT_E,e.FINDER_PAT_B,e.FINDER_PAT_D,e.FINDER_PAT_E,e.FINDER_PAT_F,e.FINDER_PAT_F],[e.FINDER_PAT_A,e.FINDER_PAT_A,e.FINDER_PAT_B,e.FINDER_PAT_B,e.FINDER_PAT_C,e.FINDER_PAT_C,e.FINDER_PAT_D,e.FINDER_PAT_D],[e.FINDER_PAT_A,e.FINDER_PAT_A,e.FINDER_PAT_B,e.FINDER_PAT_B,e.FINDER_PAT_C,e.FINDER_PAT_C,e.FINDER_PAT_D,e.FINDER_PAT_E,e.FINDER_PAT_E],[e.FINDER_PAT_A,e.FINDER_PAT_A,e.FINDER_PAT_B,e.FINDER_PAT_B,e.FINDER_PAT_C,e.FINDER_PAT_C,e.FINDER_PAT_D,e.FINDER_PAT_E,e.FINDER_PAT_F,e.FINDER_PAT_F],[e.FINDER_PAT_A,e.FINDER_PAT_A,e.FINDER_PAT_B,e.FINDER_PAT_B,e.FINDER_PAT_C,e.FINDER_PAT_D,e.FINDER_PAT_D,e.FINDER_PAT_E,e.FINDER_PAT_E,e.FINDER_PAT_F,e.FINDER_PAT_F]],e.MAX_PAIRS=11,e}(Eo),fi=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),di=function(t){function e(e,r,n){var o=t.call(this,e,r)||this;return o.count=0,o.finderPattern=n,o}return fi(e,t),e.prototype.getFinderPattern=function(){return this.finderPattern},e.prototype.getCount=function(){return this.count},e.prototype.incrementCount=function(){this.count++},e}(Io),pi=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),gi=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},mi=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.possibleLeftPairs=[],e.possibleRightPairs=[],e}return pi(e,t),e.prototype.decodeRow=function(t,r,n){var o,i,a,s,u=this.decodePair(r,!1,t,n);e.addOrTally(this.possibleLeftPairs,u),r.reverse();var l=this.decodePair(r,!0,t,n);e.addOrTally(this.possibleRightPairs,l),r.reverse();try{for(var c=gi(this.possibleLeftPairs),h=c.next();!h.done;h=c.next()){var f=h.value;if(f.getCount()>1)try{for(var d=(a=void 0,gi(this.possibleRightPairs)),p=d.next();!p.done;p=d.next()){var g=p.value;if(g.getCount()>1&&e.checkChecksum(f,g))return e.constructResult(f,g)}}catch(m){a={error:m}}finally{try{p&&!p.done&&(s=d.return)&&s.call(d)}finally{if(a)throw a.error}}}}catch(m){o={error:m}}finally{try{h&&!h.done&&(i=c.return)&&i.call(c)}finally{if(o)throw o.error}}throw new Kr},e.addOrTally=function(t,e){var r,n;if(null!=e){var o=!1;try{for(var i=gi(t),a=i.next();!a.done;a=i.next()){var s=a.value;if(s.getValue()===e.getValue()){s.incrementCount(),o=!0;break}}}catch(u){r={error:u}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}o||t.push(e)}},e.prototype.reset=function(){this.possibleLeftPairs.length=0,this.possibleRightPairs.length=0},e.constructResult=function(t,e){for(var r=4537077*t.getValue()+e.getValue(),n=new String(r).toString(),o=new $r,i=13-n.length;i>0;i--)o.append("0");o.append(n);var a=0;for(i=0;i<13;i++){var s=o.charAt(i).charCodeAt(0)-"0".charCodeAt(0);a+=1&i?s:3*s}10==(a=10-a%10)&&(a=0),o.append(a.toString());var u=t.getFinderPattern().getResultPoints(),l=e.getFinderPattern().getResultPoints();return new hn(o.toString(),null,0,[u[0],u[1],l[0],l[1]],dn.RSS_14,(new Date).getTime())},e.checkChecksum=function(t,e){var r=(t.getChecksumPortion()+16*e.getChecksumPortion())%79,n=9*t.getFinderPattern().getValue()+e.getFinderPattern().getValue();return n>72&&n--,n>8&&n--,r===n},e.prototype.decodePair=function(t,e,r,n){try{var o=this.findFinderPattern(t,e),i=this.parseFoundFinderPattern(t,r,e,o),a=null==n?null:n.get(Fr.NEED_RESULT_POINT_CALLBACK);if(null!=a){var s=(o[0]+o[1])/2;e&&(s=t.getSize()-1-s),a.foundPossibleResultPoint(new kn(s,r))}var u=this.decodeDataCharacter(t,i,!0),l=this.decodeDataCharacter(t,i,!1);return new di(1597*u.getValue()+l.getValue(),u.getChecksumPortion()+4*l.getChecksumPortion(),i)}catch(c){return null}},e.prototype.decodeDataCharacter=function(t,r,n){for(var o=this.getDataCharacterCounters(),i=0;i<o.length;i++)o[i]=0;if(n)Gn.recordPatternInReverse(t,r.getStartEnd()[0],o);else{Gn.recordPattern(t,r.getStartEnd()[1]+1,o);for(var a=0,s=o.length-1;a<s;a++,s--){var u=o[a];o[a]=o[s],o[s]=u}}var l=n?16:15,c=Tn.sum(new Int32Array(o))/l,h=this.getOddCounts(),f=this.getEvenCounts(),d=this.getOddRoundingErrors(),p=this.getEvenRoundingErrors();for(a=0;a<o.length;a++){var g=o[a]/c,m=Math.floor(g+.5);m<1?m=1:m>8&&(m=8);var v=Math.floor(a/2);1&a?(f[v]=m,p[v]=g-m):(h[v]=m,d[v]=g-m)}this.adjustOddEvenCounts(n,l);var y=0,_=0;for(a=h.length-1;a>=0;a--)_*=9,_+=h[a],y+=h[a];var w=0,b=0;for(a=f.length-1;a>=0;a--)w*=9,w+=f[a],b+=f[a];var C=_+3*w;if(n){if(1&y||y>12||y<4)throw new Kr;var A=(12-y)/2,E=9-(T=e.OUTSIDE_ODD_WIDEST[A]),I=xo.getRSSvalue(h,T,!1),S=xo.getRSSvalue(f,E,!0),x=e.OUTSIDE_EVEN_TOTAL_SUBSET[A],O=e.OUTSIDE_GSUM[A];return new Io(I*x+S+O,C)}if(1&b||b>10||b<4)throw new Kr;A=(10-b)/2,E=9-(T=e.INSIDE_ODD_WIDEST[A]),I=xo.getRSSvalue(h,T,!0),S=xo.getRSSvalue(f,E,!1);var T,N=e.INSIDE_ODD_TOTAL_SUBSET[A];return O=e.INSIDE_GSUM[A],new Io(S*N+I+O,C)},e.prototype.findFinderPattern=function(t,e){var r=this.getDecodeFinderCounters();r[0]=0,r[1]=0,r[2]=0,r[3]=0;for(var n=t.getSize(),o=!1,i=0;i<n&&e!==(o=!t.get(i));)i++;for(var a=0,s=i,u=i;u<n;u++)if(t.get(u)!==o)r[a]++;else{if(3===a){if(Eo.isFinderPattern(r))return[s,u];s+=r[0]+r[1],r[0]=r[2],r[1]=r[3],r[2]=0,r[3]=0,a--}else a++;r[a]=1,o=!o}throw new Kr},e.prototype.parseFoundFinderPattern=function(t,r,n,o){for(var i=t.get(o[0]),a=o[0]-1;a>=0&&i!==t.get(a);)a--;a++;var s=o[0]-a,u=this.getDecodeFinderCounters(),l=new Int32Array(u.length);Tr.arraycopy(u,0,l,1,u.length-1),l[0]=s;var c=this.parseFinderValue(l,e.FINDER_PATTERNS),h=a,f=o[1];return n&&(h=t.getSize()-1-h,f=t.getSize()-1-f),new So(c,[a,o[1]],h,f,r)},e.prototype.adjustOddEvenCounts=function(t,e){var r=Tn.sum(new Int32Array(this.getOddCounts())),n=Tn.sum(new Int32Array(this.getEvenCounts())),o=!1,i=!1,a=!1,s=!1;t?(r>12?i=!0:r<4&&(o=!0),n>12?s=!0:n<4&&(a=!0)):(r>11?i=!0:r<5&&(o=!0),n>10?s=!0:n<4&&(a=!0));var u=r+n-e,l=(1&r)==(t?1:0),c=!(1&~n);if(1===u)if(l){if(c)throw new Kr;i=!0}else{if(!c)throw new Kr;s=!0}else if(-1===u)if(l){if(c)throw new Kr;o=!0}else{if(!c)throw new Kr;a=!0}else{if(0!==u)throw new Kr;if(l){if(!c)throw new Kr;r<n?(o=!0,s=!0):(i=!0,a=!0)}else if(c)throw new Kr}if(o){if(i)throw new Kr;Eo.increment(this.getOddCounts(),this.getOddRoundingErrors())}if(i&&Eo.decrement(this.getOddCounts(),this.getOddRoundingErrors()),a){if(s)throw new Kr;Eo.increment(this.getEvenCounts(),this.getOddRoundingErrors())}s&&Eo.decrement(this.getEvenCounts(),this.getEvenRoundingErrors())},e.OUTSIDE_EVEN_TOTAL_SUBSET=[1,10,34,70,126],e.INSIDE_ODD_TOTAL_SUBSET=[4,20,48,81],e.OUTSIDE_GSUM=[0,161,961,2015,2715],e.INSIDE_GSUM=[0,336,1036,1516],e.OUTSIDE_ODD_WIDEST=[8,6,4,3,1],e.INSIDE_ODD_WIDEST=[2,4,6,8],e.FINDER_PATTERNS=[Int32Array.from([3,8,2,1]),Int32Array.from([3,5,5,1]),Int32Array.from([3,3,7,1]),Int32Array.from([3,1,9,1]),Int32Array.from([2,7,4,1]),Int32Array.from([2,5,6,1]),Int32Array.from([2,3,8,1]),Int32Array.from([1,5,7,1]),Int32Array.from([1,3,9,1])],e}(Eo),vi=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),yi=function(t){function e(e){var r=t.call(this)||this;r.readers=[];var n=e?e.get(Fr.POSSIBLE_FORMATS):null,o=e&&void 0!==e.get(Fr.ASSUME_CODE_39_CHECK_DIGIT);return n&&((n.includes(dn.EAN_13)||n.includes(dn.UPC_A)||n.includes(dn.EAN_8)||n.includes(dn.UPC_E))&&r.readers.push(new Co(e)),n.includes(dn.CODE_39)&&r.readers.push(new Kn(o)),n.includes(dn.CODE_128)&&r.readers.push(new $n),n.includes(dn.ITF)&&r.readers.push(new Qn),n.includes(dn.RSS_14)&&r.readers.push(new mi),n.includes(dn.RSS_EXPANDED)&&(console.warn("RSS Expanded reader IS NOT ready for production yet! use at your own risk."),r.readers.push(new hi))),0===r.readers.length&&(r.readers.push(new Co(e)),r.readers.push(new Kn),r.readers.push(new Co(e)),r.readers.push(new $n),r.readers.push(new Qn),r.readers.push(new mi)),r}return vi(e,t),e.prototype.decodeRow=function(t,e,r){for(var n=0;n<this.readers.length;n++)try{return this.readers[n].decodeRow(t,e,r)}catch(o){}throw new Kr},e.prototype.reset=function(){this.readers.forEach(function(t){return t.reset()})},e}(Gn),_i=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();!function(t){_i(function(e,r){return void 0===e&&(e=500),t.call(this,new yi(r),e,r)||this},t)}(cn);var wi,bi=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Ci=function(){function t(t,e,r){this.ecCodewords=t,this.ecBlocks=[e],r&&this.ecBlocks.push(r)}return t.prototype.getECCodewords=function(){return this.ecCodewords},t.prototype.getECBlocks=function(){return this.ecBlocks},t}(),Ai=function(){function t(t,e){this.count=t,this.dataCodewords=e}return t.prototype.getCount=function(){return this.count},t.prototype.getDataCodewords=function(){return this.dataCodewords},t}(),Ei=function(){function t(t,e,r,n,o,i){var a,s;this.versionNumber=t,this.symbolSizeRows=e,this.symbolSizeColumns=r,this.dataRegionSizeRows=n,this.dataRegionSizeColumns=o,this.ecBlocks=i;var u=0,l=i.getECCodewords(),c=i.getECBlocks();try{for(var h=bi(c),f=h.next();!f.done;f=h.next()){var d=f.value;u+=d.getCount()*(d.getDataCodewords()+l)}}catch(p){a={error:p}}finally{try{f&&!f.done&&(s=h.return)&&s.call(h)}finally{if(a)throw a.error}}this.totalCodewords=u}return t.prototype.getVersionNumber=function(){return this.versionNumber},t.prototype.getSymbolSizeRows=function(){return this.symbolSizeRows},t.prototype.getSymbolSizeColumns=function(){return this.symbolSizeColumns},t.prototype.getDataRegionSizeRows=function(){return this.dataRegionSizeRows},t.prototype.getDataRegionSizeColumns=function(){return this.dataRegionSizeColumns},t.prototype.getTotalCodewords=function(){return this.totalCodewords},t.prototype.getECBlocks=function(){return this.ecBlocks},t.getVersionForDimensions=function(e,r){var n,o;if(1&e||1&r)throw new Vr;try{for(var i=bi(t.VERSIONS),a=i.next();!a.done;a=i.next()){var s=a.value;if(s.symbolSizeRows===e&&s.symbolSizeColumns===r)return s}}catch(u){n={error:u}}finally{try{a&&!a.done&&(o=i.return)&&o.call(i)}finally{if(n)throw n.error}}throw new Vr},t.prototype.toString=function(){return""+this.versionNumber},t.buildVersions=function(){return[new t(1,10,10,8,8,new Ci(5,new Ai(1,3))),new t(2,12,12,10,10,new Ci(7,new Ai(1,5))),new t(3,14,14,12,12,new Ci(10,new Ai(1,8))),new t(4,16,16,14,14,new Ci(12,new Ai(1,12))),new t(5,18,18,16,16,new Ci(14,new Ai(1,18))),new t(6,20,20,18,18,new Ci(18,new Ai(1,22))),new t(7,22,22,20,20,new Ci(20,new Ai(1,30))),new t(8,24,24,22,22,new Ci(24,new Ai(1,36))),new t(9,26,26,24,24,new Ci(28,new Ai(1,44))),new t(10,32,32,14,14,new Ci(36,new Ai(1,62))),new t(11,36,36,16,16,new Ci(42,new Ai(1,86))),new t(12,40,40,18,18,new Ci(48,new Ai(1,114))),new t(13,44,44,20,20,new Ci(56,new Ai(1,144))),new t(14,48,48,22,22,new Ci(68,new Ai(1,174))),new t(15,52,52,24,24,new Ci(42,new Ai(2,102))),new t(16,64,64,14,14,new Ci(56,new Ai(2,140))),new t(17,72,72,16,16,new Ci(36,new Ai(4,92))),new t(18,80,80,18,18,new Ci(48,new Ai(4,114))),new t(19,88,88,20,20,new Ci(56,new Ai(4,144))),new t(20,96,96,22,22,new Ci(68,new Ai(4,174))),new t(21,104,104,24,24,new Ci(56,new Ai(6,136))),new t(22,120,120,18,18,new Ci(68,new Ai(6,175))),new t(23,132,132,20,20,new Ci(62,new Ai(8,163))),new t(24,144,144,22,22,new Ci(62,new Ai(8,156),new Ai(2,155))),new t(25,8,18,6,16,new Ci(7,new Ai(1,5))),new t(26,8,32,6,14,new Ci(11,new Ai(1,10))),new t(27,12,26,10,24,new Ci(14,new Ai(1,16))),new t(28,12,36,10,16,new Ci(18,new Ai(1,22))),new t(29,16,36,14,16,new Ci(24,new Ai(1,32))),new t(30,16,48,14,22,new Ci(28,new Ai(1,49)))]},t.VERSIONS=t.buildVersions(),t}(),Ii=function(){function t(e){var r=e.getHeight();if(r<8||r>144||1&r)throw new Vr;this.version=t.readVersion(e),this.mappingBitMatrix=this.extractDataRegion(e),this.readMappingMatrix=new Yr(this.mappingBitMatrix.getWidth(),this.mappingBitMatrix.getHeight())}return t.prototype.getVersion=function(){return this.version},t.readVersion=function(t){var e=t.getHeight(),r=t.getWidth();return Ei.getVersionForDimensions(e,r)},t.prototype.readCodewords=function(){var t=new Int8Array(this.version.getTotalCodewords()),e=0,r=4,n=0,o=this.mappingBitMatrix.getHeight(),i=this.mappingBitMatrix.getWidth(),a=!1,s=!1,u=!1,l=!1;do{if(r!==o||0!==n||a)if(r===o-2&&0===n&&3&i&&!s)t[e++]=255&this.readCorner2(o,i),r-=2,n+=2,s=!0;else if(r!==o+4||2!==n||7&i||u)if(r!==o-2||0!==n||4!=(7&i)||l){do{r<o&&n>=0&&!this.readMappingMatrix.get(n,r)&&(t[e++]=255&this.readUtah(r,n,o,i)),r-=2,n+=2}while(r>=0&&n<i);r+=1,n+=3;do{r>=0&&n<i&&!this.readMappingMatrix.get(n,r)&&(t[e++]=255&this.readUtah(r,n,o,i)),r+=2,n-=2}while(r<o&&n>=0);r+=3,n+=1}else t[e++]=255&this.readCorner4(o,i),r-=2,n+=2,l=!0;else t[e++]=255&this.readCorner3(o,i),r-=2,n+=2,u=!0;else t[e++]=255&this.readCorner1(o,i),r-=2,n+=2,a=!0}while(r<o||n<i);if(e!==this.version.getTotalCodewords())throw new Vr;return t},t.prototype.readModule=function(t,e,r,n){return t<0&&(t+=r,e+=4-(r+4&7)),e<0&&(e+=n,t+=4-(n+4&7)),this.readMappingMatrix.set(e,t),this.mappingBitMatrix.get(e,t)},t.prototype.readUtah=function(t,e,r,n){var o=0;return this.readModule(t-2,e-2,r,n)&&(o|=1),o<<=1,this.readModule(t-2,e-1,r,n)&&(o|=1),o<<=1,this.readModule(t-1,e-2,r,n)&&(o|=1),o<<=1,this.readModule(t-1,e-1,r,n)&&(o|=1),o<<=1,this.readModule(t-1,e,r,n)&&(o|=1),o<<=1,this.readModule(t,e-2,r,n)&&(o|=1),o<<=1,this.readModule(t,e-1,r,n)&&(o|=1),o<<=1,this.readModule(t,e,r,n)&&(o|=1),o},t.prototype.readCorner1=function(t,e){var r=0;return this.readModule(t-1,0,t,e)&&(r|=1),r<<=1,this.readModule(t-1,1,t,e)&&(r|=1),r<<=1,this.readModule(t-1,2,t,e)&&(r|=1),r<<=1,this.readModule(0,e-2,t,e)&&(r|=1),r<<=1,this.readModule(0,e-1,t,e)&&(r|=1),r<<=1,this.readModule(1,e-1,t,e)&&(r|=1),r<<=1,this.readModule(2,e-1,t,e)&&(r|=1),r<<=1,this.readModule(3,e-1,t,e)&&(r|=1),r},t.prototype.readCorner2=function(t,e){var r=0;return this.readModule(t-3,0,t,e)&&(r|=1),r<<=1,this.readModule(t-2,0,t,e)&&(r|=1),r<<=1,this.readModule(t-1,0,t,e)&&(r|=1),r<<=1,this.readModule(0,e-4,t,e)&&(r|=1),r<<=1,this.readModule(0,e-3,t,e)&&(r|=1),r<<=1,this.readModule(0,e-2,t,e)&&(r|=1),r<<=1,this.readModule(0,e-1,t,e)&&(r|=1),r<<=1,this.readModule(1,e-1,t,e)&&(r|=1),r},t.prototype.readCorner3=function(t,e){var r=0;return this.readModule(t-1,0,t,e)&&(r|=1),r<<=1,this.readModule(t-1,e-1,t,e)&&(r|=1),r<<=1,this.readModule(0,e-3,t,e)&&(r|=1),r<<=1,this.readModule(0,e-2,t,e)&&(r|=1),r<<=1,this.readModule(0,e-1,t,e)&&(r|=1),r<<=1,this.readModule(1,e-3,t,e)&&(r|=1),r<<=1,this.readModule(1,e-2,t,e)&&(r|=1),r<<=1,this.readModule(1,e-1,t,e)&&(r|=1),r},t.prototype.readCorner4=function(t,e){var r=0;return this.readModule(t-3,0,t,e)&&(r|=1),r<<=1,this.readModule(t-2,0,t,e)&&(r|=1),r<<=1,this.readModule(t-1,0,t,e)&&(r|=1),r<<=1,this.readModule(0,e-2,t,e)&&(r|=1),r<<=1,this.readModule(0,e-1,t,e)&&(r|=1),r<<=1,this.readModule(1,e-1,t,e)&&(r|=1),r<<=1,this.readModule(2,e-1,t,e)&&(r|=1),r<<=1,this.readModule(3,e-1,t,e)&&(r|=1),r},t.prototype.extractDataRegion=function(t){var e=this.version.getSymbolSizeRows(),r=this.version.getSymbolSizeColumns();if(t.getHeight()!==e)throw new Er("Dimension of bitMatrix must match the version size");for(var n=this.version.getDataRegionSizeRows(),o=this.version.getDataRegionSizeColumns(),i=e/n|0,a=r/o|0,s=new Yr(a*o,i*n),u=0;u<i;++u)for(var l=u*n,c=0;c<a;++c)for(var h=c*o,f=0;f<n;++f)for(var d=u*(n+2)+1+f,p=l+f,g=0;g<o;++g){var m=c*(o+2)+1+g;if(t.get(m,d)){var v=h+g;s.set(v,p)}}return s},t}(),Si=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},xi=function(){function t(t,e){this.numDataCodewords=t,this.codewords=e}return t.getDataBlocks=function(e,r){var n,o,i,a,s=r.getECBlocks(),u=0,l=s.getECBlocks();try{for(var c=Si(l),h=c.next();!h.done;h=c.next())u+=(m=h.value).getCount()}catch(T){n={error:T}}finally{try{h&&!h.done&&(o=c.return)&&o.call(c)}finally{if(n)throw n.error}}var f=new Array(u),d=0;try{for(var p=Si(l),g=p.next();!g.done;g=p.next())for(var m=g.value,v=0;v<m.getCount();v++){var y=m.getDataCodewords(),_=s.getECCodewords()+y;f[d++]=new t(y,new Uint8Array(_))}}catch(T){i={error:T}}finally{try{g&&!g.done&&(a=p.return)&&a.call(p)}finally{if(i)throw i.error}}var w=f[0].codewords.length-s.getECCodewords(),b=w-1,C=0;for(v=0;v<b;v++)for(var A=0;A<d;A++)f[A].codewords[v]=e[C++];var E=24===r.getVersionNumber(),I=E?8:d;for(A=0;A<I;A++)f[A].codewords[w-1]=e[C++];var S=f[0].codewords.length;for(v=w;v<S;v++)for(A=0;A<d;A++){var x=E?(A+8)%d:A,O=E&&x>7?v-1:v;f[x].codewords[O]=e[C++]}if(C!==e.length)throw new Er;return f},t.prototype.getNumDataCodewords=function(){return this.numDataCodewords},t.prototype.getCodewords=function(){return this.codewords},t}(),Oi=function(){function t(t){this.bytes=t,this.byteOffset=0,this.bitOffset=0}return t.prototype.getBitOffset=function(){return this.bitOffset},t.prototype.getByteOffset=function(){return this.byteOffset},t.prototype.readBits=function(t){if(t<1||t>32||t>this.available())throw new Er(""+t);var e=0,r=this.bitOffset,n=this.byteOffset,o=this.bytes;if(r>0){var i=8-r,a=t<i?t:i,s=255>>8-a<<(u=i-a);e=(o[n]&s)>>u,t-=a,8===(r+=a)&&(r=0,n++)}if(t>0){for(;t>=8;)e=e<<8|255&o[n],n++,t-=8;var u;if(t>0)s=255>>(u=8-t)<<u,e=e<<t|(o[n]&s)>>u,r+=t}return this.bitOffset=r,this.byteOffset=n,e},t.prototype.available=function(){return 8*(this.bytes.length-this.byteOffset)-this.bitOffset},t}();!function(t){t[t.PAD_ENCODE=0]="PAD_ENCODE",t[t.ASCII_ENCODE=1]="ASCII_ENCODE",t[t.C40_ENCODE=2]="C40_ENCODE",t[t.TEXT_ENCODE=3]="TEXT_ENCODE",t[t.ANSIX12_ENCODE=4]="ANSIX12_ENCODE",t[t.EDIFACT_ENCODE=5]="EDIFACT_ENCODE",t[t.BASE256_ENCODE=6]="BASE256_ENCODE"}(wi||(wi={}));var Ti,Ni=function(){function t(){}return t.decode=function(t){var e=new Oi(t),r=new $r,n=new $r,o=new Array,i=wi.ASCII_ENCODE;do{if(i===wi.ASCII_ENCODE)i=this.decodeAsciiSegment(e,r,n);else{switch(i){case wi.C40_ENCODE:this.decodeC40Segment(e,r);break;case wi.TEXT_ENCODE:this.decodeTextSegment(e,r);break;case wi.ANSIX12_ENCODE:this.decodeAnsiX12Segment(e,r);break;case wi.EDIFACT_ENCODE:this.decodeEdifactSegment(e,r);break;case wi.BASE256_ENCODE:this.decodeBase256Segment(e,r,o);break;default:throw new Vr}i=wi.ASCII_ENCODE}}while(i!==wi.PAD_ENCODE&&e.available()>0);return n.length()>0&&r.append(n.toString()),new mn(t,r.toString(),0===o.length?null:o,null)},t.decodeAsciiSegment=function(t,e,r){var n=!1;do{var o=t.readBits(8);if(0===o)throw new Vr;if(o<=128)return n&&(o+=128),e.append(String.fromCharCode(o-1)),wi.ASCII_ENCODE;if(129===o)return wi.PAD_ENCODE;if(o<=229){var i=o-130;i<10&&e.append("0"),e.append(""+i)}else switch(o){case 230:return wi.C40_ENCODE;case 231:return wi.BASE256_ENCODE;case 232:e.append(String.fromCharCode(29));break;case 233:case 234:case 241:break;case 235:n=!0;break;case 236:e.append("[)>05"),r.insert(0,"");break;case 237:e.append("[)>06"),r.insert(0,"");break;case 238:return wi.ANSIX12_ENCODE;case 239:return wi.TEXT_ENCODE;case 240:return wi.EDIFACT_ENCODE;default:if(254!==o||0!==t.available())throw new Vr}}while(t.available()>0);return wi.ASCII_ENCODE},t.decodeC40Segment=function(t,e){var r=!1,n=[],o=0;do{if(8===t.available())return;var i=t.readBits(8);if(254===i)return;this.parseTwoBytes(i,t.readBits(8),n);for(var a=0;a<3;a++){var s=n[a];switch(o){case 0:if(s<3)o=s+1;else{if(!(s<this.C40_BASIC_SET_CHARS.length))throw new Vr;var u=this.C40_BASIC_SET_CHARS[s];r?(e.append(String.fromCharCode(u.charCodeAt(0)+128)),r=!1):e.append(u)}break;case 1:r?(e.append(String.fromCharCode(s+128)),r=!1):e.append(String.fromCharCode(s)),o=0;break;case 2:if(s<this.C40_SHIFT2_SET_CHARS.length)u=this.C40_SHIFT2_SET_CHARS[s],r?(e.append(String.fromCharCode(u.charCodeAt(0)+128)),r=!1):e.append(u);else switch(s){case 27:e.append(String.fromCharCode(29));break;case 30:r=!0;break;default:throw new Vr}o=0;break;case 3:r?(e.append(String.fromCharCode(s+224)),r=!1):e.append(String.fromCharCode(s+96)),o=0;break;default:throw new Vr}}}while(t.available()>0)},t.decodeTextSegment=function(t,e){var r=!1,n=[],o=0;do{if(8===t.available())return;var i=t.readBits(8);if(254===i)return;this.parseTwoBytes(i,t.readBits(8),n);for(var a=0;a<3;a++){var s=n[a];switch(o){case 0:if(s<3)o=s+1;else{if(!(s<this.TEXT_BASIC_SET_CHARS.length))throw new Vr;var u=this.TEXT_BASIC_SET_CHARS[s];r?(e.append(String.fromCharCode(u.charCodeAt(0)+128)),r=!1):e.append(u)}break;case 1:r?(e.append(String.fromCharCode(s+128)),r=!1):e.append(String.fromCharCode(s)),o=0;break;case 2:if(s<this.TEXT_SHIFT2_SET_CHARS.length)u=this.TEXT_SHIFT2_SET_CHARS[s],r?(e.append(String.fromCharCode(u.charCodeAt(0)+128)),r=!1):e.append(u);else switch(s){case 27:e.append(String.fromCharCode(29));break;case 30:r=!0;break;default:throw new Vr}o=0;break;case 3:if(!(s<this.TEXT_SHIFT3_SET_CHARS.length))throw new Vr;u=this.TEXT_SHIFT3_SET_CHARS[s],r?(e.append(String.fromCharCode(u.charCodeAt(0)+128)),r=!1):e.append(u),o=0;break;default:throw new Vr}}}while(t.available()>0)},t.decodeAnsiX12Segment=function(t,e){var r=[];do{if(8===t.available())return;var n=t.readBits(8);if(254===n)return;this.parseTwoBytes(n,t.readBits(8),r);for(var o=0;o<3;o++){var i=r[o];switch(i){case 0:e.append("\r");break;case 1:e.append("*");break;case 2:e.append(">");break;case 3:e.append(" ");break;default:if(i<14)e.append(String.fromCharCode(i+44));else{if(!(i<40))throw new Vr;e.append(String.fromCharCode(i+51))}}}}while(t.available()>0)},t.parseTwoBytes=function(t,e,r){var n=(t<<8)+e-1,o=Math.floor(n/1600);r[0]=o,n-=1600*o,o=Math.floor(n/40),r[1]=o,r[2]=n-40*o},t.decodeEdifactSegment=function(t,e){do{if(t.available()<=16)return;for(var r=0;r<4;r++){var n=t.readBits(6);if(31===n){var o=8-t.getBitOffset();return void(8!==o&&t.readBits(o))}!(32&n)&&(n|=64),e.append(String.fromCharCode(n))}}while(t.available()>0)},t.decodeBase256Segment=function(t,e,r){var n,o=1+t.getByteOffset(),i=this.unrandomize255State(t.readBits(8),o++);if((n=0===i?t.available()/8|0:i<250?i:250*(i-249)+this.unrandomize255State(t.readBits(8),o++))<0)throw new Vr;for(var a=new Uint8Array(n),s=0;s<n;s++){if(t.available()<8)throw new Vr;a[s]=this.unrandomize255State(t.readBits(8),o++)}r.push(a);try{e.append(Gr.decode(a,Xr.ISO88591))}catch(u){throw new Sn("Platform does not support required encoding: "+u.message)}},t.unrandomize255State=function(t,e){var r=t-(149*e%255+1);return r>=0?r:r+256},t.C40_BASIC_SET_CHARS=["*","*","*"," ","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"],t.C40_SHIFT2_SET_CHARS=["!",'"',"#","$","%","&","'","(",")","*","+",",","-",".","/",":",";","<","=",">","?","@","[","\\","]","^","_"],t.TEXT_BASIC_SET_CHARS=["*","*","*"," ","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"],t.TEXT_SHIFT2_SET_CHARS=t.C40_SHIFT2_SET_CHARS,t.TEXT_SHIFT3_SET_CHARS=["`","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","{","|","}","~",String.fromCharCode(127)],t}(),ki=function(){function t(){this.rsDecoder=new xn(Cn.DATA_MATRIX_FIELD_256)}return t.prototype.decode=function(t){var e,r,n=new Ii(t),o=n.getVersion(),i=n.readCodewords(),a=xi.getDataBlocks(i,o),s=0;try{for(var u=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}(a),l=u.next();!l.done;l=u.next())s+=l.value.getNumDataCodewords()}catch(v){e={error:v}}finally{try{l&&!l.done&&(r=u.return)&&r.call(u)}finally{if(e)throw e.error}}for(var c=new Uint8Array(s),h=a.length,f=0;f<h;f++){var d=a[f],p=d.getCodewords(),g=d.getNumDataCodewords();this.correctErrors(p,g);for(var m=0;m<g;m++)c[m*h+f]=p[m]}return Ni.decode(c)},t.prototype.correctErrors=function(t,e){var r=new Int32Array(t);try{this.rsDecoder.decode(r,t.length-e)}catch(o){throw new xr}for(var n=0;n<e;n++)t[n]=r[n]},t}(),Ri=function(){function t(t){this.image=t,this.rectangleDetector=new Mn(this.image)}return t.prototype.detect=function(){var e=this.rectangleDetector.detect(),r=this.detectSolid1(e);if((r=this.detectSolid2(r))[3]=this.correctTopRight(r),!r[3])throw new Kr;var n=(r=this.shiftToModuleCenter(r))[0],o=r[1],i=r[2],a=r[3],s=this.transitionsBetween(n,a)+1,u=this.transitionsBetween(i,a)+1;!(1&~s)&&(s+=1),!(1&~u)&&(u+=1),4*s<7*u&&4*u<7*s&&(s=u=Math.max(s,u));var l=t.sampleGrid(this.image,n,o,i,a,s,u);return new Rn(l,[n,o,i,a])},t.shiftPoint=function(t,e,r){var n=(e.getX()-t.getX())/(r+1),o=(e.getY()-t.getY())/(r+1);return new kn(t.getX()+n,t.getY()+o)},t.moveAway=function(t,e,r){var n=t.getX(),o=t.getY();return n<e?n-=1:n+=1,o<r?o-=1:o+=1,new kn(n,o)},t.prototype.detectSolid1=function(t){var e=t[0],r=t[1],n=t[3],o=t[2],i=this.transitionsBetween(e,r),a=this.transitionsBetween(r,n),s=this.transitionsBetween(n,o),u=this.transitionsBetween(o,e),l=i,c=[o,e,r,n];return l>a&&(l=a,c[0]=e,c[1]=r,c[2]=n,c[3]=o),l>s&&(l=s,c[0]=r,c[1]=n,c[2]=o,c[3]=e),l>u&&(c[0]=n,c[1]=o,c[2]=e,c[3]=r),c},t.prototype.detectSolid2=function(e){var r=e[0],n=e[1],o=e[2],i=e[3],a=this.transitionsBetween(r,i),s=t.shiftPoint(n,o,4*(a+1)),u=t.shiftPoint(o,n,4*(a+1));return this.transitionsBetween(s,r)<this.transitionsBetween(u,i)?(e[0]=r,e[1]=n,e[2]=o,e[3]=i):(e[0]=n,e[1]=o,e[2]=i,e[3]=r),e},t.prototype.correctTopRight=function(e){var r=e[0],n=e[1],o=e[2],i=e[3],a=this.transitionsBetween(r,i),s=this.transitionsBetween(n,i),u=t.shiftPoint(r,n,4*(s+1)),l=t.shiftPoint(o,n,4*(a+1));a=this.transitionsBetween(u,i),s=this.transitionsBetween(l,i);var c=new kn(i.getX()+(o.getX()-n.getX())/(a+1),i.getY()+(o.getY()-n.getY())/(a+1)),h=new kn(i.getX()+(r.getX()-n.getX())/(s+1),i.getY()+(r.getY()-n.getY())/(s+1));return this.isValid(c)?this.isValid(h)?this.transitionsBetween(u,c)+this.transitionsBetween(l,c)>this.transitionsBetween(u,h)+this.transitionsBetween(l,h)?c:h:c:this.isValid(h)?h:null},t.prototype.shiftToModuleCenter=function(e){var r=e[0],n=e[1],o=e[2],i=e[3],a=this.transitionsBetween(r,i)+1,s=this.transitionsBetween(o,i)+1,u=t.shiftPoint(r,n,4*s),l=t.shiftPoint(o,n,4*a);!(1&~(a=this.transitionsBetween(u,i)+1))&&(a+=1),!(1&~(s=this.transitionsBetween(l,i)+1))&&(s+=1);var c,h,f=(r.getX()+n.getX()+o.getX()+i.getX())/4,d=(r.getY()+n.getY()+o.getY()+i.getY())/4;return r=t.moveAway(r,f,d),n=t.moveAway(n,f,d),o=t.moveAway(o,f,d),i=t.moveAway(i,f,d),u=t.shiftPoint(r,n,4*s),u=t.shiftPoint(u,i,4*a),c=t.shiftPoint(n,r,4*s),c=t.shiftPoint(c,o,4*a),l=t.shiftPoint(o,i,4*s),l=t.shiftPoint(l,n,4*a),h=t.shiftPoint(i,o,4*s),[u,c,l,h=t.shiftPoint(h,r,4*a)]},t.prototype.isValid=function(t){return t.getX()>=0&&t.getX()<this.image.getWidth()&&t.getY()>0&&t.getY()<this.image.getHeight()},t.sampleGrid=function(t,e,r,n,o,i,a){return Vn.getInstance().sampleGrid(t,i,a,.5,.5,i-.5,.5,i-.5,a-.5,.5,a-.5,e.getX(),e.getY(),o.getX(),o.getY(),n.getX(),n.getY(),r.getX(),r.getY())},t.prototype.transitionsBetween=function(t,e){var r=Math.trunc(t.getX()),n=Math.trunc(t.getY()),o=Math.trunc(e.getX()),i=Math.trunc(e.getY()),a=Math.abs(i-n)>Math.abs(o-r);if(a){var s=r;r=n,n=s,s=o,o=i,i=s}for(var u=Math.abs(o-r),l=Math.abs(i-n),c=-u/2,h=n<i?1:-1,f=r<o?1:-1,d=0,p=this.image.get(a?n:r,a?r:n),g=r,m=n;g!==o;g+=f){var v=this.image.get(a?m:g,a?g:m);if(v!==p&&(d++,p=v),(c+=l)>0){if(m===i)break;m+=h,c-=u}}return d},t}(),Di=function(){function t(){this.decoder=new ki}return t.prototype.decode=function(e,r){var n,o;if(void 0===r&&(r=null),null!=r&&r.has(Fr.PURE_BARCODE)){var i=t.extractPureBits(e.getBlackMatrix());n=this.decoder.decode(i),o=t.NO_POINTS}else{var a=new Ri(e.getBlackMatrix()).detect();n=this.decoder.decode(a.getBits()),o=a.getPoints()}var s=n.getRawBytes(),u=new hn(n.getText(),s,8*s.length,o,dn.DATA_MATRIX,Tr.currentTimeMillis()),l=n.getByteSegments();null!=l&&u.putMetadata(gn.BYTE_SEGMENTS,l);var c=n.getECLevel();return null!=c&&u.putMetadata(gn.ERROR_CORRECTION_LEVEL,c),u},t.prototype.reset=function(){},t.extractPureBits=function(t){var e=t.getTopLeftOnBit(),r=t.getBottomRightOnBit();if(null==e||null==r)throw new Kr;var n=this.moduleSize(e,t),o=e[1],i=r[1],a=e[0],s=(r[0]-a+1)/n,u=(i-o+1)/n;if(s<=0||u<=0)throw new Kr;var l=n/2;o+=l,a+=l;for(var c=new Yr(s,u),h=0;h<u;h++)for(var f=o+h*n,d=0;d<s;d++)t.get(a+d*n,f)&&c.set(d,h);return c},t.moduleSize=function(t,e){for(var r=e.getWidth(),n=t[0],o=t[1];n<r&&e.get(n,o);)n++;if(n===r)throw new Kr;var i=n-t[0];if(0===i)throw new Kr;return i},t.NO_POINTS=[],t}(),Pi=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();!function(t){Pi(function(e){return void 0===e&&(e=500),t.call(this,new Di,e)||this},t)}(cn),function(t){t[t.L=0]="L",t[t.M=1]="M",t[t.Q=2]="Q",t[t.H=3]="H"}(Ti||(Ti={}));var Mi,Bi=function(){function t(e,r,n){this.value=e,this.stringValue=r,this.bits=n,t.FOR_BITS.set(n,this),t.FOR_VALUE.set(e,this)}return t.prototype.getValue=function(){return this.value},t.prototype.getBits=function(){return this.bits},t.fromString=function(e){switch(e){case"L":return t.L;case"M":return t.M;case"Q":return t.Q;case"H":return t.H;default:throw new Cr(e+"not available")}},t.prototype.toString=function(){return this.stringValue},t.prototype.equals=function(e){if(!(e instanceof t))return!1;var r=e;return this.value===r.value},t.forBits=function(e){if(e<0||e>=t.FOR_BITS.size)throw new Er;return t.FOR_BITS.get(e)},t.FOR_BITS=new Map,t.FOR_VALUE=new Map,t.L=new t(Ti.L,"L",1),t.M=new t(Ti.M,"M",0),t.Q=new t(Ti.Q,"Q",3),t.H=new t(Ti.H,"H",2),t}(),Li=function(){function t(t){this.errorCorrectionLevel=Bi.forBits(t>>3&3),this.dataMask=7&t}return t.numBitsDiffering=function(t,e){return Mr.bitCount(t^e)},t.decodeFormatInformation=function(e,r){var n=t.doDecodeFormatInformation(e,r);return null!==n?n:t.doDecodeFormatInformation(e^t.FORMAT_INFO_MASK_QR,r^t.FORMAT_INFO_MASK_QR)},t.doDecodeFormatInformation=function(e,r){var n,o,i=Number.MAX_SAFE_INTEGER,a=0;try{for(var s=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}(t.FORMAT_INFO_DECODE_LOOKUP),u=s.next();!u.done;u=s.next()){var l=u.value,c=l[0];if(c===e||c===r)return new t(l[1]);var h=t.numBitsDiffering(e,c);h<i&&(a=l[1],i=h),e!==r&&(h=t.numBitsDiffering(r,c))<i&&(a=l[1],i=h)}}catch(f){n={error:f}}finally{try{u&&!u.done&&(o=s.return)&&o.call(s)}finally{if(n)throw n.error}}return i<=3?new t(a):null},t.prototype.getErrorCorrectionLevel=function(){return this.errorCorrectionLevel},t.prototype.getDataMask=function(){return this.dataMask},t.prototype.hashCode=function(){return this.errorCorrectionLevel.getBits()<<3|this.dataMask},t.prototype.equals=function(e){if(!(e instanceof t))return!1;var r=e;return this.errorCorrectionLevel===r.errorCorrectionLevel&&this.dataMask===r.dataMask},t.FORMAT_INFO_MASK_QR=21522,t.FORMAT_INFO_DECODE_LOOKUP=[Int32Array.from([21522,0]),Int32Array.from([20773,1]),Int32Array.from([24188,2]),Int32Array.from([23371,3]),Int32Array.from([17913,4]),Int32Array.from([16590,5]),Int32Array.from([20375,6]),Int32Array.from([19104,7]),Int32Array.from([30660,8]),Int32Array.from([29427,9]),Int32Array.from([32170,10]),Int32Array.from([30877,11]),Int32Array.from([26159,12]),Int32Array.from([25368,13]),Int32Array.from([27713,14]),Int32Array.from([26998,15]),Int32Array.from([5769,16]),Int32Array.from([5054,17]),Int32Array.from([7399,18]),Int32Array.from([6608,19]),Int32Array.from([1890,20]),Int32Array.from([597,21]),Int32Array.from([3340,22]),Int32Array.from([2107,23]),Int32Array.from([13663,24]),Int32Array.from([12392,25]),Int32Array.from([16177,26]),Int32Array.from([14854,27]),Int32Array.from([9396,28]),Int32Array.from([8579,29]),Int32Array.from([11994,30]),Int32Array.from([11245,31])],t}(),Fi=function(){function t(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];this.ecCodewordsPerBlock=t,this.ecBlocks=e}return t.prototype.getECCodewordsPerBlock=function(){return this.ecCodewordsPerBlock},t.prototype.getNumBlocks=function(){var t,e,r=0,n=this.ecBlocks;try{for(var o=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}(n),i=o.next();!i.done;i=o.next())r+=i.value.getCount()}catch(a){t={error:a}}finally{try{i&&!i.done&&(e=o.return)&&e.call(o)}finally{if(t)throw t.error}}return r},t.prototype.getTotalECCodewords=function(){return this.ecCodewordsPerBlock*this.getNumBlocks()},t.prototype.getECBlocks=function(){return this.ecBlocks},t}(),ji=function(){function t(t,e){this.count=t,this.dataCodewords=e}return t.prototype.getCount=function(){return this.count},t.prototype.getDataCodewords=function(){return this.dataCodewords},t}(),Vi=function(){function t(t,e){for(var r,n,o=[],i=2;i<arguments.length;i++)o[i-2]=arguments[i];this.versionNumber=t,this.alignmentPatternCenters=e,this.ecBlocks=o;var a=0,s=o[0].getECCodewordsPerBlock(),u=o[0].getECBlocks();try{for(var l=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}(u),c=l.next();!c.done;c=l.next()){var h=c.value;a+=h.getCount()*(h.getDataCodewords()+s)}}catch(f){r={error:f}}finally{try{c&&!c.done&&(n=l.return)&&n.call(l)}finally{if(r)throw r.error}}this.totalCodewords=a}return t.prototype.getVersionNumber=function(){return this.versionNumber},t.prototype.getAlignmentPatternCenters=function(){return this.alignmentPatternCenters},t.prototype.getTotalCodewords=function(){return this.totalCodewords},t.prototype.getDimensionForVersion=function(){return 17+4*this.versionNumber},t.prototype.getECBlocksForLevel=function(t){return this.ecBlocks[t.getValue()]},t.getProvisionalVersionForDimension=function(t){if(t%4!=1)throw new Vr;try{return this.getVersionForNumber((t-17)/4)}catch(e){throw new Vr}},t.getVersionForNumber=function(e){if(e<1||e>40)throw new Er;return t.VERSIONS[e-1]},t.decodeVersionInformation=function(e){for(var r=Number.MAX_SAFE_INTEGER,n=0,o=0;o<t.VERSION_DECODE_INFO.length;o++){var i=t.VERSION_DECODE_INFO[o];if(i===e)return t.getVersionForNumber(o+7);var a=Li.numBitsDiffering(e,i);a<r&&(n=o+7,r=a)}return r<=3?t.getVersionForNumber(n):null},t.prototype.buildFunctionPattern=function(){var t=this.getDimensionForVersion(),e=new Yr(t);e.setRegion(0,0,9,9),e.setRegion(t-8,0,8,9),e.setRegion(0,t-8,9,8);for(var r=this.alignmentPatternCenters.length,n=0;n<r;n++)for(var o=this.alignmentPatternCenters[n]-2,i=0;i<r;i++)0===n&&(0===i||i===r-1)||n===r-1&&0===i||e.setRegion(this.alignmentPatternCenters[i]-2,o,5,5);return e.setRegion(6,9,1,t-17),e.setRegion(9,6,t-17,1),this.versionNumber>6&&(e.setRegion(t-11,0,3,6),e.setRegion(0,t-11,6,3)),e},t.prototype.toString=function(){return""+this.versionNumber},t.VERSION_DECODE_INFO=Int32Array.from([31892,34236,39577,42195,48118,51042,55367,58893,63784,68472,70749,76311,79154,84390,87683,92361,96236,102084,102881,110507,110734,117786,119615,126325,127568,133589,136944,141498,145311,150283,152622,158308,161089,167017]),t.VERSIONS=[new t(1,new Int32Array(0),new Fi(7,new ji(1,19)),new Fi(10,new ji(1,16)),new Fi(13,new ji(1,13)),new Fi(17,new ji(1,9))),new t(2,Int32Array.from([6,18]),new Fi(10,new ji(1,34)),new Fi(16,new ji(1,28)),new Fi(22,new ji(1,22)),new Fi(28,new ji(1,16))),new t(3,Int32Array.from([6,22]),new Fi(15,new ji(1,55)),new Fi(26,new ji(1,44)),new Fi(18,new ji(2,17)),new Fi(22,new ji(2,13))),new t(4,Int32Array.from([6,26]),new Fi(20,new ji(1,80)),new Fi(18,new ji(2,32)),new Fi(26,new ji(2,24)),new Fi(16,new ji(4,9))),new t(5,Int32Array.from([6,30]),new Fi(26,new ji(1,108)),new Fi(24,new ji(2,43)),new Fi(18,new ji(2,15),new ji(2,16)),new Fi(22,new ji(2,11),new ji(2,12))),new t(6,Int32Array.from([6,34]),new Fi(18,new ji(2,68)),new Fi(16,new ji(4,27)),new Fi(24,new ji(4,19)),new Fi(28,new ji(4,15))),new t(7,Int32Array.from([6,22,38]),new Fi(20,new ji(2,78)),new Fi(18,new ji(4,31)),new Fi(18,new ji(2,14),new ji(4,15)),new Fi(26,new ji(4,13),new ji(1,14))),new t(8,Int32Array.from([6,24,42]),new Fi(24,new ji(2,97)),new Fi(22,new ji(2,38),new ji(2,39)),new Fi(22,new ji(4,18),new ji(2,19)),new Fi(26,new ji(4,14),new ji(2,15))),new t(9,Int32Array.from([6,26,46]),new Fi(30,new ji(2,116)),new Fi(22,new ji(3,36),new ji(2,37)),new Fi(20,new ji(4,16),new ji(4,17)),new Fi(24,new ji(4,12),new ji(4,13))),new t(10,Int32Array.from([6,28,50]),new Fi(18,new ji(2,68),new ji(2,69)),new Fi(26,new ji(4,43),new ji(1,44)),new Fi(24,new ji(6,19),new ji(2,20)),new Fi(28,new ji(6,15),new ji(2,16))),new t(11,Int32Array.from([6,30,54]),new Fi(20,new ji(4,81)),new Fi(30,new ji(1,50),new ji(4,51)),new Fi(28,new ji(4,22),new ji(4,23)),new Fi(24,new ji(3,12),new ji(8,13))),new t(12,Int32Array.from([6,32,58]),new Fi(24,new ji(2,92),new ji(2,93)),new Fi(22,new ji(6,36),new ji(2,37)),new Fi(26,new ji(4,20),new ji(6,21)),new Fi(28,new ji(7,14),new ji(4,15))),new t(13,Int32Array.from([6,34,62]),new Fi(26,new ji(4,107)),new Fi(22,new ji(8,37),new ji(1,38)),new Fi(24,new ji(8,20),new ji(4,21)),new Fi(22,new ji(12,11),new ji(4,12))),new t(14,Int32Array.from([6,26,46,66]),new Fi(30,new ji(3,115),new ji(1,116)),new Fi(24,new ji(4,40),new ji(5,41)),new Fi(20,new ji(11,16),new ji(5,17)),new Fi(24,new ji(11,12),new ji(5,13))),new t(15,Int32Array.from([6,26,48,70]),new Fi(22,new ji(5,87),new ji(1,88)),new Fi(24,new ji(5,41),new ji(5,42)),new Fi(30,new ji(5,24),new ji(7,25)),new Fi(24,new ji(11,12),new ji(7,13))),new t(16,Int32Array.from([6,26,50,74]),new Fi(24,new ji(5,98),new ji(1,99)),new Fi(28,new ji(7,45),new ji(3,46)),new Fi(24,new ji(15,19),new ji(2,20)),new Fi(30,new ji(3,15),new ji(13,16))),new t(17,Int32Array.from([6,30,54,78]),new Fi(28,new ji(1,107),new ji(5,108)),new Fi(28,new ji(10,46),new ji(1,47)),new Fi(28,new ji(1,22),new ji(15,23)),new Fi(28,new ji(2,14),new ji(17,15))),new t(18,Int32Array.from([6,30,56,82]),new Fi(30,new ji(5,120),new ji(1,121)),new Fi(26,new ji(9,43),new ji(4,44)),new Fi(28,new ji(17,22),new ji(1,23)),new Fi(28,new ji(2,14),new ji(19,15))),new t(19,Int32Array.from([6,30,58,86]),new Fi(28,new ji(3,113),new ji(4,114)),new Fi(26,new ji(3,44),new ji(11,45)),new Fi(26,new ji(17,21),new ji(4,22)),new Fi(26,new ji(9,13),new ji(16,14))),new t(20,Int32Array.from([6,34,62,90]),new Fi(28,new ji(3,107),new ji(5,108)),new Fi(26,new ji(3,41),new ji(13,42)),new Fi(30,new ji(15,24),new ji(5,25)),new Fi(28,new ji(15,15),new ji(10,16))),new t(21,Int32Array.from([6,28,50,72,94]),new Fi(28,new ji(4,116),new ji(4,117)),new Fi(26,new ji(17,42)),new Fi(28,new ji(17,22),new ji(6,23)),new Fi(30,new ji(19,16),new ji(6,17))),new t(22,Int32Array.from([6,26,50,74,98]),new Fi(28,new ji(2,111),new ji(7,112)),new Fi(28,new ji(17,46)),new Fi(30,new ji(7,24),new ji(16,25)),new Fi(24,new ji(34,13))),new t(23,Int32Array.from([6,30,54,78,102]),new Fi(30,new ji(4,121),new ji(5,122)),new Fi(28,new ji(4,47),new ji(14,48)),new Fi(30,new ji(11,24),new ji(14,25)),new Fi(30,new ji(16,15),new ji(14,16))),new t(24,Int32Array.from([6,28,54,80,106]),new Fi(30,new ji(6,117),new ji(4,118)),new Fi(28,new ji(6,45),new ji(14,46)),new Fi(30,new ji(11,24),new ji(16,25)),new Fi(30,new ji(30,16),new ji(2,17))),new t(25,Int32Array.from([6,32,58,84,110]),new Fi(26,new ji(8,106),new ji(4,107)),new Fi(28,new ji(8,47),new ji(13,48)),new Fi(30,new ji(7,24),new ji(22,25)),new Fi(30,new ji(22,15),new ji(13,16))),new t(26,Int32Array.from([6,30,58,86,114]),new Fi(28,new ji(10,114),new ji(2,115)),new Fi(28,new ji(19,46),new ji(4,47)),new Fi(28,new ji(28,22),new ji(6,23)),new Fi(30,new ji(33,16),new ji(4,17))),new t(27,Int32Array.from([6,34,62,90,118]),new Fi(30,new ji(8,122),new ji(4,123)),new Fi(28,new ji(22,45),new ji(3,46)),new Fi(30,new ji(8,23),new ji(26,24)),new Fi(30,new ji(12,15),new ji(28,16))),new t(28,Int32Array.from([6,26,50,74,98,122]),new Fi(30,new ji(3,117),new ji(10,118)),new Fi(28,new ji(3,45),new ji(23,46)),new Fi(30,new ji(4,24),new ji(31,25)),new Fi(30,new ji(11,15),new ji(31,16))),new t(29,Int32Array.from([6,30,54,78,102,126]),new Fi(30,new ji(7,116),new ji(7,117)),new Fi(28,new ji(21,45),new ji(7,46)),new Fi(30,new ji(1,23),new ji(37,24)),new Fi(30,new ji(19,15),new ji(26,16))),new t(30,Int32Array.from([6,26,52,78,104,130]),new Fi(30,new ji(5,115),new ji(10,116)),new Fi(28,new ji(19,47),new ji(10,48)),new Fi(30,new ji(15,24),new ji(25,25)),new Fi(30,new ji(23,15),new ji(25,16))),new t(31,Int32Array.from([6,30,56,82,108,134]),new Fi(30,new ji(13,115),new ji(3,116)),new Fi(28,new ji(2,46),new ji(29,47)),new Fi(30,new ji(42,24),new ji(1,25)),new Fi(30,new ji(23,15),new ji(28,16))),new t(32,Int32Array.from([6,34,60,86,112,138]),new Fi(30,new ji(17,115)),new Fi(28,new ji(10,46),new ji(23,47)),new Fi(30,new ji(10,24),new ji(35,25)),new Fi(30,new ji(19,15),new ji(35,16))),new t(33,Int32Array.from([6,30,58,86,114,142]),new Fi(30,new ji(17,115),new ji(1,116)),new Fi(28,new ji(14,46),new ji(21,47)),new Fi(30,new ji(29,24),new ji(19,25)),new Fi(30,new ji(11,15),new ji(46,16))),new t(34,Int32Array.from([6,34,62,90,118,146]),new Fi(30,new ji(13,115),new ji(6,116)),new Fi(28,new ji(14,46),new ji(23,47)),new Fi(30,new ji(44,24),new ji(7,25)),new Fi(30,new ji(59,16),new ji(1,17))),new t(35,Int32Array.from([6,30,54,78,102,126,150]),new Fi(30,new ji(12,121),new ji(7,122)),new Fi(28,new ji(12,47),new ji(26,48)),new Fi(30,new ji(39,24),new ji(14,25)),new Fi(30,new ji(22,15),new ji(41,16))),new t(36,Int32Array.from([6,24,50,76,102,128,154]),new Fi(30,new ji(6,121),new ji(14,122)),new Fi(28,new ji(6,47),new ji(34,48)),new Fi(30,new ji(46,24),new ji(10,25)),new Fi(30,new ji(2,15),new ji(64,16))),new t(37,Int32Array.from([6,28,54,80,106,132,158]),new Fi(30,new ji(17,122),new ji(4,123)),new Fi(28,new ji(29,46),new ji(14,47)),new Fi(30,new ji(49,24),new ji(10,25)),new Fi(30,new ji(24,15),new ji(46,16))),new t(38,Int32Array.from([6,32,58,84,110,136,162]),new Fi(30,new ji(4,122),new ji(18,123)),new Fi(28,new ji(13,46),new ji(32,47)),new Fi(30,new ji(48,24),new ji(14,25)),new Fi(30,new ji(42,15),new ji(32,16))),new t(39,Int32Array.from([6,26,54,82,110,138,166]),new Fi(30,new ji(20,117),new ji(4,118)),new Fi(28,new ji(40,47),new ji(7,48)),new Fi(30,new ji(43,24),new ji(22,25)),new Fi(30,new ji(10,15),new ji(67,16))),new t(40,Int32Array.from([6,30,58,86,114,142,170]),new Fi(30,new ji(19,118),new ji(6,119)),new Fi(28,new ji(18,47),new ji(31,48)),new Fi(30,new ji(34,24),new ji(34,25)),new Fi(30,new ji(20,15),new ji(61,16)))],t}();!function(t){t[t.DATA_MASK_000=0]="DATA_MASK_000",t[t.DATA_MASK_001=1]="DATA_MASK_001",t[t.DATA_MASK_010=2]="DATA_MASK_010",t[t.DATA_MASK_011=3]="DATA_MASK_011",t[t.DATA_MASK_100=4]="DATA_MASK_100",t[t.DATA_MASK_101=5]="DATA_MASK_101",t[t.DATA_MASK_110=6]="DATA_MASK_110",t[t.DATA_MASK_111=7]="DATA_MASK_111"}(Mi||(Mi={}));var Ui,Hi=function(){function t(t,e){this.value=t,this.isMasked=e}return t.prototype.unmaskBitMatrix=function(t,e){for(var r=0;r<e;r++)for(var n=0;n<e;n++)this.isMasked(r,n)&&t.flip(n,r)},t.values=new Map([[Mi.DATA_MASK_000,new t(Mi.DATA_MASK_000,function(t,e){return!(t+e&1)})],[Mi.DATA_MASK_001,new t(Mi.DATA_MASK_001,function(t,e){return!(1&t)})],[Mi.DATA_MASK_010,new t(Mi.DATA_MASK_010,function(t,e){return e%3==0})],[Mi.DATA_MASK_011,new t(Mi.DATA_MASK_011,function(t,e){return(t+e)%3==0})],[Mi.DATA_MASK_100,new t(Mi.DATA_MASK_100,function(t,e){return!(Math.floor(t/2)+Math.floor(e/3)&1)})],[Mi.DATA_MASK_101,new t(Mi.DATA_MASK_101,function(t,e){return t*e%6==0})],[Mi.DATA_MASK_110,new t(Mi.DATA_MASK_110,function(t,e){return t*e%6<3})],[Mi.DATA_MASK_111,new t(Mi.DATA_MASK_111,function(t,e){return!(t+e+t*e%3&1)})]]),t}(),zi=function(){function t(t){var e=t.getHeight();if(e<21||1!=(3&e))throw new Vr;this.bitMatrix=t}return t.prototype.readFormatInformation=function(){if(null!==this.parsedFormatInfo&&void 0!==this.parsedFormatInfo)return this.parsedFormatInfo;for(var t=0,e=0;e<6;e++)t=this.copyBit(e,8,t);t=this.copyBit(7,8,t),t=this.copyBit(8,8,t),t=this.copyBit(8,7,t);for(var r=5;r>=0;r--)t=this.copyBit(8,r,t);var n=this.bitMatrix.getHeight(),o=0,i=n-7;for(r=n-1;r>=i;r--)o=this.copyBit(8,r,o);for(e=n-8;e<n;e++)o=this.copyBit(e,8,o);if(this.parsedFormatInfo=Li.decodeFormatInformation(t,o),null!==this.parsedFormatInfo)return this.parsedFormatInfo;throw new Vr},t.prototype.readVersion=function(){if(null!==this.parsedVersion&&void 0!==this.parsedVersion)return this.parsedVersion;var t=this.bitMatrix.getHeight(),e=Math.floor((t-17)/4);if(e<=6)return Vi.getVersionForNumber(e);for(var r=0,n=t-11,o=5;o>=0;o--)for(var i=t-9;i>=n;i--)r=this.copyBit(i,o,r);var a=Vi.decodeVersionInformation(r);if(null!==a&&a.getDimensionForVersion()===t)return this.parsedVersion=a,a;for(r=0,i=5;i>=0;i--)for(o=t-9;o>=n;o--)r=this.copyBit(i,o,r);if(null!==(a=Vi.decodeVersionInformation(r))&&a.getDimensionForVersion()===t)return this.parsedVersion=a,a;throw new Vr},t.prototype.copyBit=function(t,e,r){return(this.isMirror?this.bitMatrix.get(e,t):this.bitMatrix.get(t,e))?r<<1|1:r<<1},t.prototype.readCodewords=function(){var t=this.readFormatInformation(),e=this.readVersion(),r=Hi.values.get(t.getDataMask()),n=this.bitMatrix.getHeight();r.unmaskBitMatrix(this.bitMatrix,n);for(var o=e.buildFunctionPattern(),i=!0,a=new Uint8Array(e.getTotalCodewords()),s=0,u=0,l=0,c=n-1;c>0;c-=2){6===c&&c--;for(var h=0;h<n;h++)for(var f=i?n-1-h:h,d=0;d<2;d++)o.get(c-d,f)||(l++,u<<=1,this.bitMatrix.get(c-d,f)&&(u|=1),8===l&&(a[s++]=u,l=0,u=0));i=!i}if(s!==e.getTotalCodewords())throw new Vr;return a},t.prototype.remask=function(){if(null!==this.parsedFormatInfo){var t=Hi.values[this.parsedFormatInfo.getDataMask()],e=this.bitMatrix.getHeight();t.unmaskBitMatrix(this.bitMatrix,e)}},t.prototype.setMirror=function(t){this.parsedVersion=null,this.parsedFormatInfo=null,this.isMirror=t},t.prototype.mirror=function(){for(var t=this.bitMatrix,e=0,r=t.getWidth();e<r;e++)for(var n=e+1,o=t.getHeight();n<o;n++)t.get(e,n)!==t.get(n,e)&&(t.flip(n,e),t.flip(e,n))},t}(),Wi=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Gi=function(){function t(t,e){this.numDataCodewords=t,this.codewords=e}return t.getDataBlocks=function(e,r,n){var o,i,a,s;if(e.length!==r.getTotalCodewords())throw new Er;var u=r.getECBlocksForLevel(n),l=0,c=u.getECBlocks();try{for(var h=Wi(c),f=h.next();!f.done;f=h.next())l+=(v=f.value).getCount()}catch(O){o={error:O}}finally{try{f&&!f.done&&(i=h.return)&&i.call(h)}finally{if(o)throw o.error}}var d=new Array(l),p=0;try{for(var g=Wi(c),m=g.next();!m.done;m=g.next())for(var v=m.value,y=0;y<v.getCount();y++){var _=v.getDataCodewords(),w=u.getECCodewordsPerBlock()+_;d[p++]=new t(_,new Uint8Array(w))}}catch(O){a={error:O}}finally{try{m&&!m.done&&(s=g.return)&&s.call(g)}finally{if(a)throw a.error}}for(var b=d[0].codewords.length,C=d.length-1;C>=0&&d[C].codewords.length!==b;)C--;C++;var A=b-u.getECCodewordsPerBlock(),E=0;for(y=0;y<A;y++)for(var I=0;I<p;I++)d[I].codewords[y]=e[E++];for(I=C;I<p;I++)d[I].codewords[A]=e[E++];var S=d[0].codewords.length;for(y=A;y<S;y++)for(I=0;I<p;I++){var x=I<C?y:y+1;d[I].codewords[x]=e[E++]}return d},t.prototype.getNumDataCodewords=function(){return this.numDataCodewords},t.prototype.getCodewords=function(){return this.codewords},t}();!function(t){t[t.TERMINATOR=0]="TERMINATOR",t[t.NUMERIC=1]="NUMERIC",t[t.ALPHANUMERIC=2]="ALPHANUMERIC",t[t.STRUCTURED_APPEND=3]="STRUCTURED_APPEND",t[t.BYTE=4]="BYTE",t[t.ECI=5]="ECI",t[t.KANJI=6]="KANJI",t[t.FNC1_FIRST_POSITION=7]="FNC1_FIRST_POSITION",t[t.FNC1_SECOND_POSITION=8]="FNC1_SECOND_POSITION",t[t.HANZI=9]="HANZI"}(Ui||(Ui={}));var Xi,$i,Yi=function(){function t(e,r,n,o){this.value=e,this.stringValue=r,this.characterCountBitsForVersions=n,this.bits=o,t.FOR_BITS.set(o,this),t.FOR_VALUE.set(e,this)}return t.forBits=function(e){var r=t.FOR_BITS.get(e);if(void 0===r)throw new Er;return r},t.prototype.getCharacterCountBits=function(t){var e,r=t.getVersionNumber();return e=r<=9?0:r<=26?1:2,this.characterCountBitsForVersions[e]},t.prototype.getValue=function(){return this.value},t.prototype.getBits=function(){return this.bits},t.prototype.equals=function(e){if(!(e instanceof t))return!1;var r=e;return this.value===r.value},t.prototype.toString=function(){return this.stringValue},t.FOR_BITS=new Map,t.FOR_VALUE=new Map,t.TERMINATOR=new t(Ui.TERMINATOR,"TERMINATOR",Int32Array.from([0,0,0]),0),t.NUMERIC=new t(Ui.NUMERIC,"NUMERIC",Int32Array.from([10,12,14]),1),t.ALPHANUMERIC=new t(Ui.ALPHANUMERIC,"ALPHANUMERIC",Int32Array.from([9,11,13]),2),t.STRUCTURED_APPEND=new t(Ui.STRUCTURED_APPEND,"STRUCTURED_APPEND",Int32Array.from([0,0,0]),3),t.BYTE=new t(Ui.BYTE,"BYTE",Int32Array.from([8,16,16]),4),t.ECI=new t(Ui.ECI,"ECI",Int32Array.from([0,0,0]),7),t.KANJI=new t(Ui.KANJI,"KANJI",Int32Array.from([8,10,12]),8),t.FNC1_FIRST_POSITION=new t(Ui.FNC1_FIRST_POSITION,"FNC1_FIRST_POSITION",Int32Array.from([0,0,0]),5),t.FNC1_SECOND_POSITION=new t(Ui.FNC1_SECOND_POSITION,"FNC1_SECOND_POSITION",Int32Array.from([0,0,0]),9),t.HANZI=new t(Ui.HANZI,"HANZI",Int32Array.from([8,10,12]),13),t}(),qi=function(){function t(){}return t.decode=function(e,r,n,o){var i=new Oi(e),a=new $r,s=new Array,u=-1,l=-1;try{var c=null,h=!1,f=void 0;do{if(i.available()<4)f=Yi.TERMINATOR;else{var d=i.readBits(4);f=Yi.forBits(d)}switch(f){case Yi.TERMINATOR:break;case Yi.FNC1_FIRST_POSITION:case Yi.FNC1_SECOND_POSITION:h=!0;break;case Yi.STRUCTURED_APPEND:if(i.available()<16)throw new Vr;u=i.readBits(8),l=i.readBits(8);break;case Yi.ECI:var p=t.parseECIValue(i);if(null===(c=Hr.getCharacterSetECIByValue(p)))throw new Vr;break;case Yi.HANZI:var g=i.readBits(4),m=i.readBits(f.getCharacterCountBits(r));g===t.GB2312_SUBSET&&t.decodeHanziSegment(i,a,m);break;default:var v=i.readBits(f.getCharacterCountBits(r));switch(f){case Yi.NUMERIC:t.decodeNumericSegment(i,a,v);break;case Yi.ALPHANUMERIC:t.decodeAlphanumericSegment(i,a,v,h);break;case Yi.BYTE:t.decodeByteSegment(i,a,v,c,s,o);break;case Yi.KANJI:t.decodeKanjiSegment(i,a,v);break;default:throw new Vr}}}while(f!==Yi.TERMINATOR)}catch(y){throw new Vr}return new mn(e,a.toString(),0===s.length?null:s,null===n?null:n.toString(),u,l)},t.decodeHanziSegment=function(t,e,r){if(13*r>t.available())throw new Vr;for(var n=new Uint8Array(2*r),o=0;r>0;){var i=t.readBits(13),a=i/96<<8&4294967295|i%96;a+=a<959?41377:42657,n[o]=a>>8&255,n[o+1]=255&a,o+=2,r--}try{e.append(Gr.decode(n,Xr.GB2312))}catch(s){throw new Vr(s)}},t.decodeKanjiSegment=function(t,e,r){if(13*r>t.available())throw new Vr;for(var n=new Uint8Array(2*r),o=0;r>0;){var i=t.readBits(13),a=i/192<<8&4294967295|i%192;a+=a<7936?33088:49472,n[o]=a>>8,n[o+1]=a,o+=2,r--}try{e.append(Gr.decode(n,Xr.SHIFT_JIS))}catch(s){throw new Vr(s)}},t.decodeByteSegment=function(t,e,r,n,o,i){if(8*r>t.available())throw new Vr;for(var a,s=new Uint8Array(r),u=0;u<r;u++)s[u]=t.readBits(8);a=null===n?Xr.guessEncoding(s,i):n.getName();try{e.append(Gr.decode(s,a))}catch(l){throw new Vr(l)}o.push(s)},t.toAlphaNumericChar=function(e){if(e>=t.ALPHANUMERIC_CHARS.length)throw new Vr;return t.ALPHANUMERIC_CHARS[e]},t.decodeAlphanumericSegment=function(e,r,n,o){for(var i=r.length();n>1;){if(e.available()<11)throw new Vr;var a=e.readBits(11);r.append(t.toAlphaNumericChar(Math.floor(a/45))),r.append(t.toAlphaNumericChar(a%45)),n-=2}if(1===n){if(e.available()<6)throw new Vr;r.append(t.toAlphaNumericChar(e.readBits(6)))}if(o)for(var s=i;s<r.length();s++)"%"===r.charAt(s)&&(s<r.length()-1&&"%"===r.charAt(s+1)?r.deleteCharAt(s+1):r.setCharAt(s,String.fromCharCode(29)))},t.decodeNumericSegment=function(e,r,n){for(;n>=3;){if(e.available()<10)throw new Vr;var o=e.readBits(10);if(o>=1e3)throw new Vr;r.append(t.toAlphaNumericChar(Math.floor(o/100))),r.append(t.toAlphaNumericChar(Math.floor(o/10)%10)),r.append(t.toAlphaNumericChar(o%10)),n-=3}if(2===n){if(e.available()<7)throw new Vr;var i=e.readBits(7);if(i>=100)throw new Vr;r.append(t.toAlphaNumericChar(Math.floor(i/10))),r.append(t.toAlphaNumericChar(i%10))}else if(1===n){if(e.available()<4)throw new Vr;var a=e.readBits(4);if(a>=10)throw new Vr;r.append(t.toAlphaNumericChar(a))}},t.parseECIValue=function(t){var e=t.readBits(8);if(!(128&e))return 127&e;if(128==(192&e))return(63&e)<<8&4294967295|t.readBits(8);if(192==(224&e))return(31&e)<<16&4294967295|t.readBits(16);throw new Vr},t.ALPHANUMERIC_CHARS="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:",t.GB2312_SUBSET=1,t}(),Ki=function(){function t(t){this.mirrored=t}return t.prototype.isMirrored=function(){return this.mirrored},t.prototype.applyMirroredCorrection=function(t){if(this.mirrored&&null!==t&&!(t.length<3)){var e=t[0];t[0]=t[2],t[2]=e}},t}(),Zi=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Qi=function(){function t(){this.rsDecoder=new xn(Cn.QR_CODE_FIELD_256)}return t.prototype.decodeBooleanArray=function(t,e){return this.decodeBitMatrix(Yr.parseFromBooleanArray(t),e)},t.prototype.decodeBitMatrix=function(t,e){var r=new zi(t),n=null;try{return this.decodeBitMatrixParser(r,e)}catch(i){n=i}try{r.remask(),r.setMirror(!0),r.readVersion(),r.readFormatInformation(),r.mirror();var o=this.decodeBitMatrixParser(r,e);return o.setOther(new Ki(!0)),o}catch(i){if(null!==n)throw n;throw i}},t.prototype.decodeBitMatrixParser=function(t,e){var r,n,o,i,a=t.readVersion(),s=t.readFormatInformation().getErrorCorrectionLevel(),u=t.readCodewords(),l=Gi.getDataBlocks(u,a,s),c=0;try{for(var h=Zi(l),f=h.next();!f.done;f=h.next())c+=(v=f.value).getNumDataCodewords()}catch(b){r={error:b}}finally{try{f&&!f.done&&(n=h.return)&&n.call(h)}finally{if(r)throw r.error}}var d=new Uint8Array(c),p=0;try{for(var g=Zi(l),m=g.next();!m.done;m=g.next()){var v,y=(v=m.value).getCodewords(),_=v.getNumDataCodewords();this.correctErrors(y,_);for(var w=0;w<_;w++)d[p++]=y[w]}}catch(b){o={error:b}}finally{try{m&&!m.done&&(i=g.return)&&i.call(g)}finally{if(o)throw o.error}}return qi.decode(d,a,s,e)},t.prototype.correctErrors=function(t,e){var r=new Int32Array(t);try{this.rsDecoder.decode(r,t.length-e)}catch(o){throw new xr}for(var n=0;n<e;n++)t[n]=r[n]},t}(),Ji=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),ta=function(t){function e(e,r,n){var o=t.call(this,e,r)||this;return o.estimatedModuleSize=n,o}return Ji(e,t),e.prototype.aboutEquals=function(t,e,r){if(Math.abs(e-this.getY())<=t&&Math.abs(r-this.getX())<=t){var n=Math.abs(t-this.estimatedModuleSize);return n<=1||n<=this.estimatedModuleSize}return!1},e.prototype.combineEstimate=function(t,r,n){return new e((this.getX()+r)/2,(this.getY()+t)/2,(this.estimatedModuleSize+n)/2)},e}(kn),ea=function(){function t(t,e,r,n,o,i,a){this.image=t,this.startX=e,this.startY=r,this.width=n,this.height=o,this.moduleSize=i,this.resultPointCallback=a,this.possibleCenters=[],this.crossCheckStateCount=new Int32Array(3)}return t.prototype.find=function(){for(var t=this.startX,e=this.height,r=t+this.width,n=this.startY+e/2,o=new Int32Array(3),i=this.image,a=0;a<e;a++){var s=n+(1&a?-Math.floor((a+1)/2):Math.floor((a+1)/2));o[0]=0,o[1]=0,o[2]=0;for(var u=t;u<r&&!i.get(u,s);)u++;for(var l=0;u<r;){if(i.get(u,s))if(1===l)o[1]++;else if(2===l){var c;if(this.foundPatternCross(o)&&null!==(c=this.handlePossibleCenter(o,s,u)))return c;o[0]=o[2],o[1]=1,o[2]=0,l=1}else o[++l]++;else 1===l&&l++,o[l]++;u++}if(this.foundPatternCross(o)&&null!==(c=this.handlePossibleCenter(o,s,r)))return c}if(0!==this.possibleCenters.length)return this.possibleCenters[0];throw new Kr},t.centerFromEnd=function(t,e){return e-t[2]-t[1]/2},t.prototype.foundPatternCross=function(t){for(var e=this.moduleSize,r=e/2,n=0;n<3;n++)if(Math.abs(e-t[n])>=r)return!1;return!0},t.prototype.crossCheckVertical=function(e,r,n,o){var i=this.image,a=i.getHeight(),s=this.crossCheckStateCount;s[0]=0,s[1]=0,s[2]=0;for(var u=e;u>=0&&i.get(r,u)&&s[1]<=n;)s[1]++,u--;if(u<0||s[1]>n)return NaN;for(;u>=0&&!i.get(r,u)&&s[0]<=n;)s[0]++,u--;if(s[0]>n)return NaN;for(u=e+1;u<a&&i.get(r,u)&&s[1]<=n;)s[1]++,u++;if(u===a||s[1]>n)return NaN;for(;u<a&&!i.get(r,u)&&s[2]<=n;)s[2]++,u++;if(s[2]>n)return NaN;var l=s[0]+s[1]+s[2];return 5*Math.abs(l-o)>=2*o?NaN:this.foundPatternCross(s)?t.centerFromEnd(s,u):NaN},t.prototype.handlePossibleCenter=function(e,r,n){var o,i,a=e[0]+e[1]+e[2],s=t.centerFromEnd(e,n),u=this.crossCheckVertical(r,s,2*e[1],a);if(!isNaN(u)){var l=(e[0]+e[1]+e[2])/3;try{for(var c=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}(this.possibleCenters),h=c.next();!h.done;h=c.next()){var f=h.value;if(f.aboutEquals(l,u,s))return f.combineEstimate(u,s,l)}}catch(p){o={error:p}}finally{try{h&&!h.done&&(i=c.return)&&i.call(c)}finally{if(o)throw o.error}}var d=new ta(s,u,l);this.possibleCenters.push(d),null!==this.resultPointCallback&&void 0!==this.resultPointCallback&&this.resultPointCallback.foundPossibleResultPoint(d)}return null},t}(),ra=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),na=function(t){function e(e,r,n,o){var i=t.call(this,e,r)||this;return i.estimatedModuleSize=n,i.count=o,void 0===o&&(i.count=1),i}return ra(e,t),e.prototype.getEstimatedModuleSize=function(){return this.estimatedModuleSize},e.prototype.getCount=function(){return this.count},e.prototype.aboutEquals=function(t,e,r){if(Math.abs(e-this.getY())<=t&&Math.abs(r-this.getX())<=t){var n=Math.abs(t-this.estimatedModuleSize);return n<=1||n<=this.estimatedModuleSize}return!1},e.prototype.combineEstimate=function(t,r,n){var o=this.count+1;return new e((this.count*this.getX()+r)/o,(this.count*this.getY()+t)/o,(this.count*this.estimatedModuleSize+n)/o,o)},e}(kn),oa=function(){function t(t){this.bottomLeft=t[0],this.topLeft=t[1],this.topRight=t[2]}return t.prototype.getBottomLeft=function(){return this.bottomLeft},t.prototype.getTopLeft=function(){return this.topLeft},t.prototype.getTopRight=function(){return this.topRight},t}(),ia=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},aa=function(){function t(t,e){this.image=t,this.resultPointCallback=e,this.possibleCenters=[],this.crossCheckStateCount=new Int32Array(5),this.resultPointCallback=e}return t.prototype.getImage=function(){return this.image},t.prototype.getPossibleCenters=function(){return this.possibleCenters},t.prototype.find=function(e){var r=null!=e&&void 0!==e.get(Fr.TRY_HARDER),n=null!=e&&void 0!==e.get(Fr.PURE_BARCODE),o=this.image,i=o.getHeight(),a=o.getWidth(),s=Math.floor(3*i/(4*t.MAX_MODULES));(s<t.MIN_SKIP||r)&&(s=t.MIN_SKIP);for(var u=!1,l=new Int32Array(5),c=s-1;c<i&&!u;c+=s){l[0]=0,l[1]=0,l[2]=0,l[3]=0,l[4]=0;for(var h=0,f=0;f<a;f++)if(o.get(f,c))!(1&~h)&&h++,l[h]++;else if(1&h)l[h]++;else if(4===h)if(t.foundPatternCross(l)){if(!0!==this.handlePossibleCenter(l,c,f,n)){l[0]=l[2],l[1]=l[3],l[2]=l[4],l[3]=1,l[4]=0,h=3;continue}if(s=2,!0===this.hasSkipped)u=this.haveMultiplyConfirmedCenters();else{var d=this.findRowSkip();d>l[2]&&(c+=d-l[2]-s,f=a-1)}h=0,l[0]=0,l[1]=0,l[2]=0,l[3]=0,l[4]=0}else l[0]=l[2],l[1]=l[3],l[2]=l[4],l[3]=1,l[4]=0,h=3;else l[++h]++;t.foundPatternCross(l)&&!0===this.handlePossibleCenter(l,c,a,n)&&(s=l[0],this.hasSkipped&&(u=this.haveMultiplyConfirmedCenters()))}var p=this.selectBestPatterns();return kn.orderBestPatterns(p),new oa(p)},t.centerFromEnd=function(t,e){return e-t[4]-t[3]-t[2]/2},t.foundPatternCross=function(t){for(var e=0,r=0;r<5;r++){var n=t[r];if(0===n)return!1;e+=n}if(e<7)return!1;var o=e/7,i=o/2;return Math.abs(o-t[0])<i&&Math.abs(o-t[1])<i&&Math.abs(3*o-t[2])<3*i&&Math.abs(o-t[3])<i&&Math.abs(o-t[4])<i},t.prototype.getCrossCheckStateCount=function(){var t=this.crossCheckStateCount;return t[0]=0,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t},t.prototype.crossCheckDiagonal=function(e,r,n,o){for(var i=this.getCrossCheckStateCount(),a=0,s=this.image;e>=a&&r>=a&&s.get(r-a,e-a);)i[2]++,a++;if(e<a||r<a)return!1;for(;e>=a&&r>=a&&!s.get(r-a,e-a)&&i[1]<=n;)i[1]++,a++;if(e<a||r<a||i[1]>n)return!1;for(;e>=a&&r>=a&&s.get(r-a,e-a)&&i[0]<=n;)i[0]++,a++;if(i[0]>n)return!1;var u=s.getHeight(),l=s.getWidth();for(a=1;e+a<u&&r+a<l&&s.get(r+a,e+a);)i[2]++,a++;if(e+a>=u||r+a>=l)return!1;for(;e+a<u&&r+a<l&&!s.get(r+a,e+a)&&i[3]<n;)i[3]++,a++;if(e+a>=u||r+a>=l||i[3]>=n)return!1;for(;e+a<u&&r+a<l&&s.get(r+a,e+a)&&i[4]<n;)i[4]++,a++;if(i[4]>=n)return!1;var c=i[0]+i[1]+i[2]+i[3]+i[4];return Math.abs(c-o)<2*o&&t.foundPatternCross(i)},t.prototype.crossCheckVertical=function(e,r,n,o){for(var i=this.image,a=i.getHeight(),s=this.getCrossCheckStateCount(),u=e;u>=0&&i.get(r,u);)s[2]++,u--;if(u<0)return NaN;for(;u>=0&&!i.get(r,u)&&s[1]<=n;)s[1]++,u--;if(u<0||s[1]>n)return NaN;for(;u>=0&&i.get(r,u)&&s[0]<=n;)s[0]++,u--;if(s[0]>n)return NaN;for(u=e+1;u<a&&i.get(r,u);)s[2]++,u++;if(u===a)return NaN;for(;u<a&&!i.get(r,u)&&s[3]<n;)s[3]++,u++;if(u===a||s[3]>=n)return NaN;for(;u<a&&i.get(r,u)&&s[4]<n;)s[4]++,u++;if(s[4]>=n)return NaN;var l=s[0]+s[1]+s[2]+s[3]+s[4];return 5*Math.abs(l-o)>=2*o?NaN:t.foundPatternCross(s)?t.centerFromEnd(s,u):NaN},t.prototype.crossCheckHorizontal=function(e,r,n,o){for(var i=this.image,a=i.getWidth(),s=this.getCrossCheckStateCount(),u=e;u>=0&&i.get(u,r);)s[2]++,u--;if(u<0)return NaN;for(;u>=0&&!i.get(u,r)&&s[1]<=n;)s[1]++,u--;if(u<0||s[1]>n)return NaN;for(;u>=0&&i.get(u,r)&&s[0]<=n;)s[0]++,u--;if(s[0]>n)return NaN;for(u=e+1;u<a&&i.get(u,r);)s[2]++,u++;if(u===a)return NaN;for(;u<a&&!i.get(u,r)&&s[3]<n;)s[3]++,u++;if(u===a||s[3]>=n)return NaN;for(;u<a&&i.get(u,r)&&s[4]<n;)s[4]++,u++;if(s[4]>=n)return NaN;var l=s[0]+s[1]+s[2]+s[3]+s[4];return 5*Math.abs(l-o)>=o?NaN:t.foundPatternCross(s)?t.centerFromEnd(s,u):NaN},t.prototype.handlePossibleCenter=function(e,r,n,o){var i=e[0]+e[1]+e[2]+e[3]+e[4],a=t.centerFromEnd(e,n),s=this.crossCheckVertical(r,Math.floor(a),e[2],i);if(!isNaN(s)&&(a=this.crossCheckHorizontal(Math.floor(a),Math.floor(s),e[2],i),!isNaN(a)&&(!o||this.crossCheckDiagonal(Math.floor(s),Math.floor(a),e[2],i)))){for(var u=i/7,l=!1,c=this.possibleCenters,h=0,f=c.length;h<f;h++){var d=c[h];if(d.aboutEquals(u,s,a)){c[h]=d.combineEstimate(s,a,u),l=!0;break}}if(!l){var p=new na(a,s,u);c.push(p),null!==this.resultPointCallback&&void 0!==this.resultPointCallback&&this.resultPointCallback.foundPossibleResultPoint(p)}return!0}return!1},t.prototype.findRowSkip=function(){var e,r;if(this.possibleCenters.length<=1)return 0;var n=null;try{for(var o=ia(this.possibleCenters),i=o.next();!i.done;i=o.next()){var a=i.value;if(a.getCount()>=t.CENTER_QUORUM){if(null!=n)return this.hasSkipped=!0,Math.floor((Math.abs(n.getX()-a.getX())-Math.abs(n.getY()-a.getY()))/2);n=a}}}catch(s){e={error:s}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(e)throw e.error}}return 0},t.prototype.haveMultiplyConfirmedCenters=function(){var e,r,n,o,i=0,a=0,s=this.possibleCenters.length;try{for(var u=ia(this.possibleCenters),l=u.next();!l.done;l=u.next())(p=l.value).getCount()>=t.CENTER_QUORUM&&(i++,a+=p.getEstimatedModuleSize())}catch(g){e={error:g}}finally{try{l&&!l.done&&(r=u.return)&&r.call(u)}finally{if(e)throw e.error}}if(i<3)return!1;var c=a/s,h=0;try{for(var f=ia(this.possibleCenters),d=f.next();!d.done;d=f.next()){var p=d.value;h+=Math.abs(p.getEstimatedModuleSize()-c)}}catch(g){n={error:g}}finally{try{d&&!d.done&&(o=f.return)&&o.call(f)}finally{if(n)throw n.error}}return h<=.05*a},t.prototype.selectBestPatterns=function(){var t,e,r,n,o=this.possibleCenters.length;if(o<3)throw new Kr;var i,a=this.possibleCenters;if(o>3){var s=0,u=0;try{for(var l=ia(this.possibleCenters),c=l.next();!c.done;c=l.next()){var h=c.value.getEstimatedModuleSize();s+=h,u+=h*h}}catch(y){t={error:y}}finally{try{c&&!c.done&&(e=l.return)&&e.call(l)}finally{if(t)throw t.error}}i=s/o;var f=Math.sqrt(u/o-i*i);a.sort(function(t,e){var r=Math.abs(e.getEstimatedModuleSize()-i),n=Math.abs(t.getEstimatedModuleSize()-i);return r<n?-1:r>n?1:0});for(var d=Math.max(.2*i,f),p=0;p<a.length&&a.length>3;p++){var g=a[p];Math.abs(g.getEstimatedModuleSize()-i)>d&&(a.splice(p,1),p--)}}if(a.length>3){s=0;try{for(var m=ia(a),v=m.next();!v.done;v=m.next())s+=v.value.getEstimatedModuleSize()}catch(_){r={error:_}}finally{try{v&&!v.done&&(n=m.return)&&n.call(m)}finally{if(r)throw r.error}}i=s/a.length,a.sort(function(t,e){if(e.getCount()===t.getCount()){var r=Math.abs(e.getEstimatedModuleSize()-i),n=Math.abs(t.getEstimatedModuleSize()-i);return r<n?1:r>n?-1:0}return e.getCount()-t.getCount()}),a.splice(3)}return[a[0],a[1],a[2]]},t.CENTER_QUORUM=2,t.MIN_SKIP=3,t.MAX_MODULES=57,t}(),sa=function(){function t(t){this.image=t}return t.prototype.getImage=function(){return this.image},t.prototype.getResultPointCallback=function(){return this.resultPointCallback},t.prototype.detect=function(t){this.resultPointCallback=null==t?null:t.get(Fr.NEED_RESULT_POINT_CALLBACK);var e=new aa(this.image,this.resultPointCallback).find(t);return this.processFinderPatternInfo(e)},t.prototype.processFinderPatternInfo=function(e){var r=e.getTopLeft(),n=e.getTopRight(),o=e.getBottomLeft(),i=this.calculateModuleSize(r,n,o);if(i<1)throw new Kr("No pattern found in proccess finder.");var a=t.computeDimension(r,n,o,i),s=Vi.getProvisionalVersionForDimension(a),u=s.getDimensionForVersion()-7,l=null;if(s.getAlignmentPatternCenters().length>0)for(var c=n.getX()-r.getX()+o.getX(),h=n.getY()-r.getY()+o.getY(),f=1-3/u,d=Math.floor(r.getX()+f*(c-r.getX())),p=Math.floor(r.getY()+f*(h-r.getY())),g=4;g<=16;g<<=1)try{l=this.findAlignmentInRegion(i,d,p,g);break}catch(y){if(!(y instanceof Kr))throw y}var m=t.createTransform(r,n,o,l,a),v=t.sampleGrid(this.image,m,a);return new Rn(v,null===l?[o,r,n]:[o,r,n,l])},t.createTransform=function(t,e,r,n,o){var i,a,s,u,l=o-3.5;return null!==n?(i=n.getX(),a=n.getY(),u=s=l-3):(i=e.getX()-t.getX()+r.getX(),a=e.getY()-t.getY()+r.getY(),s=l,u=l),Ln.quadrilateralToQuadrilateral(3.5,3.5,l,3.5,s,u,3.5,l,t.getX(),t.getY(),e.getX(),e.getY(),i,a,r.getX(),r.getY())},t.sampleGrid=function(t,e,r){return Vn.getInstance().sampleGridWithTransform(t,r,r,e)},t.computeDimension=function(t,e,r,n){var o=Tn.round(kn.distance(t,e)/n),i=Tn.round(kn.distance(t,r)/n),a=Math.floor((o+i)/2)+7;switch(3&a){case 0:a++;break;case 2:a--;break;case 3:throw new Kr("Dimensions could be not found.")}return a},t.prototype.calculateModuleSize=function(t,e,r){return(this.calculateModuleSizeOneWay(t,e)+this.calculateModuleSizeOneWay(t,r))/2},t.prototype.calculateModuleSizeOneWay=function(t,e){var r=this.sizeOfBlackWhiteBlackRunBothWays(Math.floor(t.getX()),Math.floor(t.getY()),Math.floor(e.getX()),Math.floor(e.getY())),n=this.sizeOfBlackWhiteBlackRunBothWays(Math.floor(e.getX()),Math.floor(e.getY()),Math.floor(t.getX()),Math.floor(t.getY()));return isNaN(r)?n/7:isNaN(n)?r/7:(r+n)/14},t.prototype.sizeOfBlackWhiteBlackRunBothWays=function(t,e,r,n){var o=this.sizeOfBlackWhiteBlackRun(t,e,r,n),i=1,a=t-(r-t);a<0?(i=t/(t-a),a=0):a>=this.image.getWidth()&&(i=(this.image.getWidth()-1-t)/(a-t),a=this.image.getWidth()-1);var s=Math.floor(e-(n-e)*i);return i=1,s<0?(i=e/(e-s),s=0):s>=this.image.getHeight()&&(i=(this.image.getHeight()-1-e)/(s-e),s=this.image.getHeight()-1),a=Math.floor(t+(a-t)*i),(o+=this.sizeOfBlackWhiteBlackRun(t,e,a,s))-1},t.prototype.sizeOfBlackWhiteBlackRun=function(t,e,r,n){var o=Math.abs(n-e)>Math.abs(r-t);if(o){var i=t;t=e,e=i,i=r,r=n,n=i}for(var a=Math.abs(r-t),s=Math.abs(n-e),u=-a/2,l=t<r?1:-1,c=e<n?1:-1,h=0,f=r+l,d=t,p=e;d!==f;d+=l){var g=o?p:d,m=o?d:p;if(1===h===this.image.get(g,m)){if(2===h)return Tn.distance(d,p,t,e);h++}if((u+=s)>0){if(p===n)break;p+=c,u-=a}}return 2===h?Tn.distance(r+l,n,t,e):NaN},t.prototype.findAlignmentInRegion=function(t,e,r,n){var o=Math.floor(n*t),i=Math.max(0,e-o),a=Math.min(this.image.getWidth()-1,e+o);if(a-i<3*t)throw new Kr("Alignment top exceeds estimated module size.");var s=Math.max(0,r-o),u=Math.min(this.image.getHeight()-1,r+o);if(u-s<3*t)throw new Kr("Alignment bottom exceeds estimated module size.");return new ea(this.image,i,s,a-i,u-s,t,this.resultPointCallback).find()},t}(),ua=function(){function t(){this.decoder=new Qi}return t.prototype.getDecoder=function(){return this.decoder},t.prototype.decode=function(e,r){var n,o;if(null!=r&&void 0!==r.get(Fr.PURE_BARCODE)){var i=t.extractPureBits(e.getBlackMatrix());n=this.decoder.decodeBitMatrix(i,r),o=t.NO_POINTS}else{var a=new sa(e.getBlackMatrix()).detect(r);n=this.decoder.decodeBitMatrix(a.getBits(),r),o=a.getPoints()}n.getOther()instanceof Ki&&n.getOther().applyMirroredCorrection(o);var s=new hn(n.getText(),n.getRawBytes(),void 0,o,dn.QR_CODE,void 0),u=n.getByteSegments();null!==u&&s.putMetadata(gn.BYTE_SEGMENTS,u);var l=n.getECLevel();return null!==l&&s.putMetadata(gn.ERROR_CORRECTION_LEVEL,l),n.hasStructuredAppend()&&(s.putMetadata(gn.STRUCTURED_APPEND_SEQUENCE,n.getStructuredAppendSequenceNumber()),s.putMetadata(gn.STRUCTURED_APPEND_PARITY,n.getStructuredAppendParity())),s},t.prototype.reset=function(){},t.extractPureBits=function(t){var e=t.getTopLeftOnBit(),r=t.getBottomRightOnBit();if(null===e||null===r)throw new Kr;var n=this.moduleSize(e,t),o=e[1],i=r[1],a=e[0],s=r[0];if(a>=s||o>=i)throw new Kr;if(i-o!=s-a&&(s=a+(i-o))>=t.getWidth())throw new Kr;var u=Math.round((s-a+1)/n),l=Math.round((i-o+1)/n);if(u<=0||l<=0)throw new Kr;if(l!==u)throw new Kr;var c=Math.floor(n/2);o+=c;var h=(a+=c)+Math.floor((u-1)*n)-s;if(h>0){if(h>c)throw new Kr;a-=h}var f=o+Math.floor((l-1)*n)-i;if(f>0){if(f>c)throw new Kr;o-=f}for(var d=new Yr(u,l),p=0;p<l;p++)for(var g=o+Math.floor(p*n),m=0;m<u;m++)t.get(a+Math.floor(m*n),g)&&d.set(m,p);return d},t.moduleSize=function(t,e){for(var r=e.getHeight(),n=e.getWidth(),o=t[0],i=t[1],a=!0,s=0;o<n&&i<r;){if(a!==e.get(o,i)){if(5==++s)break;a=!a}o++,i++}if(o===n||i===r)throw new Kr;return(o-t[0])/7},t.NO_POINTS=new Array,t}(),la=function(){function t(){}return t.prototype.PDF417Common=function(){},t.getBitCountSum=function(t){return Tn.sum(t)},t.toIntArray=function(e){var r,n;if(null==e||!e.length)return t.EMPTY_INT_ARRAY;var o=new Int32Array(e.length),i=0;try{for(var a=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}(e),s=a.next();!s.done;s=a.next()){var u=s.value;o[i++]=u}}catch(l){r={error:l}}finally{try{s&&!s.done&&(n=a.return)&&n.call(a)}finally{if(r)throw r.error}}return o},t.getCodeword=function(e){var r=Pr.binarySearch(t.SYMBOL_TABLE,262143&e);return r<0?-1:(t.CODEWORD_TABLE[r]-1)%t.NUMBER_OF_CODEWORDS},t.NUMBER_OF_CODEWORDS=929,t.MAX_CODEWORDS_IN_BARCODE=t.NUMBER_OF_CODEWORDS-1,t.MIN_ROWS_IN_BARCODE=3,t.MAX_ROWS_IN_BARCODE=90,t.MODULES_IN_CODEWORD=17,t.MODULES_IN_STOP_PATTERN=18,t.BARS_IN_MODULE=8,t.EMPTY_INT_ARRAY=new Int32Array([]),t.SYMBOL_TABLE=Int32Array.from([66142,66170,66206,66236,66290,66292,66350,66382,66396,66454,66470,66476,66594,66600,66614,66626,66628,66632,66640,66654,66662,66668,66682,66690,66718,66720,66748,66758,66776,66798,66802,66804,66820,66824,66832,66846,66848,66876,66880,66936,66950,66956,66968,66992,67006,67022,67036,67042,67044,67048,67062,67118,67150,67164,67214,67228,67256,67294,67322,67350,67366,67372,67398,67404,67416,67438,67474,67476,67490,67492,67496,67510,67618,67624,67650,67656,67664,67678,67686,67692,67706,67714,67716,67728,67742,67744,67772,67782,67788,67800,67822,67826,67828,67842,67848,67870,67872,67900,67904,67960,67974,67992,68016,68030,68046,68060,68066,68068,68072,68086,68104,68112,68126,68128,68156,68160,68216,68336,68358,68364,68376,68400,68414,68448,68476,68494,68508,68536,68546,68548,68552,68560,68574,68582,68588,68654,68686,68700,68706,68708,68712,68726,68750,68764,68792,68802,68804,68808,68816,68830,68838,68844,68858,68878,68892,68920,68976,68990,68994,68996,69e3,69008,69022,69024,69052,69062,69068,69080,69102,69106,69108,69142,69158,69164,69190,69208,69230,69254,69260,69272,69296,69310,69326,69340,69386,69394,69396,69410,69416,69430,69442,69444,69448,69456,69470,69478,69484,69554,69556,69666,69672,69698,69704,69712,69726,69754,69762,69764,69776,69790,69792,69820,69830,69836,69848,69870,69874,69876,69890,69918,69920,69948,69952,70008,70022,70040,70064,70078,70094,70108,70114,70116,70120,70134,70152,70174,70176,70264,70384,70412,70448,70462,70496,70524,70542,70556,70584,70594,70600,70608,70622,70630,70636,70664,70672,70686,70688,70716,70720,70776,70896,71136,71180,71192,71216,71230,71264,71292,71360,71416,71452,71480,71536,71550,71554,71556,71560,71568,71582,71584,71612,71622,71628,71640,71662,71726,71732,71758,71772,71778,71780,71784,71798,71822,71836,71864,71874,71880,71888,71902,71910,71916,71930,71950,71964,71992,72048,72062,72066,72068,72080,72094,72096,72124,72134,72140,72152,72174,72178,72180,72206,72220,72248,72304,72318,72416,72444,72456,72464,72478,72480,72508,72512,72568,72588,72600,72624,72638,72654,72668,72674,72676,72680,72694,72726,72742,72748,72774,72780,72792,72814,72838,72856,72880,72894,72910,72924,72930,72932,72936,72950,72966,72972,72984,73008,73022,73056,73084,73102,73116,73144,73156,73160,73168,73182,73190,73196,73210,73226,73234,73236,73250,73252,73256,73270,73282,73284,73296,73310,73318,73324,73346,73348,73352,73360,73374,73376,73404,73414,73420,73432,73454,73498,73518,73522,73524,73550,73564,73570,73572,73576,73590,73800,73822,73858,73860,73872,73886,73888,73916,73944,73970,73972,73992,74014,74016,74044,74048,74104,74118,74136,74160,74174,74210,74212,74216,74230,74244,74256,74270,74272,74360,74480,74502,74508,74544,74558,74592,74620,74638,74652,74680,74690,74696,74704,74726,74732,74782,74784,74812,74992,75232,75288,75326,75360,75388,75456,75512,75576,75632,75646,75650,75652,75664,75678,75680,75708,75718,75724,75736,75758,75808,75836,75840,75896,76016,76256,76736,76824,76848,76862,76896,76924,76992,77048,77296,77340,77368,77424,77438,77536,77564,77572,77576,77584,77600,77628,77632,77688,77702,77708,77720,77744,77758,77774,77788,77870,77902,77916,77922,77928,77966,77980,78008,78018,78024,78032,78046,78060,78074,78094,78136,78192,78206,78210,78212,78224,78238,78240,78268,78278,78284,78296,78322,78324,78350,78364,78448,78462,78560,78588,78600,78622,78624,78652,78656,78712,78726,78744,78768,78782,78798,78812,78818,78820,78824,78838,78862,78876,78904,78960,78974,79072,79100,79296,79352,79368,79376,79390,79392,79420,79424,79480,79600,79628,79640,79664,79678,79712,79740,79772,79800,79810,79812,79816,79824,79838,79846,79852,79894,79910,79916,79942,79948,79960,79982,79988,80006,80024,80048,80062,80078,80092,80098,80100,80104,80134,80140,80176,80190,80224,80252,80270,80284,80312,80328,80336,80350,80358,80364,80378,80390,80396,80408,80432,80446,80480,80508,80576,80632,80654,80668,80696,80752,80766,80776,80784,80798,80800,80828,80844,80856,80878,80882,80884,80914,80916,80930,80932,80936,80950,80962,80968,80976,80990,80998,81004,81026,81028,81040,81054,81056,81084,81094,81100,81112,81134,81154,81156,81160,81168,81182,81184,81212,81216,81272,81286,81292,81304,81328,81342,81358,81372,81380,81384,81398,81434,81454,81458,81460,81486,81500,81506,81508,81512,81526,81550,81564,81592,81602,81604,81608,81616,81630,81638,81644,81702,81708,81722,81734,81740,81752,81774,81778,81780,82050,82078,82080,82108,82180,82184,82192,82206,82208,82236,82240,82296,82316,82328,82352,82366,82402,82404,82408,82440,82448,82462,82464,82492,82496,82552,82672,82694,82700,82712,82736,82750,82784,82812,82830,82882,82884,82888,82896,82918,82924,82952,82960,82974,82976,83004,83008,83064,83184,83424,83468,83480,83504,83518,83552,83580,83648,83704,83740,83768,83824,83838,83842,83844,83848,83856,83872,83900,83910,83916,83928,83950,83984,84e3,84028,84032,84088,84208,84448,84928,85040,85054,85088,85116,85184,85240,85488,85560,85616,85630,85728,85756,85764,85768,85776,85790,85792,85820,85824,85880,85894,85900,85912,85936,85966,85980,86048,86080,86136,86256,86496,86976,88160,88188,88256,88312,88560,89056,89200,89214,89312,89340,89536,89592,89608,89616,89632,89664,89720,89840,89868,89880,89904,89952,89980,89998,90012,90040,90190,90204,90254,90268,90296,90306,90308,90312,90334,90382,90396,90424,90480,90494,90500,90504,90512,90526,90528,90556,90566,90572,90584,90610,90612,90638,90652,90680,90736,90750,90848,90876,90884,90888,90896,90910,90912,90940,90944,91e3,91014,91020,91032,91056,91070,91086,91100,91106,91108,91112,91126,91150,91164,91192,91248,91262,91360,91388,91584,91640,91664,91678,91680,91708,91712,91768,91888,91928,91952,91966,92e3,92028,92046,92060,92088,92098,92100,92104,92112,92126,92134,92140,92188,92216,92272,92384,92412,92608,92664,93168,93200,93214,93216,93244,93248,93304,93424,93664,93720,93744,93758,93792,93820,93888,93944,93980,94008,94064,94078,94084,94088,94096,94110,94112,94140,94150,94156,94168,94246,94252,94278,94284,94296,94318,94342,94348,94360,94384,94398,94414,94428,94440,94470,94476,94488,94512,94526,94560,94588,94606,94620,94648,94658,94660,94664,94672,94686,94694,94700,94714,94726,94732,94744,94768,94782,94816,94844,94912,94968,94990,95004,95032,95088,95102,95112,95120,95134,95136,95164,95180,95192,95214,95218,95220,95244,95256,95280,95294,95328,95356,95424,95480,95728,95758,95772,95800,95856,95870,95968,95996,96008,96016,96030,96032,96060,96064,96120,96152,96176,96190,96220,96226,96228,96232,96290,96292,96296,96310,96322,96324,96328,96336,96350,96358,96364,96386,96388,96392,96400,96414,96416,96444,96454,96460,96472,96494,96498,96500,96514,96516,96520,96528,96542,96544,96572,96576,96632,96646,96652,96664,96688,96702,96718,96732,96738,96740,96744,96758,96772,96776,96784,96798,96800,96828,96832,96888,97008,97030,97036,97048,97072,97086,97120,97148,97166,97180,97208,97220,97224,97232,97246,97254,97260,97326,97330,97332,97358,97372,97378,97380,97384,97398,97422,97436,97464,97474,97476,97480,97488,97502,97510,97516,97550,97564,97592,97648,97666,97668,97672,97680,97694,97696,97724,97734,97740,97752,97774,97830,97836,97850,97862,97868,97880,97902,97906,97908,97926,97932,97944,97968,97998,98012,98018,98020,98024,98038,98618,98674,98676,98838,98854,98874,98892,98904,98926,98930,98932,98968,99006,99042,99044,99048,99062,99166,99194,99246,99286,99350,99366,99372,99386,99398,99416,99438,99442,99444,99462,99504,99518,99534,99548,99554,99556,99560,99574,99590,99596,99608,99632,99646,99680,99708,99726,99740,99768,99778,99780,99784,99792,99806,99814,99820,99834,99858,99860,99874,99880,99894,99906,99920,99934,99962,99970,99972,99976,99984,99998,1e5,100028,100038,100044,100056,100078,100082,100084,100142,100174,100188,100246,100262,100268,100306,100308,100390,100396,100410,100422,100428,100440,100462,100466,100468,100486,100504,100528,100542,100558,100572,100578,100580,100584,100598,100620,100656,100670,100704,100732,100750,100792,100802,100808,100816,100830,100838,100844,100858,100888,100912,100926,100960,100988,101056,101112,101148,101176,101232,101246,101250,101252,101256,101264,101278,101280,101308,101318,101324,101336,101358,101362,101364,101410,101412,101416,101430,101442,101448,101456,101470,101478,101498,101506,101508,101520,101534,101536,101564,101580,101618,101620,101636,101640,101648,101662,101664,101692,101696,101752,101766,101784,101838,101858,101860,101864,101934,101938,101940,101966,101980,101986,101988,101992,102030,102044,102072,102082,102084,102088,102096,102138,102166,102182,102188,102214,102220,102232,102254,102282,102290,102292,102306,102308,102312,102326,102444,102458,102470,102476,102488,102514,102516,102534,102552,102576,102590,102606,102620,102626,102632,102646,102662,102668,102704,102718,102752,102780,102798,102812,102840,102850,102856,102864,102878,102886,102892,102906,102936,102974,103008,103036,103104,103160,103224,103280,103294,103298,103300,103312,103326,103328,103356,103366,103372,103384,103406,103410,103412,103472,103486,103520,103548,103616,103672,103920,103992,104048,104062,104160,104188,104194,104196,104200,104208,104224,104252,104256,104312,104326,104332,104344,104368,104382,104398,104412,104418,104420,104424,104482,104484,104514,104520,104528,104542,104550,104570,104578,104580,104592,104606,104608,104636,104652,104690,104692,104706,104712,104734,104736,104764,104768,104824,104838,104856,104910,104930,104932,104936,104968,104976,104990,104992,105020,105024,105080,105200,105240,105278,105312,105372,105410,105412,105416,105424,105446,105518,105524,105550,105564,105570,105572,105576,105614,105628,105656,105666,105672,105680,105702,105722,105742,105756,105784,105840,105854,105858,105860,105864,105872,105888,105932,105970,105972,106006,106022,106028,106054,106060,106072,106100,106118,106124,106136,106160,106174,106190,106210,106212,106216,106250,106258,106260,106274,106276,106280,106306,106308,106312,106320,106334,106348,106394,106414,106418,106420,106566,106572,106610,106612,106630,106636,106648,106672,106686,106722,106724,106728,106742,106758,106764,106776,106800,106814,106848,106876,106894,106908,106936,106946,106948,106952,106960,106974,106982,106988,107032,107056,107070,107104,107132,107200,107256,107292,107320,107376,107390,107394,107396,107400,107408,107422,107424,107452,107462,107468,107480,107502,107506,107508,107544,107568,107582,107616,107644,107712,107768,108016,108060,108088,108144,108158,108256,108284,108290,108292,108296,108304,108318,108320,108348,108352,108408,108422,108428,108440,108464,108478,108494,108508,108514,108516,108520,108592,108640,108668,108736,108792,109040,109536,109680,109694,109792,109820,110016,110072,110084,110088,110096,110112,110140,110144,110200,110320,110342,110348,110360,110384,110398,110432,110460,110478,110492,110520,110532,110536,110544,110558,110658,110686,110714,110722,110724,110728,110736,110750,110752,110780,110796,110834,110836,110850,110852,110856,110864,110878,110880,110908,110912,110968,110982,111e3,111054,111074,111076,111080,111108,111112,111120,111134,111136,111164,111168,111224,111344,111372,111422,111456,111516,111554,111556,111560,111568,111590,111632,111646,111648,111676,111680,111736,111856,112096,112152,112224,112252,112320,112440,112514,112516,112520,112528,112542,112544,112588,112686,112718,112732,112782,112796,112824,112834,112836,112840,112848,112870,112890,112910,112924,112952,113008,113022,113026,113028,113032,113040,113054,113056,113100,113138,113140,113166,113180,113208,113264,113278,113376,113404,113416,113424,113440,113468,113472,113560,113614,113634,113636,113640,113686,113702,113708,113734,113740,113752,113778,113780,113798,113804,113816,113840,113854,113870,113890,113892,113896,113926,113932,113944,113968,113982,114016,114044,114076,114114,114116,114120,114128,114150,114170,114194,114196,114210,114212,114216,114242,114244,114248,114256,114270,114278,114306,114308,114312,114320,114334,114336,114364,114380,114420,114458,114478,114482,114484,114510,114524,114530,114532,114536,114842,114866,114868,114970,114994,114996,115042,115044,115048,115062,115130,115226,115250,115252,115278,115292,115298,115300,115304,115318,115342,115394,115396,115400,115408,115422,115430,115436,115450,115478,115494,115514,115526,115532,115570,115572,115738,115758,115762,115764,115790,115804,115810,115812,115816,115830,115854,115868,115896,115906,115912,115920,115934,115942,115948,115962,115996,116024,116080,116094,116098,116100,116104,116112,116126,116128,116156,116166,116172,116184,116206,116210,116212,116246,116262,116268,116282,116294,116300,116312,116334,116338,116340,116358,116364,116376,116400,116414,116430,116444,116450,116452,116456,116498,116500,116514,116520,116534,116546,116548,116552,116560,116574,116582,116588,116602,116654,116694,116714,116762,116782,116786,116788,116814,116828,116834,116836,116840,116854,116878,116892,116920,116930,116936,116944,116958,116966,116972,116986,117006,117048,117104,117118,117122,117124,117136,117150,117152,117180,117190,117196,117208,117230,117234,117236,117304,117360,117374,117472,117500,117506,117508,117512,117520,117536,117564,117568,117624,117638,117644,117656,117680,117694,117710,117724,117730,117732,117736,117750,117782,117798,117804,117818,117830,117848,117874,117876,117894,117936,117950,117966,117986,117988,117992,118022,118028,118040,118064,118078,118112,118140,118172,118210,118212,118216,118224,118238,118246,118266,118306,118312,118338,118352,118366,118374,118394,118402,118404,118408,118416,118430,118432,118460,118476,118514,118516,118574,118578,118580,118606,118620,118626,118628,118632,118678,118694,118700,118730,118738,118740,118830,118834,118836,118862,118876,118882,118884,118888,118902,118926,118940,118968,118978,118980,118984,118992,119006,119014,119020,119034,119068,119096,119152,119166,119170,119172,119176,119184,119198,119200,119228,119238,119244,119256,119278,119282,119284,119324,119352,119408,119422,119520,119548,119554,119556,119560,119568,119582,119584,119612,119616,119672,119686,119692,119704,119728,119742,119758,119772,119778,119780,119784,119798,119920,119934,120032,120060,120256,120312,120324,120328,120336,120352,120384,120440,120560,120582,120588,120600,120624,120638,120672,120700,120718,120732,120760,120770,120772,120776,120784,120798,120806,120812,120870,120876,120890,120902,120908,120920,120946,120948,120966,120972,120984,121008,121022,121038,121058,121060,121064,121078,121100,121112,121136,121150,121184,121212,121244,121282,121284,121288,121296,121318,121338,121356,121368,121392,121406,121440,121468,121536,121592,121656,121730,121732,121736,121744,121758,121760,121804,121842,121844,121890,121922,121924,121928,121936,121950,121958,121978,121986,121988,121992,122e3,122014,122016,122044,122060,122098,122100,122116,122120,122128,122142,122144,122172,122176,122232,122246,122264,122318,122338,122340,122344,122414,122418,122420,122446,122460,122466,122468,122472,122510,122524,122552,122562,122564,122568,122576,122598,122618,122646,122662,122668,122694,122700,122712,122738,122740,122762,122770,122772,122786,122788,122792,123018,123026,123028,123042,123044,123048,123062,123098,123146,123154,123156,123170,123172,123176,123190,123202,123204,123208,123216,123238,123244,123258,123290,123314,123316,123402,123410,123412,123426,123428,123432,123446,123458,123464,123472,123486,123494,123500,123514,123522,123524,123528,123536,123552,123580,123590,123596,123608,123630,123634,123636,123674,123698,123700,123740,123746,123748,123752,123834,123914,123922,123924,123938,123944,123958,123970,123976,123984,123998,124006,124012,124026,124034,124036,124048,124062,124064,124092,124102,124108,124120,124142,124146,124148,124162,124164,124168,124176,124190,124192,124220,124224,124280,124294,124300,124312,124336,124350,124366,124380,124386,124388,124392,124406,124442,124462,124466,124468,124494,124508,124514,124520,124558,124572,124600,124610,124612,124616,124624,124646,124666,124694,124710,124716,124730,124742,124748,124760,124786,124788,124818,124820,124834,124836,124840,124854,124946,124948,124962,124964,124968,124982,124994,124996,125e3,125008,125022,125030,125036,125050,125058,125060,125064,125072,125086,125088,125116,125126,125132,125144,125166,125170,125172,125186,125188,125192,125200,125216,125244,125248,125304,125318,125324,125336,125360,125374,125390,125404,125410,125412,125416,125430,125444,125448,125456,125472,125504,125560,125680,125702,125708,125720,125744,125758,125792,125820,125838,125852,125880,125890,125892,125896,125904,125918,125926,125932,125978,125998,126002,126004,126030,126044,126050,126052,126056,126094,126108,126136,126146,126148,126152,126160,126182,126202,126222,126236,126264,126320,126334,126338,126340,126344,126352,126366,126368,126412,126450,126452,126486,126502,126508,126522,126534,126540,126552,126574,126578,126580,126598,126604,126616,126640,126654,126670,126684,126690,126692,126696,126738,126754,126756,126760,126774,126786,126788,126792,126800,126814,126822,126828,126842,126894,126898,126900,126934,127126,127142,127148,127162,127178,127186,127188,127254,127270,127276,127290,127302,127308,127320,127342,127346,127348,127370,127378,127380,127394,127396,127400,127450,127510,127526,127532,127546,127558,127576,127598,127602,127604,127622,127628,127640,127664,127678,127694,127708,127714,127716,127720,127734,127754,127762,127764,127778,127784,127810,127812,127816,127824,127838,127846,127866,127898,127918,127922,127924,128022,128038,128044,128058,128070,128076,128088,128110,128114,128116,128134,128140,128152,128176,128190,128206,128220,128226,128228,128232,128246,128262,128268,128280,128304,128318,128352,128380,128398,128412,128440,128450,128452,128456,128464,128478,128486,128492,128506,128522,128530,128532,128546,128548,128552,128566,128578,128580,128584,128592,128606,128614,128634,128642,128644,128648,128656,128670,128672,128700,128716,128754,128756,128794,128814,128818,128820,128846,128860,128866,128868,128872,128886,128918,128934,128940,128954,128978,128980,129178,129198,129202,129204,129238,129258,129306,129326,129330,129332,129358,129372,129378,129380,129384,129398,129430,129446,129452,129466,129482,129490,129492,129562,129582,129586,129588,129614,129628,129634,129636,129640,129654,129678,129692,129720,129730,129732,129736,129744,129758,129766,129772,129814,129830,129836,129850,129862,129868,129880,129902,129906,129908,129930,129938,129940,129954,129956,129960,129974,130010]),t.CODEWORD_TABLE=Int32Array.from([2627,1819,2622,2621,1813,1812,2729,2724,2723,2779,2774,2773,902,896,908,868,865,861,859,2511,873,871,1780,835,2493,825,2491,842,837,844,1764,1762,811,810,809,2483,807,2482,806,2480,815,814,813,812,2484,817,816,1745,1744,1742,1746,2655,2637,2635,2626,2625,2623,2628,1820,2752,2739,2737,2728,2727,2725,2730,2785,2783,2778,2777,2775,2780,787,781,747,739,736,2413,754,752,1719,692,689,681,2371,678,2369,700,697,694,703,1688,1686,642,638,2343,631,2341,627,2338,651,646,643,2345,654,652,1652,1650,1647,1654,601,599,2322,596,2321,594,2319,2317,611,610,608,606,2324,603,2323,615,614,612,1617,1616,1614,1612,616,1619,1618,2575,2538,2536,905,901,898,909,2509,2507,2504,870,867,864,860,2512,875,872,1781,2490,2489,2487,2485,1748,836,834,832,830,2494,827,2492,843,841,839,845,1765,1763,2701,2676,2674,2653,2648,2656,2634,2633,2631,2629,1821,2638,2636,2770,2763,2761,2750,2745,2753,2736,2735,2733,2731,1848,2740,2738,2786,2784,591,588,576,569,566,2296,1590,537,534,526,2276,522,2274,545,542,539,548,1572,1570,481,2245,466,2242,462,2239,492,485,482,2249,496,494,1534,1531,1528,1538,413,2196,406,2191,2188,425,419,2202,415,2199,432,430,427,1472,1467,1464,433,1476,1474,368,367,2160,365,2159,362,2157,2155,2152,378,377,375,2166,372,2165,369,2162,383,381,379,2168,1419,1418,1416,1414,385,1411,384,1423,1422,1420,1424,2461,802,2441,2439,790,786,783,794,2409,2406,2403,750,742,738,2414,756,753,1720,2367,2365,2362,2359,1663,693,691,684,2373,680,2370,702,699,696,704,1690,1687,2337,2336,2334,2332,1624,2329,1622,640,637,2344,634,2342,630,2340,650,648,645,2346,655,653,1653,1651,1649,1655,2612,2597,2595,2571,2568,2565,2576,2534,2529,2526,1787,2540,2537,907,904,900,910,2503,2502,2500,2498,1768,2495,1767,2510,2508,2506,869,866,863,2513,876,874,1782,2720,2713,2711,2697,2694,2691,2702,2672,2670,2664,1828,2678,2675,2647,2646,2644,2642,1823,2639,1822,2654,2652,2650,2657,2771,1855,2765,2762,1850,1849,2751,2749,2747,2754,353,2148,344,342,336,2142,332,2140,345,1375,1373,306,2130,299,2128,295,2125,319,314,311,2132,1354,1352,1349,1356,262,257,2101,253,2096,2093,274,273,267,2107,263,2104,280,278,275,1316,1311,1308,1320,1318,2052,202,2050,2044,2040,219,2063,212,2060,208,2055,224,221,2066,1260,1258,1252,231,1248,229,1266,1264,1261,1268,155,1998,153,1996,1994,1991,1988,165,164,2007,162,2006,159,2003,2e3,172,171,169,2012,166,2010,1186,1184,1182,1179,175,1176,173,1192,1191,1189,1187,176,1194,1193,2313,2307,2305,592,589,2294,2292,2289,578,572,568,2297,580,1591,2272,2267,2264,1547,538,536,529,2278,525,2275,547,544,541,1574,1571,2237,2235,2229,1493,2225,1489,478,2247,470,2244,465,2241,493,488,484,2250,498,495,1536,1533,1530,1539,2187,2186,2184,2182,1432,2179,1430,2176,1427,414,412,2197,409,2195,405,2193,2190,426,424,421,2203,418,2201,431,429,1473,1471,1469,1466,434,1477,1475,2478,2472,2470,2459,2457,2454,2462,803,2437,2432,2429,1726,2443,2440,792,789,785,2401,2399,2393,1702,2389,1699,2411,2408,2405,745,741,2415,758,755,1721,2358,2357,2355,2353,1661,2350,1660,2347,1657,2368,2366,2364,2361,1666,690,687,2374,683,2372,701,698,705,1691,1689,2619,2617,2610,2608,2605,2613,2593,2588,2585,1803,2599,2596,2563,2561,2555,1797,2551,1795,2573,2570,2567,2577,2525,2524,2522,2520,1786,2517,1785,2514,1783,2535,2533,2531,2528,1788,2541,2539,906,903,911,2721,1844,2715,2712,1838,1836,2699,2696,2693,2703,1827,1826,1824,2673,2671,2669,2666,1829,2679,2677,1858,1857,2772,1854,1853,1851,1856,2766,2764,143,1987,139,1986,135,133,131,1984,128,1983,125,1981,138,137,136,1985,1133,1132,1130,112,110,1974,107,1973,104,1971,1969,122,121,119,117,1977,114,1976,124,1115,1114,1112,1110,1117,1116,84,83,1953,81,1952,78,1950,1948,1945,94,93,91,1959,88,1958,85,1955,99,97,95,1961,1086,1085,1083,1081,1078,100,1090,1089,1087,1091,49,47,1917,44,1915,1913,1910,1907,59,1926,56,1925,53,1922,1919,66,64,1931,61,1929,1042,1040,1038,71,1035,70,1032,68,1048,1047,1045,1043,1050,1049,12,10,1869,1867,1864,1861,21,1880,19,1877,1874,1871,28,1888,25,1886,22,1883,982,980,977,974,32,30,991,989,987,984,34,995,994,992,2151,2150,2147,2146,2144,356,355,354,2149,2139,2138,2136,2134,1359,343,341,338,2143,335,2141,348,347,346,1376,1374,2124,2123,2121,2119,1326,2116,1324,310,308,305,2131,302,2129,298,2127,320,318,316,313,2133,322,321,1355,1353,1351,1357,2092,2091,2089,2087,1276,2084,1274,2081,1271,259,2102,256,2100,252,2098,2095,272,269,2108,266,2106,281,279,277,1317,1315,1313,1310,282,1321,1319,2039,2037,2035,2032,1203,2029,1200,1197,207,2053,205,2051,201,2049,2046,2043,220,218,2064,215,2062,211,2059,228,226,223,2069,1259,1257,1254,232,1251,230,1267,1265,1263,2316,2315,2312,2311,2309,2314,2304,2303,2301,2299,1593,2308,2306,590,2288,2287,2285,2283,1578,2280,1577,2295,2293,2291,579,577,574,571,2298,582,581,1592,2263,2262,2260,2258,1545,2255,1544,2252,1541,2273,2271,2269,2266,1550,535,532,2279,528,2277,546,543,549,1575,1573,2224,2222,2220,1486,2217,1485,2214,1482,1479,2238,2236,2234,2231,1496,2228,1492,480,477,2248,473,2246,469,2243,490,487,2251,497,1537,1535,1532,2477,2476,2474,2479,2469,2468,2466,2464,1730,2473,2471,2453,2452,2450,2448,1729,2445,1728,2460,2458,2456,2463,805,804,2428,2427,2425,2423,1725,2420,1724,2417,1722,2438,2436,2434,2431,1727,2444,2442,793,791,788,795,2388,2386,2384,1697,2381,1696,2378,1694,1692,2402,2400,2398,2395,1703,2392,1701,2412,2410,2407,751,748,744,2416,759,757,1807,2620,2618,1806,1805,2611,2609,2607,2614,1802,1801,1799,2594,2592,2590,2587,1804,2600,2598,1794,1793,1791,1789,2564,2562,2560,2557,1798,2554,1796,2574,2572,2569,2578,1847,1846,2722,1843,1842,1840,1845,2716,2714,1835,1834,1832,1830,1839,1837,2700,2698,2695,2704,1817,1811,1810,897,862,1777,829,826,838,1760,1758,808,2481,1741,1740,1738,1743,2624,1818,2726,2776,782,740,737,1715,686,679,695,1682,1680,639,628,2339,647,644,1645,1643,1640,1648,602,600,597,595,2320,593,2318,609,607,604,1611,1610,1608,1606,613,1615,1613,2328,926,924,892,886,899,857,850,2505,1778,824,823,821,819,2488,818,2486,833,831,828,840,1761,1759,2649,2632,2630,2746,2734,2732,2782,2781,570,567,1587,531,527,523,540,1566,1564,476,467,463,2240,486,483,1524,1521,1518,1529,411,403,2192,399,2189,423,416,1462,1457,1454,428,1468,1465,2210,366,363,2158,360,2156,357,2153,376,373,370,2163,1410,1409,1407,1405,382,1402,380,1417,1415,1412,1421,2175,2174,777,774,771,784,732,725,722,2404,743,1716,676,674,668,2363,665,2360,685,1684,1681,626,624,622,2335,620,2333,617,2330,641,635,649,1646,1644,1642,2566,928,925,2530,2527,894,891,888,2501,2499,2496,858,856,854,851,1779,2692,2668,2665,2645,2643,2640,2651,2768,2759,2757,2744,2743,2741,2748,352,1382,340,337,333,1371,1369,307,300,296,2126,315,312,1347,1342,1350,261,258,250,2097,246,2094,271,268,264,1306,1301,1298,276,1312,1309,2115,203,2048,195,2045,191,2041,213,209,2056,1246,1244,1238,225,1234,222,1256,1253,1249,1262,2080,2079,154,1997,150,1995,147,1992,1989,163,160,2004,156,2001,1175,1174,1172,1170,1167,170,1164,167,1185,1183,1180,1177,174,1190,1188,2025,2024,2022,587,586,564,559,556,2290,573,1588,520,518,512,2268,508,2265,530,1568,1565,461,457,2233,450,2230,446,2226,479,471,489,1526,1523,1520,397,395,2185,392,2183,389,2180,2177,410,2194,402,422,1463,1461,1459,1456,1470,2455,799,2433,2430,779,776,773,2397,2394,2390,734,728,724,746,1717,2356,2354,2351,2348,1658,677,675,673,670,667,688,1685,1683,2606,2589,2586,2559,2556,2552,927,2523,2521,2518,2515,1784,2532,895,893,890,2718,2709,2707,2689,2687,2684,2663,2662,2660,2658,1825,2667,2769,1852,2760,2758,142,141,1139,1138,134,132,129,126,1982,1129,1128,1126,1131,113,111,108,105,1972,101,1970,120,118,115,1109,1108,1106,1104,123,1113,1111,82,79,1951,75,1949,72,1946,92,89,86,1956,1077,1076,1074,1072,98,1069,96,1084,1082,1079,1088,1968,1967,48,45,1916,42,1914,39,1911,1908,60,57,54,1923,50,1920,1031,1030,1028,1026,67,1023,65,1020,62,1041,1039,1036,1033,69,1046,1044,1944,1943,1941,11,9,1868,7,1865,1862,1859,20,1878,16,1875,13,1872,970,968,966,963,29,960,26,23,983,981,978,975,33,971,31,990,988,985,1906,1904,1902,993,351,2145,1383,331,330,328,326,2137,323,2135,339,1372,1370,294,293,291,289,2122,286,2120,283,2117,309,303,317,1348,1346,1344,245,244,242,2090,239,2088,236,2085,2082,260,2099,249,270,1307,1305,1303,1300,1314,189,2038,186,2036,183,2033,2030,2026,206,198,2047,194,216,1247,1245,1243,1240,227,1237,1255,2310,2302,2300,2286,2284,2281,565,563,561,558,575,1589,2261,2259,2256,2253,1542,521,519,517,514,2270,511,533,1569,1567,2223,2221,2218,2215,1483,2211,1480,459,456,453,2232,449,474,491,1527,1525,1522,2475,2467,2465,2451,2449,2446,801,800,2426,2424,2421,2418,1723,2435,780,778,775,2387,2385,2382,2379,1695,2375,1693,2396,735,733,730,727,749,1718,2616,2615,2604,2603,2601,2584,2583,2581,2579,1800,2591,2550,2549,2547,2545,1792,2542,1790,2558,929,2719,1841,2710,2708,1833,1831,2690,2688,2686,1815,1809,1808,1774,1756,1754,1737,1736,1734,1739,1816,1711,1676,1674,633,629,1638,1636,1633,1641,598,1605,1604,1602,1600,605,1609,1607,2327,887,853,1775,822,820,1757,1755,1584,524,1560,1558,468,464,1514,1511,1508,1519,408,404,400,1452,1447,1444,417,1458,1455,2208,364,361,358,2154,1401,1400,1398,1396,374,1393,371,1408,1406,1403,1413,2173,2172,772,726,723,1712,672,669,666,682,1678,1675,625,623,621,618,2331,636,632,1639,1637,1635,920,918,884,880,889,849,848,847,846,2497,855,852,1776,2641,2742,2787,1380,334,1367,1365,301,297,1340,1338,1335,1343,255,251,247,1296,1291,1288,265,1302,1299,2113,204,196,192,2042,1232,1230,1224,214,1220,210,1242,1239,1235,1250,2077,2075,151,148,1993,144,1990,1163,1162,1160,1158,1155,161,1152,157,1173,1171,1168,1165,168,1181,1178,2021,2020,2018,2023,585,560,557,1585,516,509,1562,1559,458,447,2227,472,1516,1513,1510,398,396,393,390,2181,386,2178,407,1453,1451,1449,1446,420,1460,2209,769,764,720,712,2391,729,1713,664,663,661,659,2352,656,2349,671,1679,1677,2553,922,919,2519,2516,885,883,881,2685,2661,2659,2767,2756,2755,140,1137,1136,130,127,1125,1124,1122,1127,109,106,102,1103,1102,1100,1098,116,1107,1105,1980,80,76,73,1947,1068,1067,1065,1063,90,1060,87,1075,1073,1070,1080,1966,1965,46,43,40,1912,36,1909,1019,1018,1016,1014,58,1011,55,1008,51,1029,1027,1024,1021,63,1037,1034,1940,1939,1937,1942,8,1866,4,1863,1,1860,956,954,952,949,946,17,14,969,967,964,961,27,957,24,979,976,972,1901,1900,1898,1896,986,1905,1903,350,349,1381,329,327,324,1368,1366,292,290,287,284,2118,304,1341,1339,1337,1345,243,240,237,2086,233,2083,254,1297,1295,1293,1290,1304,2114,190,187,184,2034,180,2031,177,2027,199,1233,1231,1229,1226,217,1223,1241,2078,2076,584,555,554,552,550,2282,562,1586,507,506,504,502,2257,499,2254,515,1563,1561,445,443,441,2219,438,2216,435,2212,460,454,475,1517,1515,1512,2447,798,797,2422,2419,770,768,766,2383,2380,2376,721,719,717,714,731,1714,2602,2582,2580,2548,2546,2543,923,921,2717,2706,2705,2683,2682,2680,1771,1752,1750,1733,1732,1731,1735,1814,1707,1670,1668,1631,1629,1626,1634,1599,1598,1596,1594,1603,1601,2326,1772,1753,1751,1581,1554,1552,1504,1501,1498,1509,1442,1437,1434,401,1448,1445,2206,1392,1391,1389,1387,1384,359,1399,1397,1394,1404,2171,2170,1708,1672,1669,619,1632,1630,1628,1773,1378,1363,1361,1333,1328,1336,1286,1281,1278,248,1292,1289,2111,1218,1216,1210,197,1206,193,1228,1225,1221,1236,2073,2071,1151,1150,1148,1146,152,1143,149,1140,145,1161,1159,1156,1153,158,1169,1166,2017,2016,2014,2019,1582,510,1556,1553,452,448,1506,1500,394,391,387,1443,1441,1439,1436,1450,2207,765,716,713,1709,662,660,657,1673,1671,916,914,879,878,877,882,1135,1134,1121,1120,1118,1123,1097,1096,1094,1092,103,1101,1099,1979,1059,1058,1056,1054,77,1051,74,1066,1064,1061,1071,1964,1963,1007,1006,1004,1002,999,41,996,37,1017,1015,1012,1009,52,1025,1022,1936,1935,1933,1938,942,940,938,935,932,5,2,955,953,950,947,18,943,15,965,962,958,1895,1894,1892,1890,973,1899,1897,1379,325,1364,1362,288,285,1334,1332,1330,241,238,234,1287,1285,1283,1280,1294,2112,188,185,181,178,2028,1219,1217,1215,1212,200,1209,1227,2074,2072,583,553,551,1583,505,503,500,513,1557,1555,444,442,439,436,2213,455,451,1507,1505,1502,796,763,762,760,767,711,710,708,706,2377,718,715,1710,2544,917,915,2681,1627,1597,1595,2325,1769,1749,1747,1499,1438,1435,2204,1390,1388,1385,1395,2169,2167,1704,1665,1662,1625,1623,1620,1770,1329,1282,1279,2109,1214,1207,1222,2068,2065,1149,1147,1144,1141,146,1157,1154,2013,2011,2008,2015,1579,1549,1546,1495,1487,1433,1431,1428,1425,388,1440,2205,1705,658,1667,1664,1119,1095,1093,1978,1057,1055,1052,1062,1962,1960,1005,1003,1e3,997,38,1013,1010,1932,1930,1927,1934,941,939,936,933,6,930,3,951,948,944,1889,1887,1884,1881,959,1893,1891,35,1377,1360,1358,1327,1325,1322,1331,1277,1275,1272,1269,235,1284,2110,1205,1204,1201,1198,182,1195,179,1213,2070,2067,1580,501,1551,1548,440,437,1497,1494,1490,1503,761,709,707,1706,913,912,2198,1386,2164,2161,1621,1766,2103,1208,2058,2054,1145,1142,2005,2002,1999,2009,1488,1429,1426,2200,1698,1659,1656,1975,1053,1957,1954,1001,998,1924,1921,1918,1928,937,934,931,1879,1876,1873,1870,945,1885,1882,1323,1273,1270,2105,1202,1199,1196,1211,2061,2057,1576,1543,1540,1484,1481,1478,1491,1700]),t}(),ca=function(){function t(t,e){this.bits=t,this.points=e}return t.prototype.getBits=function(){return this.bits},t.prototype.getPoints=function(){return this.points},t}(),ha=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},fa=function(){function t(){}return t.detectMultiple=function(e,r,n){var o=e.getBlackMatrix(),i=t.detect(n,o);return i.length||((o=o.clone()).rotate180(),i=t.detect(n,o)),new ca(o,i)},t.detect=function(e,r){for(var n,o,i=new Array,a=0,s=0,u=!1;a<r.getHeight();){var l=t.findVertices(r,a,s);if(null!=l[0]||null!=l[3]){if(u=!0,i.push(l),!e)break;null!=l[2]?(s=Math.trunc(l[2].getX()),a=Math.trunc(l[2].getY())):(s=Math.trunc(l[4].getX()),a=Math.trunc(l[4].getY()))}else{if(!u)break;u=!1,s=0;try{for(var c=(n=void 0,ha(i)),h=c.next();!h.done;h=c.next()){var f=h.value;null!=f[1]&&(a=Math.trunc(Math.max(a,f[1].getY()))),null!=f[3]&&(a=Math.max(a,Math.trunc(f[3].getY())))}}catch(d){n={error:d}}finally{try{h&&!h.done&&(o=c.return)&&o.call(c)}finally{if(n)throw n.error}}a+=t.ROW_STEP}}return i},t.findVertices=function(e,r,n){var o=e.getHeight(),i=e.getWidth(),a=new Array(8);return t.copyToResult(a,t.findRowsWithPattern(e,o,i,r,n,t.START_PATTERN),t.INDEXES_START_PATTERN),null!=a[4]&&(n=Math.trunc(a[4].getX()),r=Math.trunc(a[4].getY())),t.copyToResult(a,t.findRowsWithPattern(e,o,i,r,n,t.STOP_PATTERN),t.INDEXES_STOP_PATTERN),a},t.copyToResult=function(t,e,r){for(var n=0;n<r.length;n++)t[r[n]]=e[n]},t.findRowsWithPattern=function(e,r,n,o,i,a){for(var s=new Array(4),u=!1,l=new Int32Array(a.length);o<r;o+=t.ROW_STEP)if(null!=(d=t.findGuardPattern(e,i,o,n,!1,a,l))){for(;o>0;){if(null==(f=t.findGuardPattern(e,i,--o,n,!1,a,l))){o++;break}d=f}s[0]=new kn(d[0],o),s[1]=new kn(d[1],o),u=!0;break}var c=o+1;if(u){for(var h=0,f=Int32Array.from([Math.trunc(s[0].getX()),Math.trunc(s[1].getX())]);c<r;c++){var d;if(null!=(d=t.findGuardPattern(e,f[0],c,n,!1,a,l))&&Math.abs(f[0]-d[0])<t.MAX_PATTERN_DRIFT&&Math.abs(f[1]-d[1])<t.MAX_PATTERN_DRIFT)f=d,h=0;else{if(h>t.SKIPPED_ROW_COUNT_MAX)break;h++}}c-=h+1,s[2]=new kn(f[0],c),s[3]=new kn(f[1],c)}return c-o<t.BARCODE_MIN_HEIGHT&&Pr.fill(s,null),s},t.findGuardPattern=function(e,r,n,o,i,a,s){Pr.fillWithin(s,0,s.length,0);for(var u=r,l=0;e.get(u,n)&&u>0&&l++<t.MAX_PIXEL_DRIFT;)u--;for(var c=u,h=0,f=a.length,d=i;c<o;c++)if(e.get(c,n)!==d)s[h]++;else{if(h===f-1){if(t.patternMatchVariance(s,a,t.MAX_INDIVIDUAL_VARIANCE)<t.MAX_AVG_VARIANCE)return new Int32Array([u,c]);u+=s[0]+s[1],Tr.arraycopy(s,2,s,0,h-1),s[h-1]=0,s[h]=0,h--}else h++;s[h]=1,d=!d}return h===f-1&&t.patternMatchVariance(s,a,t.MAX_INDIVIDUAL_VARIANCE)<t.MAX_AVG_VARIANCE?new Int32Array([u,c-1]):null},t.patternMatchVariance=function(t,e,r){for(var n=t.length,o=0,i=0,a=0;a<n;a++)o+=t[a],i+=e[a];if(o<i)return 1/0;var s=o/i;r*=s;for(var u=0,l=0;l<n;l++){var c=t[l],h=e[l]*s,f=c>h?c-h:h-c;if(f>r)return 1/0;u+=f}return u/o},t.INDEXES_START_PATTERN=Int32Array.from([0,4,1,5]),t.INDEXES_STOP_PATTERN=Int32Array.from([6,2,7,3]),t.MAX_AVG_VARIANCE=.42,t.MAX_INDIVIDUAL_VARIANCE=.8,t.START_PATTERN=Int32Array.from([8,1,1,1,1,1,1,3]),t.STOP_PATTERN=Int32Array.from([7,1,1,3,1,1,1,2,1]),t.MAX_PIXEL_DRIFT=3,t.MAX_PATTERN_DRIFT=5,t.SKIPPED_ROW_COUNT_MAX=25,t.ROW_STEP=5,t.BARCODE_MIN_HEIGHT=10,t}(),da=function(){function t(t,e){if(0===e.length)throw new Er;this.field=t;var r=e.length;if(r>1&&0===e[0]){for(var n=1;n<r&&0===e[n];)n++;n===r?this.coefficients=new Int32Array([0]):(this.coefficients=new Int32Array(r-n),Tr.arraycopy(e,n,this.coefficients,0,this.coefficients.length))}else this.coefficients=e}return t.prototype.getCoefficients=function(){return this.coefficients},t.prototype.getDegree=function(){return this.coefficients.length-1},t.prototype.isZero=function(){return 0===this.coefficients[0]},t.prototype.getCoefficient=function(t){return this.coefficients[this.coefficients.length-1-t]},t.prototype.evaluateAt=function(t){var e,r;if(0===t)return this.getCoefficient(0);if(1===t){var n=0;try{for(var o=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}(this.coefficients),i=o.next();!i.done;i=o.next()){var a=i.value;n=this.field.add(n,a)}}catch(c){e={error:c}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(e)throw e.error}}return n}for(var s=this.coefficients[0],u=this.coefficients.length,l=1;l<u;l++)s=this.field.add(this.field.multiply(t,s),this.coefficients[l]);return s},t.prototype.add=function(e){if(!this.field.equals(e.field))throw new Er("ModulusPolys do not have same ModulusGF field");if(this.isZero())return e;if(e.isZero())return this;var r=this.coefficients,n=e.coefficients;if(r.length>n.length){var o=r;r=n,n=o}var i=new Int32Array(n.length),a=n.length-r.length;Tr.arraycopy(n,0,i,0,a);for(var s=a;s<n.length;s++)i[s]=this.field.add(r[s-a],n[s]);return new t(this.field,i)},t.prototype.subtract=function(t){if(!this.field.equals(t.field))throw new Er("ModulusPolys do not have same ModulusGF field");return t.isZero()?this:this.add(t.negative())},t.prototype.multiply=function(e){return e instanceof t?this.multiplyOther(e):this.multiplyScalar(e)},t.prototype.multiplyOther=function(e){if(!this.field.equals(e.field))throw new Er("ModulusPolys do not have same ModulusGF field");if(this.isZero()||e.isZero())return new t(this.field,new Int32Array([0]));for(var r=this.coefficients,n=r.length,o=e.coefficients,i=o.length,a=new Int32Array(n+i-1),s=0;s<n;s++)for(var u=r[s],l=0;l<i;l++)a[s+l]=this.field.add(a[s+l],this.field.multiply(u,o[l]));return new t(this.field,a)},t.prototype.negative=function(){for(var e=this.coefficients.length,r=new Int32Array(e),n=0;n<e;n++)r[n]=this.field.subtract(0,this.coefficients[n]);return new t(this.field,r)},t.prototype.multiplyScalar=function(e){if(0===e)return new t(this.field,new Int32Array([0]));if(1===e)return this;for(var r=this.coefficients.length,n=new Int32Array(r),o=0;o<r;o++)n[o]=this.field.multiply(this.coefficients[o],e);return new t(this.field,n)},t.prototype.multiplyByMonomial=function(e,r){if(e<0)throw new Er;if(0===r)return new t(this.field,new Int32Array([0]));for(var n=this.coefficients.length,o=new Int32Array(n+e),i=0;i<n;i++)o[i]=this.field.multiply(this.coefficients[i],r);return new t(this.field,o)},t.prototype.toString=function(){for(var t=new $r,e=this.getDegree();e>=0;e--){var r=this.getCoefficient(e);0!==r&&(r<0?(t.append(" - "),r=-r):t.length()>0&&t.append(" + "),0!==e&&1===r||t.append(r),0!==e&&(1===e?t.append("x"):(t.append("x^"),t.append(e))))}return t.toString()},t}(),pa=function(){function t(){}return t.prototype.add=function(t,e){return(t+e)%this.modulus},t.prototype.subtract=function(t,e){return(this.modulus+t-e)%this.modulus},t.prototype.exp=function(t){return this.expTable[t]},t.prototype.log=function(t){if(0===t)throw new Er;return this.logTable[t]},t.prototype.inverse=function(t){if(0===t)throw new wn;return this.expTable[this.modulus-this.logTable[t]-1]},t.prototype.multiply=function(t,e){return 0===t||0===e?0:this.expTable[(this.logTable[t]+this.logTable[e])%(this.modulus-1)]},t.prototype.getSize=function(){return this.modulus},t.prototype.equals=function(t){return t===this},t}(),ga=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),ma=function(t){function e(e,r){var n=t.call(this)||this;n.modulus=e,n.expTable=new Int32Array(e),n.logTable=new Int32Array(e);for(var o=1,i=0;i<e;i++)n.expTable[i]=o,o=o*r%e;for(i=0;i<e-1;i++)n.logTable[n.expTable[i]]=i;return n.zero=new da(n,new Int32Array([0])),n.one=new da(n,new Int32Array([1])),n}return ga(e,t),e.prototype.getZero=function(){return this.zero},e.prototype.getOne=function(){return this.one},e.prototype.buildMonomial=function(t,e){if(t<0)throw new Er;if(0===e)return this.zero;var r=new Int32Array(t+1);return r[0]=e,new da(this,r)},e.PDF417_GF=new e(la.NUMBER_OF_CODEWORDS,3),e}(pa),va=function(){function t(){this.field=ma.PDF417_GF}return t.prototype.decode=function(t,e,r){for(var n,o,i=new da(this.field,t),a=new Int32Array(e),s=!1,u=e;u>0;u--){var l=i.evaluateAt(this.field.exp(u));a[e-u]=l,0!==l&&(s=!0)}if(!s)return 0;var c=this.field.getOne();if(null!=r)try{for(var h=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}(r),f=h.next();!f.done;f=h.next()){var d=f.value,p=this.field.exp(t.length-1-d),g=new da(this.field,new Int32Array([this.field.subtract(0,p),1]));c=c.multiply(g)}}catch(A){n={error:A}}finally{try{f&&!f.done&&(o=h.return)&&o.call(h)}finally{if(n)throw n.error}}var m=new da(this.field,a),v=this.runEuclideanAlgorithm(this.field.buildMonomial(e,1),m,e),y=v[0],_=v[1],w=this.findErrorLocations(y),b=this.findErrorMagnitudes(_,y,w);for(u=0;u<w.length;u++){var C=t.length-1-this.field.log(w[u]);if(C<0)throw xr.getChecksumInstance();t[C]=this.field.subtract(t[C],b[u])}return w.length},t.prototype.runEuclideanAlgorithm=function(t,e,r){if(t.getDegree()<e.getDegree()){var n=t;t=e,e=n}for(var o=t,i=e,a=this.field.getZero(),s=this.field.getOne();i.getDegree()>=Math.round(r/2);){var u=o,l=a;if(a=s,(o=i).isZero())throw xr.getChecksumInstance();i=u;for(var c=this.field.getZero(),h=o.getCoefficient(o.getDegree()),f=this.field.inverse(h);i.getDegree()>=o.getDegree()&&!i.isZero();){var d=i.getDegree()-o.getDegree(),p=this.field.multiply(i.getCoefficient(i.getDegree()),f);c=c.add(this.field.buildMonomial(d,p)),i=i.subtract(o.multiplyByMonomial(d,p))}s=c.multiply(a).subtract(l).negative()}var g=s.getCoefficient(0);if(0===g)throw xr.getChecksumInstance();var m=this.field.inverse(g);return[s.multiply(m),i.multiply(m)]},t.prototype.findErrorLocations=function(t){for(var e=t.getDegree(),r=new Int32Array(e),n=0,o=1;o<this.field.getSize()&&n<e;o++)0===t.evaluateAt(o)&&(r[n]=this.field.inverse(o),n++);if(n!==e)throw xr.getChecksumInstance();return r},t.prototype.findErrorMagnitudes=function(t,e,r){for(var n=e.getDegree(),o=new Int32Array(n),i=1;i<=n;i++)o[n-i]=this.field.multiply(i,e.getCoefficient(i));var a=new da(this.field,o),s=r.length,u=new Int32Array(s);for(i=0;i<s;i++){var l=this.field.inverse(r[i]),c=this.field.subtract(0,t.evaluateAt(l)),h=this.field.inverse(a.evaluateAt(l));u[i]=this.field.multiply(c,h)}return u},t}(),ya=function(){function t(e,r,n,o,i){e instanceof t?this.constructor_2(e):this.constructor_1(e,r,n,o,i)}return t.prototype.constructor_1=function(t,e,r,n,o){var i=null==e||null==r,a=null==n||null==o;if(i&&a)throw new Kr;i?(e=new kn(0,n.getY()),r=new kn(0,o.getY())):a&&(n=new kn(t.getWidth()-1,e.getY()),o=new kn(t.getWidth()-1,r.getY())),this.image=t,this.topLeft=e,this.bottomLeft=r,this.topRight=n,this.bottomRight=o,this.minX=Math.trunc(Math.min(e.getX(),r.getX())),this.maxX=Math.trunc(Math.max(n.getX(),o.getX())),this.minY=Math.trunc(Math.min(e.getY(),n.getY())),this.maxY=Math.trunc(Math.max(r.getY(),o.getY()))},t.prototype.constructor_2=function(t){this.image=t.image,this.topLeft=t.getTopLeft(),this.bottomLeft=t.getBottomLeft(),this.topRight=t.getTopRight(),this.bottomRight=t.getBottomRight(),this.minX=t.getMinX(),this.maxX=t.getMaxX(),this.minY=t.getMinY(),this.maxY=t.getMaxY()},t.merge=function(e,r){return null==e?r:null==r?e:new t(e.image,e.topLeft,e.bottomLeft,r.topRight,r.bottomRight)},t.prototype.addMissingRows=function(e,r,n){var o=this.topLeft,i=this.bottomLeft,a=this.topRight,s=this.bottomRight;if(e>0){var u=n?this.topLeft:this.topRight,l=Math.trunc(u.getY()-e);l<0&&(l=0);var c=new kn(u.getX(),l);n?o=c:a=c}if(r>0){var h=n?this.bottomLeft:this.bottomRight,f=Math.trunc(h.getY()+r);f>=this.image.getHeight()&&(f=this.image.getHeight()-1);var d=new kn(h.getX(),f);n?i=d:s=d}return new t(this.image,o,i,a,s)},t.prototype.getMinX=function(){return this.minX},t.prototype.getMaxX=function(){return this.maxX},t.prototype.getMinY=function(){return this.minY},t.prototype.getMaxY=function(){return this.maxY},t.prototype.getTopLeft=function(){return this.topLeft},t.prototype.getTopRight=function(){return this.topRight},t.prototype.getBottomLeft=function(){return this.bottomLeft},t.prototype.getBottomRight=function(){return this.bottomRight},t}(),_a=function(){function t(t,e,r,n){this.columnCount=t,this.errorCorrectionLevel=n,this.rowCountUpperPart=e,this.rowCountLowerPart=r,this.rowCount=e+r}return t.prototype.getColumnCount=function(){return this.columnCount},t.prototype.getErrorCorrectionLevel=function(){return this.errorCorrectionLevel},t.prototype.getRowCount=function(){return this.rowCount},t.prototype.getRowCountUpperPart=function(){return this.rowCountUpperPart},t.prototype.getRowCountLowerPart=function(){return this.rowCountLowerPart},t}(),wa=function(){function t(){this.buffer=""}return t.form=function(t,e){var r=-1;return t.replace(/%(-)?(0?[0-9]+)?([.][0-9]+)?([#][0-9]+)?([scfpexd%])/g,function(t,n,o,i,a,s){if("%%"===t)return"%";if(void 0!==e[++r]){t=i?parseInt(i.substr(1)):void 0;var u,l=a?parseInt(a.substr(1)):void 0;switch(s){case"s":u=e[r];break;case"c":u=e[r][0];break;case"f":u=parseFloat(e[r]).toFixed(t);break;case"p":u=parseFloat(e[r]).toPrecision(t);break;case"e":u=parseFloat(e[r]).toExponential(t);break;case"x":u=parseInt(e[r]).toString(l||16);break;case"d":u=parseFloat(parseInt(e[r],l||10).toPrecision(t)).toFixed(0)}u="object"==typeof u?JSON.stringify(u):(+u).toString(l);for(var c=parseInt(o),h=o&&o[0]+""=="0"?"0":" ";u.length<c;)u=void 0!==n?u+h:h+u;return u}})},t.prototype.format=function(e){for(var r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];this.buffer+=t.form(e,r)},t.prototype.toString=function(){return this.buffer},t}(),ba=function(){function t(t){this.boundingBox=new ya(t),this.codewords=new Array(t.getMaxY()-t.getMinY()+1)}return t.prototype.getCodewordNearby=function(e){var r=this.getCodeword(e);if(null!=r)return r;for(var n=1;n<t.MAX_NEARBY_DISTANCE;n++){var o=this.imageRowToCodewordIndex(e)-n;if(o>=0&&null!=(r=this.codewords[o]))return r;if((o=this.imageRowToCodewordIndex(e)+n)<this.codewords.length&&null!=(r=this.codewords[o]))return r}return null},t.prototype.imageRowToCodewordIndex=function(t){return t-this.boundingBox.getMinY()},t.prototype.setCodeword=function(t,e){this.codewords[this.imageRowToCodewordIndex(t)]=e},t.prototype.getCodeword=function(t){return this.codewords[this.imageRowToCodewordIndex(t)]},t.prototype.getBoundingBox=function(){return this.boundingBox},t.prototype.getCodewords=function(){return this.codewords},t.prototype.toString=function(){var t,e,r=new wa,n=0;try{for(var o=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}(this.codewords),i=o.next();!i.done;i=o.next()){var a=i.value;null!=a?r.format("%3d: %3d|%3d%n",n++,a.getRowNumber(),a.getValue()):r.format("%3d: | %n",n++)}}catch(s){t={error:s}}finally{try{i&&!i.done&&(e=o.return)&&e.call(o)}finally{if(t)throw t.error}}return r.toString()},t.MAX_NEARBY_DISTANCE=5,t}(),Ca=function(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var n,o,i=r.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(n=i.next()).done;)a.push(n.value)}catch(s){o={error:s}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a},Aa=function(){function t(){this.values=new Map}return t.prototype.setValue=function(t){t=Math.trunc(t);var e=this.values.get(t);null==e&&(e=0),e++,this.values.set(t,e)},t.prototype.getValue=function(){var t,e,r=-1,n=new Array,o=function(t,e){var o=function(){return t},i=function(){return e};i()>r?(r=i(),(n=[]).push(o())):i()===r&&n.push(o())};try{for(var i=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}(this.values.entries()),a=i.next();!a.done;a=i.next()){var s=Ca(a.value,2);o(s[0],s[1])}}catch(u){t={error:u}}finally{try{a&&!a.done&&(e=i.return)&&e.call(i)}finally{if(t)throw t.error}}return la.toIntArray(n)},t.prototype.getConfidence=function(t){return this.values.get(t)},t}(),Ea=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Ia=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Sa=function(t){function e(e,r){var n=t.call(this,e)||this;return n._isLeft=r,n}return Ea(e,t),e.prototype.setRowNumbers=function(){var t,e;try{for(var r=Ia(this.getCodewords()),n=r.next();!n.done;n=r.next()){var o=n.value;null!=o&&o.setRowNumberAsRowIndicatorColumn()}}catch(i){t={error:i}}finally{try{n&&!n.done&&(e=r.return)&&e.call(r)}finally{if(t)throw t.error}}},e.prototype.adjustCompleteIndicatorColumnRowNumbers=function(t){var e=this.getCodewords();this.setRowNumbers(),this.removeIncorrectCodewords(e,t);for(var r=this.getBoundingBox(),n=this._isLeft?r.getTopLeft():r.getTopRight(),o=this._isLeft?r.getBottomLeft():r.getBottomRight(),i=this.imageRowToCodewordIndex(Math.trunc(n.getY())),a=this.imageRowToCodewordIndex(Math.trunc(o.getY())),s=-1,u=1,l=0,c=i;c<a;c++)if(null!=e[c]){var h=e[c],f=h.getRowNumber()-s;if(0===f)l++;else if(1===f)u=Math.max(u,l),l=1,s=h.getRowNumber();else if(f<0||h.getRowNumber()>=t.getRowCount()||f>c)e[c]=null;else{for(var d,p=(d=u>2?(u-2)*f:f)>=c,g=1;g<=d&&!p;g++)p=null!=e[c-g];p?e[c]=null:(s=h.getRowNumber(),l=1)}}},e.prototype.getRowHeights=function(){var t,e,r=this.getBarcodeMetadata();if(null==r)return null;this.adjustIncompleteIndicatorColumnRowNumbers(r);var n=new Int32Array(r.getRowCount());try{for(var o=Ia(this.getCodewords()),i=o.next();!i.done;i=o.next()){var a=i.value;if(null!=a){var s=a.getRowNumber();if(s>=n.length)continue;n[s]++}}}catch(u){t={error:u}}finally{try{i&&!i.done&&(e=o.return)&&e.call(o)}finally{if(t)throw t.error}}return n},e.prototype.adjustIncompleteIndicatorColumnRowNumbers=function(t){for(var e=this.getBoundingBox(),r=this._isLeft?e.getTopLeft():e.getTopRight(),n=this._isLeft?e.getBottomLeft():e.getBottomRight(),o=this.imageRowToCodewordIndex(Math.trunc(r.getY())),i=this.imageRowToCodewordIndex(Math.trunc(n.getY())),a=this.getCodewords(),s=-1,u=o;u<i;u++)if(null!=a[u]){var l=a[u];l.setRowNumberAsRowIndicatorColumn();var c=l.getRowNumber()-s;0===c||(1===c?s=l.getRowNumber():l.getRowNumber()>=t.getRowCount()?a[u]=null:s=l.getRowNumber())}},e.prototype.getBarcodeMetadata=function(){var t,e,r=this.getCodewords(),n=new Aa,o=new Aa,i=new Aa,a=new Aa;try{for(var s=Ia(r),u=s.next();!u.done;u=s.next()){var l=u.value;if(null!=l){l.setRowNumberAsRowIndicatorColumn();var c=l.getValue()%30,h=l.getRowNumber();switch(this._isLeft||(h+=2),h%3){case 0:o.setValue(3*c+1);break;case 1:a.setValue(c/3),i.setValue(c%3);break;case 2:n.setValue(c+1)}}}}catch(d){t={error:d}}finally{try{u&&!u.done&&(e=s.return)&&e.call(s)}finally{if(t)throw t.error}}if(0===n.getValue().length||0===o.getValue().length||0===i.getValue().length||0===a.getValue().length||n.getValue()[0]<1||o.getValue()[0]+i.getValue()[0]<la.MIN_ROWS_IN_BARCODE||o.getValue()[0]+i.getValue()[0]>la.MAX_ROWS_IN_BARCODE)return null;var f=new _a(n.getValue()[0],o.getValue()[0],i.getValue()[0],a.getValue()[0]);return this.removeIncorrectCodewords(r,f),f},e.prototype.removeIncorrectCodewords=function(t,e){for(var r=0;r<t.length;r++){var n=t[r];if(null!=t[r]){var o=n.getValue()%30,i=n.getRowNumber();if(i>e.getRowCount())t[r]=null;else switch(this._isLeft||(i+=2),i%3){case 0:3*o+1!==e.getRowCountUpperPart()&&(t[r]=null);break;case 1:Math.trunc(o/3)===e.getErrorCorrectionLevel()&&o%3===e.getRowCountLowerPart()||(t[r]=null);break;case 2:o+1!==e.getColumnCount()&&(t[r]=null)}}}},e.prototype.isLeft=function(){return this._isLeft},e.prototype.toString=function(){return"IsLeft: "+this._isLeft+"\n"+t.prototype.toString.call(this)},e}(ba),xa=function(){function t(t,e){this.ADJUST_ROW_NUMBER_SKIP=2,this.barcodeMetadata=t,this.barcodeColumnCount=t.getColumnCount(),this.boundingBox=e,this.detectionResultColumns=new Array(this.barcodeColumnCount+2)}return t.prototype.getDetectionResultColumns=function(){this.adjustIndicatorColumnRowNumbers(this.detectionResultColumns[0]),this.adjustIndicatorColumnRowNumbers(this.detectionResultColumns[this.barcodeColumnCount+1]);var t,e=la.MAX_CODEWORDS_IN_BARCODE;do{t=e,e=this.adjustRowNumbersAndGetCount()}while(e>0&&e<t);return this.detectionResultColumns},t.prototype.adjustIndicatorColumnRowNumbers=function(t){null!=t&&t.adjustCompleteIndicatorColumnRowNumbers(this.barcodeMetadata)},t.prototype.adjustRowNumbersAndGetCount=function(){var t=this.adjustRowNumbersByRow();if(0===t)return 0;for(var e=1;e<this.barcodeColumnCount+1;e++)for(var r=this.detectionResultColumns[e].getCodewords(),n=0;n<r.length;n++)null!=r[n]&&(r[n].hasValidRowNumber()||this.adjustRowNumbers(e,n,r));return t},t.prototype.adjustRowNumbersByRow=function(){return this.adjustRowNumbersFromBothRI(),this.adjustRowNumbersFromLRI()+this.adjustRowNumbersFromRRI()},t.prototype.adjustRowNumbersFromBothRI=function(){if(null!=this.detectionResultColumns[0]&&null!=this.detectionResultColumns[this.barcodeColumnCount+1])for(var t=this.detectionResultColumns[0].getCodewords(),e=this.detectionResultColumns[this.barcodeColumnCount+1].getCodewords(),r=0;r<t.length;r++)if(null!=t[r]&&null!=e[r]&&t[r].getRowNumber()===e[r].getRowNumber())for(var n=1;n<=this.barcodeColumnCount;n++){var o=this.detectionResultColumns[n].getCodewords()[r];null!=o&&(o.setRowNumber(t[r].getRowNumber()),o.hasValidRowNumber()||(this.detectionResultColumns[n].getCodewords()[r]=null))}},t.prototype.adjustRowNumbersFromRRI=function(){if(null==this.detectionResultColumns[this.barcodeColumnCount+1])return 0;for(var e=0,r=this.detectionResultColumns[this.barcodeColumnCount+1].getCodewords(),n=0;n<r.length;n++)if(null!=r[n])for(var o=r[n].getRowNumber(),i=0,a=this.barcodeColumnCount+1;a>0&&i<this.ADJUST_ROW_NUMBER_SKIP;a--){var s=this.detectionResultColumns[a].getCodewords()[n];null!=s&&(i=t.adjustRowNumberIfValid(o,i,s),s.hasValidRowNumber()||e++)}return e},t.prototype.adjustRowNumbersFromLRI=function(){if(null==this.detectionResultColumns[0])return 0;for(var e=0,r=this.detectionResultColumns[0].getCodewords(),n=0;n<r.length;n++)if(null!=r[n])for(var o=r[n].getRowNumber(),i=0,a=1;a<this.barcodeColumnCount+1&&i<this.ADJUST_ROW_NUMBER_SKIP;a++){var s=this.detectionResultColumns[a].getCodewords()[n];null!=s&&(i=t.adjustRowNumberIfValid(o,i,s),s.hasValidRowNumber()||e++)}return e},t.adjustRowNumberIfValid=function(t,e,r){return null==r||r.hasValidRowNumber()||(r.isValidRowNumber(t)?(r.setRowNumber(t),e=0):++e),e},t.prototype.adjustRowNumbers=function(e,r,n){var o,i,a=n[r],s=this.detectionResultColumns[e-1].getCodewords(),u=s;null!=this.detectionResultColumns[e+1]&&(u=this.detectionResultColumns[e+1].getCodewords());var l=new Array(14);l[2]=s[r],l[3]=u[r],r>0&&(l[0]=n[r-1],l[4]=s[r-1],l[5]=u[r-1]),r>1&&(l[8]=n[r-2],l[10]=s[r-2],l[11]=u[r-2]),r<n.length-1&&(l[1]=n[r+1],l[6]=s[r+1],l[7]=u[r+1]),r<n.length-2&&(l[9]=n[r+2],l[12]=s[r+2],l[13]=u[r+2]);try{for(var c=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}(l),h=c.next();!h.done;h=c.next()){var f=h.value;if(t.adjustRowNumber(a,f))return}}catch(d){o={error:d}}finally{try{h&&!h.done&&(i=c.return)&&i.call(c)}finally{if(o)throw o.error}}},t.adjustRowNumber=function(t,e){return!(null==e||!e.hasValidRowNumber()||e.getBucket()!==t.getBucket()||(t.setRowNumber(e.getRowNumber()),0))},t.prototype.getBarcodeColumnCount=function(){return this.barcodeColumnCount},t.prototype.getBarcodeRowCount=function(){return this.barcodeMetadata.getRowCount()},t.prototype.getBarcodeECLevel=function(){return this.barcodeMetadata.getErrorCorrectionLevel()},t.prototype.setBoundingBox=function(t){this.boundingBox=t},t.prototype.getBoundingBox=function(){return this.boundingBox},t.prototype.setDetectionResultColumn=function(t,e){this.detectionResultColumns[t]=e},t.prototype.getDetectionResultColumn=function(t){return this.detectionResultColumns[t]},t.prototype.toString=function(){var t=this.detectionResultColumns[0];null==t&&(t=this.detectionResultColumns[this.barcodeColumnCount+1]);for(var e=new wa,r=0;r<t.getCodewords().length;r++){e.format("CW %3d:",r);for(var n=0;n<this.barcodeColumnCount+2;n++)if(null!=this.detectionResultColumns[n]){var o=this.detectionResultColumns[n].getCodewords()[r];null!=o?e.format(" %3d|%3d",o.getRowNumber(),o.getValue()):e.format(" | ")}else e.format(" | ");e.format("%n")}return e.toString()},t}(),Oa=function(){function t(e,r,n,o){this.rowNumber=t.BARCODE_ROW_UNKNOWN,this.startX=Math.trunc(e),this.endX=Math.trunc(r),this.bucket=Math.trunc(n),this.value=Math.trunc(o)}return t.prototype.hasValidRowNumber=function(){return this.isValidRowNumber(this.rowNumber)},t.prototype.isValidRowNumber=function(e){return e!==t.BARCODE_ROW_UNKNOWN&&this.bucket===e%3*3},t.prototype.setRowNumberAsRowIndicatorColumn=function(){this.rowNumber=Math.trunc(3*Math.trunc(this.value/30)+Math.trunc(this.bucket/3))},t.prototype.getWidth=function(){return this.endX-this.startX},t.prototype.getStartX=function(){return this.startX},t.prototype.getEndX=function(){return this.endX},t.prototype.getBucket=function(){return this.bucket},t.prototype.getValue=function(){return this.value},t.prototype.getRowNumber=function(){return this.rowNumber},t.prototype.setRowNumber=function(t){this.rowNumber=t},t.prototype.toString=function(){return this.rowNumber+"|"+this.value},t.BARCODE_ROW_UNKNOWN=-1,t}(),Ta=function(){function t(){}return t.initialize=function(){for(var e=0;e<la.SYMBOL_TABLE.length;e++)for(var r=la.SYMBOL_TABLE[e],n=1&r,o=0;o<la.BARS_IN_MODULE;o++){for(var i=0;(1&r)===n;)i+=1,r>>=1;n=1&r,t.RATIOS_TABLE[e]||(t.RATIOS_TABLE[e]=new Array(la.BARS_IN_MODULE)),t.RATIOS_TABLE[e][la.BARS_IN_MODULE-o-1]=Math.fround(i/la.MODULES_IN_CODEWORD)}this.bSymbolTableReady=!0},t.getDecodedValue=function(e){var r=t.getDecodedCodewordValue(t.sampleBitCounts(e));return-1!==r?r:t.getClosestDecodedValue(e)},t.sampleBitCounts=function(t){for(var e=Tn.sum(t),r=new Int32Array(la.BARS_IN_MODULE),n=0,o=0,i=0;i<la.MODULES_IN_CODEWORD;i++){var a=e/(2*la.MODULES_IN_CODEWORD)+i*e/la.MODULES_IN_CODEWORD;o+t[n]<=a&&(o+=t[n],n++),r[n]++}return r},t.getDecodedCodewordValue=function(e){var r=t.getBitValue(e);return-1===la.getCodeword(r)?-1:r},t.getBitValue=function(t){for(var e=0,r=0;r<t.length;r++)for(var n=0;n<t[r];n++)e=e<<1|(r%2==0?1:0);return Math.trunc(e)},t.getClosestDecodedValue=function(e){var r=Tn.sum(e),n=new Array(la.BARS_IN_MODULE);if(r>1)for(var o=0;o<n.length;o++)n[o]=Math.fround(e[o]/r);var i=Nn.MAX_VALUE,a=-1;this.bSymbolTableReady||t.initialize();for(var s=0;s<t.RATIOS_TABLE.length;s++){for(var u=0,l=t.RATIOS_TABLE[s],c=0;c<la.BARS_IN_MODULE;c++){var h=Math.fround(l[c]-n[c]);if((u+=Math.fround(h*h))>=i)break}u<i&&(i=u,a=la.SYMBOL_TABLE[s])}return a},t.bSymbolTableReady=!1,t.RATIOS_TABLE=new Array(la.SYMBOL_TABLE.length).map(function(t){return new Array(la.BARS_IN_MODULE)}),t}(),Na=function(){function t(){this.segmentCount=-1,this.fileSize=-1,this.timestamp=-1,this.checksum=-1}return t.prototype.getSegmentIndex=function(){return this.segmentIndex},t.prototype.setSegmentIndex=function(t){this.segmentIndex=t},t.prototype.getFileId=function(){return this.fileId},t.prototype.setFileId=function(t){this.fileId=t},t.prototype.getOptionalData=function(){return this.optionalData},t.prototype.setOptionalData=function(t){this.optionalData=t},t.prototype.isLastSegment=function(){return this.lastSegment},t.prototype.setLastSegment=function(t){this.lastSegment=t},t.prototype.getSegmentCount=function(){return this.segmentCount},t.prototype.setSegmentCount=function(t){this.segmentCount=t},t.prototype.getSender=function(){return this.sender||null},t.prototype.setSender=function(t){this.sender=t},t.prototype.getAddressee=function(){return this.addressee||null},t.prototype.setAddressee=function(t){this.addressee=t},t.prototype.getFileName=function(){return this.fileName},t.prototype.setFileName=function(t){this.fileName=t},t.prototype.getFileSize=function(){return this.fileSize},t.prototype.setFileSize=function(t){this.fileSize=t},t.prototype.getChecksum=function(){return this.checksum},t.prototype.setChecksum=function(t){this.checksum=t},t.prototype.getTimestamp=function(){return this.timestamp},t.prototype.setTimestamp=function(t){this.timestamp=t},t}(),ka=function(){function t(){}return t.parseLong=function(t,e){return void 0===e&&(e=void 0),parseInt(t,e)},t}(),Ra=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Da=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Ra(e,t),e.kind="NullPointerException",e}(wr),Pa=function(){function t(){}return t.prototype.writeBytes=function(t){this.writeBytesOffset(t,0,t.length)},t.prototype.writeBytesOffset=function(t,e,r){if(null==t)throw new Da;if(e<0||e>t.length||r<0||e+r>t.length||e+r<0)throw new kr;if(0!==r)for(var n=0;n<r;n++)this.write(t[e+n])},t.prototype.flush=function(){},t.prototype.close=function(){},t}(),Ma=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Ba=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Ma(e,t),e}(wr),La=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Fa=function(t){function e(e){void 0===e&&(e=32);var r=t.call(this)||this;if(r.count=0,e<0)throw new Er("Negative initial size: "+e);return r.buf=new Uint8Array(e),r}return La(e,t),e.prototype.ensureCapacity=function(t){t-this.buf.length>0&&this.grow(t)},e.prototype.grow=function(t){var e=this.buf.length<<1;if(e-t<0&&(e=t),e<0){if(t<0)throw new Ba;e=Mr.MAX_VALUE}this.buf=Pr.copyOfUint8Array(this.buf,e)},e.prototype.write=function(t){this.ensureCapacity(this.count+1),this.buf[this.count]=t,this.count+=1},e.prototype.writeBytesOffset=function(t,e,r){if(e<0||e>t.length||r<0||e+r-t.length>0)throw new kr;this.ensureCapacity(this.count+r),Tr.arraycopy(t,e,this.buf,this.count,r),this.count+=r},e.prototype.writeTo=function(t){t.writeBytesOffset(this.buf,0,this.count)},e.prototype.reset=function(){this.count=0},e.prototype.toByteArray=function(){return Pr.copyOfUint8Array(this.buf,this.count)},e.prototype.size=function(){return this.count},e.prototype.toString=function(t){return t?"string"==typeof t?this.toString_string(t):this.toString_number(t):this.toString_void()},e.prototype.toString_void=function(){return new String(this.buf).toString()},e.prototype.toString_string=function(t){return new String(this.buf).toString()},e.prototype.toString_number=function(t){return new String(this.buf).toString()},e.prototype.close=function(){},e}(Pa);function ja(){if("undefined"!=typeof window)return window.BigInt||null;if("undefined"!=typeof global)return global.BigInt||null;if("undefined"!=typeof self)return self.BigInt||null;throw new Error("Can't search globals for BigInt!")}function Va(t){if(void 0===$i&&($i=ja()),null===$i)throw new Error("BigInt is not supported!");return $i(t)}!function(t){t[t.ALPHA=0]="ALPHA",t[t.LOWER=1]="LOWER",t[t.MIXED=2]="MIXED",t[t.PUNCT=3]="PUNCT",t[t.ALPHA_SHIFT=4]="ALPHA_SHIFT",t[t.PUNCT_SHIFT=5]="PUNCT_SHIFT"}(Xi||(Xi={}));var Ua=function(){function t(){}return t.decode=function(e,r){var n=new $r(""),o=Hr.ISO8859_1;n.enableDecoding(o);for(var i=1,a=e[i++],s=new Na;i<e[0];){switch(a){case t.TEXT_COMPACTION_MODE_LATCH:i=t.textCompaction(e,i,n);break;case t.BYTE_COMPACTION_MODE_LATCH:case t.BYTE_COMPACTION_MODE_LATCH_6:i=t.byteCompaction(a,e,o,i,n);break;case t.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:n.append(e[i++]);break;case t.NUMERIC_COMPACTION_MODE_LATCH:i=t.numericCompaction(e,i,n);break;case t.ECI_CHARSET:Hr.getCharacterSetECIByValue(e[i++]);break;case t.ECI_GENERAL_PURPOSE:i+=2;break;case t.ECI_USER_DEFINED:i++;break;case t.BEGIN_MACRO_PDF417_CONTROL_BLOCK:i=t.decodeMacroBlock(e,i,s);break;case t.BEGIN_MACRO_PDF417_OPTIONAL_FIELD:case t.MACRO_PDF417_TERMINATOR:throw new Vr;default:i--,i=t.textCompaction(e,i,n)}if(!(i<e.length))throw Vr.getFormatInstance();a=e[i++]}if(0===n.length())throw Vr.getFormatInstance();var u=new mn(null,n.toString(),null,r);return u.setOther(s),u},t.decodeMacroBlock=function(e,r,n){if(r+t.NUMBER_OF_SEQUENCE_CODEWORDS>e[0])throw Vr.getFormatInstance();for(var o=new Int32Array(t.NUMBER_OF_SEQUENCE_CODEWORDS),i=0;i<t.NUMBER_OF_SEQUENCE_CODEWORDS;i++,r++)o[i]=e[r];n.setSegmentIndex(Mr.parseInt(t.decodeBase900toBase10(o,t.NUMBER_OF_SEQUENCE_CODEWORDS)));var a=new $r;r=t.textCompaction(e,r,a),n.setFileId(a.toString());var s=-1;for(e[r]===t.BEGIN_MACRO_PDF417_OPTIONAL_FIELD&&(s=r+1);r<e[0];)switch(e[r]){case t.BEGIN_MACRO_PDF417_OPTIONAL_FIELD:switch(e[++r]){case t.MACRO_PDF417_OPTIONAL_FIELD_FILE_NAME:var u=new $r;r=t.textCompaction(e,r+1,u),n.setFileName(u.toString());break;case t.MACRO_PDF417_OPTIONAL_FIELD_SENDER:var l=new $r;r=t.textCompaction(e,r+1,l),n.setSender(l.toString());break;case t.MACRO_PDF417_OPTIONAL_FIELD_ADDRESSEE:var c=new $r;r=t.textCompaction(e,r+1,c),n.setAddressee(c.toString());break;case t.MACRO_PDF417_OPTIONAL_FIELD_SEGMENT_COUNT:var h=new $r;r=t.numericCompaction(e,r+1,h),n.setSegmentCount(Mr.parseInt(h.toString()));break;case t.MACRO_PDF417_OPTIONAL_FIELD_TIME_STAMP:var f=new $r;r=t.numericCompaction(e,r+1,f),n.setTimestamp(ka.parseLong(f.toString()));break;case t.MACRO_PDF417_OPTIONAL_FIELD_CHECKSUM:var d=new $r;r=t.numericCompaction(e,r+1,d),n.setChecksum(Mr.parseInt(d.toString()));break;case t.MACRO_PDF417_OPTIONAL_FIELD_FILE_SIZE:var p=new $r;r=t.numericCompaction(e,r+1,p),n.setFileSize(ka.parseLong(p.toString()));break;default:throw Vr.getFormatInstance()}break;case t.MACRO_PDF417_TERMINATOR:r++,n.setLastSegment(!0);break;default:throw Vr.getFormatInstance()}if(-1!==s){var g=r-s;n.isLastSegment()&&g--,n.setOptionalData(Pr.copyOfRange(e,s,s+g))}return r},t.textCompaction=function(e,r,n){for(var o=new Int32Array(2*(e[0]-r)),i=new Int32Array(2*(e[0]-r)),a=0,s=!1;r<e[0]&&!s;){var u=e[r++];if(u<t.TEXT_COMPACTION_MODE_LATCH)o[a]=u/30,o[a+1]=u%30,a+=2;else switch(u){case t.TEXT_COMPACTION_MODE_LATCH:o[a++]=t.TEXT_COMPACTION_MODE_LATCH;break;case t.BYTE_COMPACTION_MODE_LATCH:case t.BYTE_COMPACTION_MODE_LATCH_6:case t.NUMERIC_COMPACTION_MODE_LATCH:case t.BEGIN_MACRO_PDF417_CONTROL_BLOCK:case t.BEGIN_MACRO_PDF417_OPTIONAL_FIELD:case t.MACRO_PDF417_TERMINATOR:r--,s=!0;break;case t.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:o[a]=t.MODE_SHIFT_TO_BYTE_COMPACTION_MODE,u=e[r++],i[a]=u,a++}}return t.decodeTextCompaction(o,i,a,n),r},t.decodeTextCompaction=function(e,r,n,o){for(var i=Xi.ALPHA,a=Xi.ALPHA,s=0;s<n;){var u=e[s],l="";switch(i){case Xi.ALPHA:if(u<26)l=String.fromCharCode(65+u);else switch(u){case 26:l=" ";break;case t.LL:i=Xi.LOWER;break;case t.ML:i=Xi.MIXED;break;case t.PS:a=i,i=Xi.PUNCT_SHIFT;break;case t.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:o.append(r[s]);break;case t.TEXT_COMPACTION_MODE_LATCH:i=Xi.ALPHA}break;case Xi.LOWER:if(u<26)l=String.fromCharCode(97+u);else switch(u){case 26:l=" ";break;case t.AS:a=i,i=Xi.ALPHA_SHIFT;break;case t.ML:i=Xi.MIXED;break;case t.PS:a=i,i=Xi.PUNCT_SHIFT;break;case t.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:o.append(r[s]);break;case t.TEXT_COMPACTION_MODE_LATCH:i=Xi.ALPHA}break;case Xi.MIXED:if(u<t.PL)l=t.MIXED_CHARS[u];else switch(u){case t.PL:i=Xi.PUNCT;break;case 26:l=" ";break;case t.LL:i=Xi.LOWER;break;case t.AL:i=Xi.ALPHA;break;case t.PS:a=i,i=Xi.PUNCT_SHIFT;break;case t.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:o.append(r[s]);break;case t.TEXT_COMPACTION_MODE_LATCH:i=Xi.ALPHA}break;case Xi.PUNCT:if(u<t.PAL)l=t.PUNCT_CHARS[u];else switch(u){case t.PAL:i=Xi.ALPHA;break;case t.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:o.append(r[s]);break;case t.TEXT_COMPACTION_MODE_LATCH:i=Xi.ALPHA}break;case Xi.ALPHA_SHIFT:if(i=a,u<26)l=String.fromCharCode(65+u);else switch(u){case 26:l=" ";break;case t.TEXT_COMPACTION_MODE_LATCH:i=Xi.ALPHA}break;case Xi.PUNCT_SHIFT:if(i=a,u<t.PAL)l=t.PUNCT_CHARS[u];else switch(u){case t.PAL:i=Xi.ALPHA;break;case t.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:o.append(r[s]);break;case t.TEXT_COMPACTION_MODE_LATCH:i=Xi.ALPHA}}""!==l&&o.append(l),s++}},t.byteCompaction=function(e,r,n,o,i){var a=new Fa,s=0,u=0,l=!1;switch(e){case t.BYTE_COMPACTION_MODE_LATCH:for(var c=new Int32Array(6),h=r[o++];o<r[0]&&!l;)switch(c[s++]=h,u=900*u+h,h=r[o++]){case t.TEXT_COMPACTION_MODE_LATCH:case t.BYTE_COMPACTION_MODE_LATCH:case t.NUMERIC_COMPACTION_MODE_LATCH:case t.BYTE_COMPACTION_MODE_LATCH_6:case t.BEGIN_MACRO_PDF417_CONTROL_BLOCK:case t.BEGIN_MACRO_PDF417_OPTIONAL_FIELD:case t.MACRO_PDF417_TERMINATOR:o--,l=!0;break;default:if(s%5==0&&s>0){for(var f=0;f<6;++f)a.write(Number(Va(u)>>Va(8*(5-f))));u=0,s=0}}o===r[0]&&h<t.TEXT_COMPACTION_MODE_LATCH&&(c[s++]=h);for(var d=0;d<s;d++)a.write(c[d]);break;case t.BYTE_COMPACTION_MODE_LATCH_6:for(;o<r[0]&&!l;){var p=r[o++];if(p<t.TEXT_COMPACTION_MODE_LATCH)s++,u=900*u+p;else switch(p){case t.TEXT_COMPACTION_MODE_LATCH:case t.BYTE_COMPACTION_MODE_LATCH:case t.NUMERIC_COMPACTION_MODE_LATCH:case t.BYTE_COMPACTION_MODE_LATCH_6:case t.BEGIN_MACRO_PDF417_CONTROL_BLOCK:case t.BEGIN_MACRO_PDF417_OPTIONAL_FIELD:case t.MACRO_PDF417_TERMINATOR:o--,l=!0}if(s%5==0&&s>0){for(f=0;f<6;++f)a.write(Number(Va(u)>>Va(8*(5-f))));u=0,s=0}}}return i.append(Gr.decode(a.toByteArray(),n)),o},t.numericCompaction=function(e,r,n){for(var o=0,i=!1,a=new Int32Array(t.MAX_NUMERIC_CODEWORDS);r<e[0]&&!i;){var s=e[r++];if(r===e[0]&&(i=!0),s<t.TEXT_COMPACTION_MODE_LATCH)a[o]=s,o++;else switch(s){case t.TEXT_COMPACTION_MODE_LATCH:case t.BYTE_COMPACTION_MODE_LATCH:case t.BYTE_COMPACTION_MODE_LATCH_6:case t.BEGIN_MACRO_PDF417_CONTROL_BLOCK:case t.BEGIN_MACRO_PDF417_OPTIONAL_FIELD:case t.MACRO_PDF417_TERMINATOR:r--,i=!0}(o%t.MAX_NUMERIC_CODEWORDS==0||s===t.NUMERIC_COMPACTION_MODE_LATCH||i)&&o>0&&(n.append(t.decodeBase900toBase10(a,o)),o=0)}return r},t.decodeBase900toBase10=function(e,r){for(var n=Va(0),o=0;o<r;o++)n+=t.EXP900[r-o-1]*Va(e[o]);var i=n.toString();if("1"!==i.charAt(0))throw new Vr;return i.substring(1)},t.TEXT_COMPACTION_MODE_LATCH=900,t.BYTE_COMPACTION_MODE_LATCH=901,t.NUMERIC_COMPACTION_MODE_LATCH=902,t.BYTE_COMPACTION_MODE_LATCH_6=924,t.ECI_USER_DEFINED=925,t.ECI_GENERAL_PURPOSE=926,t.ECI_CHARSET=927,t.BEGIN_MACRO_PDF417_CONTROL_BLOCK=928,t.BEGIN_MACRO_PDF417_OPTIONAL_FIELD=923,t.MACRO_PDF417_TERMINATOR=922,t.MODE_SHIFT_TO_BYTE_COMPACTION_MODE=913,t.MAX_NUMERIC_CODEWORDS=15,t.MACRO_PDF417_OPTIONAL_FIELD_FILE_NAME=0,t.MACRO_PDF417_OPTIONAL_FIELD_SEGMENT_COUNT=1,t.MACRO_PDF417_OPTIONAL_FIELD_TIME_STAMP=2,t.MACRO_PDF417_OPTIONAL_FIELD_SENDER=3,t.MACRO_PDF417_OPTIONAL_FIELD_ADDRESSEE=4,t.MACRO_PDF417_OPTIONAL_FIELD_FILE_SIZE=5,t.MACRO_PDF417_OPTIONAL_FIELD_CHECKSUM=6,t.PL=25,t.LL=27,t.AS=27,t.ML=28,t.AL=28,t.PS=29,t.PAL=29,t.PUNCT_CHARS=";<>@[\\]_`~!\r\t,:\n-.$/\"|*()?{}'",t.MIXED_CHARS="0123456789&\r\t,:#-.$/+%*=^",t.EXP900=ja()?function(){var t=[];t[0]=Va(1);var e=Va(900);t[1]=e;for(var r=2;r<16;r++)t[r]=t[r-1]*e;return t}():[],t.NUMBER_OF_SEQUENCE_CODEWORDS=2,t}(),Ha=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},za=function(){function t(){}return t.decode=function(e,r,n,o,i,a,s){for(var u,l=new ya(e,r,n,o,i),c=null,h=null,f=!0;;f=!1){if(null!=r&&(c=t.getRowIndicatorColumn(e,l,r,!0,a,s)),null!=o&&(h=t.getRowIndicatorColumn(e,l,o,!1,a,s)),null==(u=t.merge(c,h)))throw Kr.getNotFoundInstance();var d=u.getBoundingBox();if(!f||null==d||!(d.getMinY()<l.getMinY()||d.getMaxY()>l.getMaxY()))break;l=d}u.setBoundingBox(l);var p=u.getBarcodeColumnCount()+1;u.setDetectionResultColumn(0,c),u.setDetectionResultColumn(p,h);for(var g=null!=c,m=1;m<=p;m++){var v=g?m:p-m;if(void 0===u.getDetectionResultColumn(v)){var y=void 0;y=0===v||v===p?new Sa(l,0===v):new ba(l),u.setDetectionResultColumn(v,y);for(var _=-1,w=_,b=l.getMinY();b<=l.getMaxY();b++){if((_=t.getStartColumn(u,v,b,g))<0||_>l.getMaxX()){if(-1===w)continue;_=w}var C=t.detectCodeword(e,l.getMinX(),l.getMaxX(),g,_,b,a,s);null!=C&&(y.setCodeword(b,C),w=_,a=Math.min(a,C.getWidth()),s=Math.max(s,C.getWidth()))}}}return t.createDecoderResult(u)},t.merge=function(e,r){if(null==e&&null==r)return null;var n=t.getBarcodeMetadata(e,r);if(null==n)return null;var o=ya.merge(t.adjustBoundingBox(e),t.adjustBoundingBox(r));return new xa(n,o)},t.adjustBoundingBox=function(e){var r,n;if(null==e)return null;var o=e.getRowHeights();if(null==o)return null;var i=t.getMax(o),a=0;try{for(var s=Ha(o),u=s.next();!u.done;u=s.next()){var l=u.value;if(a+=i-l,l>0)break}}catch(d){r={error:d}}finally{try{u&&!u.done&&(n=s.return)&&n.call(s)}finally{if(r)throw r.error}}for(var c=e.getCodewords(),h=0;a>0&&null==c[h];h++)a--;var f=0;for(h=o.length-1;h>=0&&(f+=i-o[h],!(o[h]>0));h--);for(h=c.length-1;f>0&&null==c[h];h--)f--;return e.getBoundingBox().addMissingRows(a,f,e.isLeft())},t.getMax=function(t){var e,r,n=-1;try{for(var o=Ha(t),i=o.next();!i.done;i=o.next()){var a=i.value;n=Math.max(n,a)}}catch(s){e={error:s}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(e)throw e.error}}return n},t.getBarcodeMetadata=function(t,e){var r,n;return null==t||null==(r=t.getBarcodeMetadata())?null==e?null:e.getBarcodeMetadata():null==e||null==(n=e.getBarcodeMetadata())?r:r.getColumnCount()!==n.getColumnCount()&&r.getErrorCorrectionLevel()!==n.getErrorCorrectionLevel()&&r.getRowCount()!==n.getRowCount()?null:r},t.getRowIndicatorColumn=function(e,r,n,o,i,a){for(var s=new Sa(r,o),u=0;u<2;u++)for(var l=0===u?1:-1,c=Math.trunc(Math.trunc(n.getX())),h=Math.trunc(Math.trunc(n.getY()));h<=r.getMaxY()&&h>=r.getMinY();h+=l){var f=t.detectCodeword(e,0,e.getWidth(),o,c,h,i,a);null!=f&&(s.setCodeword(h,f),c=o?f.getStartX():f.getEndX())}return s},t.adjustCodewordCount=function(e,r){var n=r[0][1],o=n.getValue(),i=e.getBarcodeColumnCount()*e.getBarcodeRowCount()-t.getNumberOfECCodeWords(e.getBarcodeECLevel());if(0===o.length){if(i<1||i>la.MAX_CODEWORDS_IN_BARCODE)throw Kr.getNotFoundInstance();n.setValue(i)}else o[0]!==i&&n.setValue(i)},t.createDecoderResult=function(e){var r=t.createBarcodeMatrix(e);t.adjustCodewordCount(e,r);for(var n=new Array,o=new Int32Array(e.getBarcodeRowCount()*e.getBarcodeColumnCount()),i=[],a=new Array,s=0;s<e.getBarcodeRowCount();s++)for(var u=0;u<e.getBarcodeColumnCount();u++){var l=r[s][u+1].getValue(),c=s*e.getBarcodeColumnCount()+u;0===l.length?n.push(c):1===l.length?o[c]=l[0]:(a.push(c),i.push(l))}for(var h=new Array(i.length),f=0;f<h.length;f++)h[f]=i[f];return t.createDecoderResultFromAmbiguousValues(e.getBarcodeECLevel(),o,la.toIntArray(n),la.toIntArray(a),h)},t.createDecoderResultFromAmbiguousValues=function(e,r,n,o,i){for(var a=new Int32Array(o.length),s=100;s-- >0;){for(var u=0;u<a.length;u++)r[o[u]]=i[u][a[u]];try{return t.decodeCodewords(r,e,n)}catch(l){if(!(l instanceof xr))throw l}if(0===a.length)throw xr.getChecksumInstance();for(u=0;u<a.length;u++){if(a[u]<i[u].length-1){a[u]++;break}if(a[u]=0,u===a.length-1)throw xr.getChecksumInstance()}}throw xr.getChecksumInstance()},t.createBarcodeMatrix=function(t){for(var e,r,n,o,i=Array.from({length:t.getBarcodeRowCount()},function(){return new Array(t.getBarcodeColumnCount()+2)}),a=0;a<i.length;a++)for(var s=0;s<i[a].length;s++)i[a][s]=new Aa;var u=0;try{for(var l=Ha(t.getDetectionResultColumns()),c=l.next();!c.done;c=l.next()){var h=c.value;if(null!=h)try{for(var f=(n=void 0,Ha(h.getCodewords())),d=f.next();!d.done;d=f.next()){var p=d.value;if(null!=p){var g=p.getRowNumber();if(g>=0){if(g>=i.length)continue;i[g][u].setValue(p.getValue())}}}}catch(m){n={error:m}}finally{try{d&&!d.done&&(o=f.return)&&o.call(f)}finally{if(n)throw n.error}}u++}}catch(m){e={error:m}}finally{try{c&&!c.done&&(r=l.return)&&r.call(l)}finally{if(e)throw e.error}}return i},t.isValidBarcodeColumn=function(t,e){return e>=0&&e<=t.getBarcodeColumnCount()+1},t.getStartColumn=function(e,r,n,o){var i,a,s=o?1:-1,u=null;if(t.isValidBarcodeColumn(e,r-s)&&(u=e.getDetectionResultColumn(r-s).getCodeword(n)),null!=u)return o?u.getEndX():u.getStartX();if(null!=(u=e.getDetectionResultColumn(r).getCodewordNearby(n)))return o?u.getStartX():u.getEndX();if(t.isValidBarcodeColumn(e,r-s)&&(u=e.getDetectionResultColumn(r-s).getCodewordNearby(n)),null!=u)return o?u.getEndX():u.getStartX();for(var l=0;t.isValidBarcodeColumn(e,r-s);){r-=s;try{for(var c=(i=void 0,Ha(e.getDetectionResultColumn(r).getCodewords())),h=c.next();!h.done;h=c.next()){var f=h.value;if(null!=f)return(o?f.getEndX():f.getStartX())+s*l*(f.getEndX()-f.getStartX())}}catch(d){i={error:d}}finally{try{h&&!h.done&&(a=c.return)&&a.call(c)}finally{if(i)throw i.error}}l++}return o?e.getBoundingBox().getMinX():e.getBoundingBox().getMaxX()},t.detectCodeword=function(e,r,n,o,i,a,s,u){i=t.adjustCodewordStartColumn(e,r,n,o,i,a);var l,c=t.getModuleBitCount(e,r,n,o,i,a);if(null==c)return null;var h=Tn.sum(c);if(o)l=i+h;else{for(var f=0;f<c.length/2;f++){var d=c[f];c[f]=c[c.length-1-f],c[c.length-1-f]=d}i=(l=i)-h}if(!t.checkCodewordSkew(h,s,u))return null;var p=Ta.getDecodedValue(c),g=la.getCodeword(p);return-1===g?null:new Oa(i,l,t.getCodewordBucketNumber(p),g)},t.getModuleBitCount=function(t,e,r,n,o,i){for(var a=o,s=new Int32Array(8),u=0,l=n?1:-1,c=n;(n?a<r:a>=e)&&u<s.length;)t.get(a,i)===c?(s[u]++,a+=l):(u++,c=!c);return u===s.length||a===(n?r:e)&&u===s.length-1?s:null},t.getNumberOfECCodeWords=function(t){return 2<<t},t.adjustCodewordStartColumn=function(e,r,n,o,i,a){for(var s=i,u=o?-1:1,l=0;l<2;l++){for(;(o?s>=r:s<n)&&o===e.get(s,a);){if(Math.abs(i-s)>t.CODEWORD_SKEW_SIZE)return i;s+=u}u=-u,o=!o}return s},t.checkCodewordSkew=function(e,r,n){return r-t.CODEWORD_SKEW_SIZE<=e&&e<=n+t.CODEWORD_SKEW_SIZE},t.decodeCodewords=function(e,r,n){if(0===e.length)throw Vr.getFormatInstance();var o=1<<r+1,i=t.correctErrors(e,n,o);t.verifyCodewordCount(e,o);var a=Ua.decode(e,""+r);return a.setErrorsCorrected(i),a.setErasures(n.length),a},t.correctErrors=function(e,r,n){if(null!=r&&r.length>n/2+t.MAX_ERRORS||n<0||n>t.MAX_EC_CODEWORDS)throw xr.getChecksumInstance();return t.errorCorrection.decode(e,n,r)},t.verifyCodewordCount=function(t,e){if(t.length<4)throw Vr.getFormatInstance();var r=t[0];if(r>t.length)throw Vr.getFormatInstance();if(0===r){if(!(e<t.length))throw Vr.getFormatInstance();t[0]=t.length-e}},t.getBitCountForCodeword=function(t){for(var e=new Int32Array(8),r=0,n=e.length-1;!((1&t)!==r&&(r=1&t,--n<0));)e[n]++,t>>=1;return e},t.getCodewordBucketNumber=function(t){return t instanceof Int32Array?this.getCodewordBucketNumber_Int32Array(t):this.getCodewordBucketNumber_number(t)},t.getCodewordBucketNumber_number=function(e){return t.getCodewordBucketNumber(t.getBitCountForCodeword(e))},t.getCodewordBucketNumber_Int32Array=function(t){return(t[0]-t[2]+t[4]-t[6]+9)%9},t.toString=function(t){for(var e=new wa,r=0;r<t.length;r++){e.format("Row %2d: ",r);for(var n=0;n<t[r].length;n++){var o=t[r][n];0===o.getValue().length?e.format(" ",null):e.format("%4d(%2d)",o.getValue()[0],o.getConfidence(o.getValue()[0]))}e.format("%n")}return e.toString()},t.CODEWORD_SKEW_SIZE=2,t.MAX_ERRORS=3,t.MAX_EC_CODEWORDS=512,t.errorCorrection=new va,t}(),Wa=function(){function t(){}return t.prototype.decode=function(e,r){void 0===r&&(r=null);var n=t.decode(e,r,!1);if(null==n||0===n.length||null==n[0])throw Kr.getNotFoundInstance();return n[0]},t.prototype.decodeMultiple=function(e,r){void 0===r&&(r=null);try{return t.decode(e,r,!0)}catch(n){if(n instanceof Vr||n instanceof xr)throw Kr.getNotFoundInstance();throw n}},t.decode=function(e,r,n){var o,i,a=new Array,s=fa.detectMultiple(e,r,n);try{for(var u=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}(s.getPoints()),l=u.next();!l.done;l=u.next()){var c=l.value,h=za.decode(s.getBits(),c[4],c[5],c[6],c[7],t.getMinCodewordWidth(c),t.getMaxCodewordWidth(c)),f=new hn(h.getText(),h.getRawBytes(),void 0,c,dn.PDF_417);f.putMetadata(gn.ERROR_CORRECTION_LEVEL,h.getECLevel());var d=h.getOther();null!=d&&f.putMetadata(gn.PDF417_EXTRA_METADATA,d),a.push(f)}}catch(p){o={error:p}}finally{try{l&&!l.done&&(i=u.return)&&i.call(u)}finally{if(o)throw o.error}}return a.map(function(t){return t})},t.getMaxWidth=function(t,e){return null==t||null==e?0:Math.trunc(Math.abs(t.getX()-e.getX()))},t.getMinWidth=function(t,e){return null==t||null==e?Mr.MAX_VALUE:Math.trunc(Math.abs(t.getX()-e.getX()))},t.getMaxCodewordWidth=function(e){return Math.floor(Math.max(Math.max(t.getMaxWidth(e[0],e[4]),t.getMaxWidth(e[6],e[2])*la.MODULES_IN_CODEWORD/la.MODULES_IN_STOP_PATTERN),Math.max(t.getMaxWidth(e[1],e[5]),t.getMaxWidth(e[7],e[3])*la.MODULES_IN_CODEWORD/la.MODULES_IN_STOP_PATTERN)))},t.getMinCodewordWidth=function(e){return Math.floor(Math.min(Math.min(t.getMinWidth(e[0],e[4]),t.getMinWidth(e[6],e[2])*la.MODULES_IN_CODEWORD/la.MODULES_IN_STOP_PATTERN),Math.min(t.getMinWidth(e[1],e[5]),t.getMinWidth(e[7],e[3])*la.MODULES_IN_CODEWORD/la.MODULES_IN_STOP_PATTERN)))},t.prototype.reset=function(){},t}(),Ga=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Xa=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Ga(e,t),e.kind="ReaderException",e}(wr),$a=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Ya=function(){function t(){}return t.prototype.decode=function(t,e){return this.setHints(e),this.decodeInternal(t)},t.prototype.decodeWithState=function(t){return null!==this.readers&&void 0!==this.readers||this.setHints(null),this.decodeInternal(t)},t.prototype.setHints=function(t){this.hints=t;var e=null!=t&&void 0!==t.get(Fr.TRY_HARDER),r=null==t?null:t.get(Fr.POSSIBLE_FORMATS),n=new Array;if(null!=r){var o=r.some(function(t){return t===dn.UPC_A||t===dn.UPC_E||t===dn.EAN_13||t===dn.EAN_8||t===dn.CODABAR||t===dn.CODE_39||t===dn.CODE_93||t===dn.CODE_128||t===dn.ITF||t===dn.RSS_14||t===dn.RSS_EXPANDED});o&&!e&&n.push(new yi(t)),r.includes(dn.QR_CODE)&&n.push(new ua),r.includes(dn.DATA_MATRIX)&&n.push(new Di),r.includes(dn.AZTEC)&&n.push(new zn),r.includes(dn.PDF_417)&&n.push(new Wa),o&&e&&n.push(new yi(t))}0===n.length&&(e||n.push(new yi(t)),n.push(new ua),n.push(new Di),n.push(new zn),n.push(new Wa),e&&n.push(new yi(t))),this.readers=n},t.prototype.reset=function(){var t,e;if(null!==this.readers)try{for(var r=$a(this.readers),n=r.next();!n.done;n=r.next())n.value.reset()}catch(o){t={error:o}}finally{try{n&&!n.done&&(e=r.return)&&e.call(r)}finally{if(t)throw t.error}}},t.prototype.decodeInternal=function(t){var e,r;if(null===this.readers)throw new Xa("No readers where selected, nothing can be read.");try{for(var n=$a(this.readers),o=n.next();!o.done;o=n.next()){var i=o.value;try{return i.decode(t,this.hints)}catch(a){if(a instanceof Xa)continue}}}catch(a){e={error:a}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(e)throw e.error}}throw new Kr("No MultiFormat Readers were able to detect the code.")},t}(),qa=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();!function(t){function e(e,r){void 0===e&&(e=null),void 0===r&&(r=500);var n=new Ya;return n.setHints(e),t.call(this,n,r)||this}qa(e,t),e.prototype.decodeBitmap=function(t){return this.reader.decodeWithState(t)}}(cn);var Ka=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();!function(t){Ka(function(e){return void 0===e&&(e=500),t.call(this,new Wa,e)||this},t)}(cn);var Za,Qa=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();!function(t){Qa(function(e){return void 0===e&&(e=500),t.call(this,new ua,e)||this},t)}(cn),function(t){t[t.ERROR_CORRECTION=0]="ERROR_CORRECTION",t[t.CHARACTER_SET=1]="CHARACTER_SET",t[t.DATA_MATRIX_SHAPE=2]="DATA_MATRIX_SHAPE",t[t.MIN_SIZE=3]="MIN_SIZE",t[t.MAX_SIZE=4]="MAX_SIZE",t[t.MARGIN=5]="MARGIN",t[t.PDF417_COMPACT=6]="PDF417_COMPACT",t[t.PDF417_COMPACTION=7]="PDF417_COMPACTION",t[t.PDF417_DIMENSIONS=8]="PDF417_DIMENSIONS",t[t.AZTEC_LAYERS=9]="AZTEC_LAYERS",t[t.QR_VERSION=10]="QR_VERSION"}(Za||(Za={}));var Ja=function(){function t(){}return t.applyMaskPenaltyRule1=function(e){return t.applyMaskPenaltyRule1Internal(e,!0)+t.applyMaskPenaltyRule1Internal(e,!1)},t.applyMaskPenaltyRule2=function(e){for(var r=0,n=e.getArray(),o=e.getWidth(),i=e.getHeight(),a=0;a<i-1;a++)for(var s=n[a],u=0;u<o-1;u++){var l=s[u];l===s[u+1]&&l===n[a+1][u]&&l===n[a+1][u+1]&&r++}return t.N2*r},t.applyMaskPenaltyRule3=function(e){for(var r=0,n=e.getArray(),o=e.getWidth(),i=e.getHeight(),a=0;a<i;a++)for(var s=0;s<o;s++){var u=n[a];s+6<o&&1===u[s]&&0===u[s+1]&&1===u[s+2]&&1===u[s+3]&&1===u[s+4]&&0===u[s+5]&&1===u[s+6]&&(t.isWhiteHorizontal(u,s-4,s)||t.isWhiteHorizontal(u,s+7,s+11))&&r++,a+6<i&&1===n[a][s]&&0===n[a+1][s]&&1===n[a+2][s]&&1===n[a+3][s]&&1===n[a+4][s]&&0===n[a+5][s]&&1===n[a+6][s]&&(t.isWhiteVertical(n,s,a-4,a)||t.isWhiteVertical(n,s,a+7,a+11))&&r++}return r*t.N3},t.isWhiteHorizontal=function(t,e,r){e=Math.max(e,0),r=Math.min(r,t.length);for(var n=e;n<r;n++)if(1===t[n])return!1;return!0},t.isWhiteVertical=function(t,e,r,n){r=Math.max(r,0),n=Math.min(n,t.length);for(var o=r;o<n;o++)if(1===t[o][e])return!1;return!0},t.applyMaskPenaltyRule4=function(e){for(var r=0,n=e.getArray(),o=e.getWidth(),i=e.getHeight(),a=0;a<i;a++)for(var s=n[a],u=0;u<o;u++)1===s[u]&&r++;var l=e.getHeight()*e.getWidth();return Math.floor(10*Math.abs(2*r-l)/l)*t.N4},t.getDataMaskBit=function(t,e,r){var n,o;switch(t){case 0:n=r+e&1;break;case 1:n=1&r;break;case 2:n=e%3;break;case 3:n=(r+e)%3;break;case 4:n=Math.floor(r/2)+Math.floor(e/3)&1;break;case 5:n=(1&(o=r*e))+o%3;break;case 6:n=(1&(o=r*e))+o%3&1;break;case 7:n=(o=r*e)%3+(r+e&1)&1;break;default:throw new Er("Invalid mask pattern: "+t)}return 0===n},t.applyMaskPenaltyRule1Internal=function(e,r){for(var n=0,o=r?e.getHeight():e.getWidth(),i=r?e.getWidth():e.getHeight(),a=e.getArray(),s=0;s<o;s++){for(var u=0,l=-1,c=0;c<i;c++){var h=r?a[s][c]:a[c][s];h===l?u++:(u>=5&&(n+=t.N1+(u-5)),u=1,l=h)}u>=5&&(n+=t.N1+(u-5))}return n},t.N1=3,t.N2=3,t.N3=40,t.N4=10,t}(),ts=function(){function t(){this.maskPattern=-1}return t.prototype.getMode=function(){return this.mode},t.prototype.getECLevel=function(){return this.ecLevel},t.prototype.getVersion=function(){return this.version},t.prototype.getMaskPattern=function(){return this.maskPattern},t.prototype.getMatrix=function(){return this.matrix},t.prototype.toString=function(){var t=new $r;return t.append("<<\n"),t.append(" mode: "),t.append(this.mode?this.mode.toString():"null"),t.append("\n ecLevel: "),t.append(this.ecLevel?this.ecLevel.toString():"null"),t.append("\n version: "),t.append(this.version?this.version.toString():"null"),t.append("\n maskPattern: "),t.append(this.maskPattern.toString()),this.matrix?(t.append("\n matrix:\n"),t.append(this.matrix.toString())):t.append("\n matrix: null\n"),t.append(">>\n"),t.toString()},t.prototype.setMode=function(t){this.mode=t},t.prototype.setECLevel=function(t){this.ecLevel=t},t.prototype.setVersion=function(t){this.version=t},t.prototype.setMaskPattern=function(t){this.maskPattern=t},t.prototype.setMatrix=function(t){this.matrix=t},t.isValidMaskPattern=function(e){return e>=0&&e<t.NUM_MASK_PATTERNS},t.NUM_MASK_PATTERNS=8,t}(),es=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),rs=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return es(e,t),e.kind="WriterException",e}(wr);!function(){function t(){}t.clearMatrix=function(t){t.clear(255)},t.buildMatrix=function(e,r,n,o,i){t.clearMatrix(i),t.embedBasicPatterns(n,i),t.embedTypeInfo(r,o,i),t.maybeEmbedVersionInfo(n,i),t.embedDataBits(e,o,i)},t.embedBasicPatterns=function(e,r){t.embedPositionDetectionPatternsAndSeparators(r),t.embedDarkDotAtLeftBottomCorner(r),t.maybeEmbedPositionAdjustmentPatterns(e,r),t.embedTimingPatterns(r)},t.embedTypeInfo=function(e,r,n){var o=new Br;t.makeTypeInfoBits(e,r,o);for(var i=0,a=o.getSize();i<a;++i){var s=o.get(o.getSize()-1-i),u=t.TYPE_INFO_COORDINATES[i],l=u[0],c=u[1];if(n.setBoolean(l,c,s),i<8){var h=n.getWidth()-i-1,f=8;n.setBoolean(h,f,s)}else h=8,f=n.getHeight()-7+(i-8),n.setBoolean(h,f,s)}},t.maybeEmbedVersionInfo=function(e,r){if(!(e.getVersionNumber()<7)){var n=new Br;t.makeVersionInfoBits(e,n);for(var o=17,i=0;i<6;++i)for(var a=0;a<3;++a){var s=n.get(o);o--,r.setBoolean(i,r.getHeight()-11+a,s),r.setBoolean(r.getHeight()-11+a,i,s)}}},t.embedDataBits=function(e,r,n){for(var o=0,i=-1,a=n.getWidth()-1,s=n.getHeight()-1;a>0;){for(6===a&&(a-=1);s>=0&&s<n.getHeight();){for(var u=0;u<2;++u){var l=a-u;if(t.isEmpty(n.get(l,s))){var c=void 0;o<e.getSize()?(c=e.get(o),++o):c=!1,255!==r&&Ja.getDataMaskBit(r,l,s)&&(c=!c),n.setBoolean(l,s,c)}}s+=i}s+=i=-i,a-=2}if(o!==e.getSize())throw new rs("Not all bits consumed: "+o+"/"+e.getSize())},t.findMSBSet=function(t){return 32-Mr.numberOfLeadingZeros(t)},t.calculateBCHCode=function(e,r){if(0===r)throw new Er("0 polynomial");var n=t.findMSBSet(r);for(e<<=n-1;t.findMSBSet(e)>=n;)e^=r<<t.findMSBSet(e)-n;return e},t.makeTypeInfoBits=function(e,r,n){if(!ts.isValidMaskPattern(r))throw new rs("Invalid mask pattern");var o=e.getBits()<<3|r;n.appendBits(o,5);var i=t.calculateBCHCode(o,t.TYPE_INFO_POLY);n.appendBits(i,10);var a=new Br;if(a.appendBits(t.TYPE_INFO_MASK_PATTERN,15),n.xor(a),15!==n.getSize())throw new rs("should not happen but we got: "+n.getSize())},t.makeVersionInfoBits=function(e,r){r.appendBits(e.getVersionNumber(),6);var n=t.calculateBCHCode(e.getVersionNumber(),t.VERSION_INFO_POLY);if(r.appendBits(n,12),18!==r.getSize())throw new rs("should not happen but we got: "+r.getSize())},t.isEmpty=function(t){return 255===t},t.embedTimingPatterns=function(e){for(var r=8;r<e.getWidth()-8;++r){var n=(r+1)%2;t.isEmpty(e.get(r,6))&&e.setNumber(r,6,n),t.isEmpty(e.get(6,r))&&e.setNumber(6,r,n)}},t.embedDarkDotAtLeftBottomCorner=function(t){if(0===t.get(8,t.getHeight()-8))throw new rs;t.setNumber(8,t.getHeight()-8,1)},t.embedHorizontalSeparationPattern=function(e,r,n){for(var o=0;o<8;++o){if(!t.isEmpty(n.get(e+o,r)))throw new rs;n.setNumber(e+o,r,0)}},t.embedVerticalSeparationPattern=function(e,r,n){for(var o=0;o<7;++o){if(!t.isEmpty(n.get(e,r+o)))throw new rs;n.setNumber(e,r+o,0)}},t.embedPositionAdjustmentPattern=function(e,r,n){for(var o=0;o<5;++o)for(var i=t.POSITION_ADJUSTMENT_PATTERN[o],a=0;a<5;++a)n.setNumber(e+a,r+o,i[a])},t.embedPositionDetectionPattern=function(e,r,n){for(var o=0;o<7;++o)for(var i=t.POSITION_DETECTION_PATTERN[o],a=0;a<7;++a)n.setNumber(e+a,r+o,i[a])},t.embedPositionDetectionPatternsAndSeparators=function(e){var r=t.POSITION_DETECTION_PATTERN[0].length;t.embedPositionDetectionPattern(0,0,e),t.embedPositionDetectionPattern(e.getWidth()-r,0,e),t.embedPositionDetectionPattern(0,e.getWidth()-r,e),t.embedHorizontalSeparationPattern(0,7,e),t.embedHorizontalSeparationPattern(e.getWidth()-8,7,e),t.embedHorizontalSeparationPattern(0,e.getWidth()-8,e),t.embedVerticalSeparationPattern(7,0,e),t.embedVerticalSeparationPattern(e.getHeight()-7-1,0,e),t.embedVerticalSeparationPattern(7,e.getHeight()-7,e)},t.maybeEmbedPositionAdjustmentPatterns=function(e,r){if(!(e.getVersionNumber()<2))for(var n=e.getVersionNumber()-1,o=t.POSITION_ADJUSTMENT_PATTERN_COORDINATE_TABLE[n],i=0,a=o.length;i!==a;i++){var s=o[i];if(s>=0)for(var u=0;u!==a;u++){var l=o[u];l>=0&&t.isEmpty(r.get(l,s))&&t.embedPositionAdjustmentPattern(l-2,s-2,r)}}},t.POSITION_DETECTION_PATTERN=Array.from([Int32Array.from([1,1,1,1,1,1,1]),Int32Array.from([1,0,0,0,0,0,1]),Int32Array.from([1,0,1,1,1,0,1]),Int32Array.from([1,0,1,1,1,0,1]),Int32Array.from([1,0,1,1,1,0,1]),Int32Array.from([1,0,0,0,0,0,1]),Int32Array.from([1,1,1,1,1,1,1])]),t.POSITION_ADJUSTMENT_PATTERN=Array.from([Int32Array.from([1,1,1,1,1]),Int32Array.from([1,0,0,0,1]),Int32Array.from([1,0,1,0,1]),Int32Array.from([1,0,0,0,1]),Int32Array.from([1,1,1,1,1])]),t.POSITION_ADJUSTMENT_PATTERN_COORDINATE_TABLE=Array.from([Int32Array.from([-1,-1,-1,-1,-1,-1,-1]),Int32Array.from([6,18,-1,-1,-1,-1,-1]),Int32Array.from([6,22,-1,-1,-1,-1,-1]),Int32Array.from([6,26,-1,-1,-1,-1,-1]),Int32Array.from([6,30,-1,-1,-1,-1,-1]),Int32Array.from([6,34,-1,-1,-1,-1,-1]),Int32Array.from([6,22,38,-1,-1,-1,-1]),Int32Array.from([6,24,42,-1,-1,-1,-1]),Int32Array.from([6,26,46,-1,-1,-1,-1]),Int32Array.from([6,28,50,-1,-1,-1,-1]),Int32Array.from([6,30,54,-1,-1,-1,-1]),Int32Array.from([6,32,58,-1,-1,-1,-1]),Int32Array.from([6,34,62,-1,-1,-1,-1]),Int32Array.from([6,26,46,66,-1,-1,-1]),Int32Array.from([6,26,48,70,-1,-1,-1]),Int32Array.from([6,26,50,74,-1,-1,-1]),Int32Array.from([6,30,54,78,-1,-1,-1]),Int32Array.from([6,30,56,82,-1,-1,-1]),Int32Array.from([6,30,58,86,-1,-1,-1]),Int32Array.from([6,34,62,90,-1,-1,-1]),Int32Array.from([6,28,50,72,94,-1,-1]),Int32Array.from([6,26,50,74,98,-1,-1]),Int32Array.from([6,30,54,78,102,-1,-1]),Int32Array.from([6,28,54,80,106,-1,-1]),Int32Array.from([6,32,58,84,110,-1,-1]),Int32Array.from([6,30,58,86,114,-1,-1]),Int32Array.from([6,34,62,90,118,-1,-1]),Int32Array.from([6,26,50,74,98,122,-1]),Int32Array.from([6,30,54,78,102,126,-1]),Int32Array.from([6,26,52,78,104,130,-1]),Int32Array.from([6,30,56,82,108,134,-1]),Int32Array.from([6,34,60,86,112,138,-1]),Int32Array.from([6,30,58,86,114,142,-1]),Int32Array.from([6,34,62,90,118,146,-1]),Int32Array.from([6,30,54,78,102,126,150]),Int32Array.from([6,24,50,76,102,128,154]),Int32Array.from([6,28,54,80,106,132,158]),Int32Array.from([6,32,58,84,110,136,162]),Int32Array.from([6,26,54,82,110,138,166]),Int32Array.from([6,30,58,86,114,142,170])]),t.TYPE_INFO_COORDINATES=Array.from([Int32Array.from([8,0]),Int32Array.from([8,1]),Int32Array.from([8,2]),Int32Array.from([8,3]),Int32Array.from([8,4]),Int32Array.from([8,5]),Int32Array.from([8,7]),Int32Array.from([8,8]),Int32Array.from([7,8]),Int32Array.from([5,8]),Int32Array.from([4,8]),Int32Array.from([3,8]),Int32Array.from([2,8]),Int32Array.from([1,8]),Int32Array.from([0,8])]),t.VERSION_INFO_POLY=7973,t.TYPE_INFO_POLY=1335,t.TYPE_INFO_MASK_PATTERN=21522}(),Int32Array.from([-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,36,-1,-1,-1,37,38,-1,-1,-1,-1,39,40,-1,41,42,43,0,1,2,3,4,5,6,7,8,9,44,-1,-1,-1,-1,-1,-1,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,-1,-1,-1,-1,-1]),Hr.UTF8.getName();var ns=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();!function(t){function e(e,r,n,o,i,a,s,u){var l=t.call(this,a,s)||this;if(l.yuvData=e,l.dataWidth=r,l.dataHeight=n,l.left=o,l.top=i,o+a>r||i+s>n)throw new Er("Crop rectangle does not fit within image data.");return u&&l.reverseHorizontal(a,s),l}ns(e,t),e.prototype.getRow=function(t,e){if(t<0||t>=this.getHeight())throw new Er("Requested row is outside the image: "+t);var r=this.getWidth();(null==e||e.length<r)&&(e=new Uint8ClampedArray(r));var n=(t+this.top)*this.dataWidth+this.left;return Tr.arraycopy(this.yuvData,n,e,0,r),e},e.prototype.getMatrix=function(){var t=this.getWidth(),e=this.getHeight();if(t===this.dataWidth&&e===this.dataHeight)return this.yuvData;var r=t*e,n=new Uint8ClampedArray(r),o=this.top*this.dataWidth+this.left;if(t===this.dataWidth)return Tr.arraycopy(this.yuvData,o,n,0,r),n;for(var i=0;i<e;i++){var a=i*t;Tr.arraycopy(this.yuvData,o,n,a,t),o+=this.dataWidth}return n},e.prototype.isCropSupported=function(){return!0},e.prototype.crop=function(t,r,n,o){return new e(this.yuvData,this.dataWidth,this.dataHeight,this.left+t,this.top+r,n,o,!1)},e.prototype.renderThumbnail=function(){for(var t=this.getWidth()/e.THUMBNAIL_SCALE_FACTOR,r=this.getHeight()/e.THUMBNAIL_SCALE_FACTOR,n=new Int32Array(t*r),o=this.yuvData,i=this.top*this.dataWidth+this.left,a=0;a<r;a++){for(var s=a*t,u=0;u<t;u++){var l=255&o[i+u*e.THUMBNAIL_SCALE_FACTOR];n[s+u]=4278190080|65793*l}i+=this.dataWidth*e.THUMBNAIL_SCALE_FACTOR}return n},e.prototype.getThumbnailWidth=function(){return this.getWidth()/e.THUMBNAIL_SCALE_FACTOR},e.prototype.getThumbnailHeight=function(){return this.getHeight()/e.THUMBNAIL_SCALE_FACTOR},e.prototype.reverseHorizontal=function(t,e){for(var r=this.yuvData,n=0,o=this.top*this.dataWidth+this.left;n<e;n++,o+=this.dataWidth)for(var i=o+t/2,a=o,s=o+t-1;a<i;a++,s--){var u=r[a];r[a]=r[s],r[s]=u}},e.prototype.invert=function(){return new nn(this)},e.THUMBNAIL_SCALE_FACTOR=2}(en);var os=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();!function(t){function e(e,r,n,o,i,a,s){var u=t.call(this,r,n)||this;if(u.dataWidth=o,u.dataHeight=i,u.left=a,u.top=s,4===e.BYTES_PER_ELEMENT){for(var l=r*n,c=new Uint8ClampedArray(l),h=0;h<l;h++){var f=e[h],d=f>>16&255,p=f>>7&510,g=255&f;c[h]=(d+p+g)/4&255}u.luminances=c}else u.luminances=e;if(void 0===o&&(u.dataWidth=r),void 0===i&&(u.dataHeight=n),void 0===a&&(u.left=0),void 0===s&&(u.top=0),u.left+r>u.dataWidth||u.top+n>u.dataHeight)throw new Er("Crop rectangle does not fit within image data.");return u}os(e,t),e.prototype.getRow=function(t,e){if(t<0||t>=this.getHeight())throw new Er("Requested row is outside the image: "+t);var r=this.getWidth();(null==e||e.length<r)&&(e=new Uint8ClampedArray(r));var n=(t+this.top)*this.dataWidth+this.left;return Tr.arraycopy(this.luminances,n,e,0,r),e},e.prototype.getMatrix=function(){var t=this.getWidth(),e=this.getHeight();if(t===this.dataWidth&&e===this.dataHeight)return this.luminances;var r=t*e,n=new Uint8ClampedArray(r),o=this.top*this.dataWidth+this.left;if(t===this.dataWidth)return Tr.arraycopy(this.luminances,o,n,0,r),n;for(var i=0;i<e;i++){var a=i*t;Tr.arraycopy(this.luminances,o,n,a,t),o+=this.dataWidth}return n},e.prototype.isCropSupported=function(){return!0},e.prototype.crop=function(t,r,n,o){return new e(this.luminances,n,o,this.dataWidth,this.dataHeight,this.left+t,this.top+r)},e.prototype.invert=function(){return new nn(this)}}(en);var is=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();!function(t){function e(){return null!==t&&t.apply(this,arguments)||this}is(e,t),e.forName=function(t){return this.getCharacterSetECIByName(t)}}(Hr);var as=function(){function t(t){this.previous=t}return t.prototype.getPrevious=function(){return this.previous},t}(),ss=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),us=function(t){function e(e,r,n){var o=t.call(this,e)||this;return o.value=r,o.bitCount=n,o}return ss(e,t),e.prototype.appendTo=function(t,e){t.appendBits(this.value,this.bitCount)},e.prototype.add=function(t,r){return new e(this,t,r)},e.prototype.addBinaryShift=function(t,r){return console.warn("addBinaryShift on SimpleToken, this simply returns a copy of this token"),new e(this,t,r)},e.prototype.toString=function(){var t=this.value&(1<<this.bitCount)-1;return t|=1<<this.bitCount,"<"+Mr.toBinaryString(t|1<<this.bitCount).substring(1)+">"},e}(as),ls=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();!function(t){function e(e,r,n){var o=t.call(this,e,0,0)||this;return o.binaryShiftStart=r,o.binaryShiftByteCount=n,o}ls(e,t),e.prototype.appendTo=function(t,e){for(var r=0;r<this.binaryShiftByteCount;r++)(0===r||31===r&&this.binaryShiftByteCount<=62)&&(t.appendBits(31,5),this.binaryShiftByteCount>62?t.appendBits(this.binaryShiftByteCount-31,16):0===r?t.appendBits(Math.min(this.binaryShiftByteCount,31),5):t.appendBits(this.binaryShiftByteCount-31,5)),t.appendBits(e[this.binaryShiftStart+r],8)},e.prototype.addBinaryShift=function(t,r){return new e(this,t,r)},e.prototype.toString=function(){return"<"+this.binaryShiftStart+"::"+(this.binaryShiftStart+this.binaryShiftByteCount-1)+">"}}(us),new us(null,0,0);!function(t){var e,r;try{for(var n=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}(t),o=n.next();!o.done;o=n.next()){var i=o.value;Pr.fill(i,-1)}}catch(a){e={error:a}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(e)throw e.error}}t[0][4]=0,t[1][4]=0,t[1][0]=28,t[3][4]=0,t[2][4]=0,t[2][0]=15}(Pr.createInt32Array(6,6)),function(t){var e=Xr.getCharCode(" "),r=Xr.getCharCode("."),n=Xr.getCharCode(",");t[0][e]=1;for(var o=Xr.getCharCode("Z"),i=Xr.getCharCode("A"),a=i;a<=o;a++)t[0][a]=a-i+2;t[1][e]=1;var s=Xr.getCharCode("z"),u=Xr.getCharCode("a");for(a=u;a<=s;a++)t[1][a]=a-u+2;t[2][e]=1;var l=Xr.getCharCode("9"),c=Xr.getCharCode("0");for(a=c;a<=l;a++)t[2][a]=a-c+2;t[2][n]=12,t[2][r]=13;for(var h=["\0"," ","","","","","","","","\b","\t","\n","\v","\f","\r","","","","","","@","\\","^","_","`","|","~",""],f=0;f<h.length;f++)t[3][Xr.getCharCode(h[f])]=f;var d=["\0","\r","\0","\0","\0","\0","!","'","#","$","%","&","'","(",")","*","+",",","-",".","/",":",";","<","=",">","?","[","]","{","}"];for(f=0;f<d.length;f++)Xr.getCharCode(d[f])>0&&(t[4][Xr.getCharCode(d[f])]=f)}(Pr.createInt32Array(5,256));var cs=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),hs=function(t){function e(r){var n=t.call(this,r.width,r.height)||this;return n.canvas=r,n.buffer=e.makeBufferFromCanvasImageData(r),n}return cs(e,t),e.makeBufferFromCanvasImageData=function(t){var r=t.getContext("2d");if(!r)throw new Error("Couldn't get canvas context.");var n=r.getImageData(0,0,t.width,t.height);return e.toGrayscaleBuffer(n.data,t.width,t.height)},e.toGrayscaleBuffer=function(t,e,r){for(var n=new Uint8ClampedArray(e*r),o=0,i=0,a=t.length;o<a;o+=4,i++){var s=void 0;s=0===t[o+3]?255:306*t[o]+601*t[o+1]+117*t[o+2]+512>>10,n[i]=s}return n},e.prototype.getRow=function(t,e){if(t<0||t>=this.getHeight())throw new Er("Requested row is outside the image: "+t);var r=this.getWidth(),n=t*r;return null===e?e=this.buffer.slice(n,n+r):(e.length<r&&(e=new Uint8ClampedArray(r)),e.set(this.buffer.slice(n,n+r))),e},e.prototype.getMatrix=function(){return this.buffer},e.prototype.isCropSupported=function(){return!0},e.prototype.crop=function(e,r,n,o){return t.prototype.crop.call(this,e,r,n,o),this},e.prototype.isRotateSupported=function(){return!0},e.prototype.rotateCounterClockwise=function(){return this.rotate(-90),this},e.prototype.rotateCounterClockwise45=function(){return this.rotate(-45),this},e.prototype.invert=function(){return new nn(this)},e.prototype.getTempCanvasElement=function(){if(null===this.tempCanvasElement){var t=this.canvas.ownerDocument.createElement("canvas");t.width=this.canvas.width,t.height=this.canvas.height,this.tempCanvasElement=t}return this.tempCanvasElement},e.prototype.rotate=function(t){var r=this.getTempCanvasElement();if(!r)throw new Error("Could not create a Canvas element.");var n=t*e.DEGREE_TO_RADIANS,o=this.canvas.width,i=this.canvas.height,a=Math.ceil(Math.abs(Math.cos(n))*o+Math.abs(Math.sin(n))*i),s=Math.ceil(Math.abs(Math.sin(n))*o+Math.abs(Math.cos(n))*i);r.width=a,r.height=s;var u=r.getContext("2d");if(!u)throw new Error("Could not create a Convas Context element.");return u.translate(a/2,s/2),u.rotate(n),u.drawImage(this.canvas,o/-2,i/-2),this.buffer=e.makeBufferFromCanvasImageData(r),this},e.DEGREE_TO_RADIANS=Math.PI/180,e}(en);function fs(){return"undefined"!=typeof navigator}var ds=function(){return ds=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},ds.apply(this,arguments)},ps=function(t,e,r,n){return new(r||(r=Promise))(function(e,o){function i(t){try{s(n.next(t))}catch(e){o(e)}}function a(t){try{s(n.throw(t))}catch(e){o(e)}}function s(t){var n;t.done?e(t.value):(n=t.value,n instanceof r?n:new r(function(t){t(n)})).then(i,a)}s((n=n.apply(t,[])).next())})},gs=function(t,e){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(s){i=[6,s],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},ms=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},vs={delayBetweenScanAttempts:500,delayBetweenScanSuccess:500,tryPlayVideoTimeout:5e3},ys=function(){function t(t,e,r){void 0===e&&(e=new Map),void 0===r&&(r={}),this.reader=t,this.hints=e,this.options=ds(ds({},vs),r)}return Object.defineProperty(t.prototype,"possibleFormats",{set:function(t){this.hints.set(Fr.POSSIBLE_FORMATS,t)},enumerable:!1,configurable:!0}),t.addVideoSource=function(t,e){try{t.srcObject=e}catch(r){t.src=URL.createObjectURL(e)}},t.mediaStreamSetTorch=function(t,e){return ps(this,0,void 0,function(){return gs(this,function(r){switch(r.label){case 0:return[4,t.applyConstraints({advanced:[{fillLightMode:e?"flash":"off",torch:!!e}]})];case 1:return r.sent(),[2]}})})},t.mediaStreamIsTorchCompatible=function(e){var r,n,o=e.getVideoTracks();try{for(var i=ms(o),a=i.next();!a.done;a=i.next()){var s=a.value;if(t.mediaStreamIsTorchCompatibleTrack(s))return!0}}catch(u){r={error:u}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return!1},t.mediaStreamIsTorchCompatibleTrack=function(t){try{return"torch"in t.getCapabilities()}catch(e){return console.error(e),console.warn("Your browser may be not fully compatible with WebRTC and/or ImageCapture specs. Torch will not be available."),!1}},t.isVideoPlaying=function(t){return t.currentTime>0&&!t.paused&&t.readyState>2},t.getMediaElement=function(t,e){var r=document.getElementById(t);if(!r)throw new Cr("element with id '"+t+"' not found");if(r.nodeName.toLowerCase()!==e.toLowerCase())throw new Cr("element with id '"+t+"' must be an "+e+" element");return r},t.createVideoElement=function(e){if(e instanceof HTMLVideoElement)return e;if("string"==typeof e)return t.getMediaElement(e,"video");if(!e&&"undefined"!=typeof document){var r=document.createElement("video");return r.width=200,r.height=200,r}throw new Error("Couldn't get videoElement from videoSource!")},t.prepareImageElement=function(e){if(e instanceof HTMLImageElement)return e;if("string"==typeof e)return t.getMediaElement(e,"img");if(void 0===e){var r=document.createElement("img");return r.width=200,r.height=200,r}throw new Error("Couldn't get imageElement from imageSource!")},t.prepareVideoElement=function(e){var r=t.createVideoElement(e);return r.setAttribute("autoplay","true"),r.setAttribute("muted","true"),r.setAttribute("playsinline","true"),r},t.isImageLoaded=function(t){return!!t.complete&&0!==t.naturalWidth},t.createBinaryBitmapFromCanvas=function(t){var e=new hs(t),r=new tn(e);return new Ir(r)},t.drawImageOnCanvas=function(t,e){t.drawImage(e,0,0)},t.getMediaElementDimensions=function(t){if(t instanceof HTMLVideoElement)return{height:t.videoHeight,width:t.videoWidth};if(t instanceof HTMLImageElement)return{height:t.naturalHeight||t.height,width:t.naturalWidth||t.width};throw new Error("Couldn't find the Source's dimentions!")},t.createCaptureCanvas=function(e){if(!e)throw new Cr("Cannot create a capture canvas without a media element.");if("undefined"==typeof document)throw new Error('The page "Document" is undefined, make sure you\'re running in a browser.');var r=document.createElement("canvas"),n=t.getMediaElementDimensions(e),o=n.width,i=n.height;return r.style.width=o+"px",r.style.height=i+"px",r.width=o,r.height=i,r},t.tryPlayVideo=function(e){return ps(this,0,void 0,function(){var r;return gs(this,function(n){switch(n.label){case 0:if(null==e?void 0:e.ended)return console.error("Trying to play video that has ended."),[2,!1];if(t.isVideoPlaying(e))return console.warn("Trying to play video that is already playing."),[2,!0];n.label=1;case 1:return n.trys.push([1,3,,4]),[4,e.play()];case 2:return n.sent(),[2,!0];case 3:return r=n.sent(),console.warn("It was not possible to play the video.",r),[2,!1];case 4:return[2]}})})},t.createCanvasFromMediaElement=function(e){var r=t.createCaptureCanvas(e),n=r.getContext("2d");if(!n)throw new Error("Couldn't find Canvas 2D Context.");return t.drawImageOnCanvas(n,e),r},t.createBinaryBitmapFromMediaElem=function(e){var r=t.createCanvasFromMediaElement(e);return t.createBinaryBitmapFromCanvas(r)},t.destroyImageElement=function(t){t.src="",t.removeAttribute("src"),t=void 0},t.listVideoInputDevices=function(){return ps(this,0,void 0,function(){var t,e,r,n,o,i,a,s,u,l,c,h;return gs(this,function(f){switch(f.label){case 0:if(!fs())throw new Error("Can't enumerate devices, navigator is not present.");if(!(fs()&&navigator.mediaDevices&&navigator.mediaDevices.enumerateDevices))throw new Error("Can't enumerate devices, method not supported.");return[4,navigator.mediaDevices.enumerateDevices()];case 1:t=f.sent(),e=[];try{for(r=ms(t),n=r.next();!n.done;n=r.next())o=n.value,"videoinput"===(i="video"===o.kind?"videoinput":o.kind)&&(a=o.deviceId||o.id,s=o.label||"Video device "+(e.length+1),u=o.groupId,l={deviceId:a,label:s,kind:i,groupId:u},e.push(l))}catch(d){c={error:d}}finally{try{n&&!n.done&&(h=r.return)&&h.call(r)}finally{if(c)throw c.error}}return[2,e]}})})},t.findDeviceById=function(e){return ps(this,0,void 0,function(){var r;return gs(this,function(n){switch(n.label){case 0:return[4,t.listVideoInputDevices()];case 1:return(r=n.sent())?[2,r.find(function(t){return t.deviceId===e})]:[2]}})})},t.cleanVideoSource=function(t){if(t){try{t.srcObject=null}catch(e){t.src=""}t&&t.removeAttribute("src")}},t.playVideoOnLoadAsync=function(e,r){return ps(this,0,void 0,function(){return gs(this,function(n){switch(n.label){case 0:return[4,t.tryPlayVideo(e)];case 1:return n.sent()?[2,!0]:[2,new Promise(function(n,o){var i=setTimeout(function(){t.isVideoPlaying(e)||(o(!1),e.removeEventListener("canplay",a))},r),a=function(){t.tryPlayVideo(e).then(function(t){clearTimeout(i),e.removeEventListener("canplay",a),n(t)})};e.addEventListener("canplay",a)})]}})})},t.attachStreamToVideo=function(e,r,n){return void 0===n&&(n=5e3),ps(this,0,void 0,function(){var o;return gs(this,function(i){switch(i.label){case 0:return o=t.prepareVideoElement(r),t.addVideoSource(o,e),[4,t.playVideoOnLoadAsync(o,n)];case 1:return i.sent(),[2,o]}})})},t._waitImageLoad=function(e){return new Promise(function(r,n){var o=setTimeout(function(){t.isImageLoaded(e)||(e.removeEventListener("load",i),n())},1e4),i=function(){clearTimeout(o),e.removeEventListener("load",i),r()};e.addEventListener("load",i)})},t.checkCallbackFnOrThrow=function(t){if(!t)throw new Cr("`callbackFn` is a required parameter, you cannot capture results without it.")},t.disposeMediaStream=function(t){t.getVideoTracks().forEach(function(t){return t.stop()}),t=void 0},t.prototype.decode=function(e){var r=t.createCanvasFromMediaElement(e);return this.decodeFromCanvas(r)},t.prototype.decodeBitmap=function(t){return this.reader.decode(t,this.hints)},t.prototype.decodeFromCanvas=function(e){var r=t.createBinaryBitmapFromCanvas(e);return this.decodeBitmap(r)},t.prototype.decodeFromImageElement=function(e){return ps(this,0,void 0,function(){var r;return gs(this,function(n){switch(n.label){case 0:if(!e)throw new Cr("An image element must be provided.");return r=t.prepareImageElement(e),[4,this._decodeOnLoadImage(r)];case 1:return[2,n.sent()]}})})},t.prototype.decodeFromImageUrl=function(e){return ps(this,0,void 0,function(){var r;return gs(this,function(n){switch(n.label){case 0:if(!e)throw new Cr("An URL must be provided.");(r=t.prepareImageElement()).src=e,n.label=1;case 1:return n.trys.push([1,,3,4]),[4,this.decodeFromImageElement(r)];case 2:return[2,n.sent()];case 3:return t.destroyImageElement(r),[7];case 4:return[2]}})})},t.prototype.decodeFromConstraints=function(e,r,n){return ps(this,0,void 0,function(){var o,i;return gs(this,function(a){switch(a.label){case 0:return t.checkCallbackFnOrThrow(n),[4,navigator.mediaDevices.getUserMedia(e)];case 1:o=a.sent(),a.label=2;case 2:return a.trys.push([2,4,,5]),[4,this.decodeFromStream(o,r,n)];case 3:return[2,a.sent()];case 4:throw i=a.sent(),t.disposeMediaStream(o),i;case 5:return[2]}})})},t.prototype.decodeFromStream=function(e,r,n){return ps(this,0,void 0,function(){var o,i,a,s,u,l,c,h,f,d,p=this;return gs(this,function(g){switch(g.label){case 0:return t.checkCallbackFnOrThrow(n),o=this.options.tryPlayVideoTimeout,[4,t.attachStreamToVideo(e,r,o)];case 1:return i=g.sent(),a=function(){var t,r;try{for(var n=ms(e.getVideoTracks()),o=n.next();!o.done;o=n.next())o.value.stop()}catch(i){t={error:i}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(t)throw t.error}}e=void 0},s=function(){a(),t.cleanVideoSource(i)},u=this.scan(i,n,s),l=e.getVideoTracks(),c=ds(ds({},u),{stop:function(){u.stop()},streamVideoConstraintsApply:function(t,e){return ps(this,0,void 0,function(){var r,n,o,i,a,s;return gs(this,function(u){switch(u.label){case 0:r=e?l.filter(e):l,u.label=1;case 1:u.trys.push([1,6,7,8]),n=ms(r),o=n.next(),u.label=2;case 2:return o.done?[3,5]:[4,o.value.applyConstraints(t)];case 3:u.sent(),u.label=4;case 4:return o=n.next(),[3,2];case 5:return[3,8];case 6:return i=u.sent(),a={error:i},[3,8];case 7:try{o&&!o.done&&(s=n.return)&&s.call(n)}finally{if(a)throw a.error}return[7];case 8:return[2]}})})},streamVideoConstraintsGet:function(t){return l.find(t).getConstraints()},streamVideoSettingsGet:function(t){return l.find(t).getSettings()},streamVideoCapabilitiesGet:function(t){return l.find(t).getCapabilities()}}),t.mediaStreamIsTorchCompatible(e)&&(h=null==l?void 0:l.find(function(e){return t.mediaStreamIsTorchCompatibleTrack(e)}),f=function(e){return ps(p,0,void 0,function(){return gs(this,function(r){switch(r.label){case 0:return[4,t.mediaStreamSetTorch(h,e)];case 1:return r.sent(),[2]}})})},c.switchTorch=f,d=function(){u.stop(),f(!1)},c.stop=d),[2,c]}})})},t.prototype.decodeFromVideoDevice=function(e,r,n){return ps(this,0,void 0,function(){var o;return gs(this,function(i){switch(i.label){case 0:return t.checkCallbackFnOrThrow(n),o={video:e?{deviceId:{exact:e}}:{facingMode:"environment"}},[4,this.decodeFromConstraints(o,r,n)];case 1:return[2,i.sent()]}})})},t.prototype.decodeFromVideoElement=function(e,r){return ps(this,0,void 0,function(){var n,o;return gs(this,function(i){switch(i.label){case 0:if(t.checkCallbackFnOrThrow(r),!e)throw new Cr("A video element must be provided.");return n=t.prepareVideoElement(e),o=this.options.tryPlayVideoTimeout,[4,t.playVideoOnLoadAsync(n,o)];case 1:return i.sent(),[2,this.scan(n,r)]}})})},t.prototype.decodeFromVideoUrl=function(e,r){return ps(this,0,void 0,function(){var n,o,i;return gs(this,function(a){switch(a.label){case 0:if(t.checkCallbackFnOrThrow(r),!e)throw new Cr("An URL must be provided.");return(n=t.prepareVideoElement()).src=e,o=function(){t.cleanVideoSource(n)},i=this.options.tryPlayVideoTimeout,[4,t.playVideoOnLoadAsync(n,i)];case 1:return a.sent(),[2,this.scan(n,r,o)]}})})},t.prototype.decodeOnceFromConstraints=function(t,e){return ps(this,0,void 0,function(){var r;return gs(this,function(n){switch(n.label){case 0:return[4,navigator.mediaDevices.getUserMedia(t)];case 1:return r=n.sent(),[4,this.decodeOnceFromStream(r,e)];case 2:return[2,n.sent()]}})})},t.prototype.decodeOnceFromStream=function(e,r){return ps(this,0,void 0,function(){var n,o;return gs(this,function(i){switch(i.label){case 0:return n=Boolean(r),[4,t.attachStreamToVideo(e,r)];case 1:o=i.sent(),i.label=2;case 2:return i.trys.push([2,,4,5]),[4,this.scanOneResult(o)];case 3:return[2,i.sent()];case 4:return n||t.cleanVideoSource(o),[7];case 5:return[2]}})})},t.prototype.decodeOnceFromVideoDevice=function(t,e){return ps(this,0,void 0,function(){var r;return gs(this,function(n){switch(n.label){case 0:return r={video:t?{deviceId:{exact:t}}:{facingMode:"environment"}},[4,this.decodeOnceFromConstraints(r,e)];case 1:return[2,n.sent()]}})})},t.prototype.decodeOnceFromVideoElement=function(e){return ps(this,0,void 0,function(){var r,n;return gs(this,function(o){switch(o.label){case 0:if(!e)throw new Cr("A video element must be provided.");return r=t.prepareVideoElement(e),n=this.options.tryPlayVideoTimeout,[4,t.playVideoOnLoadAsync(r,n)];case 1:return o.sent(),[4,this.scanOneResult(r)];case 2:return[2,o.sent()]}})})},t.prototype.decodeOnceFromVideoUrl=function(e){return ps(this,0,void 0,function(){var r,n;return gs(this,function(o){switch(o.label){case 0:if(!e)throw new Cr("An URL must be provided.");(r=t.prepareVideoElement()).src=e,n=this.decodeOnceFromVideoElement(r),o.label=1;case 1:return o.trys.push([1,,3,4]),[4,n];case 2:return[2,o.sent()];case 3:return t.cleanVideoSource(r),[7];case 4:return[2]}})})},t.prototype.scanOneResult=function(t,e,r,n){var o=this;return void 0===e&&(e=!0),void 0===r&&(r=!0),void 0===n&&(n=!0),new Promise(function(i,a){o.scan(t,function(t,o,s){if(t)return i(t),void s.stop();if(o){if(o instanceof Kr&&e)return;if(o instanceof xr&&r)return;if(o instanceof Vr&&n)return;s.stop(),a(o)}})})},t.prototype.scan=function(e,r,n){var o=this;t.checkCallbackFnOrThrow(r);var i=t.createCaptureCanvas(e),a=i.getContext("2d");if(!a)throw new Error("Couldn't create canvas for visual element scan.");var s,u=function(){a=void 0,i=void 0},l=!1,c={stop:function(){l=!0,clearTimeout(s),u(),n&&n()}},h=function(){if(!l)try{t.drawImageOnCanvas(a,e);var f=o.decodeFromCanvas(i);r(f,void 0,c),s=setTimeout(h,o.options.delayBetweenScanSuccess)}catch(d){if(r(void 0,d,c),d instanceof xr||d instanceof Vr||d instanceof Kr)return void(s=setTimeout(h,o.options.delayBetweenScanAttempts));u(),n&&n(d)}};return h(),c},t.prototype._decodeOnLoadImage=function(e){return ps(this,0,void 0,function(){return gs(this,function(r){switch(r.label){case 0:return t.isImageLoaded(e)?[3,2]:[4,t._waitImageLoad(e)];case 1:r.sent(),r.label=2;case 2:return[2,this.decode(e)]}})})},t}(),_s=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();!function(t){_s(function(e,r){return t.call(this,new zn,e,r)||this},t)}(ys);var ws=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();!function(t){ws(function(e,r){return t.call(this,new yi(e),e,r)||this},t)}(ys);var bs=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();!function(t){bs(function(e,r){return t.call(this,new Di,e,r)||this},t)}(ys);var Cs=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();!function(t){function e(e,r){var n=this,o=new Ya;return o.setHints(e),(n=t.call(this,o,e,r)||this).reader=o,n}Cs(e,t),Object.defineProperty(e.prototype,"possibleFormats",{set:function(t){this.hints.set(Fr.POSSIBLE_FORMATS,t),this.reader.setHints(this.hints)},enumerable:!1,configurable:!0}),e.prototype.decodeBitmap=function(t){return this.reader.decodeWithState(t)},e.prototype.setHints=function(t){this.hints=t,this.reader.setHints(this.hints)}}(ys);var As=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();!function(t){As(function(e,r){return t.call(this,new Wa,e,r)||this},t)}(ys);var Es=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Is=function(t){function e(e,r){return t.call(this,new ua,e,r)||this}return Es(e,t),e}(ys),Ss=function(t,e,r){var n=typeof t===r;return n||console.warn('[ReactQrReader]: Expected "'.concat(e,'" to be a of type "').concat(r,'".')),n},xs=function(){return xs=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},xs.apply(this,arguments)},Os={width:"100%",paddingTop:"100%",overflow:"hidden",position:"relative"},Ts={top:0,left:0,width:"100%",height:"100%",display:"block",overflow:"hidden",position:"absolute",transform:void 0},Ns=function(t){var r=t.videoContainerStyle,n=t.containerStyle,o=t.videoStyle,i=t.constraints,a=t.ViewFinder,s=t.scanDelay,u=t.className,l=t.onResult,c=t.videoId;return function(t){var r=t.scanDelay,n=t.constraints,o=t.onResult,i=t.videoId,a=e.useRef(null);e.useEffect(function(){var t,e=new Is(null,{delayBetweenScanAttempts:r});return(t="undefined"!=typeof navigator&&!!navigator.mediaDevices)||console.warn('[ReactQrReader]: MediaDevices API has no support for your browser. You can fix this by running "npm i webrtc-adapter"'),!t&&Ss(o,"onResult","function")&&o(null,new Error('MediaDevices API has no support for your browser. You can fix this by running "npm i webrtc-adapter"'),e),Ss(n,"constraints","object")&&e.decodeFromConstraints({video:n},i,function(t,r){Ss(o,"onResult","function")&&o(t,r,e)}).then(function(t){return a.current=t}).catch(function(t){Ss(o,"onResult","function")&&o(null,t,e)}),function(){var t;null===(t=a.current)||void 0===t||t.stop()}},[])}({constraints:i,scanDelay:s,onResult:l,videoId:c}),h.createElement("section",{className:u,style:n},h.createElement("div",{style:xs(xs({},Os),r)},!!a&&h.createElement(a,null),h.createElement("video",{muted:!0,id:c,style:xs(xs(xs({},Ts),o),{transform:"user"===(null==i?void 0:i.facingMode)&&"scaleX(-1)"})})))};function ks({onResult:t,setVisible:r,title:n,helpLink:o}){const[i,a]=e.useState(""),[s,u]=e.useState(!1);return Qt.jsxs(Qt.Fragment,{children:[Qt.jsxs(cr,{visible:!0,setVisible:r,hideScrollBar:!1,maxWidth:500,children:[Qt.jsx(dr,{helpLink:o,setVisible:r,children:n}),Qt.jsx(fr,{children:Qt.jsx(hr,{children:Qt.jsxs("div",{className:"position-relative my-2",children:[Qt.jsx(Ns,{onResult:function(e,n){(null==n?void 0:n.message)&&(a(`Ocorreu um erro ao fazer a leitura: ${n.message}`),"Requested device not found"===n.message&&u(!0)),e&&t&&(t(e),r(!1))},constraints:{facingMode:"environment"}}),Qt.jsxs("svg",{width:"50px",viewBox:"0 0 100 100",style:{top:"0px",left:"0px",zIndex:1,boxSizing:"border-box",border:"50px solid rgba(0, 0, 0, 0.25)",borderRadius:"15px",position:"absolute",width:"100%",height:"100%"},children:[Qt.jsx("path",{fill:"none",d:"M13,0 L0,0 L0,13",stroke:"rgba(255, 0, 0, 0.5)",strokeWidth:"5"}),Qt.jsx("path",{fill:"none",d:"M0,87 L0,100 L13,100",stroke:"rgba(255, 0, 0, 0.5)",strokeWidth:"5"}),Qt.jsx("path",{fill:"none",d:"M87,100 L100,100 L100,87",stroke:"rgba(255, 0, 0, 0.5)",strokeWidth:"5"}),Qt.jsx("path",{fill:"none",d:"M100,13 L100,0 87,0",stroke:"rgba(255, 0, 0, 0.5)",strokeWidth:"5"})]})]})})})]}),i&&Qt.jsx(se,{onConfirm:function(){a(),s&&r(!1)},children:i})]})}Ns.displayName="QrReader",Ns.defaultProps={constraints:{facingMode:"user"},videoId:"video",scanDelay:500};const Rs=o.div`
535
535
  display: flex;
536
536
  align-items: center;
537
537
 
@@ -549,7 +549,7 @@
549
549
  min-height: 16px;
550
550
  }
551
551
  }
552
- `;function Ps(t){return"number"!=typeof t&&(t=0),t||(t=0),Number.isNaN(t)&&(t=0),Number.isFinite(t)||(t=0),t}const Ms=o.div`
552
+ `;function Ds(t){return"number"!=typeof t&&(t=0),t||(t=0),Number.isNaN(t)&&(t=0),Number.isFinite(t)||(t=0),t}const Ps=o.div`
553
553
  --loading-bar-size: 2px;
554
554
 
555
555
  background-color: var(--loading-bar-bg);
@@ -570,9 +570,22 @@
570
570
  width: ${({position:t})=>t[1]}%;
571
571
  animation: FadeIn 0.5s both;
572
572
  }
573
- `;function ks({visible:t}){const[r,n]=e.useState([0,0]);return t?(setTimeout(()=>{let[t,e]=r;e<100?e++:e>50&&t++,100==t&&(t=0,e=0),n([t,e])},5),Qt.jsx(Ms,{position:r,children:Qt.jsx("div",{className:"floating-bar",children:Qt.jsx("span",{className:"d-none",children:"Carregando..."})})})):null}function Ls({visible:t,message:e="Aguarde...",isbar:r=!1}){return t?r?Qt.jsx(ks,{visible:t}):Qt.jsx("div",{className:"loading--container",children:Qt.jsxs("div",{className:"loading-body",children:[Qt.jsx("div",{className:"spinner-border text-info"}),Qt.jsx("span",{children:e})]})}):null}function js({name:t,value:e,onChange:r,invalid:n=!1,...o}){return Qt.jsx(u,{placeholder:"Informe o telefone",className:"form-control "+(n?"is-invalid":""),format:"(##) # ####-####",mask:"_",value:e,name:t,onValueChange:e=>function(t,e,r){r&&r({target:{name:e,value:t.formattedValue}})}(e,t,r),...o})}function Bs(t){const e=String(t).replace(/\D/g,"");let n=!1;return r.validarCPF(e)||(n=!0),"00000000000"==e&&(n=!1),""==t&&(n=!1),n}function Fs(t){const e=String(t).replace(/\D/g,"");let n=!1;return r.validarCNPJ(e)||(n=!0),"00000000000000"==e&&(n=!1),""==t&&(n=!1),n}function Vs(t){const e=String(t).replace(/\D/g,"");let r=!1;return e.length<=11&&Bs(t)&&(r=!0),e.length>11&&Fs(t)&&(r=!0),""==t&&(r=!1),r}function Hs(t,e,r){if(r){r({target:{name:e,value:(n=t.floatValue,!n||null==n||isNaN(n)?0:Number(n))}})}var n}const Us=({name:t,onChange:e,onClick:r,allowNegative:n=!1,...o})=>Qt.jsx(u,{name:t,thousandSeparator:".",decimalSeparator:",",decimalScale:2,fixedDecimalScale:!0,prefix:"R$ ",className:"form-control",allowNegative:n,onValueChange:r=>Hs(r,t,e),onClick:function(t){r?r(t):t.target.select()},...o}),Ws=({name:t,onChange:e,onClick:r,allowNegative:n=!0,decimalScale:o=2,...i})=>Qt.jsx(u,{name:t,thousandSeparator:".",decimalSeparator:",",fixedDecimalScale:!0,prefix:"",className:"form-control",decimalScale:o,allowNegative:n,onValueChange:r=>Hs(r,t,e),onClick:function(t){r?r(t):t.target.select()},...i}),zs=({name:t,onChange:e,allowNegative:r=!0,decimalScale:n=2,...o})=>Qt.jsx(u,{thousandSeparator:".",decimalSeparator:",",fixedDecimalScale:!0,prefix:"",suffix:"%",className:"form-control",decimalScale:n,allowNegative:r,onValueChange:r=>Hs(r,t,e),name:t,...o}),Gs=({name:t,onChange:e,...r})=>Qt.jsx(u,{thousandSeparator:".",decimalSeparator:",",fixedDecimalScale:!0,prefix:"",className:"form-control",decimalScale:0,allowNegative:!1,onValueChange:r=>Hs(r,t,e),...r}),Xs=t=>Qt.jsx(u,{name:t.name,format:"##:##",mask:"_",value:t.value,onChange:t.onChange,className:"form-control",...t}),$s=t=>Qt.jsx(i.Input,{tag:u,name:t.name,format:"###.###.###-##",mask:"_",value:t.value,onChange:t.onChange,invalid:Bs(t.value),...t}),Ys=t=>Qt.jsx(i.Input,{tag:u,name:t.name,format:"##.###.###/####-##",mask:"_",value:t.value,onChange:t.onChange,invalid:Fs(t.value),...t}),qs=t=>Qt.jsxs("select",{className:"form-select",name:t.name,value:t.value,onChange:t.onChange,...t,children:[Qt.jsx("option",{value:"",children:"- Selecione o estado -"}),Qt.jsx("option",{value:"EX",children:"Estrangeiro"}),Qt.jsx("option",{value:"AC",children:"Acre"}),Qt.jsx("option",{value:"AL",children:"Alagoas"}),Qt.jsx("option",{value:"AP",children:"Amapá"}),Qt.jsx("option",{value:"AM",children:"Amazonas"}),Qt.jsx("option",{value:"BA",children:"Bahia"}),Qt.jsx("option",{value:"CE",children:"Ceará"}),Qt.jsx("option",{value:"DF",children:"Distrito Federal"}),Qt.jsx("option",{value:"ES",children:"Espírito Santo"}),Qt.jsx("option",{value:"GO",children:"Goiás"}),Qt.jsx("option",{value:"MA",children:"Maranhão"}),Qt.jsx("option",{value:"MT",children:"Mato Grosso"}),Qt.jsx("option",{value:"MS",children:"Mato Grosso do Sul"}),Qt.jsx("option",{value:"MG",children:"Minas Gerais"}),Qt.jsx("option",{value:"PA",children:"Pará"}),Qt.jsx("option",{value:"PB",children:"Paraíba"}),Qt.jsx("option",{value:"PR",children:"Paraná"}),Qt.jsx("option",{value:"PE",children:"Pernambuco"}),Qt.jsx("option",{value:"PI",children:"Piauí"}),Qt.jsx("option",{value:"RJ",children:"Rio de Janeiro"}),Qt.jsx("option",{value:"RN",children:"Rio Grande do Norte"}),Qt.jsx("option",{value:"RS",children:"Rio Grande do Sul"}),Qt.jsx("option",{value:"RO",children:"Rondônia"}),Qt.jsx("option",{value:"RR",children:"Roraima"}),Qt.jsx("option",{value:"SC",children:"Santa Catarina"}),Qt.jsx("option",{value:"SP",children:"São Paulo"}),Qt.jsx("option",{value:"SE",children:"Sergipe"}),Qt.jsx("option",{value:"TO",children:"Tocantins"})]});function Ks({innerRef:t,loading:e,page:r,pages:n,...o}){return Qt.jsx("div",{className:"footer-load-more--container",ref:t,hidden:r>=n,...o,children:e&&Qt.jsxs(Qt.Fragment,{children:[Qt.jsx("div",{className:"spinner-border spinner-border-sm",role:"status",children:Qt.jsx("span",{className:"visually-hidden",children:"Loading..."})}),"Carregando..."]})})}const Zs={q:"",page:1};function Qs({isOpen:t,setOpen:n,title:o="Pesquisar",placeHolder:i="Digite o que deseja pesquisar",maxWidth:a=800,searchInit:s,route:c,keyField:u,fields:l,renderLine:f,onClick:d,helpLink:h}){var p,g;const m=e.useRef(null),[v]=e.useState(`box-inp-${r.random(1e4)}`),[y,_]=e.useState([]),[w,b]=e.useState(""),[C,A]=e.useState({...Zs,q:s||""}),[E,I]=e.useState(!1),[S,O]=or({url:c,params:{...C,limit:r.isDesktop()?28:10},onTerminated:t=>{t.error?b(t.error):t.data instanceof Array?(I(!1),_(t.data)):(I(!0),_(e=>[...e,...t.data.data]))}});function T(){if(!C.q)return b("Informe o que deseja pesquisar!");_([]),C.page>1?A({...C,page:1}):S(),N()}function N(){var t;r.isDesktop()&&(null==(t=document.querySelector(`#${v}`))||t.focus())}return e.useEffect(()=>{C.q.length>0&&S()},[C.page]),e.useEffect(()=>{const t=m.current;if(!t)return;const e=new IntersectionObserver(t=>{t.forEach(t=>{t.isIntersecting&&function(){var t;let e=C.page+1;if(e>(null==(t=O.data)?void 0:t.pages)||O.loading||0==y.length)return;O.data||(e=1);A({...C,page:e})}()})});return e.observe(t),()=>e.unobserve(t)},[y]),t?Qt.jsxs(Qt.Fragment,{children:[Qt.jsx(Ls,{visible:O.loading}),Qt.jsxs(lr,{title:o,maxWidth:a,visible:!0,setVisible:n,children:[Qt.jsx(hr,{helpLink:h,setVisible:n,children:o}),Qt.jsx(dr,{children:Qt.jsxs(fr,{children:[Qt.jsx("div",{className:"my-2",children:Qt.jsx(sr,{search:C.q,setSearch:t=>A({...C,q:t}),fnSearch:T,placeHolder:i,onKeyDown:function(t){13===t.keyCode&&(t.preventDefault(),T())},autoFocus:r.isDesktop(),id:v})}),Qt.jsxs("div",{className:"box-search--data-container",children:[0===(null==(p=O.data)?void 0:p.length)&&Qt.jsx("div",{className:"alert alert-info text-center bold",children:"Nenhum registro encontrado!"}),y&&Qt.jsx("table",{children:Qt.jsx("tbody",{children:null==y?void 0:y.map((t,e)=>Qt.jsx("tr",{onClick:()=>d(t[u],t),children:f?f(t):l.map((e,r)=>{let n;return n=0==r?{width:60,textAlign:"center",fontWeight:"bold"}:{width:"auto",textAlign:"left",fontWeight:"normal"},Qt.jsx("td",{style:n,children:t[e]},r)})},e))})}),E&&Qt.jsx(Ks,{innerRef:m,loading:O.loading,page:C.page,pages:null==(g=O.data)?void 0:g.pages})]})]})})]}),w&&Qt.jsx(se,{onConfirm:()=>{b(),N()},children:w})]}):null}function Js({children:t,findTitle:r,findPlaceHolder:n,findRoute:o,findKeyField:i,findFields:a,findRenderLine:s,findOnSelect:c,...u}){const[l,f]=e.useState(!1);return Qt.jsxs(Qt.Fragment,{children:[Qt.jsxs("div",{className:"input-group",children:[Qt.jsxs("select",{className:"form-select",...u,children:[Qt.jsxs("option",{value:0,children:["- ",r," -"]}),t]}),Qt.jsx("button",{type:"button",title:"Pesquisar...",className:"btn btn-info",onClick:()=>f(!0),children:Qt.jsx(_e,{})})]}),l&&Qt.jsx(Qs,{title:r,placeHolder:n,fields:a,keyField:i,route:o,isOpen:!0,setOpen:f,renderLine:s,onClick:(t,e)=>{c(t,e),f(!1)}})]})}const tc=o.div`
573
+ `;function Ms({visible:t}){const[r,n]=e.useState([0,0]);return t?(setTimeout(()=>{let[t,e]=r;e<100?e++:e>50&&t++,100==t&&(t=0,e=0),n([t,e])},5),Qt.jsx(Ps,{position:r,children:Qt.jsx("div",{className:"floating-bar",children:Qt.jsx("span",{className:"d-none",children:"Carregando..."})})})):null}function Bs({visible:t,message:e="Aguarde...",isbar:r=!1}){return t?r?Qt.jsx(Ms,{visible:t}):Qt.jsx("div",{className:"loading--container",children:Qt.jsxs("div",{className:"loading-body",children:[Qt.jsx("div",{className:"spinner-border text-info"}),Qt.jsx("span",{children:e})]})}):null}function Ls({name:t,value:e,onChange:r,invalid:n=!1,...o}){return Qt.jsx(l,{placeholder:"Informe o telefone",className:"form-control "+(n?"is-invalid":""),format:"(##) # ####-####",mask:"_",value:e,name:t,onValueChange:e=>function(t,e,r){r&&r({target:{name:e,value:t.formattedValue}})}(e,t,r),...o})}const Fs={mask:"**.***.***/****-00",definitions:{"*":/[A-Za-z0-9]/}};function js(t){const e=String(t).replace(/\D/g,"");let n=!1;return r.validarCPF(e)||(n=!0),"00000000000"==e&&(n=!1),""==t&&(n=!1),n}function Vs(t){return!r.validarCNPJ(t)}function Us(t){const e=String(t).replace(/[^A-Za-z0-9]/g,"");let r=!1;return e.length<=11&&js(t)&&(r=!0),e.length>11&&Vs(t)&&(r=!0),""==t&&(r=!1),r}function Hs(t){return"string"==typeof t||t instanceof String}function zs(t){var e;return"object"==typeof t&&null!=t&&"Object"===(null==t||null==(e=t.constructor)?void 0:e.name)}function Ws(t,e){return Array.isArray(e)?Ws(t,(t,r)=>e.includes(r)):Object.entries(t).reduce((t,r)=>{let[n,o]=r;return e(o,n)&&(t[n]=o),t},{})}const Gs="NONE",Xs="LEFT",$s="FORCE_LEFT",Ys="RIGHT",qs="FORCE_RIGHT";function Ks(t){return t.replace(/([.*+?^=!:${}()|[\]/\\])/g,"\\$1")}function Zs(t,e){if(e===t)return!0;const r=Array.isArray(e),n=Array.isArray(t);let o;if(r&&n){if(e.length!=t.length)return!1;for(o=0;o<e.length;o++)if(!Zs(e[o],t[o]))return!1;return!0}if(r!=n)return!1;if(e&&t&&"object"==typeof e&&"object"==typeof t){const r=e instanceof Date,n=t instanceof Date;if(r&&n)return e.getTime()==t.getTime();if(r!=n)return!1;const i=e instanceof RegExp,a=t instanceof RegExp;if(i&&a)return e.toString()==t.toString();if(i!=a)return!1;const s=Object.keys(e);for(o=0;o<s.length;o++)if(!Object.prototype.hasOwnProperty.call(t,s[o]))return!1;for(o=0;o<s.length;o++)if(!Zs(t[s[o]],e[s[o]]))return!1;return!0}return!(!e||!t||"function"!=typeof e||"function"!=typeof t)&&e.toString()===t.toString()}class Qs{constructor(t){for(Object.assign(this,t);this.value.slice(0,this.startChangePos)!==this.oldValue.slice(0,this.startChangePos);)--this.oldSelection.start;if(this.insertedCount)for(;this.value.slice(this.cursorPos)!==this.oldValue.slice(this.oldSelection.end);)this.value.length-this.cursorPos<this.oldValue.length-this.oldSelection.end?++this.oldSelection.end:++this.cursorPos}get startChangePos(){return Math.min(this.cursorPos,this.oldSelection.start)}get insertedCount(){return this.cursorPos-this.startChangePos}get inserted(){return this.value.substr(this.startChangePos,this.insertedCount)}get removedCount(){return Math.max(this.oldSelection.end-this.startChangePos||this.oldValue.length-this.value.length,0)}get removed(){return this.oldValue.substr(this.startChangePos,this.removedCount)}get head(){return this.value.substring(0,this.startChangePos)}get tail(){return this.value.substring(this.startChangePos+this.insertedCount)}get removeDirection(){return!this.removedCount||this.insertedCount?Gs:this.oldSelection.end!==this.cursorPos&&this.oldSelection.start!==this.cursorPos||this.oldSelection.end!==this.oldSelection.start?Xs:Ys}}function Js(t,e){return new Js.InputMask(t,e)}function tu(t){if(null==t)throw new Error("mask property should be defined");return t instanceof RegExp?Js.MaskedRegExp:Hs(t)?Js.MaskedPattern:t===Date?Js.MaskedDate:t===Number?Js.MaskedNumber:Array.isArray(t)||t===Array?Js.MaskedDynamic:Js.Masked&&t.prototype instanceof Js.Masked?t:Js.Masked&&t instanceof Js.Masked?t.constructor:t instanceof Function?Js.MaskedFunction:(console.warn("Mask not found for mask",t),Js.Masked)}function eu(t){if(!t)throw new Error("Options in not defined");if(Js.Masked){if(t.prototype instanceof Js.Masked)return{mask:t};const{mask:e,...r}=t instanceof Js.Masked?{mask:t}:zs(t)&&t.mask instanceof Js.Masked?t:{};if(e){const t=e.mask;return{...Ws(e,(t,e)=>!e.startsWith("_")),mask:e.constructor,_mask:t,...r}}}return zs(t)?{...t}:{mask:t}}function ru(t){if(Js.Masked&&t instanceof Js.Masked)return t;const e=eu(t),r=tu(e.mask);if(!r)throw new Error("Masked class is not found for provided mask "+e.mask+", appropriate module needs to be imported manually before creating mask.");return e.mask===r&&delete e.mask,e._mask&&(e.mask=e._mask,delete e._mask),new r(e)}Js.createMask=ru;class nu{get selectionStart(){let t;try{t=this._unsafeSelectionStart}catch{}return null!=t?t:this.value.length}get selectionEnd(){let t;try{t=this._unsafeSelectionEnd}catch{}return null!=t?t:this.value.length}select(t,e){if(null!=t&&null!=e&&(t!==this.selectionStart||e!==this.selectionEnd))try{this._unsafeSelect(t,e)}catch{}}get isActive(){return!1}}Js.MaskElement=nu;class ou extends nu{constructor(t){super(),this.input=t,this._onKeydown=this._onKeydown.bind(this),this._onInput=this._onInput.bind(this),this._onBeforeinput=this._onBeforeinput.bind(this),this._onCompositionEnd=this._onCompositionEnd.bind(this)}get rootElement(){var t,e,r;return null!=(t=null==(e=(r=this.input).getRootNode)?void 0:e.call(r))?t:document}get isActive(){return this.input===this.rootElement.activeElement}bindEvents(t){this.input.addEventListener("keydown",this._onKeydown),this.input.addEventListener("input",this._onInput),this.input.addEventListener("beforeinput",this._onBeforeinput),this.input.addEventListener("compositionend",this._onCompositionEnd),this.input.addEventListener("drop",t.drop),this.input.addEventListener("click",t.click),this.input.addEventListener("focus",t.focus),this.input.addEventListener("blur",t.commit),this._handlers=t}_onKeydown(t){return this._handlers.redo&&(90===t.keyCode&&t.shiftKey&&(t.metaKey||t.ctrlKey)||89===t.keyCode&&t.ctrlKey)?(t.preventDefault(),this._handlers.redo(t)):this._handlers.undo&&90===t.keyCode&&(t.metaKey||t.ctrlKey)?(t.preventDefault(),this._handlers.undo(t)):void(t.isComposing||this._handlers.selectionChange(t))}_onBeforeinput(t){return"historyUndo"===t.inputType&&this._handlers.undo?(t.preventDefault(),this._handlers.undo(t)):"historyRedo"===t.inputType&&this._handlers.redo?(t.preventDefault(),this._handlers.redo(t)):void 0}_onCompositionEnd(t){this._handlers.input(t)}_onInput(t){t.isComposing||this._handlers.input(t)}unbindEvents(){this.input.removeEventListener("keydown",this._onKeydown),this.input.removeEventListener("input",this._onInput),this.input.removeEventListener("beforeinput",this._onBeforeinput),this.input.removeEventListener("compositionend",this._onCompositionEnd),this.input.removeEventListener("drop",this._handlers.drop),this.input.removeEventListener("click",this._handlers.click),this.input.removeEventListener("focus",this._handlers.focus),this.input.removeEventListener("blur",this._handlers.commit),this._handlers={}}}Js.HTMLMaskElement=ou;class iu extends ou{constructor(t){super(t),this.input=t}get _unsafeSelectionStart(){return null!=this.input.selectionStart?this.input.selectionStart:this.value.length}get _unsafeSelectionEnd(){return this.input.selectionEnd}_unsafeSelect(t,e){this.input.setSelectionRange(t,e)}get value(){return this.input.value}set value(t){this.input.value=t}}Js.HTMLMaskElement=ou;class au extends ou{get _unsafeSelectionStart(){const t=this.rootElement,e=t.getSelection&&t.getSelection(),r=e&&e.anchorOffset,n=e&&e.focusOffset;return null==n||null==r||r<n?r:n}get _unsafeSelectionEnd(){const t=this.rootElement,e=t.getSelection&&t.getSelection(),r=e&&e.anchorOffset,n=e&&e.focusOffset;return null==n||null==r||r>n?r:n}_unsafeSelect(t,e){if(!this.rootElement.createRange)return;const r=this.rootElement.createRange();r.setStart(this.input.firstChild||this.input,t),r.setEnd(this.input.lastChild||this.input,e);const n=this.rootElement,o=n.getSelection&&n.getSelection();o&&(o.removeAllRanges(),o.addRange(r))}get value(){return this.input.textContent||""}set value(t){this.input.textContent=t}}Js.HTMLContenteditableMaskElement=au;class su{constructor(){this.states=[],this.currentIndex=0}get currentState(){return this.states[this.currentIndex]}get isEmpty(){return 0===this.states.length}push(t){this.currentIndex<this.states.length-1&&(this.states.length=this.currentIndex+1),this.states.push(t),this.states.length>su.MAX_LENGTH&&this.states.shift(),this.currentIndex=this.states.length-1}go(t){return this.currentIndex=Math.min(Math.max(this.currentIndex+t,0),this.states.length-1),this.currentState}undo(){return this.go(-1)}redo(){return this.go(1)}clear(){this.states.length=0,this.currentIndex=0}}su.MAX_LENGTH=100;Js.InputMask=class{constructor(t,e){this.el=t instanceof nu?t:t.isContentEditable&&"INPUT"!==t.tagName&&"TEXTAREA"!==t.tagName?new au(t):new iu(t),this.masked=ru(e),this._listeners={},this._value="",this._unmaskedValue="",this._rawInputValue="",this.history=new su,this._saveSelection=this._saveSelection.bind(this),this._onInput=this._onInput.bind(this),this._onChange=this._onChange.bind(this),this._onDrop=this._onDrop.bind(this),this._onFocus=this._onFocus.bind(this),this._onClick=this._onClick.bind(this),this._onUndo=this._onUndo.bind(this),this._onRedo=this._onRedo.bind(this),this.alignCursor=this.alignCursor.bind(this),this.alignCursorFriendly=this.alignCursorFriendly.bind(this),this._bindEvents(),this.updateValue(),this._onChange()}maskEquals(t){var e;return null==t||(null==(e=this.masked)?void 0:e.maskEquals(t))}get mask(){return this.masked.mask}set mask(t){if(this.maskEquals(t))return;if(!(t instanceof Js.Masked)&&this.masked.constructor===tu(t))return void this.masked.updateOptions({mask:t});const e=t instanceof Js.Masked?t:ru({mask:t});e.unmaskedValue=this.masked.unmaskedValue,this.masked=e}get value(){return this._value}set value(t){this.value!==t&&(this.masked.value=t,this.updateControl("auto"))}get unmaskedValue(){return this._unmaskedValue}set unmaskedValue(t){this.unmaskedValue!==t&&(this.masked.unmaskedValue=t,this.updateControl("auto"))}get rawInputValue(){return this._rawInputValue}set rawInputValue(t){this.rawInputValue!==t&&(this.masked.rawInputValue=t,this.updateControl(),this.alignCursor())}get typedValue(){return this.masked.typedValue}set typedValue(t){this.masked.typedValueEquals(t)||(this.masked.typedValue=t,this.updateControl("auto"))}get displayValue(){return this.masked.displayValue}_bindEvents(){this.el.bindEvents({selectionChange:this._saveSelection,input:this._onInput,drop:this._onDrop,click:this._onClick,focus:this._onFocus,commit:this._onChange,undo:this._onUndo,redo:this._onRedo})}_unbindEvents(){this.el&&this.el.unbindEvents()}_fireEvent(t,e){const r=this._listeners[t];r&&r.forEach(t=>t(e))}get selectionStart(){return this._cursorChanging?this._changingCursorPos:this.el.selectionStart}get cursorPos(){return this._cursorChanging?this._changingCursorPos:this.el.selectionEnd}set cursorPos(t){this.el&&this.el.isActive&&(this.el.select(t,t),this._saveSelection())}_saveSelection(){this.displayValue!==this.el.value&&console.warn("Element value was changed outside of mask. Syncronize mask using `mask.updateValue()` to work properly."),this._selection={start:this.selectionStart,end:this.cursorPos}}updateValue(){this.masked.value=this.el.value,this._value=this.masked.value,this._unmaskedValue=this.masked.unmaskedValue,this._rawInputValue=this.masked.rawInputValue}updateControl(t){const e=this.masked.unmaskedValue,r=this.masked.value,n=this.masked.rawInputValue,o=this.displayValue,i=this.unmaskedValue!==e||this.value!==r||this._rawInputValue!==n;this._unmaskedValue=e,this._value=r,this._rawInputValue=n,this.el.value!==o&&(this.el.value=o),"auto"===t?this.alignCursor():null!=t&&(this.cursorPos=t),i&&this._fireChangeEvents(),this._historyChanging||!i&&!this.history.isEmpty||this.history.push({unmaskedValue:e,selection:{start:this.selectionStart,end:this.cursorPos}})}updateOptions(t){const{mask:e,...r}=t,n=!this.maskEquals(e),o=this.masked.optionsIsChanged(r);n&&(this.mask=e),o&&this.masked.updateOptions(r),(n||o)&&this.updateControl()}updateCursor(t){null!=t&&(this.cursorPos=t,this._delayUpdateCursor(t))}_delayUpdateCursor(t){this._abortUpdateCursor(),this._changingCursorPos=t,this._cursorChanging=setTimeout(()=>{this.el&&(this.cursorPos=this._changingCursorPos,this._abortUpdateCursor())},10)}_fireChangeEvents(){this._fireEvent("accept",this._inputEvent),this.masked.isComplete&&this._fireEvent("complete",this._inputEvent)}_abortUpdateCursor(){this._cursorChanging&&(clearTimeout(this._cursorChanging),delete this._cursorChanging)}alignCursor(){this.cursorPos=this.masked.nearestInputPos(this.masked.nearestInputPos(this.cursorPos,Xs))}alignCursorFriendly(){this.selectionStart===this.cursorPos&&this.alignCursor()}on(t,e){return this._listeners[t]||(this._listeners[t]=[]),this._listeners[t].push(e),this}off(t,e){if(!this._listeners[t])return this;if(!e)return delete this._listeners[t],this;const r=this._listeners[t].indexOf(e);return r>=0&&this._listeners[t].splice(r,1),this}_onInput(t){this._inputEvent=t,this._abortUpdateCursor();const e=new Qs({value:this.el.value,cursorPos:this.cursorPos,oldValue:this.displayValue,oldSelection:this._selection}),r=this.masked.rawInputValue,n=this.masked.splice(e.startChangePos,e.removed.length,e.inserted,e.removeDirection,{input:!0,raw:!0}).offset,o=r===this.masked.rawInputValue?e.removeDirection:Gs;let i=this.masked.nearestInputPos(e.startChangePos+n,o);o!==Gs&&(i=this.masked.nearestInputPos(i,Gs)),this.updateControl(i),delete this._inputEvent}_onChange(){this.displayValue!==this.el.value&&this.updateValue(),this.masked.doCommit(),this.updateControl(),this._saveSelection()}_onDrop(t){t.preventDefault(),t.stopPropagation()}_onFocus(t){this.alignCursorFriendly()}_onClick(t){this.alignCursorFriendly()}_onUndo(){this._applyHistoryState(this.history.undo())}_onRedo(){this._applyHistoryState(this.history.redo())}_applyHistoryState(t){t&&(this._historyChanging=!0,this.unmaskedValue=t.unmaskedValue,this.el.select(t.selection.start,t.selection.end),this._saveSelection(),this._historyChanging=!1)}destroy(){this._unbindEvents(),this._listeners.length=0,delete this.el}};class uu{static normalize(t){return Array.isArray(t)?t:[t,new uu]}constructor(t){Object.assign(this,{inserted:"",rawInserted:"",tailShift:0,skip:!1},t)}aggregate(t){return this.inserted+=t.inserted,this.rawInserted+=t.rawInserted,this.tailShift+=t.tailShift,this.skip=this.skip||t.skip,this}get offset(){return this.tailShift+this.inserted.length}get consumed(){return Boolean(this.rawInserted)||this.skip}equals(t){return this.inserted===t.inserted&&this.tailShift===t.tailShift&&this.rawInserted===t.rawInserted&&this.skip===t.skip}}Js.ChangeDetails=uu;class lu{constructor(t,e,r){void 0===t&&(t=""),void 0===e&&(e=0),this.value=t,this.from=e,this.stop=r}toString(){return this.value}extend(t){this.value+=String(t)}appendTo(t){return t.append(this.toString(),{tail:!0}).aggregate(t._appendPlaceholder())}get state(){return{value:this.value,from:this.from,stop:this.stop}}set state(t){Object.assign(this,t)}unshift(t){if(!this.value.length||null!=t&&this.from>=t)return"";const e=this.value[0];return this.value=this.value.slice(1),e}shift(){if(!this.value.length)return"";const t=this.value[this.value.length-1];return this.value=this.value.slice(0,-1),t}}class cu{constructor(t){this._value="",this._update({...cu.DEFAULTS,...t}),this._initialized=!0}updateOptions(t){this.optionsIsChanged(t)&&this.withValueRefresh(this._update.bind(this,t))}_update(t){Object.assign(this,t)}get state(){return{_value:this.value,_rawInputValue:this.rawInputValue}}set state(t){this._value=t._value}reset(){this._value=""}get value(){return this._value}set value(t){this.resolve(t,{input:!0})}resolve(t,e){void 0===e&&(e={input:!0}),this.reset(),this.append(t,e,""),this.doCommit()}get unmaskedValue(){return this.value}set unmaskedValue(t){this.resolve(t,{})}get typedValue(){return this.parse?this.parse(this.value,this):this.unmaskedValue}set typedValue(t){this.format?this.value=this.format(t,this):this.unmaskedValue=String(t)}get rawInputValue(){return this.extractInput(0,this.displayValue.length,{raw:!0})}set rawInputValue(t){this.resolve(t,{raw:!0})}get displayValue(){return this.value}get isComplete(){return!0}get isFilled(){return this.isComplete}nearestInputPos(t,e){return t}totalInputPositions(t,e){return void 0===t&&(t=0),void 0===e&&(e=this.displayValue.length),Math.min(this.displayValue.length,e-t)}extractInput(t,e,r){return void 0===t&&(t=0),void 0===e&&(e=this.displayValue.length),this.displayValue.slice(t,e)}extractTail(t,e){return void 0===t&&(t=0),void 0===e&&(e=this.displayValue.length),new lu(this.extractInput(t,e),t)}appendTail(t){return Hs(t)&&(t=new lu(String(t))),t.appendTo(this)}_appendCharRaw(t,e){return t?(this._value+=t,new uu({inserted:t,rawInserted:t})):new uu}_appendChar(t,e,r){void 0===e&&(e={});const n=this.state;let o;if([t,o]=this.doPrepareChar(t,e),t&&(o=o.aggregate(this._appendCharRaw(t,e)),!o.rawInserted&&"pad"===this.autofix)){const r=this.state;this.state=n;let i=this.pad(e);const a=this._appendCharRaw(t,e);i=i.aggregate(a),a.rawInserted||i.equals(o)?o=i:this.state=r}if(o.inserted){let t,i=!1!==this.doValidate(e);if(i&&null!=r){const e=this.state;if(!0===this.overwrite){t=r.state;for(let t=0;t<o.rawInserted.length;++t)r.unshift(this.displayValue.length-o.tailShift)}let n=this.appendTail(r);if(i=n.rawInserted.length===r.toString().length,!(i&&n.inserted||"shift"!==this.overwrite)){this.state=e,t=r.state;for(let t=0;t<o.rawInserted.length;++t)r.shift();n=this.appendTail(r),i=n.rawInserted.length===r.toString().length}i&&n.inserted&&(this.state=e)}i||(o=new uu,this.state=n,r&&t&&(r.state=t))}return o}_appendPlaceholder(){return new uu}_appendEager(){return new uu}append(t,e,r){if(!Hs(t))throw new Error("value should be string");const n=Hs(r)?new lu(String(r)):r;let o;null!=e&&e.tail&&(e._beforeTailState=this.state),[t,o]=this.doPrepare(t,e);for(let i=0;i<t.length;++i){const r=this._appendChar(t[i],e,n);if(!r.rawInserted&&!this.doSkipInvalid(t[i],e,n))break;o.aggregate(r)}return(!0===this.eager||"append"===this.eager)&&null!=e&&e.input&&t&&o.aggregate(this._appendEager()),null!=n&&(o.tailShift+=this.appendTail(n).tailShift),o}remove(t,e){return void 0===t&&(t=0),void 0===e&&(e=this.displayValue.length),this._value=this.displayValue.slice(0,t)+this.displayValue.slice(e),new uu}withValueRefresh(t){if(this._refreshing||!this._initialized)return t();this._refreshing=!0;const e=this.rawInputValue,r=this.value,n=t();return this.rawInputValue=e,this.value&&this.value!==r&&0===r.indexOf(this.value)&&(this.append(r.slice(this.displayValue.length),{},""),this.doCommit()),delete this._refreshing,n}runIsolated(t){if(this._isolated||!this._initialized)return t(this);this._isolated=!0;const e=this.state,r=t(this);return this.state=e,delete this._isolated,r}doSkipInvalid(t,e,r){return Boolean(this.skipInvalid)}doPrepare(t,e){return void 0===e&&(e={}),uu.normalize(this.prepare?this.prepare(t,this,e):t)}doPrepareChar(t,e){return void 0===e&&(e={}),uu.normalize(this.prepareChar?this.prepareChar(t,this,e):t)}doValidate(t){return(!this.validate||this.validate(this.value,this,t))&&(!this.parent||this.parent.doValidate(t))}doCommit(){this.commit&&this.commit(this.value,this)}splice(t,e,r,n,o){void 0===r&&(r=""),void 0===n&&(n=Gs),void 0===o&&(o={input:!0});const i=t+e,a=this.extractTail(i),s=!0===this.eager||"remove"===this.eager;let u;s&&(n=function(t){switch(t){case Xs:return $s;case Ys:return qs;default:return t}}(n),u=this.extractInput(0,i,{raw:!0}));let l=t;const c=new uu;if(n!==Gs&&(l=this.nearestInputPos(t,e>1&&0!==t&&!s?Gs:n),c.tailShift=l-t),c.aggregate(this.remove(l)),s&&n!==Gs&&u===this.rawInputValue)if(n===$s){let t;for(;u===this.rawInputValue&&(t=this.displayValue.length);)c.aggregate(new uu({tailShift:-1})).aggregate(this.remove(t-1))}else n===qs&&a.unshift();return c.aggregate(this.append(r,o,a))}maskEquals(t){return this.mask===t}optionsIsChanged(t){return!Zs(this,t)}typedValueEquals(t){const e=this.typedValue;return t===e||cu.EMPTY_VALUES.includes(t)&&cu.EMPTY_VALUES.includes(e)||!!this.format&&this.format(t,this)===this.format(this.typedValue,this)}pad(t){return new uu}}cu.DEFAULTS={skipInvalid:!0},cu.EMPTY_VALUES=[void 0,null,""],Js.Masked=cu;class hu{constructor(t,e){void 0===t&&(t=[]),void 0===e&&(e=0),this.chunks=t,this.from=e}toString(){return this.chunks.map(String).join("")}extend(t){if(!String(t))return;t=Hs(t)?new lu(String(t)):t;const e=this.chunks[this.chunks.length-1],r=e&&(e.stop===t.stop||null==t.stop)&&t.from===e.from+e.toString().length;if(t instanceof lu)r?e.extend(t.toString()):this.chunks.push(t);else if(t instanceof hu){if(null==t.stop){let e;for(;t.chunks.length&&null==t.chunks[0].stop;)e=t.chunks.shift(),e.from+=t.from,this.extend(e)}t.toString()&&(t.stop=t.blockIndex,this.chunks.push(t))}}appendTo(t){if(!(t instanceof Js.MaskedPattern)){return new lu(this.toString()).appendTo(t)}const e=new uu;for(let r=0;r<this.chunks.length;++r){const n=this.chunks[r],o=t._mapPosToBlock(t.displayValue.length),i=n.stop;let a;if(null!=i&&(!o||o.index<=i)&&((n instanceof hu||t._stops.indexOf(i)>=0)&&e.aggregate(t._appendPlaceholder(i)),a=n instanceof hu&&t._blocks[i]),a){const r=a.appendTail(n);e.aggregate(r);const o=n.toString().slice(r.rawInserted.length);o&&e.aggregate(t.append(o,{tail:!0}))}else e.aggregate(t.append(n.toString(),{tail:!0}))}return e}get state(){return{chunks:this.chunks.map(t=>t.state),from:this.from,stop:this.stop,blockIndex:this.blockIndex}}set state(t){const{chunks:e,...r}=t;Object.assign(this,r),this.chunks=e.map(t=>{const e="chunks"in t?new hu:new lu;return e.state=t,e})}unshift(t){if(!this.chunks.length||null!=t&&this.from>=t)return"";const e=null!=t?t-this.from:t;let r=0;for(;r<this.chunks.length;){const t=this.chunks[r],n=t.unshift(e);if(t.toString()){if(!n)break;++r}else this.chunks.splice(r,1);if(n)return n}return""}shift(){if(!this.chunks.length)return"";let t=this.chunks.length-1;for(;0<=t;){const e=this.chunks[t],r=e.shift();if(e.toString()){if(!r)break;--t}else this.chunks.splice(t,1);if(r)return r}return""}}class fu{constructor(t,e){this.masked=t,this._log=[];const{offset:r,index:n}=t._mapPosToBlock(e)||(e<0?{index:0,offset:0}:{index:this.masked._blocks.length,offset:0});this.offset=r,this.index=n,this.ok=!1}get block(){return this.masked._blocks[this.index]}get pos(){return this.masked._blockStartPos(this.index)+this.offset}get state(){return{index:this.index,offset:this.offset,ok:this.ok}}set state(t){Object.assign(this,t)}pushState(){this._log.push(this.state)}popState(){const t=this._log.pop();return t&&(this.state=t),t}bindBlock(){this.block||(this.index<0&&(this.index=0,this.offset=0),this.index>=this.masked._blocks.length&&(this.index=this.masked._blocks.length-1,this.offset=this.block.displayValue.length))}_pushLeft(t){for(this.pushState(),this.bindBlock();0<=this.index;--this.index,this.offset=(null==(e=this.block)?void 0:e.displayValue.length)||0){var e;if(t())return this.ok=!0}return this.ok=!1}_pushRight(t){for(this.pushState(),this.bindBlock();this.index<this.masked._blocks.length;++this.index,this.offset=0)if(t())return this.ok=!0;return this.ok=!1}pushLeftBeforeFilled(){return this._pushLeft(()=>{if(!this.block.isFixed&&this.block.value)return this.offset=this.block.nearestInputPos(this.offset,$s),0!==this.offset||void 0})}pushLeftBeforeInput(){return this._pushLeft(()=>{if(!this.block.isFixed)return this.offset=this.block.nearestInputPos(this.offset,Xs),!0})}pushLeftBeforeRequired(){return this._pushLeft(()=>{if(!(this.block.isFixed||this.block.isOptional&&!this.block.value))return this.offset=this.block.nearestInputPos(this.offset,Xs),!0})}pushRightBeforeFilled(){return this._pushRight(()=>{if(!this.block.isFixed&&this.block.value)return this.offset=this.block.nearestInputPos(this.offset,qs),this.offset!==this.block.value.length||void 0})}pushRightBeforeInput(){return this._pushRight(()=>{if(!this.block.isFixed)return this.offset=this.block.nearestInputPos(this.offset,Gs),!0})}pushRightBeforeRequired(){return this._pushRight(()=>{if(!(this.block.isFixed||this.block.isOptional&&!this.block.value))return this.offset=this.block.nearestInputPos(this.offset,Gs),!0})}}class du{constructor(t){Object.assign(this,t),this._value="",this.isFixed=!0}get value(){return this._value}get unmaskedValue(){return this.isUnmasking?this.value:""}get rawInputValue(){return this._isRawInput?this.value:""}get displayValue(){return this.value}reset(){this._isRawInput=!1,this._value=""}remove(t,e){return void 0===t&&(t=0),void 0===e&&(e=this._value.length),this._value=this._value.slice(0,t)+this._value.slice(e),this._value||(this._isRawInput=!1),new uu}nearestInputPos(t,e){void 0===e&&(e=Gs);const r=this._value.length;switch(e){case Xs:case $s:return 0;default:return r}}totalInputPositions(t,e){return void 0===t&&(t=0),void 0===e&&(e=this._value.length),this._isRawInput?e-t:0}extractInput(t,e,r){return void 0===t&&(t=0),void 0===e&&(e=this._value.length),void 0===r&&(r={}),r.raw&&this._isRawInput&&this._value.slice(t,e)||""}get isComplete(){return!0}get isFilled(){return Boolean(this._value)}_appendChar(t,e){if(void 0===e&&(e={}),this.isFilled)return new uu;const r=!0===this.eager||"append"===this.eager,n=this.char===t&&(this.isUnmasking||e.input||e.raw)&&(!e.raw||!r)&&!e.tail,o=new uu({inserted:this.char,rawInserted:n?this.char:""});return this._value=this.char,this._isRawInput=n&&(e.raw||e.input),o}_appendEager(){return this._appendChar(this.char,{tail:!0})}_appendPlaceholder(){const t=new uu;return this.isFilled||(this._value=t.inserted=this.char),t}extractTail(){return new lu("")}appendTail(t){return Hs(t)&&(t=new lu(String(t))),t.appendTo(this)}append(t,e,r){const n=this._appendChar(t[0],e);return null!=r&&(n.tailShift+=this.appendTail(r).tailShift),n}doCommit(){}get state(){return{_value:this._value,_rawInputValue:this.rawInputValue}}set state(t){this._value=t._value,this._isRawInput=Boolean(t._rawInputValue)}pad(t){return this._appendPlaceholder()}}class pu{constructor(t){const{parent:e,isOptional:r,placeholderChar:n,displayChar:o,lazy:i,eager:a,...s}=t;this.masked=ru(s),Object.assign(this,{parent:e,isOptional:r,placeholderChar:n,displayChar:o,lazy:i,eager:a})}reset(){this.isFilled=!1,this.masked.reset()}remove(t,e){return void 0===t&&(t=0),void 0===e&&(e=this.value.length),0===t&&e>=1?(this.isFilled=!1,this.masked.remove(t,e)):new uu}get value(){return this.masked.value||(this.isFilled&&!this.isOptional?this.placeholderChar:"")}get unmaskedValue(){return this.masked.unmaskedValue}get rawInputValue(){return this.masked.rawInputValue}get displayValue(){return this.masked.value&&this.displayChar||this.value}get isComplete(){return Boolean(this.masked.value)||this.isOptional}_appendChar(t,e){if(void 0===e&&(e={}),this.isFilled)return new uu;const r=this.masked.state;let n=this.masked._appendChar(t,this.currentMaskFlags(e));return n.inserted&&!1===this.doValidate(e)&&(n=new uu,this.masked.state=r),n.inserted||this.isOptional||this.lazy||e.input||(n.inserted=this.placeholderChar),n.skip=!n.inserted&&!this.isOptional,this.isFilled=Boolean(n.inserted),n}append(t,e,r){return this.masked.append(t,this.currentMaskFlags(e),r)}_appendPlaceholder(){return this.isFilled||this.isOptional?new uu:(this.isFilled=!0,new uu({inserted:this.placeholderChar}))}_appendEager(){return new uu}extractTail(t,e){return this.masked.extractTail(t,e)}appendTail(t){return this.masked.appendTail(t)}extractInput(t,e,r){return void 0===t&&(t=0),void 0===e&&(e=this.value.length),this.masked.extractInput(t,e,r)}nearestInputPos(t,e){void 0===e&&(e=Gs);const r=this.value.length,n=Math.min(Math.max(t,0),r);switch(e){case Xs:case $s:return this.isComplete?n:0;case Ys:case qs:return this.isComplete?n:r;default:return n}}totalInputPositions(t,e){return void 0===t&&(t=0),void 0===e&&(e=this.value.length),this.value.slice(t,e).length}doValidate(t){return this.masked.doValidate(this.currentMaskFlags(t))&&(!this.parent||this.parent.doValidate(this.currentMaskFlags(t)))}doCommit(){this.masked.doCommit()}get state(){return{_value:this.value,_rawInputValue:this.rawInputValue,masked:this.masked.state,isFilled:this.isFilled}}set state(t){this.masked.state=t.masked,this.isFilled=t.isFilled}currentMaskFlags(t){var e;return{...t,_beforeTailState:(null==t||null==(e=t._beforeTailState)?void 0:e.masked)||(null==t?void 0:t._beforeTailState)}}pad(t){return new uu}}pu.DEFAULT_DEFINITIONS={0:/\d/,a:/[\u0041-\u005A\u0061-\u007A\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]/,"*":/./};Js.MaskedRegExp=class extends cu{updateOptions(t){super.updateOptions(t)}_update(t){const e=t.mask;e&&(t.validate=t=>t.search(e)>=0),super._update(t)}};class gu extends cu{constructor(t){super({...gu.DEFAULTS,...t,definitions:Object.assign({},pu.DEFAULT_DEFINITIONS,null==t?void 0:t.definitions)})}updateOptions(t){super.updateOptions(t)}_update(t){t.definitions=Object.assign({},this.definitions,t.definitions),super._update(t),this._rebuildMask()}_rebuildMask(){const t=this.definitions;this._blocks=[],this.exposeBlock=void 0,this._stops=[],this._maskedBlocks={};const e=this.mask;if(!e||!t)return;let r=!1,n=!1;for(let o=0;o<e.length;++o){if(this.blocks){const t=e.slice(o),r=Object.keys(this.blocks).filter(e=>0===t.indexOf(e));r.sort((t,e)=>e.length-t.length);const n=r[0];if(n){const{expose:t,repeat:e,...r}=eu(this.blocks[n]),i={lazy:this.lazy,eager:this.eager,placeholderChar:this.placeholderChar,displayChar:this.displayChar,overwrite:this.overwrite,autofix:this.autofix,...r,repeat:e,parent:this},a=null!=e?new Js.RepeatBlock(i):ru(i);a&&(this._blocks.push(a),t&&(this.exposeBlock=a),this._maskedBlocks[n]||(this._maskedBlocks[n]=[]),this._maskedBlocks[n].push(this._blocks.length-1)),o+=n.length-1;continue}}let i=e[o],a=i in t;if(i===gu.STOP_CHAR){this._stops.push(this._blocks.length);continue}if("{"===i||"}"===i){r=!r;continue}if("["===i||"]"===i){n=!n;continue}if(i===gu.ESCAPE_CHAR){if(++o,i=e[o],!i)break;a=!1}const s=a?new pu({isOptional:n,lazy:this.lazy,eager:this.eager,placeholderChar:this.placeholderChar,displayChar:this.displayChar,...eu(t[i]),parent:this}):new du({char:i,eager:this.eager,isUnmasking:r});this._blocks.push(s)}}get state(){return{...super.state,_blocks:this._blocks.map(t=>t.state)}}set state(t){if(!t)return void this.reset();const{_blocks:e,...r}=t;this._blocks.forEach((t,r)=>t.state=e[r]),super.state=r}reset(){super.reset(),this._blocks.forEach(t=>t.reset())}get isComplete(){return this.exposeBlock?this.exposeBlock.isComplete:this._blocks.every(t=>t.isComplete)}get isFilled(){return this._blocks.every(t=>t.isFilled)}get isFixed(){return this._blocks.every(t=>t.isFixed)}get isOptional(){return this._blocks.every(t=>t.isOptional)}doCommit(){this._blocks.forEach(t=>t.doCommit()),super.doCommit()}get unmaskedValue(){return this.exposeBlock?this.exposeBlock.unmaskedValue:this._blocks.reduce((t,e)=>t+e.unmaskedValue,"")}set unmaskedValue(t){if(this.exposeBlock){const e=this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock))+this.exposeBlock.displayValue.length);this.exposeBlock.unmaskedValue=t,this.appendTail(e),this.doCommit()}else super.unmaskedValue=t}get value(){return this.exposeBlock?this.exposeBlock.value:this._blocks.reduce((t,e)=>t+e.value,"")}set value(t){if(this.exposeBlock){const e=this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock))+this.exposeBlock.displayValue.length);this.exposeBlock.value=t,this.appendTail(e),this.doCommit()}else super.value=t}get typedValue(){return this.exposeBlock?this.exposeBlock.typedValue:super.typedValue}set typedValue(t){if(this.exposeBlock){const e=this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock))+this.exposeBlock.displayValue.length);this.exposeBlock.typedValue=t,this.appendTail(e),this.doCommit()}else super.typedValue=t}get displayValue(){return this._blocks.reduce((t,e)=>t+e.displayValue,"")}appendTail(t){return super.appendTail(t).aggregate(this._appendPlaceholder())}_appendEager(){var t;const e=new uu;let r=null==(t=this._mapPosToBlock(this.displayValue.length))?void 0:t.index;if(null==r)return e;this._blocks[r].isFilled&&++r;for(let n=r;n<this._blocks.length;++n){const t=this._blocks[n]._appendEager();if(!t.inserted)break;e.aggregate(t)}return e}_appendCharRaw(t,e){void 0===e&&(e={});const r=this._mapPosToBlock(this.displayValue.length),n=new uu;if(!r)return n;for(let i,a=r.index;i=this._blocks[a];++a){var o;const r=i._appendChar(t,{...e,_beforeTailState:null==(o=e._beforeTailState)||null==(o=o._blocks)?void 0:o[a]});if(n.aggregate(r),r.consumed)break}return n}extractTail(t,e){void 0===t&&(t=0),void 0===e&&(e=this.displayValue.length);const r=new hu;return t===e||this._forEachBlocksInRange(t,e,(t,e,n,o)=>{const i=t.extractTail(n,o);i.stop=this._findStopBefore(e),i.from=this._blockStartPos(e),i instanceof hu&&(i.blockIndex=e),r.extend(i)}),r}extractInput(t,e,r){if(void 0===t&&(t=0),void 0===e&&(e=this.displayValue.length),void 0===r&&(r={}),t===e)return"";let n="";return this._forEachBlocksInRange(t,e,(t,e,o,i)=>{n+=t.extractInput(o,i,r)}),n}_findStopBefore(t){let e;for(let r=0;r<this._stops.length;++r){const n=this._stops[r];if(!(n<=t))break;e=n}return e}_appendPlaceholder(t){const e=new uu;if(this.lazy&&null==t)return e;const r=this._mapPosToBlock(this.displayValue.length);if(!r)return e;const n=r.index,o=null!=t?t:this._blocks.length;return this._blocks.slice(n,o).forEach(r=>{var n;r.lazy&&null==t||e.aggregate(r._appendPlaceholder(null==(n=r._blocks)?void 0:n.length))}),e}_mapPosToBlock(t){let e="";for(let r=0;r<this._blocks.length;++r){const n=this._blocks[r],o=e.length;if(e+=n.displayValue,t<=e.length)return{index:r,offset:t-o}}}_blockStartPos(t){return this._blocks.slice(0,t).reduce((t,e)=>t+e.displayValue.length,0)}_forEachBlocksInRange(t,e,r){void 0===e&&(e=this.displayValue.length);const n=this._mapPosToBlock(t);if(n){const t=this._mapPosToBlock(e),o=t&&n.index===t.index,i=n.offset,a=t&&o?t.offset:this._blocks[n.index].displayValue.length;if(r(this._blocks[n.index],n.index,i,a),t&&!o){for(let e=n.index+1;e<t.index;++e)r(this._blocks[e],e,0,this._blocks[e].displayValue.length);r(this._blocks[t.index],t.index,0,t.offset)}}}remove(t,e){void 0===t&&(t=0),void 0===e&&(e=this.displayValue.length);const r=super.remove(t,e);return this._forEachBlocksInRange(t,e,(t,e,n,o)=>{r.aggregate(t.remove(n,o))}),r}nearestInputPos(t,e){if(void 0===e&&(e=Gs),!this._blocks.length)return 0;const r=new fu(this,t);if(e===Gs)return r.pushRightBeforeInput()?r.pos:(r.popState(),r.pushLeftBeforeInput()?r.pos:this.displayValue.length);if(e===Xs||e===$s){if(e===Xs){if(r.pushRightBeforeFilled(),r.ok&&r.pos===t)return t;r.popState()}if(r.pushLeftBeforeInput(),r.pushLeftBeforeRequired(),r.pushLeftBeforeFilled(),e===Xs){if(r.pushRightBeforeInput(),r.pushRightBeforeRequired(),r.ok&&r.pos<=t)return r.pos;if(r.popState(),r.ok&&r.pos<=t)return r.pos;r.popState()}return r.ok?r.pos:e===$s?0:(r.popState(),r.ok?r.pos:(r.popState(),r.ok?r.pos:0))}return e===Ys||e===qs?(r.pushRightBeforeInput(),r.pushRightBeforeRequired(),r.pushRightBeforeFilled()?r.pos:e===qs?this.displayValue.length:(r.popState(),r.ok?r.pos:(r.popState(),r.ok?r.pos:this.nearestInputPos(t,Xs)))):t}totalInputPositions(t,e){void 0===t&&(t=0),void 0===e&&(e=this.displayValue.length);let r=0;return this._forEachBlocksInRange(t,e,(t,e,n,o)=>{r+=t.totalInputPositions(n,o)}),r}maskedBlock(t){return this.maskedBlocks(t)[0]}maskedBlocks(t){const e=this._maskedBlocks[t];return e?e.map(t=>this._blocks[t]):[]}pad(t){const e=new uu;return this._forEachBlocksInRange(0,this.displayValue.length,r=>e.aggregate(r.pad(t))),e}}gu.DEFAULTS={...cu.DEFAULTS,lazy:!0,placeholderChar:"_"},gu.STOP_CHAR="`",gu.ESCAPE_CHAR="\\",gu.InputDefinition=pu,gu.FixedDefinition=du,Js.MaskedPattern=gu;class mu extends gu{get _matchFrom(){return this.maxLength-String(this.from).length}constructor(t){super(t)}updateOptions(t){super.updateOptions(t)}_update(t){const{to:e=this.to||0,from:r=this.from||0,maxLength:n=this.maxLength||0,autofix:o=this.autofix,...i}=t;this.to=e,this.from=r,this.maxLength=Math.max(String(e).length,n),this.autofix=o;const a=String(this.from).padStart(this.maxLength,"0"),s=String(this.to).padStart(this.maxLength,"0");let u=0;for(;u<s.length&&s[u]===a[u];)++u;i.mask=s.slice(0,u).replace(/0/g,"\\0")+"0".repeat(this.maxLength-u),super._update(i)}get isComplete(){return super.isComplete&&Boolean(this.value)}boundaries(t){let e="",r="";const[,n,o]=t.match(/^(\D*)(\d*)(\D*)/)||[];return o&&(e="0".repeat(n.length)+o,r="9".repeat(n.length)+o),e=e.padEnd(this.maxLength,"0"),r=r.padEnd(this.maxLength,"9"),[e,r]}doPrepareChar(t,e){let r;return void 0===e&&(e={}),[t,r]=super.doPrepareChar(t.replace(/\D/g,""),e),t||(r.skip=!this.isComplete),[t,r]}_appendCharRaw(t,e){if(void 0===e&&(e={}),!this.autofix||this.value.length+1>this.maxLength)return super._appendCharRaw(t,e);const r=String(this.from).padStart(this.maxLength,"0"),n=String(this.to).padStart(this.maxLength,"0"),[o,i]=this.boundaries(this.value+t);return Number(i)<this.from?super._appendCharRaw(r[this.value.length],e):Number(o)>this.to?!e.tail&&"pad"===this.autofix&&this.value.length+1<this.maxLength?super._appendCharRaw(r[this.value.length],e).aggregate(this._appendCharRaw(t,e)):super._appendCharRaw(n[this.value.length],e):super._appendCharRaw(t,e)}doValidate(t){const e=this.value;if(-1===e.search(/[^0]/)&&e.length<=this._matchFrom)return!0;const[r,n]=this.boundaries(e);return this.from<=Number(n)&&Number(r)<=this.to&&super.doValidate(t)}pad(t){const e=new uu;if(this.value.length===this.maxLength)return e;const r=this.value,n=this.maxLength-this.value.length;if(n){this.reset();for(let r=0;r<n;++r)e.aggregate(super._appendCharRaw("0",t));r.split("").forEach(t=>this._appendCharRaw(t))}return e}}Js.MaskedRange=mu;class vu extends gu{static extractPatternOptions(t){const{mask:e,pattern:r,...n}=t;return{...n,mask:Hs(e)?e:r}}constructor(t){super(vu.extractPatternOptions({...vu.DEFAULTS,...t}))}updateOptions(t){super.updateOptions(t)}_update(t){const{mask:e,pattern:r,blocks:n,...o}={...vu.DEFAULTS,...t},i=Object.assign({},vu.GET_DEFAULT_BLOCKS());t.min&&(i.Y.from=t.min.getFullYear()),t.max&&(i.Y.to=t.max.getFullYear()),t.min&&t.max&&i.Y.from===i.Y.to&&(i.m.from=t.min.getMonth()+1,i.m.to=t.max.getMonth()+1,i.m.from===i.m.to&&(i.d.from=t.min.getDate(),i.d.to=t.max.getDate())),Object.assign(i,this.blocks,n),super._update({...o,mask:Hs(e)?e:r,blocks:i})}doValidate(t){const e=this.date;return super.doValidate(t)&&(!this.isComplete||this.isDateExist(this.value)&&null!=e&&(null==this.min||this.min<=e)&&(null==this.max||e<=this.max))}isDateExist(t){return this.format(this.parse(t,this),this).indexOf(t)>=0}get date(){return this.typedValue}set date(t){this.typedValue=t}get typedValue(){return this.isComplete?super.typedValue:null}set typedValue(t){super.typedValue=t}maskEquals(t){return t===Date||super.maskEquals(t)}optionsIsChanged(t){return super.optionsIsChanged(vu.extractPatternOptions(t))}}vu.GET_DEFAULT_BLOCKS=()=>({d:{mask:mu,from:1,to:31,maxLength:2},m:{mask:mu,from:1,to:12,maxLength:2},Y:{mask:mu,from:1900,to:9999}}),vu.DEFAULTS={...gu.DEFAULTS,mask:Date,pattern:"d{.}`m{.}`Y",format:(t,e)=>{if(!t)return"";return[String(t.getDate()).padStart(2,"0"),String(t.getMonth()+1).padStart(2,"0"),t.getFullYear()].join(".")},parse:(t,e)=>{const[r,n,o]=t.split(".").map(Number);return new Date(o,n-1,r)}},Js.MaskedDate=vu;class yu extends cu{constructor(t){super({...yu.DEFAULTS,...t}),this.currentMask=void 0}updateOptions(t){super.updateOptions(t)}_update(t){super._update(t),"mask"in t&&(this.exposeMask=void 0,this.compiledMasks=Array.isArray(t.mask)?t.mask.map(t=>{const{expose:e,...r}=eu(t),n=ru({overwrite:this._overwrite,eager:this._eager,skipInvalid:this._skipInvalid,...r});return e&&(this.exposeMask=n),n}):[])}_appendCharRaw(t,e){void 0===e&&(e={});const r=this._applyDispatch(t,e);return this.currentMask&&r.aggregate(this.currentMask._appendChar(t,this.currentMaskFlags(e))),r}_applyDispatch(t,e,r){void 0===t&&(t=""),void 0===e&&(e={}),void 0===r&&(r="");const n=e.tail&&null!=e._beforeTailState?e._beforeTailState._value:this.value,o=this.rawInputValue,i=e.tail&&null!=e._beforeTailState?e._beforeTailState._rawInputValue:o,a=o.slice(i.length),s=this.currentMask,u=new uu,l=null==s?void 0:s.state;return this.currentMask=this.doDispatch(t,{...e},r),this.currentMask&&(this.currentMask!==s?(this.currentMask.reset(),i&&(this.currentMask.append(i,{raw:!0}),u.tailShift=this.currentMask.value.length-n.length),a&&(u.tailShift+=this.currentMask.append(a,{raw:!0,tail:!0}).tailShift)):l&&(this.currentMask.state=l)),u}_appendPlaceholder(){const t=this._applyDispatch();return this.currentMask&&t.aggregate(this.currentMask._appendPlaceholder()),t}_appendEager(){const t=this._applyDispatch();return this.currentMask&&t.aggregate(this.currentMask._appendEager()),t}appendTail(t){const e=new uu;return t&&e.aggregate(this._applyDispatch("",{},t)),e.aggregate(this.currentMask?this.currentMask.appendTail(t):super.appendTail(t))}currentMaskFlags(t){var e,r;return{...t,_beforeTailState:(null==(e=t._beforeTailState)?void 0:e.currentMaskRef)===this.currentMask&&(null==(r=t._beforeTailState)?void 0:r.currentMask)||t._beforeTailState}}doDispatch(t,e,r){return void 0===e&&(e={}),void 0===r&&(r=""),this.dispatch(t,this,e,r)}doValidate(t){return super.doValidate(t)&&(!this.currentMask||this.currentMask.doValidate(this.currentMaskFlags(t)))}doPrepare(t,e){void 0===e&&(e={});let[r,n]=super.doPrepare(t,e);if(this.currentMask){let t;[r,t]=super.doPrepare(r,this.currentMaskFlags(e)),n=n.aggregate(t)}return[r,n]}doPrepareChar(t,e){void 0===e&&(e={});let[r,n]=super.doPrepareChar(t,e);if(this.currentMask){let t;[r,t]=super.doPrepareChar(r,this.currentMaskFlags(e)),n=n.aggregate(t)}return[r,n]}reset(){var t;null==(t=this.currentMask)||t.reset(),this.compiledMasks.forEach(t=>t.reset())}get value(){return this.exposeMask?this.exposeMask.value:this.currentMask?this.currentMask.value:""}set value(t){this.exposeMask?(this.exposeMask.value=t,this.currentMask=this.exposeMask,this._applyDispatch()):super.value=t}get unmaskedValue(){return this.exposeMask?this.exposeMask.unmaskedValue:this.currentMask?this.currentMask.unmaskedValue:""}set unmaskedValue(t){this.exposeMask?(this.exposeMask.unmaskedValue=t,this.currentMask=this.exposeMask,this._applyDispatch()):super.unmaskedValue=t}get typedValue(){return this.exposeMask?this.exposeMask.typedValue:this.currentMask?this.currentMask.typedValue:""}set typedValue(t){if(this.exposeMask)return this.exposeMask.typedValue=t,this.currentMask=this.exposeMask,void this._applyDispatch();let e=String(t);this.currentMask&&(this.currentMask.typedValue=t,e=this.currentMask.unmaskedValue),this.unmaskedValue=e}get displayValue(){return this.currentMask?this.currentMask.displayValue:""}get isComplete(){var t;return Boolean(null==(t=this.currentMask)?void 0:t.isComplete)}get isFilled(){var t;return Boolean(null==(t=this.currentMask)?void 0:t.isFilled)}remove(t,e){const r=new uu;return this.currentMask&&r.aggregate(this.currentMask.remove(t,e)).aggregate(this._applyDispatch()),r}get state(){var t;return{...super.state,_rawInputValue:this.rawInputValue,compiledMasks:this.compiledMasks.map(t=>t.state),currentMaskRef:this.currentMask,currentMask:null==(t=this.currentMask)?void 0:t.state}}set state(t){const{compiledMasks:e,currentMaskRef:r,currentMask:n,...o}=t;e&&this.compiledMasks.forEach((t,r)=>t.state=e[r]),null!=r&&(this.currentMask=r,this.currentMask.state=n),super.state=o}extractInput(t,e,r){return this.currentMask?this.currentMask.extractInput(t,e,r):""}extractTail(t,e){return this.currentMask?this.currentMask.extractTail(t,e):super.extractTail(t,e)}doCommit(){this.currentMask&&this.currentMask.doCommit(),super.doCommit()}nearestInputPos(t,e){return this.currentMask?this.currentMask.nearestInputPos(t,e):super.nearestInputPos(t,e)}get overwrite(){return this.currentMask?this.currentMask.overwrite:this._overwrite}set overwrite(t){this._overwrite=t}get eager(){return this.currentMask?this.currentMask.eager:this._eager}set eager(t){this._eager=t}get skipInvalid(){return this.currentMask?this.currentMask.skipInvalid:this._skipInvalid}set skipInvalid(t){this._skipInvalid=t}get autofix(){return this.currentMask?this.currentMask.autofix:this._autofix}set autofix(t){this._autofix=t}maskEquals(t){return Array.isArray(t)?this.compiledMasks.every((e,r)=>{if(!t[r])return;const{mask:n,...o}=t[r];return Zs(e,o)&&e.maskEquals(n)}):super.maskEquals(t)}typedValueEquals(t){var e;return Boolean(null==(e=this.currentMask)?void 0:e.typedValueEquals(t))}}yu.DEFAULTS={...cu.DEFAULTS,dispatch:(t,e,r,n)=>{if(!e.compiledMasks.length)return;const o=e.rawInputValue,i=e.compiledMasks.map((i,a)=>{const s=e.currentMask===i,u=s?i.displayValue.length:i.nearestInputPos(i.displayValue.length,$s);return i.rawInputValue!==o?(i.reset(),i.append(o,{raw:!0})):s||i.remove(u),i.append(t,e.currentMaskFlags(r)),i.appendTail(n),{index:a,weight:i.rawInputValue.length,totalInputPositions:i.totalInputPositions(0,Math.max(u,i.nearestInputPos(i.displayValue.length,$s)))}});return i.sort((t,e)=>e.weight-t.weight||e.totalInputPositions-t.totalInputPositions),e.compiledMasks[i[0].index]}},Js.MaskedDynamic=yu;class _u extends gu{constructor(t){super({..._u.DEFAULTS,...t})}updateOptions(t){super.updateOptions(t)}_update(t){const{enum:e,...r}=t;if(e){const t=e.map(t=>t.length),n=Math.min(...t),o=Math.max(...t)-n;r.mask="*".repeat(n),o&&(r.mask+="["+"*".repeat(o)+"]"),this.enum=e}super._update(r)}_appendCharRaw(t,e){void 0===e&&(e={});const r=Math.min(this.nearestInputPos(0,qs),this.value.length),n=this.enum.filter(e=>this.matchValue(e,this.unmaskedValue+t,r));if(n.length){1===n.length&&this._forEachBlocksInRange(0,this.value.length,(t,r)=>{const o=n[0][r];r>=this.value.length||o===t.value||(t.reset(),t._appendChar(o,e))});const t=super._appendCharRaw(n[0][this.value.length],e);return 1===n.length&&n[0].slice(this.unmaskedValue.length).split("").forEach(e=>t.aggregate(super._appendCharRaw(e))),t}return new uu({skip:!this.isComplete})}extractTail(t,e){return void 0===t&&(t=0),void 0===e&&(e=this.displayValue.length),new lu("",t)}remove(t,e){if(void 0===t&&(t=0),void 0===e&&(e=this.displayValue.length),t===e)return new uu;const r=Math.min(super.nearestInputPos(0,qs),this.value.length);let n;for(n=t;n>=0;--n){if(this.enum.filter(t=>this.matchValue(t,this.value.slice(r,n),r)).length>1)break}const o=super.remove(n,e);return o.tailShift+=n-t,o}get isComplete(){return this.enum.indexOf(this.value)>=0}}_u.DEFAULTS={...gu.DEFAULTS,matchValue:(t,e,r)=>t.indexOf(e,r)===r},Js.MaskedEnum=_u;var wu;Js.MaskedFunction=class extends cu{updateOptions(t){super.updateOptions(t)}_update(t){super._update({...t,validate:t.mask})}};class bu extends cu{constructor(t){super({...bu.DEFAULTS,...t})}updateOptions(t){super.updateOptions(t)}_update(t){super._update(t),this._updateRegExps()}_updateRegExps(){const t="^"+(this.allowNegative?"[+|\\-]?":""),e=(this.scale?"("+Ks(this.radix)+"\\d{0,"+this.scale+"})?":"")+"$";this._numberRegExp=new RegExp(t+"\\d*"+e),this._mapToRadixRegExp=new RegExp("["+this.mapToRadix.map(Ks).join("")+"]","g"),this._thousandsSeparatorRegExp=new RegExp(Ks(this.thousandsSeparator),"g")}_removeThousandsSeparators(t){return t.replace(this._thousandsSeparatorRegExp,"")}_insertThousandsSeparators(t){const e=t.split(this.radix);return e[0]=e[0].replace(/\B(?=(\d{3})+(?!\d))/g,this.thousandsSeparator),e.join(this.radix)}doPrepareChar(t,e){void 0===e&&(e={});const[r,n]=super.doPrepareChar(this._removeThousandsSeparators(this.scale&&this.mapToRadix.length&&(e.input&&e.raw||!e.input&&!e.raw)?t.replace(this._mapToRadixRegExp,this.radix):t),e);return t&&!r&&(n.skip=!0),!r||this.allowPositive||this.value||"-"===r||n.aggregate(this._appendChar("-")),[r,n]}_separatorsCount(t,e){void 0===e&&(e=!1);let r=0;for(let n=0;n<t;++n)this._value.indexOf(this.thousandsSeparator,n)===n&&(++r,e&&(t+=this.thousandsSeparator.length));return r}_separatorsCountFromSlice(t){return void 0===t&&(t=this._value),this._separatorsCount(this._removeThousandsSeparators(t).length,!0)}extractInput(t,e,r){return void 0===t&&(t=0),void 0===e&&(e=this.displayValue.length),[t,e]=this._adjustRangeWithSeparators(t,e),this._removeThousandsSeparators(super.extractInput(t,e,r))}_appendCharRaw(t,e){void 0===e&&(e={});const r=e.tail&&e._beforeTailState?e._beforeTailState._value:this._value,n=this._separatorsCountFromSlice(r);this._value=this._removeThousandsSeparators(this.value);const o=this._value;this._value+=t;const i=this.number;let a,s=!isNaN(i),u=!1;if(s){let t;null!=this.min&&this.min<0&&this.number<this.min&&(t=this.min),null!=this.max&&this.max>0&&this.number>this.max&&(t=this.max),null!=t&&(this.autofix?(this._value=this.format(t,this).replace(bu.UNMASKED_RADIX,this.radix),u||(u=o===this._value&&!e.tail)):s=!1),s&&(s=Boolean(this._value.match(this._numberRegExp)))}s?a=new uu({inserted:this._value.slice(o.length),rawInserted:u?"":t,skip:u}):(this._value=o,a=new uu),this._value=this._insertThousandsSeparators(this._value);const l=e.tail&&e._beforeTailState?e._beforeTailState._value:this._value,c=this._separatorsCountFromSlice(l);return a.tailShift+=(c-n)*this.thousandsSeparator.length,a}_findSeparatorAround(t){if(this.thousandsSeparator){const e=t-this.thousandsSeparator.length+1,r=this.value.indexOf(this.thousandsSeparator,e);if(r<=t)return r}return-1}_adjustRangeWithSeparators(t,e){const r=this._findSeparatorAround(t);r>=0&&(t=r);const n=this._findSeparatorAround(e);return n>=0&&(e=n+this.thousandsSeparator.length),[t,e]}remove(t,e){void 0===t&&(t=0),void 0===e&&(e=this.displayValue.length),[t,e]=this._adjustRangeWithSeparators(t,e);const r=this.value.slice(0,t),n=this.value.slice(e),o=this._separatorsCount(r.length);this._value=this._insertThousandsSeparators(this._removeThousandsSeparators(r+n));const i=this._separatorsCountFromSlice(r);return new uu({tailShift:(i-o)*this.thousandsSeparator.length})}nearestInputPos(t,e){if(!this.thousandsSeparator)return t;switch(e){case Gs:case Xs:case $s:{const r=this._findSeparatorAround(t-1);if(r>=0){const n=r+this.thousandsSeparator.length;if(t<n||this.value.length<=n||e===$s)return r}break}case Ys:case qs:{const e=this._findSeparatorAround(t);if(e>=0)return e+this.thousandsSeparator.length}}return t}doCommit(){if(this.value){const t=this.number;let e=t;null!=this.min&&(e=Math.max(e,this.min)),null!=this.max&&(e=Math.min(e,this.max)),e!==t&&(this.unmaskedValue=this.format(e,this));let r=this.value;this.normalizeZeros&&(r=this._normalizeZeros(r)),this.padFractionalZeros&&this.scale>0&&(r=this._padFractionalZeros(r)),this._value=r}super.doCommit()}_normalizeZeros(t){const e=this._removeThousandsSeparators(t).split(this.radix);return e[0]=e[0].replace(/^(\D*)(0*)(\d*)/,(t,e,r,n)=>e+n),t.length&&!/\d$/.test(e[0])&&(e[0]=e[0]+"0"),e.length>1&&(e[1]=e[1].replace(/0*$/,""),e[1].length||(e.length=1)),this._insertThousandsSeparators(e.join(this.radix))}_padFractionalZeros(t){if(!t)return t;const e=t.split(this.radix);return e.length<2&&e.push(""),e[1]=e[1].padEnd(this.scale,"0"),e.join(this.radix)}doSkipInvalid(t,e,r){void 0===e&&(e={});const n=0===this.scale&&t!==this.thousandsSeparator&&(t===this.radix||t===bu.UNMASKED_RADIX||this.mapToRadix.includes(t));return super.doSkipInvalid(t,e,r)&&!n}get unmaskedValue(){return this._removeThousandsSeparators(this._normalizeZeros(this.value)).replace(this.radix,bu.UNMASKED_RADIX)}set unmaskedValue(t){super.unmaskedValue=t}get typedValue(){return this.parse(this.unmaskedValue,this)}set typedValue(t){this.rawInputValue=this.format(t,this).replace(bu.UNMASKED_RADIX,this.radix)}get number(){return this.typedValue}set number(t){this.typedValue=t}get allowNegative(){return null!=this.min&&this.min<0||null!=this.max&&this.max<0}get allowPositive(){return null!=this.min&&this.min>0||null!=this.max&&this.max>0}typedValueEquals(t){return(super.typedValueEquals(t)||bu.EMPTY_VALUES.includes(t)&&bu.EMPTY_VALUES.includes(this.typedValue))&&!(0===t&&""===this.value)}}wu=bu,bu.UNMASKED_RADIX=".",bu.EMPTY_VALUES=[...cu.EMPTY_VALUES,0],bu.DEFAULTS={...cu.DEFAULTS,mask:Number,radix:",",thousandsSeparator:"",mapToRadix:[wu.UNMASKED_RADIX],min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER,scale:2,normalizeZeros:!0,padFractionalZeros:!1,parse:Number,format:t=>t.toLocaleString("en-US",{useGrouping:!1,maximumFractionDigits:20})},Js.MaskedNumber=bu;const Cu={MASKED:"value",UNMASKED:"unmaskedValue",TYPED:"typedValue"};function Au(t,e,r){void 0===e&&(e=Cu.MASKED),void 0===r&&(r=Cu.MASKED);const n=ru(t);return t=>n.runIsolated(n=>(n[e]=t,n[r]))}Js.PIPE_TYPE=Cu,Js.createPipe=Au,Js.pipe=function(t,e,r,n){return Au(e,r,n)(t)};Js.RepeatBlock=class extends gu{get repeatFrom(){var t;return null!=(t=Array.isArray(this.repeat)?this.repeat[0]:this.repeat===1/0?0:this.repeat)?t:0}get repeatTo(){var t;return null!=(t=Array.isArray(this.repeat)?this.repeat[1]:this.repeat)?t:1/0}constructor(t){super(t)}updateOptions(t){super.updateOptions(t)}_update(t){var e,r,n;const{repeat:o,...i}=eu(t);this._blockOpts=Object.assign({},this._blockOpts,i);const a=ru(this._blockOpts);this.repeat=null!=(e=null!=(r=null!=o?o:a.repeat)?r:this.repeat)?e:1/0,super._update({mask:"m".repeat(Math.max(this.repeatTo===1/0&&(null==(n=this._blocks)?void 0:n.length)||0,this.repeatFrom)),blocks:{m:a},eager:a.eager,overwrite:a.overwrite,skipInvalid:a.skipInvalid,lazy:a.lazy,placeholderChar:a.placeholderChar,displayChar:a.displayChar})}_allocateBlock(t){return t<this._blocks.length?this._blocks[t]:this.repeatTo===1/0||this._blocks.length<this.repeatTo?(this._blocks.push(ru(this._blockOpts)),this.mask+="m",this._blocks[this._blocks.length-1]):void 0}_appendCharRaw(t,e){void 0===e&&(e={});const r=new uu;for(let s,u,l=null!=(n=null==(o=this._mapPosToBlock(this.displayValue.length))?void 0:o.index)?n:Math.max(this._blocks.length-1,0);s=null!=(i=this._blocks[l])?i:u=!u&&this._allocateBlock(l);++l){var n,o,i,a;const c=s._appendChar(t,{...e,_beforeTailState:null==(a=e._beforeTailState)||null==(a=a._blocks)?void 0:a[l]});if(c.skip&&u){this._blocks.pop(),this.mask=this.mask.slice(1);break}if(r.aggregate(c),c.consumed)break}return r}_trimEmptyTail(t,e){var r,n;void 0===t&&(t=0);const o=Math.max((null==(r=this._mapPosToBlock(t))?void 0:r.index)||0,this.repeatFrom,0);let i;null!=e&&(i=null==(n=this._mapPosToBlock(e))?void 0:n.index),null==i&&(i=this._blocks.length-1);let a=0;for(let s=i;o<=s&&!this._blocks[s].unmaskedValue;--s,++a);a&&(this._blocks.splice(i-a+1,a),this.mask=this.mask.slice(a))}reset(){super.reset(),this._trimEmptyTail()}remove(t,e){void 0===t&&(t=0),void 0===e&&(e=this.displayValue.length);const r=super.remove(t,e);return this._trimEmptyTail(t,e),r}totalInputPositions(t,e){return void 0===t&&(t=0),null==e&&this.repeatTo===1/0?1/0:super.totalInputPositions(t,e)}get state(){return super.state}set state(t){this._blocks.length=t._blocks.length,this.mask=this.mask.slice(0,this._blocks.length),super.state=t}};try{globalThis.IMask=Js}catch{}var Eu,Iu={exports:{}},Su={exports:{}},xu={};var Ou,Tu,Nu,ku,Ru,Du,Pu,Mu,Bu,Lu,Fu,ju,Vu,Uu,Hu={};
574
+ /** @license React v16.13.1
575
+ * react-is.development.js
576
+ *
577
+ * Copyright (c) Facebook, Inc. and its affiliates.
578
+ *
579
+ * This source code is licensed under the MIT license found in the
580
+ * LICENSE file in the root directory of this source tree.
581
+ */function zu(){return Tu||(Tu=1,"production"===process.env.NODE_ENV?Su.exports=function(){if(Eu)return xu;Eu=1;var t="function"==typeof Symbol&&Symbol.for,e=t?Symbol.for("react.element"):60103,r=t?Symbol.for("react.portal"):60106,n=t?Symbol.for("react.fragment"):60107,o=t?Symbol.for("react.strict_mode"):60108,i=t?Symbol.for("react.profiler"):60114,a=t?Symbol.for("react.provider"):60109,s=t?Symbol.for("react.context"):60110,u=t?Symbol.for("react.async_mode"):60111,l=t?Symbol.for("react.concurrent_mode"):60111,c=t?Symbol.for("react.forward_ref"):60112,h=t?Symbol.for("react.suspense"):60113,f=t?Symbol.for("react.suspense_list"):60120,d=t?Symbol.for("react.memo"):60115,p=t?Symbol.for("react.lazy"):60116,g=t?Symbol.for("react.block"):60121,m=t?Symbol.for("react.fundamental"):60117,v=t?Symbol.for("react.responder"):60118,y=t?Symbol.for("react.scope"):60119;function _(t){if("object"==typeof t&&null!==t){var f=t.$$typeof;switch(f){case e:switch(t=t.type){case u:case l:case n:case i:case o:case h:return t;default:switch(t=t&&t.$$typeof){case s:case c:case p:case d:case a:return t;default:return f}}case r:return f}}}function w(t){return _(t)===l}return xu.AsyncMode=u,xu.ConcurrentMode=l,xu.ContextConsumer=s,xu.ContextProvider=a,xu.Element=e,xu.ForwardRef=c,xu.Fragment=n,xu.Lazy=p,xu.Memo=d,xu.Portal=r,xu.Profiler=i,xu.StrictMode=o,xu.Suspense=h,xu.isAsyncMode=function(t){return w(t)||_(t)===u},xu.isConcurrentMode=w,xu.isContextConsumer=function(t){return _(t)===s},xu.isContextProvider=function(t){return _(t)===a},xu.isElement=function(t){return"object"==typeof t&&null!==t&&t.$$typeof===e},xu.isForwardRef=function(t){return _(t)===c},xu.isFragment=function(t){return _(t)===n},xu.isLazy=function(t){return _(t)===p},xu.isMemo=function(t){return _(t)===d},xu.isPortal=function(t){return _(t)===r},xu.isProfiler=function(t){return _(t)===i},xu.isStrictMode=function(t){return _(t)===o},xu.isSuspense=function(t){return _(t)===h},xu.isValidElementType=function(t){return"string"==typeof t||"function"==typeof t||t===n||t===l||t===i||t===o||t===h||t===f||"object"==typeof t&&null!==t&&(t.$$typeof===p||t.$$typeof===d||t.$$typeof===a||t.$$typeof===s||t.$$typeof===c||t.$$typeof===m||t.$$typeof===v||t.$$typeof===y||t.$$typeof===g)},xu.typeOf=_,xu}():Su.exports=(Ou||(Ou=1,"production"!==process.env.NODE_ENV&&function(){var t="function"==typeof Symbol&&Symbol.for,e=t?Symbol.for("react.element"):60103,r=t?Symbol.for("react.portal"):60106,n=t?Symbol.for("react.fragment"):60107,o=t?Symbol.for("react.strict_mode"):60108,i=t?Symbol.for("react.profiler"):60114,a=t?Symbol.for("react.provider"):60109,s=t?Symbol.for("react.context"):60110,u=t?Symbol.for("react.async_mode"):60111,l=t?Symbol.for("react.concurrent_mode"):60111,c=t?Symbol.for("react.forward_ref"):60112,h=t?Symbol.for("react.suspense"):60113,f=t?Symbol.for("react.suspense_list"):60120,d=t?Symbol.for("react.memo"):60115,p=t?Symbol.for("react.lazy"):60116,g=t?Symbol.for("react.block"):60121,m=t?Symbol.for("react.fundamental"):60117,v=t?Symbol.for("react.responder"):60118,y=t?Symbol.for("react.scope"):60119;function _(t){if("object"==typeof t&&null!==t){var f=t.$$typeof;switch(f){case e:var g=t.type;switch(g){case u:case l:case n:case i:case o:case h:return g;default:var m=g&&g.$$typeof;switch(m){case s:case c:case p:case d:case a:return m;default:return f}}case r:return f}}}var w=u,b=l,C=s,A=a,E=e,I=c,S=n,x=p,O=d,T=r,N=i,k=o,R=h,D=!1;function P(t){return _(t)===l}Hu.AsyncMode=w,Hu.ConcurrentMode=b,Hu.ContextConsumer=C,Hu.ContextProvider=A,Hu.Element=E,Hu.ForwardRef=I,Hu.Fragment=S,Hu.Lazy=x,Hu.Memo=O,Hu.Portal=T,Hu.Profiler=N,Hu.StrictMode=k,Hu.Suspense=R,Hu.isAsyncMode=function(t){return D||(D=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),P(t)||_(t)===u},Hu.isConcurrentMode=P,Hu.isContextConsumer=function(t){return _(t)===s},Hu.isContextProvider=function(t){return _(t)===a},Hu.isElement=function(t){return"object"==typeof t&&null!==t&&t.$$typeof===e},Hu.isForwardRef=function(t){return _(t)===c},Hu.isFragment=function(t){return _(t)===n},Hu.isLazy=function(t){return _(t)===p},Hu.isMemo=function(t){return _(t)===d},Hu.isPortal=function(t){return _(t)===r},Hu.isProfiler=function(t){return _(t)===i},Hu.isStrictMode=function(t){return _(t)===o},Hu.isSuspense=function(t){return _(t)===h},Hu.isValidElementType=function(t){return"string"==typeof t||"function"==typeof t||t===n||t===l||t===i||t===o||t===h||t===f||"object"==typeof t&&null!==t&&(t.$$typeof===p||t.$$typeof===d||t.$$typeof===a||t.$$typeof===s||t.$$typeof===c||t.$$typeof===m||t.$$typeof===v||t.$$typeof===y||t.$$typeof===g)},Hu.typeOf=_}()),Hu)),Su.exports}
582
+ /*
583
+ object-assign
584
+ (c) Sindre Sorhus
585
+ @license MIT
586
+ */function Wu(){if(ku)return Nu;ku=1;var t=Object.getOwnPropertySymbols,e=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable;return Nu=function(){try{if(!Object.assign)return!1;var t=new String("abc");if(t[5]="de","5"===Object.getOwnPropertyNames(t)[0])return!1;for(var e={},r=0;r<10;r++)e["_"+String.fromCharCode(r)]=r;if("0123456789"!==Object.getOwnPropertyNames(e).map(function(t){return e[t]}).join(""))return!1;var n={};return"abcdefghijklmnopqrst".split("").forEach(function(t){n[t]=t}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},n)).join("")}catch(o){return!1}}()?Object.assign:function(n,o){for(var i,a,s=function(t){if(null==t)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}(n),u=1;u<arguments.length;u++){for(var l in i=Object(arguments[u]))e.call(i,l)&&(s[l]=i[l]);if(t){a=t(i);for(var c=0;c<a.length;c++)r.call(i,a[c])&&(s[a[c]]=i[a[c]])}}return s},Nu}function Gu(){if(Du)return Ru;Du=1;return Ru="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"}function Xu(){return Mu?Pu:(Mu=1,Pu=Function.call.bind(Object.prototype.hasOwnProperty))}if("production"!==process.env.NODE_ENV){var $u=zu();Iu.exports=function(){if(ju)return Fu;ju=1;var t=zu(),e=Wu(),r=Gu(),n=Xu(),o=function(){if(Lu)return Bu;Lu=1;var t=function(){};if("production"!==process.env.NODE_ENV){var e=Gu(),r={},n=Xu();t=function(t){var e="Warning: "+t;"undefined"!=typeof console&&console.error(e);try{throw new Error(e)}catch(r){}}}function o(o,i,a,s,u){if("production"!==process.env.NODE_ENV)for(var l in o)if(n(o,l)){var c;try{if("function"!=typeof o[l]){var h=Error((s||"React class")+": "+a+" type `"+l+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof o[l]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw h.name="Invariant Violation",h}c=o[l](i,l,s,a,null,e)}catch(d){c=d}if(!c||c instanceof Error||t((s||"React class")+": type specification of "+a+" `"+l+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof c+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),c instanceof Error&&!(c.message in r)){r[c.message]=!0;var f=u?u():"";t("Failed "+a+" type: "+c.message+(null!=f?f:""))}}}return o.resetWarningCache=function(){"production"!==process.env.NODE_ENV&&(r={})},Bu=o}(),i=function(){};function a(){return null}return"production"!==process.env.NODE_ENV&&(i=function(t){var e="Warning: "+t;"undefined"!=typeof console&&console.error(e);try{throw new Error(e)}catch(r){}}),Fu=function(s,u){var l="function"==typeof Symbol&&Symbol.iterator,c="<<anonymous>>",h={array:g("array"),bigint:g("bigint"),bool:g("boolean"),func:g("function"),number:g("number"),object:g("object"),string:g("string"),symbol:g("symbol"),any:p(a),arrayOf:function(t){return p(function(e,n,o,i,a){if("function"!=typeof t)return new d("Property `"+a+"` of component `"+o+"` has invalid PropType notation inside arrayOf.");var s=e[n];if(!Array.isArray(s))return new d("Invalid "+i+" `"+a+"` of type `"+y(s)+"` supplied to `"+o+"`, expected an array.");for(var u=0;u<s.length;u++){var l=t(s,u,o,i,a+"["+u+"]",r);if(l instanceof Error)return l}return null})},element:p(function(t,e,r,n,o){var i=t[e];return s(i)?null:new d("Invalid "+n+" `"+o+"` of type `"+y(i)+"` supplied to `"+r+"`, expected a single ReactElement.")}),elementType:p(function(e,r,n,o,i){var a=e[r];return t.isValidElementType(a)?null:new d("Invalid "+o+" `"+i+"` of type `"+y(a)+"` supplied to `"+n+"`, expected a single ReactElement type.")}),instanceOf:function(t){return p(function(e,r,n,o,i){if(!(e[r]instanceof t)){var a=t.name||c;return new d("Invalid "+o+" `"+i+"` of type `"+((s=e[r]).constructor&&s.constructor.name?s.constructor.name:c)+"` supplied to `"+n+"`, expected instance of `"+a+"`.")}var s;return null})},node:p(function(t,e,r,n,o){return v(t[e])?null:new d("Invalid "+n+" `"+o+"` supplied to `"+r+"`, expected a ReactNode.")}),objectOf:function(t){return p(function(e,o,i,a,s){if("function"!=typeof t)return new d("Property `"+s+"` of component `"+i+"` has invalid PropType notation inside objectOf.");var u=e[o],l=y(u);if("object"!==l)return new d("Invalid "+a+" `"+s+"` of type `"+l+"` supplied to `"+i+"`, expected an object.");for(var c in u)if(n(u,c)){var h=t(u,c,i,a,s+"."+c,r);if(h instanceof Error)return h}return null})},oneOf:function(t){return Array.isArray(t)?p(function(e,r,n,o,i){for(var a=e[r],s=0;s<t.length;s++)if(f(a,t[s]))return null;var u=JSON.stringify(t,function(t,e){return"symbol"===_(e)?String(e):e});return new d("Invalid "+o+" `"+i+"` of value `"+String(a)+"` supplied to `"+n+"`, expected one of "+u+".")}):("production"!==process.env.NODE_ENV&&i(arguments.length>1?"Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).":"Invalid argument supplied to oneOf, expected an array."),a)},oneOfType:function(t){if(!Array.isArray(t))return"production"!==process.env.NODE_ENV&&i("Invalid argument supplied to oneOfType, expected an instance of array."),a;for(var e=0;e<t.length;e++){var o=t[e];if("function"!=typeof o)return i("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+w(o)+" at index "+e+"."),a}return p(function(e,o,i,a,s){for(var u=[],l=0;l<t.length;l++){var c=(0,t[l])(e,o,i,a,s,r);if(null==c)return null;c.data&&n(c.data,"expectedType")&&u.push(c.data.expectedType)}return new d("Invalid "+a+" `"+s+"` supplied to `"+i+"`"+(u.length>0?", expected one of type ["+u.join(", ")+"]":"")+".")})},shape:function(t){return p(function(e,n,o,i,a){var s=e[n],u=y(s);if("object"!==u)return new d("Invalid "+i+" `"+a+"` of type `"+u+"` supplied to `"+o+"`, expected `object`.");for(var l in t){var c=t[l];if("function"!=typeof c)return m(o,i,a,l,_(c));var h=c(s,l,o,i,a+"."+l,r);if(h)return h}return null})},exact:function(t){return p(function(o,i,a,s,u){var l=o[i],c=y(l);if("object"!==c)return new d("Invalid "+s+" `"+u+"` of type `"+c+"` supplied to `"+a+"`, expected `object`.");var h=e({},o[i],t);for(var f in h){var p=t[f];if(n(t,f)&&"function"!=typeof p)return m(a,s,u,f,_(p));if(!p)return new d("Invalid "+s+" `"+u+"` key `"+f+"` supplied to `"+a+"`.\nBad object: "+JSON.stringify(o[i],null," ")+"\nValid keys: "+JSON.stringify(Object.keys(t),null," "));var g=p(l,f,a,s,u+"."+f,r);if(g)return g}return null})}};function f(t,e){return t===e?0!==t||1/t==1/e:t!=t&&e!=e}function d(t,e){this.message=t,this.data=e&&"object"==typeof e?e:{},this.stack=""}function p(t){if("production"!==process.env.NODE_ENV)var e={},n=0;function o(o,a,s,l,h,f,p){if(l=l||c,f=f||s,p!==r){if(u){var g=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw g.name="Invariant Violation",g}if("production"!==process.env.NODE_ENV&&"undefined"!=typeof console){var m=l+":"+s;!e[m]&&n<3&&(i("You are manually calling a React.PropTypes validation function for the `"+f+"` prop on `"+l+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),e[m]=!0,n++)}}return null==a[s]?o?null===a[s]?new d("The "+h+" `"+f+"` is marked as required in `"+l+"`, but its value is `null`."):new d("The "+h+" `"+f+"` is marked as required in `"+l+"`, but its value is `undefined`."):null:t(a,s,l,h,f)}var a=o.bind(null,!1);return a.isRequired=o.bind(null,!0),a}function g(t){return p(function(e,r,n,o,i,a){var s=e[r];return y(s)!==t?new d("Invalid "+o+" `"+i+"` of type `"+_(s)+"` supplied to `"+n+"`, expected `"+t+"`.",{expectedType:t}):null})}function m(t,e,r,n,o){return new d((t||"React class")+": "+e+" type `"+r+"."+n+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+o+"`.")}function v(t){switch(typeof t){case"number":case"string":case"undefined":return!0;case"boolean":return!t;case"object":if(Array.isArray(t))return t.every(v);if(null===t||s(t))return!0;var e=function(t){var e=t&&(l&&t[l]||t["@@iterator"]);if("function"==typeof e)return e}(t);if(!e)return!1;var r,n=e.call(t);if(e!==t.entries){for(;!(r=n.next()).done;)if(!v(r.value))return!1}else for(;!(r=n.next()).done;){var o=r.value;if(o&&!v(o[1]))return!1}return!0;default:return!1}}function y(t){var e=typeof t;return Array.isArray(t)?"array":t instanceof RegExp?"object":function(t,e){return"symbol"===t||!!e&&("Symbol"===e["@@toStringTag"]||"function"==typeof Symbol&&e instanceof Symbol)}(e,t)?"symbol":e}function _(t){if(null==t)return""+t;var e=y(t);if("object"===e){if(t instanceof Date)return"date";if(t instanceof RegExp)return"regexp"}return e}function w(t){var e=_(t);switch(e){case"array":case"object":return"an "+e;case"boolean":case"date":case"regexp":return"a "+e;default:return e}}return d.prototype=Error.prototype,h.checkPropTypes=o,h.resetWarningCache=o.resetWarningCache,h.PropTypes=h,h},Fu}()($u.isElement,!0)}else Iu.exports=function(){if(Uu)return Vu;Uu=1;var t=Gu();function e(){}function r(){}return r.resetWarningCache=e,Vu=function(){function n(e,r,n,o,i,a){if(a!==t){var s=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function o(){return n}n.isRequired=n;var i={array:n,bigint:n,bool:n,func:n,number:n,object:n,string:n,symbol:n,any:n,arrayOf:o,element:n,elementType:n,instanceOf:o,node:n,objectOf:o,oneOf:o,oneOfType:o,shape:o,exact:o,checkPropTypes:r,resetWarningCache:e};return i.PropTypes=i,i}}()();const Yu=d(Iu.exports),qu={mask:Yu.oneOfType([Yu.array,Yu.func,Yu.string,Yu.instanceOf(RegExp),Yu.oneOf([Date,Number,Js.Masked]),Yu.instanceOf(Js.Masked)]),value:Yu.any,unmask:Yu.oneOfType([Yu.bool,Yu.oneOf(["typed"])]),prepare:Yu.func,prepareChar:Yu.func,validate:Yu.func,commit:Yu.func,overwrite:Yu.oneOfType([Yu.bool,Yu.oneOf(["shift"])]),eager:Yu.oneOfType([Yu.bool,Yu.oneOf(["append","remove"])]),skipInvalid:Yu.bool,onAccept:Yu.func,onComplete:Yu.func,placeholderChar:Yu.string,displayChar:Yu.string,lazy:Yu.bool,definitions:Yu.object,blocks:Yu.object,enum:Yu.arrayOf(Yu.string),maxLength:Yu.number,from:Yu.number,to:Yu.number,pattern:Yu.string,format:Yu.func,parse:Yu.func,autofix:Yu.oneOfType([Yu.bool,Yu.oneOf(["pad"])]),radix:Yu.string,thousandsSeparator:Yu.string,mapToRadix:Yu.arrayOf(Yu.string),scale:Yu.number,normalizeZeros:Yu.bool,padFractionalZeros:Yu.bool,min:Yu.oneOfType([Yu.number,Yu.instanceOf(Date)]),max:Yu.oneOfType([Yu.number,Yu.instanceOf(Date)]),dispatch:Yu.func,inputRef:Yu.oneOfType([Yu.func,Yu.shape({current:Yu.object})])},Ku=Object.keys(qu).filter(t=>"value"!==t),Zu=["value","unmask","onAccept","onComplete","inputRef"],Qu=Ku.filter(t=>Zu.indexOf(t)<0);const Ju=function(t){var r;const n=((r=class extends e.Component{constructor(t){super(t),this._inputRef=this._inputRef.bind(this)}componentDidMount(){this.props.mask&&this.initMask()}componentDidUpdate(){const t=this.props,e=this._extractMaskOptionsFromProps(t);var r;e.mask?this.maskRef?(this.maskRef.updateOptions(e),"value"in t&&void 0!==t.value&&(this.maskValue=t.value)):this.initMask(e):(this.destroyMask(),"value"in t&&void 0!==t.value&&(null!=(r=this.element)&&r.isContentEditable&&"INPUT"!==this.element.tagName&&"TEXTAREA"!==this.element.tagName?this.element.textContent=t.value:this.element.value=t.value))}componentWillUnmount(){this.destroyMask()}_inputRef(t){this.element=t,this.props.inputRef&&(Object.prototype.hasOwnProperty.call(this.props.inputRef,"current")?this.props.inputRef.current=t:this.props.inputRef(t))}initMask(t){void 0===t&&(t=this._extractMaskOptionsFromProps(this.props)),this.maskRef=Js(this.element,t).on("accept",this._onAccept.bind(this)).on("complete",this._onComplete.bind(this)),"value"in this.props&&void 0!==this.props.value&&(this.maskValue=this.props.value)}destroyMask(){this.maskRef&&(this.maskRef.destroy(),delete this.maskRef)}_extractMaskOptionsFromProps(t){const{...e}=t;return Object.keys(e).filter(t=>Qu.indexOf(t)<0).forEach(t=>{delete e[t]}),e}_extractNonMaskProps(t){const{...e}=t;return Ku.forEach(t=>{"maxLength"!==t&&delete e[t]}),"defaultValue"in e||(e.defaultValue=t.mask?"":e.value),delete e.value,e}get maskValue(){return this.maskRef?"typed"===this.props.unmask?this.maskRef.typedValue:this.props.unmask?this.maskRef.unmaskedValue:this.maskRef.value:""}set maskValue(t){this.maskRef&&(t=null==t&&"typed"!==this.props.unmask?"":t,"typed"===this.props.unmask?this.maskRef.typedValue=t:this.props.unmask?this.maskRef.unmaskedValue=t:this.maskRef.value=t)}_onAccept(t){this.props.onAccept&&this.maskRef&&this.props.onAccept(this.maskValue,this.maskRef,t)}_onComplete(t){this.props.onComplete&&this.maskRef&&this.props.onComplete(this.maskValue,this.maskRef,t)}render(){return e.createElement(t,{...this._extractNonMaskProps(this.props),inputRef:this._inputRef})}}).displayName=void 0,r.propTypes=void 0,r),o=t.displayName||t.name||"Component";return n.displayName="IMask("+o+")",n.propTypes=qu,e.forwardRef((t,r)=>e.createElement(n,{...t,ref:r}))}(t=>{let{inputRef:r,...n}=t;return e.createElement("input",{...n,ref:r})}),tl=e.forwardRef((t,r)=>e.createElement(Ju,{...t,ref:r})),el=[{mask:"000.000.000-00"},Fs];function rl({value:t,name:e,onChange:r,className:n,...o}){return Qt.jsx(tl,{className:`form-control ${Vs(t)?"is-invalid":""} ${n||""}`,mask:Fs.mask,definitions:Fs.definitions,onAccept:function(t){r({target:{name:e,value:t.toUpperCase()}})},value:t,name:e,...o})}function nl(t,e,r){if(r){r({target:{name:e,value:(n=t.floatValue,!n||null==n||isNaN(n)?0:Number(n))}})}var n}const ol=({name:t,onChange:e,onClick:r,allowNegative:n=!1,...o})=>Qt.jsx(l,{name:t,thousandSeparator:".",decimalSeparator:",",decimalScale:2,fixedDecimalScale:!0,prefix:"R$ ",className:"form-control",allowNegative:n,onValueChange:r=>nl(r,t,e),onClick:function(t){r?r(t):t.target.select()},...o}),il=({name:t,onChange:e,onClick:r,allowNegative:n=!0,decimalScale:o=2,...i})=>Qt.jsx(l,{name:t,thousandSeparator:".",decimalSeparator:",",fixedDecimalScale:!0,prefix:"",className:"form-control",decimalScale:o,allowNegative:n,onValueChange:r=>nl(r,t,e),onClick:function(t){r?r(t):t.target.select()},...i}),al=({name:t,onChange:e,allowNegative:r=!0,decimalScale:n=2,...o})=>Qt.jsx(l,{thousandSeparator:".",decimalSeparator:",",fixedDecimalScale:!0,prefix:"",suffix:"%",className:"form-control",decimalScale:n,allowNegative:r,onValueChange:r=>nl(r,t,e),name:t,...o}),sl=({name:t,onChange:e,...r})=>Qt.jsx(l,{thousandSeparator:".",decimalSeparator:",",fixedDecimalScale:!0,prefix:"",className:"form-control",decimalScale:0,allowNegative:!1,onValueChange:r=>nl(r,t,e),...r}),ul=t=>Qt.jsx(l,{name:t.name,format:"##:##",mask:"_",value:t.value,onChange:t.onChange,className:"form-control",...t}),ll=t=>Qt.jsx(i.Input,{tag:l,name:t.name,format:"###.###.###-##",mask:"_",value:t.value,onChange:t.onChange,invalid:js(t.value),...t}),cl=t=>Qt.jsxs("select",{className:"form-select",name:t.name,value:t.value,onChange:t.onChange,...t,children:[Qt.jsx("option",{value:"",children:"- Selecione o estado -"}),Qt.jsx("option",{value:"EX",children:"Estrangeiro"}),Qt.jsx("option",{value:"AC",children:"Acre"}),Qt.jsx("option",{value:"AL",children:"Alagoas"}),Qt.jsx("option",{value:"AP",children:"Amapá"}),Qt.jsx("option",{value:"AM",children:"Amazonas"}),Qt.jsx("option",{value:"BA",children:"Bahia"}),Qt.jsx("option",{value:"CE",children:"Ceará"}),Qt.jsx("option",{value:"DF",children:"Distrito Federal"}),Qt.jsx("option",{value:"ES",children:"Espírito Santo"}),Qt.jsx("option",{value:"GO",children:"Goiás"}),Qt.jsx("option",{value:"MA",children:"Maranhão"}),Qt.jsx("option",{value:"MT",children:"Mato Grosso"}),Qt.jsx("option",{value:"MS",children:"Mato Grosso do Sul"}),Qt.jsx("option",{value:"MG",children:"Minas Gerais"}),Qt.jsx("option",{value:"PA",children:"Pará"}),Qt.jsx("option",{value:"PB",children:"Paraíba"}),Qt.jsx("option",{value:"PR",children:"Paraná"}),Qt.jsx("option",{value:"PE",children:"Pernambuco"}),Qt.jsx("option",{value:"PI",children:"Piauí"}),Qt.jsx("option",{value:"RJ",children:"Rio de Janeiro"}),Qt.jsx("option",{value:"RN",children:"Rio Grande do Norte"}),Qt.jsx("option",{value:"RS",children:"Rio Grande do Sul"}),Qt.jsx("option",{value:"RO",children:"Rondônia"}),Qt.jsx("option",{value:"RR",children:"Roraima"}),Qt.jsx("option",{value:"SC",children:"Santa Catarina"}),Qt.jsx("option",{value:"SP",children:"São Paulo"}),Qt.jsx("option",{value:"SE",children:"Sergipe"}),Qt.jsx("option",{value:"TO",children:"Tocantins"})]});function hl({innerRef:t,loading:e,page:r,pages:n,...o}){return Qt.jsx("div",{className:"footer-load-more--container",ref:t,hidden:r>=n,...o,children:e&&Qt.jsxs(Qt.Fragment,{children:[Qt.jsx("div",{className:"spinner-border spinner-border-sm",role:"status",children:Qt.jsx("span",{className:"visually-hidden",children:"Loading..."})}),"Carregando..."]})})}const fl={q:"",page:1};function dl({isOpen:t,setOpen:n,title:o="Pesquisar",placeHolder:i="Digite o que deseja pesquisar",maxWidth:a=800,searchInit:s,route:u,keyField:l,fields:c,renderLine:h,onClick:f,helpLink:d}){var p,g;const m=e.useRef(null),[v]=e.useState(`box-inp-${r.random(1e4)}`),[y,_]=e.useState([]),[w,b]=e.useState(""),[C,A]=e.useState({...fl,q:s||""}),[E,I]=e.useState(!1),[S,x]=or({url:u,params:{...C,limit:r.isDesktop()?28:10},onTerminated:t=>{t.error?b(t.error):t.data instanceof Array?(I(!1),_(t.data)):(I(!0),_(e=>[...e,...t.data.data]))}});function O(){if(!C.q)return b("Informe o que deseja pesquisar!");_([]),C.page>1?A({...C,page:1}):S(),T()}function T(){var t;r.isDesktop()&&(null==(t=document.querySelector(`#${v}`))||t.focus())}return e.useEffect(()=>{C.q.length>0&&S()},[C.page]),e.useEffect(()=>{const t=m.current;if(!t)return;const e=new IntersectionObserver(t=>{t.forEach(t=>{t.isIntersecting&&function(){var t;let e=C.page+1;if(e>(null==(t=x.data)?void 0:t.pages)||x.loading||0==y.length)return;x.data||(e=1);A({...C,page:e})}()})});return e.observe(t),()=>e.unobserve(t)},[y]),t?Qt.jsxs(Qt.Fragment,{children:[Qt.jsx(Bs,{visible:x.loading}),Qt.jsxs(cr,{title:o,maxWidth:a,visible:!0,setVisible:n,children:[Qt.jsx(dr,{helpLink:d,setVisible:n,children:o}),Qt.jsx(fr,{children:Qt.jsxs(hr,{children:[Qt.jsx("div",{className:"my-2",children:Qt.jsx(sr,{search:C.q,setSearch:t=>A({...C,q:t}),fnSearch:O,placeHolder:i,onKeyDown:function(t){13===t.keyCode&&(t.preventDefault(),O())},autoFocus:r.isDesktop(),id:v})}),Qt.jsxs("div",{className:"box-search--data-container",children:[0===(null==(p=x.data)?void 0:p.length)&&Qt.jsx("div",{className:"alert alert-info text-center bold",children:"Nenhum registro encontrado!"}),y&&Qt.jsx("table",{children:Qt.jsx("tbody",{children:null==y?void 0:y.map((t,e)=>Qt.jsx("tr",{onClick:()=>f(t[l],t),children:h?h(t):c.map((e,r)=>{let n;return n=0==r?{width:60,textAlign:"center",fontWeight:"bold"}:{width:"auto",textAlign:"left",fontWeight:"normal"},Qt.jsx("td",{style:n,children:t[e]},r)})},e))})}),E&&Qt.jsx(hl,{innerRef:m,loading:x.loading,page:C.page,pages:null==(g=x.data)?void 0:g.pages})]})]})})]}),w&&Qt.jsx(se,{onConfirm:()=>{b(),T()},children:w})]}):null}function pl({children:t,findTitle:r,findPlaceHolder:n,findRoute:o,findKeyField:i,findFields:a,findRenderLine:s,findOnSelect:u,...l}){const[c,h]=e.useState(!1);return Qt.jsxs(Qt.Fragment,{children:[Qt.jsxs("div",{className:"input-group",children:[Qt.jsxs("select",{className:"form-select",...l,children:[Qt.jsxs("option",{value:0,children:["- ",r," -"]}),t]}),Qt.jsx("button",{type:"button",title:"Pesquisar...",className:"btn btn-info",onClick:()=>h(!0),children:Qt.jsx(_e,{})})]}),c&&Qt.jsx(dl,{title:r,placeHolder:n,fields:a,keyField:i,route:o,isOpen:!0,setOpen:h,renderLine:s,onClick:(t,e)=>{u(t,e),h(!1)}})]})}const gl=o.div`
574
587
  display: inline-block;
575
- `,ec=o.span`
588
+ `,ml=o.span`
576
589
  color: ${t=>t.disabled?"silver":"#333"};
577
590
  display: flex;
578
591
  align-items: center;
@@ -582,7 +595,7 @@
582
595
  span {
583
596
  font-size: 20px;
584
597
  }
585
- `,rc=o.div`
598
+ `,vl=o.div`
586
599
  position: relative;
587
600
 
588
601
  input {
@@ -608,7 +621,7 @@
608
621
  color: ${({disabled:t})=>t?"currentColor":"var(--bs-primary)"};
609
622
  }
610
623
  }
611
- `;const nc=o.div`
624
+ `;const yl=o.div`
612
625
  --toggle-color-on: #4169ed;
613
626
  --toggle-color-off: #666;
614
627
  --toggle-color-inactive: #999;
@@ -649,7 +662,7 @@
649
662
  font-weight: bold;
650
663
  color: var(--toggle-color-${t=>t.disabled?"inactive":"text"});
651
664
  }
652
- `;const oc=o.main`
665
+ `;const _l=o.main`
653
666
  height: calc(100% - 55px);
654
667
  overflow-y: scroll;
655
668
  overflow-x: hidden;
@@ -693,7 +706,7 @@
693
706
  max-width: ${({hasMaxWidth:t})=>t?"1840px":"auto"};
694
707
  margin: 12px auto 20px;
695
708
  }
696
- `;const ic=o.div`
709
+ `;const wl=o.div`
697
710
  display: flex;
698
711
  flex-direction: column;
699
712
  gap: var(--form-desk-gap);
@@ -757,7 +770,7 @@
757
770
  }
758
771
  }
759
772
  }
760
- `;const ac={id:"",caption:"",title:"",isOpen:!1,isVisible:!1},sc=e.createContext(null);function cc(t){let e=!1;for(const r of t)r.isOpen=!1,r.isVisible&&!e&&(r.isOpen=!0,e=!0)}function uc(){return e.useContext(sc)}function lc({isMultine:t}){const{tabs:e,selectTab:r}=uc(),n=e.filter(t=>t.isVisible);return Qt.jsx("div",{className:"tab-header--container "+(t?"is-tab-multiline":""),children:n.map(t=>Qt.jsx("button",{type:"button",title:t.title,onClick:()=>r(t.id),hidden:!t.isVisible,className:t.isOpen&&n.length>1?"tab-active":"",tabIndex:-1,children:t.caption||t.title},t.id))})}const fc=o.div`
773
+ `;const bl={id:"",caption:"",title:"",isOpen:!1,isVisible:!1},Cl=e.createContext(null);function Al(t){let e=!1;for(const r of t)r.isOpen=!1,r.isVisible&&!e&&(r.isOpen=!0,e=!0)}function El(){return e.useContext(Cl)}function Il({isMultine:t}){const{tabs:e,selectTab:r}=El(),n=e.filter(t=>t.isVisible);return Qt.jsx("div",{className:"tab-header--container "+(t?"is-tab-multiline":""),children:n.map(t=>Qt.jsx("button",{type:"button",title:t.title,onClick:()=>r(t.id),hidden:!t.isVisible,className:t.isOpen&&n.length>1?"tab-active":"",tabIndex:-1,children:t.caption||t.title},t.id))})}const Sl=o.div`
761
774
  /* margin: ${({noMargin:t})=>t?"0":"5px 0 8px"}; */
762
775
  border: 1px solid var(--bi-color-border);
763
776
  border-radius: ${t=>t.open?"0 0 var(--pn-border-radius) var(--pn-border-radius)":"0"};
@@ -841,7 +854,7 @@
841
854
  }
842
855
  }
843
856
  }
844
- `;const dc=qe.createInstance({name:"report",storeName:"report"});function hc(t,r){const[n,o]=e.useState(()=>{const e=localStorage.getItem(t);return e&&"undefined"!==e&&"null"!==e&&""!==e?JSON.parse(e):r});return e.useEffect(()=>localStorage.setItem(t,JSON.stringify(n)),[n]),[n,o]}const pc=o.div`
857
+ `;const xl=qe.createInstance({name:"report",storeName:"report"});function Ol(t,r){const[n,o]=e.useState(()=>{const e=localStorage.getItem(t);return e&&"undefined"!==e&&"null"!==e&&""!==e?JSON.parse(e):r});return e.useEffect(()=>localStorage.setItem(t,JSON.stringify(n)),[n]),[n,o]}const Tl=o.div`
845
858
  display: flex;
846
859
  align-items: center;
847
860
  gap: 0 5px;
@@ -871,7 +884,7 @@
871
884
  &:nth-child(1) {
872
885
  border-top: 0;
873
886
  }
874
- `,gc=o(a.Link)`
887
+ `,Nl=o(a.Link)`
875
888
  position: relative;
876
889
 
877
890
  display: grid;
@@ -941,7 +954,7 @@
941
954
  top: 3px;
942
955
  }
943
956
  }
944
- `,mc=o.hr`
957
+ `,kl=o.hr`
945
958
  margin: 4px 12px;
946
- `;function vc({opc:t,closeMenu:e,clickGroup:r,clickFavorite:n,isFavorite:o,enabledFavorite:i}){var a;const{versionApp:s}=ee();if((null==(a=t.menus)?void 0:a.length)>0)return Qt.jsxs(Qt.Fragment,{children:[Qt.jsxs(pc,{onClick:()=>r(t),isOpen:t.open,children:[Qt.jsx("span",{className:"opc",style:{color:t.isFavorite?"var(--nav-icon-sair)":"var(--bs-body-color) !important"},children:t.caption}),Qt.jsx("span",{className:"icon",children:Qt.jsx("i",{className:"fa-solid fa-chevron-down"})})]}),Qt.jsx("div",{className:"opt-group "+(t.open?"opt--open":"opt--close"),children:t.menus.map((t,a)=>Qt.jsx(vc,{opc:t,closeMenu:e,clickGroup:r,clickFavorite:n,isFavorite:o,enabledFavorite:i},a))})]});if(t.route){let r=o(t.route),a=null==t?void 0:t.version;return a&&(a=Boolean(s.substring(0,a.length)===a)),Qt.jsxs(gc,{to:t.route,onClick:e,children:[Qt.jsx("span",{className:"menu-icon",children:t.icon}),Qt.jsx("span",{className:"menu-caption",children:t.caption}),Qt.jsxs("span",{className:"menu-fav-new",children:[a&&Qt.jsx("span",{className:"menu-new",children:"novo"}),i&&Qt.jsx("span",{className:"menu-fav",onClick:e=>n(e,t),children:Qt.jsx("i",{title:"Clique para favoritar esta opção",className:"fa-"+(r?"solid":"regular")+" fa-heart",style:{color:r?"var(--nav-icon)":"var(--nav-icon-fav)"}})})]})]})}return(null==t?void 0:t.isLine)?Qt.jsx(mc,{}):null}const yc="sys/nav/closed";const _c=({routes:t,closeMenu:e,brand:r})=>Qt.jsx("div",{className:"navbar-mu--brand",children:Qt.jsx(a.Link,{to:t.home,onClick:e,className:"brand",title:"Voltar para tela inicial",children:r})});function wc({isOpen:t,setIsOpen:e,menuClose:r}){return Qt.jsx("button",{className:"btn-menu",title:"Abrir menu de opções",onClick:()=>e(!t),children:r?Qt.jsx("i",{className:"fa-solid fa-xmark icon-close"}):Qt.jsxs("div",{className:"icon-desk",children:[Qt.jsx("span",{}),Qt.jsx("span",{}),Qt.jsx("span",{})]})})}const bc="sys/nav/closed";t.Alerta=se,t.Aviso=function({onConfirm:t,text:e="",children:r}){return Qt.jsx(ae,{type:ne,title:"Aviso!",text:e,onConfirm:t,children:r})},t.BotaoClonar=function({title:t="Clonar o registro"}){return Qt.jsx(i.Button,{size:"sm",color:"warning",title:t,children:Qt.jsx(we,{})})},t.BotaoEditar=function({title:t="Alterar o registro"}){return Qt.jsx(i.Button,{size:"sm",color:"primary",title:t,children:Qt.jsx(Ee,{})})},t.BotaoExcluir=function({title:t="Excluir o registro"}){return Qt.jsx(i.Button,{size:"sm",color:"danger",title:t,children:Qt.jsx(Ie,{})})},t.BotaoIncluir=function({caption:t="Incluir",onClick:e,...r}){return Qt.jsxs(i.Button,{color:"success",title:"Incluir um novo registro",onClick:e,...r,children:[Qt.jsx(Ae,{})," ",t]})},t.BotaoSalvar=function({loading:t,saveInfo:e,link:r,fixed:n,modalFixed:o,btnSaveDisabled:s,onCancel:c,onConfirm:u}){const l=a.useHistory();return Qt.jsxs("div",{className:"botao-salvar--area","data-fixed":Boolean(n),"data-modal-fixed":Boolean(o),children:[Qt.jsxs(i.Button,{type:u?"button":"submit",color:"primary",onClick:u,disabled:s&&1==s,children:[Qt.jsx("i",{className:"fas fa-cloud-upload-alt"}),t||(null==e?void 0:e.loading)?"Salvando...":"Salvar"]}),Qt.jsxs(i.Button,{type:"button",color:"outline-danger",onClick:()=>{c?c():r?l.push(r):l.goBack()},children:[Qt.jsx("i",{className:"fas fa-times"}),"Cancelar"]})]})},t.BoxColor=function({corFonte:t,setCorFonte:e,corFundo:r,setCorFundo:n}){return Qt.jsxs("div",{className:"box-color--container",children:[Qt.jsx(Re,{label:"Cor da fonte",value:t,onChange:t=>e(t.target.value)}),Qt.jsx(Re,{label:"Cor de fundo",value:r,onChange:t=>n(t.target.value)}),Qt.jsx("div",{className:"box-color-texto",style:{color:t,backgroundColor:r},children:"Texto de exemplo"})]})},t.BoxInfo=function({id:t,title:r,isOpen:n=!1,isVisible:o=!0,onChange:i,noMargin:a,children:s,...c}){const[u,l]=e.useState(n);return e.useEffect(()=>{t&&i&&i(t,u)},[u]),o?Qt.jsxs(De,{open:u,noMargin:a,...c,children:[Qt.jsx("div",{className:"bi-btn-area",children:Qt.jsxs("button",{type:"button",onClick:()=>l(!u),children:[r," ",Qt.jsx("i",{className:"fas fa-chevron-down setas-bi"})]})}),Qt.jsx("div",{className:`bi-body ${u&&"bi-open"}`,children:s})]}):null},t.BoxSearch=Qs,t.ButtonBack=Le,t.ButtonClose=Me,t.ButtonHelp=ke,t.ButtonOptions=function({value:t,setValue:e,options:r=[],...n}){return Qt.jsx("div",{className:"btn-opts--container btn-group",...n,children:r.map((r,n)=>Qt.jsx(i.Button,{active:n===t,color:"outline-info",onClick:()=>e(n),children:r},n))})},t.ButtonTop=function({smooth:t,center:r}){const[n,o]=e.useState(!1);function i(){var t;o((null==(t=document.querySelector("main"))?void 0:t.scrollTop)>0)}return e.useEffect(()=>{var t;return null==(t=document.querySelector("main"))||t.addEventListener("scroll",i),()=>{var t;null==(t=document.querySelector("main"))||t.removeEventListener("scroll",i)}},[]),Qt.jsx(Qt.Fragment,{children:n&&Qt.jsx(je,{title:"Ir para o início da tela",visible:i,onClick:function(){var e;null==(e=document.querySelector("main"))||e.scrollTo({top:0,left:0,behavior:t?"smooth":"instant"}),o(!1)},className:"pulsate-bck",center:r,children:Qt.jsx("i",{className:"fa-solid fa-arrow-up"})})})},t.CheckBox=function({enabled:t=!0,onChange:e,children:r,...n}){const o=n.disabled||!t;return Qt.jsx(Ds,{disabled:o,children:Qt.jsxs("label",{children:[Qt.jsx(i.Input,{type:"checkbox",disabled:o,onChange:t=>{if(e){let r={...t,target:{...t.target,name:t.target.name,value:t.target.checked}};e(r)}},checked:"boolean"==typeof n.value?n.value:n.checked,...n}),r]})})},t.CheckUpdates=function(){const t=e.useRef();function r(e){var r,n;(null==t?void 0:t.current)&&(e?null==(r=t.current)||r.classList.add("update-show"):null==(n=t.current)||n.classList.remove("update-show"))}return e.useLayoutEffect(()=>{"serviceWorker"in navigator&&window.location.origin.startsWith("http")&&navigator.serviceWorker.getRegistration().then(t=>{t&&(t.addEventListener("updatefound",()=>{r(!0);const e=t.installing;e.addEventListener("statechange",()=>{"installed"==e.state&&setTimeout(()=>window.location.reload(!0),1e3),"activated"==e.state&&r(!1)})}),t.update())}).catch(t=>{console.error("=> Service Worker não encontrado:",t)})},[]),Qt.jsx("div",{className:"update-check-box",onClick:function(){r(!1)},children:Qt.jsxs("div",{ref:t,className:"update-box",children:[Qt.jsx("div",{className:"update-line"}),Qt.jsx("div",{className:"spinner-border text-warning w-22",role:"status",children:Qt.jsx("span",{className:"visually-hidden",children:"Carregando..."})}),"Nova versão disponível, atualizando..."]})})},t.ClipboardArea=function({title:t,url:r,timerInMilliSeconds:n=5e3}){const[o,i]=e.useState(!1);return e.useEffect(()=>()=>{Be&&clearTimeout(Be)},[]),Qt.jsxs("div",{className:`clipboard-area--container ${o&&" clip-active"}`,children:[Qt.jsx("a",{href:r,target:"_blank",rel:"noreferrer",title:"Abrir este link",children:t||r}),Qt.jsx("button",{type:"button",className:"clip-mark",onClick:function(){navigator.clipboard.writeText(r),i(!0),Be=setTimeout(()=>i(!1),n)},children:o?Qt.jsxs(Qt.Fragment,{children:[Qt.jsx("i",{className:"fas fa-clipboard-check"}),"Copiado"]}):Qt.jsxs(Qt.Fragment,{children:[Qt.jsx("i",{className:"fas fa-clipboard"}),"Copiar"]})})]})},t.Confirma=function({onConfirm:t,onCancel:e,text:r="",children:n,defaultBtn:o}){return Qt.jsx(ae,{type:oe,title:"Confirmação!",text:r,onConfirm:t,onCancel:e,defaultBtn:o,children:n})},t.DataItem=function({caption:t,colored:e,isForm:r=!1,children:n,className:o,...i}){return Qt.jsxs("div",{className:"di-box "+o,...i,children:[t&&Qt.jsx("label",{style:{fontWeight:r?"bold":"normal"},children:t}),r?Qt.jsx("input",{className:"form-control",value:n,readOnly:!0}):Qt.jsx("div",{style:{color:e?"var(--data-item-destaque)":"var(--body-color)"},className:"fw-bold",children:n})]})},t.DropDownButton=fe,t.DynamicCounter=function({valor:t=0,time:n=25,format:o,currency:i}){const[a,s]=e.useState(0);return e.useEffect(()=>{const e=setInterval(()=>{const r=Math.ceil(t/10)+1;s(n=>{let o=n+r;return o>t&&(o=t),o===t&&clearInterval(e),o})},n);return()=>clearInterval(e)},[t,n]),o?r.formatValor(a,i?2:0,Boolean(i)):a},t.FormDesk=function({children:t,labelWidth:e=100,sizeBreak:r=767,lineShortWidth:n=250,gap:o="8px",...i}){return Qt.jsx(ic,{style:{"--form-desk-label-width":`${e}px`,"--form-desk-line-short-width":`${n}px`,"--form-desk-gap":o},sizeBreak:r,...i,children:t})},t.FormDeskGrid=function({grid:t,gap:e=25,className:r="",children:n,...o}){return Qt.jsx("div",{className:`form-desk--grid ${r}`,style:{gridTemplateColumns:t,gap:e},...o,children:n})},t.FormDeskLine=function({children:t,label:e="",isShort:r=!1,className:n="",classNameLabel:o="",classNameCol:i="",extraComp:a,inpWidth:s,...c}){const u={};return s&&(u["--form-desk-line-short-width"]=s),Qt.jsxs("div",{className:`form-desk-line ${n}`,"data-has-extra-comp":a?"true":"false",...c,style:{...c.styles,...u},children:[Qt.jsx("label",{className:`form-desk-label ${o}`,children:e}),Qt.jsx("div",{className:i,"data-is-line-short":String(r),children:t}),a&&Qt.jsx("div",{className:"my-auto",children:a})]})},t.FormEdit=function({title:t,count:r,codigo:n,maxWidth:o=1200,goBack:i,goHome:a,onClose:s,helpLink:c,children:u}){return e.useEffect(()=>{var t;null==(t=document.querySelector("main"))||t.scrollTo(0,0)},[]),Qt.jsx("div",{className:"mx-auto",style:{maxWidth:o},children:Qt.jsx(Ge,{title:t,count:r,codigo:n,goBack:i,goHome:a,onClose:s,helpLink:c,children:u})})},t.FormEnter=function({children:t}){const r=e.useRef(),n=(t,e)=>{let r=t[e];for(;e<t.length-1&&(r=t[++e],r.disabled););return r};return Qt.jsx("form",{onSubmit:function(t){t.preventDefault()},ref:r,onKeyDown:function(t){var e,o;if("Enter"===t.key){const i=null==(e=null==r?void 0:r.current)?void 0:e.querySelector(".form-item:focus,.btn-primary"),a=null==(o=null==r?void 0:r.current)?void 0:o.querySelectorAll(".form-item,.btn-primary");for(let e=0;e<a.length;e++)if(a[e]===i&&e<a.length-1){t.preventDefault();const r=n(a,e);(null==r?void 0:r.select)&&r.select(),r.focus()}}},children:t})},t.FormatData=({value:t="",incHour:e=!0})=>{let r="";if(t){let n,o;-1!==t.indexOf("T")?(n=t.split("T"),o=n[1],n=n[0]):(n=t.split(" "),n.length>1&&(o=n[1]),n=n[0]),-1!==n.indexOf("-")&&(n=n.split("-").reverse().join("/")),o&&e&&(n=n+" "+o),r=n}return r},t.FormatPercent=({value:t=0,decimalScale:e=2,...r})=>Qt.jsx("span",{...r,children:Intl.NumberFormat("pt-br",{maximumFractionDigits:e,minimumFractionDigits:e,style:"decimal"}).format(Ps(t))+"%"}),t.FormatQuant=({value:t=0,decimalScale:e=2,...r})=>Qt.jsx("span",{...r,children:Intl.NumberFormat("pt-br",{maximumFractionDigits:e,minimumFractionDigits:e,style:"decimal"}).format(Ps(t))}),t.FormatValor=({value:t=0,money:e=!0,decimalScale:r=2,...n})=>Qt.jsx("span",{...n,children:Intl.NumberFormat("pt-br",{maximumFractionDigits:r,minimumFractionDigits:r,style:e?"currency":"decimal",currency:"BRL"}).format(Ps(t))}),t.GroupBox=function({label:t,className:e="",children:r}){return Qt.jsxs("div",{className:`group-box--container ${e}`,children:[Qt.jsx("div",{className:"group-box--label",children:t}),Qt.jsx("div",{className:"group-box--body",children:r})]})},t.Hint=function({title:t="Ajuda",children:e}){return Qt.jsxs("div",{className:"hint--container",children:[Qt.jsx("i",{className:"fas fa-question"}),Qt.jsxs("div",{className:"hint-content",children:[Qt.jsx("div",{className:"title",children:t}),e]})]})},t.IconClose=Ve,t.IconExitOutline=function(t){return Qt.jsx("svg",{viewBox:"0 0 512 512",fill:"currentColor",height:"1em",width:"1em",...t,children:Qt.jsx("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:32,d:"M320 176v-40a40 40 0 00-40-40H88a40 40 0 00-40 40v240a40 40 0 0040 40h192a40 40 0 0040-40v-40M384 176l80 80-80 80M191 256h273"})})},t.IconMenu=He,t.IconUserGear=function(t){return Qt.jsx("svg",{viewBox:"0 0 640 512",fill:"currentColor",height:"1em",width:"1em",...t,children:Qt.jsx("path",{d:"M224 256c-70.7 0-128-57.3-128-128S153.3 0 224 0s128 57.3 128 128-57.3 128-128 128zm-45.7 48h91.4c11.8 0 23.4 1.2 34.5 3.3-2.1 18.5 7.4 35.6 21.8 44.8-16.6 10.6-26.7 31.6-20 53.3 4 12.9 9.4 25.5 16.4 37.6s15.2 23.1 24.4 33c15.7 16.9 39.6 18.4 57.2 8.7v.9c0 9.2 2.7 18.5 7.9 26.3H29.7C13.3 512 0 498.7 0 482.3 0 383.8 79.8 304 178.3 304zM436 218.2c0-7 4.5-13.3 11.3-14.8 10.5-2.4 21.5-3.7 32.7-3.7s22.2 1.3 32.7 3.7c6.8 1.5 11.3 7.8 11.3 14.8v30.6c7.9 3.4 15.4 7.7 22.3 12.8l24.9-14.3c6.1-3.5 13.7-2.7 18.5 2.4 7.6 8.1 14.3 17.2 20.1 27.2s10.3 20.4 13.5 31c2.1 6.7-1.1 13.7-7.2 17.2l-25 14.4c.4 4 .7 8.1.7 12.3s-.2 8.2-.7 12.3l25 14.4c6.1 3.5 9.2 10.5 7.2 17.2-3.3 10.6-7.8 21-13.5 31s-12.5 19.1-20.1 27.2c-4.8 5.1-12.5 5.9-18.5 2.4L546.3 442c-6.9 5.1-14.3 9.4-22.3 12.8v30.6c0 7-4.5 13.3-11.3 14.8-10.5 2.4-21.5 3.7-32.7 3.7s-22.2-1.3-32.7-3.7c-6.8-1.5-11.3-7.8-11.3-14.8v-30.6c-8-3.4-15.6-7.7-22.5-12.9l-24.7 14.3c-6.1 3.5-13.7 2.7-18.5-2.4-7.6-8.1-14.3-17.2-20.1-27.2s-10.3-20.4-13.5-31c-2.1-6.7 1.1-13.7 7.2-17.2l24.8-14.3c-.4-4.1-.7-8.2-.7-12.4s.2-8.3.7-12.4L343.8 325c-6.1-3.5-9.2-10.5-7.2-17.2 3.3-10.6 7.7-21 13.5-31s12.5-19.1 20.1-27.2c4.8-5.1 12.4-5.9 18.5-2.4l24.8 14.3c6.9-5.1 14.5-9.4 22.5-12.9v-30.4zm92.1 133.5c0-26.5-21.5-48-48.1-48s-48.1 21.5-48.1 48 21.5 48 48.1 48 48.1-21.5 48.1-48z"})})},t.IconeChevron=()=>Qt.jsx("i",{className:"fas fa-chevron-down"}),t.IconeClonar=()=>Qt.jsx("i",{className:"fa-solid fa-copy"}),t.IconeConfig=()=>Qt.jsx("i",{className:"fas fa-cogs"}),t.IconeEditar=Ee,t.IconeEmail=()=>Qt.jsx("i",{className:"fas fa-envelope"}),t.IconeEncerrarAno=()=>Qt.jsx("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Qt.jsx("path",{d:"M8.875 17.375C7.43258 17.375 6.10606 17.0466 4.89545 16.3898C3.68485 15.733 2.69318 14.8572 1.92045 13.7625V15.8295H0.375V11.1932H5.01136V12.7386H3.09886C3.71705 13.6659 4.53176 14.4129 5.543 14.9795C6.55373 15.5462 7.66439 15.8295 8.875 15.8295C9.84091 15.8295 10.7458 15.6462 11.5896 15.2794C12.4329 14.9121 13.167 14.416 13.7919 13.7911C14.4162 13.1667 14.9121 12.4326 15.2794 11.5888C15.6462 10.7455 15.8295 9.84091 15.8295 8.875H17.375C17.375 10.047 17.153 11.1481 16.7089 12.1784C16.2643 13.2087 15.6557 14.1102 14.883 14.883C14.1102 15.6557 13.2087 16.2641 12.1784 16.7081C11.1481 17.1527 10.047 17.375 8.875 17.375ZM8.17955 14.2841V13.2795C7.57424 13.1379 7.08176 12.8772 6.70209 12.4975C6.32191 12.1174 6.04167 11.6182 5.86136 11L7.13636 10.4977C7.29091 11.0258 7.53251 11.4217 7.86118 11.6854C8.18933 11.9497 8.56591 12.0818 8.99091 12.0818C9.41591 12.0818 9.77961 11.9819 10.082 11.782C10.3849 11.5826 10.5364 11.2705 10.5364 10.8455C10.5364 10.472 10.3787 10.1693 10.0635 9.9375C9.74767 9.70568 9.18409 9.44167 8.37273 9.14545C7.61288 8.875 7.056 8.55303 6.70209 8.17955C6.34767 7.80606 6.17045 7.31667 6.17045 6.71136C6.17045 6.18333 6.35411 5.70347 6.72141 5.27177C7.0882 4.84059 7.58712 4.56061 8.21818 4.43182V3.46591H9.57045V4.43182C10.0341 4.47045 10.456 4.6572 10.8362 4.99205C11.2158 5.32689 11.4765 5.7197 11.6182 6.17045L10.3818 6.67273C10.2788 6.37651 10.1114 6.12873 9.87955 5.92936C9.64773 5.72948 9.32576 5.62955 8.91364 5.62955C8.46288 5.62955 8.1185 5.72614 7.8805 5.91932C7.64198 6.1125 7.52273 6.37651 7.52273 6.71136C7.52273 7.04621 7.67083 7.31023 7.96705 7.50341C8.26326 7.69659 8.79773 7.92197 9.57045 8.17955C10.4977 8.51439 11.1159 8.9072 11.425 9.35795C11.7341 9.80871 11.8886 10.3045 11.8886 10.8455C11.8886 11.2189 11.8242 11.5473 11.6955 11.8307C11.5667 12.114 11.3962 12.3554 11.1839 12.5547C10.9712 12.7546 10.7231 12.9156 10.4398 13.0377C10.1564 13.1603 9.85379 13.2538 9.53182 13.3182V14.2841H8.17955ZM0.375 8.875C0.375 7.70303 0.597288 6.60189 1.04186 5.57159C1.48592 4.54129 2.09432 3.63977 2.86705 2.86705C3.63977 2.09432 4.54129 1.48567 5.57159 1.04109C6.60189 0.59703 7.70303 0.375 8.875 0.375C10.3174 0.375 11.6439 0.703409 12.8545 1.36023C14.0652 2.01705 15.0568 2.8928 15.8295 3.9875V1.92045H17.375V6.55682H12.7386V5.01136H14.6511C14.033 4.08409 13.2182 3.33712 12.207 2.77045C11.1963 2.20379 10.0856 1.92045 8.875 1.92045C7.90909 1.92045 7.00448 2.10385 6.16118 2.47064C5.31736 2.83794 4.58327 3.33377 3.95891 3.95814C3.33403 4.58301 2.83794 5.31711 2.47064 6.16041C2.10385 7.00423 1.92045 7.90909 1.92045 8.875H0.375Z",fill:"currentColor"})}),t.IconeExcluir=Ie,t.IconeFechar=Oe,t.IconeFecharCircle=()=>Qt.jsx("i",{className:"fas fa-times-circle"}),t.IconeHelp=Te,t.IconeIncluir=Ae,t.IconeLogin=()=>Qt.jsx("i",{className:"fas fa-sign-in-alt"}),t.IconeLogout=Ce,t.IconeMostrarSenha=({display:t})=>Qt.jsx("i",{className:"fas fa-eye"+(t?"-slash":"")}),t.IconeOpenLink=Ne,t.IconePassword=()=>Qt.jsx("i",{className:"fas fa-key"}),t.IconePin=()=>Qt.jsx("i",{className:"fas fa-map-marker-alt"}),t.IconePrint=()=>Qt.jsx("i",{className:"fas fa-print"}),t.IconeQRCode=xe,t.IconeSalvar=()=>Qt.jsx("i",{className:"fas fa-cloud-upload-alt"}),t.IconeSearchPlus=()=>Qt.jsx("i",{className:"fas fa-search-plus"}),t.IconeSoma=()=>Qt.jsx("svg",{width:"10",height:"13",viewBox:"0 0 10 13",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Qt.jsx("path",{d:"M0.898056 12.1914V10.6914L5.77306 6.19141L0.898056 1.69141V0.191406H9.89806V2.44141H4.47931L8.51056 6.19141L4.47931 9.94141H9.89806V12.1914H0.898056Z",fill:"currentColor"})}),t.IconeUsers=()=>Qt.jsx("i",{className:"fas fa-user-cog"}),t.IconeVisualizar=Se,t.Input=function({autoSelect:t,...e}){function r(r){e.onClick?e.onClick(r):t&&r.currentTarget.select()}switch(e.type){case"cpf":return Qt.jsx($s,{onClick:r,...e});case"cnpj":return Qt.jsx(Ys,{onClick:r,...e});case"codigo":return Qt.jsx(Gs,{name:e.name,onChange:e.onChange,onClick:r,...e});case"fone":return Qt.jsx(js,{name:e.name,onChange:e.onChange,value:e.value,onClick:r,...e});case"uf":return Qt.jsx(qs,{onClick:r,...e});case"hora":return Qt.jsx(Xs,{onClick:r,...e});case"percent":return Qt.jsx(zs,{name:e.name,onChange:e.onChange,onClick:r,...e});case"quant":return Qt.jsx(Ws,{name:e.name,onChange:e.onChange,onClick:r,...e});case"real":return Qt.jsx(Us,{name:e.name,onChange:e.onChange,onClick:r,...e});case"finder":return Qt.jsx(Js,{onClick:r,...e});default:return Qt.jsx("input",{className:"form-control",onClick:r,...e})}},t.InputBox=function({children:t}){return Qt.jsx("div",{className:"jclib-ui-input-box",children:t})},t.InputCep=function({dados:t,setDados:r,onSearch:n,disabled:o,autoFocus:i,...a}){const[s,c]=e.useState(!1),l=async e=>{c(!0);const o=await(async(t,e)=>{let r={erro:!0,mensagem:"CEP deve ter 8 dígitos!"};if((t=t.replace(/\D+/g,""))&&8===t.length){const n=`https://viacep.com.br/ws/${t}/json`;try{r=await(await fetch(n,{mode:"cors"})).json()}catch{r={erro:!0,mensagem:"Não foi possível pesquisar este CEP!"}}finally{e&&e(r)}}return r})(e,n);!o.erro&&t&&r&&r({...t,ende:o.logradouro,bairro:o.bairro,cida:o.localidade,uf:o.uf}),c(!1)};return Qt.jsxs(Qt.Fragment,{children:[Qt.jsx(Ls,{visible:s,message:"Buscando CEP..."}),Qt.jsxs("div",{className:"input-group",children:[Qt.jsx(u,{format:"##.###-###",mask:"_",value:a.value,className:"form-control",onValueChange:t=>function(t,e,r){r&&r({target:{name:e,value:t.formattedValue}})}(t,a.name,a.onChange),disabled:o,autoFocus:i}),Qt.jsx("button",{type:"button",className:"btn btn-info",onClick:()=>l(a.value),disabled:o,children:Qt.jsx("i",{className:"fas fa-search"})})]})]})},t.InputCheckBox=({disabled:t,children:e,name:r,checked:n,onChange:o})=>Qt.jsx(tc,{children:Qt.jsxs(ec,{disabled:t,onClick:function(){if(!t&&o){o({target:{name:r,checked:!n}})}},children:[Qt.jsxs("span",{children:[n&&Qt.jsx(me,{color:t&&"silver"}),!n&&Qt.jsx(ve,{color:t&&"silver"})]})," ",e]})}),t.InputCnpj=Ys,t.InputCodigo=Gs,t.InputColor=Re,t.InputCpf=$s,t.InputCpfCnpj=function(t){const[r,n]=e.useState(o(t.value));function o(t){let e=t;return e=e.replace(/\D/g,""),e.length>11?"##.###.###/####-##":"###.###.###-#####"}return e.useEffect(()=>{n(o(t.value))},[t.value]),Qt.jsx(i.Input,{tag:u,mask:"",format:r,onKeyUp:t=>{n(o(t.target.value))},invalid:Vs(t.value),...t})},t.InputEstado=qs,t.InputFinder=({title:t,onFind:e,children:r,...n})=>Qt.jsxs("div",{className:"input-group",children:[Qt.jsxs("select",{className:"form-select",...n,children:[Qt.jsxs("option",{value:0,children:["- ",t," -"]}),r]}),Qt.jsx("button",{type:"button",title:"Pesquisar...",className:"btn btn-info",onClick:e,children:Qt.jsx(_e,{})})]}),t.InputFone=js,t.InputHora=Xs,t.InputPassword=function({disabled:t,autoSelect:r,...n}){const[o,i]=e.useState(!1);return Qt.jsxs(rc,{disabled:t,children:[Qt.jsx("input",{type:o?"text":"password",disabled:t,onClick:function(t){n.onClick?n.onClick(t):r&&t.currentTarget.select()},...n}),Qt.jsx("i",{className:o?"fas fa-eye-slash":"fas fa-eye",onClick:()=>{t||i(!o)},title:t?"":(o?"Ocultar":"Exibir")+" a senha"})]})},t.InputPercent=zs,t.InputPesquisa=sr,t.InputQRCode=function({value:t,setValue:r}){const[n,o]=e.useState(!1);return Qt.jsxs(Qt.Fragment,{children:[Qt.jsxs("div",{className:"input-group",children:[Qt.jsx(i.Input,{disabled:!0,placeholder:"Link para o documento de pagamento",title:"Link para o documento de pagamento",value:t}),Qt.jsx(i.Button,{color:"outline-secondary",title:"Limpar o campo",onClick:()=>r(""),children:Qt.jsx(be,{})}),Qt.jsx(i.Button,{color:"success-light",title:"Ler QRCode do documento",onClick:()=>o(!0),children:Qt.jsx(xe,{})}),t?Qt.jsx(tr,{className:"btn btn-info",title:"Abrir o link do documento",to:t,children:Qt.jsx(Ne,{})}):Qt.jsx(i.Button,{color:"info",disabled:!0,children:Qt.jsx(Ne,{})})]}),n&&Qt.jsx(Rs,{setVisible:o,title:"Ler QRCode do documento",onResult:t=>r(null==t?void 0:t.text)})]})},t.InputQuant=Ws,t.InputSearch=({title:t="Selecione",options:e=[],fields:r=[],btnClick:n=null,...o})=>Qt.jsxs("div",{className:"input-group",children:[Qt.jsxs("select",{className:"form-select",...o,children:[Qt.jsxs("option",{value:0,children:["- ",t," -"]}),null==e?void 0:e.map((t,e)=>Qt.jsx("option",{value:t[r[0]],children:t[r[1]]},e))]}),Qt.jsx("button",{type:"button",className:"btn btn-info",title:"Abrir tela de pesquisa",onClick:n,children:Qt.jsx(_e,{})})]}),t.InputValor=Us,t.LabelHint=function({label:t,hint:e}){return Qt.jsxs("div",{className:"label-hint--container",children:[Qt.jsx("label",{children:t}),Qt.jsx("div",{className:"label-hint--icon",children:Qt.jsx("i",{className:"fas fa-question"})}),Qt.jsxs("div",{className:"label-hint--box",children:[Qt.jsx("div",{className:"label-hint--box-title",children:"Ajuda"}),e]})]})},t.LibProvider=({apiConfig:t,children:n,versionApp:o,useTheme:i})=>{const a=!(!i||"boolean"!=typeof i)&&i,[s,c]=e.useState(()=>{let t="";if(a){let e=localStorage.getItem(te);t=e||(r.isDarkMode()?"dark":"light")}return t}),[u,l]=hc("sys/reportType",0),[f,d]=e.useState([]),[h,p]=e.useState(!1),g=t=>{let e=f.find(e=>e.modalId===t);e&&e.setVisible(!1),d(e=>e.filter(e=>e.modalId!==t))},m=e.useCallback(t=>{"Escape"===t.key&&0!=f.length&&g(f[f.length-1].modalId)},[f]);return e.useEffect(()=>{("localhost"===window.location.hostname||"127.0.0.1"===window.location.hostname||"[::1]"===window.location.hostname||window.location.hostname.startsWith("192.168."))&&!document.title.includes(" ⭕ ")&&(document.title=`${document.title} ⭕ `)},[]),e.useEffect(()=>{a&&(localStorage.setItem(te,s),document.body.dataset.bsTheme="dark"==s?s:"")},[s,a]),e.useEffect(()=>(window.addEventListener("keydown",m,!1),()=>window.removeEventListener("keydown",m,!1)),[f]),Qt.jsx(Jt.Provider,{value:{versionApp:o,addModal:(t,e)=>{d(r=>{let n=[...r],o=n.findIndex(e=>e.modalId===t);return o>=0?n[o]={modalId:t,setVisible:e}:n.push({modalId:t,setVisible:e}),n})},removeModal:g,clearModals:()=>{f.forEach(t=>{g(t.modalId)})},showBtnTop:h,setShowBtnTop:p,globalApiConfig:t,theme:s,setTheme:c,toggleTheme:()=>c("dark"==s?"light":"dark"),canChangeTheme:a,reportType:u,setReportType:l},children:n})},t.LinkToEmail=Je,t.LinkToFone=function({href:t,children:e,...r}){const n=String(t||e);let o="+";return(null==n?void 0:n.startsWith("+"))||(o="+55"),o+=n.replace(/\D/g,""),Qt.jsx("a",{href:`tel:${o}`,title:"Ligar para este número",...r,children:e||t})},t.LinkToMaps=function({href:t,children:e,...r}){let n=`https://google.com/maps/place/${null==t?void 0:t.replace(" ","+")}`;return(null==t?void 0:t.includes("/maps/place/"))&&(null==t?void 0:t.startsWith("https"))&&(n=t),Qt.jsx("a",{href:n,target:"_blank",rel:"noreferrer",title:"Localizar este endereço",...r,children:e})},t.LinkToNewPage=tr,t.LinkToWhatsApp=Qe,t.Loading=Ls,t.LoadingReport=function({url:t,file:e,fileTo:r,loading:n=!0,setLoading:o}){if(!n)return null;let[,i]=e.split("."),[a,s]=r.split(".");return s!=i&&(r=[a,i].join(".")),Qt.jsx(ar,{url:t,file:e,fileTo:r,setLoading:o})},t.Modal=lr,t.ModalBody=fr,t.ModalBox=function({visible:t,setVisible:e,codigo:r,title:n,children:o,alignTop:i,paddingBottom:a=10,helpLink:s,count:c,...u}){return t?Qt.jsxs(lr,{alignTop:i,setVisible:e,visible:t,...u,children:[Qt.jsxs(hr,{helpLink:s,setVisible:e,children:[n,null!=c&&Qt.jsxs(Qt.Fragment,{children:[" ",Qt.jsx(We,{value:c,isCount:!0})]}),Qt.jsx(We,{value:r})]}),Qt.jsx(dr,{children:Qt.jsx(fr,{style:{paddingBottom:a},children:o})})]}):null},t.ModalContent=dr,t.ModalFilter=function({title:t="Filtros",setVisible:e,maxWidth:r,fnApplyFilter:n,children:o,alignTop:a,helpLink:s}){return Qt.jsxs(lr,{alignTop:a,maxWidth:r,setVisible:e,visible:!0,children:[Qt.jsx(hr,{helpLink:s,setVisible:e,children:t}),Qt.jsx(dr,{children:Qt.jsxs(fr,{className:"mod-filter--container",children:[o,Qt.jsxs("div",{className:"mod-filter--btn-area",children:[Qt.jsxs(i.Button,{block:!0,color:"primary",onClick:()=>{n&&n(!0)},children:[Qt.jsx(ye,{})," Aplicar filtros"]}),Qt.jsxs(i.Button,{block:!0,color:"outline-danger",onClick:()=>{n&&n(!1)},children:[Qt.jsx(Oe,{})," Cancelar filtros"]})]})]})})]})},t.ModalFooter=function({className:t="",backgroundColor:e="",...r}){return Qt.jsx("div",{className:`modal--footer ${t}`,style:{backgroundColor:e},...r})},t.ModalHeader=hr,t.Navbar=function({menusConfig:{brand:t,company:n,menus:o,routes:i,user:s,validatePermis:c},helpLink:u}){const l=a.useHistory(),f=e.useRef(),d=e.useRef(),{theme:h,setTheme:p,canChangeTheme:g}=ee(),[m,v]=e.useState(!1),[y,_]=e.useState(""),[w,b]=e.useState([]),[C,A]=e.useState([]);let E=[];const I=localStorage.getItem(yc);I&&(E=JSON.parse(I));const[S]=or({url:i.apiFavorites,onTerminated:t=>{t.error?console.info("Erro ao obter lista de favoritos!",t.error):A(t.data)}}),[O]=or({url:i.apiFavorites,method:"patch",onTerminated:t=>{t.error&&console.info("Erro ao salvar favoritos!",t.error)}});function T(){v(!1)}function N(t){let e=[...w],r=[];e.forEach(e=>{e===t&&(e.open=!e.open),e.open||r.push(e.caption)}),localStorage.setItem(yc,JSON.stringify(r)),b(e)}function x(t){let e=[...w];e.forEach(e=>{(null==e?void 0:e.menus)&&((null==e?void 0:e.stayOpen)?e.open=e.stayOpen:e.open=t)}),b(e),N(null)}function R(t,e){t.stopPropagation(),t.preventDefault();const r=C.filter(t=>t.route!==e.route);var n;r.length===C.length&&r.push({caption:((null==e?void 0:e.prefix)?e.prefix+" / ":"")+e.caption,route:e.route}),n=r,i.apiFavorites&&(O({data:n}),A(n))}function D(t){return C.some(e=>e.route===t)}return e.useEffect(()=>{i.apiFavorites&&S()},[]),e.useEffect(()=>{let t=[];null==C||C.forEach(e=>{o.forEach((r,n)=>{var o;if(n>0&&0!==(null==(o=null==r?void 0:r.menus)?void 0:o.length)){let o=r.menus.findIndex(t=>t.route===e.route);if(o>=0){let i=r.menus[o];t.push({...i,caption:e.caption,index:String(n).padStart(2,"0")+String(o).padStart(2,0)})}}})}),"Favoritos"===o[0].caption&&(o[0].menus=t.sort((t,e)=>t.index>e.index?1:t.index<e.index?-1:0)),b(function(t){let e=[];return t.forEach(t=>{let r={caption:t.caption,open:!E.includes(t.caption)||t.stayOpen,stayOpen:t.stayOpen,isFavorite:null==t?void 0:t.isFavorite,prefix:null==t?void 0:t.prefix,menus:[]};t.menus&&t.menus.length>0&&t.menus.filter(t=>{var e;return(null==t?void 0:t.isLine)||!(null==t?void 0:t.isLine)&&(t.caption.toLowerCase().includes(y.toLowerCase())||(null==(e=t.shortcut)?void 0:e.toLowerCase().includes(y.toLowerCase())))}).forEach(t=>{c(null==t?void 0:t.permis,null==t?void 0:t.acesso)&&r.menus.push({...t,prefix:null==r?void 0:r.prefix})}),y&&(r.open=!0),e.push(r)}),e.forEach(t=>{var e;t.menus&&((null==(e=t.menus[0])?void 0:e.isLine)&&(t.menus=t.menus.filter(t=>!(null==t?void 0:t.isLine))),t.menus=t.menus.filter((t,e,r)=>{var n;return!(e>0&&(null==(n=r[e-1])?void 0:n.isLine)&&t.isLine)}),t.menus=t.menus.filter((t,e,r)=>!(e===r.length-1&&(null==t?void 0:t.isLine))))}),e}(o))},[y,C]),e.useEffect(()=>{var t,e;r.isDesktop()&&(null==(t=null==f?void 0:f.current)||t.focus(),null==(e=null==f?void 0:f.current)||e.select())},[m]),Qt.jsxs(Qt.Fragment,{children:[Qt.jsx("div",{className:"navbar--area",children:Qt.jsxs("div",{className:"navbar-content",children:[Qt.jsx("button",{className:"btn-menu"+(m?" opened":""),title:"Abrir menu de opções",onClick:()=>v(!m),children:m?Qt.jsx(Ve,{width:20,height:20}):Qt.jsx(He,{width:20,height:20})}),Qt.jsxs("div",{className:"content",children:[Qt.jsx(a.Link,{to:i.home,className:"brand",onClick:T,title:"Voltar para tela inicial",children:t}),Qt.jsxs("div",{className:"company",children:[Qt.jsx("div",{className:"name",children:n}),Qt.jsxs("div",{className:"doc",children:[Qt.jsxs("span",{children:[null==s?void 0:s.title," "]}),Qt.jsx("strong",{children:null==s?void 0:s.name})]})]}),Qt.jsxs("div",{className:"nav-btn-area",children:[Qt.jsx("div",{className:"btn-theme",children:g&&Qt.jsx("button",{title:"Alterar entre o tema claro/escuro",className:"btn nav-button",onClick:()=>{const t="light"==h?"dark":"light";p(t),document.body.dataset.bsTheme=t},children:Qt.jsx("i",{className:"fa-solid fa-circle-half-stroke"})})}),u&&Qt.jsx("a",{title:"Abrir ajuda online",className:"btn nav-button",href:u,target:"_blank",children:Qt.jsx(Te,{})}),Qt.jsxs("div",{className:"btn-atalho",children:[Qt.jsx(a.Link,{to:i.users,className:"nav-button",title:"Configurações do usuário",onClick:()=>v(!1),children:Qt.jsx("i",{className:"fa-solid fa-user-gear"})}),Qt.jsx(a.Link,{to:i.exit,className:"nav-button",title:"Sair do sistema",onClick:()=>v(!1),children:Qt.jsx("i",{className:"fa-solid fa-right-from-bracket"})})]})]})]})]})}),m&&Qt.jsx("div",{id:"menu-background",className:"navbar--menu-background",onClick:function(t){"menu-background"===t.target.id&&T()},children:Qt.jsxs("div",{className:"menu-content",children:[Qt.jsxs("div",{className:"search-area",children:[Qt.jsx("i",{className:"fas fa-search"}),Qt.jsx("input",{ref:f,placeholder:"Pesquisar...",value:y,onChange:t=>_(t.target.value),onKeyDown:function(t){if("Enter"==t.key)for(const e of w)if(e.menus&&0!=e.menus.length){const t=e.menus.find(t=>null!=t.route&&""!=t.route);if(t){l.push(t.route),v(!1);break}}}}),y&&Qt.jsx("button",{className:"text-danger",title:"Limpar pesquisa",onClick:()=>_(""),children:Qt.jsx("i",{className:"fas fa-times"})}),Qt.jsx("button",{title:"Fechar todos os grupos de opções",onClick:()=>x(!1),children:Qt.jsx("i",{className:"fas fa-minus"})}),Qt.jsx("button",{title:"Expandir todos os grupos de opções",onClick:()=>x(!0),children:Qt.jsx("i",{className:"fas fa-plus"})})]}),Qt.jsx("div",{className:"navbar--menu-area",ref:d,children:w.map((t,e)=>Qt.jsx(vc,{opc:t,closeMenu:T,clickGroup:N,clickFavorite:R,isFavorite:D,enabledFavorite:i.apiFavorites},e))}),Qt.jsx("div",{className:"menu-footer",children:Qt.jsx(a.Link,{to:i.exit,onClick:T,children:Qt.jsxs("div",{className:"user",children:[Qt.jsx("span",{className:"name",title:`Último acesso em ${null==s?void 0:s.lastAccess}`,children:null==s?void 0:s.name}),Qt.jsxs("span",{className:"sair",children:["Sair ",Qt.jsx(Ce,{})]})]})})})]})})]})},t.NavbarMU=function({menusConfig:{brand:t,company:n,menus:o,routes:i,user:s,validatePermis:c}}){const u=e.useRef(),l=e.useRef(),f=a.useHistory(),{theme:d,setTheme:h,canChangeTheme:p}=ee(),[g,m]=e.useState(!1),[v,y]=e.useState(""),[_,w]=e.useState([]),[b,C]=e.useState([]);let A=[];const E=localStorage.getItem(bc);E&&(A=JSON.parse(E));const[I]=or({url:i.apiFavorites,onTerminated:t=>{t.error?console.info("Erro ao obter lista de favoritos!",t.error):C(t.data)}}),[S]=or({url:i.apiFavorites,method:"patch",onTerminated:t=>{t.error&&console.info("Erro ao salvar favoritos!",t.error)}});function O(){m(!1)}function T(t){let e=[..._],r=[];e.forEach(e=>{e===t&&(e.open=!e.open),e.open||r.push(e.caption)}),localStorage.setItem(bc,JSON.stringify(r)),w(e)}function N(t){let e=[..._];e.forEach(e=>{(null==e?void 0:e.menus)&&((null==e?void 0:e.stayOpen)?e.open=e.stayOpen:e.open=t)}),w(e),T(null)}function x(t,e){t.stopPropagation(),t.preventDefault();const r=b.filter(t=>t.route!==e.route);var n;r.length===b.length&&r.push({caption:((null==e?void 0:e.prefix)?e.prefix+" / ":"")+e.caption,route:e.route}),n=r,i.apiFavorites&&(S({data:n}),C(n))}function R(t){return b.some(e=>e.route===t)}return e.useEffect(()=>{i.apiFavorites&&I()},[]),e.useEffect(()=>{let t=[];null==b||b.forEach(e=>{o.forEach((r,n)=>{var o;if(n>0&&0!==(null==(o=null==r?void 0:r.menus)?void 0:o.length)){let o=r.menus.findIndex(t=>t.route===e.route);if(o>=0){let i=r.menus[o];t.push({...i,caption:e.caption,index:String(n).padStart(2,"0")+String(o).padStart(2,0)})}}})}),"Favoritos"===o[0].caption&&(o[0].menus=t.sort((t,e)=>t.index>e.index?1:t.index<e.index?-1:0)),w(function(t){let e=[];return t.forEach(t=>{let r={caption:t.caption,open:!A.includes(t.caption)||t.stayOpen,stayOpen:t.stayOpen,isFavorite:null==t?void 0:t.isFavorite,prefix:null==t?void 0:t.prefix,menus:[]};t.menus&&t.menus.length>0&&t.menus.filter(t=>{var e;return(null==t?void 0:t.isLine)||!(null==t?void 0:t.isLine)&&(t.caption.toLowerCase().includes(v.toLowerCase())||(null==(e=t.shortcut)?void 0:e.toLowerCase().includes(v.toLowerCase())))}).forEach(t=>{c(null==t?void 0:t.permis,null==t?void 0:t.acesso)&&r.menus.push({...t,prefix:null==r?void 0:r.prefix})}),v&&(r.open=!0),e.push(r)}),e.forEach(t=>{var e;t.menus&&((null==(e=t.menus[0])?void 0:e.isLine)&&(t.menus=t.menus.filter(t=>!(null==t?void 0:t.isLine))),t.menus=t.menus.filter((t,e,r)=>{var n;return!(e>0&&(null==(n=r[e-1])?void 0:n.isLine)&&t.isLine)}),t.menus=t.menus.filter((t,e,r)=>!(e===r.length-1&&(null==t?void 0:t.isLine))))}),e}(o))},[v,b]),e.useEffect(()=>{var t,e;r.isDesktop()&&(null==(t=null==u?void 0:u.current)||t.select(),null==(e=null==u?void 0:u.current)||e.focus())},[g]),Qt.jsxs(Qt.Fragment,{children:[Qt.jsx("div",{className:"navbar-mu-area",children:Qt.jsxs("div",{className:"mu--container",children:[Qt.jsx(wc,{isOpen:g,setIsOpen:m}),Qt.jsxs("div",{className:"mu--content",children:[Qt.jsx(_c,{isOpen:g,setIsOpen:m,brand:t,closeMenu:O,routes:i}),Qt.jsxs("div",{className:"mu--info",children:[Qt.jsx("div",{className:"info-line-1",children:n}),Qt.jsx("div",{className:"info-line-2",children:Qt.jsxs("span",{children:[null==s?void 0:s.title," ",Qt.jsx("strong",{children:null==s?void 0:s.name})]})})]}),Qt.jsxs("div",{className:"mu--buttons",children:[p&&Qt.jsx("button",{title:"Alterar entre o tema claro/escuro",className:"btn nav-button",onClick:()=>{const t="light"==d?"dark":"light";h(t),document.body.dataset.bsTheme=t},children:Qt.jsx("i",{className:"fa-solid fa-circle-half-stroke"})}),Qt.jsx(a.Link,{to:i.users,className:"nav-button btn-users",title:"Configurações do usuário",onClick:()=>m(!1),children:Qt.jsx("i",{className:"fa-solid fa-user-gear"})}),Qt.jsx(a.Link,{to:i.exit,className:"nav-button btn-exit",title:"Sair do sistema",onClick:()=>m(!1),children:Qt.jsx("i",{className:"fa-solid fa-right-from-bracket"})})]})]})]})}),Qt.jsx("div",{"data-open":g,id:"menu-background",className:"nv-menu--background",onClick:function(t){"menu-background"===t.target.id&&O()},children:Qt.jsxs("div",{className:"nv-menu--content","data-open":g,children:[Qt.jsxs("div",{className:"nv-menu--brand",children:[Qt.jsx(wc,{isOpen:g,setIsOpen:m,menuClose:r.isMobile()}),Qt.jsx(_c,{isOpen:g,setIsOpen:m,brand:t,closeMenu:O,routes:i,showButtonClose:!0})]}),Qt.jsxs("div",{className:"nv-menu--search",children:[Qt.jsx("i",{className:"fas fa-search"}),Qt.jsx("input",{ref:u,placeholder:"Pesquisar...",value:v,onChange:t=>y(t.target.value),onKeyDown:function(t){if("Enter"==t.key)for(const e of _)if(e.menus&&0!=e.menus.length){const t=e.menus.find(t=>null!=t.route&&""!=t.route);if(t){f.push(t.route),m(!1);break}}}}),v&&Qt.jsx("button",{className:"text-danger",title:"Limpar pesquisa",onClick:function(){var t;y(""),null==(t=null==u?void 0:u.current)||t.focus()},children:Qt.jsx("i",{className:"fas fa-times"})}),Qt.jsx("button",{title:"Fechar todos os grupos de opções",onClick:()=>N(!1),children:Qt.jsx("i",{className:"fas fa-minus"})}),Qt.jsx("button",{title:"Expandir todos os grupos de opções",onClick:()=>N(!0),children:Qt.jsx("i",{className:"fas fa-plus"})})]}),Qt.jsx("div",{className:"nv-menu--opcoes",ref:l,children:_.map((t,e)=>Qt.jsx(vc,{opc:t,closeMenu:O,clickGroup:T,clickFavorite:x,isFavorite:R,enabledFavorite:i.apiFavorites},e))}),Qt.jsx("div",{className:"nv-menu--footer",children:Qt.jsx(a.Link,{to:i.exit,onClick:O,children:Qt.jsxs("div",{className:"foo-user",children:[Qt.jsx("span",{className:"foo-name",children:null==s?void 0:s.name}),Qt.jsxs("span",{className:"foo-sair",children:["Sair ",Qt.jsx(Ce,{})]})]})})}),Qt.jsxs("div",{className:"nv-menu--copy",children:["Último acesso em ",null==s?void 0:s.lastAccess]})]})})]})},t.Paginacao=function({pages:t,page:r,setPage:n,limitDefault:o=16,limit:i=16,setLimit:a,align:s="center"}){const[c,u]=e.useState([7,o,30,50,100]),l=void 0!==a&&void 0!==i&&void 0!==o;function f(e){var o;e!==r&&e>=1&&e<=t&&(null==(o=document.querySelector("main"))||o.scrollTo(0,0),n(e))}return l&&!c.includes(o)&&u([...c,o].sort((t,e)=>t-e)),Qt.jsx("div",{className:"pgn-content","data-fixed":i>=30?"true":"false","data-align":s,children:Qt.jsxs("div",{className:"pgn-comps",children:[l&&Qt.jsxs("div",{className:"pgn-limit",children:[Qt.jsx("label",{children:"Registros:"}),Qt.jsx("select",{className:"form-select form-select-sm",value:i,onChange:t=>a(Number(t.target.value)),children:c.map(t=>Qt.jsx("option",{value:t,children:t},t))})]}),Qt.jsxs("div",{className:"pgn-pages",children:[Qt.jsx("button",{className:"btn btn-outline-"+(r<=1?"secondary":"info"),title:"Ir para a primeira página",onClick:()=>f(1),disabled:r<=1,children:Qt.jsx("i",{className:"fas fa-angle-double-left"})}),Qt.jsx("button",{className:"btn btn-outline-"+(r<=1?"secondary":"info"),title:"Ir para página anterior",onClick:()=>f(Number(r)-1),disabled:r<=1,children:Qt.jsx("i",{className:"fas fa-angle-left"})}),Qt.jsx("span",{className:"p-2 text-body",children:Qt.jsxs("div",{children:[Qt.jsx("span",{className:"fw-bold",children:r})," / ",Qt.jsx("span",{children:t||"?"})]})}),Qt.jsx("button",{className:"btn btn-outline-"+(r>=t?"secondary":"info"),title:"Ir para próxima página",onClick:()=>f(Number(r)+1),disabled:r>=t,children:Qt.jsx("i",{className:"fas fa-angle-right"})}),Qt.jsx("button",{className:"btn btn-outline-"+(r>=t?"secondary":"info"),title:"Ir para a última página",onClick:()=>f(t),disabled:r>=t,children:Qt.jsx("i",{className:"fas fa-angle-double-right"})})]})]})})},t.Panel=Ge,t.PanelDashboard=function({title:t,color:e="var(--dash-border)",backColor:r="var(--dash-bg)",className:n,minHeight:o,children:i,marginBottom:a=0,...s}){return Qt.jsxs("div",{className:"panel-dashboard--container"+(n?` ${n}`:""),style:{minHeight:o,marginBottom:a,borderColor:e,backgroundColor:r},...s,children:[t&&Qt.jsx("h3",{className:"title",children:t}),i]})},t.PanelHeader=Ue,t.PrintButtons=function({onClose:t,showTypes:r}){const{reportType:n,setReportType:o}=ee(),i=[{title:"PDF",icon:Qt.jsx("i",{className:"fa-solid fa-file-pdf"}),onClick(){o(0)}},{title:"Excel",icon:Qt.jsx("i",{className:"fa-solid fa-file-excel"}),onClick(){o(1)}},{title:"Word",icon:Qt.jsx("i",{className:"fa-solid fa-file-word"}),onClick(){o(2)}},{title:"Texto",icon:Qt.jsx("i",{className:"fa-regular fa-file-lines"}),onClick(){o(3)}}];return e.useEffect(()=>{r||o(0)},[]),Qt.jsxs("div",{className:"print-btn--container",children:[r&&Qt.jsx(fe,{items:i,title:"Formato do relatório",direction:"down",children:Qt.jsxs("span",{className:"d-flex align-items-center gap-1",children:[Qt.jsxs("span",{children:["Formato",Qt.jsx("span",{className:"d-inline-block d-sm-none",children:" do relatório:"})]}),Qt.jsx("span",{className:"me-1",children:["PDF","Excel","Word","Texto"][n]}),Qt.jsx("i",{className:"fa-solid fa-chevron-down ms-auto fs-7"})]})}),Qt.jsxs("div",{className:"print-btn--buttons",children:[Qt.jsxs("button",{className:"btn btn-primary",type:"submit",children:[Qt.jsx("i",{className:"fas fa-print"})," Gerar relatório"]}),Qt.jsxs("button",{className:"btn btn-outline-danger",type:"button",onClick:t,children:[Qt.jsx("i",{className:"fas fa-times"})," Fechar"]})]})]})},t.QRCodeReader=Rs,t.RadioGroup=function({className:t="",label:e,name:r,value:n,setValue:o,options:a=[],disabled:s}){return Qt.jsxs("div",{className:"rad-group--container "+t,style:{color:s?"var(--bs-secondary)":"currentColor"},children:[Qt.jsx("div",{className:"group-radio--label",children:e}),Qt.jsx("div",{className:"group-radio--body",children:a.map((t,e)=>Qt.jsxs("label",{children:[Qt.jsx(i.Input,{type:"radio",name:r,checked:Number(n)===e,onChange:()=>o(e),disabled:s}),t]},e))})]})},t.ScrollContainer=function({children:t,hasMaxWidth:e=!0}){return Qt.jsx(oc,{hasMaxWidth:e,children:Qt.jsx("div",{className:"scroll--content",children:t})})},t.TabControl=function({children:t,isMultine:r=!1,className:n="",classNameContent:o="",innerRef:i,...a}){const[s,c]=e.useState([]),u=e.useCallback(t=>{c(e=>{const r=e.findIndex(e=>e.id==(null==t?void 0:t.id));return-1==r?e.push({...ac,...t}):e[r]={...e[r],...t},e.some(t=>t.isVisible&&t.isOpen)||(void 0===(null==t?void 0:t.isVisible)||(null==t?void 0:t.isVisible)?cc(e):function(t,e){let r=t.findIndex(t=>t.id==e.id),n=!1;t.forEach(t=>{t.isOpen=!1});for(let o=r-1;o>=0;o-=1){const e=t[o];if((null==e?void 0:e.isVisible)&&!n){n=!0,e.isOpen=!0;break}}n||cc(t)}(e,t)),[...e]})},[]),l=e.useCallback(t=>{c(e=>e.filter(e=>e.id!=t))},[]),f=e.useCallback(t=>{c(e=>e.map(e=>e.id==t?{...e,isOpen:!0}:{...e,isOpen:!1}))},[]),d=e.useCallback(t=>{c(e=>e.map(e=>e.id==t?{...e,isOpen:!e.isOpen}:e))},[]),h=e.useCallback(t=>s.find(e=>e.id==t),[s]),p=e.useCallback(()=>{c(t=>{const e=t.map(t=>({...t})),r=e.findIndex(t=>t.isVisible&&t.isOpen);return r<0?cc(e):e.forEach((t,e)=>t.isOpen=e==r),e})},[]);return e.useEffect(()=>{function t(){window.innerWidth>=768&&p()}return window.addEventListener("resize",t,null),()=>{window.removeEventListener("resize",t,null)}},[p]),e.useImperativeHandle(i,()=>({open(t){const e=h(t);e&&(null==e?void 0:e.isVisible)&&f(t)}}),[f,h]),Qt.jsx(sc.Provider,{value:{tabs:s,updateOrInsertTab:u,removeTab:l,findTab:h,selectTab:f,toggleTab:d},children:Qt.jsxs("div",{className:`tab-control--container ${n}`,...a,children:[Qt.jsx(lc,{isMultine:r}),Qt.jsx("div",{className:`tab-control--content ${o}`,children:t})]})})},t.TabSheet=function({tabId:t,title:n,caption:o,isVisible:i=!0,children:a,...s}){const{findTab:c,toggleTab:u,removeTab:l,updateOrInsertTab:f}=uc(),d=e.useMemo(()=>t||r.random(999999),[]),h=c(d);return e.useEffect(()=>()=>l(d),[]),e.useEffect(()=>{f({id:d,caption:o,title:n,isVisible:i})},[f,n,o,i]),i?Qt.jsxs(fc,{open:(null==h?void 0:h.isOpen)&&(null==h?void 0:h.isVisible),"data-in-tab-sheet":null!=h?"true":"false",...s,children:[Qt.jsx("div",{className:"bi-btn-area",children:Qt.jsxs("button",{type:"button",onClick:()=>u(d),children:[n," ",Qt.jsx("i",{className:"fas fa-chevron-down"})]})}),Qt.jsx("div",{className:`bi-body ${(null==h?void 0:h.isOpen)&&"bi-open"}`,children:a})]}):null},t.Table=function({colunas:e,acoes:n,opcoes:o,dados:i,alignTop:a,colorir:s=!0,border:c=!0,sizeBreak:u=767,msgSemDados:l="Nenhum registro encontrado!",getLineColor:f,onClick:d,fixedHeader:h,clickCanEdit:p}){var g,m;e&&e.forEach(t=>{!t.tipo||"money"!=t.tipo&&"currency"!=t.tipo||(t.money=!0)}),void 0===p&&(p=t.hasTableLineClick);let v=!1;const y=(null==(g=null==n?void 0:n.acoes)?void 0:g.map(t=>({...t})))||[];if(n&&n.acoes){const t=null==(m=null==n?void 0:n.acoes)?void 0:m.filter(t=>t.ativa??!0);n.acoes=t,v=n.acoes.length>0}function _(t){const e=window.getSelection();if(e.rangeCount>0){const r=e.getRangeAt(0);if(t.contains(r.commonAncestorContainer)&&e.toString().length>0)return!0}return!1}return i&&0!=i.length?Qt.jsx(ue,{children:Qt.jsxs(le,{alignTop:a,sizeBreak:u,hasBorder:c,children:[Qt.jsx(pe,{fixedHeader:h,colunas:e,incColActions:v}),Qt.jsx(ge,{colunas:e,acoes:n,dados:i,opcoes:o,colorir:s,getLineColor:f,onClick:d||p?function(t,e){if(d){if(_(null==e?void 0:e.currentTarget))return;d(t,e)}else if(p&&r.isDesktop()){if(_(null==e?void 0:e.currentTarget))return;const r=t[(null==n?void 0:n.campo)||"id"];if(null!=r){const e=y[0];e&&!1!==e.ativa&&e.funcao(r,t,0)}}}:void 0})]})}):Qt.jsx("div",{className:"alert alert-warning mb-0",children:l})},t.TextHtml=function({value:t}){return t&&"string"==typeof t&&t.replaceAll("\n","<br/>"),Qt.jsx("span",{dangerouslySetInnerHTML:{__html:t}})},t.Toggle=function({name:t,checked:e,disabled:r,onChange:n,children:o,toRight:i,className:a="",...s}){return Qt.jsx(nc,{checked:e,disabled:r,className:a,...s,children:Qt.jsxs("label",{style:{flexDirection:i?"row-reverse":"row",justifyContent:i?"space-between":"flex-start"},children:[Qt.jsx("div",{className:"form-switch",children:Qt.jsx("input",{disabled:r,type:"checkbox",className:"form-check-input",checked:e,onChange:function(){!r&&n&&n({target:{name:t,checked:!e,value:!e}})}})}),o&&Qt.jsx("span",{className:"title",children:o})]})})},t.cache=Ze,t.createApiConfig=function(t=ce){const e={...ce,...t};return e.auth={...ce.auth,...t.auth},e},t.createDropdownItems=Fe,t.createMenuOptions=function(t){return t},t.createTableActions=t=>t,t.createTableCols=t=>t,t.createTableOptions=t=>t,t.getAlign=he,t.getDataCol=de,t.setRouteMain=function(t){ze=t},t.setTableLineClick=function(e){t.hasTableLineClick=e},t.useApi=or,t.useLibContext=ee,t.useLocalForage=function(t,r,n=1){const[o,i]=e.useState(r);return e.useEffect(()=>{dc.getItem(t).then(e=>{e&&(e.versao==n?i(e.data):dc.removeItem(t))})},[]),e.useEffect(()=>{dc.setItem(t,{versao:n,data:o})},[o]),[o,i]},t.useLocalStorage=hc,t.useParamId=function(){let t=0,e=a.useParams();return e&&e.id&&(t=parseInt(e.id)),t},t.useQuery=function(){const{search:t}=a.useLocation();return e.useMemo(()=>new URLSearchParams(t),[t])},t.useSessionStorage=function(t,r){const[n,o]=e.useState(()=>{const e=sessionStorage.getItem(t);return e&&"undefined"!==e&&"null"!==e&&""!==e?JSON.parse(e):r});return e.useEffect(()=>{sessionStorage.setItem(t,JSON.stringify(n))},[n]),[n,o]},Object.defineProperty(t,Symbol.toStringTag,{value:"Module"})});
959
+ `;function Rl({opc:t,closeMenu:e,clickGroup:r,clickFavorite:n,isFavorite:o,enabledFavorite:i}){var a;const{versionApp:s}=ee();if((null==(a=t.menus)?void 0:a.length)>0)return Qt.jsxs(Qt.Fragment,{children:[Qt.jsxs(Tl,{onClick:()=>r(t),isOpen:t.open,children:[Qt.jsx("span",{className:"opc",style:{color:t.isFavorite?"var(--nav-icon-sair)":"var(--bs-body-color) !important"},children:t.caption}),Qt.jsx("span",{className:"icon",children:Qt.jsx("i",{className:"fa-solid fa-chevron-down"})})]}),Qt.jsx("div",{className:"opt-group "+(t.open?"opt--open":"opt--close"),children:t.menus.map((t,a)=>Qt.jsx(Rl,{opc:t,closeMenu:e,clickGroup:r,clickFavorite:n,isFavorite:o,enabledFavorite:i},a))})]});if(t.route){let r=o(t.route),a=null==t?void 0:t.version;return a&&(a=Boolean(s.substring(0,a.length)===a)),Qt.jsxs(Nl,{to:t.route,onClick:e,children:[Qt.jsx("span",{className:"menu-icon",children:t.icon}),Qt.jsx("span",{className:"menu-caption",children:t.caption}),Qt.jsxs("span",{className:"menu-fav-new",children:[a&&Qt.jsx("span",{className:"menu-new",children:"novo"}),i&&Qt.jsx("span",{className:"menu-fav",onClick:e=>n(e,t),children:Qt.jsx("i",{title:"Clique para favoritar esta opção",className:"fa-"+(r?"solid":"regular")+" fa-heart",style:{color:r?"var(--nav-icon)":"var(--nav-icon-fav)"}})})]})]})}return(null==t?void 0:t.isLine)?Qt.jsx(kl,{}):null}const Dl="sys/nav/closed";const Pl=({routes:t,closeMenu:e,brand:r})=>Qt.jsx("div",{className:"navbar-mu--brand",children:Qt.jsx(a.Link,{to:t.home,onClick:e,className:"brand",title:"Voltar para tela inicial",children:r})});function Ml({isOpen:t,setIsOpen:e,menuClose:r}){return Qt.jsx("button",{className:"btn-menu",title:"Abrir menu de opções",onClick:()=>e(!t),children:r?Qt.jsx("i",{className:"fa-solid fa-xmark icon-close"}):Qt.jsxs("div",{className:"icon-desk",children:[Qt.jsx("span",{}),Qt.jsx("span",{}),Qt.jsx("span",{})]})})}const Bl="sys/nav/closed";t.Alerta=se,t.Aviso=function({onConfirm:t,text:e="",children:r}){return Qt.jsx(ae,{type:ne,title:"Aviso!",text:e,onConfirm:t,children:r})},t.BotaoClonar=function({title:t="Clonar o registro"}){return Qt.jsx(i.Button,{size:"sm",color:"warning",title:t,children:Qt.jsx(we,{})})},t.BotaoEditar=function({title:t="Alterar o registro"}){return Qt.jsx(i.Button,{size:"sm",color:"primary",title:t,children:Qt.jsx(Ee,{})})},t.BotaoExcluir=function({title:t="Excluir o registro"}){return Qt.jsx(i.Button,{size:"sm",color:"danger",title:t,children:Qt.jsx(Ie,{})})},t.BotaoIncluir=function({caption:t="Incluir",onClick:e,...r}){return Qt.jsxs(i.Button,{color:"success",title:"Incluir um novo registro",onClick:e,...r,children:[Qt.jsx(Ae,{})," ",t]})},t.BotaoSalvar=function({loading:t,saveInfo:e,link:r,fixed:n,modalFixed:o,btnSaveDisabled:s,onCancel:u,onConfirm:l}){const c=a.useHistory();return Qt.jsxs("div",{className:"botao-salvar--area","data-fixed":Boolean(n),"data-modal-fixed":Boolean(o),children:[Qt.jsxs(i.Button,{type:l?"button":"submit",color:"primary",onClick:l,disabled:s&&1==s,children:[Qt.jsx("i",{className:"fas fa-cloud-upload-alt"}),t||(null==e?void 0:e.loading)?"Salvando...":"Salvar"]}),Qt.jsxs(i.Button,{type:"button",color:"outline-danger",onClick:()=>{u?u():r?c.push(r):c.goBack()},children:[Qt.jsx("i",{className:"fas fa-times"}),"Cancelar"]})]})},t.BoxColor=function({corFonte:t,setCorFonte:e,corFundo:r,setCorFundo:n}){return Qt.jsxs("div",{className:"box-color--container",children:[Qt.jsx(ke,{label:"Cor da fonte",value:t,onChange:t=>e(t.target.value)}),Qt.jsx(ke,{label:"Cor de fundo",value:r,onChange:t=>n(t.target.value)}),Qt.jsx("div",{className:"box-color-texto",style:{color:t,backgroundColor:r},children:"Texto de exemplo"})]})},t.BoxInfo=function({id:t,title:r,isOpen:n=!1,isVisible:o=!0,onChange:i,noMargin:a,children:s,...u}){const[l,c]=e.useState(n);return e.useEffect(()=>{t&&i&&i(t,l)},[l]),o?Qt.jsxs(Re,{open:l,noMargin:a,...u,children:[Qt.jsx("div",{className:"bi-btn-area",children:Qt.jsxs("button",{type:"button",onClick:()=>c(!l),children:[r," ",Qt.jsx("i",{className:"fas fa-chevron-down setas-bi"})]})}),Qt.jsx("div",{className:`bi-body ${l&&"bi-open"}`,children:s})]}):null},t.BoxSearch=dl,t.ButtonBack=Be,t.ButtonClose=Pe,t.ButtonHelp=Me,t.ButtonOptions=function({value:t,setValue:e,options:r=[],...n}){return Qt.jsx("div",{className:"btn-opts--container btn-group",...n,children:r.map((r,n)=>Qt.jsx(i.Button,{active:n===t,color:"outline-info",onClick:()=>e(n),children:r},n))})},t.ButtonTop=function({smooth:t,center:r}){const[n,o]=e.useState(!1);function i(){var t;o((null==(t=document.querySelector("main"))?void 0:t.scrollTop)>0)}return e.useEffect(()=>{var t;return null==(t=document.querySelector("main"))||t.addEventListener("scroll",i),()=>{var t;null==(t=document.querySelector("main"))||t.removeEventListener("scroll",i)}},[]),Qt.jsx(Qt.Fragment,{children:n&&Qt.jsx(Le,{title:"Ir para o início da tela",visible:i,onClick:function(){var e;null==(e=document.querySelector("main"))||e.scrollTo({top:0,left:0,behavior:t?"smooth":"instant"}),o(!1)},className:"pulsate-bck",center:r,children:Qt.jsx("i",{className:"fa-solid fa-arrow-up"})})})},t.CheckBox=function({enabled:t=!0,onChange:e,children:r,...n}){const o=n.disabled||!t;return Qt.jsx(Rs,{disabled:o,children:Qt.jsxs("label",{children:[Qt.jsx(i.Input,{type:"checkbox",disabled:o,onChange:t=>{if(e){let r={...t,target:{...t.target,name:t.target.name,value:t.target.checked}};e(r)}},checked:"boolean"==typeof n.value?n.value:n.checked,...n}),r]})})},t.CheckUpdates=function(){const t=e.useRef();function r(e){var r,n;(null==t?void 0:t.current)&&(e?null==(r=t.current)||r.classList.add("update-show"):null==(n=t.current)||n.classList.remove("update-show"))}return e.useLayoutEffect(()=>{"serviceWorker"in navigator&&window.location.origin.startsWith("http")&&navigator.serviceWorker.getRegistration().then(t=>{t&&(t.addEventListener("updatefound",()=>{r(!0);const e=t.installing;e.addEventListener("statechange",()=>{"installed"==e.state&&setTimeout(()=>window.location.reload(!0),1e3),"activated"==e.state&&r(!1)})}),t.update())}).catch(t=>{console.error("=> Service Worker não encontrado:",t)})},[]),Qt.jsx("div",{className:"update-check-box",onClick:function(){r(!1)},children:Qt.jsxs("div",{ref:t,className:"update-box",children:[Qt.jsx("div",{className:"update-line"}),Qt.jsx("div",{className:"spinner-border text-warning w-22",role:"status",children:Qt.jsx("span",{className:"visually-hidden",children:"Carregando..."})}),"Nova versão disponível, atualizando..."]})})},t.ClipboardArea=function({title:t,url:r,timerInMilliSeconds:n=5e3}){const[o,i]=e.useState(!1);return e.useEffect(()=>()=>{Fe&&clearTimeout(Fe)},[]),Qt.jsxs("div",{className:`clipboard-area--container ${o&&" clip-active"}`,children:[Qt.jsx("a",{href:r,target:"_blank",rel:"noreferrer",title:"Abrir este link",children:t||r}),Qt.jsx("button",{type:"button",className:"clip-mark",onClick:function(){navigator.clipboard.writeText(r),i(!0),Fe=setTimeout(()=>i(!1),n)},children:o?Qt.jsxs(Qt.Fragment,{children:[Qt.jsx("i",{className:"fas fa-clipboard-check"}),"Copiado"]}):Qt.jsxs(Qt.Fragment,{children:[Qt.jsx("i",{className:"fas fa-clipboard"}),"Copiar"]})})]})},t.Confirma=function({onConfirm:t,onCancel:e,text:r="",children:n,defaultBtn:o}){return Qt.jsx(ae,{type:oe,title:"Confirmação!",text:r,onConfirm:t,onCancel:e,defaultBtn:o,children:n})},t.DataItem=function({caption:t,colored:e,isForm:r=!1,children:n,className:o,...i}){return Qt.jsxs("div",{className:"di-box "+o,...i,children:[t&&Qt.jsx("label",{style:{fontWeight:r?"bold":"normal"},children:t}),r?Qt.jsx("input",{className:"form-control",value:n,readOnly:!0}):Qt.jsx("div",{style:{color:e?"var(--data-item-destaque)":"var(--body-color)"},className:"fw-bold",children:n})]})},t.DropDownButton=he,t.DynamicCounter=function({valor:t=0,time:n=25,format:o,currency:i}){const[a,s]=e.useState(0);return e.useEffect(()=>{const e=setInterval(()=>{const r=Math.ceil(t/10)+1;s(n=>{let o=n+r;return o>t&&(o=t),o===t&&clearInterval(e),o})},n);return()=>clearInterval(e)},[t,n]),o?r.formatValor(a,i?2:0,Boolean(i)):a},t.FormDesk=function({children:t,labelWidth:e=100,sizeBreak:r=767,lineShortWidth:n=250,gap:o="8px",...i}){return Qt.jsx(wl,{style:{"--form-desk-label-width":`${e}px`,"--form-desk-line-short-width":`${n}px`,"--form-desk-gap":o},sizeBreak:r,...i,children:t})},t.FormDeskGrid=function({grid:t,gap:e=25,className:r="",children:n,...o}){return Qt.jsx("div",{className:`form-desk--grid ${r}`,style:{gridTemplateColumns:t,gap:e},...o,children:n})},t.FormDeskLine=function({children:t,label:e="",isShort:r=!1,className:n="",classNameLabel:o="",classNameCol:i="",extraComp:a,inpWidth:s,...u}){const l={};return s&&(l["--form-desk-line-short-width"]=s),Qt.jsxs("div",{className:`form-desk-line ${n}`,"data-has-extra-comp":a?"true":"false",...u,style:{...u.styles,...l},children:[Qt.jsx("label",{className:`form-desk-label ${o}`,children:e}),Qt.jsx("div",{className:i,"data-is-line-short":String(r),children:t}),a&&Qt.jsx("div",{className:"my-auto",children:a})]})},t.FormEdit=function({title:t,count:r,codigo:n,maxWidth:o=1200,goBack:i,goHome:a,onClose:s,helpLink:u,children:l}){return e.useEffect(()=>{var t;null==(t=document.querySelector("main"))||t.scrollTo(0,0)},[]),Qt.jsx("div",{className:"mx-auto",style:{maxWidth:o},children:Qt.jsx(Ge,{title:t,count:r,codigo:n,goBack:i,goHome:a,onClose:s,helpLink:u,children:l})})},t.FormEnter=function({children:t}){const r=e.useRef(),n=(t,e)=>{let r=t[e];for(;e<t.length-1&&(r=t[++e],r.disabled););return r};return Qt.jsx("form",{onSubmit:function(t){t.preventDefault()},ref:r,onKeyDown:function(t){var e,o;if("Enter"===t.key){const i=null==(e=null==r?void 0:r.current)?void 0:e.querySelector(".form-item:focus,.btn-primary"),a=null==(o=null==r?void 0:r.current)?void 0:o.querySelectorAll(".form-item,.btn-primary");for(let e=0;e<a.length;e++)if(a[e]===i&&e<a.length-1){t.preventDefault();const r=n(a,e);(null==r?void 0:r.select)&&r.select(),r.focus()}}},children:t})},t.FormatData=({value:t="",incHour:e=!0})=>{let r="";if(t){let n,o;-1!==t.indexOf("T")?(n=t.split("T"),o=n[1],n=n[0]):(n=t.split(" "),n.length>1&&(o=n[1]),n=n[0]),-1!==n.indexOf("-")&&(n=n.split("-").reverse().join("/")),o&&e&&(n=n+" "+o),r=n}return r},t.FormatPercent=({value:t=0,decimalScale:e=2,...r})=>Qt.jsx("span",{...r,children:Intl.NumberFormat("pt-br",{maximumFractionDigits:e,minimumFractionDigits:e,style:"decimal"}).format(Ds(t))+"%"}),t.FormatQuant=({value:t=0,decimalScale:e=2,...r})=>Qt.jsx("span",{...r,children:Intl.NumberFormat("pt-br",{maximumFractionDigits:e,minimumFractionDigits:e,style:"decimal"}).format(Ds(t))}),t.FormatValor=({value:t=0,money:e=!0,decimalScale:r=2,...n})=>Qt.jsx("span",{...n,children:Intl.NumberFormat("pt-br",{maximumFractionDigits:r,minimumFractionDigits:r,style:e?"currency":"decimal",currency:"BRL"}).format(Ds(t))}),t.GroupBox=function({label:t,className:e="",children:r}){return Qt.jsxs("div",{className:`group-box--container ${e}`,children:[Qt.jsx("div",{className:"group-box--label",children:t}),Qt.jsx("div",{className:"group-box--body",children:r})]})},t.Hint=function({title:t="Ajuda",children:e}){return Qt.jsxs("div",{className:"hint--container",children:[Qt.jsx("i",{className:"fas fa-question"}),Qt.jsxs("div",{className:"hint-content",children:[Qt.jsx("div",{className:"title",children:t}),e]})]})},t.IconClose=Ve,t.IconExitOutline=function(t){return Qt.jsx("svg",{viewBox:"0 0 512 512",fill:"currentColor",height:"1em",width:"1em",...t,children:Qt.jsx("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:32,d:"M320 176v-40a40 40 0 00-40-40H88a40 40 0 00-40 40v240a40 40 0 0040 40h192a40 40 0 0040-40v-40M384 176l80 80-80 80M191 256h273"})})},t.IconMenu=Ue,t.IconUserGear=function(t){return Qt.jsx("svg",{viewBox:"0 0 640 512",fill:"currentColor",height:"1em",width:"1em",...t,children:Qt.jsx("path",{d:"M224 256c-70.7 0-128-57.3-128-128S153.3 0 224 0s128 57.3 128 128-57.3 128-128 128zm-45.7 48h91.4c11.8 0 23.4 1.2 34.5 3.3-2.1 18.5 7.4 35.6 21.8 44.8-16.6 10.6-26.7 31.6-20 53.3 4 12.9 9.4 25.5 16.4 37.6s15.2 23.1 24.4 33c15.7 16.9 39.6 18.4 57.2 8.7v.9c0 9.2 2.7 18.5 7.9 26.3H29.7C13.3 512 0 498.7 0 482.3 0 383.8 79.8 304 178.3 304zM436 218.2c0-7 4.5-13.3 11.3-14.8 10.5-2.4 21.5-3.7 32.7-3.7s22.2 1.3 32.7 3.7c6.8 1.5 11.3 7.8 11.3 14.8v30.6c7.9 3.4 15.4 7.7 22.3 12.8l24.9-14.3c6.1-3.5 13.7-2.7 18.5 2.4 7.6 8.1 14.3 17.2 20.1 27.2s10.3 20.4 13.5 31c2.1 6.7-1.1 13.7-7.2 17.2l-25 14.4c.4 4 .7 8.1.7 12.3s-.2 8.2-.7 12.3l25 14.4c6.1 3.5 9.2 10.5 7.2 17.2-3.3 10.6-7.8 21-13.5 31s-12.5 19.1-20.1 27.2c-4.8 5.1-12.5 5.9-18.5 2.4L546.3 442c-6.9 5.1-14.3 9.4-22.3 12.8v30.6c0 7-4.5 13.3-11.3 14.8-10.5 2.4-21.5 3.7-32.7 3.7s-22.2-1.3-32.7-3.7c-6.8-1.5-11.3-7.8-11.3-14.8v-30.6c-8-3.4-15.6-7.7-22.5-12.9l-24.7 14.3c-6.1 3.5-13.7 2.7-18.5-2.4-7.6-8.1-14.3-17.2-20.1-27.2s-10.3-20.4-13.5-31c-2.1-6.7 1.1-13.7 7.2-17.2l24.8-14.3c-.4-4.1-.7-8.2-.7-12.4s.2-8.3.7-12.4L343.8 325c-6.1-3.5-9.2-10.5-7.2-17.2 3.3-10.6 7.7-21 13.5-31s12.5-19.1 20.1-27.2c4.8-5.1 12.4-5.9 18.5-2.4l24.8 14.3c6.9-5.1 14.5-9.4 22.5-12.9v-30.4zm92.1 133.5c0-26.5-21.5-48-48.1-48s-48.1 21.5-48.1 48 21.5 48 48.1 48 48.1-21.5 48.1-48z"})})},t.IconeChevron=()=>Qt.jsx("i",{className:"fas fa-chevron-down"}),t.IconeClonar=()=>Qt.jsx("i",{className:"fa-solid fa-copy"}),t.IconeConfig=()=>Qt.jsx("i",{className:"fas fa-cogs"}),t.IconeEditar=Ee,t.IconeEmail=()=>Qt.jsx("i",{className:"fas fa-envelope"}),t.IconeEncerrarAno=()=>Qt.jsx("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Qt.jsx("path",{d:"M8.875 17.375C7.43258 17.375 6.10606 17.0466 4.89545 16.3898C3.68485 15.733 2.69318 14.8572 1.92045 13.7625V15.8295H0.375V11.1932H5.01136V12.7386H3.09886C3.71705 13.6659 4.53176 14.4129 5.543 14.9795C6.55373 15.5462 7.66439 15.8295 8.875 15.8295C9.84091 15.8295 10.7458 15.6462 11.5896 15.2794C12.4329 14.9121 13.167 14.416 13.7919 13.7911C14.4162 13.1667 14.9121 12.4326 15.2794 11.5888C15.6462 10.7455 15.8295 9.84091 15.8295 8.875H17.375C17.375 10.047 17.153 11.1481 16.7089 12.1784C16.2643 13.2087 15.6557 14.1102 14.883 14.883C14.1102 15.6557 13.2087 16.2641 12.1784 16.7081C11.1481 17.1527 10.047 17.375 8.875 17.375ZM8.17955 14.2841V13.2795C7.57424 13.1379 7.08176 12.8772 6.70209 12.4975C6.32191 12.1174 6.04167 11.6182 5.86136 11L7.13636 10.4977C7.29091 11.0258 7.53251 11.4217 7.86118 11.6854C8.18933 11.9497 8.56591 12.0818 8.99091 12.0818C9.41591 12.0818 9.77961 11.9819 10.082 11.782C10.3849 11.5826 10.5364 11.2705 10.5364 10.8455C10.5364 10.472 10.3787 10.1693 10.0635 9.9375C9.74767 9.70568 9.18409 9.44167 8.37273 9.14545C7.61288 8.875 7.056 8.55303 6.70209 8.17955C6.34767 7.80606 6.17045 7.31667 6.17045 6.71136C6.17045 6.18333 6.35411 5.70347 6.72141 5.27177C7.0882 4.84059 7.58712 4.56061 8.21818 4.43182V3.46591H9.57045V4.43182C10.0341 4.47045 10.456 4.6572 10.8362 4.99205C11.2158 5.32689 11.4765 5.7197 11.6182 6.17045L10.3818 6.67273C10.2788 6.37651 10.1114 6.12873 9.87955 5.92936C9.64773 5.72948 9.32576 5.62955 8.91364 5.62955C8.46288 5.62955 8.1185 5.72614 7.8805 5.91932C7.64198 6.1125 7.52273 6.37651 7.52273 6.71136C7.52273 7.04621 7.67083 7.31023 7.96705 7.50341C8.26326 7.69659 8.79773 7.92197 9.57045 8.17955C10.4977 8.51439 11.1159 8.9072 11.425 9.35795C11.7341 9.80871 11.8886 10.3045 11.8886 10.8455C11.8886 11.2189 11.8242 11.5473 11.6955 11.8307C11.5667 12.114 11.3962 12.3554 11.1839 12.5547C10.9712 12.7546 10.7231 12.9156 10.4398 13.0377C10.1564 13.1603 9.85379 13.2538 9.53182 13.3182V14.2841H8.17955ZM0.375 8.875C0.375 7.70303 0.597288 6.60189 1.04186 5.57159C1.48592 4.54129 2.09432 3.63977 2.86705 2.86705C3.63977 2.09432 4.54129 1.48567 5.57159 1.04109C6.60189 0.59703 7.70303 0.375 8.875 0.375C10.3174 0.375 11.6439 0.703409 12.8545 1.36023C14.0652 2.01705 15.0568 2.8928 15.8295 3.9875V1.92045H17.375V6.55682H12.7386V5.01136H14.6511C14.033 4.08409 13.2182 3.33712 12.207 2.77045C11.1963 2.20379 10.0856 1.92045 8.875 1.92045C7.90909 1.92045 7.00448 2.10385 6.16118 2.47064C5.31736 2.83794 4.58327 3.33377 3.95891 3.95814C3.33403 4.58301 2.83794 5.31711 2.47064 6.16041C2.10385 7.00423 1.92045 7.90909 1.92045 8.875H0.375Z",fill:"currentColor"})}),t.IconeExcluir=Ie,t.IconeFechar=xe,t.IconeFecharCircle=()=>Qt.jsx("i",{className:"fas fa-times-circle"}),t.IconeHelp=Oe,t.IconeIncluir=Ae,t.IconeLogin=()=>Qt.jsx("i",{className:"fas fa-sign-in-alt"}),t.IconeLogout=Ce,t.IconeMostrarSenha=({display:t})=>Qt.jsx("i",{className:"fas fa-eye"+(t?"-slash":"")}),t.IconeOpenLink=Te,t.IconePassword=()=>Qt.jsx("i",{className:"fas fa-key"}),t.IconePin=()=>Qt.jsx("i",{className:"fas fa-map-marker-alt"}),t.IconePrint=()=>Qt.jsx("i",{className:"fas fa-print"}),t.IconeQRCode=Ne,t.IconeSalvar=()=>Qt.jsx("i",{className:"fas fa-cloud-upload-alt"}),t.IconeSearchPlus=()=>Qt.jsx("i",{className:"fas fa-search-plus"}),t.IconeSoma=()=>Qt.jsx("svg",{width:"10",height:"13",viewBox:"0 0 10 13",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Qt.jsx("path",{d:"M0.898056 12.1914V10.6914L5.77306 6.19141L0.898056 1.69141V0.191406H9.89806V2.44141H4.47931L8.51056 6.19141L4.47931 9.94141H9.89806V12.1914H0.898056Z",fill:"currentColor"})}),t.IconeUsers=()=>Qt.jsx("i",{className:"fas fa-user-cog"}),t.IconeVisualizar=Se,t.Input=function({autoSelect:t,...e}){function r(r){e.onClick?e.onClick(r):t&&r.currentTarget.select()}switch(e.type){case"cpf":return Qt.jsx(ll,{onClick:r,...e});case"cnpj":return Qt.jsx(rl,{onClick:r,...e});case"codigo":return Qt.jsx(sl,{name:e.name,onChange:e.onChange,onClick:r,...e});case"fone":return Qt.jsx(Ls,{name:e.name,onChange:e.onChange,value:e.value,onClick:r,...e});case"uf":return Qt.jsx(cl,{onClick:r,...e});case"hora":return Qt.jsx(ul,{onClick:r,...e});case"percent":return Qt.jsx(al,{name:e.name,onChange:e.onChange,onClick:r,...e});case"quant":return Qt.jsx(il,{name:e.name,onChange:e.onChange,onClick:r,...e});case"real":return Qt.jsx(ol,{name:e.name,onChange:e.onChange,onClick:r,...e});case"finder":return Qt.jsx(pl,{onClick:r,...e});default:return Qt.jsx("input",{className:"form-control",onClick:r,...e})}},t.InputBox=function({children:t}){return Qt.jsx("div",{className:"jclib-ui-input-box",children:t})},t.InputCep=function({dados:t,setDados:r,onSearch:n,disabled:o,autoFocus:i,...a}){const[s,u]=e.useState(!1),c=async e=>{u(!0);const o=await(async(t,e)=>{let r={erro:!0,mensagem:"CEP deve ter 8 dígitos!"};if((t=t.replace(/\D+/g,""))&&8===t.length){const n=`https://viacep.com.br/ws/${t}/json`;try{r=await(await fetch(n,{mode:"cors"})).json()}catch{r={erro:!0,mensagem:"Não foi possível pesquisar este CEP!"}}finally{e&&e(r)}}return r})(e,n);!o.erro&&t&&r&&r({...t,ende:o.logradouro,bairro:o.bairro,cida:o.localidade,uf:o.uf}),u(!1)};return Qt.jsxs(Qt.Fragment,{children:[Qt.jsx(Bs,{visible:s,message:"Buscando CEP..."}),Qt.jsxs("div",{className:"input-group",children:[Qt.jsx(l,{format:"##.###-###",mask:"_",value:a.value,className:"form-control",onValueChange:t=>function(t,e,r){r&&r({target:{name:e,value:t.formattedValue}})}(t,a.name,a.onChange),disabled:o,autoFocus:i}),Qt.jsx("button",{type:"button",className:"btn btn-info",onClick:()=>c(a.value),disabled:o,children:Qt.jsx("i",{className:"fas fa-search"})})]})]})},t.InputCheckBox=({disabled:t,children:e,name:r,checked:n,onChange:o})=>Qt.jsx(gl,{children:Qt.jsxs(ml,{disabled:t,onClick:function(){if(!t&&o){o({target:{name:r,checked:!n}})}},children:[Qt.jsxs("span",{children:[n&&Qt.jsx(me,{color:t&&"silver"}),!n&&Qt.jsx(ve,{color:t&&"silver"})]})," ",e]})}),t.InputCnpj=rl,t.InputCodigo=sl,t.InputColor=ke,t.InputCpf=ll,t.InputCpfCnpj=function({onChange:t,value:e,name:r,className:n,...o}){return Qt.jsx(tl,{className:`form-control ${Us(e)?"is-invalid":""} ${n||""}`,mask:el,onAccept:function(e){t({target:{name:r,value:e.toUpperCase()}})},value:e,name:r,...o})},t.InputEstado=cl,t.InputFinder=({title:t,onFind:e,children:r,...n})=>Qt.jsxs("div",{className:"input-group",children:[Qt.jsxs("select",{className:"form-select",...n,children:[Qt.jsxs("option",{value:0,children:["- ",t," -"]}),r]}),Qt.jsx("button",{type:"button",title:"Pesquisar...",className:"btn btn-info",onClick:e,children:Qt.jsx(_e,{})})]}),t.InputFone=Ls,t.InputHora=ul,t.InputPassword=function({disabled:t,autoSelect:r,...n}){const[o,i]=e.useState(!1);return Qt.jsxs(vl,{disabled:t,children:[Qt.jsx("input",{type:o?"text":"password",disabled:t,onClick:function(t){n.onClick?n.onClick(t):r&&t.currentTarget.select()},...n}),Qt.jsx("i",{className:o?"fas fa-eye-slash":"fas fa-eye",onClick:()=>{t||i(!o)},title:t?"":(o?"Ocultar":"Exibir")+" a senha"})]})},t.InputPercent=al,t.InputPesquisa=sr,t.InputQRCode=function({value:t,setValue:r}){const[n,o]=e.useState(!1);return Qt.jsxs(Qt.Fragment,{children:[Qt.jsxs("div",{className:"input-group",children:[Qt.jsx(i.Input,{disabled:!0,placeholder:"Link para o documento de pagamento",title:"Link para o documento de pagamento",value:t}),Qt.jsx(i.Button,{color:"outline-secondary",title:"Limpar o campo",onClick:()=>r(""),children:Qt.jsx(be,{})}),Qt.jsx(i.Button,{color:"success-light",title:"Ler QRCode do documento",onClick:()=>o(!0),children:Qt.jsx(Ne,{})}),t?Qt.jsx(tr,{className:"btn btn-info",title:"Abrir o link do documento",to:t,children:Qt.jsx(Te,{})}):Qt.jsx(i.Button,{color:"info",disabled:!0,children:Qt.jsx(Te,{})})]}),n&&Qt.jsx(ks,{setVisible:o,title:"Ler QRCode do documento",onResult:t=>r(null==t?void 0:t.text)})]})},t.InputQuant=il,t.InputSearch=({title:t="Selecione",options:e=[],fields:r=[],btnClick:n=null,...o})=>Qt.jsxs("div",{className:"input-group",children:[Qt.jsxs("select",{className:"form-select",...o,children:[Qt.jsxs("option",{value:0,children:["- ",t," -"]}),null==e?void 0:e.map((t,e)=>Qt.jsx("option",{value:t[r[0]],children:t[r[1]]},e))]}),Qt.jsx("button",{type:"button",className:"btn btn-info",title:"Abrir tela de pesquisa",onClick:n,children:Qt.jsx(_e,{})})]}),t.InputValor=ol,t.LabelHint=function({label:t,hint:e}){return Qt.jsxs("div",{className:"label-hint--container",children:[Qt.jsx("label",{children:t}),Qt.jsx("div",{className:"label-hint--icon",children:Qt.jsx("i",{className:"fas fa-question"})}),Qt.jsxs("div",{className:"label-hint--box",children:[Qt.jsx("div",{className:"label-hint--box-title",children:"Ajuda"}),e]})]})},t.LibProvider=({apiConfig:t,children:n,versionApp:o,useTheme:i})=>{const a=!(!i||"boolean"!=typeof i)&&i,[s,u]=e.useState(()=>{let t="";if(a){let e=localStorage.getItem(te);t=e||(r.isDarkMode()?"dark":"light")}return t}),[l,c]=Ol("sys/reportType",0),[h,f]=e.useState([]),[d,p]=e.useState(!1),g=t=>{let e=h.find(e=>e.modalId===t);e&&e.setVisible(!1),f(e=>e.filter(e=>e.modalId!==t))},m=e.useCallback(t=>{"Escape"===t.key&&0!=h.length&&g(h[h.length-1].modalId)},[h]);return e.useEffect(()=>{("localhost"===window.location.hostname||"127.0.0.1"===window.location.hostname||"[::1]"===window.location.hostname||window.location.hostname.startsWith("192.168."))&&!document.title.includes(" ⭕ ")&&(document.title=`${document.title} ⭕ `)},[]),e.useEffect(()=>{a&&(localStorage.setItem(te,s),document.body.dataset.bsTheme="dark"==s?s:"")},[s,a]),e.useEffect(()=>(window.addEventListener("keydown",m,!1),()=>window.removeEventListener("keydown",m,!1)),[h]),Qt.jsx(Jt.Provider,{value:{versionApp:o,addModal:(t,e)=>{f(r=>{let n=[...r],o=n.findIndex(e=>e.modalId===t);return o>=0?n[o]={modalId:t,setVisible:e}:n.push({modalId:t,setVisible:e}),n})},removeModal:g,clearModals:()=>{h.forEach(t=>{g(t.modalId)})},showBtnTop:d,setShowBtnTop:p,globalApiConfig:t,theme:s,setTheme:u,toggleTheme:()=>u("dark"==s?"light":"dark"),canChangeTheme:a,reportType:l,setReportType:c},children:n})},t.LinkToEmail=Je,t.LinkToFone=function({href:t,children:e,...r}){const n=String(t||e);let o="+";return(null==n?void 0:n.startsWith("+"))||(o="+55"),o+=n.replace(/\D/g,""),Qt.jsx("a",{href:`tel:${o}`,title:"Ligar para este número",...r,children:e||t})},t.LinkToMaps=function({href:t,children:e,...r}){let n=`https://google.com/maps/place/${null==t?void 0:t.replace(" ","+")}`;return(null==t?void 0:t.includes("/maps/place/"))&&(null==t?void 0:t.startsWith("https"))&&(n=t),Qt.jsx("a",{href:n,target:"_blank",rel:"noreferrer",title:"Localizar este endereço",...r,children:e})},t.LinkToNewPage=tr,t.LinkToWhatsApp=Qe,t.Loading=Bs,t.LoadingReport=function({url:t,file:e,fileTo:r,loading:n=!0,setLoading:o}){if(!n)return null;let[,i]=e.split("."),[a,s]=r.split(".");return s!=i&&(r=[a,i].join(".")),Qt.jsx(ar,{url:t,file:e,fileTo:r,setLoading:o})},t.Modal=cr,t.ModalBody=hr,t.ModalBox=function({visible:t,setVisible:e,codigo:r,title:n,children:o,alignTop:i,paddingBottom:a=10,helpLink:s,count:u,...l}){return t?Qt.jsxs(cr,{alignTop:i,setVisible:e,visible:t,...l,children:[Qt.jsxs(dr,{helpLink:s,setVisible:e,children:[n,null!=u&&Qt.jsxs(Qt.Fragment,{children:[" ",Qt.jsx(ze,{value:u,isCount:!0})]}),Qt.jsx(ze,{value:r})]}),Qt.jsx(fr,{children:Qt.jsx(hr,{style:{paddingBottom:a},children:o})})]}):null},t.ModalContent=fr,t.ModalFilter=function({title:t="Filtros",setVisible:e,maxWidth:r,fnApplyFilter:n,children:o,alignTop:a,helpLink:s}){return Qt.jsxs(cr,{alignTop:a,maxWidth:r,setVisible:e,visible:!0,children:[Qt.jsx(dr,{helpLink:s,setVisible:e,children:t}),Qt.jsx(fr,{children:Qt.jsxs(hr,{className:"mod-filter--container",children:[o,Qt.jsxs("div",{className:"mod-filter--btn-area",children:[Qt.jsxs(i.Button,{block:!0,color:"primary",onClick:()=>{n&&n(!0)},children:[Qt.jsx(ye,{})," Aplicar filtros"]}),Qt.jsxs(i.Button,{block:!0,color:"outline-danger",onClick:()=>{n&&n(!1)},children:[Qt.jsx(xe,{})," Cancelar filtros"]})]})]})})]})},t.ModalFooter=function({className:t="",backgroundColor:e="",...r}){return Qt.jsx("div",{className:`modal--footer ${t}`,style:{backgroundColor:e},...r})},t.ModalHeader=dr,t.Navbar=function({menusConfig:{brand:t,company:n,menus:o,routes:i,user:s,validatePermis:u},helpLink:l}){const c=a.useHistory(),h=e.useRef(),f=e.useRef(),{theme:d,setTheme:p,canChangeTheme:g}=ee(),[m,v]=e.useState(!1),[y,_]=e.useState(""),[w,b]=e.useState([]),[C,A]=e.useState([]);let E=[];const I=localStorage.getItem(Dl);I&&(E=JSON.parse(I));const[S]=or({url:i.apiFavorites,onTerminated:t=>{t.error?console.info("Erro ao obter lista de favoritos!",t.error):A(t.data)}}),[x]=or({url:i.apiFavorites,method:"patch",onTerminated:t=>{t.error&&console.info("Erro ao salvar favoritos!",t.error)}});function O(){v(!1)}function T(t){let e=[...w],r=[];e.forEach(e=>{e===t&&(e.open=!e.open),e.open||r.push(e.caption)}),localStorage.setItem(Dl,JSON.stringify(r)),b(e)}function N(t){let e=[...w];e.forEach(e=>{(null==e?void 0:e.menus)&&((null==e?void 0:e.stayOpen)?e.open=e.stayOpen:e.open=t)}),b(e),T(null)}function k(t,e){t.stopPropagation(),t.preventDefault();const r=C.filter(t=>t.route!==e.route);var n;r.length===C.length&&r.push({caption:((null==e?void 0:e.prefix)?e.prefix+" / ":"")+e.caption,route:e.route}),n=r,i.apiFavorites&&(x({data:n}),A(n))}function R(t){return C.some(e=>e.route===t)}return e.useEffect(()=>{i.apiFavorites&&S()},[]),e.useEffect(()=>{let t=[];null==C||C.forEach(e=>{o.forEach((r,n)=>{var o;if(n>0&&0!==(null==(o=null==r?void 0:r.menus)?void 0:o.length)){let o=r.menus.findIndex(t=>t.route===e.route);if(o>=0){let i=r.menus[o];t.push({...i,caption:e.caption,index:String(n).padStart(2,"0")+String(o).padStart(2,0)})}}})}),"Favoritos"===o[0].caption&&(o[0].menus=t.sort((t,e)=>t.index>e.index?1:t.index<e.index?-1:0)),b(function(t){let e=[];return t.forEach(t=>{let r={caption:t.caption,open:!E.includes(t.caption)||t.stayOpen,stayOpen:t.stayOpen,isFavorite:null==t?void 0:t.isFavorite,prefix:null==t?void 0:t.prefix,menus:[]};t.menus&&t.menus.length>0&&t.menus.filter(t=>{var e;return(null==t?void 0:t.isLine)||!(null==t?void 0:t.isLine)&&(t.caption.toLowerCase().includes(y.toLowerCase())||(null==(e=t.shortcut)?void 0:e.toLowerCase().includes(y.toLowerCase())))}).forEach(t=>{u(null==t?void 0:t.permis,null==t?void 0:t.acesso)&&r.menus.push({...t,prefix:null==r?void 0:r.prefix})}),y&&(r.open=!0),e.push(r)}),e.forEach(t=>{var e;t.menus&&((null==(e=t.menus[0])?void 0:e.isLine)&&(t.menus=t.menus.filter(t=>!(null==t?void 0:t.isLine))),t.menus=t.menus.filter((t,e,r)=>{var n;return!(e>0&&(null==(n=r[e-1])?void 0:n.isLine)&&t.isLine)}),t.menus=t.menus.filter((t,e,r)=>!(e===r.length-1&&(null==t?void 0:t.isLine))))}),e}(o))},[y,C]),e.useEffect(()=>{var t,e;r.isDesktop()&&(null==(t=null==h?void 0:h.current)||t.focus(),null==(e=null==h?void 0:h.current)||e.select())},[m]),Qt.jsxs(Qt.Fragment,{children:[Qt.jsx("div",{className:"navbar--area",children:Qt.jsxs("div",{className:"navbar-content",children:[Qt.jsx("button",{className:"btn-menu"+(m?" opened":""),title:"Abrir menu de opções",onClick:()=>v(!m),children:m?Qt.jsx(Ve,{width:20,height:20}):Qt.jsx(Ue,{width:20,height:20})}),Qt.jsxs("div",{className:"content",children:[Qt.jsx(a.Link,{to:i.home,className:"brand",onClick:O,title:"Voltar para tela inicial",children:t}),Qt.jsxs("div",{className:"company",children:[Qt.jsx("div",{className:"name",children:n}),Qt.jsxs("div",{className:"doc",children:[Qt.jsxs("span",{children:[null==s?void 0:s.title," "]}),Qt.jsx("strong",{children:null==s?void 0:s.name})]})]}),Qt.jsxs("div",{className:"nav-btn-area",children:[Qt.jsx("div",{className:"btn-theme",children:g&&Qt.jsx("button",{title:"Alterar entre o tema claro/escuro",className:"btn nav-button",onClick:()=>{const t="light"==d?"dark":"light";p(t),document.body.dataset.bsTheme=t},children:Qt.jsx("i",{className:"fa-solid fa-circle-half-stroke"})})}),l&&Qt.jsx("a",{title:"Abrir ajuda online",className:"btn nav-button",href:l,target:"_blank",children:Qt.jsx(Oe,{})}),Qt.jsxs("div",{className:"btn-atalho",children:[Qt.jsx(a.Link,{to:i.users,className:"nav-button",title:"Configurações do usuário",onClick:()=>v(!1),children:Qt.jsx("i",{className:"fa-solid fa-user-gear"})}),Qt.jsx(a.Link,{to:i.exit,className:"nav-button",title:"Sair do sistema",onClick:()=>v(!1),children:Qt.jsx("i",{className:"fa-solid fa-right-from-bracket"})})]})]})]})]})}),m&&Qt.jsx("div",{id:"menu-background",className:"navbar--menu-background",onClick:function(t){"menu-background"===t.target.id&&O()},children:Qt.jsxs("div",{className:"menu-content",children:[Qt.jsxs("div",{className:"search-area",children:[Qt.jsx("i",{className:"fas fa-search"}),Qt.jsx("input",{ref:h,placeholder:"Pesquisar...",value:y,onChange:t=>_(t.target.value),onKeyDown:function(t){if("Enter"==t.key)for(const e of w)if(e.menus&&0!=e.menus.length){const t=e.menus.find(t=>null!=t.route&&""!=t.route);if(t){c.push(t.route),v(!1);break}}}}),y&&Qt.jsx("button",{className:"text-danger",title:"Limpar pesquisa",onClick:()=>_(""),children:Qt.jsx("i",{className:"fas fa-times"})}),Qt.jsx("button",{title:"Fechar todos os grupos de opções",onClick:()=>N(!1),children:Qt.jsx("i",{className:"fas fa-minus"})}),Qt.jsx("button",{title:"Expandir todos os grupos de opções",onClick:()=>N(!0),children:Qt.jsx("i",{className:"fas fa-plus"})})]}),Qt.jsx("div",{className:"navbar--menu-area",ref:f,children:w.map((t,e)=>Qt.jsx(Rl,{opc:t,closeMenu:O,clickGroup:T,clickFavorite:k,isFavorite:R,enabledFavorite:i.apiFavorites},e))}),Qt.jsx("div",{className:"menu-footer",children:Qt.jsx(a.Link,{to:i.exit,onClick:O,children:Qt.jsxs("div",{className:"user",children:[Qt.jsx("span",{className:"name",title:`Último acesso em ${null==s?void 0:s.lastAccess}`,children:null==s?void 0:s.name}),Qt.jsxs("span",{className:"sair",children:["Sair ",Qt.jsx(Ce,{})]})]})})})]})})]})},t.NavbarMU=function({menusConfig:{brand:t,company:n,menus:o,routes:i,user:s,validatePermis:u}}){const l=e.useRef(),c=e.useRef(),h=a.useHistory(),{theme:f,setTheme:d,canChangeTheme:p}=ee(),[g,m]=e.useState(!1),[v,y]=e.useState(""),[_,w]=e.useState([]),[b,C]=e.useState([]);let A=[];const E=localStorage.getItem(Bl);E&&(A=JSON.parse(E));const[I]=or({url:i.apiFavorites,onTerminated:t=>{t.error?console.info("Erro ao obter lista de favoritos!",t.error):C(t.data)}}),[S]=or({url:i.apiFavorites,method:"patch",onTerminated:t=>{t.error&&console.info("Erro ao salvar favoritos!",t.error)}});function x(){m(!1)}function O(t){let e=[..._],r=[];e.forEach(e=>{e===t&&(e.open=!e.open),e.open||r.push(e.caption)}),localStorage.setItem(Bl,JSON.stringify(r)),w(e)}function T(t){let e=[..._];e.forEach(e=>{(null==e?void 0:e.menus)&&((null==e?void 0:e.stayOpen)?e.open=e.stayOpen:e.open=t)}),w(e),O(null)}function N(t,e){t.stopPropagation(),t.preventDefault();const r=b.filter(t=>t.route!==e.route);var n;r.length===b.length&&r.push({caption:((null==e?void 0:e.prefix)?e.prefix+" / ":"")+e.caption,route:e.route}),n=r,i.apiFavorites&&(S({data:n}),C(n))}function k(t){return b.some(e=>e.route===t)}return e.useEffect(()=>{i.apiFavorites&&I()},[]),e.useEffect(()=>{let t=[];null==b||b.forEach(e=>{o.forEach((r,n)=>{var o;if(n>0&&0!==(null==(o=null==r?void 0:r.menus)?void 0:o.length)){let o=r.menus.findIndex(t=>t.route===e.route);if(o>=0){let i=r.menus[o];t.push({...i,caption:e.caption,index:String(n).padStart(2,"0")+String(o).padStart(2,0)})}}})}),"Favoritos"===o[0].caption&&(o[0].menus=t.sort((t,e)=>t.index>e.index?1:t.index<e.index?-1:0)),w(function(t){let e=[];return t.forEach(t=>{let r={caption:t.caption,open:!A.includes(t.caption)||t.stayOpen,stayOpen:t.stayOpen,isFavorite:null==t?void 0:t.isFavorite,prefix:null==t?void 0:t.prefix,menus:[]};t.menus&&t.menus.length>0&&t.menus.filter(t=>{var e;return(null==t?void 0:t.isLine)||!(null==t?void 0:t.isLine)&&(t.caption.toLowerCase().includes(v.toLowerCase())||(null==(e=t.shortcut)?void 0:e.toLowerCase().includes(v.toLowerCase())))}).forEach(t=>{u(null==t?void 0:t.permis,null==t?void 0:t.acesso)&&r.menus.push({...t,prefix:null==r?void 0:r.prefix})}),v&&(r.open=!0),e.push(r)}),e.forEach(t=>{var e;t.menus&&((null==(e=t.menus[0])?void 0:e.isLine)&&(t.menus=t.menus.filter(t=>!(null==t?void 0:t.isLine))),t.menus=t.menus.filter((t,e,r)=>{var n;return!(e>0&&(null==(n=r[e-1])?void 0:n.isLine)&&t.isLine)}),t.menus=t.menus.filter((t,e,r)=>!(e===r.length-1&&(null==t?void 0:t.isLine))))}),e}(o))},[v,b]),e.useEffect(()=>{var t,e;r.isDesktop()&&(null==(t=null==l?void 0:l.current)||t.select(),null==(e=null==l?void 0:l.current)||e.focus())},[g]),Qt.jsxs(Qt.Fragment,{children:[Qt.jsx("div",{className:"navbar-mu-area",children:Qt.jsxs("div",{className:"mu--container",children:[Qt.jsx(Ml,{isOpen:g,setIsOpen:m}),Qt.jsxs("div",{className:"mu--content",children:[Qt.jsx(Pl,{isOpen:g,setIsOpen:m,brand:t,closeMenu:x,routes:i}),Qt.jsxs("div",{className:"mu--info",children:[Qt.jsx("div",{className:"info-line-1",children:n}),Qt.jsx("div",{className:"info-line-2",children:Qt.jsxs("span",{children:[null==s?void 0:s.title," ",Qt.jsx("strong",{children:null==s?void 0:s.name})]})})]}),Qt.jsxs("div",{className:"mu--buttons",children:[p&&Qt.jsx("button",{title:"Alterar entre o tema claro/escuro",className:"btn nav-button",onClick:()=>{const t="light"==f?"dark":"light";d(t),document.body.dataset.bsTheme=t},children:Qt.jsx("i",{className:"fa-solid fa-circle-half-stroke"})}),Qt.jsx(a.Link,{to:i.users,className:"nav-button btn-users",title:"Configurações do usuário",onClick:()=>m(!1),children:Qt.jsx("i",{className:"fa-solid fa-user-gear"})}),Qt.jsx(a.Link,{to:i.exit,className:"nav-button btn-exit",title:"Sair do sistema",onClick:()=>m(!1),children:Qt.jsx("i",{className:"fa-solid fa-right-from-bracket"})})]})]})]})}),Qt.jsx("div",{"data-open":g,id:"menu-background",className:"nv-menu--background",onClick:function(t){"menu-background"===t.target.id&&x()},children:Qt.jsxs("div",{className:"nv-menu--content","data-open":g,children:[Qt.jsxs("div",{className:"nv-menu--brand",children:[Qt.jsx(Ml,{isOpen:g,setIsOpen:m,menuClose:r.isMobile()}),Qt.jsx(Pl,{isOpen:g,setIsOpen:m,brand:t,closeMenu:x,routes:i,showButtonClose:!0})]}),Qt.jsxs("div",{className:"nv-menu--search",children:[Qt.jsx("i",{className:"fas fa-search"}),Qt.jsx("input",{ref:l,placeholder:"Pesquisar...",value:v,onChange:t=>y(t.target.value),onKeyDown:function(t){if("Enter"==t.key)for(const e of _)if(e.menus&&0!=e.menus.length){const t=e.menus.find(t=>null!=t.route&&""!=t.route);if(t){h.push(t.route),m(!1);break}}}}),v&&Qt.jsx("button",{className:"text-danger",title:"Limpar pesquisa",onClick:function(){var t;y(""),null==(t=null==l?void 0:l.current)||t.focus()},children:Qt.jsx("i",{className:"fas fa-times"})}),Qt.jsx("button",{title:"Fechar todos os grupos de opções",onClick:()=>T(!1),children:Qt.jsx("i",{className:"fas fa-minus"})}),Qt.jsx("button",{title:"Expandir todos os grupos de opções",onClick:()=>T(!0),children:Qt.jsx("i",{className:"fas fa-plus"})})]}),Qt.jsx("div",{className:"nv-menu--opcoes",ref:c,children:_.map((t,e)=>Qt.jsx(Rl,{opc:t,closeMenu:x,clickGroup:O,clickFavorite:N,isFavorite:k,enabledFavorite:i.apiFavorites},e))}),Qt.jsx("div",{className:"nv-menu--footer",children:Qt.jsx(a.Link,{to:i.exit,onClick:x,children:Qt.jsxs("div",{className:"foo-user",children:[Qt.jsx("span",{className:"foo-name",children:null==s?void 0:s.name}),Qt.jsxs("span",{className:"foo-sair",children:["Sair ",Qt.jsx(Ce,{})]})]})})}),Qt.jsxs("div",{className:"nv-menu--copy",children:["Último acesso em ",null==s?void 0:s.lastAccess]})]})})]})},t.Paginacao=function({pages:t,page:r,setPage:n,limitDefault:o=16,limit:i=16,setLimit:a,align:s="center"}){const[u,l]=e.useState([7,o,30,50,100]),c=void 0!==a&&void 0!==i&&void 0!==o;function h(e){var o;e!==r&&e>=1&&e<=t&&(null==(o=document.querySelector("main"))||o.scrollTo(0,0),n(e))}return c&&!u.includes(o)&&l([...u,o].sort((t,e)=>t-e)),Qt.jsx("div",{className:"pgn-content","data-fixed":i>=30?"true":"false","data-align":s,children:Qt.jsxs("div",{className:"pgn-comps",children:[c&&Qt.jsxs("div",{className:"pgn-limit",children:[Qt.jsx("label",{children:"Registros:"}),Qt.jsx("select",{className:"form-select form-select-sm",value:i,onChange:t=>a(Number(t.target.value)),children:u.map(t=>Qt.jsx("option",{value:t,children:t},t))})]}),Qt.jsxs("div",{className:"pgn-pages",children:[Qt.jsx("button",{className:"btn btn-outline-"+(r<=1?"secondary":"info"),title:"Ir para a primeira página",onClick:()=>h(1),disabled:r<=1,children:Qt.jsx("i",{className:"fas fa-angle-double-left"})}),Qt.jsx("button",{className:"btn btn-outline-"+(r<=1?"secondary":"info"),title:"Ir para página anterior",onClick:()=>h(Number(r)-1),disabled:r<=1,children:Qt.jsx("i",{className:"fas fa-angle-left"})}),Qt.jsx("span",{className:"p-2 text-body",children:Qt.jsxs("div",{children:[Qt.jsx("span",{className:"fw-bold",children:r})," / ",Qt.jsx("span",{children:t||"?"})]})}),Qt.jsx("button",{className:"btn btn-outline-"+(r>=t?"secondary":"info"),title:"Ir para próxima página",onClick:()=>h(Number(r)+1),disabled:r>=t,children:Qt.jsx("i",{className:"fas fa-angle-right"})}),Qt.jsx("button",{className:"btn btn-outline-"+(r>=t?"secondary":"info"),title:"Ir para a última página",onClick:()=>h(t),disabled:r>=t,children:Qt.jsx("i",{className:"fas fa-angle-double-right"})})]})]})})},t.Panel=Ge,t.PanelDashboard=function({title:t,color:e="var(--dash-border)",backColor:r="var(--dash-bg)",className:n,minHeight:o,children:i,marginBottom:a=0,...s}){return Qt.jsxs("div",{className:"panel-dashboard--container"+(n?` ${n}`:""),style:{minHeight:o,marginBottom:a,borderColor:e,backgroundColor:r},...s,children:[t&&Qt.jsx("h3",{className:"title",children:t}),i]})},t.PanelHeader=He,t.PrintButtons=function({onClose:t,showTypes:r}){const{reportType:n,setReportType:o}=ee(),i=[{title:"PDF",icon:Qt.jsx("i",{className:"fa-solid fa-file-pdf"}),onClick(){o(0)}},{title:"Excel",icon:Qt.jsx("i",{className:"fa-solid fa-file-excel"}),onClick(){o(1)}},{title:"Word",icon:Qt.jsx("i",{className:"fa-solid fa-file-word"}),onClick(){o(2)}},{title:"Texto",icon:Qt.jsx("i",{className:"fa-regular fa-file-lines"}),onClick(){o(3)}}];return e.useEffect(()=>{r||o(0)},[]),Qt.jsxs("div",{className:"print-btn--container",children:[r&&Qt.jsx(he,{items:i,title:"Formato do relatório",direction:"down",children:Qt.jsxs("span",{className:"d-flex align-items-center gap-1",children:[Qt.jsxs("span",{children:["Formato",Qt.jsx("span",{className:"d-inline-block d-sm-none",children:" do relatório:"})]}),Qt.jsx("span",{className:"me-1",children:["PDF","Excel","Word","Texto"][n]}),Qt.jsx("i",{className:"fa-solid fa-chevron-down ms-auto fs-7"})]})}),Qt.jsxs("div",{className:"print-btn--buttons",children:[Qt.jsxs("button",{className:"btn btn-primary",type:"submit",children:[Qt.jsx("i",{className:"fas fa-print"})," Gerar relatório"]}),Qt.jsxs("button",{className:"btn btn-outline-danger",type:"button",onClick:t,children:[Qt.jsx("i",{className:"fas fa-times"})," Fechar"]})]})]})},t.QRCodeReader=ks,t.RadioGroup=function({className:t="",label:e,name:r,value:n,setValue:o,options:a=[],disabled:s}){return Qt.jsxs("div",{className:"rad-group--container "+t,style:{color:s?"var(--bs-secondary)":"currentColor"},children:[Qt.jsx("div",{className:"group-radio--label",children:e}),Qt.jsx("div",{className:"group-radio--body",children:a.map((t,e)=>Qt.jsxs("label",{children:[Qt.jsx(i.Input,{type:"radio",name:r,checked:Number(n)===e,onChange:()=>o(e),disabled:s}),t]},e))})]})},t.ScrollContainer=function({children:t,hasMaxWidth:e=!0}){return Qt.jsx(_l,{hasMaxWidth:e,children:Qt.jsx("div",{className:"scroll--content",children:t})})},t.TabControl=function({children:t,isMultine:r=!1,className:n="",classNameContent:o="",innerRef:i,...a}){const[s,u]=e.useState([]),l=e.useCallback(t=>{u(e=>{const r=e.findIndex(e=>e.id==(null==t?void 0:t.id));return-1==r?e.push({...bl,...t}):e[r]={...e[r],...t},e.some(t=>t.isVisible&&t.isOpen)||(void 0===(null==t?void 0:t.isVisible)||(null==t?void 0:t.isVisible)?Al(e):function(t,e){let r=t.findIndex(t=>t.id==e.id),n=!1;t.forEach(t=>{t.isOpen=!1});for(let o=r-1;o>=0;o-=1){const e=t[o];if((null==e?void 0:e.isVisible)&&!n){n=!0,e.isOpen=!0;break}}n||Al(t)}(e,t)),[...e]})},[]),c=e.useCallback(t=>{u(e=>e.filter(e=>e.id!=t))},[]),h=e.useCallback(t=>{u(e=>e.map(e=>e.id==t?{...e,isOpen:!0}:{...e,isOpen:!1}))},[]),f=e.useCallback(t=>{u(e=>e.map(e=>e.id==t?{...e,isOpen:!e.isOpen}:e))},[]),d=e.useCallback(t=>s.find(e=>e.id==t),[s]),p=e.useCallback(()=>{u(t=>{const e=t.map(t=>({...t})),r=e.findIndex(t=>t.isVisible&&t.isOpen);return r<0?Al(e):e.forEach((t,e)=>t.isOpen=e==r),e})},[]);return e.useEffect(()=>{function t(){window.innerWidth>=768&&p()}return window.addEventListener("resize",t,null),()=>{window.removeEventListener("resize",t,null)}},[p]),e.useImperativeHandle(i,()=>({open(t){const e=d(t);e&&(null==e?void 0:e.isVisible)&&h(t)}}),[h,d]),Qt.jsx(Cl.Provider,{value:{tabs:s,updateOrInsertTab:l,removeTab:c,findTab:d,selectTab:h,toggleTab:f},children:Qt.jsxs("div",{className:`tab-control--container ${n}`,...a,children:[Qt.jsx(Il,{isMultine:r}),Qt.jsx("div",{className:`tab-control--content ${o}`,children:t})]})})},t.TabSheet=function({tabId:t,title:n,caption:o,isVisible:i=!0,children:a,...s}){const{findTab:u,toggleTab:l,removeTab:c,updateOrInsertTab:h}=El(),f=e.useMemo(()=>t||r.random(999999),[]),d=u(f);return e.useEffect(()=>()=>c(f),[]),e.useEffect(()=>{h({id:f,caption:o,title:n,isVisible:i})},[h,n,o,i]),i?Qt.jsxs(Sl,{open:(null==d?void 0:d.isOpen)&&(null==d?void 0:d.isVisible),"data-in-tab-sheet":null!=d?"true":"false",...s,children:[Qt.jsx("div",{className:"bi-btn-area",children:Qt.jsxs("button",{type:"button",onClick:()=>l(f),children:[n," ",Qt.jsx("i",{className:"fas fa-chevron-down"})]})}),Qt.jsx("div",{className:`bi-body ${(null==d?void 0:d.isOpen)&&"bi-open"}`,children:a})]}):null},t.Table=function({colunas:e,acoes:n,opcoes:o,dados:i,alignTop:a,colorir:s=!0,border:u=!0,sizeBreak:l=767,msgSemDados:c="Nenhum registro encontrado!",getLineColor:h,onClick:f,fixedHeader:d,clickCanEdit:p}){var g,m;e&&e.forEach(t=>{!t.tipo||"money"!=t.tipo&&"currency"!=t.tipo||(t.money=!0)}),void 0===p&&(p=t.hasTableLineClick);let v=!1;const y=(null==(g=null==n?void 0:n.acoes)?void 0:g.map(t=>({...t})))||[];if(n&&n.acoes){const t=null==(m=null==n?void 0:n.acoes)?void 0:m.filter(t=>t.ativa??!0);n.acoes=t,v=n.acoes.length>0}function _(t){const e=window.getSelection();if(e.rangeCount>0){const r=e.getRangeAt(0);if(t.contains(r.commonAncestorContainer)&&e.toString().length>0)return!0}return!1}return i&&0!=i.length?Qt.jsx(le,{children:Qt.jsxs(ce,{alignTop:a,sizeBreak:l,hasBorder:u,children:[Qt.jsx(pe,{fixedHeader:d,colunas:e,incColActions:v}),Qt.jsx(ge,{colunas:e,acoes:n,dados:i,opcoes:o,colorir:s,getLineColor:h,onClick:f||p?function(t,e){if(f){if(_(null==e?void 0:e.currentTarget))return;f(t,e)}else if(p&&r.isDesktop()){if(_(null==e?void 0:e.currentTarget))return;const r=t[(null==n?void 0:n.campo)||"id"];if(null!=r){const e=y[0];e&&!1!==e.ativa&&e.funcao(r,t,0)}}}:void 0})]})}):Qt.jsx("div",{className:"alert alert-warning mb-0",children:c})},t.TextHtml=function({value:t}){return t&&"string"==typeof t&&t.replaceAll("\n","<br/>"),Qt.jsx("span",{dangerouslySetInnerHTML:{__html:t}})},t.Toggle=function({name:t,checked:e,disabled:r,onChange:n,children:o,toRight:i,className:a="",...s}){return Qt.jsx(yl,{checked:e,disabled:r,className:a,...s,children:Qt.jsxs("label",{style:{flexDirection:i?"row-reverse":"row",justifyContent:i?"space-between":"flex-start"},children:[Qt.jsx("div",{className:"form-switch",children:Qt.jsx("input",{disabled:r,type:"checkbox",className:"form-check-input",checked:e,onChange:function(){!r&&n&&n({target:{name:t,checked:!e,value:!e}})}})}),o&&Qt.jsx("span",{className:"title",children:o})]})})},t.cache=Ze,t.createApiConfig=function(t=ue){const e={...ue,...t};return e.auth={...ue.auth,...t.auth},e},t.createDropdownItems=je,t.createMenuOptions=function(t){return t},t.createTableActions=t=>t,t.createTableCols=t=>t,t.createTableOptions=t=>t,t.getAlign=de,t.getDataCol=fe,t.setRouteMain=function(t){We=t},t.setTableLineClick=function(e){t.hasTableLineClick=e},t.useApi=or,t.useLibContext=ee,t.useLocalForage=function(t,r,n=1){const[o,i]=e.useState(r);return e.useEffect(()=>{xl.getItem(t).then(e=>{e&&(e.versao==n?i(e.data):xl.removeItem(t))})},[]),e.useEffect(()=>{xl.setItem(t,{versao:n,data:o})},[o]),[o,i]},t.useLocalStorage=Ol,t.useParamId=function(){let t=0,e=a.useParams();return e&&e.id&&(t=parseInt(e.id)),t},t.useQuery=function(){const{search:t}=a.useLocation();return e.useMemo(()=>new URLSearchParams(t),[t])},t.useSessionStorage=function(t,r){const[n,o]=e.useState(()=>{const e=sessionStorage.getItem(t);return e&&"undefined"!==e&&"null"!==e&&""!==e?JSON.parse(e):r});return e.useEffect(()=>{sessionStorage.setItem(t,JSON.stringify(n))},[n]),[n,o]},Object.defineProperty(t,Symbol.toStringTag,{value:"Module"})});
947
960
  //# sourceMappingURL=jclib-ui.umd.js.map