1/*! For license information please see app.js.LICENSE.txt */ 2(()=>{var e,t={296(){"use strict";!function(){var e=function(){if("function"==typeof window.CustomEvent)return window.CustomEvent;function e(e,t){t=t||{bubbles:!1,cancelable:!1,detail:void 0};var n=document.createEvent("CustomEvent");return n.initCustomEvent(e,t.bubbles,t.cancelable,t.detail),n}return e.prototype=window.Event.prototype,e}();function t(e,t){var n=document.createElement("input");return n.type="hidden",n.name=e,n.value=t,n}function n(e,n){var r=e.getAttribute("data-to"),i=t("_method",e.getAttribute("data-method")),o=t("_csrf_token",e.getAttribute("data-csrf")),s=document.createElement("form"),a=document.createElement("input"),l=e.getAttribute("target");s.method="get"===e.getAttribute("data-method")?"get":"post",s.action=r,s.style.display="none",l?s.target=l:n&&(s.target="_blank"),s.appendChild(o),s.appendChild(i),document.body.appendChild(s),a.type="submit",s.appendChild(a),a.click()}window.addEventListener("click",function(t){var r=t.target;if(!t.defaultPrevented)for(;r&&r.getAttribute;){var i=new e("phoenix.link.click",{bubbles:!0,cancelable:!0});if(!r.dispatchEvent(i))return t.preventDefault(),t.stopImmediatePropagation(),!1;if(r.getAttribute("data-method")&&r.getAttribute("data-to"))return n(r,t.metaKey||t.shiftKey),t.preventDefault(),!1;r=r.parentNode}},!1),window.addEventListener("phoenix.link.click",function(e){var t=e.target.getAttribute("data-confirm");t&&!window.confirm(t)&&e.preventDefault()},!1)}()},97(e,t,n){!function(e){"use strict";function t(e){return null==e}var r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};function i(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}function o(e,t){var n=Object.setPrototypeOf;n?n(e,t):e.__proto__=t}function s(e,t){void 0===t&&(t=e.constructor);var n=Error.captureStackTrace;n&&n(e,t)}var a,l=function(e){function t(t){var n=this.constructor,r=e.call(this,t)||this;return Object.defineProperty(r,"name",{value:n.name,enumerable:!1}),o(r,n.prototype),s(r),r}return i(t,e),t}(Error);class c extends l{constructor(e=void 0){super(e),this.message=e}getKind(){return this.constructor.kind}}c.kind="Exception";class u extends c{}u.kind="ArgumentException";class h extends c{}h.kind="IllegalArgumentException";class d{constructor(e){if(this.binarizer=e,null===e)throw new h("Binarizer must be non-null.")}getWidth(){return this.binarizer.getWidth()}getHeight(){return this.binarizer.getHeight()}getBlackRow(e,t){return this.binarizer.getBlackRow(e,t)}getBlackMatrix(){return null!==this.matrix&&void 0!==this.matrix||(this.matrix=this.binarizer.getBlackMatrix()),this.matrix}isCropSupported(){return this.binarizer.getLuminanceSource().isCropSupported()}crop(e,t,n,r){const i=this.binarizer.getLuminanceSource().crop(e,t,n,r);return new d(this.binarizer.createBinarizer(i))}isRotateSupported(){return this.binarizer.getLuminanceSource().isRotateSupported()}rotateCounterClockwise(){const e=this.binarizer.getLuminanceSource().rotateCounterClockwise();return new d(this.binarizer.createBinarizer(e))}rotateCounterClockwise45(){const e=this.binarizer.getLuminanceSource().rotateCounterClockwise45();return new d(this.binarizer.createBinarizer(e))}toString(){try{return this.getBlackMatrix().toString()}catch(e){return""}}}class f extends c{static getChecksumInstance(){return new f}}f.kind="ChecksumException";class p{constructor(e){this.source=e}getLuminanceSource(){return this.source}getWidth(){return this.source.getWidth()}getHeight(){return this.source.getHeight()}}class g{static arraycopy(e,t,n,r,i){for(;i--;)n[r++]=e[t++]}static currentTimeMillis(){return Date.now()}}class m extends c{}m.kind="IndexOutOfBoundsException";class w extends m{constructor(e=void 0,t=void 0){super(t),this.index=e,this.message=t}}w.kind="ArrayIndexOutOfBoundsException";class y{static fill(e,t){for(let n=0,r=e.length;n<r;n++)e[n]=t}static fillWithin(e,t,n,r){y.rangeCheck(e.length,t,n);for(let i=t;i<n;i++)e[i]=r}static rangeCheck(e,t,n){if(t>n)throw new h("fromIndex("+t+") > toIndex("+n+")");if(t<0)throw new w(t);if(n>e)throw new w(n)}static asList(...e){return e}static create(e,t,n){return Array.from({length:e}).map(e=>Array.from({length:t}).fill(n))}static createInt32Array(e,t,n){return Array.from({length:e}).map(e=>Int32Array.from({length:t}).fill(n))}static equals(e,t){if(!e)return!1;if(!t)return!1;if(!e.length)return!1;if(!t.length)return!1;if(e.length!==t.length)return!1;for(let n=0,r=e.length;n<r;n++)if(e[n]!==t[n])return!1;return!0}static hashCode(e){if(null===e)return 0;let t=1;for(const n of e)t=31*t+n;return t}static fillUint8Array(e,t){for(let n=0;n!==e.length;n++)e[n]=t}static copyOf(e,t){return e.slice(0,t)}static copyOfUint8Array(e,t){if(e.length<=t){const n=new Uint8Array(t);return n.set(e),n}return e.slice(0,t)}static copyOfRange(e,t,n){const r=n-t,i=new Int32Array(r);return g.arraycopy(e,t,i,0,r),i}
vendor: 11,661 bytes, line 2
2static binarySearch(e,t,n){void 0===n&&(n=y.numberComparator);let r=0,i=e.length-1;for(;r<=i;){const o=i+r>>1,s=n(t,e[o]);if(s>0)r=o+1;else{if(!(s<0))return o;i=o-1}}return-r-1}static numberComparator(e,t){return e-t}}class E{static numberOfTrailingZeros(e){let t;if(0===e)return 32;let n=31;return t=e<<16,0!==t&&(n-=16,e=t),t=e<<8,0!==t&&(n-=8,e=t),t=e<<4,0!==t&&(n-=4,e=t),t=e<<2,0!==t&&(n-=2,e=t),n-(e<<1>>>31)}static numberOfLeadingZeros(e){if(0===e)return 32;let t=1;return e>>>16==0&&(t+=16,e<<=16),e>>>24==0&&(t+=8,e<<=8),e>>>28==0&&(t+=4,e<<=4),e>>>30==0&&(t+=2,e<<=2),t-=e>>>31,t}static toHexString(e){return e.toString(16)}static toBinaryString(e){return String(parseInt(String(e),2))}static bitCount(e){return e=(e=(858993459&(e-=e>>>1&1431655765))+(e>>>2&858993459))+(e>>>4)&252645135,e+=e>>>8,63&(e+=e>>>16)}static truncDivision(e,t){return Math.trunc(e/t)}static parseInt(e,t=void 0){return parseInt(e,t)}}E.MIN_VALUE_32_BITS=-2147483648,E.MAX_VALUE=Number.MAX_SAFE_INTEGER;class v{constructor(e,t){void 0===e?(this.size=0,this.bits=new Int32Array(1)):(this.size=e,this.bits=null==t?v.makeArray(e):t)}getSize(){return this.size}getSizeInBytes(){return Math.floor((this.size+7)/8)}ensureCapacity(e){if(e>32*this.bits.length){const t=v.makeArray(e);g.arraycopy(this.bits,0,t,0,this.bits.length),this.bits=t}}get(e){return!!(this.bits[Math.floor(e/32)]&1<<(31&e))}set(e){this.bits[Math.floor(e/32)]|=1<<(31&e)}flip(e){this.bits[Math.floor(e/32)]^=1<<(31&e)}getNextSet(e){const t=this.size;if(e>=t)return t;const n=this.bits;let r=Math.floor(e/32),i=n[r];i&=~((1<<(31&e))-1);const o=n.length;for(;0===i;){if(++r===o)return t;i=n[r]}const s=32*r+E.numberOfTrailingZeros(i);return s>t?t:s}getNextUnset(e){const t=this.size;if(e>=t)return t;const n=this.bits;let r=Math.floor(e/32),i=~n[r];i&=~((1<<(31&e))-1);const o=n.length;for(;0===i;){if(++r===o)return t;i=~n[r]}const s=32*r+E.numberOfTrailingZeros(i);return s>t?t:s}setBulk(e,t){this.bits[Math.floor(e/32)]=t}setRange(e,t){if(t<e||e<0||t>this.size)throw new h;if(t===e)return;t--;const n=Math.floor(e/32),r=Math.floor(t/32),i=this.bits;for(let o=n;o<=r;o++){const s=(2<<(o<r?31:31&t))-(1<<(o>n?0:31&e));i[o]|=s}}clear(){const e=this.bits.length,t=this.bits;for(let n=0;n<e;n++)t[n]=0}isRange(e,t,n){if(t<e||e<0||t>this.size)throw new h;if(t===e)return!0;t--;const r=Math.floor(e/32),i=Math.floor(t/32),o=this.bits;for(let s=r;s<=i;s++){const a=(2<<(s<i?31:31&t))-(1<<(s>r?0:31&e))&4294967295;if((o[s]&a)!==(n?a:0))return!1}return!0}appendBit(e){this.ensureCapacity(this.size+1),e&&(this.bits[Math.floor(this.size/32)]|=1<<(31&this.size)),this.size++}appendBits(e,t){if(t<0||t>32)throw new h("Num bits must be between 0 and 32");this.ensureCapacity(this.size+t);for(let n=t;n>0;n--)this.appendBit(1==(e>>n-1&1))}appendBitArray(e){const t=e.size;this.ensureCapacity(this.size+t);for(let n=0;n<t;n++)this.appendBit(e.get(n))}xor(e){if(this.size!==e.size)throw new h("Sizes don't match");const t=this.bits;for(let n=0,r=t.length;n<r;n++)t[n]^=e.bits[n]}toBytes(e,t,n,r){for(let i=0;i<r;i++){let r=0;for(let t=0;t<8;t++)this.get(e)&&(r|=1<<7-t),e++;t[n+i]=r}}getBitArray(){return this.bits}reverse(){const e=new Int32Array(this.bits.length),t=Math.floor((this.size-1)/32),n=t+1,r=this.bits;for(let i=0;i<n;i++){let n=r[i];n=n>>1&1431655765|(1431655765&n)<<1,n=n>>2&858993459|(858993459&n)<<2,n=n>>4&252645135|(252645135&n)<<4,n=n>>8&16711935|(16711935&n)<<8,n=n>>16&65535|(65535&n)<<16,e[t-i]=n}if(this.size!==32*n){const t=32*n-this.size;let r=e[0]>>>t;for(let i=1;i<n;i++){const n=e[i];r|=n<<32-t,e[i-1]=r,r=n>>>t}e[n-1]=r}this.bits=e}static makeArray(e){return new Int32Array(Math.floor((e+31)/32))}equals(e){if(!(e instanceof v))return!1;const t=e;return this.size===t.size&&y.equals(this.bits,t.bits)}hashCode(){return 31*this.size+y.hashCode(this.bits)}toString(){let e="";for(let t=0,n=this.size;t<n;t++)7&t||(e+=" "),e+=this.get(t)?"X":".";return e}clone(){return new v(this.size,this.bits.slice())}}!function(e){e[e.OTHER=0]="OTHER",e[e.PURE_BARCODE=1]="PURE_BARCODE",e[e.POSSIBLE_FORMATS=2]="POSSIBLE_FORMATS",e[e.TRY_HARDER=3]="TRY_HARDER",e[e.CHARACTER_SET=4]="CHARACTER_SET",e[e.ALLOWED_LENGTHS=5]="ALLOWED_LENGTHS",e[e.ASSUME_CODE_39_CHECK_DIGIT=6]="ASSUME_CODE_39_CHECK_DIGIT",e[e.ASSUME_GS1=7]="ASSUME_GS1",e[e.RETURN_CODABAR_START_END=8]="RETURN_CODABAR_START_END",e[e.NEED_RESULT_POINT_CALLBACK=9]="NEED_RESULT_POINT_CALLBACK",e[e.ALLOWED_EAN_EXTENSIONS=10]="ALLOWED_EAN_EXTENSIONS"}(a||(a={}));var A,C=a;class b extends c{static getFormatInstance(){return new b}}b.kind="FormatException",function(e){e[e.Cp437=0]="Cp437",e[e.ISO8859_1=1]="ISO8859_1",e[e.ISO8859_2=2]="ISO8859_2",e[e.ISO8859_3=3]="ISO8859_3",e[e.ISO8859_4=4]="ISO8859_4",e[e.ISO8859_5=5]="ISO8859_5",e[e.ISO8859_6=6]="ISO8859_6",e[e.ISO8859_7=7]="ISO8859_7",e[e.ISO8859_8=8]="ISO8859_8",e[e.ISO8859_9=9]="ISO8859_9",e[e.ISO8859_10=10]="ISO8859_10",e[e.ISO8859_11=11]="ISO8859_11",e[e.ISO8859_13=12]="ISO8859_13",e[e.ISO8859_14=13]="ISO8859_14",e[e.ISO8859_15=14]="ISO8859_15",e[e.ISO8859_16=15]="ISO8859_16",e[e.SJIS=16]="SJIS",e[e.Cp1250=17]="Cp1250",e[e.Cp1251=18]="Cp1251",e[e.Cp1252=19]="Cp1252",e[e.Cp1256=20]="Cp1256",e[e.UnicodeBigUnmarked=21]="UnicodeBigUnmarked",e[e.UTF8=22]="UTF8",e[e.ASCII=23]="ASCII",e[e.Big5=24]="Big5",e[e.GB18030=25]="GB18030",e[e.EUC_KR=26]="EUC_KR"}(A||(A={}));class _{constructor(e,t,n,...r){this.valueIdentifier=e,this.name=n,this.values="number"==typeof t?Int32Array.from([t]):t,this.otherEncodingNames=r,_.VALUE_IDENTIFIER_TO_ECI.set(e,this),_.NAME_TO_ECI.set(n,this);const i=this.values;for(let e=0,t=i.length;e!==t;e++){const t=i[e];_.VALUES_TO_ECI.set(t,this)}for(const e of r)_.NAME_TO_ECI.set(e,this)}getValueIdentifier(){return this.valueIdentifier}getName(){return this.name}getValue(){return this.values[0]}static getCharacterSetECIByValue(e){if(e<0||e>=900)throw new b("incorect value");const t=_.VALUES_TO_ECI.get(e);if(void 0===t)throw new b("incorect value");return t}static getCharacterSetECIByName(e){const t=_.NAME_TO_ECI.get(e);if(void 0===t)throw new b("incorect value");return t}equals(e){if(!(e instanceof _))return!1;const t=e;return this.getName()===t.getName()}}_.VALUE_IDENTIFIER_TO_ECI=new Map,_.VALUES_TO_ECI=new Map,_.NAME_TO_ECI=new Map,_.Cp437=new _(A.Cp437,Int32Array.from([0,2]),"Cp437"),_.ISO8859_1=new _(A.ISO8859_1,Int32Array.from([1,3]),"ISO-8859-1","ISO88591","ISO8859_1"),_.ISO8859_2=new _(A.ISO8859_2,4,"ISO-8859-2","ISO88592","ISO8859_2"),_.ISO8859_3=new _(A.ISO8859_3,5,"ISO-8859-3","ISO88593","ISO8859_3"),_.ISO8859_4=new _(A.ISO8859_4,6,"ISO-8859-4","ISO88594","ISO8859_4"),_.ISO8859_5=new _(A.ISO8859_5,7,"ISO-8859-5","ISO88595","ISO8859_5"),_.ISO8859_6=new _(A.ISO8859_6,8,"ISO-8859-6","ISO88596","ISO8859_6"),_.ISO8859_7=new _(A.ISO8859_7,9,"ISO-8859-7","ISO88597","ISO8859_7"),_.ISO8859_8=new _(A.ISO8859_8,10,"ISO-8859-8","ISO88598","ISO8859_8"),_.ISO8859_9=new _(A.ISO8859_9,11,"ISO-8859-9","ISO88599","ISO8859_9"),_.ISO8859_10=new _(A.ISO8859_10,12,"ISO-8859-10","ISO885910","ISO8859_10"),_.ISO8859_11=new _(A.ISO8859_11,13,"ISO-8859-11","ISO885911","ISO8859_11"),_.ISO8859_13=new _(A.ISO8859_13,15,"ISO-8859-13","ISO885913","ISO8859_13"),_.ISO8859_14=new _(A.ISO8859_14,16,"ISO-8859-14","ISO885914","ISO8859_14"),_.ISO8859_15=new _(A.ISO8859_15,17,"ISO-8859-15","ISO885915","ISO8859_15"),_.ISO8859_16=new _(A.ISO8859_16,18,"ISO-8859-16","ISO885916","ISO8859_16"),_.SJIS=new _(A.SJIS,20,"SJIS","Shift_JIS"),_.Cp1250=new _(A.Cp1250,21,"Cp1250","windows-1250"),_.Cp1251=new _(A.Cp1251,22,"Cp1251","windows-1251"),_.Cp1252=new _(A.Cp1252,23,"Cp1252","windows-1252"),_.Cp1256=new _(A.Cp1256,24,"Cp1256","windows-1256"),_.UnicodeBigUnmarked=new _(A.UnicodeBigUnmarked,25,"UnicodeBigUnmarked","UTF-16BE","UnicodeBig"),_.UTF8=new _(A.UTF8,26,"UTF8","UTF-8"),_.ASCII=new _(A.ASCII,Int32Array.from([27,170]),"ASCII","US-ASCII"),_.Big5=new _(A.Big5,28,"Big5"),_.GB18030=new _(A.GB18030,29,"GB18030","GB2312","EUC_CN","GBK"),_.EUC_KR=new _(A.EUC_KR,30,"EUC_KR","EUC-KR");class S extends c{}S.kind="UnsupportedOperationException";class I{static decode(e,t){const n=this.encodingName(t);return this.customDecoder?this.customDecoder(e,n):"undefined"==typeof TextDecoder||this.shouldDecodeOnFallback(n)?this.decodeFallback(e,n):new TextDecoder(n).decode(e)}static shouldDecodeOnFallback(e){return!I.isBrowser()&&"ISO-8859-1"===e}static encode(e,t){const n=this.encodingName(t);return this.customEncoder?this.customEncoder(e,n):"undefined"==typeof TextEncoder?this.encodeFallback(e):(new TextEncoder).encode(e)}static isBrowser(){return"undefined"!=typeof window&&"[object Window]"==={}.toString.call(window)}static encodingName(e){return"string"==typeof e?e:e.getName()}static encodingCharacterSet(e){return e instanceof _?e:_.getCharacterSetECIByName(e)}static decodeFallback(e,t){const n=this.encodingCharacterSet(t);if(I.isDecodeFallbackSupported(n)){let t="";for(let n=0,r=e.length;n<r;n++){let r=e[n].toString(16);r.length<2&&(r="0"+r),t+="%"+r}return decodeURIComponent(t)}if(n.equals(_.UnicodeBigUnmarked))return String.fromCharCode.apply(null,new Uint16Array(e.buffer));throw new S(`Encoding ${this.encodingName(t)} not supported by fallback.`)}static isDecodeFallbackSupported(e){return e.equals(_.UTF8)||e.equals(_.ISO8859_1)||e.equals(_.ASCII)}static encodeFallback(e){const t=btoa(unescape(encodeURIComponent(e))).split(""),n=[];for(let e=0;e<t.length;e++)n.push(t[e].charCodeAt(0));return new Uint8Array(n)}}class T{static castAsNonUtf8Char(e,t=null){const n=t?t.getName():this.ISO88591;return I.decode(new Uint8Array([e]),n)}static guessEncoding(e,t){if(null!=t&&void 0!==t.get(C.CHARACTER_SET))return t.get(C.CHARACTER_SET).toString();const n=e.length;let r=!0,i=!0,o=!0,s=0,a=0,l=0,c=0,u=0,h=0,d=0,f=0,p=0,g=0,m=0;const w=e.length>3&&239===e[0]&&187===e[1]&&191===e[2];for(let t=0;t<n&&(r||i||o);t++){const n=255&e[t];o&&(s>0?128&n?s--:o=!1:128&n&&(64&n?(s++,32&n?(s++,16&n?(s++,8&n?o=!1:c++):l++):a++):o=!1)),r&&(n>127&&n<160?r=!1:n>159&&(n<192||215===n||247===n)&&m++),i&&(u>0?n<64||127===n||n>252?i=!1:u--:128===n||160===n||n>239?i=!1:n>160&&n<224?(h++,f=0,d++,d>p&&(p=d)):n>127?(u++,d=0,f++,f>g&&(g=f)):(d=0,f=0))}return o&&s>0&&(o=!1),i&&u>0&&(i=!1),o&&(w||a+l+c>0)?T.UTF8:i&&(T.ASSUME_SHIFT_JIS||p>=3||g>=3)?T.SHIFT_JIS:r&&i?2===p&&2===h||10*m>=n?T.SHIFT_JIS:T.ISO88591:r?T.ISO88591:i?T.SHIFT_JIS:o?T.UTF8:T.PLATFORM_DEFAULT_ENCODING}static format(e,...t){let n=-1;function r(e,r,i,o,s,a){if("%%"===e)return"%";if(void 0===t[++n])return;e=o?parseInt(o.substr(1)):void 0;let l,c=s?parseInt(s.substr(1)):void 0;switch(a){case"s":l=t[n];break;case"c":l=t[n][0];break;case"f":l=parseFloat(t[n]).toFixed(e);break;case"p":l=parseFloat(t[n]).toPrecision(e);break;case"e":l=parseFloat(t[n]).toExponential(e);break;case"x":l=parseInt(t[n]).toString(c||16);break;case"d":l=parseFloat(parseInt(t[n],c||10).toPrecision(e)).toFixed(0)}l="object"==typeof l?JSON.stringify(l):(+l).toString(c);let u=parseInt(i),h=i&&i[0]+""=="0"?"0":" ";for(;l.length<u;)l=void 0!==r?l+h:h+l;return l}let i=/%(-)?(0?[0-9]+)?([.][0-9]+)?([#][0-9]+)?([scfpexd%])/g;return e.replace(i,r)}static getBytes(e,t){return I.encode(e,t)}static getCharCode(e,t=0){return e.charCodeAt(t)}static getCharAt(e){return String.fromCharCode(e)}}T.SHIFT_JIS=_.SJIS.getName(),T.GB2312="GB2312",T.ISO88591=_.ISO8859_1.getName(),T.EUC_JP="EUC_JP",T.UTF8=_.UTF8.getName(),T.PLATFORM_DEFAULT_ENCODING=T.UTF8,T.ASSUME_SHIFT_JIS=!1;class D{constructor(e=""){this.value=e}enableDecoding(e){return this.encoding=e,this}append(e){return"string"==typeof e?this.value+=e.toString():this.encoding?this.value+=T.castAsNonUtf8Char(e,this.encoding):this.value+=String.fromCharCode(e),this}
vendor: 10,114 bytes, line 2
2appendChars(e,t,n){for(let r=t;t<t+n;r++)this.append(e[r]);return this}length(){return this.value.length}charAt(e){return this.value.charAt(e)}deleteCharAt(e){this.value=this.value.substr(0,e)+this.value.substring(e+1)}setCharAt(e,t){this.value=this.value.substr(0,e)+t+this.value.substr(e+1)}substring(e,t){return this.value.substring(e,t)}setLengthToZero(){this.value=""}toString(){return this.value}insert(e,t){this.value=this.value.substr(0,e)+t+this.value.substr(e+t.length)}}class N{constructor(e,t,n,r){if(this.width=e,this.height=t,this.rowSize=n,this.bits=r,null==t&&(t=e),this.height=t,e<1||t<1)throw new h("Both dimensions must be greater than 0");null==n&&(n=Math.floor((e+31)/32)),this.rowSize=n,null==r&&(this.bits=new Int32Array(this.rowSize*this.height))}static parseFromBooleanArray(e){const t=e.length,n=e[0].length,r=new N(n,t);for(let i=0;i<t;i++){const t=e[i];for(let e=0;e<n;e++)t[e]&&r.set(e,i)}return r}static parseFromString(e,t,n){if(null===e)throw new h("stringRepresentation cannot be null");const r=new Array(e.length);let i=0,o=0,s=-1,a=0,l=0;for(;l<e.length;)if("\n"===e.charAt(l)||"\r"===e.charAt(l)){if(i>o){if(-1===s)s=i-o;else if(i-o!==s)throw new h("row lengths do not match");o=i,a++}l++}else if(e.substring(l,l+t.length)===t)l+=t.length,r[i]=!0,i++;else{if(e.substring(l,l+n.length)!==n)throw new h("illegal character encountered: "+e.substring(l));l+=n.length,r[i]=!1,i++}if(i>o){if(-1===s)s=i-o;else if(i-o!==s)throw new h("row lengths do not match");a++}const c=new N(s,a);for(let e=0;e<i;e++)r[e]&&c.set(Math.floor(e%s),Math.floor(e/s));return c}get(e,t){const n=t*this.rowSize+Math.floor(e/32);return!!(this.bits[n]>>>(31&e)&1)}set(e,t){const n=t*this.rowSize+Math.floor(e/32);this.bits[n]|=1<<(31&e)&4294967295}unset(e,t){const n=t*this.rowSize+Math.floor(e/32);this.bits[n]&=~(1<<(31&e)&4294967295)}flip(e,t){const n=t*this.rowSize+Math.floor(e/32);this.bits[n]^=1<<(31&e)&4294967295}xor(e){if(this.width!==e.getWidth()||this.height!==e.getHeight()||this.rowSize!==e.getRowSize())throw new h("input matrix dimensions do not match");const t=new v(Math.floor(this.width/32)+1),n=this.rowSize,r=this.bits;for(let i=0,o=this.height;i<o;i++){const o=i*n,s=e.getRow(i,t).getBitArray();for(let e=0;e<n;e++)r[o+e]^=s[e]}}clear(){const e=this.bits,t=e.length;for(let n=0;n<t;n++)e[n]=0}setRegion(e,t,n,r){if(t<0||e<0)throw new h("Left and top must be nonnegative");if(r<1||n<1)throw new h("Height and width must be at least 1");const i=e+n,o=t+r;if(o>this.height||i>this.width)throw new h("The region must fit inside the matrix");const s=this.rowSize,a=this.bits;for(let n=t;n<o;n++){const t=n*s;for(let n=e;n<i;n++)a[t+Math.floor(n/32)]|=1<<(31&n)&4294967295}}getRow(e,t){null==t||t.getSize()<this.width?t=new v(this.width):t.clear();const n=this.rowSize,r=this.bits,i=e*n;for(let e=0;e<n;e++)t.setBulk(32*e,r[i+e]);return t}setRow(e,t){g.arraycopy(t.getBitArray(),0,this.bits,e*this.rowSize,this.rowSize)}rotate180(){const e=this.getWidth(),t=this.getHeight();let n=new v(e),r=new v(e);for(let e=0,i=Math.floor((t+1)/2);e<i;e++)n=this.getRow(e,n),r=this.getRow(t-1-e,r),n.reverse(),r.reverse(),this.setRow(e,r),this.setRow(t-1-e,n)}getEnclosingRectangle(){const e=this.width,t=this.height,n=this.rowSize,r=this.bits;let i=e,o=t,s=-1,a=-1;for(let e=0;e<t;e++)for(let t=0;t<n;t++){const l=r[e*n+t];if(0!==l){if(e<o&&(o=e),e>a&&(a=e),32*t<i){let e=0;for(;!(l<<31-e&4294967295);)e++;32*t+e<i&&(i=32*t+e)}if(32*t+31>s){let e=31;for(;l>>>e===0;)e--;32*t+e>s&&(s=32*t+e)}}}return s<i||a<o?null:Int32Array.from([i,o,s-i+1,a-o+1])}getTopLeftOnBit(){const e=this.rowSize,t=this.bits;let n=0;for(;n<t.length&&0===t[n];)n++;if(n===t.length)return null;const r=n/e;let i=n%e*32;const o=t[n];let s=0;for(;!(o<<31-s&4294967295);)s++;return i+=s,Int32Array.from([i,r])}getBottomRightOnBit(){const e=this.rowSize,t=this.bits;let n=t.length-1;for(;n>=0&&0===t[n];)n--;if(n<0)return null;const r=Math.floor(n/e);let i=32*Math.floor(n%e);const o=t[n];let s=31;for(;o>>>s===0;)s--;return i+=s,Int32Array.from([i,r])}getWidth(){return this.width}getHeight(){return this.height}getRowSize(){return this.rowSize}equals(e){if(!(e instanceof N))return!1;const t=e;return this.width===t.width&&this.height===t.height&&this.rowSize===t.rowSize&&y.equals(this.bits,t.bits)}hashCode(){let e=this.width;return e=31*e+this.width,e=31*e+this.height,e=31*e+this.rowSize,e=31*e+y.hashCode(this.bits),e}toString(e="X ",t=" ",n="\n"){return this.buildToString(e,t,n)}buildToString(e,t,n){let r=new D;for(let i=0,o=this.height;i<o;i++){for(let n=0,o=this.width;n<o;n++)r.append(this.get(n,i)?e:t);r.append(n)}return r.toString()}clone(){return new N(this.width,this.height,this.rowSize,this.bits.slice())}}class O extends c{static getNotFoundInstance(){return new O}}O.kind="NotFoundException";class R extends p{constructor(e){super(e),this.luminances=R.EMPTY,this.buckets=new Int32Array(R.LUMINANCE_BUCKETS)}getBlackRow(e,t){const n=this.getLuminanceSource(),r=n.getWidth();null==t||t.getSize()<r?t=new v(r):t.clear(),this.initArrays(r);const i=n.getRow(e,this.luminances),o=this.buckets;for(let e=0;e<r;e++)o[(255&i[e])>>R.LUMINANCE_SHIFT]++;const s=R.estimateBlackPoint(o);if(r<3)for(let e=0;e<r;e++)(255&i[e])<s&&t.set(e);else{let e=255&i[0],n=255&i[1];for(let o=1;o<r-1;o++){const r=255&i[o+1];(4*n-e-r)/2<s&&t.set(o),e=n,n=r}}return t}getBlackMatrix(){const e=this.getLuminanceSource(),t=e.getWidth(),n=e.getHeight(),r=new N(t,n);this.initArrays(t);const i=this.buckets;for(let r=1;r<5;r++){const o=Math.floor(n*r/5),s=e.getRow(o,this.luminances),a=Math.floor(4*t/5);for(let e=Math.floor(t/5);e<a;e++)i[(255&s[e])>>R.LUMINANCE_SHIFT]++}const o=R.estimateBlackPoint(i),s=e.getMatrix();for(let e=0;e<n;e++){const n=e*t;for(let i=0;i<t;i++)(255&s[n+i])<o&&r.set(i,e)}return r}createBinarizer(e){return new R(e)}initArrays(e){this.luminances.length<e&&(this.luminances=new Uint8ClampedArray(e));const t=this.buckets;for(let e=0;e<R.LUMINANCE_BUCKETS;e++)t[e]=0}static estimateBlackPoint(e){const t=e.length;let n=0,r=0,i=0;for(let o=0;o<t;o++)e[o]>i&&(r=o,i=e[o]),e[o]>n&&(n=e[o]);let o=0,s=0;for(let n=0;n<t;n++){const t=n-r,i=e[n]*t*t;i>s&&(o=n,s=i)}if(r>o){const e=r;r=o,o=e}if(o-r<=t/16)throw new O;let a=o-1,l=-1;for(let t=o-1;t>r;t--){const i=t-r,s=i*i*(o-t)*(n-e[t]);s>l&&(a=t,l=s)}return a<<R.LUMINANCE_SHIFT}}R.LUMINANCE_BITS=5,R.LUMINANCE_SHIFT=8-R.LUMINANCE_BITS,R.LUMINANCE_BUCKETS=1<<R.LUMINANCE_BITS,R.EMPTY=Uint8ClampedArray.from([0]);class M extends R{constructor(e){super(e),this.matrix=null}getBlackMatrix(){if(null!==this.matrix)return this.matrix;const e=this.getLuminanceSource(),t=e.getWidth(),n=e.getHeight();if(t>=M.MINIMUM_DIMENSION&&n>=M.MINIMUM_DIMENSION){const r=e.getMatrix();let i=t>>M.BLOCK_SIZE_POWER;0!==(t&M.BLOCK_SIZE_MASK)&&i++;let o=n>>M.BLOCK_SIZE_POWER;0!==(n&M.BLOCK_SIZE_MASK)&&o++;const s=M.calculateBlackPoints(r,i,o,t,n),a=new N(t,n);M.calculateThresholdForBlock(r,i,o,t,n,s,a),this.matrix=a}else this.matrix=super.getBlackMatrix();return this.matrix}createBinarizer(e){return new M(e)}static calculateThresholdForBlock(e,t,n,r,i,o,s){const a=i-M.BLOCK_SIZE,l=r-M.BLOCK_SIZE;for(let i=0;i<n;i++){let c=i<<M.BLOCK_SIZE_POWER;c>a&&(c=a);const u=M.cap(i,2,n-3);for(let n=0;n<t;n++){let i=n<<M.BLOCK_SIZE_POWER;i>l&&(i=l);const a=M.cap(n,2,t-3);let h=0;for(let e=-2;e<=2;e++){const t=o[u+e];h+=t[a-2]+t[a-1]+t[a]+t[a+1]+t[a+2]}const d=h/25;M.thresholdBlock(e,i,c,d,r,s)}}}static cap(e,t,n){return e<t?t:e>n?n:e}static thresholdBlock(e,t,n,r,i,o){for(let s=0,a=n*i+t;s<M.BLOCK_SIZE;s++,a+=i)for(let i=0;i<M.BLOCK_SIZE;i++)(255&e[a+i])<=r&&o.set(t+i,n+s)}static calculateBlackPoints(e,t,n,r,i){const o=i-M.BLOCK_SIZE,s=r-M.BLOCK_SIZE,a=new Array(n);for(let i=0;i<n;i++){a[i]=new Int32Array(t);let n=i<<M.BLOCK_SIZE_POWER;n>o&&(n=o);for(let o=0;o<t;o++){let t=o<<M.BLOCK_SIZE_POWER;t>s&&(t=s);let l=0,c=255,u=0;for(let i=0,o=n*r+t;i<M.BLOCK_SIZE;i++,o+=r){for(let t=0;t<M.BLOCK_SIZE;t++){const n=255&e[o+t];l+=n,n<c&&(c=n),n>u&&(u=n)}if(u-c>M.MIN_DYNAMIC_RANGE)for(i++,o+=r;i<M.BLOCK_SIZE;i++,o+=r)for(let t=0;t<M.BLOCK_SIZE;t++)l+=255&e[o+t]}let h=l>>2*M.BLOCK_SIZE_POWER;if(u-c<=M.MIN_DYNAMIC_RANGE&&(h=c/2,i>0&&o>0)){const e=(a[i-1][o]+2*a[i][o-1]+a[i-1][o-1])/4;c<e&&(h=e)}a[i][o]=h}}return a}}M.BLOCK_SIZE_POWER=3,M.BLOCK_SIZE=1<<M.BLOCK_SIZE_POWER,M.BLOCK_SIZE_MASK=M.BLOCK_SIZE-1,M.MINIMUM_DIMENSION=5*M.BLOCK_SIZE,M.MIN_DYNAMIC_RANGE=24;class P{constructor(e,t){this.width=e,this.height=t}getWidth(){return this.width}getHeight(){return this.height}isCropSupported(){return!1}crop(e,t,n,r){throw new S("This luminance source does not support cropping.")}isRotateSupported(){return!1}rotateCounterClockwise(){throw new S("This luminance source does not support rotation by 90 degrees.")}rotateCounterClockwise45(){throw new S("This luminance source does not support rotation by 45 degrees.")}toString(){const e=new Uint8ClampedArray(this.width);let t=new D;for(let n=0;n<this.height;n++){const r=this.getRow(n,e);for(let e=0;e<this.width;e++){const n=255&r[e];let i;i=n<64?"#":n<128?"+":n<192?".":" ",t.append(i)}t.append("\n")}return t.toString()}}class k extends P{constructor(e){super(e.getWidth(),e.getHeight()),this.delegate=e}getRow(e,t){const n=this.delegate.getRow(e,t),r=this.getWidth();for(let e=0;e<r;e++)n[e]=255-(255&n[e]);return n}getMatrix(){const e=this.delegate.getMatrix(),t=this.getWidth()*this.getHeight(),n=new Uint8ClampedArray(t);for(let r=0;r<t;r++)n[r]=255-(255&e[r]);return n}isCropSupported(){return this.delegate.isCropSupported()}crop(e,t,n,r){return new k(this.delegate.crop(e,t,n,r))}isRotateSupported(){return this.delegate.isRotateSupported()}invert(){return this.delegate}rotateCounterClockwise(){return new k(this.delegate.rotateCounterClockwise())}rotateCounterClockwise45(){return new k(this.delegate.rotateCounterClockwise45())}}class x extends P{constructor(e){super(e.width,e.height),this.canvas=e,this.tempCanvasElement=null,this.buffer=x.makeBufferFromCanvasImageData(e)}static makeBufferFromCanvasImageData(e){const t=e.getContext("2d").getImageData(0,0,e.width,e.height);return x.toGrayscaleBuffer(t.data,e.width,e.height)}
vendor: 8,805 bytes, line 2
2static toGrayscaleBuffer(e,t,n){const r=new Uint8ClampedArray(t*n);for(let t=0,n=0,i=e.length;t<i;t+=4,n++){let i;i=0===e[t+3]?255:306*e[t]+601*e[t+1]+117*e[t+2]+512>>10,r[n]=i}return r}getRow(e,t){if(e<0||e>=this.getHeight())throw new h("Requested row is outside the image: "+e);const n=this.getWidth(),r=e*n;return null===t?t=this.buffer.slice(r,r+n):(t.length<n&&(t=new Uint8ClampedArray(n)),t.set(this.buffer.slice(r,r+n))),t}getMatrix(){return this.buffer}isCropSupported(){return!0}crop(e,t,n,r){return super.crop(e,t,n,r),this}isRotateSupported(){return!0}rotateCounterClockwise(){return this.rotate(-90),this}rotateCounterClockwise45(){return this.rotate(-45),this}getTempCanvasElement(){if(null===this.tempCanvasElement){const e=this.canvas.ownerDocument.createElement("canvas");e.width=this.canvas.width,e.height=this.canvas.height,this.tempCanvasElement=e}return this.tempCanvasElement}rotate(e){const t=this.getTempCanvasElement(),n=t.getContext("2d"),r=e*x.DEGREE_TO_RADIANS,i=this.canvas.width,o=this.canvas.height,s=Math.ceil(Math.abs(Math.cos(r))*i+Math.abs(Math.sin(r))*o),a=Math.ceil(Math.abs(Math.sin(r))*i+Math.abs(Math.cos(r))*o);return t.width=s,t.height=a,n.translate(s/2,a/2),n.rotate(r),n.drawImage(this.canvas,i/-2,o/-2),this.buffer=x.makeBufferFromCanvasImageData(t),this}invert(){return new k(this)}}x.DEGREE_TO_RADIANS=Math.PI/180;class L{constructor(e,t,n){this.deviceId=e,this.label=t,this.kind="videoinput",this.groupId=n||void 0}toJSON(){return{kind:this.kind,groupId:this.groupId,deviceId:this.deviceId,label:this.label}}}var B,F=(globalThis||n.g||self||window?(globalThis||n.g||self||window||void 0).__awaiter:void 0)||function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||(n=Promise))(function(n,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){e.done?n(e.value):i(e.value).then(s,a)}l((r=r.apply(e,t||[])).next())})};class U{constructor(e,t=500,n){this.reader=e,this.timeBetweenScansMillis=t,this._hints=n,this._stopContinuousDecode=!1,this._stopAsyncDecode=!1,this._timeBetweenDecodingAttempts=0}get hasNavigator(){return"undefined"!=typeof navigator}get isMediaDevicesSuported(){return this.hasNavigator&&!!navigator.mediaDevices}get canEnumerateDevices(){return!(!this.isMediaDevicesSuported||!navigator.mediaDevices.enumerateDevices)}get timeBetweenDecodingAttempts(){return this._timeBetweenDecodingAttempts}set timeBetweenDecodingAttempts(e){this._timeBetweenDecodingAttempts=e<0?0:e}set hints(e){this._hints=e||null}get hints(){return this._hints}listVideoInputDevices(){return F(this,void 0,void 0,function*(){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.");const e=yield navigator.mediaDevices.enumerateDevices(),t=[];for(const n of e){const e="video"===n.kind?"videoinput":n.kind;if("videoinput"!==e)continue;const r={deviceId:n.deviceId||n.id,label:n.label||`Video device ${t.length+1}`,kind:e,groupId:n.groupId};t.push(r)}return t})}getVideoInputDevices(){return F(this,void 0,void 0,function*(){return(yield this.listVideoInputDevices()).map(e=>new L(e.deviceId,e.label))})}findDeviceById(e){return F(this,void 0,void 0,function*(){const t=yield this.listVideoInputDevices();return t?t.find(t=>t.deviceId===e):null})}decodeFromInputVideoDevice(e,t){return F(this,void 0,void 0,function*(){return yield this.decodeOnceFromVideoDevice(e,t)})}decodeOnceFromVideoDevice(e,t){return F(this,void 0,void 0,function*(){let n;this.reset(),n=e?{deviceId:{exact:e}}:{facingMode:"environment"};const r={video:n};return yield this.decodeOnceFromConstraints(r,t)})}decodeOnceFromConstraints(e,t){return F(this,void 0,void 0,function*(){const n=yield navigator.mediaDevices.getUserMedia(e);return yield this.decodeOnceFromStream(n,t)})}decodeOnceFromStream(e,t){return F(this,void 0,void 0,function*(){this.reset();const n=yield this.attachStreamToVideo(e,t);return yield this.decodeOnce(n)})}decodeFromInputVideoDeviceContinuously(e,t,n){return F(this,void 0,void 0,function*(){return yield this.decodeFromVideoDevice(e,t,n)})}decodeFromVideoDevice(e,t,n){return F(this,void 0,void 0,function*(){let r;r=e?{deviceId:{exact:e}}:{facingMode:"environment"};const i={video:r};return yield this.decodeFromConstraints(i,t,n)})}decodeFromConstraints(e,t,n){return F(this,void 0,void 0,function*(){const r=yield navigator.mediaDevices.getUserMedia(e);return yield this.decodeFromStream(r,t,n)})}decodeFromStream(e,t,n){return F(this,void 0,void 0,function*(){this.reset();const r=yield this.attachStreamToVideo(e,t);return yield this.decodeContinuously(r,n)})}stopAsyncDecode(){this._stopAsyncDecode=!0}stopContinuousDecode(){this._stopContinuousDecode=!0}attachStreamToVideo(e,t){return F(this,void 0,void 0,function*(){const n=this.prepareVideoElement(t);return this.addVideoSource(n,e),this.videoElement=n,this.stream=e,yield this.playVideoOnLoadAsync(n),n})}playVideoOnLoadAsync(e){return new Promise((t,n)=>this.playVideoOnLoad(e,()=>t()))}playVideoOnLoad(e,t){this.videoEndedListener=()=>this.stopStreams(),this.videoCanPlayListener=()=>this.tryPlayVideo(e),e.addEventListener("ended",this.videoEndedListener),e.addEventListener("canplay",this.videoCanPlayListener),e.addEventListener("playing",t),this.tryPlayVideo(e)}isVideoPlaying(e){return e.currentTime>0&&!e.paused&&!e.ended&&e.readyState>2}tryPlayVideo(e){return F(this,void 0,void 0,function*(){if(this.isVideoPlaying(e))console.warn("Trying to play video that is already playing.");else try{yield e.play()}catch(e){console.warn("It was not possible to play the video.")}})}getMediaElement(e,t){const n=document.getElementById(e);if(!n)throw new u(`element with id '${e}' not found`);if(n.nodeName.toLowerCase()!==t.toLowerCase())throw new u(`element with id '${e}' must be an ${t} element`);return n}decodeFromImage(e,t){if(!e&&!t)throw new u("either imageElement with a src set or an url must be provided");return t&&!e?this.decodeFromImageUrl(t):this.decodeFromImageElement(e)}decodeFromVideo(e,t){if(!e&&!t)throw new u("Either an element with a src set or an URL must be provided");return t&&!e?this.decodeFromVideoUrl(t):this.decodeFromVideoElement(e)}decodeFromVideoContinuously(e,t,n){if(void 0===e&&void 0===t)throw new u("Either an element with a src set or an URL must be provided");return t&&!e?this.decodeFromVideoUrlContinuously(t,n):this.decodeFromVideoElementContinuously(e,n)}decodeFromImageElement(e){if(!e)throw new u("An image element must be provided.");this.reset();const t=this.prepareImageElement(e);let n;return this.imageElement=t,n=this.isImageLoaded(t)?this.decodeOnce(t,!1,!0):this._decodeOnLoadImage(t),n}decodeFromVideoElement(e){const t=this._decodeFromVideoElementSetup(e);return this._decodeOnLoadVideo(t)}decodeFromVideoElementContinuously(e,t){const n=this._decodeFromVideoElementSetup(e);return this._decodeOnLoadVideoContinuously(n,t)}_decodeFromVideoElementSetup(e){if(!e)throw new u("A video element must be provided.");this.reset();const t=this.prepareVideoElement(e);return this.videoElement=t,t}decodeFromImageUrl(e){if(!e)throw new u("An URL must be provided.");this.reset();const t=this.prepareImageElement();this.imageElement=t;const n=this._decodeOnLoadImage(t);return t.src=e,n}decodeFromVideoUrl(e){if(!e)throw new u("An URL must be provided.");this.reset();const t=this.prepareVideoElement(),n=this.decodeFromVideoElement(t);return t.src=e,n}decodeFromVideoUrlContinuously(e,t){if(!e)throw new u("An URL must be provided.");this.reset();const n=this.prepareVideoElement(),r=this.decodeFromVideoElementContinuously(n,t);return n.src=e,r}_decodeOnLoadImage(e){return new Promise((t,n)=>{this.imageLoadedListener=()=>this.decodeOnce(e,!1,!0).then(t,n),e.addEventListener("load",this.imageLoadedListener)})}_decodeOnLoadVideo(e){return F(this,void 0,void 0,function*(){return yield this.playVideoOnLoadAsync(e),yield this.decodeOnce(e)})}_decodeOnLoadVideoContinuously(e,t){return F(this,void 0,void 0,function*(){yield this.playVideoOnLoadAsync(e),this.decodeContinuously(e,t)})}isImageLoaded(e){return!!e.complete&&0!==e.naturalWidth}prepareImageElement(e){let t;return void 0===e&&(t=document.createElement("img"),t.width=200,t.height=200),"string"==typeof e&&(t=this.getMediaElement(e,"img")),e instanceof HTMLImageElement&&(t=e),t}prepareVideoElement(e){let t;return e||"undefined"==typeof document||(t=document.createElement("video"),t.width=200,t.height=200),"string"==typeof e&&(t=this.getMediaElement(e,"video")),e instanceof HTMLVideoElement&&(t=e),t.setAttribute("autoplay","true"),t.setAttribute("muted","true"),t.setAttribute("playsinline","true"),t}decodeOnce(e,t=!0,n=!0){this._stopAsyncDecode=!1;const r=(i,o)=>
vendor: 8,718 bytes, line 2
2{if(this._stopAsyncDecode)return o(new O("Video stream has ended before any code could be detected.")),void(this._stopAsyncDecode=void 0);try{i(this.decode(e))}catch(e){if(t&&e instanceof O||(e instanceof f||e instanceof b)&&n)return setTimeout(r,this._timeBetweenDecodingAttempts,i,o);o(e)}};return new Promise((e,t)=>r(e,t))}decodeContinuously(e,t){this._stopContinuousDecode=!1;const n=()=>{if(this._stopContinuousDecode)this._stopContinuousDecode=void 0;else try{const r=this.decode(e);t(r,null),setTimeout(n,this.timeBetweenScansMillis)}catch(e){t(null,e),(e instanceof f||e instanceof b||e instanceof O)&&setTimeout(n,this._timeBetweenDecodingAttempts)}};n()}decode(e){const t=this.createBinaryBitmap(e);return this.decodeBitmap(t)}_isHTMLVideoElement(e){return 0!==e.videoWidth}drawFrameOnCanvas(e,t,n){t||(t={sx:0,sy:0,sWidth:e.videoWidth,sHeight:e.videoHeight,dx:0,dy:0,dWidth:e.videoWidth,dHeight:e.videoHeight}),n||(n=this.captureCanvasContext),n.drawImage(e,t.sx,t.sy,t.sWidth,t.sHeight,t.dx,t.dy,t.dWidth,t.dHeight)}drawImageOnCanvas(e,t,n=this.captureCanvasContext){t||(t={sx:0,sy:0,sWidth:e.naturalWidth,sHeight:e.naturalHeight,dx:0,dy:0,dWidth:e.naturalWidth,dHeight:e.naturalHeight}),n||(n=this.captureCanvasContext),n.drawImage(e,t.sx,t.sy,t.sWidth,t.sHeight,t.dx,t.dy,t.dWidth,t.dHeight)}createBinaryBitmap(e){this.getCaptureCanvasContext(e),this._isHTMLVideoElement(e)?this.drawFrameOnCanvas(e):this.drawImageOnCanvas(e);const t=this.getCaptureCanvas(e),n=new x(t),r=new M(n);return new d(r)}getCaptureCanvasContext(e){if(!this.captureCanvasContext){const t=this.getCaptureCanvas(e).getContext("2d");this.captureCanvasContext=t}return this.captureCanvasContext}getCaptureCanvas(e){if(!this.captureCanvas){const t=this.createCaptureCanvas(e);this.captureCanvas=t}return this.captureCanvas}decodeBitmap(e){return this.reader.decode(e,this._hints)}createCaptureCanvas(e){if("undefined"==typeof document)return this._destroyCaptureCanvas(),null;const t=document.createElement("canvas");let n,r;return void 0!==e&&(e instanceof HTMLVideoElement?(n=e.videoWidth,r=e.videoHeight):e instanceof HTMLImageElement&&(n=e.naturalWidth||e.width,r=e.naturalHeight||e.height)),t.style.width=n+"px",t.style.height=r+"px",t.width=n,t.height=r,t}stopStreams(){this.stream&&(this.stream.getVideoTracks().forEach(e=>e.stop()),this.stream=void 0),!1===this._stopAsyncDecode&&this.stopAsyncDecode(),!1===this._stopContinuousDecode&&this.stopContinuousDecode()}reset(){this.stopStreams(),this._destroyVideoElement(),this._destroyImageElement(),this._destroyCaptureCanvas()}_destroyVideoElement(){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)}_destroyImageElement(){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)}_destroyCaptureCanvas(){this.captureCanvasContext=void 0,this.captureCanvas=void 0}addVideoSource(e,t){try{e.srcObject=t}catch(n){e.src=URL.createObjectURL(t)}}cleanVideoSource(e){try{e.srcObject=null}catch(t){e.src=""}this.videoElement.removeAttribute("src")}}class j{constructor(e,t,n=(null==t?0:8*t.length),r,i,o=g.currentTimeMillis()){this.text=e,this.rawBytes=t,this.numBits=n,this.resultPoints=r,this.format=i,this.timestamp=o,this.text=e,this.rawBytes=t,this.numBits=null==n?null==t?0:8*t.length:n,this.resultPoints=r,this.format=i,this.resultMetadata=null,this.timestamp=null==o?g.currentTimeMillis():o}getText(){return this.text}getRawBytes(){return this.rawBytes}getNumBits(){return this.numBits}getResultPoints(){return this.resultPoints}getBarcodeFormat(){return this.format}getResultMetadata(){return this.resultMetadata}putMetadata(e,t){null===this.resultMetadata&&(this.resultMetadata=new Map),this.resultMetadata.set(e,t)}putAllMetadata(e){null!==e&&(null===this.resultMetadata?this.resultMetadata=e:this.resultMetadata=new Map(e))}addResultPoints(e){const t=this.resultPoints;if(null===t)this.resultPoints=e;else if(null!==e&&e.length>0){const n=new Array(t.length+e.length);g.arraycopy(t,0,n,0,t.length),g.arraycopy(e,0,n,t.length,e.length),this.resultPoints=n}}getTimestamp(){return this.timestamp}toString(){return this.text}}!function(e){e[e.AZTEC=0]="AZTEC",e[e.CODABAR=1]="CODABAR",e[e.CODE_39=2]="CODE_39",e[e.CODE_93=3]="CODE_93",e[e.CODE_128=4]="CODE_128",e[e.DATA_MATRIX=5]="DATA_MATRIX",e[e.EAN_8=6]="EAN_8",e[e.EAN_13=7]="EAN_13",e[e.ITF=8]="ITF",e[e.MAXICODE=9]="MAXICODE",e[e.PDF_417=10]="PDF_417",e[e.QR_CODE=11]="QR_CODE",e[e.RSS_14=12]="RSS_14",e[e.RSS_EXPANDED=13]="RSS_EXPANDED",e[e.UPC_A=14]="UPC_A",e[e.UPC_E=15]="UPC_E",e[e.UPC_EAN_EXTENSION=16]="UPC_EAN_EXTENSION"}(B||(B={}));var H,V=B;!function(e){e[e.OTHER=0]="OTHER",e[e.ORIENTATION=1]="ORIENTATION",e[e.BYTE_SEGMENTS=2]="BYTE_SEGMENTS",e[e.ERROR_CORRECTION_LEVEL=3]="ERROR_CORRECTION_LEVEL",e[e.ISSUE_NUMBER=4]="ISSUE_NUMBER",e[e.SUGGESTED_PRICE=5]="SUGGESTED_PRICE",e[e.POSSIBLE_COUNTRY=6]="POSSIBLE_COUNTRY",e[e.UPC_EAN_EXTENSION=7]="UPC_EAN_EXTENSION",e[e.PDF417_EXTRA_METADATA=8]="PDF417_EXTRA_METADATA",e[e.STRUCTURED_APPEND_SEQUENCE=9]="STRUCTURED_APPEND_SEQUENCE",e[e.STRUCTURED_APPEND_PARITY=10]="STRUCTURED_APPEND_PARITY"}(H||(H={}));var z,G,W,Y,X,$,q=H;class Z{constructor(e,t,n,r,i=-1,o=-1){this.rawBytes=e,this.text=t,this.byteSegments=n,this.ecLevel=r,this.structuredAppendSequenceNumber=i,this.structuredAppendParity=o,this.numBits=null==e?0:8*e.length}getRawBytes(){return this.rawBytes}getNumBits(){return this.numBits}setNumBits(e){this.numBits=e}getText(){return this.text}getByteSegments(){return this.byteSegments}getECLevel(){return this.ecLevel}getErrorsCorrected(){return this.errorsCorrected}setErrorsCorrected(e){this.errorsCorrected=e}getErasures(){return this.erasures}setErasures(e){this.erasures=e}getOther(){return this.other}setOther(e){this.other=e}hasStructuredAppend(){return this.structuredAppendParity>=0&&this.structuredAppendSequenceNumber>=0}getStructuredAppendParity(){return this.structuredAppendParity}getStructuredAppendSequenceNumber(){return this.structuredAppendSequenceNumber}}class Q{exp(e){return this.expTable[e]}log(e){if(0===e)throw new h;return this.logTable[e]}static addOrSubtract(e,t){return e^t}}class K{constructor(e,t){if(0===t.length)throw new h;this.field=e;const n=t.length;if(n>1&&0===t[0]){let e=1;for(;e<n&&0===t[e];)e++;e===n?this.coefficients=Int32Array.from([0]):(this.coefficients=new Int32Array(n-e),g.arraycopy(t,e,this.coefficients,0,this.coefficients.length))}else this.coefficients=t}getCoefficients(){return this.coefficients}getDegree(){return this.coefficients.length-1}isZero(){return 0===this.coefficients[0]}getCoefficient(e){return this.coefficients[this.coefficients.length-1-e]}evaluateAt(e){if(0===e)return this.getCoefficient(0);const t=this.coefficients;let n;if(1===e){n=0;for(let e=0,r=t.length;e!==r;e++){const r=t[e];n=Q.addOrSubtract(n,r)}return n}n=t[0];const r=t.length,i=this.field;for(let o=1;o<r;o++)n=Q.addOrSubtract(i.multiply(e,n),t[o]);return n}addOrSubtract(e){if(!this.field.equals(e.field))throw new h("GenericGFPolys do not have same GenericGF field");if(this.isZero())return e;if(e.isZero())return this;let t=this.coefficients,n=e.coefficients;if(t.length>n.length){const e=t;t=n,n=e}let r=new Int32Array(n.length);const i=n.length-t.length;g.arraycopy(n,0,r,0,i);for(let e=i;e<n.length;e++)r[e]=Q.addOrSubtract(t[e-i],n[e]);return new K(this.field,r)}multiply(e){if(!this.field.equals(e.field))throw new h("GenericGFPolys do not have same GenericGF field");if(this.isZero()||e.isZero())return this.field.getZero();const t=this.coefficients,n=t.length,r=e.coefficients,i=r.length,o=new Int32Array(n+i-1),s=this.field;for(let e=0;e<n;e++){const n=t[e];for(let t=0;t<i;t++)o[e+t]=Q.addOrSubtract(o[e+t],s.multiply(n,r[t]))}return new K(s,o)}multiplyScalar(e){if(0===e)return this.field.getZero();if(1===e)return this;const t=this.coefficients.length,n=this.field,r=new Int32Array(t),i=this.coefficients;for(let o=0;o<t;o++)r[o]=n.multiply(i[o],e);return new K(n,r)}multiplyByMonomial(e,t){if(e<0)throw new h;if(0===t)return this.field.getZero();const n=this.coefficients,r=n.length,i=new Int32Array(r+e),o=this.field;for(let e=0;e<r;e++)i[e]=o.multiply(n[e],t);return new K(o,i)}divide(e){if(!this.field.equals(e.field))throw new h("GenericGFPolys do n
2ot have same GenericGF field");if(e.isZero())throw new h("Divide by 0");const t=this.field;let n=t.getZero(),r=this;const i=e.getCoefficient(e.getDegree()),o=t.inverse(i);for(;r.getDegree()>=e.getDegree()&&!r.isZero();){const i=r.getDegree()-e.getDegree(),s=t.multiply(r.getCoefficient(r.getDegree()),o),a=e.multiplyByMonomial(i,s),l=t.buildMonomial(i,s);n=n.addOrSubtract(l),r=r.addOrSubtract(a)}return[n,r]}toString(){let e="";for(let t=this.getDegree();t>=0;t--){let n=this.getCoefficient(t);if(0!==n){if(n<0?(e+=" - ",n=-n):e.length>0&&(e+=" + "),0===t||1!==n){const t=this.field.log(n);0===t?e+="1":1===t?e+="a":(e+="a^",e+=t)}0!==t&&(1===t?e+="x":(e+="x^",e+=t))}}return e}}class J extends c{}J.kind="ArithmeticException";class ee extends Q{constructor(e,t,n){super(),this.primitive=e,this.size=t,this.generatorBase=n;const r=new Int32Array(t);let i=1;for(let n=0;n<t;n++)r[n]=i,i*=2,i>=t&&(i^=e,i&=t-1);this.expTable=r;const o=new Int32Array(t);for(let e=0;e<t-1;e++)o[r[e]]=e;this.logTable=o,this.zero=new K(this,Int32Array.from([0])),this.one=new K(this,Int32Array.from([1]))}getZero(){return this.zero}getOne(){return this.one}buildMonomial(e,t){if(e<0)throw new h;if(0===t)return this.zero;const n=new Int32Array(e+1);return n[0]=t,new K(this,n)}inverse(e){if(0===e)throw new J;return this.expTable[this.size-this.logTable[e]-1]}multiply(e,t){return 0===e||0===t?0:this.expTable[(this.logTable[e]+this.logTable[t])%(this.size-1)]}getSize(){return this.size}getGeneratorBase(){return this.generatorBase}toString(){return"GF(0x"+E.toHexString(this.primitive)+","+this.size+")"}equals(e){return e===this}}ee.AZTEC_DATA_12=new ee(4201,4096,1),ee.AZTEC_DATA_10=new ee(1033,1024,1),ee.AZTEC_DATA_6=new ee(67,64,1),ee.AZTEC_PARAM=new ee(19,16,1),ee.QR_CODE_FIELD_256=new ee(285,256,0),ee.DATA_MATRIX_FIELD_256=new ee(301,256,1),ee.AZTEC_DATA_8=ee.DATA_MATRIX_FIELD_256,ee.MAXICODE_FIELD_64=ee.AZTEC_DATA_6;class te extends c{}te.kind="ReedSolomonException";class ne extends c{}ne.kind="IllegalStateException";class re{constructor(e){this.field=e}decode(e,t){const n=this.field,r=new K(n,e),i=new Int32Array(t);let o=!0;for(let e=0;e<t;e++){const t=r.evaluateAt(n.exp(e+n.getGeneratorBase()));i[i.length-1-e]=t,0!==t&&(o=!1)}if(o)return;const s=new K(n,i),a=this.runEuclideanAlgorithm(n.buildMonomial(t,1),s,t),l=a[0],c=a[1],u=this.findErrorLocations(l),h=this.findErrorMagnitudes(c,u);for(let t=0;t<u.length;t++){const r=e.length-1-n.log(u[t]);if(r<0)throw new te("Bad error location");e[r]=ee.addOrSubtract(e[r],h[t])}}runEuclideanAlgorithm(e,t,n){if(e.getDegree()<t.getDegree()){const n=e;e=t,t=n}const r=this.field;let i=e,o=t,s=r.getZero(),a=r.getOne();for(;o.getDegree()>=(n/2|0);){let e=i,t=s;if(i=o,s=a,i.isZero())throw new te("r_{i-1} was zero");o=e;let n=r.getZero();const l=i.getCoefficient(i.getDegree()),c=r.inverse(l);for(;o.getDegree()>=i.getDegree()&&!o.isZero();){const e=o.getDegree()-i.getDegree(),t=r.multiply(o.getCoefficient(o.getDegree()),c);n=n.addOrSubtract(r.buildMonomial(e,t)),o=o.addOrSubtract(i.multiplyByMonomial(e,t))}if(a=n.multiply(s).addOrSubtract(t),o.getDegree()>=i.getDegree())throw new ne("Division algorithm failed to reduce polynomial?")}const l=a.getCoefficient(0);if(0===l)throw new te("sigmaTilde(0) was zero");const c=r.inverse(l);return[a.multiplyScalar(c),o.multiplyScalar(c)]}findErrorLocations(e){const t=e.getDegree();if(1===t)return Int32Array.from([e.getCoefficient(1)]);const n=new Int32Array(t);let r=0;const i=this.field;for(let o=1;o<i.getSize()&&r<t;o++)0===e.evaluateAt(o)&&(n[r]=i.inverse(o),r++);if(r!==t)throw new te("Error locator degree does not match number of roots");return n}findErrorMagnitudes(e,t){const n=t.length,r=new Int32Array(n),i=this.field;for(let o=0;o<n;o++){const s=i.inverse(t[o]);let a=1;for(let e=0;e<n;e++)if(o!==e){const n=i.multiply(t[e],s),r=1&n?-2&n:1|n;a=i.multiply(a,r)}r[o]=i.multiply(e.evaluateAt(s),i.inverse(a)),0!==i.getGeneratorBase()&&(r[o]=i.multiply(r[o],s))}return r}}!function(e){e[e.UPPER=0]="UPPER",e[e.LOWER=1]="LOWER",e[e.MIXED=2]="MIXED",e[e.DIGIT=3]="DIGIT",e[e.PUNCT=4]="PUNCT",e[e.BINARY=5]="BINARY"}(z||(z={}));class ie{decode(e){this.ddata=e;let t=e.getBits(),n=this.extractBits(t),r=this.correctBits(n),i=ie.convertBoolArrayToByteArray(r),o=ie.getEncodedData(r),s=new Z(i,o,null,
vendor: 15,230 bytes, line 2
2null);return s.setNumBits(r.length),s}static highLevelDecode(e){return this.getEncodedData(e)}static getEncodedData(e){let t=e.length,n=z.UPPER,r=z.UPPER,i="",o=0;for(;o<t;)if(r===z.BINARY){if(t-o<5)break;let s=ie.readCode(e,o,5);if(o+=5,0===s){if(t-o<11)break;s=ie.readCode(e,o,11)+31,o+=11}for(let n=0;n<s;n++){if(t-o<8){o=t;break}const n=ie.readCode(e,o,8);i+=T.castAsNonUtf8Char(n),o+=8}r=n}else{let s=r===z.DIGIT?4:5;if(t-o<s)break;let a=ie.readCode(e,o,s);o+=s;let l=ie.getCharacter(r,a);l.startsWith("CTRL_")?(n=r,r=ie.getTable(l.charAt(5)),"L"===l.charAt(6)&&(n=r)):(i+=l,r=n)}return i}static getTable(e){switch(e){case"L":return z.LOWER;case"P":return z.PUNCT;case"M":return z.MIXED;case"D":return z.DIGIT;case"B":return z.BINARY;default:return z.UPPER}}static getCharacter(e,t){switch(e){case z.UPPER:return ie.UPPER_TABLE[t];case z.LOWER:return ie.LOWER_TABLE[t];case z.MIXED:return ie.MIXED_TABLE[t];case z.PUNCT:return ie.PUNCT_TABLE[t];case z.DIGIT:return ie.DIGIT_TABLE[t];default:throw new ne("Bad table")}}correctBits(e){let t,n;this.ddata.getNbLayers()<=2?(n=6,t=ee.AZTEC_DATA_6):this.ddata.getNbLayers()<=8?(n=8,t=ee.AZTEC_DATA_8):this.ddata.getNbLayers()<=22?(n=10,t=ee.AZTEC_DATA_10):(n=12,t=ee.AZTEC_DATA_12);let r=this.ddata.getNbDatablocks(),i=e.length/n;if(i<r)throw new b;let o=e.length%n,s=new Int32Array(i);for(let t=0;t<i;t++,o+=n)s[t]=ie.readCode(e,o,n);try{new re(t).decode(s,i-r)}catch(e){throw new b(e)}let a=(1<<n)-1,l=0;for(let e=0;e<r;e++){let t=s[e];if(0===t||t===a)throw new b;1!==t&&t!==a-1||l++}let c=new Array(r*n-l),u=0;for(let e=0;e<r;e++){let t=s[e];if(1===t||t===a-1)c.fill(t>1,u,u+n-1),u+=n-1;else for(let e=n-1;e>=0;--e)c[u++]=!!(t&1<<e)}return c}extractBits(e){let t=this.ddata.isCompact(),n=this.ddata.getNbLayers(),r=(t?11:14)+4*n,i=new Int32Array(r),o=new Array(this.totalBitsInLayer(n,t));if(t)for(let e=0;e<i.length;e++)i[e]=e;else{let e=r+1+2*E.truncDivision(E.truncDivision(r,2)-1,15),t=r/2,n=E.truncDivision(e,2);for(let e=0;e<t;e++){let r=e+E.truncDivision(e,15);i[t-e-1]=n-r-1,i[t+e]=n+r+1}}for(let s=0,a=0;s<n;s++){let l=4*(n-s)+(t?9:12),c=2*s,u=r-1-c;for(let t=0;t<l;t++){let n=2*t;for(let r=0;r<2;r++)o[a+n+r]=e.get(i[c+r],i[c+t]),o[a+2*l+n+r]=e.get(i[c+t],i[u-r]),o[a+4*l+n+r]=e.get(i[u-r],i[u-t]),o[a+6*l+n+r]=e.get(i[u-t],i[c+r])}a+=8*l}return o}static readCode(e,t,n){let r=0;for(let i=t;i<t+n;i++)r<<=1,e[i]&&(r|=1);return r}static readByte(e,t){let n=e.length-t;return n>=8?ie.readCode(e,t,8):ie.readCode(e,t,n)<<8-n}static convertBoolArrayToByteArray(e){let t=new Uint8Array((e.length+7)/8);for(let n=0;n<t.length;n++)t[n]=ie.readByte(e,8*n);return t}totalBitsInLayer(e,t){return((t?88:112)+16*e)*e}}ie.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"],ie.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"],ie.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"],ie.PUNCT_TABLE=["","\r","\r\n",". ",", ",": ","!",'"',"#","$","%","&","'","(",")","*","+",",","-",".","/",":",";","<","=",">","?","[","]","{","}","CTRL_UL"],ie.DIGIT_TABLE=["CTRL_PS"," ","0","1","2","3","4","5","6","7","8","9",",",".","CTRL_UL","CTRL_US"];class oe{constructor(){}static round(e){return NaN===e?0:e<=Number.MIN_SAFE_INTEGER?Number.MIN_SAFE_INTEGER:e>=Number.MAX_SAFE_INTEGER?Number.MAX_SAFE_INTEGER:e+(e<0?-.5:.5)|0}static distance(e,t,n,r){const i=e-n,o=t-r;return Math.sqrt(i*i+o*o)}static sum(e){let t=0;for(let n=0,r=e.length;n!==r;n++)t+=e[n];return t}}class se{static floatToIntBits(e){return e}}se.MAX_VALUE=Number.MAX_SAFE_INTEGER;class ae{constructor(e,t){this.x=e,this.y=t}getX(){return this.x}getY(){return this.y}equals(e){if(e instanceof ae){const t=e;return this.x===t.x&&this.y===t.y}return!1}hashCode(){return 31*se.floatToIntBits(this.x)+se.floatToIntBits(this.y)}toString(){return"("+this.x+","+this.y+")"}static orderBestPatterns(e){const t=this.distance(e[0],e[1]),n=this.distance(e[1],e[2]),r=this.distance(e[0],e[2]);let i,o,s;if(n>=t&&n>=r?(o=e[0],i=e[1],s=e[2]):r>=n&&r>=t?(o=e[1],i=e[0],s=e[2]):(o=e[2],i=e[0],s=e[1]),this.crossProductZ(i,o,s)<0){const e=i;i=s,s=e}e[0]=i,e[1]=o,e[2]=s}static distance(e,t){return oe.distance(e.x,e.y,t.x,t.y)}static crossProductZ(e,t,n){const r=t.x,i=t.y;return(n.x-r)*(e.y-i)-(n.y-i)*(e.x-r)}}class le{constructor(e,t){this.bits=e,this.points=t}getBits(){return this.bits}getPoints(){return this.points}}class ce extends le{constructor(e,t,n,r,i){super(e,t),this.compact=n,this.nbDatablocks=r,this.nbLayers=i}getNbLayers(){return this.nbLayers}getNbDatablocks(){return this.nbDatablocks}isCompact(){return this.compact}}class ue{constructor(e,t,n,r){this.image=e,this.height=e.getHeight(),this.width=e.getWidth(),null==t&&(t=ue.INIT_SIZE),null==n&&(n=e.getWidth()/2|0),null==r&&(r=e.getHeight()/2|0);const i=t/2|0;if(this.leftInit=n-i,this.rightInit=n+i,this.upInit=r-i,this.downInit=r+i,this.upInit<0||this.leftInit<0||this.downInit>=this.height||this.rightInit>=this.width)throw new O}detect(){let e=this.leftInit,t=this.rightInit,n=this.upInit,r=this.downInit,i=!1,o=!0,s=!1,a=!1,l=!1,c=!1,u=!1;const h=this.width,d=this.height;for(;o;){o=!1;let f=!0;for(;(f||!a)&&t<h;)f=this.containsBlackPoint(n,r,t,!1),f?(t++,o=!0,a=!0):a||t++;if(t>=h){i=!0;break}let p=!0;for(;(p||!l)&&r<d;)p=this.containsBlackPoint(e,t,r,!0),p?(r++,o=!0,l=!0):l||r++;if(r>=d){i=!0;break}let g=!0;for(;(g||!c)&&e>=0;)g=this.containsBlackPoint(n,r,e,!1),g?(e--,o=!0,c=!0):c||e--;if(e<0){i=!0;break}let m=!0;for(;(m||!u)&&n>=0;)m=this.containsBlackPoint(e,t,n,!0),m?(n--,o=!0,u=!0):u||n--;if(n<0){i=!0;break}o&&(s=!0)}if(!i&&s){const i=t-e;let o=null;for(let t=1;null===o&&t<i;t++)o=this.getBlackPointOnSegment(e,r-t,e+t,r);if(null==o)throw new O;let s=null;for(let t=1;null===s&&t<i;t++)s=this.getBlackPointOnSegment(e,n+t,e+t,n);if(null==s)throw new O;let a=null;for(let e=1;null===a&&e<i;e++)a=this.getBlackPointOnSegment(t,n+e,t-e,n);if(null==a)throw new O;let l=null;for(let e=1;null===l&&e<i;e++)l=this.getBlackPointOnSegment(t,r-e,t-e,r);if(null==l)throw new O;return this.centerEdges(l,o,a,s)}throw new O}getBlackPointOnSegment(e,t,n,r){const i=oe.round(oe.distance(e,t,n,r)),o=(n-e)/i,s=(r-t)/i,a=this.image;for(let n=0;n<i;n++){const r=oe.round(e+n*o),i=oe.round(t+n*s);if(a.get(r,i))return new ae(r,i)}return null}centerEdges(e,t,n,r){const i=e.getX(),o=e.getY(),s=t.getX(),a=t.getY(),l=n.getX(),c=n.getY(),u=r.getX(),h=r.getY(),d=ue.CORR;return i<this.width/2?[new ae(u-d,h+d),new ae(s+d,a+d),new ae(l-d,c-d),new ae(i+d,o-d)]:[new ae(u+d,h+d),new ae(s+d,a-d),new ae(l-d,c+d),new ae(i-d,o-d)]}containsBlackPoint(e,t,n,r){const i=this.image;if(r){for(let r=e;r<=t;r++)if(i.get(r,n))return!0}else for(let r=e;r<=t;r++)if(i.get(n,r))return!0;return!1}}ue.INIT_SIZE=10,ue.CORR=1;class he{static checkAndNudgePoints(e,t){const n=e.getWidth(),r=e.getHeight();let i=!0;for(let e=0;e<t.length&&i;e+=2){const o=Math.floor(t[e]),s=Math.floor(t[e+1]);if(o<-1||o>n||s<-1||s>r)throw new O;i=!1,-1===o?(t[e]=0,i=!0):o===n&&(t[e]=n-1,i=!0),-1===s?(t[e+1]=0,i=!0):s===r&&(t[e+1]=r-1,i=!0)}i=!0;for(let e=t.length-2;e>=0&&i;e-=2){const o=Math.floor(t[e]),s=Math.floor(t[e+1]);if(o<-1||o>n||s<-1||s>r)throw new O;i=!1,-1===o?(t[e]=0,i=!0):o===n&&(t[e]=n-1,i=!0),-1===s?(t[e+1]=0,i=!0):s===r&&(t[e+1]=r-1,i=!0)}}}class de{constructor(e,t,n,r,i,o,s,a,l){this.a11=e,this.a21=t,this.a31=n,this.a12=r,this.a22=i,this.a32=o,this.a13=s,this.a23=a,this.a33=l}static quadrilateralToQuadrilateral(e,t,n,r,i,o,s,a,l,c,u,h,d,f,p,g){const m=de.quadrilateralToSquare(e,t,n,r,i,o,s,a);return de.squareToQuadrilateral(l,c,u,h,d,f,p,g).times(m)}transformPoints(e){const t=e.length,n=this.a11,r=this.a12,i=this.a13,o=this.a21,s=this.a22,a=this.a23,l=this.a31,c=this.a32,u=this.a33;for(let h=0;h<t;h+=2){const t=e[h],d=e[h+1],f=i*t+a*d+u;e[h]=(n*t+o*d+l)/f,e[h+1]=(r*t+s*d+c)/f}}transformPointsWithValues(e,t){const n=this.a11,r=this.a12,i=this.a13,o=this.a21,s=this.a22,a=this.a23,l=this.a31,c=this.a32,u=this.a33,h=e.length;for(let d=0;d<h;d++){const h=e[d],f=t[d],p=i*h+a*f+u;e[d]=(n*h+o*f+l)/p,t[d]=(r*h+s*f+c)/p}}static squareToQuadrilateral(e,t,n,r,i,o,s,a){const l=e-n+i-s,c=t-r+o-a;if(0===l&&0===c)return new de(n-e,i-n,e,r-t,o-r,t,0,0,1);{const u=n-i,h=s-i,d=r-o,f=a-o,p=u*f-h*d,g=(l*f-h*c)/p,m=(u*c-l*d)/p;return new de(n-e+g*n,s-e+m*s,e,r-t+g*r,a-t+m*a,t,g,m,1)}}static quadrilateralToSquare(e,t,n,r,i,o,s,a){return de.squareToQuadrilateral(e,t,n,r,i,o,s,a).buildAdjoint()}buildAdjoint(){return new de(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)}times(e){return new de(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)}}class fe extends he{sampleGrid(e,t,n,r,i,o,s,a,l,c,u,h,d,f,p,g,m,w,y){const E=de.quadrilateralToQuadrilateral(r,i,o,s,a,l,c,u,h,d,f,p,g,m,w,y);return this.sampleGridWithTransform(e,t,n,E)}sampleGridWithTransform(e,t,n,r){if(t<=0||n<=0)throw new O;const i=new N(t,n),o=new Float32Array(2*t);for(let t=0;t<n;t++){const n=o.length,s=t+.5;for(let e=0;e<n;e+=2)o[e]=e/2+.5,o[e+1]=s;r.transformPoints(o),he.checkAndNudgePoints(e,o);try{for(let r=0;r<n;r+=2)e.get(Math.floor(o[r]),Math.floor(o[r+1]))&&i.set(r/2,t)}catch(e){throw new O}}return i}}class pe{static setGridSampler(e){pe.gridSampler=e}static getInstance(){return pe.gridSampler}}pe.gridSampler=new fe;class ge{constructor(e,t){this.x=e,this.y=t}toResultPoint(){return new ae(this.getX(),this.getY())}getX(){return this.x}getY(){return this.y}}class me{constructor(e){this.EXPECTED_CORNER_BITS=new Int32Array([3808,476,2107,1799]),this.image=e}detect(){return this.detectMirror(!1)}detectMirror(e){let t=this.getMatrixCenter(),n=this.getBullsEyeCorners(t);if(e){let e=n[0];n[0]=n[2],n[2]=e}this.extractParameters(n);let r=this.sampleGrid(this.image,n[this.shift%4],n[(this.shift+1)%4],n[(this.shift+2)%4],n[(this.shift+3)%4]),i=this.getMatrixCornerPoints(n);return new ce(r,i,this.compact,this.nbDataBlocks,this.nbLayers)}extractParameters(e){if(!(this.isValidPoint(e[0])&&this.isValidPoint(e[1])&&this.isValidPoint(e[2])&&this.isValidPoint(e[3])))throw new O;let t=2*this.nbCenterLayers,n=new Int32Array([this.sampleLine(e[0],e[1],t),this.sampleLine(e[1],e[2],t),this.sampleLine(e[2],e[3],t),this.sampleLine(e[3],e[0],t)]);this.shift=this.getRotation(n,t);let r=0;for(let e=0;e<4;e++){let t=n[(this.shift+e)%4];this.compact?(r<<=7,r+=t>>1&127):(r<<=10,r+=(t>>2&992)+(t>>1&31))}let i=this.getCorrectedParameterData(r,this.compact);this.compact?(this.nbLayers=1+(i>>6),this.nbDataBlocks=1+(63&i)):(this.nbLayers=1+(i>>11),this.nbDataBlocks=1+(2047&i))}getRotation(e,t){let n=0;e.forEach((e,r,i)=>{n=(e>>t-2<<1)+(1&e)+(n<<3)}),n=((1&n)<<11)+(n>>1);for(let e=0;e<4;e++)if(E.bitCount(n^this.EXPECTED_CORNER_BITS[e])<=2)return e;throw new O}getCorrectedParameterData(e,t){let n,r;t?(n=7,r=2):(n=10,r=4);let i=n-r,o=new Int32Array(n);for(let t=n-1;t>=0;--t)o[t]=15&e,e>>=4;try{new re(ee.AZTEC_PARAM).decode(o,i)}catch(e){throw new O}let s=0;for(let e=0;e<r;e++)s=(s<<4)+o[e];return s}getBullsEyeCorners(e){let t=e,n=e,r=e,i=e,o=!0;for(this.nbCenterLayers=1;this.nbCenterLayers<9;this.nbCenterLayers++){let e=this.getFirstDifferent(t,o,1,-1),s=this.getFirstDifferent(n,o,1,1),a=this.getFirstDifferent(r,o,-1,1),l=this.getFirstDifferent(i,o,-1,-1);if(this.nbCenterLayers>2){let n=this.distancePoint(l,e)*this.nbCenterLayers/(this.distancePoint(i,t)*(this.nbCenterLayers+2));if(n<.75||n>1.25||!this.isWhiteOrBlackRectangle(e,s,a,l))break}t=e,n=s,r=a,i=l,o=!o}if(5!==this.nbCenterLayers&&7!==this.nbCenterLayers)throw new O;this.compact=5===this.nbCenterLayers;let s=new ae(t.getX()+.5,t.getY()-.5),a=new ae(n.getX()+.5,n.getY()+.5),l=new ae(r.getX()-.5,r.getY()+.5),c=new ae(i.getX()-.5,i.getY()-.5);return this.expandSquare([s,a,l,c],2*this.nbCenterLayers-3,2*this.nbCenterLayers)}getMatrixCenter(){let e,t,n,r;try{let i=new ue(this.image).detect();e=i[0],t=i[1],n=i[2],r=i[3]}catch(i){let o=this.image.getWidth()/2,s=this.image.getHeight()/2;e=this.getFirstDifferent(new ge(o+7,s-7),!1,1,-1).toResultPoint(),t=this.getFirstDifferent(new ge(o+7,s+7),!1,1,1).toResultPoint(),n=this.getFirstDifferent(new ge(o-7,s+7),!1,-1,1).toResultPoint(),r=this.getFirstDifferent(new ge(o-7,s-7),!1,-1,-1).toResultPoint()}let i=oe.round((e.getX()+r.getX()+t.getX()+n.getX())/4),o=oe.round((e.getY()+r.getY()+t.getY()+n.getY())/4);try{let s=new ue(this.image,15,i,o).detect();e=s[0],t=s[1],n=s[2],r=s[3]}catch(s){e=this.getFirstDifferent(new ge(i+7,o-7),!1,1,-1).toResultPoint(),t=this.getFirstDifferent(new ge(i+7,o+7),!1,1,1).toResultPoint(),n=this.getFirstDifferent(new ge(i-7,o+7),!1,-1,1).toResultPoint(),r=this.getFirstDifferent(new ge(i-7,o-7),!1,-1,-1).toResultPoint()}return i=oe.round((e.getX()+r.getX()+t.getX()+n.getX())/4),o=oe.round((e.getY()+r.getY()+t.getY()+n.getY())/4),new ge(i,o)}getMatrixCornerPoints(e){return this.expandSquare(e,2*this.nbCenterLayers,this.getDimension())}sampleGrid(e,t,n,r,i){let o=pe.getInstance(),s=this.getDimension(),a=s/2-this.nbCenterLayers,l=s/2+this.nbCenterLayers;return o.sampleGrid(e,s,s,a,a,l,a,l,l,a,l,t.getX(),t.getY(),n.getX(),n.getY(),r.getX(),r.getY(),i.getX(),i.getY())}sampleLine(e,t,n){let r=0,i=this.distanceResultPoint(e,t),o=i/n,s=e.getX(),a=e.getY(),l=o*(t.getX()-e.getX())/i,c=o*(t.getY()-e.getY())/i;for(let e=0;e<n;e++)this.image.get(oe.round(s+e*l),oe.round(a+e*c))&&(r|=1<<n-e-1);return r}isWhiteOrBlackRectangle(e,t,n,r){let i=3;e=new ge(e.getX()-i,e.getY()+i),t=new ge(t.getX()-i,t.getY()-i),n=new ge(n.getX()+i,n.getY()-i),r=new ge(r.getX()+i,r.getY()+i);let o=this.getColor(r,e);if(0===o)return!1;let s=this.getColor(e,t);return s===o&&(s=this.getColor(t,n),s===o&&(s=this.getColor(n,r),s===o))}getColor(e,t){let n=this.distancePoint(e,t),r=(t.getX()-e.getX())/n,i=(t.getY()-e.getY())/n,o=0,s=e.getX(),a=e.getY(),l=this.image.get(e.getX(),e.getY()),c=Math.ceil(n);for(let e=0;e<c;e++)s+=r,a+=i,this.image.get(oe.round(s),oe.round(a))!==l&&o++;let u=o/n;return u>.1&&u<.9?0:u<=.1===l?1:-1}getFirstDifferent(e,t,n,r){let i=e.getX()+n,o=e.getY()+r;for(;this.isValid(i,o)&&this.image.get(i,o)===t;)i+=n,o+=r;for(i-=n,o-=r;this.isValid(i,o)&&this.image.get(i,o)===t;)i+=n;for(i-=n;this.isValid(i,o)&&this.image.get(i,o)===t;)o+=r;return o-=r,new ge(i,o)}expandSquare(e,t,n){let r=n/(2*t),i=e[0].getX()-e[2].getX(),o=e[0].getY()-e[2].getY(),s=(e[0].getX()+e[2].getX())/2,a=(e[0].getY()+e[2].getY())/2,l=ne
vendor: 10,014 bytes, line 2
2w ae(s+r*i,a+r*o),c=new ae(s-r*i,a-r*o);return i=e[1].getX()-e[3].getX(),o=e[1].getY()-e[3].getY(),s=(e[1].getX()+e[3].getX())/2,a=(e[1].getY()+e[3].getY())/2,[l,new ae(s+r*i,a+r*o),c,new ae(s-r*i,a-r*o)]}isValid(e,t){return e>=0&&e<this.image.getWidth()&&t>0&&t<this.image.getHeight()}isValidPoint(e){let t=oe.round(e.getX()),n=oe.round(e.getY());return this.isValid(t,n)}distancePoint(e,t){return oe.distance(e.getX(),e.getY(),t.getX(),t.getY())}distanceResultPoint(e,t){return oe.distance(e.getX(),e.getY(),t.getX(),t.getY())}getDimension(){return this.compact?4*this.nbLayers+11:this.nbLayers<=4?4*this.nbLayers+15:4*this.nbLayers+2*(E.truncDivision(this.nbLayers-4,8)+1)+15}}class we{decode(e,t=null){let n=null,r=new me(e.getBlackMatrix()),i=null,o=null;try{let e=r.detectMirror(!1);i=e.getPoints(),this.reportFoundResultPoints(t,i),o=(new ie).decode(e)}catch(e){n=e}if(null==o)try{let e=r.detectMirror(!0);i=e.getPoints(),this.reportFoundResultPoints(t,i),o=(new ie).decode(e)}catch(e){if(null!=n)throw n;throw e}let s=new j(o.getText(),o.getRawBytes(),o.getNumBits(),i,V.AZTEC,g.currentTimeMillis()),a=o.getByteSegments();null!=a&&s.putMetadata(q.BYTE_SEGMENTS,a);let l=o.getECLevel();return null!=l&&s.putMetadata(q.ERROR_CORRECTION_LEVEL,l),s}reportFoundResultPoints(e,t){if(null!=e){let n=e.get(C.NEED_RESULT_POINT_CALLBACK);null!=n&&t.forEach((e,t,r)=>{n.foundPossibleResultPoint(e)})}}reset(){}}class ye extends U{constructor(e=500){super(new we,e)}}class Ee{decode(e,t){try{return this.doDecode(e,t)}catch(n){if(t&&!0===t.get(C.TRY_HARDER)&&e.isRotateSupported()){const n=e.rotateCounterClockwise(),r=this.doDecode(n,t),i=r.getResultMetadata();let o=270;null!==i&&!0===i.get(q.ORIENTATION)&&(o+=i.get(q.ORIENTATION)%360),r.putMetadata(q.ORIENTATION,o);const s=r.getResultPoints();if(null!==s){const e=n.getHeight();for(let t=0;t<s.length;t++)s[t]=new ae(e-s[t].getY()-1,s[t].getX())}return r}throw new O}}reset(){}doDecode(e,t){const n=e.getWidth(),r=e.getHeight();let i=new v(n);const o=t&&!0===t.get(C.TRY_HARDER),s=Math.max(1,r>>(o?8:5));let a;a=o?r:15;const l=Math.trunc(r/2);for(let o=0;o<a;o++){const a=Math.trunc((o+1)/2),c=l+s*(1&o?-a:a);if(c<0||c>=r)break;try{i=e.getBlackRow(c,i)}catch(e){continue}for(let e=0;e<2;e++){if(1===e&&(i.reverse(),t&&!0===t.get(C.NEED_RESULT_POINT_CALLBACK))){const e=new Map;t.forEach((t,n)=>e.set(n,t)),e.delete(C.NEED_RESULT_POINT_CALLBACK),t=e}try{const r=this.decodeRow(c,i,t);if(1===e){r.putMetadata(q.ORIENTATION,180);const e=r.getResultPoints();null!==e&&(e[0]=new ae(n-e[0].getX()-1,e[0].getY()),e[1]=new ae(n-e[1].getX()-1,e[1].getY()))}return r}catch(e){}}}throw new O}static recordPattern(e,t,n){const r=n.length;for(let e=0;e<r;e++)n[e]=0;const i=e.getSize();if(t>=i)throw new O;let o=!e.get(t),s=0,a=t;for(;a<i;){if(e.get(a)!==o)n[s]++;else{if(++s===r)break;n[s]=1,o=!o}a++}if(s!==r&&(s!==r-1||a!==i))throw new O}static recordPatternInReverse(e,t,n){let r=n.length,i=e.get(t);for(;t>0&&r>=0;)e.get(--t)!==i&&(r--,i=!i);if(r>=0)throw new O;Ee.recordPattern(e,t+1,n)}static patternMatchVariance(e,t,n){const r=e.length;let i=0,o=0;for(let n=0;n<r;n++)i+=e[n],o+=t[n];if(i<o)return Number.POSITIVE_INFINITY;const s=i/o;n*=s;let a=0;for(let i=0;i<r;i++){const r=e[i],o=t[i]*s,l=r>o?r-o:o-r;if(l>n)return Number.POSITIVE_INFINITY;a+=l}return a/i}}class ve extends Ee{static findStartPattern(e){const t=e.getSize(),n=e.getNextSet(0);let r=0,i=Int32Array.from([0,0,0,0,0,0]),o=n,s=!1;const a=6;for(let l=n;l<t;l++)if(e.get(l)!==s)i[r]++;else{if(r===a-1){let t=ve.MAX_AVG_VARIANCE,n=-1;for(let e=ve.CODE_START_A;e<=ve.CODE_START_C;e++){const r=Ee.patternMatchVariance(i,ve.CODE_PATTERNS[e],ve.MAX_INDIVIDUAL_VARIANCE);r<t&&(t=r,n=e)}if(n>=0&&e.isRange(Math.max(0,o-(l-o)/2),o,!1))return Int32Array.from([o,l,n]);o+=i[0]+i[1],i=i.slice(2,i.length-1),i[r-1]=0,i[r]=0,r--}else r++;i[r]=1,s=!s}throw new O}static decodeCode(e,t,n){Ee.recordPattern(e,n,t);let r=ve.MAX_AVG_VARIANCE,i=-1;for(let e=0;e<ve.CODE_PATTERNS.length;e++){const n=ve.CODE_PATTERNS[e],o=this.patternMatchVariance(t,n,ve.MAX_INDIVIDUAL_VARIANCE);o<r&&(r=o,i=e)}if(i>=0)return i;throw new O}decodeRow(e,t,n){const r=n&&!0===n.get(C.ASSUME_GS1),i=ve.findStartPattern(t),o=i[2];let s=0;const a=new Uint8Array(20);let l;switch(a[s++]=o,o){case ve.CODE_START_A:l=ve.CODE_CODE_A;break;case ve.CODE_START_B:l=ve.CODE_CODE_B;break;case ve.CODE_START_C:l=ve.CODE_CODE_C;break;default:throw new b}let c=!1,u=!1,h="",d=i[0],p=i[1];const g=Int32Array.from([0,0,0,0,0,0]);let m=0,w=0,y=o,E=0,v=!0,A=!1,_=!1;for(;!c;){const e=u;switch(u=!1,m=w,w=ve.decodeCode(t,g,p),a[s++]=w,w!==ve.CODE_STOP&&(v=!0),w!==ve.CODE_STOP&&(E++,y+=E*w),d=p,p+=g.reduce((e,t)=>e+t,0),w){case ve.CODE_START_A:case ve.CODE_START_B:case ve.CODE_START_C:throw new b}switch(l){case ve.CODE_CODE_A:if(w<64)h+=_===A?String.fromCharCode(" ".charCodeAt(0)+w):String.fromCharCode(" ".charCodeAt(0)+w+128),_=!1;else if(w<96)h+=_===A?String.fromCharCode(w-64):String.fromCharCode(w+64),_=!1;else switch(w!==ve.CODE_STOP&&(v=!1),w){case ve.CODE_FNC_1:r&&(0===h.length?h+="]C1":h+=String.fromCharCode(29));break;case ve.CODE_FNC_2:case ve.CODE_FNC_3:break;case ve.CODE_FNC_4_A:!A&&_?(A=!0,_=!1):A&&_?(A=!1,_=!1):_=!0;break;case ve.CODE_SHIFT:u=!0,l=ve.CODE_CODE_B;break;case ve.CODE_CODE_B:l=ve.CODE_CODE_B;break;case ve.CODE_CODE_C:l=ve.CODE_CODE_C;break;case ve.CODE_STOP:c=!0}break;case ve.CODE_CODE_B:if(w<96)h+=_===A?String.fromCharCode(" ".charCodeAt(0)+w):String.fromCharCode(" ".charCodeAt(0)+w+128),_=!1;else switch(w!==ve.CODE_STOP&&(v=!1),w){case ve.CODE_FNC_1:r&&(0===h.length?h+="]C1":h+=String.fromCharCode(29));break;case ve.CODE_FNC_2:case ve.CODE_FNC_3:break;case ve.CODE_FNC_4_B:!A&&_?(A=!0,_=!1):A&&_?(A=!1,_=!1):_=!0;break;case ve.CODE_SHIFT:u=!0,l=ve.CODE_CODE_A;break;case ve.CODE_CODE_A:l=ve.CODE_CODE_A;break;case ve.CODE_CODE_C:l=ve.CODE_CODE_C;break;case ve.CODE_STOP:c=!0}break;case ve.CODE_CODE_C:if(w<100)w<10&&(h+="0"),h+=w;else switch(w!==ve.CODE_STOP&&(v=!1),w){case ve.CODE_FNC_1:r&&(0===h.length?h+="]C1":h+=String.fromCharCode(29));break;case ve.CODE_CODE_A:l=ve.CODE_CODE_A;break;case ve.CODE_CODE_B:l=ve.CODE_CODE_B;break;case ve.CODE_STOP:c=!0}}e&&(l=l===ve.CODE_CODE_A?ve.CODE_CODE_B:ve.CODE_CODE_A)}const S=p-d;if(p=t.getNextUnset(p),!t.isRange(p,Math.min(t.getSize(),p+(p-d)/2),!1))throw new O;if(y-=E*m,y%103!==m)throw new f;const I=h.length;if(0===I)throw new O;I>0&&v&&(h=l===ve.CODE_CODE_C?h.substring(0,I-2):h.substring(0,I-1));const T=(i[1]+i[0])/2,D=d+S/2,N=a.length,R=new Uint8Array(N);for(let e=0;e<N;e++)R[e]=a[e];const M=[new ae(T,e),new ae(D,e)];return new j(h,R,0,M,V.CODE_128,(new Date).getTime())}}ve.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])],ve.MAX_AVG_VARIANCE=.25,ve.MAX_INDIVIDUAL_VARIA
vendor: 4,152 bytes, line 2
2NCE=.7,ve.CODE_SHIFT=98,ve.CODE_CODE_C=99,ve.CODE_CODE_B=100,ve.CODE_CODE_A=101,ve.CODE_FNC_1=102,ve.CODE_FNC_2=97,ve.CODE_FNC_3=96,ve.CODE_FNC_4_A=101,ve.CODE_FNC_4_B=100,ve.CODE_START_A=103,ve.CODE_START_B=104,ve.CODE_START_C=105,ve.CODE_STOP=106;class Ae extends Ee{constructor(e=!1,t=!1){super(),this.usingCheckDigit=e,this.extendedMode=t,this.decodeRowResult="",this.counters=new Int32Array(9)}decodeRow(e,t,n){let r=this.counters;r.fill(0),this.decodeRowResult="";let i,o,s=Ae.findAsteriskPattern(t,r),a=t.getNextSet(s[1]),l=t.getSize();do{Ae.recordPattern(t,a,r);let e=Ae.toNarrowWidePattern(r);if(e<0)throw new O;i=Ae.patternToChar(e),this.decodeRowResult+=i,o=a;for(let e of r)a+=e;a=t.getNextSet(a)}while("*"!==i);this.decodeRowResult=this.decodeRowResult.substring(0,this.decodeRowResult.length-1);let c,u=0;for(let e of r)u+=e;if(a!==l&&2*(a-o-u)<u)throw new O;if(this.usingCheckDigit){let e=this.decodeRowResult.length-1,t=0;for(let n=0;n<e;n++)t+=Ae.ALPHABET_STRING.indexOf(this.decodeRowResult.charAt(n));if(this.decodeRowResult.charAt(e)!==Ae.ALPHABET_STRING.charAt(t%43))throw new f;this.decodeRowResult=this.decodeRowResult.substring(0,e)}if(0===this.decodeRowResult.length)throw new O;c=this.extendedMode?Ae.decodeExtended(this.decodeRowResult):this.decodeRowResult;let h=(s[1]+s[0])/2,d=o+u/2;return new j(c,null,0,[new ae(h,e),new ae(d,e)],V.CODE_39,(new Date).getTime())}static findAsteriskPattern(e,t){let n=e.getSize(),r=e.getNextSet(0),i=0,o=r,s=!1,a=t.length;for(let l=r;l<n;l++)if(e.get(l)!==s)t[i]++;else{if(i===a-1){if(this.toNarrowWidePattern(t)===Ae.ASTERISK_ENCODING&&e.isRange(Math.max(0,o-Math.floor((l-o)/2)),o,!1))return[o,l];o+=t[0]+t[1],t.copyWithin(0,2,2+i-1),t[i-1]=0,t[i]=0,i--}else i++;t[i]=1,s=!s}throw new O}static toNarrowWidePattern(e){let t,n=e.length,r=0;do{let i=2147483647;for(let t of e)t<i&&t>r&&(i=t);r=i,t=0;let o=0,s=0;for(let i=0;i<n;i++){let a=e[i];a>r&&(s|=1<<n-1-i,t++,o+=a)}if(3===t){for(let i=0;i<n&&t>0;i++){let n=e[i];if(n>r&&(t--,2*n>=o))return-1}return s}}while(t>3);return-1}static patternToChar(e){for(let t=0;t<Ae.CHARACTER_ENCODINGS.length;t++)if(Ae.CHARACTER_ENCODINGS[t]===e)return Ae.ALPHABET_STRING.charAt(t);if(e===Ae.ASTERISK_ENCODING)return"*";throw new O}static decodeExtended(e){let t=e.length,n="";for(let r=0;r<t;r++){let t=e.charAt(r);if("+"===t||"$"===t||"%"===t||"/"===t){let i=e.charAt(r+1),o="\0";switch(t){case"+":if(!(i>="A"&&i<="Z"))throw new b;o=String.fromCharCode(i.charCodeAt(0)+32);break;case"$":if(!(i>="A"&&i<="Z"))throw new b;o=String.fromCharCode(i.charCodeAt(0)-64);break;case"%":if(i>="A"&&i<="E")o=String.fromCharCode(i.charCodeAt(0)-38);else if(i>="F"&&i<="J")o=String.fromCharCode(i.charCodeAt(0)-11);else if(i>="K"&&i<="O")o=String.fromCharCode(i.charCodeAt(0)+16);else if(i>="P"&&i<="T")o=String.fromCharCode(i.charCodeAt(0)+43);else if("U"===i)o="\0";else if("V"===i)o="@";else if("W"===i)o="`";else{if("X"!==i&&"Y"!==i&&"Z"!==i)throw new b;o="�"}break;case"/":if(i>="A"&&i<="O")o=String.fromCharCode(i.charCodeAt(0)-32);else{if("Z"!==i)throw new b;o=":"}}n+=o,r++}else n+=t}return n}}Ae.ALPHABET_STRING="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-. $/+%",Ae.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],Ae.ASTERISK_ENCODING=148;class Ce extends Ee{constructor(){super(...arguments),this.narrowLineWidth=-1}decodeRow(e,t,n){let r=this.decodeStart(t),i=this.decodeEnd(t),o=new D;Ce.decodeMiddle(t,r[1],i[0],o);let s=o.toString(),a=null;null!=n&&(a=n.get(C.ALLOWED_LENGTHS)),null==a&&(a=Ce.DEFAULT_ALLOWED_LENGTHS);let l=s.length,c=!1,u=0;for(let e of a){if(l===e){c=!0;break}e>u&&(u=e)}if(!c&&l>u&&(c=!0),!c)throw new b;const h=[new ae(r[1],e),new ae(i[0],e)];return new j(s,null,0,h,V.ITF,(new Date).getTime())}static decodeMiddle(e,t,n,r){let i=new Int32Array(10),o=new Int32Array(5),s=new Int32Array(5);for(i.fill(0),o.fill(0),s.fill(0);t<n;){Ee.recordPattern(e,t,i);for(let e=0;e<5;e++){let t=2*e;o[e]=i[t],s[e]=i[t+1]}let n=Ce.decodeDigit(o);r.append(n.toString()),n=this.decodeDigit(s),r.append(n.toString()),i.forEac
vendor: 8,054 bytes, line 2
2h(function(e){t+=e})}}decodeStart(e){let t=Ce.skipWhiteSpace(e),n=Ce.findGuardPattern(e,t,Ce.START_PATTERN);return this.narrowLineWidth=(n[1]-n[0])/4,this.validateQuietZone(e,n[0]),n}validateQuietZone(e,t){let n=10*this.narrowLineWidth;n=n<t?n:t;for(let r=t-1;n>0&&r>=0&&!e.get(r);r--)n--;if(0!==n)throw new O}static skipWhiteSpace(e){const t=e.getSize(),n=e.getNextSet(0);if(n===t)throw new O;return n}decodeEnd(e){e.reverse();try{let t,n=Ce.skipWhiteSpace(e);try{t=Ce.findGuardPattern(e,n,Ce.END_PATTERN_REVERSED[0])}catch(r){r instanceof O&&(t=Ce.findGuardPattern(e,n,Ce.END_PATTERN_REVERSED[1]))}this.validateQuietZone(e,t[0]);let r=t[0];return t[0]=e.getSize()-t[1],t[1]=e.getSize()-r,t}finally{e.reverse()}}static findGuardPattern(e,t,n){let r=n.length,i=new Int32Array(r),o=e.getSize(),s=!1,a=0,l=t;i.fill(0);for(let c=t;c<o;c++)if(e.get(c)!==s)i[a]++;else{if(a===r-1){if(Ee.patternMatchVariance(i,n,Ce.MAX_INDIVIDUAL_VARIANCE)<Ce.MAX_AVG_VARIANCE)return[l,c];l+=i[0]+i[1],g.arraycopy(i,2,i,0,a-1),i[a-1]=0,i[a]=0,a--}else a++;i[a]=1,s=!s}throw new O}static decodeDigit(e){let t=Ce.MAX_AVG_VARIANCE,n=-1,r=Ce.PATTERNS.length;for(let i=0;i<r;i++){let r=Ce.PATTERNS[i],o=Ee.patternMatchVariance(e,r,Ce.MAX_INDIVIDUAL_VARIANCE);o<t?(t=o,n=i):o===t&&(n=-1)}if(n>=0)return n%10;throw new O}}Ce.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])],Ce.MAX_AVG_VARIANCE=.38,Ce.MAX_INDIVIDUAL_VARIANCE=.5,Ce.DEFAULT_ALLOWED_LENGTHS=[6,8,10,12,14],Ce.START_PATTERN=Int32Array.from([1,1,1,1]),Ce.END_PATTERN_REVERSED=[Int32Array.from([1,1,2]),Int32Array.from([1,1,3])];class be extends Ee{constructor(){super(...arguments),this.decodeRowStringBuffer=""}static findStartGuardPattern(e){let t,n=!1,r=0,i=Int32Array.from([0,0,0]);for(;!n;){i=Int32Array.from([0,0,0]),t=be.findGuardPattern(e,r,!1,this.START_END_PATTERN,i);let o=t[0];r=t[1];let s=o-(r-o);s>=0&&(n=e.isRange(s,o,!1))}return t}static checkChecksum(e){return be.checkStandardUPCEANChecksum(e)}static checkStandardUPCEANChecksum(e){let t=e.length;if(0===t)return!1;let n=parseInt(e.charAt(t-1),10);return be.getStandardUPCEANChecksum(e.substring(0,t-1))===n}static getStandardUPCEANChecksum(e){let t=e.length,n=0;for(let r=t-1;r>=0;r-=2){let t=e.charAt(r).charCodeAt(0)-"0".charCodeAt(0);if(t<0||t>9)throw new b;n+=t}n*=3;for(let r=t-2;r>=0;r-=2){let t=e.charAt(r).charCodeAt(0)-"0".charCodeAt(0);if(t<0||t>9)throw new b;n+=t}return(1e3-n)%10}static decodeEnd(e,t){return be.findGuardPattern(e,t,!1,be.START_END_PATTERN,new Int32Array(be.START_END_PATTERN.length).fill(0))}static findGuardPatternWithoutCounters(e,t,n,r){return this.findGuardPattern(e,t,n,r,new Int32Array(r.length))}static findGuardPattern(e,t,n,r,i){let o=e.getSize(),s=0,a=t=n?e.getNextUnset(t):e.getNextSet(t),l=r.length,c=n;for(let n=t;n<o;n++)if(e.get(n)!==c)i[s]++;else{if(s===l-1){if(Ee.patternMatchVariance(i,r,be.MAX_INDIVIDUAL_VARIANCE)<be.MAX_AVG_VARIANCE)return Int32Array.from([a,n]);a+=i[0]+i[1];let e=i.slice(2,i.length-1);for(let t=0;t<s-1;t++)i[t]=e[t];i[s-1]=0,i[s]=0,s--}else s++;i[s]=1,c=!c}throw new O}static decodeDigit(e,t,n,r){this.recordPattern(e,n,t);let i=this.MAX_AVG_VARIANCE,o=-1,s=r.length;for(let e=0;e<s;e++){let n=r[e],s=Ee.patternMatchVariance(t,n,be.MAX_INDIVIDUAL_VARIANCE);s<i&&(i=s,o=e)}if(o>=0)return o;throw new O}}be.MAX_AVG_VARIANCE=.48,be.MAX_INDIVIDUAL_VARIANCE=.7,be.START_END_PATTERN=Int32Array.from([1,1,1]),be.MIDDLE_PATTERN=Int32Array.from([1,1,1,1,1]),be.END_PATTERN=Int32Array.from([1,1,1,1,1,1]),be.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])];class _e{constructor(){this.CHECK_DIGIT_ENCODINGS=[24,20,18,17,12,6,3,10,9,5],this.decodeMiddleCounters=Int32Array.from([0,0,0,0]),this.decodeRowStringBuffer=""}decodeRow(e,t,n){let r=this.decodeRowStringBuffer,i=this.decodeMiddle(t,n,r),o=r.toString(),s=_e.parseExtensionString(o),a=[new ae((n[0]+n[1])/2,e),new ae(i,e)],l=new j(o,null,0,a,V.UPC_EAN_EXTENSION,(new Date).getTime());return null!=s&&l.putAllMetadata(s),l}decodeMiddle(e,t,n){let r=this.decodeMiddleCounters;r[0]=0,r[1]=0,r[2]=0,r[3]=0;let i=e.getSize(),o=t[1],s=0;for(let t=0;t<5&&o<i;t++){let i=be.decodeDigit(e,r,o,be.L_AND_G_PATTERNS);n+=String.fromCharCode("0".charCodeAt(0)+i%10);for(let e of r)o+=e;i>=10&&(s|=1<<4-t),4!==t&&(o=e.getNextSet(o),o=e.getNextUnset(o))}if(5!==n.length)throw new O;let a=this.determineCheckDigit(s);if(_e.extensionChecksum(n.toString())!==a)throw new O;return o}static extensionChecksum(e){let t=e.length,n=0;for(let r=t-2;r>=0;r-=2)n+=e.charAt(r).charCodeAt(0)-"0".charCodeAt(0);n*=3;for(let r=t-1;r>=0;r-=2)n+=e.charAt(r).charCodeAt(0)-"0".charCodeAt(0);return n*=3,n%10}determineCheckDigit(e){for(let t=0;t<10;t++)if(e===this.CHECK_DIGIT_ENCODINGS[t])return t;throw new O}static parseExtensionString(e){if(5!==e.length)return null;let t=_e.parseExtension5String(e);return null==t?null:new Map([[q.SUGGESTED_PRICE,t]])}static parseExtension5String(e){let t;switch(e.charAt(0)){case"0":t="£";break;case"5":t="$";break;case"9":switch(e){case"90000":return null;case"99991":return"0.00";case"99990":return"Used"}t="";break;default:t=""}let n=parseInt(e.substring(1)),r=n%100;return t+(n/100).toString()+"."+(r<10?"0"+r:r.toString())}}class Se{constructor(){this.decodeMiddleCounters=Int32Array.from([0,0,0,0]),this.decodeRowStringBuffer=""}decodeRow(e,t,n){let r=this.decodeRowStringBuffer,i=this.decodeMiddle(t,n,r),o=r.toString(),s=Se.parseExtensionString(o),a=[new ae((n[0]+n[1])/2,e),new ae(i,e)],l=new j(o,null,0,a,V.UPC_EAN_EXTENSION,(new Date).getTime());return null!=s&&l.putAllMetadata(s),l}decodeMiddle(e,t,n){let r=this.decodeMiddleCounters;r[0]=0,r[1]=0,r[2]=0,r[3]=0;let i=e.getSize(),o=t[1],s=0;for(let t=0;t<2&&o<i;t++){let i=be.decodeDigit(e,r,o,be.L_AND_G_PATTERNS);n+=String.fromCharCode("0".charCodeAt(0)+i%10);for(let e of r)o+=e;i>=10&&(s|=1<<1-t),1!==t&&(o=e.getNextSet(o),o=e.getNextUnset(o))}if(2!==n.length)throw new O;if(parseInt(n.toString())%4!==s)throw new O;return o}static parseExtensionString(e){return 2!==e.length?null:new Map([[q.ISSUE_NUMBER,parseInt(e)]])}}class Ie{static decodeRow(e,t,n){let r=be.findGuardPattern(t,n,!1,this.EXTENSION_START_PATTERN,new Int32Array(this.EXTENSION_START_PATTERN.length).fill(0));try{return(new _e).decodeRow(e,t,r)}catch(n){return(new Se).decodeRow(e,t,r)}}}Ie.EXTENSION_START_PATTERN=Int32Array.from([1,1,2]);class Te extends be{constructor(){super(),this.decodeRowStringBuffer="",Te.L_AND_G_PATTERNS=Te.L_PATTERNS.map(e=>Int32Array.from(e));for(let e=10;e<20;e++){let t=Te.L_PATTERNS[e-10],n=new Int32Array(t.length);for(let e=0;e<t.length;e++)n[e]=t[t.length-e-1];Te.L_AND_G_PATTERNS[e]=n}}decodeRow(e,t,n){let r=Te.findStartGuardPattern(t),i=null==n?null:n.get(C.NEED_RESULT_POINT_CALLBACK);if(null!=i){const t=new ae((r[0]+r[1])/2,e);i.foundPossibleResultPoint(t)}let o=this.decodeMiddle(t,r,this.decodeRowStringBuffer),s=o.rowOffset,a=o.resultString;if(null!=i){const t=new ae(s,e);i.foundPossibleResultPoint(t)}let l=this.decodeEnd(t,s);if(null!=i){const t=new ae((l[0]+l[1])/2,e);i.foundPossibleResultPoint(t)}let c=l[1],u=c+(c-l[0]);if(u>=t.getSize()||!t.isRange(c,u,!1))throw new O;let h=a.toString();if(h.length<8)throw new b;if(!Te.checkChecksum(h))throw new f;let d=(r[1]+r[0])/2,p=(l[1]+l[0])/2,g=this.getBarcodeFormat(),m=[new ae(d,e),new ae(p,e)],w=new j(h,null,0,m,g,(ne
vendor: 51,303 bytes, line 2
2w Date).getTime()),y=0;try{let n=Ie.decodeRow(e,t,l[1]);w.putMetadata(q.UPC_EAN_EXTENSION,n.getText()),w.putAllMetadata(n.getResultMetadata()),w.addResultPoints(n.getResultPoints()),y=n.getText().length}catch(e){}let E=null==n?null:n.get(C.ALLOWED_EAN_EXTENSIONS);if(null!=E){let e=!1;for(let t in E)if(y.toString()===t){e=!0;break}if(!e)throw new O}return w}decodeEnd(e,t){return Te.findGuardPattern(e,t,!1,Te.START_END_PATTERN,new Int32Array(Te.START_END_PATTERN.length).fill(0))}static checkChecksum(e){return Te.checkStandardUPCEANChecksum(e)}static checkStandardUPCEANChecksum(e){let t=e.length;if(0===t)return!1;let n=parseInt(e.charAt(t-1),10);return Te.getStandardUPCEANChecksum(e.substring(0,t-1))===n}static getStandardUPCEANChecksum(e){let t=e.length,n=0;for(let r=t-1;r>=0;r-=2){let t=e.charAt(r).charCodeAt(0)-"0".charCodeAt(0);if(t<0||t>9)throw new b;n+=t}n*=3;for(let r=t-2;r>=0;r-=2){let t=e.charAt(r).charCodeAt(0)-"0".charCodeAt(0);if(t<0||t>9)throw new b;n+=t}return(1e3-n)%10}}class De extends Te{constructor(){super(),this.decodeMiddleCounters=Int32Array.from([0,0,0,0])}decodeMiddle(e,t,n){let r=this.decodeMiddleCounters;r[0]=0,r[1]=0,r[2]=0,r[3]=0;let i=e.getSize(),o=t[1],s=0;for(let t=0;t<6&&o<i;t++){let i=Te.decodeDigit(e,r,o,Te.L_AND_G_PATTERNS);n+=String.fromCharCode("0".charCodeAt(0)+i%10);for(let e of r)o+=e;i>=10&&(s|=1<<5-t)}n=De.determineFirstDigit(n,s),o=Te.findGuardPattern(e,o,!0,Te.MIDDLE_PATTERN,new Int32Array(Te.MIDDLE_PATTERN.length).fill(0))[1];for(let t=0;t<6&&o<i;t++){let t=Te.decodeDigit(e,r,o,Te.L_PATTERNS);n+=String.fromCharCode("0".charCodeAt(0)+t);for(let e of r)o+=e}return{rowOffset:o,resultString:n}}getBarcodeFormat(){return V.EAN_13}static determineFirstDigit(e,t){for(let n=0;n<10;n++)if(t===this.FIRST_DIGIT_ENCODINGS[n])return e=String.fromCharCode("0".charCodeAt(0)+n)+e;throw new O}}De.FIRST_DIGIT_ENCODINGS=[0,11,13,14,19,25,28,21,22,26];class Ne extends Te{constructor(){super(),this.decodeMiddleCounters=Int32Array.from([0,0,0,0])}decodeMiddle(e,t,n){const r=this.decodeMiddleCounters;r[0]=0,r[1]=0,r[2]=0,r[3]=0;let i=e.getSize(),o=t[1];for(let t=0;t<4&&o<i;t++){let t=Te.decodeDigit(e,r,o,Te.L_PATTERNS);n+=String.fromCharCode("0".charCodeAt(0)+t);for(let e of r)o+=e}o=Te.findGuardPattern(e,o,!0,Te.MIDDLE_PATTERN,new Int32Array(Te.MIDDLE_PATTERN.length).fill(0))[1];for(let t=0;t<4&&o<i;t++){let t=Te.decodeDigit(e,r,o,Te.L_PATTERNS);n+=String.fromCharCode("0".charCodeAt(0)+t);for(let e of r)o+=e}return{rowOffset:o,resultString:n}}getBarcodeFormat(){return V.EAN_8}}class Oe extends Te{constructor(){super(...arguments),this.ean13Reader=new De}getBarcodeFormat(){return V.UPC_A}decode(e,t){return this.maybeReturnResult(this.ean13Reader.decode(e))}decodeRow(e,t,n){return this.maybeReturnResult(this.ean13Reader.decodeRow(e,t,n))}decodeMiddle(e,t,n){return this.ean13Reader.decodeMiddle(e,t,n)}maybeReturnResult(e){let t=e.getText();if("0"===t.charAt(0)){let n=new j(t.substring(1),null,null,e.getResultPoints(),V.UPC_A);return null!=e.getResultMetadata()&&n.putAllMetadata(e.getResultMetadata()),n}throw new O}reset(){this.ean13Reader.reset()}}class Re extends Te{constructor(){super(),this.decodeMiddleCounters=new Int32Array(4)}decodeMiddle(e,t,n){const r=this.decodeMiddleCounters.map(e=>e);r[0]=0,r[1]=0,r[2]=0,r[3]=0;const i=e.getSize();let o=t[1],s=0;for(let t=0;t<6&&o<i;t++){const i=Re.decodeDigit(e,r,o,Re.L_AND_G_PATTERNS);n+=String.fromCharCode("0".charCodeAt(0)+i%10);for(let e of r)o+=e;i>=10&&(s|=1<<5-t)}return{rowOffset:o,resultString:Re.determineNumSysAndCheckDigit(n,s)}}decodeEnd(e,t){return Re.findGuardPatternWithoutCounters(e,t,!0,Re.MIDDLE_END_PATTERN)}checkChecksum(e){return Te.checkChecksum(Re.convertUPCEtoUPCA(e))}static determineNumSysAndCheckDigit(e,t){for(let n=0;n<=1;n++)for(let r=0;r<10;r++)if(t===this.NUMSYS_AND_CHECK_DIGIT_PATTERNS[n][r])return String.fromCharCode("0".charCodeAt(0)+n)+e+String.fromCharCode("0".charCodeAt(0)+r);throw O.getNotFoundInstance()}getBarcodeFormat(){return V.UPC_E}static convertUPCEtoUPCA(e){const t=e.slice(1,7).split("").map(e=>e.charCodeAt(0)),n=new D;n.append(e.charAt(0));let r=t[5];switch(r){case 0:case 1:case 2:n.appendChars(t,0,2),n.append(r),n.append("0000"),n.appendChars(t,2,3);break;case 3:n.appendChars(t,0,3),n.append("00000"),n.appendChars(t,3,2);break;case 4:n.appendChars(t,0,4),n.append("00000"),n.append(t[4]);break;default:n.appendChars(t,0,5),n.append("0000"),n.append(r)}return e.length>=8&&n.append(e.charAt(7)),n.toString()}}Re.MIDDLE_END_PATTERN=Int32Array.from([1,1,1,1,1,1]),Re.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,26])];class Me extends Ee{constructor(e){super();let n=null==e?null:e.get(C.POSSIBLE_FORMATS),r=[];t(n)?(r.push(new De),r.push(new Oe),r.push(new Ne),r.push(new Re)):(n.indexOf(V.EAN_13)>-1&&r.push(new De),n.indexOf(V.UPC_A)>-1&&r.push(new Oe),n.indexOf(V.EAN_8)>-1&&r.push(new Ne),n.indexOf(V.UPC_E)>-1&&r.push(new Re)),this.readers=r}decodeRow(e,t,n){for(let r of this.readers)try{const i=r.decodeRow(e,t,n),o=i.getBarcodeFormat()===V.EAN_13&&"0"===i.getText().charAt(0),s=null==n?null:n.get(C.POSSIBLE_FORMATS),a=null==s||s.includes(V.UPC_A);if(o&&a){const e=i.getRawBytes(),t=new j(i.getText().substring(1),e,e?e.length:null,i.getResultPoints(),V.UPC_A);return t.putAllMetadata(i.getResultMetadata()),t}return i}catch(e){}throw new O}reset(){for(let e of this.readers)e.reset()}}class Pe extends Ee{constructor(){super(),this.decodeFinderCounters=new Int32Array(4),this.dataCharacterCounters=new Int32Array(8),this.oddRoundingErrors=new Array(4),this.evenRoundingErrors=new Array(4),this.oddCounts=new Array(this.dataCharacterCounters.length/2),this.evenCounts=new Array(this.dataCharacterCounters.length/2)}getDecodeFinderCounters(){return this.decodeFinderCounters}getDataCharacterCounters(){return this.dataCharacterCounters}getOddRoundingErrors(){return this.oddRoundingErrors}getEvenRoundingErrors(){return this.evenRoundingErrors}getOddCounts(){return this.oddCounts}getEvenCounts(){return this.evenCounts}parseFinderValue(e,t){for(let n=0;n<t.length;n++)if(Ee.patternMatchVariance(e,t[n],Pe.MAX_INDIVIDUAL_VARIANCE)<Pe.MAX_AVG_VARIANCE)return n;throw new O}static count(e){return oe.sum(new Int32Array(e))}static increment(e,t){let n=0,r=t[0];for(let i=1;i<e.length;i++)t[i]>r&&(r=t[i],n=i);e[n]++}static decrement(e,t){let n=0,r=t[0];for(let i=1;i<e.length;i++)t[i]<r&&(r=t[i],n=i);e[n]--}static isFinderPattern(e){let t=e[0]+e[1],n=t/(t+e[2]+e[3]);if(n>=Pe.MIN_FINDER_PATTERN_RATIO&&n<=Pe.MAX_FINDER_PATTERN_RATIO){let t=Number.MAX_SAFE_INTEGER,n=Number.MIN_SAFE_INTEGER;for(let r of e)r>n&&(n=r),r<t&&(t=r);return n<10*t}return!1}}Pe.MAX_AVG_VARIANCE=.2,Pe.MAX_INDIVIDUAL_VARIANCE=.45,Pe.MIN_FINDER_PATTERN_RATIO=9.5/12,Pe.MAX_FINDER_PATTERN_RATIO=12.5/14;class ke{constructor(e,t){this.value=e,this.checksumPortion=t}getValue(){return this.value}getChecksumPortion(){return this.checksumPortion}toString(){return this.value+"("+this.checksumPortion+")"}equals(e){if(!(e instanceof ke))return!1;const t=e;return this.value===t.value&&this.checksumPortion===t.checksumPortion}hashCode(){return this.value^this.checksumPortion}}class xe{constructor(e,t,n,r,i){this.value=e,this.startEnd=t,this.value=e,this.startEnd=t,this.resultPoints=new Array,this.resultPoints.push(new ae(n,i)),this.resultPoints.push(new ae(r,i))}getValue(){return this.value}getStartEnd(){return this.startEnd}getResultPoints(){return this.resultPoints}equals(e){if(!(e instanceof xe))return!1;const t=e;return this.value===t.value}hashCode(){return this.value}}class Le{constructor(){}static getRSSvalue(e,t,n){let r=0;for(let t of e)r+=t;let i=0,o=0,s=e.length;for(let a=0;a<s-1;a++){let l;for(l=1,o|=1<<a;l<e[a];l++,o&=~(1<<a)){let e=Le.combins(r-l-1,s-a-2);if(n&&0===o&&r-l-(s-a-1)>=s-a-1&&(e-=Le.combins(r-l-(s-a),s-a-2)),s-a-1>1){let n=0;for(let e=r-l-(s-a-2);e>t;e--)n+=Le.combins(r-l-e-1,s-a-3);e-=n*(s-1-a)}else r-l>t&&e--;i+=e}r-=l}return i}static combins(e,t){let n,r;e-t>t?(r=t,n=e-t):(r=e-t,n=t);let i=1,o=1;for(let t=e;t>n;t--)i*=t,o<=r&&(i/=o,o++);for(;o<=r;)i/=o,o++;return i}}class Be{static buildBitArray(e){let t=2*e.length-1;null==e[e.length-1].getRightChar()&&(t-=1);let n=new v(12*t),r=0,i=e[0].getRightChar().getValue();for(let e=11;e>=0;--e)i&1<<e&&n.set(r),r++;for(let t=1;t<e.length;++t){let i=e[t],o=i.getLeftChar().getValue();for(let e=11;e>=0;--e)o&1<<e&&n.set(r),r++;if(null!=i.getRightChar()){let e=i.getRightChar().getValue();for(let t=11;t>=0;--t)e&1<<t&&n.set(r),r++}}return n}}class Fe{constructor(e,t){t?this.decodedInformation=null:(this.finished=e,this.decodedInformation=t)}getDecodedInformation(){return this.decodedInformation}isFinished(){return this.finished}}class Ue{constructor(e){this.newPosition=e}getNewPosition(){return this.newPosition}}class je extends Ue{constructor(e,t){super(e),this.value=t}getValue(){return this.value}isFNC1(){return this.value===je.FNC1}}je.FNC1="$";class He extends Ue{constructor(e,t,n){super(e),n?(this.remaining=!0,this.remainingValue=this.remainingValue):(this.remaining=!1,this.remainingValue=0),this.newString=t}getNewString(){return this.newString}isRemaining(){return this.remaining}getRemainingValue(){return this.remainingValue}}class Ve extends Ue{constructor(e,t,n){if(super(e),t<0||t>10||n<0||n>10)throw new b;this.firstDigit=t,this.secondDigit=n}getFirstDigit(){return this.firstDigit}getSecondDigit(){return this.secondDigit}getValue(){return 10*this.firstDigit+this.secondDigit}isFirstDigitFNC1(){return this.firstDigit===Ve.FNC1}isSecondDigitFNC1(){return this.secondDigit===Ve.FNC1}isAnyFNC1(){return this.firstDigit===Ve.FNC1||this.secondDigit===Ve.FNC1}}Ve.FNC1=10;class ze{constructor(){}static parseFieldsInGeneralPurpose(e){if(!e)return null;if(e.length<2)throw new O;let t=e.substring(0,2);for(let n of ze.TWO_DIGIT_DATA_LENGTH)if(n[0]===t)return n[1]===ze.VARIABLE_LENGTH?ze.processVariableAI(2,n[2],e):ze.processFixedAI(2,n[1],e);if(e.length<3)throw new O;let n=e.substring(0,3);for(let t of ze.THREE_DIGIT_DATA_LENGTH)if(t[0]===n)return t[1]===ze.VARIABLE_LENGTH?ze.processVariableAI(3,t[2],e):ze.processFixedAI(3,t[1],e);for(let t of ze.THREE_DIGIT_PLUS_DIGIT_DATA_LENGTH)if(t[0]===n)return t[1]===ze.VARIABLE_LENGTH?ze.processVariableAI(4,t[2],e):ze.processFixedAI(4,t[1],e);if(e.length<4)throw new O;let r=e.substring(0,4);for(let t of ze.FOUR_DIGIT_DATA_LENGTH)if(t[0]===r)return t[1]===ze.VARIABLE_LENGTH?ze.processVariableAI(4,t[2],e):ze.processFixedAI(4,t[1],e);throw new O}static processFixedAI(e,t,n){if(n.length<e)throw new O;let r=n.substring(0,e);if(n.length<e+t)throw new O;let i=n.substring(e,e+t),o=n.substring(e+t),s="("+r+")"+i,a=ze.parseFieldsInGeneralPurpose(o);return null==a?s:s+a}static processVariableAI(e,t,n){let r,i=n.substring(0,e);r=n.length<e+t?n.length:e+t;let o=n.substring(e,r),s=n.substring(r),a="("+i+")"+o,l=ze.parseFieldsInGeneralPurpose(s);return null==l?a:a+l}}ze.VARIABLE_LENGTH=[],ze.TWO_DIGIT_DATA_LENGTH=[["00",18],["01",14],["02",14],["10",ze.VARIABLE_LENGTH,20],["11",6],["12",6],["13",6],["15",6],["17",6],["20",2],["21",ze.VARIABLE_LENGTH,20],["22",ze.VARIABLE_LENGTH,29],["30",ze.VARIABLE_LENGTH,8],["37",ze.VARIABLE_LENGTH,8],["90",ze.VARIABLE_LENGTH,30],["91",ze.VARIABLE_LENGTH,30],["92",ze.VARIABLE_LENGTH,30],["93",ze.VARIABLE_LENGTH,30],["94",ze.VARIABLE_LENGTH,30],["95",ze.VARIABLE_LENGTH,30],["96",ze.VARIABLE_LENGTH,30],["97",ze.VARIABLE_LENGTH,3],["98",ze.VARIABLE_LENGTH,30],["99",ze.VARIABLE_LENGTH,30]],ze.THREE_DIGIT_DATA_LENGTH=[["240",ze.VARIABLE_LENGTH,30],["241",ze.VARIABLE_LENGTH,30],["242",ze.VARIABLE_LENGTH,6],["250",ze.VARIABLE_LENGTH,30],["251",ze.VARIABLE_LENGTH,30],["253",ze.VARIABLE_LENGTH,17],["254",ze.VARIABLE_LENGTH,20],["400",ze.VARIABLE_LENGTH,30],["401",ze.VARIABLE_LENGTH,30],["402",17],["403",ze.VARIABLE_LENGTH,30],["410",13],["411",13],["412",13],["413",13],["414",13],["420",ze.VARIABLE_LENGTH,20],["421",ze.VARIABLE_LENGTH,15],["422",3],["423",ze.VARIABLE_LENGTH,15],["424",3],["425",3],["426",3]],ze.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",ze.VARIABLE_LENGTH,15],["391",ze.VARIABLE_LENGTH,18],["392",ze.VARIABLE_LENGTH,15],["393",ze.VARIABLE_LENGTH,18],["703",ze.VARIABLE_LENGTH,30]],ze.FOUR_DIGIT_DATA_LENGTH=[["7001",13],["7002",ze.VARIABLE_LENGTH,30],["7003",10],["8001",14],["8002",ze.VARIABLE_LENGTH,20],["8003",ze.VARIABLE_LENGTH,30],["8004",ze.VARIABLE_LENGTH,30],["8005",6],["8006",18],["8007",ze.VARIABLE_LENGTH,30],["8008",ze.VARIABLE_LENGTH,12],["8018",18],["8020",ze.VARIABLE_LENGTH,25],["8100",6],["8101",10],["8102",2],["8110",ze.VARIABLE_LENGTH,70],["8200",ze.VARIABLE_LENGTH,70]];class Ge{constructor(e){this.buffer=new D,this.information=e}decodeAllCodes(e,t){let n=t,r=null;for(;;){let t=this.decodeGeneralPurposeField(n,r),i=ze.parseFieldsInGeneralPurpose(t.getNewString());if(null!=i&&e.append(i),r=t.isRemaining()?""+t.getRemainingValue():null,n===t.getNewPosition())break;n=t.getNewPosition()}return e.toString()}isStillNumeric(e){if(e+7>this.information.getSize())return e+4<=this.information.getSize();for(let t=e;t<e+3;++t)if(this.information.get(t))return!0;return this.information.get(e+3)}decodeNumeric(e){if(e+7>this.information.getSize()){let t=this.extractNumericValueFromBitArray(e,4);return new Ve(this.information.getSize(),0===t?Ve.FNC1:t-1,Ve.FNC1)}let t=this.extractNumericValueFromBitArray(e,7);return new Ve(e+7,(t-8)/11,(t-8)%11)}extractNumericValueFromBitArray(e,t){return Ge.extractNumericValueFromBitArray(this.information,e,t)}static extractNumericValueFromBitArray(e,t,n){let r=0;for(let i=0;i<n;++i)e.get(t+i)&&(r|=1<<n-i-1);return r}decodeGeneralPurposeField(e,t){this.buffer.setLengthToZero(),null!=t&&this.buffer.append(t),this.current.setPosition(e);let n=this.parseBlocks();return null!=n&&n.isRemaining()?new He(this.current.getPosition(),this.buffer.toString(),n.getRemainingValue()):new He(this.current.getPosition(),this.buffer.toString())}parseBlocks(){let e,t;do{let n=this.current.getPosition();if(this.current.isAlpha()?(t=this.parseAlphaBlock(),e=t.isFinished()):this.current.isIsoIec646()?(t=this.parseIsoIec646Block(),e=t.isFinished()):(t=this.parseNumericBlock(),e=t.isFinished()),n===this.current.getPosition()&&!e)break}while(!e);return t.getDecodedInformation()}parseNumericBlock(){for(;this.isStillNumeric(this.current.getPosition());){let e=this.decodeNumeric(this.current.getPosition());if(this.current.setPosition(e.getNewPosition()),e.isFirstDigitFNC1()){let t;return t=e.isSecondDigitFNC1()?new He(this.current.getPosition(),this.buffer.toString()):new He(this.current.getPosition(),this.buffer.toString(),e.getSecondDigit()),new Fe(!0,t)}if(this.buffer.append(e.getFirstDigit()),e.isSecondDigitFNC1()){let e=new He(this.current.getPosition(),this.buffer.toString());return new Fe(!0,e)}this.buffer.append(e.getSecondDigit())}return this.isNumericToAlphaNumericLatch(this.current.getPosition())&&(this.current.setAlpha(),this.current.incrementPosition(4)),new Fe(!1)}parseIsoIec646Block(){for(;this.isStillIsoIec646(this.current.getPosition());){let e=this.decodeIsoIec646(this.current.getPosition());if(this.current.setPosition(e.getNewPosition()),e.isFNC1()){let e=new He(this.current.getPosition(),this.buffer.toString());return new Fe(!0,e)}this.buffer.append(e.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 Fe(!1)}parseAlphaBlock(){for(;this.isStillAlpha(this.current.getPosition());){let e=this.decodeAlphanumeric(this.current.getPosition());if(this.current.setPosition(e.getNewPosition()),e.isFNC1()){let e=new He(this.current.getPosition(),this.buffer.toString());return new Fe(!0,e)}this.buffer.append(e.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 Fe(!1)}isStillIsoIec646(e){if(e+5>this.information.getSize())return!1;let t=this.extractNumericValueFromBitArray(e,5);if(t>=5&&t<16)return!0;if(e+7>this.information.getSize())return!1;let n=this.extractNumericValueFromBitArray(e,7);if(n>=64&&n<116)return!0;if(e+8>this.information.getSize())return!1;let r=this.extractNumericValueFromBitArray(e,8);return r>=232&&r<253}decodeIsoIec646(e){let t=this.extractNumericValueFromBitArray(e,5);if(15===t)return new je(e+5,je.FNC1);if(t>=5&&t<15)return new je(e+5,"0"+(t-5));let n,r=this.extractNumericValueFromBitArray(e,7);if(r>=64&&r<90)return new je(e+7,""+(r+1));if(r>=90&&r<116)return new je(e+7,""+(r+7));switch(this.extractNumericValueFromBitArray(e,8)){case 232:n="!";break;case 233:n='"';break;case 234:n="%";break;case 235:n="&";break;case 236:n="'";break;case 237:n="(";break;case 238:n=")";break;case 239:n="*";break;case 240:n="+";break;case 241:n=",";break;case 242:n="-";break;case 243:n=".";break;case 244:n="/";break;case 245:n=":";break;case 246:n=";";break;case 247:n="<";break;case 248:n="=";break;case 249:n=">";break;case 250:n="?";break;case 251:n="_";break;case 252:n=" ";break;default:throw new b}return new je(e+8,n)}isStillAlpha(e){if(e+5>this.information.getSize())return!1;let t=this.extractNumericValueFromBitArray(e,5);if(t>=5&&t<16)return!0;if(e+6>this.information.getSize())return!1;let n=this.extractNumericValueFromBitArray(e,6);return n>=16&&n<63}decodeAlphanumeric(e){let t=this.extractNumericValueFromBitArray(e,5);if(15===t)return new je(e+5,je.FNC1);if(t>=5&&t<15)return new je(e+5,"0"+(t-5));let n,r=this.extractNumericValueFromBitArray(e,6);if(r>=32&&r<58)return new je(e+6,""+(r+33));switch(r){case 58:n="*";break;case 59:n=",";break;case 60:n="-";break;case 61:n=".";break;case 62:n="/";break;default:throw new ne("Decoding invalid alphanumeric value: "+r)}return new je(e+6,n)}isAlphaTo646ToAlphaLatch(e){if(e+1>this.information.getSize())return!1;for(let t=0;t<5&&t+e<this.information.getSize();++t)if(2===t){if(!this.information.get(e+2))return!1}else if(this.information.get(e+t))return!1;return!0}isAlphaOr646ToNumericLatch(e){if(e+3>this.information.getSize())return!1;for(let t=e;t<e+3;++t)if(this.information.get(t))return!1;return!0}isNumericToAlphaNumericLatch(e){if(e+1>this.information.getSize())return!1;for(let t=0;t<4&&t+e<this.information.getSize();++t)if(this.information.get(e+t))return!1;return!0}}class We{constructor(e){this.information=e,this.generalDecoder=new Ge(e)}getInformation(){return this.information}getGeneralDecoder(){return this.generalDecoder}}class Ye extends We{constructor(e){super(e)}encodeCompressedGtin(e,t){e.append("(01)");let n=e.length();e.append("9"),this.encodeCompressedGtinWithoutAI(e,t,n)}encodeCompressedGtinWithoutAI(e,t,n){for(let n=0;n<4;++n){let r=this.getGeneralDecoder().extractNumericValueFromBitArray(t+10*n,10);r/100==0&&e.append("0"),r/10==0&&e.append("0"),e.append(r)}Ye.appendCheckDigit(e,n)}static appendCheckDigit(e,t){let n=0;for(let r=0;r<13;r++){let i=e.charAt(r+t).charCodeAt(0)-"0".charCodeAt(0);n+=1&r?i:3*i}n=10-n%10,10===n&&(n=0),e.append(n)}}Ye.GTIN_SIZE=40;class Xe extends Ye{constructor(e){super(e)}parseInformation(){let e=new D;e.append("(01)");let t=e.length(),n=this.getGeneralDecoder().extractNumericValueFromBitArray(Xe.HEADER_SIZE,4);return e.append(n),this.encodeCompressedGtinWithoutAI(e,Xe.HEADER_SIZE+4,t),this.getGeneralDecoder().decodeAllCodes(e,Xe.HEADER_SIZE+44)}}Xe.HEADER_SIZE=4;class $e extends We{constructor(e){super(e)}parseInformation(){let e=new D;return this.getGeneralDecoder().decodeAllCodes(e,$e.HEADER_SIZE)}}$e.HEADER_SIZE=5;class qe extends Ye{constructor(e){super(e)}encodeCompressedWeight(e,t,n){let r=this.getGeneralDecoder().extractNumericValueFromBitArray(t,n);this.addWeightCode(e,r);let i=this.checkWeight(r),o=1e5;for(let t=0;t<5;++t)i/o===0&&e.append("0"),o/=10;e.append(i)}}class Ze extends qe{constructor(e){super(e)}parseInformation(){if(this.getInformation().getSize()!=Ze.HEADER_SIZE+qe.GTIN_SIZE+Ze.WEIGHT_SIZE)throw new O;let e=new D;return this.encodeCompressedGtin(e,Ze.HEADER_SIZE),this.encodeCompressedWeight(e,Ze.HEADER_SIZE+qe.GTIN_SIZE,Ze.WEIGHT_SIZE),e.toString()}}Ze.HEADER_SIZE=5,Ze.WEIGHT_SIZE=15;class Qe extends Ze{constructor(e){super(e)}addWeightCode(e,t){e.append("(3103)")}checkWeight(e){return e}}class Ke extends Ze{constructor(e){super(e)}addWeightCode(e,t){t<1e4?e.append("(3202)"):e.append("(3203)")}checkWeight(e){return e<1e4?e:e-1e4}}class Je extends Ye{constructor(e){super(e)}parseInformation(){if(this.getInformation().getSize()<Je.HEADER_SIZE+Ye.GTIN_SIZE)throw new O;let e=new D;this.encodeCompressedGtin(e,Je.HEADER_SIZE);let t=this.getGeneralDecoder().extractNumericValueFromBitArray(Je.HEADER_SIZE+Ye.GTIN_SIZE,Je.LAST_DIGIT_SIZE);e.append("(392"),e.append(t),e.append(")");let n=this.getGeneralDecoder().decodeGeneralPurposeField(Je.HEADER_SIZE+Ye.GTIN_SIZE+Je.LAST_DIGIT_SIZE,null);return e.append(n.getNewString()),e.toString()}}Je.HEADER_SIZE=8,Je.LAST_DIGIT_SIZE=2;class et extends Ye{constructor(e){super(e)}parseInformation(){if(this.getInformation().getSize()<et.HEADER_SIZE+Ye.GTIN_SIZE)throw new O;let e=new D;this.encodeCompressedGtin(e,et.HEADER_SIZE);let t=this.getGeneralDecoder().extractNumericValueFromBitArray(et.HEADER_SIZE+Ye.GTIN_SIZE,et.LAST_DIGIT_SIZE);e.append("(393"),e.append(t),e.append(")");let n=this.getGeneralDecoder().extractNumericValueFromBitArray(et.HEADER_SIZE+Ye.GTIN_SIZE+et.LAST_DIGIT_SIZE,et.FIRST_THREE_DIGITS_SIZE);n/100==0&&e.append("0"),n/10==0&&e.append("0"),e.append(n);let r=this.getGeneralDecoder().decodeGeneralPurposeField(et.HEADER_SIZE+Ye.GTIN_SIZE+et.LAST_DIGIT_SIZE+et.FIRST_THREE_DIGITS_SIZE,null);return e.append(r.getNewString()),e.toString()}}et.HEADER_SIZE=8,et.LAST_DIGIT_SIZE=2,et.FIRST_THREE_DIGITS_SIZE=10;class tt extends qe{constructor(e,t,n){super(e),this.dateCode=n,this.firstAIdigits=t}parseInformation(){if(this.getInformation().getSize()!=tt.HEADER_SIZE+tt.GTIN_SIZE+tt.WEIGHT_SIZE+tt.DATE_SIZE)throw new O;let e=new D;return this.encodeCompressedGtin(e,tt.HEADER_SIZE),this.encodeCompressedWeight(e,tt.HEADER_SIZE+tt.GTIN_SIZE,tt.WEIGHT_SIZE),this.encodeCompressedDate(e,tt.HEADER_SIZE+tt.GTIN_SIZE+tt.WEIGHT_SIZE),e.toString()}encodeCompressedDate(e,t){let n=this.getGeneralDecoder().extractNumericValueFromBitArray(t,tt.DATE_SIZE);if(38400==n)return;e.append("("),e.append(this.dateCode),e.append(")");let r=n%32;n/=32;let i=n%12+1;n/=12;let o=n;o/10==0&&e.append("0"),e.append(o),i/10==0&&e.append("0"),e.append(i),r/10==0&&e.append("0"),e.append(r)}addWeightCode(e,t){e.append("("),e.append(this.firstAIdigits),e.append(t/1e5),e.append(")")}checkWeight(e){return e%1e5}}function nt(e){try{if(e.get(1))return new Xe(e);if(!e.get(2))return new $e(e);switch(Ge.extractNumericValueFromBitArray(e,1,4)){case 4:return new Qe(e);case 5:return new Ke(e)}switch(Ge.extractNumericValueFromBitArray(e,1,5)){case 12:return new Je(e);case 13:return new et(e)}switch(Ge.extractNumericValueFromBitArray(e,1,7)){case 56:return new tt(e,"310","11");case 57:return new tt(e,"320","11");case 58:return new tt(e,"310","13");case 59:return new tt(e,"320","13");case 60:return new tt(e,"310","15");case 61:return new tt(e,"320","15");case 62:return new tt(e,"310","17");case 63:return new tt(e,"320","17")}}catch(t){throw console.log(t),new ne("unknown decoder: "+e)}}tt.HEADER_SIZE=8,tt.WEIGHT_SIZE=20,tt.DATE_SIZE=16;class rt{constructor(e,t,n,r){this.leftchar=e,this.rightchar=t,this.finderpattern=n,this.maybeLast=r}mayBeLast(){return this.maybeLast}getLeftChar(){return this.leftchar}getRightChar(){return this.rightchar}getFinderPattern(){return this.finderpattern}mustBeLast(){return null==this.rightchar}toString(){return"[ "+this.leftchar+", "+this.rightchar+" : "+(null==this.finderpattern?"null":this.finderpattern.getValue())+" ]"}static equals(e,t){return e instanceof rt&&rt.equalsOrNull(e.leftchar,t.leftchar)&&rt.equalsOrNull(e.rightchar,t.rightchar)&&rt.equalsOrNull(e.finderpattern,t.finderpattern)}static equalsOrNull(e,t){return null===e?null===t:rt.equals(e,t)}hashCode(){return this.leftchar.getValue()^this.rightchar.getValue()^this.finderpattern.getValue()}}class it{constructor(e,t,n){this.pairs=e,this.rowNumber=t,this.wasReversed=n}getPairs(){return this.pairs}getRowNumber(){return this.rowNumber}isReversed(){return this.wasReversed}isEquivalent(e){return this.checkEqualitity(this,e)}toString(){return"{ "+this.pairs+" }"}equals(e,t){return e instanceof it&&this.checkEqualitity(e,t)&&e.wasReversed===t.wasReversed}checkEqualitity(e,t){if(!e||!t)return;let n;return e.forEach((e,r)=>{t.forEach(t=>{e.getLeftChar().getValue()===t.getLeftChar().getValue()&&e.getRightChar().getValue()===t.getRightChar().getValue()&&e.getFinderPatter().getValue()===t.getFinderPatter().getValue()&&(n=!0)})}),n}}class ot extends Pe{constructor(e){super(...arguments),this.pairs=new Array(ot.MAX_PAIRS),this.rows=new Array,this.startEnd=[2],this.verbose=!0===e}decodeRow(e,t,n){this.pairs.length=0,this.startFromEven=!1;try{return ot.constructResult(this.decodeRow2pairs(e,t))}catch(e){this.verbose&&console.log(e)}return this.pairs.length=0,this.startFromEven=!0,ot.constructResult(this.decodeRow2pairs(e,t))}reset(){this.pairs.length=0,this.rows.length=0}decodeRow2pairs(e,t){let n,r=!1;for(;!r;)try{this.pairs.push(this.retrieveNextPair(t,this.pairs,e))}catch(e){if(e instanceof O){if(!this.pairs.length)throw new O;r=!0}}if(this.checkChecksum())return this.pairs;if(n=!!this.rows.length,this.storeRow(e,!1),n){let e=this.checkRowsBoolean(!1);if(null!=e)return e;if(e=this.checkRowsBoolean(!0),null!=e)return e}throw new O}checkRowsBoolean(e){if(this.rows.length>25)return this.rows.length=0,null;this.pairs.length=0,e&&(this.rows=this.rows.reverse());let t=null;try{t=this.checkRows(new Array,0)}catch(e){this.verbose&&console.log(e)}return e&&(this.rows=this.rows.reverse()),t}checkRows(e,t){for(let n=t;n<this.rows.length;n++){let t=this.rows[n];this.pairs.length=0;for(let t of e)this.pairs.push(t.getPairs());if(this.pairs.push(t.getPairs()),!ot.isValidSequence(this.pairs))continue;if(this.checkChecksum())return this.pairs;let r=new Array(e);r.push(t);try{return this.checkRows(r,n+1)}catch(e){this.verbose&&console.log(e)}}throw new O}static isValidSequence(e){for(let t of ot.FINDER_PATTERN_SEQUENCES){if(e.length>t.length)continue;let n=!0;for(let r=0;r<e.length;r++)if(e[r].getFinderPattern().getValue()!=t[r]){n=!1;break}if(n)return!0}return!1}storeRow(e,t){let n=0,r=!1,i=!1;for(;n<this.rows.length;){let t=this.rows[n];if(t.getRowNumber()>e){i=t.isEquivalent(this.pairs);break}r=t.isEquivalent(this.pairs),n++}i||r||ot.isPartialRow(this.pairs,this.rows)||(this.rows.push(n,new it(this.pairs,e,t)),this.removePartialRows(this.pairs,this.rows))}removePartialRows(e,t){for(let n of t)if(n.getPairs().length!==e.length)for(let t of n.getPairs())for(let n of e)if(rt.equals(t,n))break}static isPartialRow(e,t){for(let n of t){let t=!0;for(let r of e){let e=!1;for(let t of n.getPairs())if(r.equals(t)){e=!0;break}if(!e){t=!1;break}}if(t)return!0}return!1}getRows(){return this.rows}static constructResult(e){let t=nt(Be.buildBitArray(e)).parseInformation(),n=e[0].getFinderPattern().getResultPoints(),r=e[e.length-1].getFinderPattern().getResultPoints(),i=[n[0],n[1],r[0],r[1]];return new j(t,null,null,i,V.RSS_EXPANDED,null)}checkChecksum(){let e=this.pairs.get(0),t=e.getLeftChar(),n=e.getRightChar();if(null==n)return!1;let r=n.getChecksumPortion(),i=2;for(let e=1;e<this.pairs.size();++e){let t=this.pairs.get(e);r+=t.getLeftChar().getChecksumPortion(),i++;let n=t.getRightChar();null!=n&&(r+=n.getChecksumPortion(),i++)}return r%=211,211*(i-4)+r==t.getValue()}static getNextSecondBar(e,t){let n;return e.get(t)?(n=e.getNextUnset(t),n=e.getNextSet(n)):(n=e.getNextSet(t),n=e.getNextUnset(n)),n}retrieveNextPair(e,t,n){let r,i=t.length%2==0;this.startFromEven&&(i=!i);let o=!0,s=-1;do{this.findNextPair(e,t,s),r=this.parseFoundFinderPattern(e,n,i),null==r?s=ot.getNextSecondBar(e,this.startEnd[0]):o=!1}while(o);let a,l=this.decodeDataCharacter(e,r,i,!0);if(!this.isEmptyPair(t)&&t[t.length-1].mustBeLast())throw new O;try{a=this.decodeDataCharacter(e,r,i,!1)}catch(e){a=null,this.verbose&&console.log(e)}return new rt(l,a,r,!0)}isEmptyPair(e){return 0===e.length}findNextPair(e,t,n){let r=this.getDecodeFinderCounters();r[0]=0,r[1]=0,r[2]=0,r[3]=0;let i,o=e.getSize();i=n>=0?n:this.isEmptyPair(t)?0:t[t.length-1].getFinderPattern().getStartEnd()[1];let s=t.length%2!=0;this.startFromEven&&(s=!s);let a=!1;for(;i<o&&(a=!e.get(i),a);)i++;let l=0,c=i;for(let t=i;t<o;t++)if(e.get(t)!=a)r[l]++;else{if(3==l){if(s&&ot.reverseCounters(r),ot.isFinderPattern(r))return this.startEnd[0]=c,void(this.startEnd[1]=t);s&&ot.reverseCounters(r),c+=r[0]+r[1],r[0]=r[2],r[1]=r[3],r[2]=0,r[3]=0,l--}else l++;r[l]=1,a=!a}throw new O}static reverseCounters(e){let t=e.length;for(let n=0;n<t/2;++n){let r=e[n];e[n]=e[t-n-1],e[t-n-1]=r}}parseFoundFinderPattern(e,t,n){let r,i,o;if(n){let t=this.startEnd[0]-1;for(;t>=0&&!e.get(t);)t--;t++,r=this.startEnd[0]-t,i=t,o=this.startEnd[1]}else i=this.startEnd[0],o=e.getNextUnset(this.startEnd[1]+1),r=o-this.startEnd[1];let s,a=this.getDecodeFinderCounters();g.arraycopy(a,0,a,1,a.length-1),a[0]=r;try{s=this.parseFinderValue(a,ot.FINDER_PATTERNS)}catch(e){return null}return new xe(s,[i,o],i,o,t)}decodeDataCharacter(e,t,n,r){let i=this.getDataCharacterCounters();for(let e=0;e<i.length;e++)i[e]=0;if(r)ot.recordPatternInReverse(e,t.getStartEnd()[0],i);else{ot.recordPattern(e,t.getStartEnd()[1],i);for(let e=0,t=i.length-1;e<t;e++,t--){let n=i[e];i[e]=i[t],i[t]=n}}let o=17,s=oe.sum(new Int32Array(i))/o,a=(t.getStartEnd()[1]-t.getStartEnd()[0])/15;if(Math.abs(s-a)/a>.3)throw new O;let l=this.getOddCounts(),c=this.getEvenCounts(),u=this.getOddRoundingErrors(),h=this.getEvenRoundingErrors();for(let e=0;e<i.length;e++){let t=1*i[e]/s,n=t+.5;if(n<1){if(t<.3)throw new O;n=1}else if(n>8){if(t>8.7)throw new O;n=8}let r=e/2;1&e?(c[r]=n,h[r]=t-n):(l[r]=n,u[r]=t-n)}this.adjustOddEvenCounts(o);let d=4*t.getValue()+(n?0:2)+(r?0:1)-1,f=0,p=0;for(let e=l.length-1;e>=0;e--){if(ot.isNotA1left(t,n,r)){let t=ot.WEIGHTS[d][2*e];p+=l[e]*t}f+=l[e]}let g=0;for(let e=c.length-1;e>=0;e--)if(ot.isNotA1left(t,n,r)){let t=ot.WEIGHTS[d][2*e+1];g+=c[e]*t}let m=p+g;if(1&f||f>13||f<4)throw new O;let w=(13-f)/2,y=ot.SYMBOL_WIDEST[w],E=9-y,v=Le.getRSSvalue(l,y,!0),A=Le.getRSSvalue(c,E,!1),C=ot.EVEN_TOTAL_SUBSET[w],b=ot.GSUM[w];return new ke(v*C+A+b,m)}static isNotA1left(e,t,n){return!(0==e.getValue()&&t&&n)}adjustOddEvenCounts(e){let t=oe.sum(new Int32Array(this.getOddCounts())),n=oe.sum(new Int32Array(this.getEvenCounts())),r=!1,i=!1;t>13?i=!0:t<4&&(r=!0);let o=!1,s=!1;n>13?s=!0:n<4&&(o=!0);let a=t+n-e,l=!(1&~t),c=!(1&n);if(1==a)if(l){if(c)throw new O;i=!0}else{if(!c)throw new O;s=!0}else if(-1==a)if(l){if(c)throw new O;r=!0}else{if(!c)throw new O;o=!0}else{if(0!=a)throw new O;if(l){if(!c)throw new O;t<n?(r=!0,s=!0):(i=!0,o=!0)}else if(c)throw new O}if(r){if(i)throw new O;ot.increment(this.getOddCounts(),this.getOddRoundingErrors())}if(i&&ot.decrement(this.getOddCounts(),this.getOddRoundingErrors()),o){if(s)throw new O;ot.increment(this.getEvenCounts(),this.getOddRoundingErrors())}s&&ot.decrement(this.getEvenCounts(),this.getEvenRoundingErrors())}}ot.SYMBOL_WIDEST=[7,5,4,3,1],ot.EVEN_TOTAL_SUBSET=[4,20,52,104,204],ot.GSUM=[0,348,1388,2948,3988],ot.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])],ot.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]],ot.FINDER_PAT_A=0,ot.FINDER_PAT_B=1,ot.FINDER_PAT_C=2,ot.FINDER_PAT_D=3,ot.FINDER_PAT_E=4,ot.FINDER_PAT_F=5,ot.FINDER_PATTERN_SEQUENCES=[[ot.FINDER_PAT_A,ot.FINDER_PAT_A],[ot.FINDER_PAT_A,ot.FINDER_PAT_B,ot.FINDER_PAT_B],[ot.FINDER_PAT_A,ot.FINDER_PAT_C,ot.FINDER_PAT_B,ot.FINDER_PAT_D],[ot.FINDER_PAT_A,ot.FINDER_PAT_E,ot.FINDER_PAT_B,ot.FINDER_PAT_D,ot.FINDER_PAT_C],[ot.FINDER_PAT_A,ot.FINDER_PAT_E,ot.FINDER_PAT_B,ot.FINDER_PAT_D,ot.FINDER_PAT_D,ot.FINDER_PAT_F],[ot.FINDER_PAT_A,ot.FINDER_PAT_E,ot.FINDER_PAT_B,ot.FINDER_PAT_D,ot.FINDER_PAT_E,ot.FINDER_PAT_F,ot.FINDER_PAT_F],[ot.FINDER_PAT_A,ot.FINDER_PAT_A,ot.FINDER_PAT_B,ot.FINDER_PAT_B,ot.FINDER_PAT_C,ot.FINDER_PAT_C,ot.FINDER_PAT_D,ot.FINDER_PAT_D],[ot.FINDER_PAT_A,ot.FINDER_PAT_A,ot.FINDER_PAT_B,ot.FINDER_PAT_B,ot.FINDER_PAT_C,ot.FINDER_PAT_C,ot.FINDER_PAT_D,ot.FINDER_PAT_E,ot.FINDER_PAT_E],[ot.FINDER_PAT_A,ot.FINDER_PAT_A,ot.FINDER_PAT_B,ot.FINDER_PAT_B,ot.FINDER_PAT_C,ot.FINDER_PAT_C,ot.FINDER_PAT_D,ot.FINDER_PAT_E,ot.FINDER_PAT_F,ot.FINDER_PAT_F],[ot.FINDER_PAT_A,ot.FINDER_PAT_A,ot.FINDER_PAT_B,ot.FINDER_PAT_B,ot.FINDER_PAT_C,ot.FINDER_PAT_D,ot.FINDER_PAT_D,ot.FINDER_PAT_E,ot.FINDER_PAT_E,ot.FINDER_PAT_F,ot.FINDER_PAT_F]],ot.MAX_PAIRS=11;class st extends ke{constructor(e,t,n){super(e,t),this.count=0,this.finderPattern=n}getFinderPattern(){return this.finderPattern}getCount(){return this.count}incrementCount(){this.count++}}class at extends Pe{constructor(){super(...arguments),this.possibleLeftPairs=[],this.possibleRightPairs=[]}decodeRow(e,t,n){const r=this.decodePair(t,!1,e,n);at.addOrTally(this.possibleLeftPairs,r),t.reverse();let i=this.decodePair(t,!0,e,n);at.addOrTally(this.possibleRightPairs,i),t.reverse();for(let e of this.possibleLeftPairs)if(e.getCount()>1)for(let t of this.possibleRightPairs)if(t.getCount()>1&&at.checkChecksum(e,t))return at.constructResult(e,t);throw new O}static addOrTally(e,t){if(null==t)return;let n=!1;for(let r of e)if(r.getValue()===t.getValue()){r.incrementCount(),n=!0;break}n||e.push(t)}reset(){this.possibleLeftPairs.length=0,this.possibleRightPairs.length=0}static constructResult(e,t){let n=4537077*e.getValue()+t.getValue(),r=new String(n).toString(),i=new D;for(let e=13-r.length;e>0;e--)i.append("0");i.append(r);let o=0;for(let e=0;e<13;e++){let t=i.charAt(e).charCodeAt(0)-"0".charCodeAt(0);o+=1&e?t:3*t}o=10-o%10,10===o&&(o=0),i.append(o.toString());let s=e.getFinderPattern().getResultPoints(),a=t.getFinderPattern().getResultPoints();return new j(i.toString(),null,0,[s[0],s[1],a[0],a[1]],V.RSS_14,(new Date).getTime())}static checkChecksum(e,t){let n=(e.getChecksumPortion()+16*t.getChecksumPortion())%79,r=9*e.getFinderPattern().getValue()+t.getFinderPattern().getValue();return r>72&&r--,r>8&&r--,n===r}decodePair(e,t,n,r){try{let i=this.findFinderPattern(e,t),o=this.parseFoundFinderPattern(e,n,t,i),s=null==r?null:r.get(C.NEED_RESULT_POINT_CALLBACK);if(null!=s){let r=(i[0]+i[1])/2;t&&(r=e.getSize()-1-r),s.foundPossibleResultPoint(new ae(r,n))}let a=this.decodeDataCharacter(e,o,!0),l=this.decodeDataCharacter(e,o,!1);return new st(1597*a.getValue()+l.getValue(),a.getChecksumPortion()+4*l.getChecksumPortion(),o)}catch(e){return null}}decodeDataCharacter(e,t,n){let r=this.getDataCharacterCounters();for(let e=0;e<r.length;e++)r[e]=0;if(n)Ee.recordPatternInReverse(e,t.getStartEnd()[0],r);else{Ee.recordPattern(e,t.getStartEnd()[1]+1,r);for(let e=0,t=r.length-1;e<t;e++,t--){let n=r[e];r[e]=r[t],r[t]=n}}let i=n?16:15,o=oe.sum(new Int32Array(r))/i,s=this.getOddCounts(),a=this.getEvenCounts(),l=this.getOddRoundingErrors(),c=this.getEvenRoundingErrors();for(let e=0;e<r.length;e++){let t=r[e]/o,n=Math.floor(t+.5);n<1?n=1:n>8&&(n=8);let i=Math.floor(e/2);1&e?(a[i]=n,c[i]=t-n):(s[i]=n,l[i]=t-n)}this.adjustOddEvenCounts(n,i);let u=0,h=0;for(let e=s.length-1;e>=0;e--)h*=9,h+=s[e],u+=s[e];let d=0,f=0;for(let e=a.length-1;e>=0;e--)d*=9,d+=a[e],f+=a[e];let p=h+3*d;if(n){if(1&u||u>12||u<4)throw new O;let e=(12-u)/2,t=at.OUTSIDE_ODD_WIDEST[e],n=9-t,r=Le.getRSSvalue(s,t,!1),i=Le.getRSSvalue(a,n,!0),o=at.OUTSIDE_EVEN_TOTAL_SUBSET[e],l=at.OUTSIDE_GSUM[e];return new ke(r*o+i+l,p)}{if(1&f||f>10||f<4)throw new O;let e=(10-f)/2,t=at.INSIDE_ODD_WIDEST[e],n=9-t,r=Le.getRSSvalue(s,t,!0),i=Le.getRSSvalue(a,n,!1),o=at.INSIDE_ODD_TOTAL_SUBSET[e],l=at.INSIDE_GSUM[e];return new ke(i*o+r+l,p)}}findFinderPattern(e,t){let n=this.getDecodeFinderCounters();n[0]=0,n[1]=0,n[2]=0,n[3]=0;let r=e.getSize(),i=!1,o=0;for(;o<r&&(i=!e.get(o),t!==i);)o++;let s=0,a=o;for(let t=o;t<r;t++)if(e.get(t)!==i)n[s]++;else{if(3===s){if(Pe.isFinderPattern(n))return[a,t];a+=n[0]+n[1],n[0]=n[2],n[1]=n[3],n[2]=0,n[3]=0,s--}else s++;n[s]=1,i=!i}throw new O}parseFoundFinderPattern(e,t,n,r){let i=e.get(r[0]),o=r[0]-1;for(;o>=0&&i!==e.get(o);)o--;o++;const s=r[0]-o,a=this.getDecodeFinderCounters(),l=new Int32Array(a.length);g.arraycopy(a,0,l,1,a.length-1),l[0]=s;const c=this.parseFinderValue(l,at.FINDER_PATTERNS);let u=o,h=r[1];return n&&(u=e.getSize()-1-u,h=e.getSize()-1-h),new xe(c,[o,r[1]],u,h,t)}adjustOddEvenCounts(e,t){let n=oe.sum(new Int32Array(this.getOddCounts())),r=oe.sum(new Int32Array(this.getEvenCounts())),i=!1,o=!1,s=!1,a=!1;e?(n>12?o=!0:n<4&&(i=!0),r>12?a=!0:r<4&&(s=!0)):(n>11?o=!0:n<5&&(i=!0),r>10?a=!0:r<4&&(s=!0));let l=n+r-t,c=(1&n)==(e?1:0),u=!(1&~r);if(1===l)if(c){if(u)throw new O;o=!0}else{if(!u)throw new O;a=!0}else if(-1===l)if(c){if(u)throw new O;i=!0}else{if(!u)throw new O;s=!0}else{if(0!==l)throw new O;if(c){if(!u)throw new O;n<r?(i=!0,a=!0):(o=!0,s=!0)}else if(u)throw new O}if(i){if(o)throw new O;Pe.increment(this.getOddCounts(),this.getOddRoundingErrors())}if(o&&Pe.decrement(this.getOddCounts(),this.getOddRoundingErrors()),s){if(a)throw new O;Pe.increment(this.getEvenCounts(),this.getOddRoundingErrors())}a&&Pe.decrement(this.getEvenCounts(),this.getEvenRoundingErrors())}}at.OUTSIDE_EVEN_TOTAL_SUBSET=[1,10,34,70,126],at.INSIDE_ODD_TOTAL_SUBSET=[4,20,48,81],at.OUTSIDE_GSUM=[0,161,961,2015,2715],at.INSIDE_GSUM=[0,336,1036,1516],at.OUTSIDE_ODD_WIDEST=[8,6,4,3,1],at.INSIDE_ODD_WIDEST=[2,4,6,8],at.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])];class lt extends Ee{constructor(e,t){super(),this.readers=[],this.verbose=!0===t;const n=e?e.get(C.POSSIBLE_FORMATS):null,r=e&&void 0!==e.get(C.ASSUME_CODE_39_CHECK_DIGIT);n?((n.includes(V.EAN_13)||n.includes(V.UPC_A)||n.includes(V.EAN_8)||n.includes(V.UPC_E))&&this.readers.push(new Me(e)),n.includes(V.CODE_39)&&this.readers.push(new Ae(r)),n.includes(V.CODE_128)&&this.readers.push(new ve),n.includes(V.ITF)&&this.readers.push(new Ce),n.includes(V.RSS_14)&&this.readers.push(new at),n.includes(V.RSS_EXPANDED)&&this.readers.push(new ot(this.verbose))):(this.readers.push(new Me(e)),this.readers.push(new Ae),this.readers.push(new Me(e)),this.readers.push(new ve),this.readers.push(new Ce),this.readers.push(new at),this.readers.push(new ot(this.verbose)))}decodeRow(e,t,n){for(let r=0;r<this.readers.length;r++)try{return this.readers[r].decodeRow(e,t,n)}catch(e){}throw new O}reset(){this.readers.forEach(e=>e.reset())}}class ct extends U{constructor(e=500,t){super(new lt(t),e,t)}}class ut{constructor(e,t,n){this.ecCodewords=e,this.ecBlocks=[t],n&&this.ecBlocks.push(n)}getECCodewords(){return this.ecCodewords}getECBlocks(){return this.ecBlocks}}class ht{constructor(e,t){this.count=e,this.dataCodewords=t}getCount(){return this.count}getDataCodewords(){return this.dataCodewords}}class dt{constructor(e,t,n,r,i,o){this.versionNumber=e,this.symbolSizeRows=t,this.symbolSizeColumns=n,this.dataRegionSizeRows=r,this.dataRegionSizeColumns=i,this.ecBlocks=o;let s=0;const a=o.getECCodewords(),l=o.getECBlocks();for(let e of l)s+=e.getCount()*(e.getDataCodewords()+a);this.totalCodewords=s}getVersionNumber(){return this.versionNumber}getSymbolSizeRows(){return this.symbolSizeRows}getSymbolSizeColumns(){return this.symbolSizeColumns}getDataRegionSizeRows(){return this.dataRegionSizeRows}getDataRegionSizeColumns(){return this.dataRegionSizeColumns}getTotalCodewords(){return this.totalCodewords}getECBlocks(){return this.ecBlocks}static getVersionForDimensions(e,t){if(1&e||1&t)throw new b;for(let n of dt.VERSIONS)if(n.symbolSizeRows===e&&n.symbolSizeColumns===t)return n;throw new b}toString(){return""+this.versionNumber}static buildVersions(){return[new dt(1,10,10,8,8,new ut(5,new ht(1,3))),new dt(2,12,12,10,10,new ut(7,new ht(1,5))),new dt(3,14,14,12,12,new ut(10,new ht(1,8))),new dt(4,16,16,14,14,new ut(12,new ht(1,12))),new dt(5,18,18,16,16,new ut(14,new ht(1,18))),new dt(6,20,20,18,18,new ut(18,new ht(1,22))),new dt(7,22,22,20,20,new ut(20,new ht(1,30))),new dt(8,24,24,22,22,new ut(24,new ht(1,36))),new dt(9,26,26,24,24,new ut(28,new ht(1,44))),new dt(10,32,32,14,14,new ut(36,new ht(1,62))),new dt(11,36,36,16,16,new ut(42,new ht(1,86))),new dt(12,40,40,18,18,new ut(48,new ht(1,114))),new dt(13,44,44,20,20,new ut(56,new ht(1,144))),new dt(14,48,48,22,22,new ut(68,new ht(1,174))),new dt(15,52,52,24,24,new ut(42,new ht(2,102))),new dt(16,64,64,14,14,new ut(56,new ht(2,140))),new dt(17,72,72,16,16,new ut(36,new ht(4,92))),new dt(18,80,80,18,18,new ut(48,new ht(4,114))),new dt(19,88,88,20,20,new ut(56,new ht(4,144))),new dt(20,96,96,22,22,new ut(68,new ht(4,174))),new dt(21,104,104,24,24,new ut(56,new ht(6,136))),new dt(22,120,120,18,18,new ut(68,new ht(6,175))),new dt(23,132,132,20,20,new ut(62,new ht(8,163))),new dt(24,144,144,22,22,new ut(62,new ht(8,156),new ht(2,155))),new dt(25,8,18,6,16,new ut(7,new ht(1,5))),new dt(26,8,32,6,14,new ut(11,new ht(1,10))),new dt(27,12,26,10,24,new ut(14,new ht(1,16))),new dt(28,12,36,10,16,new ut(18,new ht(1,22))),new dt(29,16,36,14,16,new ut(24,new ht(1,32))),new dt(30,16,48,14,22,new ut(28,new ht(1,49)))]}}dt.VERSIONS=dt.buildVersions();class ft{constructor(e){const t=e.getHeight();if(t<8||t>144||1&t)throw new b;this.version=ft.readVersion(e),this.mappingBitMatrix=this.extractDataRegion(e),this.readMappingMatrix=new N(this.mappingBitMatrix.getWidth(),this.mappingBitMatrix.getHeight())}getVersion(){return this.version}static readVersion(e){const t=e.getHeight(),n=e.getWidth();return dt.getVersionForDimensions(t,n)}readCodewords(){const e=new Int8Array(this.version.getTotalCodewords());let t=0,n=4,r=0;const i=this.mappingBitMatrix.getHeight(),o=this.mappingBitMatrix.getWidth();let s=!1,a=!1,l=!1,c=!1;do{if(n!==i||0!==r||s)if(n===i-2&&0===r&&3&o&&!a)e[t++]=255&this.readCorner2(i,o),n-=2,r+=2,a=!0;else if(n!==i+4||2!==r||7&o||l)if(n!==i-2||0!==r||4!=(7&o)||c){do{n<i&&r>=0&&!this.readMappingMatrix.get(r,n)&&(e[t++]=255&this.readUtah(n,r,i,o)),n-=2,r+=2}while(n>=0&&r<o);n+=1,r+=3;do{n>=0&&r<o&&!this.readMappingMatrix.get(r,n)&&(e[t++]=255&this.readUtah(n,r,i,o)),n+=2,r-=2}while(n<i&&r>=0);n+=3,r+=1}else e[t++]=255&this.readCorner4(i,o),n-=2,r+=2,c=!0;else e[t++]=255&this.readCorner3(i,o),n-=2,r+=2,l=!0;else e[t++]=255&this.readCorner1(i,o),n-=2,r+=2,s=!0}while(n<i||r<o);if(t!==this.version.getTotalCodewords())throw new b;return e}readModule(e,t,n,r){return e<0&&(e+=n,t+=4-(n+4&7)),t<0&&(t+=r,e+=4-(r+4&7)),this.readMappingMatrix.set(t,e),this.mappingBitMatrix.get(t,e)}readUtah(e,t,n,r){let i=0;return this.readModule(e-2,t-2,n,r)&&(i|=1),i<<=1,this.readModule(e-2,t-1,n,r)&&(i|=1),i<<=1,this.readModule(e-1,t-2,n,r)&&(i|=1),i<<=1,this.readModule(e-1,t-1,n,r)&&(i|=1),i<<=1,this.readModule(e-1,t,n,r)&&(i|=1),i<<=1,this.readModule(e,t-2,n,r)&&(i|=1),i<<=1,this.readModule(e,t-1,n,r)&&(i|=1),i<<=1,this.readModule(e,t,n,r)&&(i|=1),i}readCorner1(e,t){let n=0;return this.readModule(e-1,0,e,t)&&(n|=1),n<<=1,this.readModule(e-1,1,e,t)&&(n|=1),n<<=1,this.readModule(e-1,2,e,t)&&(n|=1),n<<=1,this.readModule(0,t-2,e,t)&&(n|=1),n<<=1,this.readModule(0,t-1,e,t)&&(n|=1),n<<=1,this.readModule(1,t-1,e,t)&&(n|=1),n<<=1,this.readModule(2,t-1,e,t)&&(n|=1),n<<=1,this.readModule(3,t-1,e,t)&&(n|=1),n}readCorner2(e,t){let n=0;return this.readModule(e-3,0,e,t)&&(n|=1),n<<=1,this.readModule(e-2,0,e,t)&&(n|=1),n<<=1,this.readModule(e-1,0,e,t)&&(n|=1),n<<=1,this.readModule(0,t-4,e,t)&&(n|=1),n<<=1,this.readModule(0,t-3,e,t)&&(n|=1),n<<=1,this.readModule(0,t-2,e,t)&&(n|=1),n<<=1,this.readModule(0,t-1,e,t)&&(n|=1),n<<=1,this.readModule(1,t-1,e,t)&&(n|=1),n}readCorner3(e,t){let n=0;return this.readModule(e-1,0,e,t)&&(n|=1),n<<=1,this.readModule(e-1,t-1,e,t)&&(n|=1),n<<=1,this.readModule(0,t-3,e,t)&&(n|=1),n<<=1,this.readModule(0,t-2,e,t)&&(n|=1),n<<=1,this.readModule(0,t-1,e,t)&&(n|=1),n<<=1,this.readModule(1,t-3,e,t)&&(n|=1),n<<=1,this.readModule(1,t-2,e,t)&&(n|=1),n<<=1,this.readModule(1,t-1,e,t)&&(n|=1),n}readCorner4(e,t){let n=0;return this.readModule(e-3,0,e,t)&&(n|=1),n<<=1,this.readModule(e-2,0,e,t)&&(n|=1),n<<=1,this.readModule(e-1,0,e,t)&&(n|=1),n<<=1,this.readModule(0,t-2,e,t)&&(n|=1),n<<=1,this.readModule(0,t-1,e,t)&&(n|=1),n<<=1,this.readModule(1,t-1,e,t)&&(n|=1),n<<=1,this.readModule(2,t-1,e,t)&&(n|=1),n<<=1,this.readModule(3,t-1,e,t)&&(n|=1),n}extractDataRegion(e){const t=this.version.getSymbolSizeRows(),n=this.version.getSymbolSizeColumns();if(e.getHeight()!==t)throw new h("Dimension of bitMatrix must match the version size");const r=this.version.getDataRegionSizeRows(),i=this.version.getDataRegionSizeColumns(),o=t/r|0,s=n/i|0,a=new N(s*i,o*r);for(let t=0;t<o;++t){const n=t*r;for(let o=0;o<s;++o){const s=o*i;for(let l=0;l<r;++l){const c=t*(r+2)+1+l,u=n+l;for(let t=0;t<i;++t){const n=o*(i+2)+1+t;if(e.get(n,c)){const e=s+t;a.set(e,u)}}}}}return a}}class pt{constructor(e,t){this.numDataCodewords=e,this.codewords=t}static getDataBlocks(e,t){const n=t.getECBlocks();let r=0;const i=n.getECBlocks();for(let e of i)r+=e.getCount();const o=new Array(r);let s=0;for(let e of i)for(let t=0;t<e.getCount();t++){const t=e.getDataCodewords(),r=n.getECCodewords()+t;o[s++]=new pt(t,new Uint8Array(r))}const a=o[0].codewords.length-n.getECCodewords(),l=a-1;let c=0;for(let t=0;t<l;t++)for(let n=0;n<s;n++)o[n].codewords[t]=e[c++];const u=24===t.getVersionNumber(),d=u?8:s;for(let t=0;t<d;t++)o[t].codewords[a-1]=e[c++];const f=o[0].codewords.length;for(let t=a;t<f;t++)for(let n=0;n<s;n++){const r=u?(n+8)%s:n,i=u&&r>7?t-1:t;o[r].codewords[i]=e[c++]}if(c!==e.length)throw new h;return o}getNumDataCodewords(){return this.numDataCodewords}getCodewords(){return this.codewords}}class gt{constructor(e){this.bytes=e,this.byteOffset=0,this.bitOffset=0}getBitOffset(){return this.bitOffset}getByteOffset(){return this.byteOffset}readBits(e){if(e<1||e>32||e>this.available())throw new h(""+e);let t=0,n=this.bitOffset,r=this.byteOffset;const i=this.bytes;if(n>0){const o=8-n,s=e<o?e:o,a=o-s,l=255>>8-s<<a;t=(i[r]&l)>>a,e-=s,n+=s,8===n&&(n=0,r++)}if(e>0){for(;e>=8;)t=t<<8|255&i[r],r++,e-=8;if(e>0){const o=8-e,s=255>>o<<o;t=t<<e|(i[r]&s)>>o,n+=e}}return this.bitOffset=n,this.byteOffset=r,t}available(){return 8*(this.bytes.length-this.byteOffset)-this.bitOffset}}!function(e){e[e.PAD_ENCODE=0]="PAD_ENCODE",e[e.ASCII_ENCODE=1]="ASCII_ENCODE",e[e.C40_ENCODE=2]="C40_ENCODE",e[e.TEXT_ENCODE=3]="TEXT_ENCODE",e[e.ANSIX12_ENCODE=4]="ANSIX12_ENCODE",e[e.EDIFACT_ENCODE=5]="EDIFACT_ENCODE",e[e.BASE256_ENCODE=6]="BASE256_ENCODE"}(G||(G={}));class mt{static decode(e){const t=new gt(e),n=new D,r=new D,i=new Array;let o=G.ASCII_ENCODE;do{if(o===G.ASCII_ENCODE)o=this.decodeAsciiSegment(t,n,r);else{switch(o){case G.C40_ENCODE:this.decodeC40Segment(t,n);break;case G.TEXT_ENCODE:this.decodeTextSegment(t,n);break;case G.ANSIX12_ENCODE:this.decodeAnsiX12Segment(t,n);break;case G.EDIFACT_ENCODE:this.decodeEdifactSegment(t,n);break;case G.BASE256_ENCODE:this.decodeBase256Segment(t,n,i);break;default:throw new b}o=G.ASCII_ENCODE}}while(o!==G.PAD_ENCODE&&t.available()>0);return r.length()>0&&n.append(r.toString()),new Z(e,n.toString(),0===i.length?null:i,null)}static decodeAsciiSegment(e,t,n){let r=!1;do{let i=e.readBits(8);if(0===i)throw new b;if(i<=128)return r&&(i+=128),t.append(String.fromCharCode(i-1)),G.ASCII_ENCODE;if(129===i)return G.PAD_ENCODE;if(i<=229){const e=i-130;e<10&&t.append("0"),t.append(""+e)}else switch(i){case 230:return G.C40_ENCODE;case 231:return G.BASE256_ENCODE;case 232:t.append(String.fromCharCode(29));break;case 233:case 234:case 241:break;case 235:r=!0;break;case 236:t.append("[)>�05�"),n.insert(0,"��");break;case 237:t.append("[)>�06�"),n.insert(0,"��");break;case 238:return G.ANSIX12_ENCODE;case 239:return G.TEXT_ENCODE;case 240:return G.EDIFACT_ENCODE;default:if(254!==i||0!==e.available())throw new b}}while(e.available()>0);return G.ASCII_ENCODE}static decodeC40Segment(e,t){let n=!1;const r=[];let i=0;do{if(8===e.available())return;const o=e.readBits(8);if(254===o)return;this.parseTwoBytes(o,e.readBits(8),r);for(let e=0;e<3;e++){const o=r[e];switch(i){case 0:if(o<3)i=o+1;else{if(!(o<this.C40_BASIC_SET_CHARS.length))throw new b;{const e=this.C40_BASIC_SET_CHARS[o];n?(t.append(String.fromCharCode(e.charCodeAt(0)+128)),n=!1):t.append(e)}}break;case 1:n?(t.append(String.fromCharCode(o+128)),n=!1):t.append(String.fromCharCode(o)),i=0;break;case 2:if(o<this.C40_SHIFT2_SET_CHARS.length){const e=this.C40_SHIFT2_SET_CHARS[o];n?(t.append(String.fromCharCode(e.charCodeAt(0)+128)),n=!1):t.append(e)}else switch(o){case 27:t.append(String.fromCharCode(29));break;case 30:n=!0;break;default:throw new b}i=0;break;case 3:n?(t.append(String.fromCharCode(o+224)),n=!1):t.append(String.fromCharCode(o+96)),i=0;break;default:throw new b}}}while(e.available()>0)}static decodeTextSegment(e,t){let n=!1,r=[],i=0;do{if(8===e.available())return;const o=e.readBits(8);if(254===o)return;this.parseTwoBytes(o,e.readBits(8),r);for(let e=0;e<3;e++){const o=r[e];switch(i){case 0:if(o<3)i=o+1;else{if(!(o<this.TEXT_BASIC_SET_CHARS.length))throw new b;{const e=this.TEXT_BASIC_SET_CHARS[o];n?(t.append(String.fromCharCode(e.charCodeAt(0)+128)),n=!1):t.append(e)}}break;case 1:n?(t.append(String.fromCharCode(o+128)),n=!1):t.append(String.fromCharCode(o)),i=0;break;case 2:if(o<this.TEXT_SHIFT2_SET_CHARS.length){const e=this.TEXT_SHIFT2_SET_CHARS[o];n?(t.append(String.fromCharCode(e.charCodeAt(0)+128)),n=!1):t.append(e)}
vendor: 13,486 bytes, line 2
2else switch(o){case 27:t.append(String.fromCharCode(29));break;case 30:n=!0;break;default:throw new b}i=0;break;case 3:if(!(o<this.TEXT_SHIFT3_SET_CHARS.length))throw new b;{const e=this.TEXT_SHIFT3_SET_CHARS[o];n?(t.append(String.fromCharCode(e.charCodeAt(0)+128)),n=!1):t.append(e),i=0}break;default:throw new b}}}while(e.available()>0)}static decodeAnsiX12Segment(e,t){const n=[];do{if(8===e.available())return;const r=e.readBits(8);if(254===r)return;this.parseTwoBytes(r,e.readBits(8),n);for(let e=0;e<3;e++){const r=n[e];switch(r){case 0:t.append("\r");break;case 1:t.append("*");break;case 2:t.append(">");break;case 3:t.append(" ");break;default:if(r<14)t.append(String.fromCharCode(r+44));else{if(!(r<40))throw new b;t.append(String.fromCharCode(r+51))}}}}while(e.available()>0)}static parseTwoBytes(e,t,n){let r=(e<<8)+t-1,i=Math.floor(r/1600);n[0]=i,r-=1600*i,i=Math.floor(r/40),n[1]=i,n[2]=r-40*i}static decodeEdifactSegment(e,t){do{if(e.available()<=16)return;for(let n=0;n<4;n++){let n=e.readBits(6);if(31===n){const t=8-e.getBitOffset();return void(8!==t&&e.readBits(t))}32&n||(n|=64),t.append(String.fromCharCode(n))}}while(e.available()>0)}static decodeBase256Segment(e,t,n){let r=1+e.getByteOffset();const i=this.unrandomize255State(e.readBits(8),r++);let o;if(o=0===i?e.available()/8|0:i<250?i:250*(i-249)+this.unrandomize255State(e.readBits(8),r++),o<0)throw new b;const s=new Uint8Array(o);for(let t=0;t<o;t++){if(e.available()<8)throw new b;s[t]=this.unrandomize255State(e.readBits(8),r++)}n.push(s);try{t.append(I.decode(s,T.ISO88591))}catch(e){throw new ne("Platform does not support required encoding: "+e.message)}}static unrandomize255State(e,t){const n=e-(149*t%255+1);return n>=0?n:n+256}}mt.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"],mt.C40_SHIFT2_SET_CHARS=["!",'"',"#","$","%","&","'","(",")","*","+",",","-",".","/",":",";","<","=",">","?","@","[","\\","]","^","_"],mt.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"],mt.TEXT_SHIFT2_SET_CHARS=mt.C40_SHIFT2_SET_CHARS,mt.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)];class wt{constructor(){this.rsDecoder=new re(ee.DATA_MATRIX_FIELD_256)}decode(e){const t=new ft(e),n=t.getVersion(),r=t.readCodewords(),i=pt.getDataBlocks(r,n);let o=0;for(let e of i)o+=e.getNumDataCodewords();const s=new Uint8Array(o),a=i.length;for(let e=0;e<a;e++){const t=i[e],n=t.getCodewords(),r=t.getNumDataCodewords();this.correctErrors(n,r);for(let t=0;t<r;t++)s[t*a+e]=n[t]}return mt.decode(s)}correctErrors(e,t){const n=new Int32Array(e);try{this.rsDecoder.decode(n,e.length-t)}catch(e){throw new f}for(let r=0;r<t;r++)e[r]=n[r]}}class yt{constructor(e){this.image=e,this.rectangleDetector=new ue(this.image)}detect(){const e=this.rectangleDetector.detect();let t=this.detectSolid1(e);if(t=this.detectSolid2(t),t[3]=this.correctTopRight(t),!t[3])throw new O;t=this.shiftToModuleCenter(t);const n=t[0],r=t[1],i=t[2],o=t[3];let s=this.transitionsBetween(n,o)+1,a=this.transitionsBetween(i,o)+1;1&~s||(s+=1),1&~a||(a+=1),4*s<7*a&&4*a<7*s&&(s=a=Math.max(s,a));let l=yt.sampleGrid(this.image,n,r,i,o,s,a);return new le(l,[n,r,i,o])}static shiftPoint(e,t,n){let r=(t.getX()-e.getX())/(n+1),i=(t.getY()-e.getY())/(n+1);return new ae(e.getX()+r,e.getY()+i)}static moveAway(e,t,n){let r=e.getX(),i=e.getY();return r<t?r-=1:r+=1,i<n?i-=1:i+=1,new ae(r,i)}detectSolid1(e){let t=e[0],n=e[1],r=e[3],i=e[2],o=this.transitionsBetween(t,n),s=this.transitionsBetween(n,r),a=this.transitionsBetween(r,i),l=this.transitionsBetween(i,t),c=o,u=[i,t,n,r];return c>s&&(c=s,u[0]=t,u[1]=n,u[2]=r,u[3]=i),c>a&&(c=a,u[0]=n,u[1]=r,u[2]=i,u[3]=t),c>l&&(u[0]=r,u[1]=i,u[2]=t,u[3]=n),u}detectSolid2(e){let t=e[0],n=e[1],r=e[2],i=e[3],o=this.transitionsBetween(t,i),s=yt.shiftPoint(n,r,4*(o+1)),a=yt.shiftPoint(r,n,4*(o+1));return this.transitionsBetween(s,t)<this.transitionsBetween(a,i)?(e[0]=t,e[1]=n,e[2]=r,e[3]=i):(e[0]=n,e[1]=r,e[2]=i,e[3]=t),e}correctTopRight(e){let t=e[0],n=e[1],r=e[2],i=e[3],o=this.transitionsBetween(t,i),s=this.transitionsBetween(n,i),a=yt.shiftPoint(t,n,4*(s+1)),l=yt.shiftPoint(r,n,4*(o+1));o=this.transitionsBetween(a,i),s=this.transitionsBetween(l,i);let c=new ae(i.getX()+(r.getX()-n.getX())/(o+1),i.getY()+(r.getY()-n.getY())/(o+1)),u=new ae(i.getX()+(t.getX()-n.getX())/(s+1),i.getY()+(t.getY()-n.getY())/(s+1));return this.isValid(c)?this.isValid(u)?this.transitionsBetween(a,c)+this.transitionsBetween(l,c)>this.transitionsBetween(a,u)+this.transitionsBetween(l,u)?c:u:c:this.isValid(u)?u:null}shiftToModuleCenter(e){let t=e[0],n=e[1],r=e[2],i=e[3],o=this.transitionsBetween(t,i)+1,s=this.transitionsBetween(r,i)+1,a=yt.shiftPoint(t,n,4*s),l=yt.shiftPoint(r,n,4*o);o=this.transitionsBetween(a,i)+1,s=this.transitionsBetween(l,i)+1,1&~o||(o+=1),1&~s||(s+=1);let c,u,h=(t.getX()+n.getX()+r.getX()+i.getX())/4,d=(t.getY()+n.getY()+r.getY()+i.getY())/4;return t=yt.moveAway(t,h,d),n=yt.moveAway(n,h,d),r=yt.moveAway(r,h,d),i=yt.moveAway(i,h,d),a=yt.shiftPoint(t,n,4*s),a=yt.shiftPoint(a,i,4*o),c=yt.shiftPoint(n,t,4*s),c=yt.shiftPoint(c,r,4*o),l=yt.shiftPoint(r,i,4*s),l=yt.shiftPoint(l,n,4*o),u=yt.shiftPoint(i,r,4*s),u=yt.shiftPoint(u,t,4*o),[a,c,l,u]}isValid(e){return e.getX()>=0&&e.getX()<this.image.getWidth()&&e.getY()>0&&e.getY()<this.image.getHeight()}static sampleGrid(e,t,n,r,i,o,s){return pe.getInstance().sampleGrid(e,o,s,.5,.5,o-.5,.5,o-.5,s-.5,.5,s-.5,t.getX(),t.getY(),i.getX(),i.getY(),r.getX(),r.getY(),n.getX(),n.getY())}transitionsBetween(e,t){let n=Math.trunc(e.getX()),r=Math.trunc(e.getY()),i=Math.trunc(t.getX()),o=Math.trunc(t.getY()),s=Math.abs(o-r)>Math.abs(i-n);if(s){let e=n;n=r,r=e,e=i,i=o,o=e}let a=Math.abs(i-n),l=Math.abs(o-r),c=-a/2,u=r<o?1:-1,h=n<i?1:-1,d=0,f=this.image.get(s?r:n,s?n:r);for(let e=n,t=r;e!==i;e+=h){let n=this.image.get(s?t:e,s?e:t);if(n!==f&&(d++,f=n),c+=l,c>0){if(t===o)break;t+=u,c-=a}}return d}}class Et{constructor(){this.decoder=new wt}decode(e,t=null){let n,r;if(null!=t&&t.has(C.PURE_BARCODE)){const t=Et.extractPureBits(e.getBlackMatrix());n=this.decoder.decode(t),r=Et.NO_POINTS}else{const t=new yt(e.getBlackMatrix()).detect();n=this.decoder.decode(t.getBits()),r=t.getPoints()}const i=n.getRawBytes(),o=new j(n.getText(),i,8*i.length,r,V.DATA_MATRIX,g.currentTimeMillis()),s=n.getByteSegments();null!=s&&o.putMetadata(q.BYTE_SEGMENTS,s);const a=n.getECLevel();return null!=a&&o.putMetadata(q.ERROR_CORRECTION_LEVEL,a),o}reset(){}static extractPureBits(e){const t=e.getTopLeftOnBit(),n=e.getBottomRightOnBit();if(null==t||null==n)throw new O;const r=this.moduleSize(t,e);let i=t[1];const o=n[1];let s=t[0];const a=(n[0]-s+1)/r,l=(o-i+1)/r;if(a<=0||l<=0)throw new O;const c=r/2;i+=c,s+=c;const u=new N(a,l);for(let t=0;t<l;t++){const n=i+t*r;for(let i=0;i<a;i++)e.get(s+i*r,n)&&u.set(i,t)}return u}static moduleSize(e,t){const n=t.getWidth();let r=e[0];const i=e[1];for(;r<n&&t.get(r,i);)r++;if(r===n)throw new O;const o=r-e[0];if(0===o)throw new O;return o}}Et.NO_POINTS=[];class vt extends U{constructor(e=500){super(new Et,e)}}!function(e){e[e.L=0]="L",e[e.M=1]="M",e[e.Q=2]="Q",e[e.H=3]="H"}(W||(W={}));class At{constructor(e,t,n){this.value=e,this.stringValue=t,this.bits=n,At.FOR_BITS.set(n,this),At.FOR_VALUE.set(e,this)}getValue(){return this.value}getBits(){return this.bits}static fromString(e){switch(e){case"L":return At.L;case"M":return At.M;case"Q":return At.Q;case"H":return At.H;default:throw new u(e+"not available")}}toString(){return this.stringValue}equals(e){if(!(e instanceof At))return!1;const t=e;return this.value===t.value}static forBits(e){if(e<0||e>=At.FOR_BITS.size)throw new h;return At.FOR_BITS.get(e)}}At.FOR_BITS=new Map,At.FOR_VALUE=new Map,At.L=new At(W.L,"L",1),At.M=new At(W.M,"M",0),At.Q=new At(W.Q,"Q",3),At.H=new At(W.H,"H",2);class Ct{constructor(e){this.errorCorrectionLevel=At.forBits(e>>3&3),this.dataMask=7&e}static numBitsDiffering(e,t){return E.bitCount(e^t)}static decodeFormatInformation(e,t){const n=Ct.doDecodeFormatInformation(e,t);return null!==n?n:Ct.doDecodeFormatInformation(e^Ct.FORMAT_INFO_MASK_QR,t^Ct.FORMAT_INFO_MASK_QR)}static doDecodeFormatInformation(e,t){let n=Number.MAX_SAFE_INTEGER,r=0;for(const i of Ct.FORMAT_INFO_DECODE_LOOKUP){const o=i[0];if(o===e||o===t)return new Ct(i[1]);let s=Ct.numBitsDiffering(e,o);s<n&&(r=i[1],n=s),e!==t&&(s=Ct.numBitsDiffering(t,o),s<n&&(r=i[1],n=s))}return n<=3?new Ct(r):null}getErrorCorrectionLevel(){return this.errorCorrectionLevel}getDataMask(){return this.dataMask}hashCode(){return this.errorCorrectionLevel.getBits()<<3|this.dataMask}equals(e){if(!(e instanceof Ct))return!1;const t=e;return this.errorCorrectionLevel===t.errorCorrectionLevel&&this.dataMask===t.dataMask}}Ct.FORMAT_INFO_MASK_QR=21522,Ct.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])];class bt{constructor(e,...t){this.ecCodewordsPerBlock=e,this.ecBlocks=t}getECCodewordsPerBlock(){return this.ecCodewordsPerBlock}getNumBlocks(){let e=0;const t=this.ecBlocks;for(const n of t)e+=n.getCount();return e}getTotalECCodewords(){return this.ecCodewordsPerBlock*this.getNumBlocks()}getECBlocks(){return this.ecBlocks}}class _t{constructor(e,t){this.count=e,this.dataCodewords=t}getCount(){return this.count}getDataCodewords(){return this.dataCodewords}}class St{constructor(e,t,...n){this.versionNumber=e,this.alignmentPatternCenters=t,this.ecBlocks=n;let r=0;const i=n[0].getECCodewordsPerBlock(),o=n[0].getECBlocks();for(const e of o)r+=e.getCount()*(e.getDataCodewords()+i);this.totalCodewords=r}getVersionNumber(){return this.versionNumber}getAlignmentPatternCenters(){return this.alignmentPatternCenters}getTotalCodewords(){return this.totalCodewords}getDimensionForVersion(){return 17+4*this.versionNumber}getECBlocksForLevel(e){return this.ecBlocks[e.getValue()]}static getProvisionalVersionForDimension(e){if(e%4!=1)throw new b;try{return this.getVersionForNumber((e-17)/4)}catch(e){throw new b}}static getVersionForNumber(e){if(e<1||e>40)throw new h;return St.VERSIONS[e-1]}static decodeVersionInformation(e){let t=Number.MAX_SAFE_INTEGER,n=0;for(let r=0;r<St.VERSION_DECODE_INFO.length;r++){const i=St.VERSION_DECODE_INFO[r];if(i===e)return St.getVersionForNumber(r+7);const o=Ct.numBitsDiffering(e,i);o<t&&(n=r+7,t=o)}return t<=3?St.getVersionForNumber(n):null}buildFunctionPattern(){const e=this.getDimensionForVersion(),t=new N(e);t.setRegion(0,0,9,9),t.setRegion(e-8,0,8,9),t.setRegion(0,e-8,9,8);const n=this.alignmentPatternCenters.length;for(let e=0;e<n;e++){const r=this.alignmentPatternCenters[e]-2;for(let i=0;i<n;i++)0===e&&(0===i||i===n-1)||e===n-1&&0===i||t.setRegion(this.alignmentPatternCenters[i]-2,r,5,5)}return t.setRegion(6,9,1,e-17),t.setRegion(9,6,e-17,1),this.versionNumber>6&&(t.setRegion(e-11,0,3,6),t.setRegion(0,e-11,6,3)),t}toString(){return""+this.versionNumber}}St.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]),St.VERSIONS=[new St(1,new Int32Array(0),new bt(7,new _t(1,19)),new bt(10,new _t(1,16)),new bt(13,new _t(1,13)),new bt(17,new _t(1,9))),new St(2,Int32Array.from([6,18]),new bt(10,new _t(1,34)),new bt(16,new _t(1,28)),new bt(22,new _t(1,22)),new bt(28,new _t(1,16))),new St(3,Int32Array.from([6,22]),new bt(15,new _t(1,55)),new bt(26,new _t(1,44)),new bt(18,new _t(2,17)),new bt(22,new _t(2,13))),new St(4,Int32Array.from([6,26]),new bt(20,new _t(1,80)),new bt(18,new _t(2,32)),new bt(26,new _t(2,24)),new bt(16,new _t(4,9))),new St(5,Int32Array.from([6,30]),new bt(26,new _t(1,108)),new bt(24,new _t(2,43)),new bt(18,new _t(2,15),new _t(2,16)),new bt(22,new _t(2,11),new _t(2,12))),new St(6,Int32Array.from([6,34]),new bt(18,new _t(2,68)),new bt(16,new _t(4,27)),new bt(24,new _t(4,19)),new bt(28,new _t(4,15))),new St(7,Int32Array.from([6,22,38]),new bt(20,new _t(2,78)),new bt(18,new _t(4,31)),new bt(18,new _t(2,14),new _t(4,15)),new bt(26,new _t(4,13),new _t(1,14))),new St(8,Int32Array.from([6,24,42]),new bt(24,new _t(2,97)),new bt(22,new _t(2,38),new _t(2,39)),new bt(22,new _t(4,18),new _t(2,19)),new bt(26,new _t(4,14),new _t(2,15))),new St(9,Int32Array.from([6,26,46]),new bt(30,new _t(2,116)),new bt(22,new _t(3,36),new _t(2,37)),new bt(20,new _t(4,16),new _t(4,17)
2),new bt(24,new _t(4,12),new _t(4,13))),new St(10,Int32Array.from([6,28,50]),new bt(18,new _t(2,68),new _t(2,69)),new bt(26,new _t(4,43),new _t(1,44)),new bt(24,new _t(6,19),new _t(2,20)),new bt(28,new _t(6,15),new _t(2,16))),new St(11,Int32Array.from([6,30,54]),new bt(20,new _t(4,81)),new bt(30,new _t(1,50),new _t(4,51)),new bt(28,new _t(4,22),new _t(4,23)),new bt(24,new _t(3,12),new _t(8,13))),new St(12,Int32Array.from([6,32,58]),new bt(24,new _t(2,92),new _t(2,93)),new bt(22,new _t(6,36),new _t(2,37)),new bt(26,new _t(4,20),new _t(6,21)),new bt(28,new _t(7,14),new _t(4,15))),new St(13,Int32Array.from([6,34,62]),new bt(26,new _t(4,107)),new bt(22,new _t(8,37),new _t(1,38)),new bt(24,new _t(8,20),new _t(4,21)),new bt(22,new _t(12,11),new _t(4,12))),new St(14,Int32Array.from([6,26,46,66]),new bt(30,new _t(3,115),new _t(1,116)),new bt(24,new _t(4,40),new _t(5,41)),new bt(20,new _t(11,16),new _t(5,17)),new bt(24,new _t(11,12),new _t(5,13))),new St(15,Int32Array.from([6,26,48,70]),new bt(22,new _t(5,87),new _t(1,88)),new bt(24,new _t(5,41),new _t(5,42)),new bt(30,new _t(5,24),new _t(7,25)),new bt(24,new _t(11,12),new _t(7,13))),new St(16,Int32Array.from([6,26,50,74]),new bt(24,new _t(5,98),new _t(1,99)),new bt(28,new _t(7,45),new _t(3,46)),new bt(24,new _t(15,19),new _t(2,20)),new bt(30,new _t(3,15),new _t(13,16))),new St(17,Int32Array.from([6,30,54,78]),new bt(28,new _t(1,107),new _t(5,108)),new bt(28,new _t(10,46),new _t(1,47)),new bt(28,new _t(1,22),new _t(15,23)),new bt(28,new _t(2,14),new _t(17,15))),new St(18,Int32Array.from([6,30,56,82]),new bt(30,new _t(5,120),new _t(1,121)),new bt(26,new _t(9,43),new _t(4,44)),new bt(28,new _t(17,22),new _t(1,23)),new bt(28,new _t(2,14),new _t(19,15))),new St(19,Int32Array.from([6,30,58,86]),new bt(28,new _t(3,113),new _t(4,114)),new bt(26,new _t(3,44),new _t(11,45)),new bt(26,new _t(17,21),new _t(4,22)),new bt(26,new _t(9,13),new _t(16,14))),new St(20,Int32Array.from([6,34,62,90]),new bt(28,new _t(3,107),new _t(5,108)),new bt(26,new _t(3,41),new _t(13,42)),new bt(30,new _t(15,24),new _t(5,25)),new bt(28,new _t(15,15),new _t(10,16))),new St(21,Int32Array.from([6,28,50,72,94]),new bt(28,new _t(4,116),new _t(4,117)),new bt(26,new _t(17,42)),new bt(28,new _t(17,22),new _t(6,23)),new bt(30,new _t(19,16),new _t(6,17))),new St(22,Int32Array.from([6,26,50,74,98]),new bt(28,new _t(2,111),new _t(7,112)),new bt(28,new _t(17,46)),new bt(30,new _t(7,24),new _t(16,25)),new bt(24,new _t(34,13))),new St(23,Int32Array.from([6,30,54,78,102]),new bt(30,new _t(4,121),new _t(5,122)),new bt(28,new _t(4,47),new _t(14,48)),new bt(30,new _t(11,24),new _t(14,25)),new bt(30,new _t(16,15),new _t(14,16))),new St(24,Int32Array.from([6,28,54,80,106]),new bt(30,new _t(6,117),new _t(4,118)),new bt(28,new _t(6,45),new _t(14,46)),new bt(30,new _t(11,24),new _t(16,25)),new bt(30,new _t(30,16),new _t(2,17))),new St(25,Int32Array.from([6,32,58,84,110]),new bt(26,new _t(8,106),new _t(4,107)),new bt(28,new _t(8,47),new _t(13,48)),new bt(30,new _t(7,24),new _t(22,25)),new bt(30,new _t(22,15),new _t(13,16))),new St(26,Int32Array.from([6,30,58,86,114]),new bt(28,new _t(10,114),new _t(2,115)),new bt(28,new _t(19,46),new _t(4,47)),new bt(28,new _t(28,22),new _t(6,23)),new bt(30,new _t(33,16),new _t(4,17))),new St(27,Int32Array.from([6,34,62,90,118]),new bt(30,new _t(8,122),new _t(4,123)),new bt(28,new _t(22,45),new _t(3,46)),new bt(30,new _t(8,23),new _t(26,24)),new bt(30,new _t(12,15),new _t(28,16))),new St(28,Int32Array.from([6,26,50,74,98,122]),new bt(30,new _t(3,117),new _t(10,118)),new bt(28,new _t(3,45),new _t(23,46)),new bt(30,new _t(4,24),new _t(31,25)),new bt(30,new _t(11,15),new _t(31,16))),new St(29,Int32Array.from([6,30,54,78,102,126]),new bt(30,new _t(7,116),new _t(7,117)),new bt(28,new _t(21,45),new _t(7,46)),new bt(30,new _t(1,23),new _t(37,24)),new bt(30,new _t(19,15),new _t(26,16))),new St(30,Int32Array.from([6,26,52,78,104,130]),new bt(30,new _t(5,115),new _t(10,116)),new bt(28,new _t(19,47),new _t(10,48)),new bt(30,new _t(15,24),new _t(25,25)),new bt(30,new _t(23,15),new _t(25,16))),new St(31,Int32Array.from([6,30,56,82,108,134]),new bt(30,new _t(13,115),new _t(3,116)),new bt(28,new _t(2,46),new _t(29,47)),new bt(30,new _t(42,24),new _t(1,25)),new bt(30,new _t(23,15),new _t(28,16))),new St(32,Int32Array.from([6,34,60,86,112,138]),new bt(30,new _t(17,115)),new bt(28,new _t(10,46),new _t(23,47)),new bt(30,new _t(10,24),new _t(35,25)),new bt(30,new _t(19,15),new _t(35,16))),new St(33,Int32Array.from([6,30,58,86,114,142]),new bt(30,new _t(17,115),new _t(1,116)),new bt(28,new _t(14,46),new _t(21,47)),new bt(30,new _t(29,24),new _t(19,25)),new bt(30,new _t(11,15),new _t(46,16))),new St(34,Int32Array.from([6,34,62,90,118,146]),new bt(30,new _t(13,115),new _t(6,116)),new bt(28,new _t(14,46),new _t(23,47)),new bt(30,new _t(44,24),new _t(7,25)),new bt(30,new _t(59,16),new _t(1,17))),new St(35,Int32Array.from([6,30,54,78,102,126,150]),new bt(30,new _t(12,121),new _t(7,122)),new bt(28,new _t(12,47),new _t(26,48)),new bt(30,new _t(39,24),new _t(14,25)),new bt(30,new _t(22,15),new _t(41,16))),new St(36,Int32Array.from([6,24,50,76,102,128,154]),new bt(30,new _t(6,121),new _t(14,122)),new bt(28,new _t(6,47),new _t(34,48)),new bt(30,new _t(46,24),new _t(10,25)),new bt(30,new _t(2,15),new _t(64,16))
vendor: 3,970 bytes, line 2
2),new St(37,Int32Array.from([6,28,54,80,106,132,158]),new bt(30,new _t(17,122),new _t(4,123)),new bt(28,new _t(29,46),new _t(14,47)),new bt(30,new _t(49,24),new _t(10,25)),new bt(30,new _t(24,15),new _t(46,16))),new St(38,Int32Array.from([6,32,58,84,110,136,162]),new bt(30,new _t(4,122),new _t(18,123)),new bt(28,new _t(13,46),new _t(32,47)),new bt(30,new _t(48,24),new _t(14,25)),new bt(30,new _t(42,15),new _t(32,16))),new St(39,Int32Array.from([6,26,54,82,110,138,166]),new bt(30,new _t(20,117),new _t(4,118)),new bt(28,new _t(40,47),new _t(7,48)),new bt(30,new _t(43,24),new _t(22,25)),new bt(30,new _t(10,15),new _t(67,16))),new St(40,Int32Array.from([6,30,58,86,114,142,170]),new bt(30,new _t(19,118),new _t(6,119)),new bt(28,new _t(18,47),new _t(31,48)),new bt(30,new _t(34,24),new _t(34,25)),new bt(30,new _t(20,15),new _t(61,16)))],function(e){e[e.DATA_MASK_000=0]="DATA_MASK_000",e[e.DATA_MASK_001=1]="DATA_MASK_001",e[e.DATA_MASK_010=2]="DATA_MASK_010",e[e.DATA_MASK_011=3]="DATA_MASK_011",e[e.DATA_MASK_100=4]="DATA_MASK_100",e[e.DATA_MASK_101=5]="DATA_MASK_101",e[e.DATA_MASK_110=6]="DATA_MASK_110",e[e.DATA_MASK_111=7]="DATA_MASK_111"}(Y||(Y={}));class It{constructor(e,t){this.value=e,this.isMasked=t}unmaskBitMatrix(e,t){for(let n=0;n<t;n++)for(let r=0;r<t;r++)this.isMasked(n,r)&&e.flip(r,n)}}It.values=new Map([[Y.DATA_MASK_000,new It(Y.DATA_MASK_000,(e,t)=>!(e+t&1))],[Y.DATA_MASK_001,new It(Y.DATA_MASK_001,(e,t)=>!(1&e))],[Y.DATA_MASK_010,new It(Y.DATA_MASK_010,(e,t)=>t%3==0)],[Y.DATA_MASK_011,new It(Y.DATA_MASK_011,(e,t)=>(e+t)%3==0)],[Y.DATA_MASK_100,new It(Y.DATA_MASK_100,(e,t)=>!(Math.floor(e/2)+Math.floor(t/3)&1))],[Y.DATA_MASK_101,new It(Y.DATA_MASK_101,(e,t)=>e*t%6==0)],[Y.DATA_MASK_110,new It(Y.DATA_MASK_110,(e,t)=>e*t%6<3)],[Y.DATA_MASK_111,new It(Y.DATA_MASK_111,(e,t)=>!(e+t+e*t%3&1))]]);class Tt{constructor(e){const t=e.getHeight();if(t<21||1!=(3&t))throw new b;this.bitMatrix=e}readFormatInformation(){if(null!==this.parsedFormatInfo&&void 0!==this.parsedFormatInfo)return this.parsedFormatInfo;let e=0;for(let t=0;t<6;t++)e=this.copyBit(t,8,e);e=this.copyBit(7,8,e),e=this.copyBit(8,8,e),e=this.copyBit(8,7,e);for(let t=5;t>=0;t--)e=this.copyBit(8,t,e);const t=this.bitMatrix.getHeight();let n=0;const r=t-7;for(let e=t-1;e>=r;e--)n=this.copyBit(8,e,n);for(let e=t-8;e<t;e++)n=this.copyBit(e,8,n);if(this.parsedFormatInfo=Ct.decodeFormatInformation(e,n),null!==this.parsedFormatInfo)return this.parsedFormatInfo;throw new b}readVersion(){if(null!==this.parsedVersion&&void 0!==this.parsedVersion)return this.parsedVersion;const e=this.bitMatrix.getHeight(),t=Math.floor((e-17)/4);if(t<=6)return St.getVersionForNumber(t);let n=0;const r=e-11;for(let t=5;t>=0;t--)for(let i=e-9;i>=r;i--)n=this.copyBit(i,t,n);let i=St.decodeVersionInformation(n);if(null!==i&&i.getDimensionForVersion()===e)return this.parsedVersion=i,i;n=0;for(let t=5;t>=0;t--)for(let i=e-9;i>=r;i--)n=this.copyBit(t,i,n);if(i=St.decodeVersionInformation(n),null!==i&&i.getDimensionForVersion()===e)return this.parsedVersion=i,i;throw new b}copyBit(e,t,n){return(this.isMirror?this.bitMatrix.get(t,e):this.bitMatrix.get(e,t))?n<<1|1:n<<1}readCodewords(){const e=this.readFormatInformation(),t=this.readVersion(),n=It.values.get(e.getDataMask()),r=this.bitMatrix.getHeight();n.unmaskBitMatrix(this.bitMatrix,r);const i=t.buildFunctionPattern();let o=!0;const s=new Uint8Array(t.getTotalCodewords());let a=0,l=0,c=0;for(let e=r-1;e>0;e-=2){6===e&&e--;for(let t=0;t<r;t++){const n=o?r-1-t:t;for(let t=0;t<2;t++)i.get(e-t,n)||(c++,l<<=1,this.bitMatrix.get(e-t,n)&&(l|=1),8===c&&(s[a++]=l,c=0,l=0))}o=!o}if(a!==t.getTotalCodewords())throw new b;return s}remask(){if(null===this.parsedFormatInfo)return;const e=It.values[this.parsedFormatInfo.getDataMask()],t=this.bitMatrix.getHeight();e.unmaskBitMatrix(this.bitMatrix,t)}setMirror(e){this.parsedVersion=null,this.parsedFormatInfo=null,this.isMirror=e}mirror(){const e=this.bitMatrix;for(let t=0,n=e.getWidth();t<n;
vendor: 15,118 bytes, line 2
2t++)for(let n=t+1,r=e.getHeight();n<r;n++)e.get(t,n)!==e.get(n,t)&&(e.flip(n,t),e.flip(t,n))}}class Dt{constructor(e,t){this.numDataCodewords=e,this.codewords=t}static getDataBlocks(e,t,n){if(e.length!==t.getTotalCodewords())throw new h;const r=t.getECBlocksForLevel(n);let i=0;const o=r.getECBlocks();for(const e of o)i+=e.getCount();const s=new Array(i);let a=0;for(const e of o)for(let t=0;t<e.getCount();t++){const t=e.getDataCodewords(),n=r.getECCodewordsPerBlock()+t;s[a++]=new Dt(t,new Uint8Array(n))}const l=s[0].codewords.length;let c=s.length-1;for(;c>=0&&s[c].codewords.length!==l;)c--;c++;const u=l-r.getECCodewordsPerBlock();let d=0;for(let t=0;t<u;t++)for(let n=0;n<a;n++)s[n].codewords[t]=e[d++];for(let t=c;t<a;t++)s[t].codewords[u]=e[d++];const f=s[0].codewords.length;for(let t=u;t<f;t++)for(let n=0;n<a;n++){const r=n<c?t:t+1;s[n].codewords[r]=e[d++]}return s}getNumDataCodewords(){return this.numDataCodewords}getCodewords(){return this.codewords}}!function(e){e[e.TERMINATOR=0]="TERMINATOR",e[e.NUMERIC=1]="NUMERIC",e[e.ALPHANUMERIC=2]="ALPHANUMERIC",e[e.STRUCTURED_APPEND=3]="STRUCTURED_APPEND",e[e.BYTE=4]="BYTE",e[e.ECI=5]="ECI",e[e.KANJI=6]="KANJI",e[e.FNC1_FIRST_POSITION=7]="FNC1_FIRST_POSITION",e[e.FNC1_SECOND_POSITION=8]="FNC1_SECOND_POSITION",e[e.HANZI=9]="HANZI"}(X||(X={}));class Nt{constructor(e,t,n,r){this.value=e,this.stringValue=t,this.characterCountBitsForVersions=n,this.bits=r,Nt.FOR_BITS.set(r,this),Nt.FOR_VALUE.set(e,this)}static forBits(e){const t=Nt.FOR_BITS.get(e);if(void 0===t)throw new h;return t}getCharacterCountBits(e){const t=e.getVersionNumber();let n;return n=t<=9?0:t<=26?1:2,this.characterCountBitsForVersions[n]}getValue(){return this.value}getBits(){return this.bits}equals(e){if(!(e instanceof Nt))return!1;const t=e;return this.value===t.value}toString(){return this.stringValue}}Nt.FOR_BITS=new Map,Nt.FOR_VALUE=new Map,Nt.TERMINATOR=new Nt(X.TERMINATOR,"TERMINATOR",Int32Array.from([0,0,0]),0),Nt.NUMERIC=new Nt(X.NUMERIC,"NUMERIC",Int32Array.from([10,12,14]),1),Nt.ALPHANUMERIC=new Nt(X.ALPHANUMERIC,"ALPHANUMERIC",Int32Array.from([9,11,13]),2),Nt.STRUCTURED_APPEND=new Nt(X.STRUCTURED_APPEND,"STRUCTURED_APPEND",Int32Array.from([0,0,0]),3),Nt.BYTE=new Nt(X.BYTE,"BYTE",Int32Array.from([8,16,16]),4),Nt.ECI=new Nt(X.ECI,"ECI",Int32Array.from([0,0,0]),7),Nt.KANJI=new Nt(X.KANJI,"KANJI",Int32Array.from([8,10,12]),8),Nt.FNC1_FIRST_POSITION=new Nt(X.FNC1_FIRST_POSITION,"FNC1_FIRST_POSITION",Int32Array.from([0,0,0]),5),Nt.FNC1_SECOND_POSITION=new Nt(X.FNC1_SECOND_POSITION,"FNC1_SECOND_POSITION",Int32Array.from([0,0,0]),9),Nt.HANZI=new Nt(X.HANZI,"HANZI",Int32Array.from([8,10,12]),13);class Ot{static decode(e,t,n,r){const i=new gt(e);let o=new D;const s=new Array;let a=-1,l=-1;try{let e,n=null,c=!1;do{if(i.available()<4)e=Nt.TERMINATOR;else{const t=i.readBits(4);e=Nt.forBits(t)}switch(e){case Nt.TERMINATOR:break;case Nt.FNC1_FIRST_POSITION:case Nt.FNC1_SECOND_POSITION:c=!0;break;case Nt.STRUCTURED_APPEND:if(i.available()<16)throw new b;a=i.readBits(8),l=i.readBits(8);break;case Nt.ECI:const u=Ot.parseECIValue(i);if(n=_.getCharacterSetECIByValue(u),null===n)throw new b;break;case Nt.HANZI:const h=i.readBits(4),d=i.readBits(e.getCharacterCountBits(t));h===Ot.GB2312_SUBSET&&Ot.decodeHanziSegment(i,o,d);break;default:const f=i.readBits(e.getCharacterCountBits(t));switch(e){case Nt.NUMERIC:Ot.decodeNumericSegment(i,o,f);break;case Nt.ALPHANUMERIC:Ot.decodeAlphanumericSegment(i,o,f,c);break;case Nt.BYTE:Ot.decodeByteSegment(i,o,f,n,s,r);break;case Nt.KANJI:Ot.decodeKanjiSegment(i,o,f);break;default:throw new b}}}while(e!==Nt.TERMINATOR)}catch(e){throw new b}return new Z(e,o.toString(),0===s.length?null:s,null===n?null:n.toString(),a,l)}static decodeHanziSegment(e,t,n){if(13*n>e.available())throw new b;const r=new Uint8Array(2*n);let i=0;for(;n>0;){const t=e.readBits(13);let o=t/96<<8&4294967295|t%96;o+=o<959?41377:42657,r[i]=o>>8&255,r[i+1]=255&o,i+=2,n--}try{t.append(I.decode(r,T.GB2312))}catch(e){throw new b(e)}}static decodeKanjiSegment(e,t,n){if(13*n>e.available())throw new b;const r=new Uint8Array(2*n);let i=0;for(;n>0;){const t=e.readBits(13);let o=t/192<<8&4294967295|t%192;o+=o<7936?33088:49472,r[i]=o>>8,r[i+1]=o,i+=2,n--}try{t.append(I.decode(r,T.SHIFT_JIS))}catch(e){throw new b(e)}}static decodeByteSegment(e,t,n,r,i,o){if(8*n>e.available())throw new b;const s=new Uint8Array(n);for(let t=0;t<n;t++)s[t]=e.readBits(8);let a;a=null===r?T.guessEncoding(s,o):r.getName();try{t.append(I.decode(s,a))}catch(e){throw new b(e)}i.push(s)}static toAlphaNumericChar(e){if(e>=Ot.ALPHANUMERIC_CHARS.length)throw new b;return Ot.ALPHANUMERIC_CHARS[e]}static decodeAlphanumericSegment(e,t,n,r){const i=t.length();for(;n>1;){if(e.available()<11)throw new b;const r=e.readBits(11);t.append(Ot.toAlphaNumericChar(Math.floor(r/45))),t.append(Ot.toAlphaNumericChar(r%45)),n-=2}if(1===n){if(e.available()<6)throw new b;t.append(Ot.toAlphaNumericChar(e.readBits(6)))}if(r)for(let e=i;e<t.length();e++)"%"===t.charAt(e)&&(e<t.length()-1&&"%"===t.charAt(e+1)?t.deleteCharAt(e+1):t.setCharAt(e,String.fromCharCode(29)))}static decodeNumericSegment(e,t,n){for(;n>=3;){if(e.available()<10)throw new b;const r=e.readBits(10);if(r>=1e3)throw new b;t.append(Ot.toAlphaNumericChar(Math.floor(r/100))),t.append(Ot.toAlphaNumericChar(Math.floor(r/10)%10)),t.append(Ot.toAlphaNumericChar(r%10)),n-=3}if(2===n){if(e.available()<7)throw new b;const n=e.readBits(7);if(n>=100)throw new b;t.append(Ot.toAlphaNumericChar(Math.floor(n/10))),t.append(Ot.toAlphaNumericChar(n%10))}else if(1===n){if(e.available()<4)throw new b;const n=e.readBits(4);if(n>=10)throw new b;t.append(Ot.toAlphaNumericChar(n))}}static parseECIValue(e){const t=e.readBits(8);if(!(128&t))return 127&t;if(128==(192&t))return(63&t)<<8&4294967295|e.readBits(8);if(192==(224&t))return(31&t)<<16&4294967295|e.readBits(16);throw new b}}Ot.ALPHANUMERIC_CHARS="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:",Ot.GB2312_SUBSET=1;class Rt{constructor(e){this.mirrored=e}isMirrored(){return this.mirrored}applyMirroredCorrection(e){if(!this.mirrored||null===e||e.length<3)return;const t=e[0];e[0]=e[2],e[2]=t}}class Mt{constructor(){this.rsDecoder=new re(ee.QR_CODE_FIELD_256)}decodeBooleanArray(e,t){return this.decodeBitMatrix(N.parseFromBooleanArray(e),t)}decodeBitMatrix(e,t){const n=new Tt(e);let r=null;try{return this.decodeBitMatrixParser(n,t)}catch(e){r=e}try{n.remask(),n.setMirror(!0),n.readVersion(),n.readFormatInformation(),n.mirror();const e=this.decodeBitMatrixParser(n,t);return e.setOther(new Rt(!0)),e}catch(e){if(null!==r)throw r;throw e}}decodeBitMatrixParser(e,t){const n=e.readVersion(),r=e.readFormatInformation().getErrorCorrectionLevel(),i=e.readCodewords(),o=Dt.getDataBlocks(i,n,r);let s=0;for(const e of o)s+=e.getNumDataCodewords();const a=new Uint8Array(s);let l=0;for(const e of o){const t=e.getCodewords(),n=e.getNumDataCodewords();this.correctErrors(t,n);for(let e=0;e<n;e++)a[l++]=t[e]}return Ot.decode(a,n,r,t)}correctErrors(e,t){const n=new Int32Array(e);try{this.rsDecoder.decode(n,e.length-t)}catch(e){throw new f}for(let r=0;r<t;r++)e[r]=n[r]}}class Pt extends ae{constructor(e,t,n){super(e,t),this.estimatedModuleSize=n}aboutEquals(e,t,n){if(Math.abs(t-this.getY())<=e&&Math.abs(n-this.getX())<=e){const t=Math.abs(e-this.estimatedModuleSize);return t<=1||t<=this.estimatedModuleSize}return!1}combineEstimate(e,t,n){const r=(this.getX()+t)/2,i=(this.getY()+e)/2,o=(this.estimatedModuleSize+n)/2;return new Pt(r,i,o)}}class kt{constructor(e,t,n,r,i,o,s){this.image=e,this.startX=t,this.startY=n,this.width=r,this.height=i,this.moduleSize=o,this.resultPointCallback=s,this.possibleCenters=[],this.crossCheckStateCount=new Int32Array(3)}find(){const e=this.startX,t=this.height,n=e+this.width,r=this.startY+t/2,i=new Int32Array(3),o=this.image;for(let s=0;s<t;s++){const t=r+(1&s?-Math.floor((s+1)/2):Math.floor((s+1)/2));i[0]=0,i[1]=0,i[2]=0;let a=e;for(;a<n&&!o.get(a,t);)a++;let l=0;for(;a<n;){if(o.get(a,t))if(1===l)i[1]++;else if(2===l){if(this.foundPatternCross(i)){const e=this.handlePossibleCenter(i,t,a);if(null!==e)return e}i[0]=i[2],i[1]=1,i[2]=0,l=1}else i[++l]++;else 1===l&&l++,i[l]++;a++}if(this.foundPatternCross(i)){const e=this.handlePossibleCenter(i,t,n);if(null!==e)return e}}if(0!==this.possibleCenters.length)return this.possibleCenters[0];throw new O}static centerFromEnd(e,t){return t-e[2]-e[1]/2}foundPatternCross(e){const t=this.moduleSize,n=t/2;for(let r=0;r<3;r++)if(Math.abs(t-e[r])>=n)return!1;return!0}crossCheckVertical(e,t,n,r){const i=this.image,o=i.getHeight(),s=this.crossCheckStateCount;s[0]=0,s[1]=0,s[2]=0;let a=e;for(;a>=0&&i.get(t,a)&&s[1]<=n;)s[1]++,a--;if(a<0||s[1]>n)return NaN;for(;a>=0&&!i.get(t,a)&&s[0]<=n;)s[0]++,a--;if(s[0]>n)return NaN;for(a=e+1;a<o&&i.get(t,a)&&s[1]<=n;)s[1]++,a++;if(a===o||s[1]>n)return NaN;for(;a<o&&!i.get(t,a)&&s[2]<=n;)s[2]++,a++;if(s[2]>n)return NaN;const l=s[0]+s[1]+s[2];return 5*Math.abs(l-r)>=2*r?NaN:this.foundPatternCross(s)?kt.centerFromEnd(s,a):NaN}handlePossibleCenter(e,t,n){const r=e[0]+e[1]+e[2],i=kt.centerFromEnd(e,n),o=this.crossCheckVertical(t,i,2*e[1],r);if(!isNaN(o)){const t=(e[0]+e[1]+e[2])/3;for(const e of this.possibleCenters)if(e.aboutEquals(t,o,i))return e.combineEstimate(o,i,t);const n=new Pt(i,o,t);this.possibleCenters.push(n),null!==this.resultPointCallback&&void 0!==this.resultPointCallback&&this.resultPointCallback.foundPossibleResultPoint(n)}return null}}class xt extends ae{constructor(e,t,n,r){super(e,t),this.estimatedModuleSize=n,this.count=r,void 0===r&&(this.count=1)}getEstimatedModuleSize(){return this.estimatedModuleSize}getCount(){return this.count}aboutEquals(e,t,n){if(Math.abs(t-this.getY())<=e&&Math.abs(n-this.getX())<=e){const t=Math.abs(e-this.estimatedModuleSize);return t<=1||t<=this.estimatedModuleSize}return!1}combineEstimate(e,t,n){const r=this.count+1,i=(this.count*this.getX()+t)/r,o=(this.count*this.getY()+e)/r,s=(this.count*this.estimatedModuleSize+n)/r;return new xt(i,o,s,r)}}class Lt{constructor(e){this.bottomLeft=e[0],this.topLeft=e[1],this.topRight=e[2]}getBottomLeft(){return this.bottomLeft}getTopLeft(){return this.topLeft}getTopRight(){return this.topRight}}class Bt{constructor(e,t){this.image=e,this.resultPointCallback=t,this.possibleCenters=[],this.crossCheckStateCount=new Int32Array(5),this.resultPointCallback=t}getImage(){return this.image}getPossibleCenters(){return this.possibleCenters}find(e){const t=null!=e&&void 0!==e.get(C.TRY_HARDER),n=null!=e&&void 0!==e.get(C.PURE_BARCODE),r=this.image,i=r.getHeight(),o=r.getWidth();let s=Math.floor(3*i/(4*Bt.MAX_MODULES));(s<Bt.MIN_SKIP||t)&&(s=Bt.MIN_SKIP);let a=!1;const l=new Int32Array(5);for(let e=s-1;e<i&&!a;e+=s){l[0]=0,l[1]=0,l[2]=0,l[3]=0,l[4]=0;let t=0;for(let i=0;i<o;i++)if(r.get(i,e))1&~t||t++,l[t]++;else if(1&t)l[t]++;else if(4===t)if(Bt.foundPatternCross(l)){if(!0!==this.handlePossibleCenter(l,e,i,n)){l[0]=l[2],l[1]=l[3],l[2]=l[4],l[3]=1,l[4]=0,t=3;continue}if(s=2,!0===this.hasSkipped)a=this.haveMultiplyConfirmedCenters();else{const t=this.findRowSkip();t>l[2]&&(e+=t-l[2]-s,i=o-1)}t=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,t=3;else l[++t]++;Bt.foundPatternCross(l)&&!0===this.handlePossibleCenter(l,e,o,n)&&(s=l[0],this.hasSkipped&&(a=this.haveMultiplyConfirmedCenters()))}const c=this.selectBestPatterns();return ae.orderBestPatterns(c),new Lt(c)}static centerFromEnd(e,t){return t-e[4]-e[3]-e[2]/2}static foundPatternCross(e){let t=0;for(let n=0;n<5;n++){const r=e[n];if(0===r)return!1;t+=r}if(t<7)return!1;const n=t/7,r=n/2;return Math.abs(n-e[0])<r&&Math.abs(n-e[1])<r&&Math.abs(3*n-e[2])<3*r&&Math.abs(n-e[3])<r&&Math.abs(n-e[4])<r}getCrossCheckStateCount(){const e=this.crossCheckStateCount;return e[0]=0,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e}crossCheckDiagonal(e,t,n,r){const i=this.getCrossCheckStateCount();let o=0;const s=this.image;for(;e>=o&&t>=o&&s.get(t-o,e-o);)i[2]++,o++;if(e<o||t<o)return!1;for(;e>=o&&t>=o&&!s.get(t-o,e-o)&&i[1]<=n;)i[1]++,o++;if(e<o||t<o||i[1]>n)return!1;for(;e>=o&&t>=o&&s.get(t-o,e-o)&&i[0]<=n;)i[0]++,o++;if(i[0]>n)return!1;const a=s.getHeight(),l=s.getWidth();for(o=1;e+o<a&&t+o<l&&s.get(t+o,e+o);)i[2]++,o++;if(e+o>=a||t+o>=l)return!1;for(;e+o<a&&t+o<l&&!s.get(t+o,e+o)&&i[3]<n;)i[3]++,o++;if(e+o>=a||t+o>=l||i[3]>=n)return!1;for(;e+o<a&&t+o<l&&s.get(t+o,e+o)&&i[4]<n;)i[4]++,o++;if(i[4]>=n)return!1;const c=i[0]+i[1]+i[2]+i[3]+i[4];return Math.abs(c-r)<2*r&&Bt.foundPatternCross(i)}crossCheckVertical(e,t,n,r){const i=this.image,o=i.getHeight(),s=this.getCrossCheckStateCount();let a=e;for(;a>=0&&i.get(t,a);)s[2]++,a--;if(a<0)return NaN;for(;a>=0&&!i.get(t,a)&&s[1]<=n;)s[1]++,a--;if(a<0||s[1]>n)return NaN;for(;a>=0&&i.get(t,a)&&s[0]<=n;)s[0]++,a--;if(s[0]>n)return NaN;for(a=e+1;a<o&&i.get(t,a);)s[2]++,a++;if(a===o)return NaN;for(;a<o&&!i.get(t,a)&&s[3]<n;)s[3]++,a++;if(a===o||s[3]>=n)return NaN;for(;a<o&&i.get(t,a)&&s[4]<n;)s[4]++,a++;if(s[4]>=n)return NaN;const l=s[0]+s[1]+s[2]+s[3]+s[4];return 5*Math.abs(l-r)>=2*r?NaN:Bt.foundPatternCross(s)?Bt.centerFromEnd(s,a):NaN}crossCheckHorizontal(e,t,n,r){const i=this.image,o=i.getWidth(),s=this.getCrossCheckStateCount();let a=e;for(;a>=0&&i.get(a,t);)s[2]++,a--;if(a<0)return NaN;for(;a>=0&&!i.get(a,t)&&s[1]<=n;)s[1]++,a--;if(a<0||s[1]>n)return NaN;for(;a>=0&&i.get(a,t)&&s[0]<=n;)s[0]++,a--;if(s[0]>n)return NaN;for(a=e+1;a<o&&i.get(a,t);)s[2]++,a++;if(a===o)return NaN;for(;a<o&&!i.get(a,t)&&s[3]<n;)s[3]++,a++;if(a===o||s[3]>=n)return NaN;for(;a<o&&i.get(a,t)&&s[4]<n;)s[4]++,a++;if(s[4]>=n)return NaN;const l=s[0]+s[1]+s[2]+s[3]+s[4];return 5*Math.abs(l-r)>=r?NaN:Bt.foundPatternCross(s)?Bt.centerFromEnd(s,a):NaN}handlePossibleCenter(e,t,n,r){const i=e[0]+e[1]+e[2]+e[3]+e[4];let o=Bt.centerFromEnd(e,n),s=this.crossCheckVertical(t,Math.floor(o),e[2],i);if(!isNaN(s)&&(o=this.crossCheckHorizontal(Math.floor(o),Math.floor(s),e[2],i),!isNaN(o)&&(!r||this.crossCheckDiagonal(Math.floor(s),Math.floor(o),e[2],i)))){const e=i/7;let t=!1;const n=this.possibleCenters;for(let r=0,i=n.length;r<i;r++){const i=n[r];if(i.aboutEquals(e,s,o)){n[r]=i.combineEstimate(s,o,e),t=!0;break}}if(!t){const t=new xt(o,s,e);n.push(t),null!==this.resultPointCallback&&void 0!==this.resultPointCallback&&this.resultPointCallback.foundPossibleResultPoint(t)}return!0}return!1}findRowSkip(){if(this.possibleCenters.length<=1)return 0;let e=null;for(const t of this.possibleCenters)if(t.getCount()>=Bt.CENTER_QUORUM){if(null!=e)return this.hasSkipped=!0,Math.floor((Math.abs(e.getX()-t.getX())-Math.abs(e.getY()-t.getY()))/2);e=t}return 0}haveMultiplyConfirmedCenters(){let e=0,t=0;const n=this.possibleCenters.length;for(const n of this.possibleCenters)n.getCount()>=Bt.CENTER_QUORUM&&(e++,t+=n.getEstimatedModuleSize());if(e<3)return!1;const r=t/n;let i=0;for(const e of this.possibleCenters)i+=Math.abs(e.getEstimatedModuleSize()-r);return i<=.05*t}selectBestPatterns(){const e=this.possibleCenters.length;if(e<3)throw new O;const t=this.possibleCenters;let n;if(e>3){let r=0,i=0;for(const e of this.possibleCenters){const t=e.getEstimatedModuleSize();r+=t,i+=t*t}n=r/e;let o=Math.sqrt(i/e-n*n);t.sort((e,t)=>
vendor: 6,225 bytes, line 2
2{const r=Math.abs(t.getEstimatedModuleSize()-n),i=Math.abs(e.getEstimatedModuleSize()-n);return r<i?-1:r>i?1:0});const s=Math.max(.2*n,o);for(let e=0;e<t.length&&t.length>3;e++){const r=t[e];Math.abs(r.getEstimatedModuleSize()-n)>s&&(t.splice(e,1),e--)}}if(t.length>3){let e=0;for(const n of t)e+=n.getEstimatedModuleSize();n=e/t.length,t.sort((e,t)=>{if(t.getCount()===e.getCount()){const r=Math.abs(t.getEstimatedModuleSize()-n),i=Math.abs(e.getEstimatedModuleSize()-n);return r<i?1:r>i?-1:0}return t.getCount()-e.getCount()}),t.splice(3)}return[t[0],t[1],t[2]]}}Bt.CENTER_QUORUM=2,Bt.MIN_SKIP=3,Bt.MAX_MODULES=57;class Ft{constructor(e){this.image=e}getImage(){return this.image}getResultPointCallback(){return this.resultPointCallback}detect(e){this.resultPointCallback=null==e?null:e.get(C.NEED_RESULT_POINT_CALLBACK);const t=new Bt(this.image,this.resultPointCallback).find(e);return this.processFinderPatternInfo(t)}processFinderPatternInfo(e){const t=e.getTopLeft(),n=e.getTopRight(),r=e.getBottomLeft(),i=this.calculateModuleSize(t,n,r);if(i<1)throw new O("No pattern found in proccess finder.");const o=Ft.computeDimension(t,n,r,i),s=St.getProvisionalVersionForDimension(o),a=s.getDimensionForVersion()-7;let l=null;if(s.getAlignmentPatternCenters().length>0){const e=n.getX()-t.getX()+r.getX(),o=n.getY()-t.getY()+r.getY(),s=1-3/a,c=Math.floor(t.getX()+s*(e-t.getX())),u=Math.floor(t.getY()+s*(o-t.getY()));for(let e=4;e<=16;e<<=1)try{l=this.findAlignmentInRegion(i,c,u,e);break}catch(e){if(!(e instanceof O))throw e}}const c=Ft.createTransform(t,n,r,l,o),u=Ft.sampleGrid(this.image,c,o);let h;return h=null===l?[r,t,n]:[r,t,n,l],new le(u,h)}static createTransform(e,t,n,r,i){const o=i-3.5;let s,a,l,c;return null!==r?(s=r.getX(),a=r.getY(),l=o-3,c=l):(s=t.getX()-e.getX()+n.getX(),a=t.getY()-e.getY()+n.getY(),l=o,c=o),de.quadrilateralToQuadrilateral(3.5,3.5,o,3.5,l,c,3.5,o,e.getX(),e.getY(),t.getX(),t.getY(),s,a,n.getX(),n.getY())}static sampleGrid(e,t,n){return pe.getInstance().sampleGridWithTransform(e,n,n,t)}static computeDimension(e,t,n,r){const i=oe.round(ae.distance(e,t)/r),o=oe.round(ae.distance(e,n)/r);let s=Math.floor((i+o)/2)+7;switch(3&s){case 0:s++;break;case 2:s--;break;case 3:throw new O("Dimensions could be not found.")}return s}calculateModuleSize(e,t,n){return(this.calculateModuleSizeOneWay(e,t)+this.calculateModuleSizeOneWay(e,n))/2}calculateModuleSizeOneWay(e,t){const n=this.sizeOfBlackWhiteBlackRunBothWays(Math.floor(e.getX()),Math.floor(e.getY()),Math.floor(t.getX()),Math.floor(t.getY())),r=this.sizeOfBlackWhiteBlackRunBothWays(Math.floor(t.getX()),Math.floor(t.getY()),Math.floor(e.getX()),Math.floor(e.getY()));return isNaN(n)?r/7:isNaN(r)?n/7:(n+r)/14}sizeOfBlackWhiteBlackRunBothWays(e,t,n,r){let i=this.sizeOfBlackWhiteBlackRun(e,t,n,r),o=1,s=e-(n-e);s<0?(o=e/(e-s),s=0):s>=this.image.getWidth()&&(o=(this.image.getWidth()-1-e)/(s-e),s=this.image.getWidth()-1);let a=Math.floor(t-(r-t)*o);return o=1,a<0?(o=t/(t-a),a=0):a>=this.image.getHeight()&&(o=(this.image.getHeight()-1-t)/(a-t),a=this.image.getHeight()-1),s=Math.floor(e+(s-e)*o),i+=this.sizeOfBlackWhiteBlackRun(e,t,s,a),i-1}sizeOfBlackWhiteBlackRun(e,t,n,r){const i=Math.abs(r-t)>Math.abs(n-e);if(i){let i=e;e=t,t=i,i=n,n=r,r=i}const o=Math.abs(n-e),s=Math.abs(r-t);let a=-o/2;const l=e<n?1:-1,c=t<r?1:-1;let u=0;const h=n+l;for(let n=e,d=t;n!==h;n+=l){const l=i?d:n,h=i?n:d;if(1===u===this.image.get(l,h)){if(2===u)return oe.distance(n,d,e,t);u++}if(a+=s,a>0){if(d===r)break;d+=c,a-=o}}return 2===u?oe.distance(n+l,r,e,t):NaN}findAlignmentInRegion(e,t,n,r){const i=Math.floor(r*e),o=Math.max(0,t-i),s=Math.min(this.image.getWidth()-1,t+i);if(s-o<3*e)throw new O("Alignment top exceeds estimated module size.");const a=Math.max(0,n-i),l=Math.min(this.image.getHeight()-1,n+i);if(l-a<3*e)throw new O("Alignment bottom exceeds estimated module size.");return new kt(this.image,o,a,s-o,l-a,e,this.resultPointCallback).find()}}class Ut{constructor(){this.decoder=new Mt}getDecoder(){return this.decoder}decode(e,t){let n,r;if(null!=t&&void 0!==t.get(C.PURE_BARCODE)){const i=Ut.extractPureBits(e.getBlackMatrix());n=this.decoder.decodeBitMatrix(i,t),r=Ut.NO_POINTS}else{const i=new Ft(e.getBlackMatrix()).detect(t);n=this.decoder.decodeBitMatrix(i.getBits(),t),r=i.getPoints()}n.getOther()instanceof Rt&&n.getOther().applyMirroredCorrection(r);const i=new j(n.getText(),n.getRawBytes(),void 0,r,V.QR_CODE,void 0),o=n.getByteSegments();null!==o&&i.putMetadata(q.BYTE_SEGMENTS,o);const s=n.getECLevel();return null!==s&&i.putMetadata(q.ERROR_CORRECTION_LEVEL,s),n.hasStructuredAppend()&&(i.putMetadata(q.STRUCTURED_APPEND_SEQUENCE,n.getStructuredAppendSequenceNumber()),i.putMetadata(q.STRUCTURED_APPEND_PARITY,n.getStructuredAppendParity())),i}reset(){}static extractPureBits(e){const t=e.getTopLeftOnBit(),n=e.getBottomRightOnBit();if(null===t||null===n)throw new O;const r=this.moduleSize(t,e);let i=t[1],o=n[1],s=t[0],a=n[0];if(s>=a||i>=o)throw new O;if(o-i!==a-s&&(a=s+(o-i),a>=e.getWidth()))throw new O;const l=Math.round((a-s+1)/r),c=Math.round((o-i+1)/r);if(l<=0||c<=0)throw new O;if(c!==l)throw new O;const u=Math.floor(r/2);i+=u,s+=u;const h=s+Math.floor((l-1)*r)-a;if(h>0){if(h>u)throw new O;s-=h}const d=i+Math.floor((c-1)*r)-o;if(d>0){if(d>u)throw new O;i-=d}const f=new N(l,c);for(let t=0;t<c;t++){const n=i+Math.floor(t*r);for(let i=0;i<l;i++)e.get(s+Math.floor(i*r),n)&&f.set(i,t)}return f}static moduleSize(e,t){const n=t.getHeight(),r=t.getWidth();let i=e[0],o=e[1],s=!0,a=0;for(;i<r&&o<n;){if(s!==t.get(i,o)){if(5===++a)break;s=!s}i++,o++}if(i===r||o===n)throw new O;return(i-e[0])/7}}Ut.NO_POINTS=new Array;class jt{PDF417Common(){}static getBitCountSum(e){return oe.sum(e)}static toIntArray(e){if(null==e||!e.length)return jt.EMPTY_INT_ARRAY;const t=new Int32Array(e.length);let n=0;for(const r of e)t[n++]=r;return t}static getCodeword(e){const t=y.binarySearch(jt.SYMBOL_TABLE,262143&e);return t<0?-1:(jt.CODEWORD_TABLE[t]-1)%jt.NUMBER_OF_CODEWORDS}}jt.NUMBER_OF_CODEWORDS=929,jt.MAX_CODEWORDS_IN_BARCODE=jt.NUMBER_OF_CODEWORDS-1,jt.MIN_ROWS_IN_BARCODE=3,jt.MAX_ROWS_IN_BARCODE=90,jt.MODULES_IN_CODEWORD=17,jt.MODULES_IN_STOP_PATTERN=18,jt.BARS_IN_MODULE=8,jt.EMPTY_INT_ARRAY=new Int32Array([]),j
vendor: 18,273 bytes, line 2
2t.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]),
2j
vendor: 12,861 bytes, line 2
2t.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])
vendor: 30,280 bytes, line 2
2;class Ht{constructor(e,t){this.bits=e,this.points=t}getBits(){return this.bits}getPoints(){return this.points}}class Vt{static detectMultiple(e,t,n){let r=e.getBlackMatrix(),i=Vt.detect(n,r);return i.length||(r=r.clone(),r.rotate180(),i=Vt.detect(n,r)),new Ht(r,i)}static detect(e,t){const n=new Array;let r=0,i=0,o=!1;for(;r<t.getHeight();){const s=Vt.findVertices(t,r,i);if(null!=s[0]||null!=s[3]){if(o=!0,n.push(s),!e)break;null!=s[2]?(i=Math.trunc(s[2].getX()),r=Math.trunc(s[2].getY())):(i=Math.trunc(s[4].getX()),r=Math.trunc(s[4].getY()))}else{if(!o)break;o=!1,i=0;for(const e of n)null!=e[1]&&(r=Math.trunc(Math.max(r,e[1].getY()))),null!=e[3]&&(r=Math.max(r,Math.trunc(e[3].getY())));r+=Vt.ROW_STEP}}return n}static findVertices(e,t,n){const r=e.getHeight(),i=e.getWidth(),o=new Array(8);return Vt.copyToResult(o,Vt.findRowsWithPattern(e,r,i,t,n,Vt.START_PATTERN),Vt.INDEXES_START_PATTERN),null!=o[4]&&(n=Math.trunc(o[4].getX()),t=Math.trunc(o[4].getY())),Vt.copyToResult(o,Vt.findRowsWithPattern(e,r,i,t,n,Vt.STOP_PATTERN),Vt.INDEXES_STOP_PATTERN),o}static copyToResult(e,t,n){for(let r=0;r<n.length;r++)e[n[r]]=t[r]}static findRowsWithPattern(e,t,n,r,i,o){const s=new Array(4);let a=!1;const l=new Int32Array(o.length);for(;r<t;r+=Vt.ROW_STEP){let t=Vt.findGuardPattern(e,i,r,n,!1,o,l);if(null!=t){for(;r>0;){const s=Vt.findGuardPattern(e,i,--r,n,!1,o,l);if(null==s){r++;break}t=s}s[0]=new ae(t[0],r),s[1]=new ae(t[1],r),a=!0;break}}let c=r+1;if(a){let r=0,i=Int32Array.from([Math.trunc(s[0].getX()),Math.trunc(s[1].getX())]);for(;c<t;c++){const t=Vt.findGuardPattern(e,i[0],c,n,!1,o,l);if(null!=t&&Math.abs(i[0]-t[0])<Vt.MAX_PATTERN_DRIFT&&Math.abs(i[1]-t[1])<Vt.MAX_PATTERN_DRIFT)i=t,r=0;else{if(r>Vt.SKIPPED_ROW_COUNT_MAX)break;r++}}c-=r+1,s[2]=new ae(i[0],c),s[3]=new ae(i[1],c)}return c-r<Vt.BARCODE_MIN_HEIGHT&&y.fill(s,null),s}static findGuardPattern(e,t,n,r,i,o,s){y.fillWithin(s,0,s.length,0);let a=t,l=0;for(;e.get(a,n)&&a>0&&l++<Vt.MAX_PIXEL_DRIFT;)a--;let c=a,u=0,h=o.length;for(let t=i;c<r;c++)if(e.get(c,n)!==t)s[u]++;else{if(u===h-1){if(Vt.patternMatchVariance(s,o,Vt.MAX_INDIVIDUAL_VARIANCE)<Vt.MAX_AVG_VARIANCE)return new Int32Array([a,c]);a+=s[0]+s[1],g.arraycopy(s,2,s,0,u-1),s[u-1]=0,s[u]=0,u--}else u++;s[u]=1,t=!t}return u===h-1&&Vt.patternMatchVariance(s,o,Vt.MAX_INDIVIDUAL_VARIANCE)<Vt.MAX_AVG_VARIANCE?new Int32Array([a,c-1]):null}static patternMatchVariance(e,t,n){let r=e.length,i=0,o=0;for(let n=0;n<r;n++)i+=e[n],o+=t[n];if(i<o)return 1/0;let s=i/o;n*=s;let a=0;for(let i=0;i<r;i++){let r=e[i],o=t[i]*s,l=r>o?r-o:o-r;if(l>n)return 1/0;a+=l}return a/i}}Vt.INDEXES_START_PATTERN=Int32Array.from([0,4,1,5]),Vt.INDEXES_STOP_PATTERN=Int32Array.from([6,2,7,3]),Vt.MAX_AVG_VARIANCE=.42,Vt.MAX_INDIVIDUAL_VARIANCE=.8,Vt.START_PATTERN=Int32Array.from([8,1,1,1,1,1,1,3]),Vt.STOP_PATTERN=Int32Array.from([7,1,1,3,1,1,1,2,1]),Vt.MAX_PIXEL_DRIFT=3,Vt.MAX_PATTERN_DRIFT=5,Vt.SKIPPED_ROW_COUNT_MAX=25,Vt.ROW_STEP=5,Vt.BARCODE_MIN_HEIGHT=10;class zt{constructor(e,t){if(0===t.length)throw new h;this.field=e;let n=t.length;if(n>1&&0===t[0]){let e=1;for(;e<n&&0===t[e];)e++;e===n?this.coefficients=new Int32Array([0]):(this.coefficients=new Int32Array(n-e),g.arraycopy(t,e,this.coefficients,0,this.coefficients.length))}else this.coefficients=t}getCoefficients(){return this.coefficients}getDegree(){return this.coefficients.length-1}isZero(){return 0===this.coefficients[0]}getCoefficient(e){return this.coefficients[this.coefficients.length-1-e]}evaluateAt(e){if(0===e)return this.getCoefficient(0);if(1===e){let e=0;for(let t of this.coefficients)e=this.field.add(e,t);return e}let t=this.coefficients[0],n=this.coefficients.length;for(let r=1;r<n;r++)t=this.field.add(this.field.multiply(e,t),this.coefficients[r]);return t}add(e){if(!this.field.equals(e.field))throw new h("ModulusPolys do not have same ModulusGF field");if(this.isZero())return e;if(e.isZero())return this;let t=this.coefficients,n=e.coefficients;if(t.length>n.length){let e=t;t=n,n=e}let r=new Int32Array(n.length),i=n.length-t.length;g.arraycopy(n,0,r,0,i);for(let e=i;e<n.length;e++)r[e]=this.field.add(t[e-i],n[e]);return new zt(this.field,r)}subtract(e){if(!this.field.equals(e.field))throw new h("ModulusPolys do not have same ModulusGF field");return e.isZero()?this:this.add(e.negative())}multiply(e){return e instanceof zt?this.multiplyOther(e):this.multiplyScalar(e)}multiplyOther(e){if(!this.field.equals(e.field))throw new h("ModulusPolys do not have same ModulusGF field");if(this.isZero()||e.isZero())return new zt(this.field,new Int32Array([0]));let t=this.coefficients,n=t.length,r=e.coefficients,i=r.length,o=new Int32Array(n+i-1);for(let e=0;e<n;e++){let n=t[e];for(let t=0;t<i;t++)o[e+t]=this.field.add(o[e+t],this.field.multiply(n,r[t]))}return new zt(this.field,o)}negative(){let e=this.coefficients.length,t=new Int32Array(e);for(let n=0;n<e;n++)t[n]=this.field.subtract(0,this.coefficients[n]);return new zt(this.field,t)}multiplyScalar(e){if(0===e)return new zt(this.field,new Int32Array([0]));if(1===e)return this;let t=this.coefficients.length,n=new Int32Array(t);for(let r=0;r<t;r++)n[r]=this.field.multiply(this.coefficients[r],e);return new zt(this.field,n)}multiplyByMonomial(e,t){if(e<0)throw new h;if(0===t)return new zt(this.field,new Int32Array([0]));let n=this.coefficients.length,r=new Int32Array(n+e);for(let e=0;e<n;e++)r[e]=this.field.multiply(this.coefficients[e],t);return new zt(this.field,r)}toString(){let e=new D;for(let t=this.getDegree();t>=0;t--){let n=this.getCoefficient(t);0!==n&&(n<0?(e.append(" - "),n=-n):e.length()>0&&e.append(" + "),0!==t&&1===n||e.append(n),0!==t&&(1===t?e.append("x"):(e.append("x^"),e.append(t))))}return e.toString()}}class Gt{add(e,t){return(e+t)%this.modulus}subtract(e,t){return(this.modulus+e-t)%this.modulus}exp(e){return this.expTable[e]}log(e){if(0===e)throw new h;return this.logTable[e]}inverse(e){if(0===e)throw new J;return this.expTable[this.modulus-this.logTable[e]-1]}multiply(e,t){return 0===e||0===t?0:this.expTable[(this.logTable[e]+this.logTable[t])%(this.modulus-1)]}getSize(){return this.modulus}equals(e){return e===this}}class Wt extends Gt{constructor(e,t){super(),this.modulus=e,this.expTable=new Int32Array(e),this.logTable=new Int32Array(e);let n=1;for(let r=0;r<e;r++)this.expTable[r]=n,n=n*t%e;for(let t=0;t<e-1;t++)this.logTable[this.expTable[t]]=t;this.zero=new zt(this,new Int32Array([0])),this.one=new zt(this,new Int32Array([1]))}getZero(){return this.zero}getOne(){return this.one}buildMonomial(e,t){if(e<0)throw new h;if(0===t)return this.zero;let n=new Int32Array(e+1);return n[0]=t,new zt(this,n)}}Wt.PDF417_GF=new Wt(jt.NUMBER_OF_CODEWORDS,3);class Yt{constructor(){this.field=Wt.PDF417_GF}decode(e,t,n){let r=new zt(this.field,e),i=new Int32Array(t),o=!1;for(let e=t;e>0;e--){let n=r.evaluateAt(this.field.exp(e));i[t-e]=n,0!==n&&(o=!0)}if(!o)return 0;let s=this.field.getOne();if(null!=n)for(const t of n){let n=this.field.exp(e.length-1-t),r=new zt(this.field,new Int32Array([this.field.subtract(0,n),1]));s=s.multiply(r)}let a=new zt(this.field,i),l=this.runEuclideanAlgorithm(this.field.buildMonomial(t,1),a,t),c=l[0],u=l[1],h=this.findErrorLocations(c),d=this.findErrorMagnitudes(u,c,h);for(let t=0;t<h.length;t++){let n=e.length-1-this.field.log(h[t]);if(n<0)throw f.getChecksumInstance();e[n]=this.field.subtract(e[n],d[t])}return h.length}runEuclideanAlgorithm(e,t,n){if(e.getDegree()<t.getDegree()){let n=e;e=t,t=n}let r=e,i=t,o=this.field.getZero(),s=this.field.getOne();for(;i.getDegree()>=Math.round(n/2);){let e=r,t=o;if(r=i,o=s,r.isZero())throw f.getChecksumInstance();i=e;let n=this.field.getZero(),a=r.getCoefficient(r.getDegree()),l=this.field.inverse(a);for(;i.getDegree()>=r.getDegree()&&!i.isZero();){let e=i.getDegree()-r.getDegree(),t=this.field.multiply(i.getCoefficient(i.getDegree()),l);n=n.add(this.field.buildMonomial(e,t)),i=i.subtract(r.multiplyByMonomial(e,t))}s=n.multiply(o).subtract(t).negative()}let a=s.getCoefficient(0);if(0===a)throw f.getChecksumInstance();let l=this.field.inverse(a);return[s.multiply(l),i.multiply(l)]}findErrorLocations(e){let t=e.getDegree(),n=new Int32Array(t),r=0;for(let i=1;i<this.field.getSize()&&r<t;i++)0===e.evaluateAt(i)&&(n[r]=this.field.inverse(i),r++);if(r!==t)throw f.getChecksumInstance();return n}findErrorMagnitudes(e,t,n){let r=t.getDegree(),i=new Int32Array(r);for(let e=1;e<=r;e++)i[r-e]=this.field.multiply(e,t.getCoefficient(e));let o=new zt(this.field,i),s=n.length,a=new Int32Array(s);for(let t=0;t<s;t++){let r=this.field.inverse(n[t]),i=this.field.subtract(0,e.evaluateAt(r)),s=this.field.inverse(o.evaluateAt(r));a[t]=this.field.multiply(i,s)}return a}}class Xt{constructor(e,t,n,r,i){e instanceof Xt?this.constructor_2(e):this.constructor_1(e,t,n,r,i)}constructor_1(e,t,n,r,i){const o=null==t||null==n,s=null==r||null==i;if(o&&s)throw new O;o?(t=new ae(0,r.getY()),n=new ae(0,i.getY())):s&&(r=new ae(e.getWidth()-1,t.getY()),i=new ae(e.getWidth()-1,n.getY())),this.image=e,this.topLeft=t,this.bottomLeft=n,this.topRight=r,this.bottomRight=i,this.minX=Math.trunc(Math.min(t.getX(),n.getX())),this.maxX=Math.trunc(Math.max(r.getX(),i.getX())),this.minY=Math.trunc(Math.min(t.getY(),r.getY())),this.maxY=Math.trunc(Math.max(n.getY(),i.getY()))}constructor_2(e){this.image=e.image,this.topLeft=e.getTopLeft(),this.bottomLeft=e.getBottomLeft(),this.topRight=e.getTopRight(),this.bottomRight=e.getBottomRight(),this.minX=e.getMinX(),this.maxX=e.getMaxX(),this.minY=e.getMinY(),this.maxY=e.getMaxY()}static merge(e,t){return null==e?t:null==t?e:new Xt(e.image,e.topLeft,e.bottomLeft,t.topRight,t.bottomRight)}addMissingRows(e,t,n){let r=this.topLeft,i=this.bottomLeft,o=this.topRight,s=this.bottomRight;if(e>0){let t=n?this.topLeft:this.topRight,i=Math.trunc(t.getY()-e);i<0&&(i=0);let s=new ae(t.getX(),i);n?r=s:o=s}if(t>0){let e=n?this.bottomLeft:this.bottomRight,r=Math.trunc(e.getY()+t);r>=this.image.getHeight()&&(r=this.image.getHeight()-1);let o=new ae(e.getX(),r);n?i=o:s=o}return new Xt(this.image,r,i,o,s)}getMinX(){return this.minX}getMaxX(){return this.maxX}getMinY(){return this.minY}getMaxY(){return this.maxY}getTopLeft(){return this.topLeft}getTopRight(){return this.topRight}getBottomLeft(){return this.bottomLeft}getBottomRight(){return this.bottomRight}}class $t{constructor(e,t,n,r){this.columnCount=e,this.errorCorrectionLevel=r,this.rowCountUpperPart=t,this.rowCountLowerPart=n,this.rowCount=t+n}getColumnCount(){return this.columnCount}getErrorCorrectionLevel(){return this.errorCorrectionLevel}getRowCount(){return this.rowCount}getRowCountUpperPart(){return this.rowCountUpperPart}getRowCountLowerPart(){return this.rowCountLowerPart}}class qt{constructor(){this.buffer=""}static form(e,t){let n=-1;function r(e,r,i,o,s,a){if("%%"===e)return"%";if(void 0===t[++n])return;e=o?parseInt(o.substr(1)):void 0;let l,c=s?parseInt(s.substr(1)):void 0;switch(a){case"s":l=t[n];break;case"c":l=t[n][0];break;case"f":l=parseFloat(t[n]).toFixed(e);break;case"p":l=parseFloat(t[n]).toPrecision(e);break;case"e":l=parseFloat(t[n]).toExponential(e);break;case"x":l=parseInt(t[n]).toString(c||16);break;case"d":l=parseFloat(parseInt(t[n],c||10).toPrecision(e)).toFixed(0)}l="object"==typeof l?JSON.stringify(l):(+l).toString(c);let u=parseInt(i),h=i&&i[0]+""=="0"?"0":" ";for(;l.length<u;)l=void 0!==r?l+h:h+l;return l}let i=/%(-)?(0?[0-9]+)?([.][0-9]+)?([#][0-9]+)?([scfpexd%])/g;return e.replace(i,r)}format(e,...t){this.buffer+=qt.form(e,t)}toString(){return this.buffer}}class Zt{constructor(e){this.boundingBox=new Xt(e),this.codewords=new Array(e.getMaxY()-e.getMinY()+1)}getCodewordNearby(e){let t=this.getCodeword(e);if(null!=t)return t;for(let n=1;n<Zt.MAX_NEARBY_DISTANCE;n++){let r=this.imageRowToCodewordIndex(e)-n;if(r>=0&&(t=this.codewords[r],null!=t))return t;if(r=this.imageRowToCodewordIndex(e)+n,r<this.codewords.length&&(t=this.codewords[r],null!=t))return t}return null}imageRowToCodewordIndex(e){return e-this.boundingBox.getMinY()}setCodeword(e,t){this.codewords[this.imageRowToCodewordIndex(e)]=t}getCodeword(e){return this.codewords[this.imageRowToCodewordIndex(e)]}getBoundingBox(){return this.boundingBox}getCodewords(){return this.codewords}toString(){const e=new qt;let t=0;for(const n of this.codewords)null!=n?e.format("%3d: %3d|%3d%n",t++,n.getRowNumber(),n.getValue()):e.format("%3d: | %n",t++);return e.toString()}}Zt.MAX_NEARBY_DISTANCE=5;class Qt{constructor(){this.values=new Map}setValue(e){e=Math.trunc(e);let t=this.values.get(e);null==t&&(t=0),t++,this.values.set(e,t)}getValue(){let e=-1,t=new Array;for(const[n,r]of this.values.entries()){const i={getKey:()=>n,getValue:()=>r};i.getValue()>e?(e=i.getValue(),t=[],t.push(i.getKey())):i.getValue()===e&&t.push(i.getKey())}return jt.toIntArray(t)}getConfidence(e){return this.values.get(e)}}class Kt extends Zt{constructor(e,t){super(e),this._isLeft=t}setRowNumbers(){for(let e of this.getCodewords())null!=e&&e.setRowNumberAsRowIndicatorColumn()}adjustCompleteIndicatorColumnRowNumbers(e){let t=this.getCodewords();this.setRowNumbers(),this.removeIncorrectCodewords(t,e);let n=this.getBoundingBox(),r=this._isLeft?n.getTopLeft():n.getTopRight(),i=this._isLeft?n.getBottomLeft():n.getBottomRight(),o=this.imageRowToCodewordIndex(Math.trunc(r.getY())),s=this.imageRowToCodewordIndex(Math.trunc(i.getY())),a=-1,l=1,c=0;for(let n=o;n<s;n++){if(null==t[n])continue;let r=t[n],i=r.getRowNumber()-a;if(0===i)c++;else if(1===i)l=Math.max(l,c),c=1,a=r.getRowNumber();else if(i<0||r.getRowNumber()>=e.getRowCount()||i>n)t[n]=null;else{let e;e=l>2?(l-2)*i:i;let o=e>=n;for(let r=1;r<=e&&!o;r++)o=null!=t[n-r];o?t[n]=null:(a=r.getRowNumber(),c=1)}}}getRowHeights(){let e=this.getBarcodeMetadata();if(null==e)return null;this.adjustIncompleteIndicatorColumnRowNumbers(e);let t=new Int32Array(e.getRowCount());for(let e of this.getCodewords())if(null!=e){let n=e.getRowNumber();if(n>=t.length)continue;t[n]++}return t}adjustIncompleteIndicatorColumnRowNumbers(e){let t=this.getBoundingBox(),n=this._isLeft?t.getTopLeft():t.getTopRight(),r=this._isLeft?t.getBottomLeft():t.getBottomRight(),i=this.imageRowToCodewordIndex(Math.trunc(n.getY())),o=this.imageRowToCodewordIndex(Math.trunc(r.getY())),s=this.getCodewords(),a=-1;for(let t=i;t<o;t++){if(null==s[t])continue;let n=s[t];n.setRowNumberAsRowIndicatorColumn();let r=n.getRowNumber()-a;0===r||(1===r?a=n.getRowNumber():n.getRowNumber()>=e.getRowCount()?s[t]=null:a=n.getRowNumber())}}getBarcodeMetadata(){let e=this.getCodewords(),t=new Qt,n=new Qt,r=new Qt,i=new Qt;for(let o of e){if(null==o)continue;o.setRowNumberAsRowIndicatorColumn();let e=o.getValue()%30,s=o.getRowNumber();switch(this._isLeft||(s+=2),s%3){case 0:n.setValue(3*e+1);break;case 1:i.setValue(e/3),r.setValue(e%3);break;case 2:t.setValue(e+1)}}if(0===t.getValue().length||0===n.getValue().length||0===r.getValue().length||0===i.getValue().length||t.getValue()[0]<1||n.getValue()[0]+r.getValue()[0]<jt.MIN_ROWS_IN_BARCODE||n.getValue()[0]+r.getValue()[0]>jt.MAX_ROWS_IN_BARCODE)return null;let o=new $t(t.getValue()[0],n.getValue()[0],r.getValue()[0],i.getValue()[0]);return this.removeIncorrectCodewords(e,o),o}removeIncorrectCodewords(e,t){for(let n=0;n<e.length;n++){let r=e[n];if(null==e[n])continue;let i=r.getValue()%30,o=r.getRowNumber();if(o>t.getRowCount())e[n]=null;else switch(this._isLeft||(o+=2),o%3){case 0:3*i+1!==t.getRowCountUpperPart()&&(e[n]=null);break;case 1:Math.trunc(i/3)===t.getErrorCorrectionLevel()&&i%3===t.getRowCountLowerPart()||(e[n]=null);break;case 2:i+1!==t.getColumnCount()&&(e[n]=null)}}}isLeft(){return this._isLeft}toString(){return"IsLeft: "+this._isLeft+"\n"+super.toString()}}class Jt{constructor(e,t){this.ADJUST_ROW_NUMBER_SKIP=2,this.barcodeMetadata=e,this.barcodeColumnCount=e.getColumnCount(),this.boundingBox=t,this.detectionResultColumns=new Array(this.barcodeColumnCount+2)}getDetectionResultColumns(){this.adjustIndicatorColumnRowNumbers(this.detectionResultColumns[0]),this.adjustIndicatorColumnRowNumbers(this.detectionResultColumns[this.barcodeColumnCount+1]);let e,t=jt.MAX_CODEWORDS_IN_BARCODE;do{e=t,t=this.adjustRowNumbersAndGetCount()}while(t>0&&t<e);return this.detectionResultColumns}adjustIndicatorColumnRowNumbers(e){null!=e&&e.adjustCompleteIndicatorColumnRowNumbers(this.barcodeMetadata)}adjustRowNumbersAndGetCount(){let e=this.adjustRowNumbersByRow();if(0===e)return 0;for(let e=1;e<this.barcodeColumnCount+1;e++){let t=this.detectionResultColumns[e].getCodewords();for(let n=0;n<t.length;n++)null!=t[n]&&(t[n].hasValidRowNumber()||this.adjustRowNumbers(e,n,t))}return e}adjustRowNumbersByRow(){return this.adjustRowNumbersFromBothRI(),this.adjustRowNumbersFromLRI()+this.adjustRowNumbersFromRRI()}adjustRowNumbersFromBothRI(){if(null==this.detectionResultColumns[0]||null==this.detectionResultColumns[this.barcodeColumnCount+1])return;let e=this.detectionResultColumns[0].getCodewords(),t=this.detectionResultColumns[this.barcodeColumnCount+1].getCodewords();for(let n=0;n<e.length;n++)if(null!=e[n]&&null!=t[n]&&e[n].getRowNumber()===t[n].getRowNumber())for(let t=1;t<=this.barcodeColumnCount;t++){let r=this.detectionResultColumns[t].getCodewords()[n];null!=r&&(r.setRowNumber(e[n].getRowNumber()),r.hasValidRowNumber()||(this.detectionResultColumns[t].getCodewords()[n]=null))}}adjustRowNumbersFromRRI(){if(null==this.detectionResultColumns[this.barcodeColumnCount+1])return 0;let e=0,t=this.detectionResultColumns[this.barcodeColumnCount+1].getCodewords();for(let n=0;n<t.length;n++){if(null==t[n])continue;let r=t[n].getRowNumber(),i=0;for(let t=this.barcodeColumnCount+1;t>0&&i<this.ADJUST_ROW_NUMBER_SKIP;t--){let o=this.detectionResultColumns[t].getCodewords()[n];null!=o&&(i=Jt.adjustRowNumberIfValid(r,i,o),o.hasValidRowNumber()||e++)}}return e}adjustRowNumbersFromLRI(){if(null==this.detectionResultColumns[0])return 0;let e=0,t=this.detectionResultColumns[0].getCodewords();for(let n=0;n<t.length;n++){if(null==t[n])continue;let r=t[n].getRowNumber(),i=0;for(let t=1;t<this.barcodeColumnCount+1&&i<this.ADJUST_ROW_NUMBER_SKIP;t++){let o=this.detectionResultColumns[t].getCodewords()[n];null!=o&&(i=Jt.adjustRowNumberIfValid(r,i,o),o.hasValidRowNumber()||e++)}}return e}static adjustRowNumberIfValid(e,t,n){return null==n||n.hasValidRowNumber()||(n.isValidRowNumber(e)?(n.setRowNumber(e),t=0):++t),t}adjustRowNumbers(e,t,n){if(!this.detectionResultColumns[e-1])return;let r=n[t],i=this.detectionResultColumns[e-1].getCodewords(),o=i;null!=this.detectionResultColumns[e+1]&&(o=this.detectionResultColumns[e+1].getCodewords());let s=new Array(14);s[2]=i[t],s[3]=o[t],t>0&&(s[0]=n[t-1],s[4]=i[t-1],s[5]=o[t-1]),t>1&&(s[8]=n[t-2],s[10]=i[t-2],s[11]=o[t-2]),t<n.length-1&&(s[1]=n[t+1],s[6]=i[t+1],s[7]=o[t+1]),t<n.length-2&&(s[9]=n[t+2],s[12]=i[t+2],s[13]=o[t+2]);for(let e of s)if(Jt.adjustRowNumber(r,e))return}static adjustRowNumber(e,t){return!(null==t||!t.hasValidRowNumber()||t.getBucket()!==e.getBucket()||(e.setRowNumber(t.getRowNumber()),0))}getBarcodeColumnCount(){return this.barcodeColumnCount}getBarcodeRowCount(){return this.barcodeMetadata.getRowCount()}getBarcodeECLevel(){return this.barcodeMetadata.getErrorCorrectionLevel()}setBoundingBox(e){this.boundingBox=e}getBoundingBox(){return this.boundingBox}setDetectionResultColumn(e,t){this.detectionResultColumns[e]=t}getDetectionResultColumn(e){return this.detectionResultColumns[e]}toString(){let e=this.detectionResultColumns[0];null==e&&(e=this.detectionResultColumns[this.barcodeColumnCount+1]);let t=new qt;for(let n=0;n<e.getCodewords().length;n++){t.format("CW %3d:",n);for(let e=0;e<this.barcodeColumnCount+2;e++){if(null==this.detectionResultColumns[e]){t.format(" | ");continue}let r=this.detectionResultColumns[e].getCodewords()[n];null!=r?t.format(" %3d|%3d",r.getRowNumber(),r.getValue()):t.format(" | ")}t.format("%n")}return t.toString()}}class en{constructor(e,t,n,r){this.rowNumber=en.BARCODE_ROW_UNKNOWN,this.startX=Math.trunc(e),this.endX=Math.trunc(t),this.bucket=Math.trunc(n),this.value=Math.trunc(r)}hasValidRowNumber(){return this.isValidRowNumber(this.rowNumber)}isValidRowNumber(e){return e!==en.BARCODE_ROW_UNKNOWN&&this.bucket===e%3*3}setRowNumberAsRowIndicatorColumn(){this.rowNumber=Math.trunc(3*Math.trunc(this.value/30)+Math.trunc(this.bucket/3))}getWidth(){return this.endX-this.startX}getStartX(){return this.startX}getEndX(){return this.endX}getBucket(){return this.bucket}getValue(){return this.value}getRowNumber(){return this.rowNumber}setRowNumber(e){this.rowNumber=e}toString(){return this.rowNumber+"|"+this.value}}en.BARCODE_ROW_UNKNOWN=-1;class tn{static initialize(){for(let e=0;e<jt.SYMBOL_TABLE.length;e++){let t=jt.SYMBOL_TABLE[e],n=1&t;for(let r=0;r<jt.BARS_IN_MODULE;r++){let i=0;for(;(1&t)===n;)i+=1,t>>=1;n=1&t,tn.RATIOS_TABLE[e]||(tn.RATIOS_TABLE[e]=new Array(jt.BARS_IN_MODULE)),tn.RATIOS_TABLE[e][jt.BARS_IN_MODULE-r-1]=Math.fround(i/jt.MODULES_IN_CODEWORD)}}this.bSymbolTableReady=!0}static getDecodedValue(e){let t=tn.getDecodedCodewordValue(tn.sampleBitCounts(e));return-1!==t?t:tn.getClosestDecodedValue(e)}static sampleBitCounts(e){let t=oe.sum(e),n=new Int32Array(jt.BARS_IN_MODULE),r=0,i=0;for(let o=0;o<jt.MODULES_IN_CODEWORD;o++){let s=t/(2*jt.MODULES_IN_CODEWORD)+o*t/jt.MODULES_IN_CODEWORD;i+e[r]<=s&&(i+=e[r],r++),n[r]++}return n}static getDecodedCodewordValue(e){let t=tn.getBitValue(e);return-1===jt.getCodeword(t)?-1:t}static getBitValue(e){let t=0;for(let n=0;n<e.length;n++)for(let r=0;r<e[n];r++)t=t<<1|(n%2==0?1:0);return Math.trunc(t)}static getClosestDecodedValue(e){let t=oe.sum(e),n=new Array(jt.BARS_IN_MODULE);if(t>1)for(let r=0;r<n.length;r++)n[r]=Math.fround(e[r]/t);let r=se.MAX_VALUE,i=-1;this.bSymbolTableReady||tn.initialize();for(let e=0;e<tn.RATIOS_TABLE.length;e++){let t=0,o=tn.RATIOS_TABLE[e];for(let e=0;e<jt.BARS_IN_MODULE;e++){let i=Math.fround(o[e]-n[e]);if(t+=Math.fround(i*i),t>=r)break}t<r&&(r=t,i=jt.SYMBOL_TABLE[e])}return i}}tn.bSymbolTableReady=!1,tn.RATIOS_TABLE=new Array(jt.SYMBOL_TABLE.length).map(e=>new Array(jt.BARS_IN_MODULE));class nn{constructor(){this.segmentCount=-1,this.fileSize=-1,this.timestamp=-1,this.checksum=-1}getSegmentIndex(){return this.segmentIndex}setSegmentIndex(e){this.segmentIndex=e}getFileId(){return this.fileId}setFileId(e){this.fileId=e}getOptionalData(){return this.optionalData}setOptionalData(e){this.optionalData=e}isLastSegment(){return this.lastSegment}setLastSegment(e){this.lastSegment=e}getSegmentCount(){return this.segmentCount}setSegmentCount(e){this.segmentCount=e}getSender(){return this.sender||null}setSender(e){this.sender=e}getAddressee(){return this.addressee||null}setAddressee(e){this.addressee=e}getFileName(){return this.fileName}setFileName(e){this.fileName=e}getFileSize(){return this.fileSize}setFileSize(e){this.fileSize=e}getChecksum(){return this.checksum}setChecksum(e){this.checksum=e}getTimestamp(){return this.timestamp}setTimestamp(e){this.timestamp=e}}class rn{static parseLong(e,t=void 0){return parseInt(e,t)}}class on extends c{}on.kind="NullPointerException";class sn{writeBytes(e){this.writeBytesOffset(e,0,e.length)}writeBytesOffset(e,t,n){if(null==e)throw new on;if(t<0||t>e.length||n<0||t+n>e.length||t+n<0)throw new m;if(0!==n)for(let r=0;r<n;r++)this.write(e[t+r])}flush(){}close(){}}class an extends c{}class ln extends sn{constructor(e=32){if(super(),this.count=0,e<0)throw new h("Negative initial size: "+e);this.buf=new Uint8Array(e)}ensureCapacity(e){e-this.buf.length>0&&this.grow(e)}grow(e){let t=this.buf.length<<1;if(t-e<0&&(t=e),t<0){if(e<0)throw new an;t=E.MAX_VALUE}this.buf=y.copyOfUint8Array(this.buf,t)}write(e){this.ensureCapacity(this.count+1),this.buf[this.count]=e,this.count+=1}writeBytesOffset(e,t,n){if(t<0||t>e.length||n<0||t+n-e.length>0)throw new m;this.ensureCapacity(this.count+n),g.arraycopy(e,t,this.buf,this.count,n),this.count+=n}writeTo(e){e.writeBytesOffset(this.buf,0,this.count)}reset(){this.count=0}toByteArray(){return y.copyOfUint8Array(this.buf,this.count)}size(){return this.count}toString(e){return e?"string"==typeof e?this.toString_string(e):this.toString_number(e):this.toString_void()}toString_void(){return new String(this.buf).toString()}toString_string(e){return new String(this.buf).toString()}toString_number(e){return new String(this.buf).toString()}close(){}}function cn(){if("undefined"!=typeof window)return window.BigInt||null;if(void 0!==n.g)return n.g.BigInt||null;if("undefined"!=typeof self)return self.BigInt||null;throw new Error("Can't search globals for BigInt!")}let un;function hn(e){if(void 0===un&&(un=cn()),null===un)throw new Error("BigInt is not supported!");return un(e)}function dn(){let e=[];e[0]=hn(1);let t=hn(900);e[1]=t;for(let n=2;n<16;n++)e[n]=e[n-1]*t;return e}!function(e){e[e.ALPHA=0]="ALPHA",e[e.LOWER=1]="LOWER",e[e.MIXED=2]="MIXED",e[e.PUNCT=3]="PUNCT",e[e.ALPHA_SHIFT=4]="ALPHA_SHIFT",e[e.PUNCT_SHIFT=5]="PUNCT_SHIFT"}($||($={}));class fn{static decode(e,t){let n=new D(""),r=_.ISO8859_1;n.enableDecoding(r);let i=1,o=e[i++],s=new nn;for(;i<e[0];){switch(o){case fn.TEXT_COMPACTION_MODE_LATCH:i=fn.textCompaction(e,i,n);break;case fn.BYTE_COMPACTION_MODE_LATCH:case fn.BYTE_COMPACTION_MODE_LATCH_6:i=fn.byteCompaction(o,e,r,i,n);break;case fn.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:n.append(e[i++]);break;case fn.NUMERIC_COMPACTION_MODE_LATCH:i=fn.numericCompaction(e,i,n);break;case fn.ECI_CHARSET:_.getCharacterSetECIByValue(e[i++]);break;case fn.ECI_GENERAL_PURPOSE:i+=2;break;case fn.ECI_USER_DEFINED:i++;break;case fn.BEGIN_MACRO_PDF417_CONTROL_BLOCK:i=fn.decodeMacroBlock(e,i,s);break;case fn.BEGIN_MACRO_PDF417_OPTIONAL_FIELD:case fn.MACRO_PDF417_TERMINATOR:throw new b;default:i--,i=fn.textCompaction(e,i,n)}if(!(i<e.length))throw b.getFormatInstance();o=e[i++]}if(0===n.length())throw b.getFormatInstance();let a=new Z(null,n.toString(),null,t);return a.setOther(s),a}static decodeMacroBlock(e,t,n){if(t+fn.NUMBER_OF_SEQUENCE_CODEWORDS>e[0])throw b.getFormatInstance();let r=new Int32Array(fn.NUMBER_OF_SEQUENCE_CODEWORDS);for(let n=0;n<fn.NUMBER_OF_SEQUENCE_CODEWORDS;n++,t++)r[n]=e[t];n.setSegmentIndex(E.parseInt(fn.decodeBase900toBase10(r,fn.NUMBER_OF_SEQUENCE_CODEWORDS)));let i=new D;t=fn.textCompaction(e,t,i),n.setFileId(i.toString());let o=-1;for(e[t]===fn.BEGIN_MACRO_PDF417_OPTIONAL_FIELD&&(o=t+1);t<e[0];)switch(e[t]){case fn.BEGIN_MACRO_PDF417_OPTIONAL_FIELD:switch(e[++t]){case fn.MACRO_PDF417_OPTIONAL_FIELD_FILE_NAME:let r=new D;t=fn.textCompaction(e,t+1,r),n.setFileName(r.toString());break;case fn.MACRO_PDF417_OPTIONAL_FIELD_SENDER:let i=new D;t=fn.textCompaction(e,t+1,i),n.setSender(i.toString());break;case fn.MACRO_PDF417_OPTIONAL_FIELD_ADDRESSEE:let o=new D;t=fn.textCompaction(e,t+1,o),n.setAddressee(o.toString());break;case fn.MACRO_PDF417_OPTIONAL_FIELD_SEGMENT_COUNT:let s=new D;t=fn.numericCompaction(e,t+1,s),n.setSegmentCount(E.parseInt(s.toString()));break;case fn.MACRO_PDF417_OPTIONAL_FIELD_TIME_STAMP:let a=new D;t=fn.numericCompaction(e,t+1,a),n.setTimestamp(rn.parseLong(a.toString()));break;case fn.MACRO_PDF417_OPTIONAL_FIELD_CHECKSUM:let l=new D;t=fn.numericCompaction(e,t+1,l),n.setChecksum(E.parseInt(l.toString()));break;case fn.MACRO_PDF417_OPTIONAL_FIELD_FILE_SIZE:let c=new D;t=fn.numericCompaction(e,t+1,c),n.setFileSize(rn.parseLong(c.toString()));break;default:throw b.getFormatInstance()}break;case fn.MACRO_PDF417_TERMINATOR:t++,n.setLastSegment(!0);break;default:throw b.getFormatInstance()}if(-1!==o){let r=t-o;n.isLastSegment()&&r--,n.setOptionalData(y.copyOfRange(e,o,o+r))}return t}static textCompaction(e,t,n){let r=new Int32Array(2*(e[0]-t)),i=new Int32Array(2*(e[0]-t)),o=0,s=!1;for(;t<e[0]&&!s;){let n=e[t++];if(n<fn.TEXT_COMPACTION_MODE_LATCH)r[o]=n/30,r[o+1]=n%30,o+=2;else switch(n){case fn.TEXT_COMPACTION_MODE_LATCH:r[o++]=fn.TEXT_COMPACTION_MODE_LATCH;break;case fn.BYTE_COMPACTION_MODE_LATCH:case fn.BYTE_COMPACTION_MODE_LATCH_6:case fn.NUMERIC_COMPACTION_MODE_LATCH:case fn.BEGIN_MACRO_PDF417_CONTROL_BLOCK:case fn.BEGIN_MACRO_PDF417_OPTIONAL_FIELD:case fn.MACRO_PDF417_TERMINATOR:t--,s=!0;break;case fn.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:r[o]=fn.MODE_SHIFT_TO_BYTE_COMPACTION_MODE,n=e[t++],i[o]=n,o++}}return fn.decodeTextCompaction(r,i,o,n),t}static decodeTextCompaction(e,t,n,r){let i=$.ALPHA,o=$.ALPHA,s=0;for(;s<n;){let n=e[s],a="";switch(i){case $.ALPHA:if(n<26)a=String.fromCharCode(65+n);else switch(n){case 26:a=" ";break;case fn.LL:i=$.LOWER;break;case fn.ML:i=$.MIXED;break;case fn.PS:o=i,i=$.PUNCT_SHIFT;break;case fn.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:r.append(t[s]);break;case fn.TEXT_COMPACTION_MODE_LATCH:i=$.ALPHA}break;case $.LOWER:if(n<26)a=String.fromCharCode(97+n);else switch(n){case 26:a=" ";break;case fn.AS:o=i,i=$.ALPHA_SHIFT;break;case fn.ML:i=$.MIXED;break;case fn.PS:o=i,i=$.PUNCT_SHIFT;break;case fn.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:r.append(t[s]);break;case fn.TEXT_COMPACTION_MODE_LATCH:i=$.ALPHA}break;case $.MIXED:if(n<fn.PL)a=fn.MIXED_CHARS[n];else switch(n){case fn.PL:i=$.PUNCT;break;case 26:a=" ";break;case fn.LL:i=$.LOWER;break;case fn.AL:i=$.ALPHA;break;case fn.PS:o=i,i=$.PUNCT_SHIFT;break;case fn.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:r.append(t[s]);break;case fn.TEXT_COMPACTION_MODE_LATCH:i=$.ALPHA}break;case $.PUNCT:if(n<fn.PAL)a=fn.PUNCT_CHARS[n];else switch(n){case fn.PAL:i=$.ALPHA;break;case fn.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:r.append(t[s]);break;case fn.TEXT_COMPACTION_MODE_LATCH:i=$.ALPHA}break;case $.ALPHA_SHIFT:if(i=o,n<26)a=String.fromCharCode(65+n);else switch(n){case 26:a=" ";break;case fn.TEXT_COMPACTION_MODE_LATCH:i=$.ALPHA}break;case $.PUNCT_SHIFT:if(i=o,n<fn.PAL)a=fn.PUNCT_CHARS[n];else switch(n){case fn.PAL:i=$.ALPHA;break;case fn.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:r.append(t[s]);break;case fn.TEXT_COMPACTION_MODE_LATCH:i=$.ALPHA}}""!==a&&r.append(a),s++}}static byteCompaction(e,t,n,r,i){let o=new ln,s=0,a=0,l=!1;switch(e){case fn.BYTE_COMPACTION_MODE_LATCH:let e=new Int32Array(6),n=t[r++];for(;r<t[0]&&!l;)switch(e[s++]=n,a=900*a+n,n=t[r++],n){case fn.TEXT_COMPACTION_MODE_LATCH:case fn.BYTE_COMPACTION_MODE_LATCH:case fn.NUMERIC_COMPACTION_MODE_LATCH:case fn.BYTE_COMPACTION_MODE_LATCH_6:case fn.BEGIN_MACRO_PDF417_CONTROL_BLOCK:case fn.BEGIN_MACRO_PDF417_OPTIONAL_FIELD:case fn.MACRO_PDF417_TERMINATOR:r--,l=!0;break;default:if(s%5==0&&s>0){for(let e=0;e<6;++e)o.write(Number(hn(a)>>hn(8*(5-e))));a=0,s=0}
vendor: 6,026 bytes, line 2
2}r===t[0]&&n<fn.TEXT_COMPACTION_MODE_LATCH&&(e[s++]=n);for(let t=0;t<s;t++)o.write(e[t]);break;case fn.BYTE_COMPACTION_MODE_LATCH_6:for(;r<t[0]&&!l;){let e=t[r++];if(e<fn.TEXT_COMPACTION_MODE_LATCH)s++,a=900*a+e;else switch(e){case fn.TEXT_COMPACTION_MODE_LATCH:case fn.BYTE_COMPACTION_MODE_LATCH:case fn.NUMERIC_COMPACTION_MODE_LATCH:case fn.BYTE_COMPACTION_MODE_LATCH_6:case fn.BEGIN_MACRO_PDF417_CONTROL_BLOCK:case fn.BEGIN_MACRO_PDF417_OPTIONAL_FIELD:case fn.MACRO_PDF417_TERMINATOR:r--,l=!0}if(s%5==0&&s>0){for(let e=0;e<6;++e)o.write(Number(hn(a)>>hn(8*(5-e))));a=0,s=0}}}return i.append(I.decode(o.toByteArray(),n)),r}static numericCompaction(e,t,n){let r=0,i=!1,o=new Int32Array(fn.MAX_NUMERIC_CODEWORDS);for(;t<e[0]&&!i;){let s=e[t++];if(t===e[0]&&(i=!0),s<fn.TEXT_COMPACTION_MODE_LATCH)o[r]=s,r++;else switch(s){case fn.TEXT_COMPACTION_MODE_LATCH:case fn.BYTE_COMPACTION_MODE_LATCH:case fn.BYTE_COMPACTION_MODE_LATCH_6:case fn.BEGIN_MACRO_PDF417_CONTROL_BLOCK:case fn.BEGIN_MACRO_PDF417_OPTIONAL_FIELD:case fn.MACRO_PDF417_TERMINATOR:t--,i=!0}(r%fn.MAX_NUMERIC_CODEWORDS===0||s===fn.NUMERIC_COMPACTION_MODE_LATCH||i)&&r>0&&(n.append(fn.decodeBase900toBase10(o,r)),r=0)}return t}static decodeBase900toBase10(e,t){let n=hn(0);for(let r=0;r<t;r++)n+=fn.EXP900[t-r-1]*hn(e[r]);let r=n.toString();if("1"!==r.charAt(0))throw new b;return r.substring(1)}}fn.TEXT_COMPACTION_MODE_LATCH=900,fn.BYTE_COMPACTION_MODE_LATCH=901,fn.NUMERIC_COMPACTION_MODE_LATCH=902,fn.BYTE_COMPACTION_MODE_LATCH_6=924,fn.ECI_USER_DEFINED=925,fn.ECI_GENERAL_PURPOSE=926,fn.ECI_CHARSET=927,fn.BEGIN_MACRO_PDF417_CONTROL_BLOCK=928,fn.BEGIN_MACRO_PDF417_OPTIONAL_FIELD=923,fn.MACRO_PDF417_TERMINATOR=922,fn.MODE_SHIFT_TO_BYTE_COMPACTION_MODE=913,fn.MAX_NUMERIC_CODEWORDS=15,fn.MACRO_PDF417_OPTIONAL_FIELD_FILE_NAME=0,fn.MACRO_PDF417_OPTIONAL_FIELD_SEGMENT_COUNT=1,fn.MACRO_PDF417_OPTIONAL_FIELD_TIME_STAMP=2,fn.MACRO_PDF417_OPTIONAL_FIELD_SENDER=3,fn.MACRO_PDF417_OPTIONAL_FIELD_ADDRESSEE=4,fn.MACRO_PDF417_OPTIONAL_FIELD_FILE_SIZE=5,fn.MACRO_PDF417_OPTIONAL_FIELD_CHECKSUM=6,fn.PL=25,fn.LL=27,fn.AS=27,fn.ML=28,fn.AL=28,fn.PS=29,fn.PAL=29,fn.PUNCT_CHARS=";<>@[\\]_`~!\r\t,:\n-.$/\"|*()?{}'",fn.MIXED_CHARS="0123456789&\r\t,:#-.$/+%*=^",fn.EXP900=cn()?dn():[],fn.NUMBER_OF_SEQUENCE_CODEWORDS=2;class pn{constructor(){}static decode(e,t,n,r,i,o,s){let a,l=new Xt(e,t,n,r,i),c=null,u=null;for(let n=!0;;n=!1){if(null!=t&&(c=pn.getRowIndicatorColumn(e,l,t,!0,o,s)),null!=r&&(u=pn.getRowIndicatorColumn(e,l,r,!1,o,s)),a=pn.merge(c,u),null==a)throw O.getNotFoundInstance();let i=a.getBoundingBox();if(!n||null==i||!(i.getMinY()<l.getMinY()||i.getMaxY()>l.getMaxY()))break;l=i}a.setBoundingBox(l);let h=a.getBarcodeColumnCount()+1;a.setDetectionResultColumn(0,c),a.setDetectionResultColumn(h,u);let d=null!=c;for(let t=1;t<=h;t++){let n,r=d?t:h-t;if(void 0!==a.getDetectionResultColumn(r))continue;n=0===r||r===h?new Kt(l,0===r):new Zt(l),a.setDetectionResultColumn(r,n);let i=-1,c=i;for(let t=l.getMinY();t<=l.getMaxY();t++){if(i=pn.getStartColumn(a,r,t,d),i<0||i>l.getMaxX()){if(-1===c)continue;i=c}let u=pn.detectCodeword(e,l.getMinX(),l.getMaxX(),d,i,t,o,s);null!=u&&(n.setCodeword(t,u),c=i,o=Math.min(o,u.getWidth()),s=Math.max(s,u.getWidth()))}}return pn.createDecoderResult(a)}static merge(e,t){if(null==e&&null==t)return null;let n=pn.getBarcodeMetadata(e,t);if(null==n)return null;let r=Xt.merge(pn.adjustBoundingBox(e),pn.adjustBoundingBox(t));return new Jt(n,r)}static adjustBoundingBox(e){if(null==e)return null;let t=e.getRowHeights();if(null==t)return null;let n=pn.getMax(t),r=0;for(let e of t)if(r+=n-e,e>0)break;let i=e.getCodewords();for(let e=0;r>0&&null==i[e];e++)r--;let o=0;for(let e=t.length-1;e>=0&&(o+=n-t[e],!(t[e]>0));e--);for(let e=i.length-1;o>0&&null==i[e];e--)o--;return e.getBoundingBox().addMissingRows(r,o,e.isLeft())}static getMax(e){let t=-1;for(let n of e)t=Math.max(t,n);return t}static getBarcodeMetadata(e,t){let n,r;return null==e||null==(n=e.getBarcodeMetadata())?null==t?null:t.getBarcodeMetadata():null==t||null==(r=t.getBarcodeMetadata())?n:n.getColumnCount()!==r.getColumnCount()&&n.getErrorCorrectionLevel()!==r.getErrorCorrectionLevel()&&n.getRowCount()!==r.getRowCount()?null:n}static getRowIndicatorColumn(e,t,n,r,i,o){let s=new Kt(t,r);for(let a=0;a<2;a++){let l=0===a?1:-1,c=Math.trunc(Math.trunc(n.getX()));for(let a=Math.trunc(Math.trunc(n.getY()));a<=t.getMaxY()&&a>=t.getMinY();a+=l){let t=pn.detectCodeword(e,0,e.getWidth(),r,c,a,i,o);null!=t&&(s.setCodeword(a,t),c=r?t.getStartX():t.getEndX())}}return s}static adjustCodewordCount(e,t){let n=t[0][1],r=n.getValue(),i=e.getBarcodeColumnCount()*e.getBarcodeRowCount()-pn.getNumberOfECCodeWords(e.getBarcodeECLevel());if(0===r.length){if(i<1||i>jt.MAX_CODEWORDS_IN_BARCODE)throw O.getNotFoundInstance();n.setValue(i)}else r[0]!==i&&n.setValue(i)}static createDecoderResult(e){let t=pn.createBarcodeMatrix(e);pn.adjustCodewordCount(e,t);let n=new Array,r=new Int32Array(e.getBarcodeRowCount()*e.getBarcodeColumnCount()),i=[],o=new Array;for(let s=0;s<e.getBarcodeRowCount();s++)for(let a=0;a<e.getBarcodeColumnCount();a++){let l=t[s][a+1].getValue(),c=s*e.getBarcodeColumnCount()+a;0===l.length?n.push(c):1===l.length?r[c]=l[0]:(o.push(c),i.push(l))}let s=new Array(i.length);for(let e=0;e<s.length;e++)s[e]=i[e];return pn.createDecoderResultFromAmbiguousValues(e.getBarcodeECLevel(),r,jt.toIntArray(n),jt.toIntArray(o),s)}static createDecoderResultFromAmbiguousValues(e,t,n,r,i){let o=new Int32Array(r.length),s=100;for(;s-- >0;){for(let e=0;e<o.length;e++)t[r[e]]=i[e][o[e]];try{return pn.decodeCodewords(t,e,n)}catch(e){if(!(e instanceof f))throw e}if(0===o.length)throw f.getChecksumInstance();for(let e=0;e<o.length;e++){if(o[e]<i[e].length-1){o[e]++;break}if(o[e]=0,e===o.length-1)throw f.getChecksumInstance()}}throw f.getChecksumInstance()}static createBarcodeMatrix(e){let t=Array.from({length:e.getBarcodeRowCount()},()=>new Array(e.getBarcodeColumnCount()+2));for(let e=0;e<t.length;e++)for(let n=0;n<t[e].length;n++)t[e][n]=new Qt;let n=0;
vendor: 20,336 bytes, line 2
2for(let r of e.getDetectionResultColumns()){if(null!=r)for(let e of r.getCodewords())if(null!=e){let r=e.getRowNumber();if(r>=0){if(r>=t.length)continue;t[r][n].setValue(e.getValue())}}n++}return t}static isValidBarcodeColumn(e,t){return t>=0&&t<=e.getBarcodeColumnCount()+1}static getStartColumn(e,t,n,r){let i=r?1:-1,o=null;if(pn.isValidBarcodeColumn(e,t-i)&&(o=e.getDetectionResultColumn(t-i).getCodeword(n)),null!=o)return r?o.getEndX():o.getStartX();if(o=e.getDetectionResultColumn(t).getCodewordNearby(n),null!=o)return r?o.getStartX():o.getEndX();if(pn.isValidBarcodeColumn(e,t-i)&&(o=e.getDetectionResultColumn(t-i).getCodewordNearby(n)),null!=o)return r?o.getEndX():o.getStartX();let s=0;for(;pn.isValidBarcodeColumn(e,t-i);){t-=i;for(let n of e.getDetectionResultColumn(t).getCodewords())if(null!=n)return(r?n.getEndX():n.getStartX())+i*s*(n.getEndX()-n.getStartX());s++}return r?e.getBoundingBox().getMinX():e.getBoundingBox().getMaxX()}static detectCodeword(e,t,n,r,i,o,s,a){i=pn.adjustCodewordStartColumn(e,t,n,r,i,o);let l,c=pn.getModuleBitCount(e,t,n,r,i,o);if(null==c)return null;let u=oe.sum(c);if(r)l=i+u;else{for(let e=0;e<c.length/2;e++){let t=c[e];c[e]=c[c.length-1-e],c[c.length-1-e]=t}l=i,i=l-u}if(!pn.checkCodewordSkew(u,s,a))return null;let h=tn.getDecodedValue(c),d=jt.getCodeword(h);return-1===d?null:new en(i,l,pn.getCodewordBucketNumber(h),d)}static getModuleBitCount(e,t,n,r,i,o){let s=i,a=new Int32Array(8),l=0,c=r?1:-1,u=r;for(;(r?s<n:s>=t)&&l<a.length;)e.get(s,o)===u?(a[l]++,s+=c):(l++,u=!u);return l===a.length||s===(r?n:t)&&l===a.length-1?a:null}static getNumberOfECCodeWords(e){return 2<<e}static adjustCodewordStartColumn(e,t,n,r,i,o){let s=i,a=r?-1:1;for(let l=0;l<2;l++){for(;(r?s>=t:s<n)&&r===e.get(s,o);){if(Math.abs(i-s)>pn.CODEWORD_SKEW_SIZE)return i;s+=a}a=-a,r=!r}return s}static checkCodewordSkew(e,t,n){return t-pn.CODEWORD_SKEW_SIZE<=e&&e<=n+pn.CODEWORD_SKEW_SIZE}static decodeCodewords(e,t,n){if(0===e.length)throw b.getFormatInstance();let r=1<<t+1,i=pn.correctErrors(e,n,r);pn.verifyCodewordCount(e,r);let o=fn.decode(e,""+t);return o.setErrorsCorrected(i),o.setErasures(n.length),o}static correctErrors(e,t,n){if(null!=t&&t.length>n/2+pn.MAX_ERRORS||n<0||n>pn.MAX_EC_CODEWORDS)throw f.getChecksumInstance();return pn.errorCorrection.decode(e,n,t)}static verifyCodewordCount(e,t){if(e.length<4)throw b.getFormatInstance();let n=e[0];if(n>e.length)throw b.getFormatInstance();if(0===n){if(!(t<e.length))throw b.getFormatInstance();e[0]=e.length-t}}static getBitCountForCodeword(e){let t=new Int32Array(8),n=0,r=t.length-1;for(;!((1&e)!==n&&(n=1&e,r--,r<0));)t[r]++,e>>=1;return t}static getCodewordBucketNumber(e){return e instanceof Int32Array?this.getCodewordBucketNumber_Int32Array(e):this.getCodewordBucketNumber_number(e)}static getCodewordBucketNumber_number(e){return pn.getCodewordBucketNumber(pn.getBitCountForCodeword(e))}static getCodewordBucketNumber_Int32Array(e){return(e[0]-e[2]+e[4]-e[6]+9)%9}static toString(e){let t=new qt;for(let n=0;n<e.length;n++){t.format("Row %2d: ",n);for(let r=0;r<e[n].length;r++){let i=e[n][r];0===i.getValue().length?t.format(" ",null):t.format("%4d(%2d)",i.getValue()[0],i.getConfidence(i.getValue()[0]))}t.format("%n")}return t.toString()}}pn.CODEWORD_SKEW_SIZE=2,pn.MAX_ERRORS=3,pn.MAX_EC_CODEWORDS=512,pn.errorCorrection=new Yt;class gn{decode(e,t=null){let n=gn.decode(e,t,!1);if(null==n||0===n.length||null==n[0])throw O.getNotFoundInstance();return n[0]}decodeMultiple(e,t=null){try{return gn.decode(e,t,!0)}catch(e){if(e instanceof b||e instanceof f)throw O.getNotFoundInstance();throw e}}static decode(e,t,n){const r=new Array,i=Vt.detectMultiple(e,t,n);for(const e of i.getPoints()){const t=pn.decode(i.getBits(),e[4],e[5],e[6],e[7],gn.getMinCodewordWidth(e),gn.getMaxCodewordWidth(e)),n=new j(t.getText(),t.getRawBytes(),void 0,e,V.PDF_417);n.putMetadata(q.ERROR_CORRECTION_LEVEL,t.getECLevel());const o=t.getOther();null!=o&&n.putMetadata(q.PDF417_EXTRA_METADATA,o),r.push(n)}return r.map(e=>e)}static getMaxWidth(e,t){return null==e||null==t?0:Math.trunc(Math.abs(e.getX()-t.getX()))}static getMinWidth(e,t){return null==e||null==t?E.MAX_VALUE:Math.trunc(Math.abs(e.getX()-t.getX()))}static getMaxCodewordWidth(e){return Math.floor(Math.max(Math.max(gn.getMaxWidth(e[0],e[4]),gn.getMaxWidth(e[6],e[2])*jt.MODULES_IN_CODEWORD/jt.MODULES_IN_STOP_PATTERN),Math.max(gn.getMaxWidth(e[1],e[5]),gn.getMaxWidth(e[7],e[3])*jt.MODULES_IN_CODEWORD/jt.MODULES_IN_STOP_PATTERN)))}static getMinCodewordWidth(e){return Math.floor(Math.min(Math.min(gn.getMinWidth(e[0],e[4]),gn.getMinWidth(e[6],e[2])*jt.MODULES_IN_CODEWORD/jt.MODULES_IN_STOP_PATTERN),Math.min(gn.getMinWidth(e[1],e[5]),gn.getMinWidth(e[7],e[3])*jt.MODULES_IN_CODEWORD/jt.MODULES_IN_STOP_PATTERN)))}reset(){}}class mn extends c{}mn.kind="ReaderException";class wn{constructor(e,t){this.verbose=!0===e,t&&this.setHints(t)}decode(e,t){return t&&this.setHints(t),this.decodeInternal(e)}decodeWithState(e){return null!==this.readers&&void 0!==this.readers||this.setHints(null),this.decodeInternal(e)}setHints(e){this.hints=e;const n=!t(e)&&!0===e.get(C.TRY_HARDER),r=t(e)?null:e.get(C.POSSIBLE_FORMATS),i=new Array;if(!t(r)){const t=r.some(e=>e===V.UPC_A||e===V.UPC_E||e===V.EAN_13||e===V.EAN_8||e===V.CODABAR||e===V.CODE_39||e===V.CODE_93||e===V.CODE_128||e===V.ITF||e===V.RSS_14||e===V.RSS_EXPANDED);t&&!n&&i.push(new lt(e,this.verbose)),r.includes(V.QR_CODE)&&i.push(new Ut),r.includes(V.DATA_MATRIX)&&i.push(new Et),r.includes(V.AZTEC)&&i.push(new we),r.includes(V.PDF_417)&&i.push(new gn),t&&n&&i.push(new lt(e,this.verbose))}0===i.length&&(n||i.push(new lt(e,this.verbose)),i.push(new Ut),i.push(new Et),i.push(new we),i.push(new gn),n&&i.push(new lt(e,this.verbose))),this.readers=i}reset(){if(null!==this.readers)for(const e of this.readers)e.reset()}decodeInternal(e){if(null===this.readers)throw new mn("No readers where selected, nothing can be read.");for(const t of this.readers)try{return t.decode(e,this.hints)}catch(e){if(e instanceof mn)continue}throw new O("No MultiFormat Readers were able to detect the code.")}}class yn extends U{constructor(e=null,t=500){const n=new wn;n.setHints(e),super(n,t)}decodeBitmap(e){return this.reader.decodeWithState(e)}}class En extends U{constructor(e=500){super(new gn,e)}}class vn extends U{constructor(e=500){super(new Ut,e)}}var An;!function(e){e[e.ERROR_CORRECTION=0]="ERROR_CORRECTION",e[e.CHARACTER_SET=1]="CHARACTER_SET",e[e.DATA_MATRIX_SHAPE=2]="DATA_MATRIX_SHAPE",e[e.MIN_SIZE=3]="MIN_SIZE",e[e.MAX_SIZE=4]="MAX_SIZE",e[e.MARGIN=5]="MARGIN",e[e.PDF417_COMPACT=6]="PDF417_COMPACT",e[e.PDF417_COMPACTION=7]="PDF417_COMPACTION",e[e.PDF417_DIMENSIONS=8]="PDF417_DIMENSIONS",e[e.AZTEC_LAYERS=9]="AZTEC_LAYERS",e[e.QR_VERSION=10]="QR_VERSION"}(An||(An={}));var Cn=An;class bn{constructor(e){this.field=e,this.cachedGenerators=[],this.cachedGenerators.push(new K(e,Int32Array.from([1])))}buildGenerator(e){const t=this.cachedGenerators;if(e>=t.length){let n=t[t.length-1];const r=this.field;for(let i=t.length;i<=e;i++){const e=n.multiply(new K(r,Int32Array.from([1,r.exp(i-1+r.getGeneratorBase())])));t.push(e),n=e}}return t[e]}encode(e,t){if(0===t)throw new h("No error correction bytes");const n=e.length-t;if(n<=0)throw new h("No data bytes provided");const r=this.buildGenerator(t),i=new Int32Array(n);g.arraycopy(e,0,i,0,n);let o=new K(this.field,i);o=o.multiplyByMonomial(t,1);const s=o.divide(r)[1].getCoefficients(),a=t-s.length;for(let t=0;t<a;t++)e[n+t]=0;g.arraycopy(s,0,e,n+a,s.length)}}class _n{constructor(){}static applyMaskPenaltyRule1(e){return _n.applyMaskPenaltyRule1Internal(e,!0)+_n.applyMaskPenaltyRule1Internal(e,!1)}static applyMaskPenaltyRule2(e){let t=0;const n=e.getArray(),r=e.getWidth(),i=e.getHeight();for(let e=0;e<i-1;e++){const i=n[e];for(let o=0;o<r-1;o++){const r=i[o];r===i[o+1]&&r===n[e+1][o]&&r===n[e+1][o+1]&&t++}}return _n.N2*t}static applyMaskPenaltyRule3(e){let t=0;const n=e.getArray(),r=e.getWidth(),i=e.getHeight();for(let e=0;e<i;e++)for(let o=0;o<r;o++){const s=n[e];o+6<r&&1===s[o]&&0===s[o+1]&&1===s[o+2]&&1===s[o+3]&&1===s[o+4]&&0===s[o+5]&&1===s[o+6]&&(_n.isWhiteHorizontal(s,o-4,o)||_n.isWhiteHorizontal(s,o+7,o+11))&&t++,e+6<i&&1===n[e][o]&&0===n[e+1][o]&&1===n[e+2][o]&&1===n[e+3][o]&&1===n[e+4][o]&&0===n[e+5][o]&&1===n[e+6][o]&&(_n.isWhiteVertical(n,o,e-4,e)||_n.isWhiteVertical(n,o,e+7,e+11))&&t++}return t*_n.N3}static isWhiteHorizontal(e,t,n){t=Math.max(t,0),n=Math.min(n,e.length);for(let r=t;r<n;r++)if(1===e[r])return!1;return!0}static isWhiteVertical(e,t,n,r){n=Math.max(n,0),r=Math.min(r,e.length);for(let i=n;i<r;i++)if(1===e[i][t])return!1;return!0}static applyMaskPenaltyRule4(e){let t=0;const n=e.getArray(),r=e.getWidth(),i=e.getHeight();for(let e=0;e<i;e++){const i=n[e];for(let e=0;e<r;e++)1===i[e]&&t++}const o=e.getHeight()*e.getWidth();return Math.floor(10*Math.abs(2*t-o)/o)*_n.N4}static getDataMaskBit(e,t,n){let r,i;switch(e){case 0:r=n+t&1;break;case 1:r=1&n;break;case 2:r=t%3;break;case 3:r=(n+t)%3;break;case 4:r=Math.floor(n/2)+Math.floor(t/3)&1;break;case 5:i=n*t,r=(1&i)+i%3;break;case 6:i=n*t,r=(1&i)+i%3&1;break;case 7:i=n*t,r=i%3+(n+t&1)&1;break;default:throw new h("Invalid mask pattern: "+e)}return 0===r}static applyMaskPenaltyRule1Internal(e,t){let n=0;const r=t?e.getHeight():e.getWidth(),i=t?e.getWidth():e.getHeight(),o=e.getArray();for(let e=0;e<r;e++){let r=0,s=-1;for(let a=0;a<i;a++){const i=t?o[e][a]:o[a][e];i===s?r++:(r>=5&&(n+=_n.N1+(r-5)),r=1,s=i)}r>=5&&(n+=_n.N1+(r-5))}return n}}_n.N1=3,_n.N2=3,_n.N3=40,_n.N4=10;class Sn{constructor(e,t){this.width=e,this.height=t;const n=new Array(t);for(let r=0;r!==t;r++)n[r]=new Uint8Array(e);this.bytes=n}getHeight(){return this.height}getWidth(){return this.width}get(e,t){return this.bytes[t][e]}getArray(){return this.bytes}setNumber(e,t,n){this.bytes[t][e]=n}setBoolean(e,t,n){this.bytes[t][e]=n?1:0}clear(e){for(const t of this.bytes)y.fill(t,e)}equals(e){if(!(e instanceof Sn))return!1;const t=e;if(this.width!==t.width)return!1;if(this.height!==t.height)return!1;for(let e=0,n=this.height;e<n;++e){const n=this.bytes[e],r=t.bytes[e];for(let e=0,t=this.width;e<t;++e)if(n[e]!==r[e])return!1}return!0}toString(){const e=new D;for(let t=0,n=this.height;t<n;++t){const n=this.bytes[t];for(let t=0,r=this.width;t<r;++t)switch(n[t]){case 0:e.append(" 0");break;case 1:e.append(" 1");break;default:e.append(" ")}e.append("\n")}return e.toString()}}class In{constructor(){this.maskPattern=-1}getMode(){return this.mode}getECLevel(){return this.ecLevel}getVersion(){return this.version}getMaskPattern(){return this.maskPattern}getMatrix(){return this.matrix}toString(){const e=new D;return e.append("<<\n"),e.append(" mode: "),e.append(this.mode?this.mode.toString():"null"),e.append("\n ecLevel: "),e.append(this.ecLevel?this.ecLevel.toString():"null"),e.append("\n version: "),e.append(this.version?this.version.toString():"null"),e.append("\n maskPattern: "),e.append(this.maskPattern.toString()),this.matrix?(e.append("\n matrix:\n"),e.append(this.matrix.toString())):e.append("\n matrix: null\n"),e.append(">>\n"),e.toString()}setMode(e){this.mode=e}setECLevel(e){this.ecLevel=e}setVersion(e){this.version=e}setMaskPattern(e){this.maskPattern=e}setMatrix(e){this.matrix=e}static isValidMaskPattern(e){return e>=0&&e<In.NUM_MASK_PATTERNS}}In.NUM_MASK_PATTERNS=8;class Tn extends c{}Tn.kind="WriterException";class Dn{constructor(){}static clearMatrix(e){e.clear(255)}static buildMatrix(e,t,n,r,i){Dn.clearMatrix(i),Dn.embedBasicPatterns(n,i),Dn.embedTypeInfo(t,r,i),Dn.maybeEmbedVersionInfo(n,i),Dn.embedDataBits(e,r,i)}static embedBasicPatterns(e,t){Dn.embedPositionDetectionPatternsAndSeparators(t),Dn.embedDarkDotAtLeftBottomCorner(t),Dn.maybeEmbedPositionAdjustmentPatterns(e,t),Dn.embedTimingPatterns(t)}static embedTypeInfo(e,t,n){const r=new v;Dn.makeTypeInfoBits(e,t,r);for(let e=0,t=r.getSize();e<t;++e){const t=r.get(r.getSize()-1-e),i=Dn.TYPE_INFO_COORDINATES[e],o=i[0],s=i[1];if(n.setBoolean(o,s,t),e<8){const r=n.getWidth()-e-1,i=8;n.setBoolean(r,i,t)}else{const r=8,i=n.getHeight()-7+(e-8);n.setBoolean(r,i,t)}}}static maybeEmbedVersionInfo(e,t){if(e.getVersionNumber()<7)return;const n=new v;Dn.makeVersionInfoBits(e,n);let r=17;for(let e=0;e<6;++e)for(let i=0;i<3;++i){const o=n.get(r);r--,t.setBoolean(e,t.getHeight()-11+i,o),t.setBoolean(t.getHeight()-11+i,e,o)}}static embedDataBits(e,t,n){let r=0,i=-1,o=n.getWidth()-1,s=n.getHeight()-1;for(;o>0;){for(6===o&&(o-=1);s>=0&&s<n.getHeight();){for(let i=0;i<2;++i){const a=o-i;if(!Dn.isEmpty(n.get(a,s)))continue;let l;r<e.getSize()?(l=e.get(r),++r):l=!1,255!==t&&_n.getDataMaskBit(t,a,s)&&(l=!l),n.setBoolean(a,s,l)}s+=i}i=-i,s+=i,o-=2}if(r!==e.getSize())throw new Tn("Not all bits consumed: "+r+"/"+e.getSize())}static findMSBSet(e){return 32-E.numberOfLeadingZeros(e)}static calculateBCHCode(e,t){if(0===t)throw new h("0 polynomial");const n=Dn.findMSBSet(t);for(e<<=n-1;Dn.findMSBSet(e)>=n;)e^=t<<Dn.findMSBSet(e)-n;return e}static makeTypeInfoBits(e,t,n){if(!In.isValidMaskPattern(t))throw new Tn("Invalid mask pattern");const r=e.getBits()<<3|t;n.appendBits(r,5);const i=Dn.calculateBCHCode(r,Dn.TYPE_INFO_POLY);n.appendBits(i,10);const o=new v;if(o.appendBits(Dn.TYPE_INFO_MASK_PATTERN,15),n.xor(o),15!==n.getSize())throw new Tn("should not happen but we got: "+n.getSize())}static makeVersionInfoBits(e,t){t.appendBits(e.getVersionNumber(),6);const n=Dn.calculateBCHCode(e.getVersionNumber(),Dn.VERSION_INFO_POLY);if(t.appendBits(n,12),18!==t.getSize())throw new Tn("should not happen but we got: "+t.getSize())}static isEmpty(e){return 255===e}static embedTimingPatterns(e){for(let t=8;t<e.getWidth()-8;++t){const n=(t+1)%2;Dn.isEmpty(e.get(t,6))&&e.setNumber(t,6,n),Dn.isEmpty(e.get(6,t))&&e.setNumber(6,t,n)}}static embedDarkDotAtLeftBottomCorner(e){if(0===e.get(8,e.getHeight()-8))throw new Tn;e.setNumber(8,e.getHeight()-8,1)}static embedHorizontalSeparationPattern(e,t,n){for(let r=0;r<8;++r){if(!Dn.isEmpty(n.get(e+r,t)))throw new Tn;n.setNumber(e+r,t,0)}}static embedVerticalSeparationPattern(e,t,n){for(let r=0;r<7;++r){if(!Dn.isEmpty(n.get(e,t+r)))throw new Tn;n.setNumber(e,t+r,0)}}static embedPositionAdjustmentPattern(e,t,n){for(let r=0;r<5;++r){const i=Dn.POSITION_ADJUSTMENT_PATTERN[r];for(let o=0;o<5;++o)n.setNumber(e+o,t+r,i[o])}}static embedPositionDetectionPattern(e,t,n){for(let r=0;r<7;++r){const i=Dn.POSITION_DETECTION_PATTERN[r];for(let o=0;o<7;++o)n.setNumber(e+o,t+r,i[o])}}static embedPositionDetectionPatternsAndSeparators(e){const t=Dn.POSITION_DETECTION_PATTERN[0].length;Dn.embedPositionDetectionPattern(0,0,e),Dn.embedPositionDetectionPattern(e.getWidth()-t,0,e),Dn.embedPositionDetectionPattern(0,e.getWidth()-t,e);const n=8;Dn.embedHorizontalSeparationPattern(0,n-1,e),Dn.embedHorizontalSeparationPattern(e.getWidth()-n,n-1,e),Dn.embedHorizontalSeparationPattern(0,e.getWidth()-n,e);const r=7;Dn.embedVerticalSeparationPattern(r,0,e),Dn.embedVerticalSeparationPattern(e.getHeight()-r-1,0,e),Dn.embedVerticalSeparationPattern(r,e.getHeight()-r,e)}static maybeEmbedPositionAdjustmentPatterns(e,t){if(e.getVersionNumber()<2)return;const n=e.getVersionNumber()-1,r=Dn.POSITION_ADJUSTMENT_PATTERN_COORDINATE_TABLE[n];for(let e=0,n=r.length;e!==n;e++){const i=r[e];if(i>=0)for(let e=0;e!==n;e++){const n=r[e];n>=0&&Dn.isEmpty(t.get(n,i))&&Dn.embedPositionAdjustmentPattern(n-2,i-2,t)}}}}Dn.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])]),Dn.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])]),Dn.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])]),Dn.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])]),Dn.VERSION_INFO_POLY=7973,Dn.TYPE_INFO_POLY=1335,Dn.TYPE_INFO_MASK_PATTERN=21522;class Nn{constructor(e,t){this.dataBytes=e,this.errorCorrectionBytes=t}getDataBytes(){return this.dataBytes}getErrorCorrectionBytes(){return this.errorCorrectionBytes}}class On{constructor(){}static calculateMaskPenalty(e){return _n.applyMaskPenaltyRule1(e)+_n.applyMaskPenaltyRule2(e)+_n.applyMaskPenaltyRule3(e)+_n.applyMaskPenaltyRule4(e)}static encode(e,t,n=null){let r=On.DEFAULT_BYTE_MODE_ENCODING;const i=null!==n&&void 0!==n.get(Cn.CHARACTER_SET);i&&(r=n.get(Cn.CHARACTER_SET).toString());const o=this.chooseMode(e,r),s=new v;if(o===Nt.BYTE&&(i||On.DEFAULT_BYTE_MODE_ENCODING!==r)){const e=_.getCharacterSetECIByName(r);void 0!==e&&this.appendECI(e,s)}this.appendModeInfo(o,s);const a=new v;let l;if(this.appendBytes(e,o,a,r),null!==n&&void 0!==n.get(Cn.QR_VERSION)){const e=Number.parseInt(n.get(Cn.QR_VERSION).toString(),10);l=St.getVersionForNumber(e);const r=this.calculateBitsNeeded(o,s,a,l);if(!this.willFit(r,l,t))throw new Tn("Data too big for requested version")}else l=this.recommendVersion(t,o,s,a);const c=new v;c.appendBitArray(s);const u=o===Nt.BYTE?a.getSizeInBytes():e.length;this.appendLengthInfo(u,l,o,c),c.appendBitArray(a);const h=l.getECBlocksForLevel(t),d=l.getTotalCodewords()-h.getTotalECCodewords();this.terminateBits(d,c);const f=this.interleaveWithECBytes(c,l.getTotalCodewords(),d,h.getNumBlocks()),p=new In;p.setECLevel(t),p.setMode(o),p.setVersion(l);const g=l.getDimensionForVersion(),m=new Sn(g,g),w=this.chooseMaskPattern(f,t,l,m);return p.setMaskPattern(w),Dn.buildMatrix(f,t,l,w,m),p.setMatrix(m),p}static recommendVersion(e,t,n,r){const i=this.calculateBitsNeeded(t,n,r,St.getVersionForNumber(1)),o=this.chooseVersion(i,e),s=this.calculateBitsNeeded(t,n,r,o);return this.chooseVersion(s,e)}static calculateBitsNeeded(e,t,n,r){return t.getSize()+e.getCharacterCountBits(r)+n.getSize()}static getAlphanumericCode(e){return e<On.ALPHANUMERIC_TABLE.length?On.ALPHANUMERIC_TABLE[e]:-1}static chooseMode(e,t=null){if(_.SJIS.getName()===t&&this.isOnlyDoubleByteKanji(e))return Nt.KANJI;let n=!1,r=!1;for(let t=0,i=e.length;t<i;++t){const i=e.charAt(t);if(On.isDigit(i))n=!0;else{if(-1===this.getAlphanumericCode(i.charCodeAt(0)))return Nt.BYTE;r=!0}}return r?Nt.ALPHANUMERIC:n?Nt.NUMERIC:Nt.BYTE}static isOnlyDoubleByteKanji(e){let t;try{t=I.encode(e,_.SJIS)}catch(e){return!1}const n=t.length;if(n%2!=0)return!1;for(let e=0;e<n;e+=2){const n=255&t[e];
vendor: 8,667 bytes, line 2
2if((n<129||n>159)&&(n<224||n>235))return!1}return!0}static chooseMaskPattern(e,t,n,r){let i=Number.MAX_SAFE_INTEGER,o=-1;for(let s=0;s<In.NUM_MASK_PATTERNS;s++){Dn.buildMatrix(e,t,n,s,r);let a=this.calculateMaskPenalty(r);a<i&&(i=a,o=s)}return o}static chooseVersion(e,t){for(let n=1;n<=40;n++){const r=St.getVersionForNumber(n);if(On.willFit(e,r,t))return r}throw new Tn("Data too big")}static willFit(e,t,n){return t.getTotalCodewords()-t.getECBlocksForLevel(n).getTotalECCodewords()>=(e+7)/8}static terminateBits(e,t){const n=8*e;if(t.getSize()>n)throw new Tn("data bits cannot fit in the QR Code"+t.getSize()+" > "+n);for(let e=0;e<4&&t.getSize()<n;++e)t.appendBit(!1);const r=7&t.getSize();if(r>0)for(let e=r;e<8;e++)t.appendBit(!1);const i=e-t.getSizeInBytes();for(let e=0;e<i;++e)t.appendBits(1&e?17:236,8);if(t.getSize()!==n)throw new Tn("Bits size does not equal capacity")}static getNumDataBytesAndNumECBytesForBlockID(e,t,n,r,i,o){if(r>=n)throw new Tn("Block ID too large");const s=e%n,a=n-s,l=Math.floor(e/n),c=l+1,u=Math.floor(t/n),h=u+1,d=l-u,f=c-h;if(d!==f)throw new Tn("EC bytes mismatch");if(n!==a+s)throw new Tn("RS blocks mismatch");if(e!==(u+d)*a+(h+f)*s)throw new Tn("Total bytes mismatch");r<a?(i[0]=u,o[0]=d):(i[0]=h,o[0]=f)}static interleaveWithECBytes(e,t,n,r){if(e.getSizeInBytes()!==n)throw new Tn("Number of bits and data bytes does not match");let i=0,o=0,s=0;const a=new Array;for(let l=0;l<r;++l){const c=new Int32Array(1),u=new Int32Array(1);On.getNumDataBytesAndNumECBytesForBlockID(t,n,r,l,c,u);const h=c[0],d=new Uint8Array(h);e.toBytes(8*i,d,0,h);const f=On.generateECBytes(d,u[0]);a.push(new Nn(d,f)),o=Math.max(o,h),s=Math.max(s,f.length),i+=c[0]}if(n!==i)throw new Tn("Data bytes does not match offset");const l=new v;for(let e=0;e<o;++e)for(const t of a){const n=t.getDataBytes();e<n.length&&l.appendBits(n[e],8)}for(let e=0;e<s;++e)for(const t of a){const n=t.getErrorCorrectionBytes();e<n.length&&l.appendBits(n[e],8)}if(t!==l.getSizeInBytes())throw new Tn("Interleaving error: "+t+" and "+l.getSizeInBytes()+" differ.");return l}static generateECBytes(e,t){const n=e.length,r=new Int32Array(n+t);for(let t=0;t<n;t++)r[t]=255&e[t];new bn(ee.QR_CODE_FIELD_256).encode(r,t);const i=new Uint8Array(t);for(let e=0;e<t;e++)i[e]=r[n+e];return i}static appendModeInfo(e,t){t.appendBits(e.getBits(),4)}static appendLengthInfo(e,t,n,r){const i=n.getCharacterCountBits(t);if(e>=1<<i)throw new Tn(e+" is bigger than "+((1<<i)-1));r.appendBits(e,i)}static appendBytes(e,t,n,r){switch(t){case Nt.NUMERIC:On.appendNumericBytes(e,n);break;case Nt.ALPHANUMERIC:On.appendAlphanumericBytes(e,n);break;case Nt.BYTE:On.append8BitBytes(e,n,r);break;case Nt.KANJI:On.appendKanjiBytes(e,n);break;default:throw new Tn("Invalid mode: "+t)}}static getDigit(e){return e.charCodeAt(0)-48}static isDigit(e){const t=On.getDigit(e);return t>=0&&t<=9}static appendNumericBytes(e,t){const n=e.length;let r=0;for(;r<n;){const i=On.getDigit(e.charAt(r));if(r+2<n){const n=On.getDigit(e.charAt(r+1)),o=On.getDigit(e.charAt(r+2));t.appendBits(100*i+10*n+o,10),r+=3}else if(r+1<n){const n=On.getDigit(e.charAt(r+1));t.appendBits(10*i+n,7),r+=2}else t.appendBits(i,4),r++}}static appendAlphanumericBytes(e,t){const n=e.length;let r=0;for(;r<n;){const i=On.getAlphanumericCode(e.charCodeAt(r));if(-1===i)throw new Tn;if(r+1<n){const n=On.getAlphanumericCode(e.charCodeAt(r+1));if(-1===n)throw new Tn;t.appendBits(45*i+n,11),r+=2}else t.appendBits(i,6),r++}}static append8BitBytes(e,t,n){let r;try{r=I.encode(e,n)}catch(e){throw new Tn(e)}for(let e=0,n=r.length;e!==n;e++){const n=r[e];t.appendBits(n,8)}}static appendKanjiBytes(e,t){let n;try{n=I.encode(e,_.SJIS)}catch(e){throw new Tn(e)}const r=n.length;for(let e=0;e<r;e+=2){const r=(255&n[e])<<8&4294967295|255&n[e+1];let i=-1;if(r>=33088&&r<=40956?i=r-33088:r>=57408&&r<=60351&&(i=r-49472),-1===i)throw new Tn("Invalid byte sequence");const o=192*(i>>8)+(255&i);t.appendBits(o,13)}}static appendECI(e,t){t.appendBits(Nt.ECI.getBits(),4),t.appendBits(e.getValue(),8)}}On.ALPHANUMERIC_TABLE=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]),On.DEFAULT_BYTE_MODE_ENCODING=_.UTF8.getName();class Rn{write(e,t,n,r=null){if(0===e.length)throw new h("Found empty contents");if(t<0||n<0)throw new h("Requested dimensions are too small: "+t+"x"+n);let i=At.L,o=Rn.QUIET_ZONE_SIZE;null!==r&&(void 0!==r.get(Cn.ERROR_CORRECTION)&&(i=At.fromString(r.get(Cn.ERROR_CORRECTION).toString())),void 0!==r.get(Cn.MARGIN)&&(o=Number.parseInt(r.get(Cn.MARGIN).toString(),10)));const s=On.encode(e,i,r);return this.renderResult(s,t,n,o)}writeToDom(e,t,n,r,i=null){"string"==typeof e&&(e=document.querySelector(e));const o=this.write(t,n,r,i);e&&e.appendChild(o)}renderResult(e,t,n,r){const i=e.getMatrix();if(null===i)throw new ne;const o=i.getWidth(),s=i.getHeight(),a=o+2*r,l=s+2*r,c=Math.max(t,a),u=Math.max(n,l),h=Math.min(Math.floor(c/a),Math.floor(u/l)),d=Math.floor((c-o*h)/2),f=Math.floor((u-s*h)/2),p=this.createSVGElement(c,u);for(let e=0,t=f;e<s;e++,t+=h)for(let n=0,r=d;n<o;n++,r+=h)if(1===i.get(n,e)){const e=this.createSvgRectElement(r,t,h,h);p.appendChild(e)}return p}createSVGElement(e,t){const n=document.createElementNS(Rn.SVG_NS,"svg");return n.setAttributeNS(null,"height",e.toString()),n.setAttributeNS(null,"width",t.toString()),n}createSvgRectElement(e,t,n,r){const i=document.createElementNS(Rn.SVG_NS,"rect");return i.setAttributeNS(null,"x",e.toString()),i.setAttributeNS(null,"y",t.toString()),i.setAttributeNS(null,"height",n.toString()),i.setAttributeNS(null,"width",r.toString()),i.setAttributeNS(null,"fill","#000000"),i}}Rn.QUIET_ZONE_SIZE=4,Rn.SVG_NS="http://www.w3.org/2000/svg";class Mn{encode(e,t,n,r,i){if(0===e.length)throw new h("Found empty contents");if(t!==V.QR_CODE)throw new h("Can only encode QR_CODE, but got "+t);if(n<0||r<0)throw new h(`Requested dimensions are too small: ${n}x${r}`);let o=At.L,s=Mn.QUIET_ZONE_SIZE;null!==i&&(void 0!==i.get(Cn.ERROR_CORRECTION)&&(o=At.fromString(i.get(Cn.ERROR_CORRECTION).toString())),void 0!==i.get(Cn.MARGIN)&&(s=Number.parseInt(i.get(Cn.MARGIN).toString(),10)));const a=On.encode(e,o,i);return Mn.renderResult(a,n,r,s)}static renderResult(e,t,n,r){const i=e.getMatrix();if(null===i)throw new ne;const o=i.getWidth(),s=i.getHeight(),a=o+2*r,l=s+2*r,c=Math.max(t,a),u=Math.max(n,l),h=Math.min(Math.floor(c/a),Math.floor(u/l)),d=Math.floor((c-o*h)/2),f=Math.floor((u-s*h)/2),p=new N(c,u);for(let e=0,t=f;e<s;e++,t+=h)for(let n=0,r=d;n<o;n++,r+=h)1===i.get(n,e)&&p.setRegion(r,t,h,h);return p}}Mn.QUIET_ZONE_SIZE=4;class Pn{encode(e,t,n,r,i){let o;if(t!==V.QR_CODE)throw new h("No encoder available for format "+t);return o=new Mn,o.encode(e,t,n,r,i)}}class kn extends P{constructor(e,t,n,r,i,o,s,a){if(super(o,s),this.yuvData=e,this.dataWidth=t,this.dataHeight=n,this.left=r,this.top=i,r+o>t||i+s>n)throw new h("Crop rectangle does not fit within image data.");a&&this.reverseHorizontal(o,s)}getRow(e,t){if(e<0||e>=this.getHeight())throw new h("Requested row is outside the image: "+e);const n=this.getWidth();(null==t||t.length<n)&&(t=new Uint8ClampedArray(n));const r=(e+this.top)*this.dataWidth+this.left;return g.arraycopy(this.yuvData,r,t,0,n),t}getMatrix(){const e=this.getWidth(),t=this.getHeight();if(e===this.dataWidth&&t===this.dataHeight)return this.yuvData;const n=e*t,r=new Uint8ClampedArray(n);let i=this.top*this.dataWidth+this.left;if(e===this.dataWidth)return g.arraycopy(this.yuvData,i,r,0,n),r;for(let n=0;n<t;n++){const t=n*e;g.arraycopy(this.yuvData,i,r,t,e),i+=this.dataWidth}return r}isCropSupported(){return!0}crop(e,t,n,r){return new kn(this.yuvData,this.dataWidth,this.dataHeight,this.left+e,this.top+t,n,r,!1)}renderThumbnail(){const e=this.getWidth()/kn.THUMBNAIL_SCALE_FACTOR,t=this.getHeight()/kn.THUMBNAIL_SCALE_FACTOR,n=new Int32Array(e*t),r=this.yuvData;let i=this.top*this.dataWidth+this.left;for(let o=0;o<t;o++){const t=o*e;for(let o=0;o<e;o++){const e=255&r[i+o*kn.THUMBNAIL_SCALE_FACTOR];n[t+o]=4278190080|65793*e}i+=this.dataWidth*kn.THUMBNAIL_SCALE_FACTOR}return n}getThumbnailWidth(){return this.getWidth()/kn.THUMBNAIL_SCALE_FACTOR}getThumbnailHeight(){return this.getHeight()/kn.THUMBNAIL_SCALE_FACTOR}reverseHorizontal(e,t){const n=this.yuvData;for(let r=0,i=this.top*this.dataWidth+this.left;r<t;r++,i+=this.dataWidth){const t=i+e/2;for(let r=i,o=i+e-1;r<t;r++,o--){const e=n[r];n[r]=n[o],n[o]=e}}}invert(){return new k(this)}}kn.THUMBNAIL_SCALE_FACTOR=2;
vendor: 9,956 bytes, line 2
2class xn extends P{constructor(e,t,n,r,i,o,s){if(super(t,n),this.dataWidth=r,this.dataHeight=i,this.left=o,this.top=s,4===e.BYTES_PER_ELEMENT){const r=t*n,i=new Uint8ClampedArray(r);for(let t=0;t<r;t++){const n=e[t],r=n>>16&255,o=n>>7&510,s=255&n;i[t]=(r+o+s)/4&255}this.luminances=i}else this.luminances=e;if(void 0===r&&(this.dataWidth=t),void 0===i&&(this.dataHeight=n),void 0===o&&(this.left=0),void 0===s&&(this.top=0),this.left+t>this.dataWidth||this.top+n>this.dataHeight)throw new h("Crop rectangle does not fit within image data.")}getRow(e,t){if(e<0||e>=this.getHeight())throw new h("Requested row is outside the image: "+e);const n=this.getWidth();(null==t||t.length<n)&&(t=new Uint8ClampedArray(n));const r=(e+this.top)*this.dataWidth+this.left;return g.arraycopy(this.luminances,r,t,0,n),t}getMatrix(){const e=this.getWidth(),t=this.getHeight();if(e===this.dataWidth&&t===this.dataHeight)return this.luminances;const n=e*t,r=new Uint8ClampedArray(n);let i=this.top*this.dataWidth+this.left;if(e===this.dataWidth)return g.arraycopy(this.luminances,i,r,0,n),r;for(let n=0;n<t;n++){const t=n*e;g.arraycopy(this.luminances,i,r,t,e),i+=this.dataWidth}return r}isCropSupported(){return!0}crop(e,t,n,r){return new xn(this.luminances,n,r,this.dataWidth,this.dataHeight,this.left+e,this.top+t)}invert(){return new k(this)}}class Ln extends _{static forName(e){return this.getCharacterSetECIByName(e)}}class Bn{}Bn.ISO_8859_1=_.ISO8859_1;class Fn{isCompact(){return this.compact}setCompact(e){this.compact=e}getSize(){return this.size}setSize(e){this.size=e}getLayers(){return this.layers}setLayers(e){this.layers=e}getCodeWords(){return this.codeWords}setCodeWords(e){this.codeWords=e}getMatrix(){return this.matrix}setMatrix(e){this.matrix=e}}class Un{static singletonList(e){return[e]}static min(e,t){return e.sort(t)[0]}}class jn{constructor(e){this.previous=e}getPrevious(){return this.previous}}class Hn extends jn{constructor(e,t,n){super(e),this.value=t,this.bitCount=n}appendTo(e,t){e.appendBits(this.value,this.bitCount)}add(e,t){return new Hn(this,e,t)}addBinaryShift(e,t){return console.warn("addBinaryShift on SimpleToken, this simply returns a copy of this token"),new Hn(this,e,t)}toString(){let e=this.value&(1<<this.bitCount)-1;return e|=1<<this.bitCount,"<"+E.toBinaryString(e|1<<this.bitCount).substring(1)+">"}}class Vn extends Hn{constructor(e,t,n){super(e,0,0),this.binaryShiftStart=t,this.binaryShiftByteCount=n}appendTo(e,t){for(let n=0;n<this.binaryShiftByteCount;n++)(0===n||31===n&&this.binaryShiftByteCount<=62)&&(e.appendBits(31,5),this.binaryShiftByteCount>62?e.appendBits(this.binaryShiftByteCount-31,16):0===n?e.appendBits(Math.min(this.binaryShiftByteCount,31),5):e.appendBits(this.binaryShiftByteCount-31,5)),e.appendBits(t[this.binaryShiftStart+n],8)}addBinaryShift(e,t){return new Vn(this,e,t)}toString(){return"<"+this.binaryShiftStart+"::"+(this.binaryShiftStart+this.binaryShiftByteCount-1)+">"}}function zn(e,t,n){return new Vn(e,t,n)}function Gn(e,t,n){return new Hn(e,t,n)}const Wn=["UPPER","LOWER","DIGIT","MIXED","PUNCT"],Yn=0,Xn=1,$n=2,qn=3,Zn=4,Qn=new Hn(null,0,0),Kn=[Int32Array.from([0,327708,327710,327709,656318]),Int32Array.from([590318,0,327710,327709,656318]),Int32Array.from([262158,590300,0,590301,932798]),Int32Array.from([327709,327708,656318,0,327710]),Int32Array.from([327711,656380,656382,656381,0])];function Jn(e){for(let t of e)y.fill(t,-1);return e[Yn][Zn]=0,e[Xn][Zn]=0,e[Xn][Yn]=28,e[qn][Zn]=0,e[$n][Zn]=0,e[$n][Yn]=15,e}const er=Jn(y.createInt32Array(6,6));class tr{constructor(e,t,n,r){this.token=e,this.mode=t,this.binaryShiftByteCount=n,this.bitCount=r}getMode(){return this.mode}getToken(){return this.token}getBinaryShiftByteCount(){return this.binaryShiftByteCount}getBitCount(){return this.bitCount}latchAndAppend(e,t){let n=this.bitCount,r=this.token;if(e!==this.mode){let t=Kn[this.mode][e];r=Gn(r,65535&t,t>>16),n+=t>>16}let i=e===$n?4:5;return r=Gn(r,t,i),new tr(r,e,0,n+i)}shiftAndAppend(e,t){let n=this.token,r=this.mode===$n?4:5;return n=Gn(n,er[this.mode][e],r),n=Gn(n,t,5),new tr(n,this.mode,0,this.bitCount+r+5)}addBinaryShiftChar(e){let t=this.token,n=this.mode,r=this.bitCount;if(this.mode===Zn||this.mode===$n){let e=Kn[n][Yn];t=Gn(t,65535&e,e>>16),r+=e>>16,n=Yn}let i=0===this.binaryShiftByteCount||31===this.binaryShiftByteCount?18:62===this.binaryShiftByteCount?9:8,o=new tr(t,n,this.binaryShiftByteCount+1,r+i);return 2078===o.binaryShiftByteCount&&(o=o.endBinaryShift(e+1)),o}endBinaryShift(e){if(0===this.binaryShiftByteCount)return this;let t=this.token;return t=zn(t,e-this.binaryShiftByteCount,this.binaryShiftByteCount),new tr(t,this.mode,0,this.bitCount)}isBetterThanOrEqualTo(e){let t=this.bitCount+(Kn[this.mode][e.mode]>>16);return this.binaryShiftByteCount<e.binaryShiftByteCount?t+=tr.calculateBinaryShiftCost(e)-tr.calculateBinaryShiftCost(this):this.binaryShiftByteCount>e.binaryShiftByteCount&&e.binaryShiftByteCount>0&&(t+=10),t<=e.bitCount}toBitArray(e){let t=[];for(let n=this.endBinaryShift(e.length).token;null!==n;n=n.getPrevious())t.unshift(n);let n=new v;for(const r of t)r.appendTo(n,e);return n}toString(){return T.format("%s bits=%d bytes=%d",Wn[this.mode],this.bitCount,this.binaryShiftByteCount)}static calculateBinaryShiftCost(e){return e.binaryShiftByteCount>62?21:e.binaryShiftByteCount>31?20:e.binaryShiftByteCount>0?10:0}}function nr(e){const t=T.getCharCode(" "),n=T.getCharCode("."),r=T.getCharCode(",");e[Yn][t]=1;const i=T.getCharCode("Z"),o=T.getCharCode("A");for(let t=o;t<=i;t++)e[Yn][t]=t-o+2;e[Xn][t]=1;const s=T.getCharCode("z"),a=T.getCharCode("a");for(let t=a;t<=s;t++)e[Xn][t]=t-a+2;e[$n][t]=1;const l=T.getCharCode("9"),c=T.getCharCode("0");for(let t=c;t<=l;t++)e[$n][t]=t-c+2;e[$n][r]=12,e[$n][n]=13;const u=["\0"," ","�","�","�","�","�","�","�","\b","\t","\n","\v","\f","\r","�","�","�","�","�","@","\\","^","_","`","|","~","�"];for(let t=0;t<u.length;t++)e[qn][T.getCharCode(u[t])]=t;const h=["\0","\r","\0","\0","\0","\0","!","'","#","$","%","&","'","(",")","*","+",",","-",".","/",":",";","<","=",">","?","[","]","{","}"];for(let t=0;t<h.length;t++)T.getCharCode(h[t])>0&&(e[Zn][T.getCharCode(h[t])]=t);return e}tr.INITIAL_STATE=new tr(Qn,Yn,0,0);const rr=nr(y.createInt32Array(5,256));class ir{constructor(e){this.text=e}encode(){const e=T.getCharCode(" "),t=T.getCharCode("\n");let n=Un.singletonList(tr.INITIAL_STATE);for(let r=0;r<this.text.length;r++){let i,o=r+1<this.text.length?this.text[r+1]:0;switch(this.text[r]){case T.getCharCode("\r"):i=o===t?2:0;break;case T.getCharCode("."):i=o===e?3:0;break;case T.getCharCode(","):i=o===e?4:0;break;case T.getCharCode(":"):i=o===e?5:0;break;default:i=0}i>0?(n=ir.updateStateListForPair(n,r,i),r++):n=this.updateStateListForChar(n,r)}return Un.min(n,(e,t)=>e.getBitCount()-t.getBitCount()).toBitArray(this.text)}updateStateListForChar(e,t){const n=[];for(let r of e)this.updateStateForChar(r,t,n);return ir.simplifyStates(n)}updateStateForChar(e,t,n){let r=255&this.text[t],i=rr[e.getMode()][r]>0,o=null;for(let s=0;s<=Zn;s++){let a=rr[s][r];if(a>0){if(null==o&&(o=e.endBinaryShift(t)),!i||s===e.getMode()||s===$n){const e=o.latchAndAppend(s,a);n.push(e)}if(!i&&er[e.getMode()][s]>=0){const e=o.shiftAndAppend(s,a);n.push(e)}}}if(e.getBinaryShiftByteCount()>0||0===rr[e.getMode()][r]){let r=e.addBinaryShiftChar(t);n.push(r)}}static updateStateListForPair(e,t,n){const r=[];for(let i of e)this.updateStateForPair(i,t,n,r);return this.simplifyStates(r)}static updateStateForPair(e,t,n,r){let i=e.endBinaryShift(t);if(r.push(i.latchAndAppend(Zn,n)),e.getMode()!==Zn&&r.push(i.shiftAndAppend(Zn,n)),3===n||4===n){let e=i.latchAndAppend($n,16-n).latchAndAppend($n,1);r.push(e)}if(e.getBinaryShiftByteCount()>0){let n=e.addBinaryShiftChar(t).addBinaryShiftChar(t+1);r.push(n)}}static simplifyStates(e){let t=[];for(const n of e){let e=!0;for(const r of t){if(r.isBetterThanOrEqualTo(n)){e=!1;break}n.isBetterThanOrEqualTo(r)&&(t=t.filter(e=>e!==r))}e&&t.push(n)}return t}}class or{constructor(){}static encodeBytes(e){return or.encode(e,or.DEFAULT_EC_PERCENT,or.DEFAULT_AZTEC_LAYERS)}static encode(e,t,n){let r,i,o,s,a,l=new ir(e).encode(),c=E.truncDivision(l.getSize()*t,100)+11,u=l.getSize()+c;if(n!==or.DEFAULT_AZTEC_LAYERS){if(r=n<0,i=Math.abs(n),i>(r?or.MAX_NB_BITS_COMPACT:or.MAX_NB_BITS))throw new h(T.format("Illegal value %s for layers",n));o=or.totalBitsInLayer(i,r),s=or.WORD_SIZE[i];let e=o-o%s;if(a=or.stuffBits(l,s),a.getSize()+c>e)throw new h("Data to large for user specified layer");if(r&&a.getSize()>64*s)throw new h("Data to large for user specified layer")}else{s=0,a=null;for(let e=0;;e++){if(e>or.MAX_NB_BITS)throw new h("Data too large for an Aztec code");if(r=e<=3,i=r?e+1:e,o=or.totalBitsInLayer(i,r),u>o)continue;null!=a&&s===or.WORD_SIZE[i]||(s=or.WORD_SIZE[i],a=or.stuffBits(l,s));let t=o-o%s;if(!(r&&a.getSize()>64*s)&&a.getSize()+c<=t)break}}let d,f=or.generateCheckWords(a,o,s),p=a.getSize()/s,g=or.generateModeMessage(r,i,p),m=(r?11:14)+4*i,w=new Int32Array(m);if(r){d=m;for(let e=0;e<w.length;e++)w[e]=e}else{d=m+1+2*E.truncDivision(E.truncDivision(m,2)-1,15);let e=E.truncDivision(m,2),t=E.truncDivision(d,2);for(let n=0;n<e;n++){let r=n+E.truncDivision(n,15);w[e-n-1]=t-r-1,w[e+n]=t+r+1}}let y=new N(d);for(let e=0,t=0;e<i;e++){let n=4*(i-e)+(r?9:12);for(let r=0;r<n;r++){let i=2*r;for(let o=0;o<2;o++)f.get(t+i+o)&&y.set(w[2*e+o],w[2*e+r]),f.get(t+2*n+i+o)&&y.set(w[2*e+r],w[m-1-2*e-o]),f.get(t+4*n+i+o)&&y.set(w[m-1-2*e-o],w[m-1-2*e-r]),f.get(t+6*n+i+o)&&y.set(w[m-1-2*e-r],w[2*e+o])}t+=8*n}if(or.drawModeMessage(y,r,d,g),r)or.drawBullsEye(y,E.truncDivision(d,2),5);else{or.drawBullsEye(y,E.truncDivision(d,2),7);for(let e=0,t=0;e<E.truncDivision(m,2)-1;e+=15,t+=16)for(let e=1&E.truncDivision(d,2);e<d;e+=2)y.set(E.truncDivision(d,2)-t,e),y.set(E.truncDivision(d,2)+t,e),y.set(e,E.truncDivision(d,2)-t),y.set(e,E.truncDivision(d,2)+t)}let v=new Fn;return v.setCompact(r),v.setSize(d),v.setLayers(i),v.setCodeWords(p),v.setMatr
vendor: 2,610 bytes, line 2
2ix(y),v}static drawBullsEye(e,t,n){for(let r=0;r<n;r+=2)for(let n=t-r;n<=t+r;n++)e.set(n,t-r),e.set(n,t+r),e.set(t-r,n),e.set(t+r,n);e.set(t-n,t-n),e.set(t-n+1,t-n),e.set(t-n,t-n+1),e.set(t+n,t-n),e.set(t+n,t-n+1),e.set(t+n,t+n-1)}static generateModeMessage(e,t,n){let r=new v;return e?(r.appendBits(t-1,2),r.appendBits(n-1,6),r=or.generateCheckWords(r,28,4)):(r.appendBits(t-1,5),r.appendBits(n-1,11),r=or.generateCheckWords(r,40,4)),r}static drawModeMessage(e,t,n,r){let i=E.truncDivision(n,2);if(t)for(let t=0;t<7;t++){let n=i-3+t;r.get(t)&&e.set(n,i-5),r.get(t+7)&&e.set(i+5,n),r.get(20-t)&&e.set(n,i+5),r.get(27-t)&&e.set(i-5,n)}else for(let t=0;t<10;t++){let n=i-5+t+E.truncDivision(t,5);r.get(t)&&e.set(n,i-7),r.get(t+10)&&e.set(i+7,n),r.get(29-t)&&e.set(n,i+7),r.get(39-t)&&e.set(i-7,n)}}static generateCheckWords(e,t,n){let r=e.getSize()/n,i=new bn(or.getGF(n)),o=E.truncDivision(t,n),s=or.bitsToWords(e,n,o);i.encode(s,o-r);let a=t%n,l=new v;l.appendBits(0,a);for(const e of Array.from(s))l.appendBits(e,n);return l}static bitsToWords(e,t,n){let r,i,o=new Int32Array(n);for(r=0,i=e.getSize()/t;r<i;r++){let n=0;for(let i=0;i<t;i++)n|=e.get(r*t+i)?1<<t-i-1:0;o[r]=n}return o}static getGF(e){switch(e){case 4:return ee.AZTEC_PARAM;case 6:return ee.AZTEC_DATA_6;case 8:return ee.AZTEC_DATA_8;case 10:return ee.AZTEC_DATA_10;case 12:return ee.AZTEC_DATA_12;default:throw new h("Unsupported word size "+e)}}static stuffBits(e,t){let n=new v,r=e.getSize(),i=(1<<t)-2;for(let o=0;o<r;o+=t){let s=0;for(let n=0;n<t;n++)(o+n>=r||e.get(o+n))&&(s|=1<<t-1-n);(s&i)===i?(n.appendBits(s&i,t),o--):0===(s&i)?(n.appendBits(1|s,t),o--):n.appendBits(s,t)}return n}static totalBitsInLayer(e,t){return((t?88:112)+16*e)*e}}or.DEFAULT_EC_PERCENT=33,or.DEFAULT_AZTEC_LAYERS=0,or.MAX_NB_BITS=32,or.MAX_NB_BITS_COMPACT=4,or.WORD_SIZE=Int32Array.from([4,6,6,8,8,8,8,8,8,10,10,10,10,10,10,10,10,10,10,10,10,10,10,12,12,12,12,12,12,12,12,12,12]);class sr{encode(e,t,n,r){return this.encodeWithHints(e,t,n,r,null)}encodeWithHints(e,t,n,r,i){let o=Bn.ISO_8859_1,s=or.DEFAULT_EC_PERCENT,a=or.DEFAULT_AZTEC_LAYERS;return null!=i&&(i.has(Cn.CHARACTER_SET)&&(o=Ln.forName(i.get(Cn.CHARACTER_SET).toString())),i.has(Cn.ERROR_CORRECTION)&&(s=E.parseInt(i.get(Cn.ERROR_CORRECTION).toString())),i.has(Cn.AZTEC_LAYERS)&&(a=E.parseInt(i.get(Cn.AZTEC_LAYERS).toString()))),sr.encodeLayers(e,t,n,r,o,s,a)}static encodeLayers(e,t,n,r,i,o,s){if(t!==V.AZTEC)throw new h("Can only encode AZTEC, but got "+t);let a=or.encode(T.getBytes(e,i),o,s);return sr.renderResult(a,n,r)}static renderResult(e,t,n){let r=e.getMatrix();if(null==r)throw new ne;
vendor: 4,464 bytes, line 2
2let i=r.getWidth(),o=r.getHeight(),s=Math.max(t,i),a=Math.max(n,o),l=Math.min(s/i,a/o),c=(s-i*l)/2,u=(a-o*l)/2,h=new N(s,a);for(let e=0,t=u;e<o;e++,t+=l)for(let n=0,o=c;n<i;n++,o+=l)r.get(n,e)&&h.setRegion(o,t,l,l);return h}}e.AbstractExpandedDecoder=We,e.ArgumentException=u,e.ArithmeticException=J,e.AztecCode=Fn,e.AztecCodeReader=we,e.AztecCodeWriter=sr,e.AztecDecoder=ie,e.AztecDetector=me,e.AztecDetectorResult=ce,e.AztecEncoder=or,e.AztecHighLevelEncoder=ir,e.AztecPoint=ge,e.BarcodeFormat=V,e.Binarizer=p,e.BinaryBitmap=d,e.BitArray=v,e.BitMatrix=N,e.BitSource=gt,e.BrowserAztecCodeReader=ye,e.BrowserBarcodeReader=ct,e.BrowserCodeReader=U,e.BrowserDatamatrixCodeReader=vt,e.BrowserMultiFormatReader=yn,e.BrowserPDF417Reader=En,e.BrowserQRCodeReader=vn,e.BrowserQRCodeSvgWriter=Rn,e.CharacterSetECI=_,e.ChecksumException=f,e.Code128Reader=ve,e.Code39Reader=Ae,e.DataMatrixDecodedBitStreamParser=mt,e.DataMatrixReader=Et,e.DecodeHintType=C,e.DecoderResult=Z,e.DefaultGridSampler=fe,e.DetectorResult=le,e.EAN13Reader=De,e.EncodeHintType=Cn,e.Exception=c,e.FormatException=b,e.GenericGF=ee,e.GenericGFPoly=K,e.GlobalHistogramBinarizer=R,e.GridSampler=he,e.GridSamplerInstance=pe,e.HTMLCanvasElementLuminanceSource=x,e.HybridBinarizer=M,e.ITFReader=Ce,e.IllegalArgumentException=h,e.IllegalStateException=ne,e.InvertedLuminanceSource=k,e.LuminanceSource=P,e.MathUtils=oe,e.MultiFormatOneDReader=lt,e.MultiFormatReader=wn,e.MultiFormatWriter=Pn,e.NotFoundException=O,e.OneDReader=Ee,e.PDF417DecodedBitStreamParser=fn,e.PDF417DecoderErrorCorrection=Yt,e.PDF417Reader=gn,e.PDF417ResultMetadata=nn,e.PerspectiveTransform=de,e.PlanarYUVLuminanceSource=kn,e.QRCodeByteMatrix=Sn,e.QRCodeDataMask=It,e.QRCodeDecodedBitStreamParser=Ot,e.QRCodeDecoderErrorCorrectionLevel=At,e.QRCodeDecoderFormatInformation=Ct,e.QRCodeEncoder=On,e.QRCodeEncoderQRCode=In,e.QRCodeMaskUtil=_n,e.QRCodeMatrixUtil=Dn,e.QRCodeMode=Nt,e.QRCodeReader=Ut,e.QRCodeVersion=St,e.QRCodeWriter=Mn,e.RGBLuminanceSource=xn,e.RSS14Reader=at,e.RSSExpandedReader=ot,e.ReaderException=mn,e.ReedSolomonDecoder=re,e.ReedSolomonEncoder=bn,e.ReedSolomonException=te,e.Result=j,e.ResultMetadataType=q,e.ResultPoint=ae,e.StringUtils=T,e.UnsupportedOperationException=S,e.VideoInputDevice=L,e.WhiteRectangleDetector=ue,e.WriterException=Tn,e.ZXingArrays=y,e.ZXingCharset=Ln,e.ZXingInteger=E,e.ZXingStandardCharsets=Bn,e.ZXingStringBuilder=D,e.ZXingStringEncoding=I,e.ZXingSystem=g,e.createAbstractExpandedDecoder=nt,Object.defineProperty(e,"__esModule",{value:!0})}(t)},473(e){var t=function(e){"use strict";var t,n=Object.prototype,r=n.hasOwnProperty,i=Object.defineProperty||function(e,t,n){e[t]=n.value},o="function"==typeof Symbol?Symbol:{},s=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",l=o.toStringTag||"@@toStringTag";function c(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,n){return e[t]=n}}function u(e,t,n,r){var o=t&&t.prototype instanceof w?t:w,s=Object.create(o.prototype),a=new O(r||[]);return i(s,"_invoke",{value:I(e,n,a)}),s}function h(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=u;var d="suspendedStart",f="suspendedYield",p="executing",g="completed",m={};function w(){}function y(){}function E(){}var v={};c(v,s,function(){return this});var A=Object.getPrototypeOf,C=A&&A(A(R([])));C&&C!==n&&r.call(C,s)&&(v=C);var b=E.prototype=w.prototype=Object.create(v);function _(e){["next","throw","return"].forEach(function(t){c(e,t,function(e){return this._invoke(t,e)})})}function S(e,t){function n(i,o,s,a){var l=h(e[i],e,o);if("throw"!==l.type){var c=l.arg,u=c.value;return u&&"object"==typeof u&&r.call(u,"__await")?t.resolve(u.__await).then(function(e){n("next",e,s,a)},function(e){n("throw",e,s,a)}):t.resolve(u).then(function(e){c.value=e,s(c)},function(e){return n("throw",e,s,a)})}a(l.arg)}var o;i(this,"_invoke",{value:function(e,r){function i(){return new t(function(t,i){n(e,r,t,i)})}return o=o?o.then(i,i):i()}})}function I(e,t,n){var r=d;return function(i,o){if(r===p)throw new Error("Generator is already running");if(r===g){if("throw"===i)throw o;return M()}for(n.method=i,n.arg=o;;){var s=n.delegate;if(s){var a=T(s,n);if(a){if(a===m)continue;return a}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(r===d)throw r=g,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r=p;
vendor: 4,106 bytes, line 2
2var l=h(e,t,n);if("normal"===l.type){if(r=n.done?g:f,l.arg===m)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(r=g,n.method="throw",n.arg=l.arg)}}}function T(e,n){var r=n.method,i=e.iterator[r];if(i===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,T(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),m;var o=h(i,e.iterator,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,m;var s=o.arg;return s?s.done?(n[e.resultName]=s.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,m):s:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,m)}function D(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function N(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function O(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(D,this),this.reset(!0)}function R(e){if(e){var n=e[s];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,o=function n(){for(;++i<e.length;)if(r.call(e,i))return n.value=e[i],n.done=!1,n;return n.value=t,n.done=!0,n};return o.next=o}}return{next:M}}function M(){return{value:t,done:!0}}return y.prototype=E,i(b,"constructor",{value:E,configurable:!0}),i(E,"constructor",{value:y,configurable:!0}),y.displayName=c(E,l,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===y||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,E):(e.__proto__=E,c(e,l,"GeneratorFunction")),e.prototype=Object.create(b),e},e.awrap=function(e){return{__await:e}},_(S.prototype),c(S.prototype,a,function(){return this}),e.AsyncIterator=S,e.async=function(t,n,r,i,o){void 0===o&&(o=Promise);var s=new S(u(t,n,r,i),o);return e.isGeneratorFunction(n)?s:s.next().then(function(e){return e.done?e.value:s.next()})},_(b),c(b,l,"Generator"),c(b,s,function(){return this}),c(b,"toString",function(){return"[object Generator]"}),e.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},e.values=R,O.prototype={constructor:O,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(N),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function i(r,i){return a.type="throw",a.arg=e,n.next=r,i&&(n.method="next",n.arg=t),!!i}for(var o=this.tryEntries.length-1;o>=0;--o){var s=this.tryEntries[o],a=s.completion;if("root"===s.tryLoc)return i("end");if(s.tryLoc<=this.prev){var l=r.call(s,"catchLoc"),c=r.call(s,"finallyLoc");if(l&&c){if(this.prev<s.catchLoc)return i(s.catchLoc,!0);if(this.prev<s.finallyLoc)return i(s.finallyLoc)}else if(l){if(this.prev<s.catchLoc)return i(s.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<s.finallyLoc)return i(s.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var s=o?o.completion:{};return s.type=e,s.arg=t,o?(this.method="next",this.next=o.finallyLoc,m):this.complete(s)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),m},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];
2if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),N(n),m}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;N(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:R(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),m}},e}(e.exports);try{regeneratorRuntime=t}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=t:Function("r","regeneratorRuntime = r")(t)}},267(e,t,n){var r;(function(i,o){"use strict";function s(){a.width=i.innerWidth,a.height=5*f.barThickness;var e=a.getContext("2d");e.shadowBlur=f.shadowBlur,e.shadowColor=f.shadowColor;var t,n=e.createLinearGradient(0,0,a.width,0);for(t in f.barColors)n.addColorStop(t,f.barColors[t]);e.lineWidth=f.barThickness,e.beginPath(),e.moveTo(0,f.barThickness/2),e.lineTo(Math.ceil(l*a.width),f.barThickness/2),e.strokeStyle=n,e.stroke()}var a,l,c,u=null,h=null,d=null,f={autoRun:!0,barThickness:3,barColors:{0:"rgba(26, 188, 156, .9)",".25":"rgba(52, 152, 219, .9)",".50":"rgba(241, 196, 15, .9)",".75":"rgba(230, 126, 34, .9)","1.0":"rgba(211, 84, 0, .9)"},shadowBlur:10,shadowColor:"rgba(0, 0, 0, .6)",className:null},p={config:function(e){for(var t in e)f.hasOwnProperty(t)&&(f[t]=e[t])},show:function(e){var t,n;c||(e?d=d||setTimeout(()=>p.show(),e):(c=!0,null!==h&&i.cancelAnimationFrame(h),a||((n=(a=o.createElement("canvas")).style).position="fixed",n.top=n.left=n.right=n.margin=n.padding=0,n.zIndex=100001,n.display="none",f.className&&a.classList.add(f.className),o.body.appendChild(a),t="resize",e=s,(n=i).addEventListener?n.addEventListener(t,e,!1):n.attachEvent?n.attachEvent("on"+t,e):n["on"+t]=e),a.style.opacity=1,a.style.display="block",p.progress(0),f.autoRun&&function e(){u=i.requestAnimationFrame(e),p.progress("+"+.05*Math.pow(1-Math.sqrt(l),2))}()))},progress:function(e){return void 0===e||("string"==typeof e&&(e=(0<=e.indexOf("+")||0<=e.indexOf("-")?l:0)+parseFloat(e)),l=1<e?1:e,s()),l},hide:function(){clearTimeout(d),d=null,c&&(c=!1,null!=u&&(i.cancelAnimationFrame(u),u=null),function e(){return 1<=p.progress("+.1")&&(a.style.opacity-=.05,a.style.opacity<=.05)?(a.style.display="none",void(h=null)):void(h=i.requestAnimationFrame(e))}())}};"object"==typeof e.exports?e.exports=p:void 0===(r=function(){return p}.call(t,n,t,e))||(e.exports=r)}).call(this,window,document)}},n={};function r(e){var i=n[e];if(void 0!==i)return i.exports;var o=n[e]={exports:{}};return t[e].call(o.exports,o,o.exports,r),o.exports}r.m=t,r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.f={},r.e=e=>Promise.all(Object.keys(r.f).reduce((t,n)=>(r.f[n](e,t),t),[])),r.u=e=>e+"."+{225:"078a7f70e39abe51e1e6",339:"a979612c02bb6ce8a034",440:"0aecb9df9e4d98fbb03e",510:"846bfcaf5331c515c207",591:"9c4688bf3db1c138ea1a",634:"d0d5aaca582110c5
2d391",803:"5a09eaba3730a5cd963f",823:"049cf77c2c58c53c2ae1",853:"4c3715a9941d4b6962d8",979:"d3a7b51edd3862103f6d"}[e]+".js",r.miniCssF=e=>{},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),e={},r.l=(t,n,i,o)=>{if(e[t])e[t].push(n);else{var s,a;if(void 0!==i)for(var l=document.getElementsByTagName("script"),c=0;c<l.length;c++){var u=l[c];if(u.getAttribute("src")==t){s=u;break}}s||(a=!0,(s=document.createElement("script")).charset="utf-8",r.nc&&s.setAttribute("nonce",r.nc),s.src=t),e[t]=[n];var h=(n,r)=>{s.onerror=s.onload=null,clearTimeout(d);var i=e[t];if(delete e[t],s.parentNode&&s.parentNode.removeChild(s),i&&i.forEach(e=>e(r)),n)return n(r)},d=setTimeout(h.bind(null,void 0,{type:"timeout",target:s}),12e4);s.onerror=h.bind(null,s.onerror),s.onload=h.bind(null,s.onload),a&&document.head.appendChild(s)}},r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.p="/js/",(()=>{var e={524:0};r.f.j=(t,n)=>{var i=r.o(e,t)?e[t]:void 0;if(0!==i)if(i)n.push(i[2]);else{var o=new Promise((n,r)=>i=e[t]=[n,r]);n.push(i[2]=o);var s=r.p+r.u(t),a=new Error;r.l(s,n=>{if(r.o(e,t)&&(0!==(i=e[t])&&(e[t]=void 0),i)){var o=n&&("load"===n.type?"missing":n.type),s=n&&n.target&&n.target.src;a.message="Loading chunk "+t+" failed.\n("+o+": "+s+")",a.name="ChunkLoadError",a.type=o,a.request=s,i[1](a)}},"chunk-"+t,t)}};var t=(t,n)=>{var i,o,[s,a,l]=n,c=0;if(s.some(t=>0!==e[t])){for(i in a)r.o(a,i)&&(r.m[i]=a[i]);if(l)l(r)}for(t&&t(n);c<s.length;c++)o=s[c],r.o(e,o)&&e[o]&&e[o][0](),e[o]=0},n=self.webpackChunk=self.webpackChunk||[];n.forEach(t.bind(null,0)),n.push=t.bind(null,n.push.bind(n))})(),(()=>{"use strict";var e,t,n,i,o=!1,s=!1,a=[],l=-1;function c(e){!function(e){a.includes(e)||a.push(e);s||o||(o=!0,queueMicrotask(h))}(e)}function u(e){let t=a.indexOf(e);-1!==t&&t>l&&a.splice(t,1)}function h(){o=!1,s=!0;for(let e=0;e<a.length;e++)a[e](),l=e;a.length=0,l=-1,s=!1}var d=!0;function f(e){t=e}function p(e,r){let i,o=!0,s=t(()=>{let t=e();JSON.stringify(t),o?i=t:queueMicrotask(()=>{r(t,i),i=t}),o=!1});return()=>n(s)}var g=[],m=[],w=[];function y(e,t){"function"==typeof t?(e._x_cleanups||(e._x_cleanups=[]),e._x_cleanups.push(t)):(t=e,m.push(t))}function E(e){g.push(e)}function v(e,t,n){e._x_attributeCleanups||(e._x_attributeCleanups={}),e._x_attributeCleanups[t]||(e._x_attributeCleanups[t]=[]),e._x_attributeCleanups[t].push(n)}function A(e,t){e._x_attributeCleanups&&Object.entries(e._x_attributeCleanups).forEach(([n,r])=>{(void 0===t||t.includes(n))&&(r.forEach(e=>e()),delete e._x_attributeCleanups[n])})}var C=new MutationObserver(O),b=!1;function _(){C.observe(document,{subtree:!0,childList:!0,attributes:!0,attributeOldValue:!0}),b=!0}function S(){!function(){let e=C.takeRecords();I.push(()=>e.length>0&&O(e));let t=I.length;queueMicrotask(()=>{if(I.length===t)for(;I.length>0;)I.shift()()})}(),C.disconnect(),b=!1}var I=[];function T(e){if(!b)return e();S();let t=e();return _(),t}var D=!1,N=[];function O(e){if(D)return void(N=N.concat(e));let t=new Set,n=new Set,r=new Map,i=new Map;for(let o=0;o<e.length;o++)if(!e[o].target._x_ignoreMutationObserver&&("childList"===e[o].type&&(e[o].addedNodes.forEach(e=>1===e.nodeType&&t.add(e)),e[o].removedNodes.forEach(e=>1===e.nodeType&&n.add(e))),"attributes"===e[o].type)){let t=e[o].target,n=e[o].attributeName,s=e[o].oldValue,a=()=>{r.has(t)||r.set(t,[]),r.get(t).push({name:n,value:t.getAttribute(n)})},l=()=>{i.has(t)||i.set(t,[]),i.get(t).push(n)};t.hasAttribute(n)&&null===s?a():t.hasAttribute(n)?(l(),a()):l()}i.forEach((e,t)=>{A(t,e)}),r.forEach((e,t)=>{g.forEach(n=>n(t,e))});for(let e of n)t.has(e)||m.forEach(t=>t(e));t.forEach(e=>{e._x_ignoreSelf=!0,e._x_ignore=!0});for(let e of t)n.has(e)||e.isConnected&&(delete e._x_ignoreSelf,delete e._x_ignore,w.forEach(t=>t(e)),e._x_ignore=!0,e._x_ignoreSelf=!0);t.forEach(e=>{delete e._x_ignoreSelf,delete e._x_ignore}),t=null,n=null,r=null,i=null}function R(e){return k(P(e))}function M(e,t,n){return e._x_dataStack=[t,...P(n||e)],()=>{e._x_dataStack=e._x_dataStack.filter(e=>e!==t)}}function P(e){return e._x_dataStack?e._x_dataStack:"function"==typeof ShadowRoot&&e instanceof ShadowRoot?P(e.host):e.parentNode?P(e.parentNode):[]}function k(e){return new Proxy({objects:e},x)}var x={ownKeys:({objects:e})=>Array.from(new Set(e.flatMap(e=>Object.keys(e)))),has:({objects:e},t)=>t!=Symbol.unscopables&&e.some(e=>Object.prototype.hasOwnProperty.call(e,t)||Reflect.has(e,t)),get:({objects:e},t,n)=>"toJSON"==t?L:Reflect.get(e.find(e=>Reflect.has(e,t))||{},t,n),set({objects:e},t,n,r){const i=e.find(e=>Object.prototype.hasOwnProperty.call(e,t))||e[e.length-1],o=Object.getOwnPropertyDescriptor(i,t);return o?.set&&o?.get?o.set.call(r,n)||!0:Reflect.set(i,t,n)}};function L(){return Reflect.ownKeys(this).reduce((e,t)=>
2(e[t]=Reflect.get(this,t),e),{})}function B(e){let t=(n,r="")=>{Object.entries(Object.getOwnPropertyDescriptors(n)).forEach(([i,{value:o,enumerable:s}])=>{if(!1===s||void 0===o)return;if("object"==typeof o&&null!==o&&o.__v_skip)return;let a=""===r?i:`${r}.${i}`;var l;"object"==typeof o&&null!==o&&o._x_interceptor?n[i]=o.initialize(e,a,i):"object"!=typeof(l=o)||Array.isArray(l)||null===l||o===n||o instanceof Element||t(o,a)})};return t(e)}function F(e,t=()=>{}){let n={initialValue:void 0,_x_interceptor:!0,initialize(t,n,r){return e(this.initialValue,()=>function(e,t){return t.split(".").reduce((e,t)=>e[t],e)}(t,n),e=>U(t,n,e),n,r)}};return t(n),e=>{if("object"==typeof e&&null!==e&&e._x_interceptor){let t=n.initialize.bind(n);n.initialize=(r,i,o)=>{let s=e.initialize(r,i,o);return n.initialValue=s,t(r,i,o)}}else n.initialValue=e;return n}}function U(e,t,n){if("string"==typeof t&&(t=t.split(".")),1!==t.length){if(0===t.length)throw error;return e[t[0]]||(e[t[0]]={}),U(e[t[0]],t.slice(1),n)}e[t[0]]=n}var j={};function H(e,t){j[e]=t}function V(e,t){let n=function(e){let[t,n]=le(e),r={interceptor:F,...t};return y(e,n),r}(t);return Object.entries(j).forEach(([r,i])=>{Object.defineProperty(e,`$${r}`,{get:()=>i(t,n),enumerable:!1})}),e}function z(e,t,n,...r){try{return n(...r)}catch(n){G(n,e,t)}}function G(e,t,n=void 0){e=Object.assign(e??{message:"No error message given."},{el:t,expression:n}),console.warn(`Alpine Expression Error: ${e.message}\n\n${n?'Expression: "'+n+'"\n\n':""}`,t),setTimeout(()=>{throw e},0)}var W=!0;function Y(e){let t=W;W=!1;let n=e();return W=t,n}function X(e,t,n={}){let r;return $(e,t)(e=>r=e,n),r}function $(...e){return q(...e)}var q=Z;function Z(e,t){let n={};V(n,e);let r=[n,...P(e)],i="function"==typeof t?function(e,t){return(n=()=>{},{scope:r={},params:i=[]}={})=>{K(n,t.apply(k([r,...e]),i))}}(r,t):function(e,t,n){let r=function(e,t){if(Q[e])return Q[e];let n=Object.getPrototypeOf(async function(){}).constructor,r=/^[\n\s]*if.*\(.*\)/.test(e.trim())||/^(let|const)\s/.test(e.trim())?`(async()=>{ ${e} })()`:e;const i=()=>{try{let t=new n(["__self","scope"],`with (scope) { __self.result = ${r} }; __self.finished = true; return __self.result;`);return Object.defineProperty(t,"name",{value:`[Alpine] ${e}`}),t}catch(n){return G(n,t,e),Promise.resolve()}};let o=i();return Q[e]=o,o}(t,n);return(i=()=>{},{scope:o={},params:s=[]}={})=>{r.result=void 0,r.finished=!1;let a=k([o,...e]);if("function"==typeof r){let e=r(r,a).catch(e=>G(e,n,t));r.finished?(K(i,r.result,a,s,n),r.result=void 0):e.then(e=>{K(i,e,a,s,n)}).catch(e=>G(e,n,t)).finally(()=>r.result=void 0)}}}(r,t,e);return z.bind(null,e,t,i)}var Q={};function K(e,t,n,r,i){if(W&&"function"==typeof t){let o=t.apply(n,r);o instanceof Promise?o.then(t=>K(e,t,n,r)).catch(e=>G(e,i,t)):e(o)}else"object"==typeof t&&t instanceof Promise?t.then(t=>e(t)):e(t)}var J="x-";function ee(e=""){return J+e}var te={};function ne(e,t){return te[e]=t,{before(t){if(!te[t])return void console.warn(String.raw`Cannot find directive \`${t}\`. \`${e}\` will use the default order of execution`);const n=me.indexOf(t);me.splice(n>=0?n:me.indexOf("DEFAULT"),0,e)}}}function re(e,t,n){if(t=Array.from(t),e._x_virtualDirectives){let n=Object.entries(e._x_virtualDirectives).map(([e,t])=>({name:e,value:t})),r=ie(n);n=n.map(e=>r.find(t=>t.name===e.name)?{name:`x-bind:${e.name}`,value:`"${e.value}"`}:e),t=t.concat(n)}let r={},i=t.map(ue((e,t)=>r[e]=t)).filter(fe).map(function(e,t){return({name:n,value:r})=>{let i=n.match(pe()),o=n.match(/:([a-zA-Z0-9\-_:]+)/),s=n.match(/\.[^.\]]+(?=[^\]]*$)/g)||[],a=t||e[n]||n;return{type:i?i[1]:null,value:o?o[1]:null,modifiers:s.map(e=>e.replace(".","")),expression:r,original:a}}}(r,n)).sort(we);return i.map(t=>function(e,t){let n=()=>{},r=te[t.type]||n,[i,o]=le(e);v(e,t.original,o);let s=()=>{e._x_ignore||e._x_ignoreSelf||(r.inline&&r.inline(e,t,i),r=r.bind(r,e,t,i),oe?se.get(ae).push(r):r())};return s.runCleanups=o,s}(e,t))}function ie(e){return Array.from(e).map(ue()).filter(e=>!fe(e))}var oe=!1,se=new Map,ae=Symbol();function le(e){let r=[],[i,o]=function(e){let r=()=>{};return[i=>{let o=t(i);return e._x_effects||(e._x_effects=new Set,e._x_runEffects=()=>
2{e._x_effects.forEach(e=>e())}),e._x_effects.add(o),r=()=>{void 0!==o&&(e._x_effects.delete(o),n(o))},o},()=>{r()}]}(e);r.push(o);return[{Alpine:mt,effect:i,cleanup:e=>r.push(e),evaluateLater:$.bind($,e),evaluate:X.bind(X,e)},()=>r.forEach(e=>e())]}var ce=(e,t)=>({name:n,value:r})=>(n.startsWith(e)&&(n=n.replace(e,t)),{name:n,value:r});function ue(e=()=>{}){return({name:t,value:n})=>{let{name:r,value:i}=he.reduce((e,t)=>t(e),{name:t,value:n});return r!==t&&e(r,t),{name:r,value:i}}}var he=[];function de(e){he.push(e)}function fe({name:e}){return pe().test(e)}var pe=()=>new RegExp(`^${J}([^:^.]+)\\b`);var ge="DEFAULT",me=["ignore","ref","data","id","anchor","bind","init","for","model","modelable","transition","show","if",ge,"teleport"];function we(e,t){let n=-1===me.indexOf(e.type)?ge:e.type,r=-1===me.indexOf(t.type)?ge:t.type;return me.indexOf(n)-me.indexOf(r)}function ye(e,t,n={}){e.dispatchEvent(new CustomEvent(t,{detail:n,bubbles:!0,composed:!0,cancelable:!0}))}function Ee(e,t){if("function"==typeof ShadowRoot&&e instanceof ShadowRoot)return void Array.from(e.children).forEach(e=>Ee(e,t));let n=!1;if(t(e,()=>n=!0),n)return;let r=e.firstElementChild;for(;r;)Ee(r,t),r=r.nextElementSibling}function ve(e,...t){console.warn(`Alpine Warning: ${e}`,...t)}var Ae=!1;var Ce=[],be=[];function _e(){return Ce.map(e=>e())}function Se(){return Ce.concat(be).map(e=>e())}function Ie(e){Ce.push(e)}function Te(e){be.push(e)}function De(e,t=!1){return Ne(e,e=>{if((t?Se():_e()).some(t=>e.matches(t)))return!0})}function Ne(e,t){if(e){if(t(e))return e;if(e._x_teleportBack&&(e=e._x_teleportBack),e.parentElement)return Ne(e.parentElement,t)}}var Oe=[];function Re(e,t=Ee,n=()=>{}){!function(e){oe=!0;let t=Symbol();ae=t,se.set(t,[]);let n=()=>{for(;se.get(t).length;)se.get(t).shift()();se.delete(t)};e(n),oe=!1,n()}(()=>{t(e,(e,t)=>{n(e,t),Oe.forEach(n=>n(e,t)),re(e,e.attributes).forEach(e=>e()),e._x_ignore&&t()})})}function Me(e,t=Ee){t(e,e=>{!function(e){for(e._x_effects?.forEach(u);e._x_cleanups?.length;)e._x_cleanups.pop()()}(e),A(e)})}var Pe=[],ke=!1;function xe(e=()=>{}){return queueMicrotask(()=>{ke||setTimeout(()=>{Le()})}),new Promise(t=>{Pe.push(()=>{e(),t()})})}function Le(){for(ke=!1;Pe.length;)Pe.shift()()}function Be(e,t){return Array.isArray(t)?Fe(e,t.join(" ")):"object"==typeof t&&null!==t?function(e,t){let n=e=>e.split(" ").filter(Boolean),r=Object.entries(t).flatMap(([e,t])=>!!t&&n(e)).filter(Boolean),i=Object.entries(t).flatMap(([e,t])=>!t&&n(e)).filter(Boolean),o=[],s=[];return i.forEach(t=>{e.classList.contains(t)&&(e.classList.remove(t),s.push(t))}),r.forEach(t=>{e.classList.contains(t)||(e.classList.add(t),o.push(t))}),()=>{s.forEach(t=>e.classList.add(t)),o.forEach(t=>e.classList.remove(t))}}(e,t):"function"==typeof t?Be(e,t()):Fe(e,t)}function Fe(e,t){return t=!0===t?t="":t||"",n=t.split(" ").filter(t=>!e.classList.contains(t)).filter(Boolean),e.classList.add(...n),()=>{e.classList.remove(...n)};var n}function Ue(e,t){return"object"==typeof t&&null!==t?function(e,t){let n={};return Object.entries(t).forEach(([t,r])=>{n[t]=e.style[t],t.startsWith("--")||(t=t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()),e.style.setProperty(t,r)}),setTimeout(()=>{0===e.style.length&&e.removeAttribute("style")}),()=>{Ue(e,n)}}(e,t):function(e,t){let n=e.getAttribute("style",t);return e.setAttribute("style",t),()=>{e.setAttribute("style",n||"")}}(e,t)}function je(e,t=()=>{}){let n=!1;return function(){n?t.apply(this,arguments):(n=!0,e.apply(this,arguments))}}function He(e,t,n={}){e._x_transition||(e._x_transition={enter:{during:n,start:n,end:n},leave:{during:n,start:n,end:n},in(n=()=>{},r=()=>{}){ze(e,t,{during:this.enter.during,start:this.enter.start,end:this.enter.end},n,r)},out(n=()=>{},r=()=>{}){ze(e,t,{during:this.leave.during,start:this.leave.start,end:this.leave.end},n,r)}})}function Ve(e){let t=e.parentNode;if(t)return t._x_hidePromise?t:Ve(t)}function ze(e,t,{during:n,start:r,end:i}={},o=()=>{},s=()=>{}){if(e._x_transitioning&&e._x_transitioning.cancel(),0===Object.keys(n).length&&0===Object.keys(r).length&&0===Object.keys(i).length)return o(),void s();let a,l,c;!function(e,t){let n,r,i,o=je(()=>{T(()=>{n=!0,r||t.before(),i||(t.end(),Le()),t.after(),e.isConnected&&t.cleanup(),delete e._x_transitioning})});e._x_transitioning={beforeCancels:[],beforeCancel(e){this.beforeCancels.push(e)},cancel:je(function(){for(;this.beforeCancels.length;)this.beforeCancels.shift()();o()}),finish:o},T(()=>{t.start(),t.during()}),ke=!0,requestAnimationFrame(()=>{if(n)return;let o=1e3*Number(getComputedStyle(e).transitionDuration.replace(/,.*/,"").replace("s","")),s=1e3*Number(getComputedStyle(e).transitionDelay.replace(/,.*/,"").replace("s",""));0===o&&(o=1e3*Number(getComputedStyle(e).animationDuration.replace("s",""))),T(()=>{t.before()}),r=!0,requestAnimationFrame(()=>{n||(T(()=>{t.end()}),Le(),setTimeout(e._x_transitioning.finish,o+s),i=!0)})})}(e,{start(){a=t(e,r)},during(){l=t(e,n)},before:o,end(){a(),c=t(e,i)},after:s,cleanup(){l(),c()}})}function Ge(e,t,n){if(-1===e.indexOf(t))return n;const r=e[e.indexOf(t)+1];if(!r)return n;if("scale"===t&&isNaN(r))return n;if("duration"===t||"delay"===t){let e=r.match(/([0-9]+)ms/);if(e)return e[1]}
2return"origin"===t&&["top","right","left","center","bottom"].includes(e[e.indexOf(t)+2])?[r,e[e.indexOf(t)+2]].join(" "):r}ne("transition",(e,{value:t,modifiers:n,expression:r},{evaluate:i})=>{"function"==typeof r&&(r=i(r)),!1!==r&&(r&&"boolean"!=typeof r?function(e,t,n){He(e,Be,"");let r={enter:t=>{e._x_transition.enter.during=t},"enter-start":t=>{e._x_transition.enter.start=t},"enter-end":t=>{e._x_transition.enter.end=t},leave:t=>{e._x_transition.leave.during=t},"leave-start":t=>{e._x_transition.leave.start=t},"leave-end":t=>{e._x_transition.leave.end=t}};r[n](t)}(e,r,t):function(e,t,n){He(e,Ue);let r=!t.includes("in")&&!t.includes("out")&&!n,i=r||t.includes("in")||["enter"].includes(n),o=r||t.includes("out")||["leave"].includes(n);t.includes("in")&&!r&&(t=t.filter((e,n)=>n<t.indexOf("out")));t.includes("out")&&!r&&(t=t.filter((e,n)=>n>t.indexOf("out")));let s=!t.includes("opacity")&&!t.includes("scale"),a=s||t.includes("opacity"),l=s||t.includes("scale"),c=a?0:1,u=l?Ge(t,"scale",95)/100:1,h=Ge(t,"delay",0)/1e3,d=Ge(t,"origin","center"),f="opacity, transform",p=Ge(t,"duration",150)/1e3,g=Ge(t,"duration",75)/1e3,m="cubic-bezier(0.4, 0.0, 0.2, 1)";i&&(e._x_transition.enter.during={transformOrigin:d,transitionDelay:`${h}s`,transitionProperty:f,transitionDuration:`${p}s`,transitionTimingFunction:m},e._x_transition.enter.start={opacity:c,transform:`scale(${u})`},e._x_transition.enter.end={opacity:1,transform:"scale(1)"});o&&(e._x_transition.leave.during={transformOrigin:d,transitionDelay:`${h}s`,transitionProperty:f,transitionDuration:`${g}s`,transitionTimingFunction:m},e._x_transition.leave.start={opacity:1,transform:"scale(1)"},e._x_transition.leave.end={opacity:c,transform:`scale(${u})`})}(e,n,t))}),window.Element.prototype._x_toggleAndCascadeWithTransitions=function(e,t,n,r){const i="visible"===document.visibilityState?requestAnimationFrame:setTimeout;let o=()=>i(n);t?e._x_transition&&(e._x_transition.enter||e._x_transition.leave)?e._x_transition.enter&&(Object.entries(e._x_transition.enter.during).length||Object.entries(e._x_transition.enter.start).length||Object.entries(e._x_transition.enter.end).length)?e._x_transition.in(n):o():e._x_transition?e._x_transition.in(n):o():(e._x_hidePromise=e._x_transition?new Promise((t,n)=>{e._x_transition.out(()=>{},()=>t(r)),e._x_transitioning&&e._x_transitioning.beforeCancel(()=>n({isFromCancelledTransition:!0}))}):Promise.resolve(r),queueMicrotask(()=>{let t=Ve(e);t?(t._x_hideChildren||(t._x_hideChildren=[]),t._x_hideChildren.push(e)):i(()=>{let t=e=>{let n=Promise.all([e._x_hidePromise,...(e._x_hideChildren||[]).map(t)]).then(([e])=>e?.());return delete e._x_hidePromise,delete e._x_hideChildren,n};t(e).catch(e=>{if(!e.isFromCancelledTransition)throw e})})}))};var We=!1;function Ye(e,t=()=>{}){return(...n)=>We?t(...n):e(...n)}var Xe=[];function $e(e){Xe.push(e)}var qe=!1;function Ze(e){let r=t;f((e,t)=>{let i=r(e);return n(i),()=>{}}),e(),f(r)}function Qe(t,n,r,i=[]){switch(t._x_bindings||(t._x_bindings=e({})),t._x_bindings[n]=r,n=i.includes("camel")?n.toLowerCase().replace(/-(\w)/g,(e,t)=>t.toUpperCase()):n){case"value":!function(e,t){if(ot(e))void 0===e.attributes.value&&(e.value=t),window.fromModel&&(e.checked="boolean"==typeof t?et(e.value)===t:Je(e.value,t));else if(it(e))Number.isInteger(t)?e.value=t:Array.isArray(t)||"boolean"==typeof t||[null,void 0].includes(t)?Array.isArray(t)?e.checked=t.some(t=>Je(t,e.value)):e.checked=!!t:e.value=String(t);else if("SELECT"===e.tagName)!function(e,t){const n=[].concat(t).map(e=>e+"");Array.from(e.options).forEach(e=>{e.selected=n.includes(e.value)})}(e,t);else{if(e.value===t)return;e.value=void 0===t?"":t}}(t,r);break;case"style":!function(e,t){e._x_undoAddedStyles&&e._x_undoAddedStyles();e._x_undoAddedStyles=Ue(e,t)}(t,r);break;case"class":!function(e,t){e._x_undoAddedClasses&&e._x_undoAddedClasses();e._x_undoAddedClasses=Be(e,t)}(t,r);break;case"selected":case"checked":!function(e,t,n){Ke(e,t,n),function(e,t,n){e[t]!==n&&(e[t]=n)}(e,t,n)}(t,n,r);break;default:Ke(t,n,r)}}function Ke(e,t,n){[null,void 0,!1].includes(n)&&function(e){return!["aria-pressed","aria-checked","aria-expanded","aria-selected"].includes(e)}(t)?e.removeAttribute(t):(nt(t)&&(n=t),function(e,t,n){e.getAttribute(t)!=n&&e.setAttribute(t,n)}
2(e,t,n))}function Je(e,t){return e==t}function et(e){return!![1,"1","true","on","yes",!0].includes(e)||![0,"0","false","off","no",!1].includes(e)&&(e?Boolean(e):null)}var tt=new Set(["allowfullscreen","async","autofocus","autoplay","checked","controls","default","defer","disabled","formnovalidate","inert","ismap","itemscope","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","selected","shadowrootclonable","shadowrootdelegatesfocus","shadowrootserializable"]);function nt(e){return tt.has(e)}function rt(e,t,n){let r=e.getAttribute(t);return null===r?"function"==typeof n?n():n:""===r||(nt(t)?!![t,"true"].includes(r):r)}function it(e){return"checkbox"===e.type||"ui-checkbox"===e.localName||"ui-switch"===e.localName}function ot(e){return"radio"===e.type||"ui-radio"===e.localName}function st(e,t){var n;return function(){var r=this,i=arguments;clearTimeout(n),n=setTimeout(function(){n=null,e.apply(r,i)},t)}}function at(e,t){let n;return function(){let r=this,i=arguments;n||(e.apply(r,i),n=!0,setTimeout(()=>n=!1,t))}}function lt({get:e,set:r},{get:i,set:o}){let s,a,l=!0,c=t(()=>{let t=e(),n=i();if(l)o(ct(t)),l=!1;else{let e=JSON.stringify(t),i=JSON.stringify(n);e!==s?o(ct(t)):e!==i&&r(ct(n))}s=JSON.stringify(e()),a=JSON.stringify(i())});return()=>{n(c)}}function ct(e){return"object"==typeof e?JSON.parse(JSON.stringify(e)):e}var ut={},ht=!1;var dt={};function ft(e,t,n){let r=[];for(;r.length;)r.pop()();let i=Object.entries(t).map(([e,t])=>({name:e,value:t})),o=ie(i);return i=i.map(e=>o.find(t=>t.name===e.name)?{name:`x-bind:${e.name}`,value:`"${e.value}"`}:e),re(e,i,n).map(e=>{r.push(e.runCleanups),e()}),()=>{for(;r.length;)r.pop()()}}var pt={};var gt={get reactive(){return e},get release(){return n},get effect(){return t},get raw(){return i},version:"3.14.3",flushAndStopDeferringMutations:function(){D=!1,O(N),N=[]},dontAutoEvaluateFunctions:Y,disableEffectScheduling:function(e){d=!1,e(),d=!0},startObservingMutations:_,stopObservingMutations:S,setReactivityEngine:function(r){e=r.reactive,n=r.release,t=e=>r.effect(e,{scheduler:e=>{d?c(e):e()}}),i=r.raw},onAttributeRemoved:v,onAttributesAdded:E,closestDataStack:P,skipDuringClone:Ye,onlyDuringClone:function(e){return(...t)=>We&&e(...t)},addRootSelector:Ie,addInitSelector:Te,interceptClone:$e,addScopeToNode:M,deferMutations:function(){D=!0},mapAttributes:de,evaluateLater:$,interceptInit:function(e){Oe.push(e)},setEvaluator:function(e){q=e},mergeProxies:k,extractProp:function(e,t,n,r=!0){if(e._x_bindings&&void 0!==e._x_bindings[t])return e._x_bindings[t];if(e._x_inlineBindings&&void 0!==e._x_inlineBindings[t]){let n=e._x_inlineBindings[t];return n.extract=r,Y(()=>X(e,n.expression))}return rt(e,t,n)},findClosest:Ne,onElRemoved:y,closestRoot:De,destroyTree:Me,interceptor:F,transition:ze,setStyles:Ue,mutateDom:T,directive:ne,entangle:lt,throttle:at,debounce:st,evaluate:X,initTree:Re,nextTick:xe,prefixed:ee,prefix:function(e){J=e},plugin:function(e){(Array.isArray(e)?e:[e]).forEach(e=>e(mt))},magic:H,store:function(t,n){if(ht||(ut=e(ut),ht=!0),void 0===n)return ut[t];ut[t]=n,B(ut[t]),"object"==typeof n&&null!==n&&n.hasOwnProperty("init")&&"function"==typeof n.init&&ut[t].init()},start:function(){var e;Ae&&ve("Alpine has already been initialized on this page. Calling Alpine.start() more than once can cause problems."),Ae=!0,document.body||ve("Unable to initialize. Trying to load Alpine before `<body>` is available. Did you forget to add `defer` in Alpine's `<script>` tag?"),ye(document,"alpine:init"),ye(document,"alpine:initializing"),_(),e=e=>Re(e,Ee),w.push(e),y(e=>Me(e)),E((e,t)=>{re(e,t).forEach(e=>e())}),Array.from(document.querySelectorAll(Se().join(","))).filter(e=>!De(e.parentElement,!0)).forEach(e=>{Re(e)}),ye(document,"alpine:initialized"),setTimeout(()=>{[["ui","dialog",["[x-dialog], [x-popover]"]],["anchor","anchor",["[x-anchor]"]],["sort","sort",["[x-sort]"]]].forEach(([e,t,n])=>{var r;r=t,Object.keys(te).includes(r)||n.some(t=>{if(document.querySelector(t))return ve(`found "${t}", but missing ${e} plugin`),!0})})})},clone:function(e,t){t._x_dataStack||(t._x_dataStack=e._x_dataStack),We=!0,qe=!0,Ze(()=>{!function(e){let t=!1;Re(e,(e,n)=>{Ee(e,(e,r)=>{if(t&&function(e){return _e().some(t=>e.matches(t))}(e))return r();t=!0,n(e,r)})})}(t)}),We=!1,qe=!1},cloneNode:function(e,t){Xe.forEach(n=>n(e,t)),We=!0,Ze(()=>{Re(t,(e,t)=>{t(e,()=>{})})}),We=!1},bound:function(e,t,n){return e._x_bindings&&void 0!==e._x_bindings[t]?e._x_bindings[t]:rt(e,t,n)},$data:R,watch:p,walk:Ee,data:function(e,t){pt[e]=t},bind:function(e,t){let n="function"!=typeof t?()=>t:t;return e instanceof Element?ft(e,n()):(dt[e]=n,()=>{})}},mt=gt;function wt(e,t){const n=Object.create(null),r=e.split(",");for(let e=0;e<r.length;e++)n[r[e]]=!0;return t?e=>!!n[e.toLowerCase()]:e=>!!n[e]}var yt,Et=Object.freeze({}),vt=(Object.freeze([]),Object.prototype.hasOwnProperty),At=(e,t)=>vt.call(e,t),Ct=Array.isArray,bt=e=>"[object Map]"===Tt(e),_t=e=>"symbol"==typeof e,St=e=>null!==e&&"object"==typeof e,It=Object.prototype.toString,Tt=e=>It.call(e),Dt=e=>Tt(e).slice(8,-1),Nt=e=>"string"==typeof e&&"NaN"!==e&&"-"!==e[0]&&""+parseInt(e,10)===e,Ot=e=>{const t=Object.create(null);return n=>t[n]||(t[n]=e(n))},Rt=/-(\w)/g,Mt=(Ot(e=>e.replace(Rt,(e,t)=>t?t.toUpperCase():"")),/\B([A-Z])/g),Pt=(Ot(e=>e.replace(Mt,"-$1").toLowerCase()),Ot(e=>e.charAt(0).toUpperCase()+e.slice(1))),kt=(Ot(e=>e?`on${Pt(e)}`:""),(e,t)=>e!==t&&(e==e||t==t)),xt=new WeakMap,Lt=[],Bt=Symbol("iterate"),Ft=Symbol("Map key iterate");var Ut=0;function jt(e){const{deps:t}=e;if(t.length){for(let n=0;n<t.length;n++)t[n].delete(e);t.length=0}}var Ht=!0,Vt=[];function zt(){const e=Vt.pop();Ht=void 0===e||e}function Gt(e,t,n){if(!Ht||void 0===yt)return;let r=xt.get(e);r||xt.set(e,r=new Map);let i=r.get(n);i||r.set(n,i=new Set),i.has(yt)||(i.add(yt),yt.deps.push(i),yt.options.onTrack&&yt.options.onTrack({effect:yt,target:e,type:t,key:n}))}function Wt(e,t,n,r,i,o){const s=xt.get(e);if(!s)return;const a=new Set,l=e=>
vendor: 4,138 bytes, line 2
2{e&&e.forEach(e=>{(e!==yt||e.allowRecurse)&&a.add(e)})};if("clear"===t)s.forEach(l);else if("length"===n&&Ct(e))s.forEach((e,t)=>{("length"===t||t>=r)&&l(e)});else switch(void 0!==n&&l(s.get(n)),t){case"add":Ct(e)?Nt(n)&&l(s.get("length")):(l(s.get(Bt)),bt(e)&&l(s.get(Ft)));break;case"delete":Ct(e)||(l(s.get(Bt)),bt(e)&&l(s.get(Ft)));break;case"set":bt(e)&&l(s.get(Bt))}a.forEach(s=>{s.options.onTrigger&&s.options.onTrigger({effect:s,target:e,key:n,type:t,newValue:r,oldValue:i,oldTarget:o}),s.options.scheduler?s.options.scheduler(s):s()})}var Yt=wt("__proto__,__v_isRef,__isVue"),Xt=new Set(Object.getOwnPropertyNames(Symbol).map(e=>Symbol[e]).filter(_t)),$t=Kt(),qt=Kt(!0),Zt=Qt();function Qt(){const e={};return["includes","indexOf","lastIndexOf"].forEach(t=>{e[t]=function(...e){const n=Pn(this);for(let e=0,t=this.length;e<t;e++)Gt(n,"get",e+"");const r=n[t](...e);return-1===r||!1===r?n[t](...e.map(Pn)):r}}),["push","pop","shift","unshift","splice"].forEach(t=>{e[t]=function(...e){Vt.push(Ht),Ht=!1;const n=Pn(this)[t].apply(this,e);return zt(),n}}),e}function Kt(e=!1,t=!1){return function(n,r,i){if("__v_isReactive"===r)return!e;if("__v_isReadonly"===r)return e;if("__v_raw"===r&&i===(e?t?Nn:Dn:t?Tn:In).get(n))return n;const o=Ct(n);if(!e&&o&&At(Zt,r))return Reflect.get(Zt,r,i);const s=Reflect.get(n,r,i);if(_t(r)?Xt.has(r):Yt(r))return s;if(e||Gt(n,"get",r),t)return s;if(kn(s)){return!o||!Nt(r)?s.value:s}return St(s)?e?Rn(s):On(s):s}}function Jt(e=!1){return function(t,n,r,i){let o=t[n];if(!e&&(r=Pn(r),o=Pn(o),!Ct(t)&&kn(o)&&!kn(r)))return o.value=r,!0;const s=Ct(t)&&Nt(n)?Number(n)<t.length:At(t,n),a=Reflect.set(t,n,r,i);return t===Pn(i)&&(s?kt(r,o)&&Wt(t,"set",n,r,o):Wt(t,"add",n,r)),a}}var en={get:$t,set:Jt(),deleteProperty:function(e,t){const n=At(e,t),r=e[t],i=Reflect.deleteProperty(e,t);return i&&n&&Wt(e,"delete",t,void 0,r),i},has:function(e,t){const n=Reflect.has(e,t);return _t(t)&&Xt.has(t)||Gt(e,"has",t),n},ownKeys:function(e){return Gt(e,"iterate",Ct(e)?"length":Bt),Reflect.ownKeys(e)}},tn={get:qt,set:(e,t)=>(console.warn(`Set operation on key "${String(t)}" failed: target is readonly.`,e),!0),deleteProperty:(e,t)=>(console.warn(`Delete operation on key "${String(t)}" failed: target is readonly.`,e),!0)},nn=e=>St(e)?On(e):e,rn=e=>St(e)?Rn(e):e,on=e=>e,sn=e=>Reflect.getPrototypeOf(e);function an(e,t,n=!1,r=!1){const i=Pn(e=e.__v_raw),o=Pn(t);t!==o&&!n&&Gt(i,"get",t),!n&&Gt(i,"get",o);const{has:s}=sn(i),a=r?on:n?rn:nn;return s.call(i,t)?a(e.get(t)):s.call(i,o)?a(e.get(o)):void(e!==i&&e.get(t))}function ln(e,t=!1){const n=this.__v_raw,r=Pn(n),i=Pn(e);return e!==i&&!t&&Gt(r,"has",e),!t&&Gt(r,"has",i),e===i?n.has(e):n.has(e)||n.has(i)}function cn(e,t=!1){return e=e.__v_raw,!t&&Gt(Pn(e),"iterate",Bt),Reflect.get(e,"size",e)}function un(e){e=Pn(e);const t=Pn(this);return sn(t).has.call(t,e)||(t.add(e),Wt(t,"add",e,e)),this}function hn(e,t){t=Pn(t);const n=Pn(this),{has:r,get:i}=sn(n);let o=r.call(n,e);o?Sn(n,r,e):(e=Pn(e),o=r.call(n,e));const s=i.call(n,e);return n.set(e,t),o?kt(t,s)&&Wt(n,"set",e,t,s):Wt(n,"add",e,t),this}function dn(e){const t=Pn(this),{has:n,get:r}=sn(t);let i=n.call(t,e);i?Sn(t,n,e):(e=Pn(e),i=n.call(t,e));const o=r?r.call(t,e):void 0,s=t.delete(e);return i&&Wt(t,"delete",e,void 0,o),s}function fn(){const e=Pn(this),t=0!==e.size,n=bt(e)?new Map(e):new Set(e),r=e.clear();return t&&Wt(e,"clear",void 0,void 0,n),r}function pn(e,t){return function(n,r){const i=this,o=i.__v_raw,s=Pn(o),a=t?on:e?rn:nn;return!e&&Gt(s,"iterate",Bt),o.forEach((e,t)=>n.call(r,a(e),a(t),i))}}function gn(e,t,n){return function(...r){const i=this.__v_raw,o=Pn(i),s=bt(o),a="entries"===e||e===Symbol.iterator&&s,l="keys"===e&&s,c=i[e](...r),u=n?on:t?rn:nn;return!t&&Gt(o,"iterate",l?Ft:Bt),{next(){const{value:e,done:t}=c.next();return t?{value:e,done:t}:{value:a?[u(e[0]),u(e[1])]:u(e),done:t}},[Symbol.iterator](){return this}}}}function mn(e){return function(...t){{const n=t[0]?`on key "${t[0]}" `:"";console.warn(`${Pt(e)} operation ${n}failed: target is readonly.`,Pn(this))}return"delete"!==e&&this}}function wn(){const e={get(e){return an(this,e)},get size(){return cn(this)}
2,has:ln,add:un,set:hn,delete:dn,clear:fn,forEach:pn(!1,!1)},t={get(e){return an(this,e,!1,!0)},get size(){return cn(this)},has:ln,add:un,set:hn,delete:dn,clear:fn,forEach:pn(!1,!0)},n={get(e){return an(this,e,!0)},get size(){return cn(this,!0)},has(e){return ln.call(this,e,!0)},add:mn("add"),set:mn("set"),delete:mn("delete"),clear:mn("clear"),forEach:pn(!0,!1)},r={get(e){return an(this,e,!0,!0)},get size(){return cn(this,!0)},has(e){return ln.call(this,e,!0)},add:mn("add"),set:mn("set"),delete:mn("delete"),clear:mn("clear"),forEach:pn(!0,!0)};return["keys","values","entries",Symbol.iterator].forEach(i=>{e[i]=gn(i,!1,!1),n[i]=gn(i,!0,!1),t[i]=gn(i,!1,!0),r[i]=gn(i,!0,!0)}),[e,n,t,r]}var[yn,En,vn,An]=wn();function Cn(e,t){const n=t?e?An:vn:e?En:yn;return(t,r,i)=>"__v_isReactive"===r?!e:"__v_isReadonly"===r?e:"__v_raw"===r?t:Reflect.get(At(n,r)&&r in t?n:t,r,i)}var bn={get:Cn(!1,!1)},_n={get:Cn(!0,!1)};function Sn(e,t,n){const r=Pn(n);if(r!==n&&t.call(e,r)){const t=Dt(e);console.warn(`Reactive ${t} contains both the raw and reactive versions of the same object${"Map"===t?" as keys":""}, which can lead to inconsistencies. Avoid differentiating between the raw and reactive versions of an object and only use the reactive version if possible.`)}}var In=new WeakMap,Tn=new WeakMap,Dn=new WeakMap,Nn=new WeakMap;function On(e){return e&&e.__v_isReadonly?e:Mn(e,!1,en,bn,In)}function Rn(e){return Mn(e,!0,tn,_n,Dn)}function Mn(e,t,n,r,i){if(!St(e))return console.warn(`value cannot be made reactive: ${String(e)}`),e;if(e.__v_raw&&(!t||!e.__v_isReactive))return e;const o=i.get(e);if(o)return o;const s=(a=e).__v_skip||!Object.isExtensible(a)?0:function(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}(Dt(a));var a;if(0===s)return e;const l=new Proxy(e,2===s?r:n);return i.set(e,l),l}function Pn(e){return e&&Pn(e.__v_raw)||e}function kn(e){return Boolean(e&&!0===e.__v_isRef)}H("nextTick",()=>xe),H("dispatch",e=>ye.bind(ye,e)),H("watch",(e,{evaluateLater:t,cleanup:n})=>(e,r)=>{let i=t(e),o=p(()=>{let e;return i(t=>e=t),e},r);n(o)}),H("store",function(){return ut}),H("data",e=>R(e)),H("root",e=>De(e)),H("refs",e=>(e._x_refs_proxy||(e._x_refs_proxy=k(function(e){let t=[];return Ne(e,e=>{e._x_refs&&t.push(e._x_refs)}),t}(e))),e._x_refs_proxy));var xn={};function Ln(e){return xn[e]||(xn[e]=0),++xn[e]}function Bn(e,t,n){H(t,r=>ve(`You can't use [$${t}] without first installing the "${e}" plugin here: https://alpinejs.dev/plugins/${n}`,r))}H("id",(e,{cleanup:t})=>(n,r=null)=>function(e,t,n,r){e._x_id||(e._x_id={});if(e._x_id[t])return e._x_id[t];let i=r();return e._x_id[t]=i,n(()=>{delete e._x_id[t]}),i}(e,`${n}${r?`-${r}`:""}`,t,()=>{let t=function(e,t){return Ne(e,e=>{if(e._x_ids&&e._x_ids[t])return!0})}(e,n),i=t?t._x_ids[n]:Ln(n);return r?`${n}-${i}-${r}`:`${n}-${i}`})),$e((e,t)=>{e._x_id&&(t._x_id=e._x_id)}),H("el",e=>e),Bn("Focus","focus","focus"),Bn("Persist","persist","persist"),ne("modelable",(e,{expression:t},{effect:n,evaluateLater:r,cleanup:i})=>{let o=r(t),s=()=>{let e;return o(t=>e=t),e},a=r(`${t} = __placeholder`),l=e=>a(()=>{},{scope:{__placeholder:e}}),c=s();l(c),queueMicrotask(()=>{if(!e._x_model)return;e._x_removeModelListeners.default();let t=e._x_model.get,n=e._x_model.set,r=lt({get:()=>t(),set(e){n(e)}},{get:()=>s(),set(e){l(e)}});i(r)})}),ne("teleport",(e,{modifiers:t,expression:n},{cleanup:r})=>{"template"!==e.tagName.toLowerCase()&&ve("x-teleport can only be used on a <template> tag",e);let i=Un(n),o=e.content.cloneNode(!0).firstElementChild;e._x_teleport=o,o._x_teleportBack=e,e.setAttribute("data-teleport-template",!0),o.setAttribute("data-teleport-target",!0),e._x_forwardEvents&&e._x_forwardEvents.forEach(t=>{o.addEventListener(t,t=>{t.stopPropagation(),e.dispatchEvent(new t.constructor(t.type,t))})}),M(o,{},e);let s=(e,t,n)=>{n.includes("prepend")?t.parentNode.insertBefore(e,t):n.includes("append")?t.parentNode.insertBefore(e,t.nextSibling):t.appendChild(e)};T(()=>{s(o,i,t),Ye(()=>{Re(o),o._x_ignore=!0})()}),e._x_teleportPutBack=()=>{let r=Un(n);T(()=>{s(e._x_teleport,r,t)})},r(()=>T(()=>{o.remove(),Me(o)}))});var Fn=document.createElement("div");function Un(e){let t=Ye(()=>document.querySelector(e),()=>Fn)();return t||ve(`Cannot find x-teleport element for selector: "${e}"`),t}var jn=()=>{};function Hn(e,t,n,r){let i=e,o=e=>r(e),s={},a=(e,t)=>n=>t(e,n);if(n.includes("dot")&&(t=t.replace(/-/g,".")),n.includes("camel")&&(t=function(e){return e.toLowerCase().replace(/-(\w)/g,(e,t)=>t.toUpperCase())}(t)),n.includes("passive")&&(s.passive=!0),n.includes("capture")&&(s.capture=!0),n.includes("window")&&(i=window),n.includes("document")&&(i=document),n.includes("debounce")){let e=n[n.indexOf("debounce")+1]||"invalid-wait",t=Vn(e.split("ms")[0])?Number(e.split("ms")[0]):250;o=st(o,t)}if(n.includes("throttle")){let e=n[n.indexOf("throttle")+1]||"invalid-wait",t=Vn(e.split("ms")[0])?Number(e.split("ms")[0]):250;o=at(o,t)}return n.includes("prevent")&&(o=a(o,(e,t)=>{t.preventDefault(),e(t)}
2)),n.includes("stop")&&(o=a(o,(e,t)=>{t.stopPropagation(),e(t)})),n.includes("once")&&(o=a(o,(e,n)=>{e(n),i.removeEventListener(t,o,s)})),(n.includes("away")||n.includes("outside"))&&(i=document,o=a(o,(t,n)=>{e.contains(n.target)||!1!==n.target.isConnected&&(e.offsetWidth<1&&e.offsetHeight<1||!1!==e._x_isShown&&t(n))})),n.includes("self")&&(o=a(o,(t,n)=>{n.target===e&&t(n)})),(function(e){return["keydown","keyup"].includes(e)}(t)||zn(t))&&(o=a(o,(e,t)=>{(function(e,t){let n=t.filter(e=>!["window","document","prevent","stop","once","capture","self","away","outside","passive"].includes(e));if(n.includes("debounce")){let e=n.indexOf("debounce");n.splice(e,Vn((n[e+1]||"invalid-wait").split("ms")[0])?2:1)}if(n.includes("throttle")){let e=n.indexOf("throttle");n.splice(e,Vn((n[e+1]||"invalid-wait").split("ms")[0])?2:1)}if(0===n.length)return!1;if(1===n.length&&Gn(e.key).includes(n[0]))return!1;const r=["ctrl","shift","alt","meta","cmd","super"].filter(e=>n.includes(e));if(n=n.filter(e=>!r.includes(e)),r.length>0){if(r.filter(t=>("cmd"!==t&&"super"!==t||(t="meta"),e[`${t}Key`])).length===r.length){if(zn(e.type))return!1;if(Gn(e.key).includes(n[0]))return!1}}return!0})(t,n)||e(t)})),i.addEventListener(t,o,s),()=>{i.removeEventListener(t,o,s)}}function Vn(e){return!Array.isArray(e)&&!isNaN(e)}function zn(e){return["contextmenu","click","mouse"].some(t=>e.includes(t))}function Gn(e){if(!e)return[];var t;e=[" ","_"].includes(t=e)?t:t.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[_\s]/,"-").toLowerCase();let n={ctrl:"control",slash:"/",space:" ",spacebar:" ",cmd:"meta",esc:"escape",up:"arrow-up",down:"arrow-down",left:"arrow-left",right:"arrow-right",period:".",comma:",",equal:"=",minus:"-",underscore:"_"};return n[e]=e,Object.keys(n).map(t=>{if(n[t]===e)return t}).filter(e=>e)}function Wn(e,t,n,r){return T(()=>{if(n instanceof CustomEvent&&void 0!==n.detail)return null!==n.detail&&void 0!==n.detail?n.detail:n.target.value;if(it(e)){if(Array.isArray(r)){let e=null;return e=t.includes("number")?Yn(n.target.value):t.includes("boolean")?et(n.target.value):n.target.value,n.target.checked?r.includes(e)?r:r.concat([e]):r.filter(t=>!(t==e))}return n.target.checked}if("select"===e.tagName.toLowerCase()&&e.multiple)return t.includes("number")?Array.from(n.target.selectedOptions).map(e=>Yn(e.value||e.text)):t.includes("boolean")?Array.from(n.target.selectedOptions).map(e=>et(e.value||e.text)):Array.from(n.target.selectedOptions).map(e=>e.value||e.text);{let i;return i=ot(e)?n.target.checked?n.target.value:r:n.target.value,t.includes("number")?Yn(i):t.includes("boolean")?et(i):t.includes("trim")?i.trim():i}})}function Yn(e){let t=e?parseFloat(e):null;return n=t,Array.isArray(n)||isNaN(n)?e:t;var n}function Xn(e){return null!==e&&"object"==typeof e&&"function"==typeof e.get&&"function"==typeof e.set}jn.inline=(e,{modifiers:t},{cleanup:n})=>{t.includes("self")?e._x_ignoreSelf=!0:e._x_ignore=!0,n(()=>{t.includes("self")?delete e._x_ignoreSelf:delete e._x_ignore})},ne("ignore",jn),ne("effect",Ye((e,{expression:t},{effect:n})=>{n($(e,t))})),ne("model",(e,{modifiers:t,expression:n},{effect:r,cleanup:i})=>{let o=e;t.includes("parent")&&(o=e.parentNode);let s,a=$(o,n);s="string"==typeof n?$(o,`${n} = __placeholder`):"function"==typeof n&&"string"==typeof n()?$(o,`${n()} = __placeholder`):()=>{};let l=()=>{let e;return a(t=>e=t),Xn(e)?e.get():e},c=e=>{let t;a(e=>t=e),Xn(t)?t.set(e):s(()=>{},{scope:{__placeholder:e}})};"string"==typeof n&&"radio"===e.type&&T(()=>{e.hasAttribute("name")||e.setAttribute("name",n)});var u="select"===e.tagName.toLowerCase()||["checkbox","radio"].includes(e.type)||t.includes("lazy")?"change":"input";let h=We?()=>{}:Hn(e,u,t,n=>{c(Wn(e,t,n,l()))});if(t.includes("fill")&&([void 0,null,""].includes(l())||it(e)&&Array.isArray(l())||"select"===e.tagName.toLowerCase()&&e.multiple)&&c(Wn(e,t,{target:e},l())),e._x_removeModelListeners||(e._x_removeModelListeners={}),e._x_removeModelListeners.default=h,i(()=>e._x_removeModelListeners.default()),e.form){let n=Hn(e.form,"reset",[],n=>{xe(()=>e._x_model&&e._x_model.set(Wn(e,t,{target:e},l())))});i(()=>n())}e._x_model={get:()=>l(),set(e){c(e)}},e._x_forceModelUpdate=t=>{void 0===t&&"string"==typeof n&&n.match(/\./)&&(t=""),window.fromModel=!0,T(()=>Qe(e,"value",t)),delete window.fromModel},r(()=>{let n=l();t.includes("unintrusive")&&document.activeElement.isSameNode(e)||e._x_forceModelUpdate(n)})}),ne("cloak",e=>queueMicrotask(()=>T(()=>e.removeAttribute(ee("cloak"))))),Te(()=>`[${ee("init")}]`),ne("init",Ye((e,{expression:t},{evaluate:n})=>"string"==typeof t?!!t.trim()&&n(t,{},!1):n(t,{},!1))),ne("text",(e,{expression:t},{effect:n,evaluateLater:r})=>{let i=r(t);n(()=>{i(t=>{T(()=>{e.textContent=t})})})}),ne("html",(e,{expression:t},{effect:n,evaluateLater:r})=>{let i=r(t);n(()=>{i(t=>{T(()=>{e.innerHTML=t,e._x_ignoreSelf=!0,Re(e),delete e._x_ignoreSelf})})})}),de(ce(":",ee("bind:")));var $n=(e,{value:t,modifiers:n,expression:r,original:i},{effect:o,cleanup:s})=>{if(!t){let t={};return a=t,Object.entries(dt).forEach(([e,t])=>{Object.defineProperty(a,e,{get:()=>(...e)=>t(...e)})}),void $(e,r)(t=>{ft(e,t,i)},{scope:t})}var a;if("key"===t)return function(e,t){e._x_keyExpression=t}(e,r);if(e._x_inlineBindings&&e._x_inlineBindings[t]&&e._x_inlineBindings[t].extract)return;let l=$(e,r);o(()=>l(i=>{void 0===i&&"string"==typeof r&&r.match(/\./)&&(i=""),T(()=>Qe(e,t,i,n))})),s(()=>
2{e._x_undoAddedClasses&&e._x_undoAddedClasses(),e._x_undoAddedStyles&&e._x_undoAddedStyles()})};function qn(e,t,n,r){let i={};if(/^\[.*\]$/.test(e.item)&&Array.isArray(t)){e.item.replace("[","").replace("]","").split(",").map(e=>e.trim()).forEach((e,n)=>{i[e]=t[n]})}else if(/^\{.*\}$/.test(e.item)&&!Array.isArray(t)&&"object"==typeof t){e.item.replace("{","").replace("}","").split(",").map(e=>e.trim()).forEach(e=>{i[e]=t[e]})}else i[e.item]=t;return e.index&&(i[e.index]=n),e.collection&&(i[e.collection]=r),i}function Zn(){}function Qn(e,t,n){ne(t,r=>ve(`You can't use [x-${t}] without first installing the "${e}" plugin here: https://alpinejs.dev/plugins/${n}`,r))}$n.inline=(e,{value:t,modifiers:n,expression:r})=>{t&&(e._x_inlineBindings||(e._x_inlineBindings={}),e._x_inlineBindings[t]={expression:r,extract:!1})},ne("bind",$n),Ie(()=>`[${ee("data")}]`),ne("data",(t,{expression:n},{cleanup:r})=>{if(function(e){return!!We&&(!!qe||e.hasAttribute("data-has-alpine-state"))}(t))return;n=""===n?"{}":n;let i={};V(i,t);let o={};var s,a;s=o,a=i,Object.entries(pt).forEach(([e,t])=>{Object.defineProperty(s,e,{get:()=>(...e)=>t.bind(a)(...e),enumerable:!1})});let l=X(t,n,{scope:o});void 0!==l&&!0!==l||(l={}),V(l,t);let c=e(l);B(c);let u=M(t,c);c.init&&X(t,c.init),r(()=>{c.destroy&&X(t,c.destroy),u()})}),$e((e,t)=>{e._x_dataStack&&(t._x_dataStack=e._x_dataStack,t.setAttribute("data-has-alpine-state",!0))}),ne("show",(e,{modifiers:t,expression:n},{effect:r})=>{let i=$(e,n);e._x_doHide||(e._x_doHide=()=>{T(()=>{e.style.setProperty("display","none",t.includes("important")?"important":void 0)})}),e._x_doShow||(e._x_doShow=()=>{T(()=>{1===e.style.length&&"none"===e.style.display?e.removeAttribute("style"):e.style.removeProperty("display")})});let o,s=()=>{e._x_doHide(),e._x_isShown=!1},a=()=>{e._x_doShow(),e._x_isShown=!0},l=()=>setTimeout(a),c=je(e=>e?a():s(),t=>{"function"==typeof e._x_toggleAndCascadeWithTransitions?e._x_toggleAndCascadeWithTransitions(e,t,a,s):t?l():s()}),u=!0;r(()=>i(e=>{(u||e!==o)&&(t.includes("immediate")&&(e?l():s()),c(e),o=e,u=!1)}))}),ne("for",(t,{expression:n},{effect:r,cleanup:i})=>{let o=function(e){let t=/,([^,\}\]]*)(?:,([^,\}\]]*))?$/,n=/^\s*\(|\)\s*$/g,r=/([\s\S]*?)\s+(?:in|of)\s+([\s\S]*)/,i=e.match(r);if(!i)return;let o={};o.items=i[2].trim();let s=i[1].replace(n,"").trim(),a=s.match(t);a?(o.item=s.replace(t,"").trim(),o.index=a[1].trim(),a[2]&&(o.collection=a[2].trim())):o.item=s;return o}(n),s=$(t,o.items),a=$(t,t._x_keyExpression||"index");t._x_prevKeys=[],t._x_lookup={},r(()=>function(t,n,r,i){let o=e=>"object"==typeof e&&!Array.isArray(e),s=t;r(r=>{var a;a=r,!Array.isArray(a)&&!isNaN(a)&&r>=0&&(r=Array.from(Array(r).keys(),e=>e+1)),void 0===r&&(r=[]);let l=t._x_lookup,c=t._x_prevKeys,u=[],h=[];if(o(r))r=Object.entries(r).map(([e,o])=>{let s=qn(n,o,e,r);i(e=>{h.includes(e)&&ve("Duplicate key on x-for",t),h.push(e)},{scope:{index:e,...s}}),u.push(s)});else for(let e=0;e<r.length;e++){let o=qn(n,r[e],e,r);i(e=>{h.includes(e)&&ve("Duplicate key on x-for",t),h.push(e)},{scope:{index:e,...o}}),u.push(o)}let d=[],f=[],p=[],g=[];for(let e=0;e<c.length;e++){let t=c[e];-1===h.indexOf(t)&&p.push(t)}c=c.filter(e=>!p.includes(e));let m="template";for(let e=0;e<h.length;e++){let t=h[e],n=c.indexOf(t);if(-1===n)c.splice(e,0,t),d.push([m,e]);else if(n!==e){let t=c.splice(e,1)[0],r=c.splice(n-1,1)[0];c.splice(e,0,r),c.splice(n,0,t),f.push([t,r])}else g.push(t);m=t}for(let e=0;e<p.length;e++){let t=p[e];t in l&&(T(()=>{Me(l[t]),l[t].remove()}),delete l[t])}for(let e=0;e<f.length;e++){let[t,n]=f[e],r=l[t],i=l[n],o=document.createElement("div");T(()=>{i||ve('x-for ":key" is undefined or invalid',s,n,l),i.after(o),r.after(i),i._x_currentIfEl&&i.after(i._x_currentIfEl),o.before(r),r._x_currentIfEl&&r.after(r._x_currentIfEl),o.remove()}),i._x_refreshXForScope(u[h.indexOf(n)])}for(let t=0;t<d.length;t++){let[n,r]=d[t],i="template"===n?s:l[n];i._x_currentIfEl&&(i=i._x_currentIfEl);let o=u[r],a=h[r],c=document.importNode(s.content,!0).firstElementChild,f=e(o);M(c,f,s),c._x_refreshXForScope=e=>{Object.entries(e).forEach(([e,t])=>{f[e]=t})},T(()=>{i.after(c),Ye(()=>Re(c))()}),"object"==typeof a&&ve("x-for key cannot be an object, it must be a string or an integer",s),l[a]=c}for(let e=0;e<g.length;e++)l[g[e]]._x_refreshXForScope(u[h.indexOf(g[e])]);s._x_prevKeys=h})}(t,o,s,a)),i(()=>
2{Object.values(t._x_lookup).forEach(e=>T(()=>{Me(e),e.remove()})),delete t._x_prevKeys,delete t._x_lookup})}),Zn.inline=(e,{expression:t},{cleanup:n})=>{let r=De(e);r._x_refs||(r._x_refs={}),r._x_refs[t]=e,n(()=>delete r._x_refs[t])},ne("ref",Zn),ne("if",(e,{expression:t},{effect:n,cleanup:r})=>{"template"!==e.tagName.toLowerCase()&&ve("x-if can only be used on a <template> tag",e);let i=$(e,t);n(()=>i(t=>{t?(()=>{if(e._x_currentIfEl)return e._x_currentIfEl;let t=e.content.cloneNode(!0).firstElementChild;M(t,{},e),T(()=>{e.after(t),Ye(()=>Re(t))()}),e._x_currentIfEl=t,e._x_undoIf=()=>{T(()=>{Me(t),t.remove()}),delete e._x_currentIfEl}})():e._x_undoIf&&(e._x_undoIf(),delete e._x_undoIf)})),r(()=>e._x_undoIf&&e._x_undoIf())}),ne("id",(e,{expression:t},{evaluate:n})=>{n(t).forEach(t=>function(e,t){e._x_ids||(e._x_ids={}),e._x_ids[t]||(e._x_ids[t]=Ln(t))}(e,t))}),$e((e,t)=>{e._x_ids&&(t._x_ids=e._x_ids)}),de(ce("@",ee("on:"))),ne("on",Ye((e,{value:t,modifiers:n,expression:r},{cleanup:i})=>{let o=r?$(e,r):()=>{};"template"===e.tagName.toLowerCase()&&(e._x_forwardEvents||(e._x_forwardEvents=[]),e._x_forwardEvents.includes(t)||e._x_forwardEvents.push(t));let s=Hn(e,t,n,e=>{o(()=>{},{scope:{$event:e},params:[e]})});i(()=>s())})),Qn("Collapse","collapse","collapse"),Qn("Intersect","intersect","intersect"),Qn("Focus","trap","focus"),Qn("Mask","mask","mask"),mt.setEvaluator(Z),mt.setReactivityEngine({reactive:On,effect:function(e,t=Et){(function(e){return e&&!0===e._isEffect})(e)&&(e=e.raw);const n=function(e,t){const n=function(){if(!n.active)return e();if(!Lt.includes(n)){jt(n);try{return Vt.push(Ht),Ht=!0,Lt.push(n),yt=n,e()}finally{Lt.pop(),zt(),yt=Lt[Lt.length-1]}}};return n.id=Ut++,n.allowRecurse=!!t.allowRecurse,n._isEffect=!0,n.active=!0,n.raw=e,n.deps=[],n.options=t,n}(e,t);return t.lazy||n(),n},release:function(e){e.active&&(jt(e),e.options.onStop&&e.options.onStop(),e.active=!1)},raw:Pn});var Kn=mt;function Jn(e,t,n){if(-1===e.indexOf(t))return n;const r=e[e.indexOf(t)+1];if(!r)return n;if("duration"===t){let e=r.match(/([0-9]+)ms/);if(e)return e[1]}if("min"===t){let e=r.match(/([0-9]+)px/);if(e)return e[1]}return r}var er,tr,nr=function(e){function t(t,{modifiers:n}){let r=Jn(n,"duration",250)/1e3,i=Jn(n,"min",0),o=!n.includes("min");t._x_isShown||(t.style.height=`${i}px`),!t._x_isShown&&o&&(t.hidden=!0),t._x_isShown||(t.style.overflow="hidden");let s=(t,n)=>{let r=e.setStyles(t,n);return n.height?()=>{}:r},a={transitionProperty:"height",transitionDuration:`${r}s`,transitionTimingFunction:"cubic-bezier(0.4, 0.0, 0.2, 1)"};t._x_transition={in(n=()=>{},r=()=>{}){o&&(t.hidden=!1),o&&(t.style.display=null);let s=t.getBoundingClientRect().height;t.style.height="auto";let l=t.getBoundingClientRect().height;s===l&&(s=i),e.transition(t,e.setStyles,{during:a,start:{height:s+"px"},end:{height:l+"px"}},()=>t._x_isShown=!0,()=>{Math.abs(t.getBoundingClientRect().height-l)<1&&(t.style.overflow=null)})},out(n=()=>{},r=()=>{}){let l=t.getBoundingClientRect().height;e.transition(t,s,{during:a,start:{height:l+"px"},end:{height:i+"px"}},()=>t.style.overflow="hidden",()=>{t._x_isShown=!1,t.style.height==`${i}px`&&o&&(t.style.display="none",t.hidden=!0)})}}}e.directive("collapse",t),t.inline=(e,{modifiers:t})=>{t.includes("min")&&(e._x_doShow=()=>{},e._x_doHide=()=>{})}},rr=Object.create,ir=Object.defineProperty,or=Object.getPrototypeOf,sr=Object.prototype.hasOwnProperty,ar=Object.getOwnPropertyNames,lr=Object.getOwnPropertyDescriptor,cr=(er=(e,t)=>{!function(e,n){if(e){for(var r,i={8:"backspace",9:"tab",13:"enter",16:"shift",17:"ctrl",18:"alt",20:"capslock",27:"esc",32:"space",33:"pageup",34:"pagedown",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down",45:"ins",46:"del",91:"meta",93:"meta",224:"meta"},o={106:"*",107:"+",109:"-",110:".",111:"/",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},s={"~":"`","!":"1","@":"2","#":"3",$:"4","%":"5","^":"6","&":"7","*":"8","(":"9",")":"0",_:"-","+":"=",":":";",'"':"'","<":",",">":".","?":"/","|":"\\"},a={option:"alt",command:"meta",return:"enter",escape:"esc",plus:"+",mod:/Mac|iPod|iPhone|iPad/.test(navigator.platform)?"meta":"ctrl"},l=1;l<20;++l)i[111+l]="f"+l;for(l=0;l<=9;++l)i[l+96]=l.toString();m.prototype.bind=function(e,t,n){var r=this;return e=e instanceof Array?e:[e],r._bindMultiple.call(r,e,t,n),r},m.prototype.unbind=function(e,t){return this.bind.call(this,e,function(){},t)},m.prototype.trigger=function(e,t){var n=this;return n._directMap[e+":"+t]&&n._directMap[e+":"+t]({},e),n},m.prototype.reset=function(){var e=this;return e._callbacks={},e._directMap={},e},m.prototype.stopCallback=function(e,t){if((" "+t.className+" ").indexOf(" mousetrap ")>-1)return!1;
vendor: 4,172 bytes, line 2
2if(g(t,this.target))return!1;if("composedPath"in e&&"function"==typeof e.composedPath){var n=e.composedPath()[0];n!==e.target&&(t=n)}return"INPUT"==t.tagName||"SELECT"==t.tagName||"TEXTAREA"==t.tagName||t.isContentEditable},m.prototype.handleKey=function(){return this._handleKey.apply(this,arguments)},m.addKeycodes=function(e){for(var t in e)e.hasOwnProperty(t)&&(i[t]=e[t]);r=null},m.init=function(){var e=m(n);for(var t in e)"_"!==t.charAt(0)&&(m[t]=function(t){return function(){return e[t].apply(e,arguments)}}(t))},m.init(),e.Mousetrap=m,void 0!==t&&t.exports&&(t.exports=m),"function"==typeof define&&define.amd&&define(function(){return m})}function c(e,t,n){e.addEventListener?e.addEventListener(t,n,!1):e.attachEvent("on"+t,n)}function u(e){if("keypress"==e.type){var t=String.fromCharCode(e.which);return e.shiftKey||(t=t.toLowerCase()),t}return i[e.which]?i[e.which]:o[e.which]?o[e.which]:String.fromCharCode(e.which).toLowerCase()}function h(e,t){return e.sort().join(",")===t.sort().join(",")}function d(e){return"shift"==e||"ctrl"==e||"alt"==e||"meta"==e}function f(e,t,n){return n||(n=function(){if(!r)for(var e in r={},i)e>95&&e<112||i.hasOwnProperty(e)&&(r[i[e]]=e);return r}()[e]?"keydown":"keypress"),"keypress"==n&&t.length&&(n="keydown"),n}function p(e,t){var n,r,i,o=[];for(n=function(e){return"+"===e?["+"]:(e=e.replace(/\+{2}/g,"+plus")).split("+")}(e),i=0;i<n.length;++i)r=n[i],a[r]&&(r=a[r]),t&&"keypress"!=t&&s[r]&&(r=s[r],o.push("shift")),d(r)&&o.push(r);return{key:r,modifiers:o,action:t=f(r,o,t)}}function g(e,t){return null!==e&&e!==n&&(e===t||g(e.parentNode,t))}function m(e){var t=this;if(e=e||n,!(t instanceof m))return new m(e);t.target=e,t._callbacks={},t._directMap={};var r,i={},o=!1,s=!1,a=!1;function l(e){e=e||{};var t,n=!1;for(t in i)e[t]?n=!0:i[t]=0;n||(a=!1)}function f(e,n,r,o,s,a){var l,c,u=[],f=r.type;if(!t._callbacks[e])return[];for("keyup"==f&&d(e)&&(n=[e]),l=0;l<t._callbacks[e].length;++l)if(c=t._callbacks[e][l],(o||!c.seq||i[c.seq]==c.level)&&f==c.action&&("keypress"==f&&!r.metaKey&&!r.ctrlKey||h(n,c.modifiers))){var p=!o&&c.combo==s,g=o&&c.seq==o&&c.level==a;(p||g)&&t._callbacks[e].splice(l,1),u.push(c)}return u}function g(e,n,r,i){t.stopCallback(n,n.target||n.srcElement,r,i)||!1===e(n,r)&&(function(e){e.preventDefault?e.preventDefault():e.returnValue=!1}(n),function(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}(n))}function w(e){"number"!=typeof e.which&&(e.which=e.keyCode);var n=u(e);n&&("keyup"!=e.type||o!==n?t.handleKey(n,function(e){var t=[];return e.shiftKey&&t.push("shift"),e.altKey&&t.push("alt"),e.ctrlKey&&t.push("ctrl"),e.metaKey&&t.push("meta"),t}(e),e):o=!1)}function y(e,t,n,s){function c(t){return function(){a=t,++i[e],clearTimeout(r),r=setTimeout(l,1e3)}}function h(t){g(n,t,e),"keyup"!==s&&(o=u(t)),setTimeout(l,10)}i[e]=0;for(var d=0;d<t.length;++d){var f=d+1===t.length?h:c(s||p(t[d+1]).action);E(t[d],f,s,e,d)}}function E(e,n,r,i,o){t._directMap[e+":"+r]=n;var s,a=(e=e.replace(/\s+/g," ")).split(" ");a.length>1?y(e,a,n,r):(s=p(e,r),t._callbacks[s.key]=t._callbacks[s.key]||[],f(s.key,s.modifiers,{type:s.action},i,e,o),t._callbacks[s.key][i?"unshift":"push"]({callback:n,modifiers:s.modifiers,action:s.action,seq:i,level:o,combo:e}))}t._handleKey=function(e,t,n){var r,i=f(e,t,n),o={},c=0,u=!1;for(r=0;r<i.length;++r)i[r].seq&&(c=Math.max(c,i[r].level));for(r=0;r<i.length;++r)if(i[r].seq){if(i[r].level!=c)continue;u=!0,o[i[r].seq]=1,g(i[r].callback,n,i[r].combo,i[r].seq)}else u||g(i[r].callback,n,i[r].combo);var h="keypress"==n.type&&s;n.type!=a||d(e)||h||l(o),s=u&&"keydown"==n.type},t._bindMultiple=function(e,t,n){for(var r=0;r<e.length;++r)E(e[r],t,n)},c(e,"keypress",w),c(e,"keydown",w),c(e,"keyup",w)}}("undefined"!=typeof window?window:null,"undefined"!=typeof window?document:null)},()=>(tr||er((tr={exports:{}}).exports,tr),tr.exports)),ur=(e=>{return((e,t,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of ar(t))sr.call(e,r)||"default"===r||ir(e,r,{get:()=>t[r],enumerable:!(n=lr(t,r))||n.enumerable});return e})((t=ir(null!=e?rr(or(e)):{},"default",e&&e.__esModule&&"default"in e?{get:()=>e.default,enumerable:!0}:{value:e,enumerable:!0}
2),ir(t,"__esModule",{value:!0})),e);var t})(cr());!function(e){if(e){var t={},n=e.prototype.stopCallback;e.prototype.stopCallback=function(e,r,i,o){return!!this.paused||!t[i]&&!t[o]&&n.call(this,e,r,i)},e.prototype.bindGlobal=function(e,n,r){if(this.bind(e,n,r),e instanceof Array)for(var i=0;i<e.length;i++)t[e[i]]=!0;else t[e]=!0},e.init()}}("undefined"!=typeof Mousetrap?Mousetrap:void 0);var hr=()=>Array.from(document.querySelectorAll('[aria-modal="true"]')).find(e=>"none"!==window.getComputedStyle(e).display),dr=e=>{e.directive("mousetrap",(e,{modifiers:t,expression:n},{evaluate:r})=>{const i=()=>n?r(n):e.click();(t=t.map(e=>e.replace(/--/g," ").replace(/-/g,"+").replace(/\bslash\b/g,"/"))).includes("global")&&(t=t.filter(e=>"global"!==e),ur.default.bindGlobal(t,t=>{const n=hr();n&&!n.contains(e)||(t.preventDefault(),i())})),ur.default.bind(t,t=>{const n=hr();n&&!n.contains(e)||(t.preventDefault(),i())}),document.addEventListener("livewire:navigating",()=>{ur.default.unbind(t)},{once:!0})})};function fr(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",i=n.toStringTag||"@@toStringTag";function o(n,r,i,o){var l=r&&r.prototype instanceof a?r:a,c=Object.create(l.prototype);return pr(c,"_invoke",function(n,r,i){var o,a,l,c=0,u=i||[],h=!1,d={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(t,n){return o=t,a=0,l=e,d.n=n,s}};function f(n,r){for(a=n,l=r,t=0;!h&&c&&!i&&t<u.length;t++){var i,o=u[t],f=d.p,p=o[2];n>3?(i=p===r)&&(l=o[(a=o[4])?5:(a=3,3)],o[4]=o[5]=e):o[0]<=f&&((i=n<2&&f<o[1])?(a=0,d.v=r,d.n=o[1]):f<p&&(i=n<3||o[0]>r||r>p)&&(o[4]=n,o[5]=r,d.n=p,a=0))}if(i||n>1)return s;throw h=!0,r}return function(i,u,p){if(c>1)throw TypeError("Generator is already running");for(h&&1===u&&f(u,p),a=u,l=p;(t=a<2?e:l)||!h;){o||(a?a<3?(a>1&&(d.n=-1),f(a,l)):d.n=l:d.v=l);try{if(c=2,o){if(a||(i="next"),t=o[i]){if(!(t=t.call(o,l)))throw TypeError("iterator result is not an object");if(!t.done)return t;l=t.value,a<2&&(a=0)}else 1===a&&(t=o.return)&&t.call(o),a<2&&(l=TypeError("The iterator does not provide a '"+i+"' method"),a=1);o=e}else if((t=(h=d.n<0)?l:n.call(r,d))!==s)break}catch(t){o=e,a=1,l=t}finally{c=1}}return{value:t,done:h}}}(n,i,o),!0),c}var s={};function a(){}function l(){}function c(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(pr(t={},r,function(){return this}),t),h=c.prototype=a.prototype=Object.create(u);function d(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,pr(e,i,"GeneratorFunction")),e.prototype=Object.create(h),e}return l.prototype=c,pr(h,"constructor",c),pr(c,"constructor",l),l.displayName="GeneratorFunction",pr(c,i,"GeneratorFunction"),pr(h),pr(h,i,"Generator"),pr(h,r,function(){return this}),pr(h,"toString",function(){return"[object Generator]"}),(fr=function(){return{w:o,m:d}})()}function pr(e,t,n,r){var i=Object.defineProperty;try{i({},"",{})}catch(e){i=0}pr=function(e,t,n,r){function o(t,n){pr(e,t,function(e){return this._invoke(t,n,e)})}t?i?i(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(o("next",0),o("throw",1),o("return",2))},pr(e,t,n,r)}function gr(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return mr(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?mr(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,s=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){a=!0,o=e},f:function(){try{s||null==n.return||n.return()}finally{if(a)throw o}}}}function mr(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function wr(e,t,n,r,i,o,s){try{var a=e[o](s),l=a.value}catch(e){return void n(e)}a.done?t(l):Promise.resolve(l).then(r,i)}function yr(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function s(e){wr(o,r,i,s,a,"next",e)}function a(e){wr(o,r,i,s,a,"throw",e)}s(void 0)})}}function Er(e){return vr.apply(this,arguments)}function vr(){return(vr=yr(fr().m(function e(t){var n,i;return fr().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,Promise.all([r.e(510),r.e(979)]).then(r.bind(r,33));case 1:return n=e.v,i=n.default,e.a(2,i)}},e)}))).apply(this,arguments)}const Ar={mounted:function(){return yr(fr().m(function e(){var t,n;return fr().w(function(e){for(;;)switch(e.n){case 0:if(window.Swiper){e.n=2;break}return e.n=1,Er();case 1:if(window.Swiper=e.v,window.Swiper_waitlist){t=gr(window.Swiper_waitlist);try{for(t.s();!(n=t.n()).done;)(0,n.value)()}catch(e){t.e(e)}finally{t.f()}delete window.Swiper_waitlist}case 2:return e.a(2)}},e)}))()},beforeDestroy:function(){console.log("#log 9515 destroy Swiper"),delete window.Swiper,delete window.Swiper_waitlist}};function Cr(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",i=n.toStringTag||"@@toStringTag";function o(n,r,i,o){var l=r&&r.prototype instanceof a?r:a,c=Object.create(l.prototype);return br(c,"_invoke",function(n,r,i){var o,a,l,c=0,u=i||[],h=!1,d={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(t,n){return o=t,a=0,l=e,d.n=n,s}};function f(n,r){for(a=n,l=r,t=0;!h&&c&&!i&&t<u.length;t++){var i,o=u[t],f=d.p,p=o[2];n>3?(i=p===r)&&(l=o[(a=o[4])?5:(a=3,3)],o[4]=o[5]=e):o[0]<=f&&((i=n<2&&f<o[1])?(a=0,d.v=r,d.n=o[1]):f<p&&(i=n<3||o[0]>r||r>p)&&(o[4]=n,o[5]=r,d.n=p,a=0))}if(i||n>1)return s;throw h=!0,r}return function(i,u,p){if(c>1)throw TypeError("Generator is already running");for(h&&1===u&&f(u,p),a=u,l=p;(t=a<2?e:l)||!h;){o||(a?a<3?(a>1&&(d.n=-1),f(a,l)):d.n=l:d.v=l);try{if(c=2,o){if(a||(i="next"),t=o[i]){if(!(t=t.call(o,l)))throw TypeError("iterator result is not an object");
2if(!t.done)return t;l=t.value,a<2&&(a=0)}else 1===a&&(t=o.return)&&t.call(o),a<2&&(l=TypeError("The iterator does not provide a '"+i+"' method"),a=1);o=e}else if((t=(h=d.n<0)?l:n.call(r,d))!==s)break}catch(t){o=e,a=1,l=t}finally{c=1}}return{value:t,done:h}}}(n,i,o),!0),c}var s={};function a(){}function l(){}function c(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(br(t={},r,function(){return this}),t),h=c.prototype=a.prototype=Object.create(u);function d(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,br(e,i,"GeneratorFunction")),e.prototype=Object.create(h),e}return l.prototype=c,br(h,"constructor",c),br(c,"constructor",l),l.displayName="GeneratorFunction",br(c,i,"GeneratorFunction"),br(h),br(h,i,"Generator"),br(h,r,function(){return this}),br(h,"toString",function(){return"[object Generator]"}),(Cr=function(){return{w:o,m:d}})()}function br(e,t,n,r){var i=Object.defineProperty;try{i({},"",{})}catch(e){i=0}br=function(e,t,n,r){function o(t,n){br(e,t,function(e){return this._invoke(t,n,e)})}t?i?i(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(o("next",0),o("throw",1),o("return",2))},br(e,t,n,r)}function _r(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return Sr(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Sr(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,s=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){a=!0,o=e},f:function(){try{s||null==n.return||n.return()}finally{if(a)throw o}}}}function Sr(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Ir(e,t,n,r,i,o,s){try{var a=e[o](s),l=a.value}catch(e){return void n(e)}a.done?t(l):Promise.resolve(l).then(r,i)}function Tr(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function s(e){Ir(o,r,i,s,a,"next",e)}function a(e){Ir(o,r,i,s,a,"throw",e)}s(void 0)})}}function Dr(e){return Nr.apply(this,arguments)}function Nr(){return(Nr=Tr(Cr().m(function e(t){var n,i;return Cr().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,Promise.all([r.e(591),r.e(634)]).then(r.bind(r,395));case 1:return n=e.v,i=n.default,e.a(2,i)}},e)}))).apply(this,arguments)}const Or={mounted:function(){return Tr(Cr().m(function e(){var t,n;return Cr().w(function(e){for(;;)switch(e.n){case 0:if(window.Gsap){e.n=2;break}return e.n=1,Dr();case 1:if(window.Gsap=e.v,window.Gsap_waitlist){t=_r(window.Gsap_waitlist);try{for(t.s();!(n=t.n()).done;)(0,n.value)()}catch(e){t.e(e)}finally{t.f()}delete window.Gsap_waitlist}case 2:return e.a(2)}},e)}))()},beforeDestroy:function(){delete window.Gsap,delete window.Gsap_waitlist}};const Rr={mounted:function(){this._keydownHandler=function(e){if("Enter"===e.key){var t=e.target;if(t&&(!t.closest||!t.closest("[data-allow-enter-submit]"))){var n=(t.tagName||"").toUpperCase();if("TEXTAREA"!==n&&!t.isContentEditable&&"BUTTON"!==n&&"A"!==n){if("INPUT"===n){var r=(t.getAttribute("type")||"").toLowerCase();if("submit"===r||"button"===r)return}e.preventDefault(),e.stopPropagation()}}}},this.el.addEventListener("keydown",this._keydownHandler,!0)},destroyed:function(){this._keydownHandler&&(this.el.removeEventListener("keydown",this._keydownHandler,!0),this._keydownHandler=null)}};function Mr(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",i=n.toStringTag||"@@toStringTag";function o(n,r,i,o){var l=r&&r.prototype instanceof a?r:a,c=Object.create(l.prototype);return Pr(c,"_invoke",function(n,r,i){var o,a,l,c=0,u=i||[],h=!1,d={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(t,n){return o=t,a=0,l=e,d.n=n,s}};function f(n,r){for(a=n,l=r,t=0;!h&&c&&!i&&t<u.length;t++){var i,o=u[t],f=d.p,p=o[2];n>3?(i=p===r)&&(l=o[(a=o[4])?5:(a=3,3)],o[4]=o[5]=e):o[0]<=f&&((i=n<2&&f<o[1])?(a=0,d.v=r,d.n=o[1]):f<p&&(i=n<3||o[0]>r||r>p)&&(o[4]=n,o[5]=r,d.n=p,a=0))}if(i||n>1)return s;throw h=!0,r}return function(i,u,p){if(c>1)throw TypeError("Generator is already running");for(h&&1===u&&f(u,p),a=u,l=p;(t=a<2?e:l)||!h;){o||(a?a<3?(a>1&&(d.n=-1),f(a,l)):d.n=l:d.v=l);try{if(c=2,o){if(a||(i="next"),t=o[i]){if(!(t=t.call(o,l)))throw TypeError("iterator result is not an object");
2if(!t.done)return t;l=t.value,a<2&&(a=0)}else 1===a&&(t=o.return)&&t.call(o),a<2&&(l=TypeError("The iterator does not provide a '"+i+"' method"),a=1);o=e}else if((t=(h=d.n<0)?l:n.call(r,d))!==s)break}catch(t){o=e,a=1,l=t}finally{c=1}}return{value:t,done:h}}}(n,i,o),!0),c}var s={};function a(){}function l(){}function c(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(Pr(t={},r,function(){return this}),t),h=c.prototype=a.prototype=Object.create(u);function d(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,Pr(e,i,"GeneratorFunction")),e.prototype=Object.create(h),e}return l.prototype=c,Pr(h,"constructor",c),Pr(c,"constructor",l),l.displayName="GeneratorFunction",Pr(c,i,"GeneratorFunction"),Pr(h),Pr(h,i,"Generator"),Pr(h,r,function(){return this}),Pr(h,"toString",function(){return"[object Generator]"}),(Mr=function(){return{w:o,m:d}})()}function Pr(e,t,n,r){var i=Object.defineProperty;try{i({},"",{})}catch(e){i=0}Pr=function(e,t,n,r){function o(t,n){Pr(e,t,function(e){return this._invoke(t,n,e)})}t?i?i(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(o("next",0),o("throw",1),o("return",2))},Pr(e,t,n,r)}function kr(e,t,n,r,i,o,s){try{var a=e[o](s),l=a.value}catch(e){return void n(e)}a.done?t(l):Promise.resolve(l).then(r,i)}const xr={mounted:function(){this.initializeStripe()},initializeStripe:function(){var e=this,t=this.el.querySelector("#payment-form");if(t){var n=t.dataset.stripePublicKey,r=t.dataset.clientSecret,i=t.dataset.returnUrl||window.location.pathname+"?redirected_from_paymentprovider=stripe",o=new URL(i,window.location.origin).toString();if(n&&r){if("undefined"==typeof Stripe)return console.error("Stripe.js not loaded yet, retrying in 500ms..."),void setTimeout(function(){return e.initializeStripe()},500);try{var s=Stripe(n),a=s.elements({clientSecret:r});a.create("payment").mount("#payment-element"),t.addEventListener("submit",function(){var e,t=(e=Mr().m(function e(t){var n,r,i,l,c,u;return Mr().w(function(e){for(;;)switch(e.n){case 0:return t.preventDefault(),n=document.getElementById("submit-payment"),r=document.getElementById("button-text"),i=document.getElementById("spinner"),n.disabled=!0,r.classList.add("hidden"),i.classList.remove("hidden"),e.n=1,s.confirmPayment({elements:a,confirmParams:{return_url:o},redirect:"if_required"});case 1:if(!(l=e.v).error){e.n=2;break}return(c=document.getElementById("payment-message")).textContent=l.error.message,c.classList.remove("hidden"),n.disabled=!1,r.classList.remove("hidden"),i.classList.add("hidden"),e.a(2);case 2:l.paymentIntent&&l.paymentIntent.id&&(u=o.includes("?")?"&":"?",window.location="".concat(o).concat(u,"payment_intent=").concat(encodeURIComponent(l.paymentIntent.id)));case 3:return e.a(2)}},e)}),function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function s(e){kr(o,r,i,s,a,"next",e)}function a(e){kr(o,r,i,s,a,"throw",e)}s(void 0)})});return function(e){return t.apply(this,arguments)}}())}catch(e){console.error("Error initializing Stripe:",e)}}else console.error("Stripe: Missing publishable key or client secret")}else console.error("Stripe: Payment form not found")}};var Lr;!function(e){e[e.QR_CODE=0]="QR_CODE",e[e.AZTEC=1]="AZTEC",e[e.CODABAR=2]="CODABAR",e[e.CODE_39=3]="CODE_39",e[e.CODE_93=4]="CODE_93",e[e.CODE_128=5]="CODE_128",e[e.DATA_MATRIX=6]="DATA_MATRIX",e[e.MAXICODE=7]="MAXICODE",e[e.ITF=8]="ITF",e[e.EAN_13=9]="EAN_13",e[e.EAN_8=10]="EAN_8",e[e.PDF_417=11]="PDF_417",e[e.RSS_14=12]="RSS_14",e[e.RSS_EXPANDED=13]="RSS_EXPANDED",e[e.UPC_A=14]="UPC_A",e[e.UPC_E=15]="UPC_E",e[e.UPC_EAN_EXTENSION=16]="UPC_EAN_EXTENSION"}(Lr||(Lr={}));var Br,Fr,Ur=new Map([[Lr.QR_CODE,"QR_CODE"],[Lr.AZTEC,"AZTEC"],[Lr.CODABAR,"CODABAR"],[Lr.CODE_39,"CODE_39"],[Lr.CODE_93,"CODE_93"],[Lr.CODE_128,"CODE_128"],[Lr.DATA_MATRIX,"DATA_MATRIX"],[Lr.MAXICODE,"MAXICODE"],[Lr.ITF,"ITF"],[Lr.EAN_13,"EAN_13"],[Lr.EAN_8,"EAN_8"],[Lr.PDF_417,"PDF_417"],[Lr.RSS_14,"RSS_14"],[Lr.RSS_EXPANDED,"RSS_EXPANDED"],[Lr.UPC_A,"UPC_A"],[Lr.UPC_E,"UPC_E"],[Lr.UPC_EAN_EXTENSION,"UPC_EAN_EXTENSION"]]);function jr(e){return Object.values(Lr).includes(e)}!function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.URL=1]="URL"}(Br||(Br={})),function(e){e[e.SCAN_TYPE_CAMERA=0]="SCAN_TYPE_CAMERA",e[e.SCAN_TYPE_FILE=1]="SCAN_TYPE_FILE"}(Fr||(Fr={}));var Hr,Vr=function(){function e(){}return e.GITHUB_PROJECT_URL="https://github.com/mebjas/html5-qrcode",e.SCAN_DEFAULT_FPS=2,e.DEFAULT_DISABLE_FLIP=!1,e.DEFAULT_REMEMBER_LAST_CAMERA_USED=!0,e.DEFAULT_SUPPORTED_SCAN_TYPE=[Fr.SCAN_TYPE_CAMERA,Fr.SCAN_TYPE_FILE],e}(),zr=function(){function e(e,t){this.format=e,this.formatName=t}return e.prototype.toString=function(){return this.formatName},e.create=function(t){if(!Ur.has(t))throw"".concat(t," not in html5QrcodeSupportedFormatsTextMap");return new e(t,Ur.get(t))},e}(),Gr=function(){function e(){}return e.createFromText=function(e){return{decodedText:e,result:{text:e}}},e.createFromQrcodeResult=function(e){return{decodedText:e.text,result:e}},e}();!function(e){e[e.UNKWOWN_ERROR=0]="UNKWOWN_ERROR",e[e.IMPLEMENTATION_ERROR=1]="IMPLEMENTATION_ERROR",e[e.NO_CODE_FOUND_ERROR=2]="NO_CODE_FOUND_ERROR"}(Hr||(Hr={}));var Wr=function(){function e(){}return e.createFrom=function(e){return{errorMessage:e,type:Hr.UNKWOWN_ERROR}},e}(),Yr=function(){function e(e){this.verbose=e}return e.prototype.log=function(e){this.verbose&&console.log(e)},e.prototype.warn=function(e){this.verbose&&console.warn(e)},e.prototype.logError=function(e,t){(this.verbose||!0===t)&&console.error(e)},e.prototype.logErrors=function(e){if(0===e.length)throw"Logger#logError called without arguments";this.verbose&&console.error(e)},e}();function Xr(e){return null==e}var $r,qr,Zr=function(){function e(){}return e.codeParseError=function(e){return"QR code parse error, error = ".concat(e)},e.errorGettingUserMedia=function(e){return"Error getting userMedia, error = ".concat(e)},e.onlyDeviceSupportedError=function(){return"The device doesn't support navigator.mediaDevices , only supported cameraIdOrConfig in this case is deviceId parameter (string)."},e.cameraStreamingNotSupported=function(){return"Camera streaming not supported by the browser."},e.unableToQuerySupportedDevices=function(){return"Unable to query supported devices, unknown error."},e.insecureContextCameraQueryError=function(){return"Camera access is only supported in secure context like https or localhost."},e.scannerPaused=function(){return"Scanner paused"},e}(),Qr=function(){function e(){}return e.scanningStatus=function(){return"Scanning"},e.idleStatus=function(){return"Idle"},e.errorStatus=function(){return"Error"},e.permissionStatus=function(){return"Permission"},e.noCameraFoundErrorStatus=function(){return"No Cameras"},e.lastMatch=function(e){return"Last Match: ".concat(e)},e.codeScannerTitle=function(){return"Code Scanner"},e.cameraPermissionTitle=function(){return"Request Camera Permissions"},e.cameraPermissionRequesting=function(){return"Requesting camera permissions..."},e.noCameraFound=function(){return"No camera found"},e.scanButtonStopScanningText=function(){return"Stop Scanning"}
vendor: 14,218 bytes, line 2
2,e.scanButtonStartScanningText=function(){return"Start Scanning"},e.torchOnButton=function(){return"Switch On Torch"},e.torchOffButton=function(){return"Switch Off Torch"},e.torchOnFailedMessage=function(){return"Failed to turn on torch"},e.torchOffFailedMessage=function(){return"Failed to turn off torch"},e.scanButtonScanningStarting=function(){return"Launching Camera..."},e.textIfCameraScanSelected=function(){return"Scan an Image File"},e.textIfFileScanSelected=function(){return"Scan using camera directly"},e.selectCamera=function(){return"Select Camera"},e.fileSelectionChooseImage=function(){return"Choose Image"},e.fileSelectionChooseAnother=function(){return"Choose Another"},e.fileSelectionNoImageSelected=function(){return"No image choosen"},e.anonymousCameraPrefix=function(){return"Anonymous Camera"},e.dragAndDropMessage=function(){return"Or drop an image to scan"},e.dragAndDropMessageOnlyImages=function(){return"Or drop an image to scan (other files not supported)"},e.zoom=function(){return"zoom"},e.loadingImage=function(){return"Loading image..."},e.cameraScanAltText=function(){return"Camera based scan"},e.fileScanAltText=function(){return"Fule based scan"},e}(),Kr=function(){function e(){}return e.poweredBy=function(){return"Powered by "},e.reportIssues=function(){return"Report issues"},e}(),Jr=function(){function e(){}return e.isMediaStreamConstraintsValid=function(e,t){if("object"!=typeof e){var n=typeof e;return t.logError("videoConstraints should be of type object, the "+"object passed is of type ".concat(n,"."),!0),!1}for(var r=new Set(["autoGainControl","channelCount","echoCancellation","latency","noiseSuppression","sampleRate","sampleSize","volume"]),i=0,o=Object.keys(e);i<o.length;i++){var s=o[i];if(r.has(s))return t.logError("".concat(s," is not supported videoConstaints."),!0),!1}return!0},e}(),ei=r(97),ti=function(){function e(e,t,n){if(this.formatMap=new Map([[Lr.QR_CODE,ei.BarcodeFormat.QR_CODE],[Lr.AZTEC,ei.BarcodeFormat.AZTEC],[Lr.CODABAR,ei.BarcodeFormat.CODABAR],[Lr.CODE_39,ei.BarcodeFormat.CODE_39],[Lr.CODE_93,ei.BarcodeFormat.CODE_93],[Lr.CODE_128,ei.BarcodeFormat.CODE_128],[Lr.DATA_MATRIX,ei.BarcodeFormat.DATA_MATRIX],[Lr.MAXICODE,ei.BarcodeFormat.MAXICODE],[Lr.ITF,ei.BarcodeFormat.ITF],[Lr.EAN_13,ei.BarcodeFormat.EAN_13],[Lr.EAN_8,ei.BarcodeFormat.EAN_8],[Lr.PDF_417,ei.BarcodeFormat.PDF_417],[Lr.RSS_14,ei.BarcodeFormat.RSS_14],[Lr.RSS_EXPANDED,ei.BarcodeFormat.RSS_EXPANDED],[Lr.UPC_A,ei.BarcodeFormat.UPC_A],[Lr.UPC_E,ei.BarcodeFormat.UPC_E],[Lr.UPC_EAN_EXTENSION,ei.BarcodeFormat.UPC_EAN_EXTENSION]]),this.reverseFormatMap=this.createReverseFormatMap(),!ei)throw"Use html5qrcode.min.js without edit, ZXing not found.";this.verbose=t,this.logger=n;var r=this.createZXingFormats(e),i=new Map;i.set(ei.DecodeHintType.POSSIBLE_FORMATS,r),i.set(ei.DecodeHintType.TRY_HARDER,!1),this.hints=i}return e.prototype.decodeAsync=function(e){var t=this;return new Promise(function(n,r){try{n(t.decode(e))}catch(e){r(e)}})},e.prototype.decode=function(e){var t=new ei.MultiFormatReader(this.verbose,this.hints),n=new ei.HTMLCanvasElementLuminanceSource(e),r=new ei.BinaryBitmap(new ei.HybridBinarizer(n)),i=t.decode(r);return{text:i.text,format:zr.create(this.toHtml5QrcodeSupportedFormats(i.format)),debugData:this.createDebugData()}},e.prototype.createReverseFormatMap=function(){var e=new Map;return this.formatMap.forEach(function(t,n,r){e.set(t,n)}),e},e.prototype.toHtml5QrcodeSupportedFormats=function(e){if(!this.reverseFormatMap.has(e))throw"reverseFormatMap doesn't have ".concat(e);return this.reverseFormatMap.get(e)},e.prototype.createZXingFormats=function(e){for(var t=[],n=0,r=e;n<r.length;n++){var i=r[n];this.formatMap.has(i)?t.push(this.formatMap.get(i)):this.logger.logError("".concat(i," is not supported by")+"ZXingHtml5QrcodeShim")}return t},e.prototype.createDebugData=function(){return{decoderName:"zxing-js"}},e}(),ni=function(e,t,n,r){return new(n||(n=Promise))(function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}l((r=r.apply(e,t||[])).next())})},ri=function(e,t){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(a){return function(l){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,a[0]&&(s=0)),s;)try{if(n=1,r&&(i=2&a[0]?r.return:a[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,a[1])).done)return i;switch(r=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,r=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!(i=s.trys,(i=i.length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){s.label=a[1];break}if(6===a[0]&&s.label<i[1]){s.label=i[1],i=a;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(a);break}i[2]&&s.ops.pop(),s.trys.pop();continue}a=t.call(e,s)}catch(e){a=[6,e],r=0}finally{n=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,l])}}},ii=function(){function e(t,n,r){if(this.formatMap=new Map([[Lr.QR_CODE,"qr_code"],[Lr.AZTEC,"aztec"],[Lr.CODABAR,"codabar"],[Lr.CODE_39,"code_39"],[Lr.CODE_93,"code_93"],[Lr.CODE_128,"code_128"],[Lr.DATA_MATRIX,"data_matrix"],[Lr.ITF,"itf"],[Lr.EAN_13,"ean_13"],[Lr.EAN_8,"ean_8"],[Lr.PDF_417,"pdf417"],[Lr.UPC_A,"upc_a"],[Lr.UPC_E,"upc_e"]]),this.reverseFormatMap=this.createReverseFormatMap(),!e.isSupported())throw"Use html5qrcode.min.js without edit, Use BarcodeDetectorDelegate only if it isSupported();";this.verbose=n,this.logger=r;var i=this.createBarcodeDetectorFormats(t);if(this.detector=new BarcodeDetector(i),!this.detector)throw"BarcodeDetector detector not supported"}return e.isSupported=function(){return"BarcodeDetector"in window&&void 0!==new BarcodeDetector({formats:["qr_code"]})},e.prototype.decodeAsync=function(e){return ni(this,void 0,void 0,function(){var t,n;return ri(this,function(r){switch(r.label){case 0:return[4,this.detector.detect(e)];case 1:if(!(t=r.sent())||0===t.length)throw"No barcode or QR code detected.";return[2,{text:(n=this.selectLargestBarcode(t)).rawValue,format:zr.create(this.toHtml5QrcodeSupportedFormats(n.format)),debugData:this.createDebugData()}]}})})},e.prototype.selectLargestBarcode=function(e){for(var t=null,n=0,r=0,i=e;r<i.length;r++){var o=i[r],s=o.boundingBox.width*o.boundingBox.height;s>n&&(n=s,t=o)}if(!t)throw"No largest barcode found";return t},e.prototype.createBarcodeDetectorFormats=function(e){for(var t=[],n=0,r=e;n<r.length;n++){var i=r[n];this.formatMap.has(i)?t.push(this.formatMap.get(i)):this.logger.warn("".concat(i," is not supported by")+"BarcodeDetectorDelegate")}return{formats:t}},e.prototype.toHtml5QrcodeSupportedFormats=function(e){if(!this.reverseFormatMap.has(e))throw"reverseFormatMap doesn't have ".concat(e);return this.reverseFormatMap.get(e)},e.prototype.createReverseFormatMap=function(){var e=new Map;return this.formatMap.forEach(function(t,n,r){e.set(t,n)}),e},e.prototype.createDebugData=function(){return{decoderName:"BarcodeDetector"}},e}(),oi=function(e,t,n,r){return new(n||(n=Promise))(function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}l((r=r.apply(e,t||[])).next())})},si=function(e,t){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(a){return function(l){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,a[0]&&(s=0)),s;)try{if(n=1,r&&(i=2&a[0]?r.return:a[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,a[1])).done)return i;switch(r=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,r=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!(i=s.trys,(i=i.length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){s.label=a[1];break}if(6===a[0]&&s.label<i[1]){s.label=i[1],i=a;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(a);break}i[2]&&s.ops.pop(),s.trys.pop();continue}a=t.call(e,s)}catch(e){a=[6,e],r=0}finally{n=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,l])}}},ai=function(){function e(e,t,n,r){this.EXECUTIONS_TO_REPORT_PERFORMANCE=100,this.executions=0,this.executionResults=[],this.wasPrimaryDecoderUsedInLastDecode=!1,this.verbose=n,t&&ii.isSupported()?(this.primaryDecoder=new ii(e,n,r),this.secondaryDecoder=new ti(e,n,r)):this.primaryDecoder=new ti(e,n,r)}return e.prototype.decodeAsync=function(e){return oi(this,void 0,void 0,function(){var t;return si(this,function(n){switch(n.label){case 0:t=performance.now(),n.label=1;case 1:return n.trys.push([1,,3,4]),[4,this.getDecoder().decodeAsync(e)];case 2:return[2,n.sent()];case 3:return this.possiblyLogPerformance(t),[7];case 4:return[2]}})})},e.prototype.decodeRobustlyAsync=function(e){return oi(this,void 0,void 0,function(){var t,n;return si(this,function(r){switch(r.label){case 0:t=performance.now(),r.label=1;case 1:return r.trys.push([1,3,4,5]),[4,this.primaryDecoder.decodeAsync(e)];case 2:return[2,r.sent()];case 3:if(n=r.sent(),this.secondaryDecoder)return[2,this.secondaryDecoder.decodeAsync(e)];throw n;case 4:return this.possiblyLogPerformance(t),[7];case 5:return[2]}})})},e.prototype.getDecoder=function(){return this.secondaryDecoder?!1===this.wasPrimaryDecoderUsedInLastDecode?(this.wasPrimaryDecoderUsedInLastDecode=!0,this.primaryDecoder):(this.wasPrimaryDecoderUsedInLastDecode=!1,this.secondaryDecoder):this.primaryDecoder},e.prototype.possiblyLogPerformance=function(e){if(this.verbose){var t=performance.now()-e;this.executionResults.push(t),this.executions++,this.possiblyFlushPerformanceReport()}},e.prototype.possiblyFlushPerformanceReport=function(){if(!(this.executions<this.EXECUTIONS_TO_REPORT_PERFORMANCE)){for(var e=0,t=0,n=this.executionResults;t<n.length;t++){e+=n[t]}var r=e/this.executionResults.length;console.log("".concat(r," ms for ").concat(this.executionResults.length," last runs.")),this.executions=0,this.executionResults=[]}},e}(),li=($r=function(e,t){return $r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},$r(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}$r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),ci=function(e,t,n,r){return new(n||(n=Promise))(function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}l((r=r.apply(e,t||[])).next())})},ui=function(e,t){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(a){return function(l){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,a[0]&&(s=0)),s;)try{if(n=1,r&&(i=2&a[0]?r.return:a[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,a[1])).done)return i;switch(r=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,r=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!(i=s.trys,(i=i.length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){s.label=a[1];break}if(6===a[0]&&s.label<i[1]){s.label=i[1],i=a;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(a);break}i[2]&&s.ops.pop(),s.trys.pop();continue}a=t.call(e,s)}catch(e){a=[6,e],r=0}finally{n=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,l])}}},hi=function(){function e(e,t){this.name=e,this.track=t}return e.prototype.isSupported=function(){return!!this.track.getCapabilities&&this.name in this.track.getCapabilities()},e.prototype.apply=function(e){var t={};t[this.name]=e;var n={advanced:[t]};return this.track.applyConstraints(n)},e.prototype.value=function(){var e=this.track.getSettings();return this.name in e?e[this.name]:null},e}(),di=function(e){function t(t,n){return e.call(this,t,n)||this}return li(t,e),t.prototype.min=function(){return this.getCapabilities().min},t.prototype.max=function(){return this.getCapabilities().max},t.prototype.step=function(){return this.getCapabilities().step},t.prototype.apply=function(e){var t={};t[this.name]=e;var n={advanced:[t]};return this.track.applyConstraints(n)},t.prototype.getCapabilities=function(){this.failIfNotSupported();var e=this.track.getCapabilities()[this.name];return{min:e.min,max:e.max,step:e.step}},t.prototype.failIfNotSupported=function(){if(!this.isSupported())throw new Error("".concat(this.name," capability not supported"))},t}(hi),fi=function(e){function t(t){return e.call(this,"zoom",t)||this}return li(t,e),t}(di),pi=function(e){function t(t){return e.call(this,"torch",t)||this}return li(t,e),t}(hi),gi=function(){function e(e){this.track=e}return e.prototype.zoomFeature=function(){return new fi(this.track)},e.prototype.torchFeature=function(){return new pi(this.track)},e}(),mi=function(){function e(e,t,n){this.isClosed=!1,this.parentElement=e,this.mediaStream=t,this.callbacks=n,this.surface=this.createVideoElement(this.parentElement.clientWidth),e.append(this.surface)}return e.prototype.createVideoElement=function(e){var t=document.createElement("video");return t.style.width="".concat(e,"px"),t.style.display="block",t.muted=!0,t.setAttribute("muted","true"),t.playsInl
2ine=!0,t},e.prototype.setupSurface=function(){var e=this;this.surface.onabort=function(){throw"RenderedCameraImpl video surface onabort() called"},this.surface.onerror=function(){throw"RenderedCameraImpl video surface onerror() called"};var t=function(){var n=e.surface.clientWidth,r=e.surface.clientHeight;e.callbacks.onRenderSurfaceReady(n,r),e.surface.removeEventListener("playing",t)};this.surface.addEventListener("playing",t),this.surface.srcObject=this.mediaStream,this.surface.play()},e.create=function(t,n,r,i){return ci(this,void 0,void 0,function(){var o,s;return ui(this,function(a){switch(a.label){case 0:return o=new e(t,n,i),r.aspectRatio?(s={aspectRatio:r.aspectRatio},[4,o.getFirstTrackOrFail().applyConstraints(s)]):[3,2];case 1:a.sent(),a.label=2;case 2:return o.setupSurface(),[2,o]}})})},e.prototype.failIfClosed=function(){if(this.isClosed)throw"The RenderedCamera has already been closed."},e.prototype.getFirstTrackOrFail=function(){if(this.failIfClosed(),0===this.mediaStream.getVideoTracks().length)throw"No video tracks found";return this.mediaStream.getVideoTracks()[0]},e.prototype.pause=function(){this.failIfClosed(),this.surface.pause()},e.prototype.resume=function(e){this.failIfClosed();var t=this,n=function(){setTimeout(e,200),t.surface.removeEventListener("playing",n)};this.surface.addEventListener("playing",n),this.surface.play()},e.prototype.isPaused=function(){return this.failIfClosed(),this.surface.paused},e.prototype.getSurface=function(){return this.failIfClosed(),this.surface},e.prototype.getRunningTrackCapabilities=function(){return this.getFirstTrackOrFail().getCapabilities()},e.prototype.getRunningTrackSettings=function(){return this.getFirstTrackOrFail().getSettings()},e.prototype.applyVideoConstraints=function(e){return ci(this,void 0,void 0,function(){return ui(this,function(t){if("aspectRatio"in e)throw"Changing 'aspectRatio' in run-time is not yet supported.";return[2,this.getFirstTrackOrFail().applyConstraints(e)]})})},e.prototype.close=function(){if(this.isClosed)return Promise.resolve();var e=this;return new Promise(function(t,n){var r=e.mediaStream.getVideoTracks().length,i=0;e.mediaStream.getVideoTracks().forEach(function(n){e.mediaStream.removeTrack(n),n.stop(),++i>=r&&(e.isClosed=!0,e.parentElement.removeChild(e.surface),t())})})},e.prototype.getCapabilities=function(){return new gi(this.getFirstTrackOrFail())},e}(),wi=function(){function e(e){this.mediaStream=e}return e.prototype.render=function(e,t,n){return ci(this,void 0,void 0,function(){return ui(this,function(r){return[2,mi.create(e,this.mediaStream,t,n)]})})},e.create=function(t){return ci(this,void 0,void 0,function(){var n;return ui(this,function(r){switch(r.label){case 0:if(!navigator.mediaDevices)throw"navigator.mediaDevices not supported";return n={audio:!1,video:t},[4,navigator.mediaDevices.getUserMedia(n)];case 1:return[2,new e(r.sent())]}})})},e}(),yi=function(e,t,n,r){return new(n||(n=Promise))(function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}l((r=r.apply(e,t||[])).next())})},Ei=function(e,t){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(a){return function(l){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,a[0]&&(s=0)),s;)try{if(n=1,r&&(i=2&a[0]?r.return:a[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,a[1])).done)return i;switch(r=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,r=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!(i=s.trys,(i=i.length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){s.label=a[1];break}if(6===a[0]&&s.label<i[1]){s.label=i[1],i=a;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(a);break}i[2]&&s.ops.pop(),s.trys.pop();continue}a=t.call(e,s)}catch(e){a=[6,e],r=0}finally{n=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,l])}}},vi=function(){function e(){}return e.failIfNotSupported=function(){return yi(this,void 0,void 0,function(){return Ei(this,function(t){if(!navigator.mediaDevices)throw"navigator.mediaDevices not supported";return[2,new e]})})},e.prototype.create=function(e){return yi(this,void 0,void 0,function(){return Ei(this,function(t){return[2,wi.create(e)]})})},e}
vendor: 7,597 bytes, line 2
2(),Ai=function(e,t,n,r){return new(n||(n=Promise))(function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}l((r=r.apply(e,t||[])).next())})},Ci=function(e,t){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(a){return function(l){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,a[0]&&(s=0)),s;)try{if(n=1,r&&(i=2&a[0]?r.return:a[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,a[1])).done)return i;switch(r=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,r=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!(i=s.trys,(i=i.length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){s.label=a[1];break}if(6===a[0]&&s.label<i[1]){s.label=i[1],i=a;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(a);break}i[2]&&s.ops.pop(),s.trys.pop();continue}a=t.call(e,s)}catch(e){a=[6,e],r=0}finally{n=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,l])}}},bi=function(){function e(){}return e.retrieve=function(){if(navigator.mediaDevices)return e.getCamerasFromMediaDevices();var t=MediaStreamTrack;return MediaStreamTrack&&t.getSources?e.getCamerasFromMediaStreamTrack():e.rejectWithError()},e.rejectWithError=function(){var t=Zr.unableToQuerySupportedDevices();return e.isHttpsOrLocalhost()||(t=Zr.insecureContextCameraQueryError()),Promise.reject(t)},e.isHttpsOrLocalhost=function(){if("https:"===location.protocol)return!0;var e=location.host.split(":")[0];return"127.0.0.1"===e||"localhost"===e},e.getCamerasFromMediaDevices=function(){return Ai(this,void 0,void 0,function(){var e,t,n,r,i,o,s;return Ci(this,function(a){switch(a.label){case 0:return e=function(e){for(var t=0,n=e.getVideoTracks();t<n.length;t++){var r=n[t];r.enabled=!1,r.stop(),e.removeTrack(r)}},[4,navigator.mediaDevices.getUserMedia({audio:!1,video:!0})];case 1:return t=a.sent(),[4,navigator.mediaDevices.enumerateDevices()];case 2:for(n=a.sent(),r=[],i=0,o=n;i<o.length;i++)"videoinput"===(s=o[i]).kind&&r.push({id:s.deviceId,label:s.label});return e(t),[2,r]}})})},e.getCamerasFromMediaStreamTrack=function(){return new Promise(function(e,t){MediaStreamTrack.getSources(function(t){for(var n=[],r=0,i=t;r<i.length;r++){var o=i[r];"video"===o.kind&&n.push({id:o.id,label:o.label})}e(n)})})},e}();!function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.NOT_STARTED=1]="NOT_STARTED",e[e.SCANNING=2]="SCANNING",e[e.PAUSED=3]="PAUSED"}(qr||(qr={}));var _i,Si=function(){function e(){this.state=qr.NOT_STARTED,this.onGoingTransactionNewState=qr.UNKNOWN}return e.prototype.directTransition=function(e){this.failIfTransitionOngoing(),this.validateTransition(e),this.state=e},e.prototype.startTransition=function(e){return this.failIfTransitionOngoing(),this.validateTransition(e),this.onGoingTransactionNewState=e,this},e.prototype.execute=function(){if(this.onGoingTransactionNewState===qr.UNKNOWN)throw"Transaction is already cancelled, cannot execute().";var e=this.onGoingTransactionNewState;this.onGoingTransactionNewState=qr.UNKNOWN,this.directTransition(e)},e.prototype.cancel=function(){if(this.onGoingTransactionNewState===qr.UNKNOWN)throw"Transaction is already cancelled, cannot cancel().";this.onGoingTransactionNewState=qr.UNKNOWN},e.prototype.getState=function(){return this.state},e.prototype.failIfTransitionOngoing=function(){if(this.onGoingTransactionNewState!==qr.UNKNOWN)throw"Cannot transition to a new state, already under transition"},e.prototype.validateTransition=function(e){switch(this.state){case qr.UNKNOWN:throw"Transition from unknown is not allowed";case qr.NOT_STARTED:this.failIfNewStateIs(e,[qr.PAUSED]);case qr.SCANNING:case qr.PAUSED:}},e.prototype.failIfNewStateIs=function(e,t){for(var n=0,r=t;n<r.length;n++){if(e===r[n])throw"Cannot transition from ".concat(this.state," to ").concat(e)}},e}(),Ii=function(){function e(e){this.stateManager=e}return e.prototype.startTransition=function(e){return this.stateManager.startTransition(e)},e.prototype.directTransition=function(e){this.stateManager.directTransition(e)},e.prototype.getState=function(){return this.stateManager.getState()},e.prototype.canScanFile=function(){return this.stateManager.getState()===qr.NOT_STARTED},e.prototype.isScanning=function(){return this.stateManager.getState()!==qr.NOT_STARTED},e.prototype.isStrictlyScanning=function(){return this.stateManager.getState()===qr.SCANNING},e.prototype.isPaused=function(){return this.stateManager.getState()===qr.PAUSED},e}(),Ti=function(){function e(){}return e.create=function(){return new Ii(new Si)},e}(),Di=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Ni=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Di(t,e),t.DEFAULT_WIDTH=300,t.DEFAULT_WIDTH_OFFSET=2,t.FILE_SCAN_MIN_HEIGHT=300,t.FILE_SCAN_HIDDEN_CANVAS_PADDING=100,t.MIN_QR_BOX_SIZE=50,t.SHADED_LEFT=1,t.SHADED_RIGHT=2,t.SHADED_TOP=3,t.SHADED_BOTTOM=4,t.SHADED_REGION_ELEMENT_ID="qr-shaded-region",t.VERBOSE=!1,t.BORDER_SHADER_DEFAULT_COLOR="#ffffff",t.BORDER_SHADER_MATCH_COLOR="rgb(90, 193, 56)",t}(Vr),Oi=function(){function e(e,t){this.logger=t,this.fps=Ni.SCAN_DEFAULT_FPS,e?(e.fps&&(this.fps=e.fps),this.disableFlip=!0===e.disableFlip,this.qrbox=e.qrbox,this.aspectRatio=e.aspectRatio,this.videoConstraints=e.videoConstraints):this.disableFlip=Ni.DEFAULT_DISABLE_FLIP}return e.prototype.isMediaStreamConstraintsValid=function(){return this.videoConstraints?Jr.isMediaStreamConstraintsValid(this.videoConstraints,this.logger):(this.logger.logError("Empty videoConstraints",!0),!1)},e.prototype.isShadedBoxEnabled=function(){return!Xr(this.qrbox)},e.create=function(t,n){return new e(t,n)},e}(),Ri=function(){function e(e,t){if(this.element=null,this.canvasElement=null,this.scannerPausedUiElement=null,this.hasBorderShaders=null,this.borderShaders=null,this.qrMatch=null,this.renderedCamera=null,this.qrRegion=null,this.context=null,this.lastScanImageFile=null,this.isScanning=!1,!document.getElementById(e))throw"HTML Element with id=".concat(e," not found");var n;this.elementId=e,this.verbose=!1,"boolean"==typeof t?this.verbose=!0===t:t&&(n=t,this.verbose=!0===n.verbose,n.experimentalFeatures),this.logger=new Yr(this.verbose),this.qrcode=new ai(this.getSupportedFormats(t),this.getUseBarCodeDetectorIfSupported(n),this.verbose,this.logger),this.foreverScanTimeout,this.shouldScan=!0,this.stateManagerProxy=Ti.create()}return e.prototype.start=function(e,t,n,r){var i,o=this;if(!e)throw"cameraIdOrConfig is required";if(!n||"function"!=typeof n)throw"qrCodeSuccessCallback is required and should be a function.";i=r||(this.verbose?this.logger.log:function(){});var s=Oi.create(t,this.logger);this.clearElement();var a=!1;s.videoConstraints&&(s.isMediaStreamConstraintsValid()?a=!0:this.logger.logError("'videoConstraints' is not val
2id 'MediaStreamConstraints, it will be ignored.'",!0));var l=a,c=document.getElementById(this.elementId);c.clientWidth?c.clientWidth:Ni.DEFAULT_WIDTH;c.style.position="relative",this.shouldScan=!0,this.element=c;var u=this,h=this.stateManagerProxy.startTransition(qr.SCANNING);return new Promise(function(t,r){var a=l?s.videoConstraints:u.createVideoConstraints(e);if(!a)return h.cancel(),void r("videoConstraints should be defined");var c={};l&&!s.aspectRatio||(c.aspectRatio=s.aspectRatio);var d={onRenderSurfaceReady:function(e,t){u.setupUi(e,t,s),u.isScanning=!0,u.foreverScan(s,n,i)}};vi.failIfNotSupported().then(function(e){e.create(a).then(function(e){return e.render(o.element,c,d).then(function(e){u.renderedCamera=e,h.execute(),t(null)}).catch(function(e){h.cancel(),r(e)})}).catch(function(e){h.cancel(),r(Zr.errorGettingUserMedia(e))})}).catch(function(e){h.cancel(),r(Zr.cameraStreamingNotSupported())})})},e.prototype.pause=function(e){if(!this.stateManagerProxy.isStrictlyScanning())throw"Cannot pause, scanner is not scanning.";this.stateManagerProxy.directTransition(qr.PAUSED),this.showPausedState(),(Xr(e)||!0!==e)&&(e=!1),e&&this.renderedCamera&&this.renderedCamera.pause()},e.prototype.resume=function(){if(!this.stateManagerProxy.isPaused())throw"Cannot result, scanner is not paused.";if(!this.renderedCamera)throw"renderedCamera doesn't exist while trying resume()";var e=this,t=function(){e.stateManagerProxy.directTransition(qr.SCANNING),e.hidePausedState()};this.renderedCamera.isPaused()?this.renderedCamera.resume(function(){t()}):t()},e.prototype.getState=function(){return this.stateManagerProxy.getState()},e.prototype.stop=function(){var e=this;if(!this.stateManagerProxy.isScanning())throw"Cannot stop, scanner is not running or paused.";var t=this.stateManagerProxy.startTransition(qr.NOT_STARTED);this.shouldScan=!1,this.foreverScanTimeout&&clearTimeout(this.foreverScanTimeout);var n=this;return this.renderedCamera.close().then(function(){return n.renderedCamera=null,n.element&&(n.element.removeChild(n.canvasElement),n.canvasElement=null),function(){if(e.element){var t=document.getElementById(Ni.SHADED_REGION_ELEMENT_ID);t&&e.element.removeChild(t)}}(),n.qrRegion&&(n.qrRegion=null),n.context&&(n.context=null),t.execute(),n.hidePausedState(),n.isScanning=!1,Promise.resolve()})},e.prototype.scanFile=function(e,t){return this.scanFileV2(e,t).then(function(e){return e.decodedText})},e.prototype.scanFileV2=function(e,t){var n=this;if(!(e&&e instanceof File))throw"imageFile argument is mandatory and should be instance of File. Use 'event.target.files[0]'.";if(Xr(t)&&(t=!0),!this.stateManagerProxy.canScanFile())throw"Cannot start file scan - ongoing camera scan";return new Promise(function(r,i){n.possiblyCloseLastScanImageFile(),n.clearElement(),n.lastScanImageFile=URL.createObjectURL(e);var o=new Image;o.onload=function(){var e=o.width,s=o.height,a=document.getElementById(n.elementId),l=a.clientWidth?a.clientWidth:Ni.DEFAULT_WIDTH,c=Math.max(a.clientHeight?a.clientHeight:s,Ni.FILE_SCAN_MIN_HEIGHT),u=n.computeCanvasDrawConfig(e,s,l,c);if(t){var h=n.createCanvasElement(l,c,"qr-canvas-visible");h.style.display="inline-block",a.appendChild(h);var d=h.getContext("2d");if(!d)throw"Unable to get 2d context from canvas";d.canvas.width=l,d.canvas.height=c,d.drawImage(o,0,0,e,s,u.x,u.y,u.width,u.height)}var f=Ni.FILE_SCAN_HIDDEN_CANVAS_PADDING,p=Math.max(o.width,u.width),g=Math.max(o.height,u.height),m=p+2*f,w=g+2*f,y=n.createCanvasElement(m,w);a.appendChild(y);var E=y.getContext("2d");if(!E)throw"Unable to get 2d context from canvas";E.canvas.width=m,E.canvas.height=w,E.drawImage(o,0,0,e,s,f,f,p,g);try{n.qrcode.decodeRobustlyAsync(y).then(function(e){r(Gr.createFromQrcodeResult(e))}).catch(i)}catch(e){i("QR code parse error, error = ".concat(e))}},o.onerror=i,o.onabort=i,o.onstalled=i,o.onsuspend=i,o.src=URL.createObjectURL(e)})},e.prototype.clear=function(){this.clearElement()},e.getCameras=function(){return bi.retrieve()},e.prototype.getRunningTrackCapabilities=function(){return this.getRenderedCameraOrFail().getRunningTrackCapabilities()},e.prototype.getRunningTrackSettings=function(){return this.getRenderedCameraOrFail().getRunningTrackSettings()},e.prototype.getRunningTrackCameraCapabilities=function(){return this.getRenderedCameraOrFail().getCapabilities()},e.prototype.applyVideoConstraints=function(e){if(!e)throw"videoConstaints is required argument.";if(!Jr.isMediaStreamConstraintsValid(e,this.logger))throw"invalid videoConstaints passed, check logs for more details";return this.getRenderedCameraOrFail().applyVideoConstraints(e)},e.prototype.getRenderedCameraOrFail=function(){if(null==this.renderedCamera)throw"Scanning is not in running state, call this API only when QR code scanning using camera is in running state.";return this.renderedCamera}
vendor: 9,551 bytes, line 2
2,e.prototype.getSupportedFormats=function(e){var t=[Lr.QR_CODE,Lr.AZTEC,Lr.CODABAR,Lr.CODE_39,Lr.CODE_93,Lr.CODE_128,Lr.DATA_MATRIX,Lr.MAXICODE,Lr.ITF,Lr.EAN_13,Lr.EAN_8,Lr.PDF_417,Lr.RSS_14,Lr.RSS_EXPANDED,Lr.UPC_A,Lr.UPC_E,Lr.UPC_EAN_EXTENSION];if(!e||"boolean"==typeof e)return t;if(!e.formatsToSupport)return t;if(!Array.isArray(e.formatsToSupport))throw"configOrVerbosityFlag.formatsToSupport should be undefined or an array.";if(0===e.formatsToSupport.length)throw"Atleast 1 formatsToSupport is needed.";for(var n=[],r=0,i=e.formatsToSupport;r<i.length;r++){var o=i[r];jr(o)?n.push(o):this.logger.warn("Invalid format: ".concat(o," passed in config, ignoring."))}if(0===n.length)throw"None of formatsToSupport match supported values.";return n},e.prototype.getUseBarCodeDetectorIfSupported=function(e){if(Xr(e))return!0;if(!Xr(e.useBarCodeDetectorIfSupported))return!1!==e.useBarCodeDetectorIfSupported;if(Xr(e.experimentalFeatures))return!0;var t=e.experimentalFeatures;return!!Xr(t.useBarCodeDetectorIfSupported)||!1!==t.useBarCodeDetectorIfSupported},e.prototype.validateQrboxSize=function(e,t,n){var r=this,i=n.qrbox;this.validateQrboxConfig(i);var o,s=this.toQrdimensions(e,t,i),a=function(e){if(e<Ni.MIN_QR_BOX_SIZE)throw"minimum size of 'config.qrbox' dimension value is"+" ".concat(Ni.MIN_QR_BOX_SIZE,"px.")};a(s.width),a(s.height),s.width=((o=s.width)>e&&(r.logger.warn("`qrbox.width` or `qrbox` is larger than the width of the root element. The width will be truncated to the width of root element."),o=e),o)},e.prototype.validateQrboxConfig=function(e){if("number"!=typeof e&&"function"!=typeof e&&(void 0===e.width||void 0===e.height))throw"Invalid instance of QrDimensions passed for 'config.qrbox'. Both 'width' and 'height' should be set."},e.prototype.toQrdimensions=function(e,t,n){if("number"==typeof n)return{width:n,height:n};if("function"==typeof n)try{return n(e,t)}catch(e){throw new Error("qrbox config was passed as a function but it failed with unknown error"+e)}return n},e.prototype.setupUi=function(e,t,n){n.isShadedBoxEnabled()&&this.validateQrboxSize(e,t,n);var r=Xr(n.qrbox)?{width:e,height:t}:n.qrbox;this.validateQrboxConfig(r);var i=this.toQrdimensions(e,t,r);i.height>t&&this.logger.warn("[Html5Qrcode] config.qrbox has height that isgreater than the height of the video stream. Shading will be ignored");var o=n.isShadedBoxEnabled()&&i.height<=t,s={x:0,y:0,width:e,height:t},a=o?this.getShadedRegionBounds(e,t,i):s,l=this.createCanvasElement(a.width,a.height),c=l.getContext("2d",{willReadFrequently:!0});c.canvas.width=a.width,c.canvas.height=a.height,this.element.append(l),o&&this.possiblyInsertShadingElement(this.element,e,t,i),this.createScannerPausedUiElement(this.element),this.qrRegion=a,this.context=c,this.canvasElement=l},e.prototype.createScannerPausedUiElement=function(e){var t=document.createElement("div");t.innerText=Zr.scannerPaused(),t.style.display="none",t.style.position="absolute",t.style.top="0px",t.style.zIndex="1",t.style.background="rgba(9, 9, 9, 0.46)",t.style.color="#FFECEC",t.style.textAlign="center",t.style.width="100%",e.appendChild(t),this.scannerPausedUiElement=t},e.prototype.scanContext=function(e,t){var n=this;return this.stateManagerProxy.isPaused()?Promise.resolve(!1):this.qrcode.decodeAsync(this.canvasElement).then(function(t){return e(t.text,Gr.createFromQrcodeResult(t)),n.possiblyUpdateShaders(!0),!0}).catch(function(e){n.possiblyUpdateShaders(!1);var r=Zr.codeParseError(e);return t(r,Wr.createFrom(r)),!1})},e.prototype.foreverScan=function(e,t,n){var r=this;if(this.shouldScan&&this.renderedCamera){var i=this.renderedCamera.getSurface(),o=i.videoWidth/i.clientWidth,s=i.videoHeight/i.clientHeight;if(!this.qrRegion)throw"qrRegion undefined when localMediaStream is ready.";var a=this.qrRegion.width*o,l=this.qrRegion.height*s,c=this.qrRegion.x*o,u=this.qrRegion.y*s;this.context.drawImage(i,c,u,a,l,0,0,this.qrRegion.width,this.qrRegion.height);var h=function(){r.foreverScanTimeout=setTimeout(function(){r.foreverScan(e,t,n)},r.getTimeoutFps(e.fps))};this.scanContext(t,n).then(function(i){i||!0===e.disableFlip?h():(r.context.translate(r.context.canvas.width,0),r.context.scale(-1,1),r.scanContext(t,n).finally(function(){h()}))}).catch(function(e){r.logger.logError("Error happend while scanning context",e),h()})}},e.prototype.createVideoConstraints=function(e){if("string"==typeof e)return{deviceId:{exact:e}};if("object"==typeof e){var t="facingMode",n="deviceId",r={user:!0,environment:!0},i="exact",o=function(e){if(e in r)return!0;throw"config has invalid 'facingMode' value = "+"'".concat(e,"'")},s=Object.keys(e);if(1!==s.length)throw"'cameraIdOrConfig' object should have exactly 1 key,"+" if passed as an object, found ".concat(s.length," keys");var a=Object.keys(e)[0];if(a!==t&&a!==n)throw"Only '".concat(t,"' and '").concat(n,"' ")+" are supported for 'cameraIdOrConfig'";if(a!==t){var l=e.deviceId;if("string"==typeof l)return{deviceId:l};if("object"==typeof l){if(i in l)return{deviceId:{exact:l["".concat(i)]}};throw"'deviceId' should be string or object with"+" ".concat(i," as key.")}throw"Invalid type of 'deviceId' = ".concat(typeof l)}var c=e.facingMode;if("string"==typeof c){if(o(c))return{facingMode:c}}else{if("object"!=typeof c)throw"Invalid type of 'facingMode' = ".concat(typeof c);if(!(i in c))throw"'facingMode' should be string or object with"+" ".concat(i," as key.");if(o(c["".concat(i)]))return{facingMode:{exact:c["".concat(i)]}}}}throw"Invalid type of 'cameraIdOrConfig' = ".concat(typeof e)},e.prototype.computeCanvasDrawConfig=function(e,t,n,r){if(e<=n&&t<=r)return{x:(n-e)/2,y:(r-t)/2,width:e,height:t};var i=e,o=t;return e>n&&(t*=n/e,e=n),t>r&&(e*=r/t,t=r),this.logger.log("Image downsampled from "+"".concat(i,"X").concat(o)+" to ".concat(e,"X").concat(t,".")),this.computeCanvasDrawConfig(e,t,n,r)},e.prototype.clearElement=function(){if(this.stateManagerProxy.isScanning())throw"Cannot clear while scan is ongoing, close it first.";var e=document.getElementById(this.elementId);e&&(e.innerHTML="")},e.prototype.possiblyUpdateShaders=function(e){this.qrMatch!==e&&(this.hasBorderShaders&&this.borderShaders&&this.borderShaders.length&&this.borderShaders.forEach(function(t){t.style.backgroundColor=e?Ni.BORDER_SHADER_MATCH_COLOR:Ni.BORDER_SHADER_DEFAULT_COLOR}),this.qrMatch=e)},e.prototype.possiblyCloseLastScanImageFile=function(){this.lastScanImageFile&&(URL.revokeObjectURL(this.lastScanImageFile),this.lastScanImageFile=null)},e.prototype.createCanvasElement=function(e,t,n){var r=e,i=t,o=document.createElement("canvas");return o.style.width="".concat(r,"px"),o.style.height="".concat(i,"px"),o.style.display="none",o.id=Xr(n)?"qr-canvas":n,o},e.prototype.getShadedRegionBounds=function(e,t,n){if(n.width>e||n.height>t)throw"'config.qrbox' dimensions should not be greater than the dimensions of the root HTML element.";return{x:(e-n.width)/2,y:(t-n.height)/2,width:n.width,height:n.height}},e.prototype.possiblyInsertShadingElement=function(e,t,n,r){if(!(t-r.width<1||n-r.height<1)){var i=document.createElement("div");i.style.position="absolute";var o=(t-r.width)/2,s=(n-r.height)/2;if(i.style.borderLeft="".concat(o,"px solid rgba(0, 0, 0, 0.48)"),i.style.borderRight="".concat(o,"px solid rgba(0, 0, 0, 0.48)"),i.style.borderTop="".concat(s,"px solid rgba(0, 0, 0, 0.48)"),i.style.borderBottom="".concat(s,"px solid rgba(0, 0, 0, 0.48)"),i.style.boxSizing="border-box",i.style.top="0px",i.style.bottom="0px",i.style.left="0px",i.style.right="0px",i.id="".concat(Ni.SHADED_REGION_ELEMENT_ID),t-r.width<11||n-r.height<11)this.hasBorderShaders=!1;else{var a=40;this.insertShaderBorders(i,a,5,-5,null,0,!0),this.insertShaderBorders(i,a,5,-5,null,0,!1),this.insertShaderBorders(i,a,5,null,-5,0,!0),this.insertShaderBorders(i,a,5,null,-5,0,!1),this.insertShaderBorders(i,5,45,-5,null,-5,!0),this.insertShaderBorders(i,5,45,null,-5,-5,!0),this.insertShaderBorders(i,5,45,-5,null,-5,!1),this.insertShaderBorders(i,5,45,null,-5,-5,!1),this.hasBorderShaders=!0}e.append(i)}},e.prototype.insertShaderBorders=function(e,t,n,r,i,o,s){var a=document.createElement("div");a.style.position="absolute",a.style.backgroundColor=Ni.BORDER_SHADER_DEFAULT_COLOR,a.style.width="".concat(t,"px"),a.style.height="".concat(n,"px"),null!==r&&(a.style.top="".concat(r,"px")),null!==i&&(a.style.bottom="".concat(i,"px")),s?a.style.left="".concat(o,"px"):a.style.right="".concat(o,"px"),this.borderShaders||(this.borderShaders=[]),this.borderShaders.push(a),e.appendChild(a)},e.prototype.showPausedState=function(){if(!this.scannerPausedUiElement)throw"[internal error] scanner paused UI element not found";this.scannerPausedUiElement.style.display="block"},e.prototype.hidePausedState=function(){if(!this.scannerPausedUiElement)throw"[internal error] scanner paused UI element not found";this.scannerPausedUiElement.style.display="none"},e.prototype.getTimeoutFps=function(e){return 1e3/e},e}(),Mi="data:image/svg+xml;base64,",Pi=Mi+"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAzNzEuNjQzIDM3MS42NDMiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDM3MS42NDMgMzcxLjY0MyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+PHBhdGggZD0iTTEwNS4wODQgMzguMjcxaDE2My43Njh2MjBIMTA1LjA4NHoiLz48cGF0aCBkPSJNMzExLjU5NiAxOTAuMTg5Yy03LjQ0MS05LjM0Ny0xOC40MDMtMTYuMjA2LTMyLjc0My0yMC41MjJWMzBjMC0xNi41NDItMTMuNDU4LTMwLTMwLTMwSDEyNS4wODRjLTE2LjU0MiAwLTMwIDEzLjQ1OC0zMCAzMHYxMjAuMTQzaC04LjI5NmMtMTYuNTQyIDAtMzAgMTMuNDU4LTMwIDMwdjEuMzMzYTI5LjgwNCAyOS44MDQgMCAwIDAgNC42MDMgMTUuOTM5Yy03LjM0IDUuNDc0LTEyLjEwMyAxNC4yMjEtMTIuMTAzIDI0LjA2MXYxLjMzM2MwI
2DkuODQgNC43NjMgMTguNTg3IDEyLjEwMyAyNC4wNjJhMjkuODEgMjkuODEgMCAwIDAtNC42MDMgMTUuOTM4djEuMzMzYzAgMTYuNTQyIDEzLjQ1OCAzMCAzMCAzMGg4LjMyNGMuNDI3IDExLjYzMSA3LjUwMyAyMS41ODcgMTcuNTM0IDI2LjE3Ny45MzEgMTAuNTAzIDQuMDg0IDMwLjE4NyAxNC43NjggNDUuNTM3YTkuOTg4IDkuOTg4IDAgMCAwIDguMjE2IDQuMjg4IDkuOTU4IDkuOTU4IDAgMCAwIDUuNzA0LTEuNzkzYzQuNTMzLTMuMTU1IDUuNjUtOS4zODggMi40OTUtMTMuOTIxLTYuNzk4LTkuNzY3LTkuNjAyLTIyLjYwOC0xMC43Ni0zMS40aDgyLjY4NWMuMjcyLjQxNC41NDUuODE4LjgxNSAxLjIxIDMuMTQyIDQuNTQxIDkuMzcyIDUuNjc5IDEzLjkxMyAyLjUzNCA0LjU0Mi0zLjE0MiA1LjY3Ny05LjM3MSAyLjUzNS0xMy45MTMtMTEuOTE5LTE3LjIyOS04Ljc4Ny0zNS44ODQgOS41ODEtNTcuMDEyIDMuMDY3LTIuNjUyIDEyLjMwNy0xMS43MzIgMTEuMjE3LTI0LjAzMy0uODI4LTkuMzQzLTcuMTA5LTE3LjE5NC0xOC42NjktMjMuMzM3YTkuODU3IDkuODU3IDAgMCAwLTEuMDYxLS40ODZjLS40NjYtLjE4Mi0xMS40MDMtNC41NzktOS43NDEtMTUuNzA2IDEuMDA3LTYuNzM3IDE0Ljc2OC04LjI3MyAyMy43NjYtNy42NjYgMjMuMTU2IDEuNTY5IDM5LjY5OCA3LjgwMyA0Ny44MzYgMTguMDI2IDUuNzUyIDcuMjI1IDcuNjA3IDE2LjYyMyA1LjY3MyAyOC43MzMtLjQxMyAyLjU4NS0uODI0IDUuMjQxLTEuMjQ1IDcuOTU5LTUuNzU2IDM3LjE5NC0xMi45MTkgODMuNDgzLTQ5Ljg3IDExNC42NjEtNC4yMjEgMy41NjEtNC43NTYgOS44Ny0xLjE5NCAxNC4wOTJhOS45OCA5Ljk4IDAgMCAwIDcuNjQ4IDMuNTUxIDkuOTU1IDkuOTU1IDAgMCAwIDYuNDQ0LTIuMzU4YzQyLjY3Mi0zNi4wMDUgNTAuODAyLTg4LjUzMyA1Ni43MzctMTI2Ljg4OC40MTUtMi42ODQuODIxLTUuMzA5IDEuMjI5LTcuODYzIDIuODM0LTE3LjcyMS0uNDU1LTMyLjY0MS05Ljc3Mi00NC4zNDV6bS0yMzIuMzA4IDQyLjYyYy01LjUxNCAwLTEwLTQuNDg2LTEwLTEwdi0xLjMzM2MwLTUuNTE0IDQuNDg2LTEwIDEwLTEwaDE1djIxLjMzM2gtMTV6bS0yLjUtNTIuNjY2YzAtNS41MTQgNC40ODYtMTAgMTAtMTBoNy41djIxLjMzM2gtNy41Yy01LjUxNCAwLTEwLTQuNDg2LTEwLTEwdi0xLjMzM3ptMTcuNSA5My45OTloLTcuNWMtNS41MTQgMC0xMC00LjQ4Ni0xMC0xMHYtMS4zMzNjMC01LjUxNCA0LjQ4Ni0xMCAxMC0xMGg3LjV2MjEuMzMzem0zMC43OTYgMjguODg3Yy01LjUxNCAwLTEwLTQuNDg2LTEwLTEwdi04LjI3MWg5MS40NTdjLS44NTEgNi42NjgtLjQzNyAxMi43ODcuNzMxIDE4LjI3MWgtODIuMTg4em03OS40ODItMTEzLjY5OGMtMy4xMjQgMjAuOTA2IDEyLjQyNyAzMy4xODQgMjEuNjI1IDM3LjA0IDUuNDQxIDIuOTY4IDcuNTUxIDUuNjQ3IDcuNzAxIDcuMTg4LjIxIDIuMTUtMi41NTMgNS42ODQtNC40NzcgNy4yNTEtLjQ4Mi4zNzgtLjkyOS44LTEuMzM1IDEuMjYxLTYuOTg3IDcuOTM2LTExLjk4MiAxNS41Mi0xNS40MzIgMjIuNjg4aC05Ny41NjRWMzBjMC01LjUxNCA0LjQ4Ni0xMCAxMC0xMGgxMjMuNzY5YzUuNTE0IDAgMTAgNC40ODYgMTAgMTB2MTM1LjU3OWMtMy4wMzItLjM4MS02LjE1LS42OTQtOS4zODktLjkxNC0yNS4xNTktMS42OTQtNDIuMzcgNy43NDgtNDQuODk4IDI0LjY2NnoiLz48cGF0aCBkPSJNMTc5LjEyOSA4My4xNjdoLTI0LjA2YTUgNSAwIDAgMC01IDV2MjQuMDYxYTUgNSAwIDAgMCA1IDVoMjQuMDZhNSA1IDAgMCAwIDUtNVY4OC4xNjdhNSA1IDAgMCAwLTUtNXpNMTcyLjYyOSAxNDIuODZoLTEyLjU2VjEzMC44YTUgNSAwIDEgMC0xMCAwdjE3LjA2MWE1IDUgMCAwIDAgNSA1aDE3LjU2YTUgNSAwIDEgMCAwLTEwLjAwMXpNMjE2LjU2OCA4My4xNjdoLTI0LjA2YTUgNSAwIDAgMC01IDV2MjQuMDYxYTUgNSAwIDAgMCA1IDVoMjQuMDZhNSA1IDAgMCAwIDUtNVY4OC4xNjdhNSA1IDAgMCAwLTUtNXptLTUgMjQuMDYxaC0xNC4wNlY5My4xNjdoMTQuMDZ2MTQuMDYxek0yMTEuNjY5IDEyNS45MzZIMTk3LjQxYTUgNSAwIDAgMC01IDV2MTQuMjU3YTUgNSAwIDAgMCA1IDVoMTQuMjU5YTUgNSAwIDAgMCA1LTV2LTE0LjI1N2E1IDUgMCAwIDAtNS01eiIvPjwvc3ZnPg==",ki=Mi+"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA1OS4wMTggNTkuMDE4IiBzdHlsZT0iZW5hYmxlLWJhY2tncm91bmQ6bmV3IDAgMCA1OS4wMTggNTkuMDE4IiB4bWw6c3BhY2U9InByZXNlcnZlIj48cGF0aCBkPSJtNTguNzQxIDU0LjgwOS01Ljk2OS02LjI0NGExMC43NCAxMC43NCAwIDAgMCAyLjgyLTcuMjVjMC01Ljk1My00Ljg0My0xMC43OTYtMTAuNzk2LTEwLjc5NlMzNCAzNS4zNjEgMzQgNDEuMzE0IDM4Ljg0MyA1Mi4xMSA0NC43OTYgNTIuMTFjMi40NDEgMCA0LjY4OC0uODI0IDYuNDk5LTIuMTk2bDYuMDAxIDYuMjc3YS45OTguOTk4IDAgMCAwIDEuNDE0LjAzMiAxIDEgMCAwIDAgLjAzMS0xLjQxNHpNMzYgNDEuMzE0YzAtNC44NSAzLjk0Ni04Ljc5NiA4Ljc5Ni04Ljc5NnM4Ljc5NiAzLjk0NiA4Ljc5NiA4Ljc5Ni0zLjk0NiA4Ljc5Ni04Ljc5NiA4Ljc5NlMzNiA0Ni4xNjQgMzYgNDEuMzE0ek0xMC40MzEgMTYuMDg4YzAgMy4wNyAyLjQ5OCA1LjU2OCA1LjU2OSA1LjU2OHM1LjU2OS0yLjQ5OCA1LjU2OS01LjU2OGMwLTMuMDcxLTIuNDk4LTUuNTY5LTUuNTY5LTUuNTY5cy01LjU2OSAyLjQ5OC01LjU2OSA1LjU2OXptOS4xMzggMGMwIDEuOTY4LTEuNjAyIDMuNTY4LTMuNTY5IDMuNTY4cy0zLjU2OS0xLjYwMS0zLjU2OS0zLjU2OCAxLjYwMi0zLjU2OSAzLjU2OS0zLjU2OSAzLjU2OSAxLjYwMSAzLjU2OSAzLjU2OXoiLz48cGF0aCBkPSJtMzAuODgyIDI4Ljk4NyA5LjE4LTEwLjA1NCAxMS4yNjIgMTAuMzIzYTEgMSAwIDAgMCAxLjM1MS0xLjQ3NWwtMTItMTFhMSAxIDAgMCAwLTEuNDE0LjA2M2wtOS43OTQgMTAuNzI3LTQuNzQzLTQuNzQzYTEuMDAzIDEuMDAzIDAgMCAwLTEuMzY4LS4wNDRMNi4zMzkgMzcuNzY4YTEgMSAwIDEgMCAxLjMyMiAxLjUwMWwxNi4zMTMtMTQuMzYyIDcuMzE5IDcuMzE4YS45OTkuOTk5IDAgMSAwIDEuNDE0LTEuNDE0bC0xLjgyNS0xLjgyNHoiLz48cGF0aCBkPSJNMzAgNDYuNTE4SDJ2LTQyaDU0djI4YTEgMSAwIDEgMCAyIDB2LTI5YTEgMSAwIDAgMC0xLTFIMWExIDEgMCAwIDAtMSAxdjQ0YTEgMSAwIDAgMCAxIDFoMjlhMSAxIDAgMSAwIDAtMnoiLz48L3N2Zz4=",xi=Mi+"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA0NjAgNDYwIiBzdHlsZT0iZW5hYmxlLWJhY2tncm91bmQ6bmV3IDAgMCA0NjAgNDYwIiB4bWw6c3BhY2U9InByZXNlcnZlIj48cGF0aCBkPSJNMjMwIDBDMTAyLjk3NSAwIDAgMTAyLjk3NSAwIDIzMHMxMDIuOTc1IDIzMCAyMzAgMjMwIDIzMC0x
2MDIuOTc0IDIzMC0yMzBTMzU3LjAyNSAwIDIzMCAwem0zOC4zMzMgMzc3LjM2YzAgOC42NzYtNy4wMzQgMTUuNzEtMTUuNzEgMTUuNzFoLTQzLjEwMWMtOC42NzYgMC0xNS43MS03LjAzNC0xNS43MS0xNS43MVYyMDIuNDc3YzAtOC42NzYgNy4wMzMtMTUuNzEgMTUuNzEtMTUuNzFoNDMuMTAxYzguNjc2IDAgMTUuNzEgNy4wMzMgMTUuNzEgMTUuNzFWMzc3LjM2ek0yMzAgMTU3Yy0yMS41MzkgMC0zOS0xNy40NjEtMzktMzlzMTcuNDYxLTM5IDM5LTM5IDM5IDE3LjQ2MSAzOSAzOS0xNy40NjEgMzktMzkgMzl6Ii8+PC9zdmc+",Li=function(){function e(){}return e.createDefault=function(){return{hasPermission:!1,lastUsedCameraId:null}},e}(),Bi=function(){function e(){this.data=Li.createDefault();var t=localStorage.getItem(e.LOCAL_STORAGE_KEY);t?this.data=JSON.parse(t):this.reset()}return e.prototype.hasCameraPermissions=function(){return this.data.hasPermission},e.prototype.getLastUsedCameraId=function(){return this.data.lastUsedCameraId},e.prototype.setHasPermission=function(e){this.data.hasPermission=e,this.flush()},e.prototype.setLastUsedCameraId=function(e){this.data.lastUsedCameraId=e,this.flush()},e.prototype.resetLastUsedCameraId=function(){this.data.lastUsedCameraId=null,this.flush()},e.prototype.reset=function(){this.data=Li.createDefault(),this.flush()},e.prototype.flush=function(){localStorage.setItem(e.LOCAL_STORAGE_KEY,JSON.stringify(this.data))},e.LOCAL_STORAGE_KEY="HTML5_QRCODE_DATA",e}(),Fi=function(){function e(){this.infoDiv=document.createElement("div")}return e.prototype.renderInto=function(e){this.infoDiv.style.position="absolute",this.infoDiv.style.top="10px",this.infoDiv.style.right="10px",this.infoDiv.style.zIndex="2",this.infoDiv.style.display="none",this.infoDiv.style.padding="5pt",this.infoDiv.style.border="1px solid #171717",this.infoDiv.style.fontSize="10pt",this.infoDiv.style.background="rgb(0 0 0 / 69%)",this.infoDiv.style.borderRadius="5px",this.infoDiv.style.textAlign="center",this.infoDiv.style.fontWeight="400",this.infoDiv.style.color="white",this.infoDiv.innerText=Kr.poweredBy();var t=document.createElement("a");t.innerText="ScanApp",t.href="https://scanapp.org",t.target="new",t.style.color="white",this.infoDiv.appendChild(t);var n=document.createElement("br"),r=document.createElement("br");this.infoDiv.appendChild(n),this.infoDiv.appendChild(r);var i=document.createElement("a");i.innerText=Kr.reportIssues(),i.href="https://github.com/mebjas/html5-qrcode/issues",i.target="new",i.style.color="white",this.infoDiv.appendChild(i),e.appendChild(this.infoDiv)},e.prototype.show=function(){this.infoDiv.style.display="block"},e.prototype.hide=function(){this.infoDiv.style.display="none"},e}(),Ui=function(){function e(e,t){this.isShowingInfoIcon=!0,this.onTapIn=e,this.onTapOut=t,this.infoIcon=document.createElement("img")}return e.prototype.renderInto=function(e){var t=this;this.infoIcon.alt="Info icon",this.infoIcon.src=xi,this.infoIcon.style.position="absolute",this.infoIcon.style.top="4px",this.infoIcon.style.right="4px",this.infoIcon.style.opacity="0.6",this.infoIcon.style.cursor="pointer",this.infoIcon.style.zIndex="2",this.infoIcon.style.width="16px",this.infoIcon.style.height="16px",this.infoIcon.onmouseover=function(e){return t.onHoverIn()},this.infoIcon.onmouseout=function(e){return t.onHoverOut()},this.infoIcon.onclick=function(e){return t.onClick()},e.appendChild(this.infoIcon)},e.prototype.onHoverIn=function(){this.isShowingInfoIcon&&(this.infoIcon.style.opacity="1")},e.prototype.onHoverOut=function(){this.isShowingInfoIcon&&(this.infoIcon.style.opacity="0.6")},e.prototype.onClick=function(){this.isShowingInfoIcon?(this.isShowingInfoIcon=!1,this.onTapIn(),this.infoIcon.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAAQgAAAEIBarqQRAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAE1SURBVDiNfdI7S0NBEAXgLya1otFgpbYSbISAgpXYi6CmiH9KCAiChaVga6OiWPgfRDQ+0itaGVNosXtluWwcuMzePfM4M3sq8lbHBubwg1dc4m1E/J/N4ghDPOIsfk/4xiEao5KX0McFljN4C9d4QTPXuY99jP3DsIoDPGM6BY5i5yI5R7O4q+ImFkJY2DCh3cAH2klyB+9J1xUMMAG7eCh1a+Mr+k48b5diXrFVwwLuS+BJ9MfR7+G0FHOHhTHhnXNWS87VDF4pcnfQK4Ep7XScNLmPTZgURNKKYENYWDpzW1BhscS1WHS8CDgURFJQrWcoF3c13KKbgg1BYQfy8xZWEzTTw1QZbAoKu8FqJnktdu5hcVSHmchiILzzuaDQvjBzV2m8yohCE1jHfPx/xhU+y4G/D75ELlRJsSYAAAAASUVORK5CYII=",this.infoIcon.style.opacity="1"):(this.isShowingInfoIcon=!0,this.onTapOut(),this.infoIcon.src=xi,this.infoIcon.style.opacity="0.6")},e}(),ji=function(){function e(){var e=this;this.infoDiv=new Fi,this.infoIcon=new Ui(function(){e.infoDiv.show()},function(){e.infoDiv.hide()})}return e.prototype.renderInto=function(e){this.infoDiv.renderInto(e),this.infoIcon.renderInto(e)},e}
vendor: 5,437 bytes, line 2
2(),Hi=function(e,t,n,r){return new(n||(n=Promise))(function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}l((r=r.apply(e,t||[])).next())})},Vi=function(e,t){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(a){return function(l){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,a[0]&&(s=0)),s;)try{if(n=1,r&&(i=2&a[0]?r.return:a[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,a[1])).done)return i;switch(r=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,r=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!(i=s.trys,(i=i.length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){s.label=a[1];break}if(6===a[0]&&s.label<i[1]){s.label=i[1],i=a;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(a);break}i[2]&&s.ops.pop(),s.trys.pop();continue}a=t.call(e,s)}catch(e){a=[6,e],r=0}finally{n=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,l])}}},zi=function(){function e(){}return e.hasPermissions=function(){return Hi(this,void 0,void 0,function(){var e,t,n,r;return Vi(this,function(i){switch(i.label){case 0:return[4,navigator.mediaDevices.enumerateDevices()];case 1:for(e=i.sent(),t=0,n=e;t<n.length;t++)if("videoinput"===(r=n[t]).kind&&r.label)return[2,!0];return[2,!1]}})})},e}(),Gi=function(){function e(e){this.supportedScanTypes=this.validateAndReturnScanTypes(e)}return e.prototype.getDefaultScanType=function(){return this.supportedScanTypes[0]},e.prototype.hasMoreThanOneScanType=function(){return this.supportedScanTypes.length>1},e.prototype.isCameraScanRequired=function(){for(var t=0,n=this.supportedScanTypes;t<n.length;t++){var r=n[t];if(e.isCameraScanType(r))return!0}return!1},e.isCameraScanType=function(e){return e===Fr.SCAN_TYPE_CAMERA},e.isFileScanType=function(e){return e===Fr.SCAN_TYPE_FILE},e.prototype.validateAndReturnScanTypes=function(e){if(!e||0===e.length)return Vr.DEFAULT_SUPPORTED_SCAN_TYPE;var t=Vr.DEFAULT_SUPPORTED_SCAN_TYPE.length;if(e.length>t)throw"Max ".concat(t," values expected for ")+"supportedScanTypes";for(var n=0,r=e;n<r.length;n++){var i=r[n];if(!Vr.DEFAULT_SUPPORTED_SCAN_TYPE.includes(i))throw"Unsupported scan type ".concat(i)}return e},e}(),Wi=function(){function e(){}return e.ALL_ELEMENT_CLASS="html5-qrcode-element",e.CAMERA_PERMISSION_BUTTON_ID="html5-qrcode-button-camera-permission",e.CAMERA_START_BUTTON_ID="html5-qrcode-button-camera-start",e.CAMERA_STOP_BUTTON_ID="html5-qrcode-button-camera-stop",e.TORCH_BUTTON_ID="html5-qrcode-button-torch",e.CAMERA_SELECTION_SELECT_ID="html5-qrcode-select-camera",e.FILE_SELECTION_BUTTON_ID="html5-qrcode-button-file-selection",e.ZOOM_SLIDER_ID="html5-qrcode-input-range-zoom",e.SCAN_TYPE_CHANGE_ANCHOR_ID="html5-qrcode-anchor-scan-type-change",e.TORCH_BUTTON_CLASS_TORCH_ON="html5-qrcode-button-torch-on",e.TORCH_BUTTON_CLASS_TORCH_OFF="html5-qrcode-button-torch-off",e}(),Yi=function(){function e(){}return e.createElement=function(e,t){var n=document.createElement(e);return n.id=t,n.classList.add(Wi.ALL_ELEMENT_CLASS),"button"===e&&n.setAttribute("type","button"),n},e}(),Xi=function(e,t,n,r){return new(n||(n=Promise))(function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}l((r=r.apply(e,t||[])).next())})},$i=function(e,t){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(a){return function(l){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,a[0]&&(s=0)),s;)try{if(n=1,r&&(i=2&a[0]?r.return:a[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,a[1])).done)return i;switch(r=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,r=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!(i=s.trys,(i=i.length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){s.label=a[1];break}if(6===a[0]&&s.label<i[1]){s.label=i[1],i=a;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(a);break}i[2]&&s.ops.pop(),s.trys.pop();continue}a=t.call(e,s)}catch(e){a=[6,e],r=0}finally{n=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,l])}}},qi=function(){function e(e,t,n){this.isTorchOn=!1,this.torchCapability=e,this.buttonController=t,this.onTorchActionFailureCallback=n}return e.prototype.isTorchEnabled=function(){return this.isTorchOn},e.prototype.flipState=function(){return Xi(this,void 0,void 0,function(){var e,t;return $i(this,function(n){switch(n.label){case 0:this.buttonController.disable(),e=!this.isTorchOn,n.label=1;case 1:return n.trys.push([1,3,,4]),[4,this.torchCapability.apply(e)];case 2:return n.sent(),this.updateUiBasedOnLatestSettings(this.torchCapability.value(
2),e),[3,4];case 3:return t=n.sent(),this.propagateFailure(e,t),this.buttonController.enable(),[3,4];case 4:return[2]}})})},e.prototype.updateUiBasedOnLatestSettings=function(e,t){e===t?(this.buttonController.setText(t?Qr.torchOffButton():Qr.torchOnButton()),this.isTorchOn=t):this.propagateFailure(t),this.buttonController.enable()},e.prototype.propagateFailure=function(e,t){var n=e?Qr.torchOnFailedMessage():Qr.torchOffFailedMessage();t&&(n+="; Error = "+t),this.onTorchActionFailureCallback(n)},e.prototype.reset=function(){this.isTorchOn=!1},e}(),Zi=function(){function e(e,t){this.onTorchActionFailureCallback=t,this.torchButton=Yi.createElement("button",Wi.TORCH_BUTTON_ID),this.torchController=new qi(e,this,t)}return e.prototype.render=function(e,t){var n=this;this.torchButton.innerText=Qr.torchOnButton(),this.torchButton.style.display=t.display,this.torchButton.style.marginLeft=t.marginLeft;var r=this;this.torchButton.addEventListener("click",function(e){return Xi(n,void 0,void 0,function(){return $i(this,function(e){switch(e.label){case 0:return[4,r.torchController.flipState()];case 1:return e.sent(),r.torchController.isTorchEnabled()?(r.torchButton.classList.remove(Wi.TORCH_BUTTON_CLASS_TORCH_OFF),r.torchButton.classList.add(Wi.TORCH_BUTTON_CLASS_TORCH_ON)):(r.torchButton.classList.remove(Wi.TORCH_BUTTON_CLASS_TORCH_ON),r.torchButton.classList.add(Wi.TORCH_BUTTON_CLASS_TORCH_OFF)),[2]}})})}),e.appendChild(this.torchButton)},e.prototype.updateTorchCapability=function(e){this.torchController=new qi(e,this,this.onTorchActionFailureCallback)},e.prototype.getTorchButton=function(){return this.torchButton},e.prototype.hide=function(){this.torchButton.style.display="none"},e.prototype.show=function(){this.torchButton.style.display="inline-block"},e.prototype.disable=function(){this.torchButton.disabled=!0},e.prototype.enable=function(){this.torchButton.disabled=!1},e.prototype.setText=function(e){this.torchButton.innerText=e},e.prototype.reset=function(){this.torchButton.innerText=Qr.torchOnButton(),this.torchController.reset()},e.create=function(t,n,r,i){var o=new e(n,i);return o.render(t,r),o},e}(),Qi=function(){function e(e,t,n){this.fileBasedScanRegion=this.createFileBasedScanRegion(),this.fileBasedScanRegion.style.display=t?"block":"none",e.appendChild(this.fileBasedScanRegion);var r=document.createElement("label");r.setAttribute("for",this.getFileScanInputId()),r.style.display="inline-block",this.fileBasedScanRegion.appendChild(r),this.fileSelectionButton=Yi.createElement("button",Wi.FILE_SELECTION_BUTTON_ID),this.setInitialValueToButton(),this.fileSelectionButton.addEventListener("click",function(e){r.click()}),r.append(this.fileSelectionButton),this.fileScanInput=Yi.createElement("input",this.getFileScanInputId()),this.fileScanInput.type="file",this.fileScanInput.accept="image/*",this.fileScanInput.style.display="none",r.appendChild(this.fileScanInput);var i=this;this.fileScanInput.addEventListener("change",function(e){if(null!=e&&null!=e.target){var t=e.target;if(!t.files||0!==t.files.length){var r=t.files[0],o=r.name;i.setImageNameToButton(o),n(r)}}});var o=this.createDragAndDropMessage();this.fileBasedScanRegion.appendChild(o),this.fileBasedScanRegion.addEventListener("dragenter",function(e){i.fileBasedScanRegion.style.border=i.fileBasedScanRegionActiveBorder(),e.stopPropagation(),e.preventDefault()}),this.fileBasedScanRegion.addEventListener("dragleave",function(e){i.fileBasedScanRegion.style.border=i.fileBasedScanRegionDefaultBorder(),e.stopPropagation(),e.preventDefault()}),this.fileBasedScanRegion.addEventListener("dragover",function(e){i.fileBasedScanRegion.style.border=i.fileBasedScanRegionActiveBorder(),e.stopPropagation(),e.preventDefault()}),this.fileBasedScanRegion.addEventListener("drop",function(e){e.stopPropagation(),e.preventDefault(),i.fileBasedScanRegion.style.border=i.fileBasedScanRegionDefaultBorder();var t=e.dataTransfer;if(t){var r=t.files;if(!r||0===r.length)return;for(var s=!1,a=0;a<r.length;++a){var l=r.item(a);if(l){if(l.type.match(/image.*/)){s=!0;var c=l.name;i.setImageNameToButton(c),n(l),o.innerText=Qr.dragAndDropMessage();break}}}s||(o.innerText=Qr.dragAndDropMessageOnlyImages())}})}return e.prototype.hide=function(){this.fileBasedScanRegion.style.display="none",this.fileScanInput.disabled=!0},e.prototype.show=function(){this.fileBasedScanRegion.style.display="block",this.fileScanInput.disabled=!1},e.prototype.isShowing=function(){return"block"===this.fileBasedScanRegion.style.display},e.prototype.resetValue=function(){this.fileScanInput.value="",this.setInitialValueToButton()},e.prototype.createFileBasedScanRegion=function(){var e=document.createElement("div");return e.style.textAlign="center",e.style.margin="auto",e.style.width="80%",e.style.maxWidth="600px",e.
vendor: 17,776 bytes, line 2
2style.border=this.fileBasedScanRegionDefaultBorder(),e.style.padding="10px",e.style.marginBottom="10px",e},e.prototype.fileBasedScanRegionDefaultBorder=function(){return"6px dashed #ebebeb"},e.prototype.fileBasedScanRegionActiveBorder=function(){return"6px dashed rgb(153 151 151)"},e.prototype.createDragAndDropMessage=function(){var e=document.createElement("div");return e.innerText=Qr.dragAndDropMessage(),e.style.fontWeight="400",e},e.prototype.setImageNameToButton=function(e){if(e.length>20){var t=e.substring(0,8),n=e.length,r=e.substring(n-8,n);e="".concat(t,"....").concat(r)}var i=Qr.fileSelectionChooseAnother()+" - "+e;this.fileSelectionButton.innerText=i},e.prototype.setInitialValueToButton=function(){var e=Qr.fileSelectionChooseImage()+" - "+Qr.fileSelectionNoImageSelected();this.fileSelectionButton.innerText=e},e.prototype.getFileScanInputId=function(){return"html5-qrcode-private-filescan-input"},e.create=function(t,n,r){return new e(t,n,r)},e}(),Ki=function(){function e(e){this.selectElement=Yi.createElement("select",Wi.CAMERA_SELECTION_SELECT_ID),this.cameras=e,this.options=[]}return e.prototype.render=function(e){var t=document.createElement("span");t.style.marginRight="10px";var n=this.cameras.length;if(0===n)throw new Error("No cameras found");if(1===n)t.style.display="none";else{var r=Qr.selectCamera();t.innerText="".concat(r," (").concat(this.cameras.length,") ")}for(var i=1,o=0,s=this.cameras;o<s.length;o++){var a=s[o],l=a.id,c=null==a.label?l:a.label;c&&""!==c||(c=[Qr.anonymousCameraPrefix(),i++].join(" "));var u=document.createElement("option");u.value=l,u.innerText=c,this.options.push(u),this.selectElement.appendChild(u)}t.appendChild(this.selectElement),e.appendChild(t)},e.prototype.disable=function(){this.selectElement.disabled=!0},e.prototype.isDisabled=function(){return!0===this.selectElement.disabled},e.prototype.enable=function(){this.selectElement.disabled=!1},e.prototype.getValue=function(){return this.selectElement.value},e.prototype.hasValue=function(e){for(var t=0,n=this.options;t<n.length;t++){if(n[t].value===e)return!0}return!1},e.prototype.setValue=function(e){if(!this.hasValue(e))throw new Error("".concat(e," is not present in the camera list."));this.selectElement.value=e},e.prototype.hasSingleItem=function(){return 1===this.cameras.length},e.prototype.numCameras=function(){return this.cameras.length},e.create=function(t,n){var r=new e(n);return r.render(t),r},e}(),Ji=function(){function e(){this.onChangeCallback=null,this.zoomElementContainer=document.createElement("div"),this.rangeInput=Yi.createElement("input",Wi.ZOOM_SLIDER_ID),this.rangeInput.type="range",this.rangeText=document.createElement("span"),this.rangeInput.min="1",this.rangeInput.max="5",this.rangeInput.value="1",this.rangeInput.step="0.1"}return e.prototype.render=function(e,t){this.zoomElementContainer.style.display=t?"block":"none",this.zoomElementContainer.style.padding="5px 10px",this.zoomElementContainer.style.textAlign="center",e.appendChild(this.zoomElementContainer),this.rangeInput.style.display="inline-block",this.rangeInput.style.width="50%",this.rangeInput.style.height="5px",this.rangeInput.style.background="#d3d3d3",this.rangeInput.style.outline="none",this.rangeInput.style.opacity="0.7";var n=Qr.zoom();this.rangeText.innerText="".concat(this.rangeInput.value,"x ").concat(n),this.rangeText.style.marginRight="10px";var r=this;this.rangeInput.addEventListener("input",function(){return r.onValueChange()}),this.rangeInput.addEventListener("change",function(){return r.onValueChange()}),this.zoomElementContainer.appendChild(this.rangeInput),this.zoomElementContainer.appendChild(this.rangeText)},e.prototype.onValueChange=function(){var e=Qr.zoom();this.rangeText.innerText="".concat(this.rangeInput.value,"x ").concat(e),this.onChangeCallback&&this.onChangeCallback(parseFloat(this.rangeInput.value))},e.prototype.setValues=function(e,t,n,r){this.rangeInput.min=e.toString(),this.rangeInput.max=t.toString(),this.rangeInput.step=r.toString(),this.rangeInput.value=n.toString(),this.onValueChange()},e.prototype.show=function(){this.zoomElementContainer.style.display="block"},e.prototype.hide=function(){this.zoomElementContainer.style.display="none"},e.prototype.setOnCameraZoomValueChangeCallback=function(e){this.onChangeCallback=e},e.prototype.removeOnCameraZoomValueChangeCallback=function(){this.onChangeCallback=null},e.create=function(t,n){var r=new e;return r.render(t,n),r},e}();!function(e){e[e.STATUS_DEFAULT=0]="STATUS_DEFAULT",e[e.STATUS_SUCCESS=1]="STATUS_SUCCESS",e[e.STATUS_WARNING=2]="STATUS_WARNING",e[e.STATUS_REQUESTING_PERMISSION=3]="STATUS_REQUESTING_PERMISSION"}(_i||(_i={}));!function(){function e(e,t,n){if(this.lastMatchFound=null,this.cameraScanImage=null,this.fileScanImage=null,this.fileSelectionUi=null,this.elementId=e,this.config=this.createConfig(t),this.verbose=!0===n,!document.getElementById(e))throw"HTML Element with id=".concat(e," not found");this.scanTypeSelector=new Gi(this.config.supportedScanTypes),this.currentScanType=this.scanTypeSelector.getDefaultScanType(),this.sectionSwapAllowed=!0,this.logger=new Yr(this.verbose),this.persistedDataManager=new Bi,!0!==t.rememberLastUsedCamera&&this.persistedDataManager.reset()}e.prototype.render=function(e,t){var n=this;this.lastMatchFound=null,this.qrCodeSuccessCallback=function(t,r){if(e)e(t,r);else{if(n.lastMatchFound===t)return;n.lastMatchFound=t,n.setHeaderMessage(Qr.lastMatch(t),_i.STATUS_SUCCESS)}},this.qrCodeErrorCallback=function(e,n){t&&t(e,n)};var r,i,o=document.getElementById(this.elementId);if(!o)throw"HTML Element with id=".concat(this.elementId," not found");o.innerHTML="",this.createBasicLayout(o),this.html5Qrcode=new Ri(this.getScanRegionId(),(r=this.config,i=this.verbose,{formatsToSupport:r.formatsToSupport,useBarCodeDetectorIfSupported:r.useBarCodeDetectorIfSupported,experimentalFeatures:r.experimentalFeatures,verbose:i}))},e.prototype.pause=function(e){(Xr(e)||!0!==e)&&(e=!1),this.getHtml5QrcodeOrFail().pause(e)},e.prototype.resume=function(){this.getHtml5QrcodeOrFail().resume()},e.prototype.getState=function(){return this.getHtml5QrcodeOrFail().getState()},e.prototype.clear=function(){var e=this,t=function(){var t=document.getElementById(e.elementId);t&&(t.innerHTML="",e.resetBasicLayout(t))};return this.html5Qrcode?new Promise(function(n,r){e.html5Qrcode?e.html5Qrcode.isScanning?e.html5Qrcode.stop().then(function(r){e.html5Qrcode?(e.html5Qrcode.clear(),t(),n()):n()}).catch(function(t){e.verbose&&e.logger.logError("Unable to stop qrcode scanner",t),r(t)}):(e.html5Qrcode.clear(),t(),n()):n()}):Promise.resolve()},e.prototype.getRunningTrackCapabilities=function(){return this.getHtml5QrcodeOrFail().getRunningTrackCapabilities()},e.prototype.getRunningTrackSettings=function(){return this.getHtml5QrcodeOrFail().getRunningTrackSettings()},e.prototype.applyVideoConstraints=function(e){return this.getHtml5QrcodeOrFail().applyVideoConstraints(e)},e.prototype.getHtml5QrcodeOrFail=function(){if(!this.html5Qrcode)throw"Code scanner not initialized.";return this.html5Qrcode},e.prototype.createConfig=function(e){return e?(e.fps||(e.fps=Vr.SCAN_DEFAULT_FPS),e.rememberLastUsedCamera!==!Vr.DEFAULT_REMEMBER_LAST_CAMERA_USED&&(e.rememberLastUsedCamera=Vr.DEFAULT_REMEMBER_LAST_CAMERA_USED),e.supportedScanTypes||(e.supportedScanTypes=Vr.DEFAULT_SUPPORTED_SCAN_TYPE),e):{fps:Vr.SCAN_DEFAULT_FPS,rememberLastUsedCamera:Vr.DEFAULT_REMEMBER_LAST_CAMERA_USED,supportedScanTypes:Vr.DEFAULT_SUPPORTED_SCAN_TYPE}},e.prototype.createBasicLayout=function(e){e.style.position="relative",e.style.padding="0px",e.style.border="1px solid silver",this.createHeader(e);var t=document.createElement("div"),n=this.getScanRegionId();t.id=n,t.style.width="100%",t.style.minHeight="100px",t.style.textAlign="center",e.appendChild(t),Gi.isCameraScanType(this.currentScanType)?this.insertCameraScanImageToScanRegion():this.insertFileScanImageToScanRegion();var r=document.createElement("div"),i=this.getDashboardId();r.id=i,r.style.width="100%",e.appendChild(r),this.setupInitialDashboard(r)},e.prototype.resetBasicLayout=function(e){e.style.border="none"},e.prototype.setupInitialDashboard=function(e){this.createSection(e),this.createSectionControlPanel(),this.scanTypeSelector.hasMoreThanOneScanType()&&this.createSectionSwap()},e.prototype.createHeader=function(e){var t=document.createElement("div");t.style.textAlign="left",t.style.margin="0px",e.appendChild(t),(new ji).renderInto(t);var n=document.createElement("div");n.id=this.getHeaderMessageContainerId(),n.style.display="none",n.style.textAlign="center",n.style.fontSize="14px",n.style.padding="2px 10px",n.style.margin="4px",n.style.borderTop="1px solid #f6f6f6",t.appendChild(n)},e.prototype.createSection=function(e){var t=document.createElement("div");t.id=this.getDashboardSectionId(),t.style.width="100%",t.style.padding="10px 0px 10px 0px",t.style.textAlign="left",e.appendChild(t)},e.prototype.createCameraListUi=function(e,t,n){var r=this;r.showHideScanTypeSwapLink(!1),r.setHeaderMessage(Qr.cameraPermissionRequesting());var i=function(){n||r.createPermissionButton(e,t)};Ri.getCameras().then(function(n){r.persistedDataManager.setHasPermission(!0),r.showHideScanTypeSwapLink(!0),r.resetHeaderMessage(),n&&n.length>0?(e.removeChild(t),r.renderCameraSelection(n)):(r.setHeaderMessage(Qr.noCameraFound(),_i.STATUS_WARNING),i())}).catch(function(e){r.persistedDataManager.setHasPermission(!1),n?n.disabled=!1:i(),r.setHeaderMessage(e,_i.STATUS_WARNING),r.showHideScanTypeSwapLink(!0)})},e.prototype.createPermissionButton=function(e,t){var n=this,r=Yi.createElement("button",this.getCameraPermissionButtonId());r.innerText=Qr.cameraPermissionTitle(),r.addEventListener("click",function(){r.disabled=!0,n.createCameraListUi(e,t,r)}),t.appendChild(r)},e.prototype.createPermissionsUi=function(e,t){var n=this;Gi.isCameraScanType(this.currentScanType)&&this.persistedDataManager.hasCameraPermissions()?zi.hasPermissions().then(function(r){r?n.createCameraListUi(e,t):(n.persistedDataManager.setHasPermission(!1),n.createPermissionButton(e,t))}).catch(function(r){n.persistedDataManager.setHasPermission(!1),n.createPermissionButton(e,t)}):this.createPermissionButton(e,t)},e.prototype.createSectionControlPanel=function(){var e=document.getElementById(this.getDashboardSectionId()),t=document.createElement("div");e.appendChild(t);var n=document.createElement("div");n.id=this.getDashboardSectionCameraScanRegionId(),n.style.display=Gi.isCameraScanType(this.currentScanType)?"block":"none",t.appendChild(n);var r=document.createElement("div");r.style.textAlign="center",n.appendChild(r),this.scanTypeSelector.isCameraScanRequired()&&this.createPermissionsUi(n,r),this.renderFileScanUi(t)},e.prototype.renderFileScanUi=function(e){var t=Gi.isFileScanType(this.currentScanType),n=this;this.fileSelectionUi=Qi.create(e,t,function(e){if(!n.html5Qrcode)throw"html5Qrcode not defined";Gi.isFileScanType(n.currentScanType)&&(n.setHeaderMessage(Qr.loadingImage()),n.html5Qrcode.scanFileV2(e,!0).then(function(e){n.resetHeaderMessage(),n.qrCodeSuccessCallback(e.decodedText,e)}).catch(function(e){n.setHeaderMessage(e,_i.STATUS_WARNING),n.qrCodeErrorCallback(e,Wr.createFrom(e))}))})},e.prototype.renderCameraSelection=function(e){var t=this,n=this,r=document.getElementById(this.getDashboardSectionCameraScanRegionId());r.style.textAlign="center";var i=Ji.create(r,!1),o=Ki.create(r,e),s=document.createElement("span"),a=Yi.createElement("button",Wi.CAMERA_START_BUTTON_ID);a.innerText=Qr.scanButtonStartScanningText(),s.appendChild(a);var l,c=Yi.createElement("button",Wi.CAMERA_STOP_BUTTON_ID);c.innerText=Qr.scanButtonStopScanningText(),c.style.display="none",c.disabled=!0,s.appendChild(c);r.appendChild(s);var u=function(e){e||(a.style.display="none"),a.innerText=Qr.scanButtonStartScanningText(),a.style.opacity="1",a.disabled=!1,e&&(a.style.display="inline-block")};if(a.addEventListener("click",function(e){a.innerText=Qr.scanButtonScanningStarting(),o.disable(),a.disabled=!0,a.style.opacity="0.5",t.scanTypeSelector.hasMoreThanOneScanType()&&n.showHideScanTypeSwapLink(!1),n.resetHeaderMessage();var r,h=o.getValue();n.persistedDataManager.setLastUsedCameraId(h),n.html5Qrcode.start(h,(r=n.config,{fps:r.fps,qrbox:r.qrbox,aspectRatio:r.aspectRatio,disableFlip:r.disableFlip,videoConstraints:r.videoConstraints}),n.qrCodeSuccessCallback,n.qrCodeErrorCallback).then(function(e){c.disabled=!1,c.style.display="inline-block",u(!1);var r=n.html5Qrcode.getRunningTrackCameraCapabilities();!0===t.config.showTorchButtonIfSupported&&function(e){e.torchFeature().isSupported()?(l?l.updateTorchCapability(e.torchFeature()):l=Zi.create(s,e.torchFeature(),{display:"none",marginLeft:"5px"},function(e){n.setHeaderMessage(e,_i.STATUS_WARNING)}),l.show()):l&&l.hide()}(r),!0===t.config.showZoomSliderIfSupported&&function(e){var n=e.zoomFeature();if(n.isSupported()){i.setOnCameraZoomValueChangeCallback(function(e){n.apply(e)});var r,o,s,a=1;t.config.defaultZoomValueIfSupported&&(a=t.config.defaultZoomValueIfSupported),r=a,o=n.min(),a=r>(s=n.max())?s:r<o?o:r,i.setValues(n.min(),n.max(),a,n.step()),i.show()}}(r)}).catch(function(e){n.showHideScanTypeSwapLink(!0),o.enable(),u(!0),n.setHeaderMessage(e,_i.STATUS_WARNING)})}),o.hasSingleItem()&&a.click(),c.addEventListener("click",function(e){if(!n.html5Qrcode)throw"html5Qrcode not defined";c.disabled=!0,n.html5Qrcode.stop().then(function(e){t.scanTypeSelector.hasMoreThanOneScanType()&&n.showHideScanTypeSwapLink(!0),o.enable(),a.disabled=!1,c.style.display="none",a.style.display="inline-block",l&&(l.reset(),l.hide()),i.removeOnCameraZoomValueChangeCallback(),i.hide(),n.insertCameraScanImageToScanRegion()}).catch(function(e){c.disabled=!1,n.setHeaderMessage(e,_i.STATUS_WARNING)})}),n.persistedDataManager.getLastUsedCameraId()){var h=n.persistedDataManager.getLastUsedCameraId();o.hasValue(h)?(o.setValue(h),a.click()):n.persistedDataManager.resetLastUsedCameraId()}},e.prototype.createSectionSwap=function(){var e=this,t=Qr.textIfCameraScanSelected(),n=Qr.textIfFileScanSelected(),r=document.getElementById(this.getDashboardSectionId()),i=document.createElement("div");i.style.textAlign="center";var o=Yi.createElement("span",this.getDashboardSectionSwapLinkId());o.style.textDecoration="underline",o.style.cursor="pointer",o.innerText=Gi.isCameraScanType(this.currentScanType)?t:n,o.addEventListener("click",function(){e.sectionSwapAllowed?(e.resetHeaderMessage(),e.fileSelectionUi.resetValue(),e.sectionSwapAllowed=!1,Gi.isCameraScanType(e.currentScanType)?(e.clearScanRegion(),e.getCameraScanRegion().style.display="none",e.fileSelectionUi.show(),o.innerText=n,e.currentScanType=Fr.SCAN_TYPE_FILE,e.insertFileScanImageToScanRegion()):(e.clearScanRegion(),e.getCameraScanRegion().style.display="block",e.fileSelectionUi.hide(),o.innerText=t,e.currentScanType=Fr.SCAN_TYPE_CAMERA,e.insertCameraScanImageToScanRegion(),e.startCameraScanIfPermissionExistsOnSwap()),e.sectionSwapAllowed=!0):e.verbose&&e.logger.logError("Section swap called when not allowed")}),i.appendChild(o),r.appendChild(i)},e.prototype.startCameraScanIfPermissionExistsOnSwap=function(){var e=this,t=this;this.persistedDataManager.hasCameraPermissions()&&zi.hasPermissions().then(function(n){if(n){var r=document.getElementById(t.getCameraPermissionButtonId());if(!r)throw e.logger.logError("Permission button not found, fail;"),"Permission button not found";r.click()}else t.persistedDataManager.setHasPermission(!1)}).catch(function(e){t.persistedDataManager.setHasPermission(!1)})},e.prototype.resetHeaderMessage=function(){document.getElementById(this.getHeaderMessageContainerId()).style.display="none"},e.prototype.setHeaderMessage=function(e,t){t||(t=_i.STATUS_DEFAULT);var n=this.getHeaderMessageDiv();switch(n.innerText=e,n.style.display="block",t){case _i.STATUS_SUCCESS:n.style.background="rgba(106, 175, 80, 0.26)",n.style.color="#477735";break;case _i.STATUS_WARNING:n.style.background="rgba(203, 36, 49, 0.14)",n.style.color="#cb2431";break;case _i.STATUS_DEFAULT:default:n.style.background="rgba(0, 0, 0, 0)",n.style.color="rgb(17, 17, 17)"}},e.prototype.showHideScanTypeSwapLink=function(e){this.scanTypeSelector.hasMoreThanOneScanType()&&(!0!==e&&(e=!1),this.sectionSwapAllowed=e,this.getDashboardSectionSwapLink().style.display=e?"inline-block":"none")},e.prototype.insertCameraScanImageToScanRegion=function(){var e=this,t=document.getElementById(this.getScanRegionId());if(this.cameraScanImage)return t.innerHTML="<br>",void t.appendChild(this.cameraScanImage);this.cameraScanImage=new Image,this.cameraScanImage.onload=function(n){t.innerHTML="<br>",t.appendChild(e.cameraScanImage)},this.cameraScanImage.width=64,this.cameraScanImage.style.opacity="0.8",this.cameraScanImage.src=Pi,this.cameraScanImage.alt=Qr.cameraScanAltText()},e.prototype.insertFileScanImageToScanRegion=function(){var e=this,t=document.getElementById(this.getScanRegionId());if(this.fileScanImage)return t.innerHTML="<br>",void t.appendChild(this.fileScanImage);this.fileScanImage=new Image,this.fileScanImage.onload=function(n){t.innerHTML="<br>",t.appendChild(e.fileScanImage)},this.fileScanImage.width=64,this.fileScanImage.style.opacity="0.8",this.fileScanImage.src=ki,this.fileScanImage.alt=Qr.fileScanAltText()},e.prototype.clearScanRegion=function(){document.getElementById(this.getScanRegionId()).innerHTML=""},e.prototype.getDashboardSectionId=function(){return"".concat(this.elementId,"__dashboard_section")},e.prototype.getDashboardSectionCameraScanRegionId=function(){return"".concat(this.elementId,"__dashboard_section_csr")},e.prototype.getDashboardSectionSwapLinkId=function(){return Wi.SCAN_TYPE_CHANGE_ANCHOR_ID},e.prototype.getScanRegionId=function(){return"".concat(this.elementId,"__scan_regi
2on")},e.prototype.getDashboardId=function(){return"".concat(this.elementId,"__dashboard")},e.prototype.getHeaderMessageContainerId=function(){return"".concat(this.elementId,"__header_message")},e.prototype.getCameraPermissionButtonId=function(){return Wi.CAMERA_PERMISSION_BUTTON_ID},e.prototype.getCameraScanRegion=function(){return document.getElementById(this.getDashboardSectionCameraScanRegionId())},e.prototype.getDashboardSectionSwapLink=function(){return document.getElementById(this.getDashboardSectionSwapLinkId())},e.prototype.getHeaderMessageDiv=function(){return document.getElementById(this.getHeaderMessageContainerId())}}();function eo(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",i=n.toStringTag||"@@toStringTag";function o(n,r,i,o){var l=r&&r.prototype instanceof a?r:a,c=Object.create(l.prototype);return to(c,"_invoke",function(n,r,i){var o,a,l,c=0,u=i||[],h=!1,d={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(t,n){return o=t,a=0,l=e,d.n=n,s}};function f(n,r){for(a=n,l=r,t=0;!h&&c&&!i&&t<u.length;t++){var i,o=u[t],f=d.p,p=o[2];n>3?(i=p===r)&&(l=o[(a=o[4])?5:(a=3,3)],o[4]=o[5]=e):o[0]<=f&&((i=n<2&&f<o[1])?(a=0,d.v=r,d.n=o[1]):f<p&&(i=n<3||o[0]>r||r>p)&&(o[4]=n,o[5]=r,d.n=p,a=0))}if(i||n>1)return s;throw h=!0,r}return function(i,u,p){if(c>1)throw TypeError("Generator is already running");for(h&&1===u&&f(u,p),a=u,l=p;(t=a<2?e:l)||!h;){o||(a?a<3?(a>1&&(d.n=-1),f(a,l)):d.n=l:d.v=l);try{if(c=2,o){if(a||(i="next"),t=o[i]){if(!(t=t.call(o,l)))throw TypeError("iterator result is not an object");if(!t.done)return t;l=t.value,a<2&&(a=0)}else 1===a&&(t=o.return)&&t.call(o),a<2&&(l=TypeError("The iterator does not provide a '"+i+"' method"),a=1);o=e}else if((t=(h=d.n<0)?l:n.call(r,d))!==s)break}catch(t){o=e,a=1,l=t}finally{c=1}}return{value:t,done:h}}}(n,i,o),!0),c}var s={};function a(){}function l(){}function c(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(to(t={},r,function(){return this}),t),h=c.prototype=a.prototype=Object.create(u);function d(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,to(e,i,"GeneratorFunction")),e.prototype=Object.create(h),e}return l.prototype=c,to(h,"constructor",c),to(c,"constructor",l),l.displayName="GeneratorFunction",to(c,i,"GeneratorFunction"),to(h),to(h,i,"Generator"),to(h,r,function(){return this}),to(h,"toString",function(){return"[object Generator]"}),(eo=function(){return{w:o,m:d}})()}function to(e,t,n,r){var i=Object.defineProperty;try{i({},"",{})}catch(e){i=0}to=function(e,t,n,r){function o(t,n){to(e,t,function(e){return this._invoke(t,n,e)})}t?i?i(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(o("next",0),o("throw",1),o("return",2))},to(e,t,n,r)}function no(e,t,n,r,i,o,s){try{var a=e[o](s),l=a.value}catch(e){return void n(e)}a.done?t(l):Promise.resolve(l).then(r,i)}function ro(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function s(e){no(o,r,i,s,a,"next",e)}function a(e){no(o,r,i,s,a,"throw",e)}s(void 0)})}}var io={mounted:function(){var e=this;this.scanner=null,this.scanning=!1,this.lastScannedText=null,this.cooldownTimer=null,this.scanFeedbackActive=!1,this.scanFeedbackTimer=null,this.handleEvent("start_scan",function(){return e.startScanning()}),this.handleEvent("stop_scan",function(){return e.stopScanning()}),this.handleEvent("scan_feedback",function(){return e.triggerScanFeedback()})},startScanning:function(){var e=this;return ro(eo().m(function t(){var n,r,i;return eo().w(function(t){for(;;)switch(t.p=t.n){case 0:if(!e.scanning){t.n=1;break}return t.a(2);case 1:if(r=null===(n=e.el.querySelector("[data-qr-reader]"))||void 0===n?void 0:n.id){t.n=2;break}return t.a(2);case 2:return e.scanner=new Ri(r),e.scanning=!0,e.lastScannedText=null,t.p=3,t.n=4,e.scanner.start({facingMode:"environment"},{fps:10,aspectRatio:1,qrbox:function(e,t){var n=Math.floor(.7*Math.min(e,t));return{width:n,height:n}}},function(t){e.scanFeedbackActive||t===e.lastScannedText||(e.lastScannedText=t,e.triggerScanFeedback(),clearTimeout(e.cooldownTimer),e.cooldownTimer=setTimeout(function(){e.lastScannedText=null},3e3),e.pushEvent("qr_scanned",{text:t}))},function(){});case 4:t.n=6;break;case 5:t.p=5,i=t.v,e.pushEvent("scan_error",{message:i.toString()}),e.scanning=!1;case 6:return t.a(2)}},t,null,[[3,5]])}))()},triggerScanFeedback:function(){var e=this;if(!this.scanFeedbackActive){var t=this.el.querySelector("[data-scan-feedback]");t&&(this.scanFeedbackActive=!0,clearTimeout(this.scanFeedbackTimer),t.classList.remove("is-active"),t.offsetWidth,t.classList.add("is-active"),this.scanFeedbackTimer=setTimeout(function(){t.classList.remove("is-active"),e.scanFeedbackActive=!1},1200))}},stopScanning:function(){var e=this;return ro(eo().m(function t(){return eo().w(function(t){for(;;)switch(t.p=t.n){case 0:if(e.scanner&&e.scanning){t.n=1;break}return t.a(2);case 1:return t.p=1,t.n=2,e.scanner.stop();case 2:t.n=4;break;case 3:t.p=3,t.v;case 4:e.scanner=null,e.scanning=!1,e.lastScannedText=null,e.scanFeedbackActive=!1,clearTimeout(e.scanFeedbackTimer);case 5:return t.a(2)}},t,null,[[1,3]])}
2))()},destroyed:function(){this.stopScanning(),clearTimeout(this.cooldownTimer),clearTimeout(this.scanFeedbackTimer)}};const oo=io,so={child:null,currentBounds:null,debug:!1,duration:300,easing:"ease-in-out",fill:"both",mounted(){this.debug=Object.hasOwn(this.el.dataset,"debug"),this.duration=parseInt(this.el.dataset.duration||"300"),this.easing=this.el.dataset.easing||"ease-in-out",this.fill=this.el.dataset.fill||"both"},beforeUpdate(){this.child=this.el.children[0],this.currentBounds=this.child.getBoundingClientRect(),this.debug&&console.log("Before Update:",{bounds:{left:this.currentBounds.left,top:this.currentBounds.top,width:this.currentBounds.width,height:this.currentBounds.height}})},updated(){const e=this.child.getBoundingClientRect(),t=this.currentBounds.left-e.left,n=this.currentBounds.top-e.top,r=this.currentBounds.width/e.width,i=this.currentBounds.height/e.height,o={left:e.left,top:e.top,width:e.width,height:e.height},s=this.child.animate([{transformOrigin:"top left",transform:`translate(${t}px, ${n}px) scale(${r}, ${i})`},{transformOrigin:"top left",transform:"none"}],{duration:this.duration,easing:this.easing,fill:this.fill});this.debug&&(s.onfinish=()=>{requestAnimationFrame(()=>{const e=this.child.getBoundingClientRect();console.log("Animation finished:",{expected:o,actual:{left:e.left,top:e.top,width:e.width,height:e.height},difference:{x:Math.abs(e.left-o.left),y:Math.abs(e.top-o.top),width:Math.abs(e.width-o.width),height:Math.abs(e.height-o.height)}})})})},destroyed(){},disconnected(){},reconnected(){}},ao=e=>{const[t,n]=e.trim().split(" "),r=1===t.indexOf("/");return{component:r?t.slice(2,-1):t.slice(1,-1),path:n,closing:r}};r(296);var lo=e=>{if("function"==typeof e)return e;return function(){return e}},co="undefined"!=typeof self?self:null,uo="undefined"!=typeof window?window:null,ho=co||uo||ho,fo=0,po=1,go=2,mo=3,wo="closed",yo="errored",Eo="joined",vo="joining",Ao="leaving",Co="phx_close",bo="phx_error",_o="phx_join",So="phx_reply",Io="phx_leave",To="longpoll",Do="websocket",No=4,Oo=class{constructor(e,t,n,r){this.channel=e,this.event=t,this.payload=n||function(){return{}},this.receivedResp=null,this.timeout=r,this.timeoutTimer=null,this.recHooks=[],this.sent=!1}resend(e){this.timeout=e,this.reset(),this.send()}send(){this.hasReceived("timeout")||(this.startTimeout(),this.sent=!0,this.channel.socket.push({topic:this.channel.topic,event:this.event,payload:this.payload(),ref:this.ref,join_ref:this.channel.joinRef()}))}receive(e,t){return this.hasReceived(e)&&t(this.receivedResp.response),this.recHooks.push({status:e,callback:t}),this}reset(){this.cancelRefEvent(),this.ref=null,this.refEvent=null,this.receivedResp=null,this.sent=!1}matchReceive({status:e,response:t,_ref:n}){this.recHooks.filter(t=>t.status===e).forEach(e=>e.callback(t))}cancelRefEvent(){this.refEvent&&this.channel.off(this.refEvent)}cancelTimeout(){clearTimeout(this.timeoutTimer),this.timeoutTimer=null}startTimeout(){this.timeoutTimer&&this.cancelTimeout(),this.ref=this.channel.socket.makeRef(),this.refEvent=this.channel.replyEventName(this.ref),this.channel.on(this.refEvent,e=>{this.cancelRefEvent(),this.cancelTimeout(),this.receivedResp=e,this.matchReceive(e)}),this.timeoutTimer=setTimeout(()=>{this.trigger("timeout",{})},this.timeout)}hasReceived(e){return this.receivedResp&&this.receivedResp.status===e}trigger(e,t){this.channel.trigger(this.refEvent,{status:e,response:t})}},Ro=class{constructor(e,t){this.callback=e,this.timerCalc=t,this.timer=null,this.tries=0}reset(){this.tries=0,clearTimeout(this.timer)}scheduleTimeout(){clearTimeout(this.timer),this.timer=setTimeout(()=>{this.tries=this.tries+1,this.callback()},this.timerCalc(this.tries+1))}},Mo=class{constructor(e,t,n){this.state=wo,this.topic=e,this.params=lo(t||{}),this.socket=n,this.bindings=[],this.bindingRef=0,this.timeout=this.socket.timeout,this.joinedOnce=!1,this.joinPush=new Oo(this,_o,this.params,this.timeout),this.pushBuffer=[],this.stateChangeRefs=[],this.rejoinTimer=new Ro(()=>{this.socket.isConnected()&&this.rejoin()},this.socket.rejoinAfterMs),this.stateChangeRefs.push(this.socket.onError(()=>this.rejoinTimer.reset())),this.stateChangeRefs.push(this.socket.onOpen(()=>{this.rejoinTimer.reset(),this.isErrored()&&this.rejoin()})),this.joinPush.receive("ok",()=>{this.state=Eo,this.rejoinTimer.reset(),this.pushBuffer.forEach(e
2=>e.send()),this.pushBuffer=[]}),this.joinPush.receive("error",()=>{this.state=yo,this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.onClose(()=>{this.rejoinTimer.reset(),this.socket.hasLogger()&&this.socket.log("channel",`close ${this.topic} ${this.joinRef()}`),this.state=wo,this.socket.remove(this)}),this.onError(e=>{this.socket.hasLogger()&&this.socket.log("channel",`error ${this.topic}`,e),this.isJoining()&&this.joinPush.reset(),this.state=yo,this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.joinPush.receive("timeout",()=>{this.socket.hasLogger()&&this.socket.log("channel",`timeout ${this.topic} (${this.joinRef()})`,this.joinPush.timeout),new Oo(this,Io,lo({}),this.timeout).send(),this.state=yo,this.joinPush.reset(),this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.on(So,(e,t)=>{this.trigger(this.replyEventName(t),e)})}join(e=this.timeout){if(this.joinedOnce)throw new Error("tried to join multiple times. 'join' can only be called a single time per channel instance");return this.timeout=e,this.joinedOnce=!0,this.rejoin(),this.joinPush}onClose(e){this.on(Co,e)}onError(e){return this.on(bo,t=>e(t))}on(e,t){let n=this.bindingRef++;return this.bindings.push({event:e,ref:n,callback:t}),n}off(e,t){this.bindings=this.bindings.filter(n=>!(n.event===e&&(void 0===t||t===n.ref)))}canPush(){return this.socket.isConnected()&&this.isJoined()}push(e,t,n=this.timeout){if(t=t||{},!this.joinedOnce)throw new Error(`tried to push '${e}' to '${this.topic}' before joining. Use channel.join() before pushing events`);let r=new Oo(this,e,function(){return t},n);return this.canPush()?r.send():(r.startTimeout(),this.pushBuffer.push(r)),r}leave(e=this.timeout){this.rejoinTimer.reset(),this.joinPush.cancelTimeout(),this.state=Ao;let t=()=>{this.socket.hasLogger()&&this.socket.log("channel",`leave ${this.topic}`),this.trigger(Co,"leave")},n=new Oo(this,Io,lo({}),e);return n.receive("ok",()=>t()).receive("timeout",()=>t()),n.send(),this.canPush()||n.trigger("ok",{}),n}onMessage(e,t,n){return t}
2isMember(e,t,n,r){return this.topic===e&&(!r||r===this.joinRef()||(this.socket.hasLogger()&&this.socket.log("channel","dropping outdated message",{topic:e,event:t,payload:n,joinRef:r}),!1))}joinRef(){return this.joinPush.ref}rejoin(e=this.timeout){this.isLeaving()||(this.socket.leaveOpenTopic(this.topic),this.state=vo,this.joinPush.resend(e))}trigger(e,t,n,r){let i=this.onMessage(e,t,n,r);if(t&&!i)throw new Error("channel onMessage callbacks must return the payload, modified or unmodified");let o=this.bindings.filter(t=>t.event===e);for(let e=0;e<o.length;e++){o[e].callback(i,n,r||this.joinRef())}}replyEventName(e){return`chan_reply_${e}`}isClosed(){return this.state===wo}isErrored(){return this.state===yo}isJoined(){return this.state===Eo}isJoining(){return this.state===vo}isLeaving(){return this.state===Ao}},Po=class{static request(e,t,n,r,i,o,s){if(ho.XDomainRequest){let n=new ho.XDomainRequest;return this.xdomainRequest(n,e,t,r,i,o,s)}{let a=new ho.XMLHttpRequest;return this.xhrRequest(a,e,t,n,r,i,o,s)}}static xdomainRequest(e,t,n,r,i,o,s){return e.timeout=i,e.open(t,n),e.onload=()=>{let t=this.parseJSON(e.responseText);s&&s(t)},o&&(e.ontimeout=o),e.onprogress=()=>{},e.send(r),e}static xhrRequest(e,t,n,r,i,o,s,a){return e.open(t,n,!0),e.timeout=o,e.setRequestHeader("Content-Type",r),e.onerror=()=>a&&a(null),e.onreadystatechange=()=>{if(e.readyState===No&&a){let t=this.parseJSON(e.responseText);a(t)}},s&&(e.ontimeout=s),e.send(i),e}static parseJSON(e){if(!e||""===e)return null;try{return JSON.parse(e)}catch(t){return console&&console.log("failed to parse JSON response",e),null}}static serialize(e,t){let n=[];for(var r in e){if(!Object.prototype.hasOwnProperty.call(e,r))continue;let i=t?`${t}[${r}]`:r,o=e[r];"object"==typeof o?n.push(this.serialize(o,i)):n.push(encodeURIComponent(i)+"="+encodeURIComponent(o))}return n.join("&")}static appendParams(e,t){if(0===Object.keys(t).length)return e;let n=e.match(/\?/)?"&":"?";return`${e}${n}${this.serialize(t)}`}},ko=class{constructor(e){this.endPoint=null,this.token=null,this.skipHeartbeat=!0,this.reqs=new Set,this.awaitingBatchAck=!1,this.currentBatch=null,this.currentBatchTimer=null,this.batchBuffer=[],this.onopen=function(){},this.onerror=function(){},this.onmessage=function(){},this.onclose=function(){},this.pollEndpoint=this.normalizeEndpoint(e),this.readyState=fo,setTimeout(()=>this.poll(),0)}normalizeEndpoint(e){return e.replace("ws://","http://").replace("wss://","https://").replace(new RegExp("(.*)/"+Do),"$1/"+To)}endpointURL(){return Po.appendParams(this.pollEndpoint,{token:this.token})}closeAndRetry(e,t,n){this.close(e,t,n),this.readyState=fo}ontimeout(){this.onerror("timeout"),this.closeAndRetry(1005,"timeout",!1)}isActive(){return this.readyState===po||this.readyState===fo}poll(){this.ajax("GET","application/json",null,()=>this.ontimeout(),e=>{if(e){var{status:t,token:n,messages:r}=e;this.token=n}else t=0;switch(t){case 200:r.forEach(e=>{setTimeout(()=>this.onmessage({data:e}),0)}),this.poll();break;case 204:this.poll();break;case 410:this.readyState=po,this.onopen({}),this.poll();break;
2case 403:this.onerror(403),this.close(1008,"forbidden",!1);break;case 0:case 500:this.onerror(500),this.closeAndRetry(1011,"internal server error",500);break;default:throw new Error(`unhandled poll status ${t}`)}})}send(e){"string"!=typeof e&&(e=(e=>{let t="",n=new Uint8Array(e),r=n.byteLength;for(let e=0;e<r;e++)t+=String.fromCharCode(n[e]);return btoa(t)})(e)),this.currentBatch?this.currentBatch.push(e):this.awaitingBatchAck?this.batchBuffer.push(e):(this.currentBatch=[e],this.currentBatchTimer=setTimeout(()=>{this.batchSend(this.currentBatch),this.currentBatch=null},0))}batchSend(e){this.awaitingBatchAck=!0,this.ajax("POST","application/x-ndjson",e.join("\n"),()=>this.onerror("timeout"),e=>{this.awaitingBatchAck=!1,e&&200===e.status?this.batchBuffer.length>0&&(this.batchSend(this.batchBuffer),this.batchBuffer=[]):(this.onerror(e&&e.status),this.closeAndRetry(1011,"internal server error",!1))})}close(e,t,n){for(let e of this.reqs)e.abort();this.readyState=mo;let r=Object.assign({code:1e3,reason:void 0,wasClean:!0},{code:e,reason:t,wasClean:n});this.batchBuffer=[],clearTimeout(this.currentBatchTimer),this.currentBatchTimer=null,"undefined"!=typeof CloseEvent?this.onclose(new CloseEvent("close",r)):this.onclose(r)}ajax(e,t,n,r,i){let o;o=Po.request(e,this.endpointURL(),t,n,this.timeout,()=>{this.reqs.delete(o),r()},e=>{this.reqs.delete(o),this.isActive()&&i(e)}),this.reqs.add(o)}},xo={HEADER_LENGTH:1,META_LENGTH:4,KINDS:{push:0,reply:1,broadcast:2},encode(e,t){if(e.payload.constructor===ArrayBuffer)return t(this.binaryEncode(e));{let n=[e.join_ref,e.ref,e.topic,e.event,e.payload];return t(JSON.stringify(n))}},decode(e,t){if(e.constructor===ArrayBuffer)return t(this.binaryDecode(e));{let[n,r,i,o,s]=JSON.parse(e);return t({join_ref:n,ref:r,topic:i,event:o,payload:s})}},binaryEncode(e){let{join_ref:t,ref:n,event:r,topic:i,payload:o}=e,s=this.META_LENGTH+t.length+n.length+i.length+r.length,a=new ArrayBuffer(this.HEADER_LENGTH+s),l=new DataView(a),c=0;l.setUint8(c++,this.KINDS.push),l.setUint8(c++,t.length),l.setUint8(c++,n.length),l.setUint8(c++,i.length),l.setUint8(c++,r.length),Array.from(t,e=>l.setUint8(c++,e.charCodeAt(0))),Array.from(n,e=>l.setUint8(c++,e.charCodeAt(0))),Array.from(i,e=>l.setUint8(c++,e.charCodeAt(0))),Array.from(r,e=>l.setUint8(c++,e.charCodeAt(0)));var u=new Uint8Array(a.byteLength+o.byteLength);return u.set(new Uint8Array(a),0),u.set(new Uint8Array(o),a.byteLength),u.buffer},binaryDecode(e){let t=new DataView(e),n=t.getUint8(0),r=new TextDecoder;switch(n){case this.KINDS.push:return this.decodePush(e,t,r);case this.KINDS.reply:return this.decodeReply(e,t,r);case this.KINDS.broadcast:return this.decodeBroadcast(e,t,r)}},decodePush(e,t,n){let r=t.getUint8(1),i=t.getUint8(2),o=t.getUint8(3),s=this.HEADER_LENGTH+this.META_LENGTH-1,a=n.decode(e.slice(s,s+r));s+=r;let l=n.decode(e.slice(s,s+i));s+=i;let c=n.decode(e.slice(s,s+o));return s+=o,{join_ref:a,ref:null,topic:l,event:c,payload:e.slice(s,e.byteLength)}},decodeReply(e,t,n){let r=t.getUint8(1),i=t.getUint8(2),o=t.getUint8(3),s=t.getUint8(4),a=this.HEADER_LENGTH+this.META_LENGTH,l=n.decode(e.slice(a,a+r));a+=r;let c=n.decode(e.slice(a,a+i));a+=i;let u=n.decode(e.slice(a,a+o));a+=o;let h=n.decode(e.slice(a,a+s));a+=s;let d=e.slice(a,e.byteLength);return{join_ref:l,ref:c,topic:u,event:So,payload:{status:h,response:d}}},decodeBroadcast(e,t,n){let r=t.getUint8(1),i=t.getUint8(2),o=this.HEADER_LENGTH+2,s=n.decode(e.slice(o,o+r));o+=r;let a=n.decode(e.slice(o,o+i));return o+=i,{join_ref:null,ref:null,topic:s,event:a,payload:e.slice(o,e.byteLength)}}},Lo=r(267),Bo=r.n(Lo),Fo="consecutive-reloads",Uo=["phx-click-loading","phx-change-loading","phx-submit-loading","phx-keydown-loading","phx-keyup-loading","phx-blur-loading","phx-focus-loading","phx-hook-loading"],jo="data-phx-component",Ho="data-phx-link",Vo="data-phx-ref-loading",zo="data-phx-ref-src",Go="data-phx-ref-lock",Wo="phx-pending-refs",Yo="track-uploads",Xo="data-phx-upload-ref",$o="data-phx-preflighted-refs",qo="drop-target",Zo="data-phx-active-refs",Qo="phx:live-file:updated",Ko="data-phx-skip",Jo="data-phx-id",es="data-phx-prune",ts="phx-connected",ns="phx-loading",rs="phx-error",is="phx-client-error",os="phx-server-error",ss="data-phx-parent-id",as="data-phx-main",ls="data-phx-root-id",cs="viewport-top",us="viewport-bottom",hs="phx-has-focused",ds=["text","textarea","number","email","password","search","tel","url","date","time","datetime-local","color","range"],fs=["checkbox","radio"],ps="phx-has-submitted",gs="data-phx-session",ms=`[${gs}]`,ws="data-phx-sticky",ys="data-phx-static",Es="data-phx-readonly",vs="data-phx-disabled",As="disable-with",Cs="data-phx-disable-with-restore",bs="hook",_s="update",Ss="stream",Is="data-phx-stream",Ts="phxPrivate",Ds="auto-recover",Ns="phx:live-socket:debug",Os="phx:live-socket:profiling",Rs="phx:live-socket:latency-sim",Ms="phx:nav-history-position",Ps="mounted",ks="__phoenix_reload_status__",xs="debounce-trigger",Ls="throttled",Bs="debounce-prev-key",Fs={debounce:300,throttle:300},Us=[Vo,zo,Go],js="d",Hs="s",Vs="c",zs="e",Gs="r",Ws="t",Ys="stream",Xs=class{constructor(e,t,n){let{chunk_size:r,chunk_timeout:i}=t;this.liveSocket=n,this.entry=e,this.offset=0,this.chunkSize=r,this.chunkTimeout=i,this.chunkTimer=null,this.errored=!1,this.uploadChannel=n.channel(`lvu:${e.ref}`,{token:e.metadata()})}error(e){this.errored||(this.uploadChannel.leave(),this.errored=!0,clearTimeout(this.chunkTimer),this.entry.error(e))}upload(){this.uploadChannel.onError(e=>this.error(e)),this.uploadChannel.join().receive("ok",e=>this.readNextChunk()).receive("error",e=>this.error(e))}isDone(){return this.offset>=this.entry.file.size}readNextChunk(){let e=new window.FileReader,t=this.entry.file.slice(this.offset,this.chunkSize+this.offset);e.onload=e=>{if(null!==e.target.error)return $s("Read error: "+e.target.error);this.offset+=e.target.result.byteLength,this.pushChunk(e.target.result)},e.readAsArrayBuffer(t)}pushChunk(e){this.uploadChannel.isJoined()&&this.uploadChannel.push("chunk",e,this.chunkTimeout).receive("ok",()=>{this.entry.progress(this.offset/this.entry.file.size*100),this.isDone()||(this.chunkTimer=setTimeout(()=>this.readNextChunk(),this.liveSocket.getLatencySim()||0))}).receive("error",({reason:e})=>this.error(e))}},$s=(e,t)=>console.error&&console.error(e,t),qs=e=>{let t=typeof e;return"number"===t||"string"===t&&/^(0|[1-9]\d*)$/.test(e)};var Zs=e=>"function"==typeof e?e:function(){return e},Qs=e=>JSON.parse(JSON.stringify(e)),Ks=(e,t,n)=>{do{if(e.matches(`[${t}]`)&&!e.disabled)return e;e=e.parentElement||e.parentNode}while(null!==e&&1===e.nodeType&&!(n&&n.isSameNode(e)||e.matches(ms)));return null},Js=e=>null!==e&&"object"==typeof e&&!(e instanceof Array),ea=e=>{for(let t in e)return!1;return!0},ta=(e,t)=>
2e&&t(e),na=function(e,t,n,r){e.forEach(e=>{new Xs(e,n.config,r).upload()})},ra={canPushState:()=>void 0!==history.pushState,dropLocal(e,t,n){return e.removeItem(this.localKey(t,n))},updateLocal(e,t,n,r,i){let o=this.getLocal(e,t,n),s=this.localKey(t,n),a=null===o?r:i(o);return e.setItem(s,JSON.stringify(a)),a},getLocal(e,t,n){return JSON.parse(e.getItem(this.localKey(t,n)))},updateCurrentState(e){this.canPushState()&&history.replaceState(e(history.state||{}),"",window.location.href)},pushState(e,t,n){if(this.canPushState()){if(n!==window.location.href){if("redirect"==t.type&&t.scroll){let e=history.state||{};e.scroll=t.scroll,history.replaceState(e,"",window.location.href)}delete t.scroll,history[e+"State"](t,"",n||null),window.requestAnimationFrame(()=>{let e=this.getHashTargetEl(window.location.hash);e?e.scrollIntoView():"redirect"===t.type&&window.scroll(0,0)})}}else this.redirect(n)},setCookie(e,t,n){let r="number"==typeof n?` max-age=${n};`:"";document.cookie=`${e}=${t};${r} path=/`},getCookie:e=>document.cookie.replace(new RegExp(`(?:(?:^|.*;s*)${e}s*=s*([^;]*).*$)|^.*$`),"$1"),deleteCookie(e){document.cookie=`${e}=; max-age=-1; path=/`},redirect(e,t){t&&this.setCookie("__phoenix_flash__",t,60),window.location=e},localKey:(e,t)=>`${e}-${t}`,getHashTargetEl(e){let t=e.toString().substring(1);if(""!==t)return document.getElementById(t)||document.querySelector(`a[name="${t}"]`)}},ia=ra,oa={byId:e=>document.getElementById(e)||$s(`no id found for ${e}`),removeClass(e,t){e.classList.remove(t),0===e.classList.length&&e.removeAttribute("class")},all(e,t,n){if(!e)return[];let r=Array.from(e.querySelectorAll(t));return n?r.forEach(n):r},childNodeLength(e){let t=document.createElement("template");return t.innerHTML=e,t.content.childElementCount},isUploadInput:e=>"file"===e.type&&null!==e.getAttribute(Xo),isAutoUpload:e=>e.hasAttribute("data-phx-auto-upload"),findUploadInputs(e){const t=e.id,n=this.all(document,`input[type="file"][${Xo}][form="${t}"]`);return this.all(e,`input[type="file"][${Xo}]`).concat(n)},findComponentNodeList(e,t){return this.filterWithinSameLiveView(this.all(e,`[${jo}="${t}"]`),e)},isPhxDestroyed:e=>!(!e.id||!oa.private(e,"destroyed")),wantsNewTab(e){let t=e.ctrlKey||e.shiftKey||e.metaKey||e.button&&1===e.button,n=e.target instanceof HTMLAnchorElement&&e.target.hasAttribute("download"),r=e.target.hasAttribute("target")&&"_blank"===e.target.getAttribute("target").toLowerCase(),i=e.target.hasAttribute("target")&&!e.target.getAttribute("target").startsWith("_");return t||r||n||i},isUnloadableFormSubmit(e){return!(e.target&&"dialog"===e.target.getAttribute("method")||e.submitter&&"dialog"===e.submitter.getAttribute("formmethod"))&&(!e.defaultPrevented&&!this.wantsNewTab(e))},isNewPageClick(e,t){let n,r=e.target instanceof HTMLAnchorElement?e.target.getAttribute("href"):null;if(e.defaultPrevented||null===r||this.wantsNewTab(e))return!1;if(r.startsWith("mailto:")||r.startsWith("tel:"))return!1;if(e.target.isContentEditable)return!1;try{n=new URL(r)}catch{try{n=new URL(r,t)}catch{return!0}}return n.host===t.host&&n.protocol===t.protocol&&n.pathname===t.pathname&&n.search===t.search?""===n.hash&&!n.href.endsWith("#"):n.protocol.startsWith("http")},markPhxChildDestroyed(e){this.isPhxChild(e)&&e.setAttribute(gs,""),this.putPrivate(e,"destroyed",!0)},findPhxChildrenInFragment(e,t){let n=document.createElement("template");return n.innerHTML=e,this.findPhxChildren(n.content,t)},isIgnored:(e,t)=>"ignore"===(e.getAttribute(t)||e.getAttribute("data-phx-update")),isPhxUpdate:(e,t,n)=>e.getAttribute&&n.indexOf(e.getAttribute(t))>=0,findPhxSticky(e){return this.all(e,`[${ws}]`)},findPhxChildren(e,t){return this.all(e,`${ms}[${ss}="${t}"]`)},findExistingParentCIDs(e,t){let n=new Set,r=new Set;return t.forEach(t=>{this.filterWithinSameLiveView(this.all(e,`[${jo}="${t}"]`),e).forEach(e=>{n.add(t),this.filterWithinSameLiveView(this.all(e,`[${jo}]`),e).map(e=>parseInt(e.getAttribute(jo))).forEach(e=>r.add(e))})}),r.forEach(e=>n.delete(e)),n},filterWithinSameLiveView(e,t){return t.querySelector(ms)?e.filter(e=>this.withinSameLiveView(e,t)):e},withinSameLiveView(e,t){for(;e=e.parentNode;){if(e.isSameNode(t))return!0;
2if(null!==e.getAttribute(gs))return!1}},private:(e,t)=>e[Ts]&&e[Ts][t],deletePrivate(e,t){e[Ts]&&delete e[Ts][t]},putPrivate(e,t,n){e[Ts]||(e[Ts]={}),e[Ts][t]=n},updatePrivate(e,t,n,r){let i=this.private(e,t);void 0===i?this.putPrivate(e,t,r(n)):this.putPrivate(e,t,r(i))},syncPendingAttrs(e,t){e.hasAttribute(zo)&&(Uo.forEach(n=>{e.classList.contains(n)&&t.classList.add(n)}),Us.filter(t=>e.hasAttribute(t)).forEach(n=>{t.setAttribute(n,e.getAttribute(n))}))},copyPrivates(e,t){t[Ts]&&(e[Ts]=t[Ts])},putTitle(e){let t=document.querySelector("title");if(t){let{prefix:n,suffix:r,default:i}=t.dataset,o="string"!=typeof e||""===e.trim();if(o&&"string"!=typeof i)return;let s=o?i:e;document.title=`${n||""}${s||""}${r||""}`}else document.title=e},debounce(e,t,n,r,i,o,s,a){let l=e.getAttribute(n),c=e.getAttribute(i);""===l&&(l=r),""===c&&(c=o);let u=l||c;switch(u){case null:return a();case"blur":return this.incCycle(e,"debounce-blur-cycle",()=>{s()&&a()}),void(this.once(e,"debounce-blur")&&e.addEventListener("blur",()=>this.triggerCycle(e,"debounce-blur-cycle")));default:let n=parseInt(u),r=()=>c?this.deletePrivate(e,Ls):a(),i=this.incCycle(e,xs,r);if(isNaN(n))return $s(`invalid throttle/debounce value: ${u}`);if(c){let r=!1;if("keydown"===t.type){let n=this.private(e,Bs);this.putPrivate(e,Bs,t.key),r=n!==t.key}if(!r&&this.private(e,Ls))return!1;{a();const t=setTimeout(()=>{s()&&this.triggerCycle(e,xs)},n);this.putPrivate(e,Ls,t)}}else setTimeout(()=>{s()&&this.triggerCycle(e,xs,i)},n);let o=e.form;o&&this.once(o,"bind-debounce")&&o.addEventListener("submit",()=>{Array.from(new FormData(o).entries(),([e])=>{let t=o.querySelector(`[name="${e}"]`);this.incCycle(t,xs),this.deletePrivate(t,Ls)})}),this.once(e,"bind-debounce")&&e.addEventListener("blur",()=>{clearTimeout(this.private(e,Ls)),this.triggerCycle(e,xs)})}},triggerCycle(e,t,n){let[r,i]=this.private(e,t);n||(n=r),n===r&&(this.incCycle(e,t),i())},once(e,t){return!0!==this.private(e,t)&&(this.putPrivate(e,t,!0),!0)},incCycle(e,t,n=function(){}){let[r]=this.private(e,t)||[0,n];return r++,this.putPrivate(e,t,[r,n]),r},maintainPrivateHooks(e,t,n,r){e.hasAttribute&&e.hasAttribute("data-phx-hook")&&!t.hasAttribute("data-phx-hook")&&t.setAttribute("data-phx-hook",e.getAttribute("data-phx-hook")),t.hasAttribute&&(t.hasAttribute(n)||t.hasAttribute(r))&&t.setAttribute("data-phx-hook","Phoenix.InfiniteScroll")},putCustomElHook(e,t){e.isConnected?e.setAttribute("data-phx-hook",""):console.error(`\n hook attached to non-connected DOM element\n ensure you are calling createHook within your connectedCallback. ${e.outerHTML}\n `),this.putPrivate(e,"custom-el-hook",t)},getCustomElHook(e){return this.private(e,"custom-el-hook")},isUsedInput(e){return e.nodeType===Node.ELEMENT_NODE&&(this.private(e,hs)||this.private(e,ps))},resetForm(e){Array.from(e.elements).forEach(e=>{this.deletePrivate(e,hs),this.deletePrivate(e,ps)})},isPhxChild:e=>e.getAttribute&&e.getAttribute(ss),isPhxSticky:e=>e.getAttribute&&null!==e.getAttribute(ws),isChildOfAny:(e,t)=>!!t.find(t=>t.contains(e)),firstPhxChild(e){return this.isPhxChild(e)?e:this.all(e,`[${ss}]`)[0]},dispatchEvent(e,t,n={}){let r=!0;"INPUT"===e.nodeName&&"file"===e.type&&"click"===t&&(r=!1);let i={bubbles:void 0===n.bubbles?r:!!n.bubbles,cancelable:!0,detail:n.detail||{}},o="click"===t?new MouseEvent("click",i):new CustomEvent(t,i);e.dispatchEvent(o)},cloneNode(e,t){if(void 0===t)return e.cloneNode(!0);{let n=e.cloneNode(!1);return n.innerHTML=t,n}},mergeAttrs(e,t,n={}){let r=new Set(n.exclude||[]),i=n.isIgnored,o=t.attributes;for(let n=o.length-1;n>=0;n--){let s=o[n].name;if(r.has(s))"value"===s&&e.value===t.value&&e.setAttribute("value",t.getAttribute(s));else{const n=t.getAttribute(s);e.getAttribute(s)!==n&&(!i||i&&s.startsWith("data-"))&&e.setAttribute(s,n)}}let s=e.attributes;for(let n=s.length-1;n>=0;n--){let r=s[n].name;i?!r.startsWith("data-")||t.hasAttribute(r)||Us.includes(r)||e.removeAttribute(r):t.hasAttribute(r)||e.removeAttribute(r)}},mergeFocusedInput(e,t){e instanceof HTMLSelectElement||oa.mergeAttrs(e,t,{exclude:["value"]}),t.readOnly?e.setAttribute("readonly",!0):e.removeAttribute("readonly")},hasSelectionRange:e=>e.setSelectionRange&&("text"===e.type||"textarea"===e.type),restoreFocus(e,t,n){if(e instanceof HTMLSelectElement&&e.focus(),!oa.isTextualInput(e))return;e.matches(":focus")||e.focus(),this.hasSelectionRange(e)&&e.setSelectionRange(t,n)},isFormInput:e=>/^(?:input|select|textarea)$/i.test(e.tagName)&&"button"!==e.type,syncAttrsToProps(e){e instanceof HTMLInputElement&&fs.indexOf(e.type.toLocaleLowerCase())>=0&&(e.checked=null!==e.getAttribute("checked"))},isTextualInput:e=>ds.indexOf(e.type)>
2=0,isNowTriggerFormExternal:(e,t)=>e.getAttribute&&null!==e.getAttribute(t)&&document.body.contains(e),cleanChildNodes(e,t){if(oa.isPhxUpdate(e,t,["append","prepend",Ss])){let t=[];e.childNodes.forEach(e=>{if(!e.id){e.nodeType===Node.TEXT_NODE&&""===e.nodeValue.trim()||e.nodeType===Node.COMMENT_NODE||$s(`only HTML element tags with an id are allowed inside containers with phx-update.\n\nremoving illegal node: "${(e.outerHTML||e.nodeValue).trim()}"\n\n`),t.push(e)}}),t.forEach(e=>e.remove())}},replaceRootContainer(e,t,n){let r=new Set(["id",gs,ys,as,ls]);if(e.tagName.toLowerCase()===t.toLowerCase())return Array.from(e.attributes).filter(e=>!r.has(e.name.toLowerCase())).forEach(t=>e.removeAttribute(t.name)),Object.keys(n).filter(e=>!r.has(e.toLowerCase())).forEach(t=>e.setAttribute(t,n[t])),e;{let i=document.createElement(t);return Object.keys(n).forEach(e=>i.setAttribute(e,n[e])),r.forEach(t=>i.setAttribute(t,e.getAttribute(t))),i.innerHTML=e.innerHTML,e.replaceWith(i),i}},getSticky(e,t,n){let r=(oa.private(e,"sticky")||[]).find(([e])=>t===e);if(r){let[e,t,n]=r;return n}return"function"==typeof n?n():n},deleteSticky(e,t){this.updatePrivate(e,"sticky",[],e=>e.filter(([e,n])=>e!==t))},putSticky(e,t,n){let r=n(e);this.updatePrivate(e,"sticky",[],e=>{let i=e.findIndex(([e])=>t===e);return i>=0?e[i]=[t,n,r]:e.push([t,n,r]),e})},applyStickyOperations(e){let t=oa.private(e,"sticky");t&&t.forEach(([t,n,r])=>this.putSticky(e,t,n))},isLocked:e=>e.hasAttribute&&e.hasAttribute(Go)},sa=oa,aa=class{static isActive(e,t){let n=void 0===t._phxRef,r=e.getAttribute(Zo).split(",").indexOf(ca.genFileRef(t))>=0;return t.size>0&&(n||r)}static isPreflighted(e,t){return e.getAttribute($o).split(",").indexOf(ca.genFileRef(t))>=0&&this.isActive(e,t)}static isPreflightInProgress(e){return!0===e._preflightInProgress}static markPreflightInProgress(e){e._preflightInProgress=!0}constructor(e,t,n,r){this.ref=ca.genFileRef(t),this.fileEl=e,this.file=t,this.view=n,this.meta=null,this._isCancelled=!1,this._isDone=!1,this._progress=0,this._lastProgressSent=-1,this._onDone=function(){},this._onElUpdated=this.onElUpdated.bind(this),this.fileEl.addEventListener(Qo,this._onElUpdated),this.autoUpload=r}metadata(){return this.meta}progress(e){this._progress=Math.floor(e),this._progress>this._lastProgressSent&&(this._progress>=100?(this._progress=100,this._lastProgressSent=100,this._isDone=!0,this.view.pushFileProgress(this.fileEl,this.ref,100,()=>{ca.untrackFile(this.fileEl,this.file),this._onDone()})):(this._lastProgressSent=this._progress,this.view.pushFileProgress(this.fileEl,this.ref,this._progress)))}isCancelled(){return this._isCancelled}cancel(){this.file._preflightInProgress=!1,this._isCancelled=!0,this._isDone=!0,this._onDone()}isDone(){return this._isDone}error(e="failed"){this.fileEl.removeEventListener(Qo,this._onElUpdated),this.view.pushFileProgress(this.fileEl,this.ref,{error:e}),this.isAutoUpload()||ca.clearFiles(this.fileEl)}isAutoUpload(){return this.autoUpload}onDone(e){this._onDone=()=>{this.fileEl.removeEventListener(Qo,this._onElUpdated),e()}}onElUpdated(){-1===this.fileEl.getAttribute(Zo).split(",").indexOf(this.ref)&&(ca.untrackFile(this.fileEl,this.file),this.cancel())}toPreflightPayload(){return{last_modified:this.file.lastModified,name:this.file.name,relative_path:this.file.webkitRelativePath,size:this.file.size,type:this.file.type,ref:this.ref,meta:"function"==typeof this.file.meta?this.file.meta():void 0}}uploader(e){if(this.meta.uploader){let t=e[this.meta.uploader]||$s(`no uploader configured for ${this.meta.uploader}`);return{name:this.meta.uploader,callback:t}}return{name:"channel",callback:na}}zipPostFlight(e){this.meta=e.entries[this.ref],this.meta||$s(`no preflight upload response returned with ref ${this.ref}`,{input:this.fileEl,response:e})}},la=0,ca=class e{static genFileRef(e){let t=e._phxRef;return void 0!==t?t:(e._phxRef=(la++).toString(),e._phxRef)}static getEntryDataURL(e,t,n){let r=this.activeFiles(e).find(e=>this.genFileRef(e)===t);n(URL.createObjectURL(r))}static hasUploadsInProgress(e){let t=0;
2return sa.findUploadInputs(e).forEach(e=>{e.getAttribute($o)!==e.getAttribute("data-phx-done-refs")&&t++}),t>0}static serializeUploads(e){let t=this.activeFiles(e),n={};return t.forEach(t=>{let r={path:e.name},i=e.getAttribute(Xo);n[i]=n[i]||[],r.ref=this.genFileRef(t),r.last_modified=t.lastModified,r.name=t.name||r.ref,r.relative_path=t.webkitRelativePath,r.type=t.type,r.size=t.size,"function"==typeof t.meta&&(r.meta=t.meta()),n[i].push(r)}),n}static clearFiles(e){e.value=null,e.removeAttribute(Xo),sa.putPrivate(e,"files",[])}static untrackFile(e,t){sa.putPrivate(e,"files",sa.private(e,"files").filter(e=>!Object.is(e,t)))}static trackFiles(e,t,n){if(null!==e.getAttribute("multiple")){let n=t.filter(t=>!this.activeFiles(e).find(e=>Object.is(e,t)));sa.updatePrivate(e,"files",[],e=>e.concat(n)),e.value=null}else n&&n.files.length>0&&(e.files=n.files),sa.putPrivate(e,"files",t)}static activeFileInputs(e){let t=sa.findUploadInputs(e);return Array.from(t).filter(e=>e.files&&this.activeFiles(e).length>0)}static activeFiles(e){return(sa.private(e,"files")||[]).filter(t=>aa.isActive(e,t))}static inputsAwaitingPreflight(e){let t=sa.findUploadInputs(e);return Array.from(t).filter(e=>this.filesAwaitingPreflight(e).length>0)}static filesAwaitingPreflight(e){return this.activeFiles(e).filter(t=>!aa.isPreflighted(e,t)&&!aa.isPreflightInProgress(t))}static markPreflightInProgress(e){e.forEach(e=>aa.markPreflightInProgress(e.file))}constructor(t,n,r){this.autoUpload=sa.isAutoUpload(t),this.view=n,this.onComplete=r,this._entries=Array.from(e.filesAwaitingPreflight(t)||[]).map(e=>new aa(t,e,n,this.autoUpload)),e.markPreflightInProgress(this._entries),this.numEntriesInProgress=this._entries.length}isAutoUpload(){return this.autoUpload}entries(){return this._entries}initAdapterUpload(e,t,n){this._entries=this._entries.map(t=>(t.isCancelled()?(this.numEntriesInProgress--,0===this.numEntriesInProgress&&this.onComplete()):(t.zipPostFlight(e),t.onDone(()=>{this.numEntriesInProgress--,0===this.numEntriesInProgress&&this.onComplete()})),t));let r=this._entries.reduce((e,t)=>{if(!t.meta)return e;let{name:r,callback:i}=t.uploader(n.uploaders);return e[r]=e[r]||{callback:i,entries:[]},e[r].entries.push(t),e},{});for(let i in r){let{callback:o,entries:s}=r[i];o(s,t,e,n)}}},ua={anyOf:(e,t)=>t.find(t=>e instanceof t),isFocusable(e,t){return e instanceof HTMLAnchorElement&&"ignore"!==e.rel||e instanceof HTMLAreaElement&&void 0!==e.href||!e.disabled&&this.anyOf(e,[HTMLInputElement,HTMLSelectElement,HTMLTextAreaElement,HTMLButtonElement])||e instanceof HTMLIFrameElement||e.tabIndex>=0&&"true"!==e.getAttribute("aria-hidden")||!t&&null!==e.getAttribute("tabindex")&&"true"!==e.getAttribute("aria-hidden")},attemptFocus(e,t){if(this.isFocusable(e,t))try{e.focus()}catch{}return!!document.activeElement&&document.activeElement.isSameNode(e)},focusFirstInteractive(e){let t=e.firstElementChild;for(;t;){if(this.attemptFocus(t,!0)||this.focusFirstInteractive(t,!0))return!0;t=t.nextElementSibling}},focusFirst(e){let t=e.firstElementChild;for(;t;){if(this.attemptFocus(t)||this.focusFirst(t))return!0;t=t.nextElementSibling}},focusLast(e){let t=e.lastElementChild;for(;t;){if(this.attemptFocus(t)||this.focusLast(t))return!0;t=t.previousElementSibling}}},ha={LiveFileUpload:{activeRefs(){return this.el.getAttribute(Zo)},preflightedRefs(){return this.el.getAttribute($o)},mounted(){this.preflightedWas=this.preflightedRefs()},updated(){let e=this.preflightedRefs();this.preflightedWas!==e&&(this.preflightedWas=e,""===e&&this.__view().cancelSubmit(this.el.form)),""===this.activeRefs()&&(this.el.value=null),this.el.dispatchEvent(new CustomEvent(Qo))}},LiveImgPreview:{mounted(){this.ref=this.el.getAttribute("data-phx-entry-ref"),this.inputEl=document.getElementById(this.el.getAttribute(Xo)),ca.getEntryDataURL(this.inputEl,this.ref,e=>{this.url=e,this.el.src=e})},destroyed(){URL.revokeObjectURL(this.url)}},FocusWrap:{mounted(){this.focusStart=this.el.firstElementChild,this.focusEnd=this.el.lastElementChild,this.focusStart.addEventListener("focus",e=>{if(e.relatedTarget&&this.el.contains(e.relatedTarget))ua.focusLast(this.el);else{const t=e.target.nextElementSibling;ua.attemptFocus(t)||ua.focusFirst(t)}}),this.focusEnd.addEventListener("focus",e=>{if(e.relatedTarget&&this.el.contains(e.relatedTarget))ua.focusFirst(this.el);else{const t=e.target.previousElementSibling;ua.attemptFocus(t)||ua.focusLast(t)}}),this.el.addEventListener("phx:show-end",()=>this.el.focus()),"none"!==window.getComputedStyle(this.el).display&&ua.focusFirst(this.el)}}},da=e=>["HTML","BODY"].indexOf(e.nodeName.toUpperCase())>=0?null:["scroll","auto"].indexOf(getComputedStyle(e).overflowY)>=0?e:da(e.parentElement),fa=e=>e?e.scrollTop:document.documentElement.scrollTop||document.body.scrollTop,pa=e=>e?e.getBoundingClientRect().bottom:window.innerHeight||document.documentElement.clientHeight,ga=e=>e?e.getBoundingClientRect().top:0,ma=(e,t)=>{let n=e.getBoundingClientRect();return Math.ceil(n.top)>=ga(t)&&Math.ceil(n.left)>=0&&Math.floor(n.top)<=pa(t)};ha.InfiniteScroll={mounted(){this.scrollContainer=da(this.el);let e=fa(this.scrollContainer),t=!1,n=null,r=this.throttle(500,(e,t)=>{n=()=>!0,this.liveSocket.execJSHookPush(this.el,e,{id:t.id,_overran:!0},()=>{n=null})}),i=this.throttle(500,(e,t)=>{n=()=>t.scrollIntoView({block:"start"}),this.liveSocket.execJSHookPush(this.el,e,{id:t.id},()=>{n=null,window.requestAnimationFrame(()=>{ma(t,this.scrollContainer)||t.scrollIntoView({block:"start"})})})}),o=this.throttle(500,(e,t)=>{n=()=>t.scrollIntoView({block:"end"}),this.liveSocket.execJSHookPush(this.el,e,{id:t.id},()=>{n=null,window.requestAnimationFrame(()=>{ma(t,this.scrollContainer)||t.scrollIntoView({block:"end"})})})});this.onScroll=s=>{let a=fa(this.scrollContainer);if(n)return e=a,n();let l=this.el.getBoundingClientRect(),c=this.el.getAttribute(this.liveSocket.b
2inding("viewport-top")),u=this.el.getAttribute(this.liveSocket.binding("viewport-bottom")),h=this.el.lastElementChild,d=this.el.firstElementChild,f=a<e,p=a>e;f&&c&&!t&&l.top>=0?(t=!0,r(c,d)):p&&t&&l.top<=0&&(t=!1),c&&f&&((e,t)=>{let n=e.getBoundingClientRect();return Math.ceil(n.top)>=ga(t)&&Math.ceil(n.left)>=0&&Math.floor(n.top)<=pa(t)})(d,this.scrollContainer)?i(c,d):u&&p&&((e,t)=>{let n=e.getBoundingClientRect();return Math.ceil(n.bottom)>=ga(t)&&Math.ceil(n.left)>=0&&Math.floor(n.bottom)<=pa(t)})(h,this.scrollContainer)&&o(u,h),e=a},this.scrollContainer?this.scrollContainer.addEventListener("scroll",this.onScroll):window.addEventListener("scroll",this.onScroll)},destroyed(){this.scrollContainer?this.scrollContainer.removeEventListener("scroll",this.onScroll):window.removeEventListener("scroll",this.onScroll)},throttle(e,t){let n,r=0;return(...i)=>{let o=Date.now(),s=e-(o-r);s<=0||s>e?(n&&(clearTimeout(n),n=null),r=o,t(...i)):n||(n=setTimeout(()=>{r=Date.now(),n=null,t(...i)},s))}}};var wa,ya=ha,Ea=class{static onUnlock(e,t){if(!sa.isLocked(e)&&!e.closest(`[${Go}]`))return t();const n=e.closest(`[${Go}]`),r=n.closest(`[${Go}]`).getAttribute(Go);n.addEventListener(`phx:undo-lock:${r}`,()=>{t()},{once:!0})}constructor(e){this.el=e,this.loadingRef=e.hasAttribute(Vo)?parseInt(e.getAttribute(Vo),10):null,this.lockRef=e.hasAttribute(Go)?parseInt(e.getAttribute(Go),10):null}maybeUndo(e,t,n){this.isWithin(e)?(this.undoLocks(e,t,n),this.undoLoading(e,t),sa.updatePrivate(this.el,Wo,[],n=>n.filter(n=>{let r={detail:{ref:n,event:t},bubbles:!0,cancelable:!1};return this.loadingRef&&this.loadingRef>n&&this.el.dispatchEvent(new CustomEvent(`phx:undo-loading:${n}`,r)),this.lockRef&&this.lockRef>n&&this.el.dispatchEvent(new CustomEvent(`phx:undo-lock:${n}`,r)),n>e})),this.isFullyResolvedBy(e)&&this.el.removeAttribute(zo)):sa.updatePrivate(this.el,Wo,[],t=>(t.push(e),t))}isWithin(e){return!(null!==this.loadingRef&&this.loadingRef>e&&null!==this.lockRef&&this.lockRef>e)}undoLocks(e,t,n){if(!this.isLockUndoneBy(e))return;let r=sa.private(this.el,Go);r&&(n(r),sa.deletePrivate(this.el,Go)),this.el.removeAttribute(Go);let i={detail:{ref:e,event:t},bubbles:!0,cancelable:!1};this.el.dispatchEvent(new CustomEvent(`phx:undo-lock:${this.lockRef}`,i))}undoLoading(e,t){if(this.isLoadingUndoneBy(e)){if(this.canUndoLoading(e)){this.el.removeAttribute(Vo);let n=this.el.getAttribute(vs),r=this.el.getAttribute(Es);null!==r&&(this.el.readOnly="true"===r,this.el.removeAttribute(Es)),null!==n&&(this.el.disabled="true"===n,this.el.removeAttribute(vs));let i=this.el.getAttribute(Cs);null!==i&&(this.el.innerText=i,this.el.removeAttribute(Cs));let o={detail:{ref:e,event:t},bubbles:!0,cancelable:!1};this.el.dispatchEvent(new CustomEvent(`phx:undo-loading:${this.loadingRef}`,o))}Uo.forEach(t=>{("phx-submit-loading"!==t||this.canUndoLoading(e))&&sa.removeClass(this.el,t)})}else this.canUndoLoading(e)&&this.el.classList.contains("phx-submit-loading")&&this.el.classList.remove("phx-change-loading")}isLoadingUndoneBy(e){return null!==this.loadingRef&&this.loadingRef<=e}isLockUndoneBy(e){return null!==this.lockRef&&this.lockRef<=e}isFullyResolvedBy(e){return(null===this.loadingRef||this.loadingRef<=e)&&(null===this.lockRef||this.lockRef<=e)}canUndoLoading(e){return null===this.lockRef||this.lockRef<=e}},va=class{constructor(e,t,n){let r=new Set,i=new Set([...t.children].map(e=>e.id)),o=[];Array.from(e.children).forEach(e=>{if(e.id&&(r.add(e.id),i.has(e.id))){let t=e.previousElementSibling&&e.previousElementSibling.id;o.push({elementId:e.id,previousElementId:t})}}),this.containerId=t.id,this.updateType=n,this.elementsToModify=o,this.elementIdsToAdd=[...i].filter(e=>!r.has(e))}perform(){let e=sa.byId(this.containerId);this.elementsToModify.forEach(t=>{t.previousElementId?ta(document.getElementById(t.previousElementId),e=>{ta(document.getElementById(t.elementId),t=>{t.previousElementSibling&&t.previousElementSibling.id==e.id||e.insertAdjacentElement("afterend",t)})}):ta(document.getElementById(t.elementId),t=>{null==t.previousElementSibling||e.insertAdjacentElement("afterbegin",t)})}),"prepend"==this.updateType&&this.elementIdsToAdd.reverse().forEac
vendor: 4,712 bytes, line 2
2h(t=>{ta(document.getElementById(t),t=>e.insertAdjacentElement("afterbegin",t))})}};var Aa="undefined"==typeof document?void 0:document,Ca=!!Aa&&"content"in Aa.createElement("template"),ba=!!Aa&&Aa.createRange&&"createContextualFragment"in Aa.createRange();function _a(e){return e=e.trim(),Ca?function(e){var t=Aa.createElement("template");return t.innerHTML=e,t.content.childNodes[0]}(e):ba?function(e){return wa||(wa=Aa.createRange()).selectNode(Aa.body),wa.createContextualFragment(e).childNodes[0]}(e):function(e){var t=Aa.createElement("body");return t.innerHTML=e,t.childNodes[0]}(e)}function Sa(e,t){var n,r,i=e.nodeName,o=t.nodeName;return i===o||(n=i.charCodeAt(0),r=o.charCodeAt(0),n<=90&&r>=97?i===o.toUpperCase():r<=90&&n>=97&&o===i.toUpperCase())}function Ia(e,t,n){e[n]!==t[n]&&(e[n]=t[n],e[n]?e.setAttribute(n,""):e.removeAttribute(n))}var Ta={OPTION:function(e,t){var n=e.parentNode;if(n){var r=n.nodeName.toUpperCase();"OPTGROUP"===r&&(r=(n=n.parentNode)&&n.nodeName.toUpperCase()),"SELECT"!==r||n.hasAttribute("multiple")||(e.hasAttribute("selected")&&!t.selected&&(e.setAttribute("selected","selected"),e.removeAttribute("selected")),n.selectedIndex=-1)}Ia(e,t,"selected")},INPUT:function(e,t){Ia(e,t,"checked"),Ia(e,t,"disabled"),e.value!==t.value&&(e.value=t.value),t.hasAttribute("value")||e.removeAttribute("value")},TEXTAREA:function(e,t){var n=t.value;e.value!==n&&(e.value=n);var r=e.firstChild;if(r){var i=r.nodeValue;if(i==n||!n&&i==e.placeholder)return;r.nodeValue=n}},SELECT:function(e,t){if(!t.hasAttribute("multiple")){for(var n,r,i=-1,o=0,s=e.firstChild;s;)if("OPTGROUP"===(r=s.nodeName&&s.nodeName.toUpperCase()))(s=(n=s).firstChild)||(s=n.nextSibling,n=null);else{if("OPTION"===r){if(s.hasAttribute("selected")){i=o;break}o++}!(s=s.nextSibling)&&n&&(s=n.nextSibling,n=null)}e.selectedIndex=i}}};function Da(){}function Na(e){if(e)return e.getAttribute&&e.getAttribute("id")||e.id}var Oa,Ra=(Oa=function(e,t){var n,r,i,o,s=t.attributes;if(11!==t.nodeType&&11!==e.nodeType){for(var a=s.length-1;a>=0;a--)r=(n=s[a]).name,i=n.namespaceURI,o=n.value,i?(r=n.localName||r,e.getAttributeNS(i,r)!==o&&("xmlns"===n.prefix&&(r=n.name),e.setAttributeNS(i,r,o))):e.getAttribute(r)!==o&&e.setAttribute(r,o);for(var l=e.attributes,c=l.length-1;c>=0;c--)r=(n=l[c]).name,(i=n.namespaceURI)?(r=n.localName||r,t.hasAttributeNS(i,r)||e.removeAttributeNS(i,r)):t.hasAttribute(r)||e.removeAttribute(r)}},function(e,t,n){if(n||(n={}),"string"==typeof t)if("#document"===e.nodeName||"HTML"===e.nodeName||"BODY"===e.nodeName){var r=t;(t=Aa.createElement("html")).innerHTML=r}else t=_a(t);else 11===t.nodeType&&(t=t.firstElementChild);var i=n.getNodeKey||Na,o=n.onBeforeNodeAdded||Da,s=n.onNodeAdded||Da,a=n.onBeforeElUpdated||Da,l=n.onElUpdated||Da,c=n.onBeforeNodeDiscarded||Da,u=n.onNodeDiscarded||Da,h=n.onBeforeElChildrenUpdated||Da,d=n.skipFromChildren||Da,f=n.addChild||function(e,t){return e.appendChild(t)},p=!0===n.childrenOnly,g=Object.create(null),m=[];function w(e){m.push(e)}function y(e,t){if(1===e.nodeType)for(var n=e.firstChild;n;){var r=void 0;t&&(r=i(n))?w(r):(u(n),n.firstChild&&y(n,t)),n=n.nextSibling}}function E(e,t,n){!1!==c(e)&&(t&&t.removeChild(e),u(e),y(e,n))}function v(e){if(1===e.nodeType||11===e.nodeType)for(var t=e.firstChild;t;){var n=i(t);n&&(g[n]=t),v(t),t=t.nextSibling}}function A(e){s(e);for(var t=e.firstChild;t;){var n=t.nextSibling,r=i(t);if(r){var o=g[r];o&&Sa(t,o)?(t.parentNode.replaceChild(o,t),C(o,t)):A(t)}else A(t);t=n}}function C(e,t,n){var r=i(t);if(r&&delete g[r],!n){var s=a(e,t);if(!1===s)return;if(s instanceof HTMLElement&&v(e=s),Oa(e,t),l(e),!1===h(e,t))return}"TEXTAREA"!==e.nodeName?function(e,t){var n,r,s,a,l,c=d(e,t),u=t.firstChild,h=e.firstChild;e:for(;u;){for(a=u.nextSibling,n=i(u);!c&&h;){if(s=h.nextSibling,u.isSameNode&&u.isSameNode(h)){u=a,h=s;continue e}r=i(h);var p=h.nodeType,m=void 0;if(p===u.nodeType&&(1===p?(n?n!==r&&((l=g[n])?s===l?m=!1:(e.insertBefore(l,h),r?w(r):E(h,e,!0),r=i(h=l)):m=!1):r&&(m=!1),(m=!1!==m&&Sa(h,u))&&C(h,u)):3!==p&&8!=p||(m=!0,h.nodeValue!==u.nodeValue&&(h.nodeValue=u.nodeValue))),m){u=a,h=s;continue e}r?w(r):E(h,e,!0),h=s}if(n&&(l=g[n])&&Sa(l,u))c||f(e,l),C(l,u);else{var y=o(u);!1!==y&&(y&&(u=y),u.actualize&&(u=u.actualize(e.ownerDocument||Aa)),f(e,u),A(u))}u=a,h=s}!function(e,t,n){for(;t;){var r=t.nextSibling;(n=i(t))?w(n):E(t,e,!0),t=r}}(e,h,r);var v=Ta[e.nodeName];v&&v(e,t)}(e,t):Ta.TEXTAREA(e,t)}v(e);var b,_,S=e,I=S.nodeType,T=t.nodeType;if(!p)if(1===I)1===T?Sa(e,t)||(u(e),S=function(e,t){for(var n=e.firstChild;n;){var r=n.nextSibling;t.appendChild(n),n=r}return t}(e,(b=t.nodeName,(_=t.namespaceURI)&&"http://www.w3.org/1999/xhtml"!==_?Aa.createElementNS(_,b):Aa.createElement(b)))):S=t;
2else if(3===I||8===I){if(T===I)return S.nodeValue!==t.nodeValue&&(S.nodeValue=t.nodeValue),S;S=t}if(S===t)u(e);else{if(t.isSameNode&&t.isSameNode(S))return;if(C(S,t,p),m)for(var D=0,N=m.length;D<N;D++){var O=g[m[D]];O&&E(O,O.parentNode,!1)}}return!p&&S!==e&&e.parentNode&&(S.actualize&&(S=S.actualize(e.ownerDocument||Aa)),e.parentNode.replaceChild(S,e)),S}),Ma=class{constructor(e,t,n,r,i,o,s={}){this.view=e,this.liveSocket=e.liveSocket,this.container=t,this.id=n,this.rootID=e.root.id,this.html=r,this.streams=i,this.streamInserts={},this.streamComponentRestore={},this.targetCID=o,this.cidPatch=qs(this.targetCID),this.pendingRemoves=[],this.phxRemove=this.liveSocket.binding("remove"),this.targetContainer=this.isCIDPatch()?this.targetCIDContainer(r):t,this.callbacks={beforeadded:[],beforeupdated:[],beforephxChildAdded:[],afteradded:[],afterupdated:[],afterdiscarded:[],afterphxChildAdded:[],aftertransitionsDiscarded:[]},this.withChildren=s.withChildren||s.undoRef||!1,this.undoRef=s.undoRef}before(e,t){this.callbacks[`before${e}`].push(t)}after(e,t){this.callbacks[`after${e}`].push(t)}trackBefore(e,...t){this.callbacks[`before${e}`].forEach(e=>e(...t))}trackAfter(e,...t){this.callbacks[`after${e}`].forEach(e=>e(...t))}markPrunableContentForRemoval(){let e=this.liveSocket.binding(_s);sa.all(this.container,`[${e}=append] > *, [${e}=prepend] > *`,e=>{e.setAttribute(es,"")})}perform(e){let{view:t,liveSocket:n,html:r,container:i}=this,o=this.targetContainer;if(this.isCIDPatch()&&!o)return;if(this.isCIDPatch()){const e=o.closest(`[${Go}]`);if(e){const t=sa.private(e,Go);
2t&&(o=t.querySelector(`[data-phx-component="${this.targetCID}"]`))}}let s=n.getActiveElement(),{selectionStart:a,selectionEnd:l}=s&&sa.hasSelectionRange(s)?s:{},c=n.binding(_s),u=n.binding(cs),h=n.binding(us),d=n.binding("trigger-action"),f=[],p=[],g=[],m=null;function w(n,r,i=this.withChildren){let o={childrenOnly:null===n.getAttribute(jo)&&!i,getNodeKey:t=>sa.isPhxDestroyed(t)?null:e?t.id:t.id||t.getAttribute&&t.getAttribute(Jo),skipFromChildren:e=>e.getAttribute(c)===Ss,addChild:(e,t)=>{let{ref:n,streamAt:r}=this.getStreamInsert(t);if(void 0===n)return e.appendChild(t);if(this.setStreamRef(t,n),0===r)e.insertAdjacentElement("afterbegin",t);else if(-1===r){let n=e.lastElementChild;if(n&&!n.hasAttribute(Is)){let n=Array.from(e.children).find(e=>!e.hasAttribute(Is));e.insertBefore(t,n)}else e.appendChild(t)}else if(r>0){let n=Array.from(e.children)[r];e.insertBefore(t,n)}},onBeforeNodeAdded:e=>{sa.maintainPrivateHooks(e,e,u,h),this.trackBefore("added",e);let t=e;return this.streamComponentRestore[e.id]&&(t=this.streamComponentRestore[e.id],delete this.streamComponentRestore[e.id],w.call(this,t,e,!0)),t},onNodeAdded:e=>{e.getAttribute&&this.maybeReOrderStream(e,!0),e instanceof HTMLImageElement&&e.srcset?e.srcset=e.srcset:e instanceof HTMLVideoElement&&e.autoplay&&e.play(),sa.isNowTriggerFormExternal(e,d)&&(m=e),(sa.isPhxChild(e)&&t.ownsElement(e)||sa.isPhxSticky(e)&&t.ownsElement(e.parentNode))&&this.trackAfter("phxChildAdded",e),f.push(e)},onNodeDiscarded:e=>this.onNodeDiscarded(e),onBeforeNodeDiscarded:e=>!(!e.getAttribute||null===e.getAttribute(es))||(null===e.parentElement||!e.id||!sa.isPhxUpdate(e.parentElement,c,[Ss,"append","prepend"]))&&(!this.maybePendingRemove(e)&&!this.skipCIDSibling(e)),onElUpdated:e=>{sa.isNowTriggerFormExternal(e,d)&&(m=e),p.push(e),this.maybeReOrderStream(e,!1)},onBeforeElUpdated:(e,t)=>{if(e.id&&e.isSameNode(n)&&e.id!==t.id)return o.onNodeDiscarded(e),e.replaceWith(t),o.onNodeAdded(t);if(sa.syncPendingAttrs(e,t),sa.maintainPrivateHooks(e,t,u,h),sa.cleanChildNodes(t,c),this.skipCIDSibling(t))return this.maybeReOrderStream(e),!1;if(sa.isPhxSticky(e))return[gs,ys,ls].map(n=>[n,e.getAttribute(n),t.getAttribute(n)]).forEach(([t,n,r])=>{r&&n!==r&&e.setAttribute(t,r)}),!1;if(sa.isIgnored(e,c)||e.form&&e.form.isSameNode(m))return this.trackBefore("updated",e,t),sa.mergeAttrs(e,t,{isIgnored:sa.isIgnored(e,c)}),p.push(e),sa.applyStickyOperations(e),!1;if("number"===e.type&&e.validity&&e.validity.badInput)return!1;let r=s&&e.isSameNode(s)&&sa.isFormInput(e),i=r&&this.isChangedSelect(e,t);if(e.hasAttribute(zo)){const n=new Ea(e);if(n.lockRef&&(!this.undoRef||!n.isLockUndoneBy(this.undoRef))){sa.isUploadInput(e)&&(sa.mergeAttrs(e,t,{isIgnored:!0}),this.trackBefore("updated",e,t),p.push(e)),sa.applyStickyOperations(e);let n=e.hasAttribute(Go)?sa.private(e,Go)||e.cloneNode(!0):null;n&&(sa.putPrivate(e,Go,n),r||(e=n))}}if(sa.isPhxChild(t)){let n=e.getAttribute(gs);return sa.mergeAttrs(e,t,{exclude:[ys]}),""!==n&&e.setAttribute(gs,n),e.setAttribute(ls,this.rootID),sa.applyStickyOperations(e),!1}return this.undoRef&&sa.private(t,Go)&&sa.putPrivate(e,Go,sa.private(t,Go)),sa.copyPrivates(t,e),r&&"hidden"!==e.type&&!i?(this.trackBefore("updated",e,t),sa.mergeFocusedInput(e,t),sa.syncAttrsToProps(e),p.push(e),sa.applyStickyOperations(e),!1):(i&&e.blur(),sa.isPhxUpdate(t,c,["append","prepend"])&&g.push(new va(e,t,t.getAttribute(c))),sa.syncAttrsToProps(t),sa.applyStickyOperations(t),this.trackBefore("updated",e,t),e)}};Ra(n,r,o)}if(this.trackBefore("added",i),this.trackBefore("updated",i,i),n.time("morphdom",()=>{this.streams.forEach(([e,t,n,r])=>{t.forEach(([t,n,i])=>{this.streamInserts[t]={ref:e,streamAt:n,limit:i,reset:r}}),void 0!==r&&sa.all(i,`[${Is}="${e}"]`,e=>{this.removeStreamChildElement(e)}),n.forEach(e=>{let t=i.querySelector(`[id="${e}"]`);t&&this.removeStreamChildElement(t)})}),e&&sa.all(this.container,`[${c}=${Ss}]`).filter(e=>
2this.view.ownsElement(e)).forEach(e=>{Array.from(e.children).forEach(e=>{this.removeStreamChildElement(e,!0)})}),w.call(this,o,r)}),n.isDebugEnabled()&&(!function(){let e=new Set,t=document.querySelectorAll("*[id]");for(let n=0,r=t.length;n<r;n++)e.has(t[n].id)?console.error(`Multiple IDs detected: ${t[n].id}. Ensure unique element ids.`):e.add(t[n].id)}(),function(e){const t=new Set;Object.keys(e).forEach(e=>{const n=document.getElementById(e);n&&n.parentElement&&"stream"!==n.parentElement.getAttribute("phx-update")&&t.add(`The stream container with id "${n.parentElement.id}" is missing the phx-update="stream" attribute. Ensure it is set for streams to work properly.`)}),t.forEach(e=>console.error(e))}(this.streamInserts),Array.from(document.querySelectorAll("input[name=id]")).forEach(e=>{e.form&&console.error('Detected an input with name="id" inside a form! This will cause problems when patching the DOM.\n',e)})),g.length>0&&n.time("post-morph append/prepend restoration",()=>{g.forEach(e=>e.perform())}),n.silenceEvents(()=>sa.restoreFocus(s,a,l)),sa.dispatchEvent(document,"phx:update"),f.forEach(e=>this.trackAfter("added",e)),p.forEach(e=>this.trackAfter("updated",e)),this.transitionPendingRemoves(),m){n.unload();const e=sa.private(m,"submitter");if(e&&e.name&&o.contains(e)){const t=document.createElement("input");t.type="hidden";const n=e.getAttribute("form");n&&t.setAttribute("form",n),t.name=e.name,t.value=e.value,e.parentElement.insertBefore(t,e)}Object.getPrototypeOf(m).submit.call(m)}return!0}onNodeDiscarded(e){(sa.isPhxChild(e)||sa.isPhxSticky(e))&&this.liveSocket.destroyViewByEl(e),this.trackAfter("discarded",e)}maybePendingRemove(e){return!(!e.getAttribute||null===e.getAttribute(this.phxRemove))&&(this.pendingRemoves.push(e),!0)}removeStreamChildElement(e,t=!1){(t||this.view.ownsElement(e))&&(this.streamInserts[e.id]?(this.streamComponentRestore[e.id]=e,e.remove()):this.maybePendingRemove(e)||(e.remove(),this.onNodeDiscarded(e)))}getStreamInsert(e){return(e.id?this.streamInserts[e.id]:{})||{}}setStreamRef(e,t){sa.putSticky(e,Is,e=>e.setAttribute(Is,t))}maybeReOrderStream(e,t){let{ref:n,streamAt:r,reset:i}=this.getStreamInsert(e);if(void 0!==r&&(this.setStreamRef(e,n),(i||t)&&e.parentElement)){if(0===r)e.parentElement.insertBefore(e,e.parentElement.firstElementChild);else if(r>0){let t=Array.from(e.parentElement.children),n=t.indexOf(e);if(r>=t.length-1)e.parentElement.appendChild(e);else{let i=t[r];n>r?e.parentElement.insertBefore(e,i):e.parentElement.insertBefore(e,i.nextElementSibling)}}this.maybeLimitStream(e)}}maybeLimitStream(e){let{limit:t}=this.getStreamInsert(e),n=null!==t&&Array.from(e.parentElement.children);t&&t<0&&n.length>-1*t?n.slice(0,n.length+t).forEach(e=>this.removeStreamChildElement(e)):t&&t>=0&&n.length>t&&n.slice(t).forEach(e=>this.removeStreamChildElement(e))}transitionPendingRemoves(){let{pendingRemoves:e,liveSocket:t}=this;e.length>0&&t.transitionRemoves(e,()=>{e.forEach(e=>{let n=sa.firstPhxChild(e);n&&t.destroyViewByEl(n),e.remove()}),this.trackAfter("transitionsDiscarded",e)})}isChangedSelect(e,t){return e instanceof HTMLSelectElement&&!e.multiple&&(e.options.length!==t.options.length||(t.value=e.value,!e.isEqualNode(t)))}isCIDPatch(){return this.cidPatch}skipCIDSibling(e){return e.nodeType===Node.ELEMENT_NODE&&e.hasAttribute(Ko)}targetCIDContainer(e){if(!this.isCIDPatch())return;let[t,...n]=sa.findComponentNodeList(this.container,this.targetCID);return 0===n.length&&1===sa.childNodeLength(e)?t:t&&t.parentNode}indexOf(e,t){return Array.from(e.children).indexOf(t)}},Pa=new Set(["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"]),ka=new Set(["'",'"']),xa=(e,t,n)=>{let r,i,o,s,a,l,c=0,u=!1,h=e.match(/^(\s*(?:<!--.*?-->\s*)*)<([^\s\/>]+)/);if(null===h)throw new Error(`malformed html ${e}`);for(c=h[0].length,r=h[1],o=h[2],s=c;c<e.length&&">"!==e.charAt(c);c++)if("="===e.charAt(c)){let t=" id"===e.slice(c-3,c);c++;let n=e.charAt(c);if(ka.has(n)){let r=c;for(c++;c<e.length&&e.charAt(c)!==n;c++);if(t){a=e.slice(r+1,c);break}}}let d=e.length-1;for(u=!1;d>=r.length+o.length;){let t=e.charAt(d);if(u)"-"===t&&"<!-"===e.slice(d-3,d)?(u=!1,d-=4):d-=1;else if(">"===t&&"--"===e.slice(d-2,d))u=!0,d-=3;else{if(">"===t)break;d-=1}}i=e.slice(d+1,e.length);let f=Object.keys(t).map(e=>!0===t[e]?e:`${e}="${t[e]}"`).join(" ");if(n){let e=a?` id="${a}"`:"";l=Pa.has(o)?`<${o}${e}${""===f?"":" "}${f}/>`:`<${o}${e}${""===f?"":" "}${f}></${o}>`}else{l=`<${o}${""===f?"":" "}${f}${e.slice(s,d+1)}`}return[l,r,i]},La=class{static extract(e){let{[Gs]:t,[zs]:n,[Ws]:r}=e;return delete e[Gs],delete e[zs],delete e[Ws],{diff:e,title:r,reply:t||null,events:n||[]}}constructor(e,t){this.viewId=e,this.rendered={},this.magicId=0,this.mergeDiff(t)}parentViewId(){return this.viewId}toString(e){let[t,n]=this.recursiveToString(this.rendered,this.rendered[Vs],e,!0,{});return[t,n]}recursiveToString(e,t=e[Vs],n,r,i){let o={buffer:"",components:t,onlyCids:n=n?new Set(n):null,streams:new Set};return this.toOutputBuffer(e,null,o,r,i),[o.buffer,o.streams]}componentCIDs(e){return Object.keys(e[Vs]||{}).map(e=>parseInt(e))}isComponentOnlyDiff(e){return!!e[Vs]&&1===Object.keys(e).length}getComponent(e,t){return e[Vs][t]}resetRender(e){this.rendered[Vs][e]&&(this.rendered[Vs][e].reset=!0)}mergeDiff(e){let t=e[Vs],n={};if(delete e[Vs],this.rendered=this.mutableMerge(this.rendered,e),this.rendered[Vs]=this.rendered[Vs]||{},t){let r=this.rendered[Vs];for(let e in t)t[e]=this.cachedFindComponent(e,t[e],r,t,n);for(let e in t)r[e]=t[e];e[Vs]=t}}cachedFindComponent(e,t,n,r,i){if(i[e])return i[e];{let o,s,a=t[Hs];if(qs(a)){let e;e=a>0?this.cachedFindComponent(a,r[a],n,r,i):n[-a],s=e[Hs],o=this.cloneMerge(e,t,!0),o[Hs]=s}else o=void 0!==t[Hs]||void 0===n[e]?t:this.cloneMerge(n[e],t,!1);return i[e]=o,o}}mutableMerge(e,t){return void 0!==t[Hs]?t:(this.doMutableMerge(e,t),e)}doMutableMerge(e,t){for(let n in t){let r=t[n],i=e[n];Js(r)&&void 0===r[Hs]&&Js(i)?this.doMutableMerge(i,r):e[n]=r}e.r&&(e.newRender=!0)}cloneMerge(e,t,n){let r={...e,...t};for(let i in r){let o=t[i],s=e[i];Js(o)&&void 0===o[Hs]&&Js(s)?r[i]=this.cloneMerge(s,o,n):void 0===o&&Js(s)&&(r[i]=this.cloneMerge(s,{},n))}return n?(delete r.magicId,delete r.newRender):e.r&&(r.newRender=!0),r}componentToString(e){let[t,n]=this.recursiveCIDToString(this.rendered[Vs],e,null),[r,i,o]=xa(t,{});return[r,n]}
2pruneCIDs(e){e.forEach(e=>delete this.rendered[Vs][e])}get(){return this.rendered}isNewFingerprint(e={}){return!!e[Hs]}templateStatic(e,t){return"number"==typeof e?t[e]:e}nextMagicID(){return this.magicId++,`m${this.magicId}-${this.parentViewId()}`}toOutputBuffer(e,t,n,r,i={}){if(e[js])return this.comprehensionToBuffer(e,t,n);let{[Hs]:o}=e;o=this.templateStatic(o,t);let s=e.r,a=n.buffer;s&&(n.buffer=""),r&&s&&!e.magicId&&(e.newRender=!0,e.magicId=this.nextMagicID()),n.buffer+=o[0];for(let i=1;i<o.length;i++)this.dynamicToBuffer(e[i-1],t,n,r),n.buffer+=o[i];if(s){let t,o=!1;r||e.magicId?(o=r&&!e.newRender,t={[Jo]:e.magicId,...i}):t=i,o&&(t[Ko]=!0);let[s,l,c]=xa(n.buffer,t,o);e.newRender=!1,n.buffer=a+l+s+c}}comprehensionToBuffer(e,t,n){let{[js]:r,[Hs]:i,[Ys]:o}=e,[s,a,l,c]=o||[null,{},[],null];i=this.templateStatic(i,t);let u=t||e.p;for(let e=0;e<r.length;e++){let t=r[e];n.buffer+=i[0];for(let e=1;e<i.length;e++){let r=!1;this.dynamicToBuffer(t[e-1],u,n,r),n.buffer+=i[e]}}void 0!==o&&(e[js].length>0||l.length>0||c)&&(delete e[Ys],e[js]=[],n.streams.add(o))}dynamicToBuffer(e,t,n,r){if("number"==typeof e){let[t,r]=this.recursiveCIDToString(n.components,e,n.onlyCids);n.buffer+=t,n.streams=new Set([...n.streams,...r])}else Js(e)?this.toOutputBuffer(e,t,n,r,{}):n.buffer+=e}recursiveCIDToString(e,t,n){let r=e[t]||$s(`no component for CID ${t}`,e),i={[jo]:t},o=n&&!n.has(t);r.newRender=!o,r.magicId=`c${t}-${this.parentViewId()}`;let s=!r.reset,[a,l]=this.recursiveToString(r,e,n,s,i);return delete r.reset,[a,l]}},Ba=[],Fa={exec(e,t,n,r,i,o){let[s,a]=o||[null,{callback:o&&o.callback}];("["===n.charAt(0)?JSON.parse(n):[[s,a]]).forEach(([o,l])=>{o===s&&((l={...a,...l}).callback=l.callback||a.callback),this.filterToEls(r.liveSocket,i,l).forEach(s=>{this[`exec_${o}`](e,t,n,r,i,s,l)})})},isVisible:e=>!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length>0),isInViewport(e){const t=e.getBoundingClientRect(),n=window.innerHeight||document.documentElement.clientHeight,r=window.innerWidth||document.documentElement.clientWidth;return t.right>0&&t.bottom>0&&t.left<r&&t.top<n},exec_exec(e,t,n,r,i,o,{attr:s,to:a}){let l=o.getAttribute(s);if(!l)throw new Error(`expected ${s} to contain JS command on "${a}"`);r.liveSocket.execJS(o,l,t)},exec_dispatch(e,t,n,r,i,o,{event:s,detail:a,bubbles:l}){(a=a||{}).dispatcher=i,sa.dispatchEvent(o,s,{detail:a,bubbles:l})},exec_push(e,t,n,r,i,o,s){let{event:a,data:l,target:c,page_loading:u,loading:h,value:d,dispatcher:f,callback:p}=s,g={loading:h,value:d,target:c,page_loading:!!u},m="change"===t&&f?f:i,w=c||m.getAttribute(r.binding("target"))||m;const y=(e,r)=>{if(e.isConnected())if("change"===t){let{newCid:t,_target:o}=s;o=o||(sa.isFormInput(i)?i.name:void 0),o&&(g._target=o),e.pushInput(i,r,t,a||n,g,p)}else if("submit"===t){let{submitter:t}=s;e.submitForm(i,r,a||n,t,g,p)}else e.pushEvent(t,i,r,a||n,l,g,p)};s.targetView&&s.targetCtx?y(s.targetView,s.targetCtx):r.withinTargets(w,y)},exec_navigate(e,t,n,r,i,o,{href:s,replace:a}){r.liveSocket.historyRedirect(e,s,a?"replace":"push",null,i)},exec_patch(e,t,n,r,i,o,{href:s,replace:a}){r.liveSocket.pushHistoryPatch(e,s,a?"replace":"push",i)},exec_focus(e,t,n,r,i,o){ua.attemptFocus(o),window.requestAnimationFrame(()=>{window.requestAnimationFrame(()=>ua.attemptFocus(o))})},exec_focus_first(e,t,n,r,i,o){ua.focusFirstInteractive(o)||ua.focusFirst(o),window.requestAnimationFrame(()=>{window.requestAnimationFrame(()=>ua.focusFirstInteractive(o)||ua.focusFirst(o))})},exec_push_focus(e,t,n,r,i,o){Ba.push(o||i)},exec_pop_focus(e,t,n,r,i,o){const s=Ba.pop();s&&(s.focus(),window.requestAnimationFrame(()=>{window.requestAnimationFrame(()=>s.focus())}))},exec_add_class(e,t,n,r,i,o,{names:s,transition:a,time:l,blocking:c}){this.addOrRemoveClasses(o,s,[],a,l,r,c)},exec_remove_class(e,t,n,r,i,o,{names:s,transition:a,time:l,blocking:c}){this.addOrRemoveClasses(o,[],s,a,l,r,c)},exec_toggle_class(e,t,n,r,i,o,{names:s,transition:a,time:l,blocking:c}){this.toggleClasses(o,s,a,l,r,c)},exec_toggle_attr(e,t,n,r,i,o,{attr:[s,a,l]}){this.toggleAttr(o,s,a,l)},exec_transition(e,t,n,r,i,o,{time:s,transition:a,blocking:l}){this.addOrRemoveClasses(o,[],[],a,s,r,l)},exec_toggle(e,t,n,r,i,o,{display:s,ins:a,outs:l,time:c,blocking:u}){this.toggle(t,r,o,s,a,l,c,u)},exec_show(e,t,n,r,i,o,{display:s,transition:a,time:l,blocking:c}){this.show(t,r,o,s,a,l,c)},exec_hide(e,t,n,r,i,o,{display:s,transition:a,time:l,blocking:c}){this.hide(t,r,o,s,a,l,c)},exec_set_attr(e,t,n,r,i,o,{attr:[s,a]}){this.setOrRemoveAttrs(o,[[s,a]],[])},exec_remove_attr(e,t,n,r,i,o,{attr:s}){this.setOrRemoveAttrs(o,[],[s])},show(e,t,n,r,i,o,s){this.isVisible(n)||this.toggle(e,t,n,r,i,null,o,s)},hide(e,t,n,r,i,o,s){this.isVisible(n)&&this.toggle(e,t,n,r,null,i,o,s)},toggle(e,t,n,r,i,o,s,a){s=s||200;let[l,c,u]=i||[[],[],[]],[h,d,f]=o||[[],[],[]];if(l.length>0||h.length>0)if(this.isVisible(n)){let e=()=>{this.addOrRemoveClasses(n,d,l.concat(c).concat(u)),window.requestAnimationFrame(()=>{this.addOrRemoveClasses(n,h,[]),window.requestAnimationFrame(()=>this.addOrRemoveClasses(n,f,d))})},r=()=>{this.addOrRemoveClasses(n,[],h.concat(f)),sa.putSticky(n,"toggle",e=>e.style.display="none"),n.dispatchEvent(new Event("phx:hide-end"))};n.dispatchEvent(new Event("phx:hide-start")),!1===a?(e(),setTimeout(r,s)):t.transition(s,e,r)}else{if("remove"===e)return;let i=()=>{this.addOrRemoveClasses(n,c,h.concat(d).concat(f));const e=r||this.defaultDisplay(n);window.requestAnimationFrame(()=>{this.addOrRemoveClasses(n,l,[]),window.requestAnimationFrame(()=>{sa.putSticky(n,"toggle",t=>t.style.display=e),this.addOrRemoveClasses(n,u,c)})})},o=()=>{this.addOrRemoveClasses(n,[],l.concat(u)),n.dispatchEvent(new Event("phx:show-end"))};n.dispatchEvent(new Event("phx:show-start")),!1===a?(i(),setTimeout(o,s)):t.transition(s,i,o)}else this.isVisible(n)?window.requestAnimationFrame(()=>{n.dispatchEvent(new Event("phx:hide-start")),sa.putSticky(n,"toggle",e=>e.style.display="none"),n.dispatchEvent(new Event("phx:hide-end"))}):window.requestAnimationFrame(()=>{n.dispatchEvent(new Event("phx:show-start"));let e=r||this.defaultDisplay(n);sa.putSticky(n,"toggle",t=>t.style.display=e),n.dispatchEvent(new Event("phx:show-end"))})},toggleClasses(e,t,n,r,i,o){window.requestAnimationFrame(()=>{let[s,a]=sa.getSticky(e,"classes",[[],[]]),l=t.filter(t=>s.indexOf(t)<0&&!e.classList.contains(t)),c=t.filter(t=>a.indexOf(t)<0&&e.classList.contains(t));this.addOrRemoveClasses(e,l,c,n,r,i,o)})},toggleAttr(e,t,n,r){e.hasAttribute(t)?void 0!==r?e.getAttribute(t)===n?this.setOrRemoveAttrs(e,[[t,r]],[]):this.setOrRemoveAttrs(e,[[t,n]],[]):this.setOrRemoveAttrs(e,[],[t]):this.setOrRemoveAttrs(e,[[t,n]],[])},addOrRemoveClasses(e,t,n,r,i,o,s){i=i||200;let[a,l,c]=r||[[],[],[]];if(a.length>0){let r=()=>{this.addOrRemoveClasses(e,l,[].concat(a).concat(c)),window.requestAnimationFrame(()=>{this.addOrRemoveClasses(e,a,[]),window.requestAnimationFrame(()=>this.addOrRemoveClasses(e,c,l))})},u=()=>this.addOrRemoveClasses(e,t.concat(c),n.concat(a).concat(l));return void(!1===s?(r(),setTimeout(u,i)):o.transition(i,r,u))}window.requestAnimationFrame(()=>{let[r,i]=sa.getSticky(e,"classes",[[],[]]),o=t.filter(t=>r.indexOf(t)<0&&!e.classList.contains(t)),s=n.filter(t=>i.indexOf(t)<0&&e.classList.contains(t)),a=r.filter(e=>n.indexOf(e)<0).concat(o),l=i.filter(e=>t.indexOf(e)<0).concat(s);sa.putSticky(e,"classes",e=>(e.classList.remove(...l),e.classList.add(...a),[a,l]))})},setOrRemoveAttrs(e,t,n){let[r,i]=sa.getSticky(e,"attrs",[[],[]]),o=t.map(([e,t])=>e).concat(n),s=r.filter(([e,t])=>!o.includes(e)).concat(t),a=i.filter(e=>!o.includes(e)).concat(n);sa.putSticky(e,"attrs",e=>
2(a.forEach(t=>e.removeAttribute(t)),s.forEach(([t,n])=>e.setAttribute(t,n)),[s,a]))},hasAllClasses:(e,t)=>t.every(t=>e.classList.contains(t)),isToggledOut(e,t){return!this.isVisible(e)||this.hasAllClasses(e,t)},filterToEls:(e,t,{to:n})=>n?e.jsQuerySelectorAll(t,n,()=>{if("string"==typeof n)return document.querySelectorAll(n);if(n.closest){let e=t.closest(n.closest);return e?[e]:[]}return n.inner?t.querySelectorAll(n.inner):void 0}):[t],defaultDisplay:e=>({tr:"table-row",td:"table-cell"}[e.tagName.toLowerCase()]||"block"),transitionClasses(e){if(!e)return null;let[t,n,r]=Array.isArray(e)?e:[e.split(" "),[],[]];return t=Array.isArray(t)?t:t.split(" "),n=Array.isArray(n)?n:n.split(" "),r=Array.isArray(r)?r:r.split(" "),[t,n,r]}},Ua=Fa,ja="hookId",Ha=1,Va=class{static makeID(){return Ha++}static elementID(e){return sa.private(e,ja)}constructor(e,t,n){this.el=t,this.__attachView(e),this.__callbacks=n,this.__listeners=new Set,this.__isDisconnected=!1,sa.putPrivate(this.el,ja,this.constructor.makeID());for(let e in this.__callbacks)this[e]=this.__callbacks[e]}__attachView(e){e?(this.__view=()=>e,this.liveSocket=e.liveSocket):(this.__view=()=>{throw new Error(`hook not yet attached to a live view: ${this.el.outerHTML}`)},this.liveSocket=null)}__mounted(){this.mounted&&this.mounted()}__updated(){this.updated&&this.updated()}__beforeUpdate(){this.beforeUpdate&&this.beforeUpdate()}__destroyed(){this.destroyed&&this.destroyed(),sa.deletePrivate(this.el,ja)}__reconnected(){this.__isDisconnected&&(this.__isDisconnected=!1,this.reconnected&&this.reconnected())}__disconnected(){this.__isDisconnected=!0,this.disconnected&&this.disconnected()}js(){let e=this;return{exec(t){e.__view().liveSocket.execJS(e.el,t,"hook")},show(t,n={}){let r=e.__view().liveSocket.owner(t);Ua.show("hook",r,t,n.display,n.transition,n.time,n.blocking)},hide(t,n={}){let r=e.__view().liveSocket.owner(t);Ua.hide("hook",r,t,null,n.transition,n.time,n.blocking)},toggle(t,n={}){let r=e.__view().liveSocket.owner(t);n.in=Ua.transitionClasses(n.in),n.out=Ua.transitionClasses(n.out),Ua.toggle("hook",r,t,n.display,n.in,n.out,n.time,n.blocking)},addClass(t,n,r={}){n=Array.isArray(n)?n:n.split(" ");let i=e.__view().liveSocket.owner(t);Ua.addOrRemoveClasses(t,n,[],r.transition,r.time,i,r.blocking)},removeClass(t,n,r={}){r.transition=Ua.transitionClasses(r.transition),n=Array.isArray(n)?n:n.split(" ");let i=e.__view().liveSocket.owner(t);Ua.addOrRemoveClasses(t,[],n,r.transition,r.time,i,r.blocking)},toggleClass(t,n,r={}){r.transition=Ua.transitionClasses(r.transition),n=Array.isArray(n)?n:n.split(" ");let i=e.__view().liveSocket.owner(t);Ua.toggleClasses(t,n,r.transition,r.time,i,r.blocking)},transition(t,n,r={}){let i=e.__view().liveSocket.owner(t);Ua.addOrRemoveClasses(t,[],[],Ua.transitionClasses(n),r.time,i,r.blocking)},setAttribute(e,t,n){Ua.setOrRemoveAttrs(e,[[t,n]],[])},removeAttribute(e,t){Ua.setOrRemoveAttrs(e,[],[t])},toggleAttribute(e,t,n,r){Ua.toggleAttr(e,t,n,r)}}}pushEvent(e,t={},n){return void 0===n?new Promise((n,r)=>{try{!1===this.__view().pushHookEvent(this.el,null,e,t,(e,t)=>n(e))&&r(new Error("unable to push hook event. LiveView not connected"))}catch(e){r(e)}}):this.__view().pushHookEvent(this.el,null,e,t,n)}pushEventTo(e,t,n={},r){return void 0===r?new Promise((r,i)=>{try{this.__view().withinTargets(e,(e,o)=>{!1===e.pushHookEvent(this.el,o,t,n,(e,t)=>r(e))&&i(new Error("unable to push hook event. LiveView not connected"))})}catch(e){i(e)}}):this.__view().withinTargets(e,(e,i)=>e.pushHookEvent(this.el,i,t,n,r))}handleEvent(e,t){let n=(n,r)=>r?e:t(n.detail);return window.addEventListener(`phx:${e}`,n),this.__listeners.add(n),n}removeHandleEvent(e){let t=e(null,!0);window.removeEventListener(`phx:${t}`,e),this.__listeners.delete(e)}upload(e,t){return this.__view().dispatchUploads(null,e,t)}uploadTo(e,t,n){return this.__view().withinTargets(e,(e,r)=>{e.dispatchUploads(r,t,n)})}__cleanup__(){this.__listeners.forEach(e=>this.removeHandleEvent(e))}},za=(e,t)=>{let n=e.endsWith("[]"),r=n?e.slice(0,-2):e;return r=r.replace(/([^\[\]]+)(\]?$)/,`${t}$1$2`),n&&(r+="[]"),r},Ga=(e,t,n=[])=>{const{submitter:r}=t;let i;if(r&&r.name){const e=document.createElement("input");e.type="hidden";const t=r.getAttribute("form");t&&e.setAttribute("form",t),e.name=r.name,e.value=r.value,r.parentElement.insertBefore(e,r),i=e}const o=new FormData(e),s=[];o.forEach((e,t,n)=>{e instanceof File&&s.push(t)}
2),s.forEach(e=>o.delete(e));const a=new URLSearchParams,{inputsUnused:l,onlyHiddenInputs:c}=Array.from(e.elements).reduce((e,t)=>{const{inputsUnused:n,onlyHiddenInputs:r}=e,i=t.name;if(!i)return e;void 0===n[i]&&(n[i]=!0),void 0===r[i]&&(r[i]=!0);const o=sa.private(t,hs)||sa.private(t,ps),s="hidden"===t.type;return n[i]=n[i]&&!o,r[i]=r[i]&&s,e},{inputsUnused:{},onlyHiddenInputs:{}});for(let[e,t]of o.entries())if(0===n.length||n.indexOf(e)>=0){let n=l[e],i=c[e];!n||r&&r.name==e||i||a.append(za(e,"_unused_"),""),a.append(e,t)}return r&&i&&r.parentElement.removeChild(i),a.toString()},Wa=class e{static closestView(e){let t=e.closest(ms);return t?sa.private(t,"view"):null}constructor(e,t,n,r,i){this.isDead=!1,this.liveSocket=t,this.flash=r,this.parent=n,this.root=n?n.root:this,this.el=e,sa.putPrivate(this.el,"view",this),this.id=this.el.id,this.ref=0,this.lastAckRef=null,this.childJoins=0,this.loaderTimer=null,this.disconnectedTimer=null,this.pendingDiffs=[],this.pendingForms=new Set,this.redirect=!1,this.href=null,this.joinCount=this.parent?this.parent.joinCount-1:0,this.joinAttempts=0,this.joinPending=!0,this.destroyed=!1,this.joinCallback=function(e){e&&e()},this.stopCallback=function(){},this.pendingJoinOps=this.parent?null:[],this.viewHooks={},this.formSubmits=[],this.children=this.parent?null:{},this.root.children[this.id]={},this.formsForRecovery={},this.channel=this.liveSocket.channel(`lv:${this.id}`,()=>{let e=this.href&&this.expandURL(this.href);return{redirect:this.redirect?e:void 0,url:this.redirect?void 0:e||void 0,params:this.connectParams(i),session:this.getSession(),static:this.getStatic(),flash:this.flash,sticky:this.el.hasAttribute(ws)}})}setHref(e){this.href=e}setRedirect(e){this.redirect=!0,this.href=e}isMain(){return this.el.hasAttribute(as)}connectParams(e){let t=this.liveSocket.params(this.el),n=sa.all(document,`[${this.binding("track-static")}]`).map(e=>e.src||e.href).filter(e=>"string"==typeof e);return n.length>0&&(t._track_static=n),t._mounts=this.joinCount,t._mount_attempts=this.joinAttempts,t._live_referer=e,this.joinAttempts++,t}isConnected(){return this.channel.canPush()}getSession(){return this.el.getAttribute(gs)}getStatic(){let e=this.el.getAttribute(ys);return""===e?null:e}destroy(e=function(){}){this.destroyAllChildren(),this.destroyed=!0,delete this.root.children[this.id],this.parent&&delete this.root.children[this.parent.id][this.id],clearTimeout(this.loaderTimer);let t=()=>{e();for(let e in this.viewHooks)this.destroyHook(this.viewHooks[e])};sa.markPhxChildDestroyed(this.el),this.log("destroyed",()=>["the child has been removed from the parent"]),this.channel.leave().receive("ok",t).receive("error",t).receive("timeout",t)}setContainerClasses(...e){this.el.classList.remove(ts,ns,rs,is,os),this.el.classList.add(...e)}showLoader(e){if(clearTimeout(this.loaderTimer),e)this.loaderTimer=setTimeout(()=>this.showLoader(),e);else{for(let e in this.viewHooks)this.viewHooks[e].__disconnected();this.setContainerClasses(ns)}}execAll(e){sa.all(this.el,`[${e}]`,t=>this.liveSocket.execJS(t,t.getAttribute(e)))}hideLoader(){clearTimeout(this.loaderTimer),clearTimeout(this.disconnectedTimer),this.setContainerClasses(ts),this.execAll(this.binding("connected"))}triggerReconnected(){for(let e in this.viewHooks)this.viewHooks[e].__reconnected()}log(e,t){this.liveSocket.log(this,e,t)}transition(e,t,n=function(){}){this.liveSocket.transition(e,t,n)}withinTargets(e,t,n=document,r){if(e instanceof HTMLElement||e instanceof SVGElement)return this.liveSocket.owner(e,n=>t(n,e));if(qs(e)){0===sa.findComponentNodeList(r||this.el,e).length?$s(`no component found matching phx-target of ${e}`):t(this,parseInt(e))}else{let r=Array.from(n.querySelectorAll(e));0===r.length&&$s(`nothing found matching the phx-target selector "${e}"`),r.forEach(e=>this.liveSocket.owner(e,n=>t(n,e)))}}applyDiff(e,t,n){this.log(e,()=>["",Qs(t)]);let{diff:r,reply:i,events:o,title:s}=La.extract(t);n({diff:r,reply:i,events:o}),"string"!=typeof s&&"mount"!=e||window.requestAnimationFrame(()=>sa.putTitle(s))}onJoin(e){let{rendered:t,container:n,liveview_version:r}=e;if(n){let[e,t]=n;this.el=sa.replaceRootContainer(this.el,e,t)}this.childJoins=0,this.joinPending=!0,this.flash=null,this.root===this&&(this.formsForRecovery=this.getFormsForRecovery()),this.isMain()&&null===window.history.state&&ia.pushState("replace",{type:"patch",id:this.id,position:this.liveSocket.currentHistoryPosition}),r!==this.liveSocket.version()&&console.error(`LiveView asset version mismatch. JavaScript version ${this.liveSocket.version()} vs. server ${r}. To avoid issues, please ensure that your assets use the same version as the server.`),ia.dropLocal(this.liveSocket.localStorage,window.location.pathname,Fo),this.applyDiff("mount",t,({diff:t,events:n})=>{this.rendered=new La(this.id,t);let[r,i]=this.renderContainer(null,"join");this.dropPendingRefs(),this.joinCount++,this.joinAttempts=0,this.maybeRecoverForms(r,()=>{this.onJoinComplete(e,r,i,n)})})}dropPendingRefs(){sa.all(document,`[${zo}="${this.refSrc()}"]`,e=>{e.removeAttribute(Vo),e.removeAttribute(zo),e.removeAttribute(Go)})}onJoinComplete({live_patch:e},t,n,r){if(this.joinCount>1||this.parent&&!this.parent.isJoinPending())return this.applyJoinPatch(e,t,n,r);0===sa.findPhxChildrenInFragment(t,this.id).filter(e=>{let t=e.id&&this.el.querySelector(`[id="${e.id}"]`),n=t&&t.getAttribute(ys);return n&&e.setAttribute(ys,n),t&&t.setAttribute(ls,this.root.id),this.joinChild(e)}).length?this.parent?(this.root.pendingJoinOps.push([this,()=>this.applyJoinPatch(e,t,n,r)]),this.parent.ackJoin(this)):(this.onAllChildJoinsComplete(),this.applyJoinPatch(e,t,n,r)):this.root.pendingJoinOps.push([this,()=>this.applyJoinPatch(e,t,n,r)])}attachTrueDocEl(){this.el=sa.byId(this.id),this.el.setAttribute(ls,this.root.id)}execNewMounted(e=this.el){let t=this.binding(cs),n=this.binding(us);sa.all(e,`[${t}], [${n}]`,e=>{this.ownsElement(e)&&(sa.maintainPrivateHooks(e,e,t,n),this.maybeAddNewHook(e))}),sa.all(e,`[${this.binding(bs)}], [data-phx-${bs}]`,e=>{this.ownsElement(e)&&this.maybeAddNewHook(e)}),sa.all(e,`[${this.binding(Ps)}]`,e=>{this.ownsElement(e)&&this.maybeMounted(e)})}applyJoinPatch(e,t,n,r){this.attachTrueDocEl();let i=new Ma(this,this.el,this.id,t,n,null);
2if(i.markPrunableContentForRemoval(),this.performPatch(i,!1,!0),this.joinNewChildren(),this.execNewMounted(),this.joinPending=!1,this.liveSocket.dispatchEvents(r),this.applyPendingUpdates(),e){let{kind:t,to:n}=e;this.liveSocket.historyPatch(n,t)}this.hideLoader(),this.joinCount>1&&this.triggerReconnected(),this.stopCallback()}triggerBeforeUpdateHook(e,t){this.liveSocket.triggerDOM("onBeforeElUpdated",[e,t]);let n=this.getHook(e),r=n&&sa.isIgnored(e,this.binding(_s));if(n&&!e.isEqualNode(t)&&(!r||(i=e.dataset,o=t.dataset,JSON.stringify(i)!==JSON.stringify(o))))return n.__beforeUpdate(),n;var i,o}maybeMounted(e){let t=e.getAttribute(this.binding(Ps)),n=t&&sa.private(e,"mounted");t&&!n&&(this.liveSocket.execJS(e,t),sa.putPrivate(e,"mounted",!0))}maybeAddNewHook(e){let t=this.addHook(e);t&&t.__mounted()}performPatch(e,t,n=!1){let r=[],i=!1,o=new Set;return this.liveSocket.triggerDOM("onPatchStart",[e.targetContainer]),e.after("added",e=>{this.liveSocket.triggerDOM("onNodeAdded",[e]);let t=this.binding(cs),n=this.binding(us);sa.maintainPrivateHooks(e,e,t,n),this.maybeAddNewHook(e),e.getAttribute&&this.maybeMounted(e)}),e.after("phxChildAdded",e=>{sa.isPhxSticky(e)?this.liveSocket.joinRootViews():i=!0}),e.before("updated",(e,t)=>{this.triggerBeforeUpdateHook(e,t)&&o.add(e.id)}),e.after("updated",e=>{o.has(e.id)&&this.getHook(e).__updated()}),e.after("discarded",e=>{e.nodeType===Node.ELEMENT_NODE&&r.push(e)}),e.after("transitionsDiscarded",e=>this.afterElementsRemoved(e,t)),e.perform(n),this.afterElementsRemoved(r,t),this.liveSocket.triggerDOM("onPatchEnd",[e.targetContainer]),i}afterElementsRemoved(e,t){let n=[];e.forEach(e=>{let t=sa.all(e,`[${jo}]`),r=sa.all(e,`[${this.binding(bs)}], [data-phx-hook]`);t.concat(e).forEach(e=>{let t=this.componentID(e);qs(t)&&-1===n.indexOf(t)&&n.push(t)}),r.concat(e).forEach(e=>{let t=this.getHook(e);t&&this.destroyHook(t)})}),t&&this.maybePushComponentsDestroyed(n)}joinNewChildren(){sa.findPhxChildren(this.el,this.id).forEach(e=>this.joinChild(e))}maybeRecoverForms(e,t){const n=this.binding("change"),r=this.root.formsForRecovery;let i=document.createElement("template");i.innerHTML=e;const o=i.content.firstElementChild;o.id=this.id,o.setAttribute(ls,this.root.id),o.setAttribute(gs,this.get
2Session()),o.setAttribute(ys,this.getStatic()),o.setAttribute(ss,this.parent?this.parent.id:null);const s=sa.all(i.content,"form").filter(e=>e.id&&r[e.id]).filter(e=>!this.pendingForms.has(e.id)).filter(e=>r[e.id].getAttribute(n)===e.getAttribute(n)).map(e=>[r[e.id],e]);if(0===s.length)return t();s.forEach(([e,n],r)=>{this.pendingForms.add(n.id),this.pushFormRecovery(e,n,i.content.firstElementChild,()=>{this.pendingForms.delete(n.id),r===s.length-1&&t()})})}getChildById(e){return this.root.children[this.id][e]}getDescendentByEl(e){return e.id===this.id?this:this.children[e.getAttribute(ss)]?.[e.id]}destroyDescendent(e){for(let t in this.root.children)for(let n in this.root.children[t])if(n===e)return this.root.children[t][n].destroy()}joinChild(t){if(!this.getChildById(t.id)){let n=new e(t,this.liveSocket,this);return this.root.children[this.id][n.id]=n,n.join(),this.childJoins++,!0}}isJoinPending(){return this.joinPending}ackJoin(e){this.childJoins--,0===this.childJoins&&(this.parent?this.parent.ackJoin(this):this.onAllChildJoinsComplete())}onAllChildJoinsComplete(){this.pendingForms.clear(),this.formsForRecovery={},this.joinCallback(()=>{this.pendingJoinOps.forEach(([e,t])=>{e.isDestroyed()||t()}),this.pendingJoinOps=[]})}update(e,t,n=!1){if(this.isJoinPending()||this.liveSocket.hasPendingLink()&&this.root.isMain())return n||this.pendingDiffs.push({diff:e,events:t}),!1;this.rendered.mergeDiff(e);let r=!1;return this.rendered.isComponentOnlyDiff(e)?this.liveSocket.time("component patch complete",()=>{sa.findExistingParentCIDs(this.el,this.rendered.componentCIDs(e)).forEach(t=>{this.componentPatch(this.rendered.getComponent(e,t),t)&&(r=!0)})}):ea(e)||this.liveSocket.time("full patch complete",()=>{let[t,n]=this.renderContainer(e,"update"),i=new Ma(this,this.el,this.id,t,n,null);r=this.performPatch(i,!0)}),this.liveSocket.dispatchEvents(t),r&&this.joinNewChildren(),!0}renderContainer(e,t){return this.liveSocket.time(`toString diff (${t})`,()=>{let t=this.el.tagName,n=e?this.rendered.componentCIDs(e):null,[r,i]=this.rendered.toString(n);return[`<${t}>${r}</${t}>`,i]})}componentPatch(e,t){if(ea(e))return!1;let[n,r]=this.rendered.componentToString(t),i=new Ma(this,this.el,this.id,n,r,t);return this.performPatch(i,!0)}getHook(e){return this.viewHooks[Va.elementID(e)]}addHook(e){let t=Va.elementID(e);if(!e.getAttribute||this.ownsElement(e)){if(t&&!this.viewHooks[t]){let n=sa.getCustomElHook(e)||$s(`no hook found for custom element: ${e.id}`);return this.viewHooks[t]=n,n.__attachView(this),n}if(!t&&e.getAttribute){let t=e.getAttribute(`data-phx-${bs}`)||e.getAttribute(this.binding(bs)),n=this.liveSocket.getHookCallbacks(t);if(n){e.id||$s(`no DOM ID for hook "${t}". Hooks require a unique ID on each element.`,e);let r=new Va(this,e,n);return this.viewHooks[Va.elementID(r.el)]=r,r}
2null!==t&&$s(`unknown hook found for "${t}"`,e)}}}destroyHook(e){const t=Va.elementID(e.el);e.__destroyed(),e.__cleanup__(),delete this.viewHooks[t]}applyPendingUpdates(){this.pendingDiffs=this.pendingDiffs.filter(({diff:e,events:t})=>!this.update(e,t,!0)),this.eachChild(e=>e.applyPendingUpdates())}eachChild(e){let t=this.root.children[this.id]||{};for(let n in t)e(this.getChildById(n))}onChannel(e,t){this.liveSocket.onChannel(this.channel,e,e=>{this.isJoinPending()?this.root.pendingJoinOps.push([this,()=>t(e)]):this.liveSocket.requestDOMUpdate(()=>t(e))})}bindChannel(){this.liveSocket.onChannel(this.channel,"diff",e=>{this.liveSocket.requestDOMUpdate(()=>{this.applyDiff("update",e,({diff:e,events:t})=>this.update(e,t))})}),this.onChannel("redirect",({to:e,flash:t})=>this.onRedirect({to:e,flash:t})),this.onChannel("live_patch",e=>this.onLivePatch(e)),this.onChannel("live_redirect",e=>this.onLiveRedirect(e)),this.channel.onError(e=>this.onError(e)),this.channel.onClose(e=>this.onClose(e))}destroyAllChildren(){this.eachChild(e=>e.destroy())}onLiveRedirect(e){let{to:t,kind:n,flash:r}=e,i=this.expandURL(t),o=new CustomEvent("phx:server-navigate",{detail:{to:t,kind:n,flash:r}});this.liveSocket.historyRedirect(o,i,n,r)}onLivePatch(e){let{to:t,kind:n}=e;this.href=this.expandURL(t),this.liveSocket.historyPatch(t,n)}expandURL(e){return e.startsWith("/")?`${window.location.protocol}//${window.location.host}${e}`:e}onRedirect({to:e,flash:t,reloadToken:n}){this.liveSocket.redirect(e,t,n)}isDestroyed(){return this.destroyed}joinDead(){this.isDead=!0}joinPush(){return this.joinPush=this.joinPush||this.channel.join(),this.joinPush}join(e){this.showLoader(this.liveSocket.loaderTimeout),this.bindChannel(),this.isMain()&&(this.stopCallback=this.liveSocket.withPageLoading({to:this.href,kind:"initial"})),this.joinCallback=t=>{t=t||function(){},e?e(this.joinCount,t):t()},this.wrapPush(()=>this.channel.join(),{ok:e=>this.liveSocket.requestDOMUpdate(()=>this.onJoin(e)),error:e=>this.onJoinError(e),timeout:()=>this.onJoinError({reason:"timeout"})})}onJoinError(e){if("reload"===e.reason)return this.log("error",()=>[`failed mount with ${e.status}. Falling back to page reload`,e]),void this.onRedirect({to:this.root.href,reloadToken:e.token});if("unauthorized"===e.reason||"stale"===e.reason)return this.log("error",()=>["unauthorized live_redirect. Falling back to page request",e]),void this.onRedirect({to:this.root.href,flash:this.flash});if((e.redirect||e.live_redirect)&&(this.joinPending=!1,this.channel.leave()),e.redirect)return this.onRedirect(e.redirect);if(e.live_redirect)return this.onLiveRedirect(e.live_redirect);if(this.log("error",()=>["unable to join",e]),this.isMain())this.displayError([ns,rs,os]),this.liveSocket.isConnected()&&this.liveSocket.reloadWithJitter(this);else{this.joinAttempts>=3&&(this.root.displayError([ns,rs,os]),this.log("error",()=>["giving up trying to mount after 3 tries",e]),this.destroy());let t=sa.byId(this.el.id);t?(sa.mergeAttrs(t,this.el),this.displayError([ns,rs,os]),this.el=t):this.destroy()}}onClose(e){if(!this.isDestroyed()){if(this.isMain()&&this.liveSocket.hasPendingLink()&&"leave"!==e)return this.liveSocket.reloadWithJitter(this);this.destroyAllChildren(),this.liveSocket.dropActiveElement(this),document.activeElement&&document.activeElement.blur(),this.liveSocket.isUnloaded()&&this.showLoader(200)}}onError(e){this.onClose(e),this.liveSocket.isConnected()&&this.log("error",()=>["view crashed",e]),this.liveSocket.isUnloaded()||(this.liveSocket.isConnected()?this.displayError([ns,rs,os]):this.displayError([ns,rs,is]))}displayError(e){this.isMain()&&sa.dispatchEvent(window,"phx:page-loading-start",{detail:{to:this.href,kind:"error"}}),this.showLoader(),this.setContainerClasses(...e),this.delayedDisconnected()}delayedDisconnected(){this.disconnectedTimer=setTimeout(()=>{this.execAll(this.binding("disconnected"))},this.liveSocket.disconnectedTimeout)}wrapPush(e,t){let n=this.liveSocket.getLatencySim(),r=n?e=>setTimeout(()=>!this.isDestroyed()&&e(),n):e=>!this.isDestroyed()&&e();r(()=>{e().receive("ok",e=>r(()=>t.ok&&t.ok(e))).receive("error",e=>r(()=>t.error&&t.error(e))).receive("timeout",()=>r(()=>t.timeout&&t.timeout()))})}pushWithReply(e,t,n){if(!this.isConnected())return Promise.reject({error:"noconnection"});let[r,[i],o]=e?e():[null,[],{}],s=this.joinCount,a=function(){};return o.page_loading&&(a=this.liveSocket.withPageLoading({kind:"element",target:i})),"number"!=typeof n.cid&&delete n.cid,new Promise((e,i)=>{this.wrapPush(()=>this.channel.push(t,n,3e4),{ok:t=>{null!==r&&(this.lastAckRef=r);let i=n=>{t.redirect&&this.onRedirect(t.redirect),t.live_patch&&this.onLivePatch(t.live_patch),t.live_redirect&&this.onLiveRedirect(t.live_redirect),a(),e({resp:t,reply:n})};t.diff?this.liveSocket.requestDOMUpdate(()=>{this.applyDiff("update",t.diff,({diff:e,reply:t,events:o})=>{null!==r&&this.undoRefs(r,n.event),this.update(e,o),i(t)})}):(null!==r&&this.undoRefs(r,n.event),i(null))},error:e=>i({error:e}),timeout:()=>{i({timeout:!0}),this.joinCount===s&&this.liveSocket.reloadWithJitter(this,()=>{this.log("timeout",()=>["received timeout while communicating with server. Falling back to hard refresh for recovery"])})}})})}undoRefs(e,t,n){if(!this.isConnected())return;let r=`[${zo}="${this.refSrc()}"]`;n?(n=new Set(n),sa.all(document,r,i=>{n&&!n.has(i)||(sa.all(i,r,n=>this.undoElRef(n,e,t)),this.undoElRef(i,e,t))})):sa.all(document,r,n=>this.undoElRef(n,e,t))}undoElRef(e,t,n){new Ea(e).maybeUndo(t,n,r=>{let i=new Ma(this,e,this.id,r,[],null,{undoRef:t});const o=this.performPatch(i,!0);sa.all(e,`[${zo}="${this.refSrc()}"]`,e=>this.undoElRef(e,t,n)),o&&this.joinNewChildren()})}refSrc(){return this.el.id}putRef(e,t,n,r={}){let i=this.ref++,o=this.binding(As);if(r.loading){let t=sa.all(document,r.loading).map(e=>({el:e,lock:!0,loading:!0}));e=e.concat(t)}for(let{el:s,lock:a,loading:l}of e){if(!a&&!l)throw new Error("putRef requires lock or loading");if(s.setAttribute(zo,this.refSrc()),l&&s.setAttribute(Vo,i),a&&s.setAttribute(Go,i),!l||r.submitter&&s!==r.submitter&&s!==r.form)continue;let c=new Promise(e=>{s.addEventListener(`phx:undo-lock:${i}`,()=>e(d),{once:!0})}),u=new Promise(e=>{s.addEventListener(`phx:undo-loading:${i}`,()=>e(d),{once:!0})});s.classList.add(`phx-${n}-loading`);let h=s.getAttribute(o);null!==h&&(s.getAttribute(Cs)||s.setAttribute(Cs,s.innerText),""!==h&&
2(s.innerText=h),s.setAttribute(vs,s.getAttribute(vs)||s.disabled),s.setAttribute("disabled",""));let d={event:t,eventType:n,ref:i,isLoading:l,isLocked:a,lockElements:e.filter(({lock:e})=>e).map(({el:e})=>e),loadingElements:e.filter(({loading:e})=>e).map(({el:e})=>e),unlock:e=>{e=Array.isArray(e)?e:[e],this.undoRefs(i,t,e)},lockComplete:c,loadingComplete:u,lock:e=>new Promise(t=>{if(this.isAcked(i))return t(d);e.setAttribute(Go,i),e.setAttribute(zo,this.refSrc()),e.addEventListener(`phx:lock-stop:${i}`,()=>t(d),{once:!0})})};s.dispatchEvent(new CustomEvent("phx:push",{detail:d,bubbles:!0,cancelable:!1})),t&&s.dispatchEvent(new CustomEvent(`phx:push:${t}`,{detail:d,bubbles:!0,cancelable:!1}))}return[i,e.map(({el:e})=>e),r]}isAcked(e){return null!==this.lastAckRef&&this.lastAckRef>=e}componentID(e){let t=e.getAttribute&&e.getAttribute(jo);return t?parseInt(t):null}targetComponentID(e,t,n={}){if(qs(t))return t;let r=n.target||e.getAttribute(this.binding("target"));return qs(r)?parseInt(r):t&&(null!==r||n.target)?this.closestComponentID(t):null}closestComponentID(e){return qs(e)?e:e?ta(e.closest(`[${jo}]`),e=>this.ownsElement(e)&&this.componentID(e)):null}pushHookEvent(e,t,n,r,i){if(!this.isConnected())return this.log("hook",()=>["unable to push hook event. LiveView not connected",n,r]),!1;let[o,s,a]=this.putRef([{el:e,loading:!0,lock:!0}],n,"hook");return this.pushWithReply(()=>[o,s,a],"event",{type:"hook",event:n,value:r,cid:this.closestComponentID(t)}).then(({resp:e,reply:t})=>i(t,o)),o}extractMeta(e,t,n){let r=this.binding("value-");for(let n=0;n<e.attributes.length;n++){t||(t={});let i=e.attributes[n].name;i.startsWith(r)&&(t[i.replace(r,"")]=e.getAttribute(i))}if(void 0===e.value||e instanceof HTMLFormElement||(t||(t={}),t.value=e.value,"INPUT"===e.tagName&&fs.indexOf(e.type)>=0&&!e.checked&&delete t.value),n){t||(t={});for(let e in n)t[e]=n[e]}return t}pushEvent(e,t,n,r,i,o={},s){this.pushWithReply(()=>this.putRef([{el:t,loading:!0,lock:!0}],r,e,o),"event",{type:e,event:r,value:this.extractMeta(t,i,o.value),cid:this.targetComponentID(t,n,o)}).then(({reply:e})=>s&&s(e)).catch(e=>$s("Failed to push event",e))}pushFileProgress(e,t,n,r=function(){}){this.liveSocket.withinOwners(e.form,(i,o)=>{i.pushWithReply(null,"progress",{event:e.getAttribute(i.binding("progress")),ref:e.getAttribute(Xo),entry_ref:t,progress:n,cid:i.targetComponentID(e.form,o)}).then(({resp:e})=>r(e)).catch(e=>$s("Failed to push file progress",e))})}pushInput(e,t,n,r,i,o){if(!e.form)throw new Error("form events require the input to be inside a form");let s,a,l=qs(n)?n:this.targetComponentID(e.form,t,i),c=()=>this.putRef([{el:e,loading:!0,lock:!0},{el:e.form,loading:!0,lock:!0}],r,"change",i),u=this.extractMeta(e.form,{},i.value),h={};e instanceof HTMLButtonElement&&(h.submitter=e),a=e.getAttribute(this.binding("change"))?Ga(e.form,h,[e.name]):Ga(e.form,h),sa.isUploadInput(e)&&e.files&&e.files.length>0&&ca.trackFiles(e,Array.from(e.files)),s=ca.serializeUploads(e);let d={type:"form",event:r,value:a,meta:{_target:i._target||"undefined",...u},uploads:s,cid:l};this.pushWithReply(c,"event",d).then(({resp:n})=>{sa.isUploadInput(e)&&sa.isAutoUpload(e)?Ea.onUnlock(e,()=>{if(ca.filesAwaitingPreflight(e).length>0){let[i,s]=c();this.undoRefs(i,r,[e.form]),this.uploadFiles(e.form,r,t,i,l,t=>{o&&o(n),this.triggerAwaitingSubmit(e.form,r),this.undoRefs(i,r)})}}):o&&o(n)}).catch(e=>$s("Failed to push input event",e))}triggerAwaitingSubmit(e,t){let n=this.getScheduledSubmit(e);if(n){let[r,i,o,s]=n;this.cancelSubmit(e,t),s()}}getScheduledSubmit(e){return this.formSubmits.find(([t,n,r,i])=>t.isSameNode(e))}scheduleSubmit(e,t,n,r){if(this.getScheduledSubmit(e))return!0;this.formSubmits.push([e,t,n,r])}cancelSubmit(e,t){this.formSubmits=this.formSubmits.filter(([n,r,i,o])=>!n.isSameNode(e)||(this.undoRefs(r,t),!1))}disableForm(e,t,n={}){let r=e=>!(Ks(e,`${this.binding(_s)}=ignore`,e.form)||Ks(e,"data-phx-update=ignore",e.form)),i=Array.from(e.elements),o=i.filter(e=>e.hasAttribute(this.binding(As))),s=i.filter(e=>"BUTTON"==e.tagName).filter(r),a=i.filter(e=>["INPUT","TEXTAREA","SELECT"].includes(e.tagName)).filter(r);
2s.forEach(e=>{e.setAttribute(vs,e.disabled),e.disabled=!0}),a.forEach(e=>{e.setAttribute(Es,e.readOnly),e.readOnly=!0,e.files&&(e.setAttribute(vs,e.disabled),e.disabled=!0)});let l=o.concat(s).concat(a).map(e=>({el:e,loading:!0,lock:!0})),c=[{el:e,loading:!0,lock:!1}].concat(l).reverse();return this.putRef(c,t,"submit",n)}pushFormSubmit(e,t,n,r,i,o){let s=()=>this.disableForm(e,n,{...i,form:e,submitter:r});sa.putPrivate(e,"submitter",r);let a=this.targetComponentID(e,t);if(ca.hasUploadsInProgress(e)){let[a,l]=s(),c=()=>this.pushFormSubmit(e,t,n,r,i,o);return this.scheduleSubmit(e,a,i,c)}if(ca.inputsAwaitingPreflight(e).length>0){let[l,c]=s(),u=()=>[l,c,i];this.uploadFiles(e,n,t,l,a,t=>{if(ca.inputsAwaitingPreflight(e).length>0)return this.undoRefs(l,n);let s=this.extractMeta(e,{},i.value),c=Ga(e,{submitter:r});this.pushWithReply(u,"event",{type:"form",event:n,value:c,meta:s,cid:a}).then(({resp:e})=>o(e)).catch(e=>$s("Failed to push form submit",e))})}else if(!e.hasAttribute(zo)||!e.classList.contains("phx-submit-loading")){let t=this.extractMeta(e,{},i.value),l=Ga(e,{submitter:r});this.pushWithReply(s,"event",{type:"form",event:n,value:l,meta:t,cid:a}).then(({resp:e})=>o(e)).catch(e=>$s("Failed to push form submit",e))}}uploadFiles(e,t,n,r,i,o){let s=this.joinCount,a=ca.activeFileInputs(e),l=a.length;a.forEach(e=>{let i=new ca(e,this,()=>{l--,0===l&&o()}),a=i.entries().map(e=>e.toPreflightPayload());if(0===a.length)return void l--;let c={ref:e.getAttribute(Xo),entries:a,cid:this.targetComponentID(e.form,n)};this.log("upload",()=>["sending preflight request",c]),this.pushWithReply(null,"allow_upload",c).then(({resp:e})=>{if(this.log("upload",()=>["got preflight response",e]),i.entries().forEach(t=>{e.entries&&!e.entries[t.ref]&&this.handleFailedEntryPreflight(t.ref,"failed preflight",i)}),e.error||0===Object.keys(e.entries).length){this.undoRefs(r,t),(e.error||[]).map(([e,t])=>{this.handleFailedEntryPreflight(e,t,i)})}else{let t=e=>{this.channel.onError(()=>{this.joinCount===s&&e()})};i.initAdapterUpload(e,t,this.liveSocket)}}).catch(e=>$s("Failed to push upload",e))})}handleFailedEntryPreflight(e,t,n){if(n.isAutoUpload()){let t=n.entries().find(t=>t.ref===e.toString());t&&t.cancel()}else n.entries().map(e=>e.cancel());this.log("upload",()=>[`error for entry ${e}`,t])}dispatchUploads(e,t,n){let r=this.targetCtxElement(e)||this.el,i=sa.findUploadInputs(r).filter(e=>e.name===t);0===i.length?$s(`no live file inputs found matching the name "${t}"`):i.length>1?$s(`duplicate live file inputs found matching the name "${t}"`):sa.dispatchEvent(i[0],Yo,{detail:{files:n}})}targetCtxElement(e){if(qs(e)){let[t]=sa.findComponentNodeList(this.el,e);return t}return e||null}pushFormRecovery(e,t,n,r){const i=this.binding("change"),o=t.getAttribute(this.binding("target"))||t,s=t.getAttribute(this.binding(Ds))||t.getAttribute(this.binding("change")),a=Array.from(e.elements).filter(e=>sa.isFormInput(e)&&e.name&&!e.hasAttribute(i));if(0===a.length)return void r();a.forEach(e=>e.hasAttribute(Xo)&&ca.clearFiles(e));let l=a.find(e=>"hidden"!==e.type)||a[0],c=0;this.withinTargets(o,(n,i)=>{const o=this.targetComponentID(t,i);c++;let a=new CustomEvent("phx:form-recovery",{detail:{sourceElement:e}});Ua.exec(a,"change",s,this,l,["push",{_target:l.name,targetView:n,targetCtx:i,newCid:o,callback:()=>{c--,0===c&&r()}}])},n,n)}pushLinkPatch(e,t,n,r){let i=this.liveSocket.setPendingLink(t),o=e.isTrusted&&"popstate"!==e.type,s=n?()=>this.putRef([{el:n,loading:o,lock:!0}],null,"click"):null,a=()=>this.liveSocket.redirect(window.location.href),l=t.startsWith("/")?`${location.protocol}//${location.host}${t}`:t;this.pushWithReply(s,"live_patch",{url:l}).then(({resp:e})=>{this.liveSocket.requestDOMUpdate(()=>{e.link_redirect?this.liveSocket.replaceMain(t,null,r,i):(this.liveSocket.commitPendingLink(i)&&(this.href=t),this.applyPendingUpdates(),r&&r(i))})},({error:e,timeout:t})=>a())}getFormsForRecovery(){if(0===this.joinCount)return{};let e=this.binding("change");return sa.all(this.el,`form[${e}]`).filter(e=>e.id).filter(e=>e.elements.length>0).filter(e=>"ignore"!==e.getAttribute(this.binding(Ds))).map(e=>{const t=e.cloneNode(!1);
2return sa.copyPrivates(t,e),Array.from(e.elements).forEach(e=>{const n=e.cloneNode(!0);Ra(n,e),sa.copyPrivates(n,e),t.appendChild(n)}),t}).reduce((e,t)=>(e[t.id]=t,e),{})}maybePushComponentsDestroyed(e){let t=e.filter(e=>0===sa.findComponentNodeList(this.el,e).length);t.length>0&&(t.forEach(e=>this.rendered.resetRender(e)),this.pushWithReply(null,"cids_will_destroy",{cids:t}).then(()=>{this.liveSocket.requestDOMUpdate(()=>{let e=t.filter(e=>0===sa.findComponentNodeList(this.el,e).length);e.length>0&&this.pushWithReply(null,"cids_destroyed",{cids:e}).then(({resp:e})=>{this.rendered.pruneCIDs(e.cids)}).catch(e=>$s("Failed to push components destroyed",e))})}).catch(e=>$s("Failed to push components destroyed",e)))}ownsElement(e){let t=e.closest(ms);return e.getAttribute(ss)===this.id||t&&t.id===this.id||!t&&this.isDead}submitForm(e,t,n,r,i={}){sa.putPrivate(e,ps,!0);Array.from(e.elements).forEach(e=>sa.putPrivate(e,ps,!0)),this.liveSocket.blurActiveElement(this),this.pushFormSubmit(e,t,n,r,i,()=>{this.liveSocket.restorePreviouslyActiveFocus()})}binding(e){return this.liveSocket.binding(e)}},Ya=class{constructor(){this.transitions=new Set,this.pendingOps=[]}reset(){this.transitions.forEach(e=>{clearTimeout(e),this.transitions.delete(e)}),this.flushPendingOps()}after(e){0===this.size()?e():this.pushPendingOp(e)}addTransition(e,t,n){t();let r=setTimeout(()=>{this.transitions.delete(r),n(),this.flushPendingOps()},e);this.transitions.add(r)}pushPendingOp(e){this.pendingOps.push(e)}size(){return this.transitions.size}flushPendingOps(){if(this.size()>0)return;let e=this.pendingOps.shift();e&&(e(),this.flushPendingOps())}};r(473);function Xa(e){return Xa="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Xa(e)}function $a(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",i=n.toStringTag||"@@toStringTag";function o(n,r,i,o){var l=r&&r.prototype instanceof a?r:a,c=Object.create(l.prototype);return qa(c,"_invoke",function(n,r,i){var o,a,l,c=0,u=i||[],h=!1,d={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(t,n){return o=t,a=0,l=e,d.n=n,s}};function f(n,r){for(a=n,l=r,t=0;!h&&c&&!i&&t<u.length;t++){var i,o=u[t],f=d.p,p=o[2];n>3?(i=p===r)&&(l=o[(a=o[4])?5:(a=3,3)],o[4]=o[5]=e):o[0]<=f&&((i=n<2&&f<o[1])?(a=0,d.v=r,d.n=o[1]):f<p&&(i=n<3||o[0]>r||r>p)&&(o[4]=n,o[5]=r,d.n=p,a=0))}if(i||n>1)return s;throw h=!0,r}return function(i,u,p){if(c>1)throw TypeError("Generator is already running");for(h&&1===u&&f(u,p),a=u,l=p;(t=a<2?e:l)||!h;){o||(a?a<3?(a>1&&(d.n=-1),f(a,l)):d.n=l:d.v=l);try{if(c=2,o){if(a||(i="next"),t=o[i]){if(!(t=t.call(o,l)))throw TypeError("iterator result is not an object");if(!t.done)return t;l=t.value,a<2&&(a=0)}else 1===a&&(t=o.return)&&t.call(o),a<2&&(l=TypeError("The iterator does not provide a '"+i+"' method"),a=1);o=e}else if((t=(h=d.n<0)?l:n.call(r,d))!==s)break}catch(t){o=e,a=1,l=t}finally{c=1}}return{value:t,done:h}}}(n,i,o),!0),c}var s={};function a(){}function l(){}function c(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(qa(t={},r,function(){return this}),t),h=c.prototype=a.prototype=Object.create(u);function d(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,qa(e,i,"GeneratorFunction")),e.prototype=Object.create(h),e}return l.prototype=c,qa(h,"constructor",c),qa(c,"constructor",l),l.displayName="GeneratorFunction",qa(c,i,"GeneratorFunction"),qa(h),qa(h,i,"Generator"),qa(h,r,function(){return this}),qa(h,"toString",function(){return"[object Generator]"}),($a=function(){return{w:o,m:d}})()}function qa(e,t,n,r){var i=Object.defineProperty;try{i({},"",{})}catch(e){i=0}qa=function(e,t,n,r){function o(t,n){qa(e,t,function(e){return this._invoke(t,n,e)})}t?i?i(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(o("next",0),o("throw",1),o("return",2))},qa(e,t,n,r)}function Za(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Qa(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};
2t%2?Za(Object(n),!0).forEach(function(t){Ka(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Za(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Ka(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=Xa(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=Xa(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Xa(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ja(e,t,n,r,i,o,s){try{var a=e[o](s),l=a.value}catch(e){return void n(e)}a.done?t(l):Promise.resolve(l).then(r,i)}function el(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function s(e){Ja(o,r,i,s,a,"next",e)}function a(e){Ja(o,r,i,s,a,"throw",e)}s(void 0)})}}function tl(e){return nl.apply(this,arguments)}function nl(){return(nl=el($a().m(function e(t){var n,i;return $a().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,Promise.all([r.e(510),r.e(979)]).then(r.bind(r,450));case 1:return n=e.v,i=n.default,e.a(2,i)}},e)}))).apply(this,arguments)}const rl=function(e){return Qa(Qa({},e),{},{swiper:null,swiperDomElement:null,init:function(){var e=this;return el($a().m(function t(){return $a().w(function(t){for(;;)switch(t.n){case 0:if(window.Swiper){t.n=2;break}return t.n=1,tl();case 1:window.Swiper=t.v,e.setupSwiper();case 2:return t.a(2)}},t)}))()},setupSwiper:function(){var e=this;this.$el.classList.contains("swiper")?this.swiperDomElement=this.$el:(this.swiperDomElement=this.$el.querySelector(".swiper"),this.swiperDomElement||alert("cannot find swiper-element")),this.swiper=new window.Swiper(this.swiperDomElement,null==this?void 0:this.options),this.swiper.on("slideChange",function(){e.$dispatch("slide-change")}),null!=this&&this.afterInit&&this.afterInit()}})};function il(e){return il="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},il(e)}function ol(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function sl(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=il(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=il(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==il(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function al(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",i=n.toStringTag||"@@toStringTag";function o(n,r,i,o){var l=r&&r.prototype instanceof a?r:a,c=Object.create(l.prototype);return ll(c,"_invoke",function(n,r,i){var o,a,l,c=0,u=i||[],h=!1,d={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(t,n){return o=t,a=0,l=e,d.n=n,s}};function f(n,r){for(a=n,l=r,t=0;!h&&c&&!i&&t<u.length;t++){var i,o=u[t],f=d.p,p=o[2];n>3?(i=p===r)&&(l=o[(a=o[4])?5:(a=3,3)],o[4]=o[5]=e):o[0]<=f&&((i=n<2&&f<o[1])?(a=0,d.v=r,d.n=o[1]):f<p&&(i=n<3||o[0]>r||r>p)&&(o[4]=n,o[5]=r,d.n=p,a=0))}if(i||n>1)return s;throw h=!0,r}return function(i,u,p){if(c>1)throw TypeError("Generator is already running");for(h&&1===u&&f(u,p),a=u,l=p;(t=a<2?e:l)||!h;){o||(a?a<3?(a>1&&(d.n=-1),f(a,l)):d.n=l:d.v=l);try{if(c=2,o){if(a||(i="next"),t=o[i]){if(!(t=t.call(o,l)))throw TypeError("iterator result is not an object");if(!t.done)return t;l=t.value,a<2&&(a=0)}else 1===a&&(t=o.return)&&t.call(o),a<2&&(l=TypeError("The iterator does not provide a '"+i+"' method"),a=1);o=e}else if((t=(h=d.n<0)?l:n.call(r,d))!==s)break}catch(t){o=e,a=1,l=t}finally{c=1}}return{value:t,done:h}}}(n,i,o),!0),c}var s={};function a(){}function l(){}function c(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(ll(t={},r,function(){return this}),t),h=c.prototype=a.prototype=Object.create(u);function d(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,ll(e,i,"GeneratorFunction")),e.prototype=Object.create(h),e}return l.prototype=c,ll(h,"constructor",c),ll(c,"constructor",l),l.displayName="GeneratorFunction",ll(c,i,"GeneratorFunction"),ll(h),ll(h,i,"Generator"),ll(h,r,function(){return this}),ll(h,"toString",function(){return"[object Generator]"}),(al=function(){return{w:o,m:d}})()}function ll(e,t,n,r){var i=Object.defineProperty;try{i({},"",{})}catch(e){i=0}ll=function(e,t,n,r){function o(t,n){ll(e,t,function(e){return this._invoke(t,n,e)})}t?i?i(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(o("next",0),o("throw",1),o("return",2))},ll(e,t,n,r)}function cl(e,t,n,r,i,o,s){try{var a=e[o](s),l=a.value}catch(e){return void n(e)}a.done?t(l):Promise.resolve(l).then(r,i)}function ul(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function s(e){cl(o,r,i,s,a,"next",e)}function a(e){cl(o,r,i,s,a,"throw",e)}s(void 0)})}}function hl(e){return dl.apply(this,arguments)}function dl(){return(dl=ul(al().m(function e(t){var n,i;return al().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,Promise.all([r.e(823),r.e(853)]).then(r.bind(r,708));case 1:return n=e.v,i=n.default,e.a(2,i)}},e)}))).apply(this,arguments)}(Object.getOwnPropertyDescriptor(rl,"name")||{}).writable||Object.defineProperty(rl,"name",{value:"default",configurable:!0});const fl=function(e){return{options:e,glightboxInstance:null,init:function(){var e=this;return ul(al().m(function t(){return al().w(function(t){for(;;)switch(t.n){case 0:if(window.Glightbox){t.n=2;break}return t.n=1,hl();case 1:window.Glightbox=t.v,e.setupGlightbox();case 2:return t.a(2)}},t)}))()},setupGlightbox:function(){this.glightboxInstance=window.Glightbox(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};
2t%2?ol(Object(n),!0).forEach(function(t){sl(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ol(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}({},this.options))},openLightbox:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;this.glightboxInstance.openAt(e)}}};function pl(e){return pl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},pl(e)}function gl(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",i=n.toStringTag||"@@toStringTag";function o(n,r,i,o){var l=r&&r.prototype instanceof a?r:a,c=Object.create(l.prototype);return ml(c,"_invoke",function(n,r,i){var o,a,l,c=0,u=i||[],h=!1,d={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(t,n){return o=t,a=0,l=e,d.n=n,s}};function f(n,r){for(a=n,l=r,t=0;!h&&c&&!i&&t<u.length;t++){var i,o=u[t],f=d.p,p=o[2];n>3?(i=p===r)&&(l=o[(a=o[4])?5:(a=3,3)],o[4]=o[5]=e):o[0]<=f&&((i=n<2&&f<o[1])?(a=0,d.v=r,d.n=o[1]):f<p&&(i=n<3||o[0]>r||r>p)&&(o[4]=n,o[5]=r,d.n=p,a=0))}if(i||n>1)return s;throw h=!0,r}return function(i,u,p){if(c>1)throw TypeError("Generator is already running");for(h&&1===u&&f(u,p),a=u,l=p;(t=a<2?e:l)||!h;){o||(a?a<3?(a>1&&(d.n=-1),f(a,l)):d.n=l:d.v=l);try{if(c=2,o){if(a||(i="next"),t=o[i]){if(!(t=t.call(o,l)))throw TypeError("iterator result is not an object");if(!t.done)return t;l=t.value,a<2&&(a=0)}else 1===a&&(t=o.return)&&t.call(o),a<2&&(l=TypeError("The iterator does not provide a '"+i+"' method"),a=1);o=e}else if((t=(h=d.n<0)?l:n.call(r,d))!==s)break}catch(t){o=e,a=1,l=t}finally{c=1}}return{value:t,done:h}}}(n,i,o),!0),c}var s={};function a(){}function l(){}function c(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(ml(t={},r,function(){return this}),t),h=c.prototype=a.prototype=Object.create(u);function d(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,ml(e,i,"GeneratorFunction")),e.prototype=Object.create(h),e}return l.prototype=c,ml(h,"constructor",c),ml(c,"constructor",l),l.displayName="GeneratorFunction",ml(c,i,"GeneratorFunction"),ml(h),ml(h,i,"Generator"),ml(h,r,function(){return this}),ml(h,"toString",function(){return"[object Generator]"}),(gl=function(){return{w:o,m:d}})()}function ml(e,t,n,r){var i=Object.defineProperty;try{i({},"",{})}catch(e){i=0}ml=function(e,t,n,r){function o(t,n){ml(e,t,function(e){return this._invoke(t,n,e)})}t?i?i(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(o("next",0),o("throw",1),o("return",2))},ml(e,t,n,r)}function wl(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function yl(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?wl(Object(n),!0).forEach(function(t){El(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):wl(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function El(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=pl(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=pl(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==pl(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function vl(e,t,n,r,i,o,s){try{var a=e[o](s),l=a.value}catch(e){return void n(e)}a.done?t(l):Promise.resolve(l).then(r,i)}function Al(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function s(e){vl(o,r,i,s,a,"next",e)}function a(e){vl(o,r,i,s,a,"throw",e)}s(void 0)})}}function Cl(e){return bl.apply(this,arguments)}function bl(){return(bl=Al(gl().m(function e(t){var n,i;return gl().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,Promise.all([r.e(339),r.e(225)]).then(r.bind(r,544));case 1:return n=e.v,i=n.default,e.a(2,i)}},e)}))).apply(this,arguments)}(Object.getOwnPropertyDescriptor(fl,"name")||{}).writable||Object.defineProperty(fl,"name",{value:"default",configurable:!0});const _l=function(e){return yl(yl({},e),{},{videojs:null,videojsDomElement:null,init:function(){var e=this;return Al(gl().m(function t(){return gl().w(function(t){for(;;)switch(t.n){case 0:if(window.Videojs){t.n=2;break}return t.n=1,Cl();
2case 1:window.Videojs=t.v,e.setupVideojs();case 2:return t.a(2)}},t)}))()},setupVideojs:function(){var e=this;this.$el.classList.contains("videojs")?this.videojsDomElement=this.$el:(this.videojsDomElement=this.$el.querySelector(".videojs"),this.videojsDomElement||alert("cannot find videojs-element")),this.videojs=new window.Videojs(this.videojsDomElement,null==this?void 0:this.options),this.videojs.on("slideChange",function(){e.$dispatch("slide-change")}),null!=this&&this.afterInit&&this.afterInit()}})};function Sl(e){return Sl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Sl(e)}function Il(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",i=n.toStringTag||"@@toStringTag";function o(n,r,i,o){var l=r&&r.prototype instanceof a?r:a,c=Object.create(l.prototype);return Tl(c,"_invoke",function(n,r,i){var o,a,l,c=0,u=i||[],h=!1,d={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(t,n){return o=t,a=0,l=e,d.n=n,s}};function f(n,r){for(a=n,l=r,t=0;!h&&c&&!i&&t<u.length;t++){var i,o=u[t],f=d.p,p=o[2];n>3?(i=p===r)&&(l=o[(a=o[4])?5:(a=3,3)],o[4]=o[5]=e):o[0]<=f&&((i=n<2&&f<o[1])?(a=0,d.v=r,d.n=o[1]):f<p&&(i=n<3||o[0]>r||r>p)&&(o[4]=n,o[5]=r,d.n=p,a=0))}if(i||n>1)return s;throw h=!0,r}return function(i,u,p){if(c>1)throw TypeError("Generator is already running");for(h&&1===u&&f(u,p),a=u,l=p;(t=a<2?e:l)||!h;){o||(a?a<3?(a>1&&(d.n=-1),f(a,l)):d.n=l:d.v=l);try{if(c=2,o){if(a||(i="next"),t=o[i]){if(!(t=t.call(o,l)))throw TypeError("iterator result is not an object");if(!t.done)return t;l=t.value,a<2&&(a=0)}else 1===a&&(t=o.return)&&t.call(o),a<2&&(l=TypeError("The iterator does not provide a '"+i+"' method"),a=1);o=e}else if((t=(h=d.n<0)?l:n.call(r,d))!==s)break}catch(t){o=e,a=1,l=t}finally{c=1}}return{value:t,done:h}}}(n,i,o),!0),c}var s={};function a(){}function l(){}function c(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(Tl(t={},r,function(){return this}),t),h=c.prototype=a.prototype=Object.create(u);function d(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,Tl(e,i,"GeneratorFunction")),e.prototype=Object.create(h),e}return l.prototype=c,Tl(h,"constructor",c),Tl(c,"constructor",l),l.displayName="GeneratorFunction",Tl(c,i,"GeneratorFunction"),Tl(h),Tl(h,i,"Generator"),Tl(h,r,function(){return this}),Tl(h,"toString",function(){return"[object Generator]"}),(Il=function(){return{w:o,m:d}})()}function Tl(e,t,n,r){var i=Object.defineProperty;try{i({},"",{})}catch(e){i=0}Tl=function(e,t,n,r){function o(t,n){Tl(e,t,function(e){return this._invoke(t,n,e)})}t?i?i(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(o("next",0),o("throw",1),o("return",2))},Tl(e,t,n,r)}function Dl(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Nl(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Dl(Object(n),!0).forEach(function(t){Ol(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Dl(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Ol(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=Sl(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=Sl(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Sl(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Rl(e){return function(e){if(Array.isArray(e))return kl(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||Pl(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ml(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,s,a=[],l=!0,c=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(a.push(r.value),a.length!==t);l=!0);}catch(e){c=!0,i=e}
2finally{try{if(!l&&null!=n.return&&(s=n.return(),Object(s)!==s))return}finally{if(c)throw i}}return a}}(e,t)||Pl(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Pl(e,t){if(e){if("string"==typeof e)return kl(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?kl(e,t):void 0}}function kl(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function xl(e,t,n,r,i,o,s){try{var a=e[o](s),l=a.value}catch(e){return void n(e)}a.done?t(l):Promise.resolve(l).then(r,i)}function Ll(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function s(e){xl(o,r,i,s,a,"next",e)}function a(e){xl(o,r,i,s,a,"throw",e)}s(void 0)})}}function Bl(){return Fl.apply(this,arguments)}function Fl(){return(Fl=Ll(Il().m(function e(){var t,n;return Il().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,Promise.all([r.e(440),r.e(803)]).then(r.bind(r,306));case 1:return t=e.v,n=t.default,e.a(2,n)}},e)}))).apply(this,arguments)}function Ul(e){return Object.entries(e||{}).filter(function(e){return!0===Ml(e,2)[1]}).map(function(e){return Ml(e,1)[0]})}function jl(e){return String(e||"").toLocaleLowerCase()}function Hl(e){return String(e||"").split(",").map(function(e){return e.trim()}).filter(function(e){return""!==e})}function Vl(e,t){var n,r;return((null==t||null===(n=t.markerData)||void 0===n?void 0:n.year)||0)-((null==e||null===(r=e.markerData)||void 0===r?void 0:r.year)||0)}function zl(e){if(!Array.isArray(e)||2!==e.length)return null;var t=Ml(e,2),n=t[0],r=t[1];return"number"!=typeof n||"number"!=typeof r?null:"".concat(n.toFixed(6),",").concat(r.toFixed(6))}function Gl(e,t){var n=document.createElement("canvas");n.width=e,n.height=t;var r=n.getContext("2d");r.scale(e/100,t/140);var i=Math.acos(40/96),o=Math.PI/2-i,s=Math.PI/2+i;return r.fillStyle="#111",r.beginPath(),r.arc(50,42,40,o,s,!0),r.lineTo(50,138),r.closePath(),r.fill(),{data:r.getImageData(0,0,e,t).data,width:e,height:t}}(Object.getOwnPropertyDescriptor(_l,"name")||{}).writable||Object.defineProperty(_l,"name",{value:"default",configurable:!0});const Wl=function(e){return{options:e,map:null,allItems:[],visibleItems:[],filteredItemsCount:0,placeQuery:"",placeResults:[],placeStatus:"idle",placeError:null,filterOptions:{regions:[],countries:[],topics:[],daterangePresets:[]},filterState:{keyword:"",daterange:null,regions:{},countries:{},topics:{}},activeId:null,selectedItem:null,locationGroupsByKey:{},markerPopup:null,popupLocationKey:null,popupClusterId:null,currentPage:0,pageSize:50,init:function(){var e=this;return Ll(Il().m(function t(){return Il().w(function(t){for(;;)switch(t.n){case 0:if(window.Maplibre){t.n=2;break}return t.n=1,Bl();case 1:window.Maplibre=t.v;case 2:return t.n=3,e.loadData();case 3:e.initializeFilters(),e.hydrateFiltersFromUrl(),e.persistFilterStateToUrl(),e.activeId=e.getUrlParam("v"),e.initMap();case 4:return t.a(2)}},t)}))()},searchPlaces:function(){var e=this;return Ll(Il().m(function t(){var n,r,i,o,s,a;return Il().w(function(t){for(;;)switch(t.p=t.n){case 0:if(r=null===(n=e.options)||void 0===n?void 0:n.placesApiUrl){t.n=1;break}return t.a(2);case 1:if(i=String(e.placeQuery||"").trim(),e.placeError=null,!(i.length<3)){t.n=2;break}return e.placeResults=[],e.placeError="Bitte mindestens 3 Zeichen eingeben.",t.a(2);case 2:return e.placeStatus="loading",t.p=3,(o=new URL(r,window.location.origin)).searchParams.set("q",i),o.searchParams.set("limit","5"),t.n=4,fetch(o.toString(),{credentials:"same-origin"});case 4:if((s=t.v).ok){t.n=5;break}return e.placeResults=[],e.placeError="Ortssuche momentan nicht verfuegbar.",t.a(2);case 5:return t.n=6,s.json();case 6:a=t.v,e.placeResults=Array.isArray(null==a?void 0:a.places)?a.places:[],0===e.placeResults.length&&(e.placeError="Keine Treffer."),t.n=8;break;case 7:t.p=7,t.v,e.placeResults=[],e.placeError="Ortssuche momentan nicht verfuegbar.";case 8:return t.p=8,e.placeStatus="idle",t.f(8);case 9:return t.a(2)}},t,null,[[3,7,8,9]])}))()},selectPlace:function(e){var t=null==e?void 0:e.coordinates;if(this.map&&Array.isArray(t)&&2===t.length){var n=Ml(t,2),r=n[0],i=n[1];"number"==typeof r&&"number"==typeof i&&this.map.easeTo({center:[r,i],zoom:Math.max(this.map.getZoom(),10)})}}
2,loadData:function(){var e=this;return Ll(Il().m(function t(){var n,r,i;return Il().w(function(t){for(;;)switch(t.n){case 0:return n=new URL(e.options.apiUrl,window.location.origin),(r=String(e.getUrlParam("q")||"").trim())&&n.searchParams.set("q",r),t.n=1,fetch(n.toString(),{credentials:"same-origin"});case 1:if((i=t.v).ok){t.n=2;break}throw new Error("failed loading geofilms data");case 2:return t.n=3,i.json();case 3:e.allItems=t.v;case 4:return t.a(2)}},t)}))()},initializeFilters:function(){var e,t=(null===(e=this.options)||void 0===e?void 0:e.filterOptions)||{};this.filterOptions={regions:t.regions||[],countries:t.countries||[],topics:t.topics||[],daterangePresets:t.daterangePresets||[]},this.filterState={keyword:"",daterange:null,regions:Object.fromEntries(this.filterOptions.regions.map(function(e){return[e.slug,!1]})),countries:Object.fromEntries(this.filterOptions.countries.map(function(e){return[e.slug,!1]})),topics:Object.fromEntries(this.filterOptions.topics.map(function(e){return[e.slug,!1]}))}},getFilteredItems:function(){var e=jl(this.filterState.keyword).trim(),t=Ul(this.filterState.regions),n=Ul(this.filterState.countries),r=Ul(this.filterState.topics),i=null,o=null;if(this.filterState.daterange){var s=Ml(String(this.filterState.daterange).split("-").map(function(e){return Number(e)}),2),a=s[0],l=s[1];Number.isInteger(a)&&Number.isInteger(l)&&(i=a,o=l)}return this.allItems.filter(function(s){var a,l,c,u,h,d,f,p=null==s||null===(a=s.markerData)||void 0===a?void 0:a.year,g=jl((null==s||null===(l=s.videoData)||void 0===l?void 0:l.headline)||(null==s||null===(c=s.markerData)||void 0===c?void 0:c.text)),m=jl(null==s||null===(u=s.videoData)||void 0===u?void 0:u.sub_headline),w=jl(null==s?void 0:s.webid),y=jl(null==s?void 0:s.id),E=(null==s||null===(h=s.filterData)||void 0===h?void 0:h.regions)||[],v=(null==s||null===(d=s.filterData)||void 0===d?void 0:d.countries)||[],A=(null==s||null===(f=s.filterData)||void 0===f?void 0:f.topics)||[];return!!(!e||g.includes(e)||m.includes(e)||w.includes(e)||y.includes(e))&&((null===i||null===o||!(!Number.isInteger(p)||p<i||p>o))&&(!(t.length>0&&!t.some(function(e){return E.includes(e)}))&&(!(n.length>0&&!n.some(function(e){return v.includes(e)}))&&!(r.length>0&&!r.some(function(e){return A.includes(e)})))))})},getUrlParam:function(e){return new URLSearchParams(window.location.search).get(e)},setUrlParam:function(e,t){this.setUrlParams(Ol({},e,t))},setUrlParams:function(e){var t=new URL(window.location.href);Object.entries(e||{}).forEach(function(e){var n=Ml(e,2),r=n[0],i=n[1];null==i||""===i?t.searchParams.delete(r):t.searchParams.set(r,i)}),window.history.replaceState({},"",t)},isValidDateRange:function(e){if("string"!=typeof e)return!1;var t=e.match(/^(\d{3,4})-(\d{3,4})$/);if(!t)return!1;var n=Number(t[1]),r=Number(t[2]);return Number.isInteger(n)&&Number.isInteger(r)&&n<=r},parseSelectedFromUrl:function(e,t){var n=Hl(this.getUrlParam(t)),r=new Set((this.filterOptions[e]||[]).map(function(e){return e.slug}));this.filterState[e]=Object.fromEntries((this.filterOptions[e]||[]).map(function(e){return[e.slug,n.includes(e.slug)&&r.has(e.slug)]}))},selectedForUrl:function(e){var t=Ul(this.filterState[e]);return t.length>0?t.join(","):null},hydrateFiltersFromUrl:function(){var e=this.getUrlParam("q"),t=this.getUrlParam("d");e&&(this.filterState.keyword=e),this.isValidDateRange(t)&&(this.filterState.daterange=t),this.parseSelectedFromUrl("regions","rg"),this.parseSelectedFromUrl("countries","ct"),this.parseSelectedFromUrl("topics","tp")},persistFilterStateToUrl:function(){var e;this.setUrlParams({q:(null===(e=this.filterState.keyword)||void 0===e?void 0:e.trim())||null,d:this.filterState.daterange||null,rg:this.selectedForUrl("regions"),ct:this.selectedForUrl("countries"),tp:this.selectedForUrl("topics")})},getInitialView:function(){var e=this.getUrlParam("l");if(!e)return{center:this.options.center,zoom:this.options.zoom};var t=e.split(",").map(function(e){return Number(e)});return 3!==t.length||t.some(function(e){return Number.isNaN(e)})?{center:this.options.center,zoom:this.options.zoom}:{center:[t[1],t[0]],zoom:t[2]}},initMap:function(){var e=this,t=this.getInitialView();this.map=new window.Maplibre.Map({container:this.$refs.map,style:this.options.styleUrl,center:t.center,zoom:t.zoom}),this.map.addControl(new window.Maplibre.NavigationControl({showCompass:!1}),"top-left"),this.map.on("load",Ll(Il().m(function t(){return Il().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,e.buildSourceAndLayers();case 1:e.syncVisibleItems(),e.applyActiveMarkerFromUrl(),e.restorePopupFromUrl();case 2:return t.a(2)}},t)}))),this.map.on("moveend",function(){var t=e.map.getCenter(),n=e.map.getZoom();e.setUrlParam("l","".concat(t.lat.toFixed(5),",").concat(t.lng.toFixed(5),",").concat(n.toFixed(2))),e.syncVisibleItems()}),this.map.on("click","clusters",function(t){e.handleClusterClick(t)}),this.map.on("click","unclustered-point",function(t){e.handleUnclusteredPointClick(t)}),this.syncVisibleItems()},buildSourceAndLayers:function(){var e=this;return Ll(Il().m(function t(){var n,r;return Il().w(function(t){for(;;)switch(t.n){case 0:n=e.toGeoJson(),e.map.hasImage("pin-marker")||(r=Gl(128,180),e.map.addImage("pin-marker",r)),e.map.getSource("geofilms")||e.map.addSource("geofilms",{type:"geojson",data:n,cluster:!0,clusterMa
2xZoom:12,clusterRadius:50}),e.map.getLayer("clusters")||e.map.addLayer({id:"clusters",type:"symbol",source:"geofilms",filter:["has","point_count"],layout:{"icon-image":"pin-marker","icon-size":.25,"icon-allow-overlap":!0,"icon-anchor":"bottom","text-field":["get","point_count_abbreviated"],"text-size":12,"text-offset":[0,-2.6],"text-allow-overlap":!0},paint:{"text-color":"#ffed36"}}),e.map.getLayer("unclustered-point")||e.map.addLayer({id:"unclustered-point",type:"symbol",source:"geofilms",filter:["!",["has","point_count"]],layout:{"icon-image":"pin-marker","icon-size":.25,"icon-allow-overlap":!0,"icon-anchor":"bottom","text-field":["to-string",["coalesce",["get","videosCount"],1]],"text-size":11,"text-offset":[0,-2.8],"text-allow-overlap":!0},paint:{"text-color":"#ffed36"}}),e.map.getSource("geofilms-highlight")||e.map.addSource("geofilms-highlight",{type:"geojson",data:{type:"FeatureCollection",features:[]}}),e.map.getLayer("highlight-point")||e.map.addLayer({id:"highlight-point",type:"symbol",source:"geofilms-highlight",layout:{"icon-image":"pin-marker","icon-size":.14,"icon-allow-overlap":!0,"icon-anchor":"bottom"}});case 1:return t.a(2)}},t)}))()},getSidebarPadding:function(){var e,t,n=null===(e=this.$el)||void 0===e?void 0:e.querySelector(".geofilms-sidebar");if(!n)return{top:0,bottom:0,left:0,right:0};var r=(null===(t=this.map)||void 0===t||null===(t=t.getContainer())||void 0===t?void 0:t.offsetHeight)||window.innerHeight;if(window.innerWidth>=1024)return{top:Math.round(.55*r),bottom:0,left:0,right:n.offsetWidth+32};var i=n.offsetHeight||0,o=r-i;return{top:Math.round(.45*o),bottom:i+16,left:0,right:0}},updateMarkerVisibility:function(){if(this.map){var e=["!",["has","point_count"]],t=this.popupLocationKey?["all",e,["!=",["get","locationKey"],this.popupLocationKey]]:e;if(this.map.getLayer("unclustered-point")&&this.map.setFilter("unclustered-point",t),this.map.getLayer("clusters")){var n=null!=this.popupClusterId?["all",["has","point_count"],["!=",["get","cluster_id"],this.popupClusterId]]:["has","point_count"];
2this.map.setFilter("clusters",n)}}},toGeoJson:function(){var e=function(e){var t=new Map;return e.forEach(function(e){var n,r=null==e||null===(n=e.markerData)||void 0===n?void 0:n.coordinates,i=zl(r);i&&(t.has(i)||t.set(i,{locationKey:i,coordinates:Rl(r),items:[]}),t.get(i).items.push(e))}),Array.from(t.values()).map(function(e){return Nl(Nl({},e),{},{items:Rl(e.items).sort(Vl)})})}(this.getFilteredItems());return this.locationGroupsByKey=Object.fromEntries(e.map(function(e){return[e.locationKey,e.items]})),{type:"FeatureCollection",features:e.map(function(e){return function(e){var t=Ml((null==e?void 0:e.coordinates)||[],2),n=t[0],r=t[1];return"number"!=typeof n||"number"!=typeof r?null:{type:"Feature",geometry:{type:"Point",coordinates:[n,r]},properties:{locationKey:e.locationKey,videosCount:e.items.length}}}(e)}).filter(Boolean)}},refreshSource:function(){var e;this.persistFilterStateToUrl(),this.closeMarkerPopup();var t=null===(e=this.map)||void 0===e?void 0:e.getSource("geofilms");t&&t.setData(this.toGeoJson()),this.fitToFilteredItems(),this.syncVisibleItems()},fitToFilteredItems:function(){if(this.map){var e=this.getFilteredItems();if(0!==e.length){var t,n=1/0,r=1/0,i=-1/0,o=-1/0,s=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=Pl(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,s=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){a=!0,o=e},f:function(){try{s||null==n.return||n.return()}finally{if(a)throw o}}}}(e);try{for(s.s();!(t=s.n()).done;){var a,l=t.value,c=Ml((null==l||null===(a=l.markerData)||void 0===a?void 0:a.coordinates)||[],2),u=c[0],h=c[1];"number"==typeof u&&"number"==typeof h&&(u<n&&(n=u),u>i&&(i=u),h<r&&(r=h),h>o&&(o=h))}}catch(e){s.e(e)}finally{s.f()}isFinite(n)&&this.map.fitBounds([[n,r],[i,o]],{padding:60,maxZoom:9,duration:800})}}},syncVisibleItems:function(){if(this.map){var e=this.map.getBounds(),t=this.getFilteredItems();this.filteredItemsCount=t.length,this.visibleItems=t.filter(function(t){var n,r=Ml((null==t||null===(n=t.markerData)||void 0===n?void 0:n.coordinates)||[],2),i=r[0],o=r[1];return"number"==typeof i&&"number"==typeof o&&e.contains([i,o])}).sort(Vl),this.currentPage=0}},applyActiveMarkerFromUrl:function(){var e=this;if(this.activeId){var t=this.allItems.find(function(t){return t.id===e.activeId});t&&this.selectItem(t)}},parseCoordinates:function(e){var t=String(e||"").split(",").map(function(e){return Number(e)});return 2!==t.length||t.some(function(e){return Number.isNaN(e)})?null:[t[0],t[1]]},setPopupUrlState:function(e,t,n){var r=Array.isArray(e)&&2===e.length?e:null,i=(t||[]).map(function(e){return null==e?void 0:e.id}).filter(function(e){return"string"==typeof e&&e.length>0});if(r&&0!==i.length){var o=Number.isInteger(n)?Math.min(Math.max(n,0),i.length-1):0,s=zl(r);this.setUrlParams({pm:s||"".concat(r[0],",").concat(r[1]),pv:i.join(","),pi:String(o)})}else this.clearPopupUrlState()},clearPopupUrlState:function(){this.setUrlParams({pm:null,pv:null,pi:null})},restorePopupFromUrl:function(){var e,t,n=this.getUrlParam("pv");if(n){var r=Hl(n);if(0!==r.length){var i=new Map(this.allItems.map(function(e){return[e.id,e]})),o=r.map(function(e){return i.get(e)}).filter(Boolean);if(0!==o.length){var s=Number(this.getUrlParam("pi")),a=Number.isInteger(s)?Math.min(Math.max(s,0),o.length-1):0,l=this.parseCoordinates(this.getUrlParam("pm")),c=(null===(e=o[a])||void 0===e||null===(e=e.markerData)||void 0===e?void 0:e.coordinates)||(null===(t=o[0])||void 0===t||null===(t=t.markerData)||void 0===t?void 0:t.coordinates),u=l||c;Array.isArray(u)&&2===u.length?this.openMarkerPopup(u,o,{maxItems:null,initialIndex:a}):this.clearPopupUrlState()}else this.clearPopupUrlState()}else this.clearPopupUrlState()}},toggleCheckbox:function(e,t){this.filterState[e]&&(this.filterState[e][t]=!this.filterState[e][t],this.refreshSource())},setDateRange:function(e){this.filterState.daterange=this.filterState.daterange===e?null:e,this.refreshSource()},hasActiveFilters:function(){var e;return Boolean(null===(e=this.filterState.keyword)||void 0===e?void 0:e.trim())||Boolean(this.filterState.daterange)||Ul(this.filterState.regi
2ons).length>0||Ul(this.filterState.countries).length>0||Ul(this.filterState.topics).length>0},handleClusterClick:function(e){var t=this;return Ll(Il().m(function n(){var r,i,o,s,a,l,c,u;return Il().w(function(n){for(;;)switch(n.n){case 0:if(l=null===(r=e.features)||void 0===r?void 0:r[0]){n.n=1;break}return n.a(2);case 1:if(t.closeMarkerPopup(),c=null==l||null===(i=l.properties)||void 0===i?void 0:i.cluster_id,u=Number((null==l||null===(o=l.properties)||void 0===o?void 0:o.point_count)||0),!(Number((null===(s=t.map)||void 0===s||null===(a=s.getZoom)||void 0===a?void 0:a.call(s))||0)>7&&u>1)){n.n=3;break}return n.n=2,t.openClusterPopup(l,c,u);case 2:if(!n.v){n.n=3;break}return n.a(2);case 3:return n.n=4,t.zoomToCluster(l,c);case 4:return n.a(2)}},n)}))()},zoomToCluster:function(e,t){var n=this;return Ll(Il().m(function r(){var i,o;return Il().w(function(r){for(;;)switch(r.p=r.n){case 0:if(n.map&&null!=t){r.n=1;break}return r.a(2);case 1:if(i=n.map.getSource("geofilms")){r.n=2;break}return r.a(2);case 2:return r.p=2,r.n=3,n.getClusterExpansionZoom(i,t);case 3:if("number"==typeof(o=r.v)){r.n=4;break}return r.a(2);case 4:n.map.easeTo({center:e.geometry.coordinates,zoom:o}),r.n=6;break;case 5:r.p=5,r.v;case 6:return r.a(2)}},r,null,[[2,5]])}))()},getClusterExpansionZoom:function(e,t){return Ll(Il().m(function n(){var r;return Il().w(function(n){for(;;)switch(n.p=n.n){case 0:return n.p=0,n.n=1,e.getClusterExpansionZoom(t);case 1:if("number"!=typeof(r=n.v)){n.n=2;break}return n.a(2,r);case 2:n.n=4;break;case 3:n.p=3,n.v;case 4:return n.n=5,new Promise(function(n,r){e.getClusterExpansionZoom(t,function(e,t){e?r(e):n(t)})});case 5:return n.a(2,n.v)}},n,null,[[0,3]])}))()},getClusterLeaves:function(e,t,n){return Ll(Il().m(function r(){var i;return Il().w(function(r){for(;;)switch(r.p=r.n){case 0:return r.p=0,r.n=1,e.getClusterLeaves(t,n,0);case 1:if(i=r.v,!Array.isArray(i)){r.n=2;break}return r.a(2,i);case 2:r.n=4;break;case 3:r.p=3,r.v;case 4:return r.n=5,new Promise(function(r,i){e.getClusterLeaves(t,n,0,function(e,t){e?i(e):r(Array.isArray(t)?t:[])})});case 5:return r.a(2,r.v)}},r,null,[[0,3]])}))()},openClusterPopup:function(e,t,n){var r=this;return Ll(Il().m(function i(){var o,s,a,l;return Il().w(function(i){for(;;)switch(i.p=i.n){case 0:if((s=null===(o=r.map)||void 0===o?void 0:o.getSource("geofilms"))&&null!=t&&!(n<=1)){i.n=1;break}return i.a(2,!1);case 1:return i.p=1,i.n=2,r.getClusterLeaves(s,t,n);case 2:if(a=i.v,0!==(l=a.flatMap(function(e){var t;return r.locationGroupsByKey[null==e||null===(t=e.properties)||void 0===t?void 0:t.locationKey]||[]}).reduce(function(e,t){return null==t||!t.id||e.seen.has(t.id)||(e.seen.add(t.id),e.items.push(t)),e},{seen:new Set,items:[]}).items.sort(Vl)).length){i.n=3;break}return i.a(2,!1);case 3:return r.popupClusterId=t,r.openMarkerPopup(e.geometry.coordinates,l,{maxItems:null}),i.a(2,!0);case 4:return i.p=4,i.v,i.a(2,!1)}},i,null,[[1,4]])}))()},handleUnclusteredPointClick:function(e){var t,n,r,i=null===(t=e.features)||void 0===t?void 0:t[0];if(i){var o=null==i||null===(n=i.properties)||void 0===n?void 0:n.locationKey,s=null==i||null===(r=i.geometry)||void 0===r?void 0:r.coordinates,a=zl(s),l=this.locationGroupsByKey[o]||this.locationGroupsByKey[a]||[];0!==l.length&&this.openMarkerPopup(s,l)}},closeMarkerPopup:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];if(this.markerPopup){var t=this.markerPopup;this.markerPopup=null,this.popupLocationKey=null,this.popupClusterId=null,this.updateMarkerVisibility(),t.remove(),e&&this.clearPopupUrlState()}else e&&this.clearPopupUrlState()},openMarkerPopup:function(e,t){var n,r=this,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(this.map&&Array.isArray(e)&&2===e.length){var o=Object.prototype.hasOwnProperty.call(i,"maxItems"),s=function(){if(!o)return t.slice(0,20);if(null==i.maxItems)return Rl(t);var e=Number(i.maxItems),n=Number.isFinite(e)?Math.max(1,e):20;return t.slice(0,n)}();if(0!==s.length){this.closeMarkerPopup(!1);var a=null===(n=s[0])||void 0===n||null===(n=n.markerData)||void 0===n?void 0:n.coordinates;this.popupLocationKey=zl(a)||zl(e),this.updateMarkerVisibility();var l=this.getSidebarPadding();this.map.easeTo({center:e,padding:l,duration:400}),setTimeout(function(){return r._showPopup(e,s,t.length,i)},450)}}},_showPopup:function(e,t,n,r){var i=this,o=document.createElement("div");o.className="geofilms-marker-popup";var s=document.createElement("a");s.className="geofilms-marker-popup__media",o.append(s);var a=document.createElement("img");a.className="geofilms-marker-popup__image",a.loading="lazy",s.append(a);var l=document.createElement("div");l.className="geofilms-marker-popup__fallback",l.textContent="Kein Bild",s.append(l);var c=document.createElement("div");c.className="geofilms-marker-popup__facts",o.append(c);var u=document.createElement("span");u.className="geofilms-marker-popup__facts-year",c.append(u);var h=document.createElement("span");h.className="geofilms-marker-popup__facts-duration",c.append(h);var d=document.createElement("div");d.className="geofilms-marker-popup__title",o.append(d);var f=document.createElement("div");f.className="geofilms-marker-popup__actions",o.append(f);var p=document.createElement("a");p.className="geofilms-marker-popup__action geofilms-marker-popup__action--primary",p.textContent="Ansehen",f.append(p);var g=document.createElement("div");g.className="geofilms-marker-popup__controls",o.append(g);var m=document.createElement("button");m.type="button",m.className="geofilms-marker-popup__nav",m.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" width="20" height="20"><path fill-rule="evenodd" d="M12.79 5.23a.75.75 0 01-.02 1.06L8.832 10l3.938 3.71a.75.75 0 11-1.04 1.08l-4.5-4.25a.75.75 0 010-1.08l4.5-4.25a.75.75 0 011.06.02z" clip-rule="evenodd"/></svg>',g.append(m);var w=document.createElement("div");w.className="geofilms-marker-popup__counter",g.append(w);var y=document.createElement("button");if(y.type="button",y.className="geofilms-marker-popup__nav",y.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" width="20" height="20"><path fill-rule="evenodd" d="M7.21 14.77a.75.75 0 01.02-1.06L11.168 10 7.23 6.29a.75.75 0 111.04-1.08l4.5 4.25a.75.75 0 010 1.08l-4.5 4.25a.75.75 0 01-1.06-.02z" clip-rule="evenodd"/></svg>',g.append(y),n>t.length){var E=document.createElement("div");E.className="geofilms-marker-popup__maxinfo",E.textContent="Zeige ".concat(t.length," von ").concat(n," Filmen"),o.append(E)}var v=Number(null==r?void 0:r.initialIndex),A=Number.isInteger(v)?Math.min(Math.max(v,0),t.length-1):0,C=function(){var n,r,o,f,E,v,C=t[A];
2if(C){var b=(null==C||null===(n=C.videoData)||void 0===n?void 0:n.headline)||(null==C||null===(r=C.markerData)||void 0===r?void 0:r.text)||"Ohne Titel";d.textContent=b;var _=null==C||null===(o=C.markerData)||void 0===o?void 0:o.year,S=String((null==C||null===(f=C.videoData)||void 0===f?void 0:f.length_str)||"").trim(),I=Number.isInteger(_)?String(_):"";u.textContent=I,h.textContent=S;var T=I.length>0||S.length>0;c.style.display=T?"flex":"none";var D=(null==C||null===(E=C.videoData)||void 0===E?void 0:E.to)||"#";s.href=D,p.href=D;var N=null==C||null===(v=C.videoData)||void 0===v?void 0:v.image_url;N?(a.src=N,a.alt=b,a.style.display="block",l.style.display="none"):(a.removeAttribute("src"),a.style.display="none",l.style.display="flex"),w.textContent="".concat(A+1,"/").concat(t.length);var O=t.length>1;m.disabled=!O||A<=0,y.disabled=!O||A>=t.length-1,g.style.display=O?"flex":"none",i.setPopupUrlState(e,t,A)}};m.addEventListener("click",function(e){e.preventDefault(),t.length<=1||A<=0||(A-=1,C())}),y.addEventListener("click",function(e){e.preventDefault(),t.length<=1||A>=t.length-1||(A+=1,C())}),p.textContent="Film anschauen",C();var b=new window.Maplibre.Popup({closeButton:!1,closeOnClick:!0,maxWidth:"213px",anchor:"bottom",offset:[56,-20]}).setLngLat(e).setDOMContent(o).addTo(this.map);b.on("close",function(){i.markerPopup=null,i.popupLocationKey=null,i.popupClusterId=null,i.updateMarkerVisibility(),i.clearPopupUrlState()}),this.markerPopup=b},selectItem:function(e){var t;this.activeId=e.id,this.selectedItem=e,this.closeMarkerPopup(),this.setUrlParam("v",e.id),this.updateHighlight(),this.$refs.sidebar&&(this.$refs.sidebar.scrollTop=0);var n=null==e||null===(t=e.markerData)||void 0===t?void 0:t.coordinates;n&&this.map&&this.map.easeTo({center:n,zoom:Math.max(this.map.getZoom(),9)})},deselectItem:function(){this.activeId=null,this.selectedItem=null,this.closeMarkerPopup(),this.setUrlParam("v",null),this.updateHighlight()},updateHighlight:function(){var e,t=this,n=null===(e=this.map)||void 0===e?void 0:e.getSource("geofilms-highlight");if(n)if(this.activeId){var r=this.selectedItem||this.allItems.find(function(e){return e.id===t.activeId});if(r){var i=function(e){var t,n,r,i,o=Ml((null==e||null===(t=e.markerData)||void 0===t?void 0:t.coordinates)||[],2),s=o[0],a=o[1];return"number"!=typeof s||"number"!=typeof a?null:{type:"Feature",geometry:{type:"Point",coordinates:[s,a]},properties:{id:e.id,year:null==e||null===(n=e.markerData)||void 0===n?void 0:n.year,title:(null==e||null===(r=e.videoData)||void 0===r?void 0:r.headline)||(null==e||null===(i=e.markerData)||void 0===i?void 0:i.text)||""}}}(r);n.setData(i?{type:"FeatureCollection",features:[i]}:{type:"FeatureCollection",features:[]})}else n.setData({type:"FeatureCollection",features:[]})}else n.setData({type:"FeatureCollection",features:[]})},get pagedItems(){var e=this.currentPage*this.pageSize;return this.visibleItems.slice(e,e+this.pageSize)},get totalPages(){return Math.max(1,Math.ceil(this.visibleItems.length/this.pageSize))},nextPage:function(){this.currentPage<this.totalPages-1&&this.currentPage++},prevPage:function(){this.currentPage>0&&this.currentPage--},clearFilters:function(){this.filterState.keyword="",this.filterState.daterange=null,this.filterState.regions=Object.fromEntries(this.filterOptions.regions.map(function(e){return[e.slug,!1]})),this.filterState.countries=Object.fromEntries(this.filterOptions.countries.map(function(e){return[e.slug,!1]})),this.filterState.topics=Object.fromEntries(this.filterOptions.topics.map(function(e){return[e.slug,!1]})),this.refreshSource()}}};function Yl(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Xl(){return Xl=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Xl.apply(null,arguments)}function $l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function ql(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};
vendor: 11,199 bytes, line 2
2t%2?$l(Object(n),!0).forEach(function(t){Yl(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):$l(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Zl(e){return Zl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Zl(e)}(Object.getOwnPropertyDescriptor(Wl,"name")||{}).writable||Object.defineProperty(Wl,"name",{value:"default",configurable:!0});function Ql(e){if("undefined"!=typeof window&&window.navigator)return!!navigator.userAgent.match(e)}var Kl=Ql(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),Jl=Ql(/Edge/i),ec=Ql(/firefox/i),tc=Ql(/safari/i)&&!Ql(/chrome/i)&&!Ql(/android/i),nc=Ql(/iP(ad|od|hone)/i),rc=Ql(/chrome/i)&&Ql(/android/i),ic={capture:!1,passive:!1};function oc(e,t,n){e.addEventListener(t,n,!Kl&&ic)}function sc(e,t,n){e.removeEventListener(t,n,!Kl&&ic)}function ac(e,t){if(t){if(">"===t[0]&&(t=t.substring(1)),e)try{if(e.matches)return e.matches(t);if(e.msMatchesSelector)return e.msMatchesSelector(t);if(e.webkitMatchesSelector)return e.webkitMatchesSelector(t)}catch(e){return!1}return!1}}function lc(e){return e.host&&e!==document&&e.host.nodeType&&e.host!==e?e.host:e.parentNode}function cc(e,t,n,r){if(e){n=n||document;do{if(null!=t&&(">"===t[0]?e.parentNode===n&&ac(e,t):ac(e,t))||r&&e===n)return e;if(e===n)break}while(e=lc(e))}return null}var uc,hc=/\s+/g;function dc(e,t,n){if(e&&t)if(e.classList)e.classList[n?"add":"remove"](t);else{var r=(" "+e.className+" ").replace(hc," ").replace(" "+t+" "," ");e.className=(r+(n?" "+t:"")).replace(hc," ")}}function fc(e,t,n){var r=e&&e.style;if(r){if(void 0===n)return document.defaultView&&document.defaultView.getComputedStyle?n=document.defaultView.getComputedStyle(e,""):e.currentStyle&&(n=e.currentStyle),void 0===t?n:n[t];t in r||-1!==t.indexOf("webkit")||(t="-webkit-"+t),r[t]=n+("string"==typeof n?"":"px")}}function pc(e,t){var n="";if("string"==typeof e)n=e;else do{var r=fc(e,"transform");r&&"none"!==r&&(n=r+" "+n)}while(!t&&(e=e.parentNode));var i=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return i&&new i(n)}function gc(e,t,n){if(e){var r=e.getElementsByTagName(t),i=0,o=r.length;if(n)for(;i<o;i++)n(r[i],i);return r}return[]}function mc(){var e=document.scrollingElement;return e||document.documentElement}function wc(e,t,n,r,i){if(e.getBoundingClientRect||e===window){var o,s,a,l,c,u,h;if(e!==window&&e.parentNode&&e!==mc()?(s=(o=e.getBoundingClientRect()).top,a=o.left,l=o.bottom,c=o.right,u=o.height,h=o.width):(s=0,a=0,l=window.innerHeight,c=window.innerWidth,u=window.innerHeight,h=window.innerWidth),(t||n)&&e!==window&&(i=i||e.parentNode,!Kl))do{if(i&&i.getBoundingClientRect&&("none"!==fc(i,"transform")||n&&"static"!==fc(i,"position"))){var d=i.getBoundingClientRect();s-=d.top+parseInt(fc(i,"border-top-width")),a-=d.left+parseInt(fc(i,"border-left-width")),l=s+o.height,c=a+o.width;break}}while(i=i.parentNode);if(r&&e!==window){var f=pc(i||e),p=f&&f.a,g=f&&f.d;f&&(l=(s/=g)+(u/=g),c=(a/=p)+(h/=p))}return{top:s,left:a,bottom:l,right:c,width:h,height:u}}}function yc(e,t,n){for(var r=bc(e,!0),i=wc(e)[t];r;){var o=wc(r)[n];if(!("top"===n||"left"===n?i>=o:i<=o))return r;if(r===mc())break;r=bc(r,!1)}return!1}function Ec(e,t,n,r){for(var i=0,o=0,s=e.children;o<s.length;){if("none"!==s[o].style.display&&s[o]!==Du.ghost&&(r||s[o]!==Du.dragged)&&cc(s[o],n.draggable,e,!1)){if(i===t)return s[o];i++}o++}return null}function vc(e,t){for(var n=e.lastElementChild;n&&(n===Du.ghost||"none"===fc(n,"display")||t&&!ac(n,t));)n=n.previousElementSibling;return n||null}function Ac(e,t){var n=0;if(!e||!e.parentNode)return-1;for(;e=e.previousElementSibling;)"TEMPLATE"===e.nodeName.toUpperCase()||e===Du.clone||t&&!ac(e,t)||n++;return n}function Cc(e){var t=0,n=0,r=mc();if(e)do{var i=pc(e),o=i.a,s=i.d;t+=e.scrollLeft*o,n+=e.scrollTop*s}while(e!==r&&(e=e.parentNode));return[t,n]}function bc(e,t){if(!e||!e.getBoundingClientRect)return mc();var n=e,r=!1;do{if(n.clientWidth<n.scrollWidth||n.clientHeight<n.scrollHeight){var i=fc(n);if(n.clientWidth<n.scrollWidth&&("auto"==i.overflowX||"scroll"==i.overflowX)||n.clientHeight<n.scrollHeight&&("auto"==i.overflowY||"scroll"==i.overflowY)){if(!n.getBoundingClientRect||n===document.body)return mc();if(r||t)return n;r=!0}}}while(n=n.parentNode);return mc()}function _c(e,t){return Math.round(e.top)===Math.round(t.top)&&Math.round(e.left)===Math.round(t.left)&&Math.round(e.height)===Math.round(t.height)&&Math.round(e.width)===Math.round(t.width)}function Sc(e,t){return function(){if(!uc){var n=arguments;1===n.length?e.call(this,n[0]):e.apply(this,n),uc=setTimeout(function(){uc=void 0},t)}}}function Ic(e,t,n){e.scrollLeft+=t,e.scrollTop+=n}function Tc(e){var t=window.Polymer,n=window.jQuery||window.Zepto;return t&&t.dom?t.dom(e).cloneNode(!0):n?n(e).clone(!0)[0]:e.cloneNode(!0)}function Dc(e,t,n){var r={};return Array.from(e.children).forEach(function(i){var o,s,a,l;if(cc(i,t.draggable,e,!1)&&!i.animated&&i!==n){var c=wc(i);r.left=Math.min(null!==(o=r.left)&&void 0!==o?o:1/0,c.left),r.top=Math.min(null!==(s=r.top)&&void 0!==s?s:1/0,c.top),r.right=Math.max(null!==(a=r.right)&&void 0!==a?a:-1/0,c.right),r.bottom=Math.max(null!==(l=r.bottom)&&void 0!==l?l:-1/0,c.bottom)}}),r.width=r.right-r.left,r.height=r.bottom-r.top,r.x=r.left,r.y=r.top,r}var Nc="Sortable"+(new Date).getTime();function Oc(){var e,t=[];return{captureAnimationState:function(){(t=[],this.options.animation)&&[].slice.call(this.el.children).forEach(function(e){if("none"!==fc(e,"display")&&e!==Du.ghost){t.push({target:e,rect:wc(e)});var n=ql({},t[t.length-1].rect);if(e.thisAnimationDuration){var r=pc(e,!0);r&&(n.top-=r.f,n.left-=r.e)}e.fromRect=n}})},addAnimationState:function(e){t.push(e)},removeAnimationState:function(e){t.splice(function(e,t){for(var n in e)if(e.hasOwnProperty(n))for(var r in t)if(t.hasOwnProperty(r)&&t[r]===e[n][r])return Number(n);return-1}(t,{target:e}),1)},animateAll:function(n){var r=this;if(!this.options.animation)return clearTimeout(e),void("function"==typeof n&&n());var i=!1,o=0;t.forEach(function(e){var t=0,n=e.target,s=n.fromRect,a=wc(n),l=n.prevFromRect,c=n.prevToRect,u=e.rect,h=pc(n,!0);h&&(a.top-=h.f,a.left-=h.e),n.toRect=a,n.thisAnimationDuration&&_c(l,a)&&!_c(s,a)&&(u.top-a.top)/(u.left-a.left)===(s.top-a.top)/(s.left-a.left)&&(t=function(e,t,n,r){return Math.sqrt(Math.pow(t.top-e.top,2)+Math.pow(t.left-e.left,2))/Math.sqrt(Math.pow(t.top-n.top,2)+Math.pow(t.left-n.left,2))*r.animation}(u,l,c,r.options)),_c(a,s)||(n.prevFromRect=s,n.prevToRect=a,t||(t=r.options.animation),r.animate(n,u,a,t)),t&&(i=!0,o=Math.max(o,t),clearTimeout(n.animationResetTimer),n.animationResetTimer=setTimeout(function(){n.animationTime=0,n.prevFromRect=null,n.fromRect=null,n.prevToRect=null,n.thisAnimationDuration=null},t),n.thisAnimationDuration=t)}),clearTimeout(e),i?e=setTimeout(function(){"function"==typeof n&&n()},o):"function"==typeof n&&n(),t=[]},animate:function(e,t,n,r){if(r){fc(e,"transition",""),fc(e,"transform","");var i=pc(this.el),o=i&&i.a,s=i&&i.d,a=(t.left-n.left)/(o||1),l=(t.top-n.top)/(s||1);e.animatingX=!!a,e.animatingY=!!l,fc(e,"transform","translate3d("+a+"px,"+l+"px,0)"),this.forRepaintDummy=function(e){return e.offsetWidth}(e),fc(e,"transition","transform "+r+"ms"+(this.options.easing?" "+this.options.easing:"")),fc(e,"transform","translate3d(0,0,0)"),"number"==typeof e.animated&&clearTimeout(e.animated),e.animated=setTimeout(function(){fc(e,"transition",""),fc(e,"transform",""),e.animated=!1,e.animatingX=!1,e.animatingY=!1},r)}}}}var Rc=[],Mc={initializeByDefault:!0},Pc={mount:function(e){for(var t in Mc)Mc.hasOwnProperty(t)&&!(t in e)&&(e[t]=Mc[t]);Rc.forEach(function(t){if(t.pluginName===e.pluginName)throw"Sortable: Cannot mount plugin ".concat(e.pluginName," more than once")}),Rc.push(e)},pluginEvent:function(e,t,n){var r=this;this.eventCanceled=!1,n.cancel=function(){r.eventCanceled=!0};var i=e+"Global";Rc.forEach(function(r){t[r.pluginName]&&(t[r.pluginName][i]&&t[r.pluginName][i](ql({sortable:t},n)),t.options[r.pluginName]&&t[r.pluginName][e]&&t[r.pluginName][e](ql({sortable:t},n)))})},initializePlugins:function(e,t,n,r){for(var i in Rc.forEach(function(r){var i=r.pluginName;if(e.options[i]||r.initializeByDefault){var o=new r(e,t,e.options);o.sortable=e,o.options=e.options,e[i]=o,Xl(n,o.defaults)}}),e.options)if(e.options.hasOwnProperty(i)){var o=this.modifyOption(e,i,e.options[i]);void 0!==o&&(e.options[i]=o)}},getEventProperties:function(e,t){var n={};return Rc.forEach(function(r){"function"==typeof r.eventProperties&&Xl(n,r.eventProperties.call(t[r.pluginName],e))}),n},modifyOption:function(e,t,n){var r;return Rc.forEach(function(i){e[i.pluginName]&&i.optionListeners&&"function"==typeof i.optionListeners[t]&&(r=i.optionListeners[t].call(e[i.pluginName],n))}),r}};function kc(e){var t=e.sortable,n=e.rootEl,r=e.name,i=e.targetEl,o=e.cloneEl,s=e.toEl,a=e.fromEl,l=e.oldIndex,c=e.newIndex,u=e.oldDraggableIndex,h=e.newDraggableIndex,d=e.originalEvent,f=e.putSortable,p=e.extraEventProperties;if(t=t||n&&n[Nc]){var g,m=t.options,w="on"+r.charAt(0).toUpperCase()+r.substr(1);!window.CustomEvent||Kl||Jl?(g=document.createEvent("Event")).initEvent(r,!0,!0):g=new CustomEvent(r,{bubbles:!0,cancelable:!0}),g.to=s||n,g.from=a||n,g.item=i||n,g.clone=o,g.oldIndex=l,g.newIndex=c,g.oldDraggableIndex=u,g.newDraggableIndex=h,g.originalEvent=d,g.pullMode=f?f.lastPutMode:void 0;var y=ql(ql({},p),Pc.getEventProperties(r,t));for(var E in y)g[E]=y[E];n&&n.dispatchEvent(g),m[w]&&m[w].call(t,g)}}var xc=["evt"],Lc=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.evt,i=function(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}(n,xc);Pc.pluginEvent.bind(Du)(e,t,ql({dragEl:Fc,parentEl:Uc,ghostEl:jc,rootEl:Hc,nextEl:Vc,lastDownEl:zc,cloneEl:Gc,cloneHidden:Wc,dragStarted:iu,putSortable:Qc,activeSortable:Du.active,originalEvent:r,oldIndex:Yc,oldDraggableIndex:$c,newIndex:Xc,newDraggableIndex:qc,hideGhostForTarget:_u,unhideGhostForTarget:Su,cloneNowHidden:function(){Wc=!0},cloneNowShown:function(){Wc=!1},dispatchSortableEvent:function(e){Bc({sortable:t,name:e,originalEvent:r})}},i))};function Bc(e){kc(ql({putSortable:Qc,cloneEl:Gc,targetEl:Fc,rootEl:Hc,oldIndex:Yc,oldDraggableIndex:$c,newIndex:Xc,newDraggableIndex:qc},e))}var Fc,Uc,jc,Hc,Vc,zc,Gc,Wc,Yc,Xc,$c,qc,Zc,Qc,Kc,Jc,eu,tu,nu,ru,iu,ou,su,au,lu,cu=!1,uu=!1,hu=[],du=!1,fu=!1,pu=[],gu=!1,mu=[],wu="undefined"!=typeof document,yu=nc,Eu=Jl||Kl?"cssFloat":"float",vu=wu&&!rc&&!nc&&"draggable"in document.createElement("div"),Au=function(){if(wu){if(Kl)return!1;var e=document.createElement("x");return e.style.cssText="pointer-events:auto","auto"===e.style.pointerEvents}}
vendor: 8,791 bytes, line 2
2(),Cu=function(e,t){var n=fc(e),r=parseInt(n.width)-parseInt(n.paddingLeft)-parseInt(n.paddingRight)-parseInt(n.borderLeftWidth)-parseInt(n.borderRightWidth),i=Ec(e,0,t),o=Ec(e,1,t),s=i&&fc(i),a=o&&fc(o),l=s&&parseInt(s.marginLeft)+parseInt(s.marginRight)+wc(i).width,c=a&&parseInt(a.marginLeft)+parseInt(a.marginRight)+wc(o).width;if("flex"===n.display)return"column"===n.flexDirection||"column-reverse"===n.flexDirection?"vertical":"horizontal";if("grid"===n.display)return n.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(i&&s.float&&"none"!==s.float){var u="left"===s.float?"left":"right";return!o||"both"!==a.clear&&a.clear!==u?"horizontal":"vertical"}return i&&("block"===s.display||"flex"===s.display||"table"===s.display||"grid"===s.display||l>=r&&"none"===n[Eu]||o&&"none"===n[Eu]&&l+c>r)?"vertical":"horizontal"},bu=function(e){function t(e,n){return function(r,i,o,s){var a=r.options.group.name&&i.options.group.name&&r.options.group.name===i.options.group.name;if(null==e&&(n||a))return!0;if(null==e||!1===e)return!1;if(n&&"clone"===e)return e;if("function"==typeof e)return t(e(r,i,o,s),n)(r,i,o,s);var l=(n?r:i).options.group.name;return!0===e||"string"==typeof e&&e===l||e.join&&e.indexOf(l)>-1}}var n={},r=e.group;r&&"object"==Zl(r)||(r={name:r}),n.name=r.name,n.checkPull=t(r.pull,!0),n.checkPut=t(r.put),n.revertClone=r.revertClone,e.group=n},_u=function(){!Au&&jc&&fc(jc,"display","none")},Su=function(){!Au&&jc&&fc(jc,"display","")};wu&&!rc&&document.addEventListener("click",function(e){if(uu)return e.preventDefault(),e.stopPropagation&&e.stopPropagation(),e.stopImmediatePropagation&&e.stopImmediatePropagation(),uu=!1,!1},!0);var Iu=function(e){if(Fc){e=e.touches?e.touches[0]:e;var t=(i=e.clientX,o=e.clientY,hu.some(function(e){var t=e[Nc].options.emptyInsertThreshold;if(t&&!vc(e)){var n=wc(e),r=i>=n.left-t&&i<=n.right+t,a=o>=n.top-t&&o<=n.bottom+t;return r&&a?s=e:void 0}}),s);if(t){var n={};for(var r in e)e.hasOwnProperty(r)&&(n[r]=e[r]);n.target=n.rootEl=t,n.preventDefault=void 0,n.stopPropagation=void 0,t[Nc]._onDragOver(n)}}var i,o,s},Tu=function(e){Fc&&Fc.parentNode[Nc]._isOutsideThisEl(e.target)};function Du(e,t){if(!e||!e.nodeType||1!==e.nodeType)throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(e));this.el=e,this.options=t=Xl({},t),e[Nc]=this;var n={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(e.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return Cu(e,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(e,t){e.setData("Text",t.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:!1!==Du.supportPointer&&"PointerEvent"in window&&(!tc||nc),emptyInsertThreshold:5};for(var r in Pc.initializePlugins(this,e,n),n)!(r in t)&&(t[r]=n[r]);for(var i in bu(t),this)"_"===i.charAt(0)&&"function"==typeof this[i]&&(this[i]=this[i].bind(this));this.nativeDraggable=!t.forceFallback&&vu,this.nativeDraggable&&(this.options.touchStartThreshold=1),t.supportPointer?oc(e,"pointerdown",this._onTapStart):(oc(e,"mousedown",this._onTapStart),oc(e,"touchstart",this._onTapStart)),this.nativeDraggable&&(oc(e,"dragover",this),oc(e,"dragenter",this)),hu.push(this.el),t.store&&t.store.get&&this.sort(t.store.get(this)||[]),Xl(this,Oc())}function Nu(e,t,n,r,i,o,s,a){var l,c,u=e[Nc],h=u.options.onMove;return!window.CustomEvent||Kl||Jl?(l=document.createEvent("Event")).initEvent("move",!0,!0):l=new CustomEvent("move",{bubbles:!0,cancelable:!0}),l.to=t,l.from=e,l.dragged=n,l.draggedRect=r,l.related=i||t,l.relatedRect=o||wc(t),l.willInsertAfter=a,l.originalEvent=s,e.dispatchEvent(l),h&&(c=h.call(u,l,s)),c}function Ou(e){e.draggable=!1}function Ru(){gu=!1}function Mu(e){for(var t=e.tagName+e.className+e.src+e.href+e.textContent,n=t.length,r=0;n--;)r+=t.charCodeAt(n);return r.toString(36)}function Pu(e){return setTimeout(e,0)}function ku(e){return clearTimeout(e)}Du.prototype={constructor:Du,_isOutsideThisEl:function(e){this.el.contains(e)||e===this.el||(ou=null)},_getDirection:function(e,t){return"function"==typeof this.options.direction?this.options.direction.call(this,e,t,Fc):this.options.direction},_onTapStart:function(e){if(e.cancelable){var t=this,n=this.el,r=this.options,i=r.preventOnFilter,o=e.type,s=e.touches&&e.touches[0]||e.pointerType&&"touch"===e.pointerType&&e,a=(s||e).target,l=e.target.shadowRoot&&(e.path&&e.path[0]||e.composedPath&&e.composedPath()[0])||a,c=r.filter;if(function(e){mu.length=0;var t=e.getElementsByTagName("input"),n=t.length;for(;n--;){var r=t[n];r.checked&&mu.push(r)}}(n),!Fc&&!(/mousedown|pointerdown/.test(o)&&0!==e.button||r.disabled)&&!l.isContentEditable&&(this.nativeDraggable||!tc||!a||"SELECT"!==a.tagName.toUpperCase())&&!((a=cc(a,r.draggable,n,!1))&&a.animated||zc===a)){if(Yc=Ac(a),$c=Ac(a,r.draggable),"function"==typeof c){if(c.call(this,e,a,this))return Bc({sortable:t,rootEl:l,name:"filter",targetEl:a,toEl:n,fromEl:n}),Lc("filter",t,{evt:e}),void(i&&e.preventDefault())}else if(c&&(c=c.split(",").some(function(r){if(r=cc(l,r.trim(),n,!1))return Bc({sortable:t,rootEl:r,name:"filter",targetEl:a,fromEl:n,toEl:n}),Lc("filter",t,{evt:e}),!0})))return void(i&&e.preventDefault());r.handle&&!cc(l,r.handle,n,!1)||this._prepareDragStart(e,s,a)}}},_prepareDragStart:function(e,t,n){var r,i=this,o=i.el,s=i.options,a=o.ownerDocument;if(n&&!Fc&&n.parentNode===o){var l=wc(n);if(Hc=o,Uc=(Fc=n).parentNode,Vc=Fc.nextSibling,zc=n,Zc=s.group,Du.dragged=Fc,Kc={target:Fc,clientX:(t||e).clientX,clientY:(t||e).clientY},nu=Kc.clientX-l.left,ru=Kc.clientY-l.top,this._lastX=(t||e).clientX,this._lastY=(t||e).clientY,Fc.style["will-change"]="all",r=function(){Lc("delayEnded",i,{evt:e}),Du.eventCanceled?i._onDrop():(i._disableDelayedDragEvents(),!ec&&i.nativeDraggable&&(Fc.draggable=!0),i._triggerDragStart(e,t),Bc({sortable:i,name:"choose",originalEvent:e}),dc(Fc,s.chosenClass,!0))},s.ignore.split(",").forEach(function(e){gc(Fc,e.trim(),Ou)}),oc(a,"dragover",Iu),oc(a,"mousemove",Iu),oc(a,"touchmove",Iu),s.supportPointer?(oc(a,"pointerup",i._onDrop),!this.nativeDraggable&&oc(a,"pointercancel",i._onDrop)):(oc(a,"mouseup",i._onDrop),oc(a,"touchend",i._onDrop),oc(a,"touchcancel",i._onDrop)),ec&&this.nativeDraggable&&(this.options.touchStartThreshold=4,Fc.draggable=!0),Lc("delayStart",this,{evt:e}),!s.delay||s.delayOnTouchOnly&&!t||this.nativeDraggable&&(Jl||Kl))r();else{if(Du.eventCanceled)return void this._onDrop();s.supportPointer?(oc(a,"pointerup",i._disableDelayedDrag),oc(a,"pointercancel",i._disableDelayedDrag)):(oc(a,"mouseup",i._disableDelayedDrag),oc(a,"touchend",i._disableDelayedDrag),oc(a,"touchcancel",i._disableDelayedDrag)),oc(a,"mousemove",i._delayedDragTouchMoveHandler),oc(a,"touchmove",i._delayedDragTouchMoveHandler),s.supportPointer&&oc(a,"pointermove",i._delayedDragTouchMoveHandler),i._dragStartTimer=setTimeout(r,s.delay)}}},_delayedDragTouchMoveHandler:function(e){var t=e.touches?e.touches[0]:e;Math.max(Math.abs(t.clientX-this._lastX),Math.abs(t.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){Fc&&Ou(Fc),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var e=this.el.ownerDocument;sc(e,"mouseup",this._disableDelayedDrag),sc(e,"touchend",this._disableDelayedDrag),sc(e,"touchcancel",this._disableDelayedDrag),sc(e,"pointerup",this._disableDelayedDrag),sc(e,"pointercancel",this._disableDelayedDrag),sc(e,"mousemove",this._delayedDragTouchMoveHandler),sc(e,"touchmove",this._delayedDragTouchMoveHandler),sc(e,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(e,t){t=t||"touch"==e.pointerType&&e,!this.nativeDraggable||t?this.options.supportPointer?oc(document,"pointermove",this._onTouchMove):oc(document,t?"touchmove":"mousemove",this._onTouchMove):(oc(Fc,"dragend",this),oc(Hc,"dragstart",this._onDragStart));try{document.selection?Pu(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch(e){}},_dragStarted:function(e,t){if(cu=!1,Hc&&Fc){Lc("dragStarted",this,{evt:t}),this.nativeDraggable&&oc(document,"dragover",Tu);var n=this.options;!e&&dc(Fc,n.dragClass,!1),dc(Fc,n.ghostClass,!0),Du.active=this,e&&this._appendGhost(),Bc({sortable:this,name:"start",originalEvent:t})}
vendor: 9,787 bytes, line 2
2else this._nulling()},_emulateDragOver:function(){if(Jc){this._lastX=Jc.clientX,this._lastY=Jc.clientY,_u();for(var e=document.elementFromPoint(Jc.clientX,Jc.clientY),t=e;e&&e.shadowRoot&&(e=e.shadowRoot.elementFromPoint(Jc.clientX,Jc.clientY))!==t;)t=e;if(Fc.parentNode[Nc]._isOutsideThisEl(e),t)do{if(t[Nc]){if(t[Nc]._onDragOver({clientX:Jc.clientX,clientY:Jc.clientY,target:e,rootEl:t})&&!this.options.dragoverBubble)break}e=t}while(t=lc(t));Su()}},_onTouchMove:function(e){if(Kc){var t=this.options,n=t.fallbackTolerance,r=t.fallbackOffset,i=e.touches?e.touches[0]:e,o=jc&&pc(jc,!0),s=jc&&o&&o.a,a=jc&&o&&o.d,l=yu&&lu&&Cc(lu),c=(i.clientX-Kc.clientX+r.x)/(s||1)+(l?l[0]-pu[0]:0)/(s||1),u=(i.clientY-Kc.clientY+r.y)/(a||1)+(l?l[1]-pu[1]:0)/(a||1);if(!Du.active&&!cu){if(n&&Math.max(Math.abs(i.clientX-this._lastX),Math.abs(i.clientY-this._lastY))<n)return;this._onDragStart(e,!0)}if(jc){o?(o.e+=c-(eu||0),o.f+=u-(tu||0)):o={a:1,b:0,c:0,d:1,e:c,f:u};var h="matrix(".concat(o.a,",").concat(o.b,",").concat(o.c,",").concat(o.d,",").concat(o.e,",").concat(o.f,")");fc(jc,"webkitTransform",h),fc(jc,"mozTransform",h),fc(jc,"msTransform",h),fc(jc,"transform",h),eu=c,tu=u,Jc=i}e.cancelable&&e.preventDefault()}},_appendGhost:function(){if(!jc){var e=this.options.fallbackOnBody?document.body:Hc,t=wc(Fc,!0,yu,!0,e),n=this.options;if(yu){for(lu=e;"static"===fc(lu,"position")&&"none"===fc(lu,"transform")&&lu!==document;)lu=lu.parentNode;lu!==document.body&&lu!==document.documentElement?(lu===document&&(lu=mc()),t.top+=lu.scrollTop,t.left+=lu.scrollLeft):lu=mc(),pu=Cc(lu)}dc(jc=Fc.cloneNode(!0),n.ghostClass,!1),dc(jc,n.fallbackClass,!0),dc(jc,n.dragClass,!0),fc(jc,"transition",""),fc(jc,"transform",""),fc(jc,"box-sizing","border-box"),fc(jc,"margin",0),fc(jc,"top",t.top),fc(jc,"left",t.left),fc(jc,"width",t.width),fc(jc,"height",t.height),fc(jc,"opacity","0.8"),fc(jc,"position",yu?"absolute":"fixed"),fc(jc,"zIndex","100000"),fc(jc,"pointerEvents","none"),Du.ghost=jc,e.appendChild(jc),fc(jc,"transform-origin",nu/parseInt(jc.style.width)*100+"% "+ru/parseInt(jc.style.height)*100+"%")}},_onDragStart:function(e,t){var n=this,r=e.dataTransfer,i=n.options;Lc("dragStart",this,{evt:e}),Du.eventCanceled?this._onDrop():(Lc("setupClone",this),Du.eventCanceled||((Gc=Tc(Fc)).removeAttribute("id"),Gc.draggable=!1,Gc.style["will-change"]="",this._hideClone(),dc(Gc,this.options.chosenClass,!1),Du.clone=Gc),n.cloneId=Pu(function(){Lc("clone",n),Du.eventCanceled||(n.options.removeCloneOnHide||Hc.insertBefore(Gc,Fc),n._hideClone(),Bc({sortable:n,name:"clone"}))}),!t&&dc(Fc,i.dragClass,!0),t?(uu=!0,n._loopId=setInterval(n._emulateDragOver,50)):(sc(document,"mouseup",n._onDrop),sc(document,"touchend",n._onDrop),sc(document,"touchcancel",n._onDrop),r&&(r.effectAllowed="move",i.setData&&i.setData.call(n,r,Fc)),oc(document,"drop",n),fc(Fc,"transform","translateZ(0)")),cu=!0,n._dragStartId=Pu(n._dragStarted.bind(n,t,e)),oc(document,"selectstart",n),iu=!0,window.getSelection().removeAllRanges(),tc&&fc(document.body,"user-select","none"))},_onDragOver:function(e){var t,n,r,i,o=this.el,s=e.target,a=this.options,l=a.group,c=Du.active,u=Zc===l,h=a.sort,d=Qc||c,f=this,p=!1;if(!gu){if(void 0!==e.preventDefault&&e.cancelable&&e.preventDefault(),s=cc(s,a.draggable,o,!0),N("dragOver"),Du.eventCanceled)return p;if(Fc.contains(e.target)||s.animated&&s.animatingX&&s.animatingY||f._ignoreWhileAnimating===s)return R(!1);if(uu=!1,c&&!a.disabled&&(u?h||(r=Uc!==Hc):Qc===this||(this.lastPutMode=Zc.checkPull(this,c,Fc,e))&&l.checkPut(this,c,Fc,e))){if(i="vertical"===this._getDirection(e,s),t=wc(Fc),N("dragOverValid"),Du.eventCanceled)return p;if(r)return Uc=Hc,O(),this._hideClone(),N("revert"),Du.eventCanceled||(Vc?Hc.insertBefore(Fc,Vc):Hc.appendChild(Fc)),R(!0);var g=vc(o,a.draggable);if(!g||function(e,t,n){var r=wc(vc(n.el,n.options.draggable)),i=Dc(n.el,n.options,jc),o=10;return t?e.clientX>i.right+o||e.clientY>r.bottom&&e.clientX>r.left:e.clientY>i.bottom+o||e.clientX>r.right&&e.clientY>r.top}(e,i,this)&&!g.animated){if(g===Fc)return R(!1);if(g&&o===e.target&&(s=g),s&&(n=wc(s)),!1!==Nu(Hc,o,Fc,t,s,n,e,!!s))return O(),g&&g.nextSibling?o.insertBefore(Fc,g.nextSibling):o.appendChild(Fc),Uc=o,M(),R(!0)}else if(g&&function(e,t,n){var r=wc(Ec(n.el,0,n.options,!0)),i=Dc(n.el,n.options,jc),o=10;return t?e.clientX<i.left-o||e.clientY<r.top&&e.clientX<r.right:e.clientY<i.top-o||e.clientY<r.bottom&&e.clientX<r.left}(e,i,this)){var m=Ec(o,0,a,!0);if(m===Fc)return R(!1);if(n=wc(s=m),!1!==Nu(Hc,o,Fc,t,s,n,e,!1))return O(),o.insertBefore(Fc,m),Uc=o,M(),R(!0)}else if(s.parentNode===o){n=wc(s);var w,y,E,v=Fc.parentNode!==o,A=!function(e,t,n){var r=n?e.left:e.top,i=n?e.right:e.bottom,o=n?e.width:e.height,s=n?t.left:t.top,a=n?t.right:t.bottom,l=n?t.width:t.height;return r===s||i===a||r+o/2===s+l/2}(Fc.animated&&Fc.toRect||t,s.animated&&s.toRect||n,i),C=i?"top":"left",b=yc(s,"top","top")||yc(Fc,"top","top"),_=b?b.scrollTop:void 0;if(ou!==s&&(y=n[C],du=!1,fu=!A&&a.invertSwap||v),w=function(e,t,n,r,i,o,s,a){var l=r?e.clientY:e.clientX,c=r?n.height:n.width,u=r?n.top:n.left,h=r?n.bottom:n.right,d=!1;if(!s)if(a&&au<c*i){if(!du&&(1===su?l>u+c*o/2:l<h-c*o/2)&&(du=!0),du)d=!0;else if(1===su?l<u+au:l>h-au)return-su}else if(l>u+c*(1-i)/2&&l<h-c*(1-i)/2)return function(e){return Ac(Fc)<Ac(e)?1:-1}(t);if((d=d||s)&&(l<u+c*o/2||l>h-c*o/2))return l>u+c/2?1:-1;return 0}(e,s,n,i,A?1:a.swapThreshold,null==a.invertedSwapThreshold?a.swapThreshold:a.invertedSwapThreshold,fu,ou===s),0!==w){var S=Ac(Fc);do{S-=w,E=Uc.children[S]}while(E&&("none"===fc(E,"display")||E===jc))}if(0===w||E===s)return R(!1);ou=s,su=w;var I=s.nextElementSibling,T=!1,D=Nu(Hc,o,Fc,t,s,n,e,T=1===w);if(!1!==D)return 1!==D&&-1!==D||(T=1===D),gu=!0,setTimeout(Ru,30),O(),T&&!I?o.appendChild(Fc):s.parentNode.insertBefore(Fc,T?I:s),b&&Ic(b,0,_-b.scrollTop),Uc=Fc.parentNode,void 0===y||fu||(au=Math.abs(y-wc(s)[C])),M(),R(!0)}if(o.contains(Fc))return R(!1)}return!1}function N(a,l){Lc(a,f,ql({evt:e,isOwner:u,axis:i?"vertical":"horizontal",revert:r,dragRect:t,targetRect:n,canSort:h,fromSortable:d,target:s,completed:R,onMove:function(n,r){return Nu(Hc,o,Fc,t,n,wc(n),e,r)},changed:M},l))}function O(){N("dragOverAnimationCapture"),f.captureAnimationState(),f!==d&&d.captureAnimationState()}function R(t){return N("dragOverCompleted",{insertion:t}),t&&(u?c._hideClone():c._showClone(f),f!==d&&(dc(Fc,Qc?Qc.options.ghostClass:c.options.ghostClass,!1),dc(Fc,a.ghostClass,!0)),Qc!==f&&f!==Du.active?Qc=f:f===Du.active&&Qc&&(Qc=null),d===f&&(f._ignoreWhileAnimating=s),f.animateAll(function(){N("dragOverAnimationComplete"),f._ignoreWhileAnimating=null}),f!==d&&(d.animateAll(),d._ignoreWhileAnimating=null)),(s===Fc&&!Fc.animated||s===o&&!s.animated)&&(ou=null),a.dragoverBubble||e.rootEl||s===document||(Fc.parentNode[Nc]._isOutsideThisEl(e.target),!t&&Iu(e)),!a.dragoverBubble&&e.stopPropagation&&e.stopPropagation(),p=!0}function M(){Xc=Ac(Fc),qc=Ac(Fc,a.draggable),Bc({sortable:f,name:"change",toEl:o,newIndex:Xc,newDraggableIndex:qc,originalEvent:e})}},_ignoreWhileAnimating:null,_offMoveEvents:function(){sc(document,"mousemove",this._onTouchMove),sc(document,"touchmove",this._onTouchMove),sc(document,"pointermove",this._onTouchMove),sc(document,"dragover",Iu),sc(document,"mousemove",Iu),sc(document,"touchmove",Iu)},_offUpEvents:function(){var e=this.el.ownerDocument;sc(e,"mouseup",this._onDrop),sc(e,"touchend",this._onDrop),sc(e,"pointerup",this._onDrop),sc(e,"pointercancel",this._onDrop),sc(e,"touchcancel",this._onDrop),sc(document,"selectstart",this)},_onDrop:function(e){var t=this.el,n=this.options;Xc=Ac(Fc),qc=Ac(Fc,n.draggable),Lc("drop",this,{evt:e}),Uc=Fc&&Fc.parentNode,Xc=Ac(Fc),qc=Ac(Fc,n.draggable),Du.eventCanceled||(cu=!1,fu=!1,du=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),ku(this.cloneId),ku(this._dragStartId),this.nativeDraggable&&(sc(document,"drop",this),sc(t,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),tc&&fc(document.body,"user-select",""),fc(Fc,"transform",""),e&&(iu&&(e.cancelable&&e.preventDefault(),!n.dropBubble&&e.stopPropagation()),jc&&jc.parentNode&&jc.parentNode.removeChild(jc),(Hc===Uc||Qc&&"clone"!==Qc.lastPutMode)&&Gc&&Gc.parentNode&&Gc.parentNode.removeChild(Gc),Fc&&(this.nativeDraggable&&sc(Fc,"dragend",this),Ou(Fc),Fc.style["will-change"]="",iu&&!cu&&dc(Fc,Qc?Qc.options.ghostClass:this.options.ghostClass,!1),dc(Fc,this.options.chosenClass,!1),Bc({sortable:this,name:"unchoose",toEl:Uc,newIndex:null,newDraggableIndex:null,originalEvent:e}),Hc!==Uc?(Xc>=0&&(Bc({rootEl:Uc,name:"add",toEl:Uc,fromEl:Hc,originalEvent:e}),Bc({sortable:this,name:"remove",toEl:Uc,originalEvent:e}),Bc({rootEl:Uc,name:"sort",toEl:Uc,fromEl:Hc,originalEvent:e}),Bc({sortable:this,name:"sort",toEl:Uc,originalEvent:e})),Qc&&Qc.save()):Xc!==Yc&&Xc>=0&&(Bc({sortable:this,name:"update",toEl:Uc,originalEvent:e}),Bc({sortable:this,name:"sort",toEl:Uc,originalEvent:e})),Du.active&&(null!=Xc&&-1!==Xc||(Xc=Yc,qc=$c),Bc({sortable:this,name:"end",toEl:Uc,originalEvent:e}),this.save())))),this._nulling()},_nulling:function(){Lc("nulling",this),Hc=Fc=Uc=jc=Vc=Gc=zc=Wc=Kc=Jc=iu=Xc=qc=Yc=$c=ou=su=Qc=Zc=Du.dragged=Du.ghost=Du.clone=Du.active=null;var e=this.el;mu.forEach(function(t){e.contains(t)&&(t.checked=!0)}),mu.length=eu=tu=0},handleEvent:function(e){switch(e.type){case"drop":case"dragend":this._onDrop(e);break;case"dragenter":case"dragover":Fc&&(this._onDragOver(e),function(e){e.dataTransfer&&(e.dataTransfer.dropEffect="move");e.cancelable&&e.preventDefault()}(e));break;case"selectstart":e.preventDefault()}},toArray:function(){for(var e,t=[],n=this.el.children,r=0,i=n.length,o=this.options;r<i;r++)cc(e=n[r],o.draggable,this.el,!1)&&t.push(e.getAttribute(o.dataIdAttr)||Mu(e));return t},sort:function(e,t){var n={},r=this.el;
vendor: 5,804 bytes, line 2
2this.toArray().forEach(function(e,t){var i=r.children[t];cc(i,this.options.draggable,r,!1)&&(n[e]=i)},this),t&&this.captureAnimationState(),e.forEach(function(e){n[e]&&(r.removeChild(n[e]),r.appendChild(n[e]))}),t&&this.animateAll()},save:function(){var e=this.options.store;e&&e.set&&e.set(this)},closest:function(e,t){return cc(e,t||this.options.draggable,this.el,!1)},option:function(e,t){var n=this.options;if(void 0===t)return n[e];var r=Pc.modifyOption(this,e,t);n[e]=void 0!==r?r:t,"group"===e&&bu(n)},destroy:function(){Lc("destroy",this);var e=this.el;e[Nc]=null,sc(e,"mousedown",this._onTapStart),sc(e,"touchstart",this._onTapStart),sc(e,"pointerdown",this._onTapStart),this.nativeDraggable&&(sc(e,"dragover",this),sc(e,"dragenter",this)),Array.prototype.forEach.call(e.querySelectorAll("[draggable]"),function(e){e.removeAttribute("draggable")}),this._onDrop(),this._disableDelayedDragEvents(),hu.splice(hu.indexOf(this.el),1),this.el=e=null},_hideClone:function(){if(!Wc){if(Lc("hideClone",this),Du.eventCanceled)return;fc(Gc,"display","none"),this.options.removeCloneOnHide&&Gc.parentNode&&Gc.parentNode.removeChild(Gc),Wc=!0}},_showClone:function(e){if("clone"===e.lastPutMode){if(Wc){if(Lc("showClone",this),Du.eventCanceled)return;Fc.parentNode!=Hc||this.options.group.revertClone?Vc?Hc.insertBefore(Gc,Vc):Hc.appendChild(Gc):Hc.insertBefore(Gc,Fc),this.options.group.revertClone&&this.animate(Fc,Gc),fc(Gc,"display",""),Wc=!1}}else this._hideClone()}},wu&&oc(document,"touchmove",function(e){(Du.active||cu)&&e.cancelable&&e.preventDefault()}),Du.utils={on:oc,off:sc,css:fc,find:gc,is:function(e,t){return!!cc(e,t,e,!1)},extend:function(e,t){if(e&&t)for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e},throttle:Sc,closest:cc,toggleClass:dc,clone:Tc,index:Ac,nextTick:Pu,cancelNextTick:ku,detectDirection:Cu,getChild:Ec,expando:Nc},Du.get=function(e){return e[Nc]},Du.mount=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];t[0].constructor===Array&&(t=t[0]),t.forEach(function(e){if(!e.prototype||!e.prototype.constructor)throw"Sortable: Mounted plugin must be a constructor function, not ".concat({}.toString.call(e));e.utils&&(Du.utils=ql(ql({},Du.utils),e.utils)),Pc.mount(e)})},Du.create=function(e,t){return new Du(e,t)},Du.version="1.15.7";var xu,Lu,Bu,Fu,Uu,ju,Hu=[],Vu=!1;function zu(){Hu.forEach(function(e){clearInterval(e.pid)}),Hu=[]}function Gu(){clearInterval(ju)}var Wu=Sc(function(e,t,n,r){if(t.scroll){var i,o=(e.touches?e.touches[0]:e).clientX,s=(e.touches?e.touches[0]:e).clientY,a=t.scrollSensitivity,l=t.scrollSpeed,c=mc(),u=!1;Lu!==n&&(Lu=n,zu(),xu=t.scroll,i=t.scrollFn,!0===xu&&(xu=bc(n,!0)));var h=0,d=xu;do{var f=d,p=wc(f),g=p.top,m=p.bottom,w=p.left,y=p.right,E=p.width,v=p.height,A=void 0,C=void 0,b=f.scrollWidth,_=f.scrollHeight,S=fc(f),I=f.scrollLeft,T=f.scrollTop;f===c?(A=E<b&&("auto"===S.overflowX||"scroll"===S.overflowX||"visible"===S.overflowX),C=v<_&&("auto"===S.overflowY||"scroll"===S.overflowY||"visible"===S.overflowY)):(A=E<b&&("auto"===S.overflowX||"scroll"===S.overflowX),C=v<_&&("auto"===S.overflowY||"scroll"===S.overflowY));var D=A&&(Math.abs(y-o)<=a&&I+E<b)-(Math.abs(w-o)<=a&&!!I),N=C&&(Math.abs(m-s)<=a&&T+v<_)-(Math.abs(g-s)<=a&&!!T);if(!Hu[h])for(var O=0;O<=h;O++)Hu[O]||(Hu[O]={});Hu[h].vx==D&&Hu[h].vy==N&&Hu[h].el===f||(Hu[h].el=f,Hu[h].vx=D,Hu[h].vy=N,clearInterval(Hu[h].pid),0==D&&0==N||(u=!0,Hu[h].pid=setInterval(function(){r&&0===this.layer&&Du.active._onTouchMove(Uu);var t=Hu[this.layer].vy?Hu[this.layer].vy*l:0,n=Hu[this.layer].vx?Hu[this.layer].vx*l:0;"function"==typeof i&&"continue"!==i.call(Du.dragged.parentNode[Nc],n,t,e,Uu,Hu[this.layer].el)||Ic(Hu[this.layer].el,n,t)}.bind({layer:h}),24))),h++}while(t.bubbleScroll&&d!==c&&(d=bc(d,!1)));Vu=u}},30),Yu=function(e){var t=e.originalEvent,n=e.putSortable,r=e.dragEl,i=e.activeSortable,o=e.dispatchSortableEvent,s=e.hideGhostForTarget,a=e.unhideGhostForTarget;if(t){var l=n||i;s();var c=t.changedTouches&&t.changedTouches.length?t.changedTouches[0]:t,u=document.elementFromPoint(c.clientX,c.clientY);a(),l&&!l.el.contains(u)&&(o("spill"),this.onSpill({dragEl:r,putSortable:n}))}};function Xu(){}function $u(){}Xu.prototype={startIndex:null,dragStart:function(e){var t=e.oldDraggableIndex;this.startIndex=t},onSpill:function(e){var t=e.dragEl,n=e.putSortable;this.sortable.captureAnimationState(),n&&n.captureAnimationState();var r=Ec(this.sortable.el,this.startIndex,this.options);r?this.sortable.el.insertBefore(t,r):this.sortable.el.appendChild(t),this.sortable.animateAll(),n&&n.animateAll()},drop:Yu},Xl(Xu,{pluginName:"revertOnSpill"}),$u.prototype={onSpill:function(e){var t=e.dragEl,n=e.putSortable||this.sortable;n.captureAnimationState(),t.parentNode&&t.parentNode.removeChild(t),n.animateAll()},drop:Yu},Xl($u,{pluginName:"removeOnSpill"});Du.mount(new function(){function e(){for(var e in this.defaults={scroll:!0,forceAutoScrollFallback:!1,scrollSensitivity:30,scrollSpeed:10,bubbleScroll:!0},this)"_"===e.charAt(0)&&"function"==typeof this[e]&&(this[e]=this[e].bind(this))}return e.prototype={dragStarted:function(e){var t=e.originalEvent;this.sortable.nativeDraggable?oc(document,"dragover",this._handleAutoScroll):this.options.supportPointer?oc(document,"pointermove",this._handleFallbackAutoScroll):t.touches?oc(document,"touchmove",this._handleFallbackAutoScroll):oc(document,"mousemove",this._handleFallbackAutoScroll)},dragOverCompleted:function(e){var t=e.originalEvent;this.options.dragOverBubble||t.rootEl||this._handleAutoScroll(t)},drop:function(){this.sortable.nativeDraggable?sc(document,"dragover",this._handleAutoScroll):(sc(document,"pointermove",this._handleFallbackAutoScroll),sc(document,"touchmove",this._handleFallbackAutoScroll),sc(document,"mousemove",this._handleFallbackAutoScroll)),Gu(),zu
2(),clearTimeout(uc),uc=void 0},nulling:function(){Uu=Lu=xu=Vu=ju=Bu=Fu=null,Hu.length=0},_handleFallbackAutoScroll:function(e){this._handleAutoScroll(e,!0)},_handleAutoScroll:function(e,t){var n=this,r=(e.touches?e.touches[0]:e).clientX,i=(e.touches?e.touches[0]:e).clientY,o=document.elementFromPoint(r,i);if(Uu=e,t||this.options.forceAutoScrollFallback||Jl||Kl||tc){Wu(e,this.options,o,t);var s=bc(o,!0);!Vu||ju&&r===Bu&&i===Fu||(ju&&Gu(),ju=setInterval(function(){var o=bc(document.elementFromPoint(r,i),!0);o!==s&&(s=o,zu()),Wu(e,n.options,o,t)},10),Bu=r,Fu=i)}else{if(!this.options.bubbleScroll||bc(o,!0)===mc())return void zu();Wu(e,this.options,bc(o,!1),!1)}}},Xl(e,{pluginName:"scroll",initializeByDefault:!0})}),Du.mount($u,Xu);function qu(e){return qu="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},qu(e)}function Zu(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Qu(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Zu(Object(n),!0).forEach(function(t){Ku(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Zu(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Ku(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=qu(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=qu(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==qu(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Ju=document.querySelector("meta[name='csrf-token']").getAttribute("content"),eh={mounted:function(){this.handleEvent("root.console_log",function(e){return console.log(e.msg,e.data)}),this.handleEvent("root.console_error",function(e){return console.error(e.msg,e.data)})}},th={mounted:function(){console.log("mounted - the element has been added to the DOM and its server LiveView has finished mounting",this.id,this)},beforeUpdate:function(){console.log("beforeUpdate - the element is about to be updated in the DOM. Note: any call here must be synchronous as the operation cannot be deferred or cancelled.",this.id,this)},updated:function(){console.log("updated - the element has been updated in the DOM by the server",this.id,this)},destroyed:function(){console.log("destroyed - the element has been removed from the page, either by a parent update, or by the parent being removed entirely",this.id,this)},disconnected:function(){console.log("disconnected - the elements parent LiveView has disconnected from the server",this.id,this)},reconnected:function(){console.log("reconnected - the elements parent LiveView has reconnected to the server",this.id,this)}},nh={mounted:function(){window.PhxContext=this,document.documentElement.classList.contains("kiosk")&&!window.__kioskAutoReloadTimer&&(window.__kioskAutoReloadTimer=window.setTimeout(function(){window.location.reload()},9e5)),this.handleEvent("reload_page",function(){window.location.reload()})}},rh={mounted:function(){var e=this;this.tapCount=0,this.lastTapAt=0,this.tapTimer=null,this.startPoint=null,this.maxDelay=Number(this.el.dataset.tapDelay||360),this.moveTolerance=Number(this.el.dataset.tapMoveTolerance||18),this.eventName=this.el.dataset.quadTapEvent||"toggle_extra_options",this.el.style.touchAction=this.el.style.touchAction||"manipulation",this.onPointerDown=function(t){e.startPoint={x:t.clientX,y:t.clientY}},this.onPointerUp=function(t){if(e.startPoint){var n=Math.abs(t.clientX-e.startPoint.x),r=Math.abs(t.clientY-e.startPoint.y);if(e.startPoint=null,n>e.moveTolerance||r>e.moveTolerance)e.resetTapCount();else{var i=Date.now();if(i-e.lastTapAt>e.maxDelay&&(e.tapCount=0),e.tapCount+=1,e.lastTapAt=i,clearTimeout(e.tapTimer),e.tapCount>=4)return t.preventDefault(),e.resetTapCount(),void e.pushEvent(e.eventName,{});e.tapTimer=setTimeout(function(){return e.resetTapCount()},e.maxDelay)}}},this.onPointerCancel=function(){return e.resetTapCount()},this.el.addEventListener("pointerdown",this.onPointerDown),this.el.addEventListener("pointerup",this.onPointerUp),this.el.addEventListener("pointercancel",this.onPointerCancel)},resetTapCount:function(){this.tapCount=0,this.lastTapAt=0,this.startPoint=null,clearTimeout(this.tapTimer),this.tapTimer=null},destroyed:function(){clearTimeout(this.tapTimer),this.el.removeEventListener("pointerdown",this.onPointerDown),this.el.removeEventListener("pointerup",this.onPointerUp),this.el.removeEventListener("pointercancel",this.onPointerCancel)}};window.Alpine=Kn;var ih={GlightboxComponent:fl,SwiperComponent:rl,VideojsComponent:_l,MaplibreC
2omponent:Wl};Kn.data("loadComponent",function(e,t){return ih["".concat(e,"Component")](t)}),Kn.plugin(nr),Kn.plugin(dr),Kn.start(),window.Hooks={PhxContextHook:nh,QuadTapToggle:rh,RootHook:eh,SwiperHook:Ar,GsapHook:Or,PreventEnterSubmitHook:Rr,Flip:so,ClickToComponent:{mounted(){this.menu=(e=>{const t=document.createElement("div");return Object.assign(t.style,{display:"none",position:"fixed",top:"0px",left:"0px",zIndex:999999999,background:"white",border:"1px solid #e4e4e7",borderRadius:"8px",padding:"8px 0px"}),{mount(){document.body.appendChild(t),document.addEventListener("click",e=>{t.contains(e.target)||(t.style.display="none")})},render(n,r){t.innerHTML="",t.style.top=`${n.clientY}px`,t.style.left=`${n.clientX}px`,t.style.display="block";for(const n of r){const r=document.createElement("div");Object.assign(r.style,{margin:"6px 0px",padding:"0px 12px",fontSize:"14px",cursor:"pointer"}),r.innerText=n.component,r.onclick=()=>e(n),t.appendChild(r)}}}})(this.onMenuClick.bind(this)),this.menu.mount(),document.addEventListener("click",this.onClick.bind(this))},onClick(e){if(e.altKey){e.preventDefault(),e.stopPropagation();const t=(e=>{const t=[],n=[];for(;;){let r=e.previousSibling;for(;null!==r;){if(r.nodeType===document.COMMENT_NODE){const e=ao(r.nodeValue);e.closing?n.unshift(e):n[0]?.component===e.component?n.shift():t.push(e)}r=r.previousSibling}if(null==e.parentElement)break;e=e.parentElement}return t})(e.target);this.menu.render(e,t)}},onMenuClick(e){this.pushEventTo(this.el,"click_to_component:open",{path:e.path})}},MountdebugHook:th,StripeCheckoutHook:xr,QrScannerHook:oo},void 0!==window.LocalHooks&&(window.Hooks=Qu(Qu({},window.Hooks),window.LocalHooks)),Bo().config({barColors:{0:"#29d"},shadowColor:"rgba(0, 0, 0, .3)"});var oh=new class{constructor(e,t,n={}){if(this.unloaded=!1,!t||"Object"===t.constructor.name)throw new Error('\n a phoenix Socket must be provided as the second argument to the LiveSocket constructor. For example:\n\n import {Socket} from "phoenix"\n import {LiveSocket} from "phoenix_live_view"\n let liveSocket = new LiveSocket("/live", Socket, {...})\n ');this.socket=new t(e,n),this.bindingPrefix=n.bindingPrefix||"phx-",this.opts=n,this.params=Zs(n.params||{}),this.viewLogger=n.viewLogger,this.metadataCallbacks=n.metadata||{},this.defaults=Object.assign(Qs(Fs),n.defaults||{}),this.activeElement=null,this.prevActive=null,this.silenced=!1,this.main=null,this.outgoingMainEl=null,this.clickStartedAtTarget=null,this.linkRef=1,this.roots={},this.href=window.location.href,this.pendingLink=null,this.currentLocation=Qs(window.location),this.hooks=n.hooks||{},this.uploaders=n.uploaders||{},this.loaderTimeout=n.loaderTimeout||1,this.disconnectedTimeout=n.disconnectedTimeout||500,this.reloadWithJitterTimer=null,this.maxReloads=n.maxReloads||10,this.reloadJitterMin=n.reloadJitterMin||5e3,this.reloadJitterMax=n.reloadJitterMax||1e4,this.failsafeJitter=n.failsafeJitter||3e4,this.localStorage=n.localStorage||window.localStorage,this.sessionStorage=n.sessionStorage||window.sessionStorage,this.boundTopLevelEvents=!1,this.boundEventNames=new Set,this.serverCloseRef=null,this.domCallbacks=Object.assign({jsQuerySelectorAll:null,onPatchStart:Zs(),onPatchEnd:Zs(),onNodeAdded:Zs(),onBeforeElUpdated:Zs()},n.dom||{}),this.transitions=new Ya,this.currentHistoryPosition=parseInt(this.sessionStorage.getItem(Ms))||0,window.addEventListener("pagehide",e=>{this.unloaded=!0}),this.socket.onOpen(()=>{this.isUnloaded()&&window.location.reload()})}version(){return"1.0.18"}isProfileEnabled(){return"true"===this.sessionStorage.getItem(Os)}isDebugEnabled(){return"true"===this.sessionStorage.getItem(Ns)}isDebugDisabled(){return"false"===this.sessionStorage.getItem(Ns)}enableDebug(){this.sessionStorage.setItem(Ns,"true")}enableProfiling(){this.sessionStorage.setItem(Os,"true")}disableDebug(){this.sessionStorage.setItem(Ns,"false")}disableProfiling(){this.sessionStorage.removeItem(Os)}enableLatencySim(e){this.enableDebug(),console.log("latency simulator enabled for the duration of this browser session. Call disableLatencySim() to disable"),this.sessionStorage.setItem(Rs,e)}disableLatencySim(){this.sessionStorage.removeItem(Rs)}getLatencySim(){let e=this.sessionStorage.getItem(Rs);return e?parseInt(e):null}getSocket(){return this.socket}connect(){"localhost"!==window.location.hostname||this.isDebugDisabled()||this.enableDebug();let e=()=>{this.resetReloadStatus(),this.joinRootViews()?(this.bindTopLevelEvents(),this.socket.connect()):this.main?this.socket.connect():this.bindTopLevelEvents({dead:!0}),this.joinDeadView()};["complete","loaded","interactive"].indexOf(document.readyState)>=0?e():document.addEventListener("DOMContentLoaded",()=>e())}disconnect(e){clearTimeout(this.reloadWithJitterTimer),this.serverCloseRef&&(this.socket.off(this.serverCloseRef),this.serverCloseRef=null),this.socket.disconnect(e)}replaceTransport(e){clearTimeout(this.reloadWithJitterTimer),this.socket.replaceTransport(e),this.connect()}execJS(e,t,n=null){let r=new CustomEvent("phx:exec",{detail:{sourceElement:e}});this.owner(e,i=>Ua.exec(r,n,t,i,e))}execJSHookPush(e,t,n,r){this.withinOwners(e,i=>{let o=new CustomEvent("phx:exec",{detail:{sourceElement:e}});Ua.exec(o,"hook",t,i,e,["push",{data:n,callback:r}])})}unload(){this.unloaded||(this.main&&this.isConnected()&&this.log(this.main,"socket",()=>["disconnect for page nav"]),this.unloaded=!0,this.destroyAllViews(),this.disconnect())}triggerDOM(e,t){this.domCallbacks[e](...t)}time(e,t){if(!this.isProfileEnabled()||!console.time)return t();console.time(e);let n=t();return console.timeEnd(e),n}log(e,t,n){if(this.viewLogger){let[r,i]=n();
2this.viewLogger(e,t,r,i)}else if(this.isDebugEnabled()){let[r,i]=n();((e,t,n,r)=>{e.liveSocket.isDebugEnabled()&&console.log(`${e.id} ${t}: ${n} - `,r)})(e,t,r,i)}}requestDOMUpdate(e){this.transitions.after(e)}transition(e,t,n=function(){}){this.transitions.addTransition(e,t,n)}onChannel(e,t,n){e.on(t,e=>{let t=this.getLatencySim();t?setTimeout(()=>n(e),t):n(e)})}reloadWithJitter(e,t){clearTimeout(this.reloadWithJitterTimer),this.disconnect();let n=this.reloadJitterMin,r=this.reloadJitterMax,i=Math.floor(Math.random()*(r-n+1))+n,o=ia.updateLocal(this.localStorage,window.location.pathname,Fo,0,e=>e+1);o>=this.maxReloads&&(i=this.failsafeJitter),this.reloadWithJitterTimer=setTimeout(()=>{e.isDestroyed()||e.isConnected()||(e.destroy(),t?t():this.log(e,"join",()=>[`encountered ${o} consecutive reloads`]),o>=this.maxReloads&&this.log(e,"join",()=>[`exceeded ${this.maxReloads} consecutive reloads. Entering failsafe mode`]),this.hasPendingLink()?window.location=this.pendingLink:window.location.reload())},i)}getHookCallbacks(e){return e&&e.startsWith("Phoenix.")?ya[e.split(".")[1]]:this.hooks[e]}isUnloaded(){return this.unloaded}isConnected(){return this.socket.isConnected()}getBindingPrefix(){return this.bindingPrefix}binding(e){return`${this.getBindingPrefix()}${e}`}channel(e,t){return this.socket.channel(e,t)}joinDeadView(){let e=document.body;if(e&&!this.isPhxView(e)&&!this.isPhxView(document.firstElementChild)){let t=this.newRootView(e);t.setHref(this.getHref()),t.joinDead(),this.main||(this.main=t),window.requestAnimationFrame(()=>{t.execNewMounted(),this.maybeScroll(history.state?.scroll)})}}joinRootViews(){let e=!1;return sa.all(document,`${ms}:not([${ss}])`,t=>{if(!this.getRootById(t.id)){let e=this.newRootView(t);sa.isPhxSticky(t)||e.setHref(this.getHref()),e.join(),t.hasAttribute(as)&&(this.main=e)}e=!0}),e}redirect(e,t,n){n&&ia.setCookie(ks,n,60),this.unload(),ia.redirect(e,t)}replaceMain(e,t,n=null,r=this.setPendingLink(e)){const i=this.currentLocation.href;this.outgoingMainEl=this.outgoingMainEl||this.main.el;const o=sa.findPhxSticky(document)||[],s=sa.all(this.outgoingMainEl,`[${this.binding("remove")}]`).filter(e=>!sa.isChildOfAny(e,o)),a=sa.cloneNode(this.outgoingMainEl,"");this.main.showLoader(this.loaderTimeout),this.main.destroy(),this.main=this.newRootView(a,t,i),this.main.setRedirect(e),this.transitionRemoves(s),this.main.join((e,t)=>{1===e&&this.commitPendingLink(r)&&this.requestDOMUpdate(()=>{s.forEach(e=>e.remove()),o.forEach(e=>a.appendChild(e)),this.outgoingMainEl.replaceWith(a),this.outgoingMainEl=null,n&&n(r),t()})})}transitionRemoves(e,t){let n=this.binding("remove"),r=e=>{e.preventDefault(),e.stopImmediatePropagation()};e.forEach(e=>{for(let t of this.boundEventNames)e.addEventListener(t,r,!0);this.execJS(e,e.getAttribute(n),"remove")}),this.requestDOMUpdate(()=>{e.forEach(e=>{for(let t of this.boundEventNames)e.removeEventListener(t,r,!0)}),t&&t()})}isPhxView(e){return e.getAttribute&&null!==e.getAttribute(gs)}newRootView(e,t,n){let r=new Wa(e,this,null,t,n);return this.roots[r.id]=r,r}owner(e,t){let n;const r=e.closest(ms);return n=r?this.getViewByEl(r):this.main,n&&t?t(n):n}withinOwners(e,t){this.owner(e,n=>t(n,e))}getViewByEl(e){let t=e.getAttribute(ls);return ta(this.getRootById(t),t=>t.getDescendentByEl(e))}getRootById(e){return this.roots[e]}destroyAllViews(){for(let e in this.roots)this.roots[e].destroy(),delete this.roots[e];this.main=null}destroyViewByEl(e){let t=this.getRootById(e.getAttribute(ls));t&&t.id===e.id?(t.destroy(),delete this.roots[t.id]):t&&t.destroyDescendent(e.id)}getActiveElement(){return document.activeElement}dropActiveElement(e){this.prevActive&&e.ownsElement(this.prevActive)&&(this.prevActive=null)}restorePreviouslyActiveFocus(){this.prevActive&&this.prevActive!==document.body&&this.prevActive.focus()}blurActiveElement(){this.prevActive=this.getActiveElement(),this.prevActive!==document.body&&this.prevActive.blur()}bindTopLevelEvents({dead:e}={}){this.boundTopLevelEvents||(this.boundTopLevelEvents=!0,this.serverCloseRef=this.socket.onClose(e=>{if(e&&1e3===e.code&&this.main)return this.reloadWithJitter(this.main)}),document.body.addEventListener("click",function(){}),window.addEventListener("pageshow",e=>{e.persisted&&(this.getSocket().disconnect(),this.withPageLoading({to:window.location.href,kind:"redirect"}),window.location.reload())},!0),e||this.bindNav(),this.bindClicks(),e||this.bindForms(),this.bind({keyup:"keyup",keydown:"keydown"},(e,t,n,r,i,o)=>{let s=r.getAttribute(this.binding("key")),a=e.key&&e.key.toLowerCase();if(s&&s.toLowerCase()!==a)return;let l={key:e.key,...this.eventMeta(t,e,r)};Ua.exec(e,t,i,n,r,["push",{data:l}])}
2),this.bind({blur:"focusout",focus:"focusin"},(e,t,n,r,i,o)=>{if(!o){let o={key:e.key,...this.eventMeta(t,e,r)};Ua.exec(e,t,i,n,r,["push",{data:o}])}}),this.bind({blur:"blur",focus:"focus"},(e,t,n,r,i,o)=>{if("window"===o){let o=this.eventMeta(t,e,r);Ua.exec(e,t,i,n,r,["push",{data:o}])}}),this.on("dragover",e=>e.preventDefault()),this.on("drop",e=>{e.preventDefault();let t=ta(Ks(e.target,this.binding(qo)),e=>e.getAttribute(this.binding(qo))),n=t&&document.getElementById(t),r=Array.from(e.dataTransfer.files||[]);n&&!n.disabled&&0!==r.length&&n.files instanceof FileList&&(ca.trackFiles(n,r,e.dataTransfer),n.dispatchEvent(new Event("input",{bubbles:!0})))}),this.on(Yo,e=>{let t=e.target;if(!sa.isUploadInput(t))return;let n=Array.from(e.detail.files||[]).filter(e=>e instanceof File||e instanceof Blob);ca.trackFiles(t,n),t.dispatchEvent(new Event("input",{bubbles:!0}))}))}eventMeta(e,t,n){let r=this.metadataCallbacks[e];return r?r(t,n):{}}setPendingLink(e){return this.linkRef++,this.pendingLink=e,this.resetReloadStatus(),this.linkRef}resetReloadStatus(){ia.deleteCookie(ks)}commitPendingLink(e){return this.linkRef===e&&(this.href=this.pendingLink,this.pendingLink=null,!0)}getHref(){return this.href}hasPendingLink(){return!!this.pendingLink}bind(e,t){for(let n in e){let r=e[n];this.on(r,e=>{let i=this.binding(n),o=this.binding(`window-${n}`),s=e.target.getAttribute&&e.target.getAttribute(i);s?this.debounce(e.target,e,r,()=>{this.withinOwners(e.target,r=>{t(e,n,r,e.target,s,null)})}):sa.all(document,`[${o}]`,i=>{let s=i.getAttribute(o);this.debounce(i,e,r,()=>{this.withinOwners(i,r=>{t(e,n,r,i,s,"window")})})})})}}bindClicks(){this.on("mousedown",e=>this.clickStartedAtTarget=e.target),this.bindClick("click","click")}bindClick(e,t){let n=this.binding(t);window.addEventListener(e,e=>{let t=null;0===e.detail&&(this.clickStartedAtTarget=e.target);let r=this.clickStartedAtTarget||e.target;t=Ks(e.target,n),this.dispatchClickAway(e,r),this.clickStartedAtTarget=null;let i=t&&t.getAttribute(n);i?("#"===t.getAttribute("href")&&e.preventDefault(),t.hasAttribute(zo)||this.debounce(t,e,"click",()=>{this.withinOwners(t,n=>{Ua.exec(e,"click",i,n,t,["push",{data:this.eventMeta("click",e,t)}])})})):sa.isNewPageClick(e,window.location)&&this.unload()},!1)}dispatchClickAway(e,t){let n=this.binding("click-away");sa.all(document,`[${n}]`,r=>{r.isSameNode(t)||r.contains(t)||this.withinOwners(r,t=>{let i=r.getAttribute(n);Ua.isVisible(r)&&Ua.isInViewport(r)&&Ua.exec(e,"click",i,t,r,["push",{data:this.eventMeta("click",e,e.target)}])})})}bindNav(){if(!ia.canPushState())return;history.scrollRestoration&&(history.scrollRestoration="manual");let e=null;window.addEventListener("scroll",t=>{clearTimeout(e),e=setTimeout(()=>{ia.updateCurrentState(e=>Object.assign(e,{scroll:window.scrollY}))},100)}),window.addEventListener("popstate",e=>{if(!this.registerNewLocation(window.location))return;let{type:t,backType:n,id:r,scroll:i,position:o}=e.state||{},s=window.location.href,a=o>this.currentHistoryPosition;t=a?t:n||t,this.currentHistoryPosition=o||0,this.sessionStorage.setItem(Ms,this.currentHistoryPosition.toString()),sa.dispatchEvent(window,"phx:navigate",{detail:{href:s,patch:"patch"===t,pop:!0,direction:a?"forward":"backward"}}),this.requestDOMUpdate(()=>{const n=()=>{this.maybeScroll(i)};this.main.isConnected()&&"patch"===t&&r===this.main.id?this.main.pushLinkPatch(e,s,null,n):this.replaceMain(s,null,n)})},!1),window.addEventListener("click",e=>{let t=Ks(e.target,Ho),n=t&&t.getAttribute(Ho);if(!n||!this.isConnected()||!this.main||sa.wantsNewTab(e))return;let r=t.href instanceof SVGAnimatedString?t.href.baseVal:t.href,i=t.getAttribute("data-phx-link-state");e.preventDefault(),e.stopImmediatePropagation(),this.pendingLink!==r&&this.requestDOMUpdate(()=>{if("patch"===n)this.pushHistoryPatch(e,r,i,t);else{if("redirect"!==n)throw new Error(`expected ${Ho} to be "patch" or "redirect", got: ${n}`);this.historyRedirect(e,r,i,null,t)}let o=t.getAttribute(this.binding("click"));o&&this.requestDOMUpdate(()=>this.execJS(t,o,"click"))})},!1)}maybeScroll(e){"number"==typeof e&&requestAnimationFrame(()=>{window.scrollTo(0,e)})}dispatchEvent(e,t={}){sa.dispatchEvent(window,`phx:${e}`,{detail:t})}dispatchEvents(e){e.forEach(([e,t])=>this.dispatchEvent(e,t))}withPageLoading(e,t){sa.dispatchEvent(window,"phx:page-loading-start",{detail:e});let n=()=>sa.dispatchEvent(window,"phx:page-loading-stop",{detail:e});return t?t(n):n}pushHistoryPatch(e,t,n,r){if(!this.isConnected()||!this.main.isMain())return ia.redirect(t);this.withPageLoading({to:t,kind:"patch"},i=>{this.main.pushLinkPatch(e,t,r,e=>{this.historyPatch(t,n,e),i()})})}historyPatch(e,t,n=this.setPendingLink(e)){this.commitPendingLink(n)&&(this.currentHistoryPosition++,this.sessionStorage.setItem(Ms,this.currentHistoryPosition.toString()),ia.updateCurrentState(e=>({...e,backType:"patch"})),ia.pushState(t,{type:"patch",id:this.main.id,position:this.currentHistoryPosition},e),sa.dispatchEvent(window,"phx:navigate",{detail:{patch:!0,href:e,pop:!1,direction:"forward"}}),this.registerNewLocation(window.location))}historyRedirect(e,t,n,r,i){const o=i&&e.isTrusted&&"popstate"!==e.type;if(o&&i.classList.add("phx-click-loading"),!this.isConnected()||!this.main.isMain())return ia.redirect(t,r);
2if(/^\/$|^\/[^\/]+.*$/.test(t)){let{protocol:e,host:n}=window.location;t=`${e}//${n}${t}`}let s=window.scrollY;this.withPageLoading({to:t,kind:"redirect"},e=>{this.replaceMain(t,r,r=>{r===this.linkRef&&(this.currentHistoryPosition++,this.sessionStorage.setItem(Ms,this.currentHistoryPosition.toString()),ia.updateCurrentState(e=>({...e,backType:"redirect"})),ia.pushState(n,{type:"redirect",id:this.main.id,scroll:s,position:this.currentHistoryPosition},t),sa.dispatchEvent(window,"phx:navigate",{detail:{href:t,patch:!1,pop:!1,direction:"forward"}}),this.registerNewLocation(window.location)),o&&i.classList.remove("phx-click-loading"),e()})})}registerNewLocation(e){let{pathname:t,search:n}=this.currentLocation;return t+n!==e.pathname+e.search&&(this.currentLocation=Qs(e),!0)}bindForms(){let e=0,t=!1;this.on("submit",e=>{let n=e.target.getAttribute(this.binding("submit")),r=e.target.getAttribute(this.binding("change"));t||!r||n||(t=!0,e.preventDefault(),this.withinOwners(e.target,t=>{t.disableForm(e.target),window.requestAnimationFrame(()=>{sa.isUnloadableFormSubmit(e)&&this.unload(),e.target.submit()})}))}),this.on("submit",e=>{let t=e.target.getAttribute(this.binding("submit"));t?(e.preventDefault(),e.target.disabled=!0,this.withinOwners(e.target,n=>{Ua.exec(e,"submit",t,n,e.target,["push",{submitter:e.submitter}])})):sa.isUnloadableFormSubmit(e)&&this.unload()});for(let t of["change","input"])this.on(t,n=>{if(n instanceof CustomEvent&&void 0===n.target.form){if(n.detail&&n.detail.dispatcher)throw new Error(`dispatching a custom ${t} event is only supported on input elements inside a form`);return}let r=this.binding("change"),i=n.target;if(n.isComposing){const e=`composition-listener-${t}`;return void(sa.private(i,e)||(sa.putPrivate(i,e,!0),i.addEventListener("compositionend",()=>{i.dispatchEvent(new Event(t,{bubbles:!0})),sa.deletePrivate(i,e)},{once:!0})))}let o=i.getAttribute(r),s=i.form&&i.form.getAttribute(r),a=o||s;if(!a)return;if("number"===i.type&&i.validity&&i.validity.badInput)return;let l=o?i:i.form,c=e;e++;let{at:u,type:h}=sa.private(i,"prev-iteration")||{};u===c-1&&"change"===t&&"input"===h||(sa.putPrivate(i,"prev-iteration",{at:c,type:t}),this.debounce(i,n,t,()=>{this.withinOwners(l,e=>{sa.putPrivate(i,hs,!0),Ua.exec(n,"change",a,e,i,["push",{_target:n.target.name,dispatcher:l}])})}))});this.on("reset",e=>{let t=e.target;sa.resetForm(t);let n=Array.from(t.elements).find(e=>"reset"===e.type);n&&window.requestAnimationFrame(()=>{n.dispatchEvent(new Event("input",{bubbles:!0,cancelable:!1}))})})}debounce(e,t,n,r){if("blur"===n||"focusout"===n)return r();let i=this.binding("debounce"),o=this.binding("throttle"),s=this.defaults.debounce.toString(),a=this.defaults.throttle.toString();this.withinOwners(e,n=>{sa.debounce(e,t,i,s,o,a,()=>!n.isDestroyed()&&document.body.contains(e),()=>{r()})})}silenceEvents(e){this.silenced=!0,e(),this.silenced=!1}on(e,t){this.boundEventNames.add(e),window.addEventListener(e,e=>{this.silenced||t(e)})}jsQuerySelectorAll(e,t,n){let r=this.domCallbacks.jsQuerySelectorAll;return r?r(e,t,n):n()}}("/live",class{constructor(e,t={}){this.stateChangeCallbacks={open:[],close:[],error:[],message:[]},this.channels=[],this.sendBuffer=[],this.ref=0,this.timeout=t.timeout||1e4,this.transport=t.transport||ho.WebSocket||ko,this.primaryPassedHealthCheck=!1,this.longPollFallbackMs=t.longPollFallbackMs,this.fallbackTimer=null,this.sessionStore=t.sessionStorage||ho&&ho.sessionStorage,this.establishedConnections=0,this.defaultEncoder=xo.encode.bind(xo),this.defaultDecoder=xo.decode.bind(xo),this.closeWasClean=!1,this.disconnecting=!1,this.binaryType=t.binaryType||"arraybuffer",this.connectClock=1,this.transport!==ko?(this.encode=t.encode||this.defaultEncoder,this.decode=t.decode||this.defaultDecoder):(this.encode=this.defaultEncoder,this.decode=this.defaultDecoder);let n=null;uo&&uo.addEventListener&&(uo.addEventListener("pagehide",e=>{this.conn&&(this.disconnect(),n=this.connectClock)}),uo.addEventListener("pageshow",e=>{n===this.connectClock&&(n=null,this.connect())})),this.heartbeatIntervalMs=t.heartbeatIntervalMs||3e4,this.rejoinAfterMs=e=>t.rejoinAfterMs?t.rejoinAfterMs(e):[1e3,2e3,5e3][e-1]||1e4,this.reconnectAfterMs=e=>t.reconnectAfterMs?t.reconnectAfterMs(e):[10,50,100,150,200,250,500,1e3,2e3][e-1]||5e3,this.logger=t.logger||null,!this.logger&&t.debug&&(this.logger=(e,t,n)=>{console.log(`${e}: ${t}`,n)}),this.longpollerTimeout=t.longpollerTimeout||2e4,this.params=lo(t.params||{}),this.endPoint=`${e}/${Do}`,this.vsn=t.vsn||"2.0.0",this.heartbeatTimeoutTimer=null,this.heartbeatTimer=null,this.pendingHeartbeatRef=null,this.reconnectTimer=new Ro(()=>{this.teardown(()=>this.connect())},this.reconnectAfterMs)}getLongPollTransport(){return ko}replaceTransport(e){this.connectClock++,this.closeWasClean=!0,clearTimeout(this.fallbackTimer),this.reconnectTimer.reset(),this.conn&&(this.conn.
2close(),this.conn=null),this.transport=e}protocol(){return location.protocol.match(/^https/)?"wss":"ws"}endPointURL(){let e=Po.appendParams(Po.appendParams(this.endPoint,this.params()),{vsn:this.vsn});return"/"!==e.charAt(0)?e:"/"===e.charAt(1)?`${this.protocol()}:${e}`:`${this.protocol()}://${location.host}${e}`}disconnect(e,t,n){this.connectClock++,this.disconnecting=!0,this.closeWasClean=!0,clearTimeout(this.fallbackTimer),this.reconnectTimer.reset(),this.teardown(()=>{this.disconnecting=!1,e&&e()},t,n)}connect(e){e&&(console&&console.log("passing params to connect is deprecated. Instead pass :params to the Socket constructor"),this.params=lo(e)),this.conn&&!this.disconnecting||(this.longPollFallbackMs&&this.transport!==ko?this.connectWithFallback(ko,this.longPollFallbackMs):this.transportConnect())}log(e,t,n){this.logger&&this.logger(e,t,n)}hasLogger(){return null!==this.logger}onOpen(e){let t=this.makeRef();return this.stateChangeCallbacks.open.push([t,e]),t}onClose(e){let t=this.makeRef();return this.stateChangeCallbacks.close.push([t,e]),t}onError(e){let t=this.makeRef();return this.stateChangeCallbacks.error.push([t,e]),t}onMessage(e){let t=this.makeRef();return this.stateChangeCallbacks.message.push([t,e]),t}ping(e){if(!this.isConnected())return!1;let t=this.makeRef(),n=Date.now();this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:t});let r=this.onMessage(i=>{i.ref===t&&(this.off([r]),e(Date.now()-n))});return!0}transportConnect(){this.connectClock++,this.closeWasClean=!1,this.conn=new this.transport(this.endPointURL()),this.conn.binaryType=this.binaryType,this.conn.timeout=this.longpollerTimeout,this.conn.onopen=()=>this.onConnOpen(),this.conn.onerror=e=>this.onConnError(e),this.conn.onmessage=e=>this.onConnMessage(e),this.conn.onclose=e=>this.onConnClose(e)}getSession(e){return this.sessionStore&&this.sessionStore.getItem(e)}storeSession(e,t){this.sessionStore&&this.sessionStore.setItem(e,t)}connectWithFallback(e,t=2500){clearTimeout(this.fallbackTimer);let n,r=!1,i=!0,o=t=>{this.log("transport",`falling back to ${e.name}...`,t),this.off([void 0,n]),i=!1,this.replaceTransport(e),this.transportConnect()};if(this.getSession(`phx:fallback:${e.name}`))return o("memorized");this.fallbackTimer=setTimeout(o,t),n=this.onError(e=>{this.log("transport","error",e),i&&!r&&(clearTimeout(this.fallbackTimer),o(e))}),this.onOpen(()=>{if(r=!0,!i)return this.primaryPassedHealthCheck||this.storeSession(`phx:fallback:${e.name}`,"true"),this.log("transport",`established ${e.name} fallback`);clearTimeout(this.fallbackTimer),this.fallbackTimer=setTimeout(o,t),this.ping(e=>{this.log("transport","connected to primary after",e),this.primaryPassedHealthCheck=!0,clearTimeout(this.fallbackTimer)})}),this.transportConnect()}clearHeartbeats(){clearTimeout(this.heartbeatTimer),clearTimeout(this.heartbeatTimeoutTimer)}onConnOpen(){this.hasLogger()&&this.log("transport",`${this.transport.name} connected to ${this.endPointURL()}`),this.closeWasClean=!1,this.disconnecting=!1,this.establishedConnections++,this.flushSendBuffer(),this.reconnectTimer.reset(),this.resetHeartbeat(),this.stateChangeCallbacks.open.forEach(([,e])=>e())}heartbeatTimeout(){this.pendingHeartbeatRef&&(this.pendingHeartbeatRef=null,this.hasLogger()&&this.log("transport","heartbeat timeout. Attempting to re-establish connection"),this.triggerChanError(),this.closeWasClean=!1,this.teardown(()=>this.reconnectTimer.scheduleTimeout(),1e3,"heartbeat timeout"))}resetHeartbeat(){this.conn&&this.conn.skipHeartbeat||(this.pendingHeartbeatRef=null,this.clearHeartbeats(),this.heartbeatTimer=setTimeout(()=>this.sendHeartbeat(),this.heartbeatIntervalMs))}teardown(e,t,n){if(!this.conn)return e&&e();let r=this.connectClock;this.waitForBufferDone(()=>{r===this.connectClock&&(this.conn&&(t?this.conn.close(t,n||""):this.conn.close()),this.waitForSocketClosed(()=>{r===this.connectClock&&(this.conn&&(this.conn.onopen=function(){},this.conn.onerror=function(){},this.conn.onmessage=function(){},this.conn.onclose=function(){},this.conn=null),e&&e())}))})}waitForBufferDone(e,t=1){5!==t&&this.conn&&this.conn.bufferedAmount?setTimeout(()=>{this.waitForBufferDone(e,t+1)},150*t):e()}waitForSocketClosed(e,t=1){5!==t&&this.conn&&this.conn.readyState!==mo?setTimeout(()=>{this.waitForSocketClosed(e,t+1)},150*t):e()}onConnClose(e){let t=e&&e.code;this.hasLogger()&&this.log("transport","close",e),this.triggerChanError(),this.clearHeartbeats(),this.closeWasClean||1e3===t||this.reconnectTimer.scheduleTimeout(),this.stateChangeCallbacks.close.forEach(([,t])=>t(e))}onConnError(e){this.hasLogger()&&this.log("transport",e);let t=this.transport,n=this.establishedConnections;this.stateChangeCallbacks.error.forEach(([,r])=>{r(e,t,n)}),(t===this.transport||n>0)&&this.triggerChanError()}
2triggerChanError(){this.channels.forEach(e=>{e.isErrored()||e.isLeaving()||e.isClosed()||e.trigger(bo)})}connectionState(){switch(this.conn&&this.conn.readyState){case fo:return"connecting";case po:return"open";case go:return"closing";default:return"closed"}}isConnected(){return"open"===this.connectionState()}remove(e){this.off(e.stateChangeRefs),this.channels=this.channels.filter(t=>t!==e)}off(e){for(let t in this.stateChangeCallbacks)this.stateChangeCallbacks[t]=this.stateChangeCallbacks[t].filter(([t])=>-1===e.indexOf(t))}channel(e,t={}){let n=new Mo(e,t,this);return this.channels.push(n),n}push(e){if(this.hasLogger()){let{topic:t,event:n,payload:r,ref:i,join_ref:o}=e;this.log("push",`${t} ${n} (${o}, ${i})`,r)}this.isConnected()?this.encode(e,e=>this.conn.send(e)):this.sendBuffer.push(()=>this.encode(e,e=>this.conn.send(e)))}makeRef(){let e=this.ref+1;return e===this.ref?this.ref=0:this.ref=e,this.ref.toString()}sendHeartbeat(){this.pendingHeartbeatRef&&!this.isConnected()||(this.pendingHeartbeatRef=this.makeRef(),this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:this.pendingHeartbeatRef}),this.heartbeatTimeoutTimer=setTimeout(()=>this.heartbeatTimeout(),this.heartbeatIntervalMs))}flushSendBuffer(){this.isConnected()&&this.sendBuffer.length>0&&(this.sendBuffer.forEach(e=>e()),this.sendBuffer=[])}onConnMessage(e){this.decode(e.data,e=>{let{topic:t,event:n,payload:r,ref:i,join_ref:o}=e;i&&i===this.pendingHeartbeatRef&&(this.clearHeartbeats(),this.pendingHeartbeatRef=null,this.heartbeatTimer=setTimeout(()=>this.sendHeartbeat(),this.heartbeatIntervalMs)),this.hasLogger()&&this.log("receive",`${r.status||""} ${t} ${n} ${i&&"("+i+")"||""}`,r);for(let e=0;e<this.channels.length;e++){const s=this.channels[e];s.isMember(t,n,r,o)&&s.trigger(n,r,i,o)}for(let t=0;t<this.stateChangeCallbacks.message.length;t++){let[,n]=this.stateChangeCallbacks.message[t];n(e)}})}leaveOpenTopic(e){let t=this.channels.find(t=>t.topic===e&&(t.isJoined()||t.isJoining()));t&&(this.hasLogger()&&this.log("transport",`leaving duplicate topic "${e}"`),t.leave())}},{dom:{onNodeAdded:function(e){e instanceof Element&&e.hasAttribute("phx-update")&&"ignore"===e.getAttribute("phx-update")&&(console.log("--reinit alpinejs on node",e),window.Alpine.initTree(e))},onBeforeElUpdated:function(e,t){if(e.isEqualNode(t))return!1;e._x_dataStack&&(e.hasAttribute("x-no-clone")||window.Alpine.clone(e,t))}},params:{_csrf_token:Ju},hooks:window.Hooks});window.addEventListener("phx:page-loading-start",function(e){return Bo().show(300)}),window.addEventListener("phx:page-loading-stop",function(e){return Bo().hide()}),window.addEventListener("phx:live_reload:attached",function(e){var t,n=e.detail;console.log("attach phx:live_reload"),n.enableServerLogs(),console.log("addd c/d keyboard listeners"),window.addEventListener("keydown",function(e){return t=e.key}),window.addEventListener("keyup",function(e){return t=null}),window.addEventListener("click",function(e){"c"===t?(console.log("c â openEditorAtCaller",n),e.preventDefault(),e.stopImmediatePropagation(),n.openEditorAtCaller(e.target)):"d"===t&&(e.preventDefault(),e.stopImmediatePropagation(),n.openEditorAtDef(e.target))},!0),window.liveReloader=n}),window.addEventListener("phx:js-exec",function(e){var t=e.detail;document.querySelectorAll(t.to).forEach(function(e){oh.execJS(e,e.getAttribute(t.attr))})}),window.addEventListener("phoenix.link.click",function(e){"top"==e.target.getAttribute("data-scroll")&&window.scrollTo(0,0)},!1),oh.connect(),console.log(" liveSocket connected",oh),window.liveSocket=oh})()})();
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.