From 5e703010967633945c1317d1fb0e9a6f80bed1ee Mon Sep 17 00:00:00 2001 From: dssq Date: Sun, 19 May 2024 18:01:51 +0800 Subject: [PATCH] Updates --- assets/{index-B_LX_ngC.js => index-BVBH4oGe.js} | 2 +- index.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) rename assets/{index-B_LX_ngC.js => index-BVBH4oGe.js} (96%) diff --git a/assets/index-B_LX_ngC.js b/assets/index-BVBH4oGe.js similarity index 96% rename from assets/index-B_LX_ngC.js rename to assets/index-BVBH4oGe.js index e5a65ed..8083189 100644 --- a/assets/index-B_LX_ngC.js +++ b/assets/index-BVBH4oGe.js @@ -63,7 +63,7 @@ __p += '`),D0&&(H+=`' + function print() { __p += __j.call(arguments, '') } `:`; `)+H+`return __p -}`;var d0=Xc(function(){return g0(A,t0+"return "+H).apply(t,y)});if(d0.source=H,Ou(d0))throw d0;return d0}function j2(n){return m0(n).toLowerCase()}function G2(n){return m0(n).toUpperCase()}function V2(n,r,l){if(n=m0(n),n&&(l||r===t))return r8(n);if(!n||!(r=Ne(r)))return n;var a=ux(n),f=ux(r),A=o8(a,f),y=i8(a,f)+1;return nt(a,A,y).join("")}function Q2(n,r,l){if(n=m0(n),n&&(l||r===t))return n.slice(0,u8(n)+1);if(!n||!(r=Ne(r)))return n;var a=ux(n),f=i8(a,ux(r))+1;return nt(a,0,f).join("")}function K2(n,r,l){if(n=m0(n),n&&(l||r===t))return n.replace(Ol,"");if(!n||!(r=Ne(r)))return n;var a=ux(n),f=o8(a,ux(r));return nt(a,f).join("")}function Y2(n,r){var l=$,a=K;if(R0(r)){var f="separator"in r?r.separator:f;l="length"in r?f0(r.length):l,a="omission"in r?Ne(r.omission):a}n=m0(n);var A=n.length;if(tn(n)){var y=ux(n);A=y.length}if(l>=A)return n;var S=l-nn(a);if(S<1)return a;var T=y?nt(y,0,S).join(""):n.slice(0,S);if(f===t)return T+a;if(y&&(S+=T.length-S),zu(f)){if(n.slice(S).search(f)){var U,W=T;for(f.global||(f=eu(f.source,m0(ya.exec(f))+"g")),f.lastIndex=0;U=f.exec(W);)var H=U.index;T=T.slice(0,H===t?S:H)}}else if(n.indexOf(Ne(f),S)!=S){var Y=T.lastIndexOf(f);Y>-1&&(T=T.slice(0,Y))}return T+a}function X2(n){return n=m0(n),n&&id.test(n)?n.replace(ma,v5):n}var Z2=cn(function(n,r,l){return n+(l?" ":"")+r.toUpperCase()}),$u=Z8("toUpperCase");function Yc(n,r,l){return n=m0(n),r=l?t:r,r===t?D5(n)?k5(n):a5(n):n.match(r)||[]}var Xc=B0(function(n,r){try{return Te(n,t,r)}catch(l){return Ou(l)?l:new s0(l)}}),J2=Tx(function(n,r){return Ye(r,function(l){l=gx(l),Mx(n,l,Nu(n[l],n))}),n});function b2(n){var r=n==null?0:n.length,l=o0();return n=r?I0(n,function(a){if(typeof a[1]!="function")throw new Xe(s);return[l(a[0]),a[1]]}):[],B0(function(a){for(var f=-1;++fj)return[];var l=Q,a=se(n,Q);r=o0(r),n-=Q;for(var f=Jl(a,r);++l0||r<0)?new F0(l):(n<0?l=l.takeRight(-n):n&&(l=l.drop(n)),r!==t&&(r=f0(r),l=r<0?l.dropRight(-r):l.take(r-n)),l)},F0.prototype.takeRightWhile=function(n){return this.reverse().takeWhile(n).reverse()},F0.prototype.toArray=function(){return this.take(Q)},hx(F0.prototype,function(n,r){var l=/^(?:filter|find|map|reject)|While$/.test(r),a=/^(?:head|last)$/.test(r),f=B[a?"take"+(r=="last"?"Right":""):r],A=a||/^find/.test(r);f&&(B.prototype[r]=function(){var y=this.__wrapped__,S=a?[1]:arguments,T=y instanceof F0,U=S[0],W=T||c0(y),H=function(C0){var D0=f.apply(B,Jx([C0],S));return a&&Y?D0[0]:D0};W&&l&&typeof U=="function"&&U.length!=1&&(T=W=!1);var Y=this.__chain__,t0=!!this.__actions__.length,i0=A&&!Y,d0=T&&!t0;if(!A&&W){y=d0?y:new F0(this);var l0=n.apply(y,S);return l0.__actions__.push({func:Vo,args:[H],thisArg:t}),new Ze(l0,Y)}return i0&&d0?n.apply(this,S):(l0=this.thru(H),i0?a?l0.value()[0]:l0.value():l0)})}),Ye(["pop","push","shift","sort","splice","unshift"],function(n){var r=Ao[n],l=/^(?:push|sort|unshift)$/.test(n)?"tap":"thru",a=/^(?:pop|shift)$/.test(n);B.prototype[n]=function(){var f=arguments;if(a&&!this.__chain__){var A=this.value();return r.apply(c0(A)?A:[],f)}return this[l](function(y){return r.apply(c0(y)?y:[],f)})}}),hx(F0.prototype,function(n,r){var l=B[r];if(l){var a=l.name+"";v0.call(un,a)||(un[a]=[]),un[a].push({name:r,func:l})}}),un[zo(t,p).name]=[{name:"wrapper",func:t}],F0.prototype.clone=X5,F0.prototype.reverse=Z5,F0.prototype.value=J5,B.prototype.at=yC,B.prototype.chain=kC,B.prototype.commit=PC,B.prototype.next=_C,B.prototype.plant=MC,B.prototype.reverse=LC,B.prototype.toJSON=B.prototype.valueOf=B.prototype.value=TC,B.prototype.first=B.prototype.head,xr&&(B.prototype[xr]=SC),B},rn=P5();_t?((_t.exports=rn)._=rn,jl._=rn):te._=rn}).call(Cn)})(xl,xl.exports);var jx=xl.exports;const xo=Symbol();class Xn extends Error{}class aD extends Xn{constructor(t,o){super(`A length of ${t} was requested, but only ${o} chars are left in the payload`);Br(this,"lengthRequested");Br(this,"lengthAvailable");this.lengthRequested=t,this.lengthAvailable=o}}class uf extends Xn{constructor(t){super(`An invalid element+length indicator of ${t} was encountered`);Br(this,"element");this.element=t}}const cD={description:"Merchant account information",interpreter:e=>{const x=tl(ED,e),t=x.elements[0];if(t&&!(t instanceof Xn)&&t.elementID==="00"){const o=t.rawValue.toUpperCase();return o in sf?tl(sf[o],e):x}else return x}},ED={name:"Generic merchant account information",knownElements:{"00":{description:"Payload format indicator"}}},sf={"SG.PAYNOW":{name:"PayNow Merchant Information",knownElements:{"00":{description:"Payload format indicator"},"01":{description:"Payee type",interpreter:e=>({0:"Mobile number",2:"UEN"})[e]||xo},"02":{description:"Payee"},"03":{description:"Is amount editable",interpreter:e=>({0:"Not editable",1:"Editable"})[e]||xo},"04":{description:"Transaction reference"},"05":{description:"Expiry (YYYY/MM/DD)"}}},"SG.COM.NETS":{name:"NETS",knownElements:{"00":{description:"Payload format indicator"},"01":{description:"QR metadata"},"02":{description:"Merchant ID"},"03":{description:"Terminal ID"},"09":{description:"Transaction amount modifier"},99:{description:"Signature"}}},"COM.GRAB":{name:"GrabPay",knownElements:{"00":{description:"Payload format indicator"},"01":{description:"Merchant ID"}}},"SG.SGQR":{name:"SG Merchant ID",knownElements:{"00":{description:"Payload format indicator"},"01":{description:"SGQR ID Number"},"02":{description:"Version"},"03":{description:"Postcode"},"04":{description:"Level"},"05":{description:"Unit number"},"06":{description:"Misc"},"07":{description:"Revision date (YYYYMMDD)"}}},"COM.MYFAVE":{name:"FavePay",knownElements:{"00":{description:"Payload format indicator"},"01":{description:"FavePay URL"}}}},L6={name:"EMVCo Merchant Presented QR Code",knownElements:{"00":{description:"Payload format indicator"},"01":{description:"Point of initiation",interpreter:e=>({11:"Static -- can be used for multiple transactions",12:"Dynamic -- to be used for a single transaction"})[e]||xo},...Object.fromEntries(jx.range(26,52).map(e=>[e.toString().padStart(2,"0"),cD])),52:{description:"Merchant category code"},53:{description:"Transaction currency"},58:{description:"Country code"},59:{description:"Merchant name"},60:{description:"Merchant city"},63:{description:"CRC"}}},tl=(e,x)=>{var i,u;let t=0;const o=[];for(;t{x.current&&(x.current.srcObject=null,x.current.pause(),x.current=null),i(!1)},[]),E=h0.useCallback(()=>{const F=x.current;if(F&&t.current){if(F.readyState===F.HAVE_ENOUGH_DATA){const D=t.current.getContext("2d");if(!D)return;t.current.height=F.videoHeight,t.current.width=F.videoWidth,D.drawImage(F,0,0,t.current.width,t.current.height);const m=D.getImageData(0,0,t.current.width,t.current.height),w=s(m);if(w){u(w),c();return}}requestAnimationFrame(E)}},[u,s,c]),d=h0.useCallback(()=>{if(!x.current){const F=document.createElement("video");navigator.mediaDevices.getUserMedia({video:{facingMode:"environment"}}).then(function(D){F.srcObject=D,F.setAttribute("playsinline","true"),F.play(),requestAnimationFrame(E)}),x.current=F}i(!0)},[E]);return G.jsxs(G.Fragment,{children:[e.children({captureImage:d,isCapturing:o,stopCapture:c}),G.jsxs(fD,{style:{display:o?void 0:"none",textAlign:"center"},children:[G.jsx("button",{onClick:c,children:"Stop Capture"}),G.jsx("canvas",{ref:t,width:"500",height:"500",style:{height:"auto",width:"100%",display:o?"block":"none"}})]})]})}function fD(e){return Aa.createPortal(G.jsx("div",{className:"canvas-portal",style:e.style,children:e.children}),document.body)}const I6=e=>e.map(x=>{var t;return{rawData:x.rawValue,description:x.interpretation.context.name,protocol:((t=x.interpretation.elements.find(o=>o.elementID==="00"))==null?void 0:t.rawValue)||"Unknown",iconURL:""}});function dD(e){return typeof e=="string"?e:G.jsx("em",{children:"Unknown"})}function BD(e){return typeof e=="string"?e:e===null?null:e===xo?G.jsx("em",{children:"Unknown"}):N6(e)}function CD(e){const x=tl(L6,e.data),t=h0.useContext(pl),o=x.elements.filter(u=>!(u instanceof Xn)&&u.elementID>="26"&&u.elementID<="51"),i=o.length>0;return G.jsxs(G.Fragment,{children:[N6(x),i&&G.jsx("button",{onClick:()=>t.setPage({id:"compose",data:{paymentMethods:I6(o)}}),children:"Combine with other QRs"})]})}function N6(e){return G.jsxs("table",{children:[G.jsx("thead",{children:G.jsx("tr",{children:G.jsx("th",{colSpan:3,children:e.context.name})})}),G.jsx("tbody",{children:e.elements.map((x,t)=>x instanceof Xn?G.jsx("tr",{children:G.jsx("td",{colSpan:3,children:x.message})},t):G.jsxs(h0.Fragment,{children:[G.jsxs("tr",{className:"group-start",children:[G.jsx("td",{children:x.elementID}),G.jsx("td",{children:dD(x.description)}),G.jsx("td",{children:G.jsx(R6,{value:x.rawValue})})]},t+"._1"),x.interpretation&&G.jsxs("tr",{children:[G.jsx("td",{}),G.jsx("td",{colSpan:2,children:BD(x.interpretation)})]},t+"._2")]},t))})]})}function R6(e){return G.jsx("div",{style:{width:"100%",whiteSpace:"normal",maxWidth:"100%",maxHeight:"300px",overflow:"hidden",fontFamily:"monospace",wordBreak:"break-all",textAlign:"left",border:"solid 1px black"},children:e.value})}function AD(e){return e.data===null?null:G.jsxs(G.Fragment,{children:[G.jsx("div",{style:{textAlign:"left"},children:"Captured data:"}),G.jsx(R6,{value:e.data}),G.jsx(CD,{data:e.data})]})}function FD({rawData:e}){const x=h0.useContext(pl),t=h0.useCallback(s=>{x==null||x.setPage({id:"interpret",data:{rawData:s}})},[x]),o=h0.useCallback(s=>M6(s.data,s.width,s.height,{inversionAttempts:"dontInvert"}),[]),i=h0.useCallback(s=>{t(s.data)},[t]),u=T6;return G.jsxs(G.Fragment,{children:[G.jsx(u,{tester:o,onImageCaptured:i,children:({captureImage:s,isCapturing:c,stopCapture:E})=>G.jsxs(G.Fragment,{children:[!c&&G.jsx("button",{onClick:s,children:"Capture QR"}),c&&G.jsx("button",{onClick:E,children:"Stop Capture"})]})}),G.jsx(AD,{data:e})]})}const af=(e,x)=>{let t=x==null?void 0:x.offsetParent;for(;t;)e-=t.offsetTop,t=t.offsetParent;return e},cf=(e,x)=>jx.range(0,x.length).find(t=>{const o=x[t],i=x[t+1]??1e6;if(e>=o&&e<=i)return!0;if(e<=o)return!0}),Ef=e=>{const{draggedIndex:x,parentElem:t,childrenElem:o}=e,i=o.map(m=>m.offsetTop),u=e.target;u.classList.add("drag-sortable-dragged"),t.classList.add("drag-sortable-dragging");const s=e.clickPageY,c=(i[x+1]??t.offsetTop+t.offsetHeight)-i[x],E=u.style.top,d=u.style.userSelect;return{handleDragEnd:m=>{for(let M of jx.range(0,i.length))o[M].style.top="0";u.classList.remove("drag-sortable-dragged"),t.classList.remove("drag-sortable-dragging"),u.style.top=E,u.style.userSelect=d;const w=af(m,t.offsetParent),k=cf(w,i);return{draggedIndex:x,insertBefore:k>x?k+1:k}},handleDragMove:m=>{const w=m-s;console.log(w),u.style.top=w+"px",u.style.userSelect="none";const k=af(m,t.offsetParent),M=cf(k,i);if(M===void 0)throw new Error("indexToBeReplaced is somehow null");for(let I of jx.range(0,i.length))I!==x&&(Ix&&I>M||x===M?o[I].style.top="0":x>M?o[I].style.top=`${c}px`:x{t.current.length=o.length},[o]);const i=s=>c=>{c.preventDefault();const{handleDragMove:E,handleDragEnd:d}=Ef({draggedIndex:s,parentElem:x.current,childrenElem:t.current,clickPageY:c.pageY,target:c.currentTarget}),F=m=>{m.preventDefault(),E(m.pageY)},D=m=>{window.removeEventListener("mousemove",F),window.removeEventListener("mouseup",D);const{draggedIndex:w,insertBefore:k}=d(m.pageY);e.onSwap(w,k)};window.addEventListener("mousemove",F),window.addEventListener("mouseup",D)},u=s=>c=>{if(c.touches.length>1)return;c.preventDefault();const{handleDragMove:E,handleDragEnd:d}=Ef({draggedIndex:s,parentElem:x.current,childrenElem:t.current,clickPageY:c.touches[0].pageY,target:c.currentTarget}),F=m=>{m.preventDefault(),E(m.touches[0].pageY)},D=m=>{if(m.touches.length>0)return;window.removeEventListener("touchmove",F),window.removeEventListener("touchend",D);const{draggedIndex:w,insertBefore:k}=d(m.changedTouches[0].pageY);e.onSwap(w,k)};window.addEventListener("touchmove",F),window.addEventListener("touchend",D)};return G.jsx("div",{ref:x,className:"drag-sortable",children:e.list.map((s,c)=>G.jsx("div",{ref:E=>t.current[c]=E,onMouseDown:i(c),onTouchStart:u(c),className:"drag-sortable-element",children:e.children({item:s,index:c})},c))})}var hD=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then},O6={},Ve={};let Fa;const pD=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];Ve.getSymbolSize=function(x){if(!x)throw new Error('"version" cannot be null or undefined');if(x<1||x>40)throw new Error('"version" should be in range from 1 to 40');return x*4+17};Ve.getSymbolTotalCodewords=function(x){return pD[x]};Ve.getBCHDigit=function(e){let x=0;for(;e!==0;)x++,e>>>=1;return x};Ve.setToSJISFunction=function(x){if(typeof x!="function")throw new Error('"toSJISFunc" is not a valid function.');Fa=x};Ve.isKanjiModeEnabled=function(){return typeof Fa<"u"};Ve.toSJIS=function(x){return Fa(x)};var gl={};(function(e){e.L={bit:1},e.M={bit:0},e.Q={bit:3},e.H={bit:2};function x(t){if(typeof t!="string")throw new Error("Param is not a string");switch(t.toLowerCase()){case"l":case"low":return e.L;case"m":case"medium":return e.M;case"q":case"quartile":return e.Q;case"h":case"high":return e.H;default:throw new Error("Unknown EC Level: "+t)}}e.isValid=function(o){return o&&typeof o.bit<"u"&&o.bit>=0&&o.bit<4},e.from=function(o,i){if(e.isValid(o))return o;try{return x(o)}catch{return i}}})(gl);function z6(){this.buffer=[],this.length=0}z6.prototype={get:function(e){const x=Math.floor(e/8);return(this.buffer[x]>>>7-e%8&1)===1},put:function(e,x){for(let t=0;t>>x-t-1&1)===1)},getLengthInBits:function(){return this.length},putBit:function(e){const x=Math.floor(this.length/8);this.buffer.length<=x&&this.buffer.push(0),e&&(this.buffer[x]|=128>>>this.length%8),this.length++}};var gD=z6;function uo(e){if(!e||e<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=e,this.data=new Uint8Array(e*e),this.reservedBit=new Uint8Array(e*e)}uo.prototype.set=function(e,x,t,o){const i=e*this.size+x;this.data[i]=t,o&&(this.reservedBit[i]=!0)};uo.prototype.get=function(e,x){return this.data[e*this.size+x]};uo.prototype.xor=function(e,x,t){this.data[e*this.size+x]^=t};uo.prototype.isReserved=function(e,x){return this.reservedBit[e*this.size+x]};var mD=uo,U6={};(function(e){const x=Ve.getSymbolSize;e.getRowColCoords=function(o){if(o===1)return[];const i=Math.floor(o/7)+2,u=x(o),s=u===145?26:Math.ceil((u-13)/(2*i-2))*2,c=[u-7];for(let E=1;E=0&&i<=7},e.from=function(i){return e.isValid(i)?parseInt(i,10):void 0},e.getPenaltyN1=function(i){const u=i.size;let s=0,c=0,E=0,d=null,F=null;for(let D=0;D=5&&(s+=x.N1+(c-5)),d=w,c=1),w=i.get(m,D),w===F?E++:(E>=5&&(s+=x.N1+(E-5)),F=w,E=1)}c>=5&&(s+=x.N1+(c-5)),E>=5&&(s+=x.N1+(E-5))}return s},e.getPenaltyN2=function(i){const u=i.size;let s=0;for(let c=0;c=10&&(c===1488||c===93)&&s++,E=E<<1&2047|i.get(F,d),F>=10&&(E===1488||E===93)&&s++}return s*x.N3},e.getPenaltyN4=function(i){let u=0;const s=i.data.length;for(let E=0;E=0;){const s=u[0];for(let E=0;E0){const u=new Uint8Array(this.degree);return u.set(o,i),u}return o};var wD=Da,G6={},yt={},ha={};ha.isValid=function(x){return!isNaN(x)&&x>=1&&x<=40};var Px={};const V6="[0-9]+",yD="[A-Z $%*+\\-./:]+";let to="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";to=to.replace(/u/g,"\\u");const kD="(?:(?![A-Z0-9 $%*+\\-./:]|"+to+`)(?:.|[\r +}`;var d0=Xc(function(){return g0(A,t0+"return "+H).apply(t,y)});if(d0.source=H,Ou(d0))throw d0;return d0}function j2(n){return m0(n).toLowerCase()}function G2(n){return m0(n).toUpperCase()}function V2(n,r,l){if(n=m0(n),n&&(l||r===t))return r8(n);if(!n||!(r=Ne(r)))return n;var a=ux(n),f=ux(r),A=o8(a,f),y=i8(a,f)+1;return nt(a,A,y).join("")}function Q2(n,r,l){if(n=m0(n),n&&(l||r===t))return n.slice(0,u8(n)+1);if(!n||!(r=Ne(r)))return n;var a=ux(n),f=i8(a,ux(r))+1;return nt(a,0,f).join("")}function K2(n,r,l){if(n=m0(n),n&&(l||r===t))return n.replace(Ol,"");if(!n||!(r=Ne(r)))return n;var a=ux(n),f=o8(a,ux(r));return nt(a,f).join("")}function Y2(n,r){var l=$,a=K;if(R0(r)){var f="separator"in r?r.separator:f;l="length"in r?f0(r.length):l,a="omission"in r?Ne(r.omission):a}n=m0(n);var A=n.length;if(tn(n)){var y=ux(n);A=y.length}if(l>=A)return n;var S=l-nn(a);if(S<1)return a;var T=y?nt(y,0,S).join(""):n.slice(0,S);if(f===t)return T+a;if(y&&(S+=T.length-S),zu(f)){if(n.slice(S).search(f)){var U,W=T;for(f.global||(f=eu(f.source,m0(ya.exec(f))+"g")),f.lastIndex=0;U=f.exec(W);)var H=U.index;T=T.slice(0,H===t?S:H)}}else if(n.indexOf(Ne(f),S)!=S){var Y=T.lastIndexOf(f);Y>-1&&(T=T.slice(0,Y))}return T+a}function X2(n){return n=m0(n),n&&id.test(n)?n.replace(ma,v5):n}var Z2=cn(function(n,r,l){return n+(l?" ":"")+r.toUpperCase()}),$u=Z8("toUpperCase");function Yc(n,r,l){return n=m0(n),r=l?t:r,r===t?D5(n)?k5(n):a5(n):n.match(r)||[]}var Xc=B0(function(n,r){try{return Te(n,t,r)}catch(l){return Ou(l)?l:new s0(l)}}),J2=Tx(function(n,r){return Ye(r,function(l){l=gx(l),Mx(n,l,Nu(n[l],n))}),n});function b2(n){var r=n==null?0:n.length,l=o0();return n=r?I0(n,function(a){if(typeof a[1]!="function")throw new Xe(s);return[l(a[0]),a[1]]}):[],B0(function(a){for(var f=-1;++fj)return[];var l=Q,a=se(n,Q);r=o0(r),n-=Q;for(var f=Jl(a,r);++l0||r<0)?new F0(l):(n<0?l=l.takeRight(-n):n&&(l=l.drop(n)),r!==t&&(r=f0(r),l=r<0?l.dropRight(-r):l.take(r-n)),l)},F0.prototype.takeRightWhile=function(n){return this.reverse().takeWhile(n).reverse()},F0.prototype.toArray=function(){return this.take(Q)},hx(F0.prototype,function(n,r){var l=/^(?:filter|find|map|reject)|While$/.test(r),a=/^(?:head|last)$/.test(r),f=B[a?"take"+(r=="last"?"Right":""):r],A=a||/^find/.test(r);f&&(B.prototype[r]=function(){var y=this.__wrapped__,S=a?[1]:arguments,T=y instanceof F0,U=S[0],W=T||c0(y),H=function(C0){var D0=f.apply(B,Jx([C0],S));return a&&Y?D0[0]:D0};W&&l&&typeof U=="function"&&U.length!=1&&(T=W=!1);var Y=this.__chain__,t0=!!this.__actions__.length,i0=A&&!Y,d0=T&&!t0;if(!A&&W){y=d0?y:new F0(this);var l0=n.apply(y,S);return l0.__actions__.push({func:Vo,args:[H],thisArg:t}),new Ze(l0,Y)}return i0&&d0?n.apply(this,S):(l0=this.thru(H),i0?a?l0.value()[0]:l0.value():l0)})}),Ye(["pop","push","shift","sort","splice","unshift"],function(n){var r=Ao[n],l=/^(?:push|sort|unshift)$/.test(n)?"tap":"thru",a=/^(?:pop|shift)$/.test(n);B.prototype[n]=function(){var f=arguments;if(a&&!this.__chain__){var A=this.value();return r.apply(c0(A)?A:[],f)}return this[l](function(y){return r.apply(c0(y)?y:[],f)})}}),hx(F0.prototype,function(n,r){var l=B[r];if(l){var a=l.name+"";v0.call(un,a)||(un[a]=[]),un[a].push({name:r,func:l})}}),un[zo(t,p).name]=[{name:"wrapper",func:t}],F0.prototype.clone=X5,F0.prototype.reverse=Z5,F0.prototype.value=J5,B.prototype.at=yC,B.prototype.chain=kC,B.prototype.commit=PC,B.prototype.next=_C,B.prototype.plant=MC,B.prototype.reverse=LC,B.prototype.toJSON=B.prototype.valueOf=B.prototype.value=TC,B.prototype.first=B.prototype.head,xr&&(B.prototype[xr]=SC),B},rn=P5();_t?((_t.exports=rn)._=rn,jl._=rn):te._=rn}).call(Cn)})(xl,xl.exports);var jx=xl.exports;const xo=Symbol();class Xn extends Error{}class aD extends Xn{constructor(t,o){super(`A length of ${t} was requested, but only ${o} chars are left in the payload`);Br(this,"lengthRequested");Br(this,"lengthAvailable");this.lengthRequested=t,this.lengthAvailable=o}}class uf extends Xn{constructor(t){super(`An invalid element+length indicator of ${t} was encountered`);Br(this,"element");this.element=t}}const cD={description:"Merchant account information",interpreter:e=>{const x=tl(ED,e),t=x.elements[0];if(t&&!(t instanceof Xn)&&t.elementID==="00"){const o=t.rawValue.toUpperCase();return o in sf?tl(sf[o],e):x}else return x}},ED={name:"Generic merchant account information",knownElements:{"00":{description:"Payload format indicator"}}},sf={"SG.PAYNOW":{name:"PayNow Merchant Information",knownElements:{"00":{description:"Payload format indicator"},"01":{description:"Payee type",interpreter:e=>({0:"Mobile number",2:"UEN"})[e]||xo},"02":{description:"Payee"},"03":{description:"Is amount editable",interpreter:e=>({0:"Not editable",1:"Editable"})[e]||xo},"04":{description:"Transaction reference"},"05":{description:"Expiry (YYYY/MM/DD)"}}},"SG.COM.NETS":{name:"NETS",knownElements:{"00":{description:"Payload format indicator"},"01":{description:"QR metadata"},"02":{description:"Merchant ID"},"03":{description:"Terminal ID"},"09":{description:"Transaction amount modifier"},99:{description:"Signature"}}},"COM.GRAB":{name:"GrabPay",knownElements:{"00":{description:"Payload format indicator"},"01":{description:"Merchant ID"}}},"SG.SGQR":{name:"SG Merchant ID",knownElements:{"00":{description:"Payload format indicator"},"01":{description:"SGQR ID Number"},"02":{description:"Version"},"03":{description:"Postcode"},"04":{description:"Level"},"05":{description:"Unit number"},"06":{description:"Misc"},"07":{description:"Revision date (YYYYMMDD)"}}},"COM.MYFAVE":{name:"FavePay",knownElements:{"00":{description:"Payload format indicator"},"01":{description:"FavePay URL"}}}},L6={name:"EMVCo Merchant Presented QR Code",knownElements:{"00":{description:"Payload format indicator"},"01":{description:"Point of initiation",interpreter:e=>({11:"Static -- can be used for multiple transactions",12:"Dynamic -- to be used for a single transaction"})[e]||xo},...Object.fromEntries(jx.range(26,52).map(e=>[e.toString().padStart(2,"0"),cD])),52:{description:"Merchant category code"},53:{description:"Transaction currency"},58:{description:"Country code"},59:{description:"Merchant name"},60:{description:"Merchant city"},63:{description:"CRC"}}},tl=(e,x)=>{var i,u;let t=0;const o=[];for(;t{x.current&&(x.current.srcObject=null,x.current.pause(),x.current=null),i(!1)},[]),E=h0.useCallback(()=>{const F=x.current;if(F&&t.current){if(F.readyState===F.HAVE_ENOUGH_DATA){const D=t.current.getContext("2d");if(!D)return;t.current.height=F.videoHeight,t.current.width=F.videoWidth,D.drawImage(F,0,0,t.current.width,t.current.height);const m=D.getImageData(0,0,t.current.width,t.current.height),w=s(m);if(w){u(w),c();return}}requestAnimationFrame(E)}},[u,s,c]),d=h0.useCallback(()=>{if(!x.current){const F=document.createElement("video");navigator.mediaDevices.getUserMedia({video:{facingMode:"environment"}}).then(function(D){F.srcObject=D,F.setAttribute("playsinline","true"),F.play(),requestAnimationFrame(E)}),x.current=F}i(!0)},[E]);return G.jsxs(G.Fragment,{children:[e.children({captureImage:d,isCapturing:o,stopCapture:c}),G.jsxs(fD,{style:{display:o?void 0:"none",textAlign:"center"},children:[G.jsx("button",{onClick:c,children:"Stop Capture"}),G.jsx("canvas",{ref:t,width:"500",height:"500",style:{height:"auto",width:"100%",display:o?"block":"none"}})]})]})}function fD(e){return Aa.createPortal(G.jsx("div",{className:"canvas-portal",style:e.style,children:e.children}),document.body)}const I6=e=>e.map(x=>{var t;return{rawData:x.rawValue,description:x.interpretation.context.name,protocol:((t=x.interpretation.elements.find(o=>o.elementID==="00"))==null?void 0:t.rawValue)||"Unknown",iconURL:""}});function dD(e){return typeof e=="string"?e:G.jsx("em",{children:"Unknown"})}function BD(e){return typeof e=="string"?e:e===null?null:e===xo?G.jsx("em",{children:"Unknown"}):N6(e)}function CD(e){const x=tl(L6,e.data),t=h0.useContext(pl),o=x.elements.filter(u=>!(u instanceof Xn)&&u.elementID>="26"&&u.elementID<="51"),i=o.length>0;return G.jsxs(G.Fragment,{children:[N6(x),i&&G.jsx("button",{style:{width:"100%"},onClick:()=>t.setPage({id:"compose",data:{paymentMethods:I6(o)}}),children:"Combine with other QRs"})]})}function N6(e){return G.jsxs("table",{children:[G.jsx("thead",{children:G.jsx("tr",{children:G.jsx("th",{colSpan:3,children:e.context.name})})}),G.jsx("tbody",{children:e.elements.map((x,t)=>x instanceof Xn?G.jsx("tr",{children:G.jsx("td",{colSpan:3,children:x.message})},t):G.jsxs(h0.Fragment,{children:[G.jsxs("tr",{className:"group-start",children:[G.jsx("td",{children:x.elementID}),G.jsx("td",{children:dD(x.description)}),G.jsx("td",{children:G.jsx(R6,{value:x.rawValue})})]},t+"._1"),x.interpretation&&G.jsxs("tr",{children:[G.jsx("td",{}),G.jsx("td",{colSpan:2,children:BD(x.interpretation)})]},t+"._2")]},t))})]})}function R6(e){return G.jsx("div",{style:{width:"100%",whiteSpace:"normal",maxWidth:"100%",maxHeight:"300px",overflow:"hidden",fontFamily:"monospace",wordBreak:"break-all",textAlign:"left",border:"solid 1px black"},children:e.value})}function AD(e){return e.data===null?null:G.jsxs(G.Fragment,{children:[G.jsx("div",{style:{textAlign:"left"},children:"Captured data:"}),G.jsx(R6,{value:e.data}),G.jsx(CD,{data:e.data})]})}function FD({rawData:e}){const x=h0.useContext(pl),t=h0.useCallback(s=>{x==null||x.setPage({id:"interpret",data:{rawData:s}})},[x]),o=h0.useCallback(s=>M6(s.data,s.width,s.height,{inversionAttempts:"dontInvert"}),[]),i=h0.useCallback(s=>{t(s.data)},[t]),u=T6;return G.jsxs(G.Fragment,{children:[G.jsx(u,{tester:o,onImageCaptured:i,children:({captureImage:s,isCapturing:c,stopCapture:E})=>G.jsxs(G.Fragment,{children:[!c&&G.jsx("button",{style:{width:"100%"},onClick:s,children:"Capture QR"}),c&&G.jsx("button",{style:{width:"100%"},onClick:E,children:"Stop Capture"})]})}),G.jsx(AD,{data:e})]})}const af=(e,x)=>{let t=x==null?void 0:x.offsetParent;for(;t;)e-=t.offsetTop,t=t.offsetParent;return e},cf=(e,x)=>jx.range(0,x.length).find(t=>{const o=x[t],i=x[t+1]??1e6;if(e>=o&&e<=i)return!0;if(e<=o)return!0}),Ef=e=>{const{draggedIndex:x,parentElem:t,childrenElem:o}=e,i=o.map(m=>m.offsetTop),u=e.target;u.classList.add("drag-sortable-dragged"),t.classList.add("drag-sortable-dragging");const s=e.clickPageY,c=(i[x+1]??t.offsetTop+t.offsetHeight)-i[x],E=u.style.top,d=u.style.userSelect;return{handleDragEnd:m=>{for(let M of jx.range(0,i.length))o[M].style.top="0";u.classList.remove("drag-sortable-dragged"),t.classList.remove("drag-sortable-dragging"),u.style.top=E,u.style.userSelect=d;const w=af(m,t.offsetParent),k=cf(w,i);return{draggedIndex:x,insertBefore:k>x?k+1:k}},handleDragMove:m=>{const w=m-s;console.log(w),u.style.top=w+"px",u.style.userSelect="none";const k=af(m,t.offsetParent),M=cf(k,i);if(M===void 0)throw new Error("indexToBeReplaced is somehow null");for(let I of jx.range(0,i.length))I!==x&&(Ix&&I>M||x===M?o[I].style.top="0":x>M?o[I].style.top=`${c}px`:x{t.current.length=o.length},[o]);const i=s=>c=>{c.preventDefault();const{handleDragMove:E,handleDragEnd:d}=Ef({draggedIndex:s,parentElem:x.current,childrenElem:t.current,clickPageY:c.pageY,target:c.currentTarget}),F=m=>{m.preventDefault(),E(m.pageY)},D=m=>{window.removeEventListener("mousemove",F),window.removeEventListener("mouseup",D);const{draggedIndex:w,insertBefore:k}=d(m.pageY);e.onSwap(w,k)};window.addEventListener("mousemove",F),window.addEventListener("mouseup",D)},u=s=>c=>{if(c.touches.length>1)return;c.preventDefault();const{handleDragMove:E,handleDragEnd:d}=Ef({draggedIndex:s,parentElem:x.current,childrenElem:t.current,clickPageY:c.touches[0].pageY,target:c.currentTarget}),F=m=>{m.preventDefault(),E(m.touches[0].pageY)},D=m=>{if(m.touches.length>0)return;window.removeEventListener("touchmove",F),window.removeEventListener("touchend",D);const{draggedIndex:w,insertBefore:k}=d(m.changedTouches[0].pageY);e.onSwap(w,k)};window.addEventListener("touchmove",F),window.addEventListener("touchend",D)};return G.jsx("div",{ref:x,className:"drag-sortable",children:e.list.map((s,c)=>G.jsx("div",{ref:E=>t.current[c]=E,onMouseDown:i(c),onTouchStart:u(c),className:"drag-sortable-element",children:e.children({item:s,index:c})},c))})}var hD=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then},O6={},Ve={};let Fa;const pD=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];Ve.getSymbolSize=function(x){if(!x)throw new Error('"version" cannot be null or undefined');if(x<1||x>40)throw new Error('"version" should be in range from 1 to 40');return x*4+17};Ve.getSymbolTotalCodewords=function(x){return pD[x]};Ve.getBCHDigit=function(e){let x=0;for(;e!==0;)x++,e>>>=1;return x};Ve.setToSJISFunction=function(x){if(typeof x!="function")throw new Error('"toSJISFunc" is not a valid function.');Fa=x};Ve.isKanjiModeEnabled=function(){return typeof Fa<"u"};Ve.toSJIS=function(x){return Fa(x)};var gl={};(function(e){e.L={bit:1},e.M={bit:0},e.Q={bit:3},e.H={bit:2};function x(t){if(typeof t!="string")throw new Error("Param is not a string");switch(t.toLowerCase()){case"l":case"low":return e.L;case"m":case"medium":return e.M;case"q":case"quartile":return e.Q;case"h":case"high":return e.H;default:throw new Error("Unknown EC Level: "+t)}}e.isValid=function(o){return o&&typeof o.bit<"u"&&o.bit>=0&&o.bit<4},e.from=function(o,i){if(e.isValid(o))return o;try{return x(o)}catch{return i}}})(gl);function z6(){this.buffer=[],this.length=0}z6.prototype={get:function(e){const x=Math.floor(e/8);return(this.buffer[x]>>>7-e%8&1)===1},put:function(e,x){for(let t=0;t>>x-t-1&1)===1)},getLengthInBits:function(){return this.length},putBit:function(e){const x=Math.floor(this.length/8);this.buffer.length<=x&&this.buffer.push(0),e&&(this.buffer[x]|=128>>>this.length%8),this.length++}};var gD=z6;function uo(e){if(!e||e<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=e,this.data=new Uint8Array(e*e),this.reservedBit=new Uint8Array(e*e)}uo.prototype.set=function(e,x,t,o){const i=e*this.size+x;this.data[i]=t,o&&(this.reservedBit[i]=!0)};uo.prototype.get=function(e,x){return this.data[e*this.size+x]};uo.prototype.xor=function(e,x,t){this.data[e*this.size+x]^=t};uo.prototype.isReserved=function(e,x){return this.reservedBit[e*this.size+x]};var mD=uo,U6={};(function(e){const x=Ve.getSymbolSize;e.getRowColCoords=function(o){if(o===1)return[];const i=Math.floor(o/7)+2,u=x(o),s=u===145?26:Math.ceil((u-13)/(2*i-2))*2,c=[u-7];for(let E=1;E=0&&i<=7},e.from=function(i){return e.isValid(i)?parseInt(i,10):void 0},e.getPenaltyN1=function(i){const u=i.size;let s=0,c=0,E=0,d=null,F=null;for(let D=0;D=5&&(s+=x.N1+(c-5)),d=w,c=1),w=i.get(m,D),w===F?E++:(E>=5&&(s+=x.N1+(E-5)),F=w,E=1)}c>=5&&(s+=x.N1+(c-5)),E>=5&&(s+=x.N1+(E-5))}return s},e.getPenaltyN2=function(i){const u=i.size;let s=0;for(let c=0;c=10&&(c===1488||c===93)&&s++,E=E<<1&2047|i.get(F,d),F>=10&&(E===1488||E===93)&&s++}return s*x.N3},e.getPenaltyN4=function(i){let u=0;const s=i.data.length;for(let E=0;E=0;){const s=u[0];for(let E=0;E0){const u=new Uint8Array(this.degree);return u.set(o,i),u}return o};var wD=Da,G6={},yt={},ha={};ha.isValid=function(x){return!isNaN(x)&&x>=1&&x<=40};var Px={};const V6="[0-9]+",yD="[A-Z $%*+\\-./:]+";let to="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";to=to.replace(/u/g,"\\u");const kD="(?:(?![A-Z0-9 $%*+\\-./:]|"+to+`)(?:.|[\r ]))+`;Px.KANJI=new RegExp(to,"g");Px.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g");Px.BYTE=new RegExp(kD,"g");Px.NUMERIC=new RegExp(V6,"g");Px.ALPHANUMERIC=new RegExp(yD,"g");const PD=new RegExp("^"+to+"$"),_D=new RegExp("^"+V6+"$"),SD=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");Px.testKanji=function(x){return PD.test(x)};Px.testNumeric=function(x){return _D.test(x)};Px.testAlphanumeric=function(x){return SD.test(x)};(function(e){const x=ha,t=Px;e.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},e.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},e.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},e.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},e.MIXED={bit:-1},e.getCharCountIndicator=function(u,s){if(!u.ccBits)throw new Error("Invalid mode: "+u);if(!x.isValid(s))throw new Error("Invalid version: "+s);return s>=1&&s<10?u.ccBits[0]:s<27?u.ccBits[1]:u.ccBits[2]},e.getBestModeForData=function(u){return t.testNumeric(u)?e.NUMERIC:t.testAlphanumeric(u)?e.ALPHANUMERIC:t.testKanji(u)?e.KANJI:e.BYTE},e.toString=function(u){if(u&&u.id)return u.id;throw new Error("Invalid mode")},e.isValid=function(u){return u&&u.bit&&u.ccBits};function o(i){if(typeof i!="string")throw new Error("Param is not a string");switch(i.toLowerCase()){case"numeric":return e.NUMERIC;case"alphanumeric":return e.ALPHANUMERIC;case"kanji":return e.KANJI;case"byte":return e.BYTE;default:throw new Error("Unknown mode: "+i)}}e.from=function(u,s){if(e.isValid(u))return u;try{return o(u)}catch{return s}}})(yt);(function(e){const x=Ve,t=ml,o=gl,i=yt,u=ha,s=7973,c=x.getBCHDigit(s);function E(m,w,k){for(let M=1;M<=40;M++)if(w<=e.getCapacity(M,k,m))return M}function d(m,w){return i.getCharCountIndicator(m,w)+4}function F(m,w){let k=0;return m.forEach(function(M){const I=d(M.mode,w);k+=I+M.getBitsLength()}),k}function D(m,w){for(let k=1;k<=40;k++)if(F(m,k)<=e.getCapacity(k,w,i.MIXED))return k}e.from=function(w,k){return u.isValid(w)?parseInt(w,10):k},e.getCapacity=function(w,k,M){if(!u.isValid(w))throw new Error("Invalid QR Code version");typeof M>"u"&&(M=i.BYTE);const I=x.getSymbolTotalCodewords(w),p=t.getTotalCodewordsCount(w,k),g=(I-p)*8;if(M===i.MIXED)return g;const C=g-d(M,w);switch(M){case i.NUMERIC:return Math.floor(C/10*3);case i.ALPHANUMERIC:return Math.floor(C/11*2);case i.KANJI:return Math.floor(C/13);case i.BYTE:default:return Math.floor(C/8)}},e.getBestVersionForData=function(w,k){let M;const I=o.from(k,o.M);if(Array.isArray(w)){if(w.length>1)return D(w,I);if(w.length===0)return 1;M=w[0]}else M=w;return E(M.mode,M.getLength(),I)},e.getEncodedBits=function(w){if(!u.isValid(w)||w<7)throw new Error("Invalid QR Code version");let k=w<<12;for(;x.getBCHDigit(k)-c>=0;)k^=s<=0;)i^=K6<0&&(o=this.data.substr(t),i=parseInt(o,10),x.put(i,u*3+1))};var TD=Hn;const ID=yt,hs=["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"," ","$","%","*","+","-",".","/",":"];function jn(e){this.mode=ID.ALPHANUMERIC,this.data=e}jn.getBitsLength=function(x){return 11*Math.floor(x/2)+6*(x%2)};jn.prototype.getLength=function(){return this.data.length};jn.prototype.getBitsLength=function(){return jn.getBitsLength(this.data.length)};jn.prototype.write=function(x){let t;for(t=0;t+2<=this.data.length;t+=2){let o=hs.indexOf(this.data[t])*45;o+=hs.indexOf(this.data[t+1]),x.put(o,11)}this.data.length%2&&x.put(hs.indexOf(this.data[t]),6)};var ND=jn,RD=function(x){for(var t=[],o=x.length,i=0;i=55296&&u<=56319&&o>i+1){var s=x.charCodeAt(i+1);s>=56320&&s<=57343&&(u=(u-55296)*1024+s-56320+65536,i+=1)}if(u<128){t.push(u);continue}if(u<2048){t.push(u>>6|192),t.push(u&63|128);continue}if(u<55296||u>=57344&&u<65536){t.push(u>>12|224),t.push(u>>6&63|128),t.push(u&63|128);continue}if(u>=65536&&u<=1114111){t.push(u>>18|240),t.push(u>>12&63|128),t.push(u>>6&63|128),t.push(u&63|128);continue}t.push(239,191,189)}return new Uint8Array(t).buffer};const OD=RD,zD=yt;function Gn(e){this.mode=zD.BYTE,typeof e=="string"&&(e=OD(e)),this.data=new Uint8Array(e)}Gn.getBitsLength=function(x){return x*8};Gn.prototype.getLength=function(){return this.data.length};Gn.prototype.getBitsLength=function(){return Gn.getBitsLength(this.data.length)};Gn.prototype.write=function(e){for(let x=0,t=this.data.length;x=33088&&t<=40956)t-=33088;else if(t>=57408&&t<=60351)t-=49472;else throw new Error("Invalid SJIS character: "+this.data[x]+` Make sure your charset is UTF-8`);t=(t>>>8&255)*192+(t&255),e.put(t,13)}};var HD=Vn,X6={exports:{}};(function(e){var x={single_source_shortest_paths:function(t,o,i){var u={},s={};s[o]=0;var c=x.PriorityQueue.make();c.push(o,0);for(var E,d,F,D,m,w,k,M,I;!c.empty();){E=c.pop(),d=E.value,D=E.cost,m=t[d]||{};for(F in m)m.hasOwnProperty(F)&&(w=m[F],k=D+w,M=s[F],I=typeof s[F]>"u",(I||M>k)&&(s[F]=k,c.push(F,k),u[F]=d))}if(typeof i<"u"&&typeof s[i]>"u"){var p=["Could not find a path from ",o," to ",i,"."].join("");throw new Error(p)}return u},extract_shortest_path_from_predecessor_list:function(t,o){for(var i=[],u=o;u;)i.push(u),t[u],u=t[u];return i.reverse(),i},find_path:function(t,o,i){var u=x.single_source_shortest_paths(t,o,i);return x.extract_shortest_path_from_predecessor_list(u,i)},PriorityQueue:{make:function(t){var o=x.PriorityQueue,i={},u;t=t||{};for(u in o)o.hasOwnProperty(u)&&(i[u]=o[u]);return i.queue=[],i.sorter=t.sorter||o.default_sorter,i},default_sorter:function(t,o){return t.cost-o.cost},push:function(t,o){var i={value:t,cost:o};this.queue.push(i),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return this.queue.length===0}}};e.exports=x})(X6);var jD=X6.exports;(function(e){const x=yt,t=TD,o=ND,i=UD,u=HD,s=Px,c=Ve,E=jD;function d(p){return unescape(encodeURIComponent(p)).length}function F(p,g,C){const h=[];let v;for(;(v=p.exec(C))!==null;)h.push({data:v[0],index:v.index,mode:g,length:v[0].length});return h}function D(p){const g=F(s.NUMERIC,x.NUMERIC,p),C=F(s.ALPHANUMERIC,x.ALPHANUMERIC,p);let h,v;return c.isKanjiModeEnabled()?(h=F(s.BYTE,x.BYTE,p),v=F(s.KANJI,x.KANJI,p)):(h=F(s.BYTE_KANJI,x.BYTE,p),v=[]),g.concat(C,h,v).sort(function(P,N){return P.index-N.index}).map(function(P){return{data:P.data,mode:P.mode,length:P.length}})}function m(p,g){switch(g){case x.NUMERIC:return t.getBitsLength(p);case x.ALPHANUMERIC:return o.getBitsLength(p);case x.KANJI:return u.getBitsLength(p);case x.BYTE:return i.getBitsLength(p)}}function w(p){return p.reduce(function(g,C){const h=g.length-1>=0?g[g.length-1]:null;return h&&h.mode===C.mode?(g[g.length-1].data+=C.data,g):(g.push(C),g)},[])}function k(p){const g=[];for(let C=0;C=0&&c<=6&&(E===0||E===6)||E>=0&&E<=6&&(c===0||c===6)||c>=2&&c<=4&&E>=2&&E<=4?e.set(u+c,s+E,!0,!0):e.set(u+c,s+E,!1,!0))}}function bD(e){const x=e.size;for(let t=8;t>c&1)===1,e.set(i,u,s,!0),e.set(u,i,s,!0)}function ms(e,x,t){const o=e.size,i=XD.getEncodedBits(x,t);let u,s;for(u=0;u<15;u++)s=(i>>u&1)===1,u<6?e.set(u,8,s,!0):u<8?e.set(u+1,8,s,!0):e.set(o-15+u,8,s,!0),u<8?e.set(8,o-u-1,s,!0):u<9?e.set(8,15-u-1+1,s,!0):e.set(8,15-u-1,s,!0);e.set(o-8,8,1,!0)}function xh(e,x){const t=e.size;let o=-1,i=t-1,u=7,s=0;for(let c=t-1;c>0;c-=2)for(c===6&&c--;;){for(let E=0;E<2;E++)if(!e.isReserved(i,c-E)){let d=!1;s>>u&1)===1),e.set(i,c-E,d),u--,u===-1&&(s++,u=7)}if(i+=o,i<0||t<=i){i-=o,o=-o;break}}}function th(e,x,t){const o=new GD;t.forEach(function(E){o.put(E.mode.bit,4),o.put(E.getLength(),ZD.getCharCountIndicator(E.mode,e)),E.write(o)});const i=wl.getSymbolTotalCodewords(e),u=h9.getTotalCodewordsCount(e,x),s=(i-u)*8;for(o.getLengthInBits()+4<=s&&o.put(0,4);o.getLengthInBits()%8!==0;)o.putBit(0);const c=(s-o.getLengthInBits())/8;for(let E=0;E