@walletconnect/ethereum-provider 2.10.5-rc-e12288e → 2.10.5-rc-c91a538

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.umd.js CHANGED
@@ -129,7 +129,7 @@ function print() { __p += __j.call(arguments, '') }
129
129
  * @license
130
130
  * Copyright 2018 Google LLC
131
131
  * SPDX-License-Identifier: BSD-3-Clause
132
- */const Mr=d9(class extends p9{constructor(t){var e;if(super(t),t.type!==f9.ATTRIBUTE||t.name!=="class"||((e=t.strings)===null||e===void 0?void 0:e.length)>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(t){return" "+Object.keys(t).filter(e=>t[e]).join(" ")+" "}update(t,[e]){var r,n;if(this.it===void 0){this.it=new Set,t.strings!==void 0&&(this.nt=new Set(t.strings.join(" ").split(/\s/).filter(o=>o!=="")));for(const o in e)e[o]&&!(!((r=this.nt)===null||r===void 0)&&r.has(o))&&this.it.add(o);return this.render(e)}const i=t.element.classList;this.it.forEach(o=>{o in e||(i.remove(o),this.it.delete(o))});for(const o in e){const c=!!e[o];c===this.it.has(o)||!((n=this.nt)===null||n===void 0)&&n.has(o)||(c?(i.add(o),this.it.add(o)):(i.remove(o),this.it.delete(o)))}return rs}});function g9(t,e){t.indexOf(e)===-1&&t.push(e)}const wm=(t,e,r)=>Math.min(Math.max(r,t),e),dn={duration:.3,delay:0,endDelay:0,repeat:0,easing:"ease"},Rc=t=>typeof t=="number",Vs=t=>Array.isArray(t)&&!Rc(t[0]),m9=(t,e,r)=>{const n=e-t;return((r-t)%n+n)%n+t};function w9(t,e){return Vs(t)?t[m9(0,t.length,e)]:t}const vm=(t,e,r)=>-r*t+r*e+t,ym=()=>{},Ci=t=>t,Yh=(t,e,r)=>e-t===0?1:(r-t)/(e-t);function bm(t,e){const r=t[t.length-1];for(let n=1;n<=e;n++){const i=Yh(0,e,n);t.push(vm(r,1,i))}}function v9(t){const e=[0];return bm(e,t-1),e}function y9(t,e=v9(t.length),r=Ci){const n=t.length,i=n-e.length;return i>0&&bm(e,i),o=>{let c=0;for(;c<n-2&&!(o<e[c+1]);c++);let l=wm(0,1,Yh(e[c],e[c+1],o));return l=w9(r,c)(l),vm(t[c],t[c+1],l)}}const _m=t=>Array.isArray(t)&&Rc(t[0]),Jh=t=>typeof t=="object"&&!!t.createAnimation,is=t=>typeof t=="function",b9=t=>typeof t=="string",la={ms:t=>t*1e3,s:t=>t/1e3},Em=(t,e,r)=>(((1-3*r+3*e)*t+(3*r-6*e))*t+3*e)*t,_9=1e-7,E9=12;function x9(t,e,r,n,i){let o,c,l=0;do c=e+(r-e)/2,o=Em(c,n,i)-t,o>0?r=c:e=c;while(Math.abs(o)>_9&&++l<E9);return c}function ua(t,e,r,n){if(t===e&&r===n)return Ci;const i=o=>x9(o,0,1,t,r);return o=>o===0||o===1?o:Em(i(o),e,n)}const C9=(t,e="end")=>r=>{r=e==="end"?Math.min(r,.999):Math.max(r,.001);const n=r*t,i=e==="end"?Math.floor(n):Math.ceil(n);return wm(0,1,i/t)},xm={ease:ua(.25,.1,.25,1),"ease-in":ua(.42,0,1,1),"ease-in-out":ua(.42,0,.58,1),"ease-out":ua(0,0,.58,1)},I9=/\((.*?)\)/;function Cm(t){if(is(t))return t;if(_m(t))return ua(...t);if(xm[t])return xm[t];if(t.startsWith("steps")){const e=I9.exec(t);if(e){const r=e[1].split(",");return C9(parseFloat(r[0]),r[1].trim())}}return Ci}class Im{constructor(e,r=[0,1],{easing:n,duration:i=dn.duration,delay:o=dn.delay,endDelay:c=dn.endDelay,repeat:l=dn.repeat,offset:f,direction:h="normal"}={}){if(this.startTime=null,this.rate=1,this.t=0,this.cancelTimestamp=null,this.easing=Ci,this.duration=0,this.totalDuration=0,this.repeat=0,this.playState="idle",this.finished=new Promise((y,b)=>{this.resolve=y,this.reject=b}),n=n||dn.easing,Jh(n)){const y=n.createAnimation(r);n=y.easing,r=y.keyframes||r,i=y.duration||i}this.repeat=l,this.easing=Vs(n)?Ci:Cm(n),this.updateDuration(i);const v=y9(r,f,Vs(n)?n.map(Cm):Ci);this.tick=y=>{var b;o=o;let x=0;this.pauseTime!==void 0?x=this.pauseTime:x=(y-this.startTime)*this.rate,this.t=x,x/=1e3,x=Math.max(x-o,0),this.playState==="finished"&&this.pauseTime===void 0&&(x=this.totalDuration);const P=x/this.duration;let M=Math.floor(P),H=P%1;!H&&P>=1&&(H=1),H===1&&M--;const V=M%2;(h==="reverse"||h==="alternate"&&V||h==="alternate-reverse"&&!V)&&(H=1-H);const T=x>=this.totalDuration?1:Math.min(H,1),L=v(this.easing(T));e(L),this.pauseTime===void 0&&(this.playState==="finished"||x>=this.totalDuration+c)?(this.playState="finished",(b=this.resolve)===null||b===void 0||b.call(this,L)):this.playState!=="idle"&&(this.frameRequestId=requestAnimationFrame(this.tick))},this.play()}play(){const e=performance.now();this.playState="running",this.pauseTime!==void 0?this.startTime=e-this.pauseTime:this.startTime||(this.startTime=e),this.cancelTimestamp=this.startTime,this.pauseTime=void 0,this.frameRequestId=requestAnimationFrame(this.tick)}pause(){this.playState="paused",this.pauseTime=this.t}finish(){this.playState="finished",this.tick(0)}stop(){var e;this.playState="idle",this.frameRequestId!==void 0&&cancelAnimationFrame(this.frameRequestId),(e=this.reject)===null||e===void 0||e.call(this,!1)}cancel(){this.stop(),this.tick(this.cancelTimestamp)}reverse(){this.rate*=-1}commitStyles(){}updateDuration(e){this.duration=e,this.totalDuration=e*(this.repeat+1)}get currentTime(){return this.t}set currentTime(e){this.pauseTime!==void 0||this.rate===0?this.pauseTime=e:this.startTime=performance.now()-e/this.rate}get playbackRate(){return this.rate}set playbackRate(e){this.rate=e}}var Qh=function(){};process.env.NODE_ENV!=="production"&&(Qh=function(t,e){if(!t)throw new Error(e)});class S9{setAnimation(e){this.animation=e,e?.finished.then(()=>this.clearAnimation()).catch(()=>{})}clearAnimation(){this.animation=this.generator=void 0}}const Xh=new WeakMap;function Sm(t){return Xh.has(t)||Xh.set(t,{transforms:[],values:new Map}),Xh.get(t)}function O9(t,e){return t.has(e)||t.set(e,new S9),t.get(e)}const A9=["","X","Y","Z"],D9=["translate","scale","rotate","skew"],Nc={x:"translateX",y:"translateY",z:"translateZ"},Om={syntax:"<angle>",initialValue:"0deg",toDefaultUnit:t=>t+"deg"},$9={translate:{syntax:"<length-percentage>",initialValue:"0px",toDefaultUnit:t=>t+"px"},rotate:Om,scale:{syntax:"<number>",initialValue:1,toDefaultUnit:Ci},skew:Om},ha=new Map,ef=t=>`--motion-${t}`,Lc=["x","y","z"];D9.forEach(t=>{A9.forEach(e=>{Lc.push(t+e),ha.set(ef(t+e),$9[t])})});const P9=(t,e)=>Lc.indexOf(t)-Lc.indexOf(e),T9=new Set(Lc),Am=t=>T9.has(t),R9=(t,e)=>{Nc[e]&&(e=Nc[e]);const{transforms:r}=Sm(t);g9(r,e),t.style.transform=N9(r)},N9=t=>t.sort(P9).reduce(L9,"").trim(),L9=(t,e)=>`${t} ${e}(var(${ef(e)}))`,tf=t=>t.startsWith("--"),Dm=new Set;function M9(t){if(!Dm.has(t)){Dm.add(t);try{const{syntax:e,initialValue:r}=ha.has(t)?ha.get(t):{};CSS.registerProperty({name:t,inherits:!1,syntax:e,initialValue:r})}catch{}}}const rf=(t,e)=>document.createElement("div").animate(t,e),$m={cssRegisterProperty:()=>typeof CSS<"u"&&Object.hasOwnProperty.call(CSS,"registerProperty"),waapi:()=>Object.hasOwnProperty.call(Element.prototype,"animate"),partialKeyframes:()=>{try{rf({opacity:[1]})}catch{return!1}return!0},finished:()=>!!rf({opacity:[0,1]},{duration:.001}).finished,linearEasing:()=>{try{rf({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0}},nf={},Ks={};for(const t in $m)Ks[t]=()=>(nf[t]===void 0&&(nf[t]=$m[t]()),nf[t]);const U9=.015,j9=(t,e)=>{let r="";const n=Math.round(e/U9);for(let i=0;i<n;i++)r+=t(Yh(0,n-1,i))+", ";return r.substring(0,r.length-2)},Pm=(t,e)=>is(t)?Ks.linearEasing()?`linear(${j9(t,e)})`:dn.easing:_m(t)?F9(t):t,F9=([t,e,r,n])=>`cubic-bezier(${t}, ${e}, ${r}, ${n})`;function B9(t,e){for(let r=0;r<t.length;r++)t[r]===null&&(t[r]=r?t[r-1]:e());return t}const k9=t=>Array.isArray(t)?t:[t];function sf(t){return Nc[t]&&(t=Nc[t]),Am(t)?ef(t):t}const Mc={get:(t,e)=>{e=sf(e);let r=tf(e)?t.style.getPropertyValue(e):getComputedStyle(t)[e];if(!r&&r!==0){const n=ha.get(e);n&&(r=n.initialValue)}return r},set:(t,e,r)=>{e=sf(e),tf(e)?t.style.setProperty(e,r):t.style[e]=r}};function Tm(t,e=!0){if(!(!t||t.playState==="finished"))try{t.stop?t.stop():(e&&t.commitStyles(),t.cancel())}catch{}}function H9(t,e){var r;let n=e?.toDefaultUnit||Ci;const i=t[t.length-1];if(b9(i)){const o=((r=i.match(/(-?[\d.]+)([a-z%]*)/))===null||r===void 0?void 0:r[2])||"";o&&(n=c=>c+o)}return n}function z9(){return window.__MOTION_DEV_TOOLS_RECORD}function W9(t,e,r,n={},i){const o=z9(),c=n.record!==!1&&o;let l,{duration:f=dn.duration,delay:h=dn.delay,endDelay:v=dn.endDelay,repeat:y=dn.repeat,easing:b=dn.easing,persist:x=!1,direction:P,offset:M,allowWebkitAcceleration:H=!1}=n;const V=Sm(t),T=Am(e);let L=Ks.waapi();T&&R9(t,e);const $=sf(e),R=O9(V.values,$),S=ha.get($);return Tm(R.animation,!(Jh(b)&&R.generator)&&n.record!==!1),()=>{const d=()=>{var z,ee;return(ee=(z=Mc.get(t,$))!==null&&z!==void 0?z:S?.initialValue)!==null&&ee!==void 0?ee:0};let C=B9(k9(r),d);const J=H9(C,S);if(Jh(b)){const z=b.createAnimation(C,e!=="opacity",d,$,R);b=z.easing,C=z.keyframes||C,f=z.duration||f}if(tf($)&&(Ks.cssRegisterProperty()?M9($):L=!1),T&&!Ks.linearEasing()&&(is(b)||Vs(b)&&b.some(is))&&(L=!1),L){S&&(C=C.map(de=>Rc(de)?S.toDefaultUnit(de):de)),C.length===1&&(!Ks.partialKeyframes()||c)&&C.unshift(d());const z={delay:la.ms(h),duration:la.ms(f),endDelay:la.ms(v),easing:Vs(b)?void 0:Pm(b,f),direction:P,iterations:y+1,fill:"both"};l=t.animate({[$]:C,offset:M,easing:Vs(b)?b.map(de=>Pm(de,f)):void 0},z),l.finished||(l.finished=new Promise((de,me)=>{l.onfinish=de,l.oncancel=me}));const ee=C[C.length-1];l.finished.then(()=>{x||(Mc.set(t,$,ee),l.cancel())}).catch(ym),H||(l.playbackRate=1.000001)}else if(i&&T)C=C.map(z=>typeof z=="string"?parseFloat(z):z),C.length===1&&C.unshift(parseFloat(d())),l=new i(z=>{Mc.set(t,$,J?J(z):z)},C,Object.assign(Object.assign({},n),{duration:f,easing:b}));else{const z=C[C.length-1];Mc.set(t,$,S&&Rc(z)?S.toDefaultUnit(z):z)}return c&&o(t,e,C,{duration:f,delay:h,easing:b,repeat:y,offset:M},"motion-one"),R.setAnimation(l),l}}const q9=(t,e)=>t[e]?Object.assign(Object.assign({},t),t[e]):Object.assign({},t);function Rm(t,e){var r;return typeof t=="string"?e?((r=e[t])!==null&&r!==void 0||(e[t]=document.querySelectorAll(t)),t=e[t]):t=document.querySelectorAll(t):t instanceof Element&&(t=[t]),Array.from(t||[])}const V9=t=>t(),Nm=(t,e,r=dn.duration)=>new Proxy({animations:t.map(V9).filter(Boolean),duration:r,options:e},G9),K9=t=>t.animations[0],G9={get:(t,e)=>{const r=K9(t);switch(e){case"duration":return t.duration;case"currentTime":return la.s(r?.[e]||0);case"playbackRate":case"playState":return r?.[e];case"finished":return t.finished||(t.finished=Promise.all(t.animations.map(Z9)).catch(ym)),t.finished;case"stop":return()=>{t.animations.forEach(n=>Tm(n))};case"forEachNative":return n=>{t.animations.forEach(i=>n(i,t))};default:return typeof r?.[e]>"u"?void 0:()=>t.animations.forEach(n=>n[e]())}},set:(t,e,r)=>{switch(e){case"currentTime":r=la.ms(r);case"currentTime":case"playbackRate":for(let n=0;n<t.animations.length;n++)t.animations[n][e]=r;return!0}return!1}},Z9=t=>t.finished;function Y9(t,e,r){return is(t)?t(e,r):t}function J9(t){return function(r,n,i={}){r=Rm(r);const o=r.length;Qh(!!o,"No valid element provided."),Qh(!!n,"No keyframes defined.");const c=[];for(let l=0;l<o;l++){const f=r[l];for(const h in n){const v=q9(i,h);v.delay=Y9(v.delay,l,o);const y=W9(f,h,n[h],v,t);c.push(y)}}return Nm(c,i,i.duration)}}const Q9=J9(Im);function X9(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]]);return r}const eC={any:0,all:1};function tC(t,e,{root:r,margin:n,amount:i="any"}={}){if(typeof IntersectionObserver>"u")return()=>{};const o=Rm(t),c=new WeakMap,l=h=>{h.forEach(v=>{const y=c.get(v.target);if(v.isIntersecting!==!!y)if(v.isIntersecting){const b=e(v);is(b)?c.set(v.target,b):f.unobserve(v.target)}else y&&(y(v),c.delete(v.target))})},f=new IntersectionObserver(l,{root:r,rootMargin:n,threshold:typeof i=="number"?i:eC[i]});return o.forEach(h=>f.observe(h)),()=>f.disconnect()}function of(t,e,r){t.dispatchEvent(new CustomEvent(e,{detail:{originalEvent:r}}))}function Lm(t,e,r){t.dispatchEvent(new CustomEvent(e,{detail:{originalEntry:r}}))}const rC={isActive:t=>!!t.inView,subscribe:(t,{enable:e,disable:r},{inViewOptions:n={}})=>{const{once:i}=n,o=X9(n,["once"]);return tC(t,c=>{if(e(),Lm(t,"viewenter",c),!i)return l=>{r(),Lm(t,"viewleave",l)}},o)}},Mm=(t,e,r)=>n=>{n.pointerType&&n.pointerType!=="mouse"||(r(),of(t,e,n))};[...Object.keys({inView:rC,hover:{isActive:t=>!!t.hover,subscribe:(t,{enable:e,disable:r})=>{const n=Mm(t,"hoverstart",e),i=Mm(t,"hoverend",r);return t.addEventListener("pointerenter",n),t.addEventListener("pointerleave",i),()=>{t.removeEventListener("pointerenter",n),t.removeEventListener("pointerleave",i)}}},press:{isActive:t=>!!t.press,subscribe:(t,{enable:e,disable:r})=>{const n=o=>{r(),of(t,"pressend",o),window.removeEventListener("pointerup",n)},i=o=>{e(),of(t,"pressstart",o),window.addEventListener("pointerup",n)};return t.addEventListener("pointerdown",i),()=>{t.removeEventListener("pointerdown",i),window.removeEventListener("pointerup",n)}}}})];function nC(t,e={}){return Nm([()=>{const r=new Im(t,[0,1],e);return r.finished.catch(()=>{}),r}],e,e.duration)}function ss(t,e,r){return(is(t)?nC:Q9)(t,e,r)}var fa={},iC=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then},Um={},tn={};let af;const sC=[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];tn.getSymbolSize=function(e){if(!e)throw new Error('"version" cannot be null or undefined');if(e<1||e>40)throw new Error('"version" should be in range from 1 to 40');return e*4+17},tn.getSymbolTotalCodewords=function(e){return sC[e]},tn.getBCHDigit=function(t){let e=0;for(;t!==0;)e++,t>>>=1;return e},tn.setToSJISFunction=function(e){if(typeof e!="function")throw new Error('"toSJISFunc" is not a valid function.');af=e},tn.isKanjiModeEnabled=function(){return typeof af<"u"},tn.toSJIS=function(e){return af(e)};var Uc={};(function(t){t.L={bit:1},t.M={bit:0},t.Q={bit:3},t.H={bit:2};function e(r){if(typeof r!="string")throw new Error("Param is not a string");switch(r.toLowerCase()){case"l":case"low":return t.L;case"m":case"medium":return t.M;case"q":case"quartile":return t.Q;case"h":case"high":return t.H;default:throw new Error("Unknown EC Level: "+r)}}t.isValid=function(n){return n&&typeof n.bit<"u"&&n.bit>=0&&n.bit<4},t.from=function(n,i){if(t.isValid(n))return n;try{return e(n)}catch{return i}}})(Uc);function jm(){this.buffer=[],this.length=0}jm.prototype={get:function(t){const e=Math.floor(t/8);return(this.buffer[e]>>>7-t%8&1)===1},put:function(t,e){for(let r=0;r<e;r++)this.putBit((t>>>e-r-1&1)===1)},getLengthInBits:function(){return this.length},putBit:function(t){const e=Math.floor(this.length/8);this.buffer.length<=e&&this.buffer.push(0),t&&(this.buffer[e]|=128>>>this.length%8),this.length++}};var oC=jm;function da(t){if(!t||t<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=t,this.data=new Uint8Array(t*t),this.reservedBit=new Uint8Array(t*t)}da.prototype.set=function(t,e,r,n){const i=t*this.size+e;this.data[i]=r,n&&(this.reservedBit[i]=!0)},da.prototype.get=function(t,e){return this.data[t*this.size+e]},da.prototype.xor=function(t,e,r){this.data[t*this.size+e]^=r},da.prototype.isReserved=function(t,e){return this.reservedBit[t*this.size+e]};var aC=da,Fm={};(function(t){const e=tn.getSymbolSize;t.getRowColCoords=function(n){if(n===1)return[];const i=Math.floor(n/7)+2,o=e(n),c=o===145?26:Math.ceil((o-13)/(2*i-2))*2,l=[o-7];for(let f=1;f<i-1;f++)l[f]=l[f-1]-c;return l.push(6),l.reverse()},t.getPositions=function(n){const i=[],o=t.getRowColCoords(n),c=o.length;for(let l=0;l<c;l++)for(let f=0;f<c;f++)l===0&&f===0||l===0&&f===c-1||l===c-1&&f===0||i.push([o[l],o[f]]);return i}})(Fm);var Bm={};const cC=tn.getSymbolSize,km=7;Bm.getPositions=function(e){const r=cC(e);return[[0,0],[r-km,0],[0,r-km]]};var Hm={};(function(t){t.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};const e={N1:3,N2:3,N3:40,N4:10};t.isValid=function(i){return i!=null&&i!==""&&!isNaN(i)&&i>=0&&i<=7},t.from=function(i){return t.isValid(i)?parseInt(i,10):void 0},t.getPenaltyN1=function(i){const o=i.size;let c=0,l=0,f=0,h=null,v=null;for(let y=0;y<o;y++){l=f=0,h=v=null;for(let b=0;b<o;b++){let x=i.get(y,b);x===h?l++:(l>=5&&(c+=e.N1+(l-5)),h=x,l=1),x=i.get(b,y),x===v?f++:(f>=5&&(c+=e.N1+(f-5)),v=x,f=1)}l>=5&&(c+=e.N1+(l-5)),f>=5&&(c+=e.N1+(f-5))}return c},t.getPenaltyN2=function(i){const o=i.size;let c=0;for(let l=0;l<o-1;l++)for(let f=0;f<o-1;f++){const h=i.get(l,f)+i.get(l,f+1)+i.get(l+1,f)+i.get(l+1,f+1);(h===4||h===0)&&c++}return c*e.N2},t.getPenaltyN3=function(i){const o=i.size;let c=0,l=0,f=0;for(let h=0;h<o;h++){l=f=0;for(let v=0;v<o;v++)l=l<<1&2047|i.get(h,v),v>=10&&(l===1488||l===93)&&c++,f=f<<1&2047|i.get(v,h),v>=10&&(f===1488||f===93)&&c++}return c*e.N3},t.getPenaltyN4=function(i){let o=0;const c=i.data.length;for(let f=0;f<c;f++)o+=i.data[f];return Math.abs(Math.ceil(o*100/c/5)-10)*e.N4};function r(n,i,o){switch(n){case t.Patterns.PATTERN000:return(i+o)%2===0;case t.Patterns.PATTERN001:return i%2===0;case t.Patterns.PATTERN010:return o%3===0;case t.Patterns.PATTERN011:return(i+o)%3===0;case t.Patterns.PATTERN100:return(Math.floor(i/2)+Math.floor(o/3))%2===0;case t.Patterns.PATTERN101:return i*o%2+i*o%3===0;case t.Patterns.PATTERN110:return(i*o%2+i*o%3)%2===0;case t.Patterns.PATTERN111:return(i*o%3+(i+o)%2)%2===0;default:throw new Error("bad maskPattern:"+n)}}t.applyMask=function(i,o){const c=o.size;for(let l=0;l<c;l++)for(let f=0;f<c;f++)o.isReserved(f,l)||o.xor(f,l,r(i,f,l))},t.getBestMask=function(i,o){const c=Object.keys(t.Patterns).length;let l=0,f=1/0;for(let h=0;h<c;h++){o(h),t.applyMask(h,i);const v=t.getPenaltyN1(i)+t.getPenaltyN2(i)+t.getPenaltyN3(i)+t.getPenaltyN4(i);t.applyMask(h,i),v<f&&(f=v,l=h)}return l}})(Hm);var jc={};const Ii=Uc,Fc=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],Bc=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];jc.getBlocksCount=function(e,r){switch(r){case Ii.L:return Fc[(e-1)*4+0];case Ii.M:return Fc[(e-1)*4+1];case Ii.Q:return Fc[(e-1)*4+2];case Ii.H:return Fc[(e-1)*4+3];default:return}},jc.getTotalCodewordsCount=function(e,r){switch(r){case Ii.L:return Bc[(e-1)*4+0];case Ii.M:return Bc[(e-1)*4+1];case Ii.Q:return Bc[(e-1)*4+2];case Ii.H:return Bc[(e-1)*4+3];default:return}};var zm={},kc={};const pa=new Uint8Array(512),Hc=new Uint8Array(256);(function(){let e=1;for(let r=0;r<255;r++)pa[r]=e,Hc[e]=r,e<<=1,e&256&&(e^=285);for(let r=255;r<512;r++)pa[r]=pa[r-255]})(),kc.log=function(e){if(e<1)throw new Error("log("+e+")");return Hc[e]},kc.exp=function(e){return pa[e]},kc.mul=function(e,r){return e===0||r===0?0:pa[Hc[e]+Hc[r]]},function(t){const e=kc;t.mul=function(n,i){const o=new Uint8Array(n.length+i.length-1);for(let c=0;c<n.length;c++)for(let l=0;l<i.length;l++)o[c+l]^=e.mul(n[c],i[l]);return o},t.mod=function(n,i){let o=new Uint8Array(n);for(;o.length-i.length>=0;){const c=o[0];for(let f=0;f<i.length;f++)o[f]^=e.mul(i[f],c);let l=0;for(;l<o.length&&o[l]===0;)l++;o=o.slice(l)}return o},t.generateECPolynomial=function(n){let i=new Uint8Array([1]);for(let o=0;o<n;o++)i=t.mul(i,new Uint8Array([1,e.exp(o)]));return i}}(zm);const Wm=zm;function cf(t){this.genPoly=void 0,this.degree=t,this.degree&&this.initialize(this.degree)}cf.prototype.initialize=function(e){this.degree=e,this.genPoly=Wm.generateECPolynomial(this.degree)},cf.prototype.encode=function(e){if(!this.genPoly)throw new Error("Encoder not initialized");const r=new Uint8Array(e.length+this.degree);r.set(e);const n=Wm.mod(r,this.genPoly),i=this.degree-n.length;if(i>0){const o=new Uint8Array(this.degree);return o.set(n,i),o}return n};var lC=cf,qm={},Si={},lf={};lf.isValid=function(e){return!isNaN(e)&&e>=1&&e<=40};var Fn={};const Vm="[0-9]+",uC="[A-Z $%*+\\-./:]+";let ga="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";ga=ga.replace(/u/g,"\\u");const hC="(?:(?![A-Z0-9 $%*+\\-./:]|"+ga+`)(?:.|[\r
132
+ */const Mr=d9(class extends p9{constructor(t){var e;if(super(t),t.type!==f9.ATTRIBUTE||t.name!=="class"||((e=t.strings)===null||e===void 0?void 0:e.length)>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(t){return" "+Object.keys(t).filter(e=>t[e]).join(" ")+" "}update(t,[e]){var r,n;if(this.it===void 0){this.it=new Set,t.strings!==void 0&&(this.nt=new Set(t.strings.join(" ").split(/\s/).filter(o=>o!=="")));for(const o in e)e[o]&&!(!((r=this.nt)===null||r===void 0)&&r.has(o))&&this.it.add(o);return this.render(e)}const i=t.element.classList;this.it.forEach(o=>{o in e||(i.remove(o),this.it.delete(o))});for(const o in e){const c=!!e[o];c===this.it.has(o)||!((n=this.nt)===null||n===void 0)&&n.has(o)||(c?(i.add(o),this.it.add(o)):(i.remove(o),this.it.delete(o)))}return rs}});function g9(t,e){t.indexOf(e)===-1&&t.push(e)}const wm=(t,e,r)=>Math.min(Math.max(r,t),e),dn={duration:.3,delay:0,endDelay:0,repeat:0,easing:"ease"},Rc=t=>typeof t=="number",Vs=t=>Array.isArray(t)&&!Rc(t[0]),m9=(t,e,r)=>{const n=e-t;return((r-t)%n+n)%n+t};function w9(t,e){return Vs(t)?t[m9(0,t.length,e)]:t}const vm=(t,e,r)=>-r*t+r*e+t,ym=()=>{},Ci=t=>t,Yh=(t,e,r)=>e-t===0?1:(r-t)/(e-t);function bm(t,e){const r=t[t.length-1];for(let n=1;n<=e;n++){const i=Yh(0,e,n);t.push(vm(r,1,i))}}function v9(t){const e=[0];return bm(e,t-1),e}function y9(t,e=v9(t.length),r=Ci){const n=t.length,i=n-e.length;return i>0&&bm(e,i),o=>{let c=0;for(;c<n-2&&!(o<e[c+1]);c++);let l=wm(0,1,Yh(e[c],e[c+1],o));return l=w9(r,c)(l),vm(t[c],t[c+1],l)}}const _m=t=>Array.isArray(t)&&Rc(t[0]),Jh=t=>typeof t=="object"&&!!t.createAnimation,is=t=>typeof t=="function",b9=t=>typeof t=="string",la={ms:t=>t*1e3,s:t=>t/1e3},Em=(t,e,r)=>(((1-3*r+3*e)*t+(3*r-6*e))*t+3*e)*t,_9=1e-7,E9=12;function x9(t,e,r,n,i){let o,c,l=0;do c=e+(r-e)/2,o=Em(c,n,i)-t,o>0?r=c:e=c;while(Math.abs(o)>_9&&++l<E9);return c}function ua(t,e,r,n){if(t===e&&r===n)return Ci;const i=o=>x9(o,0,1,t,r);return o=>o===0||o===1?o:Em(i(o),e,n)}const C9=(t,e="end")=>r=>{r=e==="end"?Math.min(r,.999):Math.max(r,.001);const n=r*t,i=e==="end"?Math.floor(n):Math.ceil(n);return wm(0,1,i/t)},xm={ease:ua(.25,.1,.25,1),"ease-in":ua(.42,0,1,1),"ease-in-out":ua(.42,0,.58,1),"ease-out":ua(0,0,.58,1)},I9=/\((.*?)\)/;function Cm(t){if(is(t))return t;if(_m(t))return ua(...t);if(xm[t])return xm[t];if(t.startsWith("steps")){const e=I9.exec(t);if(e){const r=e[1].split(",");return C9(parseFloat(r[0]),r[1].trim())}}return Ci}class Im{constructor(e,r=[0,1],{easing:n,duration:i=dn.duration,delay:o=dn.delay,endDelay:c=dn.endDelay,repeat:l=dn.repeat,offset:f,direction:h="normal"}={}){if(this.startTime=null,this.rate=1,this.t=0,this.cancelTimestamp=null,this.easing=Ci,this.duration=0,this.totalDuration=0,this.repeat=0,this.playState="idle",this.finished=new Promise((y,b)=>{this.resolve=y,this.reject=b}),n=n||dn.easing,Jh(n)){const y=n.createAnimation(r);n=y.easing,r=y.keyframes||r,i=y.duration||i}this.repeat=l,this.easing=Vs(n)?Ci:Cm(n),this.updateDuration(i);const v=y9(r,f,Vs(n)?n.map(Cm):Ci);this.tick=y=>{var b;o=o;let x=0;this.pauseTime!==void 0?x=this.pauseTime:x=(y-this.startTime)*this.rate,this.t=x,x/=1e3,x=Math.max(x-o,0),this.playState==="finished"&&this.pauseTime===void 0&&(x=this.totalDuration);const P=x/this.duration;let M=Math.floor(P),H=P%1;!H&&P>=1&&(H=1),H===1&&M--;const V=M%2;(h==="reverse"||h==="alternate"&&V||h==="alternate-reverse"&&!V)&&(H=1-H);const T=x>=this.totalDuration?1:Math.min(H,1),L=v(this.easing(T));e(L),this.pauseTime===void 0&&(this.playState==="finished"||x>=this.totalDuration+c)?(this.playState="finished",(b=this.resolve)===null||b===void 0||b.call(this,L)):this.playState!=="idle"&&(this.frameRequestId=requestAnimationFrame(this.tick))},this.play()}play(){const e=performance.now();this.playState="running",this.pauseTime!==void 0?this.startTime=e-this.pauseTime:this.startTime||(this.startTime=e),this.cancelTimestamp=this.startTime,this.pauseTime=void 0,this.frameRequestId=requestAnimationFrame(this.tick)}pause(){this.playState="paused",this.pauseTime=this.t}finish(){this.playState="finished",this.tick(0)}stop(){var e;this.playState="idle",this.frameRequestId!==void 0&&cancelAnimationFrame(this.frameRequestId),(e=this.reject)===null||e===void 0||e.call(this,!1)}cancel(){this.stop(),this.tick(this.cancelTimestamp)}reverse(){this.rate*=-1}commitStyles(){}updateDuration(e){this.duration=e,this.totalDuration=e*(this.repeat+1)}get currentTime(){return this.t}set currentTime(e){this.pauseTime!==void 0||this.rate===0?this.pauseTime=e:this.startTime=performance.now()-e/this.rate}get playbackRate(){return this.rate}set playbackRate(e){this.rate=e}}var Qh=function(){};process.env.NODE_ENV!=="production"&&(Qh=function(t,e){if(!t)throw new Error(e)});class S9{setAnimation(e){this.animation=e,e?.finished.then(()=>this.clearAnimation()).catch(()=>{})}clearAnimation(){this.animation=this.generator=void 0}}const Xh=new WeakMap;function Sm(t){return Xh.has(t)||Xh.set(t,{transforms:[],values:new Map}),Xh.get(t)}function O9(t,e){return t.has(e)||t.set(e,new S9),t.get(e)}const A9=["","X","Y","Z"],D9=["translate","scale","rotate","skew"],Nc={x:"translateX",y:"translateY",z:"translateZ"},Om={syntax:"<angle>",initialValue:"0deg",toDefaultUnit:t=>t+"deg"},$9={translate:{syntax:"<length-percentage>",initialValue:"0px",toDefaultUnit:t=>t+"px"},rotate:Om,scale:{syntax:"<number>",initialValue:1,toDefaultUnit:Ci},skew:Om},ha=new Map,ef=t=>`--motion-${t}`,Lc=["x","y","z"];D9.forEach(t=>{A9.forEach(e=>{Lc.push(t+e),ha.set(ef(t+e),$9[t])})});const P9=(t,e)=>Lc.indexOf(t)-Lc.indexOf(e),T9=new Set(Lc),Am=t=>T9.has(t),R9=(t,e)=>{Nc[e]&&(e=Nc[e]);const{transforms:r}=Sm(t);g9(r,e),t.style.transform=N9(r)},N9=t=>t.sort(P9).reduce(L9,"").trim(),L9=(t,e)=>`${t} ${e}(var(${ef(e)}))`,tf=t=>t.startsWith("--"),Dm=new Set;function M9(t){if(!Dm.has(t)){Dm.add(t);try{const{syntax:e,initialValue:r}=ha.has(t)?ha.get(t):{};CSS.registerProperty({name:t,inherits:!1,syntax:e,initialValue:r})}catch{}}}const rf=(t,e)=>document.createElement("div").animate(t,e),$m={cssRegisterProperty:()=>typeof CSS<"u"&&Object.hasOwnProperty.call(CSS,"registerProperty"),waapi:()=>Object.hasOwnProperty.call(Element.prototype,"animate"),partialKeyframes:()=>{try{rf({opacity:[1]})}catch{return!1}return!0},finished:()=>!!rf({opacity:[0,1]},{duration:.001}).finished,linearEasing:()=>{try{rf({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0}},nf={},Ks={};for(const t in $m)Ks[t]=()=>(nf[t]===void 0&&(nf[t]=$m[t]()),nf[t]);const U9=.015,j9=(t,e)=>{let r="";const n=Math.round(e/U9);for(let i=0;i<n;i++)r+=t(Yh(0,n-1,i))+", ";return r.substring(0,r.length-2)},Pm=(t,e)=>is(t)?Ks.linearEasing()?`linear(${j9(t,e)})`:dn.easing:_m(t)?F9(t):t,F9=([t,e,r,n])=>`cubic-bezier(${t}, ${e}, ${r}, ${n})`;function B9(t,e){for(let r=0;r<t.length;r++)t[r]===null&&(t[r]=r?t[r-1]:e());return t}const k9=t=>Array.isArray(t)?t:[t];function sf(t){return Nc[t]&&(t=Nc[t]),Am(t)?ef(t):t}const Mc={get:(t,e)=>{e=sf(e);let r=tf(e)?t.style.getPropertyValue(e):getComputedStyle(t)[e];if(!r&&r!==0){const n=ha.get(e);n&&(r=n.initialValue)}return r},set:(t,e,r)=>{e=sf(e),tf(e)?t.style.setProperty(e,r):t.style[e]=r}};function Tm(t,e=!0){if(!(!t||t.playState==="finished"))try{t.stop?t.stop():(e&&t.commitStyles(),t.cancel())}catch{}}function H9(t,e){var r;let n=e?.toDefaultUnit||Ci;const i=t[t.length-1];if(b9(i)){const o=((r=i.match(/(-?[\d.]+)([a-z%]*)/))===null||r===void 0?void 0:r[2])||"";o&&(n=c=>c+o)}return n}function z9(){return window.__MOTION_DEV_TOOLS_RECORD}function W9(t,e,r,n={},i){const o=z9(),c=n.record!==!1&&o;let l,{duration:f=dn.duration,delay:h=dn.delay,endDelay:v=dn.endDelay,repeat:y=dn.repeat,easing:b=dn.easing,persist:x=!1,direction:P,offset:M,allowWebkitAcceleration:H=!1}=n;const V=Sm(t),T=Am(e);let L=Ks.waapi();T&&R9(t,e);const $=sf(e),R=O9(V.values,$),S=ha.get($);return Tm(R.animation,!(Jh(b)&&R.generator)&&n.record!==!1),()=>{const d=()=>{var z,ee;return(ee=(z=Mc.get(t,$))!==null&&z!==void 0?z:S?.initialValue)!==null&&ee!==void 0?ee:0};let C=B9(k9(r),d);const J=H9(C,S);if(Jh(b)){const z=b.createAnimation(C,e!=="opacity",d,$,R);b=z.easing,C=z.keyframes||C,f=z.duration||f}if(tf($)&&(Ks.cssRegisterProperty()?M9($):L=!1),T&&!Ks.linearEasing()&&(is(b)||Vs(b)&&b.some(is))&&(L=!1),L){S&&(C=C.map(de=>Rc(de)?S.toDefaultUnit(de):de)),C.length===1&&(!Ks.partialKeyframes()||c)&&C.unshift(d());const z={delay:la.ms(h),duration:la.ms(f),endDelay:la.ms(v),easing:Vs(b)?void 0:Pm(b,f),direction:P,iterations:y+1,fill:"both"};l=t.animate({[$]:C,offset:M,easing:Vs(b)?b.map(de=>Pm(de,f)):void 0},z),l.finished||(l.finished=new Promise((de,me)=>{l.onfinish=de,l.oncancel=me}));const ee=C[C.length-1];l.finished.then(()=>{x||(Mc.set(t,$,ee),l.cancel())}).catch(ym),H||(l.playbackRate=1.000001)}else if(i&&T)C=C.map(z=>typeof z=="string"?parseFloat(z):z),C.length===1&&C.unshift(parseFloat(d())),l=new i(z=>{Mc.set(t,$,J?J(z):z)},C,Object.assign(Object.assign({},n),{duration:f,easing:b}));else{const z=C[C.length-1];Mc.set(t,$,S&&Rc(z)?S.toDefaultUnit(z):z)}return c&&o(t,e,C,{duration:f,delay:h,easing:b,repeat:y,offset:M},"motion-one"),R.setAnimation(l),l}}const q9=(t,e)=>t[e]?Object.assign(Object.assign({},t),t[e]):Object.assign({},t);function Rm(t,e){var r;return typeof t=="string"?e?((r=e[t])!==null&&r!==void 0||(e[t]=document.querySelectorAll(t)),t=e[t]):t=document.querySelectorAll(t):t instanceof Element&&(t=[t]),Array.from(t||[])}const V9=t=>t(),Nm=(t,e,r=dn.duration)=>new Proxy({animations:t.map(V9).filter(Boolean),duration:r,options:e},G9),K9=t=>t.animations[0],G9={get:(t,e)=>{const r=K9(t);switch(e){case"duration":return t.duration;case"currentTime":return la.s(r?.[e]||0);case"playbackRate":case"playState":return r?.[e];case"finished":return t.finished||(t.finished=Promise.all(t.animations.map(Z9)).catch(ym)),t.finished;case"stop":return()=>{t.animations.forEach(n=>Tm(n))};case"forEachNative":return n=>{t.animations.forEach(i=>n(i,t))};default:return typeof r?.[e]>"u"?void 0:()=>t.animations.forEach(n=>n[e]())}},set:(t,e,r)=>{switch(e){case"currentTime":r=la.ms(r);case"currentTime":case"playbackRate":for(let n=0;n<t.animations.length;n++)t.animations[n][e]=r;return!0}return!1}},Z9=t=>t.finished;function Y9(t,e,r){return is(t)?t(e,r):t}function J9(t){return function(r,n,i={}){r=Rm(r);const o=r.length;Qh(!!o,"No valid element provided."),Qh(!!n,"No keyframes defined.");const c=[];for(let l=0;l<o;l++){const f=r[l];for(const h in n){const v=q9(i,h);v.delay=Y9(v.delay,l,o);const y=W9(f,h,n[h],v,t);c.push(y)}}return Nm(c,i,i.duration)}}const Q9=J9(Im);function X9(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]]);return r}typeof SuppressedError=="function"&&SuppressedError;const eC={any:0,all:1};function tC(t,e,{root:r,margin:n,amount:i="any"}={}){if(typeof IntersectionObserver>"u")return()=>{};const o=Rm(t),c=new WeakMap,l=h=>{h.forEach(v=>{const y=c.get(v.target);if(v.isIntersecting!==!!y)if(v.isIntersecting){const b=e(v);is(b)?c.set(v.target,b):f.unobserve(v.target)}else y&&(y(v),c.delete(v.target))})},f=new IntersectionObserver(l,{root:r,rootMargin:n,threshold:typeof i=="number"?i:eC[i]});return o.forEach(h=>f.observe(h)),()=>f.disconnect()}function of(t,e,r){t.dispatchEvent(new CustomEvent(e,{detail:{originalEvent:r}}))}function Lm(t,e,r){t.dispatchEvent(new CustomEvent(e,{detail:{originalEntry:r}}))}const rC={isActive:t=>!!t.inView,subscribe:(t,{enable:e,disable:r},{inViewOptions:n={}})=>{const{once:i}=n,o=X9(n,["once"]);return tC(t,c=>{if(e(),Lm(t,"viewenter",c),!i)return l=>{r(),Lm(t,"viewleave",l)}},o)}},Mm=(t,e,r)=>n=>{n.pointerType&&n.pointerType!=="mouse"||(r(),of(t,e,n))};[...Object.keys({inView:rC,hover:{isActive:t=>!!t.hover,subscribe:(t,{enable:e,disable:r})=>{const n=Mm(t,"hoverstart",e),i=Mm(t,"hoverend",r);return t.addEventListener("pointerenter",n),t.addEventListener("pointerleave",i),()=>{t.removeEventListener("pointerenter",n),t.removeEventListener("pointerleave",i)}}},press:{isActive:t=>!!t.press,subscribe:(t,{enable:e,disable:r})=>{const n=o=>{r(),of(t,"pressend",o),window.removeEventListener("pointerup",n)},i=o=>{e(),of(t,"pressstart",o),window.addEventListener("pointerup",n)};return t.addEventListener("pointerdown",i),()=>{t.removeEventListener("pointerdown",i),window.removeEventListener("pointerup",n)}}}})];function nC(t,e={}){return Nm([()=>{const r=new Im(t,[0,1],e);return r.finished.catch(()=>{}),r}],e,e.duration)}function ss(t,e,r){return(is(t)?nC:Q9)(t,e,r)}var fa={},iC=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then},Um={},tn={};let af;const sC=[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];tn.getSymbolSize=function(e){if(!e)throw new Error('"version" cannot be null or undefined');if(e<1||e>40)throw new Error('"version" should be in range from 1 to 40');return e*4+17},tn.getSymbolTotalCodewords=function(e){return sC[e]},tn.getBCHDigit=function(t){let e=0;for(;t!==0;)e++,t>>>=1;return e},tn.setToSJISFunction=function(e){if(typeof e!="function")throw new Error('"toSJISFunc" is not a valid function.');af=e},tn.isKanjiModeEnabled=function(){return typeof af<"u"},tn.toSJIS=function(e){return af(e)};var Uc={};(function(t){t.L={bit:1},t.M={bit:0},t.Q={bit:3},t.H={bit:2};function e(r){if(typeof r!="string")throw new Error("Param is not a string");switch(r.toLowerCase()){case"l":case"low":return t.L;case"m":case"medium":return t.M;case"q":case"quartile":return t.Q;case"h":case"high":return t.H;default:throw new Error("Unknown EC Level: "+r)}}t.isValid=function(n){return n&&typeof n.bit<"u"&&n.bit>=0&&n.bit<4},t.from=function(n,i){if(t.isValid(n))return n;try{return e(n)}catch{return i}}})(Uc);function jm(){this.buffer=[],this.length=0}jm.prototype={get:function(t){const e=Math.floor(t/8);return(this.buffer[e]>>>7-t%8&1)===1},put:function(t,e){for(let r=0;r<e;r++)this.putBit((t>>>e-r-1&1)===1)},getLengthInBits:function(){return this.length},putBit:function(t){const e=Math.floor(this.length/8);this.buffer.length<=e&&this.buffer.push(0),t&&(this.buffer[e]|=128>>>this.length%8),this.length++}};var oC=jm;function da(t){if(!t||t<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=t,this.data=new Uint8Array(t*t),this.reservedBit=new Uint8Array(t*t)}da.prototype.set=function(t,e,r,n){const i=t*this.size+e;this.data[i]=r,n&&(this.reservedBit[i]=!0)},da.prototype.get=function(t,e){return this.data[t*this.size+e]},da.prototype.xor=function(t,e,r){this.data[t*this.size+e]^=r},da.prototype.isReserved=function(t,e){return this.reservedBit[t*this.size+e]};var aC=da,Fm={};(function(t){const e=tn.getSymbolSize;t.getRowColCoords=function(n){if(n===1)return[];const i=Math.floor(n/7)+2,o=e(n),c=o===145?26:Math.ceil((o-13)/(2*i-2))*2,l=[o-7];for(let f=1;f<i-1;f++)l[f]=l[f-1]-c;return l.push(6),l.reverse()},t.getPositions=function(n){const i=[],o=t.getRowColCoords(n),c=o.length;for(let l=0;l<c;l++)for(let f=0;f<c;f++)l===0&&f===0||l===0&&f===c-1||l===c-1&&f===0||i.push([o[l],o[f]]);return i}})(Fm);var Bm={};const cC=tn.getSymbolSize,km=7;Bm.getPositions=function(e){const r=cC(e);return[[0,0],[r-km,0],[0,r-km]]};var Hm={};(function(t){t.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};const e={N1:3,N2:3,N3:40,N4:10};t.isValid=function(i){return i!=null&&i!==""&&!isNaN(i)&&i>=0&&i<=7},t.from=function(i){return t.isValid(i)?parseInt(i,10):void 0},t.getPenaltyN1=function(i){const o=i.size;let c=0,l=0,f=0,h=null,v=null;for(let y=0;y<o;y++){l=f=0,h=v=null;for(let b=0;b<o;b++){let x=i.get(y,b);x===h?l++:(l>=5&&(c+=e.N1+(l-5)),h=x,l=1),x=i.get(b,y),x===v?f++:(f>=5&&(c+=e.N1+(f-5)),v=x,f=1)}l>=5&&(c+=e.N1+(l-5)),f>=5&&(c+=e.N1+(f-5))}return c},t.getPenaltyN2=function(i){const o=i.size;let c=0;for(let l=0;l<o-1;l++)for(let f=0;f<o-1;f++){const h=i.get(l,f)+i.get(l,f+1)+i.get(l+1,f)+i.get(l+1,f+1);(h===4||h===0)&&c++}return c*e.N2},t.getPenaltyN3=function(i){const o=i.size;let c=0,l=0,f=0;for(let h=0;h<o;h++){l=f=0;for(let v=0;v<o;v++)l=l<<1&2047|i.get(h,v),v>=10&&(l===1488||l===93)&&c++,f=f<<1&2047|i.get(v,h),v>=10&&(f===1488||f===93)&&c++}return c*e.N3},t.getPenaltyN4=function(i){let o=0;const c=i.data.length;for(let f=0;f<c;f++)o+=i.data[f];return Math.abs(Math.ceil(o*100/c/5)-10)*e.N4};function r(n,i,o){switch(n){case t.Patterns.PATTERN000:return(i+o)%2===0;case t.Patterns.PATTERN001:return i%2===0;case t.Patterns.PATTERN010:return o%3===0;case t.Patterns.PATTERN011:return(i+o)%3===0;case t.Patterns.PATTERN100:return(Math.floor(i/2)+Math.floor(o/3))%2===0;case t.Patterns.PATTERN101:return i*o%2+i*o%3===0;case t.Patterns.PATTERN110:return(i*o%2+i*o%3)%2===0;case t.Patterns.PATTERN111:return(i*o%3+(i+o)%2)%2===0;default:throw new Error("bad maskPattern:"+n)}}t.applyMask=function(i,o){const c=o.size;for(let l=0;l<c;l++)for(let f=0;f<c;f++)o.isReserved(f,l)||o.xor(f,l,r(i,f,l))},t.getBestMask=function(i,o){const c=Object.keys(t.Patterns).length;let l=0,f=1/0;for(let h=0;h<c;h++){o(h),t.applyMask(h,i);const v=t.getPenaltyN1(i)+t.getPenaltyN2(i)+t.getPenaltyN3(i)+t.getPenaltyN4(i);t.applyMask(h,i),v<f&&(f=v,l=h)}return l}})(Hm);var jc={};const Ii=Uc,Fc=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],Bc=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];jc.getBlocksCount=function(e,r){switch(r){case Ii.L:return Fc[(e-1)*4+0];case Ii.M:return Fc[(e-1)*4+1];case Ii.Q:return Fc[(e-1)*4+2];case Ii.H:return Fc[(e-1)*4+3];default:return}},jc.getTotalCodewordsCount=function(e,r){switch(r){case Ii.L:return Bc[(e-1)*4+0];case Ii.M:return Bc[(e-1)*4+1];case Ii.Q:return Bc[(e-1)*4+2];case Ii.H:return Bc[(e-1)*4+3];default:return}};var zm={},kc={};const pa=new Uint8Array(512),Hc=new Uint8Array(256);(function(){let e=1;for(let r=0;r<255;r++)pa[r]=e,Hc[e]=r,e<<=1,e&256&&(e^=285);for(let r=255;r<512;r++)pa[r]=pa[r-255]})(),kc.log=function(e){if(e<1)throw new Error("log("+e+")");return Hc[e]},kc.exp=function(e){return pa[e]},kc.mul=function(e,r){return e===0||r===0?0:pa[Hc[e]+Hc[r]]},function(t){const e=kc;t.mul=function(n,i){const o=new Uint8Array(n.length+i.length-1);for(let c=0;c<n.length;c++)for(let l=0;l<i.length;l++)o[c+l]^=e.mul(n[c],i[l]);return o},t.mod=function(n,i){let o=new Uint8Array(n);for(;o.length-i.length>=0;){const c=o[0];for(let f=0;f<i.length;f++)o[f]^=e.mul(i[f],c);let l=0;for(;l<o.length&&o[l]===0;)l++;o=o.slice(l)}return o},t.generateECPolynomial=function(n){let i=new Uint8Array([1]);for(let o=0;o<n;o++)i=t.mul(i,new Uint8Array([1,e.exp(o)]));return i}}(zm);const Wm=zm;function cf(t){this.genPoly=void 0,this.degree=t,this.degree&&this.initialize(this.degree)}cf.prototype.initialize=function(e){this.degree=e,this.genPoly=Wm.generateECPolynomial(this.degree)},cf.prototype.encode=function(e){if(!this.genPoly)throw new Error("Encoder not initialized");const r=new Uint8Array(e.length+this.degree);r.set(e);const n=Wm.mod(r,this.genPoly),i=this.degree-n.length;if(i>0){const o=new Uint8Array(this.degree);return o.set(n,i),o}return n};var lC=cf,qm={},Si={},lf={};lf.isValid=function(e){return!isNaN(e)&&e>=1&&e<=40};var Fn={};const Vm="[0-9]+",uC="[A-Z $%*+\\-./:]+";let ga="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";ga=ga.replace(/u/g,"\\u");const hC="(?:(?![A-Z0-9 $%*+\\-./:]|"+ga+`)(?:.|[\r
133
133
  ]))+`;Fn.KANJI=new RegExp(ga,"g"),Fn.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g"),Fn.BYTE=new RegExp(hC,"g"),Fn.NUMERIC=new RegExp(Vm,"g"),Fn.ALPHANUMERIC=new RegExp(uC,"g");const fC=new RegExp("^"+ga+"$"),dC=new RegExp("^"+Vm+"$"),pC=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");Fn.testKanji=function(e){return fC.test(e)},Fn.testNumeric=function(e){return dC.test(e)},Fn.testAlphanumeric=function(e){return pC.test(e)},function(t){const e=lf,r=Fn;t.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},t.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},t.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},t.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},t.MIXED={bit:-1},t.getCharCountIndicator=function(o,c){if(!o.ccBits)throw new Error("Invalid mode: "+o);if(!e.isValid(c))throw new Error("Invalid version: "+c);return c>=1&&c<10?o.ccBits[0]:c<27?o.ccBits[1]:o.ccBits[2]},t.getBestModeForData=function(o){return r.testNumeric(o)?t.NUMERIC:r.testAlphanumeric(o)?t.ALPHANUMERIC:r.testKanji(o)?t.KANJI:t.BYTE},t.toString=function(o){if(o&&o.id)return o.id;throw new Error("Invalid mode")},t.isValid=function(o){return o&&o.bit&&o.ccBits};function n(i){if(typeof i!="string")throw new Error("Param is not a string");switch(i.toLowerCase()){case"numeric":return t.NUMERIC;case"alphanumeric":return t.ALPHANUMERIC;case"kanji":return t.KANJI;case"byte":return t.BYTE;default:throw new Error("Unknown mode: "+i)}}t.from=function(o,c){if(t.isValid(o))return o;try{return n(o)}catch{return c}}}(Si),function(t){const e=tn,r=jc,n=Uc,i=Si,o=lf,c=7973,l=e.getBCHDigit(c);function f(b,x,P){for(let M=1;M<=40;M++)if(x<=t.getCapacity(M,P,b))return M}function h(b,x){return i.getCharCountIndicator(b,x)+4}function v(b,x){let P=0;return b.forEach(function(M){const H=h(M.mode,x);P+=H+M.getBitsLength()}),P}function y(b,x){for(let P=1;P<=40;P++)if(v(b,P)<=t.getCapacity(P,x,i.MIXED))return P}t.from=function(x,P){return o.isValid(x)?parseInt(x,10):P},t.getCapacity=function(x,P,M){if(!o.isValid(x))throw new Error("Invalid QR Code version");typeof M>"u"&&(M=i.BYTE);const H=e.getSymbolTotalCodewords(x),V=r.getTotalCodewordsCount(x,P),T=(H-V)*8;if(M===i.MIXED)return T;const L=T-h(M,x);switch(M){case i.NUMERIC:return Math.floor(L/10*3);case i.ALPHANUMERIC:return Math.floor(L/11*2);case i.KANJI:return Math.floor(L/13);case i.BYTE:default:return Math.floor(L/8)}},t.getBestVersionForData=function(x,P){let M;const H=n.from(P,n.M);if(Array.isArray(x)){if(x.length>1)return y(x,H);if(x.length===0)return 1;M=x[0]}else M=x;return f(M.mode,M.getLength(),H)},t.getEncodedBits=function(x){if(!o.isValid(x)||x<7)throw new Error("Invalid QR Code version");let P=x<<12;for(;e.getBCHDigit(P)-l>=0;)P^=c<<e.getBCHDigit(P)-l;return x<<12|P}}(qm);var Km={};const uf=tn,Gm=1335,gC=21522,Zm=uf.getBCHDigit(Gm);Km.getEncodedBits=function(e,r){const n=e.bit<<3|r;let i=n<<10;for(;uf.getBCHDigit(i)-Zm>=0;)i^=Gm<<uf.getBCHDigit(i)-Zm;return(n<<10|i)^gC};var Ym={};const mC=Si;function Gs(t){this.mode=mC.NUMERIC,this.data=t.toString()}Gs.getBitsLength=function(e){return 10*Math.floor(e/3)+(e%3?e%3*3+1:0)},Gs.prototype.getLength=function(){return this.data.length},Gs.prototype.getBitsLength=function(){return Gs.getBitsLength(this.data.length)},Gs.prototype.write=function(e){let r,n,i;for(r=0;r+3<=this.data.length;r+=3)n=this.data.substr(r,3),i=parseInt(n,10),e.put(i,10);const o=this.data.length-r;o>0&&(n=this.data.substr(r),i=parseInt(n,10),e.put(i,o*3+1))};var wC=Gs;const vC=Si,hf=["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 Zs(t){this.mode=vC.ALPHANUMERIC,this.data=t}Zs.getBitsLength=function(e){return 11*Math.floor(e/2)+6*(e%2)},Zs.prototype.getLength=function(){return this.data.length},Zs.prototype.getBitsLength=function(){return Zs.getBitsLength(this.data.length)},Zs.prototype.write=function(e){let r;for(r=0;r+2<=this.data.length;r+=2){let n=hf.indexOf(this.data[r])*45;n+=hf.indexOf(this.data[r+1]),e.put(n,11)}this.data.length%2&&e.put(hf.indexOf(this.data[r]),6)};var yC=Zs,bC=function(e){for(var r=[],n=e.length,i=0;i<n;i++){var o=e.charCodeAt(i);if(o>=55296&&o<=56319&&n>i+1){var c=e.charCodeAt(i+1);c>=56320&&c<=57343&&(o=(o-55296)*1024+c-56320+65536,i+=1)}if(o<128){r.push(o);continue}if(o<2048){r.push(o>>6|192),r.push(o&63|128);continue}if(o<55296||o>=57344&&o<65536){r.push(o>>12|224),r.push(o>>6&63|128),r.push(o&63|128);continue}if(o>=65536&&o<=1114111){r.push(o>>18|240),r.push(o>>12&63|128),r.push(o>>6&63|128),r.push(o&63|128);continue}r.push(239,191,189)}return new Uint8Array(r).buffer};const _C=bC,EC=Si;function Ys(t){this.mode=EC.BYTE,typeof t=="string"&&(t=_C(t)),this.data=new Uint8Array(t)}Ys.getBitsLength=function(e){return e*8},Ys.prototype.getLength=function(){return this.data.length},Ys.prototype.getBitsLength=function(){return Ys.getBitsLength(this.data.length)},Ys.prototype.write=function(t){for(let e=0,r=this.data.length;e<r;e++)t.put(this.data[e],8)};var xC=Ys;const CC=Si,IC=tn;function Js(t){this.mode=CC.KANJI,this.data=t}Js.getBitsLength=function(e){return e*13},Js.prototype.getLength=function(){return this.data.length},Js.prototype.getBitsLength=function(){return Js.getBitsLength(this.data.length)},Js.prototype.write=function(t){let e;for(e=0;e<this.data.length;e++){let r=IC.toSJIS(this.data[e]);if(r>=33088&&r<=40956)r-=33088;else if(r>=57408&&r<=60351)r-=49472;else throw new Error("Invalid SJIS character: "+this.data[e]+`
134
134
  Make sure your charset is UTF-8`);r=(r>>>8&255)*192+(r&255),t.put(r,13)}};var SC=Js,Jm={exports:{}};(function(t){var e={single_source_shortest_paths:function(r,n,i){var o={},c={};c[n]=0;var l=e.PriorityQueue.make();l.push(n,0);for(var f,h,v,y,b,x,P,M,H;!l.empty();){f=l.pop(),h=f.value,y=f.cost,b=r[h]||{};for(v in b)b.hasOwnProperty(v)&&(x=b[v],P=y+x,M=c[v],H=typeof c[v]>"u",(H||M>P)&&(c[v]=P,l.push(v,P),o[v]=h))}if(typeof i<"u"&&typeof c[i]>"u"){var V=["Could not find a path from ",n," to ",i,"."].join("");throw new Error(V)}return o},extract_shortest_path_from_predecessor_list:function(r,n){for(var i=[],o=n;o;)i.push(o),r[o],o=r[o];return i.reverse(),i},find_path:function(r,n,i){var o=e.single_source_shortest_paths(r,n,i);return e.extract_shortest_path_from_predecessor_list(o,i)},PriorityQueue:{make:function(r){var n=e.PriorityQueue,i={},o;r=r||{};for(o in n)n.hasOwnProperty(o)&&(i[o]=n[o]);return i.queue=[],i.sorter=r.sorter||n.default_sorter,i},default_sorter:function(r,n){return r.cost-n.cost},push:function(r,n){var i={value:r,cost:n};this.queue.push(i),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return this.queue.length===0}}};t.exports=e})(Jm),function(t){const e=Si,r=wC,n=yC,i=xC,o=SC,c=Fn,l=tn,f=Jm.exports;function h(V){return unescape(encodeURIComponent(V)).length}function v(V,T,L){const $=[];let R;for(;(R=V.exec(L))!==null;)$.push({data:R[0],index:R.index,mode:T,length:R[0].length});return $}function y(V){const T=v(c.NUMERIC,e.NUMERIC,V),L=v(c.ALPHANUMERIC,e.ALPHANUMERIC,V);let $,R;return l.isKanjiModeEnabled()?($=v(c.BYTE,e.BYTE,V),R=v(c.KANJI,e.KANJI,V)):($=v(c.BYTE_KANJI,e.BYTE,V),R=[]),T.concat(L,$,R).sort(function(d,C){return d.index-C.index}).map(function(d){return{data:d.data,mode:d.mode,length:d.length}})}function b(V,T){switch(T){case e.NUMERIC:return r.getBitsLength(V);case e.ALPHANUMERIC:return n.getBitsLength(V);case e.KANJI:return o.getBitsLength(V);case e.BYTE:return i.getBitsLength(V)}}function x(V){return V.reduce(function(T,L){const $=T.length-1>=0?T[T.length-1]:null;return $&&$.mode===L.mode?(T[T.length-1].data+=L.data,T):(T.push(L),T)},[])}function P(V){const T=[];for(let L=0;L<V.length;L++){const $=V[L];switch($.mode){case e.NUMERIC:T.push([$,{data:$.data,mode:e.ALPHANUMERIC,length:$.length},{data:$.data,mode:e.BYTE,length:$.length}]);break;case e.ALPHANUMERIC:T.push([$,{data:$.data,mode:e.BYTE,length:$.length}]);break;case e.KANJI:T.push([$,{data:$.data,mode:e.BYTE,length:h($.data)}]);break;case e.BYTE:T.push([{data:$.data,mode:e.BYTE,length:h($.data)}])}}return T}function M(V,T){const L={},$={start:{}};let R=["start"];for(let S=0;S<V.length;S++){const d=V[S],C=[];for(let J=0;J<d.length;J++){const z=d[J],ee=""+S+J;C.push(ee),L[ee]={node:z,lastCount:0},$[ee]={};for(let de=0;de<R.length;de++){const me=R[de];L[me]&&L[me].node.mode===z.mode?($[me][ee]=b(L[me].lastCount+z.length,z.mode)-b(L[me].lastCount,z.mode),L[me].lastCount+=z.length):(L[me]&&(L[me].lastCount=z.length),$[me][ee]=b(z.length,z.mode)+4+e.getCharCountIndicator(z.mode,T))}}R=C}for(let S=0;S<R.length;S++)$[R[S]].end=0;return{map:$,table:L}}function H(V,T){let L;const $=e.getBestModeForData(V);if(L=e.from(T,$),L!==e.BYTE&&L.bit<$.bit)throw new Error('"'+V+'" cannot be encoded with mode '+e.toString(L)+`.
135
135
  Suggested mode is: `+e.toString($));switch(L===e.KANJI&&!l.isKanjiModeEnabled()&&(L=e.BYTE),L){case e.NUMERIC:return new r(V);case e.ALPHANUMERIC:return new n(V);case e.KANJI:return new o(V);case e.BYTE:return new i(V)}}t.fromArray=function(T){return T.reduce(function(L,$){return typeof $=="string"?L.push(H($,null)):$.data&&L.push(H($.data,$.mode)),L},[])},t.fromString=function(T,L){const $=y(T,l.isKanjiModeEnabled()),R=P($),S=M(R,L),d=f.find_path(S.map,"start","end"),C=[];for(let J=1;J<d.length-1;J++)C.push(S.table[d[J]].node);return t.fromArray(x(C))},t.rawSplit=function(T){return t.fromArray(y(T,l.isKanjiModeEnabled()))}}(Ym);const zc=tn,ff=Uc,OC=oC,AC=aC,DC=Fm,$C=Bm,df=Hm,pf=jc,PC=lC,Wc=qm,TC=Km,RC=Si,gf=Ym;function NC(t,e){const r=t.size,n=$C.getPositions(e);for(let i=0;i<n.length;i++){const o=n[i][0],c=n[i][1];for(let l=-1;l<=7;l++)if(!(o+l<=-1||r<=o+l))for(let f=-1;f<=7;f++)c+f<=-1||r<=c+f||(l>=0&&l<=6&&(f===0||f===6)||f>=0&&f<=6&&(l===0||l===6)||l>=2&&l<=4&&f>=2&&f<=4?t.set(o+l,c+f,!0,!0):t.set(o+l,c+f,!1,!0))}}function LC(t){const e=t.size;for(let r=8;r<e-8;r++){const n=r%2===0;t.set(r,6,n,!0),t.set(6,r,n,!0)}}function MC(t,e){const r=DC.getPositions(e);for(let n=0;n<r.length;n++){const i=r[n][0],o=r[n][1];for(let c=-2;c<=2;c++)for(let l=-2;l<=2;l++)c===-2||c===2||l===-2||l===2||c===0&&l===0?t.set(i+c,o+l,!0,!0):t.set(i+c,o+l,!1,!0)}}function UC(t,e){const r=t.size,n=Wc.getEncodedBits(e);let i,o,c;for(let l=0;l<18;l++)i=Math.floor(l/3),o=l%3+r-8-3,c=(n>>l&1)===1,t.set(i,o,c,!0),t.set(o,i,c,!0)}function mf(t,e,r){const n=t.size,i=TC.getEncodedBits(e,r);let o,c;for(o=0;o<15;o++)c=(i>>o&1)===1,o<6?t.set(o,8,c,!0):o<8?t.set(o+1,8,c,!0):t.set(n-15+o,8,c,!0),o<8?t.set(8,n-o-1,c,!0):o<9?t.set(8,15-o-1+1,c,!0):t.set(8,15-o-1,c,!0);t.set(n-8,8,1,!0)}function jC(t,e){const r=t.size;let n=-1,i=r-1,o=7,c=0;for(let l=r-1;l>0;l-=2)for(l===6&&l--;;){for(let f=0;f<2;f++)if(!t.isReserved(i,l-f)){let h=!1;c<e.length&&(h=(e[c]>>>o&1)===1),t.set(i,l-f,h),o--,o===-1&&(c++,o=7)}if(i+=n,i<0||r<=i){i-=n,n=-n;break}}}function FC(t,e,r){const n=new OC;r.forEach(function(f){n.put(f.mode.bit,4),n.put(f.getLength(),RC.getCharCountIndicator(f.mode,t)),f.write(n)});const i=zc.getSymbolTotalCodewords(t),o=pf.getTotalCodewordsCount(t,e),c=(i-o)*8;for(n.getLengthInBits()+4<=c&&n.put(0,4);n.getLengthInBits()%8!==0;)n.putBit(0);const l=(c-n.getLengthInBits())/8;for(let f=0;f<l;f++)n.put(f%2?17:236,8);return BC(n,t,e)}function BC(t,e,r){const n=zc.getSymbolTotalCodewords(e),i=pf.getTotalCodewordsCount(e,r),o=n-i,c=pf.getBlocksCount(e,r),l=n%c,f=c-l,h=Math.floor(n/c),v=Math.floor(o/c),y=v+1,b=h-v,x=new PC(b);let P=0;const M=new Array(c),H=new Array(c);let V=0;const T=new Uint8Array(t.buffer);for(let d=0;d<c;d++){const C=d<f?v:y;M[d]=T.slice(P,P+C),H[d]=x.encode(M[d]),P+=C,V=Math.max(V,C)}const L=new Uint8Array(n);let $=0,R,S;for(R=0;R<V;R++)for(S=0;S<c;S++)R<M[S].length&&(L[$++]=M[S][R]);for(R=0;R<b;R++)for(S=0;S<c;S++)L[$++]=H[S][R];return L}function kC(t,e,r,n){let i;if(Array.isArray(t))i=gf.fromArray(t);else if(typeof t=="string"){let h=e;if(!h){const v=gf.rawSplit(t);h=Wc.getBestVersionForData(v,r)}i=gf.fromString(t,h||40)}else throw new Error("Invalid data");const o=Wc.getBestVersionForData(i,r);if(!o)throw new Error("The amount of data is too big to be stored in a QR Code");if(!e)e=o;else if(e<o)throw new Error(`