9 lines
64 KiB
JavaScript
9 lines
64 KiB
JavaScript
|
|
import"./chunks/modulepreload-polyfill-B5Qt9EMX.js";import{c as Yt}from"./chunks/core-CvwXoH-U.js";function yn(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var de={},De,Ct;function Cn(){return Ct||(Ct=1,De=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then}),De}var Ue={},ee={},Et;function se(){if(Et)return ee;Et=1;let e;const t=[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];return ee.getSymbolSize=function(o){if(!o)throw new Error('"version" cannot be null or undefined');if(o<1||o>40)throw new Error('"version" should be in range from 1 to 40');return o*4+17},ee.getSymbolTotalCodewords=function(o){return t[o]},ee.getBCHDigit=function(n){let o=0;for(;n!==0;)o++,n>>>=1;return o},ee.setToSJISFunction=function(o){if(typeof o!="function")throw new Error('"toSJISFunc" is not a valid function.');e=o},ee.isKanjiModeEnabled=function(){return typeof e<"u"},ee.toSJIS=function(o){return e(o)},ee}var Fe={},bt;function lt(){return bt||(bt=1,(function(e){e.L={bit:1},e.M={bit:0},e.Q={bit:3},e.H={bit:2};function t(n){if(typeof n!="string")throw new Error("Param is not a string");switch(n.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: "+n)}}e.isValid=function(o){return o&&typeof o.bit<"u"&&o.bit>=0&&o.bit<4},e.from=function(o,r){if(e.isValid(o))return o;try{return t(o)}catch{return r}}})(Fe)),Fe}var qe,kt;function En(){if(kt)return qe;kt=1;function e(){this.buffer=[],this.length=0}return e.prototype={get:function(t){const n=Math.floor(t/8);return(this.buffer[n]>>>7-t%8&1)===1},put:function(t,n){for(let o=0;o<n;o++)this.putBit((t>>>n-o-1&1)===1)},getLengthInBits:function(){return this.length},putBit:function(t){const n=Math.floor(this.length/8);this.buffer.length<=n&&this.buffer.push(0),t&&(this.buffer[n]|=128>>>this.length%8),this.length++}},qe=e,qe}var Ve,At;function bn(){if(At)return Ve;At=1;function e(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)}return e.prototype.set=function(t,n,o,r){const i=t*this.size+n;this.data[i]=o,r&&(this.reservedBit[i]=!0)},e.prototype.get=function(t,n){return this.data[t*this.size+n]},e.prototype.xor=function(t,n,o){this.data[t*this.size+n]^=o},e.prototype.isReserved=function(t,n){return this.reservedBit[t*this.size+n]},Ve=e,Ve}var Ke={},Lt;function kn(){return Lt||(Lt=1,(function(e){const t=se().getSymbolSize;e.getRowColCoords=function(o){if(o===1)return[];const r=Math.floor(o/7)+2,i=t(o),a=i===145?26:Math.ceil((i-13)/(2*r-2))*2,l=[i-7];for(let c=1;c<r-1;c++)l[c]=l[c-1]-a;return l.push(6),l.reverse()},e.getPositions=function(o){const r=[],i=e.getRowColCoords(o),a=i.length;for(let l=0;l<a;l++)for(let c=0;c<a;c++)l===0&&c===0||l===0&&c===a-1||l===a-1&&c===0||r.push([i[l],i[c]]);return r}})(Ke)),Ke}var je={},St;function An(){if(St)return je;St=1;const e=se().getSymbolSize,t=7;return je.getPositions=function(o){const r=e(o);return[[0,0],[r-t,0],[0,r-t]]},je}var ze={},Nt;function Ln(){return Nt||(Nt=1,(function(e){e.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};const t={N1:3,N2:3,N3:40,N4:10};e.isValid=function(r){return r!=null&&r!==""&&!isNaN(r)&&r>=0&&r<=7},e.from=function(r){return e.isValid(r)?parseInt(r,10):void 0},e.getPenaltyN1=function(r){const i=r.size;let a=0,l=0,c=0,d=null,u=null;for(let f=0;f<i;f++){l=c=0,d=u=null;for(let p=0;p<i;p++){let m=r.get(f,p);m===d?l++:(l>=5&&(a+=t.N1+(l-5)),d=m,l=1),m=r.get(p,f),m===u?c++:(c>=5&&(a+=t.N1+(c-5)),u=m,c=1)}l>=5&&(a+=t.N1+(l-5)),c>=5&&(a+=t.N1+(c-5))}return a},e.getPenaltyN2=function(r){const i=r.size;let a=0;for(let l=0;l<i-1;l++)for(let c=0;c<i-1;c++){const d=r.get(l,c)+r.get(l,c+1)+r.get(l+1,c)+r.get(l+1,c+1);(d===4||d===0)&&a++}
|
||
|
|
]))+`;z.KANJI=new RegExp(n,"g"),z.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g"),z.BYTE=new RegExp(o,"g"),z.NUMERIC=new RegExp(e,"g"),z.ALPHANUMERIC=new RegExp(t,"g");const r=new RegExp("^"+n+"$"),i=new RegExp("^"+e+"$"),a=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");return z.testKanji=function(c){return r.test(c)},z.testNumeric=function(c){return i.test(c)},z.testAlphanumeric=function(c){return a.test(c)},z}var Pt;function ce(){return Pt||(Pt=1,(function(e){const t=Qt(),n=Zt();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(i,a){if(!i.ccBits)throw new Error("Invalid mode: "+i);if(!t.isValid(a))throw new Error("Invalid version: "+a);return a>=1&&a<10?i.ccBits[0]:a<27?i.ccBits[1]:i.ccBits[2]},e.getBestModeForData=function(i){return n.testNumeric(i)?e.NUMERIC:n.testAlphanumeric(i)?e.ALPHANUMERIC:n.testKanji(i)?e.KANJI:e.BYTE},e.toString=function(i){if(i&&i.id)return i.id;throw new Error("Invalid mode")},e.isValid=function(i){return i&&i.bit&&i.ccBits};function o(r){if(typeof r!="string")throw new Error("Param is not a string");switch(r.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: "+r)}}e.from=function(i,a){if(e.isValid(i))return i;try{return o(i)}catch{return a}}})(He)),He}var Mt;function _n(){return Mt||(Mt=1,(function(e){const t=se(),n=Gt(),o=lt(),r=ce(),i=Qt(),a=7973,l=t.getBCHDigit(a);function c(p,m,g){for(let v=1;v<=40;v++)if(m<=e.getCapacity(v,g,p))return v}function d(p,m){return r.getCharCountIndicator(p,m)+4}function u(p,m){let g=0;return p.forEach(function(v){const R=d(v.mode,m);g+=R+v.getBitsLength()}),g}function f(p,m){for(let g=1;g<=40;g++)if(u(p,g)<=e.getCapacity(g,m,r.MIXED))return g}e.from=function(m,g){return i.isValid(m)?parseInt(m,10):g},e.getCapacity=function(m,g,v){if(!i.isValid(m))throw new Error("Invalid QR Code version");typeof v>"u"&&(v=r.BYTE);const R=t.getSymbolTotalCodewords(m),C=n.getTotalCodewordsCount(m,g),_=(R-C)*8;if(v===r.MIXED)return _;const E=_-d(v,m);switch(v){case r.NUMERIC:return Math.floor(E/10*3);case r.ALPHANUMERIC:return Math.floor(E/11*2);case r.KANJI:return Math.floor(E/13);case r.BYTE:default:return Math.floor(E/8)}},e.getBestVersionForData=function(m,g){let v;const R=o.from(g,o.M);if(Array.isArray(m)){if(m.length>1)return f(m,R);if(m.length===0)return 1;v=m[0]}else v=m;return c(v.mode,v.getLength(),R)},e.getEncodedBits=function(m){if(!i.isValid(m)||m<7)throw new Error("Invalid QR Code version");let g=m<<12;for(;t.getBCHDigit(g)-l>=0;)g^=a<<t.getBCHDigit(g)-l;return m<<12|g}})(Je)),Je}var Ge={},$t;function Bn(){if($t)return Ge;$t=1;const e=se(),t=1335,n=21522,o=e.getBCHDigit(t);return Ge.getEncodedBits=function(i,a){const l=i.bit<<3|a;let c=l<<10;for(;e.getBCHDigit(c)-o>=0;)c^=t<<e.getBCHDigit(c)-o;return(l<<10|c)^n},Ge}var Qe={},Ze,Dt;function xn(){if(Dt)return Ze;Dt=1;const e=ce();function t(n){this.mode=e.NUMERIC,this.data=n.toString()}return t.getBitsLength=function(o){return 10*Math.floor(o/3)+(o%3?o%3*3+1:0)},t.prototype.getLength=function(){return this.data.length},t.prototype.getBitsLength=function(){return t.getBitsLength(this.data.length)},t.prototype.write=function(o){let r,i,a;for(r=0;r+3<=this.data.length;r+=3)i=this.data.substr(r,3),a=parseInt(i,10),o.put(a,10);const l=this.data.length-r;l>0&&(i=this.data.substr(r),a=parseInt(i,10),o.put(a,l*3+1))},Ze=t,Ze}var Xe,Ut;function Rn(){if(Ut)return Xe;Ut=1;const e=ce(),t=["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 n(o){this.mode=e.ALPHANUMERIC,this.data=o}return n.getBitsLength=function(r){return 11*Math.floor(r/2)+6*(r%2)},n.prototype.getLength=function(){return this.data.length},n.prototype.getBitsLength=function(){return n.getBitsLength(this.data.length)}
|
||
|
|
Make sure your charset is UTF-8`);i=(i>>>8&255)*192+(i&255),o.put(i,13)}},tt=n,tt}var nt={exports:{}},Vt;function Mn(){return Vt||(Vt=1,(function(e){var t={single_source_shortest_paths:function(n,o,r){var i={},a={};a[o]=0;var l=t.PriorityQueue.make();l.push(o,0);for(var c,d,u,f,p,m,g,v,R;!l.empty();){c=l.pop(),d=c.value,f=c.cost,p=n[d]||{};for(u in p)p.hasOwnProperty(u)&&(m=p[u],g=f+m,v=a[u],R=typeof a[u]>"u",(R||v>g)&&(a[u]=g,l.push(u,g),i[u]=d))}if(typeof r<"u"&&typeof a[r]>"u"){var C=["Could not find a path from ",o," to ",r,"."].join("");throw new Error(C)}return i},extract_shortest_path_from_predecessor_list:function(n,o){for(var r=[],i=o;i;)r.push(i),n[i],i=n[i];return r.reverse(),r},find_path:function(n,o,r){var i=t.single_source_shortest_paths(n,o,r);return t.extract_shortest_path_from_predecessor_list(i,r)},PriorityQueue:{make:function(n){var o=t.PriorityQueue,r={},i;n=n||{};for(i in o)o.hasOwnProperty(i)&&(r[i]=o[i]);return r.queue=[],r.sorter=n.sorter||o.default_sorter,r},default_sorter:function(n,o){return n.cost-o.cost},push:function(n,o){var r={value:n,cost:o};this.queue.push(r),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return this.queue.length===0}}};e.exports=t})(nt)),nt.exports}var Kt;function $n(){return Kt||(Kt=1,(function(e){const t=ce(),n=xn(),o=Rn(),r=In(),i=Pn(),a=Zt(),l=se(),c=Mn();function d(C){return unescape(encodeURIComponent(C)).length}function u(C,_,E){const N=[];let D;for(;(D=C.exec(E))!==null;)N.push({data:D[0],index:D.index,mode:_,length:D[0].length});return N}function f(C){const _=u(a.NUMERIC,t.NUMERIC,C),E=u(a.ALPHANUMERIC,t.ALPHANUMERIC,C);let N,D;return l.isKanjiModeEnabled()?(N=u(a.BYTE,t.BYTE,C),D=u(a.KANJI,t.KANJI,C)):(N=u(a.BYTE_KANJI,t.BYTE,C),D=[]),_.concat(E,N,D).sort(function(L,A){return L.index-A.index}).map(function(L){return{data:L.data,mode:L.mode,length:L.length}})}function p(C,_){switch(_){case t.NUMERIC:return n.getBitsLength(C);case t.ALPHANUMERIC:return o.getBitsLength(C);case t.KANJI:return i.getBitsLength(C);case t.BYTE:return r.getBitsLength(C)}}function m(C){return C.reduce(function(_,E){const N=_.length-1>=0?_[_.length-1]:null;return N&&N.mode===E.mode?(_[_.length-1].data+=E.data,_):(_.push(E),_)},[])}function g(C){const _=[];for(let E=0;E<C.length;E++){const N=C[E];switch(N.mode){case t.NUMERIC:_.push([N,{data:N.data,mode:t.ALPHANUMERIC,length:N.length},{data:N.data,mode:t.BYTE,length:N.length}]);break;case t.ALPHANUMERIC:_.push([N,{data:N.data,mode:t.BYTE,length:N.length}]);break;case t.KANJI:_.push([N,{data:N.data,mode:t.BYTE,length:d(N.data)}]);break;case t.BYTE:_.push([{data:N.data,mode:t.BYTE,length:d(N.data)}])}}return _}function v(C,_){const E={},N={start:{}};let D=["start"];for(let y=0;y<C.length;y++){const L=C[y],A=[];for(let w=0;w<L.length;w++){const T=L[w],b=""+y+w;A.push(b),E[b]={node:T,lastCount:0},N[b]={};for(let S=0;S<D.length;S++){const k=D[S];E[k]&&E[k].node.mode===T.mode?(N[k][b]=p(E[k].lastCount+T.length,T.mode)-p(E[k].lastCount,T.mode),E[k].lastCount+=T.length):(E[k]&&(E[k].lastCount=T.length),N[k][b]=p(T.length,T.mode)+4+t.getCharCountIndicator(T.mode,_))}}D=A}for(let y=0;y<D.length;y++)N[D[y]].end=0;return{map:N,table:E}}function R(C,_){let E;const N=t.getBestModeForData(C);if(E=t.from(_,N),E!==t.BYTE&&E.bit<N.bit)throw new Error('"'+C+'" cannot be encoded with mode '+t.toString(E)+`.
|
||
|
|
Suggested mode is: `+t.toString(N));switch(E===t.KANJI&&!l.isKanjiModeEnabled()&&(E=t.BYTE),E){case t.NUMERIC:return new n(C);case t.ALPHANUMERIC:return new o(C);case t.KANJI:return new i(C);case t.BYTE:return new r(C)}}e.fromArray=function(_){return _.reduce(function(E,N){return typeof N=="string"?E.push(R(N,null)):N.data&&E.push(R(N.data,N.mode)),E},[])},e.fromString=function(_,E){const N=f(_,l.isKanjiModeEnabled()),D=g(N),y=v(D,E),L=c.find_path(y.map,"start","end"),A=[];for(let w=1;w<L.length-1;w++)A.push(y.table[L[w]].node);return e.fromArray(m(A))},e.rawSplit=function(_){return e.fromArray(f(_,l.isKanjiModeEnabled()))}})(Qe)),Qe}var jt;function Dn(){if(jt)return Ue;jt=1;const e=se(),t=lt(),n=En(),o=bn(),r=kn(),i=An(),a=Ln(),l=Gt(),c=Tn(),d=_n(),u=Bn(),f=ce(),p=$n();function m(y,L){const A=y.size,w=i.getPositions(L);for(let T=0;T<w.length;T++){const b=w[T][0],S=w[T][1];for(let k=-1;k<=7;k++)if(!(b+k<=-1||A<=b+k))for(let B=-1;B<=7;B++)S+B<=-1||A<=S+B||(k>=0&&k<=6&&(B===0||B===6)||B>=0&&B<=6&&(k===0||k===6)||k>=2&&k<=4&&B>=2&&B<=4?y.set(b+k,S+B,!0,!0):y.set(b+k,S+B,!1,!0))}}function g(y){const L=y.size;for(let A=8;A<L-8;A++){const w=A%2===0;y.set(A,6,w,!0),y.set(6,A,w,!0)}}function v(y,L){const A=r.getPositions(L);for(let w=0;w<A.length;w++){const T=A[w][0],b=A[w][1];for(let S=-2;S<=2;S++)for(let k=-2;k<=2;k++)S===-2||S===2||k===-2||k===2||S===0&&k===0?y.set(T+S,b+k,!0,!0):y.set(T+S,b+k,!1,!0)}}function R(y,L){const A=y.size,w=d.getEncodedBits(L);let T,b,S;for(let k=0;k<18;k++)T=Math.floor(k/3),b=k%3+A-8-3,S=(w>>k&1)===1,y.set(T,b,S,!0),y.set(b,T,S,!0)}function C(y,L,A){const w=y.size,T=u.getEncodedBits(L,A);let b,S;for(b=0;b<15;b++)S=(T>>b&1)===1,b<6?y.set(b,8,S,!0):b<8?y.set(b+1,8,S,!0):y.set(w-15+b,8,S,!0),b<8?y.set(8,w-b-1,S,!0):b<9?y.set(8,15-b-1+1,S,!0):y.set(8,15-b-1,S,!0);y.set(w-8,8,1,!0)}function _(y,L){const A=y.size;let w=-1,T=A-1,b=7,S=0;for(let k=A-1;k>0;k-=2)for(k===6&&k--;;){for(let B=0;B<2;B++)if(!y.isReserved(T,k-B)){let X=!1;S<L.length&&(X=(L[S]>>>b&1)===1),y.set(T,k-B,X),b--,b===-1&&(S++,b=7)}if(T+=w,T<0||A<=T){T-=w,w=-w;break}}}function E(y,L,A){const w=new n;A.forEach(function(B){w.put(B.mode.bit,4),w.put(B.getLength(),f.getCharCountIndicator(B.mode,y)),B.write(w)});const T=e.getSymbolTotalCodewords(y),b=l.getTotalCodewordsCount(y,L),S=(T-b)*8;for(w.getLengthInBits()+4<=S&&w.put(0,4);w.getLengthInBits()%8!==0;)w.putBit(0);const k=(S-w.getLengthInBits())/8;for(let B=0;B<k;B++)w.put(B%2?17:236,8);return N(w,y,L)}function N(y,L,A){const w=e.getSymbolTotalCodewords(L),T=l.getTotalCodewordsCount(L,A),b=w-T,S=l.getBlocksCount(L,A),k=w%S,B=S-k,X=Math.floor(w/S),me=Math.floor(b/S),hn=me+1,vt=X-me,vn=new c(vt);let Ie=0;const ke=new Array(S),wt=new Array(S);let Pe=0;const wn=new Uint8Array(y.buffer);for(let le=0;le<S;le++){const $e=le<B?me:hn;ke[le]=wn.slice(Ie,Ie+$e),wt[le]=vn.encode(ke[le]),Ie+=$e,Pe=Math.max(Pe,$e)}const Me=new Uint8Array(w);let yt=0,O,W;for(O=0;O<Pe;O++)for(W=0;W<S;W++)O<ke[W].length&&(Me[yt++]=ke[W][O]);for(O=0;O<vt;O++)for(W=0;W<S;W++)Me[yt++]=wt[W][O];return Me}function D(y,L,A,w){let T;if(Array.isArray(y))T=p.fromArray(y);else if(typeof y=="string"){let X=L;if(!X){const me=p.rawSplit(y);X=d.getBestVersionForData(me,A)}T=p.fromString(y,X||40)}else throw new Error("Invalid data");const b=d.getBestVersionForData(T,A);if(!b)throw new Error("The amount of data is too big to be stored in a QR Code");if(!L)L=b;else if(L<b)throw new Error(`
|
||
|
|
The chosen QR Code version cannot contain this amount of data.
|
||
|
|
Minimum version required to store current data is: `+b+`.
|
||
|
|
`);const S=E(L,A,T),k=e.getSymbolSize(L),B=new o(k);return m(B,L),g(B),v(B,L),C(B,A,0),L>=7&&R(B,L),_(B,S),isNaN(w)&&(w=a.getBestMask(B,C.bind(null,B,A))),a.applyMask(w,B),C(B,A,w),{modules:B,version:L,errorCorrectionLevel:A,maskPattern:w,segments:T}}return Ue.create=function(L,A){if(typeof L>"u"||L==="")throw new Error("No input text");let w=t.M,T,b;return typeof A<"u"&&(w=t.from(A.errorCorrectionLevel,t.M),T=d.from(A.version),b=a.from(A.maskPattern),A.toSJISFunc&&e.setToSJISFunction(A.toSJISFunc)),D(L,T,w,b)},Ue}var rt={},ot={},zt;function Xt(){return zt||(zt=1,(function(e){function t(n){if(typeof n=="number"&&(n=n.toString()),typeof n!="string")throw new Error("Color should be defined as hex string");let o=n.slice().replace("#","").split("");if(o.length<3||o.length===5||o.length>8)throw new Error("Invalid hex color: "+n);(o.length===3||o.length===4)&&(o=Array.prototype.concat.apply([],o.map(function(i){return[i,i]}))),o.length===6&&o.push("F","F");const r=parseInt(o.join(""),16);return{r:r>>24&255,g:r>>16&255,b:r>>8&255,a:r&255,hex:"#"+o.slice(0,6).join("")}}e.getOptions=function(o){o||(o={}),o.color||(o.color={});const r=typeof o.margin>"u"||o.margin===null||o.margin<0?4:o.margin,i=o.width&&o.width>=21?o.width:void 0,a=o.scale||4;return{width:i,scale:i?4:a,margin:r,color:{dark:t(o.color.dark||"#000000ff"),light:t(o.color.light||"#ffffffff")},type:o.type,rendererOpts:o.rendererOpts||{}}},e.getScale=function(o,r){return r.width&&r.width>=o+r.margin*2?r.width/(o+r.margin*2):r.scale},e.getImageWidth=function(o,r){const i=e.getScale(o,r);return Math.floor((o+r.margin*2)*i)},e.qrToImageData=function(o,r,i){const a=r.modules.size,l=r.modules.data,c=e.getScale(a,i),d=Math.floor((a+i.margin*2)*c),u=i.margin*c,f=[i.color.light,i.color.dark];for(let p=0;p<d;p++)for(let m=0;m<d;m++){let g=(p*d+m)*4,v=i.color.light;if(p>=u&&m>=u&&p<d-u&&m<d-u){const R=Math.floor((p-u)/c),C=Math.floor((m-u)/c);v=f[l[R*a+C]?1:0]}o[g++]=v.r,o[g++]=v.g,o[g++]=v.b,o[g]=v.a}}})(ot)),ot}var Ot;function Un(){return Ot||(Ot=1,(function(e){const t=Xt();function n(r,i,a){r.clearRect(0,0,i.width,i.height),i.style||(i.style={}),i.height=a,i.width=a,i.style.height=a+"px",i.style.width=a+"px"}function o(){try{return document.createElement("canvas")}catch{throw new Error("You need to specify a canvas element")}}e.render=function(i,a,l){let c=l,d=a;typeof c>"u"&&(!a||!a.getContext)&&(c=a,a=void 0),a||(d=o()),c=t.getOptions(c);const u=t.getImageWidth(i.modules.size,c),f=d.getContext("2d"),p=f.createImageData(u,u);return t.qrToImageData(p.data,i,c),n(f,d,u),f.putImageData(p,0,0),d},e.renderToDataURL=function(i,a,l){let c=l;typeof c>"u"&&(!a||!a.getContext)&&(c=a,a=void 0),c||(c={});const d=e.render(i,a,c),u=c.type||"image/png",f=c.rendererOpts||{};return d.toDataURL(u,f.quality)}})(rt)),rt}var it={},Wt;function Fn(){if(Wt)return it;Wt=1;const e=Xt();function t(r,i){const a=r.a/255,l=i+'="'+r.hex+'"';return a<1?l+" "+i+'-opacity="'+a.toFixed(2).slice(1)+'"':l}function n(r,i,a){let l=r+i;return typeof a<"u"&&(l+=" "+a),l}function o(r,i,a){let l="",c=0,d=!1,u=0;for(let f=0;f<r.length;f++){const p=Math.floor(f%i),m=Math.floor(f/i);!p&&!d&&(d=!0),r[f]?(u++,f>0&&p>0&&r[f-1]||(l+=d?n("M",p+a,.5+m+a):n("m",c,0),c=0,d=!1),p+1<i&&r[f+1]||(l+=n("h",u),u=0)):c++}return l}return it.render=function(i,a,l){const c=e.getOptions(a),d=i.modules.size,u=i.modules.data,f=d+c.margin*2,p=c.color.light.a?"<path "+t(c.color.light,"fill")+' d="M0 0h'+f+"v"+f+'H0z"/>':"",m="<path "+t(c.color.dark,"stroke")+' d="'+o(u,d,c.margin)+'"/>',g='viewBox="0 0 '+f+" "+f+'"',R='<svg xmlns="http://www.w3.org/2000/svg" '+(c.width?'width="'+c.width+'" height="'+c.width+'" ':"")+g+' shape-rendering="crispEdges">'+p+m+`</svg>
|
||
|
|
`;return typeof l=="function"&&l(null,R),R},it}var Jt;function qn(){if(Jt)return de;Jt=1;const e=Cn(),t=Dn(),n=Un(),o=Fn();function r(i,a,l,c,d){const u=[].slice.call(arguments,1),f=u.length,p=typeof u[f-1]=="function";if(!p&&!e())throw new Error("Callback required as last argument");if(p){if(f<2)throw new Error("Too few arguments provided");f===2?(d=l,l=a,a=c=void 0):f===3&&(a.getContext&&typeof d>"u"?(d=c,c=void 0):(d=c,c=l,l=a,a=void 0))}else{if(f<1)throw new Error("Too few arguments provided");return f===1?(l=a,a=c=void 0):f===2&&!a.getContext&&(c=l,l=a,a=void 0),new Promise(function(m,g){try{const v=t.create(l,c);m(i(v,a,c))}catch(v){g(v)}})}try{const m=t.create(l,c);d(null,i(m,a,c))}catch(m){d(m)}}return de.create=t.create,de.toCanvas=r.bind(null,n.render),de.toDataURL=r.bind(null,n.renderToDataURL),de.toString=r.bind(null,function(i,a,l){return o.render(i,l)}),de}var Vn=qn();const Kn=yn(Vn),s=e=>document.getElementById(e),jn=Array.from(document.querySelectorAll(".screen")),M=s("notice");let Ne="",fe="",ge="",ie="",h,dt,Te="held",K=1,ae=0;const ve=8;let x,J=[],Z,P,_e,en="activity",Y,we="",oe="";const he=20,zn={1:"Mining Reward",2:"Transfer",3:"Token Creation",4:"NFT/RWA Creation",5:"Marketing",6:"Swap",7:"Loan",8:"Loan Payment",9:"Collateral Claim",10:"Asset Burn",11:"Token Issuance",12:"Vanity Address",100:"Storage Key",101:"Data Storage Bool",102:"Data Storage U8",103:"Data Storage U16",104:"Data Storage U32",105:"Data Storage U64",106:"Data Storage U128",107:"Data Storage String",108:"Data Storage I8",109:"Data Storage I16",110:"Data Storage I32",111:"Data Storage I64",112:"Data Storage I128",113:"Delete Stored Data",200:"Proposal",201:"Proposal Vote",202:"Activation Vote"};async function $(e,t={}){const n=await chrome.runtime.sendMessage({type:e,...t});if(!(n!=null&&n.ok))throw new Error((n==null?void 0:n.error)??"Wallet request failed.");return n.result}function I(e,t=!0){jn.forEach(n=>{n.hidden=n.id!==e}),t&&(M.textContent="")}function V(e){var i;h=e;const t=e.address??((i=e.wallets.find(a=>a.active))==null?void 0:i.address),n=(t==null?void 0:t.endsWith(".cltc"))??!0,o=n?"Testnet":"Mainnet",r=n?"CLTC":"CLC";document.querySelectorAll("[data-network-name]").forEach(a=>{a.textContent=o}),document.querySelectorAll("[data-network-symbol]").forEach(a=>{a.textContent=r}),s("base-asset-name").textContent=`Contractless ${o}`,s("wallet-address").textContent=e.address??"",s("wallet-address-short").textContent=e.address?`${e.address.slice(0,6)}...${e.address.slice(-6)}`:"Account",s("settings-api-url").value=e.apiUrl,s("settings-lock-timeout").value=String(e.autoLockMinutes),Zn(e),e.exists?e.unlocked?at().then(a=>{a||(I("dashboard-screen"),Be())}):I("locked-screen"):I("create-screen")}function On(e,t){return e==="contractless_connect"?"Connect application":e==="contractless_signMessage"?"Sign text message":e==="contractless_sendTransaction"||e==="contractless_signDualTransaction"?`Sign ${String(t.transaction_type??"transaction")}`:"Review request"}function j(e,t,n){const o=document.createElement("dt");o.textContent=t.replaceAll("_"," ");const r=document.createElement("dd");r.textContent=typeof n=="object"?JSON.stringify(n,null,2):String(n),e.append(o,r)}function te(e,t,n,o){const r=re(e[t]),i=String(e[n]??"").trim().toUpperCase(),a=Number(e[o]??0);return`${r} ${i}${a>0?` #${a}`:""}`}function Ht(e,t,n){var i;const o=n===1?2:1,r=(i=h==null?void 0:h.address)!=null&&i.endsWith(".cltc")?"CLTC":"CLC";j(e,"Your miner tip",te(t,`tip${n}`,`ticker${n}`,`nft_series${n}`)),j(e,"Your transaction fee",`${re(t[`txfee${n}`])} ${r}`),j(e,"Other party miner tip",te(t,`tip${o}`,`ticker${o}`,`nft_series${o}`)),j(e,"Other party transaction fee",`${re(t[`txfee${o}`])} ${r}`)}function Wn(e,t){var a;const n=((a=h==null?void 0:h.address)==null?void 0:a.trim().toLowerCase())??"",o=String(t.sender1??"").trim().toLowerCase(),r=String(t.sender2??"").trim().toLowerCase(),i=n===o?1:n===r?2:0;if(i===1){j(e,"Sending",te(t,"value1","ticker1","nft_series1")),j(e,"Receiving",te(t,"value2","ticker2","nft_series2")),Ht(e,t,1);return}if(i===2){j(e,"Sending",t
|